@human-protocol/sdk 3.0.7 → 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.
- package/dist/constants.d.ts +2 -25
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +25 -66
- package/dist/decorators.js +1 -1
- package/dist/encryption.d.ts +21 -29
- package/dist/encryption.d.ts.map +1 -1
- package/dist/encryption.js +34 -36
- package/dist/error.d.ts +31 -28
- package/dist/error.d.ts.map +1 -1
- package/dist/error.js +36 -33
- package/dist/escrow.d.ts +118 -112
- package/dist/escrow.d.ts.map +1 -1
- package/dist/escrow.js +254 -180
- package/dist/graphql/queries/operator.d.ts.map +1 -1
- package/dist/graphql/queries/operator.js +15 -7
- package/dist/graphql/queries/statistics.d.ts.map +1 -1
- package/dist/graphql/queries/statistics.js +0 -2
- package/dist/graphql/queries/transaction.d.ts.map +1 -1
- package/dist/graphql/queries/transaction.js +23 -10
- package/dist/graphql/types.d.ts +0 -2
- package/dist/graphql/types.d.ts.map +1 -1
- package/dist/interfaces.d.ts +29 -12
- package/dist/interfaces.d.ts.map +1 -1
- package/dist/kvstore.d.ts +16 -16
- package/dist/kvstore.d.ts.map +1 -1
- package/dist/kvstore.js +16 -16
- package/dist/operator.d.ts +11 -10
- package/dist/operator.d.ts.map +1 -1
- package/dist/operator.js +36 -11
- package/dist/staking.d.ts +26 -118
- package/dist/staking.d.ts.map +1 -1
- package/dist/staking.js +46 -173
- package/dist/statistics.d.ts +10 -29
- package/dist/statistics.d.ts.map +1 -1
- package/dist/statistics.js +13 -30
- package/dist/storage.d.ts +13 -18
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +30 -25
- package/dist/transaction.js +1 -1
- package/dist/types.d.ts +23 -6
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -1
- package/dist/utils.d.ts +0 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +0 -1
- package/package.json +8 -4
- package/src/constants.ts +25 -66
- package/src/decorators.ts +1 -1
- package/src/encryption.ts +21 -29
- package/src/error.ts +39 -37
- package/src/escrow.ts +360 -216
- package/src/graphql/queries/operator.ts +15 -7
- package/src/graphql/queries/statistics.ts +0 -2
- package/src/graphql/queries/transaction.ts +23 -13
- package/src/graphql/types.ts +0 -2
- package/src/interfaces.ts +30 -13
- package/src/kvstore.ts +17 -17
- package/src/operator.ts +47 -12
- package/src/staking.ts +53 -187
- package/src/statistics.ts +13 -30
- package/src/storage.ts +13 -18
- package/src/transaction.ts +2 -2
- package/src/types.ts +24 -6
- package/src/utils.ts +0 -1
package/src/types.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { TransactionLike } from 'ethers';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Enum for escrow statuses.
|
|
3
5
|
* @readonly
|
|
@@ -21,7 +23,7 @@ export enum EscrowStatus {
|
|
|
21
23
|
*/
|
|
22
24
|
Paid,
|
|
23
25
|
/**
|
|
24
|
-
* Escrow is finished
|
|
26
|
+
* Escrow is finished.
|
|
25
27
|
*/
|
|
26
28
|
Complete,
|
|
27
29
|
/**
|
|
@@ -115,10 +117,6 @@ export type NetworkData = {
|
|
|
115
117
|
* Staking contract address
|
|
116
118
|
*/
|
|
117
119
|
stakingAddress: string;
|
|
118
|
-
/**
|
|
119
|
-
* RewardPool contract address
|
|
120
|
-
*/
|
|
121
|
-
rewardPoolAddress: string;
|
|
122
120
|
/**
|
|
123
121
|
* KVStore contract address
|
|
124
122
|
*/
|
|
@@ -128,7 +126,7 @@ export type NetworkData = {
|
|
|
128
126
|
*/
|
|
129
127
|
subgraphUrl: string;
|
|
130
128
|
/**
|
|
131
|
-
* Subgraph URL
|
|
129
|
+
* Subgraph URL API key
|
|
132
130
|
*/
|
|
133
131
|
subgraphUrlApiKey: string;
|
|
134
132
|
/**
|
|
@@ -154,3 +152,23 @@ export type EscrowCancel = {
|
|
|
154
152
|
*/
|
|
155
153
|
amountRefunded: bigint;
|
|
156
154
|
};
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Represents the response data for an escrow withdrawal.
|
|
158
|
+
*/
|
|
159
|
+
export type EscrowWithdraw = {
|
|
160
|
+
/**
|
|
161
|
+
* The hash of the transaction associated with the escrow withdrawal.
|
|
162
|
+
*/
|
|
163
|
+
txHash: string;
|
|
164
|
+
/**
|
|
165
|
+
* The address of the token used for the withdrawal.
|
|
166
|
+
*/
|
|
167
|
+
tokenAddress: string;
|
|
168
|
+
/**
|
|
169
|
+
* The amount withdrawn from the escrow.
|
|
170
|
+
*/
|
|
171
|
+
amountWithdrawn: bigint;
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
export type TransactionLikeWithNonce = TransactionLike & { nonce: number };
|