Skip to content

Commit 7ffa628

Browse files
kev1n-petersevan-gray
authored andcommitted
add timestamp to event data
1 parent d1ff9c2 commit 7ffa628

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

cloud_functions/src/getSolanaEvents.ts

+4
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ const getEventData = (
198198
token: tokenBridgeIx.accounts[3]?.toString() || '', // mint account
199199
amount: transferIx.parsed.info?.amount,
200200
isDeposit: true,
201+
timestamp: tx.blockTime || undefined,
201202
};
202203
}
203204
break;
@@ -243,6 +244,7 @@ const getEventData = (
243244
token: tokenBridgeIx.accounts[4]?.toString() || '', // mint account
244245
amount: burnIx.parsed.info?.amount,
245246
isDeposit: false,
247+
timestamp: tx.blockTime || undefined,
246248
};
247249
}
248250
break;
@@ -268,6 +270,7 @@ const getEventData = (
268270
token: tokenBridgeIx.accounts[mintAccountIndex]?.toString() || '', // mint account
269271
amount: transferIx.parsed.info?.amount,
270272
isDeposit: false,
273+
timestamp: tx.blockTime || undefined,
271274
};
272275
}
273276
break;
@@ -294,6 +297,7 @@ const getEventData = (
294297
token: mintToIx.parsed.info?.mint,
295298
amount: mintToIx.parsed.info?.amount,
296299
isDeposit: false,
300+
timestamp: tx.blockTime || undefined,
297301
};
298302
}
299303
break;

common/src/types.ts

+1
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ export interface EventData {
154154
token: string;
155155
amount: string;
156156
isDeposit: boolean;
157+
timestamp?: number;
157158
}
158159

159160
export type TokenAmount = {

0 commit comments

Comments
 (0)