@human-protocol/sdk 1.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/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "@human-protocol/sdk",
3
+ "description": "Human Protocol SDK",
4
+ "version": "1.0.0",
5
+ "files": [
6
+ "src",
7
+ "dist"
8
+ ],
9
+ "main": "dist/index.js",
10
+ "types": "dist/index.d.ts",
11
+ "scripts": {
12
+ "clean": "rm -rf ./dist",
13
+ "build": "npm run clean && tsc",
14
+ "prepublish": "npm run build",
15
+ "test": "./scripts/run-test.sh",
16
+ "lint": "eslint .",
17
+ "lint:fix": "eslint . --fix",
18
+ "format": "prettier --write '**/*.{ts,json}'"
19
+ },
20
+ "repository": {
21
+ "url": "https://github.com/humanprotocol/human-protocol.git",
22
+ "directory": "packages/sdk/typescript/human-protocol-sdk"
23
+ },
24
+ "keywords": [
25
+ "human-protocol",
26
+ "sdk",
27
+ "node",
28
+ "typescript",
29
+ "ethereum"
30
+ ],
31
+ "license": "MIT",
32
+ "lint-staged": {
33
+ "*.ts": [
34
+ "prettier --write",
35
+ "eslint --fix"
36
+ ]
37
+ },
38
+ "dependencies": {
39
+ "@human-protocol/core": "workspace:*",
40
+ "aws-sdk": "^2.1255.0",
41
+ "crypto": "^1.0.1",
42
+ "dotenv": "^16.0.3",
43
+ "ethers": "^5.7.2",
44
+ "secp256k1": "^4.0.3",
45
+ "winston": "^3.8.2"
46
+ }
47
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @constant Default bucket name
3
+ */
4
+ export const DEFAULT_BUCKET = 'escrow-results';
5
+
6
+ /**
7
+ * @constant Default public bucket name
8
+ */
9
+ export const DEFAULT_PUBLIC_BUCKET = 'escrow-public-results';
package/src/error.ts ADDED
@@ -0,0 +1,38 @@
1
+ /**
2
+ * @constant {Error} - The job is not initialized yet.
3
+ */
4
+ export const ErrorJobNotInitialized = new Error('Job is not initialized');
5
+
6
+ /**
7
+ * @constant {Error} - The job is not launched yet.
8
+ */
9
+ export const ErrorJobNotLaunched = new Error('Job is not launched');
10
+
11
+ /**
12
+ * @constant {Error} - The job is already launched.
13
+ */
14
+ export const ErrorJobAlreadyLaunched = new Error('Job is already launched');
15
+
16
+ /**
17
+ * @constant {Error} - The reputation oracle is missing.
18
+ */
19
+ export const ErrorReputationOracleMissing = new Error(
20
+ 'Reputation oracle is missing'
21
+ );
22
+
23
+ /**
24
+ * @constant {Error} - The manifest is missing.
25
+ */
26
+ export const ErrorManifestMissing = new Error('Manifest is missing');
27
+
28
+ /**
29
+ * @constant {Error} - The HMToken is missing.
30
+ */
31
+ export const ErrorHMTokenMissing = new Error('HMToken is missing');
32
+
33
+ /**
34
+ * @constant {Error} - The Storage access data is missing.
35
+ */
36
+ export const ErrorStorageAccessDataMissing = new Error(
37
+ 'Storage access data is missing'
38
+ );
package/src/index.ts ADDED
@@ -0,0 +1,4 @@
1
+ export { Job } from './job';
2
+
3
+ export * from './constants';
4
+ export * from './types';