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/gov.js
CHANGED
|
@@ -48,7 +48,7 @@ class GovModule extends base_1.default {
|
|
|
48
48
|
const value = tx_1.MsgDeposit.fromPartial({
|
|
49
49
|
proposalId: new long_1.default(params.proposalId),
|
|
50
50
|
depositor: wallet.bech32Address,
|
|
51
|
-
amount:
|
|
51
|
+
amount: amino_1.coins(params.amount, params.denom)
|
|
52
52
|
});
|
|
53
53
|
return yield wallet.sendTx({
|
|
54
54
|
typeUrl: util_1.CarbonTx.Types.MsgDeposit,
|
|
@@ -78,21 +78,21 @@ class GovModule extends base_1.default {
|
|
|
78
78
|
const createTokenMsg = {
|
|
79
79
|
title: title,
|
|
80
80
|
description: description,
|
|
81
|
-
msg:
|
|
81
|
+
msg: admin_1.transfromCreateTokenParams(msg, wallet.bech32Address)
|
|
82
82
|
};
|
|
83
83
|
return proposal_1.CreateTokenProposal.encode(createTokenMsg).finish();
|
|
84
84
|
case "SetMsgGasCostProposal":
|
|
85
85
|
const setMsgGasCostMsg = {
|
|
86
86
|
title: title,
|
|
87
87
|
description: description,
|
|
88
|
-
msg:
|
|
88
|
+
msg: admin_1.transfromSetMsgGasCostParams(msg)
|
|
89
89
|
};
|
|
90
90
|
return proposal_2.SetMsgGasCostProposal.encode(setMsgGasCostMsg).finish();
|
|
91
91
|
case "SetMinGasPriceProposal":
|
|
92
92
|
const setMinGasPriceMsg = {
|
|
93
93
|
title: title,
|
|
94
94
|
description: description,
|
|
95
|
-
msg:
|
|
95
|
+
msg: admin_1.transfromSetMinGasPriceParams(msg)
|
|
96
96
|
};
|
|
97
97
|
return proposal_2.SetMinGasPriceProposal.encode(setMinGasPriceMsg).finish();
|
|
98
98
|
case "RemoveMsgGasCostProposal":
|
|
@@ -113,63 +113,63 @@ class GovModule extends base_1.default {
|
|
|
113
113
|
const linkPoolMsg = {
|
|
114
114
|
title: title,
|
|
115
115
|
description: description,
|
|
116
|
-
msg:
|
|
116
|
+
msg: admin_1.transfromLinkPoolParams(msg)
|
|
117
117
|
};
|
|
118
118
|
return proposal_3.LinkPoolProposal.encode(linkPoolMsg).finish();
|
|
119
119
|
case "UnlinkPoolProposal":
|
|
120
120
|
const unlinkPoolMsg = {
|
|
121
121
|
title: title,
|
|
122
122
|
description: description,
|
|
123
|
-
msg:
|
|
123
|
+
msg: admin_1.transfromUnlinkPoolParams(msg)
|
|
124
124
|
};
|
|
125
125
|
return proposal_3.UnlinkPoolProposal.encode(unlinkPoolMsg).finish();
|
|
126
126
|
case "SetRewardCurveProposal":
|
|
127
127
|
const setRewardCurveMsg = {
|
|
128
128
|
title: title,
|
|
129
129
|
description: description,
|
|
130
|
-
msg:
|
|
130
|
+
msg: admin_1.transfromSetRewardCurveParams(msg)
|
|
131
131
|
};
|
|
132
132
|
return proposal_3.SetRewardCurveProposal.encode(setRewardCurveMsg).finish();
|
|
133
133
|
case "SetCommitmentCurveProposal":
|
|
134
134
|
const setCommitmentCurveMsg = {
|
|
135
135
|
title: title,
|
|
136
136
|
description: description,
|
|
137
|
-
msg:
|
|
137
|
+
msg: admin_1.transfromSetCommitmentCurveParams(msg)
|
|
138
138
|
};
|
|
139
139
|
return proposal_3.SetCommitmentCurveProposal.encode(setCommitmentCurveMsg).finish();
|
|
140
140
|
case "SetRewardsWeightsProposal":
|
|
141
141
|
const setRewardsWeightsMsg = {
|
|
142
142
|
title: title,
|
|
143
143
|
description: description,
|
|
144
|
-
msg:
|
|
144
|
+
msg: admin_1.transfromSetRewardsWeightsParams(msg)
|
|
145
145
|
};
|
|
146
146
|
return proposal_3.SetRewardsWeightsProposal.encode(setRewardsWeightsMsg).finish();
|
|
147
147
|
case "UpdatePoolProposal":
|
|
148
148
|
const updatePoolProposalMsg = {
|
|
149
149
|
title: title,
|
|
150
150
|
description: description,
|
|
151
|
-
msg:
|
|
151
|
+
msg: admin_1.transfromUpdatePoolParams(msg)
|
|
152
152
|
};
|
|
153
153
|
return proposal_3.UpdatePoolProposal.encode(updatePoolProposalMsg).finish();
|
|
154
154
|
case "UpdateMarketProposal":
|
|
155
155
|
const updateMarketProposalMsg = {
|
|
156
156
|
title: title,
|
|
157
157
|
description: description,
|
|
158
|
-
msg:
|
|
158
|
+
msg: market_1.transfromUpdateMarketParams(msg)
|
|
159
159
|
};
|
|
160
160
|
return proposal_4.UpdateMarketProposal.encode(updateMarketProposalMsg).finish();
|
|
161
161
|
case "CreateOracleProposal":
|
|
162
162
|
const createOracleProposalMsg = {
|
|
163
163
|
title: title,
|
|
164
164
|
description: description,
|
|
165
|
-
msg:
|
|
165
|
+
msg: admin_1.transfromCreateOracleParams(msg, wallet.bech32Address)
|
|
166
166
|
};
|
|
167
167
|
return proposal_5.CreateOracleProposal.encode(createOracleProposalMsg).finish();
|
|
168
168
|
case "SettlementPriceProposal":
|
|
169
169
|
const settlementPriceProposalMsg = {
|
|
170
170
|
title: title,
|
|
171
171
|
description: description,
|
|
172
|
-
msg:
|
|
172
|
+
msg: admin_1.transformSetSettlementPriceParams(msg),
|
|
173
173
|
};
|
|
174
174
|
return proposal_6.SettlementPriceProposal.encode(settlementPriceProposalMsg).finish();
|
|
175
175
|
case "ParameterChangeProposal":
|
|
@@ -191,7 +191,7 @@ class GovModule extends base_1.default {
|
|
|
191
191
|
title: title,
|
|
192
192
|
description: description,
|
|
193
193
|
recipient: proposalMsg.recipient,
|
|
194
|
-
amount:
|
|
194
|
+
amount: admin_1.transformCommunityPoolSpendAmount(proposalMsg.amount),
|
|
195
195
|
};
|
|
196
196
|
return distribution_1.CommunityPoolSpendProposal.encode(communityPoolSpendProposalMsg).finish();
|
|
197
197
|
case "CancelSoftwareUpgradeProposal":
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CarbonTx } from "../util";
|
|
2
2
|
import { BigNumber } from "bignumber.js";
|
|
3
|
+
import Long from "long";
|
|
3
4
|
import BaseModule from "./base";
|
|
4
5
|
export declare class LiquidityPoolModule extends BaseModule {
|
|
5
6
|
create(params: LiquidityPoolModule.CreatePoolParams, opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
|
|
@@ -25,6 +26,7 @@ export declare namespace LiquidityPoolModule {
|
|
|
25
26
|
tokenAWeight: BigNumber;
|
|
26
27
|
tokenBWeight: BigNumber;
|
|
27
28
|
swapFee: BigNumber;
|
|
29
|
+
ampBps: Long;
|
|
28
30
|
numQuotes: number;
|
|
29
31
|
}
|
|
30
32
|
interface CreatePoolWithLiquidityParams {
|
|
@@ -35,6 +37,7 @@ export declare namespace LiquidityPoolModule {
|
|
|
35
37
|
amountA: BigNumber;
|
|
36
38
|
amountB: BigNumber;
|
|
37
39
|
swapFee: BigNumber;
|
|
40
|
+
ampBps: Long;
|
|
38
41
|
numQuotes: number;
|
|
39
42
|
}
|
|
40
43
|
interface AddLiquidityParams {
|
|
@@ -30,6 +30,7 @@ class LiquidityPoolModule extends base_1.default {
|
|
|
30
30
|
tokenAWeight: params.tokenAWeight.shiftedBy(18).toString(10),
|
|
31
31
|
tokenBWeight: params.tokenBWeight.shiftedBy(18).toString(10),
|
|
32
32
|
swapFee: params.swapFee.shiftedBy(18).toString(10),
|
|
33
|
+
ampBps: params.ampBps,
|
|
33
34
|
numQuotes: new long_1.default(params.numQuotes),
|
|
34
35
|
});
|
|
35
36
|
return yield wallet.sendTx({
|
|
@@ -50,6 +51,7 @@ class LiquidityPoolModule extends base_1.default {
|
|
|
50
51
|
amountA: params.amountA.toString(10),
|
|
51
52
|
amountB: params.amountB.toString(10),
|
|
52
53
|
swapFee: params.swapFee.shiftedBy(18).toString(10),
|
|
54
|
+
ampBps: params.ampBps,
|
|
53
55
|
numQuotes: new long_1.default(params.numQuotes),
|
|
54
56
|
});
|
|
55
57
|
return yield wallet.sendTx({
|
|
@@ -145,7 +147,7 @@ class LiquidityPoolModule extends base_1.default {
|
|
|
145
147
|
const SECONDS_IN_A_WEEK = new bignumber_js_1.BigNumber(604800);
|
|
146
148
|
const mintDataResponse = yield this.sdkProvider.query.inflation.MintData({});
|
|
147
149
|
const mintData = mintDataResponse.mintData;
|
|
148
|
-
const nowTime = new bignumber_js_1.BigNumber(
|
|
150
|
+
const nowTime = new bignumber_js_1.BigNumber(dayjs_1.default().unix());
|
|
149
151
|
const firstBlockTime = (_a = mintData === null || mintData === void 0 ? void 0 : mintData.firstBlockTime.toNumber()) !== null && _a !== void 0 ? _a : 0;
|
|
150
152
|
const difference = nowTime.minus(firstBlockTime);
|
|
151
153
|
const currentWeek = difference.div(SECONDS_IN_A_WEEK).dp(0, bignumber_js_1.BigNumber.ROUND_DOWN);
|
|
@@ -85,7 +85,7 @@ class EthLedgerAccount {
|
|
|
85
85
|
static tryConnect() {
|
|
86
86
|
return __awaiter(this, void 0, void 0, function* () {
|
|
87
87
|
try {
|
|
88
|
-
const transport = yield
|
|
88
|
+
const transport = yield ledger_1.getLedgerTransport();
|
|
89
89
|
// get public key to assert that NEO app is open
|
|
90
90
|
const ethApp = new hw_app_eth_1.default(transport);
|
|
91
91
|
const bipString = EthLedgerAccount.getETHBIP44String();
|
|
@@ -39,7 +39,7 @@ exports.looksLikeTransportStatusError = looksLikeTransportStatusError;
|
|
|
39
39
|
* @returns error with modified message if found.
|
|
40
40
|
*/
|
|
41
41
|
function evalTransportError(err) {
|
|
42
|
-
const transportErr =
|
|
42
|
+
const transportErr = lodash_1.cloneDeep(err);
|
|
43
43
|
switch (transportErr.statusCode) {
|
|
44
44
|
case StatusWord.APP_CLOSED:
|
|
45
45
|
transportErr.message = "Your NEO app is closed! Please login.";
|
|
@@ -49,8 +49,8 @@ function getAppName(ledger) {
|
|
|
49
49
|
return version.substring(0, version.length - 2); // take of status word
|
|
50
50
|
}
|
|
51
51
|
catch (e) {
|
|
52
|
-
if (
|
|
53
|
-
throw
|
|
52
|
+
if (ErrorCode_1.looksLikeTransportStatusError(e)) {
|
|
53
|
+
throw ErrorCode_1.evalTransportError(e);
|
|
54
54
|
}
|
|
55
55
|
throw e;
|
|
56
56
|
}
|
|
@@ -72,8 +72,8 @@ function getAppVersion(ledger) {
|
|
|
72
72
|
return major.toString() + "." + minor.toString() + "." + patch.toString();
|
|
73
73
|
}
|
|
74
74
|
catch (e) {
|
|
75
|
-
if (
|
|
76
|
-
throw
|
|
75
|
+
if (ErrorCode_1.looksLikeTransportStatusError(e)) {
|
|
76
|
+
throw ErrorCode_1.evalTransportError(e);
|
|
77
77
|
}
|
|
78
78
|
throw e;
|
|
79
79
|
}
|
|
@@ -109,8 +109,8 @@ function getPublicKey(ledger, bip44String, showAddressOnDevice = false) {
|
|
|
109
109
|
return response.toString("hex").substring(0, 130);
|
|
110
110
|
}
|
|
111
111
|
catch (e) {
|
|
112
|
-
if (
|
|
113
|
-
throw
|
|
112
|
+
if (ErrorCode_1.looksLikeTransportStatusError(e)) {
|
|
113
|
+
throw ErrorCode_1.evalTransportError(e);
|
|
114
114
|
}
|
|
115
115
|
throw e;
|
|
116
116
|
}
|
|
@@ -142,8 +142,8 @@ function getSignature(ledger, payload, bip44String, network) {
|
|
|
142
142
|
return DerToHexSignature(response.toString("hex"));
|
|
143
143
|
}
|
|
144
144
|
catch (e) {
|
|
145
|
-
if (
|
|
146
|
-
throw
|
|
145
|
+
if (ErrorCode_1.looksLikeTransportStatusError(e)) {
|
|
146
|
+
throw ErrorCode_1.evalTransportError(e);
|
|
147
147
|
}
|
|
148
148
|
throw e;
|
|
149
149
|
}
|
|
@@ -109,8 +109,8 @@ class NeoLedgerAccount {
|
|
|
109
109
|
*/
|
|
110
110
|
static tryConnect(version = "neo") {
|
|
111
111
|
return __awaiter(this, void 0, void 0, function* () {
|
|
112
|
-
const bipString =
|
|
113
|
-
const ledger = yield
|
|
112
|
+
const bipString = NeonLedger_1.getNEOBIP44String();
|
|
113
|
+
const ledger = yield ledger_1.getLedgerTransport();
|
|
114
114
|
// get public key to assert that NEO app is open
|
|
115
115
|
const ledgerAdapter = adapterForVersion(version);
|
|
116
116
|
const publicKey = yield ledgerAdapter.getPublicKey(ledger, bipString);
|
|
@@ -127,7 +127,7 @@ class NeoLedgerAccount {
|
|
|
127
127
|
}
|
|
128
128
|
sign(msg, magic = neon_core_next_1.CONST.MAGIC_NUMBER.MainNet) {
|
|
129
129
|
return __awaiter(this, void 0, void 0, function* () {
|
|
130
|
-
const bipString =
|
|
130
|
+
const bipString = NeonLedger_1.getNEOBIP44String();
|
|
131
131
|
const ledger = this.useLedger();
|
|
132
132
|
const ledgerAdapter = adapterForVersion(this.version);
|
|
133
133
|
console.log("getsignature", ledgerAdapter, ledger, msg, bipString, magic);
|
|
@@ -41,7 +41,7 @@ function evalTransportError(err) {
|
|
|
41
41
|
transportErr.message = "Transaction signing denied";
|
|
42
42
|
break;
|
|
43
43
|
default:
|
|
44
|
-
transportErr.message =
|
|
44
|
+
transportErr.message = hw_transport_1.getAltStatusMessage(transportErr.statusCode);
|
|
45
45
|
}
|
|
46
46
|
return err;
|
|
47
47
|
}
|
|
@@ -43,6 +43,17 @@ const TxTypes = {
|
|
|
43
43
|
RemoveMinGasPrice: "fee/RemoveMinGasPrice",
|
|
44
44
|
CreateValidator: "cosmos-sdk/MsgCreateValidator",
|
|
45
45
|
EditValidator: "cosmos-sdk/MsgEditValidator",
|
|
46
|
+
AddRateStrategy: "cdp/AddRateStrategy",
|
|
47
|
+
UpdateRateStrategy: "cdp/UpdateRateStrategy",
|
|
48
|
+
RemoveRateStrategy: "cdp/RemoveRateStrategy",
|
|
49
|
+
AddAsset: "cdp/AddAsset",
|
|
50
|
+
UpdateAsset: "cdp/UpdateAsset",
|
|
51
|
+
SetLiquidationFee: "cdp/SetLiquidationFee",
|
|
52
|
+
SetInterestFee: "cdp/SetInterestFee",
|
|
53
|
+
SetStablecoinInterestRate: "cdp/SetStablecoinInterestRate",
|
|
54
|
+
SetCompleteLiquidationThreshold: "cdp/SetCompleteLiquidationThreshold",
|
|
55
|
+
SetMinimumCloseFactor: "cdp/SetMinimumCloseFactor",
|
|
56
|
+
SetSmallLiquidationSize: "cdp/SetSmallLiquidationSize",
|
|
46
57
|
};
|
|
47
58
|
const MsgCreateOracle = {
|
|
48
59
|
aminoType: TxTypes.CreateOracle,
|
|
@@ -84,12 +95,6 @@ const MsgCreateMarket = {
|
|
|
84
95
|
currentQuotePriceUsd: utils_1.ConvertEncType.Dec,
|
|
85
96
|
},
|
|
86
97
|
};
|
|
87
|
-
const MsgCreateVaultType = {
|
|
88
|
-
aminoType: TxTypes.CreateVaultType,
|
|
89
|
-
valueMap: {
|
|
90
|
-
collateralizationRatio: utils_1.ConvertEncType.Dec,
|
|
91
|
-
},
|
|
92
|
-
};
|
|
93
98
|
const MsgLinkPool = {
|
|
94
99
|
aminoType: TxTypes.LinkPool,
|
|
95
100
|
valueMap: {
|
|
@@ -177,26 +182,86 @@ const MsgEditValidator = {
|
|
|
177
182
|
commissionRate: utils_1.ConvertEncType.Dec,
|
|
178
183
|
},
|
|
179
184
|
};
|
|
185
|
+
const MsgAddRateStrategy = {
|
|
186
|
+
aminoType: TxTypes.AddRateStrategy,
|
|
187
|
+
valueMap: {},
|
|
188
|
+
};
|
|
189
|
+
const MsgUpdateRateStrategy = {
|
|
190
|
+
aminoType: TxTypes.UpdateRateStrategy,
|
|
191
|
+
valueMap: {},
|
|
192
|
+
};
|
|
193
|
+
const MsgRemoveRateStrategy = {
|
|
194
|
+
aminoType: TxTypes.RemoveRateStrategy,
|
|
195
|
+
valueMap: {},
|
|
196
|
+
};
|
|
197
|
+
const MsgAddAsset = {
|
|
198
|
+
aminoType: TxTypes.AddAsset,
|
|
199
|
+
valueMap: {},
|
|
200
|
+
};
|
|
201
|
+
const MsgUpdateAsset = {
|
|
202
|
+
aminoType: TxTypes.UpdateAsset,
|
|
203
|
+
valueMap: {},
|
|
204
|
+
};
|
|
205
|
+
const MsgSetLiquidationFee = {
|
|
206
|
+
aminoType: TxTypes.SetLiquidationFee,
|
|
207
|
+
valueMap: {},
|
|
208
|
+
};
|
|
209
|
+
const MsgSetInterestFee = {
|
|
210
|
+
aminoType: TxTypes.SetInterestFee,
|
|
211
|
+
valueMap: {},
|
|
212
|
+
};
|
|
213
|
+
const MsgSetStablecoinInterestRate = {
|
|
214
|
+
aminoType: TxTypes.SetStablecoinInterestRate,
|
|
215
|
+
valueMap: {},
|
|
216
|
+
};
|
|
217
|
+
const MsgSetCompleteLiquidationThreshold = {
|
|
218
|
+
aminoType: TxTypes.SetCompleteLiquidationThreshold,
|
|
219
|
+
valueMap: {
|
|
220
|
+
completeLiquidationThreshold: utils_1.ConvertEncType.Dec,
|
|
221
|
+
},
|
|
222
|
+
};
|
|
223
|
+
const MsgSetMinimumCloseFactor = {
|
|
224
|
+
aminoType: TxTypes.SetMinimumCloseFactor,
|
|
225
|
+
valueMap: {
|
|
226
|
+
minimumCloseFactor: utils_1.ConvertEncType.Dec,
|
|
227
|
+
},
|
|
228
|
+
};
|
|
229
|
+
const MsgSetSmallLiquidationSize = {
|
|
230
|
+
aminoType: TxTypes.SetSmallLiquidationSize,
|
|
231
|
+
valueMap: {
|
|
232
|
+
smallLiquidationSize: utils_1.ConvertEncType.Dec,
|
|
233
|
+
},
|
|
234
|
+
};
|
|
180
235
|
const AdminAmino = {
|
|
181
|
-
[CarbonTx.Types.MsgCreateOracle]:
|
|
182
|
-
[CarbonTx.Types.MsgBindToken]:
|
|
183
|
-
[CarbonTx.Types.MsgCreateToken]:
|
|
184
|
-
[CarbonTx.Types.MsgLinkToken]:
|
|
185
|
-
[CarbonTx.Types.MsgSyncToken]:
|
|
186
|
-
[CarbonTx.Types.MsgCreateMarket]:
|
|
187
|
-
[CarbonTx.Types.
|
|
188
|
-
[CarbonTx.Types.
|
|
189
|
-
[CarbonTx.Types.
|
|
190
|
-
[CarbonTx.Types.
|
|
191
|
-
[CarbonTx.Types.
|
|
192
|
-
[CarbonTx.Types.
|
|
193
|
-
[CarbonTx.Types.
|
|
194
|
-
[CarbonTx.Types.
|
|
195
|
-
[CarbonTx.Types.
|
|
196
|
-
[CarbonTx.Types.
|
|
197
|
-
[CarbonTx.Types.
|
|
198
|
-
[CarbonTx.Types.
|
|
199
|
-
[CarbonTx.Types.
|
|
200
|
-
[CarbonTx.Types.
|
|
236
|
+
[CarbonTx.Types.MsgCreateOracle]: utils_1.generateAminoType(MsgCreateOracle),
|
|
237
|
+
[CarbonTx.Types.MsgBindToken]: utils_1.generateAminoType(MsgBindToken),
|
|
238
|
+
[CarbonTx.Types.MsgCreateToken]: utils_1.generateAminoType(MsgCreateToken),
|
|
239
|
+
[CarbonTx.Types.MsgLinkToken]: utils_1.generateAminoType(MsgLinkToken),
|
|
240
|
+
[CarbonTx.Types.MsgSyncToken]: utils_1.generateAminoType(MsgSyncToken),
|
|
241
|
+
[CarbonTx.Types.MsgCreateMarket]: utils_1.generateAminoType(MsgCreateMarket),
|
|
242
|
+
[CarbonTx.Types.MsgLinkPool]: utils_1.generateAminoType(MsgLinkPool),
|
|
243
|
+
[CarbonTx.Types.MsgUnlinkPool]: utils_1.generateAminoType(MsgUnlinkPool),
|
|
244
|
+
[CarbonTx.Types.MsgUpdatePool]: utils_1.generateAminoType(MsgUpdatePool),
|
|
245
|
+
[CarbonTx.Types.MsgSetRewardsWeights]: utils_1.generateAminoType(MsgSetRewardsWeights),
|
|
246
|
+
[CarbonTx.Types.MsgSetRewardCurve]: utils_1.generateAminoType(MsgSetRewardCurve),
|
|
247
|
+
[CarbonTx.Types.MsgSetCommitmentCurve]: utils_1.generateAminoType(MsgSetCommitmentCurve),
|
|
248
|
+
[CarbonTx.Types.MsgSetTradingFlag]: utils_1.generateAminoType(MsgSetTradingFlag),
|
|
249
|
+
[CarbonTx.Types.MsgSetGasCost]: utils_1.generateAminoType(MsgSetGasCost),
|
|
250
|
+
[CarbonTx.Types.MsgSetMinGasPrice]: utils_1.generateAminoType(MsgSetMinGasPrice),
|
|
251
|
+
[CarbonTx.Types.MsgRemoveGasCost]: utils_1.generateAminoType(MsgRemoveGasCost),
|
|
252
|
+
[CarbonTx.Types.MsgRemoveMinGasPrice]: utils_1.generateAminoType(MsgRemoveMinGasPrice),
|
|
253
|
+
[CarbonTx.Types.MsgCreateValidator]: utils_1.generateAminoType(MsgCreateValidator),
|
|
254
|
+
[CarbonTx.Types.MsgEditValidator]: utils_1.generateAminoType(MsgEditValidator),
|
|
255
|
+
[CarbonTx.Types.MsgAddRateStrategy]: utils_1.generateAminoType(MsgAddRateStrategy),
|
|
256
|
+
[CarbonTx.Types.MsgUpdateRateStrategy]: utils_1.generateAminoType(MsgUpdateRateStrategy),
|
|
257
|
+
[CarbonTx.Types.MsgRemoveRateStrategy]: utils_1.generateAminoType(MsgRemoveRateStrategy),
|
|
258
|
+
[CarbonTx.Types.MsgAddAsset]: utils_1.generateAminoType(MsgAddAsset),
|
|
259
|
+
[CarbonTx.Types.MsgUpdateAsset]: utils_1.generateAminoType(MsgUpdateAsset),
|
|
260
|
+
[CarbonTx.Types.MsgSetLiquidationFee]: utils_1.generateAminoType(MsgSetLiquidationFee),
|
|
261
|
+
[CarbonTx.Types.MsgSetInterestFee]: utils_1.generateAminoType(MsgSetInterestFee),
|
|
262
|
+
[CarbonTx.Types.MsgSetStablecoinInterestRate]: utils_1.generateAminoType(MsgSetStablecoinInterestRate),
|
|
263
|
+
[CarbonTx.Types.MsgSetCompleteLiquidationThreshold]: utils_1.generateAminoType(MsgSetCompleteLiquidationThreshold),
|
|
264
|
+
[CarbonTx.Types.MsgSetMinimumCloseFactor]: utils_1.generateAminoType(MsgSetMinimumCloseFactor),
|
|
265
|
+
[CarbonTx.Types.MsgSetSmallLiquidationSize]: utils_1.generateAminoType(MsgSetSmallLiquidationSize),
|
|
201
266
|
};
|
|
202
267
|
exports.default = AdminAmino;
|
|
@@ -29,6 +29,6 @@ const MsgInitiateLiquidation = {
|
|
|
29
29
|
valueMap: {},
|
|
30
30
|
};
|
|
31
31
|
const BrokerAmino = {
|
|
32
|
-
[CarbonTx.Types.MsgInitiateLiquidation]:
|
|
32
|
+
[CarbonTx.Types.MsgInitiateLiquidation]: utils_1.generateAminoType(MsgInitiateLiquidation),
|
|
33
33
|
};
|
|
34
34
|
exports.default = BrokerAmino;
|
|
@@ -22,39 +22,150 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
22
22
|
const CarbonTx = __importStar(require("../../../util/tx"));
|
|
23
23
|
const utils_1 = require("../utils");
|
|
24
24
|
const TxTypes = {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
SupplyAsset: "cdp/SupplyAsset",
|
|
26
|
+
WithdrawAsset: "cdp/WithdrawAsset",
|
|
27
|
+
LockCollateral: "cdp/LockCollateral",
|
|
28
|
+
UnlockCollateral: "cdp/UnlockCollateral",
|
|
29
|
+
BorrowAsset: "cdp/BorrowAsset",
|
|
30
|
+
RepayAsset: "cdp/RepayAsset",
|
|
31
|
+
SupplyAssetAndLockCollateral: "cdp/SupplyAssetAndLockCollateral",
|
|
32
|
+
UnlockCollateralAndWithdrawAsset: "cdp/UnlockCollateralAndWithdrawAsset",
|
|
33
|
+
LiquidateCollateral: "cdp/LiquidateCollateral",
|
|
34
|
+
RepayAssetWithCdpTokens: "cdp/RepayAssetWithCdpTokens",
|
|
35
|
+
RepayAssetWithCollateral: "cdp/RepayAssetWithCollateral",
|
|
36
|
+
MintStablecoin: "cdp/MintStablecoin",
|
|
37
|
+
ReturnStablecoin: "cdp/ReturnStablecoin",
|
|
38
|
+
LiquidateCollateralWithCdpTokens: "cdp/LiquidateCollateralWithCdpTokens",
|
|
39
|
+
LiquidateCollateralWithCollateral: "cdp/LiquidateCollateralWithCollateral",
|
|
40
|
+
LiquidateCollateralWithStablecoin: "cdp/LiquidateCollateralWithStablecoin",
|
|
41
|
+
CreateRewardScheme: "cdp/CreateRewardScheme",
|
|
42
|
+
UpdateRewardScheme: "cdp/UpdateRewardScheme",
|
|
43
|
+
SetStablecoinMintCap: "cdp/SetStablecoinMintCap",
|
|
44
|
+
SetStalePriceGracePeriod: "cdp/SetStalePriceGracePeriod",
|
|
45
|
+
SetCdpPaused: "cdp/SetCdpPaused",
|
|
46
|
+
ClaimRewards: "cdp/ClaimRewards",
|
|
29
47
|
};
|
|
30
|
-
const
|
|
31
|
-
aminoType: TxTypes.
|
|
32
|
-
valueMap: {
|
|
33
|
-
vaultTypeId: utils_1.ConvertEncType.Long,
|
|
34
|
-
},
|
|
48
|
+
const MsgSupplyAsset = {
|
|
49
|
+
aminoType: TxTypes.SupplyAsset,
|
|
50
|
+
valueMap: {},
|
|
35
51
|
};
|
|
36
|
-
const
|
|
37
|
-
aminoType: TxTypes.
|
|
38
|
-
valueMap: {
|
|
39
|
-
|
|
40
|
-
|
|
52
|
+
const MsgWithdrawAsset = {
|
|
53
|
+
aminoType: TxTypes.WithdrawAsset,
|
|
54
|
+
valueMap: {},
|
|
55
|
+
};
|
|
56
|
+
const MsgLockCollateral = {
|
|
57
|
+
aminoType: TxTypes.LockCollateral,
|
|
58
|
+
valueMap: {},
|
|
59
|
+
};
|
|
60
|
+
const MsgUnlockCollateral = {
|
|
61
|
+
aminoType: TxTypes.UnlockCollateral,
|
|
62
|
+
valueMap: {},
|
|
63
|
+
};
|
|
64
|
+
const MsgBorrowAsset = {
|
|
65
|
+
aminoType: TxTypes.BorrowAsset,
|
|
66
|
+
valueMap: {},
|
|
67
|
+
};
|
|
68
|
+
const MsgRepayAsset = {
|
|
69
|
+
aminoType: TxTypes.RepayAsset,
|
|
70
|
+
valueMap: {},
|
|
71
|
+
};
|
|
72
|
+
const MsgSupplyAssetAndLockCollateral = {
|
|
73
|
+
aminoType: TxTypes.SupplyAssetAndLockCollateral,
|
|
74
|
+
valueMap: {},
|
|
75
|
+
};
|
|
76
|
+
const MsgUnlockCollateralAndWithdrawAsset = {
|
|
77
|
+
aminoType: TxTypes.UnlockCollateralAndWithdrawAsset,
|
|
78
|
+
valueMap: {},
|
|
79
|
+
};
|
|
80
|
+
const MsgLiquidateCollateral = {
|
|
81
|
+
aminoType: TxTypes.LiquidateCollateral,
|
|
82
|
+
valueMap: {},
|
|
41
83
|
};
|
|
42
|
-
const
|
|
43
|
-
aminoType: TxTypes.
|
|
84
|
+
const MsgRepayAssetWithCdpTokens = {
|
|
85
|
+
aminoType: TxTypes.RepayAssetWithCdpTokens,
|
|
86
|
+
valueMap: {},
|
|
87
|
+
};
|
|
88
|
+
const MsgRepayAssetWithCollateral = {
|
|
89
|
+
aminoType: TxTypes.RepayAssetWithCollateral,
|
|
90
|
+
valueMap: {},
|
|
91
|
+
};
|
|
92
|
+
const MsgMintStablecoin = {
|
|
93
|
+
aminoType: TxTypes.MintStablecoin,
|
|
94
|
+
valueMap: {},
|
|
95
|
+
};
|
|
96
|
+
const MsgReturnStablecoin = {
|
|
97
|
+
aminoType: TxTypes.ReturnStablecoin,
|
|
98
|
+
valueMap: {},
|
|
99
|
+
};
|
|
100
|
+
const MsgLiquidateCollateralWithCdpTokens = {
|
|
101
|
+
aminoType: TxTypes.LiquidateCollateralWithCdpTokens,
|
|
102
|
+
valueMap: {},
|
|
103
|
+
};
|
|
104
|
+
const MsgLiquidateCollateralWithCollateral = {
|
|
105
|
+
aminoType: TxTypes.LiquidateCollateralWithCollateral,
|
|
106
|
+
valueMap: {},
|
|
107
|
+
};
|
|
108
|
+
const MsgLiquidateCollateralWithStablecoin = {
|
|
109
|
+
aminoType: TxTypes.LiquidateCollateralWithStablecoin,
|
|
110
|
+
valueMap: {},
|
|
111
|
+
};
|
|
112
|
+
const MsgCreateRewardScheme = {
|
|
113
|
+
aminoType: TxTypes.CreateRewardScheme,
|
|
44
114
|
valueMap: {
|
|
45
|
-
|
|
115
|
+
createRewardSchemeParams: {
|
|
116
|
+
startTime: utils_1.ConvertEncType.Date,
|
|
117
|
+
endTime: utils_1.ConvertEncType.Date,
|
|
118
|
+
},
|
|
46
119
|
},
|
|
47
120
|
};
|
|
48
|
-
const
|
|
49
|
-
aminoType: TxTypes.
|
|
121
|
+
const MsgUpdateRewardScheme = {
|
|
122
|
+
aminoType: TxTypes.UpdateRewardScheme,
|
|
50
123
|
valueMap: {
|
|
51
|
-
|
|
124
|
+
updateRewardSchemeParams: {
|
|
125
|
+
rewardSchemeId: utils_1.ConvertEncType.Long,
|
|
126
|
+
startTime: utils_1.ConvertEncType.Date,
|
|
127
|
+
endTime: utils_1.ConvertEncType.Date,
|
|
128
|
+
},
|
|
52
129
|
},
|
|
53
130
|
};
|
|
131
|
+
const MsgClaimRewards = {
|
|
132
|
+
aminoType: TxTypes.ClaimRewards,
|
|
133
|
+
valueMap: {},
|
|
134
|
+
};
|
|
135
|
+
const MsgSetStablecoinMintCap = {
|
|
136
|
+
aminoType: TxTypes.SetStablecoinMintCap,
|
|
137
|
+
valueMap: {},
|
|
138
|
+
};
|
|
139
|
+
const MsgSetStalePriceGracePeriod = {
|
|
140
|
+
aminoType: TxTypes.SetStalePriceGracePeriod,
|
|
141
|
+
valueMap: {},
|
|
142
|
+
};
|
|
143
|
+
const MsgSetCdpPaused = {
|
|
144
|
+
aminoType: TxTypes.SetCdpPaused,
|
|
145
|
+
valueMap: {},
|
|
146
|
+
};
|
|
54
147
|
const CdpAmino = {
|
|
55
|
-
[CarbonTx.Types.
|
|
56
|
-
[CarbonTx.Types.
|
|
57
|
-
[CarbonTx.Types.
|
|
58
|
-
[CarbonTx.Types.
|
|
148
|
+
[CarbonTx.Types.MsgSupplyAsset]: utils_1.generateAminoType(MsgSupplyAsset),
|
|
149
|
+
[CarbonTx.Types.MsgWithdrawAsset]: utils_1.generateAminoType(MsgWithdrawAsset),
|
|
150
|
+
[CarbonTx.Types.MsgLockCollateral]: utils_1.generateAminoType(MsgLockCollateral),
|
|
151
|
+
[CarbonTx.Types.MsgUnlockCollateral]: utils_1.generateAminoType(MsgUnlockCollateral),
|
|
152
|
+
[CarbonTx.Types.MsgBorrowAsset]: utils_1.generateAminoType(MsgBorrowAsset),
|
|
153
|
+
[CarbonTx.Types.MsgRepayAsset]: utils_1.generateAminoType(MsgRepayAsset),
|
|
154
|
+
[CarbonTx.Types.MsgSupplyAssetAndLockCollateral]: utils_1.generateAminoType(MsgSupplyAssetAndLockCollateral),
|
|
155
|
+
[CarbonTx.Types.MsgUnlockCollateralAndWithdrawAsset]: utils_1.generateAminoType(MsgUnlockCollateralAndWithdrawAsset),
|
|
156
|
+
[CarbonTx.Types.MsgLiquidateCollateral]: utils_1.generateAminoType(MsgLiquidateCollateral),
|
|
157
|
+
[CarbonTx.Types.MsgRepayAssetWithCdpTokens]: utils_1.generateAminoType(MsgRepayAssetWithCdpTokens),
|
|
158
|
+
[CarbonTx.Types.MsgRepayAssetWithCollateral]: utils_1.generateAminoType(MsgRepayAssetWithCollateral),
|
|
159
|
+
[CarbonTx.Types.MsgMintStablecoin]: utils_1.generateAminoType(MsgMintStablecoin),
|
|
160
|
+
[CarbonTx.Types.MsgReturnStablecoin]: utils_1.generateAminoType(MsgReturnStablecoin),
|
|
161
|
+
[CarbonTx.Types.MsgLiquidateCollateralWithCdpTokens]: utils_1.generateAminoType(MsgLiquidateCollateralWithCdpTokens),
|
|
162
|
+
[CarbonTx.Types.MsgLiquidateCollateralWithCollateral]: utils_1.generateAminoType(MsgLiquidateCollateralWithCollateral),
|
|
163
|
+
[CarbonTx.Types.MsgLiquidateCollateralWithStablecoin]: utils_1.generateAminoType(MsgLiquidateCollateralWithStablecoin),
|
|
164
|
+
[CarbonTx.Types.MsgCreateRewardScheme]: utils_1.generateAminoType(MsgCreateRewardScheme),
|
|
165
|
+
[CarbonTx.Types.MsgUpdateRewardScheme]: utils_1.generateAminoType(MsgUpdateRewardScheme),
|
|
166
|
+
[CarbonTx.Types.MsgClaimRewards]: utils_1.generateAminoType(MsgClaimRewards),
|
|
167
|
+
[CarbonTx.Types.MsgSetStablecoinMintCap]: utils_1.generateAminoType(MsgSetStablecoinMintCap),
|
|
168
|
+
[CarbonTx.Types.MsgSetStalePriceGracePeriod]: utils_1.generateAminoType(MsgSetStalePriceGracePeriod),
|
|
169
|
+
[CarbonTx.Types.MsgSetCdpPaused]: utils_1.generateAminoType(MsgSetCdpPaused),
|
|
59
170
|
};
|
|
60
171
|
exports.default = CdpAmino;
|
|
@@ -34,7 +34,7 @@ const MsgMintToken = {
|
|
|
34
34
|
valueMap: {},
|
|
35
35
|
};
|
|
36
36
|
const CoinAmino = {
|
|
37
|
-
[CarbonTx.Types.MsgWithdraw]:
|
|
38
|
-
[CarbonTx.Types.MsgMintToken]:
|
|
37
|
+
[CarbonTx.Types.MsgWithdraw]: utils_1.generateAminoType(MsgWithdraw),
|
|
38
|
+
[CarbonTx.Types.MsgMintToken]: utils_1.generateAminoType(MsgMintToken),
|
|
39
39
|
};
|
|
40
40
|
exports.default = CoinAmino;
|
|
@@ -172,7 +172,7 @@ const SettlementPrice = {
|
|
|
172
172
|
};
|
|
173
173
|
;
|
|
174
174
|
const preProcessAmino = (value, valueMap) => {
|
|
175
|
-
return
|
|
175
|
+
return utils_1.mapEachIndiv(value, valueMap, false);
|
|
176
176
|
};
|
|
177
177
|
const checkDecodeProposal = (content, amino) => {
|
|
178
178
|
const decodedValue = util_1.GovUtils.decodeContent(content);
|
|
@@ -403,8 +403,8 @@ const proposalAminoProcess = {
|
|
|
403
403
|
},
|
|
404
404
|
};
|
|
405
405
|
const GovAmino = {
|
|
406
|
-
[CarbonTx.Types.MsgSubmitProposal]:
|
|
407
|
-
[CarbonTx.Types.MsgDeposit]:
|
|
408
|
-
[CarbonTx.Types.MsgVote]:
|
|
406
|
+
[CarbonTx.Types.MsgSubmitProposal]: utils_1.generateAminoType(SubmitProposalMsg, proposalAminoProcess),
|
|
407
|
+
[CarbonTx.Types.MsgDeposit]: utils_1.generateAminoType(MsgDeposit),
|
|
408
|
+
[CarbonTx.Types.MsgVote]: utils_1.generateAminoType(MsgVote),
|
|
409
409
|
};
|
|
410
410
|
exports.default = GovAmino;
|
|
@@ -55,6 +55,6 @@ const pruneTransferProcess = {
|
|
|
55
55
|
},
|
|
56
56
|
};
|
|
57
57
|
const IbcAmino = {
|
|
58
|
-
[CarbonTx.Types.MsgTransfer]:
|
|
58
|
+
[CarbonTx.Types.MsgTransfer]: utils_1.generateAminoType(MsgTransfer, pruneTransferProcess),
|
|
59
59
|
};
|
|
60
60
|
exports.default = IbcAmino;
|
|
@@ -31,6 +31,6 @@ const MsgSetLeverage = {
|
|
|
31
31
|
},
|
|
32
32
|
};
|
|
33
33
|
const LeverageAmino = {
|
|
34
|
-
[CarbonTx.Types.MsgSetLeverage]:
|
|
34
|
+
[CarbonTx.Types.MsgSetLeverage]: utils_1.generateAminoType(MsgSetLeverage),
|
|
35
35
|
};
|
|
36
36
|
exports.default = LeverageAmino;
|