@merkl/api 0.16.45 → 0.17.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/eden/index.d.ts +65 -10
- package/dist/src/index.d.ts +13 -2
- package/dist/src/jobs/etl/update-dynamic-data.js +97 -42
- package/dist/src/libs/campaigns/campaignTypes/ERC20DynamicData.js +1 -2
- package/dist/src/modules/v4/enso/enso.service.d.ts +12 -1
- package/dist/src/modules/v4/interaction/interaction.controller.d.ts +12 -2
- package/dist/src/modules/v4/liquidity/liquidity.service.js +1 -1
- package/dist/src/modules/v4/opportunity/opportunity.controller.d.ts +1 -0
- package/dist/src/modules/v4/opportunity/opportunity.model.d.ts +6 -0
- package/dist/src/modules/v4/opportunity/opportunity.model.js +1 -0
- package/dist/src/modules/v4/opportunity/opportunity.repository.d.ts +2 -1
- package/dist/src/modules/v4/opportunity/opportunity.repository.js +5 -2
- package/dist/src/modules/v4/opportunity/opportunity.service.d.ts +18 -2
- package/dist/src/modules/v4/opportunity/opportunity.service.js +9 -3
- package/dist/src/modules/v4/programPayload/programPayload.repository.d.ts +13 -6
- package/dist/src/modules/v4/programPayload/programPayload.repository.js +120 -15
- package/dist/src/modules/v4/protocol/protocol.service.d.ts +7 -7
- package/dist/src/modules/v4/protocol/protocol.service.js +9 -9
- package/dist/src/modules/v4/router.d.ts +13 -2
- package/dist/src/modules/v4/token/token.controller.js +31 -5
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/helpers/getTVL.d.ts +0 -2
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/helpers/getTVL.js +0 -8
@@ -32,11 +32,14 @@ export var swapxCampaigns;
|
|
32
32
|
swapxCampaigns["Swapx_SWPx_Weth_Swapx"] = "Swapx SWPx/Weth Swapx 0x9c2a7bb01951bE15fe835886188fA13255eF9486";
|
33
33
|
swapxCampaigns["Swapx_SWPx_OS_Swapx"] = "Swapx SWPx/OS Swapx 0x9Cb484FAD38D953bc79e2a39bBc93655256F0B16";
|
34
34
|
swapxCampaigns["Swapx_USDCe_wS_Swapx"] = "Swapx USDC.e/wS Swapx 0x5C4B7d607aAF7B5CDE9F09b5F03Cf3b5c923AEEa";
|
35
|
-
swapxCampaigns["
|
35
|
+
swapxCampaigns["Swapx_USDCe_scUSD_USDCe_gauge_Swapx"] = "Swapx USDC.e/scUSD USDC.e gauge Swapx 0xDd35c88B1754879EF86BBF3A24F81fCCA5Eb6B5D";
|
36
|
+
swapxCampaigns["Swapx_USDCe_scUSD_scUSD_gauge_Swapx"] = "Swapx USDC.e/scUSD scUSD gauge Swapx 0xDd35c88B1754879EF86BBF3A24F81fCCA5Eb6B5D";
|
36
37
|
swapxCampaigns["Swapx_scETH_wS_Swapx"] = "Swapx scETH/wS Swapx 0xFC64BD7c84F7Dc1387D6E752679a533F22f6F1DB";
|
37
|
-
swapxCampaigns["
|
38
|
+
swapxCampaigns["Swapx_stS_wS_stS_gauge_Swapx"] = "Swapx stS/wS stS gauge Swapx 0xD760791B29e7894FB827A94Ca433254bb5aFB653";
|
39
|
+
swapxCampaigns["Swapx_stS_wS_wS_gauge_Swapx"] = "Swapx stS/wS wS gauge Swapx 0xD760791B29e7894FB827A94Ca433254bb5aFB653";
|
38
40
|
swapxCampaigns["Swapx_WETH_USDCe_Swapx"] = "Swapx WETH/USDC.e Swapx 0xeC4Ee7d6988Ab06F7a8DAaf8C5FDfFdE6321Be68";
|
39
|
-
swapxCampaigns["
|
41
|
+
swapxCampaigns["Swapx_stS_USDCe_stS_gauge_Swapx"] = "Swapx stS/USDC.e stS gauge Swapx 0x5DDbeF774488cc68266d5F15bFB08eaA7cd513F9";
|
42
|
+
swapxCampaigns["Swapx_stS_USDCe_USDCe_gauge_Swapx"] = "Swapx stS/USDC.e USDC.e gauge Swapx 0x5DDbeF774488cc68266d5F15bFB08eaA7cd513F9";
|
40
43
|
swapxCampaigns["Swapx_wETH_wS_Swapx"] = "Swapx wETH/wS Swapx 0xF58fC088C33aD46113940173cB0da3Dd08c4AA88";
|
41
44
|
swapxCampaigns["Swapx_ANON_USDC_Swapx"] = "Swapx ANON/USDC Swapx 0x6F7C5f531024216CD8156D0B4E271E0C92a8A4E6";
|
42
45
|
swapxCampaigns["Swapx_ANON_wS_Swapx"] = "Swapx ANON/wS Swapx 0xb73a4d63fa27EB0Ded5305C5D4D1cE488edfE2A1";
|
@@ -44,17 +47,21 @@ export var swapxCampaigns;
|
|
44
47
|
swapxCampaigns["Swapx_OS_wS_Swapx"] = "Swapx OS/wS Swapx 0xa76Beaf111BaD5dD866fa4835D66b9aA2Eb1FdEc";
|
45
48
|
swapxCampaigns["Swapx_scETH_WETH_Swapx"] = "Swapx scETH/WETH Swapx 0xDa2fDdeb3D654E1F32E2664d8d95C9329e34E5c8";
|
46
49
|
swapxCampaigns["Swapx_OS_GEMSx_Swapx"] = "Swapx OS/GEMSx Swapx 0x9ac7F5961a452e9cD5Be5717bD2c3dF412D1c1a5";
|
47
|
-
swapxCampaigns["
|
50
|
+
swapxCampaigns["Swapx_USDT_USDCe_USDT_gauge_Swapx"] = "Swapx USDT/USDC.e USDT gauge Swapx 0x0d13400CC7c46D77a43957fE614ba58C827dfde6";
|
51
|
+
swapxCampaigns["Swapx_USDT_USDCe_USDCe_gauge_Swapx"] = "Swapx USDT/USDC.e USDC.e gauge Swapx 0x0d13400CC7c46D77a43957fE614ba58C827dfde6";
|
48
52
|
swapxCampaigns["Swapx_frxUSD_scUSD_Swapx"] = "Swapx frxUSD/scUSD Swapx 0x63a66Dd60b0F2812249802477adA8a890A030Eca";
|
49
53
|
swapxCampaigns["Swapx_frxETH_scETH_Swapx"] = "Swapx frxETH/scETH Swapx 0x77BF14037D3f72c65CbaEa92FA3f09f2f8978cBe";
|
50
54
|
swapxCampaigns["Swapx_FXS_frxETH_Swapx"] = "Swapx FXS/frxETH Swapx 0x3f74c162E4B2baeBA31Ac1698fEB7c5DB3aFFE4A";
|
51
55
|
swapxCampaigns["Swapx_sfrxUSD_frxUSD_Swapx"] = "Swapx sfrxUSD/frxUSD Swapx 0x7d709a567BA2fdBbB92E94E5fE74b9cbbc590835";
|
52
56
|
swapxCampaigns["Swapx_sfrxETH_frxETH_Swapx"] = "Swapx sfrxETH/frxETH Swapx 0x586C118d62664C5D253272357359A14349219EBA";
|
53
|
-
swapxCampaigns["
|
57
|
+
swapxCampaigns["Swapx_sfrxUSD_OS_sfrxUSD_gauge_Swapx"] = "Swapx sfrxUSD/OS sfrxUSD gauge Swapx 0x9255F31eF9B35d085cED6fE29F9E077EB1f513C6";
|
58
|
+
swapxCampaigns["Swapx_sfrxUSD_OS_OS_gauge_Swapx"] = "Swapx sfrxUSD/OS OS gauge Swapx 0x9255F31eF9B35d085cED6fE29F9E077EB1f513C6";
|
54
59
|
swapxCampaigns["Swapx_WBTC_SCBTC_Swapx"] = "Swapx WBTC/SCBTC Swapx 0xb96F401F789271bc14ADe2229E6189084805c50C";
|
55
60
|
swapxCampaigns["Swapx_ws_scbtc_Swapx"] = "Swapx ws/scbtc Swapx 0xcD531DAfD592be3CA9bef79cDb4C0dF8A5104b81";
|
56
61
|
swapxCampaigns["Swapx_scUSD_OS_Swapx"] = "Swapx scUSD/OS Swapx 0x370428430503B3b5970Ccaf530CbC71d02C3B61a";
|
57
62
|
swapxCampaigns["Swapx_V2_USDCe_scUSD_Swapx"] = "Swapx V2 USDCe/scUSD 0xBb8aE5b889243561ac9261F22F592B72250AFd1F";
|
63
|
+
swapxCampaigns["Swapx_wstkscUSD_scUSD_wstkscUSD_gauge_Swapx"] = "Swapx wstkscUSD/scUSD wstkscUSD gauge Swapx 0xEd08f5caD599E7F523d6B3FD598005B43aA003bb";
|
64
|
+
swapxCampaigns["Swapx_wstkscUSD_scUSD_scUSD_gauge_Swapx"] = "Swapx wstkscUSD/scUSD scUSD gauge Swapx 0xEd08f5caD599E7F523d6B3FD598005B43aA003bb";
|
58
65
|
})(swapxCampaigns || (swapxCampaigns = {}));
|
59
66
|
export var celoCampaigns;
|
60
67
|
(function (celoCampaigns) {
|
@@ -610,12 +617,26 @@ const SwapxInterfaceCampaigns = {
|
|
610
617
|
weightToken0: 4000,
|
611
618
|
weightToken1: 4000,
|
612
619
|
},
|
613
|
-
[swapxCampaigns.
|
620
|
+
[swapxCampaigns.Swapx_USDCe_scUSD_USDCe_gauge_Swapx]: {
|
614
621
|
campaignType: Campaign.CLAMM,
|
615
622
|
computeChainId: ChainId.SONIC,
|
616
623
|
hooks: [],
|
617
624
|
poolAddress: "0xDd35c88B1754879EF86BBF3A24F81fCCA5Eb6B5D",
|
618
|
-
whitelist: ["0x640429B0633851F487639BcDd8Ed523DDf1Bbff8"
|
625
|
+
whitelist: ["0x640429B0633851F487639BcDd8Ed523DDf1Bbff8"],
|
626
|
+
blacklist: [],
|
627
|
+
url: "https://swapx.fi/earn?ownerType=pools&filter=conc-liquidity",
|
628
|
+
forwarders: [],
|
629
|
+
isOutOfRangeIncentivized: false,
|
630
|
+
weightFees: 2000,
|
631
|
+
weightToken0: 4000,
|
632
|
+
weightToken1: 4000,
|
633
|
+
},
|
634
|
+
[swapxCampaigns.Swapx_USDCe_scUSD_scUSD_gauge_Swapx]: {
|
635
|
+
campaignType: Campaign.CLAMM,
|
636
|
+
computeChainId: ChainId.SONIC,
|
637
|
+
hooks: [],
|
638
|
+
poolAddress: "0xDd35c88B1754879EF86BBF3A24F81fCCA5Eb6B5D",
|
639
|
+
whitelist: ["0x4604782BcD6F749B271Fc9d14BFd583be6e5a6cf"],
|
619
640
|
blacklist: [],
|
620
641
|
url: "https://swapx.fi/earn?ownerType=pools&filter=conc-liquidity",
|
621
642
|
forwarders: [],
|
@@ -638,12 +659,26 @@ const SwapxInterfaceCampaigns = {
|
|
638
659
|
weightToken0: 4000,
|
639
660
|
weightToken1: 4000,
|
640
661
|
},
|
641
|
-
[swapxCampaigns.
|
662
|
+
[swapxCampaigns.Swapx_stS_wS_stS_gauge_Swapx]: {
|
642
663
|
campaignType: Campaign.CLAMM,
|
643
664
|
computeChainId: ChainId.SONIC,
|
644
665
|
hooks: [],
|
645
666
|
poolAddress: "0xD760791B29e7894FB827A94Ca433254bb5aFB653",
|
646
|
-
whitelist: ["0x2f9e2852de03c42c13d3dCdD2C57c0b3cF0382c1"
|
667
|
+
whitelist: ["0x2f9e2852de03c42c13d3dCdD2C57c0b3cF0382c1"],
|
668
|
+
blacklist: [],
|
669
|
+
url: "https://swapx.fi/earn?ownerType=pools&filter=conc-liquidity",
|
670
|
+
forwarders: [],
|
671
|
+
isOutOfRangeIncentivized: false,
|
672
|
+
weightFees: 2000,
|
673
|
+
weightToken0: 4000,
|
674
|
+
weightToken1: 4000,
|
675
|
+
},
|
676
|
+
[swapxCampaigns.Swapx_stS_wS_wS_gauge_Swapx]: {
|
677
|
+
campaignType: Campaign.CLAMM,
|
678
|
+
computeChainId: ChainId.SONIC,
|
679
|
+
hooks: [],
|
680
|
+
poolAddress: "0xD760791B29e7894FB827A94Ca433254bb5aFB653",
|
681
|
+
whitelist: ["0xC693c6fc1d2b44DfB5C5aa05Ca2b02A91DB97528"],
|
647
682
|
blacklist: [],
|
648
683
|
url: "https://swapx.fi/earn?ownerType=pools&filter=conc-liquidity",
|
649
684
|
forwarders: [],
|
@@ -666,12 +701,26 @@ const SwapxInterfaceCampaigns = {
|
|
666
701
|
weightToken0: 4000,
|
667
702
|
weightToken1: 4000,
|
668
703
|
},
|
669
|
-
[swapxCampaigns.
|
704
|
+
[swapxCampaigns.Swapx_stS_USDCe_stS_gauge_Swapx]: {
|
705
|
+
campaignType: Campaign.CLAMM,
|
706
|
+
computeChainId: ChainId.SONIC,
|
707
|
+
hooks: [],
|
708
|
+
poolAddress: "0x5DDbeF774488cc68266d5F15bFB08eaA7cd513F9",
|
709
|
+
whitelist: ["0x7791ECC02Ce43f877DF2D39d8073572Ded64617e"],
|
710
|
+
blacklist: [],
|
711
|
+
url: "https://swapx.fi/earn?ownerType=pools&filter=conc-liquidity",
|
712
|
+
forwarders: [],
|
713
|
+
isOutOfRangeIncentivized: false,
|
714
|
+
weightFees: 2000,
|
715
|
+
weightToken0: 4000,
|
716
|
+
weightToken1: 4000,
|
717
|
+
},
|
718
|
+
[swapxCampaigns.Swapx_stS_USDCe_USDCe_gauge_Swapx]: {
|
670
719
|
campaignType: Campaign.CLAMM,
|
671
720
|
computeChainId: ChainId.SONIC,
|
672
721
|
hooks: [],
|
673
722
|
poolAddress: "0x5DDbeF774488cc68266d5F15bFB08eaA7cd513F9",
|
674
|
-
whitelist: ["
|
723
|
+
whitelist: ["0x6bd21754fB317ABA1F112c3d01904669e7D34803"],
|
675
724
|
blacklist: [],
|
676
725
|
url: "https://swapx.fi/earn?ownerType=pools&filter=conc-liquidity",
|
677
726
|
forwarders: [],
|
@@ -778,12 +827,26 @@ const SwapxInterfaceCampaigns = {
|
|
778
827
|
weightToken0: 4000,
|
779
828
|
weightToken1: 4000,
|
780
829
|
},
|
781
|
-
[swapxCampaigns.
|
830
|
+
[swapxCampaigns.Swapx_USDT_USDCe_USDT_gauge_Swapx]: {
|
831
|
+
campaignType: Campaign.CLAMM,
|
832
|
+
computeChainId: ChainId.SONIC,
|
833
|
+
hooks: [],
|
834
|
+
poolAddress: "0x0d13400CC7c46D77a43957fE614ba58C827dfde6",
|
835
|
+
whitelist: ["0x29985EE262a4C9D878AA6A9B9dC43f2FC87a81c6"],
|
836
|
+
blacklist: [],
|
837
|
+
url: "https://swapx.fi/earn?ownerType=pools&filter=conc-liquidity",
|
838
|
+
forwarders: [],
|
839
|
+
isOutOfRangeIncentivized: false,
|
840
|
+
weightFees: 2000,
|
841
|
+
weightToken0: 4000,
|
842
|
+
weightToken1: 4000,
|
843
|
+
},
|
844
|
+
[swapxCampaigns.Swapx_USDT_USDCe_USDCe_gauge_Swapx]: {
|
782
845
|
campaignType: Campaign.CLAMM,
|
783
846
|
computeChainId: ChainId.SONIC,
|
784
847
|
hooks: [],
|
785
848
|
poolAddress: "0x0d13400CC7c46D77a43957fE614ba58C827dfde6",
|
786
|
-
whitelist: ["
|
849
|
+
whitelist: ["0x30Df881606c719916b99a0b5bc89e5eB338a226C"],
|
787
850
|
blacklist: [],
|
788
851
|
url: "https://swapx.fi/earn?ownerType=pools&filter=conc-liquidity",
|
789
852
|
forwarders: [],
|
@@ -862,12 +925,26 @@ const SwapxInterfaceCampaigns = {
|
|
862
925
|
weightToken0: 4000,
|
863
926
|
weightToken1: 4000,
|
864
927
|
},
|
865
|
-
[swapxCampaigns.
|
928
|
+
[swapxCampaigns.Swapx_sfrxUSD_OS_sfrxUSD_gauge_Swapx]: {
|
866
929
|
campaignType: Campaign.CLAMM,
|
867
930
|
computeChainId: ChainId.SONIC,
|
868
931
|
hooks: [],
|
869
932
|
poolAddress: "0x9255F31eF9B35d085cED6fE29F9E077EB1f513C6",
|
870
|
-
whitelist: ["0x88d6c63f1EF23bDff2bD483831074dc23d8416d4"
|
933
|
+
whitelist: ["0x88d6c63f1EF23bDff2bD483831074dc23d8416d4"],
|
934
|
+
blacklist: [],
|
935
|
+
url: "https://swapx.fi/earn?ownerType=pools&filter=conc-liquidity",
|
936
|
+
forwarders: [],
|
937
|
+
isOutOfRangeIncentivized: false,
|
938
|
+
weightFees: 2000,
|
939
|
+
weightToken0: 4000,
|
940
|
+
weightToken1: 4000,
|
941
|
+
},
|
942
|
+
[swapxCampaigns.Swapx_sfrxUSD_OS_OS_gauge_Swapx]: {
|
943
|
+
campaignType: Campaign.CLAMM,
|
944
|
+
computeChainId: ChainId.SONIC,
|
945
|
+
hooks: [],
|
946
|
+
poolAddress: "0x9255F31eF9B35d085cED6fE29F9E077EB1f513C6",
|
947
|
+
whitelist: ["0x99d8E114F1a6359c6048Ae5Cce163786c0Ce97DF"],
|
871
948
|
blacklist: [],
|
872
949
|
url: "https://swapx.fi/earn?ownerType=pools&filter=conc-liquidity",
|
873
950
|
forwarders: [],
|
@@ -918,6 +995,34 @@ const SwapxInterfaceCampaigns = {
|
|
918
995
|
weightToken0: 4000,
|
919
996
|
weightToken1: 4000,
|
920
997
|
},
|
998
|
+
[swapxCampaigns.Swapx_wstkscUSD_scUSD_wstkscUSD_gauge_Swapx]: {
|
999
|
+
campaignType: Campaign.CLAMM,
|
1000
|
+
computeChainId: ChainId.SONIC,
|
1001
|
+
hooks: [],
|
1002
|
+
poolAddress: "0xEd08f5caD599E7F523d6B3FD598005B43aA003bb",
|
1003
|
+
whitelist: ["0xA57898F2076277670394807F0456413BF595b25D"],
|
1004
|
+
blacklist: [],
|
1005
|
+
url: "https://swapx.fi/earn?ownerType=pools&filter=conc-liquidity",
|
1006
|
+
forwarders: [],
|
1007
|
+
isOutOfRangeIncentivized: false,
|
1008
|
+
weightFees: 2000,
|
1009
|
+
weightToken0: 4000,
|
1010
|
+
weightToken1: 4000,
|
1011
|
+
},
|
1012
|
+
[swapxCampaigns.Swapx_wstkscUSD_scUSD_scUSD_gauge_Swapx]: {
|
1013
|
+
campaignType: Campaign.CLAMM,
|
1014
|
+
computeChainId: ChainId.SONIC,
|
1015
|
+
hooks: [],
|
1016
|
+
poolAddress: "0xEd08f5caD599E7F523d6B3FD598005B43aA003bb",
|
1017
|
+
whitelist: ["0xECDd1Df06b5b0C598348678F83B74ADDcbD45835"],
|
1018
|
+
blacklist: [],
|
1019
|
+
url: "https://swapx.fi/earn?ownerType=pools&filter=conc-liquidity",
|
1020
|
+
forwarders: [],
|
1021
|
+
isOutOfRangeIncentivized: false,
|
1022
|
+
weightFees: 2000,
|
1023
|
+
weightToken0: 4000,
|
1024
|
+
weightToken1: 4000,
|
1025
|
+
},
|
921
1026
|
[swapxCampaigns.Swapx_V2_USDCe_scUSD_Swapx]: {
|
922
1027
|
campaignType: Campaign.ERC20,
|
923
1028
|
computeChainId: ChainId.SONIC,
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import type { CreateProtocolModel, GetProtocolsQueryModel, Protocol, ProtocolId, UpdateProtocolModel } from "./protocol.model";
|
2
2
|
export declare abstract class ProtocolService {
|
3
|
-
findMany(query: GetProtocolsQueryModel): Promise<Protocol["model"][]>;
|
4
|
-
countMany(query: GetProtocolsQueryModel): Promise<number>;
|
5
|
-
getFromId(id: ProtocolId | string): Promise<Protocol["model"] | null>;
|
6
|
-
getFromName(name: string): Promise<Protocol["model"] | null>;
|
7
|
-
create(data: CreateProtocolModel): Promise<{
|
3
|
+
static findMany(query: GetProtocolsQueryModel): Promise<Protocol["model"][]>;
|
4
|
+
static countMany(query: GetProtocolsQueryModel): Promise<number>;
|
5
|
+
static getFromId(id: ProtocolId | string): Promise<Protocol["model"] | null>;
|
6
|
+
static getFromName(name: string): Promise<Protocol["model"] | null>;
|
7
|
+
static create(data: CreateProtocolModel): Promise<{
|
8
8
|
name: string;
|
9
9
|
url: string;
|
10
10
|
description: string;
|
@@ -12,7 +12,7 @@ export declare abstract class ProtocolService {
|
|
12
12
|
tags: string[];
|
13
13
|
icon: string;
|
14
14
|
}>;
|
15
|
-
update(id: string, data: UpdateProtocolModel): Promise<{
|
15
|
+
static update(id: string, data: UpdateProtocolModel): Promise<{
|
16
16
|
name: string;
|
17
17
|
url: string;
|
18
18
|
description: string;
|
@@ -20,5 +20,5 @@ export declare abstract class ProtocolService {
|
|
20
20
|
tags: string[];
|
21
21
|
icon: string;
|
22
22
|
}>;
|
23
|
-
changeLogoUrls(): Promise<void>;
|
23
|
+
static changeLogoUrls(): Promise<void>;
|
24
24
|
}
|
@@ -4,7 +4,7 @@ import { ChainService } from "../chain";
|
|
4
4
|
import { ProtocolRepository } from "./protocol.repository";
|
5
5
|
// ─── Protocols Services ──────────────────────────────────────────────────────
|
6
6
|
export class ProtocolService {
|
7
|
-
async findMany(query) {
|
7
|
+
static async findMany(query) {
|
8
8
|
const protocols = await ProtocolRepository.findMany(query);
|
9
9
|
const enrichedProtocols = protocols.map(({ MainOpportunities, ...protocol }) => ({
|
10
10
|
...protocol,
|
@@ -14,33 +14,33 @@ export class ProtocolService {
|
|
14
14
|
}));
|
15
15
|
return enrichedProtocols;
|
16
16
|
}
|
17
|
-
async countMany(query) {
|
17
|
+
static async countMany(query) {
|
18
18
|
return ProtocolRepository.countMany(query);
|
19
19
|
}
|
20
|
-
async getFromId(id) {
|
20
|
+
static async getFromId(id) {
|
21
21
|
return ProtocolRepository.read(id);
|
22
22
|
}
|
23
23
|
// Todo : Should be a findfirst by name here
|
24
|
-
async getFromName(name) {
|
24
|
+
static async getFromName(name) {
|
25
25
|
return (await ProtocolRepository.findManyByName(name))[0];
|
26
26
|
}
|
27
|
-
async create(data) {
|
27
|
+
static async create(data) {
|
28
28
|
return await ProtocolRepository.create(data);
|
29
29
|
}
|
30
|
-
async update(id, data) {
|
30
|
+
static async update(id, data) {
|
31
31
|
// let iconUri = data.icon;
|
32
32
|
// if (data.iconFile) {
|
33
33
|
// iconUri = await BucketService.upload("merkl-assets", `/protocols/${id}`, data.iconFile.stream(), true);
|
34
34
|
// }
|
35
35
|
return await ProtocolRepository.update(id, data);
|
36
36
|
}
|
37
|
-
async changeLogoUrls() {
|
37
|
+
static async changeLogoUrls() {
|
38
38
|
const oldUrl = "https://storage.googleapis.com/merkl-assets/";
|
39
39
|
const newUrl = "https://raw.githubusercontent.com/AngleProtocol/angle-token-list/main/src/assets/";
|
40
|
-
const protocols = await
|
40
|
+
const protocols = await ProtocolService.findMany({ items: 10_000 });
|
41
41
|
for (const protocol of protocols) {
|
42
42
|
if (protocol.icon.includes(oldUrl)) {
|
43
|
-
await
|
43
|
+
await ProtocolService.update(protocol.id, { icon: protocol.icon.replace(oldUrl, newUrl) });
|
44
44
|
log.info(`Updated protocol ${protocol.id} icon`);
|
45
45
|
}
|
46
46
|
}
|
@@ -879,6 +879,7 @@ export declare const v4: Elysia<"/v4", false, {
|
|
879
879
|
patch: {
|
880
880
|
body: {
|
881
881
|
name?: string | undefined;
|
882
|
+
status?: "NONE" | "PAST" | "LIVE" | "SOON" | undefined;
|
882
883
|
tags?: string[] | undefined;
|
883
884
|
};
|
884
885
|
params: {
|
@@ -2847,8 +2848,18 @@ export declare const v4: Elysia<"/v4", false, {
|
|
2847
2848
|
};
|
2848
2849
|
headers: unknown;
|
2849
2850
|
response: {
|
2850
|
-
|
2851
|
-
|
2851
|
+
200: ({
|
2852
|
+
name: string;
|
2853
|
+
url: string;
|
2854
|
+
description: string;
|
2855
|
+
id: string;
|
2856
|
+
tags: string[];
|
2857
|
+
icon: string;
|
2858
|
+
} & {
|
2859
|
+
dailyRewards?: number | undefined;
|
2860
|
+
numberOfLiveCampaigns?: number | undefined;
|
2861
|
+
opportunityLiveTags?: string[] | undefined;
|
2862
|
+
})[];
|
2852
2863
|
};
|
2853
2864
|
};
|
2854
2865
|
};
|
@@ -7,7 +7,7 @@ import { ChainDto } from "../accounting";
|
|
7
7
|
import { CreateTokenDto, FindUniqueTokenAllowanceDto, FindUniqueTokenDto, GetTokenBalanceDto, GetTokenQueryDto, NotionWebhookDto, TokenIdDto, UpdateTokenDto, } from "./token.model";
|
8
8
|
import { TokenService } from "./token.service";
|
9
9
|
// ─── Tokens Controller ───────────────────────────────────────────────────────
|
10
|
-
export const TokenController = new Elysia({ prefix: "/tokens", detail: { tags: ["Tokens"]
|
10
|
+
export const TokenController = new Elysia({ prefix: "/tokens", detail: { tags: ["Tokens"] } })
|
11
11
|
// ─── Get A Token By Id ───────────────────────────────────────────────
|
12
12
|
.get("/:id", async ({ params }) => {
|
13
13
|
try {
|
@@ -18,7 +18,12 @@ export const TokenController = new Elysia({ prefix: "/tokens", detail: { tags: [
|
|
18
18
|
if (err.code && err.code === "P2025")
|
19
19
|
throw new NotFoundError();
|
20
20
|
}
|
21
|
-
}, {
|
21
|
+
}, {
|
22
|
+
params: FindUniqueTokenDto,
|
23
|
+
detail: {
|
24
|
+
hide: true,
|
25
|
+
},
|
26
|
+
})
|
22
27
|
.get("/:id/allowance/:owner/:spender", async ({ params: { id, owner, spender } }) => {
|
23
28
|
try {
|
24
29
|
const [chainId, address] = id.split("-");
|
@@ -30,11 +35,19 @@ export const TokenController = new Elysia({ prefix: "/tokens", detail: { tags: [
|
|
30
35
|
if (err.code && err.code === "P2025")
|
31
36
|
throw new NotFoundError();
|
32
37
|
}
|
33
|
-
}, {
|
38
|
+
}, {
|
39
|
+
params: FindUniqueTokenAllowanceDto,
|
40
|
+
detail: {
|
41
|
+
hide: true,
|
42
|
+
},
|
43
|
+
})
|
34
44
|
// ─── Get Valid Reward Token ───────────────────────────────────────────
|
35
45
|
.get("/reward/:chainId", async ({ params }) => TokenService.getValidRewardTokens(params.chainId), {
|
36
46
|
params: ChainDto,
|
37
47
|
beforeHandle: ({ params }) => throwOnUnsupportedChainId(params.chainId),
|
48
|
+
detail: {
|
49
|
+
description: "Get the list of tokens that are accept as reward tokens on a given chain",
|
50
|
+
},
|
38
51
|
})
|
39
52
|
// ─── Get Tokens With Balances ────────────────────────────────────────
|
40
53
|
.get("/balances", async ({ query: { chainId, userAddress, tokenAddress, additionalTokenAddresses } }) => {
|
@@ -43,11 +56,24 @@ export const TokenController = new Elysia({ prefix: "/tokens", detail: { tags: [
|
|
43
56
|
return await TokenService.fetchVerifiedBalances(chainId, userAddress, additionalTokenAddresses);
|
44
57
|
}, {
|
45
58
|
query: GetTokenBalanceDto,
|
59
|
+
detail: {
|
60
|
+
hide: true,
|
61
|
+
},
|
46
62
|
})
|
47
63
|
// ─── Get Many Tokens ─────────────────────────────────────────────────
|
48
|
-
.get("/", async ({ query }) => await TokenService.findMany(query), {
|
64
|
+
.get("/", async ({ query }) => await TokenService.findMany(query), {
|
65
|
+
query: GetTokenQueryDto,
|
66
|
+
detail: {
|
67
|
+
hide: true,
|
68
|
+
},
|
69
|
+
})
|
49
70
|
// ─── Count Tokens ────────────────────────────────────────────────────
|
50
|
-
.get("/count", async ({ query }) => await TokenService.countMany(query), {
|
71
|
+
.get("/count", async ({ query }) => await TokenService.countMany(query), {
|
72
|
+
query: GetTokenQueryDto,
|
73
|
+
detail: {
|
74
|
+
hide: true,
|
75
|
+
},
|
76
|
+
})
|
51
77
|
// ─── Update IsTest Status ────────────────────────────────────────────
|
52
78
|
.post("/", async ({ body }) => await TokenService.fillAndCreate(body), {
|
53
79
|
body: CreateTokenDto,
|