@ssv-labs/ssv-sdk 1.0.1 → 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.md +22 -6
- package/dist/api/subgraph/index.d.ts +49 -82
- package/dist/graphql/graphql.d.ts +137 -0
- package/dist/libs/api/index.d.ts +0 -1
- package/dist/libs/operator/methods.d.ts +1 -1
- package/dist/libs/utils/index.d.ts +2 -0
- package/dist/libs/utils/methods/get-cluster-balance.d.ts +1 -0
- package/dist/libs/utils/methods/index.d.ts +1 -0
- package/dist/libs/utils/methods/write-keyshares-file.d.ts +16 -0
- package/dist/main.js +313 -61
- package/dist/main.mjs +303 -73
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<img src="https://
|
|
2
|
+
<img src="https://framerusercontent.com/assets/SxrtOSpELBgEtirWSlWPnBE0cd4.png" alt="SSV Network" width="300"/>
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
5
|
<h1 align="center">SSV SDK</h1>
|
|
@@ -73,26 +73,42 @@ const sdk = new SSVSDK({
|
|
|
73
73
|
|
|
74
74
|
```typescript
|
|
75
75
|
// Query operators
|
|
76
|
-
const operators = await sdk.api.getOperators({
|
|
76
|
+
const { operators } = await sdk.api.getOperators({
|
|
77
77
|
operatorIds: ['220', '221', '223', '224'],
|
|
78
78
|
});
|
|
79
79
|
|
|
80
80
|
// Get owner nonce
|
|
81
|
-
const nonce = await sdk.api.getOwnerNonce({
|
|
81
|
+
const { nonce } = await sdk.api.getOwnerNonce({
|
|
82
82
|
owner: 'your_wallet_address',
|
|
83
83
|
});
|
|
84
|
+
|
|
85
|
+
// Export SDK-generated payloads into a webapp-ready keyshares JSON file (Node.js only)
|
|
86
|
+
await sdk.utils.writeKeysharesFile({
|
|
87
|
+
path: './keyshares-webapp.json',
|
|
88
|
+
shares,
|
|
89
|
+
ownerAddress: 'your_wallet_address',
|
|
90
|
+
nonce,
|
|
91
|
+
});
|
|
84
92
|
```
|
|
85
93
|
|
|
86
94
|
### API Compatibility Notes
|
|
87
95
|
|
|
88
|
-
`getClusterSnapshot`
|
|
96
|
+
`getClusterSnapshot` is the canonical cluster snapshot API.
|
|
97
|
+
|
|
98
|
+
Snapshot-aware SDK read methods return the queried data together with the subgraph snapshot block number, for example:
|
|
99
|
+
|
|
100
|
+
- `sdk.api.getOwnerNonce(...) -> { blockNumber, nonce }`
|
|
101
|
+
- `sdk.api.getOperators(...) -> { blockNumber, operators }`
|
|
102
|
+
- `sdk.api.getClusterSnapshot(...) -> { blockNumber, cluster }`
|
|
89
103
|
|
|
90
104
|
| SDK version | Method name |
|
|
91
105
|
| ----------- | ------------------------------------ |
|
|
92
106
|
| `0.1.x` | `sdk.api.getClusterSnapshot({ id })` |
|
|
93
|
-
| `1.x` | `sdk.api.
|
|
107
|
+
| `1.x` | `sdk.api.getClusterSnapshot({ id })` |
|
|
108
|
+
|
|
109
|
+
`sdk.api.toSolidityCluster` is no longer part of the public subgraph API. The internal utility `toSolidityCluster(...)` in `utils/cluster` still exists for converting cluster data into the Solidity struct shape used by contract calls.
|
|
94
110
|
|
|
95
|
-
`sdk.
|
|
111
|
+
`sdk.utils.writeKeysharesFile(...)` is a Node.js utility and relies on filesystem access.
|
|
96
112
|
|
|
97
113
|
### Cluster Management
|
|
98
114
|
|
|
@@ -1,90 +1,56 @@
|
|
|
1
|
-
import { GetClusterBalanceQueryVariables, GetClusterQueryVariables, GetClusterSnapshotQueryVariables, GetClustersQueryVariables, GetDaoValuesQueryVariables, GetOperatorQueryVariables, GetOperatorsQueryVariables, GetOwnerNonceByBlockQueryVariables, GetValidatorQueryVariables, GetValidatorsQueryVariables } from '../../graphql/graphql';
|
|
1
|
+
import { GetClusterBalanceQuery, GetClusterBalanceQueryVariables, GetClusterQuery, GetClusterQueryVariables, GetClusterSnapshotQuery, GetClusterSnapshotQueryVariables, GetClustersQuery, GetClustersQueryVariables, GetDaoValuesQuery, GetDaoValuesQueryVariables, GetOperatorQuery, GetOperatorQueryVariables, GetOperatorsQuery, GetOperatorsQueryVariables, GetOwnerNonceByBlockQueryVariables, GetValidatorQuery, GetValidatorQueryVariables, GetValidatorsQuery, GetValidatorsQueryVariables } from '../../graphql/graphql';
|
|
2
2
|
import { RemoveConfigArg } from '../../types/methods';
|
|
3
3
|
import { GraphQLClient } from 'graphql-request';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
* @deprecated Use `toSolidityCluster` instead.
|
|
15
|
-
*/
|
|
16
|
-
export declare const getClusterSnapshot: (client: GraphQLClient, args: GetClusterSnapshotQueryVariables) => Promise<{
|
|
17
|
-
active: boolean;
|
|
18
|
-
validatorCount: string;
|
|
19
|
-
balance: string;
|
|
20
|
-
index: string;
|
|
21
|
-
networkFeeIndex: string;
|
|
22
|
-
effectiveBalance: string;
|
|
23
|
-
} | null | undefined>;
|
|
24
|
-
export declare const getCluster: (client: GraphQLClient, args: GetClusterQueryVariables) => Promise<{
|
|
25
|
-
feeAsset: import('../../graphql/graphql').ClusterFeeAssetTypes;
|
|
26
|
-
active: boolean;
|
|
27
|
-
validatorCount: string;
|
|
28
|
-
balance: string;
|
|
29
|
-
index: string;
|
|
30
|
-
networkFeeIndex: string;
|
|
31
|
-
operatorIds: Array<string>;
|
|
32
|
-
effectiveBalance: string;
|
|
33
|
-
owner: {
|
|
34
|
-
id: import('viem').Address;
|
|
35
|
-
};
|
|
36
|
-
} | null | undefined>;
|
|
37
|
-
export declare const getClusters: (client: GraphQLClient, args: GetClustersQueryVariables) => Promise<{
|
|
38
|
-
id: string;
|
|
39
|
-
feeAsset: import('../../graphql/graphql').ClusterFeeAssetTypes;
|
|
40
|
-
active: boolean;
|
|
41
|
-
validatorCount: string;
|
|
42
|
-
balance: string;
|
|
43
|
-
index: string;
|
|
44
|
-
networkFeeIndex: string;
|
|
45
|
-
operatorIds: Array<string>;
|
|
46
|
-
effectiveBalance: string;
|
|
47
|
-
}[]>;
|
|
48
|
-
export declare const getOperator: (client: GraphQLClient, args: GetOperatorQueryVariables) => Promise<{
|
|
4
|
+
import { Address } from 'viem';
|
|
5
|
+
type SnapshotResult<T> = {
|
|
6
|
+
blockNumber: number;
|
|
7
|
+
} & T;
|
|
8
|
+
declare const mapOperator: <T extends {
|
|
9
|
+
publicKey: Address;
|
|
10
|
+
whitelisted: {
|
|
11
|
+
id: Address;
|
|
12
|
+
}[];
|
|
13
|
+
}>(operator: T) => Omit<T, "publicKey" | "whitelisted"> & {
|
|
49
14
|
publicKey: string;
|
|
50
|
-
whitelisted:
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
export declare const
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
15
|
+
whitelisted: Address[];
|
|
16
|
+
};
|
|
17
|
+
export declare const getOwnerNonce: (client: GraphQLClient, args: GetOwnerNonceByBlockQueryVariables) => Promise<SnapshotResult<{
|
|
18
|
+
nonce: number;
|
|
19
|
+
}>>;
|
|
20
|
+
export declare const getClusterSnapshot: (client: GraphQLClient, args: GetClusterSnapshotQueryVariables) => Promise<SnapshotResult<{
|
|
21
|
+
cluster: GetClusterSnapshotQuery["cluster"];
|
|
22
|
+
}>>;
|
|
23
|
+
export declare const getCluster: (client: GraphQLClient, args: GetClusterQueryVariables) => Promise<SnapshotResult<{
|
|
24
|
+
cluster: GetClusterQuery["cluster"];
|
|
25
|
+
}>>;
|
|
26
|
+
export declare const getClusters: (client: GraphQLClient, args: GetClustersQueryVariables) => Promise<SnapshotResult<{
|
|
27
|
+
clusters: GetClustersQuery["clusters"];
|
|
28
|
+
}>>;
|
|
29
|
+
export declare const getOperator: (client: GraphQLClient, args: GetOperatorQueryVariables) => Promise<SnapshotResult<{
|
|
30
|
+
operator: (Omit<NonNullable<GetOperatorQuery["operator"]>, "publicKey" | "whitelisted"> & {
|
|
31
|
+
publicKey: string;
|
|
32
|
+
whitelisted: Address[];
|
|
33
|
+
}) | null;
|
|
34
|
+
}>>;
|
|
35
|
+
export declare const getOperators: (client: GraphQLClient, args: GetOperatorsQueryVariables) => Promise<SnapshotResult<{
|
|
36
|
+
operators: ReturnType<typeof mapOperator<NonNullable<GetOperatorsQuery["operators"][number]>>>[];
|
|
37
|
+
}>>;
|
|
38
|
+
export declare const getValidators: (client: GraphQLClient, args: GetValidatorsQueryVariables) => Promise<SnapshotResult<{
|
|
39
|
+
validators: GetValidatorsQuery["validators"];
|
|
40
|
+
}>>;
|
|
41
|
+
export declare const getValidator: (client: GraphQLClient, args: GetValidatorQueryVariables) => Promise<SnapshotResult<{
|
|
42
|
+
validator: GetValidatorQuery["validator"];
|
|
43
|
+
}>>;
|
|
44
|
+
export declare const getClusterBalance: (client: GraphQLClient, args: GetClusterBalanceQueryVariables) => Promise<SnapshotResult<{
|
|
45
|
+
cluster: GetClusterBalanceQuery["cluster"];
|
|
46
|
+
daovalues: GetClusterBalanceQuery["daovalues"];
|
|
47
|
+
operators: GetClusterBalanceQuery["operators"];
|
|
48
|
+
}>>;
|
|
49
|
+
export declare const getDaoValues: (client: GraphQLClient, args: GetDaoValuesQueryVariables) => Promise<SnapshotResult<{
|
|
50
|
+
daovalues: GetDaoValuesQuery["daovalues"];
|
|
51
|
+
}>>;
|
|
85
52
|
export declare const getQueries: (client: GraphQLClient) => {
|
|
86
53
|
getOwnerNonce: RemoveConfigArg<typeof getOwnerNonce>;
|
|
87
|
-
toSolidityCluster: RemoveConfigArg<typeof toSolidityCluster>;
|
|
88
54
|
getClusterSnapshot: RemoveConfigArg<typeof getClusterSnapshot>;
|
|
89
55
|
getCluster: RemoveConfigArg<typeof getCluster>;
|
|
90
56
|
getClusters: RemoveConfigArg<typeof getClusters>;
|
|
@@ -95,3 +61,4 @@ export declare const getQueries: (client: GraphQLClient) => {
|
|
|
95
61
|
getClusterBalance: RemoveConfigArg<typeof getClusterBalance>;
|
|
96
62
|
getDaoValues: RemoveConfigArg<typeof getDaoValues>;
|
|
97
63
|
};
|
|
64
|
+
export {};
|
|
@@ -68,6 +68,7 @@ export type Scalars = {
|
|
|
68
68
|
};
|
|
69
69
|
export type Account = {
|
|
70
70
|
clusters?: Maybe<Array<Cluster>>;
|
|
71
|
+
effectiveBalance: Scalars['BigInt']['output'];
|
|
71
72
|
feeRecipient: Scalars['Bytes']['output'];
|
|
72
73
|
id: Scalars['Bytes']['output'];
|
|
73
74
|
nonce: Scalars['BigInt']['output'];
|
|
@@ -103,6 +104,14 @@ export type Account_Filter = {
|
|
|
103
104
|
_change_block?: InputMaybe<BlockChangedFilter>;
|
|
104
105
|
and?: InputMaybe<Array<InputMaybe<Account_Filter>>>;
|
|
105
106
|
clusters_?: InputMaybe<Cluster_Filter>;
|
|
107
|
+
effectiveBalance?: InputMaybe<Scalars['BigInt']['input']>;
|
|
108
|
+
effectiveBalance_gt?: InputMaybe<Scalars['BigInt']['input']>;
|
|
109
|
+
effectiveBalance_gte?: InputMaybe<Scalars['BigInt']['input']>;
|
|
110
|
+
effectiveBalance_in?: InputMaybe<Array<Scalars['BigInt']['input']>>;
|
|
111
|
+
effectiveBalance_lt?: InputMaybe<Scalars['BigInt']['input']>;
|
|
112
|
+
effectiveBalance_lte?: InputMaybe<Scalars['BigInt']['input']>;
|
|
113
|
+
effectiveBalance_not?: InputMaybe<Scalars['BigInt']['input']>;
|
|
114
|
+
effectiveBalance_not_in?: InputMaybe<Array<Scalars['BigInt']['input']>>;
|
|
106
115
|
feeRecipient?: InputMaybe<Scalars['Bytes']['input']>;
|
|
107
116
|
feeRecipient_contains?: InputMaybe<Scalars['Bytes']['input']>;
|
|
108
117
|
feeRecipient_gt?: InputMaybe<Scalars['Bytes']['input']>;
|
|
@@ -161,6 +170,7 @@ export type Account_Filter = {
|
|
|
161
170
|
};
|
|
162
171
|
export declare enum Account_OrderBy {
|
|
163
172
|
clusters = "clusters",
|
|
173
|
+
effectiveBalance = "effectiveBalance",
|
|
164
174
|
feeRecipient = "feeRecipient",
|
|
165
175
|
id = "id",
|
|
166
176
|
nonce = "nonce",
|
|
@@ -1297,6 +1307,7 @@ export declare enum Cluster_OrderBy {
|
|
|
1297
1307
|
networkFeeIndex = "networkFeeIndex",
|
|
1298
1308
|
operatorIds = "operatorIds",
|
|
1299
1309
|
owner = "owner",
|
|
1310
|
+
owner__effectiveBalance = "owner__effectiveBalance",
|
|
1300
1311
|
owner__feeRecipient = "owner__feeRecipient",
|
|
1301
1312
|
owner__id = "owner__id",
|
|
1302
1313
|
owner__nonce = "owner__nonce",
|
|
@@ -1333,6 +1344,7 @@ export declare enum DaoUpdateTypes {
|
|
|
1333
1344
|
export type DaoValues = {
|
|
1334
1345
|
accEthPerShare: Scalars['BigInt']['output'];
|
|
1335
1346
|
declareOperatorFeePeriod: Scalars['BigInt']['output'];
|
|
1347
|
+
effectiveBalanceETH: Scalars['BigInt']['output'];
|
|
1336
1348
|
executeOperatorFeePeriod: Scalars['BigInt']['output'];
|
|
1337
1349
|
id: Scalars['Bytes']['output'];
|
|
1338
1350
|
lastUpdateBlockNumber: Scalars['BigInt']['output'];
|
|
@@ -1386,6 +1398,14 @@ export type DaoValues_Filter = {
|
|
|
1386
1398
|
declareOperatorFeePeriod_lte?: InputMaybe<Scalars['BigInt']['input']>;
|
|
1387
1399
|
declareOperatorFeePeriod_not?: InputMaybe<Scalars['BigInt']['input']>;
|
|
1388
1400
|
declareOperatorFeePeriod_not_in?: InputMaybe<Array<Scalars['BigInt']['input']>>;
|
|
1401
|
+
effectiveBalanceETH?: InputMaybe<Scalars['BigInt']['input']>;
|
|
1402
|
+
effectiveBalanceETH_gt?: InputMaybe<Scalars['BigInt']['input']>;
|
|
1403
|
+
effectiveBalanceETH_gte?: InputMaybe<Scalars['BigInt']['input']>;
|
|
1404
|
+
effectiveBalanceETH_in?: InputMaybe<Array<Scalars['BigInt']['input']>>;
|
|
1405
|
+
effectiveBalanceETH_lt?: InputMaybe<Scalars['BigInt']['input']>;
|
|
1406
|
+
effectiveBalanceETH_lte?: InputMaybe<Scalars['BigInt']['input']>;
|
|
1407
|
+
effectiveBalanceETH_not?: InputMaybe<Scalars['BigInt']['input']>;
|
|
1408
|
+
effectiveBalanceETH_not_in?: InputMaybe<Array<Scalars['BigInt']['input']>>;
|
|
1389
1409
|
executeOperatorFeePeriod?: InputMaybe<Scalars['BigInt']['input']>;
|
|
1390
1410
|
executeOperatorFeePeriod_gt?: InputMaybe<Scalars['BigInt']['input']>;
|
|
1391
1411
|
executeOperatorFeePeriod_gte?: InputMaybe<Scalars['BigInt']['input']>;
|
|
@@ -1661,6 +1681,7 @@ export type DaoValues_Filter = {
|
|
|
1661
1681
|
export declare enum DaoValues_OrderBy {
|
|
1662
1682
|
accEthPerShare = "accEthPerShare",
|
|
1663
1683
|
declareOperatorFeePeriod = "declareOperatorFeePeriod",
|
|
1684
|
+
effectiveBalanceETH = "effectiveBalanceETH",
|
|
1664
1685
|
executeOperatorFeePeriod = "executeOperatorFeePeriod",
|
|
1665
1686
|
id = "id",
|
|
1666
1687
|
lastUpdateBlockNumber = "lastUpdateBlockNumber",
|
|
@@ -2348,6 +2369,22 @@ export declare enum LiquidationThresholdPeriodUpdated_OrderBy {
|
|
|
2348
2369
|
transactionHash = "transactionHash",
|
|
2349
2370
|
value = "value"
|
|
2350
2371
|
}
|
|
2372
|
+
/**
|
|
2373
|
+
* The severity level of a log entry.
|
|
2374
|
+
* Log levels are ordered from most to least severe: CRITICAL > ERROR > WARNING > INFO > DEBUG
|
|
2375
|
+
*/
|
|
2376
|
+
export declare enum LogLevel {
|
|
2377
|
+
/** Critical errors that require immediate attention */
|
|
2378
|
+
CRITICAL = "CRITICAL",
|
|
2379
|
+
/** Detailed diagnostic information for debugging */
|
|
2380
|
+
DEBUG = "DEBUG",
|
|
2381
|
+
/** Error conditions that indicate a failure */
|
|
2382
|
+
ERROR = "ERROR",
|
|
2383
|
+
/** Informational messages about normal operations */
|
|
2384
|
+
INFO = "INFO",
|
|
2385
|
+
/** Warning conditions that may require attention */
|
|
2386
|
+
WARNING = "WARNING"
|
|
2387
|
+
}
|
|
2351
2388
|
export type MinimumLiquidationCollateralSsvUpdated = {
|
|
2352
2389
|
blockNumber: Scalars['BigInt']['output'];
|
|
2353
2390
|
blockTimestamp: Scalars['BigInt']['output'];
|
|
@@ -4213,6 +4250,7 @@ export declare enum Operator_OrderBy {
|
|
|
4213
4250
|
lastUpdateTransactionHash = "lastUpdateTransactionHash",
|
|
4214
4251
|
operatorId = "operatorId",
|
|
4215
4252
|
owner = "owner",
|
|
4253
|
+
owner__effectiveBalance = "owner__effectiveBalance",
|
|
4216
4254
|
owner__feeRecipient = "owner__feeRecipient",
|
|
4217
4255
|
owner__id = "owner__id",
|
|
4218
4256
|
owner__nonce = "owner__nonce",
|
|
@@ -4419,6 +4457,8 @@ export declare enum OrderDirection {
|
|
|
4419
4457
|
desc = "desc"
|
|
4420
4458
|
}
|
|
4421
4459
|
export type Query = {
|
|
4460
|
+
/** Query execution logs emitted by the subgraph during indexing. Results are sorted by timestamp in descending order (newest first). */
|
|
4461
|
+
_logs: Array<_Log_>;
|
|
4422
4462
|
/** Access to subgraph metadata */
|
|
4423
4463
|
_meta?: Maybe<_Meta_>;
|
|
4424
4464
|
account?: Maybe<Account>;
|
|
@@ -4528,6 +4568,15 @@ export type Query = {
|
|
|
4528
4568
|
weightedRootProposed?: Maybe<WeightedRootProposed>;
|
|
4529
4569
|
weightedRootProposeds: Array<WeightedRootProposed>;
|
|
4530
4570
|
};
|
|
4571
|
+
export type Query_LogsArgs = {
|
|
4572
|
+
first?: InputMaybe<Scalars['Int']['input']>;
|
|
4573
|
+
from?: InputMaybe<Scalars['String']['input']>;
|
|
4574
|
+
level?: InputMaybe<LogLevel>;
|
|
4575
|
+
orderDirection?: InputMaybe<OrderDirection>;
|
|
4576
|
+
search?: InputMaybe<Scalars['String']['input']>;
|
|
4577
|
+
skip?: InputMaybe<Scalars['Int']['input']>;
|
|
4578
|
+
to?: InputMaybe<Scalars['String']['input']>;
|
|
4579
|
+
};
|
|
4531
4580
|
export type Query_MetaArgs = {
|
|
4532
4581
|
block?: InputMaybe<Block_Height>;
|
|
4533
4582
|
};
|
|
@@ -6628,6 +6677,7 @@ export declare enum Validator_OrderBy {
|
|
|
6628
6677
|
lastUpdateTransactionHash = "lastUpdateTransactionHash",
|
|
6629
6678
|
operators = "operators",
|
|
6630
6679
|
owner = "owner",
|
|
6680
|
+
owner__effectiveBalance = "owner__effectiveBalance",
|
|
6631
6681
|
owner__feeRecipient = "owner__feeRecipient",
|
|
6632
6682
|
owner__id = "owner__id",
|
|
6633
6683
|
owner__nonce = "owner__nonce",
|
|
@@ -6765,6 +6815,48 @@ export type _Block_ = {
|
|
|
6765
6815
|
/** Integer representation of the timestamp stored in blocks for the chain */
|
|
6766
6816
|
timestamp?: Maybe<Scalars['Int']['output']>;
|
|
6767
6817
|
};
|
|
6818
|
+
/**
|
|
6819
|
+
* A key-value pair of additional data associated with a log entry.
|
|
6820
|
+
* These correspond to arguments passed to the log function in the subgraph code.
|
|
6821
|
+
*/
|
|
6822
|
+
export type _LogArgument_ = {
|
|
6823
|
+
/** The parameter name */
|
|
6824
|
+
key: Scalars['String']['output'];
|
|
6825
|
+
/** The parameter value, serialized as a string */
|
|
6826
|
+
value: Scalars['String']['output'];
|
|
6827
|
+
};
|
|
6828
|
+
/**
|
|
6829
|
+
* Source code location metadata for a log entry.
|
|
6830
|
+
* Indicates where in the subgraph's AssemblyScript code the log statement was executed.
|
|
6831
|
+
*/
|
|
6832
|
+
export type _LogMeta_ = {
|
|
6833
|
+
/** The column number in the source file */
|
|
6834
|
+
column: Scalars['Int']['output'];
|
|
6835
|
+
/** The line number in the source file */
|
|
6836
|
+
line: Scalars['Int']['output'];
|
|
6837
|
+
/** The module or file path where the log was emitted */
|
|
6838
|
+
module: Scalars['String']['output'];
|
|
6839
|
+
};
|
|
6840
|
+
/**
|
|
6841
|
+
* A log entry emitted by a subgraph during indexing.
|
|
6842
|
+
* Logs can be generated by the subgraph's AssemblyScript code using the `log.*` functions.
|
|
6843
|
+
*/
|
|
6844
|
+
export type _Log_ = {
|
|
6845
|
+
/** Additional structured data passed to the log function as key-value pairs */
|
|
6846
|
+
arguments: Array<_LogArgument_>;
|
|
6847
|
+
/** Unique identifier for this log entry */
|
|
6848
|
+
id: Scalars['String']['output'];
|
|
6849
|
+
/** The severity level of the log entry */
|
|
6850
|
+
level: LogLevel;
|
|
6851
|
+
/** Metadata about the source location in the subgraph code where the log was emitted */
|
|
6852
|
+
meta: _LogMeta_;
|
|
6853
|
+
/** The deployment hash of the subgraph that emitted this log */
|
|
6854
|
+
subgraphId: Scalars['String']['output'];
|
|
6855
|
+
/** The log message text */
|
|
6856
|
+
text: Scalars['String']['output'];
|
|
6857
|
+
/** The timestamp when the log was emitted, in RFC3339 format (e.g., '2024-01-15T10:30:00Z') */
|
|
6858
|
+
timestamp: Scalars['String']['output'];
|
|
6859
|
+
};
|
|
6768
6860
|
/** The type for the top-level _meta field */
|
|
6769
6861
|
export type _Meta_ = {
|
|
6770
6862
|
/**
|
|
@@ -6789,6 +6881,11 @@ export type GetClusterSnapshotQueryVariables = Exact<{
|
|
|
6789
6881
|
id: Scalars['ID']['input'];
|
|
6790
6882
|
}>;
|
|
6791
6883
|
export type GetClusterSnapshotQuery = {
|
|
6884
|
+
_meta?: {
|
|
6885
|
+
block: {
|
|
6886
|
+
number: number;
|
|
6887
|
+
};
|
|
6888
|
+
} | null;
|
|
6792
6889
|
cluster?: {
|
|
6793
6890
|
active: boolean;
|
|
6794
6891
|
validatorCount: string;
|
|
@@ -6802,6 +6899,11 @@ export type GetClusterQueryVariables = Exact<{
|
|
|
6802
6899
|
id: Scalars['ID']['input'];
|
|
6803
6900
|
}>;
|
|
6804
6901
|
export type GetClusterQuery = {
|
|
6902
|
+
_meta?: {
|
|
6903
|
+
block: {
|
|
6904
|
+
number: number;
|
|
6905
|
+
};
|
|
6906
|
+
} | null;
|
|
6805
6907
|
cluster?: {
|
|
6806
6908
|
feeAsset: ClusterFeeAssetTypes;
|
|
6807
6909
|
active: boolean;
|
|
@@ -6820,6 +6922,11 @@ export type GetClustersQueryVariables = Exact<{
|
|
|
6820
6922
|
owner: Scalars['String']['input'];
|
|
6821
6923
|
}>;
|
|
6822
6924
|
export type GetClustersQuery = {
|
|
6925
|
+
_meta?: {
|
|
6926
|
+
block: {
|
|
6927
|
+
number: number;
|
|
6928
|
+
};
|
|
6929
|
+
} | null;
|
|
6823
6930
|
clusters: Array<{
|
|
6824
6931
|
id: string;
|
|
6825
6932
|
feeAsset: ClusterFeeAssetTypes;
|
|
@@ -6836,6 +6943,11 @@ export type GetOwnerNonceQueryVariables = Exact<{
|
|
|
6836
6943
|
owner: Scalars['ID']['input'];
|
|
6837
6944
|
}>;
|
|
6838
6945
|
export type GetOwnerNonceQuery = {
|
|
6946
|
+
_meta?: {
|
|
6947
|
+
block: {
|
|
6948
|
+
number: number;
|
|
6949
|
+
};
|
|
6950
|
+
} | null;
|
|
6839
6951
|
account?: {
|
|
6840
6952
|
nonce: string;
|
|
6841
6953
|
} | null;
|
|
@@ -6853,6 +6965,11 @@ export type GetOperatorQueryVariables = Exact<{
|
|
|
6853
6965
|
id: Scalars['ID']['input'];
|
|
6854
6966
|
}>;
|
|
6855
6967
|
export type GetOperatorQuery = {
|
|
6968
|
+
_meta?: {
|
|
6969
|
+
block: {
|
|
6970
|
+
number: number;
|
|
6971
|
+
};
|
|
6972
|
+
} | null;
|
|
6856
6973
|
operator?: {
|
|
6857
6974
|
id: string;
|
|
6858
6975
|
publicKey: Address;
|
|
@@ -6868,6 +6985,11 @@ export type GetOperatorsQueryVariables = Exact<{
|
|
|
6868
6985
|
operatorIds: Array<Scalars['String']['input']> | Scalars['String']['input'];
|
|
6869
6986
|
}>;
|
|
6870
6987
|
export type GetOperatorsQuery = {
|
|
6988
|
+
_meta?: {
|
|
6989
|
+
block: {
|
|
6990
|
+
number: number;
|
|
6991
|
+
};
|
|
6992
|
+
} | null;
|
|
6871
6993
|
operators: Array<{
|
|
6872
6994
|
id: string;
|
|
6873
6995
|
publicKey: Address;
|
|
@@ -6885,6 +7007,11 @@ export type GetValidatorsQueryVariables = Exact<{
|
|
|
6885
7007
|
ids: Array<Scalars['Bytes']['input']> | Scalars['Bytes']['input'];
|
|
6886
7008
|
}>;
|
|
6887
7009
|
export type GetValidatorsQuery = {
|
|
7010
|
+
_meta?: {
|
|
7011
|
+
block: {
|
|
7012
|
+
number: number;
|
|
7013
|
+
};
|
|
7014
|
+
} | null;
|
|
6888
7015
|
validators: Array<{
|
|
6889
7016
|
id: Address;
|
|
6890
7017
|
}>;
|
|
@@ -6893,6 +7020,11 @@ export type GetValidatorQueryVariables = Exact<{
|
|
|
6893
7020
|
id: Scalars['ID']['input'];
|
|
6894
7021
|
}>;
|
|
6895
7022
|
export type GetValidatorQuery = {
|
|
7023
|
+
_meta?: {
|
|
7024
|
+
block: {
|
|
7025
|
+
number: number;
|
|
7026
|
+
};
|
|
7027
|
+
} | null;
|
|
6896
7028
|
validator?: {
|
|
6897
7029
|
id: Address;
|
|
6898
7030
|
} | null;
|
|
@@ -6941,6 +7073,11 @@ export type GetDaoValuesQueryVariables = Exact<{
|
|
|
6941
7073
|
daoAddress: Scalars['ID']['input'];
|
|
6942
7074
|
}>;
|
|
6943
7075
|
export type GetDaoValuesQuery = {
|
|
7076
|
+
_meta?: {
|
|
7077
|
+
block: {
|
|
7078
|
+
number: number;
|
|
7079
|
+
};
|
|
7080
|
+
} | null;
|
|
6944
7081
|
daovalues?: {
|
|
6945
7082
|
networkFee: string;
|
|
6946
7083
|
networkFeeIndex: string;
|
package/dist/libs/api/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { GraphQLClient } from 'graphql-request';
|
|
2
2
|
export declare const createQueries: (graphqlClient: GraphQLClient) => {
|
|
3
3
|
getOwnerNonce: import('../../types/methods').RemoveConfigArg<typeof import('../../api/subgraph').getOwnerNonce>;
|
|
4
|
-
toSolidityCluster: import('../../types/methods').RemoveConfigArg<typeof import('../../api/subgraph').toSolidityCluster>;
|
|
5
4
|
getClusterSnapshot: import('../../types/methods').RemoveConfigArg<typeof import('../../api/subgraph').getClusterSnapshot>;
|
|
6
5
|
getCluster: import('../../types/methods').RemoveConfigArg<typeof import('../../api/subgraph').getCluster>;
|
|
7
6
|
getClusters: import('../../types/methods').RemoveConfigArg<typeof import('../../api/subgraph').getClusters>;
|
|
@@ -2569,5 +2569,5 @@ export declare const setOperatorWhitelists: (config: ConfigReturnType, { args: {
|
|
|
2569
2569
|
})[];
|
|
2570
2570
|
}>;
|
|
2571
2571
|
}>;
|
|
2572
|
-
export declare const canAccountUseOperator: (config: ConfigReturnType, operator: Awaited<ReturnType<typeof getOperator
|
|
2572
|
+
export declare const canAccountUseOperator: (config: ConfigReturnType, operator: Awaited<ReturnType<typeof getOperator>>["operator"], account: Address) => Promise<boolean>;
|
|
2573
2573
|
export {};
|
|
@@ -2,6 +2,7 @@ import { ConfigReturnType } from '../../config/create';
|
|
|
2
2
|
import { getClusterBalance, getOperatorCapacity } from './methods';
|
|
3
3
|
import { calcDepositFromRunway } from './methods/calc-deposit-from-runway';
|
|
4
4
|
import { validateSharesPreRegistration } from './methods/keyshares';
|
|
5
|
+
import { writeKeysharesFile } from './methods/write-keyshares-file';
|
|
5
6
|
import { RemoveConfigArg } from '../../types/methods';
|
|
6
7
|
export declare const createUtils: (config: ConfigReturnType) => {
|
|
7
8
|
generateKeyShares: (args: {
|
|
@@ -12,6 +13,7 @@ export declare const createUtils: (config: ConfigReturnType) => {
|
|
|
12
13
|
ownerAddress: string;
|
|
13
14
|
nonce: number;
|
|
14
15
|
}) => Promise<import('../ssv-keys/KeyShares/KeySharesData/KeySharesPayload').KeySharesPayload[]>;
|
|
16
|
+
writeKeysharesFile: RemoveConfigArg<typeof writeKeysharesFile>;
|
|
15
17
|
validateKeysharesJSON: ({ account, operators, keyshares, }: {
|
|
16
18
|
account: import('viem').Address;
|
|
17
19
|
operators: Pick<import('../../types/operator').Operator, "id" | "publicKey">[];
|
|
@@ -5,6 +5,7 @@ type GetClusterBalanceArgs = {
|
|
|
5
5
|
ownerAddress?: Address;
|
|
6
6
|
};
|
|
7
7
|
export declare const getClusterBalance: (config: ConfigReturnType, { operatorIds, ownerAddress }: GetClusterBalanceArgs) => Promise<{
|
|
8
|
+
blockNumber: number;
|
|
8
9
|
balance: bigint;
|
|
9
10
|
operationalRunway: bigint;
|
|
10
11
|
}>;
|
|
@@ -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 {};
|