From 8a4e933402c4194d0487533643f8e4e0b45f903e Mon Sep 17 00:00:00 2001 From: Kevin Peters Date: Fri, 27 Sep 2024 13:47:45 -0500 Subject: [PATCH] add timestamp to event data --- cloud_functions/src/getSolanaEvents.ts | 4 ++++ common/src/types.ts | 1 + 2 files changed, 5 insertions(+) diff --git a/cloud_functions/src/getSolanaEvents.ts b/cloud_functions/src/getSolanaEvents.ts index 6989c941..c59331f6 100644 --- a/cloud_functions/src/getSolanaEvents.ts +++ b/cloud_functions/src/getSolanaEvents.ts @@ -198,6 +198,7 @@ const getEventData = ( token: tokenBridgeIx.accounts[3]?.toString() || '', // mint account amount: transferIx.parsed.info?.amount, isDeposit: true, + timestamp: tx.blockTime || undefined, }; } break; @@ -243,6 +244,7 @@ const getEventData = ( token: tokenBridgeIx.accounts[4]?.toString() || '', // mint account amount: burnIx.parsed.info?.amount, isDeposit: false, + timestamp: tx.blockTime || undefined, }; } break; @@ -268,6 +270,7 @@ const getEventData = ( token: tokenBridgeIx.accounts[mintAccountIndex]?.toString() || '', // mint account amount: transferIx.parsed.info?.amount, isDeposit: false, + timestamp: tx.blockTime || undefined, }; } break; @@ -294,6 +297,7 @@ const getEventData = ( token: mintToIx.parsed.info?.mint, amount: mintToIx.parsed.info?.amount, isDeposit: false, + timestamp: tx.blockTime || undefined, }; } break; diff --git a/common/src/types.ts b/common/src/types.ts index 3b7f6606..40646c99 100644 --- a/common/src/types.ts +++ b/common/src/types.ts @@ -154,6 +154,7 @@ export interface EventData { token: string; amount: string; isDeposit: boolean; + timestamp?: number; } export type TokenAmount = {