@merkl/api 0.13.15 → 0.14.0
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/jobs/etl/pendings.js +3 -1
- package/dist/src/jobs/etl/reward-breakdowns.js +3 -1
- package/dist/src/jobs/etl/rewards.js +3 -1
- package/dist/src/libs/campaigns/campaignTypes/ERC20DynamicData.d.ts +2 -1
- package/dist/src/libs/campaigns/campaignTypes/ERC20DynamicData.js +1 -1
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/EulerBorrowProcessor.d.ts +8 -12
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/EulerBorrowProcessor.js +28 -24
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/EulerLendProcessor.d.ts +7 -11
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/EulerLendProcessor.js +20 -21
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/GenericProcessor.d.ts +6 -5
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/GenericProcessor.js +4 -4
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/MaverickBPProcessor.d.ts +1 -1
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/MaverickBPProcessor.js +1 -1
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/NoLinkVaultProcessor.d.ts +1 -1
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/NoLinkVaultProcessor.js +2 -2
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/RfxProcessor.d.ts +1 -1
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/RfxProcessor.js +1 -1
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound2.d.ts +3 -2
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound2.js +2 -2
- package/dist/src/libs/campaigns/campaignsDynamicData.js +1 -2
- package/dist/src/modules/v4/bucket/bucket.model.d.ts +10 -0
- package/dist/src/modules/v4/bucket/bucket.model.js +85 -0
- package/dist/src/modules/v4/bucket/bucket.service.d.ts +8 -6
- package/dist/src/modules/v4/bucket/bucket.service.js +145 -83
- package/dist/src/modules/v4/campaign/campaign.repository.js +1 -2
- package/dist/src/modules/v4/programPayload/programPayload.repository.d.ts +4 -0
- package/dist/src/modules/v4/programPayload/programPayload.repository.js +61 -1
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/src/libs/campaigns/campaignTypes/EulerDynamicData.d.ts +0 -3
- package/dist/src/libs/campaigns/campaignTypes/EulerDynamicData.js +0 -165
@@ -17,7 +17,9 @@ const gcsClient = new S3Client({
|
|
17
17
|
endpoint: process.env.GCS_ENDPOINT,
|
18
18
|
bucket: `merkl-rewards-lake-${process.env.ENV}`,
|
19
19
|
});
|
20
|
-
|
20
|
+
let file = gcsClient.file(`pendings/${process.env.FILENAME}`);
|
21
|
+
if (!(await file.exists))
|
22
|
+
file = gcsClient.file(`pendings/${process.env.FILENAME}.gz`);
|
21
23
|
// ─── Extract ─────────────────────────────────────────────────────────────────
|
22
24
|
const extract = async () => {
|
23
25
|
if (!file.exists())
|
@@ -13,7 +13,9 @@ const gcsClient = new S3Client({
|
|
13
13
|
endpoint: process.env.GCS_ENDPOINT,
|
14
14
|
bucket: `merkl-rewards-lake-${process.env.ENV}`,
|
15
15
|
});
|
16
|
-
|
16
|
+
let file = gcsClient.file(`breakdowns/${process.env.CHAIN_ID}-${process.env.ROOT}`);
|
17
|
+
if (!(await file.exists()))
|
18
|
+
file = gcsClient.file(`breakdowns/${process.env.CHAIN_ID}-${process.env.ROOT}.gz`);
|
17
19
|
const failedBatches = [];
|
18
20
|
// ─── Extract ─────────────────────────────────────────────────────────────────
|
19
21
|
const extract = async () => {
|
@@ -13,7 +13,9 @@ const gcsClient = new S3Client({
|
|
13
13
|
endpoint: process.env.GCS_ENDPOINT,
|
14
14
|
bucket: `merkl-rewards-lake-${process.env.ENV}`,
|
15
15
|
});
|
16
|
-
|
16
|
+
let file = gcsClient.file(`rewards/${process.env.CHAIN_ID}-${process.env.ROOT}`);
|
17
|
+
if (!(await file.exists()))
|
18
|
+
file = gcsClient.file(`rewards/${process.env.CHAIN_ID}-${process.env.ROOT}.gz`);
|
17
19
|
const failedBatches = [];
|
18
20
|
// ─── Extract ─────────────────────────────────────────────────────────────────
|
19
21
|
const extract = async () => {
|
@@ -1,3 +1,4 @@
|
|
1
1
|
import { type Campaign, type CampaignDynamicData, type CampaignParameters, type MerklChainId } from "@sdk";
|
2
2
|
import type { UncachedResult } from "../../../utils/execute";
|
3
|
-
export
|
3
|
+
export type ERC20SupportedCampaignType = Campaign.ERC20 | Campaign.ERC20LOGPROCESSOR | Campaign.ERC20REBASELOGPROCESSOR | Campaign.EULER;
|
4
|
+
export declare function ERC20DynamicData(chainId: MerklChainId, campaigns: CampaignParameters<ERC20SupportedCampaignType>[]): Promise<UncachedResult<Partial<CampaignDynamicData<ERC20SupportedCampaignType>[]>>>;
|
@@ -76,7 +76,7 @@ export async function ERC20DynamicData(chainId, campaigns) {
|
|
76
76
|
for (const campaign of campaigns) {
|
77
77
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
78
78
|
const callsForCampaign = tokenTypesByCampaign[campaign.campaignId].calls.length;
|
79
|
-
tokenTypesByCampaign[campaign.campaignId] = getTokenTypeRound2(j, tokenTypesByCampaign[campaign.campaignId].type, tokenTypesByCampaign[campaign.campaignId].typeInfo, resultRound2);
|
79
|
+
tokenTypesByCampaign[campaign.campaignId] = getTokenTypeRound2(j, tokenTypesByCampaign[campaign.campaignId].type, tokenTypesByCampaign[campaign.campaignId].typeInfo, resultRound2, campaign);
|
80
80
|
j += callsForCampaign;
|
81
81
|
callsRounds3.push(...tokenTypesByCampaign[campaign.campaignId].calls);
|
82
82
|
}
|
package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/EulerBorrowProcessor.d.ts
CHANGED
@@ -9,22 +9,17 @@ type callType = {
|
|
9
9
|
metaData?: keyof callKeysEuler;
|
10
10
|
};
|
11
11
|
type callKeysEuler = mandatoryCallKeys & {
|
12
|
-
|
13
|
-
underlying: string;
|
14
|
-
symbolUnderlyingToken: string;
|
15
|
-
decimalsUnderlyingToken: string;
|
16
|
-
targetTotalAsset: string;
|
12
|
+
addressVault: string;
|
17
13
|
totalAssets: string;
|
18
14
|
};
|
19
15
|
type dataRawEuler = callKeysEuler & {};
|
20
16
|
type dataTypeEuler = dataType & {
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
17
|
+
addressVault: string;
|
18
|
+
asset: string;
|
19
|
+
symbolAsset: string;
|
20
|
+
decimalsAsset: number;
|
25
21
|
totalSupply: number;
|
26
|
-
|
27
|
-
totalAssets: string;
|
22
|
+
totalBorrows: string;
|
28
23
|
};
|
29
24
|
export declare class EulerBorrowProcessor extends GenericProcessor<callKeysEuler, dataRawEuler, dataTypeEuler> {
|
30
25
|
rounds: {
|
@@ -33,6 +28,7 @@ export declare class EulerBorrowProcessor extends GenericProcessor<callKeysEuler
|
|
33
28
|
round3: callType[];
|
34
29
|
round4: callType[];
|
35
30
|
};
|
36
|
-
|
31
|
+
processingRound2(typeInfo: dataRawEuler, campaign: CampaignParameters<Campaign.EULER>): void;
|
32
|
+
processingRound5(_index: number, type: tokenType, typeInfo: dataRawEuler, _calls: string[], campaign: CampaignParameters<Campaign.EULER>, pricer: Pricer): Promise<dataTypeEuler>;
|
37
33
|
}
|
38
34
|
export {};
|
package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/EulerBorrowProcessor.js
CHANGED
@@ -1,46 +1,50 @@
|
|
1
1
|
import { generateCardName } from "../../../../../utils/generateCardName";
|
2
|
-
import { BN2Number } from "@sdk";
|
2
|
+
import { BN2Number, EulerSubCampaignType } from "@sdk";
|
3
3
|
import { fetchEulerVaultName } from "../helpers/eulerVaultNames";
|
4
4
|
import { GenericProcessor } from "./GenericProcessor";
|
5
5
|
export class EulerBorrowProcessor extends GenericProcessor {
|
6
6
|
rounds = {
|
7
|
-
round1: [
|
8
|
-
round2: [
|
9
|
-
round3: [
|
10
|
-
{ key: "decimalsUnderlyingToken", call: "decimals", target: "underlying" },
|
11
|
-
{ key: "symbolUnderlyingToken", call: "symbol", target: "underlying" },
|
12
|
-
],
|
7
|
+
round1: [],
|
8
|
+
round2: [],
|
9
|
+
round3: [],
|
13
10
|
round4: [
|
14
11
|
{ key: "totalSupply", call: "totalSupply", target: "tokenAddress" },
|
15
|
-
{ key: "totalAssets", call: "totalAssets", target: "
|
12
|
+
{ key: "totalAssets", call: "totalAssets", target: "addressVault" },
|
16
13
|
],
|
17
14
|
};
|
18
|
-
|
15
|
+
processingRound2(typeInfo, campaign) {
|
16
|
+
typeInfo.addressVault = campaign.campaignParameters.evkAddress;
|
17
|
+
}
|
19
18
|
async processingRound5(_index, type, typeInfo, _calls, campaign, pricer) {
|
20
19
|
const { whitelistedSupplyTargetToken, totalSupply, blacklistedSupply } = this.handleWhiteListBlacklistRound5(typeInfo, campaign);
|
21
|
-
const
|
22
|
-
|
23
|
-
|
24
|
-
const
|
25
|
-
|
26
|
-
|
27
|
-
typeInfo.totalAssets, decimalsUnderlyingToken);
|
28
|
-
cardName = generateCardName(type, typeInfo, campaign);
|
29
|
-
const vaultName = await fetchEulerVaultName(typeInfo.vault, campaign.chainId);
|
20
|
+
const symbolAsset = campaign.campaignParameters.symbolAsset;
|
21
|
+
const decimalsAsset = Number(campaign.campaignParameters.decimalsAsset);
|
22
|
+
const priceAsset = (await pricer.get({ symbol: symbolAsset })) ?? 1;
|
23
|
+
const totalBorrows = BN2Number(typeInfo.totalAssets, decimalsAsset);
|
24
|
+
let cardName = generateCardName(type, typeInfo, campaign);
|
25
|
+
const vaultName = await fetchEulerVaultName(campaign.campaignParameters.evkAddress, campaign.chainId);
|
30
26
|
if (!!vaultName) {
|
31
27
|
cardName = `Borrow from ${vaultName} vault`;
|
32
28
|
}
|
33
|
-
|
29
|
+
if (campaign.campaignSubType === EulerSubCampaignType.BORROW_FROM_COLLATERAL) {
|
30
|
+
cardName = `${cardName} using ${campaign.campaignParameters.symbolCollateral}`;
|
31
|
+
// TODO
|
32
|
+
}
|
33
|
+
const tvl = priceAsset * totalBorrows;
|
34
34
|
const priceTargetToken = tvl / totalSupply;
|
35
35
|
return {
|
36
36
|
...typeInfo,
|
37
|
-
|
37
|
+
asset: campaign.campaignParameters.addressAsset,
|
38
|
+
addressVault: typeInfo.addressVault,
|
38
39
|
blacklistedSupply,
|
39
|
-
whitelistedSupplyTargetToken,
|
40
|
-
tvl,
|
41
|
-
priceTargetToken,
|
42
40
|
cardName: cardName,
|
43
|
-
|
41
|
+
decimalsAsset,
|
42
|
+
priceTargetToken,
|
43
|
+
symbolAsset,
|
44
|
+
totalBorrows: typeInfo.totalAssets.toString(),
|
45
|
+
totalSupply,
|
46
|
+
tvl,
|
47
|
+
whitelistedSupplyTargetToken,
|
44
48
|
};
|
45
49
|
}
|
46
50
|
}
|
package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/EulerLendProcessor.d.ts
CHANGED
@@ -9,21 +9,16 @@ type callType = {
|
|
9
9
|
metaData?: keyof callKeysEuler;
|
10
10
|
};
|
11
11
|
type callKeysEuler = mandatoryCallKeys & {
|
12
|
-
|
13
|
-
underlying: string;
|
14
|
-
symbolUnderlyingToken: string;
|
15
|
-
decimalsUnderlyingToken: string;
|
16
|
-
targetTotalAsset: string;
|
12
|
+
addressVault: string;
|
17
13
|
totalAssets: string;
|
18
14
|
};
|
19
15
|
type dataRawEuler = callKeysEuler & {};
|
20
16
|
type dataTypeEuler = dataType & {
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
17
|
+
addressVault: string;
|
18
|
+
asset: string;
|
19
|
+
symbolAsset: string;
|
20
|
+
decimalsAsset: number;
|
25
21
|
totalSupply: number;
|
26
|
-
targetTotalAsset: string;
|
27
22
|
totalAssets: string;
|
28
23
|
};
|
29
24
|
export declare class EulerLendProcessor extends GenericProcessor<callKeysEuler, dataRawEuler, dataTypeEuler> {
|
@@ -33,6 +28,7 @@ export declare class EulerLendProcessor extends GenericProcessor<callKeysEuler,
|
|
33
28
|
round3: callType[];
|
34
29
|
round4: callType[];
|
35
30
|
};
|
36
|
-
|
31
|
+
processingRound2(typeInfo: dataRawEuler, campaign: CampaignParameters<Campaign.EULER>): void;
|
32
|
+
processingRound5(index: number, type: tokenType, typeInfo: dataRawEuler, calls: string[], campaign: CampaignParameters<Campaign.EULER>, pricer: Pricer): Promise<dataTypeEuler>;
|
37
33
|
}
|
38
34
|
export {};
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import { decodeCall } from "../../../../../utils/decodeCalls";
|
2
1
|
import { generateCardName } from "../../../../../utils/generateCardName";
|
3
2
|
import { BN2Number } from "@sdk";
|
4
3
|
import { fetchEulerVaultName } from "../helpers/eulerVaultNames";
|
@@ -6,42 +5,42 @@ import { GenericProcessor } from "./GenericProcessor";
|
|
6
5
|
export class EulerLendProcessor extends GenericProcessor {
|
7
6
|
rounds = {
|
8
7
|
round1: [],
|
9
|
-
round2: [
|
10
|
-
round3: [
|
11
|
-
{ key: "decimalsUnderlyingToken", call: "decimals", target: "underlying" },
|
12
|
-
{ key: "symbolUnderlyingToken", call: "symbol", target: "underlying" },
|
13
|
-
],
|
8
|
+
round2: [],
|
9
|
+
round3: [],
|
14
10
|
round4: [
|
15
11
|
{ key: "totalSupply", call: "totalSupply", target: "tokenAddress" },
|
16
12
|
{ key: "totalAssets", call: "totalAssets", target: "tokenAddress" },
|
17
13
|
],
|
18
14
|
};
|
19
|
-
|
15
|
+
processingRound2(typeInfo, campaign) {
|
16
|
+
typeInfo.addressVault = campaign.campaignParameters.evkAddress;
|
17
|
+
}
|
20
18
|
async processingRound5(index, type, typeInfo, calls, campaign, pricer) {
|
21
19
|
const { whitelistedSupplyTargetToken, totalSupply, blacklistedSupply } = this.handleWhiteListBlacklistRound5(typeInfo, campaign);
|
22
|
-
const
|
23
|
-
|
24
|
-
|
25
|
-
const
|
26
|
-
|
27
|
-
// eulerInterface.decodeFunctionResult("totalAssets", calls[index++])[0],
|
28
|
-
decodeCall(calls, index++, "totalAssets", type), decimalsUnderlyingToken);
|
29
|
-
cardName = generateCardName(type, typeInfo, campaign);
|
20
|
+
const symbolAsset = campaign.campaignParameters.symbolAsset;
|
21
|
+
const decimalsAsset = Number(campaign.campaignParameters.decimalsAsset);
|
22
|
+
const priceAsset = (await pricer.get({ symbol: symbolAsset })) ?? 1;
|
23
|
+
const totalAssets = BN2Number(typeInfo.totalAssets, decimalsAsset);
|
24
|
+
let cardName = generateCardName(type, typeInfo, campaign);
|
30
25
|
const vaultName = await fetchEulerVaultName(typeInfo.tokenAddress, campaign.chainId);
|
31
26
|
if (!!vaultName) {
|
32
|
-
cardName = `Supply ${
|
27
|
+
cardName = `Supply ${symbolAsset} on ${vaultName} vault`;
|
33
28
|
}
|
34
|
-
const tvl =
|
29
|
+
const tvl = priceAsset * totalAssets;
|
35
30
|
const priceTargetToken = tvl / totalSupply;
|
36
31
|
return {
|
37
32
|
...typeInfo,
|
38
|
-
|
33
|
+
asset: campaign.campaignParameters.addressAsset,
|
34
|
+
addressVault: typeInfo.addressVault,
|
39
35
|
blacklistedSupply,
|
36
|
+
cardName: cardName,
|
37
|
+
decimalsAsset,
|
38
|
+
priceTargetToken,
|
39
|
+
symbolAsset,
|
40
|
+
totalAssets: typeInfo.totalAssets.toString(),
|
41
|
+
totalSupply,
|
40
42
|
tvl,
|
41
43
|
whitelistedSupplyTargetToken,
|
42
|
-
priceTargetToken,
|
43
|
-
cardName: cardName,
|
44
|
-
totalAssets: typeInfo.totalAssets,
|
45
44
|
};
|
46
45
|
}
|
47
46
|
}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import type { Pricer } from "../../../../../utils/pricer";
|
2
2
|
import { type CallDto, type Campaign, type CampaignParameters } from "@sdk";
|
3
|
+
import type { ERC20SupportedCampaignType } from "../../ERC20DynamicData";
|
3
4
|
import { type tokenType, type tokenTypeStruct } from "../helpers/tokenType";
|
4
5
|
export declare enum roundType {
|
5
6
|
one = "round1",
|
@@ -51,8 +52,8 @@ export declare class GenericProcessor<Input extends callKeys, DataRaw extends da
|
|
51
52
|
round4: callType[];
|
52
53
|
};
|
53
54
|
debug: boolean;
|
54
|
-
processingRound1(typeInfo: DataRaw
|
55
|
-
processingRound2(typeInfo: DataRaw): void;
|
55
|
+
processingRound1(typeInfo: DataRaw): void;
|
56
|
+
processingRound2(typeInfo: DataRaw, campaign?: CampaignParameters<ERC20SupportedCampaignType>): void;
|
56
57
|
processingRound3(typeInfo: DataRaw): void;
|
57
58
|
processingRound4(typeInfo: DataRaw): void;
|
58
59
|
handleWhiteListBlacklistRound5(typeInfo: DataRaw, campaign: CampaignParameters<Campaign.ERC20> | CampaignParameters<Campaign.ERC20LOGPROCESSOR> | CampaignParameters<Campaign.ERC20REBASELOGPROCESSOR> | CampaignParameters<Campaign.EULER>): {
|
@@ -62,10 +63,10 @@ export declare class GenericProcessor<Input extends callKeys, DataRaw extends da
|
|
62
63
|
};
|
63
64
|
processingRound5(index: number, type: tokenType, typeInfo: DataRaw, calls: string[], campaign: CampaignParameters<Campaign.ERC20> | CampaignParameters<Campaign.ERC20LOGPROCESSOR> | CampaignParameters<Campaign.ERC20REBASELOGPROCESSOR> | CampaignParameters<Campaign.EULER>, pricer: Pricer): Promise<Output>;
|
64
65
|
computeRound1(type: tokenType, typeInfo: DataRaw): tokenTypeStruct;
|
65
|
-
computeRound2(index: number, type: tokenType, typeInfo: DataRaw, calls: string[]): tokenTypeStruct;
|
66
|
+
computeRound2(index: number, type: tokenType, typeInfo: DataRaw, calls: string[], campaign?: CampaignParameters<ERC20SupportedCampaignType>): tokenTypeStruct;
|
66
67
|
computeRound3(index: number, type: tokenType, typeInfo: DataRaw, calls: string[]): tokenTypeStruct;
|
67
|
-
computeRound4(index: number, type: tokenType, typeInfo: DataRaw, calls: string[], campaign: CampaignParameters<
|
68
|
-
computeRound5(index: number, type: tokenType, typeInfo: DataRaw, calls: string[], campaign: CampaignParameters<
|
68
|
+
computeRound4(index: number, type: tokenType, typeInfo: DataRaw, calls: string[], campaign: CampaignParameters<ERC20SupportedCampaignType>): tokenTypeStruct;
|
69
|
+
computeRound5(index: number, type: tokenType, typeInfo: DataRaw, calls: string[], campaign: CampaignParameters<ERC20SupportedCampaignType>, pricer: Pricer): Promise<tokenTypeStruct>;
|
69
70
|
generateWhitelistCall(type: tokenType, typeInfo: DataRaw, campaign: CampaignParameters<Campaign.ERC20> | CampaignParameters<Campaign.ERC20LOGPROCESSOR> | CampaignParameters<Campaign.ERC20REBASELOGPROCESSOR> | CampaignParameters<Campaign.EULER>): CallDto[];
|
70
71
|
generateBlackListCall(type: tokenType, typeInfo: DataRaw, campaign: CampaignParameters<Campaign.ERC20> | CampaignParameters<Campaign.ERC20LOGPROCESSOR> | CampaignParameters<Campaign.ERC20REBASELOGPROCESSOR> | CampaignParameters<Campaign.EULER>): CallDto[];
|
71
72
|
decodeListedSupply(index: number, decimals: number, list: string[], calls: string[]): string;
|
@@ -18,8 +18,8 @@ export class GenericProcessor {
|
|
18
18
|
round4: [{ key: "totalSupply", call: "totalSupply", target: "tokenAddress" }],
|
19
19
|
};
|
20
20
|
debug = false;
|
21
|
-
processingRound1(typeInfo
|
22
|
-
processingRound2(typeInfo) { }
|
21
|
+
processingRound1(typeInfo) { }
|
22
|
+
processingRound2(typeInfo, campaign) { }
|
23
23
|
processingRound3(typeInfo) { }
|
24
24
|
processingRound4(typeInfo) { }
|
25
25
|
handleWhiteListBlacklistRound5(typeInfo, campaign) {
|
@@ -65,9 +65,9 @@ export class GenericProcessor {
|
|
65
65
|
typeInfo,
|
66
66
|
};
|
67
67
|
}
|
68
|
-
computeRound2(index, type, typeInfo, calls) {
|
68
|
+
computeRound2(index, type, typeInfo, calls, campaign) {
|
69
69
|
this.decodePreviousRound(roundType.one, calls, typeInfo, type, index);
|
70
|
-
this.processingRound2(typeInfo);
|
70
|
+
this.processingRound2(typeInfo, campaign);
|
71
71
|
if (this.debug) {
|
72
72
|
console.log("Round 2", {
|
73
73
|
type: type,
|
package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/MaverickBPProcessor.d.ts
CHANGED
@@ -43,7 +43,7 @@ export declare class MaverickBPProcessor extends GenericProcessor<callKeysMaveri
|
|
43
43
|
round3: callType[];
|
44
44
|
round4: callType[];
|
45
45
|
};
|
46
|
-
processingRound1(typeInfo: dataRawMaverickBP
|
46
|
+
processingRound1(typeInfo: dataRawMaverickBP): void;
|
47
47
|
processingRound2(typeInfo: dataRawMaverickBP): void;
|
48
48
|
processingRound5(_index: number, type: tokenType, typeInfo: dataRawMaverickBP, _calls: string[], campaign: CampaignParameters<Campaign.ERC20> | CampaignParameters<Campaign.EULER>, pricer: Pricer): Promise<dataTypeMaverickBP>;
|
49
49
|
}
|
package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/MaverickBPProcessor.js
CHANGED
@@ -37,7 +37,7 @@ export class MaverickBPProcessor extends GenericProcessor {
|
|
37
37
|
round3: [],
|
38
38
|
round4: [{ key: "totalSupply", call: "totalSupply", target: "tokenAddress" }],
|
39
39
|
};
|
40
|
-
processingRound1(typeInfo
|
40
|
+
processingRound1(typeInfo) {
|
41
41
|
typeInfo.lensAddress = MAVERICK_ZKSYNC_BP_LENS_ADDRESS;
|
42
42
|
}
|
43
43
|
processingRound2(typeInfo) {
|
package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/NoLinkVaultProcessor.d.ts
CHANGED
@@ -27,7 +27,7 @@ export declare class NoLinkVaultProcessor extends GenericProcessor<callKeysNoLin
|
|
27
27
|
round3: callType[];
|
28
28
|
round4: callType[];
|
29
29
|
};
|
30
|
-
processingRound1(typeInfo: dataRawNoLinkVault
|
30
|
+
processingRound1(typeInfo: dataRawNoLinkVault): void;
|
31
31
|
processingRound5(index: number, type: tokenType, typeInfo: dataRawNoLinkVault, calls: string[], campaign: CampaignParameters<Campaign.ERC20> | CampaignParameters<Campaign.EULER>, pricer: Pricer): Promise<dataTypeNoLinkVault>;
|
32
32
|
computeRound1(type: tokenType, typeInfo: dataRawNoLinkVault): tokenTypeStruct;
|
33
33
|
computeRound2(index: number, type: tokenType, typeInfo: dataRawNoLinkVault, calls: string[]): tokenTypeStruct;
|
package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/NoLinkVaultProcessor.js
CHANGED
@@ -12,7 +12,7 @@ export class NoLinkVaultProcessor extends GenericProcessor {
|
|
12
12
|
round3: [{ key: "baseSymbol", call: "symbol", target: "base" }],
|
13
13
|
round4: [{ key: "totalSupply", call: "totalSupply", target: "tokenAddress" }],
|
14
14
|
};
|
15
|
-
processingRound1(typeInfo
|
15
|
+
processingRound1(typeInfo) {
|
16
16
|
if (typeInfo.tokenAddress === "0x196ead472583Bc1e9aF7A05F860D9857e1Bd3dCc") {
|
17
17
|
typeInfo.protocol = "Unifi";
|
18
18
|
typeInfo.rateAccountant = "0xA9fB7e2922216deBE3Fd5E1bBE7591eE446Dc21c";
|
@@ -25,7 +25,7 @@ export class NoLinkVaultProcessor extends GenericProcessor {
|
|
25
25
|
typeInfo.protocol = "Unifi";
|
26
26
|
typeInfo.rateAccountant = "0xe0bDb7b9225A2CeB42998dc2E51D4D3CDeb7e3Be";
|
27
27
|
}
|
28
|
-
if (type === tokenType.veda) {
|
28
|
+
if (typeInfo.type === tokenType.veda) {
|
29
29
|
// To retrieve the rateAccountant, look at a transaction, find the teller, then find the accountant.
|
30
30
|
if (typeInfo.tokenAddress === "0x08c6F91e2B681FaF5e17227F2a44C307b3C1364C")
|
31
31
|
typeInfo.rateAccountant = "0xc315D6e14DDCDC7407784e2Caf815d131Bc1D3E7";
|
@@ -34,7 +34,7 @@ export declare class RfxProcessor extends GenericProcessor<callKeysRfx, dataRawT
|
|
34
34
|
round3: callType[];
|
35
35
|
round4: callType[];
|
36
36
|
};
|
37
|
-
processingRound1(typeInfo: dataRawTemplate
|
37
|
+
processingRound1(typeInfo: dataRawTemplate): void;
|
38
38
|
processingRound5(index: number, type: tokenType, typeInfo: dataRawTemplate, calls: string[], campaign: CampaignParameters<Campaign.ERC20> | CampaignParameters<Campaign.EULER>, pricer: Pricer): Promise<dataTypeRfx>;
|
39
39
|
}
|
40
40
|
export {};
|
@@ -32,7 +32,7 @@ export class RfxProcessor extends GenericProcessor {
|
|
32
32
|
round4: [{ key: "totalSupply", call: "totalSupply", target: "tokenAddress" }],
|
33
33
|
};
|
34
34
|
// override computeRound1(): void {}
|
35
|
-
processingRound1(typeInfo
|
35
|
+
processingRound1(typeInfo) {
|
36
36
|
const hexShortToken = ethers.utils.keccak256(ethers.utils.defaultAbiCoder.encode(["string"], ["SHORT_TOKEN"]));
|
37
37
|
const hexLongToken = ethers.utils.keccak256(ethers.utils.defaultAbiCoder.encode(["string"], ["LONG_TOKEN"]));
|
38
38
|
typeInfo.RFX_DATASTORE = RFX_DATASTORE;
|
@@ -1,3 +1,4 @@
|
|
1
|
-
import type { ResultDto } from "@sdk";
|
1
|
+
import type { CampaignParameters, ResultDto } from "@sdk";
|
2
|
+
import type { ERC20SupportedCampaignType } from "../ERC20DynamicData";
|
2
3
|
import type { tokenType, tokenTypeStruct } from "./helpers/tokenType";
|
3
|
-
export declare function getTokenTypeRound2(index: number, type: tokenType, typeInfo: any, calls: ResultDto[]): tokenTypeStruct;
|
4
|
+
export declare function getTokenTypeRound2(index: number, type: tokenType, typeInfo: any, calls: ResultDto[], campaign?: CampaignParameters<ERC20SupportedCampaignType>): tokenTypeStruct;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { processorMapping } from "./processor/processorMapping";
|
2
|
-
export function getTokenTypeRound2(index, type, typeInfo, calls) {
|
2
|
+
export function getTokenTypeRound2(index, type, typeInfo, calls, campaign) {
|
3
3
|
try {
|
4
4
|
const returnValueOfCalls = calls.map(call => call.returnData);
|
5
5
|
const ProcessorClass = processorMapping[type];
|
@@ -7,7 +7,7 @@ export function getTokenTypeRound2(index, type, typeInfo, calls) {
|
|
7
7
|
throw new Error(`Processor not found for key: ${type}`);
|
8
8
|
}
|
9
9
|
const processorObject = new ProcessorClass();
|
10
|
-
return processorObject.computeRound2(index, type, typeInfo, returnValueOfCalls);
|
10
|
+
return processorObject.computeRound2(index, type, typeInfo, returnValueOfCalls, campaign);
|
11
11
|
}
|
12
12
|
catch (error) {
|
13
13
|
console.error(error);
|
@@ -9,7 +9,6 @@ import { DolomiteDynamicData } from "./campaignTypes/DolomiteDynamicData";
|
|
9
9
|
import { ERC20DynamicData } from "./campaignTypes/ERC20DynamicData";
|
10
10
|
import { ERC20_SNAPSHOTDynamicData } from "./campaignTypes/ERC20_SNAPSHOTDynamicData";
|
11
11
|
import { EigenLayerDynamicData } from "./campaignTypes/EigenLayerDynamicData";
|
12
|
-
import { EulerDynamicData } from "./campaignTypes/EulerDynamicData";
|
13
12
|
import { HyperdriveDynamicData } from "./campaignTypes/HyperdriveDynamicData";
|
14
13
|
import { JSON_AIRDROPDynamicData } from "./campaignTypes/JSON_AIRDROPDynamicData";
|
15
14
|
import { MORPHODynamicData } from "./campaignTypes/MORPHODynamicData";
|
@@ -53,7 +52,7 @@ export async function campaignsDynamicData(chainId, campaigns, type) {
|
|
53
52
|
return MORPHODynamicData(chainId, campaigns);
|
54
53
|
}
|
55
54
|
case Campaign.EULER: {
|
56
|
-
return
|
55
|
+
return ERC20DynamicData(chainId, campaigns);
|
57
56
|
}
|
58
57
|
case Campaign.DOLOMITE: {
|
59
58
|
return DolomiteDynamicData(chainId, campaigns);
|
@@ -0,0 +1,10 @@
|
|
1
|
+
export declare const mimeTypes: readonly ["audio/aac", "application/x-abiword", "image/apng", "application/x-freearc", "image/avif", "video/x-msvideo", "application/vnd.amazon.ebook", "application/octet-stream", "image/bmp", "application/x-bzip", "application/x-bzip2", "application/x-cdf", "application/x-csh", "text/css", "text/csv", "application/msword", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "application/vnd.ms-fontobject", "application/epub+zip", "application/gzip", "application/x-gzip", "image/gif", "text/html", "image/vnd.microsoft.icon", "text/calendar", "application/java-archive", "image/jpeg", "text/javascript", "application/json", "application/ld+json", "audio/midi", "audio/x-midi", "text/javascript", "audio/mpeg", "video/mp4", "video/mpeg", "application/vnd.apple.installer+xml", "application/vnd.oasis.opendocument.presentation", "application/vnd.oasis.opendocument.spreadsheet", "application/vnd.oasis.opendocument.text", "audio/ogg", "video/ogg", "application/ogg", "audio/ogg", "font/otf", "image/png", "application/pdf", "application/x-httpd-php", "application/vnd.ms-powerpoint", "application/vnd.openxmlformats-officedocument.presentationml.presentation", "application/vnd.rar", "application/rtf", "application/x-sh", "image/svg+xml", "application/x-tar", "image/tiff", "video/mp2t", "font/ttf", "text/plain", "application/vnd.visio", "audio/wav", "audio/webm", "video/webm", "image/webp", "font/woff", "font/woff2", "application/xhtml+xml", "application/vnd.ms-excel", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "application/xml", "text/xml", "application/atom+xml", "application/xml", "application/vnd.mozilla.xul+xml", "application/zip", "application/x-zip-compressed", "audio/video", "video/3gpp", "audio/3gpp", "audio/video", "video/3gpp2", "audio/3gpp2", "application/x-7z-compressed"];
|
2
|
+
export type MimeType = (typeof mimeTypes)[number];
|
3
|
+
export type UploadOptions<T> = {
|
4
|
+
type?: MimeType;
|
5
|
+
compression?: boolean;
|
6
|
+
overwrite?: boolean;
|
7
|
+
isPublic?: boolean;
|
8
|
+
transform?: (obj: T) => string;
|
9
|
+
separator?: string;
|
10
|
+
};
|
@@ -0,0 +1,85 @@
|
|
1
|
+
export const mimeTypes = [
|
2
|
+
"audio/aac",
|
3
|
+
"application/x-abiword",
|
4
|
+
"image/apng",
|
5
|
+
"application/x-freearc",
|
6
|
+
"image/avif",
|
7
|
+
"video/x-msvideo",
|
8
|
+
"application/vnd.amazon.ebook",
|
9
|
+
"application/octet-stream",
|
10
|
+
"image/bmp",
|
11
|
+
"application/x-bzip",
|
12
|
+
"application/x-bzip2",
|
13
|
+
"application/x-cdf",
|
14
|
+
"application/x-csh",
|
15
|
+
"text/css",
|
16
|
+
"text/csv",
|
17
|
+
"application/msword",
|
18
|
+
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
19
|
+
"application/vnd.ms-fontobject",
|
20
|
+
"application/epub+zip",
|
21
|
+
"application/gzip",
|
22
|
+
"application/x-gzip",
|
23
|
+
"image/gif",
|
24
|
+
"text/html",
|
25
|
+
"image/vnd.microsoft.icon",
|
26
|
+
"text/calendar",
|
27
|
+
"application/java-archive",
|
28
|
+
"image/jpeg",
|
29
|
+
"text/javascript",
|
30
|
+
"application/json",
|
31
|
+
"application/ld+json",
|
32
|
+
"audio/midi",
|
33
|
+
"audio/x-midi",
|
34
|
+
"text/javascript",
|
35
|
+
"audio/mpeg",
|
36
|
+
"video/mp4",
|
37
|
+
"video/mpeg",
|
38
|
+
"application/vnd.apple.installer+xml",
|
39
|
+
"application/vnd.oasis.opendocument.presentation",
|
40
|
+
"application/vnd.oasis.opendocument.spreadsheet",
|
41
|
+
"application/vnd.oasis.opendocument.text",
|
42
|
+
"audio/ogg",
|
43
|
+
"video/ogg",
|
44
|
+
"application/ogg",
|
45
|
+
"audio/ogg",
|
46
|
+
"font/otf",
|
47
|
+
"image/png",
|
48
|
+
"application/pdf",
|
49
|
+
"application/x-httpd-php",
|
50
|
+
"application/vnd.ms-powerpoint",
|
51
|
+
"application/vnd.openxmlformats-officedocument.presentationml.presentation",
|
52
|
+
"application/vnd.rar",
|
53
|
+
"application/rtf",
|
54
|
+
"application/x-sh",
|
55
|
+
"image/svg+xml",
|
56
|
+
"application/x-tar",
|
57
|
+
"image/tiff",
|
58
|
+
"video/mp2t",
|
59
|
+
"font/ttf",
|
60
|
+
"text/plain",
|
61
|
+
"application/vnd.visio",
|
62
|
+
"audio/wav",
|
63
|
+
"audio/webm",
|
64
|
+
"video/webm",
|
65
|
+
"image/webp",
|
66
|
+
"font/woff",
|
67
|
+
"font/woff2",
|
68
|
+
"application/xhtml+xml",
|
69
|
+
"application/vnd.ms-excel",
|
70
|
+
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
71
|
+
"application/xml",
|
72
|
+
"text/xml",
|
73
|
+
"application/atom+xml",
|
74
|
+
"application/xml",
|
75
|
+
"application/vnd.mozilla.xul+xml",
|
76
|
+
"application/zip",
|
77
|
+
"application/x-zip-compressed",
|
78
|
+
"audio/video",
|
79
|
+
"video/3gpp",
|
80
|
+
"audio/3gpp",
|
81
|
+
"audio/video",
|
82
|
+
"video/3gpp2",
|
83
|
+
"audio/3gpp2",
|
84
|
+
"application/x-7z-compressed",
|
85
|
+
];
|
@@ -1,8 +1,10 @@
|
|
1
|
-
import type {
|
1
|
+
import type { UploadOptions } from "./bucket.model";
|
2
2
|
export declare class BucketService {
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
3
|
+
#private;
|
4
|
+
defaultUploadOptions: UploadOptions<unknown>;
|
5
|
+
constructor(bucket: string);
|
6
|
+
pushArray<T>(filename: string, arr: T[], options?: UploadOptions<T>): Promise<number>;
|
7
|
+
push(filename: string, text: string, options?: Omit<UploadOptions<never>, "transform">): Promise<number>;
|
8
|
+
pullArray<T>(filename: string, callback: (elem: string) => T, separator?: string): Promise<T[]>;
|
9
|
+
pull(filename: string): Promise<string>;
|
8
10
|
}
|