Vault Events
Functions for parsing vault-related events from transaction receipts.
eventParseDepositedβ
Parse Deposited events from a transaction.
Returnsβ
Promise<Array<{
args: {
sender: Address
receiver: Address
vaultId: bigint
assets: bigint
shares: bigint
}
}>>
Exampleβ
import { eventParseDeposited } from '@0xintuition/protocol'
const events = await eventParseDeposited(publicClient, txHash)
events.forEach((event) => {
console.log('Vault ID:', event.args.vaultId)
console.log('Deposited:', formatEther(event.args.assets))
console.log('Shares received:', formatEther(event.args.shares))
})
eventParseRedeemedβ
Parse Redeemed events from a transaction.
Returnsβ
Promise<Array<{
args: {
sender: Address
receiver: Address
vaultId: bigint
assets: bigint
shares: bigint
}
}>>
Exampleβ
import { eventParseRedeemed } from '@0xintuition/protocol'
const events = await eventParseRedeemed(publicClient, txHash)
events.forEach((event) => {
console.log('Vault ID:', event.args.vaultId)
console.log('Shares redeemed:', formatEther(event.args.shares))
console.log('Assets received:', formatEther(event.args.assets))
})
eventParseSharePriceChangedβ
Parse SharePriceChanged events.
Returnsβ
Promise<Array<{
args: {
vaultId: bigint
oldPrice: bigint
newPrice: bigint
}
}>>
Exampleβ
import { eventParseSharePriceChanged } from '@0xintuition/protocol'
const events = await eventParseSharePriceChanged(publicClient, txHash)
events.forEach((event) => {
console.log('Vault ID:', event.args.vaultId)
console.log('Old price:', formatEther(event.args.oldPrice))
console.log('New price:', formatEther(event.args.newPrice))
})