carbon-js-sdk 0.2.13-dev.2 → 0.2.14
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/NEOClient.js +1 -1
- package/lib/clients/TokenClient.d.ts +0 -4
- package/lib/clients/TokenClient.js +7 -23
- package/lib/codec/book/genesis.d.ts +1 -1
- package/lib/codec/book/genesis.js +1 -1
- package/lib/codec/book/query.d.ts +1 -1
- package/lib/codec/book/query.js +1 -1
- package/lib/codec/broker/genesis.d.ts +1 -1
- package/lib/codec/broker/genesis.js +1 -1
- package/lib/codec/broker/query.d.ts +3 -3
- package/lib/codec/broker/query.js +3 -3
- package/lib/codec/btcx/denom_cross_chain_info.d.ts +1 -1
- package/lib/codec/btcx/denom_cross_chain_info.js +1 -1
- package/lib/codec/btcx/query.d.ts +1 -1
- package/lib/codec/btcx/query.js +1 -1
- package/lib/codec/ccm/genesis.d.ts +1 -1
- package/lib/codec/ccm/genesis.js +1 -1
- package/lib/codec/cdp/event.d.ts +22 -240
- package/lib/codec/cdp/event.js +80 -1516
- package/lib/codec/cdp/genesis.d.ts +4 -80
- package/lib/codec/cdp/genesis.js +22 -531
- package/lib/codec/cdp/query.d.ts +94 -397
- package/lib/codec/cdp/query.js +230 -1586
- package/lib/codec/cdp/tx.d.ts +96 -466
- package/lib/codec/cdp/tx.js +182 -1962
- package/lib/codec/coin/event.d.ts +1 -1
- package/lib/codec/coin/event.js +1 -1
- package/lib/codec/coin/genesis.d.ts +2 -2
- package/lib/codec/coin/genesis.js +2 -2
- package/lib/codec/coin/proposal.d.ts +1 -1
- package/lib/codec/coin/proposal.js +1 -1
- package/lib/codec/coin/query.d.ts +2 -2
- package/lib/codec/coin/query.js +2 -2
- package/lib/codec/coin/tx.d.ts +1 -1
- package/lib/codec/coin/tx.js +1 -1
- package/lib/codec/cosmos/auth/v1beta1/genesis.d.ts +1 -1
- package/lib/codec/cosmos/auth/v1beta1/genesis.js +1 -1
- package/lib/codec/cosmos/auth/v1beta1/query.d.ts +2 -2
- package/lib/codec/cosmos/auth/v1beta1/query.js +2 -2
- package/lib/codec/cosmos/authz/v1beta1/authz.d.ts +19 -0
- package/lib/codec/cosmos/authz/v1beta1/authz.js +89 -1
- package/lib/codec/cosmos/authz/v1beta1/genesis.d.ts +1 -15
- package/lib/codec/cosmos/authz/v1beta1/genesis.js +7 -120
- package/lib/codec/cosmos/authz/v1beta1/query.d.ts +70 -2
- package/lib/codec/cosmos/authz/v1beta1/query.js +275 -3
- package/lib/codec/cosmos/authz/v1beta1/tx.d.ts +1 -1
- package/lib/codec/cosmos/authz/v1beta1/tx.js +1 -1
- package/lib/codec/cosmos/bank/v1beta1/authz.d.ts +1 -1
- package/lib/codec/cosmos/bank/v1beta1/authz.js +1 -1
- package/lib/codec/cosmos/bank/v1beta1/bank.d.ts +1 -1
- package/lib/codec/cosmos/bank/v1beta1/bank.js +1 -1
- package/lib/codec/cosmos/bank/v1beta1/export.d.ts +1 -1
- package/lib/codec/cosmos/bank/v1beta1/export.js +3 -1
- package/lib/codec/cosmos/bank/v1beta1/genesis.d.ts +2 -2
- package/lib/codec/cosmos/bank/v1beta1/genesis.js +2 -2
- package/lib/codec/cosmos/bank/v1beta1/query.d.ts +43 -3
- package/lib/codec/cosmos/bank/v1beta1/query.js +140 -4
- package/lib/codec/cosmos/bank/v1beta1/tx.d.ts +2 -2
- package/lib/codec/cosmos/bank/v1beta1/tx.js +2 -2
- package/lib/codec/cosmos/base/snapshots/v1beta1/snapshot.d.ts +64 -0
- package/lib/codec/cosmos/base/snapshots/v1beta1/snapshot.js +343 -1
- package/lib/codec/cosmos/base/tendermint/v1beta1/query.d.ts +1 -1
- package/lib/codec/cosmos/base/tendermint/v1beta1/query.js +1 -1
- package/lib/codec/cosmos/capability/v1beta1/genesis.d.ts +1 -1
- package/lib/codec/cosmos/capability/v1beta1/genesis.js +1 -1
- package/lib/codec/cosmos/crisis/v1beta1/genesis.d.ts +1 -1
- package/lib/codec/cosmos/crisis/v1beta1/genesis.js +1 -1
- package/lib/codec/cosmos/distribution/v1beta1/distribution.d.ts +1 -1
- package/lib/codec/cosmos/distribution/v1beta1/distribution.js +1 -1
- package/lib/codec/cosmos/distribution/v1beta1/genesis.d.ts +2 -2
- package/lib/codec/cosmos/distribution/v1beta1/genesis.js +2 -2
- package/lib/codec/cosmos/distribution/v1beta1/query.d.ts +3 -3
- package/lib/codec/cosmos/distribution/v1beta1/query.js +3 -3
- package/lib/codec/cosmos/distribution/v1beta1/tx.d.ts +1 -1
- package/lib/codec/cosmos/distribution/v1beta1/tx.js +1 -1
- package/lib/codec/cosmos/evidence/v1beta1/query.d.ts +1 -1
- package/lib/codec/cosmos/evidence/v1beta1/query.js +1 -1
- package/lib/codec/cosmos/feegrant/v1beta1/feegrant.d.ts +1 -1
- package/lib/codec/cosmos/feegrant/v1beta1/feegrant.js +1 -1
- package/lib/codec/cosmos/feegrant/v1beta1/genesis.d.ts +1 -1
- package/lib/codec/cosmos/feegrant/v1beta1/genesis.js +1 -1
- package/lib/codec/cosmos/feegrant/v1beta1/query.d.ts +35 -2
- package/lib/codec/cosmos/feegrant/v1beta1/query.js +139 -3
- package/lib/codec/cosmos/gov/v1beta1/genesis.d.ts +1 -1
- package/lib/codec/cosmos/gov/v1beta1/genesis.js +1 -1
- package/lib/codec/cosmos/gov/v1beta1/gov.d.ts +1 -1
- package/lib/codec/cosmos/gov/v1beta1/gov.js +1 -1
- package/lib/codec/cosmos/gov/v1beta1/query.d.ts +2 -2
- package/lib/codec/cosmos/gov/v1beta1/query.js +2 -2
- package/lib/codec/cosmos/gov/v1beta1/tx.d.ts +2 -2
- package/lib/codec/cosmos/gov/v1beta1/tx.js +2 -2
- package/lib/codec/cosmos/mint/v1beta1/genesis.d.ts +1 -1
- package/lib/codec/cosmos/mint/v1beta1/genesis.js +1 -1
- package/lib/codec/cosmos/mint/v1beta1/query.d.ts +1 -1
- package/lib/codec/cosmos/mint/v1beta1/query.js +1 -1
- package/lib/codec/cosmos/params/v1beta1/query.d.ts +1 -1
- package/lib/codec/cosmos/params/v1beta1/query.js +1 -1
- package/lib/codec/cosmos/slashing/v1beta1/genesis.d.ts +1 -1
- package/lib/codec/cosmos/slashing/v1beta1/genesis.js +1 -1
- package/lib/codec/cosmos/slashing/v1beta1/query.d.ts +2 -2
- package/lib/codec/cosmos/slashing/v1beta1/query.js +2 -2
- package/lib/codec/cosmos/staking/v1beta1/authz.d.ts +1 -1
- package/lib/codec/cosmos/staking/v1beta1/authz.js +1 -1
- package/lib/codec/cosmos/staking/v1beta1/genesis.d.ts +1 -1
- package/lib/codec/cosmos/staking/v1beta1/genesis.js +1 -1
- package/lib/codec/cosmos/staking/v1beta1/query.d.ts +2 -2
- package/lib/codec/cosmos/staking/v1beta1/query.js +2 -2
- package/lib/codec/cosmos/staking/v1beta1/staking.d.ts +1 -1
- package/lib/codec/cosmos/staking/v1beta1/staking.js +1 -1
- package/lib/codec/cosmos/staking/v1beta1/tx.d.ts +2 -2
- package/lib/codec/cosmos/staking/v1beta1/tx.js +2 -2
- package/lib/codec/cosmos/tx/signing/v1beta1/signing.d.ts +14 -1
- package/lib/codec/cosmos/tx/signing/v1beta1/signing.js +19 -1
- package/lib/codec/cosmos/tx/v1beta1/export.d.ts +1 -1
- package/lib/codec/cosmos/tx/v1beta1/export.js +3 -1
- package/lib/codec/cosmos/tx/v1beta1/service.d.ts +53 -5
- package/lib/codec/cosmos/tx/v1beta1/service.js +179 -4
- package/lib/codec/cosmos/tx/v1beta1/tx.d.ts +3 -3
- package/lib/codec/cosmos/tx/v1beta1/tx.js +3 -3
- package/lib/codec/cosmos/upgrade/v1beta1/query.d.ts +1 -1
- package/lib/codec/cosmos/upgrade/v1beta1/query.js +1 -1
- package/lib/codec/cosmos/vesting/v1beta1/tx.d.ts +1 -1
- package/lib/codec/cosmos/vesting/v1beta1/tx.js +1 -1
- package/lib/codec/cosmos/vesting/v1beta1/vesting.d.ts +2 -2
- package/lib/codec/cosmos/vesting/v1beta1/vesting.js +2 -2
- package/lib/codec/fee/genesis.d.ts +1 -1
- package/lib/codec/fee/genesis.js +1 -1
- package/lib/codec/fee/proposal.d.ts +1 -1
- package/lib/codec/fee/proposal.js +1 -1
- package/lib/codec/fee/query.d.ts +1 -1
- package/lib/codec/fee/query.js +1 -1
- package/lib/codec/fee/tx.d.ts +1 -1
- package/lib/codec/fee/tx.js +1 -1
- package/lib/codec/headersync/genesis.d.ts +1 -1
- package/lib/codec/headersync/genesis.js +1 -1
- package/lib/codec/headersync/query.d.ts +1 -1
- package/lib/codec/headersync/query.js +1 -1
- package/lib/codec/index.d.ts +16 -52
- package/lib/codec/index.js +55 -204
- package/lib/codec/inflation/genesis.d.ts +1 -1
- package/lib/codec/inflation/genesis.js +1 -1
- package/lib/codec/inflation/query.d.ts +1 -1
- package/lib/codec/inflation/query.js +1 -1
- package/lib/codec/insurance/genesis.d.ts +1 -1
- package/lib/codec/insurance/genesis.js +1 -1
- package/lib/codec/leverage/genesis.d.ts +1 -1
- package/lib/codec/leverage/genesis.js +1 -1
- package/lib/codec/leverage/query.d.ts +1 -1
- package/lib/codec/leverage/query.js +1 -1
- package/lib/codec/liquidation/genesis.d.ts +1 -1
- package/lib/codec/liquidation/genesis.js +1 -1
- package/lib/codec/liquidation/query.d.ts +1 -1
- package/lib/codec/liquidation/query.js +1 -1
- package/lib/codec/liquidation/quote_changes.d.ts +1 -1
- package/lib/codec/liquidation/quote_changes.js +1 -1
- package/lib/codec/liquiditypool/event.d.ts +2 -2
- package/lib/codec/liquiditypool/event.js +2 -2
- package/lib/codec/liquiditypool/genesis.d.ts +2 -2
- package/lib/codec/liquiditypool/genesis.js +2 -2
- package/lib/codec/liquiditypool/proposal.d.ts +1 -1
- package/lib/codec/liquiditypool/proposal.js +1 -1
- package/lib/codec/liquiditypool/query.d.ts +2 -2
- package/lib/codec/liquiditypool/query.js +2 -2
- package/lib/codec/liquiditypool/tx.d.ts +1 -1
- package/lib/codec/liquiditypool/tx.js +1 -1
- package/lib/codec/lockproxy/genesis.d.ts +1 -1
- package/lib/codec/lockproxy/genesis.js +1 -1
- package/lib/codec/lockproxy/query.d.ts +1 -1
- package/lib/codec/lockproxy/query.js +1 -1
- package/lib/codec/market/event.d.ts +1 -1
- package/lib/codec/market/event.js +1 -1
- package/lib/codec/market/genesis.d.ts +1 -1
- package/lib/codec/market/genesis.js +1 -1
- package/lib/codec/market/proposal.d.ts +1 -1
- package/lib/codec/market/proposal.js +1 -1
- package/lib/codec/market/query.d.ts +1 -1
- package/lib/codec/market/query.js +1 -1
- package/lib/codec/market/tx.d.ts +1 -1
- package/lib/codec/market/tx.js +1 -1
- package/lib/codec/marketstats/genesis.d.ts +1 -1
- package/lib/codec/marketstats/genesis.js +1 -1
- package/lib/codec/marketstats/query.d.ts +2 -2
- package/lib/codec/marketstats/query.js +2 -2
- package/lib/codec/misc/message.d.ts +1 -1
- package/lib/codec/misc/message.js +1 -1
- package/lib/codec/misc/query.d.ts +3 -3
- package/lib/codec/misc/query.js +3 -3
- package/lib/codec/misc/transaction.d.ts +1 -1
- package/lib/codec/misc/transaction.js +1 -1
- package/lib/codec/oracle/event.d.ts +1 -1
- package/lib/codec/oracle/event.js +1 -1
- package/lib/codec/oracle/genesis.d.ts +1 -1
- package/lib/codec/oracle/genesis.js +1 -1
- package/lib/codec/oracle/proposal.d.ts +1 -1
- package/lib/codec/oracle/proposal.js +1 -1
- package/lib/codec/oracle/query.d.ts +2 -2
- package/lib/codec/oracle/query.js +2 -2
- package/lib/codec/order/event.d.ts +1 -1
- package/lib/codec/order/event.js +1 -1
- package/lib/codec/order/genesis.d.ts +1 -1
- package/lib/codec/order/genesis.js +1 -1
- package/lib/codec/order/query.d.ts +1 -1
- package/lib/codec/order/query.js +1 -1
- package/lib/codec/position/event.d.ts +1 -1
- package/lib/codec/position/event.js +1 -1
- package/lib/codec/position/genesis.d.ts +1 -1
- package/lib/codec/position/genesis.js +1 -1
- package/lib/codec/position/query.d.ts +1 -1
- package/lib/codec/position/query.js +1 -1
- package/lib/codec/pricing/event.d.ts +1 -11
- package/lib/codec/pricing/event.js +2 -52
- package/lib/codec/pricing/genesis.d.ts +1 -2
- package/lib/codec/pricing/genesis.js +5 -20
- package/lib/codec/pricing/pricing.d.ts +0 -13
- package/lib/codec/pricing/pricing.js +1 -83
- package/lib/codec/pricing/query.d.ts +1 -1
- package/lib/codec/pricing/query.js +1 -1
- package/lib/codec/profile/event.d.ts +1 -1
- package/lib/codec/profile/event.js +1 -1
- package/lib/codec/profile/genesis.d.ts +1 -1
- package/lib/codec/profile/genesis.js +1 -1
- package/lib/codec/profile/query.d.ts +1 -1
- package/lib/codec/profile/query.js +1 -1
- package/lib/codec/subaccount/genesis.d.ts +1 -1
- package/lib/codec/subaccount/genesis.js +1 -1
- package/lib/codec/subaccount/query.d.ts +1 -1
- package/lib/codec/subaccount/query.js +1 -1
- package/lib/codec/tendermint/abci/types.d.ts +4 -4
- package/lib/codec/tendermint/abci/types.js +4 -4
- package/lib/codec/tendermint/types/block.d.ts +2 -2
- package/lib/codec/tendermint/types/block.js +2 -2
- package/lib/codec/tendermint/types/evidence.d.ts +2 -2
- package/lib/codec/tendermint/types/evidence.js +2 -2
- package/lib/codec/tendermint/types/types.d.ts +3 -3
- package/lib/codec/tendermint/types/types.js +3 -3
- package/lib/codec/tendermint/types/validator.d.ts +1 -1
- package/lib/codec/tendermint/types/validator.js +1 -1
- package/lib/modules/admin.d.ts +1 -53
- package/lib/modules/admin.js +43 -175
- package/lib/modules/cdp.d.ts +12 -62
- package/lib/modules/cdp.js +20 -149
- package/lib/provider/amino/types/admin.js +7 -48
- package/lib/provider/amino/types/cdp.js +32 -72
- package/lib/util/tx.d.ts +10 -42
- package/lib/wallet/CarbonSigningClient.js +27 -2
- package/lib/websocket/channel.js +0 -44
- package/lib/websocket/models.d.ts +36 -136
- package/lib/websocket/types.d.ts +3 -58
- package/lib/websocket/types.js +0 -22
- package/package.json +1 -1
|
@@ -7,7 +7,7 @@ exports.SimpleValidator = exports.Validator = exports.ValidatorSet = exports.pro
|
|
|
7
7
|
/* eslint-disable */
|
|
8
8
|
const long_1 = __importDefault(require("long"));
|
|
9
9
|
const minimal_1 = __importDefault(require("protobufjs/minimal"));
|
|
10
|
-
const keys_1 = require("
|
|
10
|
+
const keys_1 = require("../../tendermint/crypto/keys");
|
|
11
11
|
exports.protobufPackage = "tendermint.types";
|
|
12
12
|
const baseValidatorSet = { totalVotingPower: long_1.default.ZERO };
|
|
13
13
|
exports.ValidatorSet = {
|
package/lib/modules/admin.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export declare class AdminModule extends BaseModule {
|
|
|
16
16
|
linkToken(params: AdminModule.LinkTokenParams, opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
|
|
17
17
|
createMarket(params: AdminModule.CreateMarketParams, opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
|
|
18
18
|
createMarkets(params: AdminModule.CreateMarketParams[], opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
|
|
19
|
+
createVaultType(params: AdminModule.CreateVaultTypeParams, opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
|
|
19
20
|
linkPool(params: AdminModule.LinkPoolParams, opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
|
|
20
21
|
unlinkPool(params: AdminModule.UnlinkPoolParams, opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
|
|
21
22
|
setRewardsWeights(params: AdminModule.SetRewardsWeightsParams[], opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
|
|
@@ -32,14 +33,6 @@ export declare class AdminModule extends BaseModule {
|
|
|
32
33
|
editValidator(params: AdminModule.EditValidatorParams, opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
|
|
33
34
|
authorizeBridge(params: AdminModule.AuthorizeBridgeParams, opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
|
|
34
35
|
deauthorizeBridge(params: AdminModule.DeauthorizeBridgeParams, opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
|
|
35
|
-
addRateStrategy(params: AdminModule.AddRateStrategyParams, opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
|
|
36
|
-
updateRateStrategy(params: AdminModule.UpdateRateStrategyParams, opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
|
|
37
|
-
removeRateStrategy(params: AdminModule.RemoveRateStrategyParams, opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
|
|
38
|
-
addAsset(params: AdminModule.AddAssetParams, opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
|
|
39
|
-
updateAsset(params: AdminModule.UpdateAssetParams, opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
|
|
40
|
-
setLiquidationFee(params: AdminModule.SetLiquidationFeeParams, opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
|
|
41
|
-
setInterestFee(params: AdminModule.SetInterestFeeParams, opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
|
|
42
|
-
setStableCoinInterestRate(params: AdminModule.SetStableCoinInterestRateParams, opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
|
|
43
36
|
}
|
|
44
37
|
export declare namespace AdminModule {
|
|
45
38
|
interface AuthorizeBridgeParams {
|
|
@@ -188,51 +181,6 @@ export declare namespace AdminModule {
|
|
|
188
181
|
commissionRate: BigNumber;
|
|
189
182
|
minSelfDelegation: BigNumber;
|
|
190
183
|
}
|
|
191
|
-
interface RateStrategy {
|
|
192
|
-
name: string;
|
|
193
|
-
optimalUsage: BigNumber;
|
|
194
|
-
baseVariableBorrowRate: BigNumber;
|
|
195
|
-
variableRateSlope1: BigNumber;
|
|
196
|
-
variableRateSlope2: BigNumber;
|
|
197
|
-
baseStableBorrowRate: BigNumber;
|
|
198
|
-
stableRateSlope1: BigNumber;
|
|
199
|
-
stableRateSlope2: BigNumber;
|
|
200
|
-
optimalStableToTotalDebtRatio: BigNumber;
|
|
201
|
-
}
|
|
202
|
-
interface Asset {
|
|
203
|
-
denom: string;
|
|
204
|
-
oracleId: string;
|
|
205
|
-
rateStrategyName: string;
|
|
206
|
-
loanToValue: BigNumber;
|
|
207
|
-
liquidationThreshold: BigNumber;
|
|
208
|
-
liquidationBonus: BigNumber;
|
|
209
|
-
supplyCap: BigNumber;
|
|
210
|
-
borrowCap: BigNumber;
|
|
211
|
-
}
|
|
212
|
-
interface AddRateStrategyParams {
|
|
213
|
-
rateStrategy: RateStrategy;
|
|
214
|
-
}
|
|
215
|
-
interface UpdateRateStrategyParams {
|
|
216
|
-
rateStrategy: RateStrategy;
|
|
217
|
-
}
|
|
218
|
-
interface RemoveRateStrategyParams {
|
|
219
|
-
name: string;
|
|
220
|
-
}
|
|
221
|
-
interface AddAssetParams {
|
|
222
|
-
asset: Asset;
|
|
223
|
-
}
|
|
224
|
-
interface UpdateAssetParams {
|
|
225
|
-
asset: Asset;
|
|
226
|
-
}
|
|
227
|
-
interface SetLiquidationFeeParams {
|
|
228
|
-
liquidationFee: BigNumber;
|
|
229
|
-
}
|
|
230
|
-
interface SetInterestFeeParams {
|
|
231
|
-
interestFee: BigNumber;
|
|
232
|
-
}
|
|
233
|
-
interface SetStableCoinInterestRateParams {
|
|
234
|
-
stablecoinInterestRate: BigNumber;
|
|
235
|
-
}
|
|
236
184
|
}
|
|
237
185
|
export declare function transfromCreateOracleParams(msg: AdminModule.CreateOracleParams, address: string): {
|
|
238
186
|
creator: string;
|
package/lib/modules/admin.js
CHANGED
|
@@ -13,14 +13,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.transformCommunityPoolSpendAmount = exports.transformSetSettlementPriceParams = exports.transfromSetMinGasPriceParams = exports.transfromSetMsgGasCostParams = exports.transfromSetTradingFlagParams = exports.transfromUpdatePoolParams = exports.transfromSetCommitmentCurveParams = exports.transfromSetRewardCurveParams = exports.transfromSetRewardsWeightsParams = exports.transfromUnlinkPoolParams = exports.transfromLinkPoolParams = exports.transfromCreateVaultTypeParams = exports.transfromSyncTokenParams = exports.transfromCreateTokenParams = exports.transfromCreateOracleParams = exports.AdminModule = void 0;
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
const
|
|
16
|
+
const tx_1 = require("../codec/cdp/tx");
|
|
17
|
+
const tx_2 = require("../codec/coin/tx");
|
|
18
|
+
const tx_3 = require("../codec/cosmos/staking/v1beta1/tx");
|
|
19
|
+
const tx_4 = require("../codec/fee/tx");
|
|
20
|
+
const tx_5 = require("../codec/liquiditypool/tx");
|
|
21
|
+
const tx_6 = require("../codec/market/tx");
|
|
22
|
+
const tx_7 = require("../codec/oracle/tx");
|
|
23
|
+
const tx_8 = require("../codec/order/tx");
|
|
24
24
|
const util_1 = require("../util");
|
|
25
25
|
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
26
26
|
const long_1 = __importDefault(require("long"));
|
|
@@ -29,7 +29,7 @@ class AdminModule extends base_1.default {
|
|
|
29
29
|
createOracle(params, opts) {
|
|
30
30
|
return __awaiter(this, void 0, void 0, function* () {
|
|
31
31
|
const wallet = this.getWallet();
|
|
32
|
-
const value =
|
|
32
|
+
const value = tx_7.MsgCreateOracle.fromPartial({
|
|
33
33
|
creator: wallet.bech32Address,
|
|
34
34
|
createOracleParams: transfromCreateOracleParams(params, wallet.bech32Address),
|
|
35
35
|
});
|
|
@@ -42,7 +42,7 @@ class AdminModule extends base_1.default {
|
|
|
42
42
|
createToken(params, opts) {
|
|
43
43
|
return __awaiter(this, void 0, void 0, function* () {
|
|
44
44
|
const wallet = this.getWallet();
|
|
45
|
-
const value =
|
|
45
|
+
const value = tx_2.MsgCreateToken.fromPartial({
|
|
46
46
|
creator: wallet.bech32Address,
|
|
47
47
|
createTokenParams: transfromCreateTokenParams(params, wallet.bech32Address),
|
|
48
48
|
});
|
|
@@ -56,7 +56,7 @@ class AdminModule extends base_1.default {
|
|
|
56
56
|
return __awaiter(this, void 0, void 0, function* () {
|
|
57
57
|
const wallet = this.getWallet();
|
|
58
58
|
const msgs = params.map(param => {
|
|
59
|
-
const value =
|
|
59
|
+
const value = tx_2.MsgCreateToken.fromPartial({
|
|
60
60
|
creator: wallet.bech32Address,
|
|
61
61
|
createTokenParams: transfromCreateTokenParams(param, wallet.bech32Address),
|
|
62
62
|
});
|
|
@@ -71,7 +71,7 @@ class AdminModule extends base_1.default {
|
|
|
71
71
|
syncToken(params, opts) {
|
|
72
72
|
return __awaiter(this, void 0, void 0, function* () {
|
|
73
73
|
const wallet = this.getWallet();
|
|
74
|
-
const value =
|
|
74
|
+
const value = tx_2.MsgSyncToken.fromPartial(transfromSyncTokenParams(params, wallet.bech32Address));
|
|
75
75
|
return yield wallet.sendTx({
|
|
76
76
|
typeUrl: util_1.CarbonTx.Types.MsgSyncToken,
|
|
77
77
|
value,
|
|
@@ -81,7 +81,7 @@ class AdminModule extends base_1.default {
|
|
|
81
81
|
bindToken(params, opts) {
|
|
82
82
|
return __awaiter(this, void 0, void 0, function* () {
|
|
83
83
|
const wallet = this.getWallet();
|
|
84
|
-
const value =
|
|
84
|
+
const value = tx_2.MsgBindToken.fromPartial({
|
|
85
85
|
creator: wallet.bech32Address,
|
|
86
86
|
sourceDenom: params.sourceDenom,
|
|
87
87
|
wrappedDenom: params.wrappedDenom,
|
|
@@ -95,7 +95,7 @@ class AdminModule extends base_1.default {
|
|
|
95
95
|
unbindToken(params, opts) {
|
|
96
96
|
return __awaiter(this, void 0, void 0, function* () {
|
|
97
97
|
const wallet = this.getWallet();
|
|
98
|
-
const value =
|
|
98
|
+
const value = tx_2.MsgUnbindToken.fromPartial({
|
|
99
99
|
creator: wallet.bech32Address,
|
|
100
100
|
wrappedDenom: params.wrappedDenom,
|
|
101
101
|
});
|
|
@@ -108,7 +108,7 @@ class AdminModule extends base_1.default {
|
|
|
108
108
|
updateToken(params, opts) {
|
|
109
109
|
return __awaiter(this, void 0, void 0, function* () {
|
|
110
110
|
const wallet = this.getWallet();
|
|
111
|
-
const value =
|
|
111
|
+
const value = tx_2.MsgUpdateToken.fromPartial({
|
|
112
112
|
updater: wallet.bech32Address,
|
|
113
113
|
denom: params.denom,
|
|
114
114
|
updateTokenParams: {
|
|
@@ -127,7 +127,7 @@ class AdminModule extends base_1.default {
|
|
|
127
127
|
linkToken(params, opts) {
|
|
128
128
|
return __awaiter(this, void 0, void 0, function* () {
|
|
129
129
|
const wallet = this.getWallet();
|
|
130
|
-
const value =
|
|
130
|
+
const value = tx_2.MsgLinkToken.fromPartial({
|
|
131
131
|
creator: wallet.bech32Address,
|
|
132
132
|
denom: params.denom,
|
|
133
133
|
bridgeAddress: params.bridgeAddress,
|
|
@@ -142,7 +142,7 @@ class AdminModule extends base_1.default {
|
|
|
142
142
|
var _a, _b;
|
|
143
143
|
return __awaiter(this, void 0, void 0, function* () {
|
|
144
144
|
const wallet = this.getWallet();
|
|
145
|
-
const value =
|
|
145
|
+
const value = tx_6.MsgCreateMarket.fromPartial({
|
|
146
146
|
creator: wallet.bech32Address,
|
|
147
147
|
marketType: params.marketType,
|
|
148
148
|
base: params.base,
|
|
@@ -163,7 +163,7 @@ class AdminModule extends base_1.default {
|
|
|
163
163
|
const wallet = this.getWallet();
|
|
164
164
|
const msgs = params.map((param) => {
|
|
165
165
|
var _a;
|
|
166
|
-
const value =
|
|
166
|
+
const value = tx_6.MsgCreateMarket.fromPartial(Object.assign({ creator: wallet.bech32Address, marketType: param.marketType, base: param.base, quote: param.quote, currentBasePriceUsd: param.currentBasePriceUsd.toString(10), currentQuotePriceUsd: param.currentQuotePriceUsd.toString(10), indexOracleId: (_a = param.indexOracleId) !== null && _a !== void 0 ? _a : "" }, param.expiryTime && { expiryTime: param.expiryTime }));
|
|
167
167
|
return {
|
|
168
168
|
typeUrl: util_1.CarbonTx.Types.MsgCreateMarket,
|
|
169
169
|
value,
|
|
@@ -172,10 +172,20 @@ class AdminModule extends base_1.default {
|
|
|
172
172
|
return yield wallet.sendTxs(msgs, opts);
|
|
173
173
|
});
|
|
174
174
|
}
|
|
175
|
+
createVaultType(params, opts) {
|
|
176
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
177
|
+
const wallet = this.getWallet();
|
|
178
|
+
const value = tx_1.MsgCreateVaultType.fromPartial(transfromCreateVaultTypeParams(params, wallet.bech32Address));
|
|
179
|
+
return yield wallet.sendTx({
|
|
180
|
+
typeUrl: util_1.CarbonTx.Types.MsgCreateVaultType,
|
|
181
|
+
value,
|
|
182
|
+
}, opts);
|
|
183
|
+
});
|
|
184
|
+
}
|
|
175
185
|
linkPool(params, opts) {
|
|
176
186
|
return __awaiter(this, void 0, void 0, function* () {
|
|
177
187
|
const wallet = this.getWallet();
|
|
178
|
-
const value =
|
|
188
|
+
const value = tx_5.MsgLinkPool.fromPartial({
|
|
179
189
|
creator: wallet.bech32Address,
|
|
180
190
|
linkPoolParams: transfromLinkPoolParams(params)
|
|
181
191
|
});
|
|
@@ -188,7 +198,7 @@ class AdminModule extends base_1.default {
|
|
|
188
198
|
unlinkPool(params, opts) {
|
|
189
199
|
return __awaiter(this, void 0, void 0, function* () {
|
|
190
200
|
const wallet = this.getWallet();
|
|
191
|
-
const value =
|
|
201
|
+
const value = tx_5.MsgUnlinkPool.fromPartial({
|
|
192
202
|
creator: wallet.bech32Address,
|
|
193
203
|
unlinkPoolParams: transfromUnlinkPoolParams(params)
|
|
194
204
|
});
|
|
@@ -201,7 +211,7 @@ class AdminModule extends base_1.default {
|
|
|
201
211
|
setRewardsWeights(params, opts) {
|
|
202
212
|
return __awaiter(this, void 0, void 0, function* () {
|
|
203
213
|
const wallet = this.getWallet();
|
|
204
|
-
const value =
|
|
214
|
+
const value = tx_5.MsgSetRewardsWeights.fromPartial({
|
|
205
215
|
creator: wallet.bech32Address,
|
|
206
216
|
setRewardsWeightsParams: transfromSetRewardsWeightsParams(params)
|
|
207
217
|
});
|
|
@@ -214,7 +224,7 @@ class AdminModule extends base_1.default {
|
|
|
214
224
|
setRewardCurve(params, opts) {
|
|
215
225
|
return __awaiter(this, void 0, void 0, function* () {
|
|
216
226
|
const wallet = this.getWallet();
|
|
217
|
-
const value =
|
|
227
|
+
const value = tx_5.MsgSetRewardCurve.fromPartial({
|
|
218
228
|
creator: wallet.bech32Address,
|
|
219
229
|
setRewardCurveParams: transfromSetRewardCurveParams(params)
|
|
220
230
|
});
|
|
@@ -227,7 +237,7 @@ class AdminModule extends base_1.default {
|
|
|
227
237
|
setCommitmentCurve(params, opts) {
|
|
228
238
|
return __awaiter(this, void 0, void 0, function* () {
|
|
229
239
|
const wallet = this.getWallet();
|
|
230
|
-
const value =
|
|
240
|
+
const value = tx_5.MsgSetCommitmentCurve.fromPartial({
|
|
231
241
|
creator: wallet.bech32Address,
|
|
232
242
|
setCommitmentCurveParams: transfromSetCommitmentCurveParams(params)
|
|
233
243
|
});
|
|
@@ -240,7 +250,7 @@ class AdminModule extends base_1.default {
|
|
|
240
250
|
updatePool(params, opts) {
|
|
241
251
|
return __awaiter(this, void 0, void 0, function* () {
|
|
242
252
|
const wallet = this.getWallet();
|
|
243
|
-
const value =
|
|
253
|
+
const value = tx_5.MsgUpdatePool.fromPartial({
|
|
244
254
|
creator: wallet.bech32Address,
|
|
245
255
|
updatePoolParams: transfromUpdatePoolParams(params),
|
|
246
256
|
});
|
|
@@ -253,7 +263,7 @@ class AdminModule extends base_1.default {
|
|
|
253
263
|
setTradingFlag(params, opts) {
|
|
254
264
|
return __awaiter(this, void 0, void 0, function* () {
|
|
255
265
|
const wallet = this.getWallet();
|
|
256
|
-
const value =
|
|
266
|
+
const value = tx_8.MsgSetTradingFlag.fromPartial(transfromSetTradingFlagParams(params, wallet.bech32Address));
|
|
257
267
|
return yield wallet.sendTx({
|
|
258
268
|
typeUrl: util_1.CarbonTx.Types.MsgSetTradingFlag,
|
|
259
269
|
value,
|
|
@@ -268,7 +278,7 @@ class AdminModule extends base_1.default {
|
|
|
268
278
|
setMsgGasCost(params, opts) {
|
|
269
279
|
return __awaiter(this, void 0, void 0, function* () {
|
|
270
280
|
const wallet = this.getWallet();
|
|
271
|
-
const value =
|
|
281
|
+
const value = tx_4.MsgSetGasCost.fromPartial({
|
|
272
282
|
creator: wallet.bech32Address,
|
|
273
283
|
setGasCostParams: transfromSetMsgGasCostParams(params)
|
|
274
284
|
});
|
|
@@ -281,7 +291,7 @@ class AdminModule extends base_1.default {
|
|
|
281
291
|
setMinGasPrice(params, opts) {
|
|
282
292
|
return __awaiter(this, void 0, void 0, function* () {
|
|
283
293
|
const wallet = this.getWallet();
|
|
284
|
-
const value =
|
|
294
|
+
const value = tx_4.MsgSetMinGasPrice.fromPartial({
|
|
285
295
|
creator: wallet.bech32Address,
|
|
286
296
|
setMinGasPriceParams: transfromSetMinGasPriceParams(params)
|
|
287
297
|
});
|
|
@@ -294,7 +304,7 @@ class AdminModule extends base_1.default {
|
|
|
294
304
|
removeMsgGasCost(params, opts) {
|
|
295
305
|
return __awaiter(this, void 0, void 0, function* () {
|
|
296
306
|
const wallet = this.getWallet();
|
|
297
|
-
const value =
|
|
307
|
+
const value = tx_4.MsgRemoveGasCost.fromPartial({
|
|
298
308
|
creator: wallet.bech32Address,
|
|
299
309
|
msgType: params.msgType,
|
|
300
310
|
});
|
|
@@ -307,7 +317,7 @@ class AdminModule extends base_1.default {
|
|
|
307
317
|
removeMinGasPrice(params, opts) {
|
|
308
318
|
return __awaiter(this, void 0, void 0, function* () {
|
|
309
319
|
const wallet = this.getWallet();
|
|
310
|
-
const value =
|
|
320
|
+
const value = tx_4.MsgRemoveMinGasPrice.fromPartial({
|
|
311
321
|
creator: wallet.bech32Address,
|
|
312
322
|
denom: params.denom,
|
|
313
323
|
});
|
|
@@ -320,7 +330,7 @@ class AdminModule extends base_1.default {
|
|
|
320
330
|
createValidator(params, opts) {
|
|
321
331
|
return __awaiter(this, void 0, void 0, function* () {
|
|
322
332
|
const wallet = this.getWallet();
|
|
323
|
-
const value =
|
|
333
|
+
const value = tx_3.MsgCreateValidator.fromPartial(Object.assign(Object.assign({ delegatorAddress: params.delegatorAddress, validatorAddress: params.validatorAddress, minSelfDelegation: params.minSelfDelegation.toString(10), description: params.description, pubkey: params.pubkey }, params.commission && {
|
|
324
334
|
commission: {
|
|
325
335
|
rate: params.commission.rate.shiftedBy(18).toString(10),
|
|
326
336
|
maxRate: params.commission.maxRate.shiftedBy(18).toString(10),
|
|
@@ -341,7 +351,7 @@ class AdminModule extends base_1.default {
|
|
|
341
351
|
editValidator(params, opts) {
|
|
342
352
|
return __awaiter(this, void 0, void 0, function* () {
|
|
343
353
|
const wallet = this.getWallet();
|
|
344
|
-
const value =
|
|
354
|
+
const value = tx_3.MsgEditValidator.fromPartial({
|
|
345
355
|
description: params.description,
|
|
346
356
|
validatorAddress: params.validatorAddress,
|
|
347
357
|
commissionRate: params.commissionRate.shiftedBy(18).toString(10),
|
|
@@ -356,7 +366,7 @@ class AdminModule extends base_1.default {
|
|
|
356
366
|
authorizeBridge(params, opts) {
|
|
357
367
|
return __awaiter(this, void 0, void 0, function* () {
|
|
358
368
|
const wallet = this.getWallet();
|
|
359
|
-
const value =
|
|
369
|
+
const value = tx_2.MsgAuthorizeBridge.fromPartial({
|
|
360
370
|
creator: wallet.bech32Address,
|
|
361
371
|
bridgeId: new long_1.default(params.bridgeId),
|
|
362
372
|
chainId: new long_1.default(params.chainId),
|
|
@@ -371,7 +381,7 @@ class AdminModule extends base_1.default {
|
|
|
371
381
|
deauthorizeBridge(params, opts) {
|
|
372
382
|
return __awaiter(this, void 0, void 0, function* () {
|
|
373
383
|
const wallet = this.getWallet();
|
|
374
|
-
const value =
|
|
384
|
+
const value = tx_2.MsgDeauthorizeBridge.fromPartial({
|
|
375
385
|
initiator: wallet.bech32Address,
|
|
376
386
|
bridgeId: new long_1.default(params.bridgeId),
|
|
377
387
|
chainId: new long_1.default(params.chainId),
|
|
@@ -382,148 +392,6 @@ class AdminModule extends base_1.default {
|
|
|
382
392
|
}, opts);
|
|
383
393
|
});
|
|
384
394
|
}
|
|
385
|
-
addRateStrategy(params, opts) {
|
|
386
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
387
|
-
const wallet = this.getWallet();
|
|
388
|
-
const value = codec_1.MsgAddRateStrategy.fromPartial({
|
|
389
|
-
creator: wallet.bech32Address,
|
|
390
|
-
rateStrategyParams: {
|
|
391
|
-
name: params.rateStrategy.name,
|
|
392
|
-
optimalUsage: params.rateStrategy.optimalUsage.toString(10),
|
|
393
|
-
baseVariableBorrowRate: params.rateStrategy.baseVariableBorrowRate.toString(10),
|
|
394
|
-
variableRateSlope1: params.rateStrategy.variableRateSlope1.toString(10),
|
|
395
|
-
variableRateSlope2: params.rateStrategy.variableRateSlope2.toString(10),
|
|
396
|
-
baseStableBorrowRate: params.rateStrategy.baseStableBorrowRate.toString(10),
|
|
397
|
-
stableRateSlope1: params.rateStrategy.stableRateSlope1.toString(10),
|
|
398
|
-
stableRateSlope2: params.rateStrategy.stableRateSlope2.toString(10),
|
|
399
|
-
optimalStableToTotalDebtRatio: params.rateStrategy.optimalStableToTotalDebtRatio.toString(10),
|
|
400
|
-
},
|
|
401
|
-
});
|
|
402
|
-
return yield wallet.sendTx({
|
|
403
|
-
typeUrl: util_1.CarbonTx.Types.MsgAddRateStrategy,
|
|
404
|
-
value
|
|
405
|
-
}, opts);
|
|
406
|
-
});
|
|
407
|
-
}
|
|
408
|
-
updateRateStrategy(params, opts) {
|
|
409
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
410
|
-
const wallet = this.getWallet();
|
|
411
|
-
const value = codec_1.MsgUpdateRateStrategy.fromPartial({
|
|
412
|
-
creator: wallet.bech32Address,
|
|
413
|
-
rateStrategyParams: {
|
|
414
|
-
name: params.rateStrategy.name,
|
|
415
|
-
optimalUsage: params.rateStrategy.optimalUsage.toString(10),
|
|
416
|
-
baseVariableBorrowRate: params.rateStrategy.baseVariableBorrowRate.toString(10),
|
|
417
|
-
variableRateSlope1: params.rateStrategy.variableRateSlope1.toString(10),
|
|
418
|
-
variableRateSlope2: params.rateStrategy.variableRateSlope2.toString(10),
|
|
419
|
-
baseStableBorrowRate: params.rateStrategy.baseStableBorrowRate.toString(10),
|
|
420
|
-
stableRateSlope1: params.rateStrategy.stableRateSlope1.toString(10),
|
|
421
|
-
stableRateSlope2: params.rateStrategy.stableRateSlope2.toString(10),
|
|
422
|
-
optimalStableToTotalDebtRatio: params.rateStrategy.optimalStableToTotalDebtRatio.toString(10),
|
|
423
|
-
},
|
|
424
|
-
});
|
|
425
|
-
return yield wallet.sendTx({
|
|
426
|
-
typeUrl: util_1.CarbonTx.Types.MsgUpdateRateStrategy,
|
|
427
|
-
value
|
|
428
|
-
}, opts);
|
|
429
|
-
});
|
|
430
|
-
}
|
|
431
|
-
removeRateStrategy(params, opts) {
|
|
432
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
433
|
-
const wallet = this.getWallet();
|
|
434
|
-
const value = codec_1.MsgRemoveRateStrategy.fromPartial({
|
|
435
|
-
creator: wallet.bech32Address,
|
|
436
|
-
name: params.name,
|
|
437
|
-
});
|
|
438
|
-
return yield wallet.sendTx({
|
|
439
|
-
typeUrl: util_1.CarbonTx.Types.MsgRemoveRateStrategy,
|
|
440
|
-
value
|
|
441
|
-
}, opts);
|
|
442
|
-
});
|
|
443
|
-
}
|
|
444
|
-
addAsset(params, opts) {
|
|
445
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
446
|
-
const wallet = this.getWallet();
|
|
447
|
-
const value = codec_1.MsgAddAsset.fromPartial({
|
|
448
|
-
creator: wallet.bech32Address,
|
|
449
|
-
assetParams: {
|
|
450
|
-
denom: params.asset.denom,
|
|
451
|
-
oracleId: params.asset.oracleId,
|
|
452
|
-
rateStrategyName: params.asset.rateStrategyName,
|
|
453
|
-
loanToValue: params.asset.loanToValue.toString(10),
|
|
454
|
-
liquidationThreshold: params.asset.liquidationThreshold.toString(10),
|
|
455
|
-
liquidationBonus: params.asset.liquidationBonus.toString(10),
|
|
456
|
-
supplyCap: params.asset.supplyCap.toString(10),
|
|
457
|
-
borrowCap: params.asset.borrowCap.toString(10),
|
|
458
|
-
}
|
|
459
|
-
});
|
|
460
|
-
return yield wallet.sendTx({
|
|
461
|
-
typeUrl: util_1.CarbonTx.Types.MsgAddAsset,
|
|
462
|
-
value
|
|
463
|
-
}, opts);
|
|
464
|
-
});
|
|
465
|
-
}
|
|
466
|
-
updateAsset(params, opts) {
|
|
467
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
468
|
-
const wallet = this.getWallet();
|
|
469
|
-
const value = codec_1.MsgUpdateAsset.fromPartial({
|
|
470
|
-
creator: wallet.bech32Address,
|
|
471
|
-
assetParams: {
|
|
472
|
-
denom: params.asset.denom,
|
|
473
|
-
oracleId: params.asset.oracleId,
|
|
474
|
-
rateStrategyName: params.asset.rateStrategyName,
|
|
475
|
-
loanToValue: params.asset.loanToValue.toString(10),
|
|
476
|
-
liquidationThreshold: params.asset.liquidationThreshold.toString(10),
|
|
477
|
-
liquidationBonus: params.asset.liquidationBonus.toString(10),
|
|
478
|
-
supplyCap: params.asset.supplyCap.toString(10),
|
|
479
|
-
borrowCap: params.asset.borrowCap.toString(10),
|
|
480
|
-
}
|
|
481
|
-
});
|
|
482
|
-
return yield wallet.sendTx({
|
|
483
|
-
typeUrl: util_1.CarbonTx.Types.MsgUpdateAsset,
|
|
484
|
-
value
|
|
485
|
-
}, opts);
|
|
486
|
-
});
|
|
487
|
-
}
|
|
488
|
-
setLiquidationFee(params, opts) {
|
|
489
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
490
|
-
const wallet = this.getWallet();
|
|
491
|
-
const value = codec_1.MsgSetLiquidationFee.fromPartial({
|
|
492
|
-
creator: wallet.bech32Address,
|
|
493
|
-
liquidationFee: params.liquidationFee.toString(10),
|
|
494
|
-
});
|
|
495
|
-
return yield wallet.sendTx({
|
|
496
|
-
typeUrl: util_1.CarbonTx.Types.MsgSetLiquidationFee,
|
|
497
|
-
value
|
|
498
|
-
}, opts);
|
|
499
|
-
});
|
|
500
|
-
}
|
|
501
|
-
setInterestFee(params, opts) {
|
|
502
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
503
|
-
const wallet = this.getWallet();
|
|
504
|
-
const value = codec_1.MsgSetInterestFee.fromPartial({
|
|
505
|
-
creator: wallet.bech32Address,
|
|
506
|
-
interestFee: params.interestFee.toString(10),
|
|
507
|
-
});
|
|
508
|
-
return yield wallet.sendTx({
|
|
509
|
-
typeUrl: util_1.CarbonTx.Types.MsgSetInterestFee,
|
|
510
|
-
value
|
|
511
|
-
}, opts);
|
|
512
|
-
});
|
|
513
|
-
}
|
|
514
|
-
setStableCoinInterestRate(params, opts) {
|
|
515
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
516
|
-
const wallet = this.getWallet();
|
|
517
|
-
const value = codec_1.MsgSetStablecoinInterestRate.fromPartial({
|
|
518
|
-
creator: wallet.bech32Address,
|
|
519
|
-
stablecoinInterestRate: params.stablecoinInterestRate.toString(10),
|
|
520
|
-
});
|
|
521
|
-
return yield wallet.sendTx({
|
|
522
|
-
typeUrl: util_1.CarbonTx.Types.MsgSetStablecoinInterestRate,
|
|
523
|
-
value
|
|
524
|
-
}, opts);
|
|
525
|
-
});
|
|
526
|
-
}
|
|
527
395
|
}
|
|
528
396
|
exports.AdminModule = AdminModule;
|
|
529
397
|
;
|
package/lib/modules/cdp.d.ts
CHANGED
|
@@ -2,76 +2,26 @@ import { CarbonTx } from "../util";
|
|
|
2
2
|
import BaseModule from "./base";
|
|
3
3
|
import { BigNumber } from "bignumber.js";
|
|
4
4
|
export declare class CDPModule extends BaseModule {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
borrowAsset(params: CDPModule.BorrowAssetParams, opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
|
|
10
|
-
repayAsset(params: CDPModule.RepayAssetParams, opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
|
|
11
|
-
supplyAssetAndLockCollateral(params: CDPModule.SupplyAssetAndLockCollateralParams, opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
|
|
12
|
-
unlockCollateralAndWithdrawAsset(params: CDPModule.UnlockCollateralAndWithdrawAssetParams, opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
|
|
13
|
-
liquidateCollateral(params: CDPModule.LiquidateCollateralParams, opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
|
|
14
|
-
repayAssetWithCdpTokens(params: CDPModule.RepayAssetWithCdpTokensParams, opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
|
|
15
|
-
repayAssetWithCollateral(params: CDPModule.RepayAssetWithCollateralParams, opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
|
|
16
|
-
mintStablecoin(params: CDPModule.MintStablecoinParams, opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
|
|
17
|
-
returnStablecoin(params: CDPModule.ReturnStablecoinParams, opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
|
|
5
|
+
addCollateral(params: CDPModule.AddCollateralParams, opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
|
|
6
|
+
removeCollateral(params: CDPModule.RemoveCollateralParams, opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
|
|
7
|
+
addDebt(params: CDPModule.AddDebtParams, opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
|
|
8
|
+
removeDebt(params: CDPModule.RemoveDebtParams, opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
|
|
18
9
|
}
|
|
19
10
|
export declare namespace CDPModule {
|
|
20
|
-
interface
|
|
21
|
-
|
|
11
|
+
interface AddCollateralParams {
|
|
12
|
+
vaultTypeId: number;
|
|
22
13
|
amount: BigNumber;
|
|
23
14
|
}
|
|
24
|
-
interface
|
|
25
|
-
|
|
15
|
+
interface RemoveCollateralParams {
|
|
16
|
+
vaultTypeId: number;
|
|
26
17
|
amount: BigNumber;
|
|
27
18
|
}
|
|
28
|
-
interface
|
|
29
|
-
|
|
19
|
+
interface AddDebtParams {
|
|
20
|
+
vaultTypeId: number;
|
|
30
21
|
amount: BigNumber;
|
|
31
22
|
}
|
|
32
|
-
interface
|
|
33
|
-
|
|
23
|
+
interface RemoveDebtParams {
|
|
24
|
+
vaultTypeId: number;
|
|
34
25
|
amount: BigNumber;
|
|
35
26
|
}
|
|
36
|
-
interface BorrowAssetParams {
|
|
37
|
-
denom: string;
|
|
38
|
-
amount: BigNumber;
|
|
39
|
-
}
|
|
40
|
-
interface RepayAssetParams {
|
|
41
|
-
denom: string;
|
|
42
|
-
amount: BigNumber;
|
|
43
|
-
}
|
|
44
|
-
interface SupplyAssetAndLockCollateralParams {
|
|
45
|
-
denom: string;
|
|
46
|
-
supplyAmount: BigNumber;
|
|
47
|
-
lockAmount: BigNumber;
|
|
48
|
-
}
|
|
49
|
-
interface UnlockCollateralAndWithdrawAssetParams {
|
|
50
|
-
cdpDenom: string;
|
|
51
|
-
unlockAmount: BigNumber;
|
|
52
|
-
withdrawAmount: BigNumber;
|
|
53
|
-
}
|
|
54
|
-
interface LiquidateCollateralParams {
|
|
55
|
-
debtor: string;
|
|
56
|
-
collateralDenom: string;
|
|
57
|
-
debtDenom: string;
|
|
58
|
-
debtAmount: BigNumber;
|
|
59
|
-
}
|
|
60
|
-
interface RepayAssetWithCdpTokensParams {
|
|
61
|
-
cdpDenom: string;
|
|
62
|
-
amount: BigNumber;
|
|
63
|
-
}
|
|
64
|
-
interface RepayAssetWithCollateralParams {
|
|
65
|
-
cdpDenom: string;
|
|
66
|
-
amount: BigNumber;
|
|
67
|
-
}
|
|
68
|
-
interface MintStablecoinParams {
|
|
69
|
-
amount: BigNumber;
|
|
70
|
-
}
|
|
71
|
-
interface ReturnStablecoinParams {
|
|
72
|
-
creator: string;
|
|
73
|
-
principalAmount: BigNumber;
|
|
74
|
-
interestDenom: string;
|
|
75
|
-
interestAmount: BigNumber;
|
|
76
|
-
}
|
|
77
27
|
}
|