@merkl/api 1.1.15 → 1.1.16
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/src/constants.d.ts +0 -61
- package/dist/src/eden/index.d.ts +5130 -773
- package/dist/src/engine/deprecated/dynamicData/implementations/default.d.ts +1 -1
- package/dist/src/engine/implementations/Aave/metadata.d.ts +1 -1
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/ERC4626/metadata.d.ts +31 -0
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/ERC4626/tvl.d.ts +6 -0
- package/dist/src/engine/implementations/Erc20/subTypes/index.d.ts +2 -1
- package/dist/src/engine/tvl/factory.d.ts +1 -1
- package/dist/src/index.d.ts +2432 -249
- package/dist/src/modules/v4/apr/apr.model.d.ts +8 -0
- package/dist/src/modules/v4/campaign/campaign.controller.d.ts +396 -20
- package/dist/src/modules/v4/campaign/campaign.convertor.d.ts +2 -1
- package/dist/src/modules/v4/campaign/campaign.model.d.ts +15 -17
- package/dist/src/modules/v4/campaign/campaign.repository.d.ts +63 -60
- package/dist/src/modules/v4/campaign/campaign.service.d.ts +54 -34
- package/dist/src/modules/v4/campaign/campaign.test.controller.d.ts +1168 -44
- package/dist/src/modules/v4/dynamicData/dynamicData.service.d.ts +14 -1
- package/dist/src/modules/v4/opportunity/opportunity.controller.d.ts +271 -46
- package/dist/src/modules/v4/opportunity/opportunity.converter.d.ts +6 -0
- package/dist/src/modules/v4/opportunity/opportunity.formatter.d.ts +3 -6
- package/dist/src/modules/v4/opportunity/opportunity.model.d.ts +74 -21
- package/dist/src/modules/v4/opportunity/opportunity.repository.d.ts +21 -34
- package/dist/src/modules/v4/opportunity/opportunity.service.d.ts +38 -40
- package/dist/src/modules/v4/payload/payload.controller.d.ts +468 -16
- package/dist/src/modules/v4/payload/payload.model.d.ts +10 -1
- package/dist/src/modules/v4/payload/payload.service.d.ts +379 -12
- package/dist/src/modules/v4/programPayload/programPayload.controller.d.ts +17 -3
- package/dist/src/modules/v4/programPayload/programPayload.model.d.ts +1 -1
- package/dist/src/modules/v4/programPayload/programPayload.repository.d.ts +429 -7
- package/dist/src/modules/v4/programPayload/programPayload.service.d.ts +1 -2
- package/dist/src/modules/v4/programPayload/subPayloads/hypurrFi.d.ts +11 -3
- package/dist/src/modules/v4/reward/reward.controller.d.ts +3 -3
- package/dist/src/modules/v4/reward/reward.model.d.ts +18 -4
- package/dist/src/modules/v4/reward/reward.repository.d.ts +2 -4
- package/dist/src/modules/v4/reward/reward.service.d.ts +13 -26
- package/dist/src/modules/v4/router.d.ts +2430 -250
- package/dist/src/modules/v4/token/token.controller.d.ts +14 -22
- package/dist/src/modules/v4/token/token.model.d.ts +15 -5
- package/dist/src/modules/v4/token/token.repository.d.ts +7 -11
- package/dist/src/modules/v4/token/token.service.d.ts +348 -0
- package/dist/src/modules/v4/transaction/transaction.model.d.ts +17 -0
- package/dist/src/modules/v4/user/user.controller.d.ts +2 -4
- package/dist/src/routes/v3/opportunity.d.ts +3 -0
- package/dist/src/routes/v3/payload.d.ts +1 -1
- package/dist/src/routes/v3/router.d.ts +4 -1
- package/dist/src/utils/parseDistributionType.d.ts +2 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
@@ -31,10 +31,9 @@ export declare const TokenController: Elysia<"/tokens", {
|
|
31
31
|
address: string;
|
32
32
|
id: string;
|
33
33
|
chainId: number;
|
34
|
+
type: import("@package/databases").TokenType;
|
34
35
|
icon: string;
|
35
36
|
isNative: boolean;
|
36
|
-
isPoint: boolean;
|
37
|
-
isPreTGE: boolean;
|
38
37
|
isTest: boolean;
|
39
38
|
verified: boolean;
|
40
39
|
price?: number | null | undefined;
|
@@ -76,10 +75,9 @@ export declare const TokenController: Elysia<"/tokens", {
|
|
76
75
|
address: string;
|
77
76
|
id: string;
|
78
77
|
chainId: number;
|
78
|
+
type: import("@package/databases").TokenType;
|
79
79
|
icon: string;
|
80
80
|
isNative: boolean;
|
81
|
-
isPoint: boolean;
|
82
|
-
isPreTGE: boolean;
|
83
81
|
isTest: boolean;
|
84
82
|
verified: boolean;
|
85
83
|
price?: number | null | undefined;
|
@@ -123,10 +121,9 @@ export declare const TokenController: Elysia<"/tokens", {
|
|
123
121
|
address: string;
|
124
122
|
id: string;
|
125
123
|
chainId: number;
|
124
|
+
type: import("@package/databases").TokenType;
|
126
125
|
icon: string;
|
127
126
|
isNative: boolean;
|
128
|
-
isPoint: boolean;
|
129
|
-
isPreTGE: boolean;
|
130
127
|
isTest: boolean;
|
131
128
|
verified: boolean;
|
132
129
|
displaySymbol: string;
|
@@ -152,7 +149,9 @@ export declare const TokenController: Elysia<"/tokens", {
|
|
152
149
|
params: {
|
153
150
|
chainId: number;
|
154
151
|
};
|
155
|
-
query:
|
152
|
+
query: {
|
153
|
+
tokenTypes?: ("TOKEN" | "PRETGE" | "POINT")[] | undefined;
|
154
|
+
};
|
156
155
|
headers: unknown;
|
157
156
|
response: {
|
158
157
|
200: {
|
@@ -166,10 +165,9 @@ export declare const TokenController: Elysia<"/tokens", {
|
|
166
165
|
address: string;
|
167
166
|
id: string;
|
168
167
|
chainId: number;
|
168
|
+
type: import("@package/databases").TokenType;
|
169
169
|
icon: string;
|
170
170
|
isNative: boolean;
|
171
|
-
isPoint: boolean;
|
172
|
-
isPreTGE: boolean;
|
173
171
|
isTest: boolean;
|
174
172
|
verified: boolean;
|
175
173
|
displaySymbol: string;
|
@@ -208,10 +206,9 @@ export declare const TokenController: Elysia<"/tokens", {
|
|
208
206
|
address: string;
|
209
207
|
id: string;
|
210
208
|
chainId: number;
|
209
|
+
type: import("@package/databases").TokenType;
|
211
210
|
icon: string;
|
212
211
|
isNative: boolean;
|
213
|
-
isPoint: boolean;
|
214
|
-
isPreTGE: boolean;
|
215
212
|
isTest: boolean;
|
216
213
|
verified: boolean;
|
217
214
|
} & {
|
@@ -262,10 +259,9 @@ export declare const TokenController: Elysia<"/tokens", {
|
|
262
259
|
address: string;
|
263
260
|
id: string;
|
264
261
|
chainId: number;
|
262
|
+
type: import("@package/databases").TokenType;
|
265
263
|
icon: string;
|
266
264
|
isNative: boolean;
|
267
|
-
isPoint: boolean;
|
268
|
-
isPreTGE: boolean;
|
269
265
|
isTest: boolean;
|
270
266
|
verified: boolean;
|
271
267
|
} & {
|
@@ -323,7 +319,7 @@ export declare const TokenController: Elysia<"/tokens", {
|
|
323
319
|
} & {
|
324
320
|
post: {
|
325
321
|
body: {
|
326
|
-
|
322
|
+
type?: "TOKEN" | "PRETGE" | "POINT" | undefined;
|
327
323
|
isTest?: boolean | undefined;
|
328
324
|
address: string;
|
329
325
|
chainId: number;
|
@@ -344,10 +340,9 @@ export declare const TokenController: Elysia<"/tokens", {
|
|
344
340
|
address: string;
|
345
341
|
id: string;
|
346
342
|
chainId: number;
|
343
|
+
type: import("@package/databases").TokenType;
|
347
344
|
icon: string;
|
348
345
|
isNative: boolean;
|
349
|
-
isPoint: boolean;
|
350
|
-
isPreTGE: boolean;
|
351
346
|
isTest: boolean;
|
352
347
|
verified: boolean;
|
353
348
|
displaySymbol: string;
|
@@ -368,9 +363,8 @@ export declare const TokenController: Elysia<"/tokens", {
|
|
368
363
|
patch: {
|
369
364
|
body: {
|
370
365
|
name?: string | undefined;
|
366
|
+
type?: "TOKEN" | "PRETGE" | "POINT" | undefined;
|
371
367
|
icon?: string | undefined;
|
372
|
-
isPoint?: boolean | undefined;
|
373
|
-
isPreTGE?: boolean | undefined;
|
374
368
|
isTest?: boolean | undefined;
|
375
369
|
verified?: boolean | undefined;
|
376
370
|
displaySymbol?: string | undefined;
|
@@ -391,10 +385,9 @@ export declare const TokenController: Elysia<"/tokens", {
|
|
391
385
|
address: string;
|
392
386
|
id: string;
|
393
387
|
chainId: number;
|
388
|
+
type: import("@package/databases").TokenType;
|
394
389
|
icon: string;
|
395
390
|
isNative: boolean;
|
396
|
-
isPoint: boolean;
|
397
|
-
isPreTGE: boolean;
|
398
391
|
isTest: boolean;
|
399
392
|
verified: boolean;
|
400
393
|
displaySymbol: string;
|
@@ -464,10 +457,9 @@ export declare const TokenController: Elysia<"/tokens", {
|
|
464
457
|
address: string;
|
465
458
|
id: string;
|
466
459
|
chainId: number;
|
460
|
+
type: import("@package/databases").TokenType;
|
467
461
|
icon: string;
|
468
462
|
isNative: boolean;
|
469
|
-
isPoint: boolean;
|
470
|
-
isPreTGE: boolean;
|
471
463
|
isTest: boolean;
|
472
464
|
verified: boolean;
|
473
465
|
displaySymbol: string;
|
@@ -23,10 +23,13 @@ export declare const TokenResourceDto: import("@sinclair/typebox").TObject<{
|
|
23
23
|
verified: import("@sinclair/typebox").TBoolean;
|
24
24
|
isNative: import("@sinclair/typebox").TBoolean;
|
25
25
|
isTest: import("@sinclair/typebox").TBoolean;
|
26
|
-
isPoint: import("@sinclair/typebox").TBoolean;
|
27
|
-
isPreTGE: import("@sinclair/typebox").TBoolean;
|
28
26
|
price: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TNull]>>;
|
29
27
|
symbol: import("@sinclair/typebox").TString;
|
28
|
+
type: import("@sinclair/typebox").TEnum<{
|
29
|
+
readonly TOKEN: "TOKEN";
|
30
|
+
readonly PRETGE: "PRETGE";
|
31
|
+
readonly POINT: "POINT";
|
32
|
+
}>;
|
30
33
|
}>;
|
31
34
|
export declare const FindUniqueTokenDto: import("@sinclair/typebox").TObject<{
|
32
35
|
id: import("@sinclair/typebox").TString;
|
@@ -68,8 +71,11 @@ export declare const TokenIdDto: import("@sinclair/typebox").TObject<{
|
|
68
71
|
}>;
|
69
72
|
export declare const UpdateTokenDto: import("@sinclair/typebox").TObject<{
|
70
73
|
isTest: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
71
|
-
|
72
|
-
|
74
|
+
type: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TEnum<{
|
75
|
+
readonly TOKEN: "TOKEN";
|
76
|
+
readonly PRETGE: "PRETGE";
|
77
|
+
readonly POINT: "POINT";
|
78
|
+
}>>;
|
73
79
|
verified: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
74
80
|
icon: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
75
81
|
displaySymbol: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
@@ -81,7 +87,11 @@ export declare const CreateTokenDto: import("@sinclair/typebox").TObject<{
|
|
81
87
|
icon: import("@sinclair/typebox").TString;
|
82
88
|
verified: import("@sinclair/typebox").TBoolean;
|
83
89
|
isTest: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
84
|
-
|
90
|
+
type: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TEnum<{
|
91
|
+
readonly TOKEN: "TOKEN";
|
92
|
+
readonly PRETGE: "PRETGE";
|
93
|
+
readonly POINT: "POINT";
|
94
|
+
}>>;
|
85
95
|
}>;
|
86
96
|
export declare const NotionWebhookAddTokenDto: import("@sinclair/typebox").TObject<{
|
87
97
|
data: import("@sinclair/typebox").TObject<{
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { type ChainId } from "@angleprotocol/sdk/ts";
|
2
|
+
import type { TokenType } from "@package/databases/api";
|
2
3
|
import type { GetTokenQueryModel, Token, TokenModel, UpdateTokenModel } from "./token.model";
|
3
4
|
export declare abstract class TokenRepository {
|
4
5
|
#private;
|
@@ -36,10 +37,9 @@ export declare abstract class TokenRepository {
|
|
36
37
|
address: string;
|
37
38
|
id: string;
|
38
39
|
chainId: number;
|
40
|
+
type: import("@package/databases").TokenType;
|
39
41
|
icon: string;
|
40
42
|
isNative: boolean;
|
41
|
-
isPoint: boolean;
|
42
|
-
isPreTGE: boolean;
|
43
43
|
isTest: boolean;
|
44
44
|
verified: boolean;
|
45
45
|
displaySymbol: string;
|
@@ -52,15 +52,14 @@ export declare abstract class TokenRepository {
|
|
52
52
|
address: string;
|
53
53
|
id: string;
|
54
54
|
chainId: number;
|
55
|
+
type: import("@package/databases").TokenType;
|
55
56
|
icon: string;
|
56
57
|
isNative: boolean;
|
57
|
-
isPoint: boolean;
|
58
|
-
isPreTGE: boolean;
|
59
58
|
isTest: boolean;
|
60
59
|
verified: boolean;
|
61
60
|
displaySymbol: string;
|
62
61
|
} | null>;
|
63
|
-
static findList(chainId: number, addresses: string[]): Promise<{
|
62
|
+
static findList(chainId: number, addresses: string[], types?: TokenType[]): Promise<{
|
64
63
|
symbol: string;
|
65
64
|
name: string | null;
|
66
65
|
decimals: number;
|
@@ -68,10 +67,9 @@ export declare abstract class TokenRepository {
|
|
68
67
|
address: string;
|
69
68
|
id: string;
|
70
69
|
chainId: number;
|
70
|
+
type: import("@package/databases").TokenType;
|
71
71
|
icon: string;
|
72
72
|
isNative: boolean;
|
73
|
-
isPoint: boolean;
|
74
|
-
isPreTGE: boolean;
|
75
73
|
isTest: boolean;
|
76
74
|
verified: boolean;
|
77
75
|
displaySymbol: string;
|
@@ -89,10 +87,9 @@ export declare abstract class TokenRepository {
|
|
89
87
|
address: string;
|
90
88
|
id: string;
|
91
89
|
chainId: number;
|
90
|
+
type: import("@package/databases").TokenType;
|
92
91
|
icon: string;
|
93
92
|
isNative: boolean;
|
94
|
-
isPoint: boolean;
|
95
|
-
isPreTGE: boolean;
|
96
93
|
isTest: boolean;
|
97
94
|
verified: boolean;
|
98
95
|
displaySymbol: string;
|
@@ -127,10 +124,9 @@ export declare abstract class TokenRepository {
|
|
127
124
|
address: string;
|
128
125
|
id: string;
|
129
126
|
chainId: number;
|
127
|
+
type: import("@package/databases").TokenType;
|
130
128
|
icon: string;
|
131
129
|
isNative: boolean;
|
132
|
-
isPoint: boolean;
|
133
|
-
isPreTGE: boolean;
|
134
130
|
isTest: boolean;
|
135
131
|
verified: boolean;
|
136
132
|
displaySymbol: string;
|
@@ -0,0 +1,348 @@
|
|
1
|
+
import { type Campaign, type CampaignParameters, type ChainId } from "@angleprotocol/sdk/ts";
|
2
|
+
import { TokenType } from "@package/databases";
|
3
|
+
import { Prisma } from "@package/databases/api";
|
4
|
+
import type { Pricer } from "../../../utils/pricer";
|
5
|
+
import type { CreateTokenModel, NotionWebhookModel } from "./token.model";
|
6
|
+
import type { GetTokenQueryModel, Token, TokenModel, TokenUnique, UpdateTokenModel } from "./token.model";
|
7
|
+
import { TokenRepository } from "./token.repository";
|
8
|
+
export declare abstract class TokenService {
|
9
|
+
static hashId(token: TokenUnique): string;
|
10
|
+
static format(token: Awaited<ReturnType<typeof TokenRepository.findMany>>[number]): Token["model"];
|
11
|
+
static fetchNativeBalance(chainId: number, userAddress: string): Promise<import("ethers").BigNumber>;
|
12
|
+
/**
|
13
|
+
* Fetches balances of provided tokens
|
14
|
+
*/
|
15
|
+
static fetchBalances(chainId: number, userAddress: string, tokens: Token["model"][]): Promise<(Token["model"] & {
|
16
|
+
balance: bigint;
|
17
|
+
})[]>;
|
18
|
+
/**
|
19
|
+
* Fetches tokens and include balances
|
20
|
+
*/
|
21
|
+
static fetchTokensAndBalances(chainId: number, userAddress: string, addresses: string[]): Promise<({
|
22
|
+
symbol: string;
|
23
|
+
name: string | null;
|
24
|
+
decimals: number;
|
25
|
+
address: string;
|
26
|
+
id: string;
|
27
|
+
chainId: number;
|
28
|
+
type: TokenType;
|
29
|
+
icon: string;
|
30
|
+
isNative: boolean;
|
31
|
+
isTest: boolean;
|
32
|
+
verified: boolean;
|
33
|
+
} & {
|
34
|
+
price?: number | null | undefined;
|
35
|
+
isTokenWrapper?: boolean | undefined;
|
36
|
+
tokenWrapperAddress?: string | undefined;
|
37
|
+
} & {
|
38
|
+
balance: bigint;
|
39
|
+
})[]>;
|
40
|
+
/**
|
41
|
+
* Fetches balances of verified tokens
|
42
|
+
* @info tokens that are popular and must be detected in the app are marked as 'verified'
|
43
|
+
* @param additionalTokens balances along with the verified ones
|
44
|
+
*/
|
45
|
+
static fetchVerifiedAndNativeBalances(chainId: number, userAddress: string, additionalTokenAddresses?: string[]): Promise<({
|
46
|
+
symbol: string;
|
47
|
+
name: string | null;
|
48
|
+
decimals: number;
|
49
|
+
address: string;
|
50
|
+
id: string;
|
51
|
+
chainId: number;
|
52
|
+
type: TokenType;
|
53
|
+
icon: string;
|
54
|
+
isNative: boolean;
|
55
|
+
isTest: boolean;
|
56
|
+
verified: boolean;
|
57
|
+
} & {
|
58
|
+
price?: number | null | undefined;
|
59
|
+
isTokenWrapper?: boolean | undefined;
|
60
|
+
tokenWrapperAddress?: string | undefined;
|
61
|
+
} & {
|
62
|
+
balance: bigint;
|
63
|
+
})[]>;
|
64
|
+
static fetchOnChain(token: TokenModel): Promise<Omit<Token["model"], "id">>;
|
65
|
+
static fetchManyOnChain(chainId: ChainId, addresses: string[]): Promise<{
|
66
|
+
[address: string]: Omit<{
|
67
|
+
symbol: string;
|
68
|
+
name: string | null;
|
69
|
+
decimals: number;
|
70
|
+
address: string;
|
71
|
+
id: string;
|
72
|
+
chainId: number;
|
73
|
+
type: TokenType;
|
74
|
+
icon: string;
|
75
|
+
isNative: boolean;
|
76
|
+
isTest: boolean;
|
77
|
+
verified: boolean;
|
78
|
+
} & {
|
79
|
+
price?: number | null | undefined;
|
80
|
+
isTokenWrapper?: boolean | undefined;
|
81
|
+
tokenWrapperAddress?: string | undefined;
|
82
|
+
}, "id">;
|
83
|
+
}>;
|
84
|
+
/**
|
85
|
+
* Updates price of tokens that share the same symbol
|
86
|
+
* @param symbol
|
87
|
+
* @param price value
|
88
|
+
* @param excludeAddresses to not update symbols that defined using addresses
|
89
|
+
*/
|
90
|
+
static updateSymbolPrices(symbol: string, price: number, excludeAddresses: string[]): Promise<Prisma.BatchPayload>;
|
91
|
+
/**
|
92
|
+
* Updates price of tokens that share the same address
|
93
|
+
* @param address
|
94
|
+
* @param price value
|
95
|
+
* @param chainId
|
96
|
+
*/
|
97
|
+
static updateAddressPrices(address: string, price: number, chainId?: number): Promise<Prisma.BatchPayload>;
|
98
|
+
/**
|
99
|
+
* Updates price of tokens that share the same symbol
|
100
|
+
* @param symbol
|
101
|
+
* @param price value
|
102
|
+
* @param excludeAddresses to not update symbols that defined using addresses
|
103
|
+
*/
|
104
|
+
static updatePrices(pricer: Pricer): Promise<void>;
|
105
|
+
/**
|
106
|
+
* Read token from database
|
107
|
+
* @param chainId
|
108
|
+
* @param address
|
109
|
+
*/
|
110
|
+
static findUniqueOrThrow(token: TokenUnique | string): Promise<{
|
111
|
+
symbol: string;
|
112
|
+
name: string | null;
|
113
|
+
decimals: number;
|
114
|
+
address: string;
|
115
|
+
id: string;
|
116
|
+
chainId: number;
|
117
|
+
type: TokenType;
|
118
|
+
icon: string;
|
119
|
+
isNative: boolean;
|
120
|
+
isTest: boolean;
|
121
|
+
verified: boolean;
|
122
|
+
} & {
|
123
|
+
price?: number | null | undefined;
|
124
|
+
isTokenWrapper?: boolean | undefined;
|
125
|
+
tokenWrapperAddress?: string | undefined;
|
126
|
+
}>;
|
127
|
+
/**
|
128
|
+
* Read token from database, tries to fill it if unexistant
|
129
|
+
* @param chainId
|
130
|
+
* @param address
|
131
|
+
*/
|
132
|
+
static findUniqueFillOrThrow(token: TokenUnique): Promise<{
|
133
|
+
symbol: string;
|
134
|
+
name: string | null;
|
135
|
+
decimals: number;
|
136
|
+
address: string;
|
137
|
+
id: string;
|
138
|
+
chainId: number;
|
139
|
+
type: TokenType;
|
140
|
+
icon: string;
|
141
|
+
isNative: boolean;
|
142
|
+
isTest: boolean;
|
143
|
+
verified: boolean;
|
144
|
+
} & {
|
145
|
+
price?: number | null | undefined;
|
146
|
+
isTokenWrapper?: boolean | undefined;
|
147
|
+
tokenWrapperAddress?: string | undefined;
|
148
|
+
}>;
|
149
|
+
/**
|
150
|
+
* Checks if two tokens are the same based on chainId/address combo
|
151
|
+
* @param a token
|
152
|
+
* @param b token
|
153
|
+
* @returns true if both tokens are the same
|
154
|
+
*/
|
155
|
+
static isSame(a: Pick<Token["model"], "chainId" | "address">, b: Pick<Token["model"], "chainId" | "address">): boolean;
|
156
|
+
/**
|
157
|
+
* Get the list of tokens satisfying the query
|
158
|
+
* @param query
|
159
|
+
* @returns A list of tokens
|
160
|
+
*/
|
161
|
+
static findMany(query: GetTokenQueryModel): Promise<({
|
162
|
+
symbol: string;
|
163
|
+
name: string | null;
|
164
|
+
decimals: number;
|
165
|
+
address: string;
|
166
|
+
id: string;
|
167
|
+
chainId: number;
|
168
|
+
type: TokenType;
|
169
|
+
icon: string;
|
170
|
+
isNative: boolean;
|
171
|
+
isTest: boolean;
|
172
|
+
verified: boolean;
|
173
|
+
} & {
|
174
|
+
price?: number | null | undefined;
|
175
|
+
isTokenWrapper?: boolean | undefined;
|
176
|
+
tokenWrapperAddress?: string | undefined;
|
177
|
+
})[]>;
|
178
|
+
/**
|
179
|
+
* Get the list of tokens satisfying the query or fetch if chainId and address are provided
|
180
|
+
* @param query
|
181
|
+
* @returns A list of tokens
|
182
|
+
*/
|
183
|
+
static findManyOrFetch(query: GetTokenQueryModel): Promise<({
|
184
|
+
symbol: string;
|
185
|
+
name: string | null;
|
186
|
+
decimals: number;
|
187
|
+
address: string;
|
188
|
+
id: string;
|
189
|
+
chainId: number;
|
190
|
+
type: TokenType;
|
191
|
+
icon: string;
|
192
|
+
isNative: boolean;
|
193
|
+
isTest: boolean;
|
194
|
+
verified: boolean;
|
195
|
+
} & {
|
196
|
+
price?: number | null | undefined;
|
197
|
+
isTokenWrapper?: boolean | undefined;
|
198
|
+
tokenWrapperAddress?: string | undefined;
|
199
|
+
})[]>;
|
200
|
+
static getPrice(query: Omit<GetTokenQueryModel, "page" | "items">): Promise<number>;
|
201
|
+
static findManyObjectPerAddress(query: GetTokenQueryModel): Promise<Record<string, {
|
202
|
+
symbol: string;
|
203
|
+
name: string | null;
|
204
|
+
decimals: number;
|
205
|
+
address: string;
|
206
|
+
id: string;
|
207
|
+
chainId: number;
|
208
|
+
type: TokenType;
|
209
|
+
icon: string;
|
210
|
+
isNative: boolean;
|
211
|
+
isTest: boolean;
|
212
|
+
verified: boolean;
|
213
|
+
} & {
|
214
|
+
price?: number | null | undefined;
|
215
|
+
isTokenWrapper?: boolean | undefined;
|
216
|
+
tokenWrapperAddress?: string | undefined;
|
217
|
+
}>>;
|
218
|
+
static getRewardTokenPrice(campaign: CampaignParameters<Campaign>): Promise<number>;
|
219
|
+
/**
|
220
|
+
* Get value of tokens
|
221
|
+
* @param tokenAmounts address/chain + amount of token
|
222
|
+
* @returns the cumulated dollar value of all tokens
|
223
|
+
*/
|
224
|
+
static getValue(tokenAmounts: {
|
225
|
+
amount?: bigint;
|
226
|
+
address: string;
|
227
|
+
chainId: number;
|
228
|
+
}[]): Promise<number>;
|
229
|
+
static getValueByTokenId(id: string, amount: bigint): Promise<number>;
|
230
|
+
/**
|
231
|
+
* Counts the number of tokens that complies to query
|
232
|
+
* @description used for pagination purposes
|
233
|
+
* @param query
|
234
|
+
* @returns the number of tokens
|
235
|
+
*/
|
236
|
+
static countMany(query: GetTokenQueryModel): Promise<number>;
|
237
|
+
static findChains(): Promise<Record<string, ChainId>>;
|
238
|
+
/**
|
239
|
+
* Read token from DB or fetch onchain
|
240
|
+
* @param chainId
|
241
|
+
* @param address
|
242
|
+
*/
|
243
|
+
static findManyOrCreate(tokens: TokenModel[]): Promise<({
|
244
|
+
symbol: string;
|
245
|
+
name: string | null;
|
246
|
+
decimals: number;
|
247
|
+
address: string;
|
248
|
+
id: string;
|
249
|
+
chainId: number;
|
250
|
+
type: TokenType;
|
251
|
+
icon: string;
|
252
|
+
isNative: boolean;
|
253
|
+
isTest: boolean;
|
254
|
+
verified: boolean;
|
255
|
+
} & {
|
256
|
+
price?: number | null | undefined;
|
257
|
+
isTokenWrapper?: boolean | undefined;
|
258
|
+
tokenWrapperAddress?: string | undefined;
|
259
|
+
})[]>;
|
260
|
+
static getAllValidRewardTokens(query: {
|
261
|
+
chainId?: string;
|
262
|
+
}): Promise<Record<number, {
|
263
|
+
minimumAmountPerHour: string | undefined;
|
264
|
+
isTokenWrapper: true | undefined;
|
265
|
+
tokenWrapperAddress: string | undefined;
|
266
|
+
symbol: string;
|
267
|
+
name: string | null;
|
268
|
+
decimals: number;
|
269
|
+
price: number | null;
|
270
|
+
address: string;
|
271
|
+
id: string;
|
272
|
+
chainId: number;
|
273
|
+
type: TokenType;
|
274
|
+
icon: string;
|
275
|
+
isNative: boolean;
|
276
|
+
isTest: boolean;
|
277
|
+
verified: boolean;
|
278
|
+
displaySymbol: string;
|
279
|
+
}[]>>;
|
280
|
+
static getValidRewardTokens(chainId: number, types?: TokenType[]): Promise<{
|
281
|
+
minimumAmountPerHour: string | undefined;
|
282
|
+
isTokenWrapper: true | undefined;
|
283
|
+
tokenWrapperAddress: string | undefined;
|
284
|
+
symbol: string;
|
285
|
+
name: string | null;
|
286
|
+
decimals: number;
|
287
|
+
price: number | null;
|
288
|
+
address: string;
|
289
|
+
id: string;
|
290
|
+
chainId: number;
|
291
|
+
type: TokenType;
|
292
|
+
icon: string;
|
293
|
+
isNative: boolean;
|
294
|
+
isTest: boolean;
|
295
|
+
verified: boolean;
|
296
|
+
displaySymbol: string;
|
297
|
+
}[]>;
|
298
|
+
static update(id: string, data: UpdateTokenModel): Promise<{
|
299
|
+
symbol: string;
|
300
|
+
name: string | null;
|
301
|
+
decimals: number;
|
302
|
+
price: number | null;
|
303
|
+
address: string;
|
304
|
+
id: string;
|
305
|
+
chainId: number;
|
306
|
+
type: TokenType;
|
307
|
+
icon: string;
|
308
|
+
isNative: boolean;
|
309
|
+
isTest: boolean;
|
310
|
+
verified: boolean;
|
311
|
+
displaySymbol: string;
|
312
|
+
}>;
|
313
|
+
static notionWebhook(body: NotionWebhookModel): Promise<{
|
314
|
+
symbol: string;
|
315
|
+
name: string | null;
|
316
|
+
decimals: number;
|
317
|
+
price: number | null;
|
318
|
+
address: string;
|
319
|
+
id: string;
|
320
|
+
chainId: number;
|
321
|
+
type: TokenType;
|
322
|
+
icon: string;
|
323
|
+
isNative: boolean;
|
324
|
+
isTest: boolean;
|
325
|
+
verified: boolean;
|
326
|
+
displaySymbol: string;
|
327
|
+
}>;
|
328
|
+
/**
|
329
|
+
* Fetches symbol, address, decimals and creates token on database
|
330
|
+
* @param chainId
|
331
|
+
* @param address
|
332
|
+
*/
|
333
|
+
static fillAndCreate(token: CreateTokenModel): Promise<{
|
334
|
+
symbol: string;
|
335
|
+
name: string | null;
|
336
|
+
decimals: number;
|
337
|
+
price: number | null;
|
338
|
+
address: string;
|
339
|
+
id: string;
|
340
|
+
chainId: number;
|
341
|
+
type: TokenType;
|
342
|
+
icon: string;
|
343
|
+
isNative: boolean;
|
344
|
+
isTest: boolean;
|
345
|
+
verified: boolean;
|
346
|
+
displaySymbol: string;
|
347
|
+
}>;
|
348
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
export declare const TransactionDto: import("@sinclair/typebox").TObject<{
|
2
|
+
hash: import("@sinclair/typebox").TString;
|
3
|
+
chainId: import("@sinclair/typebox").TNumber;
|
4
|
+
}>;
|
5
|
+
export declare const TransactionParametersDto: import("@sinclair/typebox").TObject<{
|
6
|
+
chainId: import("@sinclair/typebox").TNumber;
|
7
|
+
data: import("@sinclair/typebox").TString;
|
8
|
+
to: import("@sinclair/typebox").TString;
|
9
|
+
from: import("@sinclair/typebox").TString;
|
10
|
+
value: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
11
|
+
gas: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
12
|
+
maxFeePerGas: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
13
|
+
maxPriorityFeePerGas: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
14
|
+
nonce: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
15
|
+
}>;
|
16
|
+
export type TransactionModel = typeof TransactionDto.static;
|
17
|
+
export type TransactionParametersModel = typeof TransactionParametersDto.static;
|
@@ -199,10 +199,9 @@ export declare const UserController: Elysia<"/users", {
|
|
199
199
|
address: string;
|
200
200
|
id: string;
|
201
201
|
chainId: number;
|
202
|
+
type: import("@package/databases").TokenType;
|
202
203
|
icon: string;
|
203
204
|
isNative: boolean;
|
204
|
-
isPoint: boolean;
|
205
|
-
isPreTGE: boolean;
|
206
205
|
isTest: boolean;
|
207
206
|
verified: boolean;
|
208
207
|
displaySymbol: string;
|
@@ -224,10 +223,9 @@ export declare const UserController: Elysia<"/users", {
|
|
224
223
|
address: string;
|
225
224
|
id: string;
|
226
225
|
chainId: number;
|
226
|
+
type: import("@package/databases").TokenType;
|
227
227
|
icon: string;
|
228
228
|
isNative: boolean;
|
229
|
-
isPoint: boolean;
|
230
|
-
isPreTGE: boolean;
|
231
229
|
isTest: boolean;
|
232
230
|
verified: boolean;
|
233
231
|
displaySymbol: string;
|
@@ -102,6 +102,9 @@ declare const _default: (app: Elysia) => Elysia<"", {
|
|
102
102
|
[x: `61_${string}`]: import("@angleprotocol/sdk/ts").Opportunity;
|
103
103
|
[x: `62_${string}`]: import("@angleprotocol/sdk/ts").Opportunity;
|
104
104
|
[x: `63_${string}`]: import("@angleprotocol/sdk/ts").Opportunity;
|
105
|
+
[x: `64_${string}`]: import("@angleprotocol/sdk/ts").Opportunity;
|
106
|
+
[x: `65_${string}`]: import("@angleprotocol/sdk/ts").Opportunity;
|
107
|
+
[x: `66_${string}`]: import("@angleprotocol/sdk/ts").Opportunity;
|
105
108
|
};
|
106
109
|
422: {
|
107
110
|
type: "validation";
|
@@ -39,7 +39,7 @@ declare const _default: (app: Elysia) => Elysia<"", {
|
|
39
39
|
fee?: undefined;
|
40
40
|
} | {
|
41
41
|
args: import("@angleprotocol/sdk/ts").OnChainCampaignDto;
|
42
|
-
parsedCampaign: import("@angleprotocol/sdk/ts").M0Campaign | import("@angleprotocol/sdk/ts").AaveCampaign | import("@angleprotocol/sdk/ts").EigenLayerCampaign | import("@angleprotocol/sdk/ts").ERC20LogCampaign | import("@angleprotocol/sdk/ts").ERC20FixAPRCampaign | import("@angleprotocol/sdk/ts").ERC20RebaseLogCampaign | import("@angleprotocol/sdk/ts").ERC20RebaseFixAPRCampaign | import("@angleprotocol/sdk/ts").EulerCampaign | import("@angleprotocol/sdk/ts").EventBasedCampaign | import("@angleprotocol/sdk/ts").HyperDriveLogCampaign | import("@angleprotocol/sdk/ts").HyperDriveLogFixCampaign | import("@angleprotocol/sdk/ts").MorphoBorrowCampaign | import("@angleprotocol/sdk/ts").MorphoBorrowFixAPRCampaign | import("@angleprotocol/sdk/ts").MorphoCollateralCampaign | import("@angleprotocol/sdk/ts").MorphoCollateralFixAPRCampaign | import("@angleprotocol/sdk/ts").MorphoSupplyCampaign | import("@angleprotocol/sdk/ts").MorphoSupplyFixAPRCampaign | import("@angleprotocol/sdk/ts").TargetTokenCampaign | import("@angleprotocol/sdk/ts").InvalidCampaign | import("@angleprotocol/sdk/ts").ERC20Campaign | import("@angleprotocol/sdk/ts").CLAMMCampaign | import("@angleprotocol/sdk/ts").ERC20_SNAPSHOTCampaign | import("@angleprotocol/sdk/ts").JSON_AIRDROPCampaign | import("@angleprotocol/sdk/ts").SILOCampaign | import("@angleprotocol/sdk/ts").RadiantCampaign | import("@angleprotocol/sdk/ts").DolomiteCampaign | import("@angleprotocol/sdk/ts").BadgerCampaign | import("@angleprotocol/sdk/ts").CompoundCampaign | import("@angleprotocol/sdk/ts").AjnaCampaign | import("@angleprotocol/sdk/ts").UniswapV4Campaign | import("@angleprotocol/sdk/ts").EkuboCampaign | import("@angleprotocol/sdk/ts").IonCampaign | import("@angleprotocol/sdk/ts").VestCampaign | import("@angleprotocol/sdk/ts").SyncswapVaultCampaign | import("@angleprotocol/sdk/ts").AmbientCampaign | import("@angleprotocol/sdk/ts").EncompassingCampaign | import("@angleprotocol/sdk/ts").MaverickBPCampaign | import("@angleprotocol/sdk/ts").ERC6909Campaign | import("@angleprotocol/sdk/ts").ERC6909FixAPRCampaign | import("@angleprotocol/sdk/ts").CompoundV3Campaign | import("@angleprotocol/sdk/ts").CompoundV3FixAPRCampaign | import("@angleprotocol/sdk/ts").ERC721Campaign | import("@angleprotocol/sdk/ts").ERC721FixAPRCampaign | import("@angleprotocol/sdk/ts").MultiLogCampaign | import("@angleprotocol/sdk/ts").LockerCampaign | import("@angleprotocol/sdk/ts").ConvexCampaign | import("@angleprotocol/sdk/ts").StakeDAOCampaign | import("@angleprotocol/sdk/ts").MappingCampaign | import("@angleprotocol/sdk/ts").FraxLendCampaign | import("@angleprotocol/sdk/ts").FraxLendFixAPRCampaign | import("@angleprotocol/sdk/ts").SymbioticVaultCampaign | import("@angleprotocol/sdk/ts").EkuboPositionManagerCampaign | import("@angleprotocol/sdk/ts").MorphoCampaign<import("@angleprotocol/sdk/ts").MorphoSubCampaignType>;
|
42
|
+
parsedCampaign: import("@angleprotocol/sdk/ts").M0Campaign | import("@angleprotocol/sdk/ts").AaveCampaign | import("@angleprotocol/sdk/ts").EigenLayerCampaign | import("@angleprotocol/sdk/ts").ERC20LogCampaign | import("@angleprotocol/sdk/ts").ERC20FixAPRCampaign | import("@angleprotocol/sdk/ts").ERC20RebaseLogCampaign | import("@angleprotocol/sdk/ts").ERC20RebaseFixAPRCampaign | import("@angleprotocol/sdk/ts").EulerCampaign | import("@angleprotocol/sdk/ts").EventBasedCampaign | import("@angleprotocol/sdk/ts").HyperDriveLogCampaign | import("@angleprotocol/sdk/ts").HyperDriveLogFixCampaign | import("@angleprotocol/sdk/ts").MorphoBorrowCampaign | import("@angleprotocol/sdk/ts").MorphoBorrowFixAPRCampaign | import("@angleprotocol/sdk/ts").MorphoCollateralCampaign | import("@angleprotocol/sdk/ts").MorphoCollateralFixAPRCampaign | import("@angleprotocol/sdk/ts").MorphoSupplyCampaign | import("@angleprotocol/sdk/ts").MorphoSupplyFixAPRCampaign | import("@angleprotocol/sdk/ts").TargetTokenCampaign | import("@angleprotocol/sdk/ts").InvalidCampaign | import("@angleprotocol/sdk/ts").ERC20Campaign | import("@angleprotocol/sdk/ts").CLAMMCampaign | import("@angleprotocol/sdk/ts").ERC20_SNAPSHOTCampaign | import("@angleprotocol/sdk/ts").JSON_AIRDROPCampaign | import("@angleprotocol/sdk/ts").SILOCampaign | import("@angleprotocol/sdk/ts").RadiantCampaign | import("@angleprotocol/sdk/ts").DolomiteCampaign | import("@angleprotocol/sdk/ts").BadgerCampaign | import("@angleprotocol/sdk/ts").CompoundCampaign | import("@angleprotocol/sdk/ts").AjnaCampaign | import("@angleprotocol/sdk/ts").UniswapV4Campaign | import("@angleprotocol/sdk/ts").EkuboCampaign | import("@angleprotocol/sdk/ts").IonCampaign | import("@angleprotocol/sdk/ts").VestCampaign | import("@angleprotocol/sdk/ts").SyncswapVaultCampaign | import("@angleprotocol/sdk/ts").AmbientCampaign | import("@angleprotocol/sdk/ts").EncompassingCampaign | import("@angleprotocol/sdk/ts").MaverickBPCampaign | import("@angleprotocol/sdk/ts").ERC6909Campaign | import("@angleprotocol/sdk/ts").ERC6909FixAPRCampaign | import("@angleprotocol/sdk/ts").CompoundV3Campaign | import("@angleprotocol/sdk/ts").CompoundV3FixAPRCampaign | import("@angleprotocol/sdk/ts").ERC721Campaign | import("@angleprotocol/sdk/ts").ERC721FixAPRCampaign | import("@angleprotocol/sdk/ts").MultiLogCampaign | import("@angleprotocol/sdk/ts").LockerCampaign | import("@angleprotocol/sdk/ts").ConvexCampaign | import("@angleprotocol/sdk/ts").StakeDAOCampaign | import("@angleprotocol/sdk/ts").MappingCampaign | import("@angleprotocol/sdk/ts").FraxLendCampaign | import("@angleprotocol/sdk/ts").FraxLendFixAPRCampaign | import("@angleprotocol/sdk/ts").SymbioticVaultCampaign | import("@angleprotocol/sdk/ts").EkuboPositionManagerCampaign | import("@angleprotocol/sdk/ts").FluidVaultCampaign | import("@angleprotocol/sdk/ts").MorphoCampaign<import("@angleprotocol/sdk/ts").MorphoSubCampaignType>;
|
43
43
|
payload: string;
|
44
44
|
fee: string | undefined;
|
45
45
|
message?: undefined;
|