@merkl/api 0.10.325 → 0.10.327
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/eden/index.d.ts +3 -3
- package/dist/src/index.d.ts +1 -1
- package/dist/src/libs/campaigns/campaignTypes/ERC20DynamicData.js +5 -14
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/helpers/tokenType.d.ts +2 -2
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/GenericProcessor.d.ts +5 -6
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound1.d.ts +2 -3
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound1.js +2 -1
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound2.d.ts +2 -2
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound3.d.ts +1 -2
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound4.d.ts +2 -3
- package/dist/src/libs/campaigns/utils/fetchLogs.d.ts +1 -1
- package/dist/src/libs/campaigns/utils/fetchLogs.js +34 -11
- package/dist/src/libs/campaigns/utils/getCompV2ForksVaults.js +2 -0
- package/dist/src/modules/v4/apr/apr.service.js +12 -3
- package/dist/src/modules/v4/dynamicData/dynamicData.service.js +1 -1
- package/dist/src/modules/v4/programPayload/programPayload.service.js +3 -0
- package/dist/src/routes/v3/multiChainPositions.d.ts +2 -2
- package/dist/src/routes/v3/multiChainPositions.js +1 -1
- package/dist/src/routes/v3/router.d.ts +1 -1
- package/dist/src/utils/encodeCalls.d.ts +2 -2
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/src/eden/index.d.ts
CHANGED
@@ -2789,8 +2789,8 @@ declare const eden: {
|
|
2789
2789
|
headers?: Record<string, unknown> | undefined;
|
2790
2790
|
query: {
|
2791
2791
|
chainIds?: string | string[] | undefined;
|
2792
|
+
creatorTag?: string | undefined;
|
2792
2793
|
user: string;
|
2793
|
-
creatorTag: string;
|
2794
2794
|
};
|
2795
2795
|
fetch?: RequestInit | undefined;
|
2796
2796
|
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
@@ -6602,8 +6602,8 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
6602
6602
|
params: {};
|
6603
6603
|
query: {
|
6604
6604
|
chainIds?: string | string[] | undefined;
|
6605
|
+
creatorTag?: string | undefined;
|
6605
6606
|
user: string;
|
6606
|
-
creatorTag: string;
|
6607
6607
|
};
|
6608
6608
|
headers: unknown;
|
6609
6609
|
response: {
|
@@ -9783,8 +9783,8 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
9783
9783
|
headers?: Record<string, unknown> | undefined;
|
9784
9784
|
query: {
|
9785
9785
|
chainIds?: string | string[] | undefined;
|
9786
|
+
creatorTag?: string | undefined;
|
9786
9787
|
user: string;
|
9787
|
-
creatorTag: string;
|
9788
9788
|
};
|
9789
9789
|
fetch?: RequestInit | undefined;
|
9790
9790
|
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
package/dist/src/index.d.ts
CHANGED
@@ -3495,8 +3495,8 @@ declare const app: Elysia<"", false, {
|
|
3495
3495
|
params: {};
|
3496
3496
|
query: {
|
3497
3497
|
chainIds?: string | string[] | undefined;
|
3498
|
+
creatorTag?: string | undefined;
|
3498
3499
|
user: string;
|
3499
|
-
creatorTag: string;
|
3500
3500
|
};
|
3501
3501
|
headers: unknown;
|
3502
3502
|
response: {
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import { merklChainDataWithCache } from "../../merklChainData";
|
2
|
-
import { BN2Number, BalancerPoolInterface, ERC20Interface, EnzymeInterface, FactoryInterface, MetamorphoInterface, YEAR, } from "@sdk";
|
3
|
-
import { batchMulticallCallWithRetry } from "../../../utils/generic";
|
2
|
+
import { BN2Number, BalancerPoolInterface, ChainInteractionService, ERC20Interface, EnzymeInterface, FactoryInterface, MetamorphoInterface, YEAR, } from "@sdk";
|
4
3
|
import { Pricer } from "../../../utils/pricer";
|
5
4
|
import { getLastEligibilityRatio } from "../utils/getLastEligibilityRatio";
|
6
5
|
import { getTVL } from "./ERC20SubTypes/helpers/getTVL";
|
@@ -57,9 +56,7 @@ export async function ERC20DynamicData(chainId, campaigns) {
|
|
57
56
|
target: campaign.campaignParameters.targetToken,
|
58
57
|
});
|
59
58
|
}
|
60
|
-
const resultRound1 = await
|
61
|
-
calls: callsRounds1,
|
62
|
-
});
|
59
|
+
const resultRound1 = await ChainInteractionService(chainId).fetchState(callsRounds1);
|
63
60
|
const tokenTypesByCampaign = {};
|
64
61
|
// Round 2: Decode result from round 1 and get some additional info for the types before the final calls
|
65
62
|
const callsRounds2 = [];
|
@@ -75,9 +72,7 @@ export async function ERC20DynamicData(chainId, campaigns) {
|
|
75
72
|
tokenTypesByCampaign[campaign.campaignId] = typeStruct;
|
76
73
|
callsRounds2.push(...typeStruct.calls);
|
77
74
|
}
|
78
|
-
const resultRound2 = await
|
79
|
-
calls: callsRounds2,
|
80
|
-
});
|
75
|
+
const resultRound2 = await ChainInteractionService(chainId).fetchState(callsRounds2);
|
81
76
|
// Round 3: Decode result from round 2 and get some additional info for the types before the final calls
|
82
77
|
const callsRounds3 = [];
|
83
78
|
let j = 0;
|
@@ -88,9 +83,7 @@ export async function ERC20DynamicData(chainId, campaigns) {
|
|
88
83
|
j += callsForCampaign;
|
89
84
|
callsRounds3.push(...tokenTypesByCampaign[campaign.campaignId].calls);
|
90
85
|
}
|
91
|
-
const resultRound3 = await
|
92
|
-
calls: callsRounds3,
|
93
|
-
});
|
86
|
+
const resultRound3 = await ChainInteractionService(chainId).fetchState(callsRounds3);
|
94
87
|
// Final round before execute
|
95
88
|
let callsFinal = [];
|
96
89
|
j = 0;
|
@@ -101,9 +94,7 @@ export async function ERC20DynamicData(chainId, campaigns) {
|
|
101
94
|
callsFinal = callsFinal.concat(tokenTypesByCampaign[campaign.campaignId].calls);
|
102
95
|
}
|
103
96
|
// Round 4: Get the final data
|
104
|
-
const resultsFinal = await
|
105
|
-
calls: callsFinal,
|
106
|
-
});
|
97
|
+
const resultsFinal = await ChainInteractionService(chainId).fetchState(callsFinal);
|
107
98
|
j = 0;
|
108
99
|
let calls = [];
|
109
100
|
for (const campaign of campaigns) {
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type {
|
1
|
+
import type { CallDto } from "@sdk";
|
2
2
|
export declare enum tokenType {
|
3
3
|
aura = "aura",
|
4
4
|
poolside = "poolside",
|
@@ -72,6 +72,6 @@ export declare const tokenTypeToProtocol: {
|
|
72
72
|
};
|
73
73
|
export type tokenTypeStruct = {
|
74
74
|
type: tokenType;
|
75
|
-
calls:
|
75
|
+
calls: CallDto[];
|
76
76
|
typeInfo: any;
|
77
77
|
};
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import type { Pricer } from "../../../../../utils/pricer";
|
2
|
-
import { type Campaign, type CampaignParameters } from "@sdk";
|
3
|
-
import type { Multicall3 } from "libs/sdk/src/generated/Multicall";
|
2
|
+
import { type CallDto, type Campaign, type CampaignParameters } from "@sdk";
|
4
3
|
import { type tokenType, type tokenTypeStruct } from "../helpers/tokenType";
|
5
4
|
export declare enum roundType {
|
6
5
|
one = "round1",
|
@@ -62,11 +61,11 @@ export declare class GenericProcessor<Input extends callKeys, DataRaw extends da
|
|
62
61
|
computeRound3(index: number, type: tokenType, typeInfo: DataRaw, calls: string[]): tokenTypeStruct;
|
63
62
|
computeRound4(index: number, type: tokenType, typeInfo: DataRaw, calls: string[], campaign: CampaignParameters<Campaign.ERC20> | CampaignParameters<Campaign.ERC20LOGPROCESSOR> | CampaignParameters<Campaign.ERC20REBASELOGPROCESSOR> | CampaignParameters<Campaign.EULER>): tokenTypeStruct;
|
64
63
|
computeRound5(index: number, type: tokenType, typeInfo: DataRaw, calls: string[], campaign: CampaignParameters<Campaign.ERC20> | CampaignParameters<Campaign.ERC20LOGPROCESSOR> | CampaignParameters<Campaign.ERC20REBASELOGPROCESSOR> | CampaignParameters<Campaign.EULER>, pricer: Pricer): Promise<tokenTypeStruct>;
|
65
|
-
generateWhitelistCall(type: tokenType, typeInfo: DataRaw, campaign: CampaignParameters<Campaign.ERC20> | CampaignParameters<Campaign.ERC20LOGPROCESSOR> | CampaignParameters<Campaign.ERC20REBASELOGPROCESSOR> | CampaignParameters<Campaign.EULER>):
|
66
|
-
generateBlackListCall(type: tokenType, typeInfo: DataRaw, campaign: CampaignParameters<Campaign.ERC20> | CampaignParameters<Campaign.ERC20LOGPROCESSOR> | CampaignParameters<Campaign.ERC20REBASELOGPROCESSOR> | CampaignParameters<Campaign.EULER>):
|
64
|
+
generateWhitelistCall(type: tokenType, typeInfo: DataRaw, campaign: CampaignParameters<Campaign.ERC20> | CampaignParameters<Campaign.ERC20LOGPROCESSOR> | CampaignParameters<Campaign.ERC20REBASELOGPROCESSOR> | CampaignParameters<Campaign.EULER>): CallDto[];
|
65
|
+
generateBlackListCall(type: tokenType, typeInfo: DataRaw, campaign: CampaignParameters<Campaign.ERC20> | CampaignParameters<Campaign.ERC20LOGPROCESSOR> | CampaignParameters<Campaign.ERC20REBASELOGPROCESSOR> | CampaignParameters<Campaign.EULER>): CallDto[];
|
67
66
|
decodeListedSupply(index: number, decimals: number, list: string[], calls: string[]): string;
|
68
67
|
decodeRound(round: callType[], index: number, calls: string[], type: tokenType, data: DataRaw): void;
|
69
68
|
decodePreviousRound(round: roundType, calls: string[], data: DataRaw, type: tokenType, index: number): void;
|
70
|
-
encodeRound(round: callType[], callInfo: Input, type: tokenType):
|
71
|
-
encodeNextRound(round: roundType, type: tokenType, data: DataRaw):
|
69
|
+
encodeRound(round: callType[], callInfo: Input, type: tokenType): CallDto[];
|
70
|
+
encodeNextRound(round: roundType, type: tokenType, data: DataRaw): CallDto[];
|
72
71
|
}
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import { type Campaign, type CampaignParameters } from "@sdk";
|
2
|
-
import type { Multicall3 } from "libs/sdk/src/generated/Multicall";
|
1
|
+
import { type Campaign, type CampaignParameters, type ResultDto } from "@sdk";
|
3
2
|
import { type tokenTypeStruct } from "./helpers/tokenType";
|
4
|
-
export declare function getTokenTypeRound1(calls:
|
3
|
+
export declare function getTokenTypeRound1(calls: ResultDto[], targetToken: string, index: number, campaign: CampaignParameters<Campaign.ERC20> | CampaignParameters<Campaign.ERC20LOGPROCESSOR> | CampaignParameters<Campaign.ERC20REBASELOGPROCESSOR> | CampaignParameters<Campaign.EULER>): tokenTypeStruct;
|
@@ -48,7 +48,8 @@ function satisfiesNameConditions(name, type) {
|
|
48
48
|
return (lowerCaseName === "crvusd/frax" ||
|
49
49
|
lowerCaseName === "ezeth/wfrxeth" ||
|
50
50
|
lowerCaseName === "pufeth/wsteth" ||
|
51
|
-
lowerCaseName === "hai/lusd"
|
51
|
+
lowerCaseName === "hai/lusd" ||
|
52
|
+
lowerCaseName === "weth/pufeth");
|
52
53
|
case tokenType.crosscurve:
|
53
54
|
return lowerCaseName.startsWith("crosscurve") || lowerCaseName === "eywa/usdt";
|
54
55
|
case tokenType.silostaking:
|
@@ -1,3 +1,3 @@
|
|
1
|
-
import type {
|
1
|
+
import type { ResultDto } from "@sdk";
|
2
2
|
import type { tokenType, tokenTypeStruct } from "./helpers/tokenType";
|
3
|
-
export declare function getTokenTypeRound2(index: number, type: tokenType, typeInfo: any, calls:
|
3
|
+
export declare function getTokenTypeRound2(index: number, type: tokenType, typeInfo: any, calls: ResultDto[]): tokenTypeStruct;
|
@@ -1,3 +1,2 @@
|
|
1
|
-
import type { Multicall3 } from "libs/sdk/src/generated/Multicall";
|
2
1
|
import type { tokenType, tokenTypeStruct } from "./helpers/tokenType";
|
3
|
-
export declare function getTokenTypeRound3(index: number, type: tokenType, typeInfo: any, calls:
|
2
|
+
export declare function getTokenTypeRound3(index: number, type: tokenType, typeInfo: any, calls: ResultDto[]): tokenTypeStruct;
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import type { Campaign, CampaignParameters } from "@sdk";
|
2
|
-
import type { Multicall3 } from "libs/sdk/src/generated/Multicall";
|
1
|
+
import type { Campaign, CampaignParameters, ResultDto } from "@sdk";
|
3
2
|
import type { tokenType, tokenTypeStruct } from "./helpers/tokenType";
|
4
|
-
export declare function getTokenTypeRound4(index: number, type: tokenType, typeInfo: any, calls:
|
3
|
+
export declare function getTokenTypeRound4(index: number, type: tokenType, typeInfo: any, calls: ResultDto[], campaign: CampaignParameters<Campaign.ERC20> | CampaignParameters<Campaign.ERC20LOGPROCESSOR> | CampaignParameters<Campaign.ERC20REBASELOGPROCESSOR> | CampaignParameters<Campaign.EULER>): tokenTypeStruct;
|
@@ -1,10 +1,28 @@
|
|
1
1
|
import { log } from "../../../utils/logger";
|
2
2
|
import { providers } from "../../../utils/providers";
|
3
|
+
import { getContractCreationBlock } from "@sdk";
|
3
4
|
import axios from "axios";
|
4
5
|
async function fetchLogs(chainId, topics, addresses, fromBlock, toBlock) {
|
5
6
|
const url = providers[chainId].connection.url;
|
6
|
-
if (fromBlock === undefined || fromBlock === null || !toBlock) {
|
7
|
-
throw new Error(
|
7
|
+
if (fromBlock === undefined || fromBlock === null || !toBlock || fromBlock > toBlock) {
|
8
|
+
throw new Error(`fromBlock and toBlock are required and fromBlock must be less than toBlock - fromBlock: ${fromBlock} - toBlock:${toBlock}`);
|
9
|
+
}
|
10
|
+
// Take the min of all address creation blocks
|
11
|
+
if (fromBlock === 0) {
|
12
|
+
let contractCreationBlock = toBlock;
|
13
|
+
for (const address of addresses) {
|
14
|
+
try {
|
15
|
+
const aux = await getContractCreationBlock(address, providers[chainId]);
|
16
|
+
if (aux < contractCreationBlock) {
|
17
|
+
contractCreationBlock = aux;
|
18
|
+
}
|
19
|
+
}
|
20
|
+
catch {
|
21
|
+
contractCreationBlock = 0;
|
22
|
+
log.warn(`⚠️ couldn't get contract creation blocknumber for ${address}`);
|
23
|
+
}
|
24
|
+
}
|
25
|
+
fromBlock = contractCreationBlock;
|
8
26
|
}
|
9
27
|
const headers = {
|
10
28
|
accept: "application/json",
|
@@ -12,11 +30,12 @@ async function fetchLogs(chainId, topics, addresses, fromBlock, toBlock) {
|
|
12
30
|
};
|
13
31
|
let tempFromBlock = fromBlock;
|
14
32
|
let tempToBlock = toBlock;
|
15
|
-
log.
|
33
|
+
log.info(`⏳ fetching logs between blocks ${fromBlock} and ${toBlock}`);
|
16
34
|
let step = tempToBlock - tempFromBlock;
|
17
35
|
// Binary search to fetch logs and avoid errors
|
18
36
|
let logs = [];
|
19
37
|
let isRateLimitingError = false;
|
38
|
+
// let stepLimited = false;
|
20
39
|
while (true) {
|
21
40
|
try {
|
22
41
|
const data = {
|
@@ -25,9 +44,9 @@ async function fetchLogs(chainId, topics, addresses, fromBlock, toBlock) {
|
|
25
44
|
method: "eth_getLogs",
|
26
45
|
params: [
|
27
46
|
{
|
28
|
-
address:
|
47
|
+
address: addresses,
|
29
48
|
topics: topics,
|
30
|
-
fromBlock: `0x${(tempFromBlock
|
49
|
+
fromBlock: `0x${(tempFromBlock).toString(16)}`, // fromBlock is included
|
31
50
|
toBlock: `0x${tempToBlock.toString(16)}`, // toBlock is included
|
32
51
|
},
|
33
52
|
],
|
@@ -43,13 +62,17 @@ async function fetchLogs(chainId, topics, addresses, fromBlock, toBlock) {
|
|
43
62
|
if (res.data.error?.code === 413) {
|
44
63
|
throw new Error("Request entity too large");
|
45
64
|
}
|
65
|
+
// Check if we hit the maximum log limit for a single call
|
46
66
|
if (res.data.result?.length === 10000)
|
47
67
|
throw new Error("Log size exceeded");
|
48
|
-
|
49
|
-
|
68
|
+
const logsBatch = res.data.result || [];
|
69
|
+
logs = logs.concat(...logsBatch);
|
70
|
+
const batchSize = logsBatch.length;
|
71
|
+
const blockRange = tempToBlock - tempFromBlock + 1;
|
72
|
+
log.local(`fetched ${batchSize} logs between blocks ${tempFromBlock} and ${tempToBlock} (block range: ${blockRange})`);
|
50
73
|
}
|
51
74
|
catch (e) {
|
52
|
-
if (e.toString() === "Error: Request failed with status code 429") {
|
75
|
+
if (e instanceof Error && e.toString() === "Error: Request failed with status code 429") {
|
53
76
|
isRateLimitingError = true;
|
54
77
|
}
|
55
78
|
if (isRateLimitingError) {
|
@@ -59,11 +82,11 @@ async function fetchLogs(chainId, topics, addresses, fromBlock, toBlock) {
|
|
59
82
|
}
|
60
83
|
const message = `error making POST request: ${e}`;
|
61
84
|
log.error("fetchLogs", message);
|
62
|
-
throw message;
|
85
|
+
throw new Error(message);
|
63
86
|
}
|
64
87
|
if (tempToBlock === toBlock)
|
65
88
|
break;
|
66
|
-
tempFromBlock = Math.min(
|
89
|
+
tempFromBlock = Math.min(tempToBlock + 1, toBlock);
|
67
90
|
tempToBlock = Math.min(tempToBlock + step, toBlock);
|
68
91
|
}
|
69
92
|
catch {
|
@@ -74,7 +97,7 @@ async function fetchLogs(chainId, topics, addresses, fromBlock, toBlock) {
|
|
74
97
|
isRateLimitingError = false;
|
75
98
|
}
|
76
99
|
if (step === 0) {
|
77
|
-
log.error("fetchLogs", `error fetching logs for ${addresses}`);
|
100
|
+
log.error("❌ fetchLogs", `error fetching logs for ${addresses}`);
|
78
101
|
return { logs, block: tempFromBlock };
|
79
102
|
}
|
80
103
|
tempToBlock = tempFromBlock + step;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { Redis } from "../../../cache";
|
2
2
|
import { batchMulticallCallWithRetry } from "../../../utils/generic";
|
3
|
+
import { log } from "../../../utils/logger";
|
3
4
|
import { providers } from "../../../utils/providers";
|
4
5
|
import { CTokenInterface, ChainId, CompFork, Comptrollers, ERC20Interface, NULL_ADDRESS, } from "@sdk";
|
5
6
|
import { defaultAbiCoder } from "ethers/lib/utils";
|
@@ -15,6 +16,7 @@ async function getCompoundV2ForksVaults() {
|
|
15
16
|
if ([ChainId.LINEA].includes(chainId)) {
|
16
17
|
continue;
|
17
18
|
}
|
19
|
+
log.local(`Fetching Compound V2 vaults for chainId ${ChainId[chainId]} and compFork ${CompFork[compFork]}`);
|
18
20
|
const toBlock = await providers[chainId].getBlockNumber();
|
19
21
|
const comptrollerAddress = Comptrollers[compFork][chainId];
|
20
22
|
if (!comptrollerAddress) {
|
@@ -9,23 +9,32 @@ export class AprService {
|
|
9
9
|
const typesWithoutApr = [CampaignTypeV3.INVALID, CampaignTypeV3.JSON_AIRDROP, CampaignTypeV3.ERC20_SNAPSHOT];
|
10
10
|
if (typesWithoutApr.includes(type))
|
11
11
|
return { timestamp, cumulated: 0, breakdowns: [] };
|
12
|
-
let cumulated = campaignsDynamicData.reduce((sum, campaign) =>
|
12
|
+
let cumulated = campaignsDynamicData.reduce((sum, campaign) => {
|
13
|
+
const isLive = BigInt(campaign.endTimestamp) > timestamp && BigInt(campaign.startTimestamp) < timestamp;
|
14
|
+
if (!isLive)
|
15
|
+
return sum;
|
16
|
+
return sum + (Number.isNaN(Number(campaign.apr)) ? 0 : Number(campaign.apr));
|
17
|
+
}, 0) ?? 0;
|
13
18
|
cumulated = Number.isNaN(Number(cumulated)) || !Number.isFinite(cumulated) ? 0 : cumulated;
|
14
19
|
const breakdowns = campaignsDynamicData.map(campaign => {
|
20
|
+
const isLive = BigInt(campaign.endTimestamp) > timestamp && BigInt(campaign.startTimestamp) < timestamp;
|
15
21
|
return {
|
16
22
|
identifier: campaign.campaignId,
|
17
23
|
type: AprType.CAMPAIGN,
|
18
|
-
value: Number.isNaN(campaign.apr) || !Number.isFinite(campaign.apr) ? 0 : Number(campaign.apr),
|
24
|
+
value: !isLive || Number.isNaN(campaign.apr) || !Number.isFinite(campaign.apr) ? 0 : Number(campaign.apr),
|
19
25
|
};
|
20
26
|
});
|
21
27
|
if (type === CampaignTypeV3.CLAMM) {
|
22
28
|
for (const campaign of campaignsDynamicData) {
|
29
|
+
const isLive = BigInt(campaign.endTimestamp) > timestamp && BigInt(campaign.startTimestamp) < timestamp;
|
23
30
|
if (campaign.forwarders) {
|
24
31
|
for (const forwarder of campaign.forwarders) {
|
25
32
|
breakdowns.push({
|
26
33
|
identifier: forwarder.label,
|
27
34
|
type: AprType.PROTOCOL,
|
28
|
-
value: Number.isNaN(forwarder.almAPR) || !Number.isFinite(forwarder.almAPR)
|
35
|
+
value: !isLive || Number.isNaN(forwarder.almAPR) || !Number.isFinite(forwarder.almAPR)
|
36
|
+
? 0
|
37
|
+
: Number(forwarder.almAPR),
|
29
38
|
});
|
30
39
|
}
|
31
40
|
}
|
@@ -12,7 +12,7 @@ export class DynamicDataService {
|
|
12
12
|
amount: "1000000000000000000", // 1 EXR in wei
|
13
13
|
campaignSubType: 0,
|
14
14
|
chainId: chainId,
|
15
|
-
computeChainId:
|
15
|
+
computeChainId: chainId,
|
16
16
|
creator: "0xexamplecreatoraddress",
|
17
17
|
endTimestamp: 1672531199, // Example end timestamp
|
18
18
|
index: 0,
|
@@ -140,6 +140,9 @@ export class ProgramPayloadService {
|
|
140
140
|
const queryCampaign = { ...query, campaign, amount: amount };
|
141
141
|
campaignPayloads = ProgramPayloadService.buildPayload(queryCampaign, campaignPayloads);
|
142
142
|
}
|
143
|
+
else {
|
144
|
+
throw new Error(`Campaign ${campaign} not found`);
|
145
|
+
}
|
143
146
|
}
|
144
147
|
return campaignPayloads;
|
145
148
|
}
|
@@ -2,7 +2,7 @@ import type Elysia from "elysia";
|
|
2
2
|
export declare const query: import("@sinclair/typebox").TObject<{
|
3
3
|
chainIds: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>]>>;
|
4
4
|
user: import("@sinclair/typebox").TString;
|
5
|
-
creatorTag: import("@sinclair/typebox").TString
|
5
|
+
creatorTag: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
6
6
|
}>;
|
7
7
|
declare const _default: (app: Elysia) => Elysia<"", false, {
|
8
8
|
decorator: {};
|
@@ -23,8 +23,8 @@ declare const _default: (app: Elysia) => Elysia<"", false, {
|
|
23
23
|
params: {};
|
24
24
|
query: {
|
25
25
|
chainIds?: string | string[] | undefined;
|
26
|
+
creatorTag?: string | undefined;
|
26
27
|
user: string;
|
27
|
-
creatorTag: string;
|
28
28
|
};
|
29
29
|
headers: unknown;
|
30
30
|
response: {
|
@@ -8,7 +8,7 @@ import { throwOnUnsupportedChainId } from "../../utils/throw";
|
|
8
8
|
export const query = t.Object({
|
9
9
|
chainIds: t.Optional(t.Union([t.String(), t.Array(t.String())])),
|
10
10
|
user: t.String(),
|
11
|
-
creatorTag: t.String(),
|
11
|
+
creatorTag: t.Optional(t.String()),
|
12
12
|
});
|
13
13
|
export default (app) => app.use(checkQueryAddressValidity()).get("/multiChainPositions", async ({ query, set }) => {
|
14
14
|
let rawChainIds = query.chainIds;
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import { tokenType } from "../libs/campaigns/campaignTypes/ERC20SubTypes/helpers/tokenType";
|
2
|
-
import type
|
3
|
-
export declare function createCall(target: string, key: string, type?: tokenType, metaData?: any):
|
2
|
+
import { type CallDto } from "@sdk";
|
3
|
+
export declare function createCall(target: string, key: string, type?: tokenType, metaData?: any): CallDto;
|