From b93255ef6eabea6f04abb13c7152b2ec35295005 Mon Sep 17 00:00:00 2001 From: Alex Z Date: Tue, 17 Feb 2026 15:28:36 +0700 Subject: [PATCH 1/4] SDK v1.0.0 and fixes --- .../developers/BA-SDK/README.md | 19 ++++++------ docs/developers/README.md | 23 +++++++++++---- docs/developers/SSV-SDK/README.md | 29 ++++++++++++------- .../SSV-SDK/module-reference/api-module.md | 2 +- .../module-reference/cluster-module.md | 28 +++++++++--------- .../SSV-SDK/module-reference/utils-module.md | 8 ++--- 6 files changed, 66 insertions(+), 43 deletions(-) diff --git a/docs/based-applications/developers/BA-SDK/README.md b/docs/based-applications/developers/BA-SDK/README.md index 0ad4f01..445e121 100644 --- a/docs/based-applications/developers/BA-SDK/README.md +++ b/docs/based-applications/developers/BA-SDK/README.md @@ -63,16 +63,17 @@ const walletClient = createWalletClient({ transport, }) -const sdk = new BasedAppsSDK({ - beaconchainUrl: 'https://example.com/beacon', - publicClient, - walletClient, - extendedConfig: { - subgraph: { - apiKey: "" +const sdk = new SSVSDK({ + publicClient: publicClient as any, + walletClient: walletClient as any, + beaconchainUrl: 'https://example.com/beacon', + extendedConfig: { + subgraph: { + apiKey: process.env.SUBGRAPH_API, + endpoint: process.env.SUBGRAPH_ENDPOINT, + } } - } - }) + }) async function main(): Promise { diff --git a/docs/developers/README.md b/docs/developers/README.md index d323e7e..f6071ae 100644 --- a/docs/developers/README.md +++ b/docs/developers/README.md @@ -80,9 +80,15 @@ const walletClient = createWalletClient({ // Initialize SDK with viem clients const sdk = new SSVSDK({ - publicClient, - walletClient, -}) + publicClient: publicClient as any, + walletClient: walletClient as any, + extendedConfig: { + subgraph: { + apiKey: process.env.SUBGRAPH_API, + endpoint: process.env.SUBGRAPH_ENDPOINT, + } + } + }); ``` ### **2. Select operators and collect their data** @@ -278,10 +284,17 @@ async function main(): Promise { // Initialize SDK with viem clients const sdk = new SSVSDK({ - publicClient, - walletClient, + publicClient: publicClient as any, + walletClient: walletClient as any, + extendedConfig: { + subgraph: { + apiKey: process.env.SUBGRAPH_API, + endpoint: process.env.SUBGRAPH_ENDPOINT, + } + } }) + const directoryPath = process.env.KEYSTORE_FILE_DIRECTORY; let keystoresArray: { name: string; keystore: any }[]; try { diff --git a/docs/developers/SSV-SDK/README.md b/docs/developers/SSV-SDK/README.md index ef0ef5d..60290e3 100644 --- a/docs/developers/SSV-SDK/README.md +++ b/docs/developers/SSV-SDK/README.md @@ -25,6 +25,13 @@ To install the SDK, run: npm i @ssv-labs/ssv-sdk ``` +:::info ⚠️ Testnet Version ⚠️ +The latest Hoodi-compatible version was not released to npmjs. To install it, download it from [the github release](https://github.com/ssvlabs/ssv-sdk/releases/tag/v.1.0.0) or via the command below: +```bash +npm i --force --ignore-scripts github:ssvlabs/ssv-sdk#v.1.0.0 +``` +::: + ## Initialization The SDK requires specific parameters for initialization. Two that are not optional are the chain and the account. The `viem` library can be used to create an account object based off of a wallet's private key, and pass it into the SDK to instantiate it. @@ -52,25 +59,27 @@ const walletClient = createWalletClient({ // Initialize SDK with viem clients const sdk = new SSVSDK({ - publicClient, - walletClient, - extendedConfig: { - subgraph: { - apiKey: "" + publicClient: publicClient as any, + walletClient: walletClient as any, + extendedConfig: { + subgraph: { + apiKey: process.env.SUBGRAPH_API, + endpoint: process.env.SUBGRAPH_ENDPOINT, + } } - } -}) + }); ``` -The `extendedConfig` parameter is optional, if not provided, the SDK will use the development endpoint. Bear in mind that this is rate limited, though, so it is strongly advised to use an API key with the free plan. -For more information regarding your subgraph API key, please refer to the [dedicated Subgraph page](../tools/ssv-subgraph/README.md). +The `extendedConfig` parameter is optional, if not provided, the SDK will use the development endpoint. Bear in mind that this is rate limited, though, so it is strongly advised to use an API key with the free plan. For more information regarding your subgraph API key, please refer to the [dedicated Subgraph page](/developers/tools/ssv-subgraph/README.md). ### Initialization Parameters | Input name | Input type | Optional | |------------|------------|----------| -| public_client | [Viem public client](https://viem.sh/docs/clients/public.html) | No | +| public_client | [Viem public client](https://viem.sh/docs/clients/public) | No | | wallet_client | [Viem wallet client](https://viem.sh/docs/clients/wallet) | No | +| SUBGRAPH_API | API Key retrived from [The Graph account](https://thegraph.com/studio/apikeys/) | Yes, strongly recommended | +| SUBGRAPH_ENDPOINT | Subgraph Endpoint retrieved from [Mainnet or Testnet subgraph page](/developers/tools/ssv-subgraph/#querying-ssv-protocol-smart-contract-data) | Yes, strongly recommended | ## Usage diff --git a/docs/developers/SSV-SDK/module-reference/api-module.md b/docs/developers/SSV-SDK/module-reference/api-module.md index 27d2d30..d6c406d 100644 --- a/docs/developers/SSV-SDK/module-reference/api-module.md +++ b/docs/developers/SSV-SDK/module-reference/api-module.md @@ -75,7 +75,7 @@ const clusterID = createClusterId(ownerAddress, operatorIds) Example output: ```bash -1179fed483c8c1b0327c8667521162015fa8cbe1a1b047a26baf0f0971a81929 +0xf69a08b652f0cebb685c2ffe043cfb767b66544a-5-6-7-8 ``` ### `getClusterBalance(clusterId, daoAddress, operatorIds)` diff --git a/docs/developers/SSV-SDK/module-reference/cluster-module.md b/docs/developers/SSV-SDK/module-reference/cluster-module.md index ae21791..a4dcde0 100644 --- a/docs/developers/SSV-SDK/module-reference/cluster-module.md +++ b/docs/developers/SSV-SDK/module-reference/cluster-module.md @@ -19,7 +19,7 @@ Converts an SSV-based cluster (legacy) to ETH-based cluster. Accepts cluster ID | Input parameter | Input type | Description | Example input | |----------------|------------|-------------|---------------| -| `cluster_Id` | string | A `cluster_id` in its computed ID form. | 0xf69A08B652f0CEBb685c2fFE043cfB767b66544A-5-6-7-8 | +| cluster_Id | string | A cluster_id in its computed ID form. Has to have the **owner address in lower case letters**. It is advised to use the [`createClusterID`](/developers/SSV-SDK/module-reference/api-module#getclusteridowner_address-operator_ids) function to get the cluster ID in the correct format | “0xf69a08b652f0cebb685c2ffe043cfb767b66544a-5-6-7-8” | | amount | bigint | Amount of ETH to deposit to fund the cluster | 0.1234 | #### Example: @@ -27,7 +27,7 @@ Converts an SSV-based cluster (legacy) to ETH-based cluster. Accepts cluster ID ```typescript txn_receipt = await sdk.clusters.migrateClusterToETH({ args: { - cluster_Id: "0xf69A08B652f0CEBb685c2fFE043cfB767b66544A-5-6-7-8", + cluster_Id: "0xf69a08b652f0cebb685c2ffe043cfb767b66544a-5-6-7-8", amount: parseEther('0.1234') }, }).then(tx => tx.wait()) @@ -59,7 +59,7 @@ Executes the contract call to to deposit ETH to the cluster balance. | Input parameter | Input type | Description | Example input | |----------------|------------|-------------|---------------| -| id | string | Cluster ID | 0xf69A08B652f0CEBb685c2fFE043cfB767b66544A-5-6-7-8 | +| id | string | A cluster id in its computed ID form. Has to have the **owner address in lower case letters**. It is advised to use the [`createClusterID`](/developers/SSV-SDK/module-reference/api-module#getclusteridowner_address-operator_ids) function to get the cluster ID in the correct format | “0xf69a08b652f0cebb685c2ffe043cfb767b66544a-5-6-7-8” | | amount | bigint | Amount of ETH to deposit to cluster | 0.1234 | #### Example: @@ -69,7 +69,7 @@ import { parseEther } from 'viem' txn_receipt = await sdk.clusters.deposit({ args: { - id: "0xf69A08B652f0CEBb685c2fFE043cfB767b66544A-5-6-7-8", + id: "0xf69a08b652f0cebb685c2ffe043cfb767b66544a-5-6-7-8", amount: parseEther('0.1234') }, }).then(tx => tx.wait()) @@ -81,14 +81,14 @@ Liquidates a cluster sends their balance to the msg.sender (the Liquidator). **W | Input parameter | Input type | Description | Example input | |----------------|------------|-------------|---------------| -| id | string | Cluster ID | 0xf69A08B652f0CEBb685c2fFE043cfB767b66544A-5-6-7-8 | +| id | string | A cluster id in its computed ID form. Has to have the **owner address in lower case letters**. It is advised to use the [`createClusterID`](/developers/SSV-SDK/module-reference/api-module#getclusteridowner_address-operator_ids) function to get the cluster ID in the correct format | “0xf69a08b652f0cebb685c2ffe043cfb767b66544a-5-6-7-8” | #### Example: ```typescript txn_receipt = await sdk.clusters.liquidateCluster({ args: { - id: "0xf69A08B652f0CEBb685c2fFE043cfB767b66544A-5-6-7-8", + id: "0xf69a08b652f0cebb685c2ffe043cfb767b66544a-5-6-7-8", }, }).then(tx => tx.wait()) ``` @@ -99,14 +99,14 @@ Liquidates a legacy (SSV-based) cluster sends their balance to the msg.sender (t | Input parameter | Input type | Description | Example input | |----------------|------------|-------------|---------------| -| id | string | Cluster ID | 0xf69A08B652f0CEBb685c2fFE043cfB767b66544A-5-6-7-8 | +| id | string | A cluster id in its computed ID form. Has to have the **owner address in lower case letters**. It is advised to use the [`createClusterID`](/developers/SSV-SDK/module-reference/api-module#getclusteridowner_address-operator_ids) function to get the cluster ID in the correct format | “0xf69a08b652f0cebb685c2ffe043cfb767b66544a-5-6-7-8” | #### Example: ```typescript txn_receipt = await sdk.clusters.liquidateSSV({ args: { - id: "0xf69A08B652f0CEBb685c2fFE043cfB767b66544A-5-6-7-8", + id: "0xf69a08b652f0cebb685c2ffe043cfb767b66544a-5-6-7-8", }, }).then(tx => tx.wait()) ``` @@ -122,7 +122,7 @@ Withdraw a specified amount of ETH from a cluster. | Input parameter | Input type | Description | Example input | |----------------|------------|-------------|---------------| -| id | string | Cluster ID | 0xf69A08B652f0CEBb685c2fFE043cfB767b66544A-5-6-7-8 | +| id | string | A cluster id in its computed ID form. Has to have the **owner address in lower case letters**. It is advised to use the [`createClusterID`](/developers/SSV-SDK/module-reference/api-module#getclusteridowner_address-operator_ids) function to get the cluster ID in the correct format | “0xf69a08b652f0cebb685c2ffe043cfb767b66544a-5-6-7-8” | | amount | bigint | Amount of ETH to withdraw from the cluster | 0.1234 | #### Example: @@ -132,7 +132,7 @@ import { parseEther } from 'viem' txn_receipt = await sdk.clusters.withdraw({ args: { - id: "0xf69A08B652f0CEBb685c2fFE043cfB767b66544A-5-6-7-8", + id: "0xf69a08b652f0cebb685c2ffe043cfb767b66544a-5-6-7-8", amount: parseEther('0.1234') }, }).then(tx => tx.wait()) @@ -148,7 +148,7 @@ Reactivates a liquidated cluster. | Input parameter | Input type | Description | Example input | |----------------|------------|-------------|---------------| -| id | string | Cluster ID | 0xf69A08B652f0CEBb685c2fFE043cfB767b66544A-5-6-7-8 | +| id | string | A cluster id in its computed ID form. Has to have the **owner address in lower case letters**. It is advised to use the [`createClusterID`](/developers/SSV-SDK/module-reference/api-module#getclusteridowner_address-operator_ids) function to get the cluster ID in the correct format | “0xf69a08b652f0cebb685c2ffe043cfb767b66544a-5-6-7-8” | | amount | bigint | Amount of ETH to deposit to cluster | 0.1234 | #### Example: @@ -158,7 +158,7 @@ import { parseEther } from 'viem' txn_receipt = await sdk.clusters.reactivateCluster({ args: { - id: "0xf69A08B652f0CEBb685c2fFE043cfB767b66544A-5-6-7-8", + id: "0xf69a08b652f0cebb685c2ffe043cfb767b66544a-5-6-7-8", amount: parseEther('0.1234') }, }).then(tx => tx.wait()) @@ -174,7 +174,7 @@ Accepts all parameters necessary to remove the validators. Removes all the valid | Input parameter | Input type | Description | Example input | |----------------|------------|-------------|---------------| -| id | string | Cluster ID | 0xf69A08B652f0CEBb685c2fFE043cfB767b66544A-5-6-7-8 | +| id | string | A cluster id in its computed ID form. Has to have the **owner address in lower case letters**. It is advised to use the [`createClusterID`](/developers/SSV-SDK/module-reference/api-module#getclusteridowner_address-operator_ids) function to get the cluster ID in the correct format | “0xf69a08b652f0cebb685c2ffe043cfb767b66544a-5-6-7-8” | | publicKeys | Hex[] | Array of validator public keys to remove | ["0x820fd0519c75f74c8be9f21f185406919721dad0c624464538e2eaa323d77d3eb3ef27a039e8779de6cfa649a5484e86", "0x820fd0519c75f74c8be9f21f185406919721dad0c624464538e2eaa323d77d3eb3ef27a039e8779de6cfa649a5484e87"] | #### Example: @@ -182,7 +182,7 @@ Accepts all parameters necessary to remove the validators. Removes all the valid ```typescript txn_receipt = await sdk.clusters.removeValidators({ args: { - id: "0xf69A08B652f0CEBb685c2fFE043cfB767b66544A-5-6-7-8", + id: "0xf69a08b652f0cebb685c2ffe043cfb767b66544a-5-6-7-8", publicKeys: ["0x820fd0519c75f74c8be9f21f185406919721dad0c624464538e2eaa323d77d3eb3ef27a039e8779de6cfa649a5484e86", "0x820fd0519c75f74c8be9f21f185406919721dad0c624464538e2eaa323d77d3eb3ef27a039e8779de6cfa649a5484e87"], }, }).then(tx => tx.wait()) diff --git a/docs/developers/SSV-SDK/module-reference/utils-module.md b/docs/developers/SSV-SDK/module-reference/utils-module.md index a62cf94..dc89d74 100644 --- a/docs/developers/SSV-SDK/module-reference/utils-module.md +++ b/docs/developers/SSV-SDK/module-reference/utils-module.md @@ -177,12 +177,12 @@ Accepts a cluster ID to identify the cluster, for which the balance needs to be | Input parameter | Input type | Description | Example input | |----------------|------------|-------------|---------------| -| cluster_Id | string | A cluster_id in its computed ID form. | “0xf69A08B652f0CEBb685c2fFE043cfB767b66544A-5-6-7-8” | +| cluster_Id | string | A cluster_id in its computed ID form. Has to have the **owner address in lower case letters**. It is advised to use the [`createClusterID`](/developers/SSV-SDK/module-reference/api-module#getclusteridowner_address-operator_ids) function to get the cluster ID in the correct format | “0xf69a08b652f0cebb685c2ffe043cfb767b66544a-5-6-7-8” | #### Example: ```typescript -const result = await sdk.utils.getClusterBalance(“0xf69A08B652f0CEBb685c2fFE043cfB767b66544A-5-6-7-8”) +const result = await sdk.utils.getClusterBalance(“0xf69a08b652f0cebb685c2ffe043cfb767b66544a-5-6-7-8”) ``` Example output: @@ -202,7 +202,7 @@ The function fetches the cluster snapshot using the provided ID, calculate the B | Input parameter | Input type | Description | Example input | |----------------|------------|-------------|---------------| -| cluster_Id | string | A cluster_id in its computed ID form. | “0xf69A08B652f0CEBb685c2fFE043cfB767b66544A-5-6-7-8” | +| cluster_Id | string | A cluster_id in its computed ID form. Has to have the **owner address in lower case letters**. It is advised to use the [`createClusterID`](/developers/SSV-SDK/module-reference/api-module#getclusteridowner_address-operator_ids) function to get the cluster ID in the correct format | “0xf69a08b652f0cebb685c2ffe043cfb767b66544a-5-6-7-8” | | runway | number | Desired Runway length, measured in number of days. | 45 | @@ -210,7 +210,7 @@ The function fetches the cluster snapshot using the provided ID, calculate the B ```typescript const result = await sdk.utils.calcDepositFromRunway({ - cluster_Id: “0xf69A08B652f0CEBb685c2fFE043cfB767b66544A-5-6-7-8”, + cluster_Id: “0xf69a08b652f0cebb685c2ffe043cfb767b66544a-5-6-7-8”, runway: 45, }); ``` From ac1ebc0f3d1069f9da127a97fdd11fd0b08f2bb7 Mon Sep 17 00:00:00 2001 From: Alex Z Date: Thu, 19 Feb 2026 21:46:45 +0700 Subject: [PATCH 2/4] contracts updated --- docs/developers/smart-contracts/ssvnetwork.md | 36 ++++++++-------- .../smart-contracts/ssvnetworkviews.md | 42 +++++++++---------- 2 files changed, 38 insertions(+), 40 deletions(-) diff --git a/docs/developers/smart-contracts/ssvnetwork.md b/docs/developers/smart-contracts/ssvnetwork.md index b1ec096..7794e0c 100644 --- a/docs/developers/smart-contracts/ssvnetwork.md +++ b/docs/developers/smart-contracts/ssvnetwork.md @@ -6,8 +6,6 @@ sidebar_position: 1 The SSVNetwork contract is the main contract for operations and management. -[SSV Network Contracts Repository](https://github.com/ssvlabs/ssv-network/tree/main/contracts) - ## Operator Methods ### **`registerOperator(publicKey, operatorFee, setPrivate)`** @@ -50,9 +48,9 @@ Events: * `OperatorWithdrawn(address indexed owner, uint64 indexed operatorId, uint256 value)` -### `withdrawAllOperatorEarnings`**`(operatorId)`** +### **`withdrawAllOperatorEarnings(operatorId)`** -Description: Withdraws all ETH earnings from provided operator balance to msg.sender, **will fail if** msg.sender is not the operator owner. +Description: Withdraws all ETH and SSV earnings from provided operator balance to msg.sender, **will fail if** msg.sender is not the operator owner. | **Parameter** | **Type** | **Description** | | ------------- | -------- | --------------- | @@ -61,15 +59,17 @@ Description: Withdraws all ETH earnings from provided operator balance to msg.se Events: * `OperatorWithdrawn(address indexed owner, uint64 indexed operatorId, uint256 value)` +* *`OperatorWithdrawnSSV(address indexed owner, uint64 indexed operatorId, uint256 value)`* is **emitted only if** the operator had any SSV tokens to withdraw. + ### **`setOperatorsWhitelists (operatorIds, whitelisted)`** -Description: For a list of operators provided, set a list of whitelisted addresses which can register validators to these operators. +Description: For a list of operators provided, set a list of whitelisted addresses which can register validators to these operators. Subsequent calls of this function **extend the list** of whitelisted addresses, and **do not overwrite it**. | **Parameter** | **Type** | **Description** | | ------------- | ---------- | --------------------------------------------------------- | | operatorId | uint64\[] | Operator ID list | -| whitelisted | address\[] |

A list of ETH1 addresses to be whitelisted.

| +| whitelisted | address\[] | A list of ETH1 addresses to be whitelisted. | Events: @@ -82,7 +82,7 @@ Description: For a list of operators provided, remove a list of whitelisted addr | **Parameter** | **Type** | **Description** | | ------------- | ---------- | ------------------------------------------------------------------------ | | operatorId | uint64\[] | Operator ID list | -| whitelisted | address\[] |

A list of ETH1 addresses to be removed from the whitelist.

| +| whitelisted | address\[] | A list of ETH1 addresses to be removed from the whitelist. | Events: @@ -119,13 +119,13 @@ Description: For a list of operators provided, set an external whitelisting cont | **Parameter** | **Type** | **Description** | | -------------------- | ------------------------ | ---------------------------------------------------- | | operatorId | uint64\[] | Operator ID list | -| whitelistingContract | ISSVWhitelistingContract |

A valid whitelisting contract address.

| +| whitelistingContract | ISSVWhitelistingContract | A valid whitelisting contract address. | Events: * `OperatorWhitelistingContractUpdated(uint64[] operatorIds, address whitelistingContract)` -### `removeOperatorsWhitelistingContract(operatorIds)` +### **`removeOperatorsWhitelistingContract(operatorIds)`** Description: For a list of operators provided, remove the whitelisting contract stored. @@ -174,7 +174,7 @@ Events: * `OperatorFeeDeclarationCancelled(address indexed owner, uint64 indexed operatorId)` -### `reduceOperatorFee(operatorId, fee)` +### **`reduceOperatorFee(operatorId, fee)`** Description: Reduce the operator fee, does not abide by the restrictions of fee increase @@ -203,7 +203,7 @@ Events: ## Cluster Methods -### `migrateClusterToETH(operatorIds, amount, cluster)` +### **`migrateClusterToETH(operatorIds, amount, cluster)`** | **Parameter** | **Type** | **Description** | | ------------------- | -------- | ---------------------------------------------------- | @@ -214,7 +214,7 @@ Events: Events: * `ClusterMigratedToETH(address owner, uint64[] operatorIds, uint256 ethDeposited, uint256 ssvRefunded, uint32 effectiveBalance, Cluster cluster)` - +* *`ClusterReactivated(address indexed owner, uint64[] operatorIds, Cluster cluster)`* is **emitted only if** the cluster was liquidated prior to the migration. ### **`registerValidator(publicKey, operatorIds, shares, cluster)`** @@ -421,7 +421,7 @@ Events: * `LiquidationThresholdPeriodUpdated(uint64 value)` -### `updateMaxiumumOperatorFee`**`(maxFee)`** +### **`updateMaxiumumOperatorFee(maxFee)`** Description: Updates the maximum yearly fee per 32 ETH an operator can set @@ -433,7 +433,7 @@ Events: * `OperatorMaximumFeeUpdated(uint64 maxFee)` -### `updateMinimumLiquidationCollateral(amount)` +### **`updateMinimumLiquidationCollateral(amount)`** Description: Sets the minimum collateral (in ETH) each cluster must keep in his balance. @@ -496,9 +496,9 @@ Description: Withdraws a specified amount of SSV tokens from provided operator b Events: -* `OperatorWithdrawn(address indexed owner, uint64 indexed operatorId, uint256 value)` +* `OperatorWithdrawnSSV(address indexed owner, uint64 indexed operatorId, uint256 value)` -### `withdrawAllOperatorEarningsSSV`**`(operatorId)`** +### **`withdrawAllOperatorEarningsSSV(operatorId)`** Description: Withdraws all SSV tokens earnings from provided operator balance to msg.sender, **will fail if** msg.sender is not the operator owner. @@ -508,7 +508,7 @@ Description: Withdraws all SSV tokens earnings from provided operator balance to Events: -* `OperatorWithdrawn(address indexed owner, uint64 indexed operatorId, uint256 value)` +* `OperatorWithdrawnSSV(address indexed owner, uint64 indexed operatorId, uint256 value)` ### **`liquidateSSV(owner, operatorIds, cluster)`** @@ -560,7 +560,7 @@ Events: * `LiquidationThresholdPeriodSSVUpdated(uint64 value)` -### `updateMinimumLiquidationCollateralSSV(amount)` +### **`updateMinimumLiquidationCollateralSSV(amount)`** Description: Sets the minimum collateral each SSV-based cluster must keep in his balance. diff --git a/docs/developers/smart-contracts/ssvnetworkviews.md b/docs/developers/smart-contracts/ssvnetworkviews.md index 07b42da..bb8134d 100644 --- a/docs/developers/smart-contracts/ssvnetworkviews.md +++ b/docs/developers/smart-contracts/ssvnetworkviews.md @@ -6,11 +6,9 @@ sidebar_position: 2 The SSVNetworkViews contract is for reading information about the network and its participants. -[SSV Views Contracts Repository](https://github.com/ssvlabs/ssv-network/tree/main/contracts) - ## General Methods -### **`getNetworkFee ()`** +### **`getNetworkFee()`** Description: Returns current network fee. @@ -20,7 +18,7 @@ Return values: |-----------|------|-------------| | fee | uint256 | The fee charged by the network proportional to Effective Balance (denominated as ETH per block) | -### **`getNetworkEarnings ()`** +### **`getNetworkEarnings()`** Description: Returns accumulated network fees not yet withdrawn. @@ -30,7 +28,7 @@ Return values: |-----------|------|-------------| | amount | uint256 | Amount of fees accumulated in the network treasury | -### **`getLiquidationThresholdPeriod ()`** +### **`getLiquidationThresholdPeriod()`** Description: Returns the minimum duration (in blocks) which a cluster has to have sufficient balance (liquidation collateral) to not be liquidated. @@ -93,7 +91,7 @@ Return values ## Operator Methods -### **`getOperatorById (operatorId)`** +### **`getOperatorById(operatorId)`** Description: Returns operator's data. @@ -112,7 +110,7 @@ Return values: | isPrivate | boolean | Indication if operator is permissioned | | active | boolean | Operator network status | -### **`getOperatorFee (operatorId)`** +### **`getOperatorFee(operatorId)`** Description: returns current operator's fee (not declared). @@ -126,7 +124,7 @@ Return values | ------------- | -------- | ---------------------------------------------------------------------- | | declaredFee | uint256 | The fee charged by the operator (denominated as ETH per block) | -### **`getOperatorDeclaredFee (operatorId)`** +### **`getOperatorDeclaredFee(operatorId)`** Description: Returns the declared fee (not actual fee) together with the execution time window. @@ -140,7 +138,7 @@ Return value | ------------- | -------- | ---------------------------------------------------------------------- | | declaredFee | uint256 | The fee declared by the operator (denominated as ETH per block) | -### **`getOperatorEarnings (operatorId)`** +### **`getOperatorEarnings(operatorId)`** Description: Returns the outstanding earnings of an operator. @@ -201,7 +199,7 @@ Return values ## Cluster Methods -### **`getBalance (owner, operatorIds, cluster)`** +### **`getBalance(owner, operatorIds, cluster)`** Description: Returns the outstanding ETH balance of a cluster. @@ -217,7 +215,7 @@ Return values: |-----------|------|-------------| | balance | uint256 | Clusters outstanding balance denominated in ETH | -### **`getBurnRate (owner, operatorIds, cluster)`** +### **`getBurnRate(owner, operatorIds, cluster)`** Description: Returns current ongoing expenses of ETH for a particular SSV cluster balance on per block basis (aggregates all expenses for all the validators in this cluster).\\ @@ -431,7 +429,7 @@ Return values ## Liquidator Methods -### **`isLiquidatable (owner, operatorIds, cluster)`** +### **`isLiquidatable(owner, operatorIds, cluster)`** Description: Returns true if the specified cluster is under the liquidation threshold and can be liquidated. @@ -447,7 +445,7 @@ Return values | ------------- | -------- | ------------------------------------------- | | isLiquidatable | boolean | Indication if a cluster could be liquidated | -### **`isLiquidated (owner, operatorIds, cluster)`** +### **`isLiquidated(owner, operatorIds, cluster)`** Description: Returns true if the provided cluster is liquidated. @@ -465,7 +463,7 @@ Return values ## Legacy Methods -### **`getBalanceSSV (owner, operatorIds, cluster)`** +### **`getBalanceSSV(owner, operatorIds, cluster)`** Description: Returns the outstanding SSV balance of a legacy (SSV-based) cluster. @@ -481,7 +479,7 @@ Return values: |-----------|------|-------------| | balance | uint256 | Clusters outstanding balance denominated in SSV | -### **`getBurnRateSSV (owner, operatorIds, cluster)`** +### **`getBurnRateSSV(owner, operatorIds, cluster)`** Description: Returns current ongoing expenses of SSV for a particular SSV cluster balance on per block basis (aggregates all expenses for all the validators in this cluster).\\ @@ -497,7 +495,7 @@ Return values | ------------- | -------- | --------------------------------------------------- | | burnRate | uint256 | The rate per block in which the account spends ETH. | -### **`getNetworkFeeSSV ()`** +### **`getNetworkFeeSSV()`** Description: Returns current network fee for legacy (SSV-based) clusters. @@ -507,7 +505,7 @@ Return values: |-----------|------|-------------| | fee | uint256 | The fee charged by the network (denominated as SSV per block) | -### **`getNetworkEarningsSSV ()`** +### **`getNetworkEarningsSSV()`** Description: Returns accumulated network fees not yet withdrawn from the legacy (SSV-based) clusters. @@ -517,7 +515,7 @@ Return values: |-----------|------|-------------| | amount | uint256 | Amount of fees accumulated in the network treasury | -### **`getLiquidationThresholdPeriodSSV ()`** +### **`getLiquidationThresholdPeriodSSV()`** Description: Returns the minimum duration (in blocks) which legacy cluster has to have sufficient balance (liquidation collateral) to not be liquidated. @@ -547,7 +545,7 @@ Return values | --------- | ------ | -------------------------------- | | maxFee | uint64 | The maximum fee value (SSV/year) | -### **`getOperatorByIdSSV (operatorId)`** +### **`getOperatorByIdSSV(operatorId)`** Description: Returns operator's data for operators participating in legacy clusters. @@ -566,7 +564,7 @@ Return values: | isPrivate | boolean | Indication if operator is permissioned | | active | boolean | Operator network status | -### **`getOperatorFeeSSV (operatorId)`** +### **`getOperatorFeeSSV(operatorId)`** Description: returns current operator's fee (not declared). @@ -580,7 +578,7 @@ Return values | ------------- | -------- | ---------------------------------------------------------------------- | | declaredFee | uint256 | The fee charged by the operator (denominated as SSV per block) | -### **getOperatorEarningsSSV (operatorId)** +### **`getOperatorEarningsSSV(operatorId)`** Description: Returns the outstanding earnings of an operator participating legacy cluster(s). @@ -594,7 +592,7 @@ Return values | ------------- | -------- | ---------------------------------------------- | | balance | uint256 | Operators outstanding earnings in SSV. | -### **`isLiquidatableSSV (owner, operatorIds, cluster)`** +### **`isLiquidatableSSV(owner, operatorIds, cluster)`** Description: Returns true if the specified legacy cluster is under the liquidation threshold and can be liquidated. From 6b27784fbb17105fc015d0b7b5170e830896cceb Mon Sep 17 00:00:00 2001 From: Alex Z Date: Tue, 24 Feb 2026 16:32:05 +0700 Subject: [PATCH 3/4] fixing typos --- .../SSV-SDK/module-reference/cluster-module.md | 14 +++++++------- .../tools/ssv-subgraph/subgraph-examples.md | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/developers/SSV-SDK/module-reference/cluster-module.md b/docs/developers/SSV-SDK/module-reference/cluster-module.md index a4dcde0..13f9a71 100644 --- a/docs/developers/SSV-SDK/module-reference/cluster-module.md +++ b/docs/developers/SSV-SDK/module-reference/cluster-module.md @@ -19,7 +19,7 @@ Converts an SSV-based cluster (legacy) to ETH-based cluster. Accepts cluster ID | Input parameter | Input type | Description | Example input | |----------------|------------|-------------|---------------| -| cluster_Id | string | A cluster_id in its computed ID form. Has to have the **owner address in lower case letters**. It is advised to use the [`createClusterID`](/developers/SSV-SDK/module-reference/api-module#getclusteridowner_address-operator_ids) function to get the cluster ID in the correct format | “0xf69a08b652f0cebb685c2ffe043cfb767b66544a-5-6-7-8” | +| cluster_Id | string | A cluster_id in its computed ID form. Has to have the **owner address in lowercase letters**. It is advised to use the [`createClusterID`](/developers/SSV-SDK/module-reference/api-module#getclusteridowner_address-operator_ids) function to get the cluster ID in the correct format | “0xf69a08b652f0cebb685c2ffe043cfb767b66544a-5-6-7-8” | | amount | bigint | Amount of ETH to deposit to fund the cluster | 0.1234 | #### Example: @@ -59,7 +59,7 @@ Executes the contract call to to deposit ETH to the cluster balance. | Input parameter | Input type | Description | Example input | |----------------|------------|-------------|---------------| -| id | string | A cluster id in its computed ID form. Has to have the **owner address in lower case letters**. It is advised to use the [`createClusterID`](/developers/SSV-SDK/module-reference/api-module#getclusteridowner_address-operator_ids) function to get the cluster ID in the correct format | “0xf69a08b652f0cebb685c2ffe043cfb767b66544a-5-6-7-8” | +| id | string | A cluster id in its computed ID form. Has to have the **owner address in lowercase letters**. It is advised to use the [`createClusterID`](/developers/SSV-SDK/module-reference/api-module#getclusteridowner_address-operator_ids) function to get the cluster ID in the correct format | “0xf69a08b652f0cebb685c2ffe043cfb767b66544a-5-6-7-8” | | amount | bigint | Amount of ETH to deposit to cluster | 0.1234 | #### Example: @@ -81,7 +81,7 @@ Liquidates a cluster sends their balance to the msg.sender (the Liquidator). **W | Input parameter | Input type | Description | Example input | |----------------|------------|-------------|---------------| -| id | string | A cluster id in its computed ID form. Has to have the **owner address in lower case letters**. It is advised to use the [`createClusterID`](/developers/SSV-SDK/module-reference/api-module#getclusteridowner_address-operator_ids) function to get the cluster ID in the correct format | “0xf69a08b652f0cebb685c2ffe043cfb767b66544a-5-6-7-8” | +| id | string | A cluster id in its computed ID form. Has to have the **owner address in lowercase letters**. It is advised to use the [`createClusterID`](/developers/SSV-SDK/module-reference/api-module#getclusteridowner_address-operator_ids) function to get the cluster ID in the correct format | “0xf69a08b652f0cebb685c2ffe043cfb767b66544a-5-6-7-8” | #### Example: @@ -99,7 +99,7 @@ Liquidates a legacy (SSV-based) cluster sends their balance to the msg.sender (t | Input parameter | Input type | Description | Example input | |----------------|------------|-------------|---------------| -| id | string | A cluster id in its computed ID form. Has to have the **owner address in lower case letters**. It is advised to use the [`createClusterID`](/developers/SSV-SDK/module-reference/api-module#getclusteridowner_address-operator_ids) function to get the cluster ID in the correct format | “0xf69a08b652f0cebb685c2ffe043cfb767b66544a-5-6-7-8” | +| id | string | A cluster id in its computed ID form. Has to have the **owner address in lowercase letters**. It is advised to use the [`createClusterID`](/developers/SSV-SDK/module-reference/api-module#getclusteridowner_address-operator_ids) function to get the cluster ID in the correct format | “0xf69a08b652f0cebb685c2ffe043cfb767b66544a-5-6-7-8” | #### Example: @@ -122,7 +122,7 @@ Withdraw a specified amount of ETH from a cluster. | Input parameter | Input type | Description | Example input | |----------------|------------|-------------|---------------| -| id | string | A cluster id in its computed ID form. Has to have the **owner address in lower case letters**. It is advised to use the [`createClusterID`](/developers/SSV-SDK/module-reference/api-module#getclusteridowner_address-operator_ids) function to get the cluster ID in the correct format | “0xf69a08b652f0cebb685c2ffe043cfb767b66544a-5-6-7-8” | +| id | string | A cluster id in its computed ID form. Has to have the **owner address in lowercase letters**. It is advised to use the [`createClusterID`](/developers/SSV-SDK/module-reference/api-module#getclusteridowner_address-operator_ids) function to get the cluster ID in the correct format | “0xf69a08b652f0cebb685c2ffe043cfb767b66544a-5-6-7-8” | | amount | bigint | Amount of ETH to withdraw from the cluster | 0.1234 | #### Example: @@ -148,7 +148,7 @@ Reactivates a liquidated cluster. | Input parameter | Input type | Description | Example input | |----------------|------------|-------------|---------------| -| id | string | A cluster id in its computed ID form. Has to have the **owner address in lower case letters**. It is advised to use the [`createClusterID`](/developers/SSV-SDK/module-reference/api-module#getclusteridowner_address-operator_ids) function to get the cluster ID in the correct format | “0xf69a08b652f0cebb685c2ffe043cfb767b66544a-5-6-7-8” | +| id | string | A cluster id in its computed ID form. Has to have the **owner address in lowercase letters**. It is advised to use the [`createClusterID`](/developers/SSV-SDK/module-reference/api-module#getclusteridowner_address-operator_ids) function to get the cluster ID in the correct format | “0xf69a08b652f0cebb685c2ffe043cfb767b66544a-5-6-7-8” | | amount | bigint | Amount of ETH to deposit to cluster | 0.1234 | #### Example: @@ -174,7 +174,7 @@ Accepts all parameters necessary to remove the validators. Removes all the valid | Input parameter | Input type | Description | Example input | |----------------|------------|-------------|---------------| -| id | string | A cluster id in its computed ID form. Has to have the **owner address in lower case letters**. It is advised to use the [`createClusterID`](/developers/SSV-SDK/module-reference/api-module#getclusteridowner_address-operator_ids) function to get the cluster ID in the correct format | “0xf69a08b652f0cebb685c2ffe043cfb767b66544a-5-6-7-8” | +| id | string | A cluster id in its computed ID form. Has to have the **owner address in lowercase letters**. It is advised to use the [`createClusterID`](/developers/SSV-SDK/module-reference/api-module#getclusteridowner_address-operator_ids) function to get the cluster ID in the correct format | “0xf69a08b652f0cebb685c2ffe043cfb767b66544a-5-6-7-8” | | publicKeys | Hex[] | Array of validator public keys to remove | ["0x820fd0519c75f74c8be9f21f185406919721dad0c624464538e2eaa323d77d3eb3ef27a039e8779de6cfa649a5484e86", "0x820fd0519c75f74c8be9f21f185406919721dad0c624464538e2eaa323d77d3eb3ef27a039e8779de6cfa649a5484e87"] | #### Example: diff --git a/docs/developers/tools/ssv-subgraph/subgraph-examples.md b/docs/developers/tools/ssv-subgraph/subgraph-examples.md index 31c83e5..d019f14 100644 --- a/docs/developers/tools/ssv-subgraph/subgraph-examples.md +++ b/docs/developers/tools/ssv-subgraph/subgraph-examples.md @@ -299,7 +299,7 @@ query clusterBalanceValues { number } } - daovalues(id: " 0x58410Bef803ECd7E63B23664C586A6DB72DAf59c") { + daovalues(id: "0x58410Bef803ECd7E63B23664C586A6DB72DAf59c") { networkFee networkFeeIndex networkFeeIndexBlockNumber @@ -330,7 +330,7 @@ query clusterBalanceValues { number } } - daovalues(id: " 0x58410Bef803ECd7E63B23664C586A6DB72DAf59c") { + daovalues(id: "0x58410Bef803ECd7E63B23664C586A6DB72DAf59c") { networkFee networkFeeIndex networkFeeIndexBlockNumber From f1d8fee7ecd3f4841f3d8c90a092fb7c0b84debd Mon Sep 17 00:00:00 2001 From: Alex Z Date: Tue, 24 Feb 2026 16:33:24 +0700 Subject: [PATCH 4/4] lowercase fix --- docs/developers/SSV-SDK/module-reference/utils-module.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/developers/SSV-SDK/module-reference/utils-module.md b/docs/developers/SSV-SDK/module-reference/utils-module.md index dc89d74..befa083 100644 --- a/docs/developers/SSV-SDK/module-reference/utils-module.md +++ b/docs/developers/SSV-SDK/module-reference/utils-module.md @@ -177,7 +177,7 @@ Accepts a cluster ID to identify the cluster, for which the balance needs to be | Input parameter | Input type | Description | Example input | |----------------|------------|-------------|---------------| -| cluster_Id | string | A cluster_id in its computed ID form. Has to have the **owner address in lower case letters**. It is advised to use the [`createClusterID`](/developers/SSV-SDK/module-reference/api-module#getclusteridowner_address-operator_ids) function to get the cluster ID in the correct format | “0xf69a08b652f0cebb685c2ffe043cfb767b66544a-5-6-7-8” | +| cluster_Id | string | A cluster_id in its computed ID form. Has to have the **owner address in lowercase letters**. It is advised to use the [`createClusterID`](/developers/SSV-SDK/module-reference/api-module#getclusteridowner_address-operator_ids) function to get the cluster ID in the correct format | “0xf69a08b652f0cebb685c2ffe043cfb767b66544a-5-6-7-8” | #### Example: @@ -202,7 +202,7 @@ The function fetches the cluster snapshot using the provided ID, calculate the B | Input parameter | Input type | Description | Example input | |----------------|------------|-------------|---------------| -| cluster_Id | string | A cluster_id in its computed ID form. Has to have the **owner address in lower case letters**. It is advised to use the [`createClusterID`](/developers/SSV-SDK/module-reference/api-module#getclusteridowner_address-operator_ids) function to get the cluster ID in the correct format | “0xf69a08b652f0cebb685c2ffe043cfb767b66544a-5-6-7-8” | +| cluster_Id | string | A cluster_id in its computed ID form. Has to have the **owner address in lowercase letters**. It is advised to use the [`createClusterID`](/developers/SSV-SDK/module-reference/api-module#getclusteridowner_address-operator_ids) function to get the cluster ID in the correct format | “0xf69a08b652f0cebb685c2ffe043cfb767b66544a-5-6-7-8” | | runway | number | Desired Runway length, measured in number of days. | 45 |