carbon-js-sdk 0.2.13 → 0.2.14-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/clients/NEOClient.js +1 -1
- package/lib/clients/TokenClient.d.ts +5 -0
- package/lib/clients/TokenClient.js +29 -7
- 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 -12
- package/lib/codec/cdp/asset_params.js +14 -81
- package/lib/codec/cdp/debt_info.d.ts +1 -1
- package/lib/codec/cdp/debt_info.js +11 -13
- package/lib/codec/cdp/event.d.ts +321 -22
- package/lib/codec/cdp/event.js +2005 -82
- package/lib/codec/cdp/genesis.d.ts +80 -4
- package/lib/codec/cdp/genesis.js +531 -22
- package/lib/codec/cdp/params.d.ts +35 -0
- package/lib/codec/cdp/params.js +47 -1
- package/lib/codec/cdp/query.d.ts +437 -89
- package/lib/codec/cdp/query.js +1966 -177
- package/lib/codec/cdp/reward_scheme.d.ts +85 -0
- package/lib/codec/cdp/reward_scheme.js +656 -0
- package/lib/codec/cdp/stablecoin_debt_info.d.ts +1 -1
- package/lib/codec/cdp/stablecoin_debt_info.js +11 -13
- package/lib/codec/cdp/tx.d.ts +667 -96
- package/lib/codec/cdp/tx.js +3196 -243
- 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 -5
- package/lib/codec/coin/query.js +2 -8
- package/lib/codec/coin/token.d.ts +11 -0
- package/lib/codec/coin/token.js +65 -1
- package/lib/codec/coin/tx.d.ts +1 -1
- package/lib/codec/coin/tx.js +1 -1
- package/lib/codec/cosmos/auth/v1beta1/genesis.d.ts +1 -1
- package/lib/codec/cosmos/auth/v1beta1/genesis.js +1 -1
- package/lib/codec/cosmos/auth/v1beta1/query.d.ts +2 -2
- package/lib/codec/cosmos/auth/v1beta1/query.js +2 -2
- package/lib/codec/cosmos/authz/v1beta1/authz.d.ts +19 -0
- package/lib/codec/cosmos/authz/v1beta1/authz.js +89 -1
- package/lib/codec/cosmos/authz/v1beta1/genesis.d.ts +1 -15
- package/lib/codec/cosmos/authz/v1beta1/genesis.js +7 -120
- package/lib/codec/cosmos/authz/v1beta1/query.d.ts +70 -2
- package/lib/codec/cosmos/authz/v1beta1/query.js +275 -3
- package/lib/codec/cosmos/authz/v1beta1/tx.d.ts +1 -1
- package/lib/codec/cosmos/authz/v1beta1/tx.js +1 -1
- package/lib/codec/cosmos/bank/v1beta1/authz.d.ts +1 -1
- package/lib/codec/cosmos/bank/v1beta1/authz.js +1 -1
- package/lib/codec/cosmos/bank/v1beta1/bank.d.ts +1 -1
- package/lib/codec/cosmos/bank/v1beta1/bank.js +1 -1
- package/lib/codec/cosmos/bank/v1beta1/export.d.ts +1 -1
- package/lib/codec/cosmos/bank/v1beta1/export.js +3 -1
- package/lib/codec/cosmos/bank/v1beta1/genesis.d.ts +2 -2
- package/lib/codec/cosmos/bank/v1beta1/genesis.js +2 -2
- package/lib/codec/cosmos/bank/v1beta1/query.d.ts +43 -3
- package/lib/codec/cosmos/bank/v1beta1/query.js +140 -4
- package/lib/codec/cosmos/bank/v1beta1/tx.d.ts +2 -2
- package/lib/codec/cosmos/bank/v1beta1/tx.js +2 -2
- package/lib/codec/cosmos/base/snapshots/v1beta1/snapshot.d.ts +64 -0
- package/lib/codec/cosmos/base/snapshots/v1beta1/snapshot.js +343 -1
- package/lib/codec/cosmos/base/tendermint/v1beta1/query.d.ts +1 -1
- package/lib/codec/cosmos/base/tendermint/v1beta1/query.js +1 -1
- package/lib/codec/cosmos/capability/v1beta1/genesis.d.ts +1 -1
- package/lib/codec/cosmos/capability/v1beta1/genesis.js +1 -1
- package/lib/codec/cosmos/crisis/v1beta1/genesis.d.ts +1 -1
- package/lib/codec/cosmos/crisis/v1beta1/genesis.js +1 -1
- package/lib/codec/cosmos/distribution/v1beta1/distribution.d.ts +1 -1
- package/lib/codec/cosmos/distribution/v1beta1/distribution.js +1 -1
- package/lib/codec/cosmos/distribution/v1beta1/genesis.d.ts +2 -2
- package/lib/codec/cosmos/distribution/v1beta1/genesis.js +2 -2
- package/lib/codec/cosmos/distribution/v1beta1/query.d.ts +3 -3
- package/lib/codec/cosmos/distribution/v1beta1/query.js +3 -3
- package/lib/codec/cosmos/distribution/v1beta1/tx.d.ts +1 -1
- package/lib/codec/cosmos/distribution/v1beta1/tx.js +1 -1
- package/lib/codec/cosmos/evidence/v1beta1/query.d.ts +1 -1
- package/lib/codec/cosmos/evidence/v1beta1/query.js +1 -1
- package/lib/codec/cosmos/feegrant/v1beta1/feegrant.d.ts +1 -1
- package/lib/codec/cosmos/feegrant/v1beta1/feegrant.js +1 -1
- package/lib/codec/cosmos/feegrant/v1beta1/genesis.d.ts +1 -1
- package/lib/codec/cosmos/feegrant/v1beta1/genesis.js +1 -1
- package/lib/codec/cosmos/feegrant/v1beta1/query.d.ts +35 -2
- package/lib/codec/cosmos/feegrant/v1beta1/query.js +139 -3
- package/lib/codec/cosmos/gov/v1beta1/genesis.d.ts +1 -1
- package/lib/codec/cosmos/gov/v1beta1/genesis.js +1 -1
- package/lib/codec/cosmos/gov/v1beta1/gov.d.ts +1 -1
- package/lib/codec/cosmos/gov/v1beta1/gov.js +1 -1
- package/lib/codec/cosmos/gov/v1beta1/query.d.ts +2 -2
- package/lib/codec/cosmos/gov/v1beta1/query.js +2 -2
- package/lib/codec/cosmos/gov/v1beta1/tx.d.ts +2 -2
- package/lib/codec/cosmos/gov/v1beta1/tx.js +2 -2
- package/lib/codec/cosmos/mint/v1beta1/genesis.d.ts +1 -1
- package/lib/codec/cosmos/mint/v1beta1/genesis.js +1 -1
- package/lib/codec/cosmos/mint/v1beta1/query.d.ts +1 -1
- package/lib/codec/cosmos/mint/v1beta1/query.js +1 -1
- package/lib/codec/cosmos/params/v1beta1/query.d.ts +1 -1
- package/lib/codec/cosmos/params/v1beta1/query.js +1 -1
- package/lib/codec/cosmos/slashing/v1beta1/genesis.d.ts +1 -1
- package/lib/codec/cosmos/slashing/v1beta1/genesis.js +1 -1
- package/lib/codec/cosmos/slashing/v1beta1/query.d.ts +2 -2
- package/lib/codec/cosmos/slashing/v1beta1/query.js +2 -2
- package/lib/codec/cosmos/staking/v1beta1/authz.d.ts +1 -1
- package/lib/codec/cosmos/staking/v1beta1/authz.js +1 -1
- package/lib/codec/cosmos/staking/v1beta1/genesis.d.ts +1 -1
- package/lib/codec/cosmos/staking/v1beta1/genesis.js +1 -1
- package/lib/codec/cosmos/staking/v1beta1/query.d.ts +2 -2
- package/lib/codec/cosmos/staking/v1beta1/query.js +2 -2
- package/lib/codec/cosmos/staking/v1beta1/staking.d.ts +1 -1
- package/lib/codec/cosmos/staking/v1beta1/staking.js +1 -1
- package/lib/codec/cosmos/staking/v1beta1/tx.d.ts +2 -2
- package/lib/codec/cosmos/staking/v1beta1/tx.js +2 -2
- package/lib/codec/cosmos/tx/signing/v1beta1/signing.d.ts +14 -1
- package/lib/codec/cosmos/tx/signing/v1beta1/signing.js +19 -1
- package/lib/codec/cosmos/tx/v1beta1/export.d.ts +1 -1
- package/lib/codec/cosmos/tx/v1beta1/export.js +3 -1
- package/lib/codec/cosmos/tx/v1beta1/service.d.ts +53 -5
- package/lib/codec/cosmos/tx/v1beta1/service.js +179 -4
- package/lib/codec/cosmos/tx/v1beta1/tx.d.ts +3 -3
- package/lib/codec/cosmos/tx/v1beta1/tx.js +3 -3
- package/lib/codec/cosmos/upgrade/v1beta1/query.d.ts +1 -1
- package/lib/codec/cosmos/upgrade/v1beta1/query.js +1 -1
- package/lib/codec/cosmos/vesting/v1beta1/tx.d.ts +1 -1
- package/lib/codec/cosmos/vesting/v1beta1/tx.js +1 -1
- package/lib/codec/cosmos/vesting/v1beta1/vesting.d.ts +2 -2
- package/lib/codec/cosmos/vesting/v1beta1/vesting.js +2 -2
- package/lib/codec/fee/genesis.d.ts +1 -1
- package/lib/codec/fee/genesis.js +1 -1
- package/lib/codec/fee/proposal.d.ts +1 -1
- package/lib/codec/fee/proposal.js +1 -1
- package/lib/codec/fee/query.d.ts +1 -1
- package/lib/codec/fee/query.js +1 -1
- package/lib/codec/fee/tx.d.ts +1 -1
- package/lib/codec/fee/tx.js +1 -1
- package/lib/codec/headersync/genesis.d.ts +1 -1
- package/lib/codec/headersync/genesis.js +1 -1
- package/lib/codec/headersync/query.d.ts +1 -1
- package/lib/codec/headersync/query.js +1 -1
- package/lib/codec/index.d.ts +71 -23
- package/lib/codec/index.js +590 -384
- package/lib/codec/inflation/genesis.d.ts +1 -1
- package/lib/codec/inflation/genesis.js +1 -1
- package/lib/codec/inflation/query.d.ts +1 -1
- package/lib/codec/inflation/query.js +1 -1
- package/lib/codec/insurance/genesis.d.ts +1 -1
- package/lib/codec/insurance/genesis.js +1 -1
- package/lib/codec/leverage/genesis.d.ts +1 -1
- package/lib/codec/leverage/genesis.js +1 -1
- package/lib/codec/leverage/query.d.ts +1 -1
- package/lib/codec/leverage/query.js +1 -1
- package/lib/codec/liquidation/genesis.d.ts +1 -1
- package/lib/codec/liquidation/genesis.js +1 -1
- package/lib/codec/liquidation/query.d.ts +1 -1
- package/lib/codec/liquidation/query.js +1 -1
- package/lib/codec/liquidation/quote_changes.d.ts +1 -1
- package/lib/codec/liquidation/quote_changes.js +1 -1
- package/lib/codec/liquiditypool/event.d.ts +2 -2
- package/lib/codec/liquiditypool/event.js +2 -2
- package/lib/codec/liquiditypool/genesis.d.ts +2 -2
- package/lib/codec/liquiditypool/genesis.js +2 -2
- package/lib/codec/liquiditypool/proposal.d.ts +1 -1
- package/lib/codec/liquiditypool/proposal.js +1 -1
- package/lib/codec/liquiditypool/query.d.ts +2 -2
- package/lib/codec/liquiditypool/query.js +2 -2
- package/lib/codec/liquiditypool/tx.d.ts +1 -1
- package/lib/codec/liquiditypool/tx.js +1 -1
- package/lib/codec/lockproxy/genesis.d.ts +1 -1
- package/lib/codec/lockproxy/genesis.js +1 -1
- package/lib/codec/lockproxy/query.d.ts +1 -1
- package/lib/codec/lockproxy/query.js +1 -1
- package/lib/codec/market/event.d.ts +1 -1
- package/lib/codec/market/event.js +1 -1
- package/lib/codec/market/genesis.d.ts +2 -1
- package/lib/codec/market/genesis.js +20 -2
- package/lib/codec/market/proposal.d.ts +1 -1
- package/lib/codec/market/proposal.js +1 -1
- package/lib/codec/market/query.d.ts +1 -1
- package/lib/codec/market/query.js +1 -1
- package/lib/codec/market/tx.d.ts +1 -1
- package/lib/codec/market/tx.js +1 -1
- package/lib/codec/marketstats/genesis.d.ts +1 -1
- package/lib/codec/marketstats/genesis.js +1 -1
- package/lib/codec/marketstats/query.d.ts +2 -2
- package/lib/codec/marketstats/query.js +2 -2
- package/lib/codec/misc/message.d.ts +1 -1
- package/lib/codec/misc/message.js +1 -1
- package/lib/codec/misc/query.d.ts +3 -3
- package/lib/codec/misc/query.js +3 -3
- package/lib/codec/misc/trade.d.ts +1 -0
- package/lib/codec/misc/trade.js +17 -0
- package/lib/codec/misc/transaction.d.ts +1 -1
- package/lib/codec/misc/transaction.js +1 -1
- package/lib/codec/oracle/event.d.ts +1 -1
- package/lib/codec/oracle/event.js +1 -1
- package/lib/codec/oracle/genesis.d.ts +1 -1
- package/lib/codec/oracle/genesis.js +1 -1
- package/lib/codec/oracle/proposal.d.ts +1 -1
- package/lib/codec/oracle/proposal.js +1 -1
- package/lib/codec/oracle/query.d.ts +2 -2
- package/lib/codec/oracle/query.js +2 -2
- package/lib/codec/order/event.d.ts +1 -1
- package/lib/codec/order/event.js +1 -1
- package/lib/codec/order/genesis.d.ts +1 -1
- package/lib/codec/order/genesis.js +1 -1
- package/lib/codec/order/query.d.ts +1 -1
- package/lib/codec/order/query.js +1 -1
- package/lib/codec/position/event.d.ts +1 -1
- package/lib/codec/position/event.js +1 -1
- package/lib/codec/position/genesis.d.ts +1 -1
- package/lib/codec/position/genesis.js +1 -1
- package/lib/codec/position/query.d.ts +1 -1
- package/lib/codec/position/query.js +1 -1
- package/lib/codec/pricing/event.d.ts +11 -1
- package/lib/codec/pricing/event.js +52 -2
- package/lib/codec/pricing/genesis.d.ts +2 -1
- package/lib/codec/pricing/genesis.js +20 -5
- package/lib/codec/pricing/pricing.d.ts +13 -0
- package/lib/codec/pricing/pricing.js +83 -1
- package/lib/codec/pricing/query.d.ts +68 -1
- package/lib/codec/pricing/query.js +321 -2
- package/lib/codec/profile/event.d.ts +1 -1
- package/lib/codec/profile/event.js +1 -1
- package/lib/codec/profile/genesis.d.ts +1 -1
- package/lib/codec/profile/genesis.js +1 -1
- package/lib/codec/profile/query.d.ts +1 -1
- package/lib/codec/profile/query.js +1 -1
- package/lib/codec/subaccount/genesis.d.ts +1 -1
- package/lib/codec/subaccount/genesis.js +1 -1
- package/lib/codec/subaccount/query.d.ts +1 -1
- package/lib/codec/subaccount/query.js +1 -1
- package/lib/codec/tendermint/abci/types.d.ts +4 -4
- package/lib/codec/tendermint/abci/types.js +4 -4
- package/lib/codec/tendermint/types/block.d.ts +2 -2
- package/lib/codec/tendermint/types/block.js +2 -2
- package/lib/codec/tendermint/types/evidence.d.ts +2 -2
- package/lib/codec/tendermint/types/evidence.js +2 -2
- package/lib/codec/tendermint/types/types.d.ts +3 -3
- package/lib/codec/tendermint/types/types.js +3 -3
- package/lib/codec/tendermint/types/validator.d.ts +1 -1
- package/lib/codec/tendermint/types/validator.js +1 -1
- package/lib/modules/admin.d.ts +53 -1
- package/lib/modules/admin.js +175 -43
- package/lib/modules/cdp.d.ts +104 -13
- package/lib/modules/cdp.js +618 -20
- package/lib/provider/amino/types/admin.js +48 -7
- package/lib/provider/amino/types/cdp.js +72 -32
- package/lib/util/number.d.ts +1 -0
- package/lib/util/number.js +2 -1
- package/lib/util/tx.d.ts +58 -14
- package/lib/wallet/CarbonSigningClient.js +27 -2
- package/lib/wallet/CarbonWallet.js +0 -1
- package/lib/websocket/channel.js +60 -0
- package/lib/websocket/models.d.ts +179 -21
- package/lib/websocket/types.d.ts +69 -3
- package/lib/websocket/types.js +27 -0
- package/package.json +1 -1
|
@@ -43,6 +43,14 @@ 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",
|
|
46
54
|
};
|
|
47
55
|
const MsgCreateOracle = {
|
|
48
56
|
aminoType: TxTypes.CreateOracle,
|
|
@@ -84,12 +92,6 @@ const MsgCreateMarket = {
|
|
|
84
92
|
currentQuotePriceUsd: utils_1.ConvertEncType.Dec,
|
|
85
93
|
},
|
|
86
94
|
};
|
|
87
|
-
const MsgCreateVaultType = {
|
|
88
|
-
aminoType: TxTypes.CreateVaultType,
|
|
89
|
-
valueMap: {
|
|
90
|
-
collateralizationRatio: utils_1.ConvertEncType.Dec,
|
|
91
|
-
},
|
|
92
|
-
};
|
|
93
95
|
const MsgLinkPool = {
|
|
94
96
|
aminoType: TxTypes.LinkPool,
|
|
95
97
|
valueMap: {
|
|
@@ -177,6 +179,38 @@ const MsgEditValidator = {
|
|
|
177
179
|
commissionRate: utils_1.ConvertEncType.Dec,
|
|
178
180
|
},
|
|
179
181
|
};
|
|
182
|
+
const MsgAddRateStrategy = {
|
|
183
|
+
aminoType: TxTypes.AddRateStrategy,
|
|
184
|
+
valueMap: {}
|
|
185
|
+
};
|
|
186
|
+
const MsgUpdateRateStrategy = {
|
|
187
|
+
aminoType: TxTypes.UpdateRateStrategy,
|
|
188
|
+
valueMap: {}
|
|
189
|
+
};
|
|
190
|
+
const MsgRemoveRateStrategy = {
|
|
191
|
+
aminoType: TxTypes.RemoveRateStrategy,
|
|
192
|
+
valueMap: {}
|
|
193
|
+
};
|
|
194
|
+
const MsgAddAsset = {
|
|
195
|
+
aminoType: TxTypes.AddAsset,
|
|
196
|
+
valueMap: {}
|
|
197
|
+
};
|
|
198
|
+
const MsgUpdateAsset = {
|
|
199
|
+
aminoType: TxTypes.UpdateAsset,
|
|
200
|
+
valueMap: {}
|
|
201
|
+
};
|
|
202
|
+
const MsgSetLiquidationFee = {
|
|
203
|
+
aminoType: TxTypes.SetLiquidationFee,
|
|
204
|
+
valueMap: {}
|
|
205
|
+
};
|
|
206
|
+
const MsgSetInterestFee = {
|
|
207
|
+
aminoType: TxTypes.SetInterestFee,
|
|
208
|
+
valueMap: {}
|
|
209
|
+
};
|
|
210
|
+
const MsgSetStableCoinInterestRate = {
|
|
211
|
+
aminoType: TxTypes.SetStableCoinInterestRate,
|
|
212
|
+
valueMap: {}
|
|
213
|
+
};
|
|
180
214
|
const AdminAmino = {
|
|
181
215
|
[CarbonTx.Types.MsgCreateOracle]: (0, utils_1.generateAminoType)(MsgCreateOracle),
|
|
182
216
|
[CarbonTx.Types.MsgBindToken]: (0, utils_1.generateAminoType)(MsgBindToken),
|
|
@@ -184,7 +218,6 @@ const AdminAmino = {
|
|
|
184
218
|
[CarbonTx.Types.MsgLinkToken]: (0, utils_1.generateAminoType)(MsgLinkToken),
|
|
185
219
|
[CarbonTx.Types.MsgSyncToken]: (0, utils_1.generateAminoType)(MsgSyncToken),
|
|
186
220
|
[CarbonTx.Types.MsgCreateMarket]: (0, utils_1.generateAminoType)(MsgCreateMarket),
|
|
187
|
-
[CarbonTx.Types.MsgCreateVaultType]: (0, utils_1.generateAminoType)(MsgCreateVaultType),
|
|
188
221
|
[CarbonTx.Types.MsgLinkPool]: (0, utils_1.generateAminoType)(MsgLinkPool),
|
|
189
222
|
[CarbonTx.Types.MsgUnlinkPool]: (0, utils_1.generateAminoType)(MsgUnlinkPool),
|
|
190
223
|
[CarbonTx.Types.MsgUpdatePool]: (0, utils_1.generateAminoType)(MsgUpdatePool),
|
|
@@ -198,5 +231,13 @@ const AdminAmino = {
|
|
|
198
231
|
[CarbonTx.Types.MsgRemoveMinGasPrice]: (0, utils_1.generateAminoType)(MsgRemoveMinGasPrice),
|
|
199
232
|
[CarbonTx.Types.MsgCreateValidator]: (0, utils_1.generateAminoType)(MsgCreateValidator),
|
|
200
233
|
[CarbonTx.Types.MsgEditValidator]: (0, utils_1.generateAminoType)(MsgEditValidator),
|
|
234
|
+
[CarbonTx.Types.MsgAddRateStrategy]: (0, utils_1.generateAminoType)(MsgAddRateStrategy),
|
|
235
|
+
[CarbonTx.Types.MsgUpdateRateStrategy]: (0, utils_1.generateAminoType)(MsgUpdateRateStrategy),
|
|
236
|
+
[CarbonTx.Types.MsgRemoveRateStrategy]: (0, utils_1.generateAminoType)(MsgRemoveRateStrategy),
|
|
237
|
+
[CarbonTx.Types.MsgAddAsset]: (0, utils_1.generateAminoType)(MsgAddAsset),
|
|
238
|
+
[CarbonTx.Types.MsgUpdateAsset]: (0, utils_1.generateAminoType)(MsgUpdateAsset),
|
|
239
|
+
[CarbonTx.Types.MsgSetLiquidationFee]: (0, utils_1.generateAminoType)(MsgSetLiquidationFee),
|
|
240
|
+
[CarbonTx.Types.MsgSetInterestFee]: (0, utils_1.generateAminoType)(MsgSetInterestFee),
|
|
241
|
+
[CarbonTx.Types.MsgSetStablecoinInterestRate]: (0, utils_1.generateAminoType)(MsgSetStableCoinInterestRate),
|
|
201
242
|
};
|
|
202
243
|
exports.default = AdminAmino;
|
|
@@ -22,39 +22,79 @@ 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
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
},
|
|
41
|
-
};
|
|
42
|
-
const
|
|
43
|
-
aminoType: TxTypes.
|
|
44
|
-
valueMap: {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
},
|
|
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
|
+
};
|
|
38
|
+
const MsgSupplyAsset = {
|
|
39
|
+
aminoType: TxTypes.SupplyAsset,
|
|
40
|
+
valueMap: {},
|
|
41
|
+
};
|
|
42
|
+
const MsgWithdrawAsset = {
|
|
43
|
+
aminoType: TxTypes.WithdrawAsset,
|
|
44
|
+
valueMap: {},
|
|
45
|
+
};
|
|
46
|
+
const MsgLockCollateral = {
|
|
47
|
+
aminoType: TxTypes.LockCollateral,
|
|
48
|
+
valueMap: {},
|
|
49
|
+
};
|
|
50
|
+
const MsgUnlockCollateral = {
|
|
51
|
+
aminoType: TxTypes.UnlockCollateral,
|
|
52
|
+
valueMap: {},
|
|
53
|
+
};
|
|
54
|
+
const MsgBorrowAsset = {
|
|
55
|
+
aminoType: TxTypes.BorrowAsset,
|
|
56
|
+
valueMap: {},
|
|
57
|
+
};
|
|
58
|
+
const MsgRepayAsset = {
|
|
59
|
+
aminoType: TxTypes.RepayAsset,
|
|
60
|
+
valueMap: {},
|
|
61
|
+
};
|
|
62
|
+
const MsgSupplyAssetAndLockCollateral = {
|
|
63
|
+
aminoType: TxTypes.SupplyAssetAndLockCollateral,
|
|
64
|
+
valueMap: {},
|
|
65
|
+
};
|
|
66
|
+
const MsgUnlockCollateralAndWithdrawAsset = {
|
|
67
|
+
aminoType: TxTypes.UnlockCollateralAndWithdrawAsset,
|
|
68
|
+
valueMap: {},
|
|
69
|
+
};
|
|
70
|
+
const MsgLiquidateCollateral = {
|
|
71
|
+
aminoType: TxTypes.LiquidateCollateral,
|
|
72
|
+
valueMap: {},
|
|
73
|
+
};
|
|
74
|
+
const MsgRepayAssetWithCdpTokens = {
|
|
75
|
+
aminoType: TxTypes.RepayAssetWithCdpTokens,
|
|
76
|
+
valueMap: {},
|
|
77
|
+
};
|
|
78
|
+
const MsgRepayAssetWithCollateral = {
|
|
79
|
+
aminoType: TxTypes.RepayAssetWithCollateral,
|
|
80
|
+
valueMap: {},
|
|
81
|
+
};
|
|
82
|
+
const MsgMintStablecoin = {
|
|
83
|
+
aminoType: TxTypes.MintStablecoin,
|
|
84
|
+
valueMap: {},
|
|
53
85
|
};
|
|
54
86
|
const CdpAmino = {
|
|
55
|
-
[CarbonTx.Types.
|
|
56
|
-
[CarbonTx.Types.
|
|
57
|
-
[CarbonTx.Types.
|
|
58
|
-
[CarbonTx.Types.
|
|
87
|
+
[CarbonTx.Types.MsgSupplyAsset]: (0, utils_1.generateAminoType)(MsgSupplyAsset),
|
|
88
|
+
[CarbonTx.Types.MsgWithdrawAsset]: (0, utils_1.generateAminoType)(MsgWithdrawAsset),
|
|
89
|
+
[CarbonTx.Types.MsgLockCollateral]: (0, utils_1.generateAminoType)(MsgLockCollateral),
|
|
90
|
+
[CarbonTx.Types.MsgUnlockCollateral]: (0, utils_1.generateAminoType)(MsgUnlockCollateral),
|
|
91
|
+
[CarbonTx.Types.MsgBorrowAsset]: (0, utils_1.generateAminoType)(MsgBorrowAsset),
|
|
92
|
+
[CarbonTx.Types.MsgRepayAsset]: (0, utils_1.generateAminoType)(MsgRepayAsset),
|
|
93
|
+
[CarbonTx.Types.MsgSupplyAssetAndLockCollateral]: (0, utils_1.generateAminoType)(MsgSupplyAssetAndLockCollateral),
|
|
94
|
+
[CarbonTx.Types.MsgUnlockCollateralAndWithdrawAsset]: (0, utils_1.generateAminoType)(MsgUnlockCollateralAndWithdrawAsset),
|
|
95
|
+
[CarbonTx.Types.MsgLiquidateCollateral]: (0, utils_1.generateAminoType)(MsgLiquidateCollateral),
|
|
96
|
+
[CarbonTx.Types.MsgRepayAssetWithCdpTokens]: (0, utils_1.generateAminoType)(MsgRepayAssetWithCdpTokens),
|
|
97
|
+
[CarbonTx.Types.MsgRepayAssetWithCollateral]: (0, utils_1.generateAminoType)(MsgRepayAssetWithCollateral),
|
|
98
|
+
[CarbonTx.Types.MsgMintStablecoin]: (0, utils_1.generateAminoType)(MsgMintStablecoin),
|
|
59
99
|
};
|
|
60
100
|
exports.default = CdpAmino;
|
package/lib/util/number.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import BigNumber from "bignumber.js";
|
|
2
2
|
export declare const BN_ONE: BigNumber;
|
|
3
3
|
export declare const BN_ZERO: BigNumber;
|
|
4
|
+
export declare const BN_10000: BigNumber;
|
|
4
5
|
export declare const parseBN: (input?: string | number | BigNumber | null | undefined, defaultValue?: BigNumber | undefined) => BigNumber | undefined;
|
|
5
6
|
export declare const bnOrZero: (input?: string | number | BigNumber | null | undefined, defaultValue?: BigNumber) => BigNumber;
|
|
6
7
|
export declare const toHuman: (value?: string | number | BigNumber | null | undefined, decimals?: string | number | BigNumber | null | undefined) => BigNumber | undefined;
|
package/lib/util/number.js
CHANGED
|
@@ -3,10 +3,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.generateNonce = exports.toUnitless = exports.toHuman = exports.bnOrZero = exports.parseBN = exports.BN_ZERO = exports.BN_ONE = void 0;
|
|
6
|
+
exports.generateNonce = exports.toUnitless = exports.toHuman = exports.bnOrZero = exports.parseBN = exports.BN_10000 = exports.BN_ZERO = exports.BN_ONE = void 0;
|
|
7
7
|
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
8
8
|
exports.BN_ONE = new bignumber_js_1.default(1);
|
|
9
9
|
exports.BN_ZERO = new bignumber_js_1.default(0);
|
|
10
|
+
exports.BN_10000 = new bignumber_js_1.default(10000);
|
|
10
11
|
const parseBN = (input, defaultValue) => {
|
|
11
12
|
if (!input && input !== 0)
|
|
12
13
|
return defaultValue;
|
package/lib/util/tx.d.ts
CHANGED
|
@@ -57,16 +57,64 @@ export declare const Types: {
|
|
|
57
57
|
MsgCancelOrderResponse: string;
|
|
58
58
|
MsgCancelAll: string;
|
|
59
59
|
MsgCancelAllResponse: string;
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
60
|
+
MsgAddRateStrategy: string;
|
|
61
|
+
MsgAddRateStrategyResponse: string;
|
|
62
|
+
MsgUpdateRateStrategy: string;
|
|
63
|
+
MsgUpdateRateStrategyResponse: string;
|
|
64
|
+
MsgRemoveRateStrategy: string;
|
|
65
|
+
MsgRemoveRateStrategyResponse: string;
|
|
66
|
+
MsgAddAsset: string;
|
|
67
|
+
MsgAddAssetResponse: string;
|
|
68
|
+
MsgUpdateAsset: string;
|
|
69
|
+
MsgUpdateAssetResponse: string;
|
|
70
|
+
MsgSupplyAsset: string;
|
|
71
|
+
MsgSupplyAssetResponse: string;
|
|
72
|
+
MsgWithdrawAsset: string;
|
|
73
|
+
MsgWithdrawAssetResponse: string;
|
|
74
|
+
MsgLockCollateral: string;
|
|
75
|
+
MsgLockCollateralResponse: string;
|
|
76
|
+
MsgUnlockCollateral: string;
|
|
77
|
+
MsgUnlockCollateralResponse: string;
|
|
78
|
+
MsgBorrowAsset: string;
|
|
79
|
+
MsgBorrowAssetResponse: string;
|
|
80
|
+
MsgRepayAsset: string;
|
|
81
|
+
MsgRepayAssetResponse: string;
|
|
82
|
+
MsgSupplyAssetAndLockCollateral: string;
|
|
83
|
+
MsgSupplyAssetAndLockCollateralResponse: string;
|
|
84
|
+
MsgUnlockCollateralAndWithdrawAsset: string;
|
|
85
|
+
MsgUnlockCollateralAndWithdrawAssetResponse: string;
|
|
86
|
+
MsgLiquidateCollateral: string;
|
|
87
|
+
MsgLiquidateCollateralResponse: string;
|
|
88
|
+
MsgSetLiquidationFee: string;
|
|
89
|
+
MsgSetLiquidationFeeResponse: string;
|
|
90
|
+
MsgSetInterestFee: string;
|
|
91
|
+
MsgSetInterestFeeResponse: string;
|
|
92
|
+
MsgRepayAssetWithCdpTokens: string;
|
|
93
|
+
MsgRepayAssetWithCdpTokensResponse: string;
|
|
94
|
+
MsgRepayAssetWithCollateral: string;
|
|
95
|
+
MsgRepayAssetWithCollateralResponse: string;
|
|
96
|
+
MsgSetStablecoinInterestRate: string;
|
|
97
|
+
MsgSetStablecoinInterestRateResponse: string;
|
|
98
|
+
MsgMintStablecoin: string;
|
|
99
|
+
MsgMintStablecoinResponse: string;
|
|
100
|
+
MsgReturnStablecoin: string;
|
|
101
|
+
MsgReturnStablecoinResponse: string;
|
|
102
|
+
MsgSetCompleteLiquidationThreshold: string;
|
|
103
|
+
MsgSetCompleteLiquidationThresholdResponse: string;
|
|
104
|
+
MsgSetMinimumCloseFactor: string;
|
|
105
|
+
MsgSetMinimumCloseFactorResponse: string;
|
|
106
|
+
MsgSetSmallLiquidationSize: string;
|
|
107
|
+
MsgSetSmallLiquidationSizeResponse: string;
|
|
108
|
+
MsgLiquidateCollateralWithCdpTokens: string;
|
|
109
|
+
MsgLiquidateCollateralWithCdpTokensResponse: string;
|
|
110
|
+
MsgLiquidateCollateralWithCollateral: string;
|
|
111
|
+
MsgLiquidateCollateralWithCollateralResponse: string;
|
|
112
|
+
MsgCreateRewardScheme: string;
|
|
113
|
+
MsgCreateRewardSchemeResponse: string;
|
|
114
|
+
MsgUpdateRewardScheme: string;
|
|
115
|
+
MsgUpdateRewardSchemeResponse: string;
|
|
116
|
+
MsgAddRewardReserve: string;
|
|
117
|
+
MsgAddRewardReserveResponse: string;
|
|
70
118
|
MsgSyncGenesis: string;
|
|
71
119
|
MsgSyncGenesisResponse: string;
|
|
72
120
|
MsgSyncHeaders: string;
|
|
@@ -85,10 +133,6 @@ export declare const Types: {
|
|
|
85
133
|
SetMinGasPriceProposal: string;
|
|
86
134
|
RemoveMsgGasCostProposal: string;
|
|
87
135
|
RemoveMinGasPriceProposal: string;
|
|
88
|
-
MsgEnableSend: string;
|
|
89
|
-
MsgEnableSendResponse: string;
|
|
90
|
-
MsgDisableSend: string;
|
|
91
|
-
MsgDisableSendResponse: string;
|
|
92
136
|
MsgCreate: string;
|
|
93
137
|
MsgCreateResponse: string;
|
|
94
138
|
MsgBind: string;
|
|
@@ -14,7 +14,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.CarbonSigningClient = exports.makeSignDocAmino = void 0;
|
|
16
16
|
const codec_1 = require("../codec");
|
|
17
|
-
const signing_1 = require("../codec/cosmos/tx/signing/v1beta1/signing");
|
|
18
17
|
const tx_1 = require("../codec/cosmos/tx/v1beta1/tx");
|
|
19
18
|
const amino_1 = require("@cosmjs/amino");
|
|
20
19
|
const encoding_1 = require("@cosmjs/encoding");
|
|
@@ -23,6 +22,32 @@ const proto_signing_1 = require("@cosmjs/proto-signing");
|
|
|
23
22
|
const stargate_1 = require("@cosmjs/stargate");
|
|
24
23
|
const long_1 = __importDefault(require("long"));
|
|
25
24
|
const provider_1 = require("../provider");
|
|
25
|
+
// Added SignMode enum from cosmjs-types to resolve build error
|
|
26
|
+
var SignMode;
|
|
27
|
+
(function (SignMode) {
|
|
28
|
+
/**
|
|
29
|
+
* SIGN_MODE_UNSPECIFIED - SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be
|
|
30
|
+
* rejected
|
|
31
|
+
*/
|
|
32
|
+
SignMode[SignMode["SIGN_MODE_UNSPECIFIED"] = 0] = "SIGN_MODE_UNSPECIFIED";
|
|
33
|
+
/**
|
|
34
|
+
* SIGN_MODE_DIRECT - SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is
|
|
35
|
+
* verified with raw bytes from Tx
|
|
36
|
+
*/
|
|
37
|
+
SignMode[SignMode["SIGN_MODE_DIRECT"] = 1] = "SIGN_MODE_DIRECT";
|
|
38
|
+
/**
|
|
39
|
+
* SIGN_MODE_TEXTUAL - SIGN_MODE_TEXTUAL is a future signing mode that will verify some
|
|
40
|
+
* human-readable textual representation on top of the binary representation
|
|
41
|
+
* from SIGN_MODE_DIRECT
|
|
42
|
+
*/
|
|
43
|
+
SignMode[SignMode["SIGN_MODE_TEXTUAL"] = 2] = "SIGN_MODE_TEXTUAL";
|
|
44
|
+
/**
|
|
45
|
+
* SIGN_MODE_LEGACY_AMINO_JSON - SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses
|
|
46
|
+
* Amino JSON and will be removed in the future
|
|
47
|
+
*/
|
|
48
|
+
SignMode[SignMode["SIGN_MODE_LEGACY_AMINO_JSON"] = 127] = "SIGN_MODE_LEGACY_AMINO_JSON";
|
|
49
|
+
SignMode[SignMode["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
50
|
+
})(SignMode || (SignMode = {}));
|
|
26
51
|
function makeSignDocAmino(msgs, fee, chainId, memo, accountNumber, sequence, timeoutHeight = 0) {
|
|
27
52
|
const timeoutHeightStr = typeof timeoutHeight === "number" ? timeoutHeight.toString(10) : timeoutHeight;
|
|
28
53
|
return {
|
|
@@ -101,7 +126,7 @@ class CarbonSigningClient extends stargate_1.StargateClient {
|
|
|
101
126
|
throw new Error("Failed to retrieve account from signer");
|
|
102
127
|
}
|
|
103
128
|
const pubkey = (0, proto_signing_1.encodePubkey)((0, amino_1.encodeSecp256k1Pubkey)(accountFromSigner.pubkey));
|
|
104
|
-
const signMode =
|
|
129
|
+
const signMode = SignMode.SIGN_MODE_LEGACY_AMINO_JSON;
|
|
105
130
|
const msgs = messages.map((msg) => this.aminoTypes.toAmino(msg));
|
|
106
131
|
const signDoc = makeSignDocAmino(msgs, fee, chainId, memo, accountNumber, sequence, timeoutHeight !== null && timeoutHeight !== void 0 ? timeoutHeight : 0);
|
|
107
132
|
const { signature, signed } = yield signer.signAmino(signerAddress, signDoc);
|
|
@@ -168,7 +168,6 @@ class CarbonWallet {
|
|
|
168
168
|
const response = yield carbonClient.broadcastTx(tx, timeoutMs, pollIntervalMs);
|
|
169
169
|
if ((0, stargate_1.isDeliverTxFailure)(response)) {
|
|
170
170
|
// tx failed
|
|
171
|
-
console.error(response);
|
|
172
171
|
throw new Error(`[${response.code}] ${response.rawLog}`);
|
|
173
172
|
}
|
|
174
173
|
return response;
|
package/lib/websocket/channel.js
CHANGED
|
@@ -72,6 +72,34 @@ const generateChannelId = (params) => {
|
|
|
72
72
|
const { channel, address } = params;
|
|
73
73
|
return [channel, address].join(':');
|
|
74
74
|
}
|
|
75
|
+
case types_1.WSChannel.cdp_borrows: {
|
|
76
|
+
const { channel, address } = params;
|
|
77
|
+
return [channel, address].join(':');
|
|
78
|
+
}
|
|
79
|
+
case types_1.WSChannel.cdp_collaterals: {
|
|
80
|
+
const { channel, address } = params;
|
|
81
|
+
return [channel, address].join(':');
|
|
82
|
+
}
|
|
83
|
+
case types_1.WSChannel.cdp_liquidate_collaterals: {
|
|
84
|
+
const { channel } = params;
|
|
85
|
+
return [channel].join(':');
|
|
86
|
+
}
|
|
87
|
+
case types_1.WSChannel.cdp_all_token_debts: {
|
|
88
|
+
const { channel } = params;
|
|
89
|
+
return [channel].join(':');
|
|
90
|
+
}
|
|
91
|
+
case types_1.WSChannel.cdp_token_debt: {
|
|
92
|
+
const { channel, denom } = params;
|
|
93
|
+
return [channel, denom].join(':');
|
|
94
|
+
}
|
|
95
|
+
case types_1.WSChannel.cdp_reward_schemes: {
|
|
96
|
+
const { channel, address } = params;
|
|
97
|
+
return [channel, address].join(':');
|
|
98
|
+
}
|
|
99
|
+
case types_1.WSChannel.cdp_reward_debts: {
|
|
100
|
+
const { channel, address } = params;
|
|
101
|
+
return [channel, address].join(':');
|
|
102
|
+
}
|
|
75
103
|
default:
|
|
76
104
|
throw new Error(`invalid subscription channel: ${params.channel}`);
|
|
77
105
|
}
|
|
@@ -168,6 +196,38 @@ const parseChannelId = (rawChannelId) => {
|
|
|
168
196
|
channel,
|
|
169
197
|
address,
|
|
170
198
|
};
|
|
199
|
+
case types_1.WSChannel.cdp_borrows:
|
|
200
|
+
return {
|
|
201
|
+
channel,
|
|
202
|
+
address,
|
|
203
|
+
};
|
|
204
|
+
case types_1.WSChannel.cdp_collaterals:
|
|
205
|
+
return {
|
|
206
|
+
channel,
|
|
207
|
+
address,
|
|
208
|
+
};
|
|
209
|
+
case types_1.WSChannel.cdp_liquidate_collaterals:
|
|
210
|
+
return {
|
|
211
|
+
channel,
|
|
212
|
+
};
|
|
213
|
+
case types_1.WSChannel.cdp_all_token_debts:
|
|
214
|
+
return {
|
|
215
|
+
channel,
|
|
216
|
+
};
|
|
217
|
+
case types_1.WSChannel.cdp_token_debt:
|
|
218
|
+
const denom = market;
|
|
219
|
+
return {
|
|
220
|
+
channel,
|
|
221
|
+
denom,
|
|
222
|
+
};
|
|
223
|
+
case types_1.WSChannel.cdp_reward_schemes:
|
|
224
|
+
return {
|
|
225
|
+
address,
|
|
226
|
+
};
|
|
227
|
+
case types_1.WSChannel.cdp_reward_debts:
|
|
228
|
+
return {
|
|
229
|
+
address,
|
|
230
|
+
};
|
|
171
231
|
default:
|
|
172
232
|
throw new Error('Error parsing channelId');
|
|
173
233
|
}
|