@gearbox-protocol/sdk 1.20.0 → 1.20.1
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/lib/parsers/ERC20Parser.js +1 -1
- package/lib/parsers/abstractParser.d.ts +1 -0
- package/lib/parsers/abstractParser.js +3 -0
- package/lib/parsers/addressProviderParser.js +1 -1
- package/lib/parsers/airdropDistributorParser.js +1 -1
- package/lib/parsers/convexBaseRewardPoolAdapterParser.js +2 -2
- package/lib/parsers/convextRewardPoolParser.js +1 -1
- package/lib/parsers/creditManagerParser.js +1 -1
- package/lib/parsers/curveAdapterParser.js +2 -2
- package/lib/parsers/dataCompressorParser.js +1 -1
- package/lib/parsers/lidoOracleParser.js +1 -1
- package/lib/parsers/lidoSTETHParser.js +2 -3
- package/lib/parsers/multicallParser.js +1 -1
- package/lib/parsers/txParser.js +1 -2
- package/lib/parsers/yearnV2AdapterParser.js +1 -1
- package/package.json +1 -1
|
@@ -30,7 +30,7 @@ var ERC20Parser = /** @class */ (function (_super) {
|
|
|
30
30
|
var _a = this.parseSelector(calldata), functionFragment = _a.functionFragment, functionName = _a.functionName;
|
|
31
31
|
switch (functionFragment.name) {
|
|
32
32
|
case "totalSupply": {
|
|
33
|
-
return "".concat(functionName);
|
|
33
|
+
return "".concat(functionName, "()");
|
|
34
34
|
}
|
|
35
35
|
case "balanceOf": {
|
|
36
36
|
var address = this.decodeFunctionData(functionFragment, calldata)[0];
|
|
@@ -12,6 +12,7 @@ export declare class AbstractParser {
|
|
|
12
12
|
constructor(contract: string);
|
|
13
13
|
parseSelector(calldata: string): ParseSelectorResult;
|
|
14
14
|
decodeFunctionData(functionFragment: FunctionFragment | string, data: BytesLike): Result;
|
|
15
|
+
encodeFunctionResult(functionFragment: FunctionFragment | string, data: Array<any>): string;
|
|
15
16
|
tokenSymbol(address: string): SupportedToken;
|
|
16
17
|
formatBN(amount: BigNumberish, token: SupportedToken): string;
|
|
17
18
|
parseToObject(address: string, calldata: string): {
|
|
@@ -18,6 +18,9 @@ var AbstractParser = /** @class */ (function () {
|
|
|
18
18
|
AbstractParser.prototype.decodeFunctionData = function (functionFragment, data) {
|
|
19
19
|
return this.ifc.decodeFunctionData(functionFragment, data);
|
|
20
20
|
};
|
|
21
|
+
AbstractParser.prototype.encodeFunctionResult = function (functionFragment, data) {
|
|
22
|
+
return this.ifc.encodeFunctionResult(functionFragment, data);
|
|
23
|
+
};
|
|
21
24
|
AbstractParser.prototype.tokenSymbol = function (address) {
|
|
22
25
|
var symbol = token_1.tokenSymbolByAddress[address.toLowerCase()];
|
|
23
26
|
if (!symbol)
|
|
@@ -34,7 +34,7 @@ var AddressProviderParser = /** @class */ (function (_super) {
|
|
|
34
34
|
case "getDataCompressor":
|
|
35
35
|
case "getWETHGateway":
|
|
36
36
|
case "getPriceOracle": {
|
|
37
|
-
return "".concat(functionName);
|
|
37
|
+
return "".concat(functionName, "()");
|
|
38
38
|
}
|
|
39
39
|
default:
|
|
40
40
|
return "".concat(functionName, ": Unknown operation ").concat(functionFragment.name, " with calldata ").concat(calldata);
|
|
@@ -29,7 +29,7 @@ var AirdropDistributorParser = /** @class */ (function (_super) {
|
|
|
29
29
|
var _a = this.parseSelector(calldata), functionFragment = _a.functionFragment, functionName = _a.functionName;
|
|
30
30
|
switch (functionFragment.name) {
|
|
31
31
|
case "merkleRoot": {
|
|
32
|
-
return "".concat(functionName);
|
|
32
|
+
return "".concat(functionName, "()");
|
|
33
33
|
}
|
|
34
34
|
default:
|
|
35
35
|
return "".concat(functionName, ": Unknown operation ").concat(functionFragment.name, " with calldata ").concat(calldata);
|
|
@@ -48,9 +48,9 @@ var ConvexBaseRewardPoolAdapterParser = /** @class */ (function (_super) {
|
|
|
48
48
|
return "".concat(functionName, "(claim: ").concat(claim, ")");
|
|
49
49
|
}
|
|
50
50
|
case "rewardRate":
|
|
51
|
-
return "".concat(functionName);
|
|
51
|
+
return "".concat(functionName, "()");
|
|
52
52
|
case "totalSupply":
|
|
53
|
-
return "".concat(functionName);
|
|
53
|
+
return "".concat(functionName, "()");
|
|
54
54
|
default:
|
|
55
55
|
return "".concat(functionName, ": Unknown operation ").concat(functionFragment.name, " with calldata ").concat(calldata);
|
|
56
56
|
}
|
|
@@ -29,7 +29,7 @@ var ConvexRewardPoolParser = /** @class */ (function (_super) {
|
|
|
29
29
|
var _a = this.parseSelector(calldata), functionFragment = _a.functionFragment, functionName = _a.functionName;
|
|
30
30
|
switch (functionFragment.name) {
|
|
31
31
|
case "rewardRate":
|
|
32
|
-
return "".concat(functionName);
|
|
32
|
+
return "".concat(functionName, "()");
|
|
33
33
|
default:
|
|
34
34
|
return "".concat(functionName, ": Unknown operation ").concat(functionFragment.name, " with calldata ").concat(calldata);
|
|
35
35
|
}
|
|
@@ -32,7 +32,7 @@ var CreditManagerParser = /** @class */ (function (_super) {
|
|
|
32
32
|
var _a = this.parseSelector(calldata), functionFragment = _a.functionFragment, functionName = _a.functionName;
|
|
33
33
|
switch (functionFragment.name) {
|
|
34
34
|
case "creditConfigurator": {
|
|
35
|
-
return "".concat(functionName);
|
|
35
|
+
return "".concat(functionName, "()");
|
|
36
36
|
}
|
|
37
37
|
default:
|
|
38
38
|
return "".concat(functionName, ": Unknown operation ").concat(functionFragment.name, " with calldata ").concat(calldata);
|
|
@@ -95,7 +95,7 @@ var CurveAdapterParser = /** @class */ (function (_super) {
|
|
|
95
95
|
return "".concat(functionName, "(amounts: [").concat(this.convertAmounts(amounts), "], max_burn_amount: ").concat(this.formatBN(maxBurnAmount, this.lpToken), ")");
|
|
96
96
|
}
|
|
97
97
|
case "totalSupply": {
|
|
98
|
-
return "".concat(functionName);
|
|
98
|
+
return "".concat(functionName, "()");
|
|
99
99
|
}
|
|
100
100
|
case "balances": {
|
|
101
101
|
var i = this.decodeFunctionData(functionFragment, calldata)[0];
|
|
@@ -106,7 +106,7 @@ var CurveAdapterParser = /** @class */ (function (_super) {
|
|
|
106
106
|
return "".concat(functionName, "(").concat(address, ")");
|
|
107
107
|
}
|
|
108
108
|
case "get_virtual_price": {
|
|
109
|
-
return "".concat(functionName);
|
|
109
|
+
return "".concat(functionName, "()");
|
|
110
110
|
}
|
|
111
111
|
case "allowance": {
|
|
112
112
|
var _j = this.decodeFunctionData(functionFragment, calldata), account = _j[0], to = _j[1];
|
|
@@ -30,7 +30,7 @@ var DataCompressorParser = /** @class */ (function (_super) {
|
|
|
30
30
|
switch (functionFragment.name) {
|
|
31
31
|
case "getPoolsList":
|
|
32
32
|
case "getCreditManagersList": {
|
|
33
|
-
return "".concat(functionName);
|
|
33
|
+
return "".concat(functionName, "()");
|
|
34
34
|
}
|
|
35
35
|
default:
|
|
36
36
|
return "".concat(functionName, ": Unknown operation ").concat(functionFragment.name, " with calldata ").concat(calldata);
|
|
@@ -29,7 +29,7 @@ var LidoOracleParser = /** @class */ (function (_super) {
|
|
|
29
29
|
var _a = this.parseSelector(calldata), functionFragment = _a.functionFragment, functionName = _a.functionName;
|
|
30
30
|
switch (functionFragment.name) {
|
|
31
31
|
case "getLastCompletedReportDelta":
|
|
32
|
-
return "".concat(functionName);
|
|
32
|
+
return "".concat(functionName, "()");
|
|
33
33
|
default:
|
|
34
34
|
return "".concat(functionName, ": Unknown operation ").concat(functionFragment.name, " with calldata ").concat(calldata);
|
|
35
35
|
}
|
|
@@ -21,9 +21,8 @@ var abstractParser_1 = require("./abstractParser");
|
|
|
21
21
|
var LidoSTETHParser = /** @class */ (function (_super) {
|
|
22
22
|
__extends(LidoSTETHParser, _super);
|
|
23
23
|
function LidoSTETHParser(symbol) {
|
|
24
|
-
var _this = _super.call(this, symbol) || this;
|
|
24
|
+
var _this = _super.call(this, "LIDO_".concat(symbol)) || this;
|
|
25
25
|
_this.ifc = types_1.IstETH__factory.createInterface();
|
|
26
|
-
_this.adapterName = "TokenLido";
|
|
27
26
|
return _this;
|
|
28
27
|
}
|
|
29
28
|
LidoSTETHParser.prototype.parse = function (calldata) {
|
|
@@ -31,7 +30,7 @@ var LidoSTETHParser = /** @class */ (function (_super) {
|
|
|
31
30
|
switch (functionFragment.name) {
|
|
32
31
|
case "getFee":
|
|
33
32
|
case "totalSupply": {
|
|
34
|
-
return "".concat(functionName);
|
|
33
|
+
return "".concat(functionName, "()");
|
|
35
34
|
}
|
|
36
35
|
case "balanceOf": {
|
|
37
36
|
var address = this.decodeFunctionData(functionFragment, calldata)[0];
|
|
@@ -33,7 +33,7 @@ var MulticallParser = /** @class */ (function (_super) {
|
|
|
33
33
|
return "".concat(functionName, ": ").concat(calls);
|
|
34
34
|
}
|
|
35
35
|
case "getBlockNumber": {
|
|
36
|
-
return "".concat(functionName);
|
|
36
|
+
return "".concat(functionName, "()");
|
|
37
37
|
}
|
|
38
38
|
case "getEthBalance": {
|
|
39
39
|
var account = this.decodeFunctionData(functionFragment, calldata)[0];
|
package/lib/parsers/txParser.js
CHANGED
|
@@ -33,9 +33,8 @@ var TxParser = /** @class */ (function () {
|
|
|
33
33
|
return parser.parse(calldata);
|
|
34
34
|
};
|
|
35
35
|
TxParser.parseToObject = function (address, calldata) {
|
|
36
|
-
var _a;
|
|
37
36
|
var parser = TxParser.getParser(address);
|
|
38
|
-
return
|
|
37
|
+
return parser.parseToObject(address, calldata);
|
|
39
38
|
};
|
|
40
39
|
TxParser.getParseData = function (address) {
|
|
41
40
|
var parser = TxParser.getParser(address);
|
|
@@ -46,7 +46,7 @@ var YearnV2AdapterParser = /** @class */ (function (_super) {
|
|
|
46
46
|
return "".concat(functionName, "(").concat(amountStr).concat(addressStr).concat(maxLossStr, ")");
|
|
47
47
|
}
|
|
48
48
|
case "pricePerShare": {
|
|
49
|
-
return "".concat(functionName);
|
|
49
|
+
return "".concat(functionName, "()");
|
|
50
50
|
}
|
|
51
51
|
case "balanceOf": {
|
|
52
52
|
var address = this.decodeFunctionData(functionFragment, calldata)[0];
|