@human-protocol/sdk 1.1.19 → 2.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 (53) hide show
  1. package/dist/base.d.ts +4 -5
  2. package/dist/base.d.ts.map +1 -1
  3. package/dist/base.js +3 -3
  4. package/dist/decorators.d.ts.map +1 -1
  5. package/dist/decorators.js +4 -2
  6. package/dist/error.d.ts +0 -6
  7. package/dist/error.d.ts.map +1 -1
  8. package/dist/error.js +2 -14
  9. package/dist/escrow.d.ts +23 -24
  10. package/dist/escrow.d.ts.map +1 -1
  11. package/dist/escrow.js +86 -90
  12. package/dist/graphql/queries/{staking.d.ts → operator.d.ts} +2 -1
  13. package/dist/graphql/queries/operator.d.ts.map +1 -0
  14. package/dist/graphql/queries/{staking.js → operator.js} +24 -1
  15. package/dist/graphql/types.d.ts +5 -6
  16. package/dist/graphql/types.d.ts.map +1 -1
  17. package/dist/index.d.ts +2 -1
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +3 -1
  20. package/dist/interfaces.d.ts +28 -18
  21. package/dist/interfaces.d.ts.map +1 -1
  22. package/dist/kvstore.d.ts +8 -9
  23. package/dist/kvstore.d.ts.map +1 -1
  24. package/dist/kvstore.js +18 -31
  25. package/dist/operator.d.ts +68 -0
  26. package/dist/operator.d.ts.map +1 -0
  27. package/dist/operator.js +153 -0
  28. package/dist/staking.d.ts +24 -91
  29. package/dist/staking.d.ts.map +1 -1
  30. package/dist/staking.js +47 -166
  31. package/dist/statistics.d.ts.map +1 -1
  32. package/dist/statistics.js +7 -6
  33. package/dist/types.d.ts +1 -2
  34. package/dist/types.d.ts.map +1 -1
  35. package/dist/utils.d.ts +0 -7
  36. package/dist/utils.d.ts.map +1 -1
  37. package/dist/utils.js +8 -28
  38. package/package.json +4 -4
  39. package/src/base.ts +5 -6
  40. package/src/decorators.ts +3 -2
  41. package/src/error.ts +0 -12
  42. package/src/escrow.ts +101 -114
  43. package/src/graphql/queries/{staking.ts → operator.ts} +24 -0
  44. package/src/graphql/types.ts +5 -7
  45. package/src/index.ts +2 -0
  46. package/src/interfaces.ts +30 -18
  47. package/src/kvstore.ts +20 -38
  48. package/src/operator.ts +192 -0
  49. package/src/staking.ts +49 -182
  50. package/src/statistics.ts +8 -9
  51. package/src/types.ts +1 -3
  52. package/src/utils.ts +7 -29
  53. package/dist/graphql/queries/staking.d.ts.map +0 -1
package/dist/staking.d.ts CHANGED
@@ -1,19 +1,18 @@
1
- import { Provider } from '@ethersproject/abstract-provider';
2
1
  import { EscrowFactory, HMToken, RewardPool, Staking } from '@human-protocol/core/typechain-types';
3
- import { BigNumber, Overrides, Signer } from 'ethers';
2
+ import { ContractRunner, Overrides } from 'ethers';
4
3
  import { BaseEthersClient } from './base';
5
- import { IAllocation, ILeader, ILeadersFilter, IReward } from './interfaces';
4
+ import { IAllocation } from './interfaces';
6
5
  import { NetworkData } from './types';
7
6
  /**
8
7
  * ## Introduction
9
8
  *
10
9
  * This client enables to perform actions on staking contracts and obtain staking information from both the contracts and subgraph.
11
10
  *
12
- * Internally, the SDK will use one network or another according to the network ID of the `signerOrProvider`.
11
+ * Internally, the SDK will use one network or another according to the network ID of the `runner`.
13
12
  * To use this client, it is recommended to initialize it using the static `build` method.
14
13
  *
15
14
  * ```ts
16
- * static async build(signerOrProvider: Signer | Provider);
15
+ * static async build(runner: ContractRunner);
17
16
  * ```
18
17
  *
19
18
  * A `Signer` or a `Provider` should be passed depending on the use case of this module:
@@ -81,21 +80,21 @@ export declare class StakingClient extends BaseEthersClient {
81
80
  /**
82
81
  * **StakingClient constructor**
83
82
  *
84
- * @param {Signer | Provider} signerOrProvider - The Signer or Provider object to interact with the Ethereum network
83
+ * @param {ContractRunner} runner - The Runner object to interact with the Ethereum network
85
84
  * @param {NetworkData} network - The network information required to connect to the Staking contract
86
85
  */
87
- constructor(signerOrProvider: Signer | Provider, networkData: NetworkData);
86
+ constructor(runner: ContractRunner, networkData: NetworkData);
88
87
  /**
89
- * Creates an instance of StakingClient from a Signer or Provider.
88
+ * Creates an instance of StakingClient from a Runner.
90
89
  *
91
- * @param {Signer | Provider} signerOrProvider - The Signer or Provider object to interact with the Ethereum network
90
+ * @param {ContractRunner} runner - The Runner object to interact with the Ethereum network
92
91
  * @param {number | undefined} gasPriceMultiplier - The multiplier to apply to the gas price
93
92
  *
94
93
  * @returns {Promise<StakingClient>} - An instance of StakingClient
95
94
  * @throws {ErrorProviderDoesNotExist} - Thrown if the provider does not exist for the provided Signer
96
95
  * @throws {ErrorUnsupportedChainID} - Thrown if the network's chainId is not supported
97
96
  */
98
- static build(signerOrProvider: Signer | Provider): Promise<StakingClient>;
97
+ static build(runner: ContractRunner): Promise<StakingClient>;
99
98
  /**
100
99
  * Check if escrow exists
101
100
  *
@@ -105,7 +104,7 @@ export declare class StakingClient extends BaseEthersClient {
105
104
  /**
106
105
  * This function approves the staking contract to transfer a specified amount of tokens when the user stakes. It increases the allowance for the staking contract.
107
106
  *
108
- * @param {BigNumber} amount Amount in WEI of tokens to approve for stake.
107
+ * @param {bigint} amount Amount in WEI of tokens to approve for stake.
109
108
  * @param {Overrides} [txOptions] - Additional transaction parameters (optional, defaults to an empty object).
110
109
  * @returns Returns void if successful. Throws error if any.
111
110
  *
@@ -123,17 +122,17 @@ export declare class StakingClient extends BaseEthersClient {
123
122
  * const signer = new Wallet(privateKey, provider);
124
123
  * const stakingClient = await StakingClient.build(signer);
125
124
  *
126
- * const amount = ethers.utils.parseUnits(5, 'ether'); //convert from ETH to WEI
125
+ * const amount = ethers.parseUnits(5, 'ether'); //convert from ETH to WEI
127
126
  * await stakingClient.approveStake(amount);
128
127
  * ```
129
128
  */
130
- approveStake(amount: BigNumber, txOptions?: Overrides): Promise<void>;
129
+ approveStake(amount: bigint, txOptions?: Overrides): Promise<void>;
131
130
  /**
132
131
  * This function stakes a specified amount of tokens on a specific network.
133
132
  *
134
133
  * > `approveStake` must be called before
135
134
  *
136
- * @param {BigNumber} amount Amount in WEI of tokens to stake.
135
+ * @param {bigint} amount Amount in WEI of tokens to stake.
137
136
  * @param {Overrides} [txOptions] - Additional transaction parameters (optional, defaults to an empty object).
138
137
  * @returns Returns void if successful. Throws error if any.
139
138
  *
@@ -151,18 +150,18 @@ export declare class StakingClient extends BaseEthersClient {
151
150
  * const signer = new Wallet(privateKey, provider);
152
151
  * const stakingClient = await StakingClient.build(signer);
153
152
  *
154
- * const amount = ethers.utils.parseUnits(5, 'ether'); //convert from ETH to WEI
153
+ * const amount = ethers.parseUnits(5, 'ether'); //convert from ETH to WEI
155
154
  * await stakingClient.approveStake(amount); // if it was already approved before, this is not necessary
156
155
  * await stakingClient.approveStake(amount);
157
156
  * ```
158
157
  */
159
- stake(amount: BigNumber, txOptions?: Overrides): Promise<void>;
158
+ stake(amount: bigint, txOptions?: Overrides): Promise<void>;
160
159
  /**
161
160
  * This function unstakes tokens from staking contract. The unstaked tokens stay locked for a period of time.
162
161
  *
163
162
  * > Must have tokens available to unstake
164
163
  *
165
- * @param {BigNumber} amount Amount in WEI of tokens to unstake.
164
+ * @param {bigint} amount Amount in WEI of tokens to unstake.
166
165
  * @param {Overrides} [txOptions] - Additional transaction parameters (optional, defaults to an empty object).
167
166
  * @returns Returns void if successful. Throws error if any.
168
167
  *
@@ -180,11 +179,11 @@ export declare class StakingClient extends BaseEthersClient {
180
179
  * const signer = new Wallet(privateKey, provider);
181
180
  * const stakingClient = await StakingClient.build(signer);
182
181
  *
183
- * const amount = ethers.utils.parseUnits(5, 'ether'); //convert from ETH to WEI
182
+ * const amount = ethers.parseUnits(5, 'ether'); //convert from ETH to WEI
184
183
  * await stakingClient.unstake(amount);
185
184
  * ```
186
185
  */
187
- unstake(amount: BigNumber, txOptions?: Overrides): Promise<void>;
186
+ unstake(amount: bigint, txOptions?: Overrides): Promise<void>;
188
187
  /**
189
188
  * This function withdraws unstaked and non locked tokens form staking contract to the user wallet.
190
189
  *
@@ -218,7 +217,7 @@ export declare class StakingClient extends BaseEthersClient {
218
217
  * @param {string} staker Wallet address from who is going to be slashed
219
218
  * @param {string} escrowAddress Address of the escrow which allocation will be slashed
220
219
  * @param {Overrides} [txOptions] - Additional transaction parameters (optional, defaults to an empty object).
221
- * @param {BigNumber} amount Amount in WEI of tokens to unstake.
220
+ * @param {bigint} amount Amount in WEI of tokens to unstake.
222
221
  * @returns Returns void if successful. Throws error if any.
223
222
  *
224
223
  *
@@ -235,11 +234,11 @@ export declare class StakingClient extends BaseEthersClient {
235
234
  * const signer = new Wallet(privateKey, provider);
236
235
  * const stakingClient = await StakingClient.build(signer);
237
236
  *
238
- * const amount = ethers.utils.parseUnits(5, 'ether'); //convert from ETH to WEI
237
+ * const amount = ethers.parseUnits(5, 'ether'); //convert from ETH to WEI
239
238
  * await stakingClient.slash('0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266', '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266', '0x62dD51230A30401C455c8398d06F85e4EaB6309f', amount);
240
239
  * ```
241
240
  */
242
- slash(slasher: string, staker: string, escrowAddress: string, amount: BigNumber, txOptions?: Overrides): Promise<void>;
241
+ slash(slasher: string, staker: string, escrowAddress: string, amount: bigint, txOptions?: Overrides): Promise<void>;
243
242
  /**
244
243
  * This function allocates a portion of the staked tokens to a specific escrow.
245
244
  *
@@ -247,7 +246,7 @@ export declare class StakingClient extends BaseEthersClient {
247
246
  *
248
247
  * @param {string} escrowAddress Address of the escrow contract to allocate in.
249
248
  * @param {Overrides} [txOptions] - Additional transaction parameters (optional, defaults to an empty object).
250
- * @param {BigNumber} amount Amount in WEI of tokens to allocate.
249
+ * @param {bigint} amount Amount in WEI of tokens to allocate.
251
250
  * @returns Returns void if successful. Throws error if any.
252
251
  *
253
252
  *
@@ -264,11 +263,11 @@ export declare class StakingClient extends BaseEthersClient {
264
263
  * const signer = new Wallet(privateKey, provider);
265
264
  * const stakingClient = await StakingClient.build(signer);
266
265
  *
267
- * const amount = ethers.utils.parseUnits(5, 'ether'); //convert from ETH to WEI
266
+ * const amount = ethers.parseUnits(5, 'ether'); //convert from ETH to WEI
268
267
  * await stakingClient.allocate('0x62dD51230A30401C455c8398d06F85e4EaB6309f', amount);
269
268
  * ```
270
269
  */
271
- allocate(escrowAddress: string, amount: BigNumber, txOptions?: Overrides): Promise<void>;
270
+ allocate(escrowAddress: string, amount: bigint, txOptions?: Overrides): Promise<void>;
272
271
  /**
273
272
  * This function drops the allocation from a specific escrow.
274
273
  *
@@ -324,50 +323,6 @@ export declare class StakingClient extends BaseEthersClient {
324
323
  * ```
325
324
  */
326
325
  distributeReward(escrowAddress: string, txOptions?: Overrides): Promise<void>;
327
- /**
328
- * This function returns all the leader details of the protocol.
329
- *
330
- * @param {ILeadersFilter} filter Filter for the leaders.
331
- * @returns {ILeader[]} Returns an array with all the leader details.
332
- *
333
- *
334
- * **Code example**
335
- *
336
- * ```ts
337
- * import { StakingClient } from '@human-protocol/sdk';
338
- * import { providers } from 'ethers';
339
- *
340
- * const rpcUrl = 'YOUR_RPC_URL';
341
- *
342
- * const provider = new providers.JsonRpcProvider(rpcUrl);
343
- * const stakingClient = await StakingClient.build(provider);
344
- *
345
- * const leaders = await stakingClient.getLeaders();
346
- * ```
347
- */
348
- getLeader(address: string): Promise<ILeader>;
349
- /**
350
- * This function returns the leader data for the given address.
351
- *
352
- * @param {string} address Leader address.
353
- * @returns {ILeader} Returns the leader details.
354
- *
355
- *
356
- * **Code example**
357
- *
358
- * ```ts
359
- * import { StakingClient } from '@human-protocol/sdk';
360
- * import { providers } from 'ethers';
361
- *
362
- * const rpcUrl = 'YOUR_RPC_URL';
363
- *
364
- * const provider = new providers.JsonRpcProvider(rpcUrl);
365
- * const stakingClient = await StakingClient.build(provider);
366
- *
367
- * const leader = await stakingClient.getLeader('0x62dD51230A30401C455c8398d06F85e4EaB6309f');
368
- * ```
369
- */
370
- getLeaders(filter?: ILeadersFilter): Promise<ILeader[]>;
371
326
  /**
372
327
  * This function returns information about the allocation of the specified escrow.
373
328
  *
@@ -390,27 +345,5 @@ export declare class StakingClient extends BaseEthersClient {
390
345
  * ```
391
346
  */
392
347
  getAllocation(escrowAddress: string): Promise<IAllocation>;
393
- /**
394
- * This function returns information about the rewards for a given slasher address.
395
- *
396
- * @param {string} slasherAddress Slasher address.
397
- * @returns {IReward[]} Returns an array of Reward objects that contain the rewards earned by the user through slashing other users.
398
- *
399
- *
400
- * **Code example**
401
- *
402
- * ```ts
403
- * import { StakingClient } from '@human-protocol/sdk';
404
- * import { providers } from 'ethers';
405
- *
406
- * const rpcUrl = 'YOUR_RPC_URL';
407
- *
408
- * const provider = new providers.JsonRpcProvider(rpcUrl);
409
- * const stakingClient = await StakingClient.build(provider);
410
- *
411
- * const rewards = await stakingClient.getRewards('0x62dD51230A30401C455c8398d06F85e4EaB6309f');
412
- * ```
413
- */
414
- getRewards(slasherAddress: string): Promise<IReward[]>;
415
348
  }
416
349
  //# sourceMappingURL=staking.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"staking.d.ts","sourceRoot":"","sources":["../src/staking.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAE5D,OAAO,EACL,aAAa,EAEb,OAAO,EAEP,UAAU,EAEV,OAAO,EAER,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAU,MAAM,QAAQ,CAAC;AAE9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAc1C,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAMtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoEG;AACH,qBAAa,aAAc,SAAQ,gBAAgB;IAC1C,aAAa,EAAE,OAAO,CAAC;IACvB,eAAe,EAAE,OAAO,CAAC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3B,aAAa,EAAE,MAAM,EACrB,SAAS,GAAE,SAAc,GACxB,OAAO,CAAC,IAAI,CAAC;IAahB;;;;;;;;;;;;;;;;;;;;OAoBG;IACU,aAAa,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;CAUxE"}
package/dist/staking.js CHANGED
@@ -8,31 +8,25 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
8
8
  var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
11
  Object.defineProperty(exports, "__esModule", { value: true });
15
12
  exports.StakingClient = void 0;
16
13
  const typechain_types_1 = require("@human-protocol/core/typechain-types");
17
14
  const ethers_1 = require("ethers");
18
- const graphql_request_1 = __importDefault(require("graphql-request"));
19
15
  const base_1 = require("./base");
20
16
  const constants_1 = require("./constants");
21
17
  const decorators_1 = require("./decorators");
22
18
  const error_1 = require("./error");
23
19
  const utils_1 = require("./utils");
24
- const reward_1 = require("./graphql/queries/reward");
25
- const staking_1 = require("./graphql/queries/staking");
26
20
  /**
27
21
  * ## Introduction
28
22
  *
29
23
  * This client enables to perform actions on staking contracts and obtain staking information from both the contracts and subgraph.
30
24
  *
31
- * Internally, the SDK will use one network or another according to the network ID of the `signerOrProvider`.
25
+ * Internally, the SDK will use one network or another according to the network ID of the `runner`.
32
26
  * To use this client, it is recommended to initialize it using the static `build` method.
33
27
  *
34
28
  * ```ts
35
- * static async build(signerOrProvider: Signer | Provider);
29
+ * static async build(runner: ContractRunner);
36
30
  * ```
37
31
  *
38
32
  * A `Signer` or a `Provider` should be passed depending on the use case of this module:
@@ -96,43 +90,37 @@ class StakingClient extends base_1.BaseEthersClient {
96
90
  /**
97
91
  * **StakingClient constructor**
98
92
  *
99
- * @param {Signer | Provider} signerOrProvider - The Signer or Provider object to interact with the Ethereum network
93
+ * @param {ContractRunner} runner - The Runner object to interact with the Ethereum network
100
94
  * @param {NetworkData} network - The network information required to connect to the Staking contract
101
95
  */
102
- constructor(signerOrProvider, networkData) {
103
- super(signerOrProvider, networkData);
104
- this.stakingContract = typechain_types_1.Staking__factory.connect(networkData.stakingAddress, signerOrProvider);
105
- this.escrowFactoryContract = typechain_types_1.EscrowFactory__factory.connect(networkData.factoryAddress, signerOrProvider);
106
- this.tokenContract = typechain_types_1.HMToken__factory.connect(networkData.hmtAddress, signerOrProvider);
107
- this.rewardPoolContract = typechain_types_1.RewardPool__factory.connect(networkData.rewardPoolAddress, this.signerOrProvider);
96
+ constructor(runner, networkData) {
97
+ super(runner, networkData);
98
+ this.stakingContract = typechain_types_1.Staking__factory.connect(networkData.stakingAddress, runner);
99
+ this.escrowFactoryContract = typechain_types_1.EscrowFactory__factory.connect(networkData.factoryAddress, runner);
100
+ this.tokenContract = typechain_types_1.HMToken__factory.connect(networkData.hmtAddress, runner);
101
+ this.rewardPoolContract = typechain_types_1.RewardPool__factory.connect(networkData.rewardPoolAddress, this.runner);
108
102
  }
109
103
  /**
110
- * Creates an instance of StakingClient from a Signer or Provider.
104
+ * Creates an instance of StakingClient from a Runner.
111
105
  *
112
- * @param {Signer | Provider} signerOrProvider - The Signer or Provider object to interact with the Ethereum network
106
+ * @param {ContractRunner} runner - The Runner object to interact with the Ethereum network
113
107
  * @param {number | undefined} gasPriceMultiplier - The multiplier to apply to the gas price
114
108
  *
115
109
  * @returns {Promise<StakingClient>} - An instance of StakingClient
116
110
  * @throws {ErrorProviderDoesNotExist} - Thrown if the provider does not exist for the provided Signer
117
111
  * @throws {ErrorUnsupportedChainID} - Thrown if the network's chainId is not supported
118
112
  */
119
- static async build(signerOrProvider) {
120
- let network;
121
- if (ethers_1.Signer.isSigner(signerOrProvider)) {
122
- if (!signerOrProvider.provider) {
123
- throw error_1.ErrorProviderDoesNotExist;
124
- }
125
- network = await signerOrProvider.provider.getNetwork();
126
- }
127
- else {
128
- network = await signerOrProvider.getNetwork();
129
- }
130
- const chainId = network.chainId;
113
+ static async build(runner) {
114
+ if (!runner.provider) {
115
+ throw error_1.ErrorProviderDoesNotExist;
116
+ }
117
+ const network = await runner.provider?.getNetwork();
118
+ const chainId = Number(network?.chainId);
131
119
  const networkData = constants_1.NETWORKS[chainId];
132
120
  if (!networkData) {
133
121
  throw error_1.ErrorUnsupportedChainID;
134
122
  }
135
- return new StakingClient(signerOrProvider, networkData);
123
+ return new StakingClient(runner, networkData);
136
124
  }
137
125
  /**
138
126
  * Check if escrow exists
@@ -140,7 +128,7 @@ class StakingClient extends base_1.BaseEthersClient {
140
128
  * @param escrowAddress Escrow address to check against
141
129
  */
142
130
  async checkValidEscrow(escrowAddress) {
143
- if (!ethers_1.ethers.utils.isAddress(escrowAddress)) {
131
+ if (!ethers_1.ethers.isAddress(escrowAddress)) {
144
132
  throw error_1.ErrorInvalidEscrowAddressProvided;
145
133
  }
146
134
  if (!(await this.escrowFactoryContract.hasEscrow(escrowAddress))) {
@@ -150,7 +138,7 @@ class StakingClient extends base_1.BaseEthersClient {
150
138
  /**
151
139
  * This function approves the staking contract to transfer a specified amount of tokens when the user stakes. It increases the allowance for the staking contract.
152
140
  *
153
- * @param {BigNumber} amount Amount in WEI of tokens to approve for stake.
141
+ * @param {bigint} amount Amount in WEI of tokens to approve for stake.
154
142
  * @param {Overrides} [txOptions] - Additional transaction parameters (optional, defaults to an empty object).
155
143
  * @returns Returns void if successful. Throws error if any.
156
144
  *
@@ -168,19 +156,19 @@ class StakingClient extends base_1.BaseEthersClient {
168
156
  * const signer = new Wallet(privateKey, provider);
169
157
  * const stakingClient = await StakingClient.build(signer);
170
158
  *
171
- * const amount = ethers.utils.parseUnits(5, 'ether'); //convert from ETH to WEI
159
+ * const amount = ethers.parseUnits(5, 'ether'); //convert from ETH to WEI
172
160
  * await stakingClient.approveStake(amount);
173
161
  * ```
174
162
  */
175
163
  async approveStake(amount, txOptions = {}) {
176
- if (!ethers_1.BigNumber.isBigNumber(amount)) {
164
+ if (typeof amount !== 'bigint') {
177
165
  throw error_1.ErrorInvalidStakingValueType;
178
166
  }
179
- if (amount.isNegative()) {
167
+ if (amount < 0n) {
180
168
  throw error_1.ErrorInvalidStakingValueSign;
181
169
  }
182
170
  try {
183
- await (await this.tokenContract.approve(this.stakingContract.address, amount, txOptions)).wait();
171
+ await (await this.tokenContract.approve(await this.stakingContract.getAddress(), amount, txOptions)).wait();
184
172
  return;
185
173
  }
186
174
  catch (e) {
@@ -192,7 +180,7 @@ class StakingClient extends base_1.BaseEthersClient {
192
180
  *
193
181
  * > `approveStake` must be called before
194
182
  *
195
- * @param {BigNumber} amount Amount in WEI of tokens to stake.
183
+ * @param {bigint} amount Amount in WEI of tokens to stake.
196
184
  * @param {Overrides} [txOptions] - Additional transaction parameters (optional, defaults to an empty object).
197
185
  * @returns Returns void if successful. Throws error if any.
198
186
  *
@@ -210,16 +198,16 @@ class StakingClient extends base_1.BaseEthersClient {
210
198
  * const signer = new Wallet(privateKey, provider);
211
199
  * const stakingClient = await StakingClient.build(signer);
212
200
  *
213
- * const amount = ethers.utils.parseUnits(5, 'ether'); //convert from ETH to WEI
201
+ * const amount = ethers.parseUnits(5, 'ether'); //convert from ETH to WEI
214
202
  * await stakingClient.approveStake(amount); // if it was already approved before, this is not necessary
215
203
  * await stakingClient.approveStake(amount);
216
204
  * ```
217
205
  */
218
206
  async stake(amount, txOptions = {}) {
219
- if (!ethers_1.BigNumber.isBigNumber(amount)) {
207
+ if (typeof amount !== 'bigint') {
220
208
  throw error_1.ErrorInvalidStakingValueType;
221
209
  }
222
- if (amount.isNegative()) {
210
+ if (amount < 0n) {
223
211
  throw error_1.ErrorInvalidStakingValueSign;
224
212
  }
225
213
  try {
@@ -235,7 +223,7 @@ class StakingClient extends base_1.BaseEthersClient {
235
223
  *
236
224
  * > Must have tokens available to unstake
237
225
  *
238
- * @param {BigNumber} amount Amount in WEI of tokens to unstake.
226
+ * @param {bigint} amount Amount in WEI of tokens to unstake.
239
227
  * @param {Overrides} [txOptions] - Additional transaction parameters (optional, defaults to an empty object).
240
228
  * @returns Returns void if successful. Throws error if any.
241
229
  *
@@ -253,15 +241,15 @@ class StakingClient extends base_1.BaseEthersClient {
253
241
  * const signer = new Wallet(privateKey, provider);
254
242
  * const stakingClient = await StakingClient.build(signer);
255
243
  *
256
- * const amount = ethers.utils.parseUnits(5, 'ether'); //convert from ETH to WEI
244
+ * const amount = ethers.parseUnits(5, 'ether'); //convert from ETH to WEI
257
245
  * await stakingClient.unstake(amount);
258
246
  * ```
259
247
  */
260
248
  async unstake(amount, txOptions = {}) {
261
- if (!ethers_1.BigNumber.isBigNumber(amount)) {
249
+ if (typeof amount !== 'bigint') {
262
250
  throw error_1.ErrorInvalidStakingValueType;
263
251
  }
264
- if (amount.isNegative()) {
252
+ if (amount < 0n) {
265
253
  throw error_1.ErrorInvalidStakingValueSign;
266
254
  }
267
255
  try {
@@ -313,7 +301,7 @@ class StakingClient extends base_1.BaseEthersClient {
313
301
  * @param {string} staker Wallet address from who is going to be slashed
314
302
  * @param {string} escrowAddress Address of the escrow which allocation will be slashed
315
303
  * @param {Overrides} [txOptions] - Additional transaction parameters (optional, defaults to an empty object).
316
- * @param {BigNumber} amount Amount in WEI of tokens to unstake.
304
+ * @param {bigint} amount Amount in WEI of tokens to unstake.
317
305
  * @returns Returns void if successful. Throws error if any.
318
306
  *
319
307
  *
@@ -330,21 +318,21 @@ class StakingClient extends base_1.BaseEthersClient {
330
318
  * const signer = new Wallet(privateKey, provider);
331
319
  * const stakingClient = await StakingClient.build(signer);
332
320
  *
333
- * const amount = ethers.utils.parseUnits(5, 'ether'); //convert from ETH to WEI
321
+ * const amount = ethers.parseUnits(5, 'ether'); //convert from ETH to WEI
334
322
  * await stakingClient.slash('0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266', '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266', '0x62dD51230A30401C455c8398d06F85e4EaB6309f', amount);
335
323
  * ```
336
324
  */
337
325
  async slash(slasher, staker, escrowAddress, amount, txOptions = {}) {
338
- if (!ethers_1.BigNumber.isBigNumber(amount)) {
326
+ if (typeof amount !== 'bigint') {
339
327
  throw error_1.ErrorInvalidStakingValueType;
340
328
  }
341
- if (amount.isNegative()) {
329
+ if (amount < 0n) {
342
330
  throw error_1.ErrorInvalidStakingValueSign;
343
331
  }
344
- if (!ethers_1.ethers.utils.isAddress(slasher)) {
332
+ if (!ethers_1.ethers.isAddress(slasher)) {
345
333
  throw error_1.ErrorInvalidSlasherAddressProvided;
346
334
  }
347
- if (!ethers_1.ethers.utils.isAddress(staker)) {
335
+ if (!ethers_1.ethers.isAddress(staker)) {
348
336
  throw error_1.ErrorInvalidStakerAddressProvided;
349
337
  }
350
338
  await this.checkValidEscrow(escrowAddress);
@@ -363,7 +351,7 @@ class StakingClient extends base_1.BaseEthersClient {
363
351
  *
364
352
  * @param {string} escrowAddress Address of the escrow contract to allocate in.
365
353
  * @param {Overrides} [txOptions] - Additional transaction parameters (optional, defaults to an empty object).
366
- * @param {BigNumber} amount Amount in WEI of tokens to allocate.
354
+ * @param {bigint} amount Amount in WEI of tokens to allocate.
367
355
  * @returns Returns void if successful. Throws error if any.
368
356
  *
369
357
  *
@@ -380,15 +368,15 @@ class StakingClient extends base_1.BaseEthersClient {
380
368
  * const signer = new Wallet(privateKey, provider);
381
369
  * const stakingClient = await StakingClient.build(signer);
382
370
  *
383
- * const amount = ethers.utils.parseUnits(5, 'ether'); //convert from ETH to WEI
371
+ * const amount = ethers.parseUnits(5, 'ether'); //convert from ETH to WEI
384
372
  * await stakingClient.allocate('0x62dD51230A30401C455c8398d06F85e4EaB6309f', amount);
385
373
  * ```
386
374
  */
387
375
  async allocate(escrowAddress, amount, txOptions = {}) {
388
- if (!ethers_1.BigNumber.isBigNumber(amount)) {
376
+ if (typeof amount !== 'bigint') {
389
377
  throw error_1.ErrorInvalidStakingValueType;
390
378
  }
391
- if (amount.isNegative()) {
379
+ if (amount < 0n) {
392
380
  throw error_1.ErrorInvalidStakingValueSign;
393
381
  }
394
382
  await this.checkValidEscrow(escrowAddress);
@@ -473,73 +461,6 @@ class StakingClient extends base_1.BaseEthersClient {
473
461
  return (0, utils_1.throwError)(e);
474
462
  }
475
463
  }
476
- /**
477
- * This function returns all the leader details of the protocol.
478
- *
479
- * @param {ILeadersFilter} filter Filter for the leaders.
480
- * @returns {ILeader[]} Returns an array with all the leader details.
481
- *
482
- *
483
- * **Code example**
484
- *
485
- * ```ts
486
- * import { StakingClient } from '@human-protocol/sdk';
487
- * import { providers } from 'ethers';
488
- *
489
- * const rpcUrl = 'YOUR_RPC_URL';
490
- *
491
- * const provider = new providers.JsonRpcProvider(rpcUrl);
492
- * const stakingClient = await StakingClient.build(provider);
493
- *
494
- * const leaders = await stakingClient.getLeaders();
495
- * ```
496
- */
497
- async getLeader(address) {
498
- if (!ethers_1.ethers.utils.isAddress(address)) {
499
- throw error_1.ErrorInvalidStakerAddressProvided;
500
- }
501
- try {
502
- const { leader } = await (0, graphql_request_1.default)(this.networkData.subgraphUrl, staking_1.GET_LEADER_QUERY, {
503
- address: address.toLowerCase(),
504
- });
505
- return leader;
506
- }
507
- catch (e) {
508
- return (0, utils_1.throwError)(e);
509
- }
510
- }
511
- /**
512
- * This function returns the leader data for the given address.
513
- *
514
- * @param {string} address Leader address.
515
- * @returns {ILeader} Returns the leader details.
516
- *
517
- *
518
- * **Code example**
519
- *
520
- * ```ts
521
- * import { StakingClient } from '@human-protocol/sdk';
522
- * import { providers } from 'ethers';
523
- *
524
- * const rpcUrl = 'YOUR_RPC_URL';
525
- *
526
- * const provider = new providers.JsonRpcProvider(rpcUrl);
527
- * const stakingClient = await StakingClient.build(provider);
528
- *
529
- * const leader = await stakingClient.getLeader('0x62dD51230A30401C455c8398d06F85e4EaB6309f');
530
- * ```
531
- */
532
- async getLeaders(filter = {}) {
533
- try {
534
- const { leaders } = await (0, graphql_request_1.default)(this.networkData.subgraphUrl, (0, staking_1.GET_LEADERS_QUERY)(filter), {
535
- role: filter.role,
536
- });
537
- return leaders;
538
- }
539
- catch (e) {
540
- return (0, utils_1.throwError)(e);
541
- }
542
- }
543
464
  /**
544
465
  * This function returns information about the allocation of the specified escrow.
545
466
  *
@@ -571,63 +492,23 @@ class StakingClient extends base_1.BaseEthersClient {
571
492
  return (0, utils_1.throwError)(e);
572
493
  }
573
494
  }
574
- /**
575
- * This function returns information about the rewards for a given slasher address.
576
- *
577
- * @param {string} slasherAddress Slasher address.
578
- * @returns {IReward[]} Returns an array of Reward objects that contain the rewards earned by the user through slashing other users.
579
- *
580
- *
581
- * **Code example**
582
- *
583
- * ```ts
584
- * import { StakingClient } from '@human-protocol/sdk';
585
- * import { providers } from 'ethers';
586
- *
587
- * const rpcUrl = 'YOUR_RPC_URL';
588
- *
589
- * const provider = new providers.JsonRpcProvider(rpcUrl);
590
- * const stakingClient = await StakingClient.build(provider);
591
- *
592
- * const rewards = await stakingClient.getRewards('0x62dD51230A30401C455c8398d06F85e4EaB6309f');
593
- * ```
594
- */
595
- async getRewards(slasherAddress) {
596
- if (!ethers_1.ethers.utils.isAddress(slasherAddress)) {
597
- throw error_1.ErrorInvalidSlasherAddressProvided;
598
- }
599
- try {
600
- const { rewardAddedEvents } = await (0, graphql_request_1.default)(this.networkData.subgraphUrl, reward_1.GET_REWARD_ADDED_EVENTS_QUERY, {
601
- slasherAddress: slasherAddress.toLowerCase(),
602
- });
603
- return rewardAddedEvents.map((reward) => {
604
- return {
605
- escrowAddress: reward.escrow,
606
- amount: reward.amount,
607
- };
608
- });
609
- }
610
- catch (e) {
611
- return (0, utils_1.throwError)(e);
612
- }
613
- }
614
495
  }
615
496
  __decorate([
616
497
  decorators_1.requiresSigner,
617
498
  __metadata("design:type", Function),
618
- __metadata("design:paramtypes", [ethers_1.BigNumber, Object]),
499
+ __metadata("design:paramtypes", [BigInt, Object]),
619
500
  __metadata("design:returntype", Promise)
620
501
  ], StakingClient.prototype, "approveStake", null);
621
502
  __decorate([
622
503
  decorators_1.requiresSigner,
623
504
  __metadata("design:type", Function),
624
- __metadata("design:paramtypes", [ethers_1.BigNumber, Object]),
505
+ __metadata("design:paramtypes", [BigInt, Object]),
625
506
  __metadata("design:returntype", Promise)
626
507
  ], StakingClient.prototype, "stake", null);
627
508
  __decorate([
628
509
  decorators_1.requiresSigner,
629
510
  __metadata("design:type", Function),
630
- __metadata("design:paramtypes", [ethers_1.BigNumber, Object]),
511
+ __metadata("design:paramtypes", [BigInt, Object]),
631
512
  __metadata("design:returntype", Promise)
632
513
  ], StakingClient.prototype, "unstake", null);
633
514
  __decorate([
@@ -639,13 +520,13 @@ __decorate([
639
520
  __decorate([
640
521
  decorators_1.requiresSigner,
641
522
  __metadata("design:type", Function),
642
- __metadata("design:paramtypes", [String, String, String, ethers_1.BigNumber, Object]),
523
+ __metadata("design:paramtypes", [String, String, String, BigInt, Object]),
643
524
  __metadata("design:returntype", Promise)
644
525
  ], StakingClient.prototype, "slash", null);
645
526
  __decorate([
646
527
  decorators_1.requiresSigner,
647
528
  __metadata("design:type", Function),
648
- __metadata("design:paramtypes", [String, ethers_1.BigNumber, Object]),
529
+ __metadata("design:paramtypes", [String, BigInt, Object]),
649
530
  __metadata("design:returntype", Promise)
650
531
  ], StakingClient.prototype, "allocate", null);
651
532
  __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"statistics.d.ts","sourceRoot":"","sources":["../src/statistics.ts"],"names":[],"mappings":"AAIA,OAAO,EAKL,gBAAgB,EAGhB,aAAa,EAEb,iBAAiB,EACjB,gBAAgB,EAEjB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAGtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,qBAAa,gBAAgB;IACpB,WAAW,EAAE,WAAW,CAAC;IAEhC;;;;OAIG;gBACS,WAAW,EAA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