diff --git a/src/server/schemas/event.ts b/src/server/schemas/event.ts index 9f1f9f30..46bf3e87 100644 --- a/src/server/schemas/event.ts +++ b/src/server/schemas/event.ts @@ -1,24 +1,10 @@ import { BigNumber } from "ethers"; -export type ContractEventV5 = { - eventName: string; - args: Record; - address: string; - topic: string[]; - data: string; - blockNumber: bigint; - transactionHash: string; - transactionIndex: number; - blockHash: string; - logIndex: number; - removed: boolean; -}; - export type ContractEventV4 = { eventName: string; data: Record; transaction: { - blockNumber: bigint; + blockNumber: bigint | number; blockHash: string; transactionIndex: number; removed: boolean; @@ -28,15 +14,31 @@ export type ContractEventV4 = { transactionHash: string; logIndex: number; event: string; - eventSignature: string | undefined; + eventSignature?: string; }; }; +export type ContractEventV5 = { + eventName: string; + args: Record; + address: string; + topic: string[]; + data: string; + blockNumber: bigint; + transactionHash: string; + transactionIndex: number; + blockHash: string; + logIndex: number; + removed: boolean; +}; + /** * Mapping of events v5 response to v4 for backward compatiblity. * Clients may be using this api and dont want to break things. */ -export function toContractEventV4Schema(eventV5: ContractEventV5) { +export function toContractEventV4Schema( + eventV5: ContractEventV5, +): ContractEventV4 { const eventName = eventV5.eventName; // backwards compatibility of BigInt(v5) to BigNumber(v4)