carbon-js-sdk 0.2.9-dev.2 → 0.2.10
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/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 -226
- package/lib/codec/cdp/event.js +80 -1414
- package/lib/codec/cdp/genesis.d.ts +4 -57
- package/lib/codec/cdp/genesis.js +22 -417
- package/lib/codec/cdp/query.d.ts +95 -191
- package/lib/codec/cdp/query.js +238 -676
- 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 +5 -2
- package/lib/codec/coin/query.js +8 -2
- package/lib/codec/coin/token.d.ts +0 -11
- package/lib/codec/coin/token.js +1 -65
- 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/query.d.ts +2 -2
- package/lib/codec/cosmos/authz/v1beta1/query.js +2 -2
- 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/genesis.d.ts +2 -2
- package/lib/codec/cosmos/bank/v1beta1/genesis.js +2 -2
- package/lib/codec/cosmos/bank/v1beta1/query.d.ts +3 -3
- package/lib/codec/cosmos/bank/v1beta1/query.js +3 -3
- 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/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 +2 -2
- package/lib/codec/cosmos/feegrant/v1beta1/query.js +2 -2
- 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 +1 -1
- package/lib/codec/cosmos/tx/signing/v1beta1/signing.js +1 -1
- package/lib/codec/cosmos/tx/v1beta1/service.d.ts +3 -3
- package/lib/codec/cosmos/tx/v1beta1/service.js +3 -3
- 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 +22 -53
- package/lib/codec/index.js +384 -502
- 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 -2
- package/lib/codec/market/genesis.js +2 -20
- 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/trade.d.ts +0 -1
- package/lib/codec/misc/trade.js +0 -17
- 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 +42 -174
- package/lib/modules/cdp.d.ts +12 -55
- package/lib/modules/cdp.js +20 -134
- package/lib/provider/amino/types/admin.js +7 -48
- package/lib/provider/amino/types/cdp.js +32 -72
- package/lib/util/tx.d.ts +14 -42
- package/lib/websocket/channel.js +0 -26
- package/lib/websocket/models.d.ts +0 -63
- package/lib/websocket/types.d.ts +3 -38
- package/lib/websocket/types.js +0 -16
- package/package.json +2 -2
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
|
linkToken(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.MsgLinkToken.fromPartial({
|
|
112
112
|
creator: wallet.bech32Address,
|
|
113
113
|
denom: params.denom,
|
|
114
114
|
bridgeAddress: params.bridgeAddress,
|
|
@@ -123,7 +123,7 @@ class AdminModule extends base_1.default {
|
|
|
123
123
|
var _a, _b;
|
|
124
124
|
return __awaiter(this, void 0, void 0, function* () {
|
|
125
125
|
const wallet = this.getWallet();
|
|
126
|
-
const value =
|
|
126
|
+
const value = tx_6.MsgCreateMarket.fromPartial({
|
|
127
127
|
creator: wallet.bech32Address,
|
|
128
128
|
marketType: params.marketType,
|
|
129
129
|
base: params.base,
|
|
@@ -144,7 +144,7 @@ class AdminModule extends base_1.default {
|
|
|
144
144
|
const wallet = this.getWallet();
|
|
145
145
|
const msgs = params.map((param) => {
|
|
146
146
|
var _a;
|
|
147
|
-
const value =
|
|
147
|
+
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 }));
|
|
148
148
|
return {
|
|
149
149
|
typeUrl: util_1.CarbonTx.Types.MsgCreateMarket,
|
|
150
150
|
value,
|
|
@@ -153,10 +153,20 @@ class AdminModule extends base_1.default {
|
|
|
153
153
|
return yield wallet.sendTxs(msgs, opts);
|
|
154
154
|
});
|
|
155
155
|
}
|
|
156
|
+
createVaultType(params, opts) {
|
|
157
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
158
|
+
const wallet = this.getWallet();
|
|
159
|
+
const value = tx_1.MsgCreateVaultType.fromPartial(transfromCreateVaultTypeParams(params, wallet.bech32Address));
|
|
160
|
+
return yield wallet.sendTx({
|
|
161
|
+
typeUrl: util_1.CarbonTx.Types.MsgCreateVaultType,
|
|
162
|
+
value,
|
|
163
|
+
}, opts);
|
|
164
|
+
});
|
|
165
|
+
}
|
|
156
166
|
linkPool(params, opts) {
|
|
157
167
|
return __awaiter(this, void 0, void 0, function* () {
|
|
158
168
|
const wallet = this.getWallet();
|
|
159
|
-
const value =
|
|
169
|
+
const value = tx_5.MsgLinkPool.fromPartial({
|
|
160
170
|
creator: wallet.bech32Address,
|
|
161
171
|
linkPoolParams: transfromLinkPoolParams(params)
|
|
162
172
|
});
|
|
@@ -169,7 +179,7 @@ class AdminModule extends base_1.default {
|
|
|
169
179
|
unlinkPool(params, opts) {
|
|
170
180
|
return __awaiter(this, void 0, void 0, function* () {
|
|
171
181
|
const wallet = this.getWallet();
|
|
172
|
-
const value =
|
|
182
|
+
const value = tx_5.MsgUnlinkPool.fromPartial({
|
|
173
183
|
creator: wallet.bech32Address,
|
|
174
184
|
unlinkPoolParams: transfromUnlinkPoolParams(params)
|
|
175
185
|
});
|
|
@@ -182,7 +192,7 @@ class AdminModule extends base_1.default {
|
|
|
182
192
|
setRewardsWeights(params, opts) {
|
|
183
193
|
return __awaiter(this, void 0, void 0, function* () {
|
|
184
194
|
const wallet = this.getWallet();
|
|
185
|
-
const value =
|
|
195
|
+
const value = tx_5.MsgSetRewardsWeights.fromPartial({
|
|
186
196
|
creator: wallet.bech32Address,
|
|
187
197
|
setRewardsWeightsParams: transfromSetRewardsWeightsParams(params)
|
|
188
198
|
});
|
|
@@ -195,7 +205,7 @@ class AdminModule extends base_1.default {
|
|
|
195
205
|
setRewardCurve(params, opts) {
|
|
196
206
|
return __awaiter(this, void 0, void 0, function* () {
|
|
197
207
|
const wallet = this.getWallet();
|
|
198
|
-
const value =
|
|
208
|
+
const value = tx_5.MsgSetRewardCurve.fromPartial({
|
|
199
209
|
creator: wallet.bech32Address,
|
|
200
210
|
setRewardCurveParams: transfromSetRewardCurveParams(params)
|
|
201
211
|
});
|
|
@@ -208,7 +218,7 @@ class AdminModule extends base_1.default {
|
|
|
208
218
|
setCommitmentCurve(params, opts) {
|
|
209
219
|
return __awaiter(this, void 0, void 0, function* () {
|
|
210
220
|
const wallet = this.getWallet();
|
|
211
|
-
const value =
|
|
221
|
+
const value = tx_5.MsgSetCommitmentCurve.fromPartial({
|
|
212
222
|
creator: wallet.bech32Address,
|
|
213
223
|
setCommitmentCurveParams: transfromSetCommitmentCurveParams(params)
|
|
214
224
|
});
|
|
@@ -221,7 +231,7 @@ class AdminModule extends base_1.default {
|
|
|
221
231
|
updatePool(params, opts) {
|
|
222
232
|
return __awaiter(this, void 0, void 0, function* () {
|
|
223
233
|
const wallet = this.getWallet();
|
|
224
|
-
const value =
|
|
234
|
+
const value = tx_5.MsgUpdatePool.fromPartial({
|
|
225
235
|
creator: wallet.bech32Address,
|
|
226
236
|
updatePoolParams: transfromUpdatePoolParams(params),
|
|
227
237
|
});
|
|
@@ -234,7 +244,7 @@ class AdminModule extends base_1.default {
|
|
|
234
244
|
setTradingFlag(params, opts) {
|
|
235
245
|
return __awaiter(this, void 0, void 0, function* () {
|
|
236
246
|
const wallet = this.getWallet();
|
|
237
|
-
const value =
|
|
247
|
+
const value = tx_8.MsgSetTradingFlag.fromPartial(transfromSetTradingFlagParams(params, wallet.bech32Address));
|
|
238
248
|
return yield wallet.sendTx({
|
|
239
249
|
typeUrl: util_1.CarbonTx.Types.MsgSetTradingFlag,
|
|
240
250
|
value,
|
|
@@ -249,7 +259,7 @@ class AdminModule extends base_1.default {
|
|
|
249
259
|
setMsgGasCost(params, opts) {
|
|
250
260
|
return __awaiter(this, void 0, void 0, function* () {
|
|
251
261
|
const wallet = this.getWallet();
|
|
252
|
-
const value =
|
|
262
|
+
const value = tx_4.MsgSetGasCost.fromPartial({
|
|
253
263
|
creator: wallet.bech32Address,
|
|
254
264
|
setGasCostParams: transfromSetMsgGasCostParams(params)
|
|
255
265
|
});
|
|
@@ -262,7 +272,7 @@ class AdminModule extends base_1.default {
|
|
|
262
272
|
setMinGasPrice(params, opts) {
|
|
263
273
|
return __awaiter(this, void 0, void 0, function* () {
|
|
264
274
|
const wallet = this.getWallet();
|
|
265
|
-
const value =
|
|
275
|
+
const value = tx_4.MsgSetMinGasPrice.fromPartial({
|
|
266
276
|
creator: wallet.bech32Address,
|
|
267
277
|
setMinGasPriceParams: transfromSetMinGasPriceParams(params)
|
|
268
278
|
});
|
|
@@ -275,7 +285,7 @@ class AdminModule extends base_1.default {
|
|
|
275
285
|
removeMsgGasCost(params, opts) {
|
|
276
286
|
return __awaiter(this, void 0, void 0, function* () {
|
|
277
287
|
const wallet = this.getWallet();
|
|
278
|
-
const value =
|
|
288
|
+
const value = tx_4.MsgRemoveGasCost.fromPartial({
|
|
279
289
|
creator: wallet.bech32Address,
|
|
280
290
|
msgType: params.msgType,
|
|
281
291
|
});
|
|
@@ -288,7 +298,7 @@ class AdminModule extends base_1.default {
|
|
|
288
298
|
removeMinGasPrice(params, opts) {
|
|
289
299
|
return __awaiter(this, void 0, void 0, function* () {
|
|
290
300
|
const wallet = this.getWallet();
|
|
291
|
-
const value =
|
|
301
|
+
const value = tx_4.MsgRemoveMinGasPrice.fromPartial({
|
|
292
302
|
creator: wallet.bech32Address,
|
|
293
303
|
denom: params.denom,
|
|
294
304
|
});
|
|
@@ -301,7 +311,7 @@ class AdminModule extends base_1.default {
|
|
|
301
311
|
createValidator(params, opts) {
|
|
302
312
|
return __awaiter(this, void 0, void 0, function* () {
|
|
303
313
|
const wallet = this.getWallet();
|
|
304
|
-
const value =
|
|
314
|
+
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 && {
|
|
305
315
|
commission: {
|
|
306
316
|
rate: params.commission.rate.shiftedBy(18).toString(10),
|
|
307
317
|
maxRate: params.commission.maxRate.shiftedBy(18).toString(10),
|
|
@@ -322,7 +332,7 @@ class AdminModule extends base_1.default {
|
|
|
322
332
|
editValidator(params, opts) {
|
|
323
333
|
return __awaiter(this, void 0, void 0, function* () {
|
|
324
334
|
const wallet = this.getWallet();
|
|
325
|
-
const value =
|
|
335
|
+
const value = tx_3.MsgEditValidator.fromPartial({
|
|
326
336
|
description: params.description,
|
|
327
337
|
validatorAddress: params.validatorAddress,
|
|
328
338
|
commissionRate: params.commissionRate.shiftedBy(18).toString(10),
|
|
@@ -337,7 +347,7 @@ class AdminModule extends base_1.default {
|
|
|
337
347
|
authorizeBridge(params, opts) {
|
|
338
348
|
return __awaiter(this, void 0, void 0, function* () {
|
|
339
349
|
const wallet = this.getWallet();
|
|
340
|
-
const value =
|
|
350
|
+
const value = tx_2.MsgAuthorizeBridge.fromPartial({
|
|
341
351
|
creator: wallet.bech32Address,
|
|
342
352
|
bridgeId: new long_1.default(params.bridgeId),
|
|
343
353
|
chainId: new long_1.default(params.chainId),
|
|
@@ -352,7 +362,7 @@ class AdminModule extends base_1.default {
|
|
|
352
362
|
deauthorizeBridge(params, opts) {
|
|
353
363
|
return __awaiter(this, void 0, void 0, function* () {
|
|
354
364
|
const wallet = this.getWallet();
|
|
355
|
-
const value =
|
|
365
|
+
const value = tx_2.MsgDeauthorizeBridge.fromPartial({
|
|
356
366
|
initiator: wallet.bech32Address,
|
|
357
367
|
bridgeId: new long_1.default(params.bridgeId),
|
|
358
368
|
chainId: new long_1.default(params.chainId),
|
|
@@ -363,148 +373,6 @@ class AdminModule extends base_1.default {
|
|
|
363
373
|
}, opts);
|
|
364
374
|
});
|
|
365
375
|
}
|
|
366
|
-
addRateStrategy(params, opts) {
|
|
367
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
368
|
-
const wallet = this.getWallet();
|
|
369
|
-
const value = codec_1.MsgAddRateStrategy.fromPartial({
|
|
370
|
-
creator: wallet.bech32Address,
|
|
371
|
-
rateStrategyParams: {
|
|
372
|
-
name: params.rateStrategy.name,
|
|
373
|
-
optimalUsage: params.rateStrategy.optimalUsage.toString(10),
|
|
374
|
-
baseVariableBorrowRate: params.rateStrategy.baseVariableBorrowRate.toString(10),
|
|
375
|
-
variableRateSlope1: params.rateStrategy.variableRateSlope1.toString(10),
|
|
376
|
-
variableRateSlope2: params.rateStrategy.variableRateSlope2.toString(10),
|
|
377
|
-
baseStableBorrowRate: params.rateStrategy.baseStableBorrowRate.toString(10),
|
|
378
|
-
stableRateSlope1: params.rateStrategy.stableRateSlope1.toString(10),
|
|
379
|
-
stableRateSlope2: params.rateStrategy.stableRateSlope2.toString(10),
|
|
380
|
-
optimalStableToTotalDebtRatio: params.rateStrategy.optimalStableToTotalDebtRatio.toString(10),
|
|
381
|
-
},
|
|
382
|
-
});
|
|
383
|
-
return yield wallet.sendTx({
|
|
384
|
-
typeUrl: util_1.CarbonTx.Types.MsgAddRateStrategy,
|
|
385
|
-
value
|
|
386
|
-
}, opts);
|
|
387
|
-
});
|
|
388
|
-
}
|
|
389
|
-
updateRateStrategy(params, opts) {
|
|
390
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
391
|
-
const wallet = this.getWallet();
|
|
392
|
-
const value = codec_1.MsgUpdateRateStrategy.fromPartial({
|
|
393
|
-
creator: wallet.bech32Address,
|
|
394
|
-
rateStrategyParams: {
|
|
395
|
-
name: params.rateStrategy.name,
|
|
396
|
-
optimalUsage: params.rateStrategy.optimalUsage.toString(10),
|
|
397
|
-
baseVariableBorrowRate: params.rateStrategy.baseVariableBorrowRate.toString(10),
|
|
398
|
-
variableRateSlope1: params.rateStrategy.variableRateSlope1.toString(10),
|
|
399
|
-
variableRateSlope2: params.rateStrategy.variableRateSlope2.toString(10),
|
|
400
|
-
baseStableBorrowRate: params.rateStrategy.baseStableBorrowRate.toString(10),
|
|
401
|
-
stableRateSlope1: params.rateStrategy.stableRateSlope1.toString(10),
|
|
402
|
-
stableRateSlope2: params.rateStrategy.stableRateSlope2.toString(10),
|
|
403
|
-
optimalStableToTotalDebtRatio: params.rateStrategy.optimalStableToTotalDebtRatio.toString(10),
|
|
404
|
-
},
|
|
405
|
-
});
|
|
406
|
-
return yield wallet.sendTx({
|
|
407
|
-
typeUrl: util_1.CarbonTx.Types.MsgUpdateRateStrategy,
|
|
408
|
-
value
|
|
409
|
-
}, opts);
|
|
410
|
-
});
|
|
411
|
-
}
|
|
412
|
-
removeRateStrategy(params, opts) {
|
|
413
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
414
|
-
const wallet = this.getWallet();
|
|
415
|
-
const value = codec_1.MsgRemoveRateStrategy.fromPartial({
|
|
416
|
-
creator: wallet.bech32Address,
|
|
417
|
-
name: params.name,
|
|
418
|
-
});
|
|
419
|
-
return yield wallet.sendTx({
|
|
420
|
-
typeUrl: util_1.CarbonTx.Types.MsgRemoveRateStrategy,
|
|
421
|
-
value
|
|
422
|
-
}, opts);
|
|
423
|
-
});
|
|
424
|
-
}
|
|
425
|
-
addAsset(params, opts) {
|
|
426
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
427
|
-
const wallet = this.getWallet();
|
|
428
|
-
const value = codec_1.MsgAddAsset.fromPartial({
|
|
429
|
-
creator: wallet.bech32Address,
|
|
430
|
-
assetParams: {
|
|
431
|
-
denom: params.asset.denom,
|
|
432
|
-
oracleId: params.asset.oracleId,
|
|
433
|
-
rateStrategyName: params.asset.rateStrategyName,
|
|
434
|
-
loanToValue: params.asset.loanToValue.toString(10),
|
|
435
|
-
liquidationThreshold: params.asset.liquidationThreshold.toString(10),
|
|
436
|
-
liquidationBonus: params.asset.liquidationBonus.toString(10),
|
|
437
|
-
supplyCap: params.asset.supplyCap.toString(10),
|
|
438
|
-
borrowCap: params.asset.borrowCap.toString(10),
|
|
439
|
-
}
|
|
440
|
-
});
|
|
441
|
-
return yield wallet.sendTx({
|
|
442
|
-
typeUrl: util_1.CarbonTx.Types.MsgAddAsset,
|
|
443
|
-
value
|
|
444
|
-
}, opts);
|
|
445
|
-
});
|
|
446
|
-
}
|
|
447
|
-
updateAsset(params, opts) {
|
|
448
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
449
|
-
const wallet = this.getWallet();
|
|
450
|
-
const value = codec_1.MsgUpdateAsset.fromPartial({
|
|
451
|
-
creator: wallet.bech32Address,
|
|
452
|
-
assetParams: {
|
|
453
|
-
denom: params.asset.denom,
|
|
454
|
-
oracleId: params.asset.oracleId,
|
|
455
|
-
rateStrategyName: params.asset.rateStrategyName,
|
|
456
|
-
loanToValue: params.asset.loanToValue.toString(10),
|
|
457
|
-
liquidationThreshold: params.asset.liquidationThreshold.toString(10),
|
|
458
|
-
liquidationBonus: params.asset.liquidationBonus.toString(10),
|
|
459
|
-
supplyCap: params.asset.supplyCap.toString(10),
|
|
460
|
-
borrowCap: params.asset.borrowCap.toString(10),
|
|
461
|
-
}
|
|
462
|
-
});
|
|
463
|
-
return yield wallet.sendTx({
|
|
464
|
-
typeUrl: util_1.CarbonTx.Types.MsgUpdateAsset,
|
|
465
|
-
value
|
|
466
|
-
}, opts);
|
|
467
|
-
});
|
|
468
|
-
}
|
|
469
|
-
setLiquidationFee(params, opts) {
|
|
470
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
471
|
-
const wallet = this.getWallet();
|
|
472
|
-
const value = codec_1.MsgSetLiquidationFee.fromPartial({
|
|
473
|
-
creator: wallet.bech32Address,
|
|
474
|
-
liquidationFee: params.liquidationFee.toString(10),
|
|
475
|
-
});
|
|
476
|
-
return yield wallet.sendTx({
|
|
477
|
-
typeUrl: util_1.CarbonTx.Types.MsgSetLiquidationFee,
|
|
478
|
-
value
|
|
479
|
-
}, opts);
|
|
480
|
-
});
|
|
481
|
-
}
|
|
482
|
-
setInterestFee(params, opts) {
|
|
483
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
484
|
-
const wallet = this.getWallet();
|
|
485
|
-
const value = codec_1.MsgSetInterestFee.fromPartial({
|
|
486
|
-
creator: wallet.bech32Address,
|
|
487
|
-
interestFee: params.interestFee.toString(10),
|
|
488
|
-
});
|
|
489
|
-
return yield wallet.sendTx({
|
|
490
|
-
typeUrl: util_1.CarbonTx.Types.MsgSetInterestFee,
|
|
491
|
-
value
|
|
492
|
-
}, opts);
|
|
493
|
-
});
|
|
494
|
-
}
|
|
495
|
-
setStableCoinInterestRate(params, opts) {
|
|
496
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
497
|
-
const wallet = this.getWallet();
|
|
498
|
-
const value = codec_1.MsgSetStablecoinInterestRate.fromPartial({
|
|
499
|
-
creator: wallet.bech32Address,
|
|
500
|
-
stablecoinInterestRate: params.stablecoinInterestRate.toString(10),
|
|
501
|
-
});
|
|
502
|
-
return yield wallet.sendTx({
|
|
503
|
-
typeUrl: util_1.CarbonTx.Types.MsgSetStablecoinInterestRate,
|
|
504
|
-
value
|
|
505
|
-
}, opts);
|
|
506
|
-
});
|
|
507
|
-
}
|
|
508
376
|
}
|
|
509
377
|
exports.AdminModule = AdminModule;
|
|
510
378
|
;
|
package/lib/modules/cdp.d.ts
CHANGED
|
@@ -2,69 +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>;
|
|
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>;
|
|
17
9
|
}
|
|
18
10
|
export declare namespace CDPModule {
|
|
19
|
-
interface
|
|
20
|
-
|
|
11
|
+
interface AddCollateralParams {
|
|
12
|
+
vaultTypeId: number;
|
|
21
13
|
amount: BigNumber;
|
|
22
14
|
}
|
|
23
|
-
interface
|
|
24
|
-
|
|
15
|
+
interface RemoveCollateralParams {
|
|
16
|
+
vaultTypeId: number;
|
|
25
17
|
amount: BigNumber;
|
|
26
18
|
}
|
|
27
|
-
interface
|
|
28
|
-
|
|
19
|
+
interface AddDebtParams {
|
|
20
|
+
vaultTypeId: number;
|
|
29
21
|
amount: BigNumber;
|
|
30
22
|
}
|
|
31
|
-
interface
|
|
32
|
-
|
|
33
|
-
amount: BigNumber;
|
|
34
|
-
}
|
|
35
|
-
interface BorrowAssetParams {
|
|
36
|
-
denom: string;
|
|
37
|
-
amount: BigNumber;
|
|
38
|
-
}
|
|
39
|
-
interface RepayAssetParams {
|
|
40
|
-
denom: string;
|
|
41
|
-
amount: BigNumber;
|
|
42
|
-
}
|
|
43
|
-
interface SupplyAssetAndLockCollateralParams {
|
|
44
|
-
denom: string;
|
|
45
|
-
supplyAmount: BigNumber;
|
|
46
|
-
lockAmount: BigNumber;
|
|
47
|
-
}
|
|
48
|
-
interface UnlockCollateralAndWithdrawAssetParams {
|
|
49
|
-
cdpDenom: string;
|
|
50
|
-
unlockAmount: BigNumber;
|
|
51
|
-
withdrawAmount: BigNumber;
|
|
52
|
-
}
|
|
53
|
-
interface LiquidateCollateralParams {
|
|
54
|
-
debtor: string;
|
|
55
|
-
collateralDenom: string;
|
|
56
|
-
debtDenom: string;
|
|
57
|
-
debtAmount: BigNumber;
|
|
58
|
-
}
|
|
59
|
-
interface RepayAssetWithCdpTokensParams {
|
|
60
|
-
cdpDenom: string;
|
|
61
|
-
amount: BigNumber;
|
|
62
|
-
}
|
|
63
|
-
interface RepayAssetWithCollateralParams {
|
|
64
|
-
cdpDenom: string;
|
|
65
|
-
amount: BigNumber;
|
|
66
|
-
}
|
|
67
|
-
interface MintStablecoinParams {
|
|
23
|
+
interface RemoveDebtParams {
|
|
24
|
+
vaultTypeId: number;
|
|
68
25
|
amount: BigNumber;
|
|
69
26
|
}
|
|
70
27
|
}
|
package/lib/modules/cdp.js
CHANGED
|
@@ -16,174 +16,60 @@ exports.CDPModule = void 0;
|
|
|
16
16
|
const tx_1 = require("../codec/cdp/tx");
|
|
17
17
|
const util_1 = require("../util");
|
|
18
18
|
const base_1 = __importDefault(require("./base"));
|
|
19
|
+
const long_1 = __importDefault(require("long"));
|
|
19
20
|
class CDPModule extends base_1.default {
|
|
20
|
-
|
|
21
|
+
addCollateral(params, opts) {
|
|
21
22
|
return __awaiter(this, void 0, void 0, function* () {
|
|
22
23
|
const wallet = this.getWallet();
|
|
23
|
-
const value = tx_1.
|
|
24
|
+
const value = tx_1.MsgAddCollateral.fromPartial({
|
|
24
25
|
creator: wallet.bech32Address,
|
|
25
|
-
|
|
26
|
+
vaultTypeId: new long_1.default(params.vaultTypeId),
|
|
26
27
|
amount: params.amount.toString(10),
|
|
27
28
|
});
|
|
28
29
|
return yield wallet.sendTx({
|
|
29
|
-
typeUrl: util_1.CarbonTx.Types.
|
|
30
|
-
value
|
|
31
|
-
}, opts);
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
withdrawAsset(params, opts) {
|
|
35
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
-
const wallet = this.getWallet();
|
|
37
|
-
const value = tx_1.MsgWithdrawAsset.fromPartial({
|
|
38
|
-
creator: wallet.bech32Address,
|
|
39
|
-
cdpDenom: params.cdpDenom,
|
|
40
|
-
amount: params.amount.toString(10),
|
|
41
|
-
});
|
|
42
|
-
return yield wallet.sendTx({
|
|
43
|
-
typeUrl: util_1.CarbonTx.Types.MsgWithdrawAsset,
|
|
44
|
-
value
|
|
45
|
-
}, opts);
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
lockCollateral(params, opts) {
|
|
49
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
50
|
-
const wallet = this.getWallet();
|
|
51
|
-
const value = tx_1.MsgLockCollateral.fromPartial({
|
|
52
|
-
creator: wallet.bech32Address,
|
|
53
|
-
cdpDenom: params.cdpDenom,
|
|
54
|
-
amount: params.amount.toString(10),
|
|
55
|
-
});
|
|
56
|
-
return yield wallet.sendTx({
|
|
57
|
-
typeUrl: util_1.CarbonTx.Types.MsgLockCollateral,
|
|
58
|
-
value
|
|
59
|
-
}, opts);
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
unlockCollateral(params, opts) {
|
|
63
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
64
|
-
const wallet = this.getWallet();
|
|
65
|
-
const value = tx_1.MsgUnlockCollateral.fromPartial({
|
|
66
|
-
creator: wallet.bech32Address,
|
|
67
|
-
cdpDenom: params.cdpDenom,
|
|
68
|
-
amount: params.amount.toString(10),
|
|
69
|
-
});
|
|
70
|
-
return yield wallet.sendTx({
|
|
71
|
-
typeUrl: util_1.CarbonTx.Types.MsgUnlockCollateral,
|
|
72
|
-
value
|
|
73
|
-
}, opts);
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
borrowAsset(params, opts) {
|
|
77
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
78
|
-
const wallet = this.getWallet();
|
|
79
|
-
const value = tx_1.MsgBorrowAsset.fromPartial({
|
|
80
|
-
creator: wallet.bech32Address,
|
|
81
|
-
denom: params.denom,
|
|
82
|
-
amount: params.amount.toString(10),
|
|
83
|
-
});
|
|
84
|
-
return yield wallet.sendTx({
|
|
85
|
-
typeUrl: util_1.CarbonTx.Types.MsgBorrowAsset,
|
|
86
|
-
value
|
|
87
|
-
}, opts);
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
repayAsset(params, opts) {
|
|
91
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
92
|
-
const wallet = this.getWallet();
|
|
93
|
-
const value = tx_1.MsgRepayAsset.fromPartial({
|
|
94
|
-
creator: wallet.bech32Address,
|
|
95
|
-
denom: params.denom,
|
|
96
|
-
amount: params.amount.toString(10),
|
|
97
|
-
});
|
|
98
|
-
return yield wallet.sendTx({
|
|
99
|
-
typeUrl: util_1.CarbonTx.Types.MsgRepayAsset,
|
|
100
|
-
value
|
|
101
|
-
}, opts);
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
supplyAssetAndLockCollateral(params, opts) {
|
|
105
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
106
|
-
const wallet = this.getWallet();
|
|
107
|
-
const value = tx_1.MsgSupplyAssetAndLockCollateral.fromPartial({
|
|
108
|
-
creator: wallet.bech32Address,
|
|
109
|
-
denom: params.denom,
|
|
110
|
-
supplyAmount: params.supplyAmount.toString(10),
|
|
111
|
-
lockAmount: params.lockAmount.toString(10),
|
|
112
|
-
});
|
|
113
|
-
return yield wallet.sendTx({
|
|
114
|
-
typeUrl: util_1.CarbonTx.Types.MsgSupplyAssetAndLockCollateral,
|
|
115
|
-
value
|
|
116
|
-
}, opts);
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
unlockCollateralAndWithdrawAsset(params, opts) {
|
|
120
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
121
|
-
const wallet = this.getWallet();
|
|
122
|
-
const value = tx_1.MsgUnlockCollateralAndWithdrawAsset.fromPartial({
|
|
123
|
-
creator: wallet.bech32Address,
|
|
124
|
-
cdpDenom: params.cdpDenom,
|
|
125
|
-
unlockAmount: params.unlockAmount.toString(10),
|
|
126
|
-
withdrawAmount: params.withdrawAmount.toString(10),
|
|
127
|
-
});
|
|
128
|
-
return yield wallet.sendTx({
|
|
129
|
-
typeUrl: util_1.CarbonTx.Types.MsgUnlockCollateralAndWithdrawAsset,
|
|
130
|
-
value
|
|
131
|
-
}, opts);
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
liquidateCollateral(params, opts) {
|
|
135
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
136
|
-
const wallet = this.getWallet();
|
|
137
|
-
const value = tx_1.MsgLiquidateCollateral.fromPartial({
|
|
138
|
-
creator: wallet.bech32Address,
|
|
139
|
-
debtor: params.debtor,
|
|
140
|
-
collateralDenom: params.collateralDenom,
|
|
141
|
-
debtDenom: params.debtDenom,
|
|
142
|
-
debtAmount: params.debtAmount.toString(10),
|
|
143
|
-
});
|
|
144
|
-
return yield wallet.sendTx({
|
|
145
|
-
typeUrl: util_1.CarbonTx.Types.MsgLiquidateCollateral,
|
|
146
|
-
value
|
|
30
|
+
typeUrl: util_1.CarbonTx.Types.MsgAddCollateral,
|
|
31
|
+
value,
|
|
147
32
|
}, opts);
|
|
148
33
|
});
|
|
149
34
|
}
|
|
150
|
-
|
|
35
|
+
removeCollateral(params, opts) {
|
|
151
36
|
return __awaiter(this, void 0, void 0, function* () {
|
|
152
37
|
const wallet = this.getWallet();
|
|
153
|
-
const value = tx_1.
|
|
38
|
+
const value = tx_1.MsgRemoveCollateral.fromPartial({
|
|
154
39
|
creator: wallet.bech32Address,
|
|
155
|
-
|
|
40
|
+
vaultTypeId: new long_1.default(params.vaultTypeId),
|
|
156
41
|
amount: params.amount.toString(10),
|
|
157
42
|
});
|
|
158
43
|
return yield wallet.sendTx({
|
|
159
|
-
typeUrl: util_1.CarbonTx.Types.
|
|
160
|
-
value
|
|
44
|
+
typeUrl: util_1.CarbonTx.Types.MsgRemoveCollateral,
|
|
45
|
+
value,
|
|
161
46
|
}, opts);
|
|
162
47
|
});
|
|
163
48
|
}
|
|
164
|
-
|
|
49
|
+
addDebt(params, opts) {
|
|
165
50
|
return __awaiter(this, void 0, void 0, function* () {
|
|
166
51
|
const wallet = this.getWallet();
|
|
167
|
-
const value = tx_1.
|
|
52
|
+
const value = tx_1.MsgAddDebt.fromPartial({
|
|
168
53
|
creator: wallet.bech32Address,
|
|
169
|
-
|
|
54
|
+
vaultTypeId: new long_1.default(params.vaultTypeId),
|
|
170
55
|
amount: params.amount.toString(10),
|
|
171
56
|
});
|
|
172
57
|
return yield wallet.sendTx({
|
|
173
|
-
typeUrl: util_1.CarbonTx.Types.
|
|
174
|
-
value
|
|
58
|
+
typeUrl: util_1.CarbonTx.Types.MsgAddDebt,
|
|
59
|
+
value,
|
|
175
60
|
}, opts);
|
|
176
61
|
});
|
|
177
62
|
}
|
|
178
|
-
|
|
63
|
+
removeDebt(params, opts) {
|
|
179
64
|
return __awaiter(this, void 0, void 0, function* () {
|
|
180
65
|
const wallet = this.getWallet();
|
|
181
|
-
const value = tx_1.
|
|
66
|
+
const value = tx_1.MsgRemoveDebt.fromPartial({
|
|
182
67
|
creator: wallet.bech32Address,
|
|
68
|
+
vaultTypeId: new long_1.default(params.vaultTypeId),
|
|
183
69
|
amount: params.amount.toString(10),
|
|
184
70
|
});
|
|
185
71
|
return yield wallet.sendTx({
|
|
186
|
-
typeUrl: util_1.CarbonTx.Types.
|
|
72
|
+
typeUrl: util_1.CarbonTx.Types.MsgRemoveDebt,
|
|
187
73
|
value,
|
|
188
74
|
}, opts);
|
|
189
75
|
});
|