@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.
- package/dist/database/api/.generated/edge.js +6 -12
- package/dist/database/api/.generated/index-browser.js +3 -8
- package/dist/database/api/.generated/index.d.ts +156 -124
- package/dist/database/api/.generated/index.js +6 -12
- package/dist/database/api/.generated/package.json +1 -1
- package/dist/database/api/.generated/schema.prisma +3 -10
- package/dist/database/api/.generated/wasm.js +3 -8
- package/dist/database/engine/.generated/edge.js +2 -3
- package/dist/database/engine/.generated/index.js +2 -3
- package/dist/database/engine/.generated/package.json +1 -1
- package/dist/database/engine/.generated/schema.prisma +1 -1
- package/dist/src/eden/index.d.ts +142 -155
- package/dist/src/index.d.ts +52 -55
- package/dist/src/modules/v4/enso/enso.service.d.ts +1 -1
- package/dist/src/modules/v4/interaction/interaction.controller.d.ts +2 -42
- package/dist/src/modules/v4/interaction/interaction.controller.js +2 -20
- package/dist/src/modules/v4/interaction/interaction.model.d.ts +1 -0
- package/dist/src/modules/v4/interaction/interaction.model.js +1 -0
- package/dist/src/modules/v4/interaction/interaction.service.d.ts +1 -1
- package/dist/src/modules/v4/interaction/interaction.service.js +2 -2
- package/dist/src/modules/v4/kyberzap/kyberzap.model.d.ts +1 -0
- package/dist/src/modules/v4/kyberzap/kyberzap.model.js +1 -0
- package/dist/src/modules/v4/kyberzap/kyberzap.service.d.ts +1 -1
- package/dist/src/modules/v4/kyberzap/kyberzap.service.js +6 -2
- package/dist/src/modules/v4/opportunity/opportunity.controller.d.ts +5 -3
- package/dist/src/modules/v4/opportunity/opportunity.controller.js +1 -2
- package/dist/src/modules/v4/opportunity/opportunity.model.d.ts +2 -14
- package/dist/src/modules/v4/opportunity/opportunity.repository.d.ts +18 -8
- package/dist/src/modules/v4/opportunity/opportunity.service.d.ts +9 -4
- package/dist/src/modules/v4/programPayload/programPayload.repository.d.ts +4 -0
- package/dist/src/modules/v4/programPayload/programPayload.repository.js +113 -46
- package/dist/src/modules/v4/protocol/protocol.controller.d.ts +6 -6
- package/dist/src/modules/v4/protocol/protocol.model.d.ts +3 -15
- package/dist/src/modules/v4/protocol/protocol.model.js +3 -4
- package/dist/src/modules/v4/protocol/protocol.repository.d.ts +5 -5
- package/dist/src/modules/v4/protocol/protocol.service.d.ts +2 -2
- package/dist/src/modules/v4/reward/reward.repository.d.ts +3 -2
- package/dist/src/modules/v4/reward/reward.service.d.ts +18 -12
- package/dist/src/modules/v4/router.d.ts +52 -55
- package/dist/src/modules/v4/token/token.controller.d.ts +33 -0
- package/dist/src/modules/v4/token/token.controller.js +14 -1
- package/dist/src/modules/v4/token/token.model.d.ts +8 -0
- package/dist/src/modules/v4/token/token.model.js +7 -0
- package/dist/src/modules/v4/token/token.service.d.ts +19 -1
- package/dist/src/modules/v4/token/token.service.js +10 -0
- package/dist/src/modules/v4/user/user.controller.d.ts +6 -4
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/src/modules/v4/zyfi/zyfi.model.d.ts +0 -45
- package/dist/src/modules/v4/zyfi/zyfi.model.js +0 -1
- package/dist/src/modules/v4/zyfi/zyfi.service.d.ts +0 -30
- 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:
|
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:
|
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:
|
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:
|
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;
|