@human-protocol/sdk 3.0.8 → 4.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 (55) hide show
  1. package/dist/constants.d.ts +1 -1
  2. package/dist/constants.d.ts.map +1 -1
  3. package/dist/constants.js +2 -2
  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/error.d.ts +31 -28
  9. package/dist/error.d.ts.map +1 -1
  10. package/dist/error.js +36 -33
  11. package/dist/escrow.d.ts +102 -59
  12. package/dist/escrow.d.ts.map +1 -1
  13. package/dist/escrow.js +186 -98
  14. package/dist/graphql/queries/operator.d.ts.map +1 -1
  15. package/dist/graphql/queries/operator.js +13 -5
  16. package/dist/interfaces.d.ts +10 -2
  17. package/dist/interfaces.d.ts.map +1 -1
  18. package/dist/kvstore.d.ts +15 -15
  19. package/dist/kvstore.d.ts.map +1 -1
  20. package/dist/kvstore.js +15 -15
  21. package/dist/operator.d.ts +11 -10
  22. package/dist/operator.d.ts.map +1 -1
  23. package/dist/operator.js +23 -11
  24. package/dist/staking.d.ts +38 -21
  25. package/dist/staking.d.ts.map +1 -1
  26. package/dist/staking.js +62 -21
  27. package/dist/statistics.d.ts +10 -29
  28. package/dist/statistics.d.ts.map +1 -1
  29. package/dist/statistics.js +10 -29
  30. package/dist/storage.d.ts +13 -18
  31. package/dist/storage.d.ts.map +1 -1
  32. package/dist/storage.js +13 -18
  33. package/dist/transaction.js +1 -1
  34. package/dist/types.d.ts +6 -2
  35. package/dist/types.d.ts.map +1 -1
  36. package/dist/types.js +1 -1
  37. package/dist/utils.d.ts +0 -1
  38. package/dist/utils.d.ts.map +1 -1
  39. package/dist/utils.js +0 -1
  40. package/package.json +1 -1
  41. package/src/constants.ts +2 -2
  42. package/src/decorators.ts +1 -1
  43. package/src/encryption.ts +21 -29
  44. package/src/error.ts +39 -37
  45. package/src/escrow.ts +245 -117
  46. package/src/graphql/queries/operator.ts +13 -5
  47. package/src/interfaces.ts +11 -2
  48. package/src/kvstore.ts +16 -16
  49. package/src/operator.ts +26 -12
  50. package/src/staking.ts +71 -22
  51. package/src/statistics.ts +10 -29
  52. package/src/storage.ts +13 -18
  53. package/src/transaction.ts +2 -2
  54. package/src/types.ts +6 -2
  55. package/src/utils.ts +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"escrow.d.ts","sourceRoot":"","sources":["../src/escrow.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,cAAc,EAAY,SAAS,EAAU,MAAM,QAAQ,CAAC;AAErE,OAAO,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAG1C,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAyBlD,OAAO,EACL,UAAU,EAIV,WAAW,EACZ,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,WAAW,EACZ,MAAM,SAAS,CAAC;AAGjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoEG;AACH,qBAAa,YAAa,SAAQ,gBAAgB;IAChD,OAAO,CAAC,qBAAqB,CAAgB;IAE7C;;;;;OAKG;gBACS,MAAM,EAAE,cAAc,EAAE,WAAW,EAAE,WAAW;IAS5D;;;;;;;;OAQG;WACiB,KAAK,CAAC,MAAM,EAAE,cAAc;IAiBhD;;;;OAIG;IACH,OAAO,CAAC,iBAAiB;IAQzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;IAEU,YAAY,CACvB,YAAY,EAAE,MAAM,EACpB,eAAe,EAAE,MAAM,EAAE,EACzB,cAAc,EAAE,MAAM,EACtB,SAAS,GAAE,SAAc,GACxB,OAAO,CAAC,MAAM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C,MAAM,CAAC;IAkBtE;;;;;;;;;;;;;;;;;;;OAmBG;IACG,iBAAiB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAiBhE;AACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,qBAAa,WAAW;IACtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAuGG;WACiB,UAAU,CAC5B,MAAM,EAAE,cAAc,GACrB,OAAO,CAAC,UAAU,EAAE,CAAC;IA2DxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgEG;WACiB,SAAS,CAC3B,OAAO,EAAE,OAAO,EAChB,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,UAAU,CAAC;IAoBtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAyEG;WAEiB,eAAe,CACjC,OAAO,EAAE,OAAO,EAChB,QAAQ,CAAC,EAAE,YAAY,EAAE,EACzB,IAAI,CAAC,EAAE,IAAI,EACX,EAAE,CAAC,EAAE,IAAI,EACT,QAAQ,CAAC,EAAE,MAAM,EACjB,KAAK,CAAC,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,MAAM,EACb,cAAc,CAAC,EAAE,cAAc,GAC9B,OAAO,CAAC,WAAW,EAAE,CAAC;CAuD1B"}
package/dist/escrow.js CHANGED
@@ -28,19 +28,19 @@ const utils_1 = require("./utils");
28
28
  /**
29
29
  * ## Introduction
30
30
  *
31
- * This client enables to perform actions on Escrow contracts and obtain information from both the contracts and subgraph.
31
+ * This client enables performing actions on Escrow contracts and obtaining information from both the contracts and subgraph.
32
32
  *
33
33
  * Internally, the SDK will use one network or another according to the network ID of the `runner`.
34
34
  * To use this client, it is recommended to initialize it using the static `build` method.
35
35
  *
36
36
  * ```ts
37
- * static async build(runner: ContractRunner);
37
+ * static async build(runner: ContractRunner): Promise<EscrowClient>;
38
38
  * ```
39
39
  *
40
40
  * A `Signer` or a `Provider` should be passed depending on the use case of this module:
41
41
  *
42
- * - **Signer**: when the user wants to use this model in order to send transactions caling the contract functions.
43
- * - **Provider**: when the user wants to use this model in order to get information from the contracts or subgraph.
42
+ * - **Signer**: when the user wants to use this model to send transactions calling the contract functions.
43
+ * - **Provider**: when the user wants to use this model to get information from the contracts or subgraph.
44
44
  *
45
45
  * ## Installation
46
46
  *
@@ -58,21 +58,21 @@ const utils_1 = require("./utils");
58
58
  *
59
59
  * ### Signer
60
60
  *
61
- * **Using private key(backend)**
61
+ * **Using private key (backend)**
62
62
  *
63
63
  * ```ts
64
64
  * import { EscrowClient } from '@human-protocol/sdk';
65
65
  * import { Wallet, providers } from 'ethers';
66
66
  *
67
67
  * const rpcUrl = 'YOUR_RPC_URL';
68
- * const privateKey = 'YOUR_PRIVATE_KEY'
68
+ * const privateKey = 'YOUR_PRIVATE_KEY';
69
69
  *
70
70
  * const provider = new providers.JsonRpcProvider(rpcUrl);
71
71
  * const signer = new Wallet(privateKey, provider);
72
72
  * const escrowClient = await EscrowClient.build(signer);
73
73
  * ```
74
74
  *
75
- * **Using Wagmi(frontend)**
75
+ * **Using Wagmi (frontend)**
76
76
  *
77
77
  * ```ts
78
78
  * import { useSigner, useChainId } from 'wagmi';
@@ -142,11 +142,11 @@ class EscrowClient extends base_1.BaseEthersClient {
142
142
  /**
143
143
  * This function creates an escrow contract that uses the token passed to pay oracle fees and reward workers.
144
144
  *
145
- * @param {string} tokenAddress Token address to use for pay outs.
145
+ * @param {string} tokenAddress Token address to use for payouts.
146
146
  * @param {string[]} trustedHandlers Array of addresses that can perform actions on the contract.
147
147
  * @param {string} jobRequesterId Job Requester Id
148
148
  * @param {Overrides} [txOptions] - Additional transaction parameters (optional, defaults to an empty object).
149
- * @returns {Promise<string>} Return the address of the escrow created.
149
+ * @returns {Promise<string>} Returns the address of the escrow created.
150
150
  *
151
151
  *
152
152
  * **Code example**
@@ -158,7 +158,7 @@ class EscrowClient extends base_1.BaseEthersClient {
158
158
  * import { EscrowClient } from '@human-protocol/sdk';
159
159
  *
160
160
  * const rpcUrl = 'YOUR_RPC_URL';
161
- * const privateKey = 'YOUR_PRIVATE_KEY'
161
+ * const privateKey = 'YOUR_PRIVATE_KEY';
162
162
  *
163
163
  * const provider = new providers.JsonRpcProvider(rpcUrl);
164
164
  * const signer = new Wallet(privateKey, provider);
@@ -209,7 +209,7 @@ class EscrowClient extends base_1.BaseEthersClient {
209
209
  * import { EscrowClient } from '@human-protocol/sdk';
210
210
  *
211
211
  * const rpcUrl = 'YOUR_RPC_URL';
212
- * const privateKey = 'YOUR_PRIVATE_KEY'
212
+ * const privateKey = 'YOUR_PRIVATE_KEY';
213
213
  *
214
214
  * const provider = new providers.JsonRpcProvider(rpcUrl);
215
215
  * const signer = new Wallet(privateKey, provider);
@@ -220,10 +220,10 @@ class EscrowClient extends base_1.BaseEthersClient {
220
220
  * recordingOracle: '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266',
221
221
  * reputationOracle: '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266',
222
222
  * exchangeOracle: '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266',
223
- * recordingOracleFee: bigint.from('10'),
224
- * reputationOracleFee: bigint.from('10'),
225
- * exchangeOracleFee: bigint.from('10'),
226
- * manifestUrl: 'htttp://localhost/manifest.json',
223
+ * recordingOracleFee: BigInt('10'),
224
+ * reputationOracleFee: BigInt('10'),
225
+ * exchangeOracleFee: BigInt('10'),
226
+ * manifestUrl: 'http://localhost/manifest.json',
227
227
  * manifestHash: 'b5dad76bf6772c0f07fd5e048f6e75a5f86ee079',
228
228
  * };
229
229
  * await escrowClient.setup(escrowAddress, escrowConfig);
@@ -288,7 +288,7 @@ class EscrowClient extends base_1.BaseEthersClient {
288
288
  * import { EscrowClient } from '@human-protocol/sdk';
289
289
  *
290
290
  * const rpcUrl = 'YOUR_RPC_URL';
291
- * const privateKey = 'YOUR_PRIVATE_KEY'
291
+ * const privateKey = 'YOUR_PRIVATE_KEY';
292
292
  *
293
293
  * const provider = new providers.JsonRpcProvider(rpcUrl);
294
294
  * const signer = new Wallet(privateKey, provider);
@@ -320,10 +320,10 @@ class EscrowClient extends base_1.BaseEthersClient {
320
320
  }
321
321
  }
322
322
  /**
323
- * This function stores the results url and hash.
323
+ * This function stores the results URL and hash.
324
324
  *
325
325
  * @param {string} escrowAddress Address of the escrow.
326
- * @param {string} url Results file url.
326
+ * @param {string} url Results file URL.
327
327
  * @param {string} hash Results file hash.
328
328
  * @param {Overrides} [txOptions] - Additional transaction parameters (optional, defaults to an empty object).
329
329
  * @returns Returns void if successful. Throws error if any.
@@ -338,13 +338,13 @@ class EscrowClient extends base_1.BaseEthersClient {
338
338
  * import { EscrowClient } from '@human-protocol/sdk';
339
339
  *
340
340
  * const rpcUrl = 'YOUR_RPC_URL';
341
- * const privateKey = 'YOUR_PRIVATE_KEY'
341
+ * const privateKey = 'YOUR_PRIVATE_KEY';
342
342
  *
343
343
  * const provider = new providers.JsonRpcProvider(rpcUrl);
344
344
  * const signer = new Wallet(privateKey, provider);
345
345
  * const escrowClient = await EscrowClient.build(signer);
346
346
  *
347
- * await storeResults.storeResults('0x62dD51230A30401C455c8398d06F85e4EaB6309f', 'http://localhost/results.json', 'b5dad76bf6772c0f07fd5e048f6e75a5f86ee079');
347
+ * await escrowClient.storeResults('0x62dD51230A30401C455c8398d06F85e4EaB6309f', 'http://localhost/results.json', 'b5dad76bf6772c0f07fd5e048f6e75a5f86ee079');
348
348
  * ```
349
349
  */
350
350
  async storeResults(escrowAddress, url, hash, txOptions = {}) {
@@ -389,7 +389,7 @@ class EscrowClient extends base_1.BaseEthersClient {
389
389
  * import { EscrowClient } from '@human-protocol/sdk';
390
390
  *
391
391
  * const rpcUrl = 'YOUR_RPC_URL';
392
- * const privateKey = 'YOUR_PRIVATE_KEY'
392
+ * const privateKey = 'YOUR_PRIVATE_KEY';
393
393
  *
394
394
  * const provider = new providers.JsonRpcProvider(rpcUrl);
395
395
  * const signer = new Wallet(privateKey, provider);
@@ -420,9 +420,10 @@ class EscrowClient extends base_1.BaseEthersClient {
420
420
  * @param {string} escrowAddress Escrow address to payout.
421
421
  * @param {string[]} recipients Array of recipient addresses.
422
422
  * @param {bigint[]} amounts Array of amounts the recipients will receive.
423
- * @param {string} finalResultsUrl Final results file url.
423
+ * @param {string} finalResultsUrl Final results file URL.
424
424
  * @param {string} finalResultsHash Final results file hash.
425
- * @param {string} forceComplete Indicates if remaining balance should be transferred to the escrow creator (optional, defaults to false).
425
+ * @param {number} txId Transaction ID.
426
+ * @param {boolean} forceComplete Indicates if remaining balance should be transferred to the escrow creator (optional, defaults to false).
426
427
  * @param {Overrides} [txOptions] - Additional transaction parameters (optional, defaults to an empty object).
427
428
  * @returns Returns void if successful. Throws error if any.
428
429
  *
@@ -436,7 +437,7 @@ class EscrowClient extends base_1.BaseEthersClient {
436
437
  * import { EscrowClient } from '@human-protocol/sdk';
437
438
  *
438
439
  * const rpcUrl = 'YOUR_RPC_URL';
439
- * const privateKey = 'YOUR_PRIVATE_KEY'
440
+ * const privateKey = 'YOUR_PRIVATE_KEY';
440
441
  *
441
442
  * const provider = new providers.JsonRpcProvider(rpcUrl);
442
443
  * const signer = new Wallet(privateKey, provider);
@@ -445,56 +446,21 @@ class EscrowClient extends base_1.BaseEthersClient {
445
446
  * const recipients = ['0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266', '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266'];
446
447
  * const amounts = [ethers.parseUnits(5, 'ether'), ethers.parseUnits(10, 'ether')];
447
448
  * const resultsUrl = 'http://localhost/results.json';
448
- * const resultsHash'b5dad76bf6772c0f07fd5e048f6e75a5f86ee079';
449
+ * const resultsHash = 'b5dad76bf6772c0f07fd5e048f6e75a5f86ee079';
450
+ * const txId = 1;
449
451
  *
450
- * await escrowClient.bulkPayOut('0x62dD51230A30401C455c8398d06F85e4EaB6309f', recipients, amounts, resultsUrl, resultsHash);
452
+ * await escrowClient.bulkPayOut('0x62dD51230A30401C455c8398d06F85e4EaB6309f', recipients, amounts, resultsUrl, resultsHash, txId);
451
453
  * ```
452
454
  */
453
- async bulkPayOut(escrowAddress, recipients, amounts, finalResultsUrl, finalResultsHash, forceComplete = false, txOptions = {}) {
454
- if (!ethers_1.ethers.isAddress(escrowAddress)) {
455
- throw error_1.ErrorInvalidEscrowAddressProvided;
456
- }
457
- if (recipients.length === 0) {
458
- throw error_1.ErrorRecipientCannotBeEmptyArray;
459
- }
460
- if (amounts.length === 0) {
461
- throw error_1.ErrorAmountsCannotBeEmptyArray;
462
- }
463
- if (recipients.length !== amounts.length) {
464
- throw error_1.ErrorRecipientAndAmountsMustBeSameLength;
465
- }
466
- recipients.forEach((recipient) => {
467
- if (!ethers_1.ethers.isAddress(recipient)) {
468
- throw new error_1.InvalidEthereumAddressError(recipient);
469
- }
470
- });
471
- if (!finalResultsUrl) {
472
- throw error_1.ErrorUrlIsEmptyString;
473
- }
474
- if (!(0, utils_1.isValidUrl)(finalResultsUrl)) {
475
- throw error_1.ErrorInvalidUrl;
476
- }
477
- if (!finalResultsHash) {
478
- throw error_1.ErrorHashIsEmptyString;
479
- }
480
- const balance = await this.getBalance(escrowAddress);
481
- let totalAmount = 0n;
482
- amounts.forEach((amount) => {
483
- totalAmount = totalAmount + amount;
484
- });
485
- if (balance < totalAmount) {
486
- throw error_1.ErrorEscrowDoesNotHaveEnoughBalance;
487
- }
488
- if (!(await this.escrowFactoryContract.hasEscrow(escrowAddress))) {
489
- throw error_1.ErrorEscrowAddressIsNotProvidedByFactory;
490
- }
455
+ async bulkPayOut(escrowAddress, recipients, amounts, finalResultsUrl, finalResultsHash, txId, forceComplete = false, txOptions = {}) {
456
+ await this.ensureCorrectBulkPayoutInput(escrowAddress, recipients, amounts, finalResultsUrl, finalResultsHash);
491
457
  try {
492
458
  const escrowContract = this.getEscrowContract(escrowAddress);
493
459
  if (forceComplete) {
494
- await (await escrowContract['bulkPayOut(address[],uint256[],string,string,uint256,bool)'](recipients, amounts, finalResultsUrl, finalResultsHash, constants_1.DEFAULT_TX_ID, forceComplete, txOptions)).wait();
460
+ await (await escrowContract['bulkPayOut(address[],uint256[],string,string,uint256,bool)'](recipients, amounts, finalResultsUrl, finalResultsHash, txId, forceComplete, txOptions)).wait();
495
461
  }
496
462
  else {
497
- await (await escrowContract['bulkPayOut(address[],uint256[],string,string,uint256)'](recipients, amounts, finalResultsUrl, finalResultsHash, constants_1.DEFAULT_TX_ID, txOptions)).wait();
463
+ await (await escrowContract['bulkPayOut(address[],uint256[],string,string,uint256)'](recipients, amounts, finalResultsUrl, finalResultsHash, txId, txOptions)).wait();
498
464
  }
499
465
  return;
500
466
  }
@@ -519,7 +485,7 @@ class EscrowClient extends base_1.BaseEthersClient {
519
485
  * import { EscrowClient } from '@human-protocol/sdk';
520
486
  *
521
487
  * const rpcUrl = 'YOUR_RPC_URL';
522
- * const privateKey = 'YOUR_PRIVATE_KEY'
488
+ * const privateKey = 'YOUR_PRIVATE_KEY';
523
489
  *
524
490
  * const provider = new providers.JsonRpcProvider(rpcUrl);
525
491
  * const signer = new Wallet(privateKey, provider);
@@ -586,13 +552,13 @@ class EscrowClient extends base_1.BaseEthersClient {
586
552
  * import { EscrowClient } from '@human-protocol/sdk';
587
553
  *
588
554
  * const rpcUrl = 'YOUR_RPC_URL';
589
- * const privateKey = 'YOUR_PRIVATE_KEY'
555
+ * const privateKey = 'YOUR_PRIVATE_KEY';
590
556
  *
591
557
  * const provider = new providers.JsonRpcProvider(rpcUrl);
592
558
  * const signer = new Wallet(privateKey, provider);
593
559
  * const escrowClient = await EscrowClient.build(signer);
594
560
  *
595
- * const trustedHandlers = ['0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266', '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266']
561
+ * const trustedHandlers = ['0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266', '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266'];
596
562
  * await escrowClient.addTrustedHandlers('0x62dD51230A30401C455c8398d06F85e4EaB6309f', trustedHandlers);
597
563
  * ```
598
564
  */
@@ -638,7 +604,7 @@ class EscrowClient extends base_1.BaseEthersClient {
638
604
  * import { EscrowClient } from '@human-protocol/sdk';
639
605
  *
640
606
  * const rpcUrl = 'YOUR_RPC_URL';
641
- * const privateKey = 'YOUR_PRIVATE_KEY'
607
+ * const privateKey = 'YOUR_PRIVATE_KEY';
642
608
  *
643
609
  * const provider = new providers.JsonRpcProvider(rpcUrl);
644
610
  * const signer = new Wallet(privateKey, provider);
@@ -693,11 +659,128 @@ class EscrowClient extends base_1.BaseEthersClient {
693
659
  return (0, utils_1.throwError)(e);
694
660
  }
695
661
  }
662
+ /**
663
+ * Creates a prepared transaction for bulk payout without immediately sending it.
664
+ * @param {string} escrowAddress Escrow address to payout.
665
+ * @param {string[]} recipients Array of recipient addresses.
666
+ * @param {bigint[]} amounts Array of amounts the recipients will receive.
667
+ * @param {string} finalResultsUrl Final results file URL.
668
+ * @param {string} finalResultsHash Final results file hash.
669
+ * @param {number} txId Transaction ID.
670
+ * @param {boolean} forceComplete Indicates if remaining balance should be transferred to the escrow creator (optional, defaults to false).
671
+ * @param {Overrides} [txOptions] - Additional transaction parameters (optional, defaults to an empty object).
672
+ * @returns Returns object with raw transaction and signed transaction hash
673
+ *
674
+ * **Code example**
675
+ *
676
+ * > Only Reputation Oracle or a trusted handler can call it.
677
+ *
678
+ * ```ts
679
+ * import { ethers, Wallet, providers } from 'ethers';
680
+ * import { EscrowClient } from '@human-protocol/sdk';
681
+ *
682
+ * const rpcUrl = 'YOUR_RPC_URL';
683
+ * const privateKey = 'YOUR_PRIVATE_KEY'
684
+ *
685
+ * const provider = new providers.JsonRpcProvider(rpcUrl);
686
+ * const signer = new Wallet(privateKey, provider);
687
+ * const escrowClient = await EscrowClient.build(signer);
688
+ *
689
+ * const recipients = ['0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266', '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266'];
690
+ * const amounts = [ethers.parseUnits(5, 'ether'), ethers.parseUnits(10, 'ether')];
691
+ * const resultsUrl = 'http://localhost/results.json';
692
+ * const resultsHash = 'b5dad76bf6772c0f07fd5e048f6e75a5f86ee079';
693
+ * const txId = 1;
694
+ *
695
+ * const rawTransaction = await escrowClient.createBulkPayoutTransaction('0x62dD51230A30401C455c8398d06F85e4EaB6309f', recipients, amounts, resultsUrl, resultsHash, txId);
696
+ * console.log('Raw transaction:', rawTransaction);
697
+ *
698
+ * const signedTransaction = await signer.signTransaction(rawTransaction);
699
+ * console.log('Tx hash:', ethers.keccak256(signedTransaction));
700
+ * (await signer.sendTransaction(rawTransaction)).wait();
701
+ */
702
+ async createBulkPayoutTransaction(escrowAddress, recipients, amounts, finalResultsUrl, finalResultsHash, txId, forceComplete = false, txOptions = {}) {
703
+ await this.ensureCorrectBulkPayoutInput(escrowAddress, recipients, amounts, finalResultsUrl, finalResultsHash);
704
+ const signer = this.runner;
705
+ try {
706
+ const escrowContract = this.getEscrowContract(escrowAddress);
707
+ const populatedTransaction = await escrowContract['bulkPayOut(address[],uint256[],string,string,uint256,bool)'].populateTransaction(recipients, amounts, finalResultsUrl, finalResultsHash, txId, forceComplete, txOptions);
708
+ /**
709
+ * Safety-belt: explicitly set the passed nonce
710
+ * because 'populateTransaction' return value
711
+ * doesn't mention it even in library docs,
712
+ * even though it includes if from txOptions.
713
+ */
714
+ if (typeof txOptions.nonce === 'number') {
715
+ populatedTransaction.nonce = txOptions.nonce;
716
+ }
717
+ else {
718
+ populatedTransaction.nonce = await signer.getNonce();
719
+ }
720
+ /**
721
+ * It's needed to get all necessary info for tx object
722
+ * before signing it, e.g.:
723
+ * - type
724
+ * - chainId
725
+ * - fees params
726
+ * - etc.
727
+ *
728
+ * All information is needed in order to get proper hash value
729
+ */
730
+ const preparedTransaction = await signer.populateTransaction(populatedTransaction);
731
+ return preparedTransaction;
732
+ }
733
+ catch (e) {
734
+ return (0, utils_1.throwError)(e);
735
+ }
736
+ }
737
+ async ensureCorrectBulkPayoutInput(escrowAddress, recipients, amounts, finalResultsUrl, finalResultsHash) {
738
+ if (!ethers_1.ethers.isAddress(escrowAddress)) {
739
+ throw error_1.ErrorInvalidEscrowAddressProvided;
740
+ }
741
+ if (recipients.length === 0) {
742
+ throw error_1.ErrorRecipientCannotBeEmptyArray;
743
+ }
744
+ if (recipients.length > constants_1.ESCROW_BULK_PAYOUT_MAX_ITEMS) {
745
+ throw error_1.ErrorTooManyRecipients;
746
+ }
747
+ if (amounts.length === 0) {
748
+ throw error_1.ErrorAmountsCannotBeEmptyArray;
749
+ }
750
+ if (recipients.length !== amounts.length) {
751
+ throw error_1.ErrorRecipientAndAmountsMustBeSameLength;
752
+ }
753
+ recipients.forEach((recipient) => {
754
+ if (!ethers_1.ethers.isAddress(recipient)) {
755
+ throw new error_1.InvalidEthereumAddressError(recipient);
756
+ }
757
+ });
758
+ if (!finalResultsUrl) {
759
+ throw error_1.ErrorUrlIsEmptyString;
760
+ }
761
+ if (!(0, utils_1.isValidUrl)(finalResultsUrl)) {
762
+ throw error_1.ErrorInvalidUrl;
763
+ }
764
+ if (!finalResultsHash) {
765
+ throw error_1.ErrorHashIsEmptyString;
766
+ }
767
+ const balance = await this.getBalance(escrowAddress);
768
+ let totalAmount = 0n;
769
+ amounts.forEach((amount) => {
770
+ totalAmount = totalAmount + amount;
771
+ });
772
+ if (balance < totalAmount) {
773
+ throw error_1.ErrorEscrowDoesNotHaveEnoughBalance;
774
+ }
775
+ if (!(await this.escrowFactoryContract.hasEscrow(escrowAddress))) {
776
+ throw error_1.ErrorEscrowAddressIsNotProvidedByFactory;
777
+ }
778
+ }
696
779
  /**
697
780
  * This function returns the balance for a specified escrow address.
698
781
  *
699
782
  * @param {string} escrowAddress Address of the escrow.
700
- * @returns {bigint} Balance of the escrow in the token used to fund it.
783
+ * @returns {Promise<bigint>} Balance of the escrow in the token used to fund it.
701
784
  *
702
785
  * **Code example**
703
786
  *
@@ -708,7 +791,7 @@ class EscrowClient extends base_1.BaseEthersClient {
708
791
  * const rpcUrl = 'YOUR_RPC_URL';
709
792
  *
710
793
  * const provider = new providers.JsonRpcProvider(rpcUrl);
711
- * const escrowClient = await EscrowClient.build(signer);
794
+ * const escrowClient = await EscrowClient.build(provider);
712
795
  *
713
796
  * const balance = await escrowClient.getBalance('0x62dD51230A30401C455c8398d06F85e4EaB6309f');
714
797
  * ```
@@ -738,7 +821,7 @@ class EscrowClient extends base_1.BaseEthersClient {
738
821
  * This function returns the manifest file hash.
739
822
  *
740
823
  * @param {string} escrowAddress Address of the escrow.
741
- * @returns {string} Hash of the manifest file content.
824
+ * @returns {Promise<string>} Hash of the manifest file content.
742
825
  *
743
826
  * **Code example**
744
827
  *
@@ -749,7 +832,7 @@ class EscrowClient extends base_1.BaseEthersClient {
749
832
  * const rpcUrl = 'YOUR_RPC_URL';
750
833
  *
751
834
  * const provider = new providers.JsonRpcProvider(rpcUrl);
752
- * const escrowClient = await EscrowClient.build(signer);
835
+ * const escrowClient = await EscrowClient.build(provider);
753
836
  *
754
837
  * const manifestHash = await escrowClient.getManifestHash('0x62dD51230A30401C455c8398d06F85e4EaB6309f');
755
838
  * ```
@@ -773,7 +856,7 @@ class EscrowClient extends base_1.BaseEthersClient {
773
856
  * This function returns the manifest file URL.
774
857
  *
775
858
  * @param {string} escrowAddress Address of the escrow.
776
- * @returns {string} Url of the manifest.
859
+ * @returns {Promise<string>} Url of the manifest.
777
860
  *
778
861
  * **Code example**
779
862
  *
@@ -784,7 +867,7 @@ class EscrowClient extends base_1.BaseEthersClient {
784
867
  * const rpcUrl = 'YOUR_RPC_URL';
785
868
  *
786
869
  * const provider = new providers.JsonRpcProvider(rpcUrl);
787
- * const escrowClient = await EscrowClient.build(signer);
870
+ * const escrowClient = await EscrowClient.build(provider);
788
871
  *
789
872
  * const manifestUrl = await escrowClient.getManifestUrl('0x62dD51230A30401C455c8398d06F85e4EaB6309f');
790
873
  * ```
@@ -808,7 +891,7 @@ class EscrowClient extends base_1.BaseEthersClient {
808
891
  * This function returns the results file URL.
809
892
  *
810
893
  * @param {string} escrowAddress Address of the escrow.
811
- * @returns {string} Results file url.
894
+ * @returns {Promise<string>} Results file url.
812
895
  *
813
896
  * **Code example**
814
897
  *
@@ -819,7 +902,7 @@ class EscrowClient extends base_1.BaseEthersClient {
819
902
  * const rpcUrl = 'YOUR_RPC_URL';
820
903
  *
821
904
  * const provider = new providers.JsonRpcProvider(rpcUrl);
822
- * const escrowClient = await EscrowClient.build(signer);
905
+ * const escrowClient = await EscrowClient.build(provider);
823
906
  *
824
907
  * const resultsUrl = await escrowClient.getResultsUrl('0x62dD51230A30401C455c8398d06F85e4EaB6309f');
825
908
  * ```
@@ -843,7 +926,7 @@ class EscrowClient extends base_1.BaseEthersClient {
843
926
  * This function returns the intermediate results file URL.
844
927
  *
845
928
  * @param {string} escrowAddress Address of the escrow.
846
- * @returns {string} Url of the file that store results from Recording Oracle.
929
+ * @returns {Promise<string>} Url of the file that store results from Recording Oracle.
847
930
  *
848
931
  * **Code example**
849
932
  *
@@ -854,9 +937,9 @@ class EscrowClient extends base_1.BaseEthersClient {
854
937
  * const rpcUrl = 'YOUR_RPC_URL';
855
938
  *
856
939
  * const provider = new providers.JsonRpcProvider(rpcUrl);
857
- * const escrowClient = await EscrowClient.build(signer);
940
+ * const escrowClient = await EscrowClient.build(provider);
858
941
  *
859
- * const intemediateResultsUrl = await escrowClient.getIntermediateResultsUrl('0x62dD51230A30401C455c8398d06F85e4EaB6309f');
942
+ * const intermediateResultsUrl = await escrowClient.getIntermediateResultsUrl('0x62dD51230A30401C455c8398d06F85e4EaB6309f');
860
943
  * ```
861
944
  */
862
945
  async getIntermediateResultsUrl(escrowAddress) {
@@ -878,7 +961,7 @@ class EscrowClient extends base_1.BaseEthersClient {
878
961
  * This function returns the token address used for funding the escrow.
879
962
  *
880
963
  * @param {string} escrowAddress Address of the escrow.
881
- * @returns {string} Address of the token used to fund the escrow.
964
+ * @returns {Promise<string>} Address of the token used to fund the escrow.
882
965
  *
883
966
  * **Code example**
884
967
  *
@@ -889,7 +972,7 @@ class EscrowClient extends base_1.BaseEthersClient {
889
972
  * const rpcUrl = 'YOUR_RPC_URL';
890
973
  *
891
974
  * const provider = new providers.JsonRpcProvider(rpcUrl);
892
- * const escrowClient = await EscrowClient.build(signer);
975
+ * const escrowClient = await EscrowClient.build(provider);
893
976
  *
894
977
  * const tokenAddress = await escrowClient.getTokenAddress('0x62dD51230A30401C455c8398d06F85e4EaB6309f');
895
978
  * ```
@@ -913,7 +996,7 @@ class EscrowClient extends base_1.BaseEthersClient {
913
996
  * This function returns the current status of the escrow.
914
997
  *
915
998
  * @param {string} escrowAddress Address of the escrow.
916
- * @returns {EscrowStatus} Current status of the escrow.
999
+ * @returns {Promise<EscrowStatus>} Current status of the escrow.
917
1000
  *
918
1001
  * **Code example**
919
1002
  *
@@ -924,7 +1007,7 @@ class EscrowClient extends base_1.BaseEthersClient {
924
1007
  * const rpcUrl = 'YOUR_RPC_URL';
925
1008
  *
926
1009
  * const provider = new providers.JsonRpcProvider(rpcUrl);
927
- * const escrowClient = await EscrowClient.build(signer);
1010
+ * const escrowClient = await EscrowClient.build(provider);
928
1011
  *
929
1012
  * const status = await escrowClient.getStatus('0x62dD51230A30401C455c8398d06F85e4EaB6309f');
930
1013
  * ```
@@ -948,7 +1031,7 @@ class EscrowClient extends base_1.BaseEthersClient {
948
1031
  * This function returns the recording oracle address for a given escrow.
949
1032
  *
950
1033
  * @param {string} escrowAddress Address of the escrow.
951
- * @returns {string} Address of the Recording Oracle.
1034
+ * @returns {Promise<string>} Address of the Recording Oracle.
952
1035
  *
953
1036
  * **Code example**
954
1037
  *
@@ -959,7 +1042,7 @@ class EscrowClient extends base_1.BaseEthersClient {
959
1042
  * const rpcUrl = 'YOUR_RPC_URL';
960
1043
  *
961
1044
  * const provider = new providers.JsonRpcProvider(rpcUrl);
962
- * const escrowClient = await EscrowClient.build(signer);
1045
+ * const escrowClient = await EscrowClient.build(provider);
963
1046
  *
964
1047
  * const oracleAddress = await escrowClient.getRecordingOracleAddress('0x62dD51230A30401C455c8398d06F85e4EaB6309f');
965
1048
  * ```
@@ -983,7 +1066,7 @@ class EscrowClient extends base_1.BaseEthersClient {
983
1066
  * This function returns the job launcher address for a given escrow.
984
1067
  *
985
1068
  * @param {string} escrowAddress Address of the escrow.
986
- * @returns {string} Address of the Job Launcher.
1069
+ * @returns {Promise<string>} Address of the Job Launcher.
987
1070
  *
988
1071
  * **Code example**
989
1072
  *
@@ -994,7 +1077,7 @@ class EscrowClient extends base_1.BaseEthersClient {
994
1077
  * const rpcUrl = 'YOUR_RPC_URL';
995
1078
  *
996
1079
  * const provider = new providers.JsonRpcProvider(rpcUrl);
997
- * const escrowClient = await EscrowClient.build(signer);
1080
+ * const escrowClient = await EscrowClient.build(provider);
998
1081
  *
999
1082
  * const jobLauncherAddress = await escrowClient.getJobLauncherAddress('0x62dD51230A30401C455c8398d06F85e4EaB6309f');
1000
1083
  * ```
@@ -1018,7 +1101,7 @@ class EscrowClient extends base_1.BaseEthersClient {
1018
1101
  * This function returns the reputation oracle address for a given escrow.
1019
1102
  *
1020
1103
  * @param {string} escrowAddress Address of the escrow.
1021
- * @returns {EscrowStatus} Address of the Reputation Oracle.
1104
+ * @returns {Promise<string>} Address of the Reputation Oracle.
1022
1105
  *
1023
1106
  * **Code example**
1024
1107
  *
@@ -1029,7 +1112,7 @@ class EscrowClient extends base_1.BaseEthersClient {
1029
1112
  * const rpcUrl = 'YOUR_RPC_URL';
1030
1113
  *
1031
1114
  * const provider = new providers.JsonRpcProvider(rpcUrl);
1032
- * const escrowClient = await EscrowClient.build(signer);
1115
+ * const escrowClient = await EscrowClient.build(provider);
1033
1116
  *
1034
1117
  * const oracleAddress = await escrowClient.getReputationOracleAddress('0x62dD51230A30401C455c8398d06F85e4EaB6309f');
1035
1118
  * ```
@@ -1053,7 +1136,7 @@ class EscrowClient extends base_1.BaseEthersClient {
1053
1136
  * This function returns the exchange oracle address for a given escrow.
1054
1137
  *
1055
1138
  * @param {string} escrowAddress Address of the escrow.
1056
- * @returns {EscrowStatus} Address of the Exchange Oracle.
1139
+ * @returns {Promise<string>} Address of the Exchange Oracle.
1057
1140
  *
1058
1141
  * **Code example**
1059
1142
  *
@@ -1064,7 +1147,7 @@ class EscrowClient extends base_1.BaseEthersClient {
1064
1147
  * const rpcUrl = 'YOUR_RPC_URL';
1065
1148
  *
1066
1149
  * const provider = new providers.JsonRpcProvider(rpcUrl);
1067
- * const escrowClient = await EscrowClient.build(signer);
1150
+ * const escrowClient = await EscrowClient.build(provider);
1068
1151
  *
1069
1152
  * const oracleAddress = await escrowClient.getExchangeOracleAddress('0x62dD51230A30401C455c8398d06F85e4EaB6309f');
1070
1153
  * ```
@@ -1088,7 +1171,7 @@ class EscrowClient extends base_1.BaseEthersClient {
1088
1171
  * This function returns the escrow factory address for a given escrow.
1089
1172
  *
1090
1173
  * @param {string} escrowAddress Address of the escrow.
1091
- * @returns {EscrowStatus} Address of the escrow factory.
1174
+ * @returns {Promise<string>} Address of the escrow factory.
1092
1175
  *
1093
1176
  * **Code example**
1094
1177
  *
@@ -1099,7 +1182,7 @@ class EscrowClient extends base_1.BaseEthersClient {
1099
1182
  * const rpcUrl = 'YOUR_RPC_URL';
1100
1183
  *
1101
1184
  * const provider = new providers.JsonRpcProvider(rpcUrl);
1102
- * const escrowClient = await EscrowClient.build(signer);
1185
+ * const escrowClient = await EscrowClient.build(provider);
1103
1186
  *
1104
1187
  * const factoryAddress = await escrowClient.getFactoryAddress('0x62dD51230A30401C455c8398d06F85e4EaB6309f');
1105
1188
  * ```
@@ -1154,7 +1237,7 @@ __decorate([
1154
1237
  __decorate([
1155
1238
  decorators_1.requiresSigner,
1156
1239
  __metadata("design:type", Function),
1157
- __metadata("design:paramtypes", [String, Array, Array, String, String, Object, Object]),
1240
+ __metadata("design:paramtypes", [String, Array, Array, String, String, Number, Object, Object]),
1158
1241
  __metadata("design:returntype", Promise)
1159
1242
  ], EscrowClient.prototype, "bulkPayOut", null);
1160
1243
  __decorate([
@@ -1175,6 +1258,12 @@ __decorate([
1175
1258
  __metadata("design:paramtypes", [String, String, Object]),
1176
1259
  __metadata("design:returntype", Promise)
1177
1260
  ], EscrowClient.prototype, "withdraw", null);
1261
+ __decorate([
1262
+ decorators_1.requiresSigner,
1263
+ __metadata("design:type", Function),
1264
+ __metadata("design:paramtypes", [String, Array, Array, String, String, Number, Object, Object]),
1265
+ __metadata("design:returntype", Promise)
1266
+ ], EscrowClient.prototype, "createBulkPayoutTransaction", null);
1178
1267
  /**
1179
1268
  * ## Introduction
1180
1269
  *
@@ -1202,7 +1291,7 @@ __decorate([
1202
1291
  * import { ChainId, EscrowUtils } from '@human-protocol/sdk';
1203
1292
  *
1204
1293
  * const escrowAddresses = new EscrowUtils.getEscrows({
1205
- * network: ChainId.POLYGON_AMOY
1294
+ * chainId: ChainId.POLYGON_AMOY
1206
1295
  * });
1207
1296
  * ```
1208
1297
  */
@@ -1247,7 +1336,6 @@ class EscrowUtils {
1247
1336
  * AVALANCHE_TESTNET = 43113,
1248
1337
  * CELO = 42220,
1249
1338
  * CELO_ALFAJORES = 44787,
1250
- * = 1273227453,
1251
1339
  * LOCALHOST = 1338,
1252
1340
  * }
1253
1341
  * ```
@@ -1 +1 @@
1
- {"version":3,"file":"operator.d.ts","sourceRoot":"","sources":["../../../src/graphql/queries/operator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AA0BhD,eAAO,MAAM,iBAAiB,WAAY,cAAc,mCAuBvD,CAAC;AAEF,eAAO,MAAM,4BAA4B,UAAW,MAAM,mCA0BzD,CAAC;AAEF,eAAO,MAAM,gBAAgB,gCAO5B,CAAC"}
1
+ {"version":3,"file":"operator.d.ts","sourceRoot":"","sources":["../../../src/graphql/queries/operator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AA0BhD,eAAO,MAAM,iBAAiB,WAAY,cAAc,mCA+BvD,CAAC;AAEF,eAAO,MAAM,4BAA4B,UAAW,MAAM,mCA0BzD,CAAC;AAEF,eAAO,MAAM,gBAAgB,gCAO5B,CAAC"}