Skip to content

Commit

Permalink
feat: add transaction timestamp
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos V <[email protected]>
  • Loading branch information
carlosvdr committed Aug 28, 2024
1 parent 5a8d60d commit 3d4fc7d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ type Transaction @entity(immutable: true){
expectedAmount: BigInt
amount: BigInt!
escrowAccount: EscrowAccount!
timestamp: BigInt!
}

type Signer @entity{
Expand Down
3 changes: 3 additions & 0 deletions src/mappings/escrow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export function handleDeposit(event: Deposit): void {
transaction.amount = event.params.amount
transaction.escrowAccount = escrow.id
transaction.transactionGroupID = event.transaction.hash
transaction.timestamp = event.block.timestamp

transaction.save()
escrow.save()
Expand All @@ -70,6 +71,7 @@ export function handleWidthrawals(event: Withdraw): void {
transaction.amount = event.params.amount
transaction.escrowAccount = escrow.id
transaction.transactionGroupID = event.transaction.hash
transaction.timestamp = event.block.timestamp

transaction.save()
escrow.save()
Expand All @@ -93,6 +95,7 @@ export function handleRedeems(event: Redeem): void {
transaction.allocationID = event.params.allocationID
transaction.escrowAccount = escrow.id
transaction.transactionGroupID = event.transaction.hash
transaction.timestamp = event.block.timestamp

transaction.save()
escrow.save()
Expand Down

0 comments on commit 3d4fc7d

Please sign in to comment.