@gearbox-protocol/sdk 1.17.2 → 1.18.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.
@@ -1,13 +1,34 @@
1
1
  import { BigNumber, providers } from "ethers";
2
- import { ConvexPoolContract } from "../contracts/contracts";
2
+ import { ConvexPoolContract, ConvexPoolParams } from "../contracts/contracts";
3
3
  import { NetworkType } from "../core/constants";
4
+ import { CurveLPToken } from "../tokens/curveLP";
5
+ import { SupportedToken } from "../tokens/token";
4
6
  import { CurveAPYResult } from "./curveAPY";
5
- export interface GetConvexAPYProps {
6
- pool: ConvexPoolContract;
7
+ export interface GetConvexAPYBaseProps {
7
8
  provider: providers.Provider;
8
9
  networkType: NetworkType;
9
10
  getTokenPrice: (tokenAddress: string) => BigNumber;
10
11
  curveAPY: CurveAPYResult;
11
12
  }
13
+ export interface GetConvexAPYBulkProps extends GetConvexAPYBaseProps {
14
+ pools: Array<ConvexPoolContract>;
15
+ }
16
+ export declare function getConvexAPYBulk({ pools, provider, networkType, getTokenPrice, curveAPY, }: GetConvexAPYBulkProps): Promise<BigNumber[]>;
17
+ export interface GetConvexAPYProps extends GetConvexAPYBaseProps {
18
+ pool: ConvexPoolContract;
19
+ }
12
20
  export declare function getConvexAPY({ pool, provider, networkType, getTokenPrice, curveAPY, }: GetConvexAPYProps): Promise<BigNumber>;
13
21
  export declare function getCVXMintAmount(crvAmount: BigNumber, cvxSupply: BigNumber): BigNumber;
22
+ export interface CalculateConvexAPYProps {
23
+ basePoolRate: BigNumber;
24
+ basePoolSupply: BigNumber;
25
+ vPrice: BigNumber;
26
+ cvxSupply: BigNumber;
27
+ extra: Array<BigNumber>;
28
+ extraPoolAddresses: string[];
29
+ poolParams: ConvexPoolParams;
30
+ underlying: CurveLPToken;
31
+ getTokenPrice: (tokenAddress: string) => BigNumber;
32
+ curveAPY: CurveAPYResult;
33
+ tokenList: Record<SupportedToken, string>;
34
+ }
@@ -45,65 +45,150 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
45
45
  return to.concat(ar || Array.prototype.slice.call(from));
46
46
  };
47
47
  Object.defineProperty(exports, "__esModule", { value: true });
48
- exports.getCVXMintAmount = exports.getConvexAPY = void 0;
48
+ exports.getCVXMintAmount = exports.getConvexAPY = exports.getConvexAPYBulk = void 0;
49
49
  var ethers_1 = require("ethers");
50
50
  var contracts_1 = require("../contracts/contracts");
51
51
  var constants_1 = require("../core/constants");
52
52
  var token_1 = require("../tokens/token");
53
53
  var types_1 = require("../types");
54
54
  var multicall_1 = require("../utils/multicall");
55
- function getConvexAPY(_a) {
56
- var pool = _a.pool, provider = _a.provider, networkType = _a.networkType, getTokenPrice = _a.getTokenPrice, curveAPY = _a.curveAPY;
55
+ function getConvexAPYBulk(_a) {
56
+ var pools = _a.pools, provider = _a.provider, networkType = _a.networkType, getTokenPrice = _a.getTokenPrice, curveAPY = _a.curveAPY;
57
57
  return __awaiter(this, void 0, void 0, function () {
58
- var tokenList, contractsList, poolParams, stakedTokenParams, underlying, basePoolAddress, crvParams, swapPoolAddress, cvxAddress, extraPoolAddresses, _b, basePoolRate, basePoolSupply, vPrice, cvxSupply, extra, cvxPrice, crvPrice, crvPerSecond, virtualSupply, crvPerUnderlying, crvPerYear, cvxPerYear, crvAPY, cvxAPY, extraAPRs, extraAPYTotal, baseApyWAD;
59
- return __generator(this, function (_c) {
60
- switch (_c.label) {
58
+ var poolsInfo, calls, response, parsedResponse, apyList;
59
+ return __generator(this, function (_b) {
60
+ switch (_b.label) {
61
61
  case 0:
62
- tokenList = token_1.tokenDataByNetwork[networkType];
63
- contractsList = contracts_1.contractsByNetwork[networkType];
64
- poolParams = contracts_1.contractParams[pool];
65
- stakedTokenParams = token_1.supportedTokens[poolParams.stakedToken];
66
- underlying = stakedTokenParams.underlying;
67
- basePoolAddress = contractsList[pool];
68
- crvParams = token_1.supportedTokens[underlying];
69
- swapPoolAddress = contractsList[crvParams.pool];
70
- cvxAddress = tokenList.CVX;
71
- extraPoolAddresses = poolParams.extraRewards.map(function (d) { return d.poolAddress[networkType]; });
72
- return [4 /*yield*/, getPoolData({
62
+ poolsInfo = pools.map(function (pool) { return getPoolInfo({ networkType: networkType, pool: pool }); });
63
+ calls = poolsInfo.map(function (_a) {
64
+ var basePoolAddress = _a[1], swapPoolAddress = _a[2], extraPoolAddresses = _a[4], tokenList = _a[5];
65
+ return getPoolDataCalls({
73
66
  basePoolAddress: basePoolAddress,
74
67
  swapPoolAddress: swapPoolAddress,
75
- cvxAddress: cvxAddress,
68
+ cvxAddress: tokenList.CVX,
69
+ extraPoolAddresses: extraPoolAddresses,
70
+ });
71
+ });
72
+ return [4 /*yield*/, (0, multicall_1.multicall)(calls.flat(1), provider)];
73
+ case 1:
74
+ response = _b.sent();
75
+ parsedResponse = calls.reduce(function (_a, call) {
76
+ var acc = _a[0], start = _a[1];
77
+ var end = start + call.length;
78
+ var currentResponse = response.slice(start, end);
79
+ acc.push(currentResponse);
80
+ return [acc, end];
81
+ }, [[], 0])[0];
82
+ apyList = parsedResponse.map(function (_a, i) {
83
+ var basePoolRate = _a[0], basePoolSupply = _a[1], vPrice = _a[2], cvxSupply = _a[3], extra = _a.slice(4);
84
+ var _b = poolsInfo[i], poolParams = _b[0], underlying = _b[3], extraPoolAddresses = _b[4], tokenList = _b[5];
85
+ var apy = calculateConvexAPY({
86
+ basePoolRate: basePoolRate,
87
+ basePoolSupply: basePoolSupply,
88
+ vPrice: vPrice,
89
+ cvxSupply: cvxSupply,
90
+ extra: extra,
76
91
  extraPoolAddresses: extraPoolAddresses,
77
- provider: provider,
78
- })];
92
+ poolParams: poolParams,
93
+ underlying: underlying,
94
+ getTokenPrice: getTokenPrice,
95
+ curveAPY: curveAPY,
96
+ tokenList: tokenList,
97
+ });
98
+ return apy;
99
+ });
100
+ return [2 /*return*/, apyList];
101
+ }
102
+ });
103
+ });
104
+ }
105
+ exports.getConvexAPYBulk = getConvexAPYBulk;
106
+ function getConvexAPY(_a) {
107
+ var pool = _a.pool, provider = _a.provider, networkType = _a.networkType, getTokenPrice = _a.getTokenPrice, curveAPY = _a.curveAPY;
108
+ return __awaiter(this, void 0, void 0, function () {
109
+ var _b, poolParams, basePoolAddress, swapPoolAddress, underlying, extraPoolAddresses, tokenList, calls, _c, basePoolRate, basePoolSupply, vPrice, cvxSupply, extra, apy;
110
+ return __generator(this, function (_d) {
111
+ switch (_d.label) {
112
+ case 0:
113
+ _b = getPoolInfo({ networkType: networkType, pool: pool }), poolParams = _b[0], basePoolAddress = _b[1], swapPoolAddress = _b[2], underlying = _b[3], extraPoolAddresses = _b[4], tokenList = _b[5];
114
+ calls = getPoolDataCalls({
115
+ basePoolAddress: basePoolAddress,
116
+ swapPoolAddress: swapPoolAddress,
117
+ cvxAddress: tokenList.CVX,
118
+ extraPoolAddresses: extraPoolAddresses,
119
+ });
120
+ return [4 /*yield*/, (0, multicall_1.multicall)(calls, provider)];
79
121
  case 1:
80
- _b = _c.sent(), basePoolRate = _b[0], basePoolSupply = _b[1], vPrice = _b[2], cvxSupply = _b[3], extra = _b.slice(4);
81
- cvxPrice = getTokenPrice(tokenList.CVX);
82
- crvPrice = getTokenPrice(tokenList.CRV);
83
- crvPerSecond = basePoolRate;
84
- virtualSupply = basePoolSupply.mul(vPrice).div(constants_1.WAD);
85
- crvPerUnderlying = crvPerSecond.mul(constants_1.WAD).div(virtualSupply);
86
- crvPerYear = crvPerUnderlying.mul(constants_1.SECONDS_PER_YEAR);
87
- cvxPerYear = getCVXMintAmount(crvPerYear, cvxSupply);
88
- crvAPY = crvPerYear.mul(crvPrice).div(constants_1.PRICE_DECIMALS);
89
- cvxAPY = cvxPerYear.mul(cvxPrice).div(constants_1.PRICE_DECIMALS);
90
- extraAPRs = extraPoolAddresses.map(function (_, index) {
91
- var extraRewardSymbol = poolParams.extraRewards[index].rewardToken;
92
- var extraPoolRate = extra[index];
93
- var perUnderlying = extraPoolRate.mul(constants_1.WAD).div(virtualSupply);
94
- var perYear = perUnderlying.mul(constants_1.SECONDS_PER_YEAR);
95
- var extraPrice = getTokenPrice(tokenList[extraRewardSymbol]);
96
- var extraAPY = perYear.mul(extraPrice).div(constants_1.PRICE_DECIMALS);
97
- return extraAPY;
122
+ _c = _d.sent(), basePoolRate = _c[0], basePoolSupply = _c[1], vPrice = _c[2], cvxSupply = _c[3], extra = _c.slice(4);
123
+ apy = calculateConvexAPY({
124
+ basePoolRate: basePoolRate,
125
+ basePoolSupply: basePoolSupply,
126
+ vPrice: vPrice,
127
+ cvxSupply: cvxSupply,
128
+ extra: extra,
129
+ extraPoolAddresses: extraPoolAddresses,
130
+ poolParams: poolParams,
131
+ underlying: underlying,
132
+ getTokenPrice: getTokenPrice,
133
+ curveAPY: curveAPY,
134
+ tokenList: tokenList,
98
135
  });
99
- extraAPYTotal = extraAPRs.reduce(function (acc, apy) { return acc.add(apy); }, ethers_1.BigNumber.from(0));
100
- baseApyWAD = curveAPY[underlying];
101
- return [2 /*return*/, baseApyWAD.add(crvAPY).add(cvxAPY).add(extraAPYTotal)];
136
+ return [2 /*return*/, apy];
102
137
  }
103
138
  });
104
139
  });
105
140
  }
106
141
  exports.getConvexAPY = getConvexAPY;
142
+ function getPoolInfo(_a) {
143
+ var pool = _a.pool, networkType = _a.networkType;
144
+ var tokenList = token_1.tokenDataByNetwork[networkType];
145
+ var contractsList = contracts_1.contractsByNetwork[networkType];
146
+ var poolParams = contracts_1.contractParams[pool];
147
+ var stakedTokenParams = token_1.supportedTokens[poolParams.stakedToken];
148
+ var underlying = stakedTokenParams.underlying;
149
+ var basePoolAddress = contractsList[pool];
150
+ var crvParams = token_1.supportedTokens[underlying];
151
+ var swapPoolAddress = contractsList[crvParams.pool];
152
+ var extraPoolAddresses = poolParams.extraRewards.map(function (d) { return d.poolAddress[networkType]; });
153
+ return [
154
+ poolParams,
155
+ basePoolAddress,
156
+ swapPoolAddress,
157
+ underlying,
158
+ extraPoolAddresses,
159
+ tokenList,
160
+ ];
161
+ }
162
+ function getPoolDataCalls(_a) {
163
+ var basePoolAddress = _a.basePoolAddress, swapPoolAddress = _a.swapPoolAddress, cvxAddress = _a.cvxAddress, extraPoolAddresses = _a.extraPoolAddresses;
164
+ var calls = __spreadArray([
165
+ {
166
+ address: basePoolAddress,
167
+ interface: types_1.IBaseRewardPool__factory.createInterface(),
168
+ method: "rewardRate()",
169
+ },
170
+ {
171
+ address: basePoolAddress,
172
+ interface: types_1.IBaseRewardPool__factory.createInterface(),
173
+ method: "totalSupply()",
174
+ },
175
+ {
176
+ address: swapPoolAddress,
177
+ interface: types_1.ICurvePool__factory.createInterface(),
178
+ method: "get_virtual_price()",
179
+ },
180
+ {
181
+ address: cvxAddress,
182
+ interface: types_1.IConvexToken__factory.createInterface(),
183
+ method: "totalSupply()",
184
+ }
185
+ ], extraPoolAddresses.map(function (extraPoolAddress) { return ({
186
+ address: extraPoolAddress,
187
+ interface: types_1.IBaseRewardPool__factory.createInterface(),
188
+ method: "rewardRate()",
189
+ }); }), true);
190
+ return calls;
191
+ }
107
192
  var CVX_MAX_SUPPLY = constants_1.WAD.mul(100000000);
108
193
  var CVX_REDUCTION_PER_CLIFF = ethers_1.BigNumber.from(100000);
109
194
  var CVX_TOTAL_CLIFFS = constants_1.WAD.mul(1000);
@@ -118,38 +203,27 @@ function getCVXMintAmount(crvAmount, cvxSupply) {
118
203
  return ethers_1.BigNumber.from(0);
119
204
  }
120
205
  exports.getCVXMintAmount = getCVXMintAmount;
121
- function getPoolData(_a) {
122
- var basePoolAddress = _a.basePoolAddress, swapPoolAddress = _a.swapPoolAddress, cvxAddress = _a.cvxAddress, extraPoolAddresses = _a.extraPoolAddresses, provider = _a.provider;
123
- return __awaiter(this, void 0, void 0, function () {
124
- var calls;
125
- return __generator(this, function (_b) {
126
- calls = __spreadArray([
127
- {
128
- address: basePoolAddress,
129
- interface: types_1.IBaseRewardPool__factory.createInterface(),
130
- method: "rewardRate()",
131
- },
132
- {
133
- address: basePoolAddress,
134
- interface: types_1.IBaseRewardPool__factory.createInterface(),
135
- method: "totalSupply()",
136
- },
137
- {
138
- address: swapPoolAddress,
139
- interface: types_1.ICurvePool__factory.createInterface(),
140
- method: "get_virtual_price()",
141
- },
142
- {
143
- address: cvxAddress,
144
- interface: types_1.IConvexToken__factory.createInterface(),
145
- method: "totalSupply()",
146
- }
147
- ], extraPoolAddresses.map(function (extraPoolAddress) { return ({
148
- address: extraPoolAddress,
149
- interface: types_1.IBaseRewardPool__factory.createInterface(),
150
- method: "rewardRate()",
151
- }); }), true);
152
- return [2 /*return*/, (0, multicall_1.multicall)(calls, provider)];
153
- });
206
+ function calculateConvexAPY(_a) {
207
+ var basePoolRate = _a.basePoolRate, basePoolSupply = _a.basePoolSupply, vPrice = _a.vPrice, cvxSupply = _a.cvxSupply, extra = _a.extra, extraPoolAddresses = _a.extraPoolAddresses, poolParams = _a.poolParams, underlying = _a.underlying, getTokenPrice = _a.getTokenPrice, curveAPY = _a.curveAPY, tokenList = _a.tokenList;
208
+ var cvxPrice = getTokenPrice(tokenList.CVX);
209
+ var crvPrice = getTokenPrice(tokenList.CRV);
210
+ var crvPerSecond = basePoolRate;
211
+ var virtualSupply = basePoolSupply.mul(vPrice).div(constants_1.WAD);
212
+ var crvPerUnderlying = crvPerSecond.mul(constants_1.WAD).div(virtualSupply);
213
+ var crvPerYear = crvPerUnderlying.mul(constants_1.SECONDS_PER_YEAR);
214
+ var cvxPerYear = getCVXMintAmount(crvPerYear, cvxSupply);
215
+ var crvAPY = crvPerYear.mul(crvPrice).div(constants_1.PRICE_DECIMALS);
216
+ var cvxAPY = cvxPerYear.mul(cvxPrice).div(constants_1.PRICE_DECIMALS);
217
+ var extraAPRs = extraPoolAddresses.map(function (_, index) {
218
+ var extraRewardSymbol = poolParams.extraRewards[index].rewardToken;
219
+ var extraPoolRate = extra[index];
220
+ var perUnderlying = extraPoolRate.mul(constants_1.WAD).div(virtualSupply);
221
+ var perYear = perUnderlying.mul(constants_1.SECONDS_PER_YEAR);
222
+ var extraPrice = getTokenPrice(tokenList[extraRewardSymbol]);
223
+ var extraAPY = perYear.mul(extraPrice).div(constants_1.PRICE_DECIMALS);
224
+ return extraAPY;
154
225
  });
226
+ var extraAPYTotal = extraAPRs.reduce(function (acc, apy) { return acc.add(apy); }, ethers_1.BigNumber.from(0));
227
+ var baseApyWAD = curveAPY[underlying];
228
+ return baseApyWAD.add(crvAPY).add(cvxAPY).add(extraAPYTotal);
155
229
  }
@@ -2,7 +2,7 @@ import { BigNumber } from "ethers";
2
2
  import { SupportedContract } from "../contracts/contracts";
3
3
  import { EVMTx, EVMTxProps } from "./eventOrTx";
4
4
  export interface TxSerialized {
5
- type: "TxAddLiquidity" | "TxRemoveLiquidity" | "TxSwap" | "TxAddCollateral" | "TxIncreaseBorrowAmount" | "TxOpenAccount" | "TxRepayAccount" | "TxCloseAccount" | "TxApprove" | "TxOpenMultitokenAccount" | "TxClaimReward" | "TxClaimNFT";
5
+ type: "TxAddLiquidity" | "TxRemoveLiquidity" | "TxSwap" | "TxAddCollateral" | "TxIncreaseBorrowAmount" | "TxOpenAccount" | "TxRepayAccount" | "TxCloseAccount" | "TxApprove" | "TxOpenMultitokenAccount" | "TxClaimReward" | "TxClaimNFT" | "TxClaimGearRewards" | "TxEnableTokens";
6
6
  content: string;
7
7
  }
8
8
  export declare class TxSerializer {
@@ -127,6 +127,17 @@ export declare class TxClaimNFT extends EVMTx {
127
127
  toString(): string;
128
128
  serialize(): TxSerialized;
129
129
  }
130
+ interface TxClaimGearRewardsProps extends EVMTxProps {
131
+ token: string;
132
+ amount: BigNumber;
133
+ }
134
+ export declare class TxClaimGearRewards extends EVMTx {
135
+ token: string;
136
+ amount: BigNumber;
137
+ constructor(opts: TxClaimGearRewardsProps);
138
+ toString(): string;
139
+ serialize(): TxSerialized;
140
+ }
130
141
  interface RepayAccountProps extends EVMTxProps {
131
142
  creditManager: string;
132
143
  }
@@ -154,4 +165,17 @@ export declare class TxApprove extends EVMTx {
154
165
  toString(): string;
155
166
  serialize(): TxSerialized;
156
167
  }
168
+ interface TxEnableTokensProps extends EVMTxProps {
169
+ enabledTokens: Array<string>;
170
+ disabledTokens: Array<string>;
171
+ creditManager: string;
172
+ }
173
+ export declare class TxEnableTokens extends EVMTx {
174
+ readonly enabledTokens: Array<string>;
175
+ readonly disabledTokens: Array<string>;
176
+ readonly creditManager: string;
177
+ constructor(opts: TxEnableTokensProps);
178
+ toString(): string;
179
+ serialize(): TxSerialized;
180
+ }
157
181
  export {};
@@ -15,7 +15,7 @@ var __extends = (this && this.__extends) || (function () {
15
15
  };
16
16
  })();
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.TxApprove = exports.TxCloseAccount = exports.TxRepayAccount = exports.TxClaimNFT = exports.TxClaimReward = exports.TxOpenMultitokenAccount = exports.TxOpenAccount = exports.TxIncreaseBorrowAmount = exports.TxAddCollateral = exports.TXSwap = exports.TxRemoveLiquidity = exports.TxAddLiquidity = exports.TxSerializer = void 0;
18
+ exports.TxEnableTokens = exports.TxApprove = exports.TxCloseAccount = exports.TxRepayAccount = exports.TxClaimGearRewards = exports.TxClaimNFT = exports.TxClaimReward = exports.TxOpenMultitokenAccount = exports.TxOpenAccount = exports.TxIncreaseBorrowAmount = exports.TxAddCollateral = exports.TXSwap = exports.TxRemoveLiquidity = exports.TxAddLiquidity = exports.TxSerializer = void 0;
19
19
  var ethers_1 = require("ethers");
20
20
  var contracts_1 = require("../contracts/contracts");
21
21
  var contractsRegister_1 = require("../contracts/contractsRegister");
@@ -57,6 +57,10 @@ var TxSerializer = /** @class */ (function () {
57
57
  return new TxClaimReward(params);
58
58
  case "TxClaimNFT":
59
59
  return new TxClaimNFT(params);
60
+ case "TxClaimGearRewards":
61
+ return new TxClaimGearRewards(params);
62
+ case "TxEnableTokens":
63
+ return new TxEnableTokens(params);
60
64
  default:
61
65
  throw new Error("Unknown transaction for parsing: ".concat(e.type));
62
66
  }
@@ -323,6 +327,32 @@ var TxClaimNFT = /** @class */ (function (_super) {
323
327
  return TxClaimNFT;
324
328
  }(eventOrTx_1.EVMTx));
325
329
  exports.TxClaimNFT = TxClaimNFT;
330
+ var TxClaimGearRewards = /** @class */ (function (_super) {
331
+ __extends(TxClaimGearRewards, _super);
332
+ function TxClaimGearRewards(opts) {
333
+ var _this = _super.call(this, {
334
+ block: opts.block,
335
+ txHash: opts.txHash,
336
+ txStatus: opts.txStatus,
337
+ timestamp: opts.timestamp,
338
+ }) || this;
339
+ _this.amount = opts.amount;
340
+ _this.token = opts.token;
341
+ return _this;
342
+ }
343
+ TxClaimGearRewards.prototype.toString = function () {
344
+ var _a = (0, token_1.extractTokenData)(this.token), symbol = _a[0], decimals = _a[1];
345
+ return "GEAR Rewards claimed: ".concat((0, formatter_1.formatBN)(this.amount, decimals || 18), " ").concat(symbol, " ");
346
+ };
347
+ TxClaimGearRewards.prototype.serialize = function () {
348
+ return {
349
+ type: "TxClaimGearRewards",
350
+ content: JSON.stringify(this),
351
+ };
352
+ };
353
+ return TxClaimGearRewards;
354
+ }(eventOrTx_1.EVMTx));
355
+ exports.TxClaimGearRewards = TxClaimGearRewards;
326
356
  var TxRepayAccount = /** @class */ (function (_super) {
327
357
  __extends(TxRepayAccount, _super);
328
358
  function TxRepayAccount(opts) {
@@ -396,3 +426,43 @@ var TxApprove = /** @class */ (function (_super) {
396
426
  return TxApprove;
397
427
  }(eventOrTx_1.EVMTx));
398
428
  exports.TxApprove = TxApprove;
429
+ var TxEnableTokens = /** @class */ (function (_super) {
430
+ __extends(TxEnableTokens, _super);
431
+ function TxEnableTokens(opts) {
432
+ var _this = _super.call(this, {
433
+ block: opts.block,
434
+ txHash: opts.txHash,
435
+ txStatus: opts.txStatus,
436
+ timestamp: opts.timestamp,
437
+ }) || this;
438
+ _this.enabledTokens = opts.enabledTokens;
439
+ _this.disabledTokens = opts.disabledTokens;
440
+ _this.creditManager = opts.creditManager;
441
+ return _this;
442
+ }
443
+ TxEnableTokens.prototype.toString = function () {
444
+ var enabledSymbols = this.enabledTokens.map(function (address) {
445
+ var tokenSymbol = (0, token_1.extractTokenData)(address)[0];
446
+ return tokenSymbol;
447
+ });
448
+ var disabledSymbols = this.disabledTokens.map(function (address) {
449
+ var tokenSymbol = (0, token_1.extractTokenData)(address)[0];
450
+ return tokenSymbol;
451
+ });
452
+ var currentSentences = [
453
+ enabledSymbols.length > 0 ? "enabled: ".concat(enabledSymbols.join(", ")) : "",
454
+ disabledSymbols.length > 0
455
+ ? "disabled: ".concat(disabledSymbols.join(", "))
456
+ : "",
457
+ ].filter(function (s) { return !!s; });
458
+ return "Credit account ".concat((0, contractsRegister_1.getContractName)(this.creditManager), ": ").concat(currentSentences.join("; "));
459
+ };
460
+ TxEnableTokens.prototype.serialize = function () {
461
+ return {
462
+ type: "TxEnableTokens",
463
+ content: JSON.stringify(this),
464
+ };
465
+ };
466
+ return TxEnableTokens;
467
+ }(eventOrTx_1.EVMTx));
468
+ exports.TxEnableTokens = TxEnableTokens;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/sdk",
3
- "version": "1.17.2",
3
+ "version": "1.18.0",
4
4
  "description": "Gearbox SDK",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",