@merkl/api 0.10.386 → 0.10.388
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 +12 -0
- package/dist/src/index.d.ts +4 -0
- package/dist/src/libs/campaigns/campaignTypes/CompoundDynamicData.js +17 -7
- package/dist/src/modules/v4/campaign/campaign.controller.d.ts +2 -0
- package/dist/src/modules/v4/campaign/campaign.model.d.ts +1 -0
- package/dist/src/modules/v4/campaign/campaign.model.js +1 -0
- package/dist/src/modules/v4/campaign/campaign.repository.d.ts +1 -0
- package/dist/src/modules/v4/campaign/campaign.repository.js +2 -1
- package/dist/src/modules/v4/dynamicData/dynamicData.controller.d.ts +1 -0
- package/dist/src/modules/v4/opportunity/opportunity.controller.d.ts +1 -0
- package/dist/src/modules/v4/router.d.ts +4 -0
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/src/eden/index.d.ts
CHANGED
@@ -596,6 +596,7 @@ declare const eden: {
|
|
596
596
|
mainParameter?: string | undefined;
|
597
597
|
campaignId?: string | undefined;
|
598
598
|
opportunityId?: string | undefined;
|
599
|
+
creatorAddress?: string | undefined;
|
599
600
|
creatorId?: string | undefined;
|
600
601
|
test?: boolean | undefined;
|
601
602
|
creatorTag?: string | undefined;
|
@@ -933,6 +934,7 @@ declare const eden: {
|
|
933
934
|
mainParameter?: string | undefined;
|
934
935
|
campaignId?: string | undefined;
|
935
936
|
opportunityId?: string | undefined;
|
937
|
+
creatorAddress?: string | undefined;
|
936
938
|
creatorId?: string | undefined;
|
937
939
|
test?: boolean | undefined;
|
938
940
|
creatorTag?: string | undefined;
|
@@ -1003,6 +1005,7 @@ declare const eden: {
|
|
1003
1005
|
mainParameter?: string | undefined;
|
1004
1006
|
campaignId?: string | undefined;
|
1005
1007
|
opportunityId?: string | undefined;
|
1008
|
+
creatorAddress?: string | undefined;
|
1006
1009
|
creatorId?: string | undefined;
|
1007
1010
|
test?: boolean | undefined;
|
1008
1011
|
creatorTag?: string | undefined;
|
@@ -2487,6 +2490,7 @@ declare const eden: {
|
|
2487
2490
|
mainParameter?: string | undefined;
|
2488
2491
|
campaignId?: string | undefined;
|
2489
2492
|
opportunityId?: string | undefined;
|
2493
|
+
creatorAddress?: string | undefined;
|
2490
2494
|
creatorId?: string | undefined;
|
2491
2495
|
test?: boolean | undefined;
|
2492
2496
|
creatorTag?: string | undefined;
|
@@ -4138,6 +4142,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
4138
4142
|
mainParameter?: string | undefined;
|
4139
4143
|
campaignId?: string | undefined;
|
4140
4144
|
opportunityId?: string | undefined;
|
4145
|
+
creatorAddress?: string | undefined;
|
4141
4146
|
creatorId?: string | undefined;
|
4142
4147
|
test?: boolean | undefined;
|
4143
4148
|
creatorTag?: string | undefined;
|
@@ -4706,6 +4711,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
4706
4711
|
mainParameter?: string | undefined;
|
4707
4712
|
campaignId?: string | undefined;
|
4708
4713
|
opportunityId?: string | undefined;
|
4714
|
+
creatorAddress?: string | undefined;
|
4709
4715
|
creatorId?: string | undefined;
|
4710
4716
|
test?: boolean | undefined;
|
4711
4717
|
creatorTag?: string | undefined;
|
@@ -4779,6 +4785,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
4779
4785
|
mainParameter?: string | undefined;
|
4780
4786
|
campaignId?: string | undefined;
|
4781
4787
|
opportunityId?: string | undefined;
|
4788
|
+
creatorAddress?: string | undefined;
|
4782
4789
|
creatorId?: string | undefined;
|
4783
4790
|
test?: boolean | undefined;
|
4784
4791
|
creatorTag?: string | undefined;
|
@@ -6691,6 +6698,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
6691
6698
|
mainParameter?: string | undefined;
|
6692
6699
|
campaignId?: string | undefined;
|
6693
6700
|
opportunityId?: string | undefined;
|
6701
|
+
creatorAddress?: string | undefined;
|
6694
6702
|
creatorId?: string | undefined;
|
6695
6703
|
test?: boolean | undefined;
|
6696
6704
|
creatorTag?: string | undefined;
|
@@ -8763,6 +8771,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
8763
8771
|
mainParameter?: string | undefined;
|
8764
8772
|
campaignId?: string | undefined;
|
8765
8773
|
opportunityId?: string | undefined;
|
8774
|
+
creatorAddress?: string | undefined;
|
8766
8775
|
creatorId?: string | undefined;
|
8767
8776
|
test?: boolean | undefined;
|
8768
8777
|
creatorTag?: string | undefined;
|
@@ -9100,6 +9109,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
9100
9109
|
mainParameter?: string | undefined;
|
9101
9110
|
campaignId?: string | undefined;
|
9102
9111
|
opportunityId?: string | undefined;
|
9112
|
+
creatorAddress?: string | undefined;
|
9103
9113
|
creatorId?: string | undefined;
|
9104
9114
|
test?: boolean | undefined;
|
9105
9115
|
creatorTag?: string | undefined;
|
@@ -9170,6 +9180,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
9170
9180
|
mainParameter?: string | undefined;
|
9171
9181
|
campaignId?: string | undefined;
|
9172
9182
|
opportunityId?: string | undefined;
|
9183
|
+
creatorAddress?: string | undefined;
|
9173
9184
|
creatorId?: string | undefined;
|
9174
9185
|
test?: boolean | undefined;
|
9175
9186
|
creatorTag?: string | undefined;
|
@@ -10654,6 +10665,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
10654
10665
|
mainParameter?: string | undefined;
|
10655
10666
|
campaignId?: string | undefined;
|
10656
10667
|
opportunityId?: string | undefined;
|
10668
|
+
creatorAddress?: string | undefined;
|
10657
10669
|
creatorId?: string | undefined;
|
10658
10670
|
test?: boolean | undefined;
|
10659
10671
|
creatorTag?: string | undefined;
|
package/dist/src/index.d.ts
CHANGED
@@ -503,6 +503,7 @@ declare const app: Elysia<"", false, {
|
|
503
503
|
mainParameter?: string | undefined;
|
504
504
|
campaignId?: string | undefined;
|
505
505
|
opportunityId?: string | undefined;
|
506
|
+
creatorAddress?: string | undefined;
|
506
507
|
creatorId?: string | undefined;
|
507
508
|
test?: boolean | undefined;
|
508
509
|
creatorTag?: string | undefined;
|
@@ -1071,6 +1072,7 @@ declare const app: Elysia<"", false, {
|
|
1071
1072
|
mainParameter?: string | undefined;
|
1072
1073
|
campaignId?: string | undefined;
|
1073
1074
|
opportunityId?: string | undefined;
|
1075
|
+
creatorAddress?: string | undefined;
|
1074
1076
|
creatorId?: string | undefined;
|
1075
1077
|
test?: boolean | undefined;
|
1076
1078
|
creatorTag?: string | undefined;
|
@@ -1144,6 +1146,7 @@ declare const app: Elysia<"", false, {
|
|
1144
1146
|
mainParameter?: string | undefined;
|
1145
1147
|
campaignId?: string | undefined;
|
1146
1148
|
opportunityId?: string | undefined;
|
1149
|
+
creatorAddress?: string | undefined;
|
1147
1150
|
creatorId?: string | undefined;
|
1148
1151
|
test?: boolean | undefined;
|
1149
1152
|
creatorTag?: string | undefined;
|
@@ -3056,6 +3059,7 @@ declare const app: Elysia<"", false, {
|
|
3056
3059
|
mainParameter?: string | undefined;
|
3057
3060
|
campaignId?: string | undefined;
|
3058
3061
|
opportunityId?: string | undefined;
|
3062
|
+
creatorAddress?: string | undefined;
|
3059
3063
|
creatorId?: string | undefined;
|
3060
3064
|
test?: boolean | undefined;
|
3061
3065
|
creatorTag?: string | undefined;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { BN2Number, CTokenInterface, CompFork, CompoundSubCampaignType, ERC20Interface, IonicERC20_INTERFACE, LayerBankERC20Interface, YEAR, } from "@sdk";
|
1
|
+
import { BN2Number, CTokenInterface, ChainInteractionService, CompFork, CompoundSubCampaignType, ERC20Interface, IonicERC20_INTERFACE, LayerBankERC20Interface, NULL_ADDRESS, YEAR, } from "@sdk";
|
2
2
|
import { log } from "../../../utils/logger";
|
3
3
|
import { Pricer } from "../../../utils/pricer";
|
4
4
|
export async function CompoundDynamicData(_chainId, campaigns) {
|
@@ -28,11 +28,13 @@ export async function CompoundDynamicData(_chainId, campaigns) {
|
|
28
28
|
target: campaign.campaignParameters.targetToken,
|
29
29
|
});
|
30
30
|
}
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
31
|
+
if (campaign.campaignParameters.underlyingToken !== NULL_ADDRESS) {
|
32
|
+
calls.push({
|
33
|
+
allowFailure: true,
|
34
|
+
callData: ERC20Interface.encodeFunctionData("balanceOf", [campaign.campaignParameters.targetToken]),
|
35
|
+
target: campaign.campaignParameters.underlyingToken,
|
36
|
+
});
|
37
|
+
}
|
36
38
|
}
|
37
39
|
}
|
38
40
|
else {
|
@@ -76,7 +78,15 @@ export async function CompoundDynamicData(_chainId, campaigns) {
|
|
76
78
|
else {
|
77
79
|
borrowedAmount = BN2Number(CTokenInterface.decodeFunctionResult("totalBorrows", result[i++])[0], campaign.campaignParameters.decimalsUnderlyingToken);
|
78
80
|
}
|
79
|
-
|
81
|
+
if (campaign.campaignParameters.underlyingToken === NULL_ADDRESS) {
|
82
|
+
// For the case of ETH
|
83
|
+
nonUtilizedSupplied = BN2Number(await ChainInteractionService(campaign.computeChainId)
|
84
|
+
.provider()
|
85
|
+
.getBalance(campaign.campaignParameters.targetToken), 18);
|
86
|
+
}
|
87
|
+
else {
|
88
|
+
nonUtilizedSupplied = BN2Number(ERC20Interface.decodeFunctionResult("balanceOf", result[i++])[0], campaign.campaignParameters.decimalsUnderlyingToken);
|
89
|
+
}
|
80
90
|
totalSupplyTargetToken = borrowedAmount + nonUtilizedSupplied;
|
81
91
|
}
|
82
92
|
}
|
@@ -123,6 +123,7 @@ export declare const CampaignController: Elysia<"/campaigns", false, {
|
|
123
123
|
mainParameter?: string | undefined;
|
124
124
|
campaignId?: string | undefined;
|
125
125
|
opportunityId?: string | undefined;
|
126
|
+
creatorAddress?: string | undefined;
|
126
127
|
creatorId?: string | undefined;
|
127
128
|
test?: boolean | undefined;
|
128
129
|
creatorTag?: string | undefined;
|
@@ -196,6 +197,7 @@ export declare const CampaignController: Elysia<"/campaigns", false, {
|
|
196
197
|
mainParameter?: string | undefined;
|
197
198
|
campaignId?: string | undefined;
|
198
199
|
opportunityId?: string | undefined;
|
200
|
+
creatorAddress?: string | undefined;
|
199
201
|
creatorId?: string | undefined;
|
200
202
|
test?: boolean | undefined;
|
201
203
|
creatorTag?: string | undefined;
|
@@ -122,6 +122,7 @@ export declare const UpdateMetaDataCampaignDto: import("@sinclair/typebox").TObj
|
|
122
122
|
}>;
|
123
123
|
export declare const GetCampaignQueryDto: import("@sinclair/typebox").TObject<{
|
124
124
|
creatorTag: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
125
|
+
creatorAddress: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
125
126
|
creatorId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
126
127
|
chainId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
127
128
|
type: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TEnum<{
|
@@ -83,6 +83,7 @@ export const UpdateMetaDataCampaignDto = t.Object({
|
|
83
83
|
});
|
84
84
|
export const GetCampaignQueryDto = t.Object({
|
85
85
|
creatorTag: t.Optional(t.String({ description: "Filter campaigns created by a user who has a specific tag" })),
|
86
|
+
creatorAddress: t.Optional(t.String()),
|
86
87
|
creatorId: t.Optional(t.String({ description: "Filter campaigns created by a user who is registered as a merkl creator" })),
|
87
88
|
chainId: t.Optional(t.Numeric({
|
88
89
|
description: "Filter by chain.<br>You can get the list of all supported chains by calling [GET /v4/chains](#tag/chains/GET/v4/chains/)",
|
@@ -18,6 +18,7 @@ export declare abstract class CampaignRepository {
|
|
18
18
|
} | undefined;
|
19
19
|
subType: number | undefined;
|
20
20
|
type: "INVALID" | "ERC20" | "CLAMM" | "ERC20_SNAPSHOT" | "JSON_AIRDROP" | "SILO" | "RADIANT" | "MORPHO" | "DOLOMITE" | "BADGER" | "COMPOUND" | "AJNA" | "EULER" | "UNISWAP_V4" | "ION" | "EIGENLAYER" | "ERC20TRANSFERS" | "ERC20LOGPROCESSOR" | "ERC20REBASELOGPROCESSOR" | "VEST" | "ERC20_FIX_APR" | "HYPERDRIVELOGPROCESSOR" | "HYPERDRIVELOGFIXPROCESSOR" | undefined;
|
21
|
+
creatorAddress: string | undefined;
|
21
22
|
RewardToken: {
|
22
23
|
address: string | undefined;
|
23
24
|
symbol: string | undefined;
|
@@ -9,7 +9,7 @@ import { OpportunityService } from "../opportunity";
|
|
9
9
|
import { TokenService } from "../token";
|
10
10
|
export class CampaignRepository {
|
11
11
|
static transformQueryToPrismaFilters(query) {
|
12
|
-
const { creatorTag, creatorId, chainId, endTimestamp, opportunityId, mainParameter, campaignId, startTimestamp, subType, type, tokenAddress, tokenSymbol, test, } = query;
|
12
|
+
const { creatorTag, creatorId, creatorAddress, chainId, endTimestamp, opportunityId, mainParameter, campaignId, startTimestamp, subType, type, tokenAddress, tokenSymbol, test, } = query;
|
13
13
|
const getTagFilter = () => {
|
14
14
|
if (creatorTag && creatorId)
|
15
15
|
return {
|
@@ -32,6 +32,7 @@ export class CampaignRepository {
|
|
32
32
|
startTimestamp: startTimestamp ? { gte: +startTimestamp } : undefined,
|
33
33
|
subType,
|
34
34
|
type,
|
35
|
+
creatorAddress,
|
35
36
|
RewardToken: {
|
36
37
|
address: tokenAddress ? tokenAddress : undefined,
|
37
38
|
symbol: tokenSymbol ? tokenSymbol : undefined,
|
@@ -95,6 +95,7 @@ export declare const DynamicDataController: Elysia<"/dynamic-data", false, {
|
|
95
95
|
mainParameter?: string | undefined;
|
96
96
|
campaignId?: string | undefined;
|
97
97
|
opportunityId?: string | undefined;
|
98
|
+
creatorAddress?: string | undefined;
|
98
99
|
creatorId?: string | undefined;
|
99
100
|
test?: boolean | undefined;
|
100
101
|
creatorTag?: string | undefined;
|
@@ -372,6 +372,7 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
|
|
372
372
|
mainParameter?: string | undefined;
|
373
373
|
campaignId?: string | undefined;
|
374
374
|
opportunityId?: string | undefined;
|
375
|
+
creatorAddress?: string | undefined;
|
375
376
|
creatorId?: string | undefined;
|
376
377
|
test?: boolean | undefined;
|
377
378
|
creatorTag?: string | undefined;
|
@@ -381,6 +381,7 @@ export declare const v4: Elysia<"/v4", false, {
|
|
381
381
|
mainParameter?: string | undefined;
|
382
382
|
campaignId?: string | undefined;
|
383
383
|
opportunityId?: string | undefined;
|
384
|
+
creatorAddress?: string | undefined;
|
384
385
|
creatorId?: string | undefined;
|
385
386
|
test?: boolean | undefined;
|
386
387
|
creatorTag?: string | undefined;
|
@@ -949,6 +950,7 @@ export declare const v4: Elysia<"/v4", false, {
|
|
949
950
|
mainParameter?: string | undefined;
|
950
951
|
campaignId?: string | undefined;
|
951
952
|
opportunityId?: string | undefined;
|
953
|
+
creatorAddress?: string | undefined;
|
952
954
|
creatorId?: string | undefined;
|
953
955
|
test?: boolean | undefined;
|
954
956
|
creatorTag?: string | undefined;
|
@@ -1022,6 +1024,7 @@ export declare const v4: Elysia<"/v4", false, {
|
|
1022
1024
|
mainParameter?: string | undefined;
|
1023
1025
|
campaignId?: string | undefined;
|
1024
1026
|
opportunityId?: string | undefined;
|
1027
|
+
creatorAddress?: string | undefined;
|
1025
1028
|
creatorId?: string | undefined;
|
1026
1029
|
test?: boolean | undefined;
|
1027
1030
|
creatorTag?: string | undefined;
|
@@ -2934,6 +2937,7 @@ export declare const v4: Elysia<"/v4", false, {
|
|
2934
2937
|
mainParameter?: string | undefined;
|
2935
2938
|
campaignId?: string | undefined;
|
2936
2939
|
opportunityId?: string | undefined;
|
2940
|
+
creatorAddress?: string | undefined;
|
2937
2941
|
creatorId?: string | undefined;
|
2938
2942
|
test?: boolean | undefined;
|
2939
2943
|
creatorTag?: string | undefined;
|