@obolnetwork/obol-sdk 1.0.4 → 1.0.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 +1 -1
- package/dist/constants.d.ts +2 -2
- package/dist/fixtures.d.ts +17 -1
- package/dist/fixtures.d.ts.map +1 -1
- package/dist/hash.d.ts +4 -4
- package/dist/hash.d.ts.map +1 -1
- package/dist/index.d.ts +35 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.js +392 -346
- package/dist/index.js +392 -346
- package/dist/types.d.ts +97 -5
- package/dist/types.d.ts.map +1 -1
- package/package.json +4 -2
package/dist/types.d.ts
CHANGED
|
@@ -1,45 +1,137 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Cluster Node Operator
|
|
3
|
+
*/
|
|
4
|
+
export declare type ClusterOperator = {
|
|
5
|
+
/** The operator address. */
|
|
2
6
|
address: string;
|
|
7
|
+
/** The operator ethereum node record. */
|
|
3
8
|
enr?: string;
|
|
9
|
+
/** The cluster fork_version. */
|
|
4
10
|
fork_version?: string;
|
|
11
|
+
/** The cluster version. */
|
|
5
12
|
version?: string;
|
|
13
|
+
/** The operator enr signature. */
|
|
6
14
|
enr_signature?: string;
|
|
15
|
+
/** The operator configuration signature. */
|
|
7
16
|
config_signature?: string;
|
|
8
17
|
};
|
|
9
|
-
|
|
18
|
+
/**
|
|
19
|
+
* Cluster Creator
|
|
20
|
+
*/
|
|
21
|
+
export declare type ClusterCreator = {
|
|
22
|
+
/** The creator address. */
|
|
10
23
|
address: string;
|
|
24
|
+
/** The cluster configuration signature. */
|
|
11
25
|
config_signature?: string;
|
|
12
26
|
};
|
|
13
|
-
|
|
27
|
+
/**
|
|
28
|
+
* Cluster Validator
|
|
29
|
+
*/
|
|
30
|
+
export declare type ClusterValidator = {
|
|
31
|
+
/** The validator fee recipient address. */
|
|
14
32
|
fee_recipient_address: string;
|
|
33
|
+
/** The validator reward address. */
|
|
15
34
|
withdrawal_address: string;
|
|
16
35
|
};
|
|
36
|
+
/**
|
|
37
|
+
* Cluster Required Configuration
|
|
38
|
+
*/
|
|
17
39
|
export interface ClusterPayload {
|
|
40
|
+
/** The cluster name. */
|
|
18
41
|
name: string;
|
|
42
|
+
/** The cluster nodes operators addresses. */
|
|
19
43
|
operators: ClusterOperator[];
|
|
44
|
+
/** The clusters validators information. */
|
|
20
45
|
validators: ClusterValidator[];
|
|
21
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* Cluster Definition
|
|
49
|
+
*/
|
|
22
50
|
export interface ClusterDefintion extends ClusterPayload {
|
|
51
|
+
/** The creator of the cluster. */
|
|
23
52
|
creator: ClusterCreator;
|
|
53
|
+
/** The cluster configuration version. */
|
|
24
54
|
version: string;
|
|
55
|
+
/** The cluster dkg algorithm. */
|
|
25
56
|
dkg_algorithm: string;
|
|
57
|
+
/** The cluster fork version. */
|
|
26
58
|
fork_version: string;
|
|
59
|
+
/** The cluster uuid. */
|
|
27
60
|
uuid: string;
|
|
61
|
+
/** The cluster creation timestamp. */
|
|
28
62
|
timestamp: string;
|
|
63
|
+
/** The cluster configuration hash. */
|
|
29
64
|
config_hash: string;
|
|
65
|
+
/** The distributed validator threshold. */
|
|
30
66
|
threshold: number;
|
|
67
|
+
/** The number of distributed validators in the cluster. */
|
|
31
68
|
num_validators: number;
|
|
69
|
+
/** The hash of the cluster definition. */
|
|
32
70
|
definition_hash?: string;
|
|
33
71
|
}
|
|
34
|
-
|
|
72
|
+
/**
|
|
73
|
+
* Unsigned DV Builder Registration Message
|
|
74
|
+
*/
|
|
75
|
+
export declare type BuilderRegistrationMessage = {
|
|
76
|
+
/** The DV fee recipient. */
|
|
77
|
+
fee_recipient: string;
|
|
78
|
+
/** Default is 30000000. */
|
|
79
|
+
gas_limit: number;
|
|
80
|
+
/** Timestamp when generating cluster lock file. */
|
|
81
|
+
timestamp: number;
|
|
82
|
+
/** The public key of the DV. */
|
|
83
|
+
pubkey: string;
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* Pre-generated Signed Validator Builder Registration
|
|
87
|
+
*/
|
|
88
|
+
export declare type BuilderRegistration = {
|
|
89
|
+
/** Builder registration message. */
|
|
90
|
+
message: BuilderRegistrationMessage;
|
|
91
|
+
/** BLS signature of the builder registration message. */
|
|
92
|
+
signature: string;
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* Deposit Data
|
|
96
|
+
*/
|
|
97
|
+
export declare type DepositData = {
|
|
98
|
+
/** The public key of the distributed validator. */
|
|
99
|
+
pubkey: string;
|
|
100
|
+
/** The 0x01 withdrawal address of the DV. */
|
|
101
|
+
withdrawal_credentials: string;
|
|
102
|
+
/** 32 ethers. */
|
|
103
|
+
amount: string;
|
|
104
|
+
/** A checksum for DepositData fields . */
|
|
105
|
+
deposit_data_root: string;
|
|
106
|
+
/** BLS signature of the deposit message. */
|
|
107
|
+
signature: string;
|
|
108
|
+
};
|
|
109
|
+
/**
|
|
110
|
+
* Distributed Validator
|
|
111
|
+
*/
|
|
112
|
+
export declare type DistributedValidator = {
|
|
113
|
+
/** The public key of the distributed validator. */
|
|
35
114
|
distributed_public_key: string;
|
|
115
|
+
/** The public key of the node distributed validator share. */
|
|
36
116
|
public_shares: string[];
|
|
117
|
+
/** The required deposit data for activating the DV. */
|
|
118
|
+
deposit_data: Partial<DepositData>;
|
|
119
|
+
/** pre-generated signed validator builder registration to be sent to builder network. */
|
|
120
|
+
builder_registration: BuilderRegistration;
|
|
37
121
|
};
|
|
122
|
+
/**
|
|
123
|
+
* Cluster Lock (Cluster Details after DKG is complete)
|
|
124
|
+
*/
|
|
38
125
|
export interface ClusterLock {
|
|
126
|
+
/** The cluster definition. */
|
|
39
127
|
cluster_definition: ClusterDefintion;
|
|
128
|
+
/** The cluster distributed validators. */
|
|
40
129
|
distributed_validators: DistributedValidator[];
|
|
130
|
+
/** The cluster bls signature aggregate. */
|
|
41
131
|
signature_aggregate: string;
|
|
132
|
+
/** The hash of the cluster lock. */
|
|
42
133
|
lock_hash: string;
|
|
134
|
+
/** Node Signature for the lock hash by the node secp256k1 key. */
|
|
135
|
+
node_signatures: string[];
|
|
43
136
|
}
|
|
44
|
-
export {};
|
|
45
137
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,eAAe,GAAG;IAC5B,4BAA4B;IAC5B,OAAO,EAAE,MAAM,CAAC;IAEhB,yCAAyC;IACzC,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb,gCAAgC;IAChC,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,2BAA2B;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,kCAAkC;IAClC,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,4CAA4C;IAC5C,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAA;AAED;;GAEG;AACH,oBAAY,cAAc,GAAG;IAC3B,2BAA2B;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,2CAA2C;IAC3C,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAA;AAED;;GAEG;AACH,oBAAY,gBAAgB,GAAG;IAC7B,2CAA2C;IAC3C,qBAAqB,EAAE,MAAM,CAAC;IAE9B,oCAAoC;IACpC,kBAAkB,EAAE,MAAM,CAAC;CAC5B,CAAA;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAE7B,wBAAwB;IACxB,IAAI,EAAE,MAAM,CAAC;IAEb,6CAA6C;IAC7C,SAAS,EAAE,eAAe,EAAE,CAAC;IAE7B,2CAA2C;IAC3C,UAAU,EAAE,gBAAgB,EAAE,CAAC;CAChC;AAGD;;GAEG;AACH,M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E,MAAM,CAAC;IAE/B,8DAA8D;IAC9D,aAAa,EAAE,MAAM,EAAE,CAAC;IAExB,uDAAuD;IACvD,YAAY,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IAEnC,yFAAyF;IACzF,oBAAoB,EAAE,mBAAmB,CAAC;CAC3C,CAAA;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,8BAA8B;IAC9B,kBAAkB,EAAE,gBAAgB,CAAC;IAErC,0CAA0C;IAC1C,sBAAsB,EAAE,oBAAoB,EAAE,CAAC;IAE/C,2CAA2C;IAC3C,mBAAmB,EAAE,MAAM,CAAC;IAE5B,oCAAoC;IACpC,SAAS,EAAE,MAAM,CAAC;IAElB,kEAAkE;IAClE,eAAe,EAAE,MAAM,EAAE,CAAC;CAC3B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@obolnetwork/obol-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "A package for creating Distributed Validators using the Obol API.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.es.js",
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
"build": "rm -rf dist && tsc",
|
|
18
18
|
"test": "jest --config ./src/jest.config.json",
|
|
19
19
|
"ds:build": "rollup -c",
|
|
20
|
+
"generate-typedoc": "typedoc",
|
|
20
21
|
"ds:release:major": "npm version $(semver $npm_package_version -i major) && npm publish --tag latest",
|
|
21
22
|
"ds:release:minor": "npm version $(semver $npm_package_version -i minor) && npm publish --tag latest",
|
|
22
23
|
"ds:release:patch": "npm config list && npm version $(semver $npm_package_version -i patch) && npm publish --tag latest"
|
|
@@ -41,18 +42,19 @@
|
|
|
41
42
|
"ajv": "^8.12.0",
|
|
42
43
|
"cross-fetch": "^3.1.5",
|
|
43
44
|
"ethers": "^6.4.0",
|
|
44
|
-
"nock": "^13.3.1",
|
|
45
45
|
"uuid": "^9.0.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/jest": "^28.1.8",
|
|
49
49
|
"@types/node": "^20.2.5",
|
|
50
50
|
"@types/uuid": "^9.0.1",
|
|
51
|
+
"fetch-mock": "^9.11.0",
|
|
51
52
|
"jest": "^28.1.3",
|
|
52
53
|
"rollup-config": "*",
|
|
53
54
|
"ts-jest": "^28.0.8",
|
|
54
55
|
"tsconfig": "*",
|
|
55
56
|
"tsup": "^6.7.0",
|
|
57
|
+
"typedoc": "^0.24.8",
|
|
56
58
|
"typescript": "^5.1.3"
|
|
57
59
|
}
|
|
58
60
|
}
|