@obolnetwork/obol-sdk 1.0.14 → 1.0.16
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/cjs/package.json +6 -3
- package/dist/cjs/src/base.js +4 -1
- package/dist/cjs/src/constants.js +15 -4
- package/dist/cjs/src/index.js +51 -8
- package/dist/cjs/src/services.js +1 -1
- package/dist/cjs/src/verification/termsAndConditions.js +40 -0
- package/dist/cjs/src/verification/v1.8.0.js +1 -1
- package/dist/cjs/test/fixtures.js +64 -69
- package/dist/cjs/test/methods.test.js +12 -0
- package/dist/esm/package.json +6 -3
- package/dist/esm/src/base.js +4 -1
- package/dist/esm/src/constants.js +14 -3
- package/dist/esm/src/index.js +52 -9
- package/dist/esm/src/services.js +1 -1
- package/dist/esm/src/verification/termsAndConditions.js +33 -0
- package/dist/esm/src/verification/v1.8.0.js +1 -1
- package/dist/esm/test/fixtures.js +64 -69
- package/dist/esm/test/methods.test.js +12 -0
- package/dist/types/src/constants.d.ts +9 -1
- package/dist/types/src/index.d.ts +18 -9
- package/dist/types/src/services.d.ts +1 -1
- package/dist/types/src/types.d.ts +2 -2
- package/dist/types/src/utils.d.ts +2 -2
- package/dist/types/src/verification/common.d.ts +2 -2
- package/dist/types/src/verification/termsAndConditions.d.ts +1 -0
- package/dist/types/src/verification/v1.6.0.d.ts +2 -2
- package/dist/types/src/verification/v1.7.0.d.ts +2 -2
- package/dist/types/src/verification/v1.8.0.d.ts +2 -2
- package/package.json +6 -3
- package/src/base.ts +4 -2
- package/src/constants.ts +16 -4
- package/src/index.ts +63 -15
- package/src/services.ts +1 -1
- package/src/types.ts +2 -2
- package/src/utils.ts +2 -2
- package/src/verification/common.ts +3 -3
- package/src/verification/termsAndConditions.ts +30 -0
- package/src/verification/v1.6.0.ts +2 -2
- package/src/verification/v1.7.0.ts +2 -2
- package/src/verification/v1.8.0.ts +3 -3
package/dist/cjs/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@obolnetwork/obol-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.16",
|
|
4
4
|
"description": "A package for creating Distributed Validators using the Obol API.",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/obolnetwork/obol-sdk/issues"
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"@chainsafe/discv5": "^0.5.1",
|
|
43
43
|
"@chainsafe/ssz": "^0.14.0",
|
|
44
44
|
"@metamask/eth-sig-util": "^7.0.1",
|
|
45
|
+
"@types/pdf-parse": "^1.1.4",
|
|
45
46
|
"ajv": "^8.12.0",
|
|
46
47
|
"cross-fetch": "^3.1.5",
|
|
47
48
|
"elliptic": "^6.5.4",
|
|
@@ -49,9 +50,9 @@
|
|
|
49
50
|
"eslint-plugin-import": "^2.29.1",
|
|
50
51
|
"eslint-plugin-n": "^16.6.2",
|
|
51
52
|
"eslint-plugin-promise": "^6.1.1",
|
|
52
|
-
"ethers": "
|
|
53
|
+
"ethers": "6.4.0",
|
|
53
54
|
"nock": "^13.5.3",
|
|
54
|
-
"
|
|
55
|
+
"pdf-parse": "^1.1.1",
|
|
55
56
|
"semver": "^7.6.0",
|
|
56
57
|
"typescript-eslint": "^7.1.0",
|
|
57
58
|
"uuid": "^9.0.0"
|
|
@@ -61,11 +62,13 @@
|
|
|
61
62
|
"@types/elliptic": "^6.4.18",
|
|
62
63
|
"@types/jest": "^28.1.8",
|
|
63
64
|
"@types/node": "^20.2.5",
|
|
65
|
+
"@types/semver": "^7.5.8",
|
|
64
66
|
"@types/uuid": "^9.0.1",
|
|
65
67
|
"eslint": "^8.57.0",
|
|
66
68
|
"jest": "^28.1.3",
|
|
67
69
|
"msw": "^2.2.1",
|
|
68
70
|
"npm-run-all": "^4.1.5",
|
|
71
|
+
"release-it": "^17.2.1",
|
|
69
72
|
"ts-jest": "^28.0.8",
|
|
70
73
|
"tsup": "^6.7.0",
|
|
71
74
|
"typedoc": "^0.25.7",
|
package/dist/cjs/src/base.js
CHANGED
|
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.ETHER_TO_GWEI = exports.DEFAULT_CHAIN_ID = exports.DEFAULT_BASE_URL = exports.DefinitionFlow = exports.GENESIS_VALIDATOR_ROOT = exports.DOMAIN_DEPOSIT = exports.DOMAIN_APPLICATION_BUILDER = exports.SDK_VERSION = exports.CONFIG_VERSION = exports.DKG_ALGORITHM = exports.signEnrPayload = exports.signOperatorConfigHashPayload = exports.signCreatorConfigHashPayload = exports.ENRTypedMessage = exports.OperatorTypedMessage = exports.OperatorConfigHashSigningTypes = exports.EnrSigningTypes = exports.CreatorTypedMessage = exports.Domain = exports.CreatorConfigHashSigningTypes = exports.EIP712_DOMAIN_VERSION = exports.EIP712_DOMAIN_NAME = exports.CONFLICT_ERROR_MSG = void 0;
|
|
26
|
+
exports.TERMS_AND_CONDITIONS_URL = exports.TERMS_AND_CONDITIONS_VERSION = exports.ETHER_TO_GWEI = exports.DEFAULT_CHAIN_ID = exports.DEFAULT_BASE_URL = exports.DefinitionFlow = exports.GENESIS_VALIDATOR_ROOT = exports.DOMAIN_DEPOSIT = exports.DOMAIN_APPLICATION_BUILDER = exports.SDK_VERSION = exports.CONFIG_VERSION = exports.DKG_ALGORITHM = exports.signEnrPayload = exports.signOperatorConfigHashPayload = exports.signCreatorConfigHashPayload = exports.ENRTypedMessage = exports.OperatorTypedMessage = exports.OperatorConfigHashSigningTypes = exports.EnrSigningTypes = exports.CreatorTypedMessage = exports.Domain = exports.TermsAndConditionsSigningTypes = exports.CreatorConfigHashSigningTypes = exports.EIP712_DOMAIN_VERSION = exports.EIP712_DOMAIN_NAME = exports.CONFLICT_ERROR_MSG = void 0;
|
|
27
27
|
const pjson = __importStar(require("../package.json"));
|
|
28
28
|
exports.CONFLICT_ERROR_MSG = 'Conflict';
|
|
29
29
|
exports.EIP712_DOMAIN_NAME = 'Obol';
|
|
@@ -31,17 +31,26 @@ exports.EIP712_DOMAIN_VERSION = '1';
|
|
|
31
31
|
exports.CreatorConfigHashSigningTypes = {
|
|
32
32
|
CreatorConfigHash: [{ name: 'creator_config_hash', type: 'string' }],
|
|
33
33
|
};
|
|
34
|
+
exports.TermsAndConditionsSigningTypes = {
|
|
35
|
+
TermsAndConditions: [
|
|
36
|
+
{ name: 'terms_and_conditions_hash', type: 'string' },
|
|
37
|
+
{ name: 'version', type: 'uint256' },
|
|
38
|
+
]
|
|
39
|
+
};
|
|
34
40
|
const EIP712Domain = [
|
|
35
41
|
{ name: 'name', type: 'string' },
|
|
36
42
|
{ name: 'version', type: 'string' },
|
|
37
43
|
{ name: 'chainId', type: 'uint256' },
|
|
38
44
|
];
|
|
39
45
|
const Domain = (chainId) => {
|
|
40
|
-
|
|
46
|
+
const typeDataDomain = {
|
|
41
47
|
name: exports.EIP712_DOMAIN_NAME,
|
|
42
48
|
version: exports.EIP712_DOMAIN_VERSION,
|
|
43
|
-
chainId,
|
|
44
49
|
};
|
|
50
|
+
if (chainId) {
|
|
51
|
+
typeDataDomain.chainId = chainId;
|
|
52
|
+
}
|
|
53
|
+
return typeDataDomain;
|
|
45
54
|
};
|
|
46
55
|
exports.Domain = Domain;
|
|
47
56
|
exports.CreatorTypedMessage = Object.assign({ EIP712Domain }, exports.CreatorConfigHashSigningTypes);
|
|
@@ -99,7 +108,7 @@ exports.SDK_VERSION = pjson.version;
|
|
|
99
108
|
exports.DOMAIN_APPLICATION_BUILDER = '00000001';
|
|
100
109
|
exports.DOMAIN_DEPOSIT = '03000000';
|
|
101
110
|
exports.GENESIS_VALIDATOR_ROOT = '0000000000000000000000000000000000000000000000000000000000000000';
|
|
102
|
-
// Flow used to create
|
|
111
|
+
// Flow used to create definition
|
|
103
112
|
var DefinitionFlow;
|
|
104
113
|
(function (DefinitionFlow) {
|
|
105
114
|
DefinitionFlow["Group"] = "LP-Group";
|
|
@@ -109,3 +118,5 @@ var DefinitionFlow;
|
|
|
109
118
|
exports.DEFAULT_BASE_URL = 'https://api.obol.tech';
|
|
110
119
|
exports.DEFAULT_CHAIN_ID = 17000;
|
|
111
120
|
exports.ETHER_TO_GWEI = 10 ** 9;
|
|
121
|
+
exports.TERMS_AND_CONDITIONS_VERSION = 1;
|
|
122
|
+
exports.TERMS_AND_CONDITIONS_URL = (exports.TERMS_AND_CONDITIONS_VERSION === 1) ? 'https://obol.tech/terms.pdf' : `https://obol.tech/${exports.TERMS_AND_CONDITIONS_VERSION}/terms.pdf`;
|
package/dist/cjs/src/index.js
CHANGED
|
@@ -31,6 +31,7 @@ const errors_js_1 = require("./errors.js");
|
|
|
31
31
|
const common_js_1 = require("./verification/common.js");
|
|
32
32
|
const ajv_js_1 = require("./ajv.js");
|
|
33
33
|
const schema_js_1 = require("./schema.js");
|
|
34
|
+
const termsAndConditions_js_1 = require("./verification/termsAndConditions.js");
|
|
34
35
|
__exportStar(require("./types.js"), exports);
|
|
35
36
|
__exportStar(require("./services.js"), exports);
|
|
36
37
|
/**
|
|
@@ -51,6 +52,48 @@ class Client extends base_js_1.Base {
|
|
|
51
52
|
super(config);
|
|
52
53
|
this.signer = signer;
|
|
53
54
|
}
|
|
55
|
+
/**
|
|
56
|
+
* Accepts Obol terms and conditions to be able to create or update data.
|
|
57
|
+
* @returns {Promise<string>} terms and conditions acceptance success message.
|
|
58
|
+
* @throws On unverified signature or wrong hash.
|
|
59
|
+
*
|
|
60
|
+
* An example of how to use acceptObolLatestTermsAndConditions:
|
|
61
|
+
* [acceptObolLatestTermsAndConditions](https://github.com/ObolNetwork/obol-sdk-examples/blob/main/TS-Example/index.ts#L44)
|
|
62
|
+
*/
|
|
63
|
+
acceptObolLatestTermsAndConditions() {
|
|
64
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
65
|
+
if (!this.signer) {
|
|
66
|
+
throw new Error('Signer is required in acceptObolTermsAndConditions');
|
|
67
|
+
}
|
|
68
|
+
try {
|
|
69
|
+
const termsAndConditionsHash = yield (0, termsAndConditions_js_1.hashTermsAndConditions)();
|
|
70
|
+
const address = yield this.signer.getAddress();
|
|
71
|
+
const termsAndConditionsPayload = {
|
|
72
|
+
address,
|
|
73
|
+
version: constants_js_1.TERMS_AND_CONDITIONS_VERSION,
|
|
74
|
+
terms_and_conditions_hash: termsAndConditionsHash
|
|
75
|
+
};
|
|
76
|
+
const termsAndConditionsSignature = yield this.signer.signTypedData((0, constants_js_1.Domain)(), constants_js_1.TermsAndConditionsSigningTypes, {
|
|
77
|
+
terms_and_conditions_hash: termsAndConditionsHash,
|
|
78
|
+
version: constants_js_1.TERMS_AND_CONDITIONS_VERSION,
|
|
79
|
+
});
|
|
80
|
+
const termsAndConditionsResponse = yield this.request('/termsAndConditions', {
|
|
81
|
+
method: 'POST',
|
|
82
|
+
body: JSON.stringify(termsAndConditionsPayload),
|
|
83
|
+
headers: {
|
|
84
|
+
Authorization: `Bearer ${termsAndConditionsSignature}`,
|
|
85
|
+
},
|
|
86
|
+
});
|
|
87
|
+
return termsAndConditionsResponse === null || termsAndConditionsResponse === void 0 ? void 0 : termsAndConditionsResponse.message;
|
|
88
|
+
}
|
|
89
|
+
catch (err) {
|
|
90
|
+
if ((err === null || err === void 0 ? void 0 : err.message) === constants_js_1.CONFLICT_ERROR_MSG) {
|
|
91
|
+
throw new errors_js_1.ConflictError();
|
|
92
|
+
}
|
|
93
|
+
throw err;
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
}
|
|
54
97
|
/**
|
|
55
98
|
* Creates a cluster definition which contains cluster configuration.
|
|
56
99
|
* @param {ClusterPayload} newCluster - The new unique cluster.
|
|
@@ -58,7 +101,7 @@ class Client extends base_js_1.Base {
|
|
|
58
101
|
* @throws On duplicate entries, missing or wrong cluster keys.
|
|
59
102
|
*
|
|
60
103
|
* An example of how to use createClusterDefinition:
|
|
61
|
-
* [createObolCluster](https://github.com/ObolNetwork/obol-sdk-examples/blob/main/TS-Example/index.ts)
|
|
104
|
+
* [createObolCluster](https://github.com/ObolNetwork/obol-sdk-examples/blob/main/TS-Example/index.ts#L59)
|
|
62
105
|
*/
|
|
63
106
|
createClusterDefinition(newCluster) {
|
|
64
107
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -72,7 +115,7 @@ class Client extends base_js_1.Base {
|
|
|
72
115
|
clusterConfig.creator = { address };
|
|
73
116
|
clusterConfig.config_hash = (0, common_js_1.clusterConfigOrDefinitionHash)(clusterConfig, true);
|
|
74
117
|
const creatorConfigSignature = yield this.signer.signTypedData((0, constants_js_1.Domain)(this.chainId), constants_js_1.CreatorConfigHashSigningTypes, { creator_config_hash: clusterConfig.config_hash });
|
|
75
|
-
const clusterDefinition = yield this.request('/
|
|
118
|
+
const clusterDefinition = yield this.request('/v1/definition', {
|
|
76
119
|
method: 'POST',
|
|
77
120
|
body: JSON.stringify(clusterConfig),
|
|
78
121
|
headers: {
|
|
@@ -94,11 +137,11 @@ class Client extends base_js_1.Base {
|
|
|
94
137
|
* Approves joining a cluster with specific configuration.
|
|
95
138
|
* @param {OperatorPayload} operatorPayload - The operator data including signatures.
|
|
96
139
|
* @param {string} configHash - The config hash of the cluster which the operator confirms joining to.
|
|
97
|
-
* @returns {Promise<
|
|
140
|
+
* @returns {Promise<ClusterDefinition>} The cluster definition.
|
|
98
141
|
* @throws On unauthorized, duplicate entries, missing keys, not found cluster or invalid data.
|
|
99
142
|
*
|
|
100
143
|
* An example of how to use acceptClusterDefinition:
|
|
101
|
-
* [acceptClusterDefinition](https://github.com/ObolNetwork/obol-sdk-examples/blob/main/TS-Example/index.ts)
|
|
144
|
+
* [acceptClusterDefinition](https://github.com/ObolNetwork/obol-sdk-examples/blob/main/TS-Example/index.ts#L106)
|
|
102
145
|
*/
|
|
103
146
|
acceptClusterDefinition(operatorPayload, configHash) {
|
|
104
147
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -111,7 +154,7 @@ class Client extends base_js_1.Base {
|
|
|
111
154
|
const operatorConfigSignature = yield this.signer.signTypedData((0, constants_js_1.Domain)(this.chainId), constants_js_1.OperatorConfigHashSigningTypes, { operator_config_hash: configHash });
|
|
112
155
|
const operatorENRSignature = yield this.signer.signTypedData((0, constants_js_1.Domain)(this.chainId), constants_js_1.EnrSigningTypes, { enr: operatorPayload.enr });
|
|
113
156
|
const operatorData = Object.assign(Object.assign({}, operatorPayload), { address, enr_signature: operatorENRSignature, fork_version: this.fork_version });
|
|
114
|
-
const clusterDefinition = yield this.request(`/
|
|
157
|
+
const clusterDefinition = yield this.request(`/v1/definition/${configHash}`, {
|
|
115
158
|
method: 'PUT',
|
|
116
159
|
body: JSON.stringify(operatorData),
|
|
117
160
|
headers: {
|
|
@@ -127,11 +170,11 @@ class Client extends base_js_1.Base {
|
|
|
127
170
|
}
|
|
128
171
|
/**
|
|
129
172
|
* @param configHash - The configuration hash returned in createClusterDefinition
|
|
130
|
-
* @returns {Promise<
|
|
173
|
+
* @returns {Promise<ClusterDefinition>} The cluster definition for config hash
|
|
131
174
|
* @throws On not found config hash.
|
|
132
175
|
*
|
|
133
176
|
* An example of how to use getClusterDefinition:
|
|
134
|
-
* [getObolClusterDefinition](https://github.com/ObolNetwork/obol-sdk-examples/blob/main/TS-Example/index.ts)
|
|
177
|
+
* [getObolClusterDefinition](https://github.com/ObolNetwork/obol-sdk-examples/blob/main/TS-Example/index.ts#L74)
|
|
135
178
|
*/
|
|
136
179
|
getClusterDefinition(configHash) {
|
|
137
180
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -147,7 +190,7 @@ class Client extends base_js_1.Base {
|
|
|
147
190
|
* @throws On not found cluster definition or lock.
|
|
148
191
|
*
|
|
149
192
|
* An example of how to use getClusterLock:
|
|
150
|
-
* [getObolClusterLock](https://github.com/ObolNetwork/obol-sdk-examples/blob/main/TS-Example/index.ts)
|
|
193
|
+
* [getObolClusterLock](https://github.com/ObolNetwork/obol-sdk-examples/blob/main/TS-Example/index.ts#L89)
|
|
151
194
|
*/
|
|
152
195
|
getClusterLock(configHash) {
|
|
153
196
|
return __awaiter(this, void 0, void 0, function* () {
|
package/dist/cjs/src/services.js
CHANGED
|
@@ -18,7 +18,7 @@ const common_js_1 = require("./verification/common.js");
|
|
|
18
18
|
* @throws on missing keys or values.
|
|
19
19
|
*
|
|
20
20
|
* An example of how to use validateClusterLock:
|
|
21
|
-
* [validateClusterLock](https://github.com/ObolNetwork/obol-sdk-examples/blob/main/TS-Example/index.ts)
|
|
21
|
+
* [validateClusterLock](https://github.com/ObolNetwork/obol-sdk-examples/blob/main/TS-Example/index.ts#L127)
|
|
22
22
|
*/
|
|
23
23
|
const validateClusterLock = (lock) => __awaiter(void 0, void 0, void 0, function* () {
|
|
24
24
|
try {
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.hashTermsAndConditions = void 0;
|
|
16
|
+
const pdf_parse_1 = __importDefault(require("pdf-parse"));
|
|
17
|
+
const ssz_1 = require("@chainsafe/ssz");
|
|
18
|
+
const constants_1 = require("../constants");
|
|
19
|
+
const utils_1 = require("../utils");
|
|
20
|
+
const hashTermsAndConditions = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
21
|
+
try {
|
|
22
|
+
// read the pdf
|
|
23
|
+
const response = yield fetch(constants_1.TERMS_AND_CONDITIONS_URL);
|
|
24
|
+
const pdfBuffarrayBuffer = yield response.arrayBuffer();
|
|
25
|
+
const pdfBuffer = Buffer.from(pdfBuffarrayBuffer);
|
|
26
|
+
const data = yield (0, pdf_parse_1.default)(pdfBuffer);
|
|
27
|
+
// ssz hash
|
|
28
|
+
const termsType = new ssz_1.ContainerType({
|
|
29
|
+
terms_and_conditions_hash: new ssz_1.ByteListType(Number.MAX_SAFE_INTEGER),
|
|
30
|
+
});
|
|
31
|
+
const termsHasVal = termsType.defaultValue();
|
|
32
|
+
termsHasVal.terms_and_conditions_hash = (0, utils_1.strToUint8Array)(data === null || data === void 0 ? void 0 : data.text);
|
|
33
|
+
return ('0x' +
|
|
34
|
+
Buffer.from(termsType.hashTreeRoot(termsHasVal).buffer).toString('hex'));
|
|
35
|
+
}
|
|
36
|
+
catch (err) {
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
exports.hashTermsAndConditions = hashTermsAndConditions;
|
|
@@ -147,7 +147,7 @@ const verifyDVV1X8 = (clusterLock) => {
|
|
|
147
147
|
}
|
|
148
148
|
// Deposit Data Verification
|
|
149
149
|
for (let j = 0; j < validator.partial_deposit_data.length; j++) {
|
|
150
|
-
const depositData = validator.partial_deposit_data[
|
|
150
|
+
const depositData = validator.partial_deposit_data[j];
|
|
151
151
|
const { isValidDepositData, depositDataMsg } = (0, common_1.verifyDepositData)(distributedPublicKey, depositData, clusterLock.cluster_definition.validators[i].withdrawal_address, clusterLock.cluster_definition.fork_version);
|
|
152
152
|
if (!isValidDepositData) {
|
|
153
153
|
return false;
|
|
@@ -195,125 +195,120 @@ exports.clusterConfigV1X8 = {
|
|
|
195
195
|
};
|
|
196
196
|
exports.clusterLockV1X8 = {
|
|
197
197
|
cluster_definition: {
|
|
198
|
-
name: '
|
|
198
|
+
name: 'xxxx',
|
|
199
199
|
creator: {
|
|
200
|
-
address: '
|
|
201
|
-
config_signature: '
|
|
200
|
+
address: '0x86B8145c98e5BD25BA722645b15eD65f024a87EC',
|
|
201
|
+
config_signature: '0xd30b182fadbc2c5b2bb3f3f6ed6ac2588f297ceb610ed5509bf3e5a25a9b30c70f8a09ef1d2c8e1dbe5ff441299fe66ec677734cc08beec87e94b7effcb089701b'
|
|
202
202
|
},
|
|
203
203
|
operators: [
|
|
204
204
|
{
|
|
205
|
-
address: '
|
|
206
|
-
enr: 'enr:-
|
|
207
|
-
config_signature: '
|
|
208
|
-
enr_signature: '
|
|
205
|
+
address: '0x86B8145c98e5BD25BA722645b15eD65f024a87EC',
|
|
206
|
+
enr: 'enr:-HW4QLlrtMjFLGkFT1bwdGbvZQlH8hLi0M2g44JAxEYP3BZmYpcsy9Q56HPPD87fMucjvLv4-obEFacpsg0ehRilbHeAgmlkgnY0iXNlY3AyNTZrMaEDRaa5o2aSgqyFq_ERZcQTztrOij1mFtXX1bJuVI6ieak',
|
|
207
|
+
config_signature: '0x3df771ecfc9ae2d01da9249dc636a42893e48759c0fa5c51f5e5e14f3ea4513233d1e3bbdd0e11d4b67c8a907201fd08225a75a1e2d6f510a439d6b15f0c36341c',
|
|
208
|
+
enr_signature: '0x3fe2a124dabe3d517e4c274074b3529d36d9528ca6fa8a4e74ef356f86a07c1462fe72a5336421c2647be7babc4ce1835c2101133e0779cf81d4a8d8cb9fe5591c'
|
|
209
209
|
},
|
|
210
210
|
{
|
|
211
|
-
address: '
|
|
212
|
-
enr: 'enr:-
|
|
213
|
-
config_signature: '
|
|
214
|
-
enr_signature: '
|
|
211
|
+
address: '0xC35CfCd67b9C27345a54EDEcC1033F2284148c81',
|
|
212
|
+
enr: 'enr:-Iu4QNbiUUUwT18LynBbVPJhNxvzQsaSpUr40mQTWscnZaqKb6vAlvV8j-eDDR3E0wjMQumGRbGm2IAb5_k4bVWJiVGAgmlkgnY0gmlwhH8AAAGJc2VjcDI1NmsxoQPOiodUji0ohgJb5sNK1hgv8g6xO5_znZz3NkkBkyYyKIN0Y3CCDhqDdWRwgg4u',
|
|
213
|
+
config_signature: '0x12d19d6fc4c1a5d9e7be09f47c2f2357dd89f47aba8ae0185f5345e08bcc3adc324bdd51e68a12c3ca34c604d786cfde5f0798aa928dac496edb16c70e7086551b',
|
|
214
|
+
enr_signature: '0xa3d49832dfaf0ad87c5796f9bc151009343da70b91fd53bee3645baa63d001d3207662da8f67b3a20f2ee30c9cacb24a5719a78dc24e030c8ac93e7b3b46bf881b'
|
|
215
215
|
},
|
|
216
216
|
{
|
|
217
|
-
address: '
|
|
218
|
-
enr: 'enr:-
|
|
219
|
-
config_signature: '
|
|
220
|
-
enr_signature: '
|
|
217
|
+
address: '0x33807D6F1DCe44b9C599fFE03640762A6F08C496',
|
|
218
|
+
enr: 'enr:-Iu4QJyserRukhG0Vgi2csu7GjpHYUGufNEbZ8Q7ZBrcZUb0KqpL5QzHonkh1xxHlxatTxrIcX_IS5J3SEWR_sa0ptGAgmlkgnY0gmlwhH8AAAGJc2VjcDI1NmsxoQMAUgEqczOjevyculnUIofhCj0DkgJudErM7qCYIvIkzIN0Y3CCDhqDdWRwgg4u',
|
|
219
|
+
config_signature: '0x665d287c46921aad0dde389291b982f24dbbeb4b7ce5ee7bbc4a7d1fb55134f7136889eb3ce70208a7f276b9d4aefb1fbc6159476934567e5bf11765b2c9649b1b',
|
|
220
|
+
enr_signature: '0xc32d5ea29569b01354d48ddaf56df1481a5ae618ffb47602ef40e0e77357de5f23a5258923be5fa06ecce20f5692847860c25c38b97a4e306c94decd99c0519a1b'
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
address: '0xc6e76F72Ea672FAe05C357157CfC37720F0aF26f',
|
|
224
|
+
enr: 'enr:-HW4QKJTwXC6Chw6zbnA3HFZi6Jo0DkIgjKy4eUBpsSOGnAeWE6ChEjEyk_6R6Qrm7jI-iqfs3_HYxiKde8vFgvHHrCAgmlkgnY0iXNlY3AyNTZrMaECfFKQH4spdZCHqrKVz1Q02xYla6J_RQECDNNYBRWdzv8',
|
|
225
|
+
config_signature: '0x610f7be9c7c38878cde1cb391de08eee2f86e62f31f450843b4e37164e738fc8769046e53ad1f018f54ddaf858ff372d22169702c60d68bda19c96fdd20150b61c',
|
|
226
|
+
enr_signature: '0xe2977c79f63b8fe6cb6551efec0cf69041c7f4aaa8ea338997a397450ee946023b03ccb70ad3cc97b1319e1eea9f7472a2ca161bc8b33acdcde689d84c7e771c1b'
|
|
221
227
|
}
|
|
222
228
|
],
|
|
223
|
-
uuid: '
|
|
229
|
+
uuid: 'bc2fec0c-0b8b-4415-bf48-1e96b07f50eb',
|
|
224
230
|
version: 'v1.8.0',
|
|
225
|
-
timestamp: '2024-
|
|
231
|
+
timestamp: '2024-05-24T15:04:08.322Z',
|
|
226
232
|
num_validators: 2,
|
|
227
233
|
threshold: 3,
|
|
228
234
|
validators: [
|
|
229
235
|
{
|
|
230
|
-
fee_recipient_address: '
|
|
231
|
-
withdrawal_address: '
|
|
236
|
+
fee_recipient_address: '0x7aC193bF9a9C6e6DD6302969E8Ea6EdF6df490d8',
|
|
237
|
+
withdrawal_address: '0x9e0AC0078F10d28E875577bb3A4A9EDAB60c03EC'
|
|
232
238
|
},
|
|
233
239
|
{
|
|
234
|
-
fee_recipient_address: '
|
|
235
|
-
withdrawal_address: '
|
|
240
|
+
fee_recipient_address: '0x7aC193bF9a9C6e6DD6302969E8Ea6EdF6df490d8',
|
|
241
|
+
withdrawal_address: '0x9e0AC0078F10d28E875577bb3A4A9EDAB60c03EC'
|
|
236
242
|
}
|
|
237
243
|
],
|
|
238
|
-
dkg_algorithm: '
|
|
239
|
-
fork_version: '
|
|
244
|
+
dkg_algorithm: 'default',
|
|
245
|
+
fork_version: '0x01017000',
|
|
240
246
|
deposit_amounts: [
|
|
241
|
-
'
|
|
242
|
-
'16000000000',
|
|
243
|
-
'8000000000'
|
|
247
|
+
'32000000000'
|
|
244
248
|
],
|
|
245
|
-
config_hash: '
|
|
246
|
-
definition_hash: '
|
|
249
|
+
config_hash: '0xb2601f51d277f699acb8ea3b9fb4fc68087c0f1f2c6ae83d00fdd853a6cddb31',
|
|
250
|
+
definition_hash: '0x2a9d52b1dd13fd91661d81e3786512ffdcc3689e2ec97105add153f543c642b4'
|
|
247
251
|
},
|
|
248
252
|
distributed_validators: [
|
|
249
253
|
{
|
|
250
|
-
distributed_public_key: '
|
|
254
|
+
distributed_public_key: '0xa33ae80f967a669d8df3ae769acc114577fab185d53e10154b0b50cc0cf9b9f35e466a318f174e8cecdc12173d95cb27',
|
|
251
255
|
public_shares: [
|
|
252
|
-
'
|
|
253
|
-
'
|
|
254
|
-
'
|
|
256
|
+
'0x849db297f690a26e76d5930f99eac9e3f95d9232256d6e39124fe071745b43c8b5418c733b06683aa240a2a0e44b9b8f',
|
|
257
|
+
'0xa1051bf5692153d5bc418946763bb5c82780a05e97bd5b258ea7abe6705047628edd8277366f6b5d0469abfee18988d9',
|
|
258
|
+
'0x87d0342e5dc49a0a0c8f08ec011da3bd859a333bfc46ddd0a194485aa5aa954b7c18d05a2c1ae148d4dc45331101f496',
|
|
259
|
+
'0xa4fa0e971e1a5e38ebe89c6457bc9316b3dd0933660b17e1c717ac148f8340a5db20d867c7a24758c701f6b6bec4d552'
|
|
255
260
|
],
|
|
256
261
|
builder_registration: {
|
|
257
262
|
message: {
|
|
258
|
-
fee_recipient: '
|
|
263
|
+
fee_recipient: '0x7ac193bf9a9c6e6dd6302969e8ea6edf6df490d8',
|
|
259
264
|
gas_limit: 30000000,
|
|
260
|
-
timestamp:
|
|
261
|
-
pubkey: '
|
|
265
|
+
timestamp: 1696000704,
|
|
266
|
+
pubkey: '0xa33ae80f967a669d8df3ae769acc114577fab185d53e10154b0b50cc0cf9b9f35e466a318f174e8cecdc12173d95cb27'
|
|
262
267
|
},
|
|
263
|
-
signature: '
|
|
268
|
+
signature: '0xb39977fe7c45bab28cfd1bcf356a71b0557187a75e0dfa0facaf5eddba05988c0da85800a4b4528704df44f280913ebc125eb3f9c091d6dd220c92dfcc3c80bc7a9ed2f1b96bffaeaa1053cf117b02b48eb755139c5623b6e61dd92c27d15813'
|
|
264
269
|
},
|
|
265
270
|
partial_deposit_data: [
|
|
266
271
|
{
|
|
267
|
-
pubkey: '
|
|
268
|
-
withdrawal_credentials: '
|
|
269
|
-
amount: '
|
|
270
|
-
signature: '
|
|
271
|
-
},
|
|
272
|
-
{
|
|
273
|
-
pubkey: '0x87382e8cc3e2c9c2d03ac1af7ae0bcc1be468c596a8a8b8059153ca9ce7746d459dd0603858e858355cb96d67a2a87a7',
|
|
274
|
-
withdrawal_credentials: '0x01000000000000000000000081855ad8681d0d86d1e91e00167939cb6694d2c4',
|
|
275
|
-
amount: '16000000000',
|
|
276
|
-
signature: '0xac5bcb369e8dde110604f6ae829a3432f82a99b0a996e15f4be6426acbe690a1aadb4b365d8b10a36737b2cd8c7f561214d4e4df3626cc9664f663111d15efbd8d18cffff5c3eff407fe2cc478244caea7f9f2afee83a0ae8aa2587365b8e54a'
|
|
272
|
+
pubkey: '0xa33ae80f967a669d8df3ae769acc114577fab185d53e10154b0b50cc0cf9b9f35e466a318f174e8cecdc12173d95cb27',
|
|
273
|
+
withdrawal_credentials: '0x0100000000000000000000009e0ac0078f10d28e875577bb3a4a9edab60c03ec',
|
|
274
|
+
amount: '32000000000',
|
|
275
|
+
signature: '0x9861022ca71cf18aad49a201b023356b8c5ca090086614b681cb84a54327caeff53c0a71c5f55f49976114bb86de2ad6052d174d7948e6c8a924d9bfbbbc2181fad967d818454c6c4f7cffb7bb93dc2c4f4c87fc5598cb4582fa08eff0c7bc08'
|
|
277
276
|
}
|
|
278
277
|
]
|
|
279
278
|
},
|
|
280
279
|
{
|
|
281
|
-
distributed_public_key: '
|
|
280
|
+
distributed_public_key: '0xaa888bf805bec7da7ac18dea3afefbf5b8510cbf76367229dab830b3ecdd4533b9d50fb9fcb454df5cbe08e4b31e8479',
|
|
282
281
|
public_shares: [
|
|
283
|
-
'
|
|
284
|
-
'
|
|
285
|
-
'
|
|
282
|
+
'0x8279ae646839d946a622d096296ffcccd289e8c49ea2308560bbb731c63d4b49ea46db817a955e47634edbded4919d82',
|
|
283
|
+
'0xa8a12b5b645b015c55515b3220395e015fc051c58bf243e1b638770652c67f863852f9190e3e182aa86b99823b4cf28d',
|
|
284
|
+
'0xb0c557f812060bb1c409e5324c7b54f35fee8f1180c714e60784f7df6a58e3ba3da6cc8b3cebc01975f9f41efcd777cb',
|
|
285
|
+
'0xa7a8576c3b21221f2a6adefc41b4c1f979ee0761e9a7ff50d30434d1a0c4e7fc505b308636801925e698286b802de421'
|
|
286
286
|
],
|
|
287
287
|
builder_registration: {
|
|
288
288
|
message: {
|
|
289
|
-
fee_recipient: '
|
|
289
|
+
fee_recipient: '0x7ac193bf9a9c6e6dd6302969e8ea6edf6df490d8',
|
|
290
290
|
gas_limit: 30000000,
|
|
291
|
-
timestamp:
|
|
292
|
-
pubkey: '
|
|
291
|
+
timestamp: 1696000704,
|
|
292
|
+
pubkey: '0xaa888bf805bec7da7ac18dea3afefbf5b8510cbf76367229dab830b3ecdd4533b9d50fb9fcb454df5cbe08e4b31e8479'
|
|
293
293
|
},
|
|
294
|
-
signature: '
|
|
294
|
+
signature: '0x8dcb54028adb8f5601b6ab20ded381dabb6739b3e506df795a279043997908c7d38a68b8e8dda27516165f18e437a84603935bfefc1a83befbd1a90ac43fcc7fb0eed81122852a2ee71fef414aa8879198da239527036b0eaebcdc88d6eca3d1'
|
|
295
295
|
},
|
|
296
296
|
partial_deposit_data: [
|
|
297
297
|
{
|
|
298
|
-
pubkey: '
|
|
299
|
-
withdrawal_credentials: '
|
|
300
|
-
amount: '
|
|
301
|
-
signature: '
|
|
302
|
-
},
|
|
303
|
-
{
|
|
304
|
-
pubkey: '0x90b5773dc3dc11480a7ebf68005980ca26be65fad6565ce655f0a9e24083a7ad2e22d7102368a8292fcd18021272a87a',
|
|
305
|
-
withdrawal_credentials: '0x0100000000000000000000005fb90badb37c5821b6d95526a41a9504680b4e7c',
|
|
306
|
-
amount: '16000000000',
|
|
307
|
-
signature: '0x94d9db7b4527e6eb308d387f168089a51d1deffc2c985faf1f7f8e82fbc9cb93c7f10c6a7bbca4fc25a1cfc95de28432037cf7727c1db0ad6d1fb0f1813d5904fba4ab8aebfeccfcded2f915bd48fb46155131b24adb0ba5e764d7ff6d3c82a5'
|
|
298
|
+
pubkey: '0xaa888bf805bec7da7ac18dea3afefbf5b8510cbf76367229dab830b3ecdd4533b9d50fb9fcb454df5cbe08e4b31e8479',
|
|
299
|
+
withdrawal_credentials: '0x0100000000000000000000009e0ac0078f10d28e875577bb3a4a9edab60c03ec',
|
|
300
|
+
amount: '32000000000',
|
|
301
|
+
signature: '0x95ee68e5191d34e10f567ab0f565cd927211b29be9ab830d39bf74d0486aee7bff78d8fe12d455cb40ec707378eea1040a9d80806f82afa58295de9d4db2dccc48cfaf3c98e9020c6b5c8a9aacf5bbfc7e316871f505000304d9d39b7ad5c5d8'
|
|
308
302
|
}
|
|
309
303
|
]
|
|
310
304
|
}
|
|
311
305
|
],
|
|
312
|
-
signature_aggregate: '
|
|
313
|
-
lock_hash: '
|
|
306
|
+
signature_aggregate: '0x81ab6319191e3b9065f14231a71fe480b4a45e5e5db4a064faa19a31d04b9cb55fa88b8aa3c966b054b97ae7db2233ee060ae333c5ca3a55ed16b9a3de1894087901cb2d3a177de1cd40030c93301c23ca3edd28dfd1ad04e210b7e2c7625f89',
|
|
307
|
+
lock_hash: '0x186e7e61fb49373d9034d101f2f08429cb379bfcc2f7fa5e9598e8a14ae13ed7',
|
|
314
308
|
node_signatures: [
|
|
315
|
-
'
|
|
316
|
-
'
|
|
317
|
-
'
|
|
309
|
+
'0xd4b1b6f7b363015b9d1c1c4f199fffc3f9238b7326fdfc5059b175519b05c90a022a18bf2e3eae7d7b0e833384131c2e7be17cc78f6ca23644ae345904dc2d2601',
|
|
310
|
+
'0xc186f930d8d281ab3999fb0ff62b5d96045a4e2330d9d8b300d5d1014f6b4bd925d9c2fedbb53047a49d4008f82600f46e1131b981222c5e423c12b1c9fd544900',
|
|
311
|
+
'0xbc0831fa82b1a70e17eb4fe6f79249a8f5aab1d1f196dd07e32766eb27e72354757d7146b64fca4ad4efa554f7a5d4e7ef835aab6348e9afa37c9eeab069ff4e01',
|
|
312
|
+
'0x0135f307831fa58ff64f9af46e00b92e2375162646af88f6991ba6f98a8c262f2c41846af59da68eadb8ff9c94db42ee8005bd4236e5897635573db2911460aa00'
|
|
318
313
|
]
|
|
319
314
|
};
|
|
@@ -17,6 +17,7 @@ const base_1 = require("../src/base");
|
|
|
17
17
|
const ajv_1 = require("../src/ajv");
|
|
18
18
|
const msw_1 = require("msw");
|
|
19
19
|
const node_1 = require("msw/node");
|
|
20
|
+
const termsAndConditions_1 = require("../src/verification/termsAndConditions");
|
|
20
21
|
/* eslint no-new: 0 */
|
|
21
22
|
describe('Cluster Client', () => {
|
|
22
23
|
var _a, _b;
|
|
@@ -33,6 +34,13 @@ describe('Cluster Client', () => {
|
|
|
33
34
|
// expect(error.message).toBe('Obol-SDK is in Beta phase, mainnet is not yet supported')
|
|
34
35
|
// }
|
|
35
36
|
// })
|
|
37
|
+
test('createTermsAndConditions should return "successful authorization"', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
38
|
+
clientInstance['request'] = jest
|
|
39
|
+
.fn()
|
|
40
|
+
.mockReturnValue(Promise.resolve({ message: 'successful authorization' }));
|
|
41
|
+
const isAuthorized = yield clientInstance.acceptObolLatestTermsAndConditions();
|
|
42
|
+
expect(isAuthorized).toEqual('successful authorization');
|
|
43
|
+
}));
|
|
36
44
|
test('createClusterDefinition should return config_hash', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
37
45
|
clientInstance['request'] = jest
|
|
38
46
|
.fn()
|
|
@@ -148,4 +156,8 @@ describe('Cluster Client without a signer', () => {
|
|
|
148
156
|
const isValidLock = yield (0, index_1.validateClusterLock)(clusterLock);
|
|
149
157
|
expect(isValidLock).toEqual(true);
|
|
150
158
|
}));
|
|
159
|
+
test('Finds the hash of the latest version of terms and conditions', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
160
|
+
const termsAndConditionsHash = yield (0, termsAndConditions_1.hashTermsAndConditions)();
|
|
161
|
+
expect(termsAndConditionsHash).toEqual('0x0015d01710b4d864004320a4826f6846c2db12a7f056a126fa5ae16c0b5e2b65');
|
|
162
|
+
}));
|
|
151
163
|
});
|
package/dist/esm/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@obolnetwork/obol-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.16",
|
|
4
4
|
"description": "A package for creating Distributed Validators using the Obol API.",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/obolnetwork/obol-sdk/issues"
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"@chainsafe/discv5": "^0.5.1",
|
|
43
43
|
"@chainsafe/ssz": "^0.14.0",
|
|
44
44
|
"@metamask/eth-sig-util": "^7.0.1",
|
|
45
|
+
"@types/pdf-parse": "^1.1.4",
|
|
45
46
|
"ajv": "^8.12.0",
|
|
46
47
|
"cross-fetch": "^3.1.5",
|
|
47
48
|
"elliptic": "^6.5.4",
|
|
@@ -49,9 +50,9 @@
|
|
|
49
50
|
"eslint-plugin-import": "^2.29.1",
|
|
50
51
|
"eslint-plugin-n": "^16.6.2",
|
|
51
52
|
"eslint-plugin-promise": "^6.1.1",
|
|
52
|
-
"ethers": "
|
|
53
|
+
"ethers": "6.4.0",
|
|
53
54
|
"nock": "^13.5.3",
|
|
54
|
-
"
|
|
55
|
+
"pdf-parse": "^1.1.1",
|
|
55
56
|
"semver": "^7.6.0",
|
|
56
57
|
"typescript-eslint": "^7.1.0",
|
|
57
58
|
"uuid": "^9.0.0"
|
|
@@ -61,11 +62,13 @@
|
|
|
61
62
|
"@types/elliptic": "^6.4.18",
|
|
62
63
|
"@types/jest": "^28.1.8",
|
|
63
64
|
"@types/node": "^20.2.5",
|
|
65
|
+
"@types/semver": "^7.5.8",
|
|
64
66
|
"@types/uuid": "^9.0.1",
|
|
65
67
|
"eslint": "^8.57.0",
|
|
66
68
|
"jest": "^28.1.3",
|
|
67
69
|
"msw": "^2.2.1",
|
|
68
70
|
"npm-run-all": "^4.1.5",
|
|
71
|
+
"release-it": "^17.2.1",
|
|
69
72
|
"ts-jest": "^28.0.8",
|
|
70
73
|
"tsup": "^6.7.0",
|
|
71
74
|
"typedoc": "^0.25.7",
|
package/dist/esm/src/base.js
CHANGED
|
@@ -5,17 +5,26 @@ export const EIP712_DOMAIN_VERSION = '1';
|
|
|
5
5
|
export const CreatorConfigHashSigningTypes = {
|
|
6
6
|
CreatorConfigHash: [{ name: 'creator_config_hash', type: 'string' }],
|
|
7
7
|
};
|
|
8
|
+
export const TermsAndConditionsSigningTypes = {
|
|
9
|
+
TermsAndConditions: [
|
|
10
|
+
{ name: 'terms_and_conditions_hash', type: 'string' },
|
|
11
|
+
{ name: 'version', type: 'uint256' },
|
|
12
|
+
]
|
|
13
|
+
};
|
|
8
14
|
const EIP712Domain = [
|
|
9
15
|
{ name: 'name', type: 'string' },
|
|
10
16
|
{ name: 'version', type: 'string' },
|
|
11
17
|
{ name: 'chainId', type: 'uint256' },
|
|
12
18
|
];
|
|
13
19
|
export const Domain = (chainId) => {
|
|
14
|
-
|
|
20
|
+
const typeDataDomain = {
|
|
15
21
|
name: EIP712_DOMAIN_NAME,
|
|
16
22
|
version: EIP712_DOMAIN_VERSION,
|
|
17
|
-
chainId,
|
|
18
23
|
};
|
|
24
|
+
if (chainId) {
|
|
25
|
+
typeDataDomain.chainId = chainId;
|
|
26
|
+
}
|
|
27
|
+
return typeDataDomain;
|
|
19
28
|
};
|
|
20
29
|
export const CreatorTypedMessage = Object.assign({ EIP712Domain }, CreatorConfigHashSigningTypes);
|
|
21
30
|
// A conflict once updateDefinition is merged
|
|
@@ -69,7 +78,7 @@ export const SDK_VERSION = pjson.version;
|
|
|
69
78
|
export const DOMAIN_APPLICATION_BUILDER = '00000001';
|
|
70
79
|
export const DOMAIN_DEPOSIT = '03000000';
|
|
71
80
|
export const GENESIS_VALIDATOR_ROOT = '0000000000000000000000000000000000000000000000000000000000000000';
|
|
72
|
-
// Flow used to create
|
|
81
|
+
// Flow used to create definition
|
|
73
82
|
export var DefinitionFlow;
|
|
74
83
|
(function (DefinitionFlow) {
|
|
75
84
|
DefinitionFlow["Group"] = "LP-Group";
|
|
@@ -79,3 +88,5 @@ export var DefinitionFlow;
|
|
|
79
88
|
export const DEFAULT_BASE_URL = 'https://api.obol.tech';
|
|
80
89
|
export const DEFAULT_CHAIN_ID = 17000;
|
|
81
90
|
export const ETHER_TO_GWEI = 10 ** 9;
|
|
91
|
+
export const TERMS_AND_CONDITIONS_VERSION = 1;
|
|
92
|
+
export const TERMS_AND_CONDITIONS_URL = (TERMS_AND_CONDITIONS_VERSION === 1) ? 'https://obol.tech/terms.pdf' : `https://obol.tech/${TERMS_AND_CONDITIONS_VERSION}/terms.pdf`;
|