@merkl/api 0.10.91 → 0.10.93

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.
@@ -1,8 +1,28 @@
1
+ import type { ExplorerType } from "../../../../database/api/.generated";
2
+ import type { Explorer } from "./explorer.model";
1
3
  export declare abstract class ExplorerService {
4
+ static hashId(type: ExplorerType, chainId: number): string;
2
5
  static getByChainId(chainId: number): Promise<{
3
6
  id: string;
4
7
  type: import("../../../../database/api/.generated").$Enums.ExplorerType;
5
8
  url: string;
6
9
  chainId: number;
7
10
  }>;
11
+ static format(explorer: Explorer["raw"]): {
12
+ type: import("../../../../database/api/.generated").$Enums.ExplorerType;
13
+ url: string;
14
+ chainId: number;
15
+ };
16
+ /**
17
+ * Creates an explorer
18
+ * @param chainId to attach explorer to
19
+ * @param type that defines the subsequents links for transactions, addresses...
20
+ * @param url base url without / suffix
21
+ */
22
+ static create(chainId: number, type: ExplorerType, url: string): Promise<{
23
+ id: string;
24
+ type: import("../../../../database/api/.generated").$Enums.ExplorerType;
25
+ url: string;
26
+ chainId: number;
27
+ }>;
8
28
  }
@@ -806,24 +806,21 @@ export declare const v4: Elysia<"/v4", false, {
806
806
  query: unknown;
807
807
  headers: unknown;
808
808
  response: {
809
- 200: ({
810
- Explorer: {
809
+ 200: {
810
+ id: number;
811
+ name: string;
812
+ icon: string;
813
+ explorers: {
811
814
  id: string;
812
815
  type: import("../../../database/api/.generated").$Enums.ExplorerType;
813
816
  url: string;
814
817
  chainId: number;
815
818
  }[];
816
- } & {
817
- id: number;
818
- name: string;
819
- icon: string;
820
- }) | null;
819
+ } | null;
821
820
  };
822
821
  };
823
822
  };
824
- };
825
- } & {
826
- chains: {
823
+ } & {
827
824
  index: {
828
825
  get: {
829
826
  body: unknown;
@@ -833,24 +830,21 @@ export declare const v4: Elysia<"/v4", false, {
833
830
  };
834
831
  headers: unknown;
835
832
  response: {
836
- 200: ({
837
- Explorer: {
833
+ 200: {
834
+ id: number;
835
+ name: string;
836
+ icon: string;
837
+ explorers: {
838
838
  id: string;
839
839
  type: import("../../../database/api/.generated").$Enums.ExplorerType;
840
840
  url: string;
841
841
  chainId: number;
842
842
  }[];
843
- } & {
844
- id: number;
845
- name: string;
846
- icon: string;
847
- })[];
843
+ }[];
848
844
  };
849
845
  };
850
846
  };
851
- };
852
- } & {
853
- chains: {
847
+ } & {
854
848
  count: {
855
849
  get: {
856
850
  body: unknown;
@@ -864,6 +858,29 @@ export declare const v4: Elysia<"/v4", false, {
864
858
  };
865
859
  };
866
860
  };
861
+ } & {
862
+ explorers: {
863
+ post: {
864
+ body: {
865
+ type: "ETHERSCAN" | "BLOCKSCOUT";
866
+ url: string;
867
+ chainId: number;
868
+ };
869
+ params: Record<never, string>;
870
+ query: unknown;
871
+ headers: {
872
+ authorization: string;
873
+ };
874
+ response: {
875
+ 200: {
876
+ id: string;
877
+ type: import("../../../database/api/.generated").$Enums.ExplorerType;
878
+ url: string;
879
+ chainId: number;
880
+ };
881
+ };
882
+ };
883
+ };
867
884
  };
868
885
  };
869
886
  } & {
@@ -1823,6 +1840,45 @@ export declare const v4: Elysia<"/v4", false, {
1823
1840
  };
1824
1841
  };
1825
1842
  };
1843
+ } & {
1844
+ campaignStatus: {
1845
+ status: {
1846
+ get: {
1847
+ body: unknown;
1848
+ params: Record<never, string>;
1849
+ query: {
1850
+ status: "PROCESSING" | "SUCCESS" | "FAILED" | "SKIPPED" | ("PROCESSING" | "SUCCESS" | "FAILED" | "SKIPPED")[];
1851
+ };
1852
+ headers: unknown;
1853
+ response: {
1854
+ 200: ({
1855
+ Campaign: {
1856
+ id: string;
1857
+ computeChainId: number;
1858
+ distributionChainId: number;
1859
+ campaignId: string;
1860
+ type: import("../../../database/api/.generated").$Enums.CampaignType;
1861
+ subType: number | null;
1862
+ rewardTokenId: string;
1863
+ amount: string;
1864
+ opportunityId: string;
1865
+ startTimestamp: bigint;
1866
+ endTimestamp: bigint;
1867
+ params: import("../../../database/api/.generated").Prisma.JsonValue;
1868
+ creatorAddress: string;
1869
+ };
1870
+ } & {
1871
+ campaignId: string;
1872
+ computedUntil: bigint;
1873
+ processingStarted: bigint;
1874
+ status: import("../../../database/api/.generated").$Enums.RunStatus;
1875
+ error: string;
1876
+ details: import("../../../database/api/.generated").Prisma.JsonValue;
1877
+ })[];
1878
+ };
1879
+ };
1880
+ };
1881
+ };
1826
1882
  } & {
1827
1883
  campaignStatus: {
1828
1884
  unique: {
@@ -64,6 +64,45 @@ export declare const StatusController: Elysia<"/campaignStatus", false, {
64
64
  };
65
65
  };
66
66
  };
67
+ } & {
68
+ campaignStatus: {
69
+ status: {
70
+ get: {
71
+ body: unknown;
72
+ params: Record<never, string>;
73
+ query: {
74
+ status: "PROCESSING" | "SUCCESS" | "FAILED" | "SKIPPED" | ("PROCESSING" | "SUCCESS" | "FAILED" | "SKIPPED")[];
75
+ };
76
+ headers: unknown;
77
+ response: {
78
+ 200: ({
79
+ Campaign: {
80
+ id: string;
81
+ computeChainId: number;
82
+ distributionChainId: number;
83
+ campaignId: string;
84
+ type: import("../../../../database/api/.generated").$Enums.CampaignType;
85
+ subType: number | null;
86
+ rewardTokenId: string;
87
+ amount: string;
88
+ opportunityId: string;
89
+ startTimestamp: bigint;
90
+ endTimestamp: bigint;
91
+ params: import("../../../../database/api/.generated").Prisma.JsonValue;
92
+ creatorAddress: string;
93
+ };
94
+ } & {
95
+ campaignId: string;
96
+ computedUntil: bigint;
97
+ processingStarted: bigint;
98
+ status: import("../../../../database/api/.generated").$Enums.RunStatus;
99
+ error: string;
100
+ details: import("../../../../database/api/.generated").Prisma.JsonValue;
101
+ })[];
102
+ };
103
+ };
104
+ };
105
+ };
67
106
  } & {
68
107
  campaignStatus: {
69
108
  unique: {
@@ -19,5 +19,10 @@ export declare const UpdateStatusDto: import("@sinclair/typebox").TObject<{
19
19
  details: import("@sinclair/typebox").TString;
20
20
  }>]>;
21
21
  }>;
22
- export declare const ChainModel: "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function";
22
+ export declare const RunStatusDto: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"SUCCESS">, import("@sinclair/typebox").TLiteral<"FAILED">, import("@sinclair/typebox").TLiteral<"PROCESSING">, import("@sinclair/typebox").TLiteral<"SKIPPED">]>;
23
+ export declare const RunStatusListDto: import("@sinclair/typebox").TObject<{
24
+ status: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"SUCCESS">, import("@sinclair/typebox").TLiteral<"FAILED">, import("@sinclair/typebox").TLiteral<"PROCESSING">, import("@sinclair/typebox").TLiteral<"SKIPPED">]>>, import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"SUCCESS">, import("@sinclair/typebox").TLiteral<"FAILED">, import("@sinclair/typebox").TLiteral<"PROCESSING">, import("@sinclair/typebox").TLiteral<"SKIPPED">]>]>;
25
+ }>;
26
+ export type ChainModel = typeof ChainDto.static;
27
+ export type RunStatusListModel = typeof RunStatusListDto.static;
23
28
  export type UpdateStatusModel = typeof UpdateStatusDto.static;
@@ -9,6 +9,30 @@ export declare class StatusRepository {
9
9
  error: string;
10
10
  details: import("../../../../database/api/.generated").Prisma.JsonValue;
11
11
  }[]>;
12
+ static findManyByRunStatus(statuses: RunStatus[]): Promise<({
13
+ Campaign: {
14
+ id: string;
15
+ computeChainId: number;
16
+ distributionChainId: number;
17
+ campaignId: string;
18
+ type: import("../../../../database/api/.generated").$Enums.CampaignType;
19
+ subType: number | null;
20
+ rewardTokenId: string;
21
+ amount: string;
22
+ opportunityId: string;
23
+ startTimestamp: bigint;
24
+ endTimestamp: bigint;
25
+ params: import("../../../../database/api/.generated").Prisma.JsonValue;
26
+ creatorAddress: string;
27
+ };
28
+ } & {
29
+ campaignId: string;
30
+ computedUntil: bigint;
31
+ processingStarted: bigint;
32
+ status: import("../../../../database/api/.generated").$Enums.RunStatus;
33
+ error: string;
34
+ details: import("../../../../database/api/.generated").Prisma.JsonValue;
35
+ })[]>;
12
36
  static findManyPerChain(chainId: number): Promise<{
13
37
  campaignId: string;
14
38
  computedUntil: bigint;
@@ -1,5 +1,5 @@
1
1
  import { type CampaignUnique } from "../campaign";
2
- import type { UpdateStatusModel } from "./status.model";
2
+ import type { RunStatusListModel, UpdateStatusModel } from "./status.model";
3
3
  export declare class StatusService {
4
4
  static findMany(): Promise<{
5
5
  campaignId: string;
@@ -9,6 +9,30 @@ export declare class StatusService {
9
9
  error: string;
10
10
  details: import("../../../../database/api/.generated").Prisma.JsonValue;
11
11
  }[]>;
12
+ static findManyByRunStatus(x: RunStatusListModel): Promise<({
13
+ Campaign: {
14
+ id: string;
15
+ computeChainId: number;
16
+ distributionChainId: number;
17
+ campaignId: string;
18
+ type: import("../../../../database/api/.generated").$Enums.CampaignType;
19
+ subType: number | null;
20
+ rewardTokenId: string;
21
+ amount: string;
22
+ opportunityId: string;
23
+ startTimestamp: bigint;
24
+ endTimestamp: bigint;
25
+ params: import("../../../../database/api/.generated").Prisma.JsonValue;
26
+ creatorAddress: string;
27
+ };
28
+ } & {
29
+ campaignId: string;
30
+ computedUntil: bigint;
31
+ processingStarted: bigint;
32
+ status: import("../../../../database/api/.generated").$Enums.RunStatus;
33
+ error: string;
34
+ details: import("../../../../database/api/.generated").Prisma.JsonValue;
35
+ })[]>;
12
36
  static findManyPerChain(chainId: number): Promise<{
13
37
  campaignId: string;
14
38
  computedUntil: bigint;
@@ -832,24 +832,21 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
832
832
  query: unknown;
833
833
  headers: unknown;
834
834
  response: {
835
- 200: ({
836
- Explorer: {
835
+ 200: {
836
+ id: number;
837
+ name: string;
838
+ icon: string;
839
+ explorers: {
837
840
  id: string;
838
841
  type: import("../../../database/api/.generated").$Enums.ExplorerType;
839
842
  url: string;
840
843
  chainId: number;
841
844
  }[];
842
- } & {
843
- id: number;
844
- name: string;
845
- icon: string;
846
- }) | null;
845
+ } | null;
847
846
  };
848
847
  };
849
848
  };
850
- };
851
- } & {
852
- chains: {
849
+ } & {
853
850
  index: {
854
851
  get: {
855
852
  body: unknown;
@@ -859,24 +856,21 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
859
856
  };
860
857
  headers: unknown;
861
858
  response: {
862
- 200: ({
863
- Explorer: {
859
+ 200: {
860
+ id: number;
861
+ name: string;
862
+ icon: string;
863
+ explorers: {
864
864
  id: string;
865
865
  type: import("../../../database/api/.generated").$Enums.ExplorerType;
866
866
  url: string;
867
867
  chainId: number;
868
868
  }[];
869
- } & {
870
- id: number;
871
- name: string;
872
- icon: string;
873
- })[];
869
+ }[];
874
870
  };
875
871
  };
876
872
  };
877
- };
878
- } & {
879
- chains: {
873
+ } & {
880
874
  count: {
881
875
  get: {
882
876
  body: unknown;
@@ -890,6 +884,29 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
890
884
  };
891
885
  };
892
886
  };
887
+ } & {
888
+ explorers: {
889
+ post: {
890
+ body: {
891
+ type: "ETHERSCAN" | "BLOCKSCOUT";
892
+ url: string;
893
+ chainId: number;
894
+ };
895
+ params: Record<never, string>;
896
+ query: unknown;
897
+ headers: {
898
+ authorization: string;
899
+ };
900
+ response: {
901
+ 200: {
902
+ id: string;
903
+ type: import("../../../database/api/.generated").$Enums.ExplorerType;
904
+ url: string;
905
+ chainId: number;
906
+ };
907
+ };
908
+ };
909
+ };
893
910
  };
894
911
  };
895
912
  } & {
@@ -1849,6 +1866,45 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
1849
1866
  };
1850
1867
  };
1851
1868
  };
1869
+ } & {
1870
+ campaignStatus: {
1871
+ status: {
1872
+ get: {
1873
+ body: unknown;
1874
+ params: Record<never, string>;
1875
+ query: {
1876
+ status: "PROCESSING" | "SUCCESS" | "FAILED" | "SKIPPED" | ("PROCESSING" | "SUCCESS" | "FAILED" | "SKIPPED")[];
1877
+ };
1878
+ headers: unknown;
1879
+ response: {
1880
+ 200: ({
1881
+ Campaign: {
1882
+ id: string;
1883
+ computeChainId: number;
1884
+ distributionChainId: number;
1885
+ campaignId: string;
1886
+ type: import("../../../database/api/.generated").$Enums.CampaignType;
1887
+ subType: number | null;
1888
+ rewardTokenId: string;
1889
+ amount: string;
1890
+ opportunityId: string;
1891
+ startTimestamp: bigint;
1892
+ endTimestamp: bigint;
1893
+ params: import("../../../database/api/.generated").Prisma.JsonValue;
1894
+ creatorAddress: string;
1895
+ };
1896
+ } & {
1897
+ campaignId: string;
1898
+ computedUntil: bigint;
1899
+ processingStarted: bigint;
1900
+ status: import("../../../database/api/.generated").$Enums.RunStatus;
1901
+ error: string;
1902
+ details: import("../../../database/api/.generated").Prisma.JsonValue;
1903
+ })[];
1904
+ };
1905
+ };
1906
+ };
1907
+ };
1852
1908
  } & {
1853
1909
  campaignStatus: {
1854
1910
  unique: {
@@ -830,24 +830,21 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
830
830
  query: unknown;
831
831
  headers: unknown;
832
832
  response: {
833
- 200: ({
834
- Explorer: {
833
+ 200: {
834
+ id: number;
835
+ name: string;
836
+ icon: string;
837
+ explorers: {
835
838
  id: string;
836
839
  type: import("../../../database/api/.generated").$Enums.ExplorerType;
837
840
  url: string;
838
841
  chainId: number;
839
842
  }[];
840
- } & {
841
- id: number;
842
- name: string;
843
- icon: string;
844
- }) | null;
843
+ } | null;
845
844
  };
846
845
  };
847
846
  };
848
- };
849
- } & {
850
- chains: {
847
+ } & {
851
848
  index: {
852
849
  get: {
853
850
  body: unknown;
@@ -857,24 +854,21 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
857
854
  };
858
855
  headers: unknown;
859
856
  response: {
860
- 200: ({
861
- Explorer: {
857
+ 200: {
858
+ id: number;
859
+ name: string;
860
+ icon: string;
861
+ explorers: {
862
862
  id: string;
863
863
  type: import("../../../database/api/.generated").$Enums.ExplorerType;
864
864
  url: string;
865
865
  chainId: number;
866
866
  }[];
867
- } & {
868
- id: number;
869
- name: string;
870
- icon: string;
871
- })[];
867
+ }[];
872
868
  };
873
869
  };
874
870
  };
875
- };
876
- } & {
877
- chains: {
871
+ } & {
878
872
  count: {
879
873
  get: {
880
874
  body: unknown;
@@ -888,6 +882,29 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
888
882
  };
889
883
  };
890
884
  };
885
+ } & {
886
+ explorers: {
887
+ post: {
888
+ body: {
889
+ type: "ETHERSCAN" | "BLOCKSCOUT";
890
+ url: string;
891
+ chainId: number;
892
+ };
893
+ params: Record<never, string>;
894
+ query: unknown;
895
+ headers: {
896
+ authorization: string;
897
+ };
898
+ response: {
899
+ 200: {
900
+ id: string;
901
+ type: import("../../../database/api/.generated").$Enums.ExplorerType;
902
+ url: string;
903
+ chainId: number;
904
+ };
905
+ };
906
+ };
907
+ };
891
908
  };
892
909
  };
893
910
  } & {
@@ -1847,6 +1864,45 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
1847
1864
  };
1848
1865
  };
1849
1866
  };
1867
+ } & {
1868
+ campaignStatus: {
1869
+ status: {
1870
+ get: {
1871
+ body: unknown;
1872
+ params: Record<never, string>;
1873
+ query: {
1874
+ status: "PROCESSING" | "SUCCESS" | "FAILED" | "SKIPPED" | ("PROCESSING" | "SUCCESS" | "FAILED" | "SKIPPED")[];
1875
+ };
1876
+ headers: unknown;
1877
+ response: {
1878
+ 200: ({
1879
+ Campaign: {
1880
+ id: string;
1881
+ computeChainId: number;
1882
+ distributionChainId: number;
1883
+ campaignId: string;
1884
+ type: import("../../../database/api/.generated").$Enums.CampaignType;
1885
+ subType: number | null;
1886
+ rewardTokenId: string;
1887
+ amount: string;
1888
+ opportunityId: string;
1889
+ startTimestamp: bigint;
1890
+ endTimestamp: bigint;
1891
+ params: import("../../../database/api/.generated").Prisma.JsonValue;
1892
+ creatorAddress: string;
1893
+ };
1894
+ } & {
1895
+ campaignId: string;
1896
+ computedUntil: bigint;
1897
+ processingStarted: bigint;
1898
+ status: import("../../../database/api/.generated").$Enums.RunStatus;
1899
+ error: string;
1900
+ details: import("../../../database/api/.generated").Prisma.JsonValue;
1901
+ })[];
1902
+ };
1903
+ };
1904
+ };
1905
+ };
1850
1906
  } & {
1851
1907
  campaignStatus: {
1852
1908
  unique: {