@merkl/api 0.17.20 → 0.17.22
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 +60 -5
- package/dist/src/index.d.ts +12 -1
- package/dist/src/jobs/etl/update-dynamic-data.js +2 -2
- package/dist/src/modules/v4/campaign/campaign.controller.js +2 -2
- package/dist/src/modules/v4/opportunity/opportunity.converter.js +2 -0
- package/dist/src/modules/v4/programPayload/programPayload.repository.d.ts +100 -1
- package/dist/src/modules/v4/programPayload/programPayload.repository.js +146 -1
- package/dist/src/modules/v4/router.d.ts +12 -1
- package/dist/src/modules/v4/token/token.controller.d.ts +12 -1
- package/dist/src/modules/v4/token/token.controller.js +2 -2
- package/dist/src/modules/v4/token/token.service.d.ts +13 -1
- package/dist/src/modules/v4/token/token.service.js +1 -3
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/src/eden/index.d.ts
CHANGED
@@ -1524,7 +1524,18 @@ declare const eden: {
|
|
1524
1524
|
query?: Record<string, unknown> | undefined;
|
1525
1525
|
fetch?: RequestInit | undefined;
|
1526
1526
|
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
1527
|
-
200:
|
1527
|
+
200: {
|
1528
|
+
symbol: string;
|
1529
|
+
name: string | null;
|
1530
|
+
id: string;
|
1531
|
+
icon: string;
|
1532
|
+
chainId: number;
|
1533
|
+
address: string;
|
1534
|
+
decimals: number;
|
1535
|
+
verified: boolean;
|
1536
|
+
isTest: boolean;
|
1537
|
+
price?: number | null | undefined;
|
1538
|
+
} | undefined;
|
1528
1539
|
}>>;
|
1529
1540
|
};
|
1530
1541
|
count: {
|
@@ -4819,7 +4830,18 @@ declare const eden: {
|
|
4819
4830
|
query?: Record<string, unknown> | undefined;
|
4820
4831
|
fetch?: RequestInit | undefined;
|
4821
4832
|
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
4822
|
-
200:
|
4833
|
+
200: {
|
4834
|
+
symbol: string;
|
4835
|
+
name: string | null;
|
4836
|
+
id: string;
|
4837
|
+
icon: string;
|
4838
|
+
chainId: number;
|
4839
|
+
address: string;
|
4840
|
+
decimals: number;
|
4841
|
+
verified: boolean;
|
4842
|
+
isTest: boolean;
|
4843
|
+
price?: number | null | undefined;
|
4844
|
+
} | undefined;
|
4823
4845
|
}>>;
|
4824
4846
|
};
|
4825
4847
|
count: {
|
@@ -9026,7 +9048,18 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
9026
9048
|
authorization: string;
|
9027
9049
|
};
|
9028
9050
|
response: {
|
9029
|
-
200:
|
9051
|
+
200: {
|
9052
|
+
symbol: string;
|
9053
|
+
name: string | null;
|
9054
|
+
id: string;
|
9055
|
+
icon: string;
|
9056
|
+
chainId: number;
|
9057
|
+
address: string;
|
9058
|
+
decimals: number;
|
9059
|
+
verified: boolean;
|
9060
|
+
isTest: boolean;
|
9061
|
+
price?: number | null | undefined;
|
9062
|
+
} | undefined;
|
9030
9063
|
};
|
9031
9064
|
};
|
9032
9065
|
};
|
@@ -13686,7 +13719,18 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
13686
13719
|
query?: Record<string, unknown> | undefined;
|
13687
13720
|
fetch?: RequestInit | undefined;
|
13688
13721
|
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
13689
|
-
200:
|
13722
|
+
200: {
|
13723
|
+
symbol: string;
|
13724
|
+
name: string | null;
|
13725
|
+
id: string;
|
13726
|
+
icon: string;
|
13727
|
+
chainId: number;
|
13728
|
+
address: string;
|
13729
|
+
decimals: number;
|
13730
|
+
verified: boolean;
|
13731
|
+
isTest: boolean;
|
13732
|
+
price?: number | null | undefined;
|
13733
|
+
} | undefined;
|
13690
13734
|
}>>;
|
13691
13735
|
};
|
13692
13736
|
count: {
|
@@ -16981,7 +17025,18 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
16981
17025
|
query?: Record<string, unknown> | undefined;
|
16982
17026
|
fetch?: RequestInit | undefined;
|
16983
17027
|
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
16984
|
-
200:
|
17028
|
+
200: {
|
17029
|
+
symbol: string;
|
17030
|
+
name: string | null;
|
17031
|
+
id: string;
|
17032
|
+
icon: string;
|
17033
|
+
chainId: number;
|
17034
|
+
address: string;
|
17035
|
+
decimals: number;
|
17036
|
+
verified: boolean;
|
17037
|
+
isTest: boolean;
|
17038
|
+
price?: number | null | undefined;
|
17039
|
+
} | undefined;
|
16985
17040
|
}>>;
|
16986
17041
|
};
|
16987
17042
|
count: {
|
package/dist/src/index.d.ts
CHANGED
@@ -1767,7 +1767,18 @@ declare const app: Elysia<"", false, {
|
|
1767
1767
|
authorization: string;
|
1768
1768
|
};
|
1769
1769
|
response: {
|
1770
|
-
200:
|
1770
|
+
200: {
|
1771
|
+
symbol: string;
|
1772
|
+
name: string | null;
|
1773
|
+
id: string;
|
1774
|
+
icon: string;
|
1775
|
+
chainId: number;
|
1776
|
+
address: string;
|
1777
|
+
decimals: number;
|
1778
|
+
verified: boolean;
|
1779
|
+
isTest: boolean;
|
1780
|
+
price?: number | null | undefined;
|
1781
|
+
} | undefined;
|
1771
1782
|
};
|
1772
1783
|
};
|
1773
1784
|
};
|
@@ -47,9 +47,9 @@ const main = async () => {
|
|
47
47
|
}
|
48
48
|
// 3. Update the status of the opportunities associated to future campaigns
|
49
49
|
const futureOpportunityIds = (await CampaignService.getFutureCampaigns({ computeChainId: chainId })).map(c => c.Opportunity.id);
|
50
|
-
await OpportunityService.updateMany(futureOpportunityIds, { status: "SOON" });
|
51
|
-
// 4. Update the status of the opportunities associated to live campaigns
|
52
50
|
const liveOpportunityIds = (await CampaignService.getLiveCampaigns({ computeChainId: chainId })).map(c => c.Opportunity.id);
|
51
|
+
await OpportunityService.updateMany(futureOpportunityIds?.filter(opportunityId => !liveOpportunityIds.includes(opportunityId)), { status: "SOON" });
|
52
|
+
// 4. Update the status of the opportunities associated to live campaigns
|
53
53
|
await OpportunityService.updateMany(liveOpportunityIds, { status: "LIVE" });
|
54
54
|
};
|
55
55
|
try {
|
@@ -2,9 +2,9 @@ import { NotFoundError } from "../../../errors";
|
|
2
2
|
import { BackOfficeGuard } from "../../../guards/BackOffice.guard";
|
3
3
|
import { AuthorizationHeadersDto, EngineGuard } from "../../../guards/Engine.guard";
|
4
4
|
import { ChainUniqueDto } from "../chain/chain.model";
|
5
|
+
import { Campaign } from "@sdk";
|
5
6
|
import Elysia, { t } from "elysia";
|
6
7
|
import { throwOnUnsupportedChainId } from "src/utils/throw";
|
7
|
-
import { Campaign } from "@sdk";
|
8
8
|
import { DynamicDataService } from "../dynamicData/dynamicData.service";
|
9
9
|
import { CampaignResourceDto, CreateCampaignDto, GetCampaignQueryDto, UpdateCampaignDto, UpdateMetaDataCampaignDto, } from "./campaign.model";
|
10
10
|
import { CampaignService } from "./campaign.service";
|
@@ -30,7 +30,7 @@ export const CampaignController = new Elysia({ prefix: "/campaigns", detail: { t
|
|
30
30
|
detail: { hide: true },
|
31
31
|
})
|
32
32
|
.put("/:campaignId/dynamic-data", async ({ params }) => {
|
33
|
-
const id = (await CampaignService.findMany({ campaignId: params.campaignId }))[0].id;
|
33
|
+
const id = (await CampaignService.findMany({ campaignId: params.campaignId, test: true }))[0].id;
|
34
34
|
if (!id)
|
35
35
|
throw new NotFoundError();
|
36
36
|
const campaign = await CampaignService.findUniqueOrThrow(id, true);
|
@@ -21,6 +21,7 @@ export class OpportunityConvertorService {
|
|
21
21
|
endTimestamp: Number(campaign.endTimestamp),
|
22
22
|
startTimestamp: Number(campaign.startTimestamp),
|
23
23
|
rewardToken: campaign.rewardToken.address,
|
24
|
+
amm: campaign.params?.amm,
|
24
25
|
};
|
25
26
|
}
|
26
27
|
static convertV4toV3(opportunity, withCampaigns = false) {
|
@@ -108,6 +109,7 @@ export class OpportunityConvertorService {
|
|
108
109
|
: undefined,
|
109
110
|
tags: opportunity.tags,
|
110
111
|
rewardTokenIcons: opportunity.campaigns
|
112
|
+
?.filter(campaign => campaign.rewardToken.icon?.length > 0) // Do not return tokens without icons
|
111
113
|
?.map(campaign => campaign.rewardToken.symbol)
|
112
114
|
.reduce((acc, curr) => {
|
113
115
|
if (!acc.includes(curr))
|
@@ -25,9 +25,13 @@ export declare enum etherlinkCampaigns {
|
|
25
25
|
Superlend_Supply_WXTZ_Etherlink = "Superlend Supply WXTZ Etherlink 0x008ae222661B6A42e3A097bd7AAC15412829106b",
|
26
26
|
Iguana_WETH_WXTZ = "Iguana WETH/WXTZ Etherlink 0x478F067b0Ed73d120BBcd8c6f4f33438FC483912",
|
27
27
|
Iguana_USDC_USDT = "Iguana USDC/USDT Etherlink 0x86456e2E2A203Da82E61ed34eF4137Fbe545f0DC",
|
28
|
+
Iguana_XTZ_USDC = "Iguana XTZ/USDT Etherlink 0x508060A01f11d6a2Eb774B55aEba95931265E0cc",
|
28
29
|
Hanji_HJLP = "Hanji HJLP Etherlink 0x1cd88fBD530281Ad6c639E2B897c4E239003A930",
|
29
30
|
Uranium_Hold_xU308_Etherlink = "Uranium Hold xU308 Etherlink 0x79052Ab3C166D4899a1e0DD033aC3b379AF0B1fD",
|
30
|
-
referral_test = "referral test Etherlink 0x0"
|
31
|
+
referral_test = "referral test Etherlink 0x0",
|
32
|
+
Hanji_XTZ_USDC = "Hanji XTZ/USDC Etherlink 0xd0bc067cf877f7b76ceb331891331d9e6acda1a7",
|
33
|
+
Hanji_WETH_USDC = "Hanji WETH/USDC Etherlink 0x65ea4dd7f789c71c0f57ed84b3bdc3062898d3cb",
|
34
|
+
Hanji_WBTC_USDC = "Hanji WBTC/USDC Etherlink 0xbb6b01d94e3f6ebae8647cb56d544f57928ab758"
|
31
35
|
}
|
32
36
|
export declare enum swapxCampaigns {
|
33
37
|
Swapx_SWPx_USDCe_Swapx = "Swapx SWPx/USDC.e Swapx 0x467865E7Ce29E7ED8f362D51Fd7141117B234b44",
|
@@ -527,6 +531,20 @@ declare const EtherlinkInterfaceCampaigns: {
|
|
527
531
|
weightToken0: number;
|
528
532
|
weightToken1: number;
|
529
533
|
};
|
534
|
+
"Iguana XTZ/USDT Etherlink 0x508060A01f11d6a2Eb774B55aEba95931265E0cc": {
|
535
|
+
campaignType: any;
|
536
|
+
computeChainId: any;
|
537
|
+
hooks: never[];
|
538
|
+
poolAddress: string;
|
539
|
+
whitelist: never[];
|
540
|
+
blacklist: never[];
|
541
|
+
url: string;
|
542
|
+
forwarders: never[];
|
543
|
+
isOutOfRangeIncentivized: boolean;
|
544
|
+
weightFees: number;
|
545
|
+
weightToken0: number;
|
546
|
+
weightToken1: number;
|
547
|
+
};
|
530
548
|
"referral test Etherlink 0x0": {
|
531
549
|
campaignType: any;
|
532
550
|
computeChainId: any;
|
@@ -551,6 +569,87 @@ declare const EtherlinkInterfaceCampaigns: {
|
|
551
569
|
url: string;
|
552
570
|
forwarders: never[];
|
553
571
|
};
|
572
|
+
"Hanji XTZ/USDC Etherlink 0xd0bc067cf877f7b76ceb331891331d9e6acda1a7": {
|
573
|
+
campaignType: any;
|
574
|
+
contract: string;
|
575
|
+
eventID: string;
|
576
|
+
topicToData: {
|
577
|
+
topicIndex: number;
|
578
|
+
decodeKeyTopic: string;
|
579
|
+
dataIndex: number;
|
580
|
+
multiplier: string;
|
581
|
+
}[];
|
582
|
+
computeScoreParameters: {
|
583
|
+
computeMethod: any;
|
584
|
+
computeSettings: {
|
585
|
+
maxRewards: string;
|
586
|
+
};
|
587
|
+
};
|
588
|
+
decodeDataValue: string[];
|
589
|
+
expectedChecks: {
|
590
|
+
index: number;
|
591
|
+
key: string;
|
592
|
+
expectedValue: string;
|
593
|
+
}[];
|
594
|
+
whitelist: never[];
|
595
|
+
blacklist: never[];
|
596
|
+
forwarders: never[];
|
597
|
+
hooks: never[];
|
598
|
+
};
|
599
|
+
"Hanji WETH/USDC Etherlink 0x65ea4dd7f789c71c0f57ed84b3bdc3062898d3cb": {
|
600
|
+
campaignType: any;
|
601
|
+
contract: string;
|
602
|
+
eventID: string;
|
603
|
+
topicToData: {
|
604
|
+
topicIndex: number;
|
605
|
+
decodeKeyTopic: string;
|
606
|
+
dataIndex: number;
|
607
|
+
multiplier: string;
|
608
|
+
}[];
|
609
|
+
computeScoreParameters: {
|
610
|
+
computeMethod: any;
|
611
|
+
computeSettings: {
|
612
|
+
maxRewards: string;
|
613
|
+
};
|
614
|
+
};
|
615
|
+
decodeDataValue: string[];
|
616
|
+
expectedChecks: {
|
617
|
+
index: number;
|
618
|
+
key: string;
|
619
|
+
expectedValue: string;
|
620
|
+
}[];
|
621
|
+
whitelist: never[];
|
622
|
+
blacklist: never[];
|
623
|
+
forwarders: never[];
|
624
|
+
hooks: never[];
|
625
|
+
};
|
626
|
+
"Hanji WBTC/USDC Etherlink 0xbb6b01d94e3f6ebae8647cb56d544f57928ab758": {
|
627
|
+
campaignType: any;
|
628
|
+
contract: string;
|
629
|
+
eventID: string;
|
630
|
+
topicToData: {
|
631
|
+
topicIndex: number;
|
632
|
+
decodeKeyTopic: string;
|
633
|
+
dataIndex: number;
|
634
|
+
multiplier: string;
|
635
|
+
}[];
|
636
|
+
computeScoreParameters: {
|
637
|
+
computeMethod: any;
|
638
|
+
computeSettings: {
|
639
|
+
maxRewards: string;
|
640
|
+
};
|
641
|
+
};
|
642
|
+
decodeDataValue: string[];
|
643
|
+
expectedChecks: {
|
644
|
+
index: number;
|
645
|
+
key: string;
|
646
|
+
expectedValue: string;
|
647
|
+
}[];
|
648
|
+
whitelist: never[];
|
649
|
+
blacklist: never[];
|
650
|
+
forwarders: never[];
|
651
|
+
hooks: never[];
|
652
|
+
};
|
554
653
|
};
|
555
654
|
declare const SwapxInterfaceCampaigns: {
|
556
655
|
[key in swapxCampaigns]: partialConfig;
|
@@ -1,4 +1,5 @@
|
|
1
|
-
import { BalanceCallType, Campaign, ChainId, CompFork, CompoundSubCampaignType, Forwarder, HOOK, MorphoSubCampaignType, StandardType, boostingFunction, boostingReferralFunction, contractStateBoost, defaultBoost, defaultReferralBoost, selectionRaffleMethod, } from "@sdk";
|
1
|
+
import { BalanceCallType, Campaign, ChainId, CompFork, CompoundSubCampaignType, ComputeScoreMethod, Forwarder, HOOK, MorphoSubCampaignType, StandardType, boostingFunction, boostingReferralFunction, contractStateBoost, defaultBoost, defaultReferralBoost, selectionRaffleMethod, } from "@sdk";
|
2
|
+
import { id } from "ethers/lib/utils";
|
2
3
|
export var program;
|
3
4
|
(function (program) {
|
4
5
|
program["Puffer"] = "Puffer";
|
@@ -30,9 +31,13 @@ export var etherlinkCampaigns;
|
|
30
31
|
etherlinkCampaigns["Superlend_Supply_WXTZ_Etherlink"] = "Superlend Supply WXTZ Etherlink 0x008ae222661B6A42e3A097bd7AAC15412829106b";
|
31
32
|
etherlinkCampaigns["Iguana_WETH_WXTZ"] = "Iguana WETH/WXTZ Etherlink 0x478F067b0Ed73d120BBcd8c6f4f33438FC483912";
|
32
33
|
etherlinkCampaigns["Iguana_USDC_USDT"] = "Iguana USDC/USDT Etherlink 0x86456e2E2A203Da82E61ed34eF4137Fbe545f0DC";
|
34
|
+
etherlinkCampaigns["Iguana_XTZ_USDC"] = "Iguana XTZ/USDT Etherlink 0x508060A01f11d6a2Eb774B55aEba95931265E0cc";
|
33
35
|
etherlinkCampaigns["Hanji_HJLP"] = "Hanji HJLP Etherlink 0x1cd88fBD530281Ad6c639E2B897c4E239003A930";
|
34
36
|
etherlinkCampaigns["Uranium_Hold_xU308_Etherlink"] = "Uranium Hold xU308 Etherlink 0x79052Ab3C166D4899a1e0DD033aC3b379AF0B1fD";
|
35
37
|
etherlinkCampaigns["referral_test"] = "referral test Etherlink 0x0";
|
38
|
+
etherlinkCampaigns["Hanji_XTZ_USDC"] = "Hanji XTZ/USDC Etherlink 0xd0bc067cf877f7b76ceb331891331d9e6acda1a7";
|
39
|
+
etherlinkCampaigns["Hanji_WETH_USDC"] = "Hanji WETH/USDC Etherlink 0x65ea4dd7f789c71c0f57ed84b3bdc3062898d3cb";
|
40
|
+
etherlinkCampaigns["Hanji_WBTC_USDC"] = "Hanji WBTC/USDC Etherlink 0xbb6b01d94e3f6ebae8647cb56d544f57928ab758";
|
36
41
|
})(etherlinkCampaigns || (etherlinkCampaigns = {}));
|
37
42
|
export var swapxCampaigns;
|
38
43
|
(function (swapxCampaigns) {
|
@@ -569,6 +574,20 @@ const EtherlinkInterfaceCampaigns = {
|
|
569
574
|
weightToken0: 4000,
|
570
575
|
weightToken1: 4000,
|
571
576
|
},
|
577
|
+
[etherlinkCampaigns.Iguana_XTZ_USDC]: {
|
578
|
+
campaignType: Campaign.CLAMM,
|
579
|
+
computeChainId: ChainId.ETHERLINK,
|
580
|
+
hooks: [],
|
581
|
+
poolAddress: "0x508060A01f11d6a2Eb774B55aEba95931265E0cc",
|
582
|
+
whitelist: [],
|
583
|
+
blacklist: [],
|
584
|
+
url: "https://www.iguanadex.com/info/v3/pairs/0x508060A01f11d6a2Eb774B55aEba95931265E0cc?chain=etherlink",
|
585
|
+
forwarders: [],
|
586
|
+
isOutOfRangeIncentivized: false,
|
587
|
+
weightFees: 2000,
|
588
|
+
weightToken0: 4000,
|
589
|
+
weightToken1: 4000,
|
590
|
+
},
|
572
591
|
[etherlinkCampaigns.referral_test]: {
|
573
592
|
campaignType: Campaign.ERC20,
|
574
593
|
computeChainId: ChainId.ETHERLINK,
|
@@ -595,6 +614,132 @@ const EtherlinkInterfaceCampaigns = {
|
|
595
614
|
url: "",
|
596
615
|
forwarders: [],
|
597
616
|
},
|
617
|
+
[etherlinkCampaigns.Hanji_XTZ_USDC]: {
|
618
|
+
campaignType: Campaign.EVENT_BASED,
|
619
|
+
contract: "0xd0bc067cf877f7b76ceb331891331d9e6acda1a7",
|
620
|
+
eventID: id("OrderPlaced(address,uint64,bool,uint128,uint72,uint128,uint128,uint128,uint128,uint128,bool,bool)"),
|
621
|
+
topicToData: [
|
622
|
+
{ topicIndex: 1, decodeKeyTopic: "address", dataIndex: 1, multiplier: (3n * 10n ** (7n + 12n)).toString() },
|
623
|
+
],
|
624
|
+
computeScoreParameters: {
|
625
|
+
computeMethod: ComputeScoreMethod.cappedScorePercentageHistorical,
|
626
|
+
computeSettings: {
|
627
|
+
maxRewards: (10n ** 8n).toString(),
|
628
|
+
},
|
629
|
+
},
|
630
|
+
decodeDataValue: [
|
631
|
+
"uint64",
|
632
|
+
"uint128",
|
633
|
+
"uint72",
|
634
|
+
"uint128",
|
635
|
+
"uint128",
|
636
|
+
"uint128",
|
637
|
+
"uint128",
|
638
|
+
"uint128",
|
639
|
+
"bool",
|
640
|
+
"bool",
|
641
|
+
],
|
642
|
+
expectedChecks: [
|
643
|
+
{
|
644
|
+
index: 8,
|
645
|
+
key: "data",
|
646
|
+
expectedValue: "true",
|
647
|
+
},
|
648
|
+
{
|
649
|
+
index: 9,
|
650
|
+
key: "data",
|
651
|
+
expectedValue: "false",
|
652
|
+
},
|
653
|
+
],
|
654
|
+
whitelist: [],
|
655
|
+
blacklist: [],
|
656
|
+
forwarders: [],
|
657
|
+
hooks: [],
|
658
|
+
},
|
659
|
+
[etherlinkCampaigns.Hanji_WETH_USDC]: {
|
660
|
+
campaignType: Campaign.EVENT_BASED,
|
661
|
+
contract: "0x65ea4dd7f789c71c0f57ed84b3bdc3062898d3cb",
|
662
|
+
eventID: id("OrderPlaced(address,uint64,bool,uint128,uint72,uint128,uint128,uint128,uint128,uint128,bool,bool)"),
|
663
|
+
topicToData: [
|
664
|
+
{ topicIndex: 1, decodeKeyTopic: "address", dataIndex: 1, multiplier: (3n * 10n ** (7n + 12n)).toString() },
|
665
|
+
],
|
666
|
+
computeScoreParameters: {
|
667
|
+
computeMethod: ComputeScoreMethod.cappedScorePercentageHistorical,
|
668
|
+
computeSettings: {
|
669
|
+
maxRewards: (10n ** 8n).toString(),
|
670
|
+
},
|
671
|
+
},
|
672
|
+
decodeDataValue: [
|
673
|
+
"uint64",
|
674
|
+
"uint128",
|
675
|
+
"uint72",
|
676
|
+
"uint128",
|
677
|
+
"uint128",
|
678
|
+
"uint128",
|
679
|
+
"uint128",
|
680
|
+
"uint128",
|
681
|
+
"bool",
|
682
|
+
"bool",
|
683
|
+
],
|
684
|
+
expectedChecks: [
|
685
|
+
{
|
686
|
+
index: 8,
|
687
|
+
key: "data",
|
688
|
+
expectedValue: "true",
|
689
|
+
},
|
690
|
+
{
|
691
|
+
index: 9,
|
692
|
+
key: "data",
|
693
|
+
expectedValue: "false",
|
694
|
+
},
|
695
|
+
],
|
696
|
+
whitelist: [],
|
697
|
+
blacklist: [],
|
698
|
+
forwarders: [],
|
699
|
+
hooks: [],
|
700
|
+
},
|
701
|
+
[etherlinkCampaigns.Hanji_WBTC_USDC]: {
|
702
|
+
campaignType: Campaign.EVENT_BASED,
|
703
|
+
contract: "0xbb6b01d94e3f6ebae8647cb56d544f57928ab758",
|
704
|
+
eventID: id("OrderPlaced(address,uint64,bool,uint128,uint72,uint128,uint128,uint128,uint128,uint128,bool,bool)"),
|
705
|
+
topicToData: [
|
706
|
+
{ topicIndex: 1, decodeKeyTopic: "address", dataIndex: 1, multiplier: (3n * 10n ** (7n + 12n)).toString() },
|
707
|
+
],
|
708
|
+
computeScoreParameters: {
|
709
|
+
computeMethod: ComputeScoreMethod.cappedScorePercentageHistorical,
|
710
|
+
computeSettings: {
|
711
|
+
maxRewards: (10n ** 8n).toString(),
|
712
|
+
},
|
713
|
+
},
|
714
|
+
decodeDataValue: [
|
715
|
+
"uint64",
|
716
|
+
"uint128",
|
717
|
+
"uint72",
|
718
|
+
"uint128",
|
719
|
+
"uint128",
|
720
|
+
"uint128",
|
721
|
+
"uint128",
|
722
|
+
"uint128",
|
723
|
+
"bool",
|
724
|
+
"bool",
|
725
|
+
],
|
726
|
+
expectedChecks: [
|
727
|
+
{
|
728
|
+
index: 8,
|
729
|
+
key: "data",
|
730
|
+
expectedValue: "true",
|
731
|
+
},
|
732
|
+
{
|
733
|
+
index: 9,
|
734
|
+
key: "data",
|
735
|
+
expectedValue: "false",
|
736
|
+
},
|
737
|
+
],
|
738
|
+
whitelist: [],
|
739
|
+
blacklist: [],
|
740
|
+
forwarders: [],
|
741
|
+
hooks: [],
|
742
|
+
},
|
598
743
|
};
|
599
744
|
const SwapxInterfaceCampaigns = {
|
600
745
|
[swapxCampaigns.Swapx_SWPx_USDCe_Swapx]: {
|
@@ -1637,7 +1637,18 @@ export declare const v4: Elysia<"/v4", false, {
|
|
1637
1637
|
authorization: string;
|
1638
1638
|
};
|
1639
1639
|
response: {
|
1640
|
-
200:
|
1640
|
+
200: {
|
1641
|
+
symbol: string;
|
1642
|
+
name: string | null;
|
1643
|
+
id: string;
|
1644
|
+
icon: string;
|
1645
|
+
chainId: number;
|
1646
|
+
address: string;
|
1647
|
+
decimals: number;
|
1648
|
+
verified: boolean;
|
1649
|
+
isTest: boolean;
|
1650
|
+
price?: number | null | undefined;
|
1651
|
+
} | undefined;
|
1641
1652
|
};
|
1642
1653
|
};
|
1643
1654
|
};
|
@@ -202,7 +202,18 @@ export declare const TokenController: Elysia<"/tokens", false, {
|
|
202
202
|
authorization: string;
|
203
203
|
};
|
204
204
|
response: {
|
205
|
-
200:
|
205
|
+
200: {
|
206
|
+
symbol: string;
|
207
|
+
name: string | null;
|
208
|
+
id: string;
|
209
|
+
icon: string;
|
210
|
+
chainId: number;
|
211
|
+
address: string;
|
212
|
+
decimals: number;
|
213
|
+
verified: boolean;
|
214
|
+
isTest: boolean;
|
215
|
+
price?: number | null | undefined;
|
216
|
+
} | undefined;
|
206
217
|
};
|
207
218
|
};
|
208
219
|
};
|
@@ -74,7 +74,7 @@ export const TokenController = new Elysia({ prefix: "/tokens", detail: { tags: [
|
|
74
74
|
hide: true,
|
75
75
|
},
|
76
76
|
})
|
77
|
-
// ───
|
77
|
+
// ─── Create a new Token entity ────────────────────────────────────────────
|
78
78
|
.post("/", async ({ body }) => await TokenService.fillAndCreate(body), {
|
79
79
|
body: CreateTokenDto,
|
80
80
|
headers: AuthorizationHeadersDto,
|
@@ -85,7 +85,7 @@ export const TokenController = new Elysia({ prefix: "/tokens", detail: { tags: [
|
|
85
85
|
},
|
86
86
|
detail: { hide: true },
|
87
87
|
})
|
88
|
-
// ─── Update
|
88
|
+
// ─── Update token fields Status ────────────────────────────────────────────
|
89
89
|
.patch("/:id", async ({ params, body }) => await TokenService.update(params.id, body), {
|
90
90
|
params: TokenIdDto,
|
91
91
|
body: UpdateTokenDto,
|
@@ -115,7 +115,19 @@ export declare abstract class TokenService {
|
|
115
115
|
* @param chainId
|
116
116
|
* @param address
|
117
117
|
*/
|
118
|
-
static fillAndCreate(token: CreateTokenModel): Promise<
|
118
|
+
static fillAndCreate(token: CreateTokenModel): Promise<({
|
119
|
+
symbol: string;
|
120
|
+
name: string | null;
|
121
|
+
id: string;
|
122
|
+
icon: string;
|
123
|
+
chainId: number;
|
124
|
+
address: string;
|
125
|
+
decimals: number;
|
126
|
+
verified: boolean;
|
127
|
+
isTest: boolean;
|
128
|
+
} & {
|
129
|
+
price?: number | null | undefined;
|
130
|
+
}) | undefined>;
|
119
131
|
/**
|
120
132
|
* Read token from database
|
121
133
|
* @param chainId
|
@@ -202,13 +202,11 @@ export class TokenService {
|
|
202
202
|
try {
|
203
203
|
const id = TokenService.hashId(token);
|
204
204
|
const filledData = await TokenService.fetchOnChain({ address: token.address, chainId: token.chainId });
|
205
|
-
|
206
|
-
await TokenRepository.upsert({ ...filledData, ...token, id });
|
205
|
+
return await TokenRepository.upsert({ ...filledData, ...token, id });
|
207
206
|
}
|
208
207
|
catch (e) {
|
209
208
|
console.error(e);
|
210
209
|
}
|
211
|
-
return;
|
212
210
|
}
|
213
211
|
/**
|
214
212
|
* Read token from database
|