@obolnetwork/obol-sdk 1.0.8 → 1.0.11
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 +2 -1
- package/dist/cjs/src/ajv.js +17 -0
- package/dist/cjs/src/base.js +39 -0
- package/dist/cjs/src/constants.js +86 -0
- package/dist/cjs/src/errors.js +11 -0
- package/dist/cjs/src/hash.js +172 -0
- package/dist/cjs/src/index.js +158 -0
- package/dist/cjs/src/schema.js +72 -0
- package/dist/cjs/src/services.js +32 -0
- package/dist/cjs/src/types.js +18 -0
- package/dist/cjs/src/utils.js +11 -0
- package/dist/cjs/src/verify.js +326 -0
- package/dist/cjs/test/fixtures.js +101 -0
- package/dist/cjs/test/methods.test.js +128 -0
- package/dist/esm/src/ajv.js +10 -0
- package/dist/esm/src/base.js +35 -0
- package/dist/esm/src/constants.js +79 -0
- package/dist/esm/src/errors.js +7 -0
- package/dist/esm/src/hash.js +165 -0
- package/dist/esm/src/index.js +140 -0
- package/dist/esm/src/schema.js +69 -0
- package/dist/esm/src/services.js +28 -0
- package/dist/esm/src/types.js +15 -0
- package/dist/esm/src/utils.js +6 -0
- package/dist/esm/src/verify.js +295 -0
- package/dist/esm/test/fixtures.js +98 -0
- package/dist/esm/test/methods.test.js +126 -0
- package/dist/types/src/ajv.d.ts +2 -0
- package/dist/{base.d.ts → types/src/base.d.ts} +13 -14
- package/dist/types/src/constants.d.ts +79 -0
- package/dist/{errors.d.ts → types/src/errors.d.ts} +4 -5
- package/dist/{hash.d.ts → types/src/hash.d.ts} +56 -64
- package/dist/{index.d.ts → types/src/index.d.ts} +64 -49
- package/dist/types/src/schema.d.ts +57 -0
- package/dist/types/src/services.d.ts +11 -0
- package/dist/{types.d.ts → types/src/types.d.ts} +153 -150
- package/dist/types/src/utils.d.ts +2 -0
- package/dist/types/src/verify.d.ts +4 -0
- package/dist/{fixtures.d.ts → types/test/fixtures.d.ts} +61 -62
- package/dist/types/test/methods.test.d.ts +1 -0
- package/package.json +55 -21
- package/src/ajv.ts +11 -0
- package/src/base.ts +44 -0
- package/src/constants.ts +118 -0
- package/src/errors.ts +11 -0
- package/src/hash.ts +250 -0
- package/src/index.ts +160 -0
- package/src/schema.ts +70 -0
- package/src/services.ts +20 -0
- package/src/types.ts +211 -0
- package/src/utils.ts +7 -0
- package/src/verify.ts +479 -0
- package/dist/ajv.d.ts +0 -4
- package/dist/ajv.d.ts.map +0 -1
- package/dist/base.d.ts.map +0 -1
- package/dist/cluster.test.d.ts +0 -2
- package/dist/cluster.test.d.ts.map +0 -1
- package/dist/constants.d.ts +0 -18
- package/dist/constants.d.ts.map +0 -1
- package/dist/errors.d.ts.map +0 -1
- package/dist/fixtures.d.ts.map +0 -1
- package/dist/hash.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.es.js +0 -15527
- package/dist/index.js +0 -15531
- package/dist/types.d.ts.map +0 -1
|
@@ -1,64 +1,56 @@
|
|
|
1
|
-
import { ContainerType, ByteVectorType, UintNumberType, ListCompositeType, ByteListType } from '@chainsafe/ssz';
|
|
2
|
-
import { ValueOfFields } from '@chainsafe/ssz/lib/view/container';
|
|
3
|
-
import { ClusterDefintion } from './types';
|
|
4
|
-
/**
|
|
5
|
-
*
|
|
6
|
-
* @param
|
|
7
|
-
* @
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export declare const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
export declare const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
export
|
|
57
|
-
/**
|
|
58
|
-
* Returns the containerized cluster definition
|
|
59
|
-
* @param cluster ClusterDefinition to calculate the type from
|
|
60
|
-
* @returns SSZ Containerized type of cluster input
|
|
61
|
-
*/
|
|
62
|
-
export declare const clusterDefinitionContainerTypeV1X7: (configOnly: boolean) => DefinitionContainerTypeV1X7;
|
|
63
|
-
export {};
|
|
64
|
-
//# sourceMappingURL=hash.d.ts.map
|
|
1
|
+
import { ContainerType, ByteVectorType, UintNumberType, ListCompositeType, ByteListType } from '@chainsafe/ssz';
|
|
2
|
+
import { ValueOfFields } from '@chainsafe/ssz/lib/view/container.js';
|
|
3
|
+
import { ClusterDefintion, ClusterLock } from './types.js';
|
|
4
|
+
/**
|
|
5
|
+
* @param cluster The cluster configuration or the cluster definition
|
|
6
|
+
* @param configOnly a boolean to indicate config hash or definition hash
|
|
7
|
+
* @returns The config hash or the definition hash in of the corresponding cluster
|
|
8
|
+
*/
|
|
9
|
+
export declare const clusterConfigOrDefinitionHash: (cluster: ClusterDefintion, configOnly: boolean) => string;
|
|
10
|
+
export declare const hashClusterDefinition: (cluster: ClusterDefintion, configOnly: boolean) => ValueOfFields<DefinitionFields>;
|
|
11
|
+
declare const operatorAddressWrapperType: ContainerType<{
|
|
12
|
+
address: ByteVectorType;
|
|
13
|
+
}>;
|
|
14
|
+
declare const creatorAddressWrapperType: ContainerType<{
|
|
15
|
+
address: ByteVectorType;
|
|
16
|
+
}>;
|
|
17
|
+
export declare const operatorContainerType: ContainerType<{
|
|
18
|
+
address: ByteVectorType;
|
|
19
|
+
enr: ByteListType;
|
|
20
|
+
config_signature: ByteVectorType;
|
|
21
|
+
enr_signature: ByteVectorType;
|
|
22
|
+
}>;
|
|
23
|
+
export declare const creatorContainerType: ContainerType<{
|
|
24
|
+
address: ByteVectorType;
|
|
25
|
+
config_signature: ByteVectorType;
|
|
26
|
+
}>;
|
|
27
|
+
export declare const validatorsContainerType: ContainerType<{
|
|
28
|
+
fee_recipient_address: ByteVectorType;
|
|
29
|
+
withdrawal_address: ByteVectorType;
|
|
30
|
+
}>;
|
|
31
|
+
type DefinitionFields = {
|
|
32
|
+
uuid: ByteListType;
|
|
33
|
+
name: ByteListType;
|
|
34
|
+
version: ByteListType;
|
|
35
|
+
timestamp: ByteListType;
|
|
36
|
+
num_validators: UintNumberType;
|
|
37
|
+
threshold: UintNumberType;
|
|
38
|
+
dkg_algorithm: ByteListType;
|
|
39
|
+
fork_version: ByteVectorType;
|
|
40
|
+
operators: ListCompositeType<typeof operatorContainerType | typeof operatorAddressWrapperType>;
|
|
41
|
+
creator: typeof creatorContainerType | typeof creatorAddressWrapperType;
|
|
42
|
+
validators: ListCompositeType<typeof validatorsContainerType>;
|
|
43
|
+
config_hash?: ByteVectorType;
|
|
44
|
+
};
|
|
45
|
+
export type DefinitionContainerType = ContainerType<DefinitionFields>;
|
|
46
|
+
/**
|
|
47
|
+
* @param configOnly a boolean to indicate config hash or definition hash
|
|
48
|
+
* @returns SSZ Containerized type of cluster definition
|
|
49
|
+
*/
|
|
50
|
+
export declare const clusterDefinitionContainerType: (configOnly: boolean) => DefinitionContainerType;
|
|
51
|
+
/**
|
|
52
|
+
* @param cluster The published cluster lock
|
|
53
|
+
* @returns The lock hash in of the corresponding cluster
|
|
54
|
+
*/
|
|
55
|
+
export declare const clusterLockHash: (cluster: ClusterLock) => string;
|
|
56
|
+
export {};
|
|
@@ -1,49 +1,64 @@
|
|
|
1
|
-
import { Signer } from
|
|
2
|
-
import { Base } from './base';
|
|
3
|
-
import { ClusterDefintion, ClusterLock, ClusterPayload } from './types';
|
|
4
|
-
export * from "./types";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
* @param
|
|
13
|
-
* @
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
|
|
1
|
+
import { Signer } from "ethers";
|
|
2
|
+
import { Base } from './base.js';
|
|
3
|
+
import { ClusterDefintion, ClusterLock, ClusterPayload, OperatorPayload } from './types.js';
|
|
4
|
+
export * from "./types.js";
|
|
5
|
+
export * from "./services.js";
|
|
6
|
+
/**
|
|
7
|
+
* Obol sdk Client can be used for creating, managing and activating distributed validators.
|
|
8
|
+
*/
|
|
9
|
+
export declare class Client extends Base {
|
|
10
|
+
private signer;
|
|
11
|
+
/**
|
|
12
|
+
* @param config - Client configurations
|
|
13
|
+
* @param config.baseUrl - obol-api url
|
|
14
|
+
* @param config.chainId - Blockchain network ID
|
|
15
|
+
* @param signer - ethersJS Signer
|
|
16
|
+
* @returns Obol-SDK Client instance
|
|
17
|
+
*
|
|
18
|
+
* An example of how to instantiate obol-sdk Client:
|
|
19
|
+
* [obolClient](https://github.com/ObolNetwork/obol-sdk-examples/blob/main/TS-Example/index.ts#L29)
|
|
20
|
+
*/
|
|
21
|
+
constructor(config: {
|
|
22
|
+
baseUrl?: string | undefined;
|
|
23
|
+
chainId?: number | undefined;
|
|
24
|
+
}, signer?: Signer);
|
|
25
|
+
/**
|
|
26
|
+
* Creates a cluster definition which contains cluster configuration.
|
|
27
|
+
* @param {ClusterPayload} newCluster - The new unique cluster.
|
|
28
|
+
* @returns {Promise<string>} config_hash.
|
|
29
|
+
* @throws On duplicate entries, missing or wrong cluster keys.
|
|
30
|
+
*
|
|
31
|
+
* An example of how to use createClusterDefinition:
|
|
32
|
+
* [createObolCluster](https://github.com/ObolNetwork/obol-sdk-examples/blob/main/TS-Example/index.ts)
|
|
33
|
+
*/
|
|
34
|
+
createClusterDefinition(newCluster: ClusterPayload): Promise<string>;
|
|
35
|
+
/**
|
|
36
|
+
* Approves joining a cluster with specific configuration.
|
|
37
|
+
* @param {OperatorPayload} operatorPayload - The operator data including signatures.
|
|
38
|
+
* @param {string} configHash - The config hash of the cluster which the operator confirms joining to.
|
|
39
|
+
* @returns {Promise<ClusterDefintion>} The cluster definition.
|
|
40
|
+
* @throws On unauthorized, duplicate entries, missing keys, not found cluster or invalid data.
|
|
41
|
+
*
|
|
42
|
+
* An example of how to use acceptClusterDefinition:
|
|
43
|
+
* [acceptClusterDefinition](https://github.com/ObolNetwork/obol-sdk-examples/blob/main/TS-Example/index.ts)
|
|
44
|
+
*/
|
|
45
|
+
acceptClusterDefinition(operatorPayload: OperatorPayload, configHash: string): Promise<ClusterDefintion>;
|
|
46
|
+
/**
|
|
47
|
+
* @param configHash - The configuration hash returned in createClusterDefinition
|
|
48
|
+
* @returns {Promise<ClusterDefintion>} The cluster definition for config hash
|
|
49
|
+
* @throws On not found config hash.
|
|
50
|
+
*
|
|
51
|
+
* An example of how to use getClusterDefinition:
|
|
52
|
+
* [getObolClusterDefinition](https://github.com/ObolNetwork/obol-sdk-examples/blob/main/TS-Example/index.ts)
|
|
53
|
+
*/
|
|
54
|
+
getClusterDefinition(configHash: string): Promise<ClusterDefintion>;
|
|
55
|
+
/**
|
|
56
|
+
* @param configHash - The configuration hash in cluster-definition
|
|
57
|
+
* @returns {Promise<ClusterLock>} The matched cluster details (lock) from DB
|
|
58
|
+
* @throws On not found cluster definition or lock.
|
|
59
|
+
*
|
|
60
|
+
* An example of how to use getClusterLock:
|
|
61
|
+
* [getObolClusterLock](https://github.com/ObolNetwork/obol-sdk-examples/blob/main/TS-Example/index.ts)
|
|
62
|
+
*/
|
|
63
|
+
getClusterLock(configHash: string): Promise<ClusterLock>;
|
|
64
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export declare const operatorPayloadSchema: {
|
|
2
|
+
type: string;
|
|
3
|
+
properties: {
|
|
4
|
+
version: {
|
|
5
|
+
type: string;
|
|
6
|
+
};
|
|
7
|
+
enr: {
|
|
8
|
+
type: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
required: string[];
|
|
12
|
+
};
|
|
13
|
+
export declare const definitionSchema: {
|
|
14
|
+
type: string;
|
|
15
|
+
properties: {
|
|
16
|
+
name: {
|
|
17
|
+
type: string;
|
|
18
|
+
};
|
|
19
|
+
operators: {
|
|
20
|
+
type: string;
|
|
21
|
+
minItems: number;
|
|
22
|
+
uniqueItems: boolean;
|
|
23
|
+
items: {
|
|
24
|
+
type: string;
|
|
25
|
+
properties: {
|
|
26
|
+
address: {
|
|
27
|
+
type: string;
|
|
28
|
+
minLength: number;
|
|
29
|
+
maxLength: number;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
required: string[];
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
validators: {
|
|
36
|
+
type: string;
|
|
37
|
+
minItems: number;
|
|
38
|
+
items: {
|
|
39
|
+
type: string;
|
|
40
|
+
properties: {
|
|
41
|
+
fee_recipient_address: {
|
|
42
|
+
type: string;
|
|
43
|
+
minLength: number;
|
|
44
|
+
maxLength: number;
|
|
45
|
+
};
|
|
46
|
+
withdrawal_address: {
|
|
47
|
+
type: string;
|
|
48
|
+
minLength: number;
|
|
49
|
+
maxLength: number;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
required: string[];
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
required: string[];
|
|
57
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ClusterLock } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Verifies Cluster Lock's validity.
|
|
4
|
+
* @param lock - cluster lock
|
|
5
|
+
* @returns {Promise<{ result: boolean }> } boolean result to indicate if lock is valid
|
|
6
|
+
* @throws on missing keys or values.
|
|
7
|
+
*
|
|
8
|
+
* An example of how to use validateClusterLock:
|
|
9
|
+
* [validateClusterLock](https://github.com/ObolNetwork/obol-sdk-examples/blob/main/TS-Example/index.ts)
|
|
10
|
+
*/
|
|
11
|
+
export declare const validateClusterLock: (lock: ClusterLock) => Promise<boolean>;
|
|
@@ -1,150 +1,153 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Permitted ChainID's
|
|
3
|
-
*/
|
|
4
|
-
export declare enum FORK_MAPPING {
|
|
5
|
-
/** Mainnet. */
|
|
6
|
-
"0x00000000" = 1,
|
|
7
|
-
/** Goerli/Prater. */
|
|
8
|
-
"0x00001020" = 5,
|
|
9
|
-
/** Gnosis Chain. */
|
|
10
|
-
"0x00000064" = 100,
|
|
11
|
-
/** Holesky. */
|
|
12
|
-
"0x01017000" = 17000
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
*
|
|
16
|
-
*/
|
|
17
|
-
export
|
|
18
|
-
/** The operator address. */
|
|
19
|
-
address: string;
|
|
20
|
-
/** The operator ethereum node record. */
|
|
21
|
-
enr?: string;
|
|
22
|
-
/** The cluster fork_version. */
|
|
23
|
-
fork_version?: string;
|
|
24
|
-
/** The cluster version. */
|
|
25
|
-
version?: string;
|
|
26
|
-
/** The operator enr signature. */
|
|
27
|
-
enr_signature?: string;
|
|
28
|
-
/** The operator configuration signature. */
|
|
29
|
-
config_signature?: string;
|
|
30
|
-
};
|
|
31
|
-
/**
|
|
32
|
-
*
|
|
33
|
-
*/
|
|
34
|
-
export
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
/** The
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
/** The
|
|
69
|
-
|
|
70
|
-
/** The cluster
|
|
71
|
-
|
|
72
|
-
/** The cluster
|
|
73
|
-
|
|
74
|
-
/** The cluster
|
|
75
|
-
|
|
76
|
-
/** The cluster
|
|
77
|
-
|
|
78
|
-
/** The
|
|
79
|
-
|
|
80
|
-
/** The
|
|
81
|
-
|
|
82
|
-
/** The
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
/** The
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
/** The cluster
|
|
144
|
-
|
|
145
|
-
/** The
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Permitted ChainID's
|
|
3
|
+
*/
|
|
4
|
+
export declare enum FORK_MAPPING {
|
|
5
|
+
/** Mainnet. */
|
|
6
|
+
"0x00000000" = 1,
|
|
7
|
+
/** Goerli/Prater. */
|
|
8
|
+
"0x00001020" = 5,
|
|
9
|
+
/** Gnosis Chain. */
|
|
10
|
+
"0x00000064" = 100,
|
|
11
|
+
/** Holesky. */
|
|
12
|
+
"0x01017000" = 17000
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Node operator data
|
|
16
|
+
*/
|
|
17
|
+
export type ClusterOperator = {
|
|
18
|
+
/** The operator address. */
|
|
19
|
+
address: string;
|
|
20
|
+
/** The operator ethereum node record. */
|
|
21
|
+
enr?: string;
|
|
22
|
+
/** The cluster fork_version. */
|
|
23
|
+
fork_version?: string;
|
|
24
|
+
/** The cluster version. */
|
|
25
|
+
version?: string;
|
|
26
|
+
/** The operator enr signature. */
|
|
27
|
+
enr_signature?: string;
|
|
28
|
+
/** The operator configuration signature. */
|
|
29
|
+
config_signature?: string;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* A partial view of `ClusterOperator` with `enr` and `version` as required properties.
|
|
33
|
+
*/
|
|
34
|
+
export type OperatorPayload = Partial<ClusterOperator> & Required<Pick<ClusterOperator, 'enr' | 'version'>>;
|
|
35
|
+
/**
|
|
36
|
+
* Cluster creator data
|
|
37
|
+
*/
|
|
38
|
+
export type ClusterCreator = {
|
|
39
|
+
/** The creator address. */
|
|
40
|
+
address: string;
|
|
41
|
+
/** The cluster configuration signature. */
|
|
42
|
+
config_signature?: string;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Validator withdrawal configuration
|
|
46
|
+
*/
|
|
47
|
+
export type ClusterValidator = {
|
|
48
|
+
/** The validator fee recipient address. */
|
|
49
|
+
fee_recipient_address: string;
|
|
50
|
+
/** The validator reward address. */
|
|
51
|
+
withdrawal_address: string;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Cluster configuration
|
|
55
|
+
*/
|
|
56
|
+
export type ClusterPayload = {
|
|
57
|
+
/** The cluster name. */
|
|
58
|
+
name: string;
|
|
59
|
+
/** The cluster nodes operators addresses. */
|
|
60
|
+
operators: ClusterOperator[];
|
|
61
|
+
/** The clusters validators information. */
|
|
62
|
+
validators: ClusterValidator[];
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* Cluster definition data needed for dkg
|
|
66
|
+
*/
|
|
67
|
+
export interface ClusterDefintion extends ClusterPayload {
|
|
68
|
+
/** The creator of the cluster. */
|
|
69
|
+
creator: ClusterCreator;
|
|
70
|
+
/** The cluster configuration version. */
|
|
71
|
+
version: string;
|
|
72
|
+
/** The cluster dkg algorithm. */
|
|
73
|
+
dkg_algorithm: string;
|
|
74
|
+
/** The cluster fork version. */
|
|
75
|
+
fork_version: string;
|
|
76
|
+
/** The cluster uuid. */
|
|
77
|
+
uuid: string;
|
|
78
|
+
/** The cluster creation timestamp. */
|
|
79
|
+
timestamp: string;
|
|
80
|
+
/** The cluster configuration hash. */
|
|
81
|
+
config_hash: string;
|
|
82
|
+
/** The distributed validator threshold. */
|
|
83
|
+
threshold: number;
|
|
84
|
+
/** The number of distributed validators in the cluster. */
|
|
85
|
+
num_validators: number;
|
|
86
|
+
/** The hash of the cluster definition. */
|
|
87
|
+
definition_hash?: string;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Unsigned DV Builder Registration Message
|
|
91
|
+
*/
|
|
92
|
+
export type BuilderRegistrationMessage = {
|
|
93
|
+
/** The DV fee recipient. */
|
|
94
|
+
fee_recipient: string;
|
|
95
|
+
/** Default is 30000000. */
|
|
96
|
+
gas_limit: number;
|
|
97
|
+
/** Timestamp when generating cluster lock file. */
|
|
98
|
+
timestamp: number;
|
|
99
|
+
/** The public key of the DV. */
|
|
100
|
+
pubkey: string;
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* Pre-generated Signed Validator Builder Registration
|
|
104
|
+
*/
|
|
105
|
+
export type BuilderRegistration = {
|
|
106
|
+
/** Builder registration message. */
|
|
107
|
+
message: BuilderRegistrationMessage;
|
|
108
|
+
/** BLS signature of the builder registration message. */
|
|
109
|
+
signature: string;
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* Required deposit data for validator activation
|
|
113
|
+
*/
|
|
114
|
+
export type DepositData = {
|
|
115
|
+
/** The public key of the distributed validator. */
|
|
116
|
+
pubkey: string;
|
|
117
|
+
/** The 0x01 withdrawal address of the DV. */
|
|
118
|
+
withdrawal_credentials: string;
|
|
119
|
+
/** 32 ethers. */
|
|
120
|
+
amount: string;
|
|
121
|
+
/** A checksum for DepositData fields . */
|
|
122
|
+
deposit_data_root: string;
|
|
123
|
+
/** BLS signature of the deposit message. */
|
|
124
|
+
signature: string;
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* Required deposit data for validator activation
|
|
128
|
+
*/
|
|
129
|
+
export type DistributedValidator = {
|
|
130
|
+
/** The public key of the distributed validator. */
|
|
131
|
+
distributed_public_key: string;
|
|
132
|
+
/** The public key of the node distributed validator share. */
|
|
133
|
+
public_shares: string[];
|
|
134
|
+
/** The required deposit data for activating the DV. */
|
|
135
|
+
deposit_data: Partial<DepositData>;
|
|
136
|
+
/** pre-generated signed validator builder registration to be sent to builder network. */
|
|
137
|
+
builder_registration: BuilderRegistration;
|
|
138
|
+
};
|
|
139
|
+
/**
|
|
140
|
+
* Cluster Details after DKG is complete
|
|
141
|
+
*/
|
|
142
|
+
export type ClusterLock = {
|
|
143
|
+
/** The cluster definition. */
|
|
144
|
+
cluster_definition: ClusterDefintion;
|
|
145
|
+
/** The cluster distributed validators. */
|
|
146
|
+
distributed_validators: DistributedValidator[];
|
|
147
|
+
/** The cluster bls signature aggregate. */
|
|
148
|
+
signature_aggregate: string;
|
|
149
|
+
/** The hash of the cluster lock. */
|
|
150
|
+
lock_hash: string;
|
|
151
|
+
/** Node Signature for the lock hash by the node secp256k1 key. */
|
|
152
|
+
node_signatures: string[];
|
|
153
|
+
};
|