@merkl/api 0.10.238 → 0.10.239

Sign up to get free protection for your applications and to get access to all the features.
@@ -194,133 +194,40 @@ declare const app: Elysia<"", false, {
194
194
  };
195
195
  headers: unknown;
196
196
  response: {
197
- 200: ({
198
- protocol?: {
199
- name: string;
200
- url: string;
201
- description: string;
202
- id: string;
203
- tags: string[];
204
- icon: string;
205
- } | null | undefined;
206
- depositUrl?: string | undefined;
207
- aprRecord?: {
208
- timestamp: string | bigint;
197
+ 200: {
198
+ aprRecord: {
209
199
  cumulated: number;
200
+ timestamp: bigint;
210
201
  breakdowns: {
211
- type: "CAMPAIGN" | "TOKEN" | "PROTOCOL";
202
+ type: import("../database/api/.generated").$Enums.AprType;
212
203
  id: number;
213
204
  identifier: string;
214
205
  value: number;
215
206
  aprRecordId: string;
216
207
  }[];
217
- } | undefined;
218
- tvlRecord?: {
208
+ };
209
+ tvlRecord: {
210
+ id: string;
219
211
  total: number;
220
- timestamp: string | bigint;
212
+ timestamp: bigint;
221
213
  breakdowns: {
222
- type: "TOKEN" | "PROTOCOL";
214
+ type: import("../database/api/.generated").$Enums.TvlType;
223
215
  id: number;
224
216
  identifier: string;
225
217
  value: number;
226
218
  tvlRecordId: string;
227
219
  }[];
228
- } | undefined;
229
- rewardsRecord?: {
230
- total: number;
231
- id: string;
232
- timestamp: string | bigint;
233
- breakdowns: {
234
- token: {
235
- price?: number | null | undefined;
236
- symbol: string;
237
- name: string | null;
238
- id: string;
239
- icon: string;
240
- chainId: number;
241
- address: string;
242
- decimals: number;
243
- verified: boolean;
244
- isTest: boolean;
245
- };
246
- id: number;
247
- value: number;
248
- campaignId: string;
249
- amount: string | bigint;
250
- dailyRewardsRecordId: string;
251
- }[];
252
- } | undefined;
253
- name: string;
254
- type: string;
255
- tokens: {
256
- price?: number | null | undefined;
257
- symbol: string;
258
- name: string | null;
259
- id: string;
260
- icon: string;
261
- chainId: number;
262
- address: string;
263
- decimals: number;
264
- verified: boolean;
265
- isTest: boolean;
266
- }[];
267
- id: string;
268
- status: string;
269
- tags: string[];
270
- identifier: string;
271
- chain: {
272
- name: string;
273
- id: number;
274
- icon: string;
275
220
  };
276
- chainId: number;
277
- action: string;
278
- tvl: number;
279
- apr: number;
280
- dailyRewards: number;
281
- } | null)[];
282
- } | {
283
- 200: never;
284
- } | {
285
- 200: (Response | ({
286
- protocol?: {
287
- name: string;
288
- url: string;
289
- description: string;
221
+ rewardsRecord: {
290
222
  id: string;
291
- tags: string[];
292
- icon: string;
293
- } | null | undefined;
294
- depositUrl?: string | undefined;
295
- aprRecord?: {
296
- timestamp: string | bigint;
297
- cumulated: number;
298
- breakdowns: {
299
- type: "CAMPAIGN" | "TOKEN" | "PROTOCOL";
300
- id: number;
301
- identifier: string;
302
- value: number;
303
- aprRecordId: string;
304
- }[];
305
- } | undefined;
306
- tvlRecord?: {
307
223
  total: number;
308
- timestamp: string | bigint;
224
+ timestamp: bigint;
309
225
  breakdowns: {
310
- type: "TOKEN" | "PROTOCOL";
311
226
  id: number;
312
- identifier: string;
313
227
  value: number;
314
- tvlRecordId: string;
315
- }[];
316
- } | undefined;
317
- rewardsRecord?: {
318
- total: number;
319
- id: string;
320
- timestamp: string | bigint;
321
- breakdowns: {
228
+ campaignId: string;
229
+ dailyRewardsRecordId: string;
322
230
  token: {
323
- price?: number | null | undefined;
324
231
  symbol: string;
325
232
  name: string | null;
326
233
  id: string;
@@ -328,20 +235,17 @@ declare const app: Elysia<"", false, {
328
235
  chainId: number;
329
236
  address: string;
330
237
  decimals: number;
238
+ displaySymbol: string;
331
239
  verified: boolean;
332
240
  isTest: boolean;
241
+ price: number | null;
333
242
  };
334
- id: number;
335
- value: number;
336
- campaignId: string;
337
- amount: string | bigint;
338
- dailyRewardsRecordId: string;
243
+ amount: bigint;
339
244
  }[];
340
- } | undefined;
341
- name: string;
342
- type: string;
343
- tokens: {
344
- price?: number | null | undefined;
245
+ };
246
+ id: string;
247
+ depositUrl: string | undefined;
248
+ tokens: ({
345
249
  symbol: string;
346
250
  name: string | null;
347
251
  id: string;
@@ -351,280 +255,33 @@ declare const app: Elysia<"", false, {
351
255
  decimals: number;
352
256
  verified: boolean;
353
257
  isTest: boolean;
354
- }[];
355
- id: string;
356
- status: string;
357
- tags: string[];
358
- identifier: string;
258
+ } & {
259
+ price?: number | null | undefined;
260
+ })[];
359
261
  chain: {
360
262
  name: string;
361
263
  id: number;
362
264
  icon: string;
363
265
  };
364
- chainId: number;
365
- action: string;
366
- tvl: number;
367
- apr: number;
368
- dailyRewards: number;
369
- } | null)[] | {
370
- 200: ({
371
- protocol?: {
372
- name: string;
373
- url: string;
374
- description: string;
375
- id: string;
376
- tags: string[];
377
- icon: string;
378
- } | null | undefined;
379
- depositUrl?: string | undefined;
380
- aprRecord?: {
381
- timestamp: string | bigint;
382
- cumulated: number;
383
- breakdowns: {
384
- type: "CAMPAIGN" | "TOKEN" | "PROTOCOL";
385
- id: number;
386
- identifier: string;
387
- value: number;
388
- aprRecordId: string;
389
- }[];
390
- } | undefined;
391
- tvlRecord?: {
392
- total: number;
393
- timestamp: string | bigint;
394
- breakdowns: {
395
- type: "TOKEN" | "PROTOCOL";
396
- id: number;
397
- identifier: string;
398
- value: number;
399
- tvlRecordId: string;
400
- }[];
401
- } | undefined;
402
- rewardsRecord?: {
403
- total: number;
404
- id: string;
405
- timestamp: string | bigint;
406
- breakdowns: {
407
- token: {
408
- price?: number | null | undefined;
409
- symbol: string;
410
- name: string | null;
411
- id: string;
412
- icon: string;
413
- chainId: number;
414
- address: string;
415
- decimals: number;
416
- verified: boolean;
417
- isTest: boolean;
418
- };
419
- id: number;
420
- value: number;
421
- campaignId: string;
422
- amount: string | bigint;
423
- dailyRewardsRecordId: string;
424
- }[];
425
- } | undefined;
426
- name: string;
427
- type: string;
428
- tokens: {
429
- price?: number | null | undefined;
430
- symbol: string;
431
- name: string | null;
432
- id: string;
433
- icon: string;
434
- chainId: number;
435
- address: string;
436
- decimals: number;
437
- verified: boolean;
438
- isTest: boolean;
439
- }[];
440
- id: string;
441
- status: string;
442
- tags: string[];
443
- identifier: string;
444
- chain: {
445
- name: string;
446
- id: number;
447
- icon: string;
448
- };
449
- chainId: number;
450
- action: string;
451
- tvl: number;
452
- apr: number;
453
- dailyRewards: number;
454
- } | null)[];
455
- }) & ({
456
- protocol?: {
266
+ protocol: {
457
267
  name: string;
458
268
  url: string;
459
269
  description: string;
460
270
  id: string;
461
271
  tags: string[];
462
272
  icon: string;
463
- } | null | undefined;
464
- depositUrl?: string | undefined;
465
- aprRecord?: {
466
- timestamp: string | bigint;
467
- cumulated: number;
468
- breakdowns: {
469
- type: "CAMPAIGN" | "TOKEN" | "PROTOCOL";
470
- id: number;
471
- identifier: string;
472
- value: number;
473
- aprRecordId: string;
474
- }[];
475
- } | undefined;
476
- tvlRecord?: {
477
- total: number;
478
- timestamp: string | bigint;
479
- breakdowns: {
480
- type: "TOKEN" | "PROTOCOL";
481
- id: number;
482
- identifier: string;
483
- value: number;
484
- tvlRecordId: string;
485
- }[];
486
- } | undefined;
487
- rewardsRecord?: {
488
- total: number;
489
- id: string;
490
- timestamp: string | bigint;
491
- breakdowns: {
492
- token: {
493
- price?: number | null | undefined;
494
- symbol: string;
495
- name: string | null;
496
- id: string;
497
- icon: string;
498
- chainId: number;
499
- address: string;
500
- decimals: number;
501
- verified: boolean;
502
- isTest: boolean;
503
- };
504
- id: number;
505
- value: number;
506
- campaignId: string;
507
- amount: string | bigint;
508
- dailyRewardsRecordId: string;
509
- }[];
510
273
  } | undefined;
511
274
  name: string;
512
- type: string;
513
- tokens: {
514
- price?: number | null | undefined;
515
- symbol: string;
516
- name: string | null;
517
- id: string;
518
- icon: string;
519
- chainId: number;
520
- address: string;
521
- decimals: number;
522
- verified: boolean;
523
- isTest: boolean;
524
- }[];
525
- id: string;
526
- status: string;
275
+ type: import("../database/api/.generated").$Enums.CampaignType;
276
+ status: import("../database/api/.generated").$Enums.Status;
527
277
  tags: string[];
528
278
  identifier: string;
529
- chain: {
530
- name: string;
531
- id: number;
532
- icon: string;
533
- };
534
279
  chainId: number;
535
- action: string;
280
+ action: import("../database/api/.generated").$Enums.OpportunityAction;
536
281
  tvl: number;
537
282
  apr: number;
538
283
  dailyRewards: number;
539
- } | null)[];
540
- } | {
541
- 200: {
542
- 200: ({
543
- protocol?: {
544
- name: string;
545
- url: string;
546
- description: string;
547
- id: string;
548
- tags: string[];
549
- icon: string;
550
- } | null | undefined;
551
- depositUrl?: string | undefined;
552
- aprRecord?: {
553
- timestamp: string | bigint;
554
- cumulated: number;
555
- breakdowns: {
556
- type: "CAMPAIGN" | "TOKEN" | "PROTOCOL";
557
- id: number;
558
- identifier: string;
559
- value: number;
560
- aprRecordId: string;
561
- }[];
562
- } | undefined;
563
- tvlRecord?: {
564
- total: number;
565
- timestamp: string | bigint;
566
- breakdowns: {
567
- type: "TOKEN" | "PROTOCOL";
568
- id: number;
569
- identifier: string;
570
- value: number;
571
- tvlRecordId: string;
572
- }[];
573
- } | undefined;
574
- rewardsRecord?: {
575
- total: number;
576
- id: string;
577
- timestamp: string | bigint;
578
- breakdowns: {
579
- token: {
580
- price?: number | null | undefined;
581
- symbol: string;
582
- name: string | null;
583
- id: string;
584
- icon: string;
585
- chainId: number;
586
- address: string;
587
- decimals: number;
588
- verified: boolean;
589
- isTest: boolean;
590
- };
591
- id: number;
592
- value: number;
593
- campaignId: string;
594
- amount: string | bigint;
595
- dailyRewardsRecordId: string;
596
- }[];
597
- } | undefined;
598
- name: string;
599
- type: string;
600
- tokens: {
601
- price?: number | null | undefined;
602
- symbol: string;
603
- name: string | null;
604
- id: string;
605
- icon: string;
606
- chainId: number;
607
- address: string;
608
- decimals: number;
609
- verified: boolean;
610
- isTest: boolean;
611
- }[];
612
- id: string;
613
- status: string;
614
- tags: string[];
615
- identifier: string;
616
- chain: {
617
- name: string;
618
- id: number;
619
- icon: string;
620
- };
621
- chainId: number;
622
- action: string;
623
- tvl: number;
624
- apr: number;
625
- dailyRewards: number;
626
- } | null)[];
627
- };
284
+ }[];
628
285
  };
629
286
  };
630
287
  };
@@ -224,5 +224,5 @@ export declare abstract class CampaignService {
224
224
  * @param amount
225
225
  * @returns daily token amount
226
226
  */
227
- static getDailyAmount<T extends bigint | number>(start: T, end: T, amount: bigint): bigint | 0;
227
+ static getDailyAmount<T extends bigint | number>(start: T, end: T, amount: bigint): bigint;
228
228
  }
@@ -208,7 +208,7 @@ export class CampaignService {
208
208
  const timespan = Math.abs(Number(end - start));
209
209
  const isWithinTimespan = moment().unix() > start && moment().unix() < end;
210
210
  const dayspan = Math.max(1, Math.floor(timespan / (60 * 60 * 24)));
211
- const dailyAmount = isWithinTimespan ? BigInt(amount) / BigInt(dayspan) : 0;
211
+ const dailyAmount = isWithinTimespan ? BigInt(amount) / BigInt(dayspan) : 0n;
212
212
  return dailyAmount;
213
213
  }
214
214
  }