carbon-js-sdk 0.2.14-dev.1 → 0.2.14-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.
@@ -15,11 +15,15 @@ export declare class CDPModule extends BaseModule {
15
15
  supplyAssetAndLockCollateral(params: CDPModule.SupplyAssetAndLockCollateralParams, opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
16
16
  unlockCollateralAndWithdrawAsset(params: CDPModule.UnlockCollateralAndWithdrawAssetParams, opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
17
17
  liquidateCollateral(params: CDPModule.LiquidateCollateralParams, opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
18
+ liquidateCollateralWithCdpTokens(params: CDPModule.LiquidateCollateralWithCdpTokensParams, opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
19
+ liquidateCollateralWithCollateral(params: CDPModule.LiquidateCollateralWithCollateralParams, opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
20
+ liquidateCollateralWithStablecoin(params: CDPModule.LiquidateCollateralWithStablecoinParams, opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
18
21
  repayAssetWithCdpTokens(params: CDPModule.RepayAssetWithCdpTokensParams, opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
19
22
  repayAssetWithCollateral(params: CDPModule.RepayAssetWithCollateralParams, opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
20
23
  mintStablecoin(params: CDPModule.MintStablecoinParams, opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
21
24
  returnStablecoin(params: CDPModule.ReturnStablecoinParams, opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
22
25
  updateRateStrategy(params: CDPModule.UpdateRateStrategyParams, opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
26
+ claimRewards(opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
23
27
  getAccountData(account: string): Promise<{
24
28
  TotalCollateralsUsd: BigNumber;
25
29
  AvailableBorrowsUsd: BigNumber;
@@ -84,9 +88,38 @@ export declare namespace CDPModule {
84
88
  interface LiquidateCollateralParams {
85
89
  debtor: string;
86
90
  collateralDenom: string;
91
+ minCollateralAmount: BigNumber;
87
92
  debtDenom: string;
88
93
  debtAmount: BigNumber;
89
94
  }
95
+ interface LiquidateCollateralWithCdpTokensParams {
96
+ debtor: string;
97
+ collateralDenom: string;
98
+ minCollateralAmount: BigNumber;
99
+ debtDenom: string;
100
+ debtAmount: BigNumber;
101
+ debtCollateralDenom: string;
102
+ debtCollateralAmount: BigNumber;
103
+ }
104
+ interface LiquidateCollateralWithCollateralParams {
105
+ debtor: string;
106
+ collateralDenom: string;
107
+ minCollateralAmount: BigNumber;
108
+ debtDenom: string;
109
+ debtAmount: BigNumber;
110
+ debtCollateralDenom: string;
111
+ debtCollateralAmount: BigNumber;
112
+ }
113
+ interface LiquidateCollateralWithStablecoinParams {
114
+ debtor: string;
115
+ collateralDenom: string;
116
+ minCollateralAmount: BigNumber;
117
+ debtDenom: string;
118
+ debtAmount: BigNumber;
119
+ principalAmount: BigNumber;
120
+ interestDenom: string;
121
+ interestAmount: BigNumber;
122
+ }
90
123
  interface RepayAssetWithCdpTokensParams {
91
124
  debtor?: string;
92
125
  debtDenom: string;
@@ -103,7 +136,6 @@ export declare namespace CDPModule {
103
136
  amount: BigNumber;
104
137
  }
105
138
  interface ReturnStablecoinParams {
106
- creator: string;
107
139
  principalAmount: BigNumber;
108
140
  interestDenom: string;
109
141
  interestAmount: BigNumber;
@@ -22,6 +22,7 @@ const number_1 = require("../util/number");
22
22
  const bignumber_js_1 = require("bignumber.js");
23
23
  const query_3 = require("./../codec/cdp/query");
24
24
  const base_1 = __importDefault(require("./base"));
25
+ const constant_1 = require("../constant");
25
26
  class CDPModule extends base_1.default {
26
27
  constructor() {
27
28
  super(...arguments);
@@ -149,6 +150,7 @@ class CDPModule extends base_1.default {
149
150
  creator: wallet.bech32Address,
150
151
  debtor: params.debtor,
151
152
  collateralDenom: params.collateralDenom,
153
+ minCollateralAmount: params.minCollateralAmount.toString(10),
152
154
  debtDenom: params.debtDenom,
153
155
  debtAmount: params.debtAmount.toString(10),
154
156
  });
@@ -158,6 +160,64 @@ class CDPModule extends base_1.default {
158
160
  }, opts);
159
161
  });
160
162
  }
163
+ liquidateCollateralWithCdpTokens(params, opts) {
164
+ return __awaiter(this, void 0, void 0, function* () {
165
+ const wallet = this.getWallet();
166
+ const value = tx_1.MsgLiquidateCollateralWithCdpTokens.fromPartial({
167
+ creator: wallet.bech32Address,
168
+ debtor: params.debtor,
169
+ collateralDenom: params.collateralDenom,
170
+ minCollateralAmount: params.minCollateralAmount.toString(10),
171
+ debtDenom: params.debtDenom,
172
+ debtAmount: params.debtAmount.toString(10),
173
+ debtCollateralDenom: params.debtCollateralDenom,
174
+ debtCollateralAmount: params.debtCollateralAmount.toString(10)
175
+ });
176
+ return yield wallet.sendTx({
177
+ typeUrl: util_1.CarbonTx.Types.MsgLiquidateCollateralWithCdpTokens,
178
+ value
179
+ }, opts);
180
+ });
181
+ }
182
+ liquidateCollateralWithCollateral(params, opts) {
183
+ return __awaiter(this, void 0, void 0, function* () {
184
+ const wallet = this.getWallet();
185
+ const value = tx_1.MsgLiquidateCollateralWithCollateral.fromPartial({
186
+ creator: wallet.bech32Address,
187
+ debtor: params.debtor,
188
+ collateralDenom: params.collateralDenom,
189
+ minCollateralAmount: params.minCollateralAmount.toString(10),
190
+ debtDenom: params.debtDenom,
191
+ debtAmount: params.debtAmount.toString(10),
192
+ debtCollateralDenom: params.debtCollateralDenom,
193
+ debtCollateralAmount: params.debtCollateralAmount.toString(10)
194
+ });
195
+ return yield wallet.sendTx({
196
+ typeUrl: util_1.CarbonTx.Types.MsgLiquidateCollateralWithCollateral,
197
+ value
198
+ }, opts);
199
+ });
200
+ }
201
+ liquidateCollateralWithStablecoin(params, opts) {
202
+ return __awaiter(this, void 0, void 0, function* () {
203
+ const wallet = this.getWallet();
204
+ const value = tx_1.MsgLiquidateCollateralWithStablecoin.fromPartial({
205
+ creator: wallet.bech32Address,
206
+ debtor: params.debtor,
207
+ collateralDenom: params.collateralDenom,
208
+ minCollateralAmount: params.minCollateralAmount.toString(10),
209
+ debtDenom: params.debtDenom,
210
+ debtAmount: params.debtAmount.toString(10),
211
+ principalAmount: params.principalAmount.toString(10),
212
+ interestDenom: params.interestDenom,
213
+ interestAmount: params.interestAmount.toString(10),
214
+ });
215
+ return yield wallet.sendTx({
216
+ typeUrl: util_1.CarbonTx.Types.MsgLiquidateCollateralWithStablecoin,
217
+ value
218
+ }, opts);
219
+ });
220
+ }
161
221
  repayAssetWithCdpTokens(params, opts) {
162
222
  return __awaiter(this, void 0, void 0, function* () {
163
223
  const wallet = this.getWallet();
@@ -181,7 +241,7 @@ class CDPModule extends base_1.default {
181
241
  const debtor = params.debtor ? params.debtor : wallet.bech32Address;
182
242
  const value = tx_1.MsgRepayAssetWithCollateral.fromPartial({
183
243
  creator: wallet.bech32Address,
184
- debtor: params.debtor,
244
+ debtor: debtor,
185
245
  debtDenom: params.debtDenom,
186
246
  cdpDenom: params.cdpDenom,
187
247
  cdpAmount: params.cdpAmount.toString(10),
@@ -233,9 +293,21 @@ class CDPModule extends base_1.default {
233
293
  }, opts);
234
294
  });
235
295
  }
296
+ claimRewards(opts) {
297
+ return __awaiter(this, void 0, void 0, function* () {
298
+ const wallet = this.getWallet();
299
+ const value = tx_1.MsgClaimRewards.fromPartial({
300
+ creator: wallet.bech32Address,
301
+ });
302
+ return yield wallet.sendTx({
303
+ typeUrl: util_1.CarbonTx.Types.MsgClaimRewards,
304
+ value,
305
+ }, opts);
306
+ });
307
+ }
236
308
  // start of cdp calculations
237
309
  getAccountData(account) {
238
- var _a, _b;
310
+ var _a;
239
311
  return __awaiter(this, void 0, void 0, function* () {
240
312
  const sdk = this.sdkProvider;
241
313
  const debtInfoResponse = yield sdk.query.cdp.TokenDebtAll(query_3.QueryTokenDebtAllRequest.fromPartial({}));
@@ -300,10 +372,9 @@ class CDPModule extends base_1.default {
300
372
  return;
301
373
  }
302
374
  const accountStablecoin = yield sdk.query.cdp.AccountStablecoin({ address: account });
303
- const usdValue = (_a = yield sdk.getTokenClient().getUSDValue(stablecoinDebtInfo.denom)) !== null && _a !== void 0 ? _a : number_1.BN_ZERO;
304
- const stablecoinDecimals = (_b = yield this.sdkProvider.getTokenClient().getDecimals(stablecoinDebtInfo.denom)) !== null && _b !== void 0 ? _b : number_1.BN_ZERO;
375
+ const stablecoinDecimals = (_a = yield this.sdkProvider.getTokenClient().getDecimals(stablecoinDebtInfo.denom)) !== null && _a !== void 0 ? _a : number_1.BN_ZERO;
305
376
  const stablecoinDebtAmount = (0, number_1.bnOrZero)(accountStablecoin.principalDebt).plus((0, number_1.bnOrZero)(accountStablecoin.interestDebt));
306
- const stablecoinDebtUsd = (stablecoinDebtAmount.times(usdValue)).shiftedBy(-stablecoinDecimals);
377
+ const stablecoinDebtUsd = stablecoinDebtAmount.shiftedBy(-stablecoinDecimals);
307
378
  totalDebtsUsd = totalDebtsUsd.plus(stablecoinDebtUsd);
308
379
  const healthFactor = currLiquidationThreshold.div(totalDebtsUsd);
309
380
  return {
@@ -464,7 +535,13 @@ class CDPModule extends base_1.default {
464
535
  }
465
536
  const principal = (0, number_1.bnOrZero)(debtInfo.totalPrincipal);
466
537
  const interest = (0, number_1.bnOrZero)(debtInfo.totalAccumulatedInterest);
467
- return principal.plus(interest);
538
+ const cdpParamsRsp = yield this.sdkProvider.query.cdp.Params(query_1.QueryParamsRequest.fromPartial({}));
539
+ const cdpParams = cdpParamsRsp.params;
540
+ if (!cdpParams) {
541
+ return;
542
+ }
543
+ const interestFee = (0, number_1.bnOrZero)(cdpParams.interestFee).div(10000);
544
+ return principal.plus(interest.times((0, number_1.bnOrZero)(1).minus(interestFee)));
468
545
  });
469
546
  }
470
547
  getTotalAccountTokenDebt(account, denom, debt, debtInfo) {
@@ -616,6 +693,7 @@ class CDPModule extends base_1.default {
616
693
  });
617
694
  }
618
695
  getMaxCollateralForUnlock(account, cdpDenom) {
696
+ var _a;
619
697
  return __awaiter(this, void 0, void 0, function* () {
620
698
  const sdk = this.sdkProvider;
621
699
  const denom = yield this.getUnderlyingDenom(cdpDenom);
@@ -624,19 +702,25 @@ class CDPModule extends base_1.default {
624
702
  const assetParams = yield sdk.query.cdp.Asset({ denom: denom });
625
703
  if (!assetParams.assetParams)
626
704
  return;
627
- const ltv = new bignumber_js_1.BigNumber(assetParams.assetParams.loanToValue);
705
+ let unlockRatio = new bignumber_js_1.BigNumber(assetParams.assetParams.loanToValue);
706
+ if (sdk.getConfig().network === constant_1.Network.LocalHost || sdk.getConfig().network === constant_1.Network.DevNet) {
707
+ unlockRatio = new bignumber_js_1.BigNumber(assetParams.assetParams.liquidationThreshold);
708
+ }
628
709
  const accountData = yield this.getAccountData(account);
629
710
  if (!accountData)
630
711
  return;
631
- const availableBorrowsUsd = accountData.AvailableBorrowsUsd.minus(accountData.TotalDebtsUsd);
632
- const unlockableUsd = availableBorrowsUsd.multipliedBy(10000).div(ltv);
633
- const cdpTokenPrice = yield this.getCdpTokenPrice(cdpDenom);
634
- if (!cdpTokenPrice)
635
- return;
636
712
  const tokenDecimals = yield sdk.getTokenClient().getDecimals(denom);
637
713
  if (!tokenDecimals)
638
714
  return;
639
- const cdpTokensUnlockableAmt = unlockableUsd.div(cdpTokenPrice).shiftedBy(tokenDecimals);
715
+ const availableBorrowsUsd = accountData.AvailableBorrowsUsd.minus(accountData.TotalDebtsUsd);
716
+ const unlockableUsd = availableBorrowsUsd.multipliedBy(10000).div(unlockRatio);
717
+ const tokenPrice = yield sdk.query.pricing.TokenPrice({ denom: denom });
718
+ if (!tokenPrice.tokenPrice)
719
+ return;
720
+ const tokenTwap = new bignumber_js_1.BigNumber(tokenPrice.tokenPrice.twap);
721
+ const tokenAmt = unlockableUsd.div(tokenTwap.shiftedBy(-18)).shiftedBy(tokenDecimals);
722
+ const cdpToActualRatio = (_a = yield this.getCdpToActualRatio(cdpDenom)) !== null && _a !== void 0 ? _a : number_1.BN_ZERO;
723
+ const cdpTokenAmt = tokenAmt.multipliedBy(cdpToActualRatio);
640
724
  // take the min of cdpTokensUnlockableAmt and locked tokens
641
725
  const accountCollateral = yield sdk.query.cdp.AccountCollateral({
642
726
  address: account,
@@ -645,10 +729,10 @@ class CDPModule extends base_1.default {
645
729
  if (!accountCollateral.collateral)
646
730
  return;
647
731
  const lockedAmount = new bignumber_js_1.BigNumber(accountCollateral.collateral.collateralAmount);
648
- if (lockedAmount.lt(cdpTokensUnlockableAmt)) {
732
+ if (lockedAmount.lt(cdpTokenAmt)) {
649
733
  return lockedAmount;
650
734
  }
651
- return cdpTokensUnlockableAmt;
735
+ return cdpTokenAmt;
652
736
  });
653
737
  }
654
738
  getCdpTokenPrice(cdpDenom) {
@@ -3,3 +3,5 @@ import BaseModule from "./base";
3
3
  export declare class FeeModule extends BaseModule {
4
4
  getDepositWithdrawalFees(denom: string): Promise<GetFeeQuoteResponse>;
5
5
  }
6
+ onse>;
7
+ }
@@ -71,3 +71,6 @@ export declare namespace LiquidityPoolModule {
71
71
  address: string;
72
72
  }
73
73
  }
74
+
75
+ }
76
+ }
@@ -10,3 +10,6 @@ export declare namespace OracleModule {
10
10
  data: string;
11
11
  }
12
12
  }
13
+
14
+ }
15
+ }
@@ -36,3 +36,5 @@ class OracleModule extends base_1.default {
36
36
  }
37
37
  exports.OracleModule = OracleModule;
38
38
  ;
39
+ = OracleModule;
40
+ ;
@@ -58,3 +58,6 @@ export declare namespace OrderModule {
58
58
  Ioc = "ioc"
59
59
  }
60
60
  }
61
+
62
+ }
63
+ }
@@ -182,3 +182,5 @@ exports.OrderModule = OrderModule;
182
182
  })(TimeInForce = OrderModule.TimeInForce || (OrderModule.TimeInForce = {}));
183
183
  })(OrderModule = exports.OrderModule || (exports.OrderModule = {}));
184
184
  ;
185
+ orts.OrderModule = {}));
186
+ ;
@@ -11,3 +11,6 @@ export declare namespace PositionModule {
11
11
  margin: BigNumber;
12
12
  }
13
13
  }
14
+
15
+ }
16
+ }
@@ -51,3 +51,5 @@ class PositionModule extends base_1.default {
51
51
  }
52
52
  exports.PositionModule = PositionModule;
53
53
  ;
54
+ PositionModule;
55
+ ;
@@ -9,3 +9,6 @@ export declare namespace ProfileModule {
9
9
  twitter?: string;
10
10
  }
11
11
  }
12
+
13
+ }
14
+ }
@@ -34,3 +34,5 @@ class ProfileModule extends base_1.default {
34
34
  }
35
35
  exports.ProfileModule = ProfileModule;
36
36
  ;
37
+ ProfileModule;
38
+ ;
@@ -16,3 +16,6 @@ export declare namespace SubAccountModule {
16
16
  subAddress: string;
17
17
  }
18
18
  }
19
+
20
+ }
21
+ }
@@ -59,3 +59,5 @@ class SubAccountModule extends base_1.default {
59
59
  }
60
60
  exports.SubAccountModule = SubAccountModule;
61
61
  ;
62
+ bAccountModule;
63
+ ;
@@ -50,7 +50,10 @@ const TxTypes = {
50
50
  UpdateAsset: "cdp/UpdateAsset",
51
51
  SetLiquidationFee: "cdp/SetLiquidationFee",
52
52
  SetInterestFee: "cdp/SetInterestFee",
53
- SetStableCoinInterestRate: "cdp/SetStableCoinInterestRate",
53
+ SetStablecoinInterestRate: "cdp/SetStablecoinInterestRate",
54
+ SetCompleteLiquidationThreshold: "cdp/SetCompleteLiquidationThreshold",
55
+ SetMinimumCloseFactor: "cdp/SetMinimumCloseFactor",
56
+ SetSmallLiquidationSize: "cdp/SetSmallLiquidationSize",
54
57
  };
55
58
  const MsgCreateOracle = {
56
59
  aminoType: TxTypes.CreateOracle,
@@ -181,35 +184,53 @@ const MsgEditValidator = {
181
184
  };
182
185
  const MsgAddRateStrategy = {
183
186
  aminoType: TxTypes.AddRateStrategy,
184
- valueMap: {}
187
+ valueMap: {},
185
188
  };
186
189
  const MsgUpdateRateStrategy = {
187
190
  aminoType: TxTypes.UpdateRateStrategy,
188
- valueMap: {}
191
+ valueMap: {},
189
192
  };
190
193
  const MsgRemoveRateStrategy = {
191
194
  aminoType: TxTypes.RemoveRateStrategy,
192
- valueMap: {}
195
+ valueMap: {},
193
196
  };
194
197
  const MsgAddAsset = {
195
198
  aminoType: TxTypes.AddAsset,
196
- valueMap: {}
199
+ valueMap: {},
197
200
  };
198
201
  const MsgUpdateAsset = {
199
202
  aminoType: TxTypes.UpdateAsset,
200
- valueMap: {}
203
+ valueMap: {},
201
204
  };
202
205
  const MsgSetLiquidationFee = {
203
206
  aminoType: TxTypes.SetLiquidationFee,
204
- valueMap: {}
207
+ valueMap: {},
205
208
  };
206
209
  const MsgSetInterestFee = {
207
210
  aminoType: TxTypes.SetInterestFee,
208
- valueMap: {}
211
+ valueMap: {},
212
+ };
213
+ const MsgSetStablecoinInterestRate = {
214
+ aminoType: TxTypes.SetStablecoinInterestRate,
215
+ valueMap: {},
209
216
  };
210
- const MsgSetStableCoinInterestRate = {
211
- aminoType: TxTypes.SetStableCoinInterestRate,
212
- valueMap: {}
217
+ const MsgSetCompleteLiquidationThreshold = {
218
+ aminoType: TxTypes.SetCompleteLiquidationThreshold,
219
+ valueMap: {
220
+ completeLiquidationThreshold: utils_1.ConvertEncType.Dec,
221
+ },
222
+ };
223
+ const MsgSetMinimumCloseFactor = {
224
+ aminoType: TxTypes.SetMinimumCloseFactor,
225
+ valueMap: {
226
+ minimumCloseFactor: utils_1.ConvertEncType.Dec,
227
+ },
228
+ };
229
+ const MsgSetSmallLiquidationSize = {
230
+ aminoType: TxTypes.SetSmallLiquidationSize,
231
+ valueMap: {
232
+ smallLiquidationSize: utils_1.ConvertEncType.Dec,
233
+ },
213
234
  };
214
235
  const AdminAmino = {
215
236
  [CarbonTx.Types.MsgCreateOracle]: (0, utils_1.generateAminoType)(MsgCreateOracle),
@@ -238,6 +259,9 @@ const AdminAmino = {
238
259
  [CarbonTx.Types.MsgUpdateAsset]: (0, utils_1.generateAminoType)(MsgUpdateAsset),
239
260
  [CarbonTx.Types.MsgSetLiquidationFee]: (0, utils_1.generateAminoType)(MsgSetLiquidationFee),
240
261
  [CarbonTx.Types.MsgSetInterestFee]: (0, utils_1.generateAminoType)(MsgSetInterestFee),
241
- [CarbonTx.Types.MsgSetStablecoinInterestRate]: (0, utils_1.generateAminoType)(MsgSetStableCoinInterestRate),
262
+ [CarbonTx.Types.MsgSetStablecoinInterestRate]: (0, utils_1.generateAminoType)(MsgSetStablecoinInterestRate),
263
+ [CarbonTx.Types.MsgSetCompleteLiquidationThreshold]: (0, utils_1.generateAminoType)(MsgSetCompleteLiquidationThreshold),
264
+ [CarbonTx.Types.MsgSetMinimumCloseFactor]: (0, utils_1.generateAminoType)(MsgSetMinimumCloseFactor),
265
+ [CarbonTx.Types.MsgSetSmallLiquidationSize]: (0, utils_1.generateAminoType)(MsgSetSmallLiquidationSize),
242
266
  };
243
267
  exports.default = AdminAmino;
@@ -34,6 +34,11 @@ const TxTypes = {
34
34
  RepayAssetWithCdpTokens: "cdp/RepayAssetWithCdpTokens",
35
35
  RepayAssetWithCollateral: "cdp/RepayAssetWithCollateral",
36
36
  MintStablecoin: "cdp/MintStablecoin",
37
+ ReturnStablecoin: "cdp/ReturnStablecoin",
38
+ LiquidateCollateralWithCdpTokens: "cdp/LiquidateCollateralWithCdpTokens",
39
+ LiquidateCollateralWithCollateral: "cdp/LiquidateCollateralWithCollateral",
40
+ LiquidateCollateralWithStablecoin: "cdp/LiquidateCollateralWithStablecoin",
41
+ ClaimRewards: "cdp/ClaimRewards",
37
42
  };
38
43
  const MsgSupplyAsset = {
39
44
  aminoType: TxTypes.SupplyAsset,
@@ -83,6 +88,26 @@ const MsgMintStablecoin = {
83
88
  aminoType: TxTypes.MintStablecoin,
84
89
  valueMap: {},
85
90
  };
91
+ const MsgReturnStablecoin = {
92
+ aminoType: TxTypes.ReturnStablecoin,
93
+ valueMap: {},
94
+ };
95
+ const MsgLiquidateCollateralWithCdpTokens = {
96
+ aminoType: TxTypes.LiquidateCollateralWithCdpTokens,
97
+ valueMap: {},
98
+ };
99
+ const MsgLiquidateCollateralWithCollateral = {
100
+ aminoType: TxTypes.LiquidateCollateralWithCollateral,
101
+ valueMap: {},
102
+ };
103
+ const MsgLiquidateCollateralWithStablecoin = {
104
+ aminoType: TxTypes.LiquidateCollateralWithStablecoin,
105
+ valueMap: {},
106
+ };
107
+ const MsgClaimRewards = {
108
+ aminoType: TxTypes.ClaimRewards,
109
+ valueMap: {},
110
+ };
86
111
  const CdpAmino = {
87
112
  [CarbonTx.Types.MsgSupplyAsset]: (0, utils_1.generateAminoType)(MsgSupplyAsset),
88
113
  [CarbonTx.Types.MsgWithdrawAsset]: (0, utils_1.generateAminoType)(MsgWithdrawAsset),
@@ -96,5 +121,10 @@ const CdpAmino = {
96
121
  [CarbonTx.Types.MsgRepayAssetWithCdpTokens]: (0, utils_1.generateAminoType)(MsgRepayAssetWithCdpTokens),
97
122
  [CarbonTx.Types.MsgRepayAssetWithCollateral]: (0, utils_1.generateAminoType)(MsgRepayAssetWithCollateral),
98
123
  [CarbonTx.Types.MsgMintStablecoin]: (0, utils_1.generateAminoType)(MsgMintStablecoin),
124
+ [CarbonTx.Types.MsgReturnStablecoin]: (0, utils_1.generateAminoType)(MsgReturnStablecoin),
125
+ [CarbonTx.Types.MsgLiquidateCollateralWithCdpTokens]: (0, utils_1.generateAminoType)(MsgLiquidateCollateralWithCdpTokens),
126
+ [CarbonTx.Types.MsgLiquidateCollateralWithCollateral]: (0, utils_1.generateAminoType)(MsgLiquidateCollateralWithCollateral),
127
+ [CarbonTx.Types.MsgLiquidateCollateralWithStablecoin]: (0, utils_1.generateAminoType)(MsgLiquidateCollateralWithStablecoin),
128
+ [CarbonTx.Types.MsgClaimRewards]: (0, utils_1.generateAminoType)(MsgClaimRewards),
99
129
  };
100
130
  exports.default = CdpAmino;
package/lib/util/tx.d.ts CHANGED
@@ -109,12 +109,16 @@ export declare const Types: {
109
109
  MsgLiquidateCollateralWithCdpTokensResponse: string;
110
110
  MsgLiquidateCollateralWithCollateral: string;
111
111
  MsgLiquidateCollateralWithCollateralResponse: string;
112
+ MsgLiquidateCollateralWithStablecoin: string;
113
+ MsgLiquidateCollateralWithStablecoinResponse: string;
112
114
  MsgCreateRewardScheme: string;
113
115
  MsgCreateRewardSchemeResponse: string;
114
116
  MsgUpdateRewardScheme: string;
115
117
  MsgUpdateRewardSchemeResponse: string;
116
118
  MsgAddRewardReserve: string;
117
119
  MsgAddRewardReserveResponse: string;
120
+ MsgClaimRewards: string;
121
+ MsgClaimRewardsResponse: string;
118
122
  MsgSyncGenesis: string;
119
123
  MsgSyncGenesisResponse: string;
120
124
  MsgSyncHeaders: string;
@@ -333,6 +337,14 @@ export declare const Types: {
333
337
  SetCommitmentCurveProposal: string;
334
338
  SetRewardsWeightsProposal: string;
335
339
  UpdatePoolProposal: string;
340
+ MsgSetBackfillTimeInterval: string;
341
+ MsgSetBackfillTimeIntervalResponse: string;
342
+ MsgSetSmoothenBand: string;
343
+ MsgSetSmoothenBandResponse: string;
344
+ MsgSetImpactBand: string;
345
+ MsgSetImpactBandResponse: string;
346
+ MsgSetStaleIndexAllowance: string;
347
+ MsgSetStaleIndexAllowanceResponse: string;
336
348
  SettlementPriceProposal: string;
337
349
  MsgSetWrapperMapping: string;
338
350
  MsgSetWrapperMappingResponse: string;
@@ -243,6 +243,7 @@ export interface CDPBorrow {
243
243
  amount: string;
244
244
  denom: string;
245
245
  type: string;
246
+ initial_cumulative_interest_multiplier?: string;
246
247
  }
247
248
  /**
248
249
  * Response for get_cdp_total_collaterals and get_cdp_collaterals
@@ -122,6 +122,11 @@ export interface WsGetCdpStablecoinDebt {
122
122
  }
123
123
  export interface WsGetCdpLiquidations {
124
124
  }
125
+ export interface WsGetCdpRewardSchemes {
126
+ }
127
+ export interface WsGetCdpRewardDebts {
128
+ address: string;
129
+ }
125
130
  export interface WsSubscribeParams {
126
131
  channel: WSChannel;
127
132
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carbon-js-sdk",
3
- "version": "0.2.14-dev.1+2cf529ad4947",
3
+ "version": "0.2.14-dev.3+035463ebd45e",
4
4
  "description": "TypeScript SDK for Carbon blockchain",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",