@merkl/api 0.10.230 → 0.10.232

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 (52) hide show
  1. package/dist/database/api/.generated/edge.js +6 -12
  2. package/dist/database/api/.generated/index-browser.js +3 -8
  3. package/dist/database/api/.generated/index.d.ts +156 -124
  4. package/dist/database/api/.generated/index.js +6 -12
  5. package/dist/database/api/.generated/package.json +1 -1
  6. package/dist/database/api/.generated/schema.prisma +3 -10
  7. package/dist/database/api/.generated/wasm.js +3 -8
  8. package/dist/database/engine/.generated/edge.js +2 -3
  9. package/dist/database/engine/.generated/index.js +2 -3
  10. package/dist/database/engine/.generated/package.json +1 -1
  11. package/dist/database/engine/.generated/schema.prisma +1 -1
  12. package/dist/src/eden/index.d.ts +142 -155
  13. package/dist/src/index.d.ts +52 -55
  14. package/dist/src/modules/v4/enso/enso.service.d.ts +1 -1
  15. package/dist/src/modules/v4/interaction/interaction.controller.d.ts +2 -42
  16. package/dist/src/modules/v4/interaction/interaction.controller.js +2 -20
  17. package/dist/src/modules/v4/interaction/interaction.model.d.ts +1 -0
  18. package/dist/src/modules/v4/interaction/interaction.model.js +1 -0
  19. package/dist/src/modules/v4/interaction/interaction.service.d.ts +1 -1
  20. package/dist/src/modules/v4/interaction/interaction.service.js +2 -2
  21. package/dist/src/modules/v4/kyberzap/kyberzap.model.d.ts +1 -0
  22. package/dist/src/modules/v4/kyberzap/kyberzap.model.js +1 -0
  23. package/dist/src/modules/v4/kyberzap/kyberzap.service.d.ts +1 -1
  24. package/dist/src/modules/v4/kyberzap/kyberzap.service.js +6 -2
  25. package/dist/src/modules/v4/opportunity/opportunity.controller.d.ts +5 -3
  26. package/dist/src/modules/v4/opportunity/opportunity.controller.js +1 -2
  27. package/dist/src/modules/v4/opportunity/opportunity.model.d.ts +2 -14
  28. package/dist/src/modules/v4/opportunity/opportunity.repository.d.ts +18 -8
  29. package/dist/src/modules/v4/opportunity/opportunity.service.d.ts +9 -4
  30. package/dist/src/modules/v4/programPayload/programPayload.repository.d.ts +4 -0
  31. package/dist/src/modules/v4/programPayload/programPayload.repository.js +113 -46
  32. package/dist/src/modules/v4/protocol/protocol.controller.d.ts +6 -6
  33. package/dist/src/modules/v4/protocol/protocol.model.d.ts +3 -15
  34. package/dist/src/modules/v4/protocol/protocol.model.js +3 -4
  35. package/dist/src/modules/v4/protocol/protocol.repository.d.ts +5 -5
  36. package/dist/src/modules/v4/protocol/protocol.service.d.ts +2 -2
  37. package/dist/src/modules/v4/reward/reward.repository.d.ts +3 -2
  38. package/dist/src/modules/v4/reward/reward.service.d.ts +18 -12
  39. package/dist/src/modules/v4/router.d.ts +52 -55
  40. package/dist/src/modules/v4/token/token.controller.d.ts +33 -0
  41. package/dist/src/modules/v4/token/token.controller.js +14 -1
  42. package/dist/src/modules/v4/token/token.model.d.ts +8 -0
  43. package/dist/src/modules/v4/token/token.model.js +7 -0
  44. package/dist/src/modules/v4/token/token.service.d.ts +19 -1
  45. package/dist/src/modules/v4/token/token.service.js +10 -0
  46. package/dist/src/modules/v4/user/user.controller.d.ts +6 -4
  47. package/dist/tsconfig.package.tsbuildinfo +1 -1
  48. package/package.json +1 -1
  49. package/dist/src/modules/v4/zyfi/zyfi.model.d.ts +0 -45
  50. package/dist/src/modules/v4/zyfi/zyfi.model.js +0 -1
  51. package/dist/src/modules/v4/zyfi/zyfi.service.d.ts +0 -30
  52. package/dist/src/modules/v4/zyfi/zyfi.service.js +0 -35
@@ -1,4 +1,4 @@
1
- import type { GetTokenQueryModel, Token, TokenModel, TokenUnique, UpdateTokenModel } from "./";
1
+ import type { CreateTokenModel, GetTokenQueryModel, Token, TokenModel, TokenUnique, UpdateTokenModel } from "./";
2
2
  import type { Pricer } from "../../../utils/pricer";
3
3
  import { Prisma } from "../../../../database/api/.generated";
4
4
  import { type ChainId } from "@sdk";
@@ -110,6 +110,24 @@ export declare abstract class TokenService {
110
110
  } & {
111
111
  price?: number | null | undefined;
112
112
  }) | undefined>;
113
+ /**
114
+ * Fetches symbol, address, decimals and creates token on database
115
+ * @param chainId
116
+ * @param address
117
+ */
118
+ static fillAndCreate(token: CreateTokenModel): Promise<({
119
+ symbol: string;
120
+ name: string | null;
121
+ id: string;
122
+ icon: string;
123
+ chainId: number;
124
+ address: string;
125
+ decimals: number;
126
+ verified: boolean;
127
+ isTest: boolean;
128
+ } & {
129
+ price?: number | null | undefined;
130
+ }) | undefined>;
113
131
  /**
114
132
  * Read token from database
115
133
  * @param chainId
@@ -208,6 +208,16 @@ export class TokenService {
208
208
  const id = TokenService.hashId(token);
209
209
  return TokenRepository.upsert({ ...token, id });
210
210
  }
211
+ /**
212
+ * Fetches symbol, address, decimals and creates token on database
213
+ * @param chainId
214
+ * @param address
215
+ */
216
+ static async fillAndCreate(token) {
217
+ const id = TokenService.hashId(token);
218
+ const filledData = await TokenService.fetchOnChain({ address: token.address, chainId: token.chainId });
219
+ return TokenRepository.upsert({ ...filledData, ...token, id });
220
+ }
211
221
  /**
212
222
  * Read token from database
213
223
  * @param chainId
@@ -132,7 +132,7 @@ export declare const UserController: Elysia<"/users", false, {
132
132
  url: string;
133
133
  description: string;
134
134
  id: string;
135
- tags: import("../../../../database/api/.generated").$Enums.ProtocolTag[];
135
+ tags: string[];
136
136
  icon: string;
137
137
  }[];
138
138
  MainProtocol: {
@@ -140,7 +140,7 @@ export declare const UserController: Elysia<"/users", false, {
140
140
  url: string;
141
141
  description: string;
142
142
  id: string;
143
- tags: import("../../../../database/api/.generated").$Enums.ProtocolTag[];
143
+ tags: string[];
144
144
  icon: string;
145
145
  } | null;
146
146
  } & {
@@ -152,6 +152,7 @@ export declare const UserController: Elysia<"/users", false, {
152
152
  identifier: string;
153
153
  chainId: number;
154
154
  action: import("../../../../database/api/.generated").$Enums.OpportunityAction;
155
+ depositUrl: string | null;
155
156
  mainProtocolId: string | null;
156
157
  tvl: number;
157
158
  apr: number;
@@ -247,7 +248,7 @@ export declare const UserController: Elysia<"/users", false, {
247
248
  url: string;
248
249
  description: string;
249
250
  id: string;
250
- tags: import("../../../../database/api/.generated").$Enums.ProtocolTag[];
251
+ tags: string[];
251
252
  icon: string;
252
253
  }[];
253
254
  MainProtocol: {
@@ -255,7 +256,7 @@ export declare const UserController: Elysia<"/users", false, {
255
256
  url: string;
256
257
  description: string;
257
258
  id: string;
258
- tags: import("../../../../database/api/.generated").$Enums.ProtocolTag[];
259
+ tags: string[];
259
260
  icon: string;
260
261
  } | null;
261
262
  } & {
@@ -267,6 +268,7 @@ export declare const UserController: Elysia<"/users", false, {
267
268
  identifier: string;
268
269
  chainId: number;
269
270
  action: import("../../../../database/api/.generated").$Enums.OpportunityAction;
271
+ depositUrl: string | null;
270
272
  mainProtocolId: string | null;
271
273
  tvl: number;
272
274
  apr: number;