@ssv-labs/ssv-sdk 0.1.3 → 1.0.2
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.html +4 -7
- package/README.md +56 -29
- package/dist/{KeyShares-B_4l2THg.js → KeyShares-Bk9uzOlK.js} +194 -51
- package/dist/{KeyShares-ClzHwMUy.mjs → KeyShares-Dlp4Pa3b.mjs} +198 -55
- package/dist/abi/mainnet/v4/getter.d.ts +699 -74
- package/dist/abi/mainnet/v4/setter.d.ts +939 -59
- package/dist/api/subgraph/index.d.ts +50 -48
- package/dist/config/create.d.ts +2 -2
- package/dist/config/globals.d.ts +3 -0
- package/dist/{globals-CDOcDUnk.mjs → config-BdEJjnYA.mjs} +107 -79
- package/dist/{globals-DsaKgq3v.js → config-ClGS9Tic.js} +73 -45
- package/dist/contract-interactions/create.d.ts +1 -1
- package/dist/contract-interactions/types.d.ts +9 -3
- package/dist/graphql/graphql.d.ts +4799 -921
- package/dist/keys.js +1 -1
- package/dist/keys.mjs +5 -5
- package/dist/libs/api/index.d.ts +1 -0
- package/dist/libs/cluster/index.d.ts +3 -1
- package/dist/libs/cluster/methods/deposit.d.ts +150 -4
- package/dist/libs/cluster/methods/exit-validators.d.ts +149 -0
- package/dist/libs/cluster/methods/index.d.ts +3 -1
- package/dist/libs/cluster/methods/liquidate-cluster.d.ts +149 -0
- package/dist/libs/cluster/methods/liquidate-ssv.d.ts +430 -0
- package/dist/libs/cluster/methods/migrate-cluster-to-eth.d.ts +431 -0
- package/dist/libs/cluster/methods/reactivate-cluster.d.ts +149 -0
- package/dist/libs/cluster/methods/register-validators.d.ts +2222 -309
- package/dist/libs/cluster/methods/remove-validators.d.ts +149 -0
- package/dist/libs/cluster/methods/set-fee-recipient.d.ts +149 -0
- package/dist/libs/cluster/methods/withdraw.d.ts +149 -0
- package/dist/libs/dao/index.d.ts +8 -0
- package/dist/libs/dao/methods/commit-root.d.ts +432 -0
- package/dist/libs/dao/methods/index.d.ts +3 -0
- package/dist/libs/dao/methods/update-network-fee-ssv.d.ts +430 -0
- package/dist/libs/dao/methods/withdraw-network-ssv-earnings.d.ts +430 -0
- package/dist/libs/operator/index.d.ts +1525 -32
- package/dist/libs/operator/methods.d.ts +1732 -3
- package/dist/libs/ssv-keys/Encryption/__test__/RsaKeys.d.ts +1 -1
- package/dist/libs/ssv-keys/KeyShares/KeySharesItem.d.ts +1 -1
- package/dist/libs/ssv-keys/SSVKeys.d.ts +1 -1
- package/dist/libs/ssv-keys/exceptions/index.d.ts +1 -1
- package/dist/libs/ssv-keys/index.d.ts +1 -1
- package/dist/libs/ssv-keys/interfaces/index.d.ts +2 -2
- package/dist/libs/utils/index.d.ts +8 -4
- package/dist/libs/utils/methods/calc-deposit-from-runway.d.ts +11 -0
- package/dist/libs/utils/methods/get-cluster-balance.d.ts +4 -1
- package/dist/libs/utils/methods/index.d.ts +1 -0
- package/dist/libs/utils/methods/keyshares.d.ts +4 -2
- package/dist/libs/utils/methods/keystores.d.ts +4 -4
- package/dist/libs/utils/methods/write-keyshares-file.d.ts +16 -0
- package/dist/main.d.ts +1 -0
- package/dist/main.js +2970 -733
- package/dist/main.mjs +2961 -746
- package/dist/sdk.d.ts +8 -4
- package/dist/types/contract-interactions.d.ts +11 -0
- package/dist/types/methods.d.ts +4 -3
- package/dist/utils/cluster.d.ts +3 -3
- package/dist/utils/funding.d.ts +29 -0
- package/dist/utils/zod/config.d.ts +1 -1
- package/dist/utils.js +38 -38
- package/dist/utils.mjs +34 -34
- package/package.json +18 -6
|
@@ -28,7 +28,7 @@ export declare class KeySharesItem {
|
|
|
28
28
|
/**
|
|
29
29
|
* Build payload from operators list, encrypted shares and validator public key
|
|
30
30
|
*/
|
|
31
|
-
buildPayload(metaData: IKeySharesPayloadData, toSignatureData: IKeySharesToSignatureData): Promise<
|
|
31
|
+
buildPayload(metaData: IKeySharesPayloadData, toSignatureData: IKeySharesToSignatureData): Promise<KeySharesPayload>;
|
|
32
32
|
validateSingleShares(shares: string, fromSignatureData: IKeySharesFromSignatureData): Promise<void>;
|
|
33
33
|
/**
|
|
34
34
|
* Build shares from bytes string and operators list length
|
|
@@ -50,7 +50,7 @@ export declare class SSVKeys {
|
|
|
50
50
|
* Getting threshold if it has been created before.
|
|
51
51
|
*/
|
|
52
52
|
getThreshold(): ISharesKeyPairs | undefined;
|
|
53
|
-
validateSharesPostRegistration({ shares, operatorsCount, validatorPublicKey, isAccountExists, ownerAddress, ownerNonce, blockNumber }: ISharesValidation): Promise<{
|
|
53
|
+
validateSharesPostRegistration({ shares, operatorsCount, validatorPublicKey, isAccountExists, ownerAddress, ownerNonce, blockNumber, }: ISharesValidation): Promise<{
|
|
54
54
|
isValid: boolean;
|
|
55
55
|
isSharesValid: boolean;
|
|
56
56
|
sharesPublicKeys: string[] | undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { OperatorPublicKeyError, OperatorsCountsMismatchError } from './operator';
|
|
1
|
+
export { OperatorPublicKeyError, OperatorsCountsMismatchError, } from './operator';
|
|
2
2
|
export { SSVKeysException } from './base';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { SSVKeys } from './SSVKeys';
|
|
2
2
|
export { KeySharesItem } from './KeyShares/KeySharesItem';
|
|
3
3
|
export { KeyShares } from './KeyShares/KeyShares';
|
|
4
|
-
export { SSVKeysException, OperatorPublicKeyError, OperatorsCountsMismatchError } from './exceptions';
|
|
4
|
+
export { SSVKeysException, OperatorPublicKeyError, OperatorsCountsMismatchError, } from './exceptions';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type { IOperator } from './IOperator.ts';
|
|
2
2
|
export type { IOperatorData } from './IOperatorData.ts';
|
|
3
|
-
export type { IKeySharesData, IKeySharesPartialData } from './IKeySharesData.ts';
|
|
4
|
-
export type { IKeySharesPayload, IKeySharesPartialPayload } from './IKeySharesPayload.ts';
|
|
3
|
+
export type { IKeySharesData, IKeySharesPartialData, } from './IKeySharesData.ts';
|
|
4
|
+
export type { IKeySharesPayload, IKeySharesPartialPayload, } from './IKeySharesPayload.ts';
|
|
5
5
|
export type { IShares, ISharesKeyPairs } from './IShares.ts';
|
|
6
6
|
export type { IEncryptShare } from './IEncryptShare.ts';
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import { ConfigReturnType } from '../../config/create';
|
|
2
2
|
import { getClusterBalance, getOperatorCapacity } from './methods';
|
|
3
|
+
import { calcDepositFromRunway } from './methods/calc-deposit-from-runway';
|
|
3
4
|
import { validateSharesPreRegistration } from './methods/keyshares';
|
|
5
|
+
import { writeKeysharesFile } from './methods/write-keyshares-file';
|
|
4
6
|
import { RemoveConfigArg } from '../../types/methods';
|
|
5
7
|
export declare const createUtils: (config: ConfigReturnType) => {
|
|
6
8
|
generateKeyShares: (args: {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
+
operatorKeys: string[];
|
|
10
|
+
operatorIds: number[];
|
|
9
11
|
keystore: string | string[];
|
|
10
|
-
|
|
11
|
-
|
|
12
|
+
keystorePassword: string;
|
|
13
|
+
ownerAddress: string;
|
|
12
14
|
nonce: number;
|
|
13
15
|
}) => Promise<import('../ssv-keys/KeyShares/KeySharesData/KeySharesPayload').KeySharesPayload[]>;
|
|
16
|
+
writeKeysharesFile: RemoveConfigArg<typeof writeKeysharesFile>;
|
|
14
17
|
validateKeysharesJSON: ({ account, operators, keyshares, }: {
|
|
15
18
|
account: import('viem').Address;
|
|
16
19
|
operators: Pick<import('../../types/operator').Operator, "id" | "publicKey">[];
|
|
@@ -19,4 +22,5 @@ export declare const createUtils: (config: ConfigReturnType) => {
|
|
|
19
22
|
validateSharesPreRegistration: RemoveConfigArg<typeof validateSharesPreRegistration>;
|
|
20
23
|
getOperatorCapacity: RemoveConfigArg<typeof getOperatorCapacity>;
|
|
21
24
|
getClusterBalance: RemoveConfigArg<typeof getClusterBalance>;
|
|
25
|
+
calcDepositFromRunway: RemoveConfigArg<typeof calcDepositFromRunway>;
|
|
22
26
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ConfigReturnType } from '../../../config/create';
|
|
2
|
+
/**
|
|
3
|
+
* @param clusterId - The unique identifier of the cluster.
|
|
4
|
+
* @param runway - The desired operational runway in days.
|
|
5
|
+
*/
|
|
6
|
+
type CalcDepositFromRunwayArgs = {
|
|
7
|
+
clusterId: string;
|
|
8
|
+
runway: number;
|
|
9
|
+
};
|
|
10
|
+
export declare const calcDepositFromRunway: (config: ConfigReturnType, { clusterId, runway }: CalcDepositFromRunwayArgs) => Promise<bigint>;
|
|
11
|
+
export {};
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { ConfigReturnType } from '../../../config/create';
|
|
2
|
+
import { Address } from 'viem';
|
|
2
3
|
type GetClusterBalanceArgs = {
|
|
3
4
|
operatorIds: number[];
|
|
5
|
+
ownerAddress?: Address;
|
|
4
6
|
};
|
|
5
|
-
export declare const getClusterBalance: (config: ConfigReturnType, { operatorIds }: GetClusterBalanceArgs) => Promise<{
|
|
7
|
+
export declare const getClusterBalance: (config: ConfigReturnType, { operatorIds, ownerAddress }: GetClusterBalanceArgs) => Promise<{
|
|
8
|
+
blockNumber: number;
|
|
6
9
|
balance: bigint;
|
|
7
10
|
operationalRunway: bigint;
|
|
8
11
|
}>;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { ConfigReturnType } from '../../../config/create';
|
|
2
2
|
import { KeySharesItem } from '../../ssv-keys/KeyShares/KeySharesItem';
|
|
3
|
+
import { IKeySharesPartialPayload } from '../../ssv-keys/interfaces';
|
|
3
4
|
import { Operator } from '../../../types/operator';
|
|
4
5
|
import { Address, Hash } from 'viem';
|
|
5
6
|
type ValidatedKeysharesArgs = {
|
|
6
|
-
keyshares: string | object;
|
|
7
|
+
keyshares: string | object | IKeySharesPartialPayload[];
|
|
7
8
|
operatorIds: string[];
|
|
9
|
+
ownerAddress?: Address;
|
|
8
10
|
};
|
|
9
|
-
export declare const validateSharesPreRegistration: (config: ConfigReturnType, { keyshares, operatorIds }: ValidatedKeysharesArgs) => Promise<{
|
|
11
|
+
export declare const validateSharesPreRegistration: (config: ConfigReturnType, { keyshares, operatorIds, ownerAddress }: ValidatedKeysharesArgs) => Promise<{
|
|
10
12
|
available: KeySharesItem[];
|
|
11
13
|
registered: KeySharesItem[];
|
|
12
14
|
incorrect: KeySharesItem[];
|
|
@@ -2,11 +2,11 @@ import { KeySharesPayload } from '../../ssv-keys/KeyShares/KeySharesData/KeyShar
|
|
|
2
2
|
import { SSVKeys } from '../../ssv-keys/SSVKeys';
|
|
3
3
|
export declare const ssvKeys: SSVKeys;
|
|
4
4
|
type GenerateKeySharesArgs = {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
operatorKeys: string[];
|
|
6
|
+
operatorIds: number[];
|
|
7
7
|
keystore: string | string[];
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
keystorePassword: string;
|
|
9
|
+
ownerAddress: string;
|
|
10
10
|
nonce: number;
|
|
11
11
|
};
|
|
12
12
|
export declare const generateKeyShares: (args: GenerateKeySharesArgs) => Promise<KeySharesPayload[]>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ConfigReturnType } from '../../../config';
|
|
2
|
+
import { KeySharesItem } from '../../ssv-keys/KeyShares/KeySharesItem';
|
|
3
|
+
import { IKeySharesPartialData, IKeySharesPartialPayload, IOperator } from '../../ssv-keys/interfaces';
|
|
4
|
+
export type KeySharesFileShare = {
|
|
5
|
+
data: IKeySharesPartialData;
|
|
6
|
+
payload: IKeySharesPartialPayload;
|
|
7
|
+
};
|
|
8
|
+
type WriteKeysharesFileArgs = {
|
|
9
|
+
path: string;
|
|
10
|
+
shares: Array<KeySharesItem | KeySharesFileShare | IKeySharesPartialPayload>;
|
|
11
|
+
ownerAddress?: string;
|
|
12
|
+
nonce?: number;
|
|
13
|
+
operators?: IOperator[];
|
|
14
|
+
};
|
|
15
|
+
export declare const writeKeysharesFile: (config: ConfigReturnType, args: WriteKeysharesFileArgs) => Promise<void>;
|
|
16
|
+
export {};
|
package/dist/main.d.ts
CHANGED