API Module
This is a read only library which contains all the functions you need to obtain any data relating to the SSV network.
After instantiating the SDK, you can call any of the functions in the utils library like so:
Function List
getOwnerNonce(string account_address)
getOwnerNonce(string account_address)
Accepts a list of addresses, fetches their nonces using subgraph, returns as a list.
Input parameters:
Input parameter
Input type
Description
Example input
account_address
string
An array of owner addresses.
[“0xA4831B989972605A62141a667578d742927Cbef9”]
Examples input:
Example output:
getClusterSnapshot(string cluster_id )
getClusterSnapshot(string cluster_id )
Accepts a list of addresses, fetches cluster snapshots using subgraph, returns as a list.
Input:
Input parameter
Input type
Description
Example input
cluster_id
string
An array of cluster IDs in their computed ID form.
[“4c0239091131c3e57e9555c540bcfd00bcd2484a9c4048f13411f22329511131”]
Example:
Example output:
getClusterId(owner_address, operator_ids[])
getClusterId(owner_address, operator_ids[])
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 output:
getClusterBalance(clusterId, daoAddress, operatorIds)
getClusterBalance(clusterId, daoAddress, operatorIds)
Accepts a cluster id in it's hashed form. Returns details about the cluster.
Input:
Input parameter
Input type
Description
Example input
cluster_id
string
A cluster ID in it's computed form
“4c0239091131c3e57e9555c540bcfd00bcd2484a9c4048f13411f22329511131”
daoAddress
string
Address of the DAO (chain specific)
"0x38A4794cCEd47d3baf7370CcC43B560D3a1beEFA"
operatorIds
string[]
A list of operator Ids
[1,2,3,4]
Example:
Example output:
getCluster(id)
getCluster(id)
Accepts a cluster id in it's hashed form. Returns details about the cluster.
Input:
Input parameter
Input type
Description
Example input
cluster_id
string
An array of cluster IDs in their computed ID form.
[“4c0239091131c3e57e9555c540bcfd00bcd2484a9c4048f13411f22329511131”]
Example:
Example output:
getClusters(owner)
getClusters(owner)
Accepts an owner address. Returns details about all of the clusters that they own.
Input:
Input parameter
Input type
Description
Example input
owner
string
An owner address
"0xA4831B989972605A62141a667578d742927Cbef9"
Example:
Example output:
getOperator(id)
getOperator(id)
Accepts an operator ID and returns details about the operator.
Input:
Input parameter
Input type
Description
Example input
id
string
A single operator ID
"4"
Example:
Example output:
getOperators(
operatorIds[])
getOperators(
operatorIds[])
Accepts a list of operator IDs and returns details about them.
Input:
Input parameter
Input type
Description
Example input
operatorIds
string[]
A single operator ID
["4","5"]
Example:
Example output:
getValidator(id)
getValidator(id)
Accepts a validator ID and returns details about the validator.
Input:
Input parameter
Input type
Description
Example input
id
string
A single validator ID
0x0c74493afd8082f86485e4172be72678b0feb1494087ee6abe7d7ea7437c2a3fc6c06193040c6e24cdf59c9081d1c7a9
Example:
Example output:
getValidators(ids[])
getValidators(ids[])
Accepts an validator ID and returns details about the validator.
Input:
Input parameter
Input type
Description
Example input
ids
string[]
An array of validator IDs
["0x0c74493afd8082f86485e4172be72678b0feb1494087ee6abe7d7ea7437c2a3fc6c06193040c6e24cdf59c9081d1c7a9", "0x1a85052f3b9d17e73ec76c472220c80ada65a19a0fd177344b1e9f6173d51136c400120989dbd9ff498defc99dfe5181"]
Example:
Example output:
Last updated