@merkl/api 0.13.5 → 0.13.7

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.
@@ -1058,7 +1058,9 @@ declare const eden: {
1058
1058
  };
1059
1059
  fetch?: RequestInit | undefined;
1060
1060
  }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
1061
- 200: string;
1061
+ 200: {
1062
+ campaignId: string;
1063
+ };
1062
1064
  }>>;
1063
1065
  };
1064
1066
  };
@@ -2391,7 +2393,13 @@ declare const eden: {
2391
2393
  fetch?: RequestInit | undefined;
2392
2394
  }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
2393
2395
  200: {
2394
- totalAmount: number;
2396
+ total: number;
2397
+ breakdown: {
2398
+ [key: number]: {
2399
+ chainAmount: number;
2400
+ percentage: number;
2401
+ };
2402
+ };
2395
2403
  from: string;
2396
2404
  to: string;
2397
2405
  };
@@ -4061,7 +4069,9 @@ declare const eden: {
4061
4069
  };
4062
4070
  fetch?: RequestInit | undefined;
4063
4071
  }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
4064
- 200: string;
4072
+ 200: {
4073
+ campaignId: string;
4074
+ };
4065
4075
  }>>;
4066
4076
  };
4067
4077
  };
@@ -5394,7 +5404,13 @@ declare const eden: {
5394
5404
  fetch?: RequestInit | undefined;
5395
5405
  }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
5396
5406
  200: {
5397
- totalAmount: number;
5407
+ total: number;
5408
+ breakdown: {
5409
+ [key: number]: {
5410
+ chainAmount: number;
5411
+ percentage: number;
5412
+ };
5413
+ };
5398
5414
  from: string;
5399
5415
  to: string;
5400
5416
  };
@@ -7919,7 +7935,9 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
7919
7935
  authorization: string;
7920
7936
  };
7921
7937
  response: {
7922
- 200: string;
7938
+ 200: {
7939
+ campaignId: string;
7940
+ };
7923
7941
  };
7924
7942
  };
7925
7943
  };
@@ -9629,7 +9647,13 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
9629
9647
  };
9630
9648
  response: {
9631
9649
  200: {
9632
- totalAmount: number;
9650
+ total: number;
9651
+ breakdown: {
9652
+ [key: number]: {
9653
+ chainAmount: number;
9654
+ percentage: number;
9655
+ };
9656
+ };
9633
9657
  from: string;
9634
9658
  to: string;
9635
9659
  };
@@ -12371,7 +12395,9 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
12371
12395
  };
12372
12396
  fetch?: RequestInit | undefined;
12373
12397
  }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
12374
- 200: string;
12398
+ 200: {
12399
+ campaignId: string;
12400
+ };
12375
12401
  }>>;
12376
12402
  };
12377
12403
  };
@@ -13704,7 +13730,13 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
13704
13730
  fetch?: RequestInit | undefined;
13705
13731
  }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
13706
13732
  200: {
13707
- totalAmount: number;
13733
+ total: number;
13734
+ breakdown: {
13735
+ [key: number]: {
13736
+ chainAmount: number;
13737
+ percentage: number;
13738
+ };
13739
+ };
13708
13740
  from: string;
13709
13741
  to: string;
13710
13742
  };
@@ -15374,7 +15406,9 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
15374
15406
  };
15375
15407
  fetch?: RequestInit | undefined;
15376
15408
  }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
15377
- 200: string;
15409
+ 200: {
15410
+ campaignId: string;
15411
+ };
15378
15412
  }>>;
15379
15413
  };
15380
15414
  };
@@ -16707,7 +16741,13 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
16707
16741
  fetch?: RequestInit | undefined;
16708
16742
  }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
16709
16743
  200: {
16710
- totalAmount: number;
16744
+ total: number;
16745
+ breakdown: {
16746
+ [key: number]: {
16747
+ chainAmount: number;
16748
+ percentage: number;
16749
+ };
16750
+ };
16711
16751
  from: string;
16712
16752
  to: string;
16713
16753
  };
@@ -1224,7 +1224,9 @@ declare const app: Elysia<"", false, {
1224
1224
  authorization: string;
1225
1225
  };
1226
1226
  response: {
1227
- 200: string;
1227
+ 200: {
1228
+ campaignId: string;
1229
+ };
1228
1230
  };
1229
1231
  };
1230
1232
  };
@@ -2934,7 +2936,13 @@ declare const app: Elysia<"", false, {
2934
2936
  };
2935
2937
  response: {
2936
2938
  200: {
2937
- totalAmount: number;
2939
+ total: number;
2940
+ breakdown: {
2941
+ [key: number]: {
2942
+ chainAmount: number;
2943
+ percentage: number;
2944
+ };
2945
+ };
2938
2946
  from: string;
2939
2947
  to: string;
2940
2948
  };
@@ -79,7 +79,13 @@ export declare const AccountingController: Elysia<"/accounting", false, {
79
79
  };
80
80
  response: {
81
81
  200: {
82
- totalAmount: number;
82
+ total: number;
83
+ breakdown: {
84
+ [key: number]: {
85
+ chainAmount: number;
86
+ percentage: number;
87
+ };
88
+ };
83
89
  from: string;
84
90
  to: string;
85
91
  };
@@ -31,7 +31,13 @@ export declare class AccountingService {
31
31
  };
32
32
  }>;
33
33
  static getMonthlyRevenue(year: number, month: number): Promise<{
34
- totalAmount: number;
34
+ total: number;
35
+ breakdown: {
36
+ [key: number]: {
37
+ chainAmount: number;
38
+ percentage: number;
39
+ };
40
+ };
35
41
  from: string;
36
42
  to: string;
37
43
  }>;
@@ -48,12 +48,22 @@ export class AccountingService {
48
48
  static async getMonthlyRevenue(year, month) {
49
49
  const startDate = new Date(year, month - 1, 1);
50
50
  const endDate = new Date(year, month, 0, 23, 59, 59);
51
- const monthlyData = await AccountingRepository.getForMultisigBetweenDates(startDate, endDate);
52
- let totalAmount = 0;
53
- for (const tx of monthlyData) {
54
- totalAmount += Number(tx.amountIn);
51
+ const breakdown = {};
52
+ let consolidatedAmount = 0;
53
+ for (const chainId of Object.values(ChainId).filter(id => typeof id === "number")) {
54
+ const monthlyData = await AccountingRepository.getForMultisigBetweenDates(startDate, endDate);
55
+ let totalAmount = 0;
56
+ for (const tx of monthlyData) {
57
+ totalAmount += Number(tx.amountIn);
58
+ }
59
+ breakdown[chainId] = { chainAmount: totalAmount, percentage: 0 };
60
+ consolidatedAmount += totalAmount;
55
61
  }
56
- return { totalAmount, from: startDate.toDateString(), to: endDate.toDateString() };
62
+ for (const chainId of Object.values(ChainId).filter(id => typeof id === "number")) {
63
+ const totalAmount = breakdown[chainId].chainAmount;
64
+ breakdown[chainId] = { chainAmount: totalAmount, percentage: (totalAmount * 100) / consolidatedAmount };
65
+ }
66
+ return { total: consolidatedAmount, breakdown, from: startDate.toDateString(), to: endDate.toDateString() };
57
67
  }
58
68
  static async getMonthlyRevenueByChain(chainId, year, month) {
59
69
  const startDate = new Date(year, month - 1, 1);
@@ -260,7 +260,9 @@ export declare const CampaignController: Elysia<"/campaigns", false, {
260
260
  authorization: string;
261
261
  };
262
262
  response: {
263
- 200: string;
263
+ 200: {
264
+ campaignId: string;
265
+ };
264
266
  };
265
267
  };
266
268
  };
@@ -43,6 +43,9 @@ export declare const campaignTypeToEnumMap: {
43
43
  readonly HYPERDRIVELOGPROCESSOR: any;
44
44
  readonly HYPERDRIVELOGFIXPROCESSOR: any;
45
45
  readonly AMBIENTPROCESSOR: any;
46
+ readonly M0: any;
47
+ readonly MORPHOSUPPLY: any;
48
+ readonly SYNCSWAP_VAULT: any;
46
49
  };
47
50
  export type ConvertedCampaignType<C extends CampaignType> = (typeof campaignTypeToEnumMap)[C];
48
51
  export declare const CampaignUniqueDto: import("@sinclair/typebox").TObject<{
@@ -30,6 +30,9 @@ export const campaignTypeToEnumMap = {
30
30
  HYPERDRIVELOGPROCESSOR: CampaignTypeEnum.HYPERDRIVELOGPROCESSOR,
31
31
  HYPERDRIVELOGFIXPROCESSOR: CampaignTypeEnum.HYPERDRIVELOGFIXPROCESSOR,
32
32
  AMBIENTPROCESSOR: CampaignTypeEnum.AMBIENTPROCESSOR,
33
+ M0: CampaignTypeEnum.M0,
34
+ MORPHOSUPPLY: CampaignTypeEnum.MORPHOSUPPLY,
35
+ SYNCSWAP_VAULT: CampaignTypeEnum.SYNCSWAP_VAULT,
33
36
  };
34
37
  // ─── DTOs ────────────────────────────────────────────────────────────────────
35
38
  export const CampaignUniqueDto = t.Object({
@@ -137,7 +137,9 @@ export declare abstract class CampaignService {
137
137
  }[];
138
138
  campaignId: string;
139
139
  }[]>;
140
- static pickCampaignToProcess(chainId: ChainId): Promise<string>;
140
+ static pickCampaignToProcess(chainId: ChainId): Promise<{
141
+ campaignId: string;
142
+ }>;
141
143
  static fill(campaigns: CampaignUnique[]): Promise<{
142
144
  success: number;
143
145
  fail: number;
@@ -161,7 +161,7 @@ export class CampaignService {
161
161
  distributionChain: chainId,
162
162
  campaignId: campaign.campaignId,
163
163
  }, { value: "PROCESSING" });
164
- return campaign.campaignId;
164
+ return { campaignId: campaign.campaignId };
165
165
  }
166
166
  catch { }
167
167
  }
@@ -1094,7 +1094,9 @@ export declare const v4: Elysia<"/v4", false, {
1094
1094
  authorization: string;
1095
1095
  };
1096
1096
  response: {
1097
- 200: string;
1097
+ 200: {
1098
+ campaignId: string;
1099
+ };
1098
1100
  };
1099
1101
  };
1100
1102
  };
@@ -2804,7 +2806,13 @@ export declare const v4: Elysia<"/v4", false, {
2804
2806
  };
2805
2807
  response: {
2806
2808
  200: {
2807
- totalAmount: number;
2809
+ total: number;
2810
+ breakdown: {
2811
+ [key: number]: {
2812
+ chainAmount: number;
2813
+ percentage: number;
2814
+ };
2815
+ };
2808
2816
  from: string;
2809
2817
  to: string;
2810
2818
  };