@merkl/api 0.10.211 → 0.10.213
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/libs/campaigns/campaignTypes/ERC20SubTypes/processor/curveNPoolProcessor.js +7 -2
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound1.js +1 -1
- package/dist/src/utils/decodeCalls.js +6 -1
- package/dist/src/utils/generateCardName.js +3 -0
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/curveNPoolProcessor.js
CHANGED
@@ -59,9 +59,14 @@ export class CurveNPoolProcessor extends GenericProcessor {
|
|
59
59
|
for (let i = 0; i < typeInfo.numberTokens; i++) {
|
60
60
|
const symbol = typeInfo[`symbolToken${i}`];
|
61
61
|
const parsedSymbol = symbol.split("_")[0].slice(1);
|
62
|
-
let price = (await pricer.get({ symbol:
|
62
|
+
let price = (await pricer.get({ symbol: symbol })) ?? 0;
|
63
63
|
if (price === 0) {
|
64
|
-
|
64
|
+
// For cross curve
|
65
|
+
const parsedSymbol = symbol.split("_")[0].slice(1);
|
66
|
+
price = (await pricer.get({ symbol: parsedSymbol })) ?? 0;
|
67
|
+
if (price === 0) {
|
68
|
+
price = (await pricer.get({ symbol: hardcodedSymbol })) ?? 0;
|
69
|
+
}
|
65
70
|
}
|
66
71
|
const decimals = Number(typeInfo[`decimalsToken${i}`]);
|
67
72
|
const amount = BN2Number(typeInfo[`balanceToken${i}`], decimals);
|
@@ -45,7 +45,7 @@ function satisfiesNameConditions(name, type) {
|
|
45
45
|
lowerCaseName === "pufeth/wsteth" ||
|
46
46
|
lowerCaseName === "hai/lusd");
|
47
47
|
case tokenType.crosscurve:
|
48
|
-
return lowerCaseName.startsWith("crosscurve");
|
48
|
+
return lowerCaseName.startsWith("crosscurve") || lowerCaseName === "eywa/usdt";
|
49
49
|
case tokenType.silostaking:
|
50
50
|
return lowerCaseName === "isei";
|
51
51
|
case tokenType.beefy:
|
@@ -129,7 +129,12 @@ export function decodeCall(calls, index, key, type) {
|
|
129
129
|
case "coin2":
|
130
130
|
return CurveInterface.decodeFunctionResult("coins", returnData)[0];
|
131
131
|
case "N_COINS":
|
132
|
-
|
132
|
+
try {
|
133
|
+
return CurveStableSwapNGInterface.decodeFunctionResult("N_COINS", returnData)[0];
|
134
|
+
}
|
135
|
+
catch (e) {
|
136
|
+
return 2;
|
137
|
+
}
|
133
138
|
case "balances":
|
134
139
|
return CurveStableSwapNGInterface.decodeFunctionResult("balances", returnData)[0];
|
135
140
|
case "calcNetShareValue":
|
@@ -102,6 +102,9 @@ export function generateCardName(type, typeInfo, campaign, symbols = [""]) {
|
|
102
102
|
case tokenType.cpmmGamma:
|
103
103
|
return `Provide ${typeInfo.symbolToken0}/${typeInfo.symbolToken1} on ${typeInfo.protocol}`;
|
104
104
|
case tokenType.crosscurve:
|
105
|
+
if (typeInfo.name.toLowerCase() === "eywa/usdt") {
|
106
|
+
return `Curve ${typeInfo.name}`;
|
107
|
+
}
|
105
108
|
return `${typeInfo.name}`;
|
106
109
|
default:
|
107
110
|
return `Hold ${typeInfo.name} (${campaign.campaignParameters.symbolTargetToken})`;
|