@merkl/api 0.10.180 → 0.10.181

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. package/dist/src/eden/index.d.ts +12 -12
  2. package/dist/src/index.d.ts +4 -4
  3. package/dist/src/libs/campaigns/campaignTypes/ERC20DynamicDataRefacto.js +3 -3
  4. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/helpers/tokenType.d.ts +2 -1
  5. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/helpers/tokenType.js +4 -0
  6. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/AuraProcessor.d.ts +1 -0
  7. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/AuraProcessor.js +12 -3
  8. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/PendleProcessor.d.ts +1 -1
  9. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/PendleProcessor.js +1 -3
  10. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/StakingProcessor.d.ts +39 -0
  11. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/StakingProcessor.js +45 -0
  12. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/processorMapping.js +2 -0
  13. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound1RefactoFinal.d.ts +2 -1
  14. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound1RefactoFinal.js +25 -1
  15. package/dist/src/modules/v4/router.d.ts +4 -4
  16. package/dist/src/modules/v4/token/token.controller.d.ts +4 -4
  17. package/dist/src/modules/v4/token/token.service.d.ts +4 -4
  18. package/dist/src/modules/v4/token/token.service.js +2 -2
  19. package/dist/src/routes/v3/blacklist.d.ts +4 -4
  20. package/dist/src/routes/v3/campaigns.d.ts +4 -4
  21. package/dist/src/routes/v3/campaignsInfo.d.ts +4 -4
  22. package/dist/src/routes/v3/multiChainPositions.d.ts +4 -4
  23. package/dist/src/routes/v3/opportunity.d.ts +4 -4
  24. package/dist/src/routes/v3/positions.d.ts +4 -4
  25. package/dist/src/routes/v3/rewards.d.ts +4 -4
  26. package/dist/src/routes/v3/updates.d.ts +4 -4
  27. package/dist/src/routes/v3/userRewards.d.ts +4 -4
  28. package/dist/src/utils/decodeCalls.js +5 -1
  29. package/dist/src/utils/encodeCalls.js +13 -1
  30. package/dist/src/utils/generateCardName.js +3 -1
  31. package/dist/tsconfig.package.tsbuildinfo +1 -1
  32. package/package.json +1 -1
@@ -788,7 +788,7 @@ declare const eden: {
788
788
  };
789
789
  fetch?: RequestInit | undefined;
790
790
  }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
791
- 200: {
791
+ 200: ({
792
792
  symbol: string;
793
793
  name: string | null;
794
794
  id: string;
@@ -796,11 +796,11 @@ declare const eden: {
796
796
  address: string;
797
797
  icon: string;
798
798
  decimals: number;
799
- displaySymbol: string;
800
799
  verified: boolean;
801
800
  isTest: boolean;
802
- price: number | null;
803
- }[];
801
+ } & {
802
+ price?: number | null | undefined;
803
+ })[];
804
804
  }>>;
805
805
  };
806
806
  count: {
@@ -2826,7 +2826,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
2826
2826
  };
2827
2827
  headers: unknown;
2828
2828
  response: {
2829
- 200: {
2829
+ 200: ({
2830
2830
  symbol: string;
2831
2831
  name: string | null;
2832
2832
  id: string;
@@ -2834,11 +2834,11 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
2834
2834
  address: string;
2835
2835
  icon: string;
2836
2836
  decimals: number;
2837
- displaySymbol: string;
2838
2837
  verified: boolean;
2839
2838
  isTest: boolean;
2840
- price: number | null;
2841
- }[];
2839
+ } & {
2840
+ price?: number | null | undefined;
2841
+ })[];
2842
2842
  };
2843
2843
  };
2844
2844
  };
@@ -5105,7 +5105,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
5105
5105
  };
5106
5106
  fetch?: RequestInit | undefined;
5107
5107
  }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
5108
- 200: {
5108
+ 200: ({
5109
5109
  symbol: string;
5110
5110
  name: string | null;
5111
5111
  id: string;
@@ -5113,11 +5113,11 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
5113
5113
  address: string;
5114
5114
  icon: string;
5115
5115
  decimals: number;
5116
- displaySymbol: string;
5117
5116
  verified: boolean;
5118
5117
  isTest: boolean;
5119
- price: number | null;
5120
- }[];
5118
+ } & {
5119
+ price?: number | null | undefined;
5120
+ })[];
5121
5121
  }>>;
5122
5122
  };
5123
5123
  count: {
@@ -901,7 +901,7 @@ declare const app: Elysia<"", false, {
901
901
  };
902
902
  headers: unknown;
903
903
  response: {
904
- 200: {
904
+ 200: ({
905
905
  symbol: string;
906
906
  name: string | null;
907
907
  id: string;
@@ -909,11 +909,11 @@ declare const app: Elysia<"", false, {
909
909
  address: string;
910
910
  icon: string;
911
911
  decimals: number;
912
- displaySymbol: string;
913
912
  verified: boolean;
914
913
  isTest: boolean;
915
- price: number | null;
916
- }[];
914
+ } & {
915
+ price?: number | null | undefined;
916
+ })[];
917
917
  };
918
918
  };
919
919
  };
@@ -64,7 +64,7 @@ export async function ERC20DynamicDataRefacto(chainId, campaigns) {
64
64
  calls: [],
65
65
  typeInfo: {},
66
66
  };
67
- typeStruct = getTokenTypeRound1(resultRound1, campaign.campaignParameters.targetToken, i);
67
+ typeStruct = getTokenTypeRound1(resultRound1, campaign.campaignParameters.targetToken, i, campaign);
68
68
  i += 5;
69
69
  tokenTypesByCampaign[campaign.campaignId] = typeStruct;
70
70
  callsRounds2.push(...typeStruct.calls);
@@ -124,8 +124,8 @@ export async function ERC20DynamicDataRefacto(chainId, campaigns) {
124
124
  const callsForCampaign = tokenTypesByCampaign[campaign.campaignId].calls.length;
125
125
  tokenTypesByCampaign[campaign.campaignId] = await getTokenPricesInfo(i, tokenTypesByCampaign[campaign.campaignId].type, tokenTypesByCampaign[campaign.campaignId].typeInfo, result, campaign, pricer);
126
126
  i += callsForCampaign;
127
- const totalSupplyTargetToken = tokenTypesByCampaign[campaign.campaignId].typeInfo.totalSupply;
128
127
  const whitelistedSupplyTargetToken = tokenTypesByCampaign[campaign.campaignId].typeInfo.whitelistedSupplyTargetToken;
128
+ const totalSupplyTargetToken = whitelistedSupplyTargetToken;
129
129
  const priceTargetToken = tokenTypesByCampaign[campaign.campaignId].typeInfo.priceTargetToken;
130
130
  let lastEligibilityRatio = 1;
131
131
  if (!!campaign.campaignParameters.hooks?.length) {
@@ -141,7 +141,7 @@ export async function ERC20DynamicDataRefacto(chainId, campaigns) {
141
141
  campaign.campaignParameters.duration /
142
142
  (whitelistedSupplyTargetToken * priceTargetToken),
143
143
  totalSupplyTargetToken,
144
- tvl: totalSupplyTargetToken * priceTargetToken,
144
+ tvl: whitelistedSupplyTargetToken * priceTargetToken,
145
145
  type: tokenTypesByCampaign[campaign.campaignId].type,
146
146
  typeInfo: tokenTypesByCampaign[campaign.campaignId].typeInfo,
147
147
  priceRewardToken: priceRewardToken,
@@ -57,7 +57,8 @@ export declare enum tokenType {
57
57
  pendleYT = "pendleYT",
58
58
  pancakeswap = "pancakeswap",
59
59
  tempestStaking = "tempestStaking",
60
- holdstation = "holdstation"
60
+ holdstation = "holdstation",
61
+ staking = "staking"
61
62
  }
62
63
  export declare const tokenTypeToProtocol: {
63
64
  [key in tokenType]: {
@@ -59,6 +59,7 @@ export var tokenType;
59
59
  tokenType["pancakeswap"] = "pancakeswap";
60
60
  tokenType["tempestStaking"] = "tempestStaking";
61
61
  tokenType["holdstation"] = "holdstation";
62
+ tokenType["staking"] = "staking";
62
63
  })(tokenType || (tokenType = {}));
63
64
  export const tokenTypeToProtocol = {
64
65
  [tokenType.aave_borrowing]: { protocol: "Aave" },
@@ -139,4 +140,7 @@ export const tokenTypeToProtocol = {
139
140
  [tokenType.holdstation]: {
140
141
  protocol: "HoldStation",
141
142
  },
143
+ [tokenType.staking]: {
144
+ protocol: "Staking",
145
+ },
142
146
  };
@@ -21,6 +21,7 @@ type callKeysAura = mandatoryCallKeys & {
21
21
  pid: string;
22
22
  gaugeBalance: string;
23
23
  auraBalance: string;
24
+ vaultBalance: string;
24
25
  };
25
26
  type dataRawAura = callKeysAura & {
26
27
  poolTokensRaw: Array<string[] | BigNumber[]>;
@@ -2,6 +2,7 @@ import { decodeCall } from "../../../../../utils/decodeCalls";
2
2
  import { createCall } from "../../../../../utils/encodeCalls";
3
3
  import { generateCardName } from "../../../../../utils/generateCardName";
4
4
  import { BN2Number } from "@sdk";
5
+ import { utils } from "ethers";
5
6
  import { GenericProcessor, roundType } from "./GenericProcessor";
6
7
  export class AuraProcessor extends GenericProcessor {
7
8
  rounds = {
@@ -21,6 +22,7 @@ export class AuraProcessor extends GenericProcessor {
21
22
  { key: "poolTokensRaw", call: "getPoolTokens", target: "vault", metaData: "poolId" },
22
23
  { key: "gaugeBalance", call: "balanceOf", target: "balancerPool", metaData: "gaugeContract" },
23
24
  { key: "auraBalance", call: "balanceOf", target: "gaugeContract", metaData: "auraStaker" },
25
+ { key: "vaultBalance", call: "balanceOf", target: "balancerPool", metaData: "vault" },
24
26
  { key: "totalSupplyGauge", call: "totalSupply", target: "gaugeContract" },
25
27
  ],
26
28
  round4: [{ key: "totalSupply", call: "totalSupply", target: "tokenAddress" }],
@@ -43,8 +45,15 @@ export class AuraProcessor extends GenericProcessor {
43
45
  }
44
46
  }
45
47
  async processingRound5(index, type, typeInfo, calls, campaign, pricer) {
46
- const { whitelistedSupplyTargetToken, totalSupply, blacklistedSupply } = this.handleWhiteListBlacklistRound5(typeInfo, campaign);
47
- const totalSupplyBalancerPool = BN2Number(typeInfo.totalSupplyBalancerPool, 18);
48
+ let { whitelistedSupplyTargetToken, totalSupply, blacklistedSupply } = this.handleWhiteListBlacklistRound5(typeInfo, campaign);
49
+ const vaultBalance = BN2Number(typeInfo.vaultBalance, 18);
50
+ const vaultIndex = campaign.campaignParameters.blacklist
51
+ ?.map(b => utils.getAddress(b))
52
+ ?.indexOf(utils.getAddress(typeInfo.vault));
53
+ if (vaultIndex !== -1) {
54
+ blacklistedSupply -= BN2Number(decodeCall(calls, index + vaultIndex, "balanceOf"), campaign.campaignParameters.decimalsTargetToken); // The vault balance was already removed from the total supply
55
+ }
56
+ const totalSupplyBalancerPool = BN2Number(typeInfo.totalSupplyBalancerPool, 18) - vaultBalance;
48
57
  const gaugeBalance = BN2Number(typeInfo.gaugeBalance, 18);
49
58
  const auraBalance = BN2Number(typeInfo.auraBalance, 18);
50
59
  const totalSupplyGauge = BN2Number(typeInfo.totalSupplyGauge, 18);
@@ -66,7 +75,7 @@ export class AuraProcessor extends GenericProcessor {
66
75
  }
67
76
  const percentageOfSupplyInAura = (auraBalance / totalSupplyGauge) * (gaugeBalance / totalSupplyBalancerPool);
68
77
  const tvl = poolTvl * percentageOfSupplyInAura;
69
- const priceTargetToken = tvl / totalSupply;
78
+ const priceTargetToken = tvl / totalSupplyBalancerPool;
70
79
  return {
71
80
  ...typeInfo,
72
81
  totalSupplyBalancerPool,
@@ -1,5 +1,5 @@
1
1
  import type { Pricer } from "../../../../../utils/pricer";
2
- import { type Campaign, type CampaignParameters } from "@sdk";
2
+ import type { Campaign, CampaignParameters } from "@sdk";
3
3
  import type { tokenType } from "../helpers/tokenType";
4
4
  import { GenericProcessor, type dataType, type mandatoryCallKeys } from "./GenericProcessor";
5
5
  type callType = {
@@ -1,5 +1,4 @@
1
1
  import { generateCardName } from "../../../../../utils/generateCardName";
2
- import { ChainId } from "@sdk";
3
2
  import { GenericProcessor } from "./GenericProcessor";
4
3
  export class PendleProcessor extends GenericProcessor {
5
4
  rounds = {
@@ -14,8 +13,7 @@ export class PendleProcessor extends GenericProcessor {
14
13
  async processingRound5(_index, type, typeInfo, _calls, campaign, pricer) {
15
14
  const { whitelistedSupplyTargetToken, totalSupply, blacklistedSupply } = this.handleWhiteListBlacklistRound5(typeInfo, campaign);
16
15
  const priceTargetToken = (await pricer.get({
17
- address: typeInfo.tokenAddress,
18
- chainId: ChainId.MAINNET,
16
+ symbol: typeInfo.tokenAddress,
19
17
  })) ?? 0;
20
18
  const tvl = priceTargetToken * totalSupply;
21
19
  return {
@@ -0,0 +1,39 @@
1
+ import type { Pricer } from "../../../../../utils/pricer";
2
+ import type { Campaign, CampaignParameters } from "@sdk";
3
+ import type { tokenType, tokenTypeStruct } from "../helpers/tokenType";
4
+ import { GenericProcessor, type dataType, type mandatoryCallKeys } from "./GenericProcessor";
5
+ type callType = {
6
+ key: keyof dataRawStaking;
7
+ call: string;
8
+ target: keyof callKeysStaking;
9
+ metaData?: keyof callKeysStaking;
10
+ optional?: boolean;
11
+ };
12
+ type callKeysStaking = mandatoryCallKeys & {
13
+ stakingContract: string;
14
+ lockNFT: string;
15
+ stakingSymbol: string;
16
+ };
17
+ type dataRawStaking = callKeysStaking & {
18
+ eip712DomainName: string;
19
+ };
20
+ type dataTypeStaking = dataType & {};
21
+ export declare class StakingProcessor extends GenericProcessor<callKeysStaking, dataRawStaking, dataTypeStaking> {
22
+ rounds: {
23
+ round1: callType[];
24
+ round2: callType[];
25
+ round3: callType[];
26
+ round4: callType[];
27
+ };
28
+ processingRound1(typeInfo: dataRawStaking): void;
29
+ processingRound2(typeInfo: dataRawStaking): void;
30
+ processingRound3(typeInfo: dataRawStaking): void;
31
+ processingRound4(typeInfo: dataRawStaking): void;
32
+ processingRound5(index: number, type: tokenType, typeInfo: dataRawStaking, calls: string[], campaign: CampaignParameters<Campaign.ERC20> | CampaignParameters<Campaign.EULER>, pricer: Pricer): Promise<dataTypeStaking>;
33
+ computeRound1(type: tokenType, typeInfo: dataRawStaking): tokenTypeStruct;
34
+ computeRound2(index: number, type: tokenType, typeInfo: dataRawStaking, calls: string[]): tokenTypeStruct;
35
+ computeRound3(index: number, type: tokenType, typeInfo: dataRawStaking, calls: string[]): tokenTypeStruct;
36
+ computeRound4(index: number, type: tokenType, typeInfo: dataRawStaking, calls: string[], campaign: CampaignParameters<Campaign.ERC20>): tokenTypeStruct;
37
+ computeRound5(index: number, type: tokenType, typeInfo: dataRawStaking, calls: string[], campaign: CampaignParameters<Campaign.ERC20> | CampaignParameters<Campaign.EULER>, pricer: Pricer): Promise<tokenTypeStruct>;
38
+ }
39
+ export {};
@@ -0,0 +1,45 @@
1
+ import { GenericProcessor } from "./GenericProcessor";
2
+ export class StakingProcessor extends GenericProcessor {
3
+ rounds = {
4
+ round1: [
5
+ { key: "lockNFT", call: "lockNFT", target: "stakingContract", optional: true },
6
+ { key: "eip712DomainName", call: "eip712DomainName", target: "stakingContract", optional: true },
7
+ ],
8
+ round2: [{ key: "stakingSymbol", call: "symbol", target: "lockNFT", optional: true }],
9
+ round3: [],
10
+ round4: [{ key: "totalSupply", call: "totalSupply", target: "tokenAddress" }],
11
+ };
12
+ // override computeRound1(): void {}
13
+ processingRound1(typeInfo) {
14
+ if (typeInfo.stakingContract === "0x18eeD20f71BEf84B605253C89A7576E3634134C0") {
15
+ typeInfo.stakingSymbol = "CyberStaking";
16
+ }
17
+ }
18
+ processingRound2(typeInfo) {
19
+ typeInfo.stakingSymbol = typeInfo.eip712DomainName;
20
+ }
21
+ processingRound3(typeInfo) {
22
+ super.processingRound3(typeInfo);
23
+ }
24
+ processingRound4(typeInfo) {
25
+ super.processingRound4(typeInfo);
26
+ }
27
+ async processingRound5(index, type, typeInfo, calls, campaign, pricer) {
28
+ return super.processingRound5(index, type, typeInfo, calls, campaign, pricer);
29
+ }
30
+ computeRound1(type, typeInfo) {
31
+ return super.computeRound1(type, typeInfo);
32
+ }
33
+ computeRound2(index, type, typeInfo, calls) {
34
+ return super.computeRound2(index, type, typeInfo, calls);
35
+ }
36
+ computeRound3(index, type, typeInfo, calls) {
37
+ return super.computeRound3(index, type, typeInfo, calls);
38
+ }
39
+ computeRound4(index, type, typeInfo, calls, campaign) {
40
+ return super.computeRound4(index, type, typeInfo, calls, campaign);
41
+ }
42
+ async computeRound5(index, type, typeInfo, calls, campaign, pricer) {
43
+ return super.computeRound5(index, type, typeInfo, calls, campaign, pricer);
44
+ }
45
+ }
@@ -21,6 +21,7 @@ import { PendleYTProcessor } from "./PendleYTProcessor";
21
21
  import { RadiantProcessor } from "./RadiantProcessor";
22
22
  import { RfxProcessor } from "./RfxProcessor";
23
23
  import { SpliceProcessor } from "./SpliceProcessor";
24
+ import { StakingProcessor } from "./StakingProcessor";
24
25
  import { SturdySiloProcessor } from "./SturdySiloProcessor";
25
26
  import { TempestVaultProcessor } from "./TempestVaultProcessor";
26
27
  import { TorosProcessor } from "./TorosProcessor";
@@ -88,4 +89,5 @@ export const processorMapping = {
88
89
  [tokenType.pancakeswap]: UniswapProcessor,
89
90
  [tokenType.tempestStaking]: TempestVaultProcessor,
90
91
  [tokenType.holdstation]: HoldStationProcessor,
92
+ [tokenType.staking]: StakingProcessor,
91
93
  };
@@ -1,3 +1,4 @@
1
+ import type { Campaign, CampaignParameters } from "@sdk";
1
2
  import type { Multicall3 } from "libs/sdk/src/generated/Multicall";
2
3
  import { type tokenTypeStruct } from "./helpers/tokenType";
3
- export declare function getTokenTypeRound1(calls: Multicall3.ResultStructOutput[], targetToken: string, index: number): tokenTypeStruct;
4
+ export declare function getTokenTypeRound1(calls: Multicall3.ResultStructOutput[], targetToken: string, index: number, campaign: CampaignParameters<Campaign.ERC20> | CampaignParameters<Campaign.EULER>): tokenTypeStruct;
@@ -179,7 +179,27 @@ function parseForBalancer(calls, index, targetToken, name) {
179
179
  // Not a balancer pool
180
180
  }
181
181
  }
182
- export function getTokenTypeRound1(calls, targetToken, index) {
182
+ function parseForStaking(campaign, calls, index, targetToken) {
183
+ try {
184
+ const whitelist = campaign.campaignParameters.whitelist;
185
+ console.log("whitelist", whitelist, whitelist.length);
186
+ if (whitelist.length === 1) {
187
+ const forwarders = campaign.campaignParameters.forwarders;
188
+ console.log("forwarders", forwarders);
189
+ if (forwarders.length === 1) {
190
+ if (forwarders[0].sender === whitelist[0]) {
191
+ const name = decodeCall(calls, index + 2, "name");
192
+ return generateResult(tokenType.staking, name, targetToken, { stakingContract: whitelist[0] });
193
+ }
194
+ }
195
+ }
196
+ }
197
+ catch (e) {
198
+ // No factory on this token
199
+ // console.log(e);
200
+ }
201
+ }
202
+ export function getTokenTypeRound1(calls, targetToken, index, campaign) {
183
203
  const returnValueOfCalls = calls.map(call => call.returnData);
184
204
  let result = parseForFactory(returnValueOfCalls, index, targetToken);
185
205
  if (result)
@@ -188,6 +208,10 @@ export function getTokenTypeRound1(calls, targetToken, index) {
188
208
  if (result)
189
209
  return result;
190
210
  result = parseForMetamorpho(returnValueOfCalls, index, targetToken);
211
+ if (result)
212
+ return result;
213
+ console.log("parsing for staking");
214
+ result = parseForStaking(campaign, returnValueOfCalls, index, targetToken);
191
215
  if (result)
192
216
  return result;
193
217
  let name;
@@ -883,7 +883,7 @@ export declare const v4: Elysia<"/v4", false, {
883
883
  };
884
884
  headers: unknown;
885
885
  response: {
886
- 200: {
886
+ 200: ({
887
887
  symbol: string;
888
888
  name: string | null;
889
889
  id: string;
@@ -891,11 +891,11 @@ export declare const v4: Elysia<"/v4", false, {
891
891
  address: string;
892
892
  icon: string;
893
893
  decimals: number;
894
- displaySymbol: string;
895
894
  verified: boolean;
896
895
  isTest: boolean;
897
- price: number | null;
898
- }[];
896
+ } & {
897
+ price?: number | null | undefined;
898
+ })[];
899
899
  };
900
900
  };
901
901
  };
@@ -87,7 +87,7 @@ export declare const TokenController: Elysia<"/tokens", false, {
87
87
  };
88
88
  headers: unknown;
89
89
  response: {
90
- 200: {
90
+ 200: ({
91
91
  symbol: string;
92
92
  name: string | null;
93
93
  id: string;
@@ -95,11 +95,11 @@ export declare const TokenController: Elysia<"/tokens", false, {
95
95
  address: string;
96
96
  icon: string;
97
97
  decimals: number;
98
- displaySymbol: string;
99
98
  verified: boolean;
100
99
  isTest: boolean;
101
- price: number | null;
102
- }[];
100
+ } & {
101
+ price?: number | null | undefined;
102
+ })[];
103
103
  };
104
104
  };
105
105
  };
@@ -133,7 +133,7 @@ export declare abstract class TokenService {
133
133
  * @param query
134
134
  * @returns A list of tokens
135
135
  */
136
- static findMany(query: GetTokenQueryModel): Promise<{
136
+ static findMany(query: GetTokenQueryModel): Promise<({
137
137
  symbol: string;
138
138
  name: string | null;
139
139
  id: string;
@@ -141,11 +141,11 @@ export declare abstract class TokenService {
141
141
  address: string;
142
142
  icon: string;
143
143
  decimals: number;
144
- displaySymbol: string;
145
144
  verified: boolean;
146
145
  isTest: boolean;
147
- price: number | null;
148
- }[]>;
146
+ } & {
147
+ price?: number | null | undefined;
148
+ })[]>;
149
149
  /**
150
150
  * Get value of tokens
151
151
  * @param tokenAmounts address/chain + amount of token
@@ -47,7 +47,7 @@ export class TokenService {
47
47
  * @param additionalTokens balances along with the verified ones
48
48
  */
49
49
  static async fetchVerifiedBalances(chainId, userAddress, additionalTokenAddresses) {
50
- const verifiedTokens = (await TokenService.findMany({ chainId: chainId, verified: true })).map(t => TokenService.format(t));
50
+ const verifiedTokens = await TokenService.findMany({ chainId: chainId, verified: true });
51
51
  const additionalTokens = !!additionalTokenAddresses?.length
52
52
  ? await TokenService.getManyOrCreate(additionalTokenAddresses?.map(address => ({ chainId, address })))
53
53
  : [];
@@ -222,7 +222,7 @@ export class TokenService {
222
222
  * @returns A list of tokens
223
223
  */
224
224
  static async findMany(query) {
225
- return await TokenRepository.findMany(query);
225
+ return (await TokenRepository.findMany(query)).map(TokenService.format);
226
226
  }
227
227
  /**
228
228
  * Get value of tokens
@@ -907,7 +907,7 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
907
907
  };
908
908
  headers: unknown;
909
909
  response: {
910
- 200: {
910
+ 200: ({
911
911
  symbol: string;
912
912
  name: string | null;
913
913
  id: string;
@@ -915,11 +915,11 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
915
915
  address: string;
916
916
  icon: string;
917
917
  decimals: number;
918
- displaySymbol: string;
919
918
  verified: boolean;
920
919
  isTest: boolean;
921
- price: number | null;
922
- }[];
920
+ } & {
921
+ price?: number | null | undefined;
922
+ })[];
923
923
  };
924
924
  };
925
925
  };
@@ -910,7 +910,7 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
910
910
  };
911
911
  headers: unknown;
912
912
  response: {
913
- 200: {
913
+ 200: ({
914
914
  symbol: string;
915
915
  name: string | null;
916
916
  id: string;
@@ -918,11 +918,11 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
918
918
  address: string;
919
919
  icon: string;
920
920
  decimals: number;
921
- displaySymbol: string;
922
921
  verified: boolean;
923
922
  isTest: boolean;
924
- price: number | null;
925
- }[];
923
+ } & {
924
+ price?: number | null | undefined;
925
+ })[];
926
926
  };
927
927
  };
928
928
  };
@@ -901,7 +901,7 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
901
901
  };
902
902
  headers: unknown;
903
903
  response: {
904
- 200: {
904
+ 200: ({
905
905
  symbol: string;
906
906
  name: string | null;
907
907
  id: string;
@@ -909,11 +909,11 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
909
909
  address: string;
910
910
  icon: string;
911
911
  decimals: number;
912
- displaySymbol: string;
913
912
  verified: boolean;
914
913
  isTest: boolean;
915
- price: number | null;
916
- }[];
914
+ } & {
915
+ price?: number | null | undefined;
916
+ })[];
917
917
  };
918
918
  };
919
919
  };
@@ -906,7 +906,7 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
906
906
  };
907
907
  headers: unknown;
908
908
  response: {
909
- 200: {
909
+ 200: ({
910
910
  symbol: string;
911
911
  name: string | null;
912
912
  id: string;
@@ -914,11 +914,11 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
914
914
  address: string;
915
915
  icon: string;
916
916
  decimals: number;
917
- displaySymbol: string;
918
917
  verified: boolean;
919
918
  isTest: boolean;
920
- price: number | null;
921
- }[];
919
+ } & {
920
+ price?: number | null | undefined;
921
+ })[];
922
922
  };
923
923
  };
924
924
  };
@@ -924,7 +924,7 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
924
924
  };
925
925
  headers: unknown;
926
926
  response: {
927
- 200: {
927
+ 200: ({
928
928
  symbol: string;
929
929
  name: string | null;
930
930
  id: string;
@@ -932,11 +932,11 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
932
932
  address: string;
933
933
  icon: string;
934
934
  decimals: number;
935
- displaySymbol: string;
936
935
  verified: boolean;
937
936
  isTest: boolean;
938
- price: number | null;
939
- }[];
937
+ } & {
938
+ price?: number | null | undefined;
939
+ })[];
940
940
  };
941
941
  };
942
942
  };
@@ -925,7 +925,7 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
925
925
  };
926
926
  headers: unknown;
927
927
  response: {
928
- 200: {
928
+ 200: ({
929
929
  symbol: string;
930
930
  name: string | null;
931
931
  id: string;
@@ -933,11 +933,11 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
933
933
  address: string;
934
934
  icon: string;
935
935
  decimals: number;
936
- displaySymbol: string;
937
936
  verified: boolean;
938
937
  isTest: boolean;
939
- price: number | null;
940
- }[];
938
+ } & {
939
+ price?: number | null | undefined;
940
+ })[];
941
941
  };
942
942
  };
943
943
  };
@@ -907,7 +907,7 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
907
907
  };
908
908
  headers: unknown;
909
909
  response: {
910
- 200: {
910
+ 200: ({
911
911
  symbol: string;
912
912
  name: string | null;
913
913
  id: string;
@@ -915,11 +915,11 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
915
915
  address: string;
916
916
  icon: string;
917
917
  decimals: number;
918
- displaySymbol: string;
919
918
  verified: boolean;
920
919
  isTest: boolean;
921
- price: number | null;
922
- }[];
920
+ } & {
921
+ price?: number | null | undefined;
922
+ })[];
923
923
  };
924
924
  };
925
925
  };