Triple Events
Functions for parsing triple-related events from transaction receipts.
eventParseTripleCreatedβ
Parse TripleCreated events from a transaction.
Parametersβ
| Parameter | Type | Description | Required |
|---|---|---|---|
| publicClient | PublicClient | Viem public client | Yes |
| txHash | Hash | Transaction hash | Yes |
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))
})