carbon-js-sdk 0.2.16-dev.2 → 0.2.16-dev.4
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 +6 -6
- package/lib/clients/ZILClient.js +16 -16
- package/lib/codec/bank/tx.d.ts +64 -0
- package/lib/codec/bank/tx.js +236 -0
- 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/constant/generic.js +1 -1
- package/lib/modules/cdp.js +52 -48
- package/lib/modules/gov.js +14 -14
- package/lib/modules/liquiditypool.d.ts +3 -2
- package/lib/modules/liquiditypool.js +3 -3
- 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 +30 -30
- 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 +2 -2
- package/lib/provider/amino/types/gov.js +4 -4
- 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 -7
- 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/keplr/KeplrStore.js +1 -1
- 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/package.json +1 -1
package/lib/modules/cdp.js
CHANGED
|
@@ -336,7 +336,7 @@ class CDPModule extends base_1.default {
|
|
|
336
336
|
let availableBorrowsUsd = number_1.BN_ZERO;
|
|
337
337
|
let currLiquidationThreshold = number_1.BN_ZERO;
|
|
338
338
|
for (let i = 0; i < collaterals.length; i++) {
|
|
339
|
-
const amount =
|
|
339
|
+
const amount = number_1.bnOrZero(collaterals[i].collateralAmount);
|
|
340
340
|
if (amount.isZero()) {
|
|
341
341
|
continue; // no collateral for denom
|
|
342
342
|
}
|
|
@@ -353,9 +353,9 @@ class CDPModule extends base_1.default {
|
|
|
353
353
|
if (!assetParam) {
|
|
354
354
|
continue;
|
|
355
355
|
}
|
|
356
|
-
const ltv =
|
|
356
|
+
const ltv = number_1.bnOrZero(assetParam.loanToValue).div(number_1.BN_10000);
|
|
357
357
|
const availableBorrowUsd = collateralUsdVal.times(ltv);
|
|
358
|
-
const liquidationThreshold =
|
|
358
|
+
const liquidationThreshold = number_1.bnOrZero(assetParam.liquidationThreshold).div(number_1.BN_10000);
|
|
359
359
|
const liquidationThresholdVal = collateralUsdVal.times(liquidationThreshold);
|
|
360
360
|
totalCollateralsUsd = totalCollateralsUsd.plus(collateralUsdVal);
|
|
361
361
|
availableBorrowsUsd = availableBorrowsUsd.plus(availableBorrowUsd);
|
|
@@ -366,7 +366,7 @@ class CDPModule extends base_1.default {
|
|
|
366
366
|
const debts = debtsRsp.debts;
|
|
367
367
|
let totalDebtsUsd = number_1.BN_ZERO;
|
|
368
368
|
for (let i = 0; i < debts.length; i++) {
|
|
369
|
-
const amount =
|
|
369
|
+
const amount = number_1.bnOrZero(debts[i].principalDebt);
|
|
370
370
|
const denom = debts[i].denom;
|
|
371
371
|
if (amount.isZero()) {
|
|
372
372
|
continue;
|
|
@@ -388,7 +388,7 @@ class CDPModule extends base_1.default {
|
|
|
388
388
|
if (stablecoinDebtInfo) {
|
|
389
389
|
const accountStablecoin = yield sdk.query.cdp.AccountStablecoin({ address: account });
|
|
390
390
|
const stablecoinDecimals = (_a = yield this.sdkProvider.getTokenClient().getDecimals(stablecoinDebtInfo.denom)) !== null && _a !== void 0 ? _a : number_1.BN_ZERO;
|
|
391
|
-
const stablecoinDebtAmount =
|
|
391
|
+
const stablecoinDebtAmount = number_1.bnOrZero(accountStablecoin.principalDebt).plus(number_1.bnOrZero(accountStablecoin.interestDebt));
|
|
392
392
|
stablecoinDebtUsd = stablecoinDebtAmount.shiftedBy(-stablecoinDecimals);
|
|
393
393
|
totalDebtsUsd = totalDebtsUsd.plus(stablecoinDebtUsd);
|
|
394
394
|
}
|
|
@@ -409,7 +409,7 @@ class CDPModule extends base_1.default {
|
|
|
409
409
|
const sdk = this.sdkProvider;
|
|
410
410
|
const cdpAddress = this.getCdpModuleAddress();
|
|
411
411
|
const balanceRsp = yield sdk.query.bank.Balance(query_2.QueryBalanceRequest.fromPartial({ address: cdpAddress, denom }));
|
|
412
|
-
return
|
|
412
|
+
return number_1.bnOrZero((_a = balanceRsp.balance) === null || _a === void 0 ? void 0 : _a.amount);
|
|
413
413
|
});
|
|
414
414
|
}
|
|
415
415
|
getCdpToActualRatio(cdpDenom) {
|
|
@@ -420,13 +420,13 @@ class CDPModule extends base_1.default {
|
|
|
420
420
|
const cdpAmountRsp = supplyRsp.amount;
|
|
421
421
|
if (!cdpAmountRsp)
|
|
422
422
|
throw new Error("unable to retrieve cdp token supply");
|
|
423
|
-
const cdpAmount =
|
|
423
|
+
const cdpAmount = number_1.bnOrZero(cdpAmountRsp.amount);
|
|
424
424
|
const cdpAddress = this.getCdpModuleAddress();
|
|
425
425
|
const balanceRsp = yield sdk.query.bank.Balance(query_2.QueryBalanceRequest.fromPartial({ address: cdpAddress, denom }));
|
|
426
426
|
if (!balanceRsp.balance)
|
|
427
427
|
throw new Error("unable to retrieve cdp module balance");
|
|
428
428
|
const owedAmount = yield this.getTotalTokenDebt(denom);
|
|
429
|
-
const actualAmount =
|
|
429
|
+
const actualAmount = number_1.bnOrZero(balanceRsp.balance.amount).plus(owedAmount);
|
|
430
430
|
if (!owedAmount)
|
|
431
431
|
throw new Error("unable to retrieve total token debt");
|
|
432
432
|
return cdpAmount.div(actualAmount);
|
|
@@ -448,8 +448,8 @@ class CDPModule extends base_1.default {
|
|
|
448
448
|
const allDebts = allDebtsRes.debtInfosAll;
|
|
449
449
|
for (let i = 0; i < allDebts.length; i++) {
|
|
450
450
|
const denom = allDebts[i].denom;
|
|
451
|
-
const interest =
|
|
452
|
-
const principal =
|
|
451
|
+
const interest = number_1.bnOrZero(allDebts[i].totalAccumulatedInterest);
|
|
452
|
+
const principal = number_1.bnOrZero(allDebts[i].totalPrincipal);
|
|
453
453
|
const debtAmt = interest.plus(principal);
|
|
454
454
|
const debtUsdVal = yield this.getTokenUsdVal(denom, debtAmt);
|
|
455
455
|
if (!debtUsdVal) {
|
|
@@ -461,7 +461,7 @@ class CDPModule extends base_1.default {
|
|
|
461
461
|
const stablecoinDebtRes = yield this.sdkProvider.query.cdp.StablecoinDebt({});
|
|
462
462
|
if (stablecoinDebtRes.stablecoinDebtInfo) {
|
|
463
463
|
const debtInfo = stablecoinDebtRes.stablecoinDebtInfo;
|
|
464
|
-
const debtAmt =
|
|
464
|
+
const debtAmt = number_1.bnOrZero(debtInfo.totalPrincipal).plus(number_1.bnOrZero(debtInfo.totalAccumulatedInterest));
|
|
465
465
|
const stablecoinDecimals = (_a = yield sdk.getTokenClient().getDecimals(debtInfo.denom)) !== null && _a !== void 0 ? _a : 0;
|
|
466
466
|
const debtUsdVal = (debtAmt).shiftedBy(-stablecoinDecimals);
|
|
467
467
|
totalDebt = totalDebt.plus(debtUsdVal);
|
|
@@ -479,7 +479,7 @@ class CDPModule extends base_1.default {
|
|
|
479
479
|
if (!TokenClient_1.default.isCdpToken(balance.denom)) {
|
|
480
480
|
continue;
|
|
481
481
|
}
|
|
482
|
-
const amount =
|
|
482
|
+
const amount = number_1.bnOrZero(balance.amount);
|
|
483
483
|
const collateralUsdValue = yield this.getCdpTokenUsdVal(balance.denom, amount);
|
|
484
484
|
allCollateralsUsdValue = allCollateralsUsdValue.plus(collateralUsdValue);
|
|
485
485
|
}
|
|
@@ -503,7 +503,7 @@ class CDPModule extends base_1.default {
|
|
|
503
503
|
const priceResult = yield sdk.query.pricing.TokenPrice(codec_1.QueryTokenPriceRequest.fromPartial({ denom }));
|
|
504
504
|
if (!priceResult.tokenPrice)
|
|
505
505
|
throw new Error("unable to retrieve token price for " + denom);
|
|
506
|
-
const twap =
|
|
506
|
+
const twap = number_1.bnOrZero(priceResult.tokenPrice.twap).shiftedBy(-18);
|
|
507
507
|
return amount.multipliedBy(twap).shiftedBy(-decimals);
|
|
508
508
|
});
|
|
509
509
|
}
|
|
@@ -516,10 +516,10 @@ class CDPModule extends base_1.default {
|
|
|
516
516
|
}
|
|
517
517
|
if (!debtInfo)
|
|
518
518
|
throw new Error("unable to retrieve debt info");
|
|
519
|
-
const principal =
|
|
520
|
-
const accumInterest =
|
|
519
|
+
const principal = number_1.bnOrZero(debtInfo.totalPrincipal);
|
|
520
|
+
const accumInterest = number_1.bnOrZero(debtInfo.totalAccumulatedInterest);
|
|
521
521
|
const cdpParamsRsp = yield this.sdkProvider.query.cdp.Params(query_1.QueryParamsRequest.fromPartial({}));
|
|
522
|
-
const interestFee =
|
|
522
|
+
const interestFee = number_1.bnOrZero((_a = cdpParamsRsp.params) === null || _a === void 0 ? void 0 : _a.interestFee);
|
|
523
523
|
const interest = accumInterest.times(number_1.BN_10000.minus(interestFee)).dividedToIntegerBy(number_1.BN_10000);
|
|
524
524
|
return principal.plus(interest);
|
|
525
525
|
});
|
|
@@ -537,8 +537,8 @@ class CDPModule extends base_1.default {
|
|
|
537
537
|
const debtRes = yield sdk.query.cdp.AccountDebt({ address: account, denom: denom });
|
|
538
538
|
debt = debtRes.debt;
|
|
539
539
|
}
|
|
540
|
-
const principalAmount =
|
|
541
|
-
const initialCIM =
|
|
540
|
+
const principalAmount = number_1.bnOrZero(debt === null || debt === void 0 ? void 0 : debt.principalDebt);
|
|
541
|
+
const initialCIM = number_1.bnOrZero(debt === null || debt === void 0 ? void 0 : debt.initialCumulativeInterestMultiplier);
|
|
542
542
|
if (principalAmount.isZero() || initialCIM.isZero())
|
|
543
543
|
return number_1.BN_ZERO;
|
|
544
544
|
const cim = yield this.recalculateCIM(denom, debtInfo);
|
|
@@ -563,8 +563,8 @@ class CDPModule extends base_1.default {
|
|
|
563
563
|
const debtResp = yield sdk.query.cdp.AccountStablecoin(query_1.QueryAccountStablecoinRequest.fromPartial({ address: account }));
|
|
564
564
|
debt = debtResp;
|
|
565
565
|
}
|
|
566
|
-
principalAmount =
|
|
567
|
-
const initialCIM =
|
|
566
|
+
principalAmount = number_1.bnOrZero(debt.principalDebt);
|
|
567
|
+
const initialCIM = number_1.bnOrZero(debt.initialCumulativeInterestMultiplier);
|
|
568
568
|
const cim = yield this.recalculateStablecoinCIM(debtInfo);
|
|
569
569
|
if (!cim)
|
|
570
570
|
throw new Error("unable to retrieve account debt");
|
|
@@ -600,12 +600,14 @@ class CDPModule extends base_1.default {
|
|
|
600
600
|
});
|
|
601
601
|
}
|
|
602
602
|
static calculateInterestForTimePeriod(apy, start, end) {
|
|
603
|
-
const
|
|
604
|
-
if (
|
|
603
|
+
const diffMs = end.getTime() - start.getTime();
|
|
604
|
+
if (diffMs <= 0) {
|
|
605
605
|
return number_1.BN_ZERO;
|
|
606
606
|
}
|
|
607
|
-
const
|
|
608
|
-
|
|
607
|
+
const diffSeconds = new bignumber_js_1.BigNumber(diffMs).shiftedBy(-3).dp(0, bignumber_js_1.BigNumber.ROUND_CEIL);
|
|
608
|
+
const secondsAYear = number_1.bnOrZero(31536000);
|
|
609
|
+
const numPeriods = secondsAYear.div(diffSeconds).dp(18);
|
|
610
|
+
return apy.div(numPeriods).dp(18); // carbon backend sdk.dec max 18 dp
|
|
609
611
|
}
|
|
610
612
|
calculateLendAPY(denom, borrowInterest, debtInfo, params) {
|
|
611
613
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -627,8 +629,8 @@ class CDPModule extends base_1.default {
|
|
|
627
629
|
throw new Error("unable to retrieve cdp params for " + denom);
|
|
628
630
|
}
|
|
629
631
|
}
|
|
630
|
-
const interestFeeRate =
|
|
631
|
-
const utilizationRate =
|
|
632
|
+
const interestFeeRate = number_1.bnOrZero(params.interestFee).div(number_1.BN_10000);
|
|
633
|
+
const utilizationRate = number_1.bnOrZero(debtInfo.utilizationRate).shiftedBy(-18);
|
|
632
634
|
return borrowInterest.times(utilizationRate).times(number_1.BN_ONE.minus(interestFeeRate));
|
|
633
635
|
});
|
|
634
636
|
}
|
|
@@ -643,7 +645,7 @@ class CDPModule extends base_1.default {
|
|
|
643
645
|
return number_1.BN_ZERO;
|
|
644
646
|
}
|
|
645
647
|
}
|
|
646
|
-
const cim =
|
|
648
|
+
const cim = number_1.bnOrZero(debtInfo.cumulativeInterestMultiplier);
|
|
647
649
|
const apy = yield this.calculateAPY(denom, debtInfo);
|
|
648
650
|
const interest = CDPModule.calculateInterestForTimePeriod(apy, (_a = debtInfo.lastUpdatedTime) !== null && _a !== void 0 ? _a : new Date(0), new Date());
|
|
649
651
|
const newCIM = cim.times(interest.plus(1));
|
|
@@ -662,8 +664,8 @@ class CDPModule extends base_1.default {
|
|
|
662
664
|
}
|
|
663
665
|
}
|
|
664
666
|
const paramsResponse = yield sdk.query.cdp.Params(codec_1.QueryCdpParamsRequest.fromPartial({}));
|
|
665
|
-
const cim =
|
|
666
|
-
const apy =
|
|
667
|
+
const cim = number_1.bnOrZero(debtInfo.cumulativeInterestMultiplier);
|
|
668
|
+
const apy = number_1.bnOrZero((_a = paramsResponse.params) === null || _a === void 0 ? void 0 : _a.stablecoinInterestRate);
|
|
667
669
|
if (!apy) {
|
|
668
670
|
return number_1.BN_ZERO;
|
|
669
671
|
}
|
|
@@ -689,7 +691,7 @@ class CDPModule extends base_1.default {
|
|
|
689
691
|
const availableBorrowsUsd = accountData.AvailableBorrowsUsd.minus(accountData.TotalDebtsUsd);
|
|
690
692
|
const unlockableUsd = availableBorrowsUsd.multipliedBy(number_1.BN_10000).div(unlockRatio);
|
|
691
693
|
const tokenPrice = yield sdk.query.pricing.TokenPrice({ denom });
|
|
692
|
-
const tokenTwap =
|
|
694
|
+
const tokenTwap = number_1.bnOrZero((_b = tokenPrice.tokenPrice) === null || _b === void 0 ? void 0 : _b.twap);
|
|
693
695
|
if (tokenTwap.isZero())
|
|
694
696
|
throw new Error("unable to retrieve token price for " + denom);
|
|
695
697
|
const tokenAmt = unlockableUsd.div(tokenTwap.shiftedBy(-18)).shiftedBy(tokenDecimals);
|
|
@@ -700,7 +702,7 @@ class CDPModule extends base_1.default {
|
|
|
700
702
|
address: account,
|
|
701
703
|
cdpDenom: cdpDenom
|
|
702
704
|
});
|
|
703
|
-
const lockedAmount =
|
|
705
|
+
const lockedAmount = number_1.bnOrZero((_e = (_d = accountCollateral.collateral) === null || _d === void 0 ? void 0 : _d.collateralAmount) !== null && _e !== void 0 ? _e : "0");
|
|
704
706
|
return lockedAmount.lt(cdpTokenAmt) ? lockedAmount : cdpTokenAmt;
|
|
705
707
|
});
|
|
706
708
|
}
|
|
@@ -718,7 +720,7 @@ class CDPModule extends base_1.default {
|
|
|
718
720
|
const denom = this.getUnderlyingDenom(cdpDenom);
|
|
719
721
|
const cdpToActualRatio = (_a = yield this.getCdpToActualRatio(cdpDenom)) !== null && _a !== void 0 ? _a : number_1.BN_ZERO;
|
|
720
722
|
const tokenPrice = yield sdk.query.pricing.TokenPrice({ denom: denom });
|
|
721
|
-
const tokenTwap =
|
|
723
|
+
const tokenTwap = number_1.bnOrZero((_b = tokenPrice.tokenPrice) === null || _b === void 0 ? void 0 : _b.twap).shiftedBy(-18);
|
|
722
724
|
return tokenTwap.multipliedBy(cdpToActualRatio);
|
|
723
725
|
});
|
|
724
726
|
}
|
|
@@ -739,26 +741,26 @@ class CDPModule extends base_1.default {
|
|
|
739
741
|
});
|
|
740
742
|
if (!asset.assetParams)
|
|
741
743
|
throw new Error("unable to retrieve asset param for " + cdpActualDenom);
|
|
742
|
-
const bonus =
|
|
744
|
+
const bonus = number_1.bnOrZero(asset.assetParams.liquidationDiscount).div(number_1.BN_10000);
|
|
743
745
|
const cdpTokenPrice = yield this.getCdpTokenPrice(cdpDenom);
|
|
744
746
|
const cdpTokenDiscountedPrice = cdpTokenPrice.multipliedBy(number_1.BN_ONE.minus(bonus));
|
|
745
747
|
// get close factor
|
|
746
748
|
const debtorAccountData = yield sdk.query.cdp.AccountData({
|
|
747
749
|
address: debtor
|
|
748
750
|
});
|
|
749
|
-
const debtorTotalCollateralVal =
|
|
750
|
-
const debtorTotalDebtVal =
|
|
751
|
-
const currentLiqThreshold =
|
|
751
|
+
const debtorTotalCollateralVal = number_1.bnOrZero(debtorAccountData.totalCollateralsUsd);
|
|
752
|
+
const debtorTotalDebtVal = number_1.bnOrZero(debtorAccountData.totalDebtsUsd);
|
|
753
|
+
const currentLiqThreshold = number_1.bnOrZero(debtorAccountData.currLiquidationThreshold);
|
|
752
754
|
const params = yield sdk.query.cdp.Params({});
|
|
753
755
|
if (!params.params) {
|
|
754
756
|
throw new Error("unable to retrieve cdp params");
|
|
755
757
|
}
|
|
756
|
-
const smallLiqSize =
|
|
757
|
-
const minCloseFactor =
|
|
758
|
-
const completeLiqThreshold =
|
|
758
|
+
const smallLiqSize = number_1.bnOrZero(params.params.smallLiquidationSize);
|
|
759
|
+
const minCloseFactor = number_1.bnOrZero(params.params.minimumCloseFactor);
|
|
760
|
+
const completeLiqThreshold = number_1.bnOrZero(params.params.completeLiquidationThreshold);
|
|
759
761
|
const closeFactor = this.computeCloseFactor(debtorTotalDebtVal, debtorTotalCollateralVal, currentLiqThreshold, smallLiqSize, minCloseFactor, completeLiqThreshold);
|
|
760
762
|
// get max repayable amount given the debtor's debt and how much liquidator wants to repay
|
|
761
|
-
const debtDecimals =
|
|
763
|
+
const debtDecimals = number_1.bnOrZero(yield sdk.getTokenClient().getDecimals(debtDenom));
|
|
762
764
|
const maxRepayableValue = debtorTotalDebtVal.multipliedBy(closeFactor);
|
|
763
765
|
const maxRepayableAmt = maxRepayableValue.shiftedBy(debtDecimals.toNumber());
|
|
764
766
|
if (debtRepaymentAmount.isGreaterThan(maxRepayableAmt)) {
|
|
@@ -766,7 +768,7 @@ class CDPModule extends base_1.default {
|
|
|
766
768
|
}
|
|
767
769
|
// calculate collateral amount that can be obtained given that debt amount and debtor's collateral balance
|
|
768
770
|
// AND, recalculate debt repay amount if needed
|
|
769
|
-
const cdpTokenDecimals =
|
|
771
|
+
const cdpTokenDecimals = number_1.bnOrZero(yield sdk.getTokenClient().getDecimals(cdpActualDenom));
|
|
770
772
|
let collateralAmtToLiquidate = this.calculateCollateralRequiredForDebt(number_1.BN_ONE, // assumes USC is $1
|
|
771
773
|
cdpTokenDiscountedPrice, debtRepaymentAmount, cdpTokenDecimals, debtDecimals);
|
|
772
774
|
const debtorAccountCollateral = yield sdk.query.cdp.AccountCollateral({
|
|
@@ -839,17 +841,19 @@ class CDPModule extends base_1.default {
|
|
|
839
841
|
}
|
|
840
842
|
exports.CDPModule = CDPModule;
|
|
841
843
|
CDPModule.calculateInterestAPY = (debtInfo, rateStrategy) => {
|
|
842
|
-
const utilizationRate =
|
|
843
|
-
const optimalUsage =
|
|
844
|
-
const variableRate1 =
|
|
845
|
-
const variableRate2 =
|
|
846
|
-
const baseVariableBorrowRate =
|
|
844
|
+
const utilizationRate = number_1.bnOrZero(debtInfo.utilizationRate).shiftedBy(-18);
|
|
845
|
+
const optimalUsage = number_1.bnOrZero(rateStrategy.optimalUsage).shiftedBy(-4);
|
|
846
|
+
const variableRate1 = number_1.bnOrZero(rateStrategy.variableRateSlope1).shiftedBy(-4);
|
|
847
|
+
const variableRate2 = number_1.bnOrZero(rateStrategy.variableRateSlope2).shiftedBy(-4);
|
|
848
|
+
const baseVariableBorrowRate = number_1.bnOrZero(rateStrategy.baseVariableBorrowRate).shiftedBy(-4);
|
|
847
849
|
if (utilizationRate.lte(optimalUsage)) {
|
|
848
|
-
|
|
850
|
+
const vRate = utilizationRate.times(variableRate1).div(optimalUsage).dp(4, bignumber_js_1.BigNumber.ROUND_CEIL);
|
|
851
|
+
return vRate.plus(baseVariableBorrowRate);
|
|
849
852
|
}
|
|
850
853
|
else {
|
|
851
854
|
const ratio = utilizationRate.minus(optimalUsage).div(number_1.BN_ONE.minus(optimalUsage));
|
|
852
|
-
|
|
855
|
+
const vRate = ratio.times(variableRate2).plus(variableRate1).dp(4, bignumber_js_1.BigNumber.ROUND_CEIL);
|
|
856
|
+
return vRate.plus(baseVariableBorrowRate);
|
|
853
857
|
}
|
|
854
858
|
};
|
|
855
859
|
;
|
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,63 +113,63 @@ class GovModule extends base_1.default {
|
|
|
113
113
|
const linkPoolMsg = {
|
|
114
114
|
title: title,
|
|
115
115
|
description: description,
|
|
116
|
-
msg:
|
|
116
|
+
msg: admin_1.transfromLinkPoolParams(msg)
|
|
117
117
|
};
|
|
118
118
|
return proposal_3.LinkPoolProposal.encode(linkPoolMsg).finish();
|
|
119
119
|
case "UnlinkPoolProposal":
|
|
120
120
|
const unlinkPoolMsg = {
|
|
121
121
|
title: title,
|
|
122
122
|
description: description,
|
|
123
|
-
msg:
|
|
123
|
+
msg: admin_1.transfromUnlinkPoolParams(msg)
|
|
124
124
|
};
|
|
125
125
|
return proposal_3.UnlinkPoolProposal.encode(unlinkPoolMsg).finish();
|
|
126
126
|
case "SetRewardCurveProposal":
|
|
127
127
|
const setRewardCurveMsg = {
|
|
128
128
|
title: title,
|
|
129
129
|
description: description,
|
|
130
|
-
msg:
|
|
130
|
+
msg: admin_1.transfromSetRewardCurveParams(msg)
|
|
131
131
|
};
|
|
132
132
|
return proposal_3.SetRewardCurveProposal.encode(setRewardCurveMsg).finish();
|
|
133
133
|
case "SetCommitmentCurveProposal":
|
|
134
134
|
const setCommitmentCurveMsg = {
|
|
135
135
|
title: title,
|
|
136
136
|
description: description,
|
|
137
|
-
msg:
|
|
137
|
+
msg: admin_1.transfromSetCommitmentCurveParams(msg)
|
|
138
138
|
};
|
|
139
139
|
return proposal_3.SetCommitmentCurveProposal.encode(setCommitmentCurveMsg).finish();
|
|
140
140
|
case "SetRewardsWeightsProposal":
|
|
141
141
|
const setRewardsWeightsMsg = {
|
|
142
142
|
title: title,
|
|
143
143
|
description: description,
|
|
144
|
-
msg:
|
|
144
|
+
msg: admin_1.transfromSetRewardsWeightsParams(msg)
|
|
145
145
|
};
|
|
146
146
|
return proposal_3.SetRewardsWeightsProposal.encode(setRewardsWeightsMsg).finish();
|
|
147
147
|
case "UpdatePoolProposal":
|
|
148
148
|
const updatePoolProposalMsg = {
|
|
149
149
|
title: title,
|
|
150
150
|
description: description,
|
|
151
|
-
msg:
|
|
151
|
+
msg: admin_1.transfromUpdatePoolParams(msg)
|
|
152
152
|
};
|
|
153
153
|
return proposal_3.UpdatePoolProposal.encode(updatePoolProposalMsg).finish();
|
|
154
154
|
case "UpdateMarketProposal":
|
|
155
155
|
const updateMarketProposalMsg = {
|
|
156
156
|
title: title,
|
|
157
157
|
description: description,
|
|
158
|
-
msg:
|
|
158
|
+
msg: market_1.transfromUpdateMarketParams(msg)
|
|
159
159
|
};
|
|
160
160
|
return proposal_4.UpdateMarketProposal.encode(updateMarketProposalMsg).finish();
|
|
161
161
|
case "CreateOracleProposal":
|
|
162
162
|
const createOracleProposalMsg = {
|
|
163
163
|
title: title,
|
|
164
164
|
description: description,
|
|
165
|
-
msg:
|
|
165
|
+
msg: admin_1.transfromCreateOracleParams(msg, wallet.bech32Address)
|
|
166
166
|
};
|
|
167
167
|
return proposal_5.CreateOracleProposal.encode(createOracleProposalMsg).finish();
|
|
168
168
|
case "SettlementPriceProposal":
|
|
169
169
|
const settlementPriceProposalMsg = {
|
|
170
170
|
title: title,
|
|
171
171
|
description: description,
|
|
172
|
-
msg:
|
|
172
|
+
msg: admin_1.transformSetSettlementPriceParams(msg),
|
|
173
173
|
};
|
|
174
174
|
return proposal_6.SettlementPriceProposal.encode(settlementPriceProposalMsg).finish();
|
|
175
175
|
case "ParameterChangeProposal":
|
|
@@ -191,7 +191,7 @@ class GovModule extends base_1.default {
|
|
|
191
191
|
title: title,
|
|
192
192
|
description: description,
|
|
193
193
|
recipient: proposalMsg.recipient,
|
|
194
|
-
amount:
|
|
194
|
+
amount: admin_1.transformCommunityPoolSpendAmount(proposalMsg.amount),
|
|
195
195
|
};
|
|
196
196
|
return distribution_1.CommunityPoolSpendProposal.encode(communityPoolSpendProposalMsg).finish();
|
|
197
197
|
case "CancelSoftwareUpgradeProposal":
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CarbonTx } from "../util";
|
|
2
2
|
import { BigNumber } from "bignumber.js";
|
|
3
|
+
import Long from "long";
|
|
3
4
|
import BaseModule from "./base";
|
|
4
5
|
export declare class LiquidityPoolModule extends BaseModule {
|
|
5
6
|
create(params: LiquidityPoolModule.CreatePoolParams, opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
|
|
@@ -25,7 +26,7 @@ export declare namespace LiquidityPoolModule {
|
|
|
25
26
|
tokenAWeight: BigNumber;
|
|
26
27
|
tokenBWeight: BigNumber;
|
|
27
28
|
swapFee: BigNumber;
|
|
28
|
-
ampBps:
|
|
29
|
+
ampBps: Long;
|
|
29
30
|
numQuotes: number;
|
|
30
31
|
}
|
|
31
32
|
interface CreatePoolWithLiquidityParams {
|
|
@@ -36,7 +37,7 @@ export declare namespace LiquidityPoolModule {
|
|
|
36
37
|
amountA: BigNumber;
|
|
37
38
|
amountB: BigNumber;
|
|
38
39
|
swapFee: BigNumber;
|
|
39
|
-
ampBps:
|
|
40
|
+
ampBps: Long;
|
|
40
41
|
numQuotes: number;
|
|
41
42
|
}
|
|
42
43
|
interface AddLiquidityParams {
|
|
@@ -30,7 +30,7 @@ class LiquidityPoolModule extends base_1.default {
|
|
|
30
30
|
tokenAWeight: params.tokenAWeight.shiftedBy(18).toString(10),
|
|
31
31
|
tokenBWeight: params.tokenBWeight.shiftedBy(18).toString(10),
|
|
32
32
|
swapFee: params.swapFee.shiftedBy(18).toString(10),
|
|
33
|
-
ampBps:
|
|
33
|
+
ampBps: params.ampBps,
|
|
34
34
|
numQuotes: new long_1.default(params.numQuotes),
|
|
35
35
|
});
|
|
36
36
|
return yield wallet.sendTx({
|
|
@@ -51,7 +51,7 @@ class LiquidityPoolModule extends base_1.default {
|
|
|
51
51
|
amountA: params.amountA.toString(10),
|
|
52
52
|
amountB: params.amountB.toString(10),
|
|
53
53
|
swapFee: params.swapFee.shiftedBy(18).toString(10),
|
|
54
|
-
ampBps:
|
|
54
|
+
ampBps: params.ampBps,
|
|
55
55
|
numQuotes: new long_1.default(params.numQuotes),
|
|
56
56
|
});
|
|
57
57
|
return yield wallet.sendTx({
|
|
@@ -147,7 +147,7 @@ class LiquidityPoolModule extends base_1.default {
|
|
|
147
147
|
const SECONDS_IN_A_WEEK = new bignumber_js_1.BigNumber(604800);
|
|
148
148
|
const mintDataResponse = yield this.sdkProvider.query.inflation.MintData({});
|
|
149
149
|
const mintData = mintDataResponse.mintData;
|
|
150
|
-
const nowTime = new bignumber_js_1.BigNumber(
|
|
150
|
+
const nowTime = new bignumber_js_1.BigNumber(dayjs_1.default().unix());
|
|
151
151
|
const firstBlockTime = (_a = mintData === null || mintData === void 0 ? void 0 : mintData.firstBlockTime.toNumber()) !== null && _a !== void 0 ? _a : 0;
|
|
152
152
|
const difference = nowTime.minus(firstBlockTime);
|
|
153
153
|
const currentWeek = difference.div(SECONDS_IN_A_WEEK).dp(0, bignumber_js_1.BigNumber.ROUND_DOWN);
|
|
@@ -85,7 +85,7 @@ class EthLedgerAccount {
|
|
|
85
85
|
static tryConnect() {
|
|
86
86
|
return __awaiter(this, void 0, void 0, function* () {
|
|
87
87
|
try {
|
|
88
|
-
const transport = yield
|
|
88
|
+
const transport = yield ledger_1.getLedgerTransport();
|
|
89
89
|
// get public key to assert that NEO app is open
|
|
90
90
|
const ethApp = new hw_app_eth_1.default(transport);
|
|
91
91
|
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
|
}
|
|
@@ -109,8 +109,8 @@ class NeoLedgerAccount {
|
|
|
109
109
|
*/
|
|
110
110
|
static tryConnect(version = "neo") {
|
|
111
111
|
return __awaiter(this, void 0, void 0, function* () {
|
|
112
|
-
const bipString =
|
|
113
|
-
const ledger = yield
|
|
112
|
+
const bipString = NeonLedger_1.getNEOBIP44String();
|
|
113
|
+
const ledger = yield ledger_1.getLedgerTransport();
|
|
114
114
|
// get public key to assert that NEO app is open
|
|
115
115
|
const ledgerAdapter = adapterForVersion(version);
|
|
116
116
|
const publicKey = yield ledgerAdapter.getPublicKey(ledger, bipString);
|
|
@@ -127,7 +127,7 @@ class NeoLedgerAccount {
|
|
|
127
127
|
}
|
|
128
128
|
sign(msg, magic = neon_core_next_1.CONST.MAGIC_NUMBER.MainNet) {
|
|
129
129
|
return __awaiter(this, void 0, void 0, function* () {
|
|
130
|
-
const bipString =
|
|
130
|
+
const bipString = NeonLedger_1.getNEOBIP44String();
|
|
131
131
|
const ledger = this.useLedger();
|
|
132
132
|
const ledgerAdapter = adapterForVersion(this.version);
|
|
133
133
|
console.log("getsignature", ledgerAdapter, ledger, msg, bipString, magic);
|
|
@@ -41,7 +41,7 @@ function evalTransportError(err) {
|
|
|
41
41
|
transportErr.message = "Transaction signing denied";
|
|
42
42
|
break;
|
|
43
43
|
default:
|
|
44
|
-
transportErr.message =
|
|
44
|
+
transportErr.message = hw_transport_1.getAltStatusMessage(transportErr.statusCode);
|
|
45
45
|
}
|
|
46
46
|
return err;
|
|
47
47
|
}
|
|
@@ -233,35 +233,35 @@ const MsgSetSmallLiquidationSize = {
|
|
|
233
233
|
},
|
|
234
234
|
};
|
|
235
235
|
const AdminAmino = {
|
|
236
|
-
[CarbonTx.Types.MsgCreateOracle]:
|
|
237
|
-
[CarbonTx.Types.MsgBindToken]:
|
|
238
|
-
[CarbonTx.Types.MsgCreateToken]:
|
|
239
|
-
[CarbonTx.Types.MsgLinkToken]:
|
|
240
|
-
[CarbonTx.Types.MsgSyncToken]:
|
|
241
|
-
[CarbonTx.Types.MsgCreateMarket]:
|
|
242
|
-
[CarbonTx.Types.MsgLinkPool]:
|
|
243
|
-
[CarbonTx.Types.MsgUnlinkPool]:
|
|
244
|
-
[CarbonTx.Types.MsgUpdatePool]:
|
|
245
|
-
[CarbonTx.Types.MsgSetRewardsWeights]:
|
|
246
|
-
[CarbonTx.Types.MsgSetRewardCurve]:
|
|
247
|
-
[CarbonTx.Types.MsgSetCommitmentCurve]:
|
|
248
|
-
[CarbonTx.Types.MsgSetTradingFlag]:
|
|
249
|
-
[CarbonTx.Types.MsgSetGasCost]:
|
|
250
|
-
[CarbonTx.Types.MsgSetMinGasPrice]:
|
|
251
|
-
[CarbonTx.Types.MsgRemoveGasCost]:
|
|
252
|
-
[CarbonTx.Types.MsgRemoveMinGasPrice]:
|
|
253
|
-
[CarbonTx.Types.MsgCreateValidator]:
|
|
254
|
-
[CarbonTx.Types.MsgEditValidator]:
|
|
255
|
-
[CarbonTx.Types.MsgAddRateStrategy]:
|
|
256
|
-
[CarbonTx.Types.MsgUpdateRateStrategy]:
|
|
257
|
-
[CarbonTx.Types.MsgRemoveRateStrategy]:
|
|
258
|
-
[CarbonTx.Types.MsgAddAsset]:
|
|
259
|
-
[CarbonTx.Types.MsgUpdateAsset]:
|
|
260
|
-
[CarbonTx.Types.MsgSetLiquidationFee]:
|
|
261
|
-
[CarbonTx.Types.MsgSetInterestFee]:
|
|
262
|
-
[CarbonTx.Types.MsgSetStablecoinInterestRate]:
|
|
263
|
-
[CarbonTx.Types.MsgSetCompleteLiquidationThreshold]:
|
|
264
|
-
[CarbonTx.Types.MsgSetMinimumCloseFactor]:
|
|
265
|
-
[CarbonTx.Types.MsgSetSmallLiquidationSize]:
|
|
236
|
+
[CarbonTx.Types.MsgCreateOracle]: utils_1.generateAminoType(MsgCreateOracle),
|
|
237
|
+
[CarbonTx.Types.MsgBindToken]: utils_1.generateAminoType(MsgBindToken),
|
|
238
|
+
[CarbonTx.Types.MsgCreateToken]: utils_1.generateAminoType(MsgCreateToken),
|
|
239
|
+
[CarbonTx.Types.MsgLinkToken]: utils_1.generateAminoType(MsgLinkToken),
|
|
240
|
+
[CarbonTx.Types.MsgSyncToken]: utils_1.generateAminoType(MsgSyncToken),
|
|
241
|
+
[CarbonTx.Types.MsgCreateMarket]: utils_1.generateAminoType(MsgCreateMarket),
|
|
242
|
+
[CarbonTx.Types.MsgLinkPool]: utils_1.generateAminoType(MsgLinkPool),
|
|
243
|
+
[CarbonTx.Types.MsgUnlinkPool]: utils_1.generateAminoType(MsgUnlinkPool),
|
|
244
|
+
[CarbonTx.Types.MsgUpdatePool]: utils_1.generateAminoType(MsgUpdatePool),
|
|
245
|
+
[CarbonTx.Types.MsgSetRewardsWeights]: utils_1.generateAminoType(MsgSetRewardsWeights),
|
|
246
|
+
[CarbonTx.Types.MsgSetRewardCurve]: utils_1.generateAminoType(MsgSetRewardCurve),
|
|
247
|
+
[CarbonTx.Types.MsgSetCommitmentCurve]: utils_1.generateAminoType(MsgSetCommitmentCurve),
|
|
248
|
+
[CarbonTx.Types.MsgSetTradingFlag]: utils_1.generateAminoType(MsgSetTradingFlag),
|
|
249
|
+
[CarbonTx.Types.MsgSetGasCost]: utils_1.generateAminoType(MsgSetGasCost),
|
|
250
|
+
[CarbonTx.Types.MsgSetMinGasPrice]: utils_1.generateAminoType(MsgSetMinGasPrice),
|
|
251
|
+
[CarbonTx.Types.MsgRemoveGasCost]: utils_1.generateAminoType(MsgRemoveGasCost),
|
|
252
|
+
[CarbonTx.Types.MsgRemoveMinGasPrice]: utils_1.generateAminoType(MsgRemoveMinGasPrice),
|
|
253
|
+
[CarbonTx.Types.MsgCreateValidator]: utils_1.generateAminoType(MsgCreateValidator),
|
|
254
|
+
[CarbonTx.Types.MsgEditValidator]: utils_1.generateAminoType(MsgEditValidator),
|
|
255
|
+
[CarbonTx.Types.MsgAddRateStrategy]: utils_1.generateAminoType(MsgAddRateStrategy),
|
|
256
|
+
[CarbonTx.Types.MsgUpdateRateStrategy]: utils_1.generateAminoType(MsgUpdateRateStrategy),
|
|
257
|
+
[CarbonTx.Types.MsgRemoveRateStrategy]: utils_1.generateAminoType(MsgRemoveRateStrategy),
|
|
258
|
+
[CarbonTx.Types.MsgAddAsset]: utils_1.generateAminoType(MsgAddAsset),
|
|
259
|
+
[CarbonTx.Types.MsgUpdateAsset]: utils_1.generateAminoType(MsgUpdateAsset),
|
|
260
|
+
[CarbonTx.Types.MsgSetLiquidationFee]: utils_1.generateAminoType(MsgSetLiquidationFee),
|
|
261
|
+
[CarbonTx.Types.MsgSetInterestFee]: utils_1.generateAminoType(MsgSetInterestFee),
|
|
262
|
+
[CarbonTx.Types.MsgSetStablecoinInterestRate]: utils_1.generateAminoType(MsgSetStablecoinInterestRate),
|
|
263
|
+
[CarbonTx.Types.MsgSetCompleteLiquidationThreshold]: utils_1.generateAminoType(MsgSetCompleteLiquidationThreshold),
|
|
264
|
+
[CarbonTx.Types.MsgSetMinimumCloseFactor]: utils_1.generateAminoType(MsgSetMinimumCloseFactor),
|
|
265
|
+
[CarbonTx.Types.MsgSetSmallLiquidationSize]: utils_1.generateAminoType(MsgSetSmallLiquidationSize),
|
|
266
266
|
};
|
|
267
267
|
exports.default = AdminAmino;
|
|
@@ -29,6 +29,6 @@ const MsgInitiateLiquidation = {
|
|
|
29
29
|
valueMap: {},
|
|
30
30
|
};
|
|
31
31
|
const BrokerAmino = {
|
|
32
|
-
[CarbonTx.Types.MsgInitiateLiquidation]:
|
|
32
|
+
[CarbonTx.Types.MsgInitiateLiquidation]: utils_1.generateAminoType(MsgInitiateLiquidation),
|
|
33
33
|
};
|
|
34
34
|
exports.default = BrokerAmino;
|