carbon-js-sdk 0.3.43-dev.1 → 0.3.43-dev.3
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/clients/CarbonQueryClient.js +2 -2
- package/lib/clients/ETHClient.js +15 -15
- package/lib/clients/HydrogenClient.js +1 -1
- package/lib/clients/NEOClient.js +7 -7
- package/lib/clients/TokenClient.js +1 -1
- package/lib/clients/ZILClient.js +17 -17
- package/lib/codec/cosmos/gov/v1beta1/query.js +2 -2
- package/lib/codec/cosmos/gov/v1beta1/tx.js +2 -2
- package/lib/codec/cosmos/tx/v1beta1/tx.js +2 -2
- package/lib/codec/index.d.ts +2 -2
- package/lib/codec/index.js +10 -6
- package/lib/codec/liquiditypool/event.d.ts +14 -0
- package/lib/codec/liquiditypool/event.js +107 -1
- package/lib/codec/liquiditypool/query.d.ts +71 -34
- package/lib/codec/liquiditypool/query.js +304 -112
- package/lib/codec/liquiditypool/tx.d.ts +0 -1
- package/lib/codec/liquiditypool/tx.js +1 -18
- package/lib/constant/generic.js +1 -1
- package/lib/modules/cdp.js +43 -43
- package/lib/modules/gov.js +12 -12
- package/lib/modules/liquiditypool.d.ts +0 -1
- package/lib/modules/liquiditypool.js +1 -2
- package/lib/provider/account/EthLedgerAccount/EthLedgerAccount.js +1 -1
- package/lib/provider/account/NeoLedgerAccount/N3Ledger/ErrorCode.js +1 -1
- package/lib/provider/account/NeoLedgerAccount/N3Ledger/main.js +8 -8
- package/lib/provider/account/NeoLedgerAccount/NeoLedgerAccount.js +3 -3
- package/lib/provider/account/NeoLedgerAccount/NeonLedger.js +1 -1
- package/lib/provider/amino/types/admin.js +28 -28
- package/lib/provider/amino/types/bank.js +1 -1
- package/lib/provider/amino/types/broker.js +1 -1
- package/lib/provider/amino/types/cdp.js +22 -22
- package/lib/provider/amino/types/coin.js +4 -4
- package/lib/provider/amino/types/gov.js +4 -12
- package/lib/provider/amino/types/ibc.js +1 -1
- package/lib/provider/amino/types/leverage.js +1 -1
- package/lib/provider/amino/types/liquidityPool.js +7 -9
- package/lib/provider/amino/types/market.js +1 -1
- package/lib/provider/amino/types/oracle.js +1 -1
- package/lib/provider/amino/types/order.js +4 -4
- package/lib/provider/amino/types/position.js +1 -1
- package/lib/provider/amino/types/profile.js +1 -1
- package/lib/provider/amino/types/staking.js +4 -4
- package/lib/provider/amino/types/subaccount.js +3 -3
- package/lib/provider/amino/utils.js +11 -11
- package/lib/provider/ledger/ledger.js +2 -2
- package/lib/provider/metamask/MetaMask.js +1 -1
- package/lib/provider/o3/O3Wallet.js +2 -2
- package/lib/util/address.js +13 -13
- package/lib/util/api.js +4 -4
- package/lib/util/fetch.js +1 -1
- package/lib/util/generic.js +3 -3
- package/lib/util/number.js +5 -5
- package/lib/wallet/CarbonSigner.js +2 -2
- package/lib/wallet/CarbonSigningClient.js +8 -8
- package/lib/wallet/CarbonWallet.js +6 -6
- package/lib/websocket/connector.js +3 -3
- package/lib/websocket/models.d.ts +7 -2
- package/package.json +1 -1
|
@@ -200,7 +200,6 @@ const baseMsgCreatePoolWithLiquidity = {
|
|
|
200
200
|
amountA: "",
|
|
201
201
|
amountB: "",
|
|
202
202
|
swapFee: "",
|
|
203
|
-
numQuotes: long_1.default.ZERO,
|
|
204
203
|
ampBps: long_1.default.UZERO,
|
|
205
204
|
};
|
|
206
205
|
exports.MsgCreatePoolWithLiquidity = {
|
|
@@ -229,11 +228,8 @@ exports.MsgCreatePoolWithLiquidity = {
|
|
|
229
228
|
if (message.swapFee !== "") {
|
|
230
229
|
writer.uint32(66).string(message.swapFee);
|
|
231
230
|
}
|
|
232
|
-
if (!message.numQuotes.isZero()) {
|
|
233
|
-
writer.uint32(72).int64(message.numQuotes);
|
|
234
|
-
}
|
|
235
231
|
if (!message.ampBps.isZero()) {
|
|
236
|
-
writer.uint32(
|
|
232
|
+
writer.uint32(72).uint64(message.ampBps);
|
|
237
233
|
}
|
|
238
234
|
return writer;
|
|
239
235
|
},
|
|
@@ -269,9 +265,6 @@ exports.MsgCreatePoolWithLiquidity = {
|
|
|
269
265
|
message.swapFee = reader.string();
|
|
270
266
|
break;
|
|
271
267
|
case 9:
|
|
272
|
-
message.numQuotes = reader.int64();
|
|
273
|
-
break;
|
|
274
|
-
case 10:
|
|
275
268
|
message.ampBps = reader.uint64();
|
|
276
269
|
break;
|
|
277
270
|
default:
|
|
@@ -315,10 +308,6 @@ exports.MsgCreatePoolWithLiquidity = {
|
|
|
315
308
|
object.swapFee !== undefined && object.swapFee !== null
|
|
316
309
|
? String(object.swapFee)
|
|
317
310
|
: "";
|
|
318
|
-
message.numQuotes =
|
|
319
|
-
object.numQuotes !== undefined && object.numQuotes !== null
|
|
320
|
-
? long_1.default.fromString(object.numQuotes)
|
|
321
|
-
: long_1.default.ZERO;
|
|
322
311
|
message.ampBps =
|
|
323
312
|
object.ampBps !== undefined && object.ampBps !== null
|
|
324
313
|
? long_1.default.fromString(object.ampBps)
|
|
@@ -339,8 +328,6 @@ exports.MsgCreatePoolWithLiquidity = {
|
|
|
339
328
|
message.amountA !== undefined && (obj.amountA = message.amountA);
|
|
340
329
|
message.amountB !== undefined && (obj.amountB = message.amountB);
|
|
341
330
|
message.swapFee !== undefined && (obj.swapFee = message.swapFee);
|
|
342
|
-
message.numQuotes !== undefined &&
|
|
343
|
-
(obj.numQuotes = (message.numQuotes || long_1.default.ZERO).toString());
|
|
344
331
|
message.ampBps !== undefined &&
|
|
345
332
|
(obj.ampBps = (message.ampBps || long_1.default.UZERO).toString());
|
|
346
333
|
return obj;
|
|
@@ -356,10 +343,6 @@ exports.MsgCreatePoolWithLiquidity = {
|
|
|
356
343
|
message.amountA = (_f = object.amountA) !== null && _f !== void 0 ? _f : "";
|
|
357
344
|
message.amountB = (_g = object.amountB) !== null && _g !== void 0 ? _g : "";
|
|
358
345
|
message.swapFee = (_h = object.swapFee) !== null && _h !== void 0 ? _h : "";
|
|
359
|
-
message.numQuotes =
|
|
360
|
-
object.numQuotes !== undefined && object.numQuotes !== null
|
|
361
|
-
? long_1.default.fromValue(object.numQuotes)
|
|
362
|
-
: long_1.default.ZERO;
|
|
363
346
|
message.ampBps =
|
|
364
347
|
object.ampBps !== undefined && object.ampBps !== null
|
|
365
348
|
? long_1.default.fromValue(object.ampBps)
|
package/lib/constant/generic.js
CHANGED
|
@@ -12,7 +12,7 @@ exports.DEFAULT_FEE_DENOM = "swth";
|
|
|
12
12
|
exports.DEFAULT_GAS_PRICE = new bignumber_js_1.default(10);
|
|
13
13
|
exports.DEFAULT_GAS = new bignumber_js_1.default(10000000);
|
|
14
14
|
exports.DEFAULT_FEE = {
|
|
15
|
-
amount:
|
|
15
|
+
amount: proto_signing_1.coins(exports.DEFAULT_GAS_PRICE.times(exports.DEFAULT_GAS).dp(0).toString(), "swth"),
|
|
16
16
|
gas: exports.DEFAULT_GAS.toString(10),
|
|
17
17
|
};
|
|
18
18
|
exports.CARBON_GAS_PRICE = {
|
package/lib/modules/cdp.js
CHANGED
|
@@ -429,7 +429,7 @@ class CDPModule extends base_1.default {
|
|
|
429
429
|
let availableBorrowsUsd = number_1.BN_ZERO;
|
|
430
430
|
let currLiquidationThreshold = number_1.BN_ZERO;
|
|
431
431
|
for (let i = 0; i < collaterals.length; i++) {
|
|
432
|
-
const amount =
|
|
432
|
+
const amount = number_1.bnOrZero(collaterals[i].collateralAmount);
|
|
433
433
|
if (amount.isZero()) {
|
|
434
434
|
continue; // no collateral for denom
|
|
435
435
|
}
|
|
@@ -446,9 +446,9 @@ class CDPModule extends base_1.default {
|
|
|
446
446
|
if (!assetParam) {
|
|
447
447
|
continue;
|
|
448
448
|
}
|
|
449
|
-
const ltv =
|
|
449
|
+
const ltv = number_1.bnOrZero(assetParam.loanToValue).div(number_1.BN_10000);
|
|
450
450
|
const availableBorrowUsd = collateralUsdVal.times(ltv);
|
|
451
|
-
const liquidationThreshold =
|
|
451
|
+
const liquidationThreshold = number_1.bnOrZero(assetParam.liquidationThreshold).div(number_1.BN_10000);
|
|
452
452
|
const liquidationThresholdVal = collateralUsdVal.times(liquidationThreshold);
|
|
453
453
|
totalCollateralsUsd = totalCollateralsUsd.plus(collateralUsdVal);
|
|
454
454
|
availableBorrowsUsd = availableBorrowsUsd.plus(availableBorrowUsd);
|
|
@@ -459,7 +459,7 @@ class CDPModule extends base_1.default {
|
|
|
459
459
|
const debts = debtsRsp.debts;
|
|
460
460
|
let totalDebtsUsd = number_1.BN_ZERO;
|
|
461
461
|
for (let i = 0; i < debts.length; i++) {
|
|
462
|
-
const amount =
|
|
462
|
+
const amount = number_1.bnOrZero(debts[i].principalDebt);
|
|
463
463
|
const denom = debts[i].denom;
|
|
464
464
|
if (amount.isZero()) {
|
|
465
465
|
continue;
|
|
@@ -481,7 +481,7 @@ class CDPModule extends base_1.default {
|
|
|
481
481
|
if (stablecoinDebtInfo) {
|
|
482
482
|
const accountStablecoin = yield sdk.query.cdp.AccountStablecoin({ address: account });
|
|
483
483
|
const stablecoinDecimals = (_a = (yield this.sdkProvider.getTokenClient().getDecimals(stablecoinDebtInfo.denom))) !== null && _a !== void 0 ? _a : number_1.BN_ZERO;
|
|
484
|
-
const stablecoinDebtAmount =
|
|
484
|
+
const stablecoinDebtAmount = number_1.bnOrZero(accountStablecoin.principalDebt).plus(number_1.bnOrZero(accountStablecoin.interestDebt));
|
|
485
485
|
stablecoinDebtUsd = stablecoinDebtAmount.shiftedBy(-stablecoinDecimals);
|
|
486
486
|
totalDebtsUsd = totalDebtsUsd.plus(stablecoinDebtUsd);
|
|
487
487
|
}
|
|
@@ -502,7 +502,7 @@ class CDPModule extends base_1.default {
|
|
|
502
502
|
const sdk = this.sdkProvider;
|
|
503
503
|
const cdpAddress = this.getCdpModuleAddress();
|
|
504
504
|
const balanceRsp = yield sdk.query.bank.Balance(query_2.QueryBalanceRequest.fromPartial({ address: cdpAddress, denom }));
|
|
505
|
-
return
|
|
505
|
+
return number_1.bnOrZero((_a = balanceRsp.balance) === null || _a === void 0 ? void 0 : _a.amount);
|
|
506
506
|
});
|
|
507
507
|
}
|
|
508
508
|
getCdpToActualRatio(cdpDenom) {
|
|
@@ -513,13 +513,13 @@ class CDPModule extends base_1.default {
|
|
|
513
513
|
const cdpAmountRsp = supplyRsp.amount;
|
|
514
514
|
if (!cdpAmountRsp)
|
|
515
515
|
throw new Error("unable to retrieve cdp token supply");
|
|
516
|
-
const cdpAmount =
|
|
516
|
+
const cdpAmount = number_1.bnOrZero(cdpAmountRsp.amount);
|
|
517
517
|
const cdpAddress = this.getCdpModuleAddress();
|
|
518
518
|
const balanceRsp = yield sdk.query.bank.Balance(query_2.QueryBalanceRequest.fromPartial({ address: cdpAddress, denom }));
|
|
519
519
|
if (!balanceRsp.balance)
|
|
520
520
|
throw new Error("unable to retrieve cdp module balance");
|
|
521
521
|
const owedAmount = yield this.getTotalTokenDebt(denom);
|
|
522
|
-
const actualAmount =
|
|
522
|
+
const actualAmount = number_1.bnOrZero(balanceRsp.balance.amount).plus(owedAmount);
|
|
523
523
|
if (!owedAmount)
|
|
524
524
|
throw new Error("unable to retrieve total token debt");
|
|
525
525
|
return cdpAmount.div(actualAmount);
|
|
@@ -541,8 +541,8 @@ class CDPModule extends base_1.default {
|
|
|
541
541
|
const allDebts = allDebtsRes.debtInfosAll;
|
|
542
542
|
for (let i = 0; i < allDebts.length; i++) {
|
|
543
543
|
const denom = allDebts[i].denom;
|
|
544
|
-
const interest =
|
|
545
|
-
const principal =
|
|
544
|
+
const interest = number_1.bnOrZero(allDebts[i].totalAccumulatedInterest);
|
|
545
|
+
const principal = number_1.bnOrZero(allDebts[i].totalPrincipal);
|
|
546
546
|
const debtAmt = interest.plus(principal);
|
|
547
547
|
const debtUsdVal = yield this.getTokenUsdVal(denom, debtAmt);
|
|
548
548
|
if (!debtUsdVal) {
|
|
@@ -554,7 +554,7 @@ class CDPModule extends base_1.default {
|
|
|
554
554
|
const stablecoinDebtRes = yield this.sdkProvider.query.cdp.StablecoinDebt({});
|
|
555
555
|
if (stablecoinDebtRes.stablecoinDebtInfo) {
|
|
556
556
|
const debtInfo = stablecoinDebtRes.stablecoinDebtInfo;
|
|
557
|
-
const debtAmt =
|
|
557
|
+
const debtAmt = number_1.bnOrZero(debtInfo.totalPrincipal).plus(number_1.bnOrZero(debtInfo.totalAccumulatedInterest));
|
|
558
558
|
const stablecoinDecimals = (_a = (yield sdk.getTokenClient().getDecimals(debtInfo.denom))) !== null && _a !== void 0 ? _a : 0;
|
|
559
559
|
const debtUsdVal = debtAmt.shiftedBy(-stablecoinDecimals);
|
|
560
560
|
totalDebt = totalDebt.plus(debtUsdVal);
|
|
@@ -572,7 +572,7 @@ class CDPModule extends base_1.default {
|
|
|
572
572
|
if (!TokenClient_1.default.isCdpToken(balance.denom)) {
|
|
573
573
|
continue;
|
|
574
574
|
}
|
|
575
|
-
const amount =
|
|
575
|
+
const amount = number_1.bnOrZero(balance.amount);
|
|
576
576
|
const collateralUsdValue = yield this.getCdpTokenUsdVal(balance.denom, amount);
|
|
577
577
|
allCollateralsUsdValue = allCollateralsUsdValue.plus(collateralUsdValue);
|
|
578
578
|
}
|
|
@@ -596,7 +596,7 @@ class CDPModule extends base_1.default {
|
|
|
596
596
|
const priceResult = yield sdk.query.pricing.TokenPrice(codec_1.QueryTokenPriceRequest.fromPartial({ denom }));
|
|
597
597
|
if (!priceResult.tokenPrice)
|
|
598
598
|
throw new Error("unable to retrieve token price for " + denom);
|
|
599
|
-
const twap =
|
|
599
|
+
const twap = number_1.bnOrZero(priceResult.tokenPrice.twap).shiftedBy(-18);
|
|
600
600
|
return amount.multipliedBy(twap).shiftedBy(-decimals);
|
|
601
601
|
});
|
|
602
602
|
}
|
|
@@ -611,11 +611,11 @@ class CDPModule extends base_1.default {
|
|
|
611
611
|
throw new Error("unable to retrieve debt info");
|
|
612
612
|
const cimRsp = yield this.recalculateCIM(denom, debtInfo);
|
|
613
613
|
const newInterestRate = cimRsp.interest;
|
|
614
|
-
const principal =
|
|
615
|
-
const accumInterest =
|
|
614
|
+
const principal = number_1.bnOrZero(debtInfo.totalPrincipal);
|
|
615
|
+
const accumInterest = number_1.bnOrZero(debtInfo.totalAccumulatedInterest);
|
|
616
616
|
const newInterest = principal.times(newInterestRate).plus(accumInterest.times(number_1.BN_ONE.plus(newInterestRate)));
|
|
617
617
|
const cdpParamsRsp = yield this.sdkProvider.query.cdp.Params(query_1.QueryParamsRequest.fromPartial({}));
|
|
618
|
-
const interestFee =
|
|
618
|
+
const interestFee = number_1.bnOrZero((_a = cdpParamsRsp.params) === null || _a === void 0 ? void 0 : _a.interestFee);
|
|
619
619
|
const interest = newInterest.times(number_1.BN_10000.minus(interestFee)).dividedToIntegerBy(number_1.BN_10000);
|
|
620
620
|
return principal.plus(interest);
|
|
621
621
|
});
|
|
@@ -633,8 +633,8 @@ class CDPModule extends base_1.default {
|
|
|
633
633
|
const debtRes = yield sdk.query.cdp.AccountDebt({ address: account, denom: denom });
|
|
634
634
|
debt = debtRes.debt;
|
|
635
635
|
}
|
|
636
|
-
const principalAmount =
|
|
637
|
-
const initialCIM =
|
|
636
|
+
const principalAmount = number_1.bnOrZero(debt === null || debt === void 0 ? void 0 : debt.principalDebt);
|
|
637
|
+
const initialCIM = number_1.bnOrZero(debt === null || debt === void 0 ? void 0 : debt.initialCumulativeInterestMultiplier);
|
|
638
638
|
if (principalAmount.isZero() || initialCIM.isZero())
|
|
639
639
|
return number_1.BN_ZERO;
|
|
640
640
|
const cimRsp = yield this.recalculateCIM(denom, debtInfo);
|
|
@@ -660,8 +660,8 @@ class CDPModule extends base_1.default {
|
|
|
660
660
|
const debtResp = yield sdk.query.cdp.AccountStablecoin(query_1.QueryAccountStablecoinRequest.fromPartial({ address: account }));
|
|
661
661
|
debt = debtResp;
|
|
662
662
|
}
|
|
663
|
-
principalAmount =
|
|
664
|
-
const initialCIM =
|
|
663
|
+
principalAmount = number_1.bnOrZero(debt.principalDebt);
|
|
664
|
+
const initialCIM = number_1.bnOrZero(debt.initialCumulativeInterestMultiplier);
|
|
665
665
|
const cim = yield this.recalculateStablecoinCIM(debtInfo);
|
|
666
666
|
if (!cim)
|
|
667
667
|
throw new Error("unable to retrieve account debt");
|
|
@@ -702,7 +702,7 @@ class CDPModule extends base_1.default {
|
|
|
702
702
|
return number_1.BN_ZERO;
|
|
703
703
|
}
|
|
704
704
|
const diffSeconds = new bignumber_js_1.BigNumber(diffMs).shiftedBy(-3).dp(0, bignumber_js_1.BigNumber.ROUND_CEIL);
|
|
705
|
-
const secondsAYear =
|
|
705
|
+
const secondsAYear = number_1.bnOrZero(31536000);
|
|
706
706
|
const numPeriods = secondsAYear.div(diffSeconds).dp(18);
|
|
707
707
|
return apy.div(numPeriods).dp(18); // carbon backend sdk.dec max 18 dp
|
|
708
708
|
}
|
|
@@ -726,8 +726,8 @@ class CDPModule extends base_1.default {
|
|
|
726
726
|
throw new Error("unable to retrieve cdp params for " + denom);
|
|
727
727
|
}
|
|
728
728
|
}
|
|
729
|
-
const interestFeeRate =
|
|
730
|
-
const utilizationRate =
|
|
729
|
+
const interestFeeRate = number_1.bnOrZero(params.interestFee).div(number_1.BN_10000);
|
|
730
|
+
const utilizationRate = number_1.bnOrZero(debtInfo.utilizationRate).shiftedBy(-18);
|
|
731
731
|
return borrowInterest.times(utilizationRate).times(number_1.BN_ONE.minus(interestFeeRate));
|
|
732
732
|
});
|
|
733
733
|
}
|
|
@@ -742,7 +742,7 @@ class CDPModule extends base_1.default {
|
|
|
742
742
|
return { cim: number_1.BN_ZERO, interest: number_1.BN_ZERO };
|
|
743
743
|
}
|
|
744
744
|
}
|
|
745
|
-
const cim =
|
|
745
|
+
const cim = number_1.bnOrZero(debtInfo.cumulativeInterestMultiplier);
|
|
746
746
|
const apy = yield this.calculateAPY(denom, debtInfo);
|
|
747
747
|
const newInterest = CDPModule.calculateInterestForTimePeriod(apy, (_a = debtInfo.lastUpdatedTime) !== null && _a !== void 0 ? _a : new Date(0), new Date());
|
|
748
748
|
const newCIM = cim.times(newInterest.plus(1));
|
|
@@ -761,8 +761,8 @@ class CDPModule extends base_1.default {
|
|
|
761
761
|
}
|
|
762
762
|
}
|
|
763
763
|
const paramsResponse = yield sdk.query.cdp.Params(codec_1.QueryCdpParamsRequest.fromPartial({}));
|
|
764
|
-
const cim =
|
|
765
|
-
const apy =
|
|
764
|
+
const cim = number_1.bnOrZero(debtInfo.cumulativeInterestMultiplier);
|
|
765
|
+
const apy = number_1.bnOrZero((_a = paramsResponse.params) === null || _a === void 0 ? void 0 : _a.stablecoinInterestRate);
|
|
766
766
|
if (!apy) {
|
|
767
767
|
return number_1.BN_ZERO;
|
|
768
768
|
}
|
|
@@ -788,7 +788,7 @@ class CDPModule extends base_1.default {
|
|
|
788
788
|
const availableBorrowsUsd = accountData.AvailableBorrowsUsd.minus(accountData.TotalDebtsUsd);
|
|
789
789
|
const unlockableUsd = availableBorrowsUsd.multipliedBy(number_1.BN_10000).div(unlockRatio);
|
|
790
790
|
const tokenPrice = yield sdk.query.pricing.TokenPrice({ denom });
|
|
791
|
-
const tokenTwap =
|
|
791
|
+
const tokenTwap = number_1.bnOrZero((_b = tokenPrice.tokenPrice) === null || _b === void 0 ? void 0 : _b.twap);
|
|
792
792
|
if (tokenTwap.isZero())
|
|
793
793
|
throw new Error("unable to retrieve token price for " + denom);
|
|
794
794
|
const tokenAmt = unlockableUsd.div(tokenTwap.shiftedBy(-18)).shiftedBy(tokenDecimals);
|
|
@@ -799,7 +799,7 @@ class CDPModule extends base_1.default {
|
|
|
799
799
|
address: account,
|
|
800
800
|
cdpDenom: cdpDenom,
|
|
801
801
|
});
|
|
802
|
-
const lockedAmount =
|
|
802
|
+
const lockedAmount = number_1.bnOrZero((_e = (_d = accountCollateral.collateral) === null || _d === void 0 ? void 0 : _d.collateralAmount) !== null && _e !== void 0 ? _e : "0");
|
|
803
803
|
return lockedAmount.lt(cdpTokenAmt) ? lockedAmount : cdpTokenAmt;
|
|
804
804
|
});
|
|
805
805
|
}
|
|
@@ -817,7 +817,7 @@ class CDPModule extends base_1.default {
|
|
|
817
817
|
const denom = this.getUnderlyingDenom(cdpDenom);
|
|
818
818
|
const cdpToActualRatio = (_a = (yield this.getCdpToActualRatio(cdpDenom))) !== null && _a !== void 0 ? _a : number_1.BN_ZERO;
|
|
819
819
|
const tokenPrice = yield sdk.query.pricing.TokenPrice({ denom: denom });
|
|
820
|
-
const tokenTwap =
|
|
820
|
+
const tokenTwap = number_1.bnOrZero((_b = tokenPrice.tokenPrice) === null || _b === void 0 ? void 0 : _b.twap).shiftedBy(-18);
|
|
821
821
|
return tokenTwap.multipliedBy(cdpToActualRatio);
|
|
822
822
|
});
|
|
823
823
|
}
|
|
@@ -838,26 +838,26 @@ class CDPModule extends base_1.default {
|
|
|
838
838
|
});
|
|
839
839
|
if (!asset.assetParams)
|
|
840
840
|
throw new Error("unable to retrieve asset param for " + cdpActualDenom);
|
|
841
|
-
const bonus =
|
|
841
|
+
const bonus = number_1.bnOrZero(asset.assetParams.liquidationDiscount).div(number_1.BN_10000);
|
|
842
842
|
const cdpTokenPrice = yield this.getCdpTokenPrice(cdpDenom);
|
|
843
843
|
const cdpTokenDiscountedPrice = cdpTokenPrice.multipliedBy(number_1.BN_ONE.minus(bonus));
|
|
844
844
|
// get close factor
|
|
845
845
|
const debtorAccountData = yield sdk.query.cdp.AccountData({
|
|
846
846
|
address: debtor,
|
|
847
847
|
});
|
|
848
|
-
const debtorTotalCollateralVal =
|
|
849
|
-
const debtorTotalDebtVal =
|
|
850
|
-
const currentLiqThreshold =
|
|
848
|
+
const debtorTotalCollateralVal = number_1.bnOrZero(debtorAccountData.totalCollateralsUsd);
|
|
849
|
+
const debtorTotalDebtVal = number_1.bnOrZero(debtorAccountData.totalDebtsUsd);
|
|
850
|
+
const currentLiqThreshold = number_1.bnOrZero(debtorAccountData.currLiquidationThreshold);
|
|
851
851
|
const params = yield sdk.query.cdp.Params({});
|
|
852
852
|
if (!params.params) {
|
|
853
853
|
throw new Error("unable to retrieve cdp params");
|
|
854
854
|
}
|
|
855
|
-
const smallLiqSize =
|
|
856
|
-
const minCloseFactor =
|
|
857
|
-
const completeLiqThreshold =
|
|
855
|
+
const smallLiqSize = number_1.bnOrZero(params.params.smallLiquidationSize);
|
|
856
|
+
const minCloseFactor = number_1.bnOrZero(params.params.minimumCloseFactor);
|
|
857
|
+
const completeLiqThreshold = number_1.bnOrZero(params.params.completeLiquidationThreshold);
|
|
858
858
|
const closeFactor = this.computeCloseFactor(debtorTotalDebtVal, debtorTotalCollateralVal, currentLiqThreshold, smallLiqSize, minCloseFactor, completeLiqThreshold);
|
|
859
859
|
// get max repayable amount given the debtor's debt and how much liquidator wants to repay
|
|
860
|
-
const debtDecimals =
|
|
860
|
+
const debtDecimals = number_1.bnOrZero(yield sdk.getTokenClient().getDecimals(debtDenom));
|
|
861
861
|
const maxRepayableValue = debtorTotalDebtVal.multipliedBy(closeFactor);
|
|
862
862
|
const maxRepayableAmt = maxRepayableValue.shiftedBy(debtDecimals.toNumber());
|
|
863
863
|
if (debtRepaymentAmount.isGreaterThan(maxRepayableAmt)) {
|
|
@@ -865,7 +865,7 @@ class CDPModule extends base_1.default {
|
|
|
865
865
|
}
|
|
866
866
|
// calculate collateral amount that can be obtained given that debt amount and debtor's collateral balance
|
|
867
867
|
// AND, recalculate debt repay amount if needed
|
|
868
|
-
const cdpTokenDecimals =
|
|
868
|
+
const cdpTokenDecimals = number_1.bnOrZero(yield sdk.getTokenClient().getDecimals(cdpActualDenom));
|
|
869
869
|
let collateralAmtToLiquidate = this.calculateCollateralRequiredForDebt(number_1.BN_ONE, // assumes USC is $1
|
|
870
870
|
cdpTokenDiscountedPrice, debtRepaymentAmount, cdpTokenDecimals, debtDecimals);
|
|
871
871
|
const debtorAccountCollateral = yield sdk.query.cdp.AccountCollateral({
|
|
@@ -937,11 +937,11 @@ class CDPModule extends base_1.default {
|
|
|
937
937
|
}
|
|
938
938
|
exports.CDPModule = CDPModule;
|
|
939
939
|
CDPModule.calculateInterestAPY = (debtInfo, rateStrategy) => {
|
|
940
|
-
const utilizationRate =
|
|
941
|
-
const optimalUsage =
|
|
942
|
-
const variableRate1 =
|
|
943
|
-
const variableRate2 =
|
|
944
|
-
const baseVariableBorrowRate =
|
|
940
|
+
const utilizationRate = number_1.bnOrZero(debtInfo.utilizationRate).shiftedBy(-18);
|
|
941
|
+
const optimalUsage = number_1.bnOrZero(rateStrategy.optimalUsage).shiftedBy(-4);
|
|
942
|
+
const variableRate1 = number_1.bnOrZero(rateStrategy.variableRateSlope1).shiftedBy(-4);
|
|
943
|
+
const variableRate2 = number_1.bnOrZero(rateStrategy.variableRateSlope2).shiftedBy(-4);
|
|
944
|
+
const baseVariableBorrowRate = number_1.bnOrZero(rateStrategy.baseVariableBorrowRate).shiftedBy(-4);
|
|
945
945
|
if (utilizationRate.lte(optimalUsage)) {
|
|
946
946
|
const vRate = utilizationRate.times(variableRate1).div(optimalUsage).dp(4, bignumber_js_1.BigNumber.ROUND_CEIL);
|
|
947
947
|
return vRate.plus(baseVariableBorrowRate);
|
package/lib/modules/gov.js
CHANGED
|
@@ -48,7 +48,7 @@ class GovModule extends base_1.default {
|
|
|
48
48
|
const value = tx_1.MsgDeposit.fromPartial({
|
|
49
49
|
proposalId: new long_1.default(params.proposalId),
|
|
50
50
|
depositor: wallet.bech32Address,
|
|
51
|
-
amount:
|
|
51
|
+
amount: amino_1.coins(params.amount, params.denom),
|
|
52
52
|
});
|
|
53
53
|
return yield wallet.sendTx({
|
|
54
54
|
typeUrl: util_1.CarbonTx.Types.MsgDeposit,
|
|
@@ -78,21 +78,21 @@ class GovModule extends base_1.default {
|
|
|
78
78
|
const createTokenMsg = {
|
|
79
79
|
title: title,
|
|
80
80
|
description: description,
|
|
81
|
-
msg:
|
|
81
|
+
msg: admin_1.transfromCreateTokenParams(msg, wallet.bech32Address),
|
|
82
82
|
};
|
|
83
83
|
return proposal_1.CreateTokenProposal.encode(createTokenMsg).finish();
|
|
84
84
|
case "SetMsgGasCostProposal":
|
|
85
85
|
const setMsgGasCostMsg = {
|
|
86
86
|
title: title,
|
|
87
87
|
description: description,
|
|
88
|
-
msg:
|
|
88
|
+
msg: admin_1.transfromSetMsgGasCostParams(msg),
|
|
89
89
|
};
|
|
90
90
|
return proposal_2.SetMsgGasCostProposal.encode(setMsgGasCostMsg).finish();
|
|
91
91
|
case "SetMinGasPriceProposal":
|
|
92
92
|
const setMinGasPriceMsg = {
|
|
93
93
|
title: title,
|
|
94
94
|
description: description,
|
|
95
|
-
msg:
|
|
95
|
+
msg: admin_1.transfromSetMinGasPriceParams(msg),
|
|
96
96
|
};
|
|
97
97
|
return proposal_2.SetMinGasPriceProposal.encode(setMinGasPriceMsg).finish();
|
|
98
98
|
case "RemoveMsgGasCostProposal":
|
|
@@ -113,49 +113,49 @@ class GovModule extends base_1.default {
|
|
|
113
113
|
const setRewardCurveMsg = {
|
|
114
114
|
title: title,
|
|
115
115
|
description: description,
|
|
116
|
-
msg:
|
|
116
|
+
msg: admin_1.transfromSetRewardCurveParams(msg),
|
|
117
117
|
};
|
|
118
118
|
return proposal_3.SetRewardCurveProposal.encode(setRewardCurveMsg).finish();
|
|
119
119
|
case "SetCommitmentCurveProposal":
|
|
120
120
|
const setCommitmentCurveMsg = {
|
|
121
121
|
title: title,
|
|
122
122
|
description: description,
|
|
123
|
-
msg:
|
|
123
|
+
msg: admin_1.transfromSetCommitmentCurveParams(msg),
|
|
124
124
|
};
|
|
125
125
|
return proposal_3.SetCommitmentCurveProposal.encode(setCommitmentCurveMsg).finish();
|
|
126
126
|
case "SetRewardsWeightsProposal":
|
|
127
127
|
const setRewardsWeightsMsg = {
|
|
128
128
|
title: title,
|
|
129
129
|
description: description,
|
|
130
|
-
msg:
|
|
130
|
+
msg: admin_1.transfromSetRewardsWeightsParams(msg),
|
|
131
131
|
};
|
|
132
132
|
return proposal_3.SetRewardsWeightsProposal.encode(setRewardsWeightsMsg).finish();
|
|
133
133
|
case "UpdatePoolProposal":
|
|
134
134
|
const updatePoolProposalMsg = {
|
|
135
135
|
title: title,
|
|
136
136
|
description: description,
|
|
137
|
-
msg:
|
|
137
|
+
msg: admin_1.transfromUpdatePoolParams(msg),
|
|
138
138
|
};
|
|
139
139
|
return proposal_3.UpdatePoolProposal.encode(updatePoolProposalMsg).finish();
|
|
140
140
|
case "UpdateMarketProposal":
|
|
141
141
|
const updateMarketProposalMsg = {
|
|
142
142
|
title: title,
|
|
143
143
|
description: description,
|
|
144
|
-
msg:
|
|
144
|
+
msg: market_1.transfromUpdateMarketParams(msg),
|
|
145
145
|
};
|
|
146
146
|
return proposal_4.UpdateMarketProposal.encode(updateMarketProposalMsg).finish();
|
|
147
147
|
case "CreateOracleProposal":
|
|
148
148
|
const createOracleProposalMsg = {
|
|
149
149
|
title: title,
|
|
150
150
|
description: description,
|
|
151
|
-
msg:
|
|
151
|
+
msg: admin_1.transfromCreateOracleParams(msg, wallet.bech32Address),
|
|
152
152
|
};
|
|
153
153
|
return proposal_5.CreateOracleProposal.encode(createOracleProposalMsg).finish();
|
|
154
154
|
case "SettlementPriceProposal":
|
|
155
155
|
const settlementPriceProposalMsg = {
|
|
156
156
|
title: title,
|
|
157
157
|
description: description,
|
|
158
|
-
msg:
|
|
158
|
+
msg: admin_1.transformSetSettlementPriceParams(msg),
|
|
159
159
|
};
|
|
160
160
|
return proposal_6.SettlementPriceProposal.encode(settlementPriceProposalMsg).finish();
|
|
161
161
|
case "ParameterChangeProposal":
|
|
@@ -177,7 +177,7 @@ class GovModule extends base_1.default {
|
|
|
177
177
|
title: title,
|
|
178
178
|
description: description,
|
|
179
179
|
recipient: proposalMsg.recipient,
|
|
180
|
-
amount:
|
|
180
|
+
amount: admin_1.transformCommunityPoolSpendAmount(proposalMsg.amount),
|
|
181
181
|
};
|
|
182
182
|
return distribution_1.CommunityPoolSpendProposal.encode(communityPoolSpendProposalMsg).finish();
|
|
183
183
|
case "CancelSoftwareUpgradeProposal":
|
|
@@ -51,7 +51,6 @@ class LiquidityPoolModule extends base_1.default {
|
|
|
51
51
|
amountB: params.amountB.toString(10),
|
|
52
52
|
swapFee: params.swapFee.shiftedBy(18).toString(10),
|
|
53
53
|
ampBps: params.ampBps,
|
|
54
|
-
numQuotes: new long_1.default(params.numQuotes),
|
|
55
54
|
});
|
|
56
55
|
return yield wallet.sendTx({
|
|
57
56
|
typeUrl: util_1.CarbonTx.Types.MsgCreatePoolWithLiquidity,
|
|
@@ -146,7 +145,7 @@ class LiquidityPoolModule extends base_1.default {
|
|
|
146
145
|
const SECONDS_IN_A_WEEK = new bignumber_js_1.BigNumber(604800);
|
|
147
146
|
const mintDataResponse = yield this.sdkProvider.query.inflation.MintData({});
|
|
148
147
|
const mintData = mintDataResponse.mintData;
|
|
149
|
-
const nowTime = new bignumber_js_1.BigNumber(
|
|
148
|
+
const nowTime = new bignumber_js_1.BigNumber(dayjs_1.default().unix());
|
|
150
149
|
const firstBlockTime = (_a = mintData === null || mintData === void 0 ? void 0 : mintData.firstBlockTime.toNumber()) !== null && _a !== void 0 ? _a : 0;
|
|
151
150
|
const difference = nowTime.minus(firstBlockTime);
|
|
152
151
|
const currentWeek = difference.div(SECONDS_IN_A_WEEK).dp(0, bignumber_js_1.BigNumber.ROUND_DOWN);
|
|
@@ -87,7 +87,7 @@ class EthLedgerAccount {
|
|
|
87
87
|
static tryConnect() {
|
|
88
88
|
return __awaiter(this, void 0, void 0, function* () {
|
|
89
89
|
try {
|
|
90
|
-
const transport = yield
|
|
90
|
+
const transport = yield ledger_1.getLedgerTransport();
|
|
91
91
|
// get public key to assert that NEO app is open
|
|
92
92
|
const ethApp = new hw_app_eth_1.default(transport);
|
|
93
93
|
const bipString = EthLedgerAccount.getETHBIP44String();
|
|
@@ -39,7 +39,7 @@ exports.looksLikeTransportStatusError = looksLikeTransportStatusError;
|
|
|
39
39
|
* @returns error with modified message if found.
|
|
40
40
|
*/
|
|
41
41
|
function evalTransportError(err) {
|
|
42
|
-
const transportErr =
|
|
42
|
+
const transportErr = lodash_1.cloneDeep(err);
|
|
43
43
|
switch (transportErr.statusCode) {
|
|
44
44
|
case StatusWord.APP_CLOSED:
|
|
45
45
|
transportErr.message = "Your NEO app is closed! Please login.";
|
|
@@ -49,8 +49,8 @@ function getAppName(ledger) {
|
|
|
49
49
|
return version.substring(0, version.length - 2); // take of status word
|
|
50
50
|
}
|
|
51
51
|
catch (e) {
|
|
52
|
-
if (
|
|
53
|
-
throw
|
|
52
|
+
if (ErrorCode_1.looksLikeTransportStatusError(e)) {
|
|
53
|
+
throw ErrorCode_1.evalTransportError(e);
|
|
54
54
|
}
|
|
55
55
|
throw e;
|
|
56
56
|
}
|
|
@@ -72,8 +72,8 @@ function getAppVersion(ledger) {
|
|
|
72
72
|
return major.toString() + "." + minor.toString() + "." + patch.toString();
|
|
73
73
|
}
|
|
74
74
|
catch (e) {
|
|
75
|
-
if (
|
|
76
|
-
throw
|
|
75
|
+
if (ErrorCode_1.looksLikeTransportStatusError(e)) {
|
|
76
|
+
throw ErrorCode_1.evalTransportError(e);
|
|
77
77
|
}
|
|
78
78
|
throw e;
|
|
79
79
|
}
|
|
@@ -109,8 +109,8 @@ function getPublicKey(ledger, bip44String, showAddressOnDevice = false) {
|
|
|
109
109
|
return response.toString("hex").substring(0, 130);
|
|
110
110
|
}
|
|
111
111
|
catch (e) {
|
|
112
|
-
if (
|
|
113
|
-
throw
|
|
112
|
+
if (ErrorCode_1.looksLikeTransportStatusError(e)) {
|
|
113
|
+
throw ErrorCode_1.evalTransportError(e);
|
|
114
114
|
}
|
|
115
115
|
throw e;
|
|
116
116
|
}
|
|
@@ -142,8 +142,8 @@ function getSignature(ledger, payload, bip44String, network) {
|
|
|
142
142
|
return DerToHexSignature(response.toString("hex"));
|
|
143
143
|
}
|
|
144
144
|
catch (e) {
|
|
145
|
-
if (
|
|
146
|
-
throw
|
|
145
|
+
if (ErrorCode_1.looksLikeTransportStatusError(e)) {
|
|
146
|
+
throw ErrorCode_1.evalTransportError(e);
|
|
147
147
|
}
|
|
148
148
|
throw e;
|
|
149
149
|
}
|
|
@@ -111,8 +111,8 @@ class NeoLedgerAccount {
|
|
|
111
111
|
*/
|
|
112
112
|
static tryConnect(version = "neo") {
|
|
113
113
|
return __awaiter(this, void 0, void 0, function* () {
|
|
114
|
-
const bipString =
|
|
115
|
-
const ledger = yield
|
|
114
|
+
const bipString = NeonLedger_1.getNEOBIP44String();
|
|
115
|
+
const ledger = yield ledger_1.getLedgerTransport();
|
|
116
116
|
// get public key to assert that NEO app is open
|
|
117
117
|
const ledgerAdapter = adapterForVersion(version);
|
|
118
118
|
const publicKey = yield ledgerAdapter.getPublicKey(ledger, bipString);
|
|
@@ -129,7 +129,7 @@ class NeoLedgerAccount {
|
|
|
129
129
|
}
|
|
130
130
|
sign(msg, magic = neon_core_next_1.CONST.MAGIC_NUMBER.MainNet) {
|
|
131
131
|
return __awaiter(this, void 0, void 0, function* () {
|
|
132
|
-
const bipString =
|
|
132
|
+
const bipString = NeonLedger_1.getNEOBIP44String();
|
|
133
133
|
const ledger = this.useLedger();
|
|
134
134
|
const ledgerAdapter = adapterForVersion(this.version);
|
|
135
135
|
console.log("getsignature", ledgerAdapter, ledger, msg, bipString, magic);
|
|
@@ -40,7 +40,7 @@ function evalTransportError(err) {
|
|
|
40
40
|
transportErr.message = "Transaction signing denied";
|
|
41
41
|
break;
|
|
42
42
|
default:
|
|
43
|
-
transportErr.message =
|
|
43
|
+
transportErr.message = hw_transport_1.getAltStatusMessage(transportErr.statusCode);
|
|
44
44
|
}
|
|
45
45
|
return err;
|
|
46
46
|
}
|
|
@@ -231,33 +231,33 @@ const MsgSetSmallLiquidationSize = {
|
|
|
231
231
|
},
|
|
232
232
|
};
|
|
233
233
|
const AdminAmino = {
|
|
234
|
-
[CarbonTx.Types.MsgCreateOracle]:
|
|
235
|
-
[CarbonTx.Types.MsgBindToken]:
|
|
236
|
-
[CarbonTx.Types.MsgCreateToken]:
|
|
237
|
-
[CarbonTx.Types.MsgLinkToken]:
|
|
238
|
-
[CarbonTx.Types.MsgSyncToken]:
|
|
239
|
-
[CarbonTx.Types.MsgCreateMarket]:
|
|
240
|
-
[CarbonTx.Types.MsgUpdatePool]:
|
|
241
|
-
[CarbonTx.Types.MsgSetRewardsWeights]:
|
|
242
|
-
[CarbonTx.Types.MsgSetRewardCurve]:
|
|
243
|
-
[CarbonTx.Types.MsgSetCommitmentCurve]:
|
|
244
|
-
[CarbonTx.Types.MsgSetTradingFlag]:
|
|
245
|
-
[CarbonTx.Types.MsgSetGasCost]:
|
|
246
|
-
[CarbonTx.Types.MsgSetMinGasPrice]:
|
|
247
|
-
[CarbonTx.Types.MsgRemoveGasCost]:
|
|
248
|
-
[CarbonTx.Types.MsgRemoveMinGasPrice]:
|
|
249
|
-
[CarbonTx.Types.MsgCreateValidator]:
|
|
250
|
-
[CarbonTx.Types.MsgEditValidator]:
|
|
251
|
-
[CarbonTx.Types.MsgAddRateStrategy]:
|
|
252
|
-
[CarbonTx.Types.MsgUpdateRateStrategy]:
|
|
253
|
-
[CarbonTx.Types.MsgRemoveRateStrategy]:
|
|
254
|
-
[CarbonTx.Types.MsgAddAsset]:
|
|
255
|
-
[CarbonTx.Types.MsgUpdateAsset]:
|
|
256
|
-
[CarbonTx.Types.MsgSetLiquidationFee]:
|
|
257
|
-
[CarbonTx.Types.MsgSetInterestFee]:
|
|
258
|
-
[CarbonTx.Types.MsgSetStablecoinInterestRate]:
|
|
259
|
-
[CarbonTx.Types.MsgSetCompleteLiquidationThreshold]:
|
|
260
|
-
[CarbonTx.Types.MsgSetMinimumCloseFactor]:
|
|
261
|
-
[CarbonTx.Types.MsgSetSmallLiquidationSize]:
|
|
234
|
+
[CarbonTx.Types.MsgCreateOracle]: utils_1.generateAminoType(MsgCreateOracle),
|
|
235
|
+
[CarbonTx.Types.MsgBindToken]: utils_1.generateAminoType(MsgBindToken),
|
|
236
|
+
[CarbonTx.Types.MsgCreateToken]: utils_1.generateAminoType(MsgCreateToken),
|
|
237
|
+
[CarbonTx.Types.MsgLinkToken]: utils_1.generateAminoType(MsgLinkToken),
|
|
238
|
+
[CarbonTx.Types.MsgSyncToken]: utils_1.generateAminoType(MsgSyncToken),
|
|
239
|
+
[CarbonTx.Types.MsgCreateMarket]: utils_1.generateAminoType(MsgCreateMarket),
|
|
240
|
+
[CarbonTx.Types.MsgUpdatePool]: utils_1.generateAminoType(MsgUpdatePool),
|
|
241
|
+
[CarbonTx.Types.MsgSetRewardsWeights]: utils_1.generateAminoType(MsgSetRewardsWeights),
|
|
242
|
+
[CarbonTx.Types.MsgSetRewardCurve]: utils_1.generateAminoType(MsgSetRewardCurve),
|
|
243
|
+
[CarbonTx.Types.MsgSetCommitmentCurve]: utils_1.generateAminoType(MsgSetCommitmentCurve),
|
|
244
|
+
[CarbonTx.Types.MsgSetTradingFlag]: utils_1.generateAminoType(MsgSetTradingFlag),
|
|
245
|
+
[CarbonTx.Types.MsgSetGasCost]: utils_1.generateAminoType(MsgSetGasCost),
|
|
246
|
+
[CarbonTx.Types.MsgSetMinGasPrice]: utils_1.generateAminoType(MsgSetMinGasPrice),
|
|
247
|
+
[CarbonTx.Types.MsgRemoveGasCost]: utils_1.generateAminoType(MsgRemoveGasCost),
|
|
248
|
+
[CarbonTx.Types.MsgRemoveMinGasPrice]: utils_1.generateAminoType(MsgRemoveMinGasPrice),
|
|
249
|
+
[CarbonTx.Types.MsgCreateValidator]: utils_1.generateAminoType(MsgCreateValidator),
|
|
250
|
+
[CarbonTx.Types.MsgEditValidator]: utils_1.generateAminoType(MsgEditValidator),
|
|
251
|
+
[CarbonTx.Types.MsgAddRateStrategy]: utils_1.generateAminoType(MsgAddRateStrategy),
|
|
252
|
+
[CarbonTx.Types.MsgUpdateRateStrategy]: utils_1.generateAminoType(MsgUpdateRateStrategy),
|
|
253
|
+
[CarbonTx.Types.MsgRemoveRateStrategy]: utils_1.generateAminoType(MsgRemoveRateStrategy),
|
|
254
|
+
[CarbonTx.Types.MsgAddAsset]: utils_1.generateAminoType(MsgAddAsset),
|
|
255
|
+
[CarbonTx.Types.MsgUpdateAsset]: utils_1.generateAminoType(MsgUpdateAsset),
|
|
256
|
+
[CarbonTx.Types.MsgSetLiquidationFee]: utils_1.generateAminoType(MsgSetLiquidationFee),
|
|
257
|
+
[CarbonTx.Types.MsgSetInterestFee]: utils_1.generateAminoType(MsgSetInterestFee),
|
|
258
|
+
[CarbonTx.Types.MsgSetStablecoinInterestRate]: utils_1.generateAminoType(MsgSetStablecoinInterestRate),
|
|
259
|
+
[CarbonTx.Types.MsgSetCompleteLiquidationThreshold]: utils_1.generateAminoType(MsgSetCompleteLiquidationThreshold),
|
|
260
|
+
[CarbonTx.Types.MsgSetMinimumCloseFactor]: utils_1.generateAminoType(MsgSetMinimumCloseFactor),
|
|
261
|
+
[CarbonTx.Types.MsgSetSmallLiquidationSize]: utils_1.generateAminoType(MsgSetSmallLiquidationSize),
|
|
262
262
|
};
|
|
263
263
|
exports.default = AdminAmino;
|