Skip to content

Commit 6a7ff82

Browse files
committed
minor refactoring
1 parent fc390ef commit 6a7ff82

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

src/server/schemas/event.ts

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,5 @@
11
import { BigNumber } from "ethers";
22

3-
export type ContractEventV5 = {
4-
eventName: string;
5-
args: Record<string, any>;
6-
address: string;
7-
topic: string[];
8-
data: string;
9-
blockNumber: bigint;
10-
transactionHash: string;
11-
transactionIndex: number;
12-
blockHash: string;
13-
logIndex: number;
14-
removed: boolean;
15-
};
16-
173
export type ContractEventV4 = {
184
eventName: string;
195
data: Record<string, any>;
@@ -32,11 +18,27 @@ export type ContractEventV4 = {
3218
};
3319
};
3420

21+
export type ContractEventV5 = {
22+
eventName: string;
23+
args: Record<string, any>;
24+
address: string;
25+
topic: string[];
26+
data: string;
27+
blockNumber: bigint;
28+
transactionHash: string;
29+
transactionIndex: number;
30+
blockHash: string;
31+
logIndex: number;
32+
removed: boolean;
33+
};
34+
3535
/**
3636
* Mapping of events v5 response to v4 for backward compatiblity.
3737
* Clients may be using this api and dont want to break things.
3838
*/
39-
export function toContractEventV4Schema(eventV5: ContractEventV5) {
39+
export function toContractEventV4Schema(
40+
eventV5: ContractEventV5,
41+
): ContractEventV4 {
4042
const eventName = eventV5.eventName;
4143

4244
// backwards compatibility of BigInt(v5) to BigNumber(v4)

0 commit comments

Comments
 (0)