You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/developers/SSV-SDK/README.md
+19-10Lines changed: 19 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,6 +25,13 @@ To install the SDK, run:
25
25
npm i @ssv-labs/ssv-sdk
26
26
```
27
27
28
+
:::info ⚠️ Testnet Version ⚠️
29
+
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:
30
+
```bash
31
+
npm i --force --ignore-scripts github:ssvlabs/ssv-sdk#v.1.0.0
32
+
```
33
+
:::
34
+
28
35
## Initialization
29
36
30
37
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.
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.
66
-
For more information regarding your subgraph API key, please refer to the [dedicated Subgraph page](../tools/ssv-subgraph/README.md).
73
+
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).
67
74
68
75
### Initialization Parameters
69
76
70
77
| Input name | Input type | Optional |
71
78
|------------|------------|----------|
72
-
| public_client |[Viem public client](https://viem.sh/docs/clients/public.html)| No |
79
+
| public_client |[Viem public client](https://viem.sh/docs/clients/public)| No |
73
80
| wallet_client |[Viem wallet client](https://viem.sh/docs/clients/wallet)| No |
81
+
| SUBGRAPH_API | API Key retrived from [The Graph account](https://thegraph.com/studio/apikeys/)| Yes, strongly recommended |
82
+
| SUBGRAPH_ENDPOINT | Subgraph Endpoint retrieved from [Mainnet or Testnet subgraph page](/developers/tools/ssv-subgraph/#querying-ssv-protocol-smart-contract-data)| Yes, strongly recommended |
|`cluster_Id`| string | A `cluster_id` in its computed ID form. | 0xf69A08B652f0CEBb685c2fFE043cfB767b66544A-5-6-7-8 |
22
+
| 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”|
23
23
| amount | bigint | Amount of ETH to deposit to fund the cluster | 0.1234 |
| id | string |Cluster ID | 0xf69A08B652f0CEBb685c2fFE043cfB767b66544A-5-6-7-8 |
62
+
| 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”|
63
63
| amount | bigint | Amount of ETH to deposit to cluster | 0.1234 |
64
64
65
65
#### Example:
@@ -69,7 +69,7 @@ import { parseEther } from 'viem'
| id | string |Cluster ID | 0xf69A08B652f0CEBb685c2fFE043cfB767b66544A-5-6-7-8 |
84
+
| 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 |Cluster ID | 0xf69A08B652f0CEBb685c2fFE043cfB767b66544A-5-6-7-8 |
102
+
| 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 |Cluster ID | 0xf69A08B652f0CEBb685c2fFE043cfB767b66544A-5-6-7-8 |
125
+
| 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”|
126
126
| amount | bigint | Amount of ETH to withdraw from the cluster | 0.1234 |
127
127
128
128
#### Example:
@@ -132,7 +132,7 @@ import { parseEther } from 'viem'
| id | string |Cluster ID | 0xf69A08B652f0CEBb685c2fFE043cfB767b66544A-5-6-7-8 |
151
+
| 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”|
152
152
| amount | bigint | Amount of ETH to deposit to cluster | 0.1234 |
153
153
154
154
#### Example:
@@ -158,7 +158,7 @@ import { parseEther } from 'viem'
| id | string |Cluster ID | 0xf69A08B652f0CEBb685c2fFE043cfB767b66544A-5-6-7-8 |
177
+
| 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”|
178
178
| publicKeys | Hex[]| Array of validator public keys to remove |["0x820fd0519c75f74c8be9f21f185406919721dad0c624464538e2eaa323d77d3eb3ef27a039e8779de6cfa649a5484e86", "0x820fd0519c75f74c8be9f21f185406919721dad0c624464538e2eaa323d77d3eb3ef27a039e8779de6cfa649a5484e87"]|
| cluster_Id | string | A cluster_id in its computed ID form. | “0xf69A08B652f0CEBb685c2fFE043cfB767b66544A-5-6-7-8” |
180
+
| 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” |
181
181
182
182
#### Example:
183
183
184
184
```typescript
185
-
const result =awaitsdk.utils.getClusterBalance(“0xf69A08B652f0CEBb685c2fFE043cfB767b66544A-5-6-7-8”)
185
+
const result =awaitsdk.utils.getClusterBalance(“0xf69a08b652f0cebb685c2ffe043cfb767b66544a-5-6-7-8”)
186
186
```
187
187
188
188
Example output:
@@ -202,15 +202,15 @@ The function fetches the cluster snapshot using the provided ID, calculate the B
202
202
203
203
| Input parameter | Input type | Description | Example input |
| cluster_Id | string | A cluster_id in its computed ID form. | “0xf69A08B652f0CEBb685c2fFE043cfB767b66544A-5-6-7-8” |
205
+
| 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” |
206
206
| runway | number | Desired Runway length, measured in number of days. | 45 |
207
207
208
208
209
209
#### Example:
210
210
211
211
```typescript
212
212
const result =awaitsdk.utils.calcDepositFromRunway({
0 commit comments