@merkl/api 0.15.40 → 0.15.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/eden/index.d.ts +117 -0
- package/dist/src/index.d.ts +29 -0
- package/dist/src/jobs/etl/reward-breakdowns.js +79 -71
- package/dist/src/modules/v4/bucket/bucket.service.d.ts +1 -1
- package/dist/src/modules/v4/chain/chain.controller.d.ts +29 -0
- package/dist/src/modules/v4/chain/chain.controller.js +7 -1
- package/dist/src/modules/v4/chain/chain.model.d.ts +11 -0
- package/dist/src/modules/v4/chain/chain.model.js +8 -0
- package/dist/src/modules/v4/chain/chain.repository.d.ts +16 -5
- package/dist/src/modules/v4/chain/chain.repository.js +21 -2
- package/dist/src/modules/v4/chain/chain.service.d.ts +9 -1
- package/dist/src/modules/v4/chain/chain.service.js +3 -4
- package/dist/src/modules/v4/protocol/protocol.repository.d.ts +34 -2
- package/dist/src/modules/v4/protocol/protocol.repository.js +13 -0
- package/dist/src/modules/v4/protocol/protocol.service.js +7 -1
- package/dist/src/modules/v4/router.d.ts +29 -0
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +1 -1
@@ -52,6 +52,19 @@ export class ProtocolRepository {
|
|
52
52
|
take: items,
|
53
53
|
skip: page * items,
|
54
54
|
...args,
|
55
|
+
include: {
|
56
|
+
MainOpportunities: {
|
57
|
+
include: {
|
58
|
+
Campaigns: {
|
59
|
+
where: {
|
60
|
+
endTimestamp: {
|
61
|
+
gt: BigInt(Math.floor(Date.now() / 1000)),
|
62
|
+
},
|
63
|
+
},
|
64
|
+
},
|
65
|
+
},
|
66
|
+
},
|
67
|
+
},
|
55
68
|
});
|
56
69
|
}
|
57
70
|
static async countMany(query) {
|
@@ -39,7 +39,13 @@ export class ProtocolService {
|
|
39
39
|
}[amm];
|
40
40
|
}
|
41
41
|
static async findMany(query) {
|
42
|
-
|
42
|
+
const protocols = await ProtocolRepository.findMany(query);
|
43
|
+
const enrichedProtocols = protocols.map(({ MainOpportunities, ...protocol }) => ({
|
44
|
+
...protocol,
|
45
|
+
dailyReward: MainOpportunities.reduce((sum, opportunity) => sum + opportunity.dailyRewards, 0),
|
46
|
+
numberOfCampaigns: MainOpportunities.reduce((sum, opportunity) => sum + opportunity.Campaigns.length, 0),
|
47
|
+
}));
|
48
|
+
return enrichedProtocols;
|
43
49
|
}
|
44
50
|
static async countMany(query) {
|
45
51
|
return ProtocolRepository.countMany(query);
|
@@ -1978,6 +1978,35 @@ export declare const v4: Elysia<"/v4", false, {
|
|
1978
1978
|
};
|
1979
1979
|
};
|
1980
1980
|
};
|
1981
|
+
} & {
|
1982
|
+
chains: {
|
1983
|
+
index: {
|
1984
|
+
post: {
|
1985
|
+
body: {
|
1986
|
+
name: string;
|
1987
|
+
id: number;
|
1988
|
+
icon: string;
|
1989
|
+
explorerType: "ETHERSCAN" | "BLOCKSCOUT";
|
1990
|
+
explorerUrl: string;
|
1991
|
+
};
|
1992
|
+
params: {};
|
1993
|
+
query: unknown;
|
1994
|
+
headers: {
|
1995
|
+
authorization: string;
|
1996
|
+
};
|
1997
|
+
response: {
|
1998
|
+
200: {
|
1999
|
+
Explorer: {
|
2000
|
+
type: import("../../../database/api/.generated").$Enums.ExplorerType;
|
2001
|
+
url: string;
|
2002
|
+
id: string;
|
2003
|
+
chainId: number;
|
2004
|
+
}[];
|
2005
|
+
};
|
2006
|
+
};
|
2007
|
+
};
|
2008
|
+
};
|
2009
|
+
};
|
1981
2010
|
};
|
1982
2011
|
} & {
|
1983
2012
|
v4: {
|