Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
403 changes: 382 additions & 21 deletions docs/developers/README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/developers/SSV-SDK/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Development Notice: This SDK is currently under active development and testing.
This section and SDK are a work in progress and will be continuously updated as new components of the SDK are released.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need this warning?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RaekwonIII could you please help

:::

The SSV SDK is a comprehensive, open-source developer toolkit written in TypeScript, designed to empower developers to seamlessly interact with the SSV Network programmatically. 
The SSV SDK is a comprehensive, open-source developer toolkit written in TypeScript, designed to empower developers to seamlessly interact with the SSV Network programmatically.

It consolidates all necessary tooling into a single, cohesive package.

Expand Down
2 changes: 1 addition & 1 deletion docs/developers/SSV-SDK/examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ sidebar_position: 2

# Examples

In this examples section we will provide quick snippets of code to do certain actions, we will not show the imports/setup for each as this is covered previously. 
In this examples section we will provide quick snippets of code to do certain actions, we will not show the imports/setup for each as this is covered previously.

Each example will also be available in an executable typescript file found in the SDK repo.
4 changes: 2 additions & 2 deletions docs/developers/SSV-SDK/examples/api-calls.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ sidebar_position: 2

# API calls

This page will show how to use the API module to do various calls. The API module is used to get data such as the Account Nonce, or Cluster Snapshot, both are covered on this page. 
This page will show how to use the API module to do various calls. The API module is used to get data such as the Account Nonce, or Cluster Snapshot, both are covered on this page.

For the full list of functions you can check the [API Module Reference](../module-reference/api-module.md).

### Get Nonce 
### Get Nonce

``` typescript
const ownerNonce = await sdk.api.getOwnerNonce({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sidebar_position: 3

# Create Validator Keys

The SSV SDK does not natively support programmatically generating keystores out of the box, but a number of external libraries can be used to achieve this. 
The SSV SDK does not natively support programmatically generating keystores out of the box, but a number of external libraries can be used to achieve this.

If you do not need to do this programmatically, it may be easier to use the [Ethereum Staking Deposit CLI](https://github.com/ethereum/staking-deposit-cli) to generate validator keys. To generate Hoodi validator keys you can use [eth-educators' Staking Deposit CLI fork](https://github.com/eth-educators/ethstaker-deposit-cli).

Expand Down
2 changes: 1 addition & 1 deletion docs/developers/SSV-SDK/examples/register-validator.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sidebar_position: 5

# Register Validator

This page shows how to progmatically register a validator to the SSV network. Assuming you already have generated a valid keyshare. 
This page shows how to progmatically register a validator to the SSV network. Assuming you already have generated a valid keyshare.

### Register Validator

Expand Down
43 changes: 12 additions & 31 deletions docs/developers/SSV-SDK/module-reference/api-module.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@ sdk.api.getOwnerNonce()

Accepts a list of addresses, fetches their nonces using subgraph, returns as a list.

Input parameters:

<table data-header-hidden><thead><tr><th></th><th width="139"></th><th></th><th></th></tr></thead><tbody><tr><td>Input parameter</td><td>Input type</td><td>Description</td><td>Example input</td></tr><tr><td>account_address</td><td>string</td><td>An array of owner addresses.</td><td>[“0xA4831B989972605A62141a667578d742927Cbef9”]</td></tr></tbody></table>

Examples input:
#### Example:

```typescript
const ownerAddress = "0xA4831B989972605A62141a667578d742927Cbef9"
Expand All @@ -35,11 +33,9 @@ Example output:

Accepts a list of addresses, fetches cluster snapshots using subgraph, returns as a list.

Input:

<table data-header-hidden><thead><tr><th></th><th width="116"></th><th></th><th></th></tr></thead><tbody><tr><td>Input parameter</td><td>Input type</td><td>Description</td><td>Example input</td></tr><tr><td>cluster_id</td><td>string</td><td>An array of cluster IDs in their computed ID form.</td><td>[“4c0239091131c3e57e9555c540bcfd00bcd2484a9c4048f13411f22329511131”]</td></tr></tbody></table>

Example:
#### Example:

```typescript
const clusterSnapshot = await sdk.api.getClusterSnapshot({id: clusterID})
Expand All @@ -61,14 +57,13 @@ Example output:

Accepts the owner address and a list of operator IDs, computes and returns the cluster ID hash.

Input:

| Input parameter | Input type | Description | Example input |
| ----------------- | ---------- | ----------------------------- | -------------------------------------------- |
| owner\_address | string | Address of the cluster Owner. | '0x81592c3de184a3e2c0dcb5a261bc107bfa91f494' |
| operator\_ids\[] | integer | List of operator IDs. | \[12, 34, 56, 78] |

Example:
#### Example:

```typescript
import { createClusterId } from '@ssv-labs/ssv-sdk/utils'
Expand All @@ -77,7 +72,7 @@ const operatorIds = [242, 686, 707, 736]
const clusterID = createClusterId(ownerAddress, operatorIds)
```

Example output:&#x20;
Example output:

```bash
1179fed483c8c1b0327c8667521162015fa8cbe1a1b047a26baf0f0971a81929
Expand All @@ -87,11 +82,9 @@ Example output:&#x20;

Accepts a cluster id in it's hashed form. Returns details about the cluster.

Input:

<table data-header-hidden><thead><tr><th></th><th width="116"></th><th></th><th></th></tr></thead><tbody><tr><td>Input parameter</td><td>Input type</td><td>Description</td><td>Example input</td></tr><tr><td>cluster_id</td><td>string</td><td>A cluster ID in it's computed form</td><td>“4c0239091131c3e57e9555c540bcfd00bcd2484a9c4048f13411f22329511131”</td></tr><tr><td>daoAddress</td><td>string</td><td>Address of the DAO (chain specific)</td><td>"0x38A4794cCEd47d3baf7370CcC43B560D3a1beEFA"</td></tr><tr><td>operatorIds</td><td>string[]</td><td>A list of operator Ids</td><td>[1,2,3,4]</td></tr></tbody></table>

Example:
#### Example:

```typescript
const ownerAddress = "0xA4831B989972605A62141a667578d742927Cbef9"
Expand All @@ -116,11 +109,9 @@ Example output:

Accepts a cluster id in it's hashed form. Returns details about the cluster.

Input:

<table data-header-hidden><thead><tr><th></th><th width="116"></th><th></th><th></th></tr></thead><tbody><tr><td>Input parameter</td><td>Input type</td><td>Description</td><td>Example input</td></tr><tr><td>cluster_id</td><td>string</td><td>An array of cluster IDs in their computed ID form.</td><td>[“4c0239091131c3e57e9555c540bcfd00bcd2484a9c4048f13411f22329511131”]</td></tr></tbody></table>

Example:
#### Example:

```typescript
const clusterData = await sdk.api.getCluster({id: clusterID})
Expand All @@ -141,13 +132,11 @@ Example output:

### `getClusters(owner)`

Accepts an owner address. Returns details about all of the clusters that they own.&#x20;

Input:
Accepts an owner address. Returns details about all of the clusters that they own.

<table data-header-hidden><thead><tr><th></th><th width="116"></th><th></th><th></th></tr></thead><tbody><tr><td>Input parameter</td><td>Input type</td><td>Description</td><td>Example input</td></tr><tr><td>owner</td><td>string</td><td>An owner address</td><td>"0xA4831B989972605A62141a667578d742927Cbef9"</td></tr></tbody></table>

Example:
#### Example:

```typescript
const ownerAddress = "0xA4831B989972605A62141a667578d742927Cbef9"
Expand Down Expand Up @@ -183,11 +172,9 @@ Example output:

Accepts an operator ID and returns details about the operator.

Input:

<table data-header-hidden><thead><tr><th></th><th width="116"></th><th></th><th></th></tr></thead><tbody><tr><td>Input parameter</td><td>Input type</td><td>Description</td><td>Example input</td></tr><tr><td>id</td><td>string</td><td>A single operator ID</td><td>"4"</td></tr></tbody></table>

Example:
#### Example:

```typescript
const operatorData = await sdk.api.getOperator({id: "4"})
Expand All @@ -210,11 +197,9 @@ Example output:

Accepts a list of operator IDs and returns details about them.

Input:

<table data-header-hidden><thead><tr><th></th><th width="116"></th><th></th><th></th></tr></thead><tbody><tr><td>Input parameter</td><td>Input type</td><td>Description</td><td>Example input</td></tr><tr><td>operatorIds</td><td>string[]</td><td>A single operator ID</td><td>["4","5"]</td></tr></tbody></table>

Example:
#### Example:

```typescript
const operatorData = await sdk.api.getOperators({operatorIds: ["4","5"]})
Expand Down Expand Up @@ -247,11 +232,9 @@ Example output:

Accepts a validator ID and returns details about the validator.

Input:

<table data-header-hidden><thead><tr><th></th><th width="116"></th><th></th><th></th></tr></thead><tbody><tr><td>Input parameter</td><td>Input type</td><td>Description</td><td>Example input</td></tr><tr><td>id</td><td>string</td><td>A single validator ID</td><td>0x0c74493afd8082f86485e4172be72678b0feb1494087ee6abe7d7ea7437c2a3fc6c06193040c6e24cdf59c9081d1c7a9</td></tr></tbody></table>

Example:
#### Example:

```typescript
const validatorData = await sdk.api.getValidators({id: "0x0c74493afd8082f86485e4172be72678b0feb1494087ee6abe7d7ea7437c2a3fc6c06193040c6e24cdf59c9081d1c7a9"})
Expand All @@ -269,11 +252,9 @@ Example output:

Accepts an validator ID and returns details about the validator.

Input:

<table data-header-hidden><thead><tr><th></th><th width="116"></th><th></th><th></th></tr></thead><tbody><tr><td>Input parameter</td><td>Input type</td><td>Description</td><td>Example input</td></tr><tr><td>ids</td><td>string[]</td><td>An array of validator IDs</td><td>["0x0c74493afd8082f86485e4172be72678b0feb1494087ee6abe7d7ea7437c2a3fc6c06193040c6e24cdf59c9081d1c7a9", "0x1a85052f3b9d17e73ec76c472220c80ada65a19a0fd177344b1e9f6173d51136c400120989dbd9ff498defc99dfe5181"]</td></tr></tbody></table>

Example:
#### Example:

```typescript
const validatorData = await sdk.api.getValidators({id: ["0x0c74493afd8082f86485e4172be72678b0feb1494087ee6abe7d7ea7437c2a3fc6c06193040c6e24cdf59c9081d1c7a9", "0x1a85052f3b9d17e73ec76c472220c80ada65a19a0fd177344b1e9f6173d51136c400120989dbd9ff498defc99dfe5181"]})
Expand Down
Loading