carbon-js-sdk 0.2.16-dev.4 → 0.2.17
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/CarbonSDK.d.ts +1 -13
- package/lib/CarbonSDK.js +2 -31
- package/lib/clients/CarbonQueryClient.js +2 -2
- package/lib/clients/ETHClient.d.ts +1 -1
- package/lib/clients/ETHClient.js +15 -15
- package/lib/clients/HydrogenClient.js +1 -1
- package/lib/clients/N3Client.js +2 -3
- package/lib/clients/NEOClient.d.ts +1 -1
- package/lib/clients/NEOClient.js +7 -7
- package/lib/clients/TokenClient.d.ts +0 -5
- package/lib/clients/TokenClient.js +10 -38
- package/lib/clients/ZILClient.d.ts +1 -1
- package/lib/clients/ZILClient.js +16 -16
- 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 -389
- package/lib/codec/cdp/event.js +83 -2494
- package/lib/codec/cdp/genesis.d.ts +4 -97
- package/lib/codec/cdp/genesis.js +23 -648
- package/lib/codec/cdp/query.d.ts +89 -439
- package/lib/codec/cdp/query.js +173 -1991
- package/lib/codec/cdp/tx.d.ts +96 -760
- package/lib/codec/cdp/tx.js +235 -3645
- 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/genesis.d.ts +1 -1
- package/lib/codec/cosmos/authz/v1beta1/genesis.js +1 -1
- 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 +4 -4
- package/lib/codec/cosmos/gov/v1beta1/tx.d.ts +2 -2
- package/lib/codec/cosmos/gov/v1beta1/tx.js +4 -4
- 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 +5 -5
- 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 +18 -89
- package/lib/codec/index.js +180 -463
- 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/liquiditypool.d.ts +0 -3
- package/lib/codec/liquiditypool/liquiditypool.js +1 -44
- 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 -39
- package/lib/codec/liquiditypool/query.js +3 -195
- package/lib/codec/liquiditypool/tx.d.ts +1 -3
- package/lib/codec/liquiditypool/tx.js +1 -35
- 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 -4
- package/lib/codec/oracle/genesis.js +3 -34
- 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 -56
- package/lib/codec/pricing/event.js +2 -298
- 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 -14
- package/lib/codec/pricing/pricing.js +1 -103
- package/lib/codec/pricing/query.d.ts +1 -68
- package/lib/codec/pricing/query.js +2 -321
- package/lib/codec/pricing/tx.d.ts +0 -96
- package/lib/codec/pricing/tx.js +1 -399
- 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/constant/generic.js +1 -1
- package/lib/constant/token.d.ts +0 -4
- package/lib/constant/token.js +1 -5
- package/lib/modules/admin.d.ts +7 -114
- package/lib/modules/admin.js +53 -275
- package/lib/modules/cdp.d.ts +13 -152
- package/lib/modules/cdp.js +20 -800
- package/lib/modules/gov.js +14 -14
- package/lib/modules/liquiditypool.d.ts +0 -3
- package/lib/modules/liquiditypool.js +1 -3
- package/lib/provider/account/EthLedgerAccount/EthLedgerAccount.js +1 -1
- package/lib/provider/account/NeoLedgerAccount/N3Ledger/ErrorCode.js +1 -1
- package/lib/provider/account/NeoLedgerAccount/N3Ledger/main.js +8 -8
- package/lib/provider/account/NeoLedgerAccount/NeoLedgerAccount.js +3 -3
- package/lib/provider/account/NeoLedgerAccount/NeonLedger.js +1 -1
- package/lib/provider/amino/types/admin.js +26 -91
- package/lib/provider/amino/types/bank.js +1 -1
- package/lib/provider/amino/types/broker.js +1 -1
- package/lib/provider/amino/types/cdp.js +24 -135
- package/lib/provider/amino/types/coin.js +2 -2
- package/lib/provider/amino/types/gov.js +4 -4
- package/lib/provider/amino/types/ibc.js +1 -1
- package/lib/provider/amino/types/leverage.js +1 -1
- package/lib/provider/amino/types/liquidityPool.js +7 -9
- package/lib/provider/amino/types/market.js +1 -1
- package/lib/provider/amino/types/oracle.js +1 -1
- package/lib/provider/amino/types/order.js +4 -4
- package/lib/provider/amino/types/position.js +1 -1
- package/lib/provider/amino/types/profile.js +1 -1
- package/lib/provider/amino/types/staking.js +4 -4
- package/lib/provider/amino/types/subaccount.js +3 -3
- package/lib/provider/amino/utils.js +11 -11
- package/lib/provider/keplr/KeplrStore.js +1 -1
- package/lib/provider/ledger/ledger.js +2 -2
- package/lib/provider/metamask/MetaMask.js +1 -1
- package/lib/provider/o3/O3Wallet.js +2 -2
- package/lib/util/address.d.ts +0 -1
- package/lib/util/address.js +13 -21
- package/lib/util/api.js +4 -4
- package/lib/util/fetch.js +1 -1
- package/lib/util/generic.js +3 -3
- package/lib/util/number.d.ts +0 -1
- package/lib/util/number.js +6 -7
- package/lib/util/tx.d.ts +10 -74
- package/lib/wallet/CarbonSigner.js +2 -2
- package/lib/wallet/CarbonSigningClient.js +8 -8
- package/lib/wallet/CarbonWallet.js +7 -6
- package/lib/websocket/channel.js +21 -115
- package/lib/websocket/connector.js +3 -3
- package/lib/websocket/models.d.ts +0 -156
- package/lib/websocket/types.d.ts +3 -87
- package/lib/websocket/types.js +0 -31
- package/package.json +1 -1
package/lib/modules/admin.js
CHANGED
|
@@ -12,15 +12,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
const
|
|
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 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,213 +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
|
-
liquidationDiscount: params.asset.liquidationDiscount.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
|
-
liquidationDiscount: params.asset.liquidationDiscount.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
|
-
setCompleteLiquidationThreshold(params, opts) {
|
|
528
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
529
|
-
const wallet = this.getWallet();
|
|
530
|
-
const value = codec_1.MsgSetCompleteLiquidationThreshold.fromPartial({
|
|
531
|
-
creator: wallet.bech32Address,
|
|
532
|
-
completeLiquidationThreshold: params.completeLiquidationThreshold.shiftedBy(18).toString(10),
|
|
533
|
-
});
|
|
534
|
-
return yield wallet.sendTx({
|
|
535
|
-
typeUrl: util_1.CarbonTx.Types.MsgSetCompleteLiquidationThreshold,
|
|
536
|
-
value,
|
|
537
|
-
}, opts);
|
|
538
|
-
});
|
|
539
|
-
}
|
|
540
|
-
setMinimumCloseFactor(params, opts) {
|
|
541
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
542
|
-
const wallet = this.getWallet();
|
|
543
|
-
const value = codec_1.MsgSetMinimumCloseFactor.fromPartial({
|
|
544
|
-
creator: wallet.bech32Address,
|
|
545
|
-
minimumCloseFactor: params.minimumCloseFactor.shiftedBy(18).toString(10),
|
|
546
|
-
});
|
|
547
|
-
return yield wallet.sendTx({
|
|
548
|
-
typeUrl: util_1.CarbonTx.Types.MsgSetMinimumCloseFactor,
|
|
549
|
-
value,
|
|
550
|
-
}, opts);
|
|
551
|
-
});
|
|
552
|
-
}
|
|
553
|
-
setSmallLiquidationSize(params, opts) {
|
|
554
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
555
|
-
const wallet = this.getWallet();
|
|
556
|
-
const value = codec_1.MsgSetSmallLiquidationSize.fromPartial({
|
|
557
|
-
creator: wallet.bech32Address,
|
|
558
|
-
smallLiquidationSize: params.smallLiquidationSize.shiftedBy(18).toString(10),
|
|
559
|
-
});
|
|
560
|
-
return yield wallet.sendTx({
|
|
561
|
-
typeUrl: util_1.CarbonTx.Types.MsgSetSmallLiquidationSize,
|
|
562
|
-
value,
|
|
563
|
-
}, opts);
|
|
564
|
-
});
|
|
565
|
-
}
|
|
566
|
-
createRewardScheme(params, opts) {
|
|
567
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
568
|
-
const wallet = this.getWallet();
|
|
569
|
-
const value = codec_1.MsgCreateRewardScheme.fromPartial({
|
|
570
|
-
creator: wallet.bech32Address,
|
|
571
|
-
createRewardSchemeParams: transformCreateRewardScheme(params),
|
|
572
|
-
});
|
|
573
|
-
return yield wallet.sendTx({
|
|
574
|
-
typeUrl: util_1.CarbonTx.Types.MsgCreateRewardScheme,
|
|
575
|
-
value,
|
|
576
|
-
}, opts);
|
|
577
|
-
});
|
|
578
|
-
}
|
|
579
|
-
updateRewardScheme(params, opts) {
|
|
580
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
581
|
-
const wallet = this.getWallet();
|
|
582
|
-
const value = codec_1.MsgUpdateRewardScheme.fromPartial({
|
|
583
|
-
updator: wallet.bech32Address,
|
|
584
|
-
updateRewardSchemeParams: transformUpdateRewardScheme(params),
|
|
585
|
-
});
|
|
586
|
-
return yield wallet.sendTx({
|
|
587
|
-
typeUrl: util_1.CarbonTx.Types.MsgUpdateRewardScheme,
|
|
588
|
-
value,
|
|
589
|
-
}, opts);
|
|
590
|
-
});
|
|
591
|
-
}
|
|
592
395
|
}
|
|
593
396
|
exports.AdminModule = AdminModule;
|
|
594
397
|
;
|
|
@@ -626,6 +429,15 @@ function transfromSyncTokenParams(msg, address) {
|
|
|
626
429
|
};
|
|
627
430
|
}
|
|
628
431
|
exports.transfromSyncTokenParams = transfromSyncTokenParams;
|
|
432
|
+
function transfromCreateVaultTypeParams(msg, address) {
|
|
433
|
+
return {
|
|
434
|
+
creator: address,
|
|
435
|
+
collateralDenom: msg.collateralDenom,
|
|
436
|
+
debtDenom: msg.debtDenom,
|
|
437
|
+
collateralizationRatio: msg.collateralizationRatio.shiftedBy(18).toString(10),
|
|
438
|
+
};
|
|
439
|
+
}
|
|
440
|
+
exports.transfromCreateVaultTypeParams = transfromCreateVaultTypeParams;
|
|
629
441
|
function transfromLinkPoolParams(msg) {
|
|
630
442
|
return {
|
|
631
443
|
poolId: new long_1.default(msg.poolId),
|
|
@@ -716,37 +528,3 @@ function transformCommunityPoolSpendAmount(amount) {
|
|
|
716
528
|
return amounts;
|
|
717
529
|
}
|
|
718
530
|
exports.transformCommunityPoolSpendAmount = transformCommunityPoolSpendAmount;
|
|
719
|
-
function transformCreateRewardScheme(msg) {
|
|
720
|
-
return {
|
|
721
|
-
rewardDenom: msg.rewardDenom,
|
|
722
|
-
assetDenom: msg.assetDenom,
|
|
723
|
-
rewardType: msg.rewardType,
|
|
724
|
-
rewardAmountPerSecond: msg.rewardAmountPerSecond.toString(10),
|
|
725
|
-
startTime: msg.startTime,
|
|
726
|
-
endTime: msg.endTime,
|
|
727
|
-
};
|
|
728
|
-
}
|
|
729
|
-
exports.transformCreateRewardScheme = transformCreateRewardScheme;
|
|
730
|
-
function transformUpdateRewardScheme(msg) {
|
|
731
|
-
var _a;
|
|
732
|
-
return {
|
|
733
|
-
rewardSchemeId: new long_1.default(msg.rewardSchemeId),
|
|
734
|
-
rewardDenom: msg.rewardDenom,
|
|
735
|
-
assetDenom: msg.assetDenom,
|
|
736
|
-
rewardType: msg.rewardType,
|
|
737
|
-
rewardAmountPerSecond: (_a = msg.rewardAmountPerSecond) === null || _a === void 0 ? void 0 : _a.toString(10),
|
|
738
|
-
startTime: msg.startTime,
|
|
739
|
-
endTime: msg.endTime,
|
|
740
|
-
};
|
|
741
|
-
}
|
|
742
|
-
exports.transformUpdateRewardScheme = transformUpdateRewardScheme;
|
|
743
|
-
function transformAddRewardReserve(msg, wallet) {
|
|
744
|
-
var _a;
|
|
745
|
-
return {
|
|
746
|
-
creator: (_a = msg.creator) !== null && _a !== void 0 ? _a : wallet.bech32Address,
|
|
747
|
-
rewardSchemeId: new long_1.default(msg.rewardSchemeId),
|
|
748
|
-
amount: msg.amount.toString(10),
|
|
749
|
-
denom: msg.denom,
|
|
750
|
-
};
|
|
751
|
-
}
|
|
752
|
-
exports.transformAddRewardReserve = transformAddRewardReserve;
|