@merkl/api 0.17.30 → 0.17.32

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.
Files changed (34) hide show
  1. package/dist/database/api/.generated/drizzle/schema.d.ts +17 -0
  2. package/dist/database/api/.generated/drizzle/schema.js +1 -0
  3. package/dist/database/api/.generated/drizzle/schema.ts +1 -0
  4. package/dist/database/api/.generated/edge.js +4 -3
  5. package/dist/database/api/.generated/index-browser.js +1 -0
  6. package/dist/database/api/.generated/index.d.ts +58 -1
  7. package/dist/database/api/.generated/index.js +4 -3
  8. package/dist/database/api/.generated/package.json +1 -1
  9. package/dist/database/api/.generated/schema.prisma +1 -0
  10. package/dist/database/api/.generated/wasm.js +1 -0
  11. package/dist/src/eden/index.d.ts +103 -9
  12. package/dist/src/index.d.ts +21 -3
  13. package/dist/src/modules/v4/campaign/campaign.controller.d.ts +2 -0
  14. package/dist/src/modules/v4/campaign/campaign.repository.d.ts +3 -0
  15. package/dist/src/modules/v4/campaign/campaign.service.d.ts +4 -0
  16. package/dist/src/modules/v4/opportunity/opportunity.controller.d.ts +4 -0
  17. package/dist/src/modules/v4/opportunity/opportunity.repository.d.ts +13 -0
  18. package/dist/src/modules/v4/opportunity/opportunity.service.d.ts +12 -0
  19. package/dist/src/modules/v4/reward/reward.repository.d.ts +2 -0
  20. package/dist/src/modules/v4/reward/reward.service.d.ts +11 -0
  21. package/dist/src/modules/v4/router.d.ts +20 -0
  22. package/dist/src/modules/v4/token/token.controller.d.ts +10 -0
  23. package/dist/src/modules/v4/token/token.controller.js +1 -1
  24. package/dist/src/modules/v4/token/token.model.d.ts +2 -0
  25. package/dist/src/modules/v4/token/token.model.js +2 -0
  26. package/dist/src/modules/v4/token/token.repository.d.ts +3 -0
  27. package/dist/src/modules/v4/token/token.service.d.ts +12 -1
  28. package/dist/src/modules/v4/token/token.service.js +19 -7
  29. package/dist/src/modules/v4/user/user.controller.d.ts +4 -0
  30. package/dist/src/routes/v3/campaignClaims.d.ts +5 -3
  31. package/dist/src/routes/v3/campaignClaims.js +18 -4
  32. package/dist/src/routes/v3/router.d.ts +1 -3
  33. package/dist/tsconfig.package.tsbuildinfo +1 -1
  34. package/package.json +1 -1
@@ -103,6 +103,7 @@ export declare const v4: Elysia<"/v4", false, {
103
103
  decimals: number;
104
104
  verified: boolean;
105
105
  isTest: boolean;
106
+ isNative: boolean;
106
107
  } & {
107
108
  price?: number | null | undefined;
108
109
  })[];
@@ -186,6 +187,7 @@ export declare const v4: Elysia<"/v4", false, {
186
187
  displaySymbol: string;
187
188
  verified: boolean;
188
189
  isTest: boolean;
190
+ isNative: boolean;
189
191
  price: number | null;
190
192
  };
191
193
  amount: bigint;
@@ -210,6 +212,7 @@ export declare const v4: Elysia<"/v4", false, {
210
212
  decimals: number;
211
213
  verified: boolean;
212
214
  isTest: boolean;
215
+ isNative: boolean;
213
216
  } & {
214
217
  price?: number | null | undefined;
215
218
  };
@@ -270,6 +273,7 @@ export declare const v4: Elysia<"/v4", false, {
270
273
  decimals: number;
271
274
  verified: boolean;
272
275
  isTest: boolean;
276
+ isNative: boolean;
273
277
  } & {
274
278
  price?: number | null | undefined;
275
279
  })[];
@@ -1138,6 +1142,7 @@ export declare const v4: Elysia<"/v4", false, {
1138
1142
  decimals: number;
1139
1143
  verified: boolean;
1140
1144
  isTest: boolean;
1145
+ isNative: boolean;
1141
1146
  } & {
1142
1147
  price?: number | null | undefined;
1143
1148
  };
@@ -1218,6 +1223,7 @@ export declare const v4: Elysia<"/v4", false, {
1218
1223
  decimals: number;
1219
1224
  verified: boolean;
1220
1225
  isTest: boolean;
1226
+ isNative: boolean;
1221
1227
  } & {
1222
1228
  price?: number | null | undefined;
1223
1229
  };
@@ -1564,6 +1570,7 @@ export declare const v4: Elysia<"/v4", false, {
1564
1570
  decimals: number;
1565
1571
  verified: boolean;
1566
1572
  isTest: boolean;
1573
+ isNative: boolean;
1567
1574
  price?: number | null | undefined;
1568
1575
  } | undefined;
1569
1576
  };
@@ -1595,6 +1602,7 @@ export declare const v4: Elysia<"/v4", false, {
1595
1602
  decimals: number;
1596
1603
  verified: boolean;
1597
1604
  isTest: boolean;
1605
+ isNative: boolean;
1598
1606
  price?: number | null | undefined;
1599
1607
  } | undefined;
1600
1608
  };
@@ -1626,6 +1634,7 @@ export declare const v4: Elysia<"/v4", false, {
1626
1634
  displaySymbol: string;
1627
1635
  verified: boolean;
1628
1636
  isTest: boolean;
1637
+ isNative: boolean;
1629
1638
  price: number | null;
1630
1639
  }[];
1631
1640
  };
@@ -1656,6 +1665,7 @@ export declare const v4: Elysia<"/v4", false, {
1656
1665
  decimals: number;
1657
1666
  verified: boolean;
1658
1667
  isTest: boolean;
1668
+ isNative: boolean;
1659
1669
  } & {
1660
1670
  price?: number | null | undefined;
1661
1671
  } & {
@@ -1677,6 +1687,7 @@ export declare const v4: Elysia<"/v4", false, {
1677
1687
  address?: string | undefined;
1678
1688
  displaySymbol?: string | undefined;
1679
1689
  verified?: boolean | undefined;
1690
+ isNative?: boolean | undefined;
1680
1691
  test?: boolean | undefined;
1681
1692
  };
1682
1693
  headers: unknown;
@@ -1691,6 +1702,7 @@ export declare const v4: Elysia<"/v4", false, {
1691
1702
  decimals: number;
1692
1703
  verified: boolean;
1693
1704
  isTest: boolean;
1705
+ isNative: boolean;
1694
1706
  } & {
1695
1707
  price?: number | null | undefined;
1696
1708
  })[];
@@ -1710,6 +1722,7 @@ export declare const v4: Elysia<"/v4", false, {
1710
1722
  address?: string | undefined;
1711
1723
  displaySymbol?: string | undefined;
1712
1724
  verified?: boolean | undefined;
1725
+ isNative?: boolean | undefined;
1713
1726
  test?: boolean | undefined;
1714
1727
  };
1715
1728
  headers: unknown;
@@ -1744,6 +1757,7 @@ export declare const v4: Elysia<"/v4", false, {
1744
1757
  decimals: number;
1745
1758
  verified: boolean;
1746
1759
  isTest: boolean;
1760
+ isNative: boolean;
1747
1761
  price?: number | null | undefined;
1748
1762
  } | undefined;
1749
1763
  };
@@ -1756,6 +1770,7 @@ export declare const v4: Elysia<"/v4", false, {
1756
1770
  name?: string | undefined;
1757
1771
  icon?: string | undefined;
1758
1772
  displaySymbol?: string | undefined;
1773
+ verified?: boolean | undefined;
1759
1774
  isTest?: boolean | undefined;
1760
1775
  };
1761
1776
  params: {
@@ -1777,6 +1792,7 @@ export declare const v4: Elysia<"/v4", false, {
1777
1792
  displaySymbol: string;
1778
1793
  verified: boolean;
1779
1794
  isTest: boolean;
1795
+ isNative: boolean;
1780
1796
  price: number | null;
1781
1797
  };
1782
1798
  };
@@ -2673,6 +2689,7 @@ export declare const v4: Elysia<"/v4", false, {
2673
2689
  displaySymbol: string;
2674
2690
  verified: boolean;
2675
2691
  isTest: boolean;
2692
+ isNative: boolean;
2676
2693
  price: number | null;
2677
2694
  };
2678
2695
  breakdowns: {
@@ -2694,6 +2711,7 @@ export declare const v4: Elysia<"/v4", false, {
2694
2711
  displaySymbol: string;
2695
2712
  verified: boolean;
2696
2713
  isTest: boolean;
2714
+ isNative: boolean;
2697
2715
  price: number | null;
2698
2716
  }[];
2699
2717
  Protocols: {
@@ -2786,6 +2804,7 @@ export declare const v4: Elysia<"/v4", false, {
2786
2804
  displaySymbol: string;
2787
2805
  verified: boolean;
2788
2806
  isTest: boolean;
2807
+ isNative: boolean;
2789
2808
  price: number | null;
2790
2809
  };
2791
2810
  breakdowns: {
@@ -2807,6 +2826,7 @@ export declare const v4: Elysia<"/v4", false, {
2807
2826
  displaySymbol: string;
2808
2827
  verified: boolean;
2809
2828
  isTest: boolean;
2829
+ isNative: boolean;
2810
2830
  price: number | null;
2811
2831
  }[];
2812
2832
  Protocols: {
@@ -32,6 +32,7 @@ export declare const TokenController: Elysia<"/tokens", false, {
32
32
  decimals: number;
33
33
  verified: boolean;
34
34
  isTest: boolean;
35
+ isNative: boolean;
35
36
  price?: number | null | undefined;
36
37
  } | undefined;
37
38
  };
@@ -63,6 +64,7 @@ export declare const TokenController: Elysia<"/tokens", false, {
63
64
  decimals: number;
64
65
  verified: boolean;
65
66
  isTest: boolean;
67
+ isNative: boolean;
66
68
  price?: number | null | undefined;
67
69
  } | undefined;
68
70
  };
@@ -94,6 +96,7 @@ export declare const TokenController: Elysia<"/tokens", false, {
94
96
  displaySymbol: string;
95
97
  verified: boolean;
96
98
  isTest: boolean;
99
+ isNative: boolean;
97
100
  price: number | null;
98
101
  }[];
99
102
  };
@@ -124,6 +127,7 @@ export declare const TokenController: Elysia<"/tokens", false, {
124
127
  decimals: number;
125
128
  verified: boolean;
126
129
  isTest: boolean;
130
+ isNative: boolean;
127
131
  } & {
128
132
  price?: number | null | undefined;
129
133
  } & {
@@ -145,6 +149,7 @@ export declare const TokenController: Elysia<"/tokens", false, {
145
149
  address?: string | undefined;
146
150
  displaySymbol?: string | undefined;
147
151
  verified?: boolean | undefined;
152
+ isNative?: boolean | undefined;
148
153
  test?: boolean | undefined;
149
154
  };
150
155
  headers: unknown;
@@ -159,6 +164,7 @@ export declare const TokenController: Elysia<"/tokens", false, {
159
164
  decimals: number;
160
165
  verified: boolean;
161
166
  isTest: boolean;
167
+ isNative: boolean;
162
168
  } & {
163
169
  price?: number | null | undefined;
164
170
  })[];
@@ -178,6 +184,7 @@ export declare const TokenController: Elysia<"/tokens", false, {
178
184
  address?: string | undefined;
179
185
  displaySymbol?: string | undefined;
180
186
  verified?: boolean | undefined;
187
+ isNative?: boolean | undefined;
181
188
  test?: boolean | undefined;
182
189
  };
183
190
  headers: unknown;
@@ -212,6 +219,7 @@ export declare const TokenController: Elysia<"/tokens", false, {
212
219
  decimals: number;
213
220
  verified: boolean;
214
221
  isTest: boolean;
222
+ isNative: boolean;
215
223
  price?: number | null | undefined;
216
224
  } | undefined;
217
225
  };
@@ -224,6 +232,7 @@ export declare const TokenController: Elysia<"/tokens", false, {
224
232
  name?: string | undefined;
225
233
  icon?: string | undefined;
226
234
  displaySymbol?: string | undefined;
235
+ verified?: boolean | undefined;
227
236
  isTest?: boolean | undefined;
228
237
  };
229
238
  params: {
@@ -245,6 +254,7 @@ export declare const TokenController: Elysia<"/tokens", false, {
245
254
  displaySymbol: string;
246
255
  verified: boolean;
247
256
  isTest: boolean;
257
+ isNative: boolean;
248
258
  price: number | null;
249
259
  };
250
260
  };
@@ -53,7 +53,7 @@ export const TokenController = new Elysia({ prefix: "/tokens", detail: { tags: [
53
53
  .get("/balances", async ({ query: { chainId, userAddress, tokenAddress, additionalTokenAddresses } }) => {
54
54
  if (tokenAddress)
55
55
  return await TokenService.fetchTokensAndBalances(chainId, userAddress, [tokenAddress].concat(additionalTokenAddresses ?? []));
56
- return await TokenService.fetchVerifiedBalances(chainId, userAddress, additionalTokenAddresses);
56
+ return await TokenService.fetchVerifiedAndNativeBalances(chainId, userAddress, additionalTokenAddresses);
57
57
  }, {
58
58
  query: GetTokenBalanceDto,
59
59
  detail: {
@@ -36,6 +36,7 @@ export declare const GetTokenQueryDto: import("@sinclair/typebox").TObject<{
36
36
  symbol: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
37
37
  displaySymbol: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
38
38
  chainId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
39
+ isNative: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
39
40
  address: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
40
41
  name: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
41
42
  verified: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
@@ -57,6 +58,7 @@ export declare const TokenIdDto: import("@sinclair/typebox").TObject<{
57
58
  }>;
58
59
  export declare const UpdateTokenDto: import("@sinclair/typebox").TObject<{
59
60
  isTest: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
61
+ verified: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
60
62
  icon: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
61
63
  displaySymbol: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
62
64
  name: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
@@ -25,6 +25,7 @@ export const GetTokenQueryDto = t.Object({
25
25
  symbol: t.Optional(t.String()),
26
26
  displaySymbol: t.Optional(t.String()), // To filter by displaySymbol or if null symbol
27
27
  chainId: t.Optional(t.Numeric()),
28
+ isNative: t.Optional(t.Boolean()),
28
29
  address: t.Optional(t.String()),
29
30
  name: t.Optional(t.String()),
30
31
  verified: t.Optional(t.Boolean()),
@@ -44,6 +45,7 @@ export const GetTokenBalanceDto = t.Object({
44
45
  export const TokenIdDto = t.Object({ id: t.String() });
45
46
  export const UpdateTokenDto = t.Object({
46
47
  isTest: t.Optional(t.Boolean()),
48
+ verified: t.Optional(t.Boolean()),
47
49
  icon: t.Optional(t.String({ format: "uri" })),
48
50
  // iconFile: t.Optional(t.File()),
49
51
  displaySymbol: t.Optional(t.String()),
@@ -40,6 +40,7 @@ export declare abstract class TokenRepository {
40
40
  displaySymbol: string;
41
41
  verified: boolean;
42
42
  isTest: boolean;
43
+ isNative: boolean;
43
44
  price: number | null;
44
45
  }[]>;
45
46
  static findList(chainId: number, addresses: string[]): Promise<{
@@ -53,6 +54,7 @@ export declare abstract class TokenRepository {
53
54
  displaySymbol: string;
54
55
  verified: boolean;
55
56
  isTest: boolean;
57
+ isNative: boolean;
56
58
  price: number | null;
57
59
  }[]>;
58
60
  static countMany(query: GetTokenQueryModel): Promise<number>;
@@ -92,6 +94,7 @@ export declare abstract class TokenRepository {
92
94
  displaySymbol: string;
93
95
  verified: boolean;
94
96
  isTest: boolean;
97
+ isNative: boolean;
95
98
  price: number | null;
96
99
  }>;
97
100
  }
@@ -6,6 +6,7 @@ import { TokenRepository } from "./token.repository";
6
6
  export declare abstract class TokenService {
7
7
  static hashId(token: TokenUnique): string;
8
8
  static format(token: Awaited<ReturnType<typeof TokenRepository.findMany>>[number]): Token["model"];
9
+ static fetchNativeBalance(chainId: number, userAddress: string): Promise<any>;
9
10
  /**
10
11
  * Fetches balances of provided tokens
11
12
  */
@@ -25,6 +26,7 @@ export declare abstract class TokenService {
25
26
  decimals: number;
26
27
  verified: boolean;
27
28
  isTest: boolean;
29
+ isNative: boolean;
28
30
  } & {
29
31
  price?: number | null | undefined;
30
32
  } & {
@@ -35,7 +37,7 @@ export declare abstract class TokenService {
35
37
  * @info tokens that are popular and must be detected in the app are marked as 'verified'
36
38
  * @param additionalTokens balances along with the verified ones
37
39
  */
38
- static fetchVerifiedBalances(chainId: number, userAddress: string, additionalTokenAddresses?: string[]): Promise<({
40
+ static fetchVerifiedAndNativeBalances(chainId: number, userAddress: string, additionalTokenAddresses?: string[]): Promise<({
39
41
  symbol: string;
40
42
  name: string | null;
41
43
  id: string;
@@ -45,6 +47,7 @@ export declare abstract class TokenService {
45
47
  decimals: number;
46
48
  verified: boolean;
47
49
  isTest: boolean;
50
+ isNative: boolean;
48
51
  } & {
49
52
  price?: number | null | undefined;
50
53
  } & {
@@ -62,6 +65,7 @@ export declare abstract class TokenService {
62
65
  decimals: number;
63
66
  verified: boolean;
64
67
  isTest: boolean;
68
+ isNative: boolean;
65
69
  } & {
66
70
  price?: number | null | undefined;
67
71
  }, "id">;
@@ -107,6 +111,7 @@ export declare abstract class TokenService {
107
111
  decimals: number;
108
112
  verified: boolean;
109
113
  isTest: boolean;
114
+ isNative: boolean;
110
115
  } & {
111
116
  price?: number | null | undefined;
112
117
  }) | undefined>;
@@ -125,6 +130,7 @@ export declare abstract class TokenService {
125
130
  decimals: number;
126
131
  verified: boolean;
127
132
  isTest: boolean;
133
+ isNative: boolean;
128
134
  } & {
129
135
  price?: number | null | undefined;
130
136
  }) | undefined>;
@@ -143,6 +149,7 @@ export declare abstract class TokenService {
143
149
  decimals: number;
144
150
  verified: boolean;
145
151
  isTest: boolean;
152
+ isNative: boolean;
146
153
  } & {
147
154
  price?: number | null | undefined;
148
155
  }>;
@@ -161,6 +168,7 @@ export declare abstract class TokenService {
161
168
  decimals: number;
162
169
  verified: boolean;
163
170
  isTest: boolean;
171
+ isNative: boolean;
164
172
  } & {
165
173
  price?: number | null | undefined;
166
174
  })[]>;
@@ -174,6 +182,7 @@ export declare abstract class TokenService {
174
182
  decimals: number;
175
183
  verified: boolean;
176
184
  isTest: boolean;
185
+ isNative: boolean;
177
186
  } & {
178
187
  price?: number | null | undefined;
179
188
  }>>;
@@ -214,6 +223,7 @@ export declare abstract class TokenService {
214
223
  displaySymbol: string;
215
224
  verified: boolean;
216
225
  isTest: boolean;
226
+ isNative: boolean;
217
227
  price: number | null;
218
228
  }[]>;
219
229
  static update(id: string, data: UpdateTokenModel): Promise<{
@@ -227,6 +237,7 @@ export declare abstract class TokenService {
227
237
  displaySymbol: string;
228
238
  verified: boolean;
229
239
  isTest: boolean;
240
+ isNative: boolean;
230
241
  price: number | null;
231
242
  }>;
232
243
  static notionWebhook(body: NotionWebhookModel): Promise<void>;
@@ -3,7 +3,7 @@ import { getOnlyUserBalance } from "../../../libs/tokens/balances";
3
3
  import { log } from "../../../utils/logger";
4
4
  import { apiDbClient } from "../../../utils/prisma";
5
5
  import { Prisma } from "../../../../database/api/.generated";
6
- import { DistributionCreatorService, NETWORK_LABELS, bigIntToNumber } from "@sdk";
6
+ import { ChainInteractionService, DistributionCreatorService, NETWORK_LABELS, bigIntToNumber, } from "@sdk";
7
7
  import { getAddress, parseUnits } from "viem";
8
8
  import { BucketService } from "../bucket/bucket.service";
9
9
  import { CacheService } from "../cache";
@@ -20,14 +20,22 @@ export class TokenService {
20
20
  symbol: !displaySymbol || displaySymbol === "" ? symbol : displaySymbol,
21
21
  };
22
22
  }
23
+ static async fetchNativeBalance(chainId, userAddress) {
24
+ return await ChainInteractionService(chainId).provider().getBalance(userAddress);
25
+ }
23
26
  /**
24
27
  * Fetches balances of provided tokens
25
28
  */
26
29
  static async fetchBalances(chainId, userAddress, tokens) {
27
- const balances = await getOnlyUserBalance(chainId, userAddress, tokens.map(t => t.address));
30
+ const nativeTokenBalance = await TokenService.fetchNativeBalance(chainId, userAddress);
31
+ const balances = await getOnlyUserBalance(chainId, userAddress, tokens.filter(({ isNative }) => !isNative).map(t => t.address));
28
32
  const tokensWithBalances = tokens.map(t => {
29
- const balance = balances[t.address] ??
30
- balances[Object.keys(balances).find(a => a?.toLowerCase() === t.address?.toLowerCase()) ?? ""];
33
+ const balance = (() => {
34
+ if (t.isNative)
35
+ return { balance: nativeTokenBalance.toString() };
36
+ return (balances[t.address] ??
37
+ balances[Object.keys(balances).find(a => a?.toLowerCase() === t.address?.toLowerCase()) ?? ""]);
38
+ })();
31
39
  return Object.assign(t, { balance: BigInt(balance?.balance ?? 0) });
32
40
  });
33
41
  return tokensWithBalances.sort((b, a) => {
@@ -48,12 +56,15 @@ export class TokenService {
48
56
  * @info tokens that are popular and must be detected in the app are marked as 'verified'
49
57
  * @param additionalTokens balances along with the verified ones
50
58
  */
51
- static async fetchVerifiedBalances(chainId, userAddress, additionalTokenAddresses) {
59
+ static async fetchVerifiedAndNativeBalances(chainId, userAddress, additionalTokenAddresses) {
52
60
  const verifiedTokens = await TokenService.findMany({ chainId: chainId, verified: true });
61
+ const nativeTokens = await TokenService.findMany({ chainId: chainId, isNative: true });
53
62
  const additionalTokens = !!additionalTokenAddresses?.length
54
63
  ? await TokenService.getManyOrCreate(additionalTokenAddresses?.map(address => ({ chainId, address })))
55
64
  : [];
56
- const allTokens = verifiedTokens.concat(additionalTokens.filter(t => t !== undefined));
65
+ const allTokens = verifiedTokens
66
+ .concat(additionalTokens.filter(t => t !== undefined))
67
+ .concat(nativeTokens.filter(t => t !== undefined));
57
68
  return TokenService.fetchBalances(chainId, userAddress, allTokens);
58
69
  }
59
70
  static async fetchOnChain(token) {
@@ -63,7 +74,7 @@ export class TokenService {
63
74
  chainId: token.chainId,
64
75
  address: token.address,
65
76
  icon: "",
66
- ...Object.assign({ name: "unknown", decimals: 18, symbol: "UNKNOWN", verified: false, isTest: false }, onchainData),
77
+ ...Object.assign({ name: "unknown", decimals: 18, symbol: "UNKNOWN", verified: false, isTest: false, isNative: false }, onchainData),
67
78
  };
68
79
  }
69
80
  static async fetchManyOnChain(chainId, addresses) {
@@ -134,6 +145,7 @@ export class TokenService {
134
145
  decimals: token.decimals,
135
146
  icon: token.logoURI,
136
147
  isTest: false,
148
+ isNative: false,
137
149
  });
138
150
  log.local(`Token created: ${res?.symbol} on ${NETWORK_LABELS[Number.parseInt(chain)]}`);
139
151
  }
@@ -131,6 +131,7 @@ export declare const UserController: Elysia<"/users", false, {
131
131
  displaySymbol: string;
132
132
  verified: boolean;
133
133
  isTest: boolean;
134
+ isNative: boolean;
134
135
  price: number | null;
135
136
  };
136
137
  breakdowns: {
@@ -152,6 +153,7 @@ export declare const UserController: Elysia<"/users", false, {
152
153
  displaySymbol: string;
153
154
  verified: boolean;
154
155
  isTest: boolean;
156
+ isNative: boolean;
155
157
  price: number | null;
156
158
  }[];
157
159
  Protocols: {
@@ -244,6 +246,7 @@ export declare const UserController: Elysia<"/users", false, {
244
246
  displaySymbol: string;
245
247
  verified: boolean;
246
248
  isTest: boolean;
249
+ isNative: boolean;
247
250
  price: number | null;
248
251
  };
249
252
  breakdowns: {
@@ -265,6 +268,7 @@ export declare const UserController: Elysia<"/users", false, {
265
268
  displaySymbol: string;
266
269
  verified: boolean;
267
270
  isTest: boolean;
271
+ isNative: boolean;
268
272
  price: number | null;
269
273
  }[];
270
274
  Protocols: {
@@ -1,4 +1,8 @@
1
1
  import type Elysia from "elysia";
2
+ /**
3
+ * @deprecated
4
+ * This whole file is deprecated but is still used by Pancakeswap to populate their db so we can't remove it yet.
5
+ */
2
6
  export declare const query: import("@sinclair/typebox").TObject<{
3
7
  campaignId: import("@sinclair/typebox").TString;
4
8
  chainId: import("@sinclair/typebox").TNumber;
@@ -28,9 +32,7 @@ declare const _default: (app: Elysia) => Elysia<"", false, {
28
32
  };
29
33
  headers: unknown;
30
34
  response: {
31
- 200: {
32
- message: string;
33
- };
35
+ 200: unknown;
34
36
  };
35
37
  };
36
38
  };
@@ -1,14 +1,28 @@
1
1
  import checkQueryChainIdValidity from "../../hooks/checkQueryChainIdValidity";
2
+ import { engineDbClient } from "../../utils/prisma";
3
+ import { Prisma } from "../../../database/engine/.generated";
2
4
  import { t } from "elysia";
5
+ /**
6
+ * @deprecated
7
+ * This whole file is deprecated but is still used by Pancakeswap to populate their db so we can't remove it yet.
8
+ */
3
9
  export const query = t.Object({
4
10
  campaignId: t.String(),
5
11
  chainId: t.Numeric(),
6
12
  byReason: t.Optional(t.BooleanString()),
7
13
  });
8
- export default (app) => app.use(checkQueryChainIdValidity()).get("/campaignClaims", async () => {
9
- return {
10
- message: "This route is now deprecated removed for performance improvement, please reach out to the team for more information.",
11
- };
14
+ const CLAIMS_OVER_TIME = (chainId, campaignId) => Prisma.sql `
15
+ SELECT timestamp, recipient, reason, claimed
16
+ FROM "ClaimsOverTime"
17
+ WHERE
18
+ "chainId"=${chainId} AND
19
+ "campaignId"=${campaignId}
20
+ ORDER BY timestamp ASC
21
+ `;
22
+ export default (app) => app.use(checkQueryChainIdValidity()).get("/campaignClaims", async ({ query }) => {
23
+ const campaignId = query.campaignId;
24
+ const chainId = query.chainId;
25
+ return await engineDbClient.$queryRaw(CLAIMS_OVER_TIME(chainId, campaignId));
12
26
  }, {
13
27
  query,
14
28
  tags: ["Campaigns"],
@@ -57,9 +57,7 @@ export declare const v3: Elysia<"/v3", false, {
57
57
  };
58
58
  headers: unknown;
59
59
  response: {
60
- 200: {
61
- message: string;
62
- };
60
+ 200: unknown;
63
61
  };
64
62
  };
65
63
  };