Skip to main content

getStakerActions

Description:

Get a list of interactions with the vault.

Arguments:

NameTypeRequiredDescription
vaultAddressstringYesThe address of the vault
userAddressstringNoIf a user address is specified, the query will look for events for that address and the vault address only
typesAllocatorActionTypeYesEvent types can be found in enum AllocatorActionType which you can import from the library
limitnumberYesTo implement pagination
skipnumberYesTo implement pagination

Returns:

type Output = Array<{
actionType: AllocatorActionType
createdAt: number
assets: string
shares: string
link: string
id: string
}>

In events related to osToken you can use shares, in all other assets

NameDescription
idEvent identifier
assetsTransaction amount
sharesTransaction amount
createdAtTransaction date
actionTypeType of action
linkTransaction link (etherscan/blockscout)

Example:

import { AllocatorActionType } from '@stakewise/v3-sdk'

await sdk.vault.getStakerActions({
skip: 0,
limit: 20,
userAddress: '0x...',
vaultAddress: '0x...',
types: [
AllocatorActionType.Redeemed,
AllocatorActionType.Deposited,
AllocatorActionType.VaultCreated,
AllocatorActionType.ExitedAssetsClaimed,
],
})