carbon-js-sdk 0.2.16 → 0.2.18-dev.0
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 +13 -1
- package/lib/CarbonSDK.js +31 -2
- 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/NEOClient.d.ts +1 -1
- package/lib/clients/NEOClient.js +7 -7
- package/lib/clients/TokenClient.d.ts +5 -0
- package/lib/clients/TokenClient.js +38 -10
- 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/asset_params.d.ts +1 -1
- package/lib/codec/cdp/asset_params.js +11 -10
- package/lib/codec/cdp/event.d.ts +389 -22
- package/lib/codec/cdp/event.js +2494 -83
- package/lib/codec/cdp/genesis.d.ts +97 -4
- package/lib/codec/cdp/genesis.js +648 -23
- package/lib/codec/cdp/params.d.ts +8 -0
- package/lib/codec/cdp/params.js +52 -9
- package/lib/codec/cdp/query.d.ts +439 -89
- package/lib/codec/cdp/query.js +1995 -177
- package/lib/codec/cdp/reward_scheme.d.ts +1 -13
- package/lib/codec/cdp/reward_scheme.js +15 -92
- package/lib/codec/cdp/tx.d.ts +760 -96
- package/lib/codec/cdp/tx.js +3645 -235
- 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 +89 -18
- package/lib/codec/index.js +463 -180
- 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 +3 -0
- package/lib/codec/liquiditypool/liquiditypool.js +44 -1
- package/lib/codec/liquiditypool/proposal.d.ts +1 -1
- package/lib/codec/liquiditypool/proposal.js +1 -1
- package/lib/codec/liquiditypool/query.d.ts +39 -2
- package/lib/codec/liquiditypool/query.js +195 -3
- package/lib/codec/liquiditypool/tx.d.ts +3 -1
- package/lib/codec/liquiditypool/tx.js +35 -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 +4 -1
- package/lib/codec/oracle/genesis.js +34 -3
- 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 +56 -1
- package/lib/codec/pricing/event.js +298 -2
- package/lib/codec/pricing/genesis.d.ts +2 -1
- package/lib/codec/pricing/genesis.js +20 -5
- package/lib/codec/pricing/legacy.d.ts +22 -0
- package/lib/codec/pricing/legacy.js +93 -0
- package/lib/codec/pricing/pricing.d.ts +14 -0
- package/lib/codec/pricing/pricing.js +103 -1
- package/lib/codec/pricing/query.d.ts +68 -1
- package/lib/codec/pricing/query.js +321 -2
- package/lib/codec/pricing/tx.d.ts +96 -0
- package/lib/codec/pricing/tx.js +399 -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/constant/generic.js +1 -1
- package/lib/constant/token.d.ts +4 -0
- package/lib/constant/token.js +5 -1
- package/lib/modules/admin.d.ts +114 -7
- package/lib/modules/admin.js +275 -53
- package/lib/modules/cdp.d.ts +152 -13
- package/lib/modules/cdp.js +800 -20
- package/lib/modules/gov.js +14 -14
- package/lib/modules/liquiditypool.d.ts +3 -0
- package/lib/modules/liquiditypool.js +3 -1
- 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 +91 -26
- 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 +135 -24
- 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 +9 -7
- package/lib/provider/amino/types/market.js +1 -1
- package/lib/provider/amino/types/oracle.js +1 -1
- package/lib/provider/amino/types/order.js +4 -4
- package/lib/provider/amino/types/position.js +1 -1
- package/lib/provider/amino/types/profile.js +1 -1
- package/lib/provider/amino/types/staking.js +4 -4
- package/lib/provider/amino/types/subaccount.js +3 -3
- package/lib/provider/amino/utils.js +11 -11
- package/lib/provider/keplr/KeplrAccount.js +5 -0
- 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 +1 -0
- package/lib/util/address.js +21 -13
- package/lib/util/api.js +4 -4
- package/lib/util/fetch.js +1 -1
- package/lib/util/generic.js +3 -3
- package/lib/util/number.d.ts +1 -0
- package/lib/util/number.js +7 -6
- package/lib/util/tx.d.ts +75 -10
- package/lib/wallet/CarbonSigner.d.ts +5 -2
- package/lib/wallet/CarbonSigner.js +15 -2
- package/lib/wallet/CarbonSigningClient.js +8 -8
- package/lib/wallet/CarbonWallet.js +6 -7
- package/lib/websocket/channel.js +115 -21
- package/lib/websocket/connector.js +3 -3
- package/lib/websocket/models.d.ts +156 -0
- package/lib/websocket/types.d.ts +87 -3
- package/lib/websocket/types.js +31 -0
- 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.transformCommunityPoolSpendAmount = exports.transformSetSettlementPriceParams = exports.transfromSetMinGasPriceParams = exports.transfromSetMsgGasCostParams = exports.transfromSetTradingFlagParams = exports.transfromUpdatePoolParams = exports.transfromSetCommitmentCurveParams = exports.transfromSetRewardCurveParams = exports.transfromSetRewardsWeightsParams = exports.transfromUnlinkPoolParams = exports.transfromLinkPoolParams = exports.
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
const
|
|
15
|
+
exports.transformAddRewardReserve = exports.transformUpdateRewardScheme = exports.transformCreateRewardScheme = exports.transformCommunityPoolSpendAmount = exports.transformSetSettlementPriceParams = exports.transfromSetMinGasPriceParams = exports.transfromSetMsgGasCostParams = exports.transfromSetTradingFlagParams = exports.transfromUpdatePoolParams = exports.transfromSetCommitmentCurveParams = exports.transfromSetRewardCurveParams = exports.transfromSetRewardsWeightsParams = exports.transfromUnlinkPoolParams = exports.transfromLinkPoolParams = exports.transfromSyncTokenParams = exports.transfromCreateTokenParams = exports.transfromCreateOracleParams = exports.AdminModule = void 0;
|
|
16
|
+
const codec_1 = require("../codec");
|
|
17
|
+
const tx_1 = require("../codec/coin/tx");
|
|
18
|
+
const tx_2 = require("../codec/cosmos/staking/v1beta1/tx");
|
|
19
|
+
const tx_3 = require("../codec/fee/tx");
|
|
20
|
+
const tx_4 = require("../codec/liquiditypool/tx");
|
|
21
|
+
const tx_5 = require("../codec/market/tx");
|
|
22
|
+
const tx_6 = require("../codec/oracle/tx");
|
|
23
|
+
const tx_7 = 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_6.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_1.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_1.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_1.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_1.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_1.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_1.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_1.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_5.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_5.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,20 +172,10 @@ 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
|
-
}
|
|
185
175
|
linkPool(params, opts) {
|
|
186
176
|
return __awaiter(this, void 0, void 0, function* () {
|
|
187
177
|
const wallet = this.getWallet();
|
|
188
|
-
const value =
|
|
178
|
+
const value = tx_4.MsgLinkPool.fromPartial({
|
|
189
179
|
creator: wallet.bech32Address,
|
|
190
180
|
linkPoolParams: transfromLinkPoolParams(params)
|
|
191
181
|
});
|
|
@@ -198,7 +188,7 @@ class AdminModule extends base_1.default {
|
|
|
198
188
|
unlinkPool(params, opts) {
|
|
199
189
|
return __awaiter(this, void 0, void 0, function* () {
|
|
200
190
|
const wallet = this.getWallet();
|
|
201
|
-
const value =
|
|
191
|
+
const value = tx_4.MsgUnlinkPool.fromPartial({
|
|
202
192
|
creator: wallet.bech32Address,
|
|
203
193
|
unlinkPoolParams: transfromUnlinkPoolParams(params)
|
|
204
194
|
});
|
|
@@ -211,7 +201,7 @@ class AdminModule extends base_1.default {
|
|
|
211
201
|
setRewardsWeights(params, opts) {
|
|
212
202
|
return __awaiter(this, void 0, void 0, function* () {
|
|
213
203
|
const wallet = this.getWallet();
|
|
214
|
-
const value =
|
|
204
|
+
const value = tx_4.MsgSetRewardsWeights.fromPartial({
|
|
215
205
|
creator: wallet.bech32Address,
|
|
216
206
|
setRewardsWeightsParams: transfromSetRewardsWeightsParams(params)
|
|
217
207
|
});
|
|
@@ -224,7 +214,7 @@ class AdminModule extends base_1.default {
|
|
|
224
214
|
setRewardCurve(params, opts) {
|
|
225
215
|
return __awaiter(this, void 0, void 0, function* () {
|
|
226
216
|
const wallet = this.getWallet();
|
|
227
|
-
const value =
|
|
217
|
+
const value = tx_4.MsgSetRewardCurve.fromPartial({
|
|
228
218
|
creator: wallet.bech32Address,
|
|
229
219
|
setRewardCurveParams: transfromSetRewardCurveParams(params)
|
|
230
220
|
});
|
|
@@ -237,7 +227,7 @@ class AdminModule extends base_1.default {
|
|
|
237
227
|
setCommitmentCurve(params, opts) {
|
|
238
228
|
return __awaiter(this, void 0, void 0, function* () {
|
|
239
229
|
const wallet = this.getWallet();
|
|
240
|
-
const value =
|
|
230
|
+
const value = tx_4.MsgSetCommitmentCurve.fromPartial({
|
|
241
231
|
creator: wallet.bech32Address,
|
|
242
232
|
setCommitmentCurveParams: transfromSetCommitmentCurveParams(params)
|
|
243
233
|
});
|
|
@@ -250,7 +240,7 @@ class AdminModule extends base_1.default {
|
|
|
250
240
|
updatePool(params, opts) {
|
|
251
241
|
return __awaiter(this, void 0, void 0, function* () {
|
|
252
242
|
const wallet = this.getWallet();
|
|
253
|
-
const value =
|
|
243
|
+
const value = tx_4.MsgUpdatePool.fromPartial({
|
|
254
244
|
creator: wallet.bech32Address,
|
|
255
245
|
updatePoolParams: transfromUpdatePoolParams(params),
|
|
256
246
|
});
|
|
@@ -263,7 +253,7 @@ class AdminModule extends base_1.default {
|
|
|
263
253
|
setTradingFlag(params, opts) {
|
|
264
254
|
return __awaiter(this, void 0, void 0, function* () {
|
|
265
255
|
const wallet = this.getWallet();
|
|
266
|
-
const value =
|
|
256
|
+
const value = tx_7.MsgSetTradingFlag.fromPartial(transfromSetTradingFlagParams(params, wallet.bech32Address));
|
|
267
257
|
return yield wallet.sendTx({
|
|
268
258
|
typeUrl: util_1.CarbonTx.Types.MsgSetTradingFlag,
|
|
269
259
|
value,
|
|
@@ -278,7 +268,7 @@ class AdminModule extends base_1.default {
|
|
|
278
268
|
setMsgGasCost(params, opts) {
|
|
279
269
|
return __awaiter(this, void 0, void 0, function* () {
|
|
280
270
|
const wallet = this.getWallet();
|
|
281
|
-
const value =
|
|
271
|
+
const value = tx_3.MsgSetGasCost.fromPartial({
|
|
282
272
|
creator: wallet.bech32Address,
|
|
283
273
|
setGasCostParams: transfromSetMsgGasCostParams(params)
|
|
284
274
|
});
|
|
@@ -291,7 +281,7 @@ class AdminModule extends base_1.default {
|
|
|
291
281
|
setMinGasPrice(params, opts) {
|
|
292
282
|
return __awaiter(this, void 0, void 0, function* () {
|
|
293
283
|
const wallet = this.getWallet();
|
|
294
|
-
const value =
|
|
284
|
+
const value = tx_3.MsgSetMinGasPrice.fromPartial({
|
|
295
285
|
creator: wallet.bech32Address,
|
|
296
286
|
setMinGasPriceParams: transfromSetMinGasPriceParams(params)
|
|
297
287
|
});
|
|
@@ -304,7 +294,7 @@ class AdminModule extends base_1.default {
|
|
|
304
294
|
removeMsgGasCost(params, opts) {
|
|
305
295
|
return __awaiter(this, void 0, void 0, function* () {
|
|
306
296
|
const wallet = this.getWallet();
|
|
307
|
-
const value =
|
|
297
|
+
const value = tx_3.MsgRemoveGasCost.fromPartial({
|
|
308
298
|
creator: wallet.bech32Address,
|
|
309
299
|
msgType: params.msgType,
|
|
310
300
|
});
|
|
@@ -317,7 +307,7 @@ class AdminModule extends base_1.default {
|
|
|
317
307
|
removeMinGasPrice(params, opts) {
|
|
318
308
|
return __awaiter(this, void 0, void 0, function* () {
|
|
319
309
|
const wallet = this.getWallet();
|
|
320
|
-
const value =
|
|
310
|
+
const value = tx_3.MsgRemoveMinGasPrice.fromPartial({
|
|
321
311
|
creator: wallet.bech32Address,
|
|
322
312
|
denom: params.denom,
|
|
323
313
|
});
|
|
@@ -330,7 +320,7 @@ class AdminModule extends base_1.default {
|
|
|
330
320
|
createValidator(params, opts) {
|
|
331
321
|
return __awaiter(this, void 0, void 0, function* () {
|
|
332
322
|
const wallet = this.getWallet();
|
|
333
|
-
const value =
|
|
323
|
+
const value = tx_2.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 && {
|
|
334
324
|
commission: {
|
|
335
325
|
rate: params.commission.rate.shiftedBy(18).toString(10),
|
|
336
326
|
maxRate: params.commission.maxRate.shiftedBy(18).toString(10),
|
|
@@ -351,7 +341,7 @@ class AdminModule extends base_1.default {
|
|
|
351
341
|
editValidator(params, opts) {
|
|
352
342
|
return __awaiter(this, void 0, void 0, function* () {
|
|
353
343
|
const wallet = this.getWallet();
|
|
354
|
-
const value =
|
|
344
|
+
const value = tx_2.MsgEditValidator.fromPartial({
|
|
355
345
|
description: params.description,
|
|
356
346
|
validatorAddress: params.validatorAddress,
|
|
357
347
|
commissionRate: params.commissionRate.shiftedBy(18).toString(10),
|
|
@@ -366,7 +356,7 @@ class AdminModule extends base_1.default {
|
|
|
366
356
|
authorizeBridge(params, opts) {
|
|
367
357
|
return __awaiter(this, void 0, void 0, function* () {
|
|
368
358
|
const wallet = this.getWallet();
|
|
369
|
-
const value =
|
|
359
|
+
const value = tx_1.MsgAuthorizeBridge.fromPartial({
|
|
370
360
|
creator: wallet.bech32Address,
|
|
371
361
|
bridgeId: new long_1.default(params.bridgeId),
|
|
372
362
|
chainId: new long_1.default(params.chainId),
|
|
@@ -381,7 +371,7 @@ class AdminModule extends base_1.default {
|
|
|
381
371
|
deauthorizeBridge(params, opts) {
|
|
382
372
|
return __awaiter(this, void 0, void 0, function* () {
|
|
383
373
|
const wallet = this.getWallet();
|
|
384
|
-
const value =
|
|
374
|
+
const value = tx_1.MsgDeauthorizeBridge.fromPartial({
|
|
385
375
|
initiator: wallet.bech32Address,
|
|
386
376
|
bridgeId: new long_1.default(params.bridgeId),
|
|
387
377
|
chainId: new long_1.default(params.chainId),
|
|
@@ -392,6 +382,213 @@ class AdminModule extends base_1.default {
|
|
|
392
382
|
}, opts);
|
|
393
383
|
});
|
|
394
384
|
}
|
|
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
|
+
}
|
|
395
592
|
}
|
|
396
593
|
exports.AdminModule = AdminModule;
|
|
397
594
|
;
|
|
@@ -429,15 +626,6 @@ function transfromSyncTokenParams(msg, address) {
|
|
|
429
626
|
};
|
|
430
627
|
}
|
|
431
628
|
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;
|
|
441
629
|
function transfromLinkPoolParams(msg) {
|
|
442
630
|
return {
|
|
443
631
|
poolId: new long_1.default(msg.poolId),
|
|
@@ -528,3 +716,37 @@ function transformCommunityPoolSpendAmount(amount) {
|
|
|
528
716
|
return amounts;
|
|
529
717
|
}
|
|
530
718
|
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;
|