Skip to main content

Triple Events

Functions for parsing triple-related events from transaction receipts.

eventParseTripleCreated​

Parse TripleCreated events from a transaction.

Parameters​

ParameterTypeDescriptionRequired
publicClientPublicClientViem public clientYes
txHashHashTransaction hashYes

Returns​

Promise<Array<{
args: {
tripleId: bigint
subjectId: bigint
predicateId: bigint
objectId: bigint
counterVaultId: bigint
creatorAtomId: bigint
}
}>>

Example​

import { eventParseTripleCreated } from '@0xintuition/protocol'

const events = await eventParseTripleCreated(publicClient, txHash)

events.forEach((event) => {
console.log('Triple ID:', event.args.tripleId)
console.log('Subject:', event.args.subjectId)
console.log('Predicate:', event.args.predicateId)
console.log('Object:', event.args.objectId)
console.log('Counter vault:', event.args.counterVaultId)
})

eventParseTripleDepositCreated​

Parse TripleDepositCreated events.

Returns​

Promise<Array<{
args: {
tripleId: bigint
sender: Address
receiver: Address
assets: bigint
shares: bigint
}
}>>

Example​

import { eventParseTripleDepositCreated } from '@0xintuition/protocol'

const events = await eventParseTripleDepositCreated(publicClient, txHash)

events.forEach((event) => {
console.log('Triple ID:', event.args.tripleId)
console.log('Deposit:', formatEther(event.args.assets))
console.log('Shares:', formatEther(event.args.shares))
})

See Also​