@human-protocol/sdk 6.0.0 → 6.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/escrow.ts CHANGED
@@ -66,7 +66,12 @@ import {
66
66
  IEscrowWithdraw,
67
67
  SubgraphOptions,
68
68
  } from './interfaces';
69
- import { EscrowStatus, NetworkData, TransactionLikeWithNonce } from './types';
69
+ import {
70
+ EscrowStatus,
71
+ NetworkData,
72
+ TransactionLikeWithNonce,
73
+ TransactionOverrides,
74
+ } from './types';
70
75
  import {
71
76
  getSubgraphUrl,
72
77
  getUnixTimestamp,
@@ -205,20 +210,22 @@ export class EscrowClient extends BaseEthersClient {
205
210
  public async createEscrow(
206
211
  tokenAddress: string,
207
212
  jobRequesterId: string,
208
- txOptions: Overrides = {}
213
+ txOptions: TransactionOverrides = {}
209
214
  ): Promise<string> {
210
215
  if (!ethers.isAddress(tokenAddress)) {
211
216
  throw ErrorInvalidTokenAddress;
212
217
  }
213
218
 
214
219
  try {
215
- const result = await (
216
- await this.escrowFactoryContract.createEscrow(
217
- tokenAddress,
218
- jobRequesterId,
219
- txOptions
220
- )
221
- ).wait();
220
+ const result = await this.sendTxAndWait(
221
+ (overrides) =>
222
+ this.escrowFactoryContract.createEscrow(
223
+ tokenAddress,
224
+ jobRequesterId,
225
+ overrides
226
+ ),
227
+ txOptions
228
+ );
222
229
 
223
230
  const event = (
224
231
  result?.logs?.find(({ topics }) =>
@@ -340,7 +347,7 @@ export class EscrowClient extends BaseEthersClient {
340
347
  amount: bigint,
341
348
  jobRequesterId: string,
342
349
  escrowConfig: IEscrowConfig,
343
- txOptions: Overrides = {}
350
+ txOptions: TransactionOverrides = {}
344
351
  ): Promise<string> {
345
352
  if (!ethers.isAddress(tokenAddress)) {
346
353
  throw ErrorInvalidTokenAddress;
@@ -360,22 +367,24 @@ export class EscrowClient extends BaseEthersClient {
360
367
  } = escrowConfig;
361
368
 
362
369
  try {
363
- const result = await (
364
- await this.escrowFactoryContract.createFundAndSetupEscrow(
365
- tokenAddress,
366
- amount,
367
- jobRequesterId,
368
- reputationOracle,
369
- recordingOracle,
370
- exchangeOracle,
371
- reputationOracleFee,
372
- recordingOracleFee,
373
- exchangeOracleFee,
374
- manifest,
375
- manifestHash,
376
- txOptions
377
- )
378
- ).wait();
370
+ const result = await this.sendTxAndWait(
371
+ (overrides) =>
372
+ this.escrowFactoryContract.createFundAndSetupEscrow(
373
+ tokenAddress,
374
+ amount,
375
+ jobRequesterId,
376
+ reputationOracle,
377
+ recordingOracle,
378
+ exchangeOracle,
379
+ reputationOracleFee,
380
+ recordingOracleFee,
381
+ exchangeOracleFee,
382
+ manifest,
383
+ manifestHash,
384
+ overrides
385
+ ),
386
+ txOptions
387
+ );
379
388
 
380
389
  const event = (
381
390
  result?.logs?.find(({ topics }) =>
@@ -433,7 +442,7 @@ export class EscrowClient extends BaseEthersClient {
433
442
  async setup(
434
443
  escrowAddress: string,
435
444
  escrowConfig: IEscrowConfig,
436
- txOptions: Overrides = {}
445
+ txOptions: TransactionOverrides = {}
437
446
  ): Promise<void> {
438
447
  const {
439
448
  recordingOracle,
@@ -459,19 +468,21 @@ export class EscrowClient extends BaseEthersClient {
459
468
  try {
460
469
  const escrowContract = this.getEscrowContract(escrowAddress);
461
470
 
462
- await (
463
- await escrowContract.setup(
464
- reputationOracle,
465
- recordingOracle,
466
- exchangeOracle,
467
- reputationOracleFee,
468
- recordingOracleFee,
469
- exchangeOracleFee,
470
- manifest,
471
- manifestHash,
472
- txOptions
473
- )
474
- ).wait();
471
+ await this.sendTxAndWait(
472
+ (overrides) =>
473
+ escrowContract.setup(
474
+ reputationOracle,
475
+ recordingOracle,
476
+ exchangeOracle,
477
+ reputationOracleFee,
478
+ recordingOracleFee,
479
+ exchangeOracleFee,
480
+ manifest,
481
+ manifestHash,
482
+ overrides
483
+ ),
484
+ txOptions
485
+ );
475
486
 
476
487
  return;
477
488
  } catch (e) {
@@ -502,7 +513,7 @@ export class EscrowClient extends BaseEthersClient {
502
513
  async fund(
503
514
  escrowAddress: string,
504
515
  amount: bigint,
505
- txOptions: Overrides = {}
516
+ txOptions: TransactionOverrides = {}
506
517
  ): Promise<void> {
507
518
  if (!ethers.isAddress(escrowAddress)) {
508
519
  throw ErrorInvalidEscrowAddressProvided;
@@ -525,9 +536,10 @@ export class EscrowClient extends BaseEthersClient {
525
536
  tokenAddress,
526
537
  this.runner
527
538
  );
528
- await (
529
- await tokenContract.transfer(escrowAddress, amount, txOptions)
530
- ).wait();
539
+ await this.sendTxAndWait(
540
+ (overrides) => tokenContract.transfer(escrowAddress, amount, overrides),
541
+ txOptions
542
+ );
531
543
 
532
544
  return;
533
545
  } catch (e) {
@@ -564,7 +576,7 @@ export class EscrowClient extends BaseEthersClient {
564
576
  escrowAddress: string,
565
577
  url: string,
566
578
  hash: string,
567
- txOptions?: Overrides
579
+ txOptions?: TransactionOverrides
568
580
  ): Promise<void>;
569
581
 
570
582
  /**
@@ -604,7 +616,7 @@ export class EscrowClient extends BaseEthersClient {
604
616
  url: string,
605
617
  hash: string,
606
618
  fundsToReserve: bigint,
607
- txOptions?: Overrides
619
+ txOptions?: TransactionOverrides
608
620
  ): Promise<void>;
609
621
 
610
622
  @requiresSigner
@@ -612,14 +624,16 @@ export class EscrowClient extends BaseEthersClient {
612
624
  escrowAddress: string,
613
625
  url: string,
614
626
  hash: string,
615
- a?: bigint | Overrides,
616
- b?: Overrides
627
+ a?: bigint | TransactionOverrides,
628
+ b?: TransactionOverrides
617
629
  ): Promise<void> {
618
630
  const escrowContract = this.getEscrowContract(escrowAddress);
619
631
 
620
632
  const hasFundsToReserveParam = typeof a === 'bigint';
621
633
  const fundsToReserve = hasFundsToReserveParam ? (a as bigint) : null;
622
- const txOptions = (hasFundsToReserveParam ? b : a) || {};
634
+ const txOptions = (hasFundsToReserveParam ? b : a) as
635
+ | TransactionOverrides
636
+ | undefined;
623
637
  // When fundsToReserve is provided and is 0, allow empty URL.
624
638
  // In this situation not solutions might have been provided so the escrow can be straight cancelled.
625
639
  const allowEmptyUrl = hasFundsToReserveParam && fundsToReserve === 0n;
@@ -640,24 +654,17 @@ export class EscrowClient extends BaseEthersClient {
640
654
  }
641
655
 
642
656
  try {
643
- if (fundsToReserve !== null) {
644
- await (
645
- await escrowContract['storeResults(string,string,uint256)'](
646
- url,
647
- hash,
648
- fundsToReserve,
649
- txOptions
650
- )
651
- ).wait();
652
- } else {
653
- await (
654
- await escrowContract['storeResults(string,string)'](
655
- url,
656
- hash,
657
- txOptions
658
- )
659
- ).wait();
660
- }
657
+ const txFactory = (overrides: Overrides) =>
658
+ fundsToReserve !== null
659
+ ? escrowContract['storeResults(string,string,uint256)'](
660
+ url,
661
+ hash,
662
+ fundsToReserve,
663
+ overrides
664
+ )
665
+ : escrowContract['storeResults(string,string)'](url, hash, overrides);
666
+
667
+ await this.sendTxAndWait(txFactory, txOptions);
661
668
  } catch (e) {
662
669
  if (!hasFundsToReserveParam && e.reason === 'DEPRECATED_SIGNATURE') {
663
670
  throw ErrorStoreResultsVersion;
@@ -685,7 +692,7 @@ export class EscrowClient extends BaseEthersClient {
685
692
  @requiresSigner
686
693
  async complete(
687
694
  escrowAddress: string,
688
- txOptions: Overrides = {}
695
+ txOptions: TransactionOverrides = {}
689
696
  ): Promise<void> {
690
697
  if (!ethers.isAddress(escrowAddress)) {
691
698
  throw ErrorInvalidEscrowAddressProvided;
@@ -697,8 +704,10 @@ export class EscrowClient extends BaseEthersClient {
697
704
 
698
705
  try {
699
706
  const escrowContract = this.getEscrowContract(escrowAddress);
700
-
701
- await (await escrowContract.complete(txOptions)).wait();
707
+ await this.sendTxAndWait(
708
+ (overrides) => escrowContract.complete(overrides),
709
+ txOptions
710
+ );
702
711
  return;
703
712
  } catch (e) {
704
713
  return throwError(e);
@@ -759,7 +768,7 @@ export class EscrowClient extends BaseEthersClient {
759
768
  finalResultsHash: string,
760
769
  txId: number,
761
770
  forceComplete: boolean,
762
- txOptions: Overrides
771
+ txOptions: TransactionOverrides
763
772
  ): Promise<void>;
764
773
 
765
774
  /**
@@ -817,7 +826,7 @@ export class EscrowClient extends BaseEthersClient {
817
826
  finalResultsHash: string,
818
827
  payoutId: string,
819
828
  forceComplete: boolean,
820
- txOptions: Overrides
829
+ txOptions: TransactionOverrides
821
830
  ): Promise<void>;
822
831
 
823
832
  @requiresSigner
@@ -829,7 +838,7 @@ export class EscrowClient extends BaseEthersClient {
829
838
  finalResultsHash: string,
830
839
  id: number | string,
831
840
  forceComplete: boolean,
832
- txOptions: Overrides = {}
841
+ txOptions: TransactionOverrides = {}
833
842
  ): Promise<void> {
834
843
  await this.ensureCorrectBulkPayoutInput(
835
844
  escrowAddress,
@@ -843,35 +852,32 @@ export class EscrowClient extends BaseEthersClient {
843
852
  const idIsString = typeof id === 'string';
844
853
 
845
854
  try {
846
- if (idIsString) {
847
- await (
848
- await escrowContract[
849
- 'bulkPayOut(address[],uint256[],string,string,string,bool)'
850
- ](
851
- recipients,
852
- amounts,
853
- finalResultsUrl,
854
- finalResultsHash,
855
- id,
856
- forceComplete,
857
- txOptions
858
- )
859
- ).wait();
860
- } else {
861
- await (
862
- await escrowContract[
863
- 'bulkPayOut(address[],uint256[],string,string,uint256,bool)'
864
- ](
865
- recipients,
866
- amounts,
867
- finalResultsUrl,
868
- finalResultsHash,
869
- id,
870
- forceComplete,
871
- txOptions
872
- )
873
- ).wait();
874
- }
855
+ const txFactory = (overrides: Overrides) =>
856
+ idIsString
857
+ ? escrowContract[
858
+ 'bulkPayOut(address[],uint256[],string,string,string,bool)'
859
+ ](
860
+ recipients,
861
+ amounts,
862
+ finalResultsUrl,
863
+ finalResultsHash,
864
+ id,
865
+ forceComplete,
866
+ overrides
867
+ )
868
+ : escrowContract[
869
+ 'bulkPayOut(address[],uint256[],string,string,uint256,bool)'
870
+ ](
871
+ recipients,
872
+ amounts,
873
+ finalResultsUrl,
874
+ finalResultsHash,
875
+ id,
876
+ forceComplete,
877
+ overrides
878
+ );
879
+
880
+ await this.sendTxAndWait(txFactory, txOptions);
875
881
  } catch (e) {
876
882
  if (!idIsString && e.reason === 'DEPRECATED_SIGNATURE') {
877
883
  throw ErrorBulkPayOutVersion;
@@ -900,7 +906,7 @@ export class EscrowClient extends BaseEthersClient {
900
906
  @requiresSigner
901
907
  async cancel(
902
908
  escrowAddress: string,
903
- txOptions: Overrides = {}
909
+ txOptions: TransactionOverrides = {}
904
910
  ): Promise<void> {
905
911
  if (!ethers.isAddress(escrowAddress)) {
906
912
  throw ErrorInvalidEscrowAddressProvided;
@@ -912,7 +918,10 @@ export class EscrowClient extends BaseEthersClient {
912
918
 
913
919
  try {
914
920
  const escrowContract = this.getEscrowContract(escrowAddress);
915
- await (await escrowContract.cancel(txOptions)).wait();
921
+ await this.sendTxAndWait(
922
+ (overrides) => escrowContract.cancel(overrides),
923
+ txOptions
924
+ );
916
925
  } catch (e) {
917
926
  return throwError(e);
918
927
  }
@@ -936,7 +945,7 @@ export class EscrowClient extends BaseEthersClient {
936
945
  @requiresSigner
937
946
  async requestCancellation(
938
947
  escrowAddress: string,
939
- txOptions: Overrides = {}
948
+ txOptions: TransactionOverrides = {}
940
949
  ): Promise<void> {
941
950
  if (!ethers.isAddress(escrowAddress)) {
942
951
  throw ErrorInvalidEscrowAddressProvided;
@@ -948,7 +957,10 @@ export class EscrowClient extends BaseEthersClient {
948
957
 
949
958
  try {
950
959
  const escrowContract = this.getEscrowContract(escrowAddress);
951
- await (await escrowContract.requestCancellation(txOptions)).wait();
960
+ await this.sendTxAndWait(
961
+ (overrides) => escrowContract.requestCancellation(overrides),
962
+ txOptions
963
+ );
952
964
  } catch (e) {
953
965
  return throwError(e);
954
966
  }
@@ -981,7 +993,7 @@ export class EscrowClient extends BaseEthersClient {
981
993
  async withdraw(
982
994
  escrowAddress: string,
983
995
  tokenAddress: string,
984
- txOptions: Overrides = {}
996
+ txOptions: TransactionOverrides = {}
985
997
  ): Promise<IEscrowWithdraw> {
986
998
  if (!ethers.isAddress(escrowAddress)) {
987
999
  throw ErrorInvalidEscrowAddressProvided;
@@ -997,10 +1009,10 @@ export class EscrowClient extends BaseEthersClient {
997
1009
 
998
1010
  try {
999
1011
  const escrowContract = this.getEscrowContract(escrowAddress);
1000
-
1001
- const transactionReceipt = await (
1002
- await escrowContract.withdraw(tokenAddress, txOptions)
1003
- ).wait();
1012
+ const transactionReceipt = await this.sendTxAndWait(
1013
+ (overrides) => escrowContract.withdraw(tokenAddress, overrides),
1014
+ txOptions
1015
+ );
1004
1016
 
1005
1017
  let amountTransferred: bigint | undefined = undefined;
1006
1018
 
package/src/interfaces.ts CHANGED
@@ -149,8 +149,8 @@ export interface ITransaction {
149
149
 
150
150
  export interface ITransactionsFilter extends IPagination {
151
151
  chainId: ChainId;
152
- startBlock?: number;
153
- endBlock?: number;
152
+ startBlock?: number | bigint;
153
+ endBlock?: number | bigint;
154
154
  startDate?: Date;
155
155
  endDate?: Date;
156
156
  fromAddress?: string;
package/src/kvstore.ts CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  KVStore,
3
3
  KVStore__factory,
4
4
  } from '@human-protocol/core/typechain-types';
5
- import { ContractRunner, Overrides, ethers } from 'ethers';
5
+ import { ContractRunner, ethers } from 'ethers';
6
6
  import { BaseEthersClient } from './base';
7
7
  import { KVStoreKeys, NETWORKS } from './constants';
8
8
  import { requiresSigner } from './decorators';
@@ -17,7 +17,7 @@ import {
17
17
  ErrorUnsupportedChainID,
18
18
  InvalidKeyError,
19
19
  } from './error';
20
- import { NetworkData } from './types';
20
+ import { NetworkData, TransactionOverrides } from './types';
21
21
  import { getSubgraphUrl, customGqlFetch, isValidUrl } from './utils';
22
22
  import {
23
23
  GET_KVSTORE_BY_ADDRESS_AND_KEY_QUERY,
@@ -156,11 +156,14 @@ export class KVStoreClient extends BaseEthersClient {
156
156
  public async set(
157
157
  key: string,
158
158
  value: string,
159
- txOptions: Overrides = {}
159
+ txOptions: TransactionOverrides = {}
160
160
  ): Promise<void> {
161
161
  if (key === '') throw ErrorKVStoreEmptyKey;
162
162
  try {
163
- await (await this.contract.set(key, value, txOptions)).wait();
163
+ await this.sendTxAndWait(
164
+ (overrides) => this.contract.set(key, value, overrides),
165
+ txOptions
166
+ );
164
167
  } catch (e) {
165
168
  if (e instanceof Error) throw Error(`Failed to set value: ${e.message}`);
166
169
  }
@@ -188,13 +191,16 @@ export class KVStoreClient extends BaseEthersClient {
188
191
  public async setBulk(
189
192
  keys: string[],
190
193
  values: string[],
191
- txOptions: Overrides = {}
194
+ txOptions: TransactionOverrides = {}
192
195
  ): Promise<void> {
193
196
  if (keys.length !== values.length) throw ErrorKVStoreArrayLength;
194
197
  if (keys.includes('')) throw ErrorKVStoreEmptyKey;
195
198
 
196
199
  try {
197
- await (await this.contract.setBulk(keys, values, txOptions)).wait();
200
+ await this.sendTxAndWait(
201
+ (overrides) => this.contract.setBulk(keys, values, overrides),
202
+ txOptions
203
+ );
198
204
  } catch (e) {
199
205
  if (e instanceof Error)
200
206
  throw Error(`Failed to set bulk values: ${e.message}`);
@@ -221,7 +227,7 @@ export class KVStoreClient extends BaseEthersClient {
221
227
  public async setFileUrlAndHash(
222
228
  url: string,
223
229
  urlKey = 'url',
224
- txOptions: Overrides = {}
230
+ txOptions: TransactionOverrides = {}
225
231
  ): Promise<void> {
226
232
  if (!isValidUrl(url)) {
227
233
  throw ErrorInvalidUrl;
@@ -233,13 +239,15 @@ export class KVStoreClient extends BaseEthersClient {
233
239
  const hashKey = urlKey + '_hash';
234
240
 
235
241
  try {
236
- await (
237
- await this.contract.setBulk(
238
- [urlKey, hashKey],
239
- [url, contentHash],
240
- txOptions
241
- )
242
- ).wait();
242
+ await this.sendTxAndWait(
243
+ (overrides) =>
244
+ this.contract.setBulk(
245
+ [urlKey, hashKey],
246
+ [url, contentHash],
247
+ overrides
248
+ ),
249
+ txOptions
250
+ );
243
251
  } catch (e) {
244
252
  if (e instanceof Error)
245
253
  throw Error(`Failed to set URL and hash: ${e.message}`);
package/src/staking.ts CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  Staking,
7
7
  Staking__factory,
8
8
  } from '@human-protocol/core/typechain-types';
9
- import { ContractRunner, Overrides, ethers } from 'ethers';
9
+ import { ContractRunner, ethers } from 'ethers';
10
10
  import { BaseEthersClient } from './base';
11
11
  import { NETWORKS } from './constants';
12
12
  import { requiresSigner } from './decorators';
@@ -29,7 +29,7 @@ import {
29
29
  SubgraphOptions,
30
30
  } from './interfaces';
31
31
  import { StakerData } from './graphql';
32
- import { NetworkData } from './types';
32
+ import { NetworkData, TransactionOverrides } from './types';
33
33
  import { getSubgraphUrl, customGqlFetch, throwError } from './utils';
34
34
  import {
35
35
  GET_STAKER_BY_ADDRESS_QUERY,
@@ -194,7 +194,7 @@ export class StakingClient extends BaseEthersClient {
194
194
  @requiresSigner
195
195
  public async approveStake(
196
196
  amount: bigint,
197
- txOptions: Overrides = {}
197
+ txOptions: TransactionOverrides = {}
198
198
  ): Promise<void> {
199
199
  if (typeof amount !== 'bigint') {
200
200
  throw ErrorInvalidStakingValueType;
@@ -205,13 +205,15 @@ export class StakingClient extends BaseEthersClient {
205
205
  }
206
206
 
207
207
  try {
208
- await (
209
- await this.tokenContract.approve(
210
- await this.stakingContract.getAddress(),
211
- amount,
212
- txOptions
213
- )
214
- ).wait();
208
+ await this.sendTxAndWait(
209
+ async (overrides) =>
210
+ this.tokenContract.approve(
211
+ await this.stakingContract.getAddress(),
212
+ amount,
213
+ overrides
214
+ ),
215
+ txOptions
216
+ );
215
217
  return;
216
218
  } catch (e) {
217
219
  return throwError(e);
@@ -240,7 +242,10 @@ export class StakingClient extends BaseEthersClient {
240
242
  * ```
241
243
  */
242
244
  @requiresSigner
243
- public async stake(amount: bigint, txOptions: Overrides = {}): Promise<void> {
245
+ public async stake(
246
+ amount: bigint,
247
+ txOptions: TransactionOverrides = {}
248
+ ): Promise<void> {
244
249
  if (typeof amount !== 'bigint') {
245
250
  throw ErrorInvalidStakingValueType;
246
251
  }
@@ -250,7 +255,10 @@ export class StakingClient extends BaseEthersClient {
250
255
  }
251
256
 
252
257
  try {
253
- await (await this.stakingContract.stake(amount, txOptions)).wait();
258
+ await this.sendTxAndWait(
259
+ (overrides) => this.stakingContract.stake(amount, overrides),
260
+ txOptions
261
+ );
254
262
  return;
255
263
  } catch (e) {
256
264
  return throwError(e);
@@ -280,7 +288,7 @@ export class StakingClient extends BaseEthersClient {
280
288
  @requiresSigner
281
289
  public async unstake(
282
290
  amount: bigint,
283
- txOptions: Overrides = {}
291
+ txOptions: TransactionOverrides = {}
284
292
  ): Promise<void> {
285
293
  if (typeof amount !== 'bigint') {
286
294
  throw ErrorInvalidStakingValueType;
@@ -291,7 +299,10 @@ export class StakingClient extends BaseEthersClient {
291
299
  }
292
300
 
293
301
  try {
294
- await (await this.stakingContract.unstake(amount, txOptions)).wait();
302
+ await this.sendTxAndWait(
303
+ (overrides) => this.stakingContract.unstake(amount, overrides),
304
+ txOptions
305
+ );
295
306
  return;
296
307
  } catch (e) {
297
308
  return throwError(e);
@@ -312,9 +323,12 @@ export class StakingClient extends BaseEthersClient {
312
323
  * ```
313
324
  */
314
325
  @requiresSigner
315
- public async withdraw(txOptions: Overrides = {}): Promise<void> {
326
+ public async withdraw(txOptions: TransactionOverrides = {}): Promise<void> {
316
327
  try {
317
- await (await this.stakingContract.withdraw(txOptions)).wait();
328
+ await this.sendTxAndWait(
329
+ (overrides) => this.stakingContract.withdraw(overrides),
330
+ txOptions
331
+ );
318
332
  return;
319
333
  } catch (e) {
320
334
  return throwError(e);
@@ -356,7 +370,7 @@ export class StakingClient extends BaseEthersClient {
356
370
  staker: string,
357
371
  escrowAddress: string,
358
372
  amount: bigint,
359
- txOptions: Overrides = {}
373
+ txOptions: TransactionOverrides = {}
360
374
  ): Promise<void> {
361
375
  if (typeof amount !== 'bigint') {
362
376
  throw ErrorInvalidStakingValueType;
@@ -377,15 +391,17 @@ export class StakingClient extends BaseEthersClient {
377
391
  await this.checkValidEscrow(escrowAddress);
378
392
 
379
393
  try {
380
- await (
381
- await this.stakingContract.slash(
382
- slasher,
383
- staker,
384
- escrowAddress,
385
- amount,
386
- txOptions
387
- )
388
- ).wait();
394
+ await this.sendTxAndWait(
395
+ (overrides) =>
396
+ this.stakingContract.slash(
397
+ slasher,
398
+ staker,
399
+ escrowAddress,
400
+ amount,
401
+ overrides
402
+ ),
403
+ txOptions
404
+ );
389
405
 
390
406
  return;
391
407
  } catch (e) {
@@ -129,8 +129,8 @@ export class TransactionUtils {
129
129
  * token?: string; // (Optional) The token address to filter transactions.
130
130
  * startDate?: Date; // (Optional) The start date to filter transactions (inclusive).
131
131
  * endDate?: Date; // (Optional) The end date to filter transactions (inclusive).
132
- * startBlock?: number; // (Optional) The start block number to filter transactions (inclusive).
133
- * endBlock?: number; // (Optional) The end block number to filter transactions (inclusive).
132
+ * startBlock?: bigint | number; // (Optional) The start block to filter transactions (inclusive).
133
+ * endBlock?: bigint | number; // (Optional) The end block to filter transactions (inclusive).
134
134
  * first?: number; // (Optional) Number of transactions per page. Default is 10.
135
135
  * skip?: number; // (Optional) Number of transactions to skip. Default is 0.
136
136
  * orderDirection?: OrderDirection; // (Optional) Order of the results. Default is DESC.
@@ -220,8 +220,8 @@ export class TransactionUtils {
220
220
  ? getUnixTimestamp(filter?.startDate)
221
221
  : undefined,
222
222
  endDate: filter.endDate ? getUnixTimestamp(filter.endDate) : undefined,
223
- startBlock: filter.startBlock ? filter.startBlock : undefined,
224
- endBlock: filter.endBlock ? filter.endBlock : undefined,
223
+ startBlock: filter.startBlock ? Number(filter.startBlock) : undefined,
224
+ endBlock: filter.endBlock ? Number(filter.endBlock) : undefined,
225
225
  method: filter.method ? filter.method : undefined,
226
226
  escrow: filter.escrow ? filter.escrow : undefined,
227
227
  token: filter.token ? filter.token : undefined,