Cluster Module
This is a library which contains all the cluster functions you need for working with SSV, such as registering a validator
After instantiating the SDK, you can call any of the functions in the utils library like so:
Function List
registerValidators()
registerValidators()
Accepts all parameters necessary to compute the keyshares, does this in the background using ssv-keys library, returns the keyshares as an object or saves it to file.
Input:
Input parameter
Input type
Description
Example input
keyshares
KeySharesItem[] | KeySharesPayload[]
Keyshare or transaction payload
depositAmount
bigint
Amount of SSV to deposit to cluster
4
Example:
deposit()
deposit()
Executes the contract call to the SSV smart contract to deposit SSV to the cluster.
Input:
Input parameter
Input type
Description
Example input
id
string
Cluster ID
ee8881d3c979203025996773ef8a13cb4aac57076e22638dd6ed9b17adcdabfc
amount
bigint
Amount of SSV to deposit to cluster
4
approve
bool
Whether to execute out the SSV ERC20 approve transaction or not.
true
Example:
liquidateCluster()
liquidateCluster()
Liquidates a cluster sends their balances to the msg.sender (the Liquidator), will fail if the cluster is not liquidatable.
Input:
Input parameter
Input type
Description
Example input
id
string
Cluster ID
ee8881d3c979203025996773ef8a13cb4aac57076e22638dd6ed9b17adcdabfc
Example:
withdraw()
withdraw()
Withdraw a specified amount of SSV from a cluster.
Input:
Input parameter
Input type
Description
Example input
id
string
Cluster ID
ee8881d3c979203025996773ef8a13cb4aac57076e22638dd6ed9b17adcdabfc
amount
bigint
Amount of SSV to withdraw to cluster
4
Example:
reactivateCluster()
reactivateCluster()
Reactivates a liquidated cluster, will fail if insufficient SSV tokens to cover the cluster’s liquidation collateral have been deposited.
Input:
Input parameter
Input type
Description
Example input
id
string
Cluster ID
ee8881d3c979203025996773ef8a13cb4aac57076e22638dd6ed9b17adcdabfc
amount
bigint
Amount of SSV to withdraw to cluster
4
Example input:
removeValidators()
removeValidators()
Accepts all parameters necessary to compute the keyshares, does this in the background using ssv-keys library, returns the keyshares as an object or saves it to file.
Input:
Input parameter
Input type
Description
Example input
id
string
Cluster ID
ee8881d3c979203025996773ef8a13cb4aac57076e22638dd6ed9b17adcdabfc
publicKeys
Hex[]
Array of validator public keys to remove.
["0x820fd0519c75f74c8be9f21f185406919721dad0c624464538e2eaa323d77d3eb3ef27a039e8779de6cfa649a5484e86", "0x820fd0519c75f74c8be9f21f185406919721dad0c624464538e2eaa323d77d3eb3ef27a039e8779de6cfa649a5484e87"]
Example:
setFeeRecipient()
setFeeRecipient()
Sets a fee recipient address to receive tips from user transactions (part block proposal rewards). This address will be set for all the account’s validators (all clusters).
Input:
Input parameter
Input type
Description
Example input
recipient
Address
Valid Ethereum address
0xA4831B989972605A62141a667578d742927Cbef9
Example:
exitValidators()
exitValidators()
Prompts SSV nodes to sign a voluntary exit of the validator.
Input:
Input parameter
Input type
Description
Example input
publicKeys
Hex[]
Public keys of the validators to be exited
["0xA4831B989972605A62141a667578d742927Cbef9","0xA4831B989972605A62141a667578d742927Cbef8"]
operatorIds
bigint[]
IDs of the operators.
[1,2,3,4]
Example input:
validateSharesPostRegistration()
validateSharesPostRegistration()
Accepts a transaction hash of the validator registration contract call.
Input:
Input parameter
Input type
Description
Example input
txHash
Hex
Hash of the register validator transaction.
"0xd9095893dba18b101c01973069922db2d81c45e814003851ccc586d60ae28e5b"
Example input:
Example output:
Last updated