Skip to content

Commit 7effca0

Browse files
committed
feat(uniswap): add defi-kingdoms chain
1 parent 8a29382 commit 7effca0

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

services/decoder/protocols/uniswap-v2/uniswap-v2.configs.ts

+6
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ const configs: Configs = [
2525
protocol_name: "uniswap-v2",
2626
chain_name: "eth-mainnet",
2727
},
28+
{
29+
address: "0xcf329b34049033de26e4449aebcb41f1992724d3",
30+
is_factory: true,
31+
protocol_name: "uniswap-v2",
32+
chain_name: "defi-kingdoms-mainnet",
33+
},
2834
];
2935

3036
export default configs;

services/decoder/protocols/uniswap-v2/uniswap-v2.decoders.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111

1212
GoldRushDecoder.on(
1313
"uniswap-v2:Swap",
14-
["eth-mainnet"],
14+
["eth-mainnet", "defi-kingdoms-mainnet"],
1515
PairABI as Abi,
1616
async (log_event, tx, chain_name, covalent_client): Promise<EventType> => {
1717
const {

services/decoder/protocols/uniswap-v2/uniswap-v2.test.ts

+20
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,26 @@ describe("uniswap-v2", () => {
2323
expect(event.details?.length).toEqual(2);
2424
});
2525

26+
test("defi-kingdoms-mainnet:Swap", async () => {
27+
const res = await request(app)
28+
.post("/api/v1/tx/decode")
29+
.set({
30+
"x-covalent-api-key": process.env.TEST_COVALENT_API_KEY,
31+
})
32+
.send({
33+
chain_name: "defi-kingdoms-mainnet",
34+
tx_hash:
35+
"0x9327e7e7ba43fdb276e6b098e5ef7eb114640f14ce528f0419716d950ee9f947",
36+
});
37+
const { events } = res.body as { events: EventType[] };
38+
const event = events.find(({ name }) => name === "Swap");
39+
if (!event) {
40+
throw Error("Event not found");
41+
}
42+
expect(event.tokens?.length).toEqual(2);
43+
expect(event.details?.length).toEqual(2);
44+
});
45+
2646
test("eth-mainnet:Mint", async () => {
2747
const res = await request(app)
2848
.post("/api/v1/tx/decode")

0 commit comments

Comments
 (0)