@human-protocol/sdk 1.1.3 → 1.1.6
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/README.md +80 -1
- package/dist/constants.d.ts +52 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +222 -0
- package/dist/decorators.d.ts +2 -0
- package/dist/decorators.d.ts.map +1 -0
- package/dist/decorators.js +17 -0
- package/dist/encryption.d.ts +84 -0
- package/dist/encryption.d.ts.map +1 -0
- package/dist/encryption.js +202 -0
- package/dist/enums.d.ts +17 -0
- package/dist/enums.d.ts.map +1 -0
- package/dist/enums.js +20 -0
- package/dist/error.d.ts +196 -0
- package/dist/error.d.ts.map +1 -0
- package/dist/error.js +229 -0
- package/dist/escrow.d.ts +201 -0
- package/dist/escrow.d.ts.map +1 -0
- package/dist/escrow.js +651 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +29 -0
- package/dist/interfaces.d.ts +42 -0
- package/dist/interfaces.d.ts.map +1 -0
- package/dist/interfaces.js +2 -0
- package/dist/kvstore.d.ts +51 -0
- package/dist/kvstore.d.ts.map +1 -0
- package/dist/kvstore.js +135 -0
- package/dist/queries.d.ts +5 -0
- package/dist/queries.d.ts.map +1 -0
- package/dist/queries.js +19 -0
- package/dist/staking.d.ts +130 -0
- package/dist/staking.d.ts.map +1 -0
- package/dist/staking.js +409 -0
- package/dist/storage.d.ts +49 -0
- package/dist/storage.d.ts.map +1 -0
- package/dist/storage.js +171 -0
- package/dist/types.d.ts +131 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +35 -0
- package/dist/utils.d.ts +32 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +99 -0
- package/package.json +4 -1
- package/src/constants.ts +25 -6
- package/src/encryption.ts +223 -0
- package/src/error.ts +2 -4
- package/src/escrow.ts +120 -74
- package/src/index.ts +6 -12
- package/src/interfaces.ts +10 -13
- package/src/kvstore.ts +51 -14
- package/src/queries.ts +15 -7
- package/src/staking.ts +61 -24
- package/src/storage.ts +15 -3
- package/src/types.ts +8 -0
- package/src/init.ts +0 -45
package/dist/enums.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare enum ChainId {
|
|
2
|
+
ALL = -1,
|
|
3
|
+
MAINNET = 1,
|
|
4
|
+
RINKEBY = 4,
|
|
5
|
+
GOERLI = 5,
|
|
6
|
+
BSC_MAINNET = 56,
|
|
7
|
+
BSC_TESTNET = 97,
|
|
8
|
+
POLYGON = 137,
|
|
9
|
+
POLYGON_MUMBAI = 80001,
|
|
10
|
+
MOONBEAM = 1284,
|
|
11
|
+
MOONBASE_ALPHA = 1287,
|
|
12
|
+
AVALANCHE_TESTNET = 43113,
|
|
13
|
+
AVALANCHE = 43114,
|
|
14
|
+
SKALE = 1273227453,
|
|
15
|
+
LOCALHOST = 1338
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=enums.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enums.d.ts","sourceRoot":"","sources":["../src/enums.ts"],"names":[],"mappings":"AAAA,oBAAY,OAAO;IACjB,GAAG,KAAK;IACR,OAAO,IAAI;IACX,OAAO,IAAI;IACX,MAAM,IAAI;IACV,WAAW,KAAK;IAChB,WAAW,KAAK;IAChB,OAAO,MAAM;IACb,cAAc,QAAQ;IACtB,QAAQ,OAAO;IACf,cAAc,OAAO;IACrB,iBAAiB,QAAQ;IACzB,SAAS,QAAQ;IACjB,KAAK,aAAa;IAClB,SAAS,OAAO;CACjB"}
|
package/dist/enums.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ChainId = void 0;
|
|
4
|
+
var ChainId;
|
|
5
|
+
(function (ChainId) {
|
|
6
|
+
ChainId[ChainId["ALL"] = -1] = "ALL";
|
|
7
|
+
ChainId[ChainId["MAINNET"] = 1] = "MAINNET";
|
|
8
|
+
ChainId[ChainId["RINKEBY"] = 4] = "RINKEBY";
|
|
9
|
+
ChainId[ChainId["GOERLI"] = 5] = "GOERLI";
|
|
10
|
+
ChainId[ChainId["BSC_MAINNET"] = 56] = "BSC_MAINNET";
|
|
11
|
+
ChainId[ChainId["BSC_TESTNET"] = 97] = "BSC_TESTNET";
|
|
12
|
+
ChainId[ChainId["POLYGON"] = 137] = "POLYGON";
|
|
13
|
+
ChainId[ChainId["POLYGON_MUMBAI"] = 80001] = "POLYGON_MUMBAI";
|
|
14
|
+
ChainId[ChainId["MOONBEAM"] = 1284] = "MOONBEAM";
|
|
15
|
+
ChainId[ChainId["MOONBASE_ALPHA"] = 1287] = "MOONBASE_ALPHA";
|
|
16
|
+
ChainId[ChainId["AVALANCHE_TESTNET"] = 43113] = "AVALANCHE_TESTNET";
|
|
17
|
+
ChainId[ChainId["AVALANCHE"] = 43114] = "AVALANCHE";
|
|
18
|
+
ChainId[ChainId["SKALE"] = 1273227453] = "SKALE";
|
|
19
|
+
ChainId[ChainId["LOCALHOST"] = 1338] = "LOCALHOST";
|
|
20
|
+
})(ChainId = exports.ChainId || (exports.ChainId = {}));
|
package/dist/error.d.ts
ADDED
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @constant {Error} - The Staking contract is missing.
|
|
3
|
+
*/
|
|
4
|
+
export declare const ErrorStakingMissing: Error;
|
|
5
|
+
/**
|
|
6
|
+
* @constant {Error} - The Storage client not initialised.
|
|
7
|
+
*/
|
|
8
|
+
export declare const ErrorStorageClientNotInitialized: Error;
|
|
9
|
+
/**
|
|
10
|
+
* @constant {Error} - The Storage does not exists.
|
|
11
|
+
*/
|
|
12
|
+
export declare const ErrorStorageClientNotExists: Error;
|
|
13
|
+
/**
|
|
14
|
+
* @constant {Error} - The Storage credentials is missing.
|
|
15
|
+
*/
|
|
16
|
+
export declare const ErrorStorageCredentialsMissing: Error;
|
|
17
|
+
/**
|
|
18
|
+
* @constant {Error} - The Storage bucket not found.
|
|
19
|
+
*/
|
|
20
|
+
export declare const ErrorStorageBucketNotFound: Error;
|
|
21
|
+
/**
|
|
22
|
+
* @constant {Error} - The Storage file not found.
|
|
23
|
+
*/
|
|
24
|
+
export declare const ErrorStorageFileNotFound: Error;
|
|
25
|
+
/**
|
|
26
|
+
* @constant {Error} - The Storage file not uploaded.
|
|
27
|
+
*/
|
|
28
|
+
export declare const ErrorStorageFileNotUploaded: Error;
|
|
29
|
+
/**
|
|
30
|
+
* @constant {Error} - The KVStore key can not be empty.
|
|
31
|
+
*/
|
|
32
|
+
export declare const ErrorKVStoreEmptyKey: Error;
|
|
33
|
+
/**
|
|
34
|
+
* @constant {Error} - The KVStore arrays must have the same length.
|
|
35
|
+
*/
|
|
36
|
+
export declare const ErrorKVStoreArrayLength: Error;
|
|
37
|
+
/**
|
|
38
|
+
* @constant {Error} - The Address sent is invalid.
|
|
39
|
+
*/
|
|
40
|
+
export declare const ErrorInvalidAddress: Error;
|
|
41
|
+
/**
|
|
42
|
+
* @constant {Error} - The token address sent is invalid.
|
|
43
|
+
*/
|
|
44
|
+
export declare const ErrorInvalidTokenAddress: Error;
|
|
45
|
+
/**
|
|
46
|
+
* @constant {Error} - Invalid recording oracle address provided.
|
|
47
|
+
*/
|
|
48
|
+
export declare const ErrorInvalidRecordingOracleAddressProvided: Error;
|
|
49
|
+
/**
|
|
50
|
+
* @constant {Error} - Invalid reputation oracle address provided.
|
|
51
|
+
*/
|
|
52
|
+
export declare const ErrorInvalidReputationOracleAddressProvided: Error;
|
|
53
|
+
/**
|
|
54
|
+
* @constant {Error} - The Staking value must be positive.
|
|
55
|
+
*/
|
|
56
|
+
export declare const ErrorStakingValueMustBePositive: Error;
|
|
57
|
+
/**
|
|
58
|
+
* @constant {Error} - Invalid staking value: amount must be a BigNumber.
|
|
59
|
+
*/
|
|
60
|
+
export declare const ErrorInvalidStakingValueType: Error;
|
|
61
|
+
/**
|
|
62
|
+
* @constant {Error} - Invalid staking value: amount must be positive.
|
|
63
|
+
*/
|
|
64
|
+
export declare const ErrorInvalidStakingValueSign: Error;
|
|
65
|
+
/**
|
|
66
|
+
* @constant {Error} - Invalid slasher address provided.
|
|
67
|
+
*/
|
|
68
|
+
export declare const ErrorInvalidSlasherAddressProvided: Error;
|
|
69
|
+
/**
|
|
70
|
+
* @constant {Error} - Invalid staker address provided.
|
|
71
|
+
*/
|
|
72
|
+
export declare const ErrorInvalidStakerAddressProvided: Error;
|
|
73
|
+
/**
|
|
74
|
+
* @constant {Error} - Invalid escrow address provided.
|
|
75
|
+
*/
|
|
76
|
+
export declare const ErrorInvalidEscrowAddressProvided: Error;
|
|
77
|
+
/**
|
|
78
|
+
* @constant {Error} - Error getting stakers data.
|
|
79
|
+
*/
|
|
80
|
+
export declare const ErrorStakingGetStakers: Error;
|
|
81
|
+
/**
|
|
82
|
+
* @constant {Error} - Failed to approve staking amount: signerOrProvider is not a Signer instance.
|
|
83
|
+
*/
|
|
84
|
+
export declare const ErrorFailedToApproveStakingAmountSignerDoesNotExist: Error;
|
|
85
|
+
export declare const ErrorFailedToCheckAllowance: Error;
|
|
86
|
+
/**
|
|
87
|
+
* @constant {Error} - The HMToken amount not approved.
|
|
88
|
+
*/
|
|
89
|
+
export declare const ErrorHMTokenAmountNotApproved: Error;
|
|
90
|
+
/**
|
|
91
|
+
* @constant {Error} - Init provider does not exists.
|
|
92
|
+
*/
|
|
93
|
+
export declare const ErrorProviderDoesNotExist: Error;
|
|
94
|
+
/**
|
|
95
|
+
* @constant {Error} - Init with unsupported chain ID.
|
|
96
|
+
*/
|
|
97
|
+
export declare const ErrorUnsupportedChainID: Error;
|
|
98
|
+
/**
|
|
99
|
+
* @constant {Error} - Sending a transaction requires a signer.
|
|
100
|
+
*/
|
|
101
|
+
export declare const ErrorSigner: Error;
|
|
102
|
+
/**
|
|
103
|
+
* @constant {Error} - Escrow address is not provided by the factory.
|
|
104
|
+
*/
|
|
105
|
+
export declare const ErrorEscrowAddressIsNotProvidedByFactory: Error;
|
|
106
|
+
/**
|
|
107
|
+
* @constant {Error} - Manifest file does not exist.
|
|
108
|
+
*/
|
|
109
|
+
export declare const ErrorManifestFileDoesNotExist: Error;
|
|
110
|
+
/**
|
|
111
|
+
* @constant {Error} - Storage client does not exist.
|
|
112
|
+
*/
|
|
113
|
+
export declare const ErrorStorageClientDoesNotExist: Error;
|
|
114
|
+
/**
|
|
115
|
+
* @constant {Error} - Invalid URL string.
|
|
116
|
+
*/
|
|
117
|
+
export declare const ErrorInvalidUrl: Error;
|
|
118
|
+
/**
|
|
119
|
+
* @constant {Error} - URL is an empty string.
|
|
120
|
+
*/
|
|
121
|
+
export declare const ErrorUrlIsEmptyString: Error;
|
|
122
|
+
/**
|
|
123
|
+
* @constant {Error} - List of handlers cannot be empty.
|
|
124
|
+
*/
|
|
125
|
+
export declare const ErrorListOfHandlersCannotBeEmpty: Error;
|
|
126
|
+
/**
|
|
127
|
+
* @constant {Error} - No URL provided.
|
|
128
|
+
*/
|
|
129
|
+
export declare const ErrorNoURLprovided: Error;
|
|
130
|
+
/**
|
|
131
|
+
* @constant {Error} - Fee must be between 0 and 100.
|
|
132
|
+
*/
|
|
133
|
+
export declare const ErrorFeeMustBeBetweenZeroAndHundred: Error;
|
|
134
|
+
/**
|
|
135
|
+
* @constant {Error} - Total fee must be less than 100.
|
|
136
|
+
*/
|
|
137
|
+
export declare const ErrorTotalFeeMustBeLessThanHundred: Error;
|
|
138
|
+
/**
|
|
139
|
+
* @constant {Error} - Recipient cannot be an empty array.
|
|
140
|
+
*/
|
|
141
|
+
export declare const ErrorRecipientCannotBeEmptyArray: Error;
|
|
142
|
+
/**
|
|
143
|
+
* @constant {Error} - Amount must be greater than zero..
|
|
144
|
+
*/
|
|
145
|
+
export declare const ErrorAmountMustBeGreaterThanZero: Error;
|
|
146
|
+
/**
|
|
147
|
+
* @constant {Error} - Escrow does not have enough balance.
|
|
148
|
+
*/
|
|
149
|
+
export declare const ErrorEscrowDoesNotHaveEnoughBalance: Error;
|
|
150
|
+
/**
|
|
151
|
+
* @constant {Error} - Amounts cannot be an empty array.
|
|
152
|
+
*/
|
|
153
|
+
export declare const ErrorAmountsCannotBeEmptyArray: Error;
|
|
154
|
+
/**
|
|
155
|
+
* @constant {Error} - Recipient and amounts must be the same length.
|
|
156
|
+
*/
|
|
157
|
+
export declare const ErrorRecipientAndAmountsMustBeSameLength: Error;
|
|
158
|
+
/**
|
|
159
|
+
* @constant {Error} - Launched event is not emitted.
|
|
160
|
+
*/
|
|
161
|
+
export declare const ErrorLaunchedEventIsNotEmitted: Error;
|
|
162
|
+
/**
|
|
163
|
+
* @constant {Error} - Hash is an empty string.
|
|
164
|
+
*/
|
|
165
|
+
export declare const ErrorHashIsEmptyString: Error;
|
|
166
|
+
export declare class EthereumError extends Error {
|
|
167
|
+
constructor(message: string);
|
|
168
|
+
}
|
|
169
|
+
export declare class InvalidArgumentError extends EthereumError {
|
|
170
|
+
constructor(message: string);
|
|
171
|
+
}
|
|
172
|
+
export declare class OutOfGasError extends EthereumError {
|
|
173
|
+
constructor(message: string);
|
|
174
|
+
}
|
|
175
|
+
export declare class UnpredictableGasLimit extends EthereumError {
|
|
176
|
+
constructor(message: string);
|
|
177
|
+
}
|
|
178
|
+
export declare class ReplacementUnderpriced extends EthereumError {
|
|
179
|
+
constructor(message: string);
|
|
180
|
+
}
|
|
181
|
+
export declare class NumericFault extends EthereumError {
|
|
182
|
+
constructor(message: string);
|
|
183
|
+
}
|
|
184
|
+
export declare class NonceExpired extends EthereumError {
|
|
185
|
+
constructor(message: string);
|
|
186
|
+
}
|
|
187
|
+
export declare class TransactionReplaced extends EthereumError {
|
|
188
|
+
constructor(message: string);
|
|
189
|
+
}
|
|
190
|
+
export declare class ContractExecutionError extends EthereumError {
|
|
191
|
+
constructor(reason: string);
|
|
192
|
+
}
|
|
193
|
+
export declare class InvalidEthereumAddressError extends Error {
|
|
194
|
+
constructor(address: string);
|
|
195
|
+
}
|
|
196
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C,OAAO,EAAE,MAAM;CAG5B;AAED,qBAAa,qBAAsB,SAAQ,aAAa;gBAC1C,OAAO,EAAE,MAAM;CAG5B;AAED,qBAAa,sBAAuB,SAAQ,aAAa;gBAC3C,OAAO,EAAE,MAAM;CAG5B;AAED,qBAAa,YAAa,SAAQ,aAAa;gBACjC,OAAO,EAAE,MAAM;CAG5B;AAED,qBAAa,YAAa,SAAQ,aAAa;gBACjC,OAAO,EAAE,MAAM;CAG5B;AAED,qBAAa,mBAAoB,SAAQ,aAAa;gBACxC,OAAO,EAAE,MAAM;CAG5B;AAED,qBAAa,sBAAuB,SAAQ,aAAa;gBAC3C,MAAM,EAAE,MAAM;CAG3B;AAED,qBAAa,2BAA4B,SAAQ,KAAK;gBACxC,OAAO,EAAE,MAAM;CAG5B"}
|
package/dist/error.js
ADDED
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TransactionReplaced = exports.NonceExpired = exports.NumericFault = exports.ReplacementUnderpriced = exports.UnpredictableGasLimit = exports.OutOfGasError = exports.InvalidArgumentError = exports.EthereumError = exports.ErrorHashIsEmptyString = exports.ErrorLaunchedEventIsNotEmitted = exports.ErrorRecipientAndAmountsMustBeSameLength = exports.ErrorAmountsCannotBeEmptyArray = exports.ErrorEscrowDoesNotHaveEnoughBalance = exports.ErrorAmountMustBeGreaterThanZero = exports.ErrorRecipientCannotBeEmptyArray = exports.ErrorTotalFeeMustBeLessThanHundred = exports.ErrorFeeMustBeBetweenZeroAndHundred = exports.ErrorNoURLprovided = exports.ErrorListOfHandlersCannotBeEmpty = exports.ErrorUrlIsEmptyString = exports.ErrorInvalidUrl = exports.ErrorStorageClientDoesNotExist = exports.ErrorManifestFileDoesNotExist = exports.ErrorEscrowAddressIsNotProvidedByFactory = exports.ErrorSigner = exports.ErrorUnsupportedChainID = exports.ErrorProviderDoesNotExist = exports.ErrorHMTokenAmountNotApproved = exports.ErrorFailedToCheckAllowance = exports.ErrorFailedToApproveStakingAmountSignerDoesNotExist = exports.ErrorStakingGetStakers = exports.ErrorInvalidEscrowAddressProvided = exports.ErrorInvalidStakerAddressProvided = exports.ErrorInvalidSlasherAddressProvided = exports.ErrorInvalidStakingValueSign = exports.ErrorInvalidStakingValueType = exports.ErrorStakingValueMustBePositive = exports.ErrorInvalidReputationOracleAddressProvided = exports.ErrorInvalidRecordingOracleAddressProvided = exports.ErrorInvalidTokenAddress = exports.ErrorInvalidAddress = exports.ErrorKVStoreArrayLength = exports.ErrorKVStoreEmptyKey = exports.ErrorStorageFileNotUploaded = exports.ErrorStorageFileNotFound = exports.ErrorStorageBucketNotFound = exports.ErrorStorageCredentialsMissing = exports.ErrorStorageClientNotExists = exports.ErrorStorageClientNotInitialized = exports.ErrorStakingMissing = void 0;
|
|
4
|
+
exports.InvalidEthereumAddressError = exports.ContractExecutionError = void 0;
|
|
5
|
+
/**
|
|
6
|
+
* @constant {Error} - The Staking contract is missing.
|
|
7
|
+
*/
|
|
8
|
+
exports.ErrorStakingMissing = new Error('Staking contract is missing');
|
|
9
|
+
/**
|
|
10
|
+
* @constant {Error} - The Storage client not initialised.
|
|
11
|
+
*/
|
|
12
|
+
exports.ErrorStorageClientNotInitialized = new Error('Storage client not initialized');
|
|
13
|
+
/**
|
|
14
|
+
* @constant {Error} - The Storage does not exists.
|
|
15
|
+
*/
|
|
16
|
+
exports.ErrorStorageClientNotExists = new Error('Storage client does not exists');
|
|
17
|
+
/**
|
|
18
|
+
* @constant {Error} - The Storage credentials is missing.
|
|
19
|
+
*/
|
|
20
|
+
exports.ErrorStorageCredentialsMissing = new Error('Storage credentials is missing');
|
|
21
|
+
/**
|
|
22
|
+
* @constant {Error} - The Storage bucket not found.
|
|
23
|
+
*/
|
|
24
|
+
exports.ErrorStorageBucketNotFound = new Error('Bucket not found');
|
|
25
|
+
/**
|
|
26
|
+
* @constant {Error} - The Storage file not found.
|
|
27
|
+
*/
|
|
28
|
+
exports.ErrorStorageFileNotFound = new Error('File not found');
|
|
29
|
+
/**
|
|
30
|
+
* @constant {Error} - The Storage file not uploaded.
|
|
31
|
+
*/
|
|
32
|
+
exports.ErrorStorageFileNotUploaded = new Error('File not uploaded');
|
|
33
|
+
/**
|
|
34
|
+
* @constant {Error} - The KVStore key can not be empty.
|
|
35
|
+
*/
|
|
36
|
+
exports.ErrorKVStoreEmptyKey = new Error('Key can not be empty');
|
|
37
|
+
/**
|
|
38
|
+
* @constant {Error} - The KVStore arrays must have the same length.
|
|
39
|
+
*/
|
|
40
|
+
exports.ErrorKVStoreArrayLength = new Error('Arrays must have the same length');
|
|
41
|
+
/**
|
|
42
|
+
* @constant {Error} - The Address sent is invalid.
|
|
43
|
+
*/
|
|
44
|
+
exports.ErrorInvalidAddress = new Error('Invalid address');
|
|
45
|
+
/**
|
|
46
|
+
* @constant {Error} - The token address sent is invalid.
|
|
47
|
+
*/
|
|
48
|
+
exports.ErrorInvalidTokenAddress = new Error('Invalid token address');
|
|
49
|
+
/**
|
|
50
|
+
* @constant {Error} - Invalid recording oracle address provided.
|
|
51
|
+
*/
|
|
52
|
+
exports.ErrorInvalidRecordingOracleAddressProvided = new Error('Invalid recording oracle address provided');
|
|
53
|
+
/**
|
|
54
|
+
* @constant {Error} - Invalid reputation oracle address provided.
|
|
55
|
+
*/
|
|
56
|
+
exports.ErrorInvalidReputationOracleAddressProvided = new Error('Invalid reputation oracle address provided');
|
|
57
|
+
/**
|
|
58
|
+
* @constant {Error} - The Staking value must be positive.
|
|
59
|
+
*/
|
|
60
|
+
exports.ErrorStakingValueMustBePositive = new Error('Value must be positive');
|
|
61
|
+
/**
|
|
62
|
+
* @constant {Error} - Invalid staking value: amount must be a BigNumber.
|
|
63
|
+
*/
|
|
64
|
+
exports.ErrorInvalidStakingValueType = new Error('Invalid staking value: amount must be a BigNumber');
|
|
65
|
+
/**
|
|
66
|
+
* @constant {Error} - Invalid staking value: amount must be positive.
|
|
67
|
+
*/
|
|
68
|
+
exports.ErrorInvalidStakingValueSign = new Error('Invalid staking value: amount must be positive');
|
|
69
|
+
/**
|
|
70
|
+
* @constant {Error} - Invalid slasher address provided.
|
|
71
|
+
*/
|
|
72
|
+
exports.ErrorInvalidSlasherAddressProvided = new Error('Invalid slasher address provided');
|
|
73
|
+
/**
|
|
74
|
+
* @constant {Error} - Invalid staker address provided.
|
|
75
|
+
*/
|
|
76
|
+
exports.ErrorInvalidStakerAddressProvided = new Error('Invalid staker address provided');
|
|
77
|
+
/**
|
|
78
|
+
* @constant {Error} - Invalid escrow address provided.
|
|
79
|
+
*/
|
|
80
|
+
exports.ErrorInvalidEscrowAddressProvided = new Error('Invalid escrow address provided');
|
|
81
|
+
/**
|
|
82
|
+
* @constant {Error} - Error getting stakers data.
|
|
83
|
+
*/
|
|
84
|
+
exports.ErrorStakingGetStakers = new Error('Error getting stakers data');
|
|
85
|
+
/**
|
|
86
|
+
* @constant {Error} - Failed to approve staking amount: signerOrProvider is not a Signer instance.
|
|
87
|
+
*/
|
|
88
|
+
exports.ErrorFailedToApproveStakingAmountSignerDoesNotExist = new Error('Failed to approve staking amount: signerOrProvider is not a Signer instance');
|
|
89
|
+
exports.ErrorFailedToCheckAllowance = new Error('Failed to check allowance');
|
|
90
|
+
/**
|
|
91
|
+
* @constant {Error} - The HMToken amount not approved.
|
|
92
|
+
*/
|
|
93
|
+
exports.ErrorHMTokenAmountNotApproved = new Error('Amount not approved');
|
|
94
|
+
/**
|
|
95
|
+
* @constant {Error} - Init provider does not exists.
|
|
96
|
+
*/
|
|
97
|
+
exports.ErrorProviderDoesNotExist = new Error('Provider does not exist');
|
|
98
|
+
/**
|
|
99
|
+
* @constant {Error} - Init with unsupported chain ID.
|
|
100
|
+
*/
|
|
101
|
+
exports.ErrorUnsupportedChainID = new Error('Unsupported chain ID');
|
|
102
|
+
/**
|
|
103
|
+
* @constant {Error} - Sending a transaction requires a signer.
|
|
104
|
+
*/
|
|
105
|
+
exports.ErrorSigner = new Error('Signer required');
|
|
106
|
+
/**
|
|
107
|
+
* @constant {Error} - Escrow address is not provided by the factory.
|
|
108
|
+
*/
|
|
109
|
+
exports.ErrorEscrowAddressIsNotProvidedByFactory = new Error('Escrow address is not provided by the factory');
|
|
110
|
+
/**
|
|
111
|
+
* @constant {Error} - Manifest file does not exist.
|
|
112
|
+
*/
|
|
113
|
+
exports.ErrorManifestFileDoesNotExist = new Error('Manifest file does not exist');
|
|
114
|
+
/**
|
|
115
|
+
* @constant {Error} - Storage client does not exist.
|
|
116
|
+
*/
|
|
117
|
+
exports.ErrorStorageClientDoesNotExist = new Error('Storage client does not exist');
|
|
118
|
+
/**
|
|
119
|
+
* @constant {Error} - Invalid URL string.
|
|
120
|
+
*/
|
|
121
|
+
exports.ErrorInvalidUrl = new Error('Invalid URL string');
|
|
122
|
+
/**
|
|
123
|
+
* @constant {Error} - URL is an empty string.
|
|
124
|
+
*/
|
|
125
|
+
exports.ErrorUrlIsEmptyString = new Error('URL is an empty string');
|
|
126
|
+
/**
|
|
127
|
+
* @constant {Error} - List of handlers cannot be empty.
|
|
128
|
+
*/
|
|
129
|
+
exports.ErrorListOfHandlersCannotBeEmpty = new Error('List of handlers cannot be empty');
|
|
130
|
+
/**
|
|
131
|
+
* @constant {Error} - No URL provided.
|
|
132
|
+
*/
|
|
133
|
+
exports.ErrorNoURLprovided = new Error('No URL provided');
|
|
134
|
+
/**
|
|
135
|
+
* @constant {Error} - Fee must be between 0 and 100.
|
|
136
|
+
*/
|
|
137
|
+
exports.ErrorFeeMustBeBetweenZeroAndHundred = new Error('Fee must be between 0 and 100');
|
|
138
|
+
/**
|
|
139
|
+
* @constant {Error} - Total fee must be less than 100.
|
|
140
|
+
*/
|
|
141
|
+
exports.ErrorTotalFeeMustBeLessThanHundred = new Error('Total fee must be less than 100');
|
|
142
|
+
/**
|
|
143
|
+
* @constant {Error} - Recipient cannot be an empty array.
|
|
144
|
+
*/
|
|
145
|
+
exports.ErrorRecipientCannotBeEmptyArray = new Error('Recipient cannot be an empty array');
|
|
146
|
+
/**
|
|
147
|
+
* @constant {Error} - Amount must be greater than zero..
|
|
148
|
+
*/
|
|
149
|
+
exports.ErrorAmountMustBeGreaterThanZero = new Error('Amount must be greater than zero');
|
|
150
|
+
/**
|
|
151
|
+
* @constant {Error} - Escrow does not have enough balance.
|
|
152
|
+
*/
|
|
153
|
+
exports.ErrorEscrowDoesNotHaveEnoughBalance = new Error('Escrow does not have enough balance');
|
|
154
|
+
/**
|
|
155
|
+
* @constant {Error} - Amounts cannot be an empty array.
|
|
156
|
+
*/
|
|
157
|
+
exports.ErrorAmountsCannotBeEmptyArray = new Error('Amounts cannot be an empty array');
|
|
158
|
+
/**
|
|
159
|
+
* @constant {Error} - Recipient and amounts must be the same length.
|
|
160
|
+
*/
|
|
161
|
+
exports.ErrorRecipientAndAmountsMustBeSameLength = new Error('Recipient and amounts must be the same length');
|
|
162
|
+
/**
|
|
163
|
+
* @constant {Error} - Launched event is not emitted.
|
|
164
|
+
*/
|
|
165
|
+
exports.ErrorLaunchedEventIsNotEmitted = new Error('Launched event is not emitted');
|
|
166
|
+
/**
|
|
167
|
+
* @constant {Error} - Hash is an empty string.
|
|
168
|
+
*/
|
|
169
|
+
exports.ErrorHashIsEmptyString = new Error('Hash is an empty string');
|
|
170
|
+
class EthereumError extends Error {
|
|
171
|
+
constructor(message) {
|
|
172
|
+
super(`An error occurred while interacting with Ethereum: ${message}`);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
exports.EthereumError = EthereumError;
|
|
176
|
+
class InvalidArgumentError extends EthereumError {
|
|
177
|
+
constructor(message) {
|
|
178
|
+
super(`Invalid argument: ${message}`);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
exports.InvalidArgumentError = InvalidArgumentError;
|
|
182
|
+
class OutOfGasError extends EthereumError {
|
|
183
|
+
constructor(message) {
|
|
184
|
+
super(`Out of gas: ${message}`);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
exports.OutOfGasError = OutOfGasError;
|
|
188
|
+
class UnpredictableGasLimit extends EthereumError {
|
|
189
|
+
constructor(message) {
|
|
190
|
+
super(`Unpredictable gas limit: ${message}`);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
exports.UnpredictableGasLimit = UnpredictableGasLimit;
|
|
194
|
+
class ReplacementUnderpriced extends EthereumError {
|
|
195
|
+
constructor(message) {
|
|
196
|
+
super(`Replacement underpriced: ${message}`);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
exports.ReplacementUnderpriced = ReplacementUnderpriced;
|
|
200
|
+
class NumericFault extends EthereumError {
|
|
201
|
+
constructor(message) {
|
|
202
|
+
super(`Numeric fault: ${message}`);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
exports.NumericFault = NumericFault;
|
|
206
|
+
class NonceExpired extends EthereumError {
|
|
207
|
+
constructor(message) {
|
|
208
|
+
super(`Nonce expired: ${message}`);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
exports.NonceExpired = NonceExpired;
|
|
212
|
+
class TransactionReplaced extends EthereumError {
|
|
213
|
+
constructor(message) {
|
|
214
|
+
super(`Transaction replaced: ${message}`);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
exports.TransactionReplaced = TransactionReplaced;
|
|
218
|
+
class ContractExecutionError extends EthereumError {
|
|
219
|
+
constructor(reason) {
|
|
220
|
+
super(`Contract execution error: ${reason}`);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
exports.ContractExecutionError = ContractExecutionError;
|
|
224
|
+
class InvalidEthereumAddressError extends Error {
|
|
225
|
+
constructor(address) {
|
|
226
|
+
super(`Invalid ethereum address error: ${address}`);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
exports.InvalidEthereumAddressError = InvalidEthereumAddressError;
|
package/dist/escrow.d.ts
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import { Provider } from '@ethersproject/abstract-provider';
|
|
2
|
+
import { BigNumber, Signer } from 'ethers';
|
|
3
|
+
import { IEscrowConfig, IEscrowsFilter } from './interfaces';
|
|
4
|
+
import { EscrowStatus, NetworkData } from './types';
|
|
5
|
+
export declare class EscrowClient {
|
|
6
|
+
private escrowFactoryContract;
|
|
7
|
+
private escrowContract?;
|
|
8
|
+
private signerOrProvider;
|
|
9
|
+
network: NetworkData;
|
|
10
|
+
/**
|
|
11
|
+
* **EscrowClient constructor**
|
|
12
|
+
*
|
|
13
|
+
* @param {Signer | Provider} signerOrProvider - The Signer or Provider object to interact with the Ethereum network
|
|
14
|
+
* @param {NetworkData} network - The network information required to connect to the Escrow contract
|
|
15
|
+
*/
|
|
16
|
+
constructor(signerOrProvider: Signer | Provider, network: NetworkData);
|
|
17
|
+
/**
|
|
18
|
+
* Creates an instance of EscrowClient from a Signer or Provider.
|
|
19
|
+
*
|
|
20
|
+
* @param {Signer | Provider} signerOrProvider - The Signer or Provider object to interact with the Ethereum network
|
|
21
|
+
* @returns {Promise<EscrowClient>} - An instance of EscrowClient
|
|
22
|
+
* @throws {ErrorProviderDoesNotExist} - Thrown if the provider does not exist for the provided Signer
|
|
23
|
+
* @throws {ErrorUnsupportedChainID} - Thrown if the network's chainId is not supported
|
|
24
|
+
*/
|
|
25
|
+
static build(signerOrProvider: Signer | Provider): Promise<EscrowClient>;
|
|
26
|
+
/**
|
|
27
|
+
* Creates an escrow contract that uses the token passed to pay oracle fees and reward workers.
|
|
28
|
+
*
|
|
29
|
+
* @param {string} tokenAddress - Token address to use for pay outs.
|
|
30
|
+
* @param {string[]} trustedHandlers - Array of addresses that can perform actions on the contract.
|
|
31
|
+
* @returns {Promise<string>} - Return the address of the escrow created.
|
|
32
|
+
* @throws {Error} - An error object if an error occurred.
|
|
33
|
+
*/
|
|
34
|
+
createEscrow(tokenAddress: string, trustedHandlers: string[]): Promise<string>;
|
|
35
|
+
/**
|
|
36
|
+
* Sets up the parameters of the escrow.
|
|
37
|
+
*
|
|
38
|
+
* @param {string} escrowAddress - Address of the escrow to set up.
|
|
39
|
+
* @param {IEscrowConfig} escrowConfig - Configuration object with escrow settings.
|
|
40
|
+
* @returns {Promise<void>}
|
|
41
|
+
* @throws {Error} - An error object if an error occurred.
|
|
42
|
+
*/
|
|
43
|
+
setup(escrowAddress: string, escrowConfig: IEscrowConfig): Promise<void>;
|
|
44
|
+
/**
|
|
45
|
+
* **Creates an escrow contract that uses the token passed to pay oracle fees and reward workers.*
|
|
46
|
+
* **Sets up the parameters of the escrow.*
|
|
47
|
+
*
|
|
48
|
+
* @param {string} tokenAddress - Token address to use for pay outs.
|
|
49
|
+
* @param {string[]} trustedHandlers - Array of addresses that can perform actions on the contract.
|
|
50
|
+
* @param {IEscrowConfig} escrowConfig - Configuration object with escrow settings.
|
|
51
|
+
* @returns {Promise<string>}
|
|
52
|
+
* @throws {Error} - An error object if an error occurred.
|
|
53
|
+
*/
|
|
54
|
+
createAndSetupEscrow(tokenAddress: string, trustedHandlers: string[], escrowConfig: IEscrowConfig): Promise<string>;
|
|
55
|
+
/**
|
|
56
|
+
* **Adds funds of the chosen token to the escrow.*
|
|
57
|
+
*
|
|
58
|
+
* @param {string} escrowAddress - Address of the escrow to fund.
|
|
59
|
+
* @param {BigNumber} amount - Amount to be added as funds.
|
|
60
|
+
* @returns {Promise<void>}
|
|
61
|
+
* @throws {Error} - An error object if an error occurred.
|
|
62
|
+
*/
|
|
63
|
+
fund(escrowAddress: string, amount: BigNumber): Promise<void>;
|
|
64
|
+
/**
|
|
65
|
+
* **Stores the results.*
|
|
66
|
+
*
|
|
67
|
+
* @param {string} escrowAddress - Address of the escrow.
|
|
68
|
+
* @param {string} sender - Address of the sender.
|
|
69
|
+
* @param {string} url - Results file url.
|
|
70
|
+
* @param {string} hash - Results file hash.
|
|
71
|
+
* @returns {Promise<void>}
|
|
72
|
+
* @throws {Error} - An error object if an error occurred.
|
|
73
|
+
*/
|
|
74
|
+
storeResults(escrowAddress: string, url: string, hash: string): Promise<void>;
|
|
75
|
+
/**
|
|
76
|
+
* **Sets the status of an escrow to completed.*
|
|
77
|
+
*
|
|
78
|
+
* @param {string} escrowAddress - Address of the escrow.
|
|
79
|
+
* @returns {Promise<void>}
|
|
80
|
+
* @throws {Error} - An error object if an error occurred.
|
|
81
|
+
*/
|
|
82
|
+
complete(escrowAddress: string): Promise<void>;
|
|
83
|
+
/**
|
|
84
|
+
* Pays out the amounts specified to the workers and sets the URL of the final results file.
|
|
85
|
+
*
|
|
86
|
+
* @param {string} escrowAddress - Address of the escrow.
|
|
87
|
+
* @param {string[]} recipients - Array of recipient addresses.
|
|
88
|
+
* @param {BigNumber[]} amounts - Array of amounts the recipients will receive.
|
|
89
|
+
* @param {string} finalResultsUrl - Final results file url.
|
|
90
|
+
* @param {string} finalResultsHash - Final results file hash.
|
|
91
|
+
* @returns {Promise<void>}
|
|
92
|
+
* @throws {Error} - An error object if an error occurred.
|
|
93
|
+
*/
|
|
94
|
+
bulkPayOut(escrowAddress: string, recipients: string[], amounts: BigNumber[], finalResultsUrl: string, finalResultsHash: string): Promise<void>;
|
|
95
|
+
/**
|
|
96
|
+
* Cancels the specified escrow and sends the balance to the canceler.
|
|
97
|
+
*
|
|
98
|
+
* @param {string} escrowAddress - Address of the escrow.
|
|
99
|
+
* @returns {Promise<void>}
|
|
100
|
+
* @throws {Error} - An error object if an error occurred.
|
|
101
|
+
*/
|
|
102
|
+
cancel(escrowAddress: string): Promise<void>;
|
|
103
|
+
/**
|
|
104
|
+
* Cancels the specified escrow, sends the balance to the canceler and selfdestructs the escrow contract.
|
|
105
|
+
*
|
|
106
|
+
* @param {string} escrowAddress - Address of the escrow.
|
|
107
|
+
* @returns {Promise<void>}
|
|
108
|
+
* @throws {Error} - An error object if an error occurred.
|
|
109
|
+
*/
|
|
110
|
+
abort(escrowAddress: string): Promise<void>;
|
|
111
|
+
/**
|
|
112
|
+
* Adds an array of addresses to the trusted handlers list.
|
|
113
|
+
*
|
|
114
|
+
* @param {string} escrowAddress - Address of the escrow.
|
|
115
|
+
* @param {string[]} trustedHandlers - List of trusted handler addresses.
|
|
116
|
+
* @returns {Promise<void>}
|
|
117
|
+
* @throws {Error} - An error object if an error occurred.
|
|
118
|
+
*/
|
|
119
|
+
addTrustedHandlers(escrowAddress: string, trustedHandlers: string[]): Promise<void>;
|
|
120
|
+
/**
|
|
121
|
+
* Returns the balance for a specified escrow address.
|
|
122
|
+
*
|
|
123
|
+
* @param {string} escrowAddress - Address of the escrow.
|
|
124
|
+
* @returns {Promise<BigNumber>}
|
|
125
|
+
* @throws {Error} - An error object if an error occurred.
|
|
126
|
+
*/
|
|
127
|
+
getBalance(escrowAddress: string): Promise<BigNumber>;
|
|
128
|
+
/**
|
|
129
|
+
* Returns the manifest file URL.
|
|
130
|
+
*
|
|
131
|
+
* @param {string} escrowAddress - Address of the escrow.
|
|
132
|
+
* @returns {Promise<void>}
|
|
133
|
+
* @throws {Error} - An error object if an error occurred.
|
|
134
|
+
*/
|
|
135
|
+
getManifestUrl(escrowAddress: string): Promise<string>;
|
|
136
|
+
/**
|
|
137
|
+
* Returns the results file URL.
|
|
138
|
+
*
|
|
139
|
+
* @param {string} escrowAddress - Address of the escrow.
|
|
140
|
+
* @returns {Promise<void>}
|
|
141
|
+
* @throws {Error} - An error object if an error occurred.
|
|
142
|
+
*/
|
|
143
|
+
getResultsUrl(escrowAddress: string): Promise<string>;
|
|
144
|
+
/**
|
|
145
|
+
* Returns the intermediate results file URL.
|
|
146
|
+
*
|
|
147
|
+
* @param {string} escrowAddress - Address of the escrow.
|
|
148
|
+
* @returns {Promise<void>}
|
|
149
|
+
* @throws {Error} - An error object if an error occurred.
|
|
150
|
+
*/
|
|
151
|
+
getIntermediateResultsUrl(escrowAddress: string): Promise<string>;
|
|
152
|
+
/**
|
|
153
|
+
* Returns the value for a specified key and address
|
|
154
|
+
*
|
|
155
|
+
* @param {string} escrowAddress - Address of the escrow.
|
|
156
|
+
* @returns {Promise<void>}
|
|
157
|
+
* @throws {Error} - An error object if an error occurred.
|
|
158
|
+
*/
|
|
159
|
+
getTokenAddress(escrowAddress: string): Promise<string>;
|
|
160
|
+
/**
|
|
161
|
+
* Returns the current status of the escrow.
|
|
162
|
+
*
|
|
163
|
+
* @param {string} escrowAddress - Address of the escrow.
|
|
164
|
+
* @returns {Promise<void>}
|
|
165
|
+
* @throws {Error} - An error object if an error occurred.
|
|
166
|
+
*/
|
|
167
|
+
getStatus(escrowAddress: string): Promise<EscrowStatus>;
|
|
168
|
+
/**
|
|
169
|
+
* Returns the escrow addresses created by a job requester.
|
|
170
|
+
*
|
|
171
|
+
* @param {IEscrowsFilter} requesterAddress - Address of the requester.
|
|
172
|
+
* @returns {Promise<string[]>}
|
|
173
|
+
* @throws {Error} - An error object if an error occurred.
|
|
174
|
+
*/
|
|
175
|
+
getLaunchedEscrows(requesterAddress: string): Promise<string[]>;
|
|
176
|
+
/**
|
|
177
|
+
* Returns the escrow addresses based on a specified filter.
|
|
178
|
+
*
|
|
179
|
+
* @param {IEscrowsFilter} filter - Filter parameters.
|
|
180
|
+
* @returns {Promise<string[]>}
|
|
181
|
+
* @throws {Error} - An error object if an error occurred.
|
|
182
|
+
*/
|
|
183
|
+
getEscrowsFiltered(filter: IEscrowsFilter): Promise<string[]>;
|
|
184
|
+
/**
|
|
185
|
+
* Returns the recording oracle address of given escrow
|
|
186
|
+
*
|
|
187
|
+
* @param {string} escrowAddress - Address of the escrow.
|
|
188
|
+
* @returns {Promise<string>} - Address of the recording oracle.
|
|
189
|
+
* @throws {Error} - An error object if an error occurred.
|
|
190
|
+
*/
|
|
191
|
+
getRecordingOracleAddress(escrowAddress: string): Promise<string>;
|
|
192
|
+
/**
|
|
193
|
+
* Returns the reputation oracle address of given escrow
|
|
194
|
+
*
|
|
195
|
+
* @param {string} escrowAddress - Address of the escrow.
|
|
196
|
+
* @returns {Promise<string>} - Address of the reputation oracle.
|
|
197
|
+
* @throws {Error} - An error object if an error occurred.
|
|
198
|
+
*/
|
|
199
|
+
getReputationOracleAddress(escrowAddress: string): Promise<string>;
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