Skip to content

Releases: stakewise/v3-sdk

2.0.0

25 Jul 10:41
b5c6dd5
Compare
Choose a tag to compare
  • Update eslint -> 8.56.0
  • Update node version -> 20.12.2
  • Update Backend GraphQ url -> "https://holesky-api.stakewise.io/graphql"
  • Add removeOldFiles helper. The removeOldFiles function deletes all files with the extension .graphql.ts in subdirectories of the specified directory, if there is no corresponding file with the extension .graphql.
    If the directory does not contain any .graphql files, it is deleted along with all its contents.
  • Refactor multicall contracts. Implement new commonMulticall, vaultMulticall, eigenPodOwnerMulticall, rewardSplitterMulticall.
  • Implement new logic for encode & estimateGas to all transaction methods
  • Add new check access utils methods: checkAdminAccess | checkBlocklistManagerAccess | checkDepositDataManagerAccess | checkRestakeOperatorsManagerAccess | checkWhitelisterAccess, to more thoroughly verify access for vault transactions

Updates

sdk.vault.getExitQueuePositions

Returns:

type Output = {
  ...oldOutput,
  duration: number | null
}
Name Description
duration Total queue duration time (in seconds).
- It represents the approximate time after which the assets can be collected (in seconds).
- If the value is null, the time is still being calculated.
- If the value is 0, the assets are available and can be collected. (New*)

sdk.vault.getVault

Returns:

type Output = {
  ...oldOutput,
  version: number
  isRestake: boolean
  whitelistManager: string
  depositDataManager: string
  restakeOperatorsManager: string
  restakeWithdrawalsManager: string
}
Name Description Status
whitelister - Deprecated!
vaultKeysManager - Deprecated!
version Vault version (1 or 2) New
isRestake Indicates whether the Vault is a restaking vault New
whitelistManager Whitelist New
depositDataManager Keys New
restakeOperatorsManager If the Vault is a restaking vault, restake operators manager can add/remove restake operators New
restakeWithdrawalsManager If the Vault is a restaking vault, restake withdrawals manager can manage EigenLayer withdrawals New

sdk.vault.getMaxWithdraw

New arguments:

Name Type Required Info
vaultAddress bigint Yes Address of vault

sdk.vault.updateWhitelist Deprecated!

Description:

Use sdk.vault.operate instead


sdk.vault.updateBlocklist Deprecated!

Description:

Use sdk.vault.operate instead



osToken

sdk.osToken.getBurnAmount

New arguments:

Name Type Required Info
vaultAddress string Yes Address of vault

sdk.osToken.getMaxMint

New arguments:

Name Type Required Info
vaultAddress string Yes Address of vault

sdk.osToken.getBaseData Deprecated!

Description:

Use osToken.getConfig and osToken.getRate


New

Vault

sdk.vault.getRewardSplitters

Fetch the list of created reward splitters. A reward splitter is a contract designed to distribute vault rewards among multiple fee recipients in predefined proportions.
To use a reward splitter, its address should be added to the vault as a fee recipient.

Arguments:

Name Type Type Description
vaultAddress string Yes The address of the vault
owner string Yes The owner of the reward splitter
rewardSplitterAddress string No The address of the reward splitter (optional)

Returns:

type FeeRecipient = {
  shares: bigint
  percent: number
  address: string
}

type RewardSplitter = {
  owner: string
  address: string
  totalShares: bigint
  feeRecipients: FeeRecipient[]
}

type Output = {
  rewardSplitters: RewardSplitter[]
}
Name Description
rewardSplitters An array of objects representing the result of the query based on your parameters

sdk.vault.getEigenPods

Returns eigen pods for restake vault.

Arguments:

Name Type Required Description
vaultAddress string Yes The address of the vault
limit number No Limits the number of eigen pods returned. Defaults to 100
skip number No Skips the specified number of eigen pods. Defaults to 0

Returns:

type Output = {
  link: string
  owner: string
  operator: string
  restaked: string
  createdAt: number
  podAddress: string
}
Name Description
createdAt Date of Creation
link Link to beaconchain
operator The eigenPod's operator
podAddress The eigenPod's address
restaked EgenPod's restaked (in ETH)
owner The address of the eigen pod owner

sdk.vault.setDepositDataRoot

Description:

Adding root validators to vaults version 2 or higher

Arguments:

Name Type Required Description
validatorsRoot string Yes The vault validators merkle tree
userAddress string Yes -
vaultAddress string Yes -

Example:

const params = {
  validatorsRoot: 'hash',
  vaultAddress: '0x...',
  userAddress: '0x...',
}

// Send transaction
const hash = await sdk.vault.setDepositDataRoot(params)
// When you sign transactions on the backend (for custodians)
const { data, to } = await sdk.vault.setDepositDataRoot.encode(params)
// Get an approximate gas per transaction
const gas = await sdk.vault.setDepositDataRoot.estimateGas(params)

sdk.vault.setDepositDataManager

Description:

Adding deposit data manager to vaults version 2 or higher

Arguments:

Name Type Required Description
managerAddress string Yes New deposit-data manager
userAddress string Yes -
vaultAddress string Yes -

Example:

const params = {
  managerAddress: '0x...',
  vaultAddress: '0x...',
  userAddress: '0x...',
}

// Send transaction
const hash = await sdk.vault.setDepositDataManager(params)
// When you sign transactions on the backend (for custodians)
const { data, to } = await sdk.vault.setDepositDataManager.encode(params)
// Get an approximate gas per transaction
const gas = await sdk.vault.setDepositDataManager.estimateGas(params)

sdk.vault.createEigenPod

Description:

Adding eigen pod to the vault. Only for restake vaults and only restake operators manager can perform this action.

Arguments:

Name Type Required Description
userAddress string Yes The address of the user making the request
vaultAddress string Yes The address of the vault

Example:

const params = {
  vaultAddress: '0x...',
  userAddress: '0x...',
}

// Send transaction
const hash = await sdk.vault.createEigenPod(params)
// When you sign transactions on the backend (for custodians)
const { data, to } = await sdk.vault.createEigenPod.encode(params)
// Get an approximate gas per transaction
const gas = await sdk.vault.createEigenPod.estimateGas(params)

sdk.vault.setEigenPodOperator

Description:

Adding operator to the current eigen pod. This action is specific to restake vaults and can only be executed by the restake operators manager.

Arguments:

Name Type Required Description
userAddress string Yes The address of the user making the request
vaultAddress string Yes The address of the vault
ownerAddress string Yes The address of the eigen pod owner
operatorAddress string Yes New operator for current eigen pods

Example:

const params = {
  operatorAddress: '0x...',
}

// Send transaction
const hash = await sdk.vault.setEigenPodOperator(params)
// When you sign transactions on the backend (for custodians)
const { data, to } = await sdk.vault.setEigenPodOperator.encode(params)
// Get an approximate gas per transaction
const gas = await sdk.vault.setEigenPodOperator.estimateGas(params)

sdk.vault.updateEigenPodOperator

Description:

Update operator to the...

Read more

1.3.1

28 May 12:52
1d2bf8c
Compare
Choose a tag to compare

What's Changed

Full Changelog: 1.3.0...1.3.1

1.3.0

01 Apr 08:39
bbaee6c
Compare
Choose a tag to compare

What's Changed

Full Changelog: 1.2.0...1.3.0

1.2.0

29 Feb 17:43
b33b21a
Compare
Choose a tag to compare

What's Changed

Full Changelog: 1.1.0...1.2.0

1.1.0

20 Feb 11:32
f663947
Compare
Choose a tag to compare

What's Changed

Full Changelog: 1.0.10...1.1.0

1.0.10

14 Feb 11:11
568fa2b
Compare
Choose a tag to compare

What's Changed

Full Changelog: 1.0.9...1.0.10

1.0.9

12 Feb 12:15
8d972c8
Compare
Choose a tag to compare

What's Changed

Full Changelog: 1.0.8...1.0.9

1.0.8

25 Jan 12:02
fd501d2
Compare
Choose a tag to compare

What's Changed

Full Changelog: 1.0.7...1.0.8

1.0.7

02 Jan 14:20
5aeb0da
Compare
Choose a tag to compare

What's Changed

Versions 1.0.3 through 1.0.6 were used to debug a bug with the ESM build.

Full Changelog: 1.0.2...1.0.7

1.0.2

02 Jan 11:04
4af64db
Compare
Choose a tag to compare

What's Changed

Full Changelog: 1.0.1...1.0.2