@ssv-labs/ssv-sdk 0.0.5 → 0.1.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.
Files changed (83) hide show
  1. package/dist/KeyShares-7biQfDev.js +19422 -0
  2. package/dist/KeyShares-DEqBZits.mjs +19423 -0
  3. package/dist/api/subgraph/index.d.ts +15 -54
  4. package/dist/config/chains.d.ts +18 -10
  5. package/dist/contract-interactions/types.d.ts +3 -1
  6. package/dist/globals-BZbDG7rK.mjs +472 -0
  7. package/dist/globals-iY-Y-uDY.js +471 -0
  8. package/dist/graphql/graphql.d.ts +10 -33
  9. package/dist/keys.js +9 -0
  10. package/dist/keys.mjs +9 -0
  11. package/dist/libs/api/index.d.ts +9 -69
  12. package/dist/libs/cluster/index.d.ts +11 -5632
  13. package/dist/libs/cluster/methods/deposit.d.ts +1 -1
  14. package/dist/libs/cluster/methods/exit-validators.d.ts +1 -1
  15. package/dist/libs/cluster/methods/index.d.ts +1 -1
  16. package/dist/libs/cluster/methods/liquidate-cluster.d.ts +1 -1
  17. package/dist/libs/cluster/methods/reactivate-cluster.d.ts +1 -1
  18. package/dist/libs/cluster/methods/register-validators.d.ts +6 -4
  19. package/dist/libs/cluster/methods/remove-validators.d.ts +1 -1
  20. package/dist/libs/cluster/methods/set-fee-recipient.d.ts +1 -1
  21. package/dist/libs/cluster/methods/withdraw.d.ts +1 -1
  22. package/dist/libs/operator/index.d.ts +119 -901
  23. package/dist/libs/operator/methods.d.ts +3 -3
  24. package/dist/libs/ssv-keys/BLS/index.d.ts +2 -0
  25. package/dist/libs/ssv-keys/Encryption/Encryption.d.ts +7 -0
  26. package/dist/libs/ssv-keys/Encryption/__test__/RsaKeys.d.ts +3 -0
  27. package/dist/libs/ssv-keys/Encryption/utils.d.ts +55 -0
  28. package/dist/libs/ssv-keys/EthereumKeyStore/EthereumKeyStore.d.ts +23 -0
  29. package/dist/libs/ssv-keys/EthereumKeyStore/index.d.ts +1 -0
  30. package/dist/libs/ssv-keys/KeyShares/KeyShares.d.ts +32 -0
  31. package/dist/libs/ssv-keys/KeyShares/KeySharesData/KeySharesData.d.ts +21 -0
  32. package/dist/libs/ssv-keys/KeyShares/KeySharesData/KeySharesPayload.d.ts +32 -0
  33. package/dist/libs/ssv-keys/KeyShares/KeySharesData/OperatorData.d.ts +10 -0
  34. package/dist/libs/ssv-keys/KeyShares/KeySharesData/validators/encrypted-key.d.ts +6 -0
  35. package/dist/libs/ssv-keys/KeyShares/KeySharesData/validators/index.d.ts +6 -0
  36. package/dist/libs/ssv-keys/KeyShares/KeySharesData/validators/match.d.ts +6 -0
  37. package/dist/libs/ssv-keys/KeyShares/KeySharesData/validators/operator-public-key.d.ts +6 -0
  38. package/dist/libs/ssv-keys/KeyShares/KeySharesData/validators/operator-unique.d.ts +6 -0
  39. package/dist/libs/ssv-keys/KeyShares/KeySharesData/validators/owner-address.d.ts +6 -0
  40. package/dist/libs/ssv-keys/KeyShares/KeySharesData/validators/owner-nonce.d.ts +6 -0
  41. package/dist/libs/ssv-keys/KeyShares/KeySharesData/validators/public-key.d.ts +6 -0
  42. package/dist/libs/ssv-keys/KeyShares/KeySharesItem.d.ts +60 -0
  43. package/dist/libs/ssv-keys/SSVKeys.d.ts +66 -0
  44. package/dist/libs/ssv-keys/Threshold/Threshold.d.ts +28 -0
  45. package/dist/libs/ssv-keys/Threshold/__test__/helper/share_signatures.d.ts +7 -0
  46. package/dist/libs/ssv-keys/Threshold/index.d.ts +1 -0
  47. package/dist/libs/ssv-keys/exceptions/base.d.ts +4 -0
  48. package/dist/libs/ssv-keys/exceptions/bls.d.ts +9 -0
  49. package/dist/libs/ssv-keys/exceptions/index.d.ts +2 -0
  50. package/dist/libs/ssv-keys/exceptions/keyshares.d.ts +5 -0
  51. package/dist/libs/ssv-keys/exceptions/keystore.d.ts +27 -0
  52. package/dist/libs/ssv-keys/exceptions/operator.d.ts +22 -0
  53. package/dist/libs/ssv-keys/helpers/operator.helper.d.ts +7 -0
  54. package/dist/libs/ssv-keys/helpers/web3.helper.d.ts +36 -0
  55. package/dist/libs/ssv-keys/index.d.ts +4 -0
  56. package/dist/libs/ssv-keys/interfaces/IEncryptShare.d.ts +5 -0
  57. package/dist/libs/ssv-keys/interfaces/IKeySharesData.d.ts +18 -0
  58. package/dist/libs/ssv-keys/interfaces/IKeySharesPayload.d.ts +13 -0
  59. package/dist/libs/ssv-keys/interfaces/IOperator.d.ts +4 -0
  60. package/dist/libs/ssv-keys/interfaces/IOperatorData.d.ts +5 -0
  61. package/dist/libs/ssv-keys/interfaces/IShares.d.ts +10 -0
  62. package/dist/libs/ssv-keys/interfaces/index.d.ts +6 -0
  63. package/dist/libs/ssv-keys/validators/index.d.ts +2 -0
  64. package/dist/libs/ssv-keys/validators/operatorPublicKey.validator.d.ts +1 -0
  65. package/dist/libs/ssv-keys/validators/operatorsLength.validator.d.ts +1 -0
  66. package/dist/libs/utils/index.d.ts +8 -18
  67. package/dist/libs/utils/methods/keyshares.d.ts +5 -2
  68. package/dist/libs/utils/methods/keystores.d.ts +2 -2
  69. package/dist/main.d.ts +1 -0
  70. package/dist/main.js +3862 -34136
  71. package/dist/main.mjs +3920 -34193
  72. package/dist/mock/api.d.ts +1 -1
  73. package/dist/types/contract-interactions.d.ts +2 -2
  74. package/dist/utils/cluster.d.ts +1 -1
  75. package/dist/utils/contract.d.ts +2 -1
  76. package/dist/utils/keyshares.d.ts +2 -2
  77. package/dist/utils/number.d.ts +1 -1
  78. package/dist/utils/zod/config.d.ts +1 -1
  79. package/dist/utils.js +1 -1
  80. package/dist/utils.mjs +34 -34
  81. package/package.json +29 -14
  82. package/dist/globals-DsbufPrE.mjs +0 -5541
  83. package/dist/globals-fh7gkHKO.js +0 -5539
@@ -15,7 +15,7 @@ export declare const getCluster: (client: GraphQLClient, args: GetClusterQueryVa
15
15
  balance: string;
16
16
  index: string;
17
17
  networkFeeIndex: string;
18
- operatorIds: string[];
18
+ operatorIds: Array<string>;
19
19
  } | null | undefined>;
20
20
  export declare const getClusters: (client: GraphQLClient, args: GetClustersQueryVariables) => Promise<{
21
21
  id: string;
@@ -24,7 +24,7 @@ export declare const getClusters: (client: GraphQLClient, args: GetClustersQuery
24
24
  balance: string;
25
25
  index: string;
26
26
  networkFeeIndex: string;
27
- operatorIds: string[];
27
+ operatorIds: Array<string>;
28
28
  }[]>;
29
29
  export declare const getOperator: (client: GraphQLClient, args: GetOperatorQueryVariables) => Promise<{
30
30
  publicKey: string;
@@ -32,7 +32,7 @@ export declare const getOperator: (client: GraphQLClient, args: GetOperatorQuery
32
32
  id: string;
33
33
  validatorCount: string;
34
34
  isPrivate: boolean;
35
- whitelistedContract: `0x${string}`;
35
+ whitelistedContract: import('abitype').Address;
36
36
  } | null>;
37
37
  export declare const getOperators: (client: GraphQLClient, args: GetOperatorsQueryVariables) => Promise<{
38
38
  publicKey: string;
@@ -40,62 +40,23 @@ export declare const getOperators: (client: GraphQLClient, args: GetOperatorsQue
40
40
  id: string;
41
41
  validatorCount: string;
42
42
  isPrivate: boolean;
43
- whitelistedContract: `0x${string}`;
43
+ whitelistedContract: import('abitype').Address;
44
44
  }[]>;
45
45
  export declare const getValidators: (client: GraphQLClient, args: GetValidatorsQueryVariables) => Promise<{
46
- id: `0x${string}`;
46
+ id: import('abitype').Address;
47
47
  }[]>;
48
48
  export declare const getValidator: (client: GraphQLClient, args: GetValidatorQueryVariables) => Promise<{
49
- id: `0x${string}`;
49
+ id: import('abitype').Address;
50
50
  } | null | undefined>;
51
51
  export declare const getClusterBalance: (client: GraphQLClient, args: GetClusterBalanceQueryVariables) => Promise<import('../../graphql/graphql').GetClusterBalanceQuery>;
52
52
  export declare const getQueries: (client: GraphQLClient) => {
53
- getOwnerNonce: RemoveConfigArg<(client: GraphQLClient, args: GetOwnerNonceByBlockQueryVariables) => Promise<string>>;
54
- getClusterSnapshot: RemoveConfigArg<(client: GraphQLClient, args: GetClusterSnapshotQueryVariables) => Promise<{
55
- active: boolean;
56
- validatorCount: string;
57
- balance: string;
58
- index: string;
59
- networkFeeIndex: string;
60
- } | null | undefined>>;
61
- getCluster: RemoveConfigArg<(client: GraphQLClient, args: GetClusterQueryVariables) => Promise<{
62
- active: boolean;
63
- validatorCount: string;
64
- balance: string;
65
- index: string;
66
- networkFeeIndex: string;
67
- operatorIds: string[];
68
- } | null | undefined>>;
69
- getClusters: RemoveConfigArg<(client: GraphQLClient, args: GetClustersQueryVariables) => Promise<{
70
- id: string;
71
- active: boolean;
72
- validatorCount: string;
73
- balance: string;
74
- index: string;
75
- networkFeeIndex: string;
76
- operatorIds: string[];
77
- }[]>>;
78
- getOperator: RemoveConfigArg<(client: GraphQLClient, args: GetOperatorQueryVariables) => Promise<{
79
- publicKey: string;
80
- whitelisted: `0x${string}`[];
81
- id: string;
82
- validatorCount: string;
83
- isPrivate: boolean;
84
- whitelistedContract: `0x${string}`;
85
- } | null>>;
86
- getOperators: RemoveConfigArg<(client: GraphQLClient, args: GetOperatorsQueryVariables) => Promise<{
87
- publicKey: string;
88
- whitelisted: `0x${string}`[];
89
- id: string;
90
- validatorCount: string;
91
- isPrivate: boolean;
92
- whitelistedContract: `0x${string}`;
93
- }[]>>;
94
- getValidators: RemoveConfigArg<(client: GraphQLClient, args: GetValidatorsQueryVariables) => Promise<{
95
- id: `0x${string}`;
96
- }[]>>;
97
- getValidator: RemoveConfigArg<(client: GraphQLClient, args: GetValidatorQueryVariables) => Promise<{
98
- id: `0x${string}`;
99
- } | null | undefined>>;
100
- getClusterBalance: RemoveConfigArg<(client: GraphQLClient, args: GetClusterBalanceQueryVariables) => Promise<import('../../graphql/graphql').GetClusterBalanceQuery>>;
53
+ getOwnerNonce: RemoveConfigArg<typeof getOwnerNonce>;
54
+ getClusterSnapshot: RemoveConfigArg<typeof getClusterSnapshot>;
55
+ getCluster: RemoveConfigArg<typeof getCluster>;
56
+ getClusters: RemoveConfigArg<typeof getClusters>;
57
+ getOperator: RemoveConfigArg<typeof getOperator>;
58
+ getOperators: RemoveConfigArg<typeof getOperators>;
59
+ getValidators: RemoveConfigArg<typeof getValidators>;
60
+ getValidator: RemoveConfigArg<typeof getValidator>;
61
+ getClusterBalance: RemoveConfigArg<typeof getClusterBalance>;
101
62
  };
@@ -11,7 +11,8 @@ export declare const hoodi: {
11
11
  url: string;
12
12
  apiUrl?: string | undefined;
13
13
  };
14
- } | undefined;
14
+ } | undefined | undefined;
15
+ blockTime?: number | undefined | undefined;
15
16
  contracts?: {
16
17
  [x: string]: import('viem').ChainContract | {
17
18
  [sourceId: number]: import('viem').ChainContract | undefined;
@@ -21,6 +22,7 @@ export declare const hoodi: {
21
22
  multicall3?: import('viem').ChainContract | undefined;
22
23
  universalSignatureVerifier?: import('viem').ChainContract | undefined;
23
24
  } | undefined;
25
+ ensTlds?: readonly string[] | undefined;
24
26
  id: 560048;
25
27
  name: "Hoodi";
26
28
  nativeCurrency: {
@@ -33,7 +35,7 @@ export declare const hoodi: {
33
35
  readonly http: readonly ["https://rpc.hoodi.ethpandaops.io"];
34
36
  };
35
37
  };
36
- sourceId?: number | undefined;
38
+ sourceId?: number | undefined | undefined;
37
39
  testnet: true;
38
40
  custom?: Record<string, unknown> | undefined;
39
41
  fees?: import('viem').ChainFees<undefined> | undefined;
@@ -49,6 +51,7 @@ export declare const chains: {
49
51
  readonly apiUrl: "https://api.etherscan.io/api";
50
52
  };
51
53
  };
54
+ blockTime?: number | undefined | undefined;
52
55
  contracts: {
53
56
  readonly ensRegistry: {
54
57
  readonly address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";
@@ -62,6 +65,7 @@ export declare const chains: {
62
65
  readonly blockCreated: 14353601;
63
66
  };
64
67
  };
68
+ ensTlds?: readonly string[] | undefined;
65
69
  id: 1;
66
70
  name: "Ethereum";
67
71
  nativeCurrency: {
@@ -71,15 +75,15 @@ export declare const chains: {
71
75
  };
72
76
  rpcUrls: {
73
77
  readonly default: {
74
- readonly http: readonly ["https://cloudflare-eth.com"];
78
+ readonly http: readonly ["https://eth.merkle.io"];
75
79
  };
76
80
  };
77
- sourceId?: number | undefined;
78
- testnet?: boolean | undefined;
81
+ sourceId?: number | undefined | undefined;
82
+ testnet?: boolean | undefined | undefined;
79
83
  custom?: Record<string, unknown> | undefined;
80
84
  fees?: import('viem').ChainFees<undefined> | undefined;
81
85
  formatters?: undefined;
82
- serializers?: import('viem').ChainSerializers<undefined, import('viem').TransactionSerializable<bigint, number>> | undefined;
86
+ serializers?: import('viem').ChainSerializers<undefined, import('viem').TransactionSerializable> | undefined;
83
87
  };
84
88
  readonly holesky: {
85
89
  blockExplorers: {
@@ -89,6 +93,7 @@ export declare const chains: {
89
93
  readonly apiUrl: "https://api-holesky.etherscan.io/api";
90
94
  };
91
95
  };
96
+ blockTime?: number | undefined | undefined;
92
97
  contracts: {
93
98
  readonly multicall3: {
94
99
  readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
@@ -103,6 +108,7 @@ export declare const chains: {
103
108
  readonly blockCreated: 973484;
104
109
  };
105
110
  };
111
+ ensTlds?: readonly string[] | undefined;
106
112
  id: 17000;
107
113
  name: "Holesky";
108
114
  nativeCurrency: {
@@ -115,12 +121,12 @@ export declare const chains: {
115
121
  readonly http: readonly ["https://ethereum-holesky-rpc.publicnode.com"];
116
122
  };
117
123
  };
118
- sourceId?: number | undefined;
124
+ sourceId?: number | undefined | undefined;
119
125
  testnet: true;
120
126
  custom?: Record<string, unknown> | undefined;
121
127
  fees?: import('viem').ChainFees<undefined> | undefined;
122
128
  formatters?: undefined;
123
- serializers?: import('viem').ChainSerializers<undefined, import('viem').TransactionSerializable<bigint, number>> | undefined;
129
+ serializers?: import('viem').ChainSerializers<undefined, import('viem').TransactionSerializable> | undefined;
124
130
  };
125
131
  readonly hoodi: {
126
132
  blockExplorers?: {
@@ -134,7 +140,8 @@ export declare const chains: {
134
140
  url: string;
135
141
  apiUrl?: string | undefined;
136
142
  };
137
- } | undefined;
143
+ } | undefined | undefined;
144
+ blockTime?: number | undefined | undefined;
138
145
  contracts?: {
139
146
  [x: string]: import('viem').ChainContract | {
140
147
  [sourceId: number]: import('viem').ChainContract | undefined;
@@ -144,6 +151,7 @@ export declare const chains: {
144
151
  multicall3?: import('viem').ChainContract | undefined;
145
152
  universalSignatureVerifier?: import('viem').ChainContract | undefined;
146
153
  } | undefined;
154
+ ensTlds?: readonly string[] | undefined;
147
155
  id: 560048;
148
156
  name: "Hoodi";
149
157
  nativeCurrency: {
@@ -156,7 +164,7 @@ export declare const chains: {
156
164
  readonly http: readonly ["https://rpc.hoodi.ethpandaops.io"];
157
165
  };
158
166
  };
159
- sourceId?: number | undefined;
167
+ sourceId?: number | undefined | undefined;
160
168
  testnet: true;
161
169
  custom?: Record<string, unknown> | undefined;
162
170
  fees?: import('viem').ChainFees<undefined> | undefined;
@@ -4,7 +4,7 @@ import { TokenABI } from '../abi/token';
4
4
  import { AbiInputsToParams } from '../types/contract-interactions';
5
5
  import { Prettify } from '../types/utils';
6
6
  import { Abi, Address, ExtractAbiFunctions } from 'abitype';
7
- import { ContractFunctionArgs, ContractFunctionName, DecodeEventLogReturnType, Hash, PublicClient, ReadContractReturnType, SimulateContractParameters, SimulateContractReturnType, WaitForTransactionReceiptReturnType, WalletClient } from 'viem';
7
+ import { ContractFunctionArgs, ContractFunctionName, DecodeEventLogReturnType, Hash, Hex, PublicClient, ReadContractReturnType, SimulateContractParameters, SimulateContractReturnType, WaitForTransactionReceiptReturnType, WalletClient } from 'viem';
8
8
  export type SupportedAbis = typeof TokenABI | typeof MainnetV4GetterABI | typeof MainnetV4SetterABI;
9
9
  export type TokenEvents = DecodeEventLogReturnType<typeof TokenABI>;
10
10
  export type MainnetEvents = DecodeEventLogReturnType<typeof MainnetV4SetterABI>;
@@ -67,6 +67,7 @@ export type WriterFunctions<ContractName extends ContractNames, Fns extends Cont
67
67
  simulate: (props?: Prettify<(K['stateMutability'] extends 'payable' ? {
68
68
  value?: bigint;
69
69
  } : object) & WriteOptions<K>>) => SimulateContractReturnType<SupportedAbis, K['name']>;
70
+ getTransactionData: () => Hex;
70
71
  } : {
71
72
  (props: Prettify<((K['stateMutability'] extends 'payable' ? {
72
73
  value?: bigint;
@@ -78,6 +79,7 @@ export type WriterFunctions<ContractName extends ContractNames, Fns extends Cont
78
79
  } : object) & (K['inputs'] extends readonly [] ? object : {
79
80
  args: Prettify<AbiInputsToParams<K['inputs']>>;
80
81
  })) & WriteOptions<K>>) => SimulateContractReturnType<SupportedAbis, K['name']>;
82
+ getTransactionData: (props: K['inputs'] extends readonly [] ? object : Prettify<AbiInputsToParams<K['inputs']>>) => Hex;
81
83
  };
82
84
  };
83
85
  export type ReaderFunctions<ContractName extends keyof Contracts, Fns extends Contracts[ContractName]['readFunctions'] = Contracts[ContractName]['readFunctions']> = {