@gearbox-protocol/sdk 1.5.5 → 1.5.6
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.
|
@@ -29,6 +29,7 @@ export declare type CurveParams = {
|
|
|
29
29
|
type: AdapterInterface.CURVE_V1_2ASSETS | AdapterInterface.CURVE_V1_3ASSETS | AdapterInterface.CURVE_V1_4ASSETS | AdapterInterface.CURVE_V1_WRAPPER;
|
|
30
30
|
lpToken: CurveLPToken;
|
|
31
31
|
tokens: Array<NormalToken | CurveLPToken>;
|
|
32
|
+
underlyings?: Array<NormalToken>;
|
|
32
33
|
wrapper?: CurvePoolContract;
|
|
33
34
|
} & BaseContractParams;
|
|
34
35
|
export declare type CurveSteCRVPoolParams = {
|
|
@@ -126,6 +126,7 @@ exports.contractParams = {
|
|
|
126
126
|
type: adapters_1.AdapterInterface.CURVE_V1_2ASSETS,
|
|
127
127
|
lpToken: "FRAX3CRV",
|
|
128
128
|
tokens: ["FRAX", "3Crv"],
|
|
129
|
+
underlyings: ["FRAX", "DAI", "USDC", "USDT"],
|
|
129
130
|
},
|
|
130
131
|
CURVE_LUSD_POOL: {
|
|
131
132
|
name: "Curve LUSD",
|
|
@@ -133,6 +134,7 @@ exports.contractParams = {
|
|
|
133
134
|
type: adapters_1.AdapterInterface.CURVE_V1_2ASSETS,
|
|
134
135
|
lpToken: "LUSD3CRV",
|
|
135
136
|
tokens: ["LUSD", "3Crv"],
|
|
137
|
+
underlyings: ["LUSD", "DAI", "USDC", "USDT"],
|
|
136
138
|
},
|
|
137
139
|
CURVE_SUSD_POOL: {
|
|
138
140
|
name: "Curve SUSD",
|
|
@@ -155,6 +157,7 @@ exports.contractParams = {
|
|
|
155
157
|
type: adapters_1.AdapterInterface.CURVE_V1_2ASSETS,
|
|
156
158
|
lpToken: "gusd3CRV",
|
|
157
159
|
tokens: ["GUSD", "3Crv"],
|
|
160
|
+
underlyings: ["GUSD", "DAI", "USDC", "USDT"],
|
|
158
161
|
},
|
|
159
162
|
YEARN_DAI_VAULT: {
|
|
160
163
|
name: "Yearn DAI",
|
|
@@ -8,5 +8,6 @@ export declare class CurveAdapterParser extends AbstractParser implements IParse
|
|
|
8
8
|
constructor(contract: SupportedContract, isContract: boolean);
|
|
9
9
|
parse(calldata: string): string;
|
|
10
10
|
getTokenByIndex(index: number): SupportedToken;
|
|
11
|
+
getUnderlyingTokenByIndex(index: number): SupportedToken;
|
|
11
12
|
convertAmounts(amounts: Array<BigNumberish>): string;
|
|
12
13
|
}
|
|
@@ -53,8 +53,12 @@ var CurveAdapterParser = /** @class */ (function (_super) {
|
|
|
53
53
|
case "exchange":
|
|
54
54
|
case "exchange_underlying": {
|
|
55
55
|
var _b = this.decodeFunctionData(functionFragment, calldata), i = _b[0], j = _b[1], dx = _b[2], min_dy = _b[3];
|
|
56
|
-
var iSym =
|
|
57
|
-
|
|
56
|
+
var iSym = functionFragment.name === "exchange_underlying"
|
|
57
|
+
? this.getUnderlyingTokenByIndex(i)
|
|
58
|
+
: this.getTokenByIndex(i);
|
|
59
|
+
var jSym = functionFragment.name === "exchange_underlying"
|
|
60
|
+
? this.getUnderlyingTokenByIndex(j)
|
|
61
|
+
: this.getTokenByIndex(j);
|
|
58
62
|
return "".concat(functionName, "(i ,j: ").concat(iSym, " => ").concat(jSym, ", dx: ").concat(this.formatBN(dx, iSym), ", min_dy: ").concat(this.formatBN(min_dy, jSym), ")");
|
|
59
63
|
}
|
|
60
64
|
case "exchange_all":
|
|
@@ -92,6 +96,10 @@ var CurveAdapterParser = /** @class */ (function (_super) {
|
|
|
92
96
|
return contracts_1.contractParams[this.contract]
|
|
93
97
|
.tokens[index];
|
|
94
98
|
};
|
|
99
|
+
CurveAdapterParser.prototype.getUnderlyingTokenByIndex = function (index) {
|
|
100
|
+
return contracts_1.contractParams[this.contract]
|
|
101
|
+
.underlyings[index];
|
|
102
|
+
};
|
|
95
103
|
CurveAdapterParser.prototype.convertAmounts = function (amounts) {
|
|
96
104
|
var _this = this;
|
|
97
105
|
return amounts
|
|
@@ -16,7 +16,7 @@ describe("CurveAdapterParser test", function () {
|
|
|
16
16
|
constants_1.WAD.mul(3),
|
|
17
17
|
constants_1.WAD.mul(32),
|
|
18
18
|
]));
|
|
19
|
-
(0, chai_1.expect)(parsed).to.be.eq("Curve2AssetsAdapter[CURVE_FRAX_POOL].exchange_underlying(i ,j: FRAX =>
|
|
19
|
+
(0, chai_1.expect)(parsed).to.be.eq("Curve2AssetsAdapter[CURVE_FRAX_POOL].exchange_underlying(i ,j: FRAX => DAI, dx: 3.00 [3000000000000000000], min_dy: 32.00 [32000000000000000000])", "Curve2AssetsAdapter: Incorrect parse exchange_underlying");
|
|
20
20
|
parsed = parser.parse(ifc.encodeFunctionData("add_liquidity_one_coin", [
|
|
21
21
|
constants_1.WAD.mul(3),
|
|
22
22
|
0,
|