carbon-js-sdk 0.2.15 → 0.2.16-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/CarbonSDK.d.ts +13 -1
- package/lib/CarbonSDK.js +31 -2
- package/lib/clients/ETHClient.d.ts +1 -1
- package/lib/clients/NEOClient.d.ts +1 -1
- package/lib/clients/NEOClient.js +1 -1
- 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/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 +0 -13
- package/lib/codec/cdp/reward_scheme.js +1 -91
- 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 +2 -2
- package/lib/codec/cosmos/gov/v1beta1/tx.d.ts +2 -2
- package/lib/codec/cosmos/gov/v1beta1/tx.js +2 -2
- package/lib/codec/cosmos/mint/v1beta1/genesis.d.ts +1 -1
- package/lib/codec/cosmos/mint/v1beta1/genesis.js +1 -1
- package/lib/codec/cosmos/mint/v1beta1/query.d.ts +1 -1
- package/lib/codec/cosmos/mint/v1beta1/query.js +1 -1
- package/lib/codec/cosmos/params/v1beta1/query.d.ts +1 -1
- package/lib/codec/cosmos/params/v1beta1/query.js +1 -1
- package/lib/codec/cosmos/slashing/v1beta1/genesis.d.ts +1 -1
- package/lib/codec/cosmos/slashing/v1beta1/genesis.js +1 -1
- package/lib/codec/cosmos/slashing/v1beta1/query.d.ts +2 -2
- package/lib/codec/cosmos/slashing/v1beta1/query.js +2 -2
- package/lib/codec/cosmos/staking/v1beta1/authz.d.ts +1 -1
- package/lib/codec/cosmos/staking/v1beta1/authz.js +1 -1
- package/lib/codec/cosmos/staking/v1beta1/genesis.d.ts +1 -1
- package/lib/codec/cosmos/staking/v1beta1/genesis.js +1 -1
- package/lib/codec/cosmos/staking/v1beta1/query.d.ts +2 -2
- package/lib/codec/cosmos/staking/v1beta1/query.js +2 -2
- package/lib/codec/cosmos/staking/v1beta1/staking.d.ts +1 -1
- package/lib/codec/cosmos/staking/v1beta1/staking.js +1 -1
- package/lib/codec/cosmos/staking/v1beta1/tx.d.ts +2 -2
- package/lib/codec/cosmos/staking/v1beta1/tx.js +2 -2
- package/lib/codec/cosmos/tx/signing/v1beta1/signing.d.ts +1 -1
- package/lib/codec/cosmos/tx/signing/v1beta1/signing.js +1 -1
- package/lib/codec/cosmos/tx/v1beta1/service.d.ts +3 -3
- package/lib/codec/cosmos/tx/v1beta1/service.js +3 -3
- package/lib/codec/cosmos/tx/v1beta1/tx.d.ts +3 -3
- package/lib/codec/cosmos/tx/v1beta1/tx.js +3 -3
- package/lib/codec/cosmos/upgrade/v1beta1/query.d.ts +1 -1
- package/lib/codec/cosmos/upgrade/v1beta1/query.js +1 -1
- package/lib/codec/cosmos/vesting/v1beta1/tx.d.ts +1 -1
- package/lib/codec/cosmos/vesting/v1beta1/tx.js +1 -1
- package/lib/codec/cosmos/vesting/v1beta1/vesting.d.ts +2 -2
- package/lib/codec/cosmos/vesting/v1beta1/vesting.js +2 -2
- package/lib/codec/fee/genesis.d.ts +1 -1
- package/lib/codec/fee/genesis.js +1 -1
- package/lib/codec/fee/proposal.d.ts +1 -1
- package/lib/codec/fee/proposal.js +1 -1
- package/lib/codec/fee/query.d.ts +1 -1
- package/lib/codec/fee/query.js +1 -1
- package/lib/codec/fee/tx.d.ts +1 -1
- package/lib/codec/fee/tx.js +1 -1
- package/lib/codec/headersync/genesis.d.ts +1 -1
- package/lib/codec/headersync/genesis.js +1 -1
- package/lib/codec/headersync/query.d.ts +1 -1
- package/lib/codec/headersync/query.js +1 -1
- package/lib/codec/index.d.ts +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/network.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 +796 -20
- package/lib/modules/liquiditypool.d.ts +2 -0
- package/lib/modules/liquiditypool.js +2 -0
- package/lib/provider/amino/types/admin.js +72 -7
- package/lib/provider/amino/types/cdp.js +102 -32
- package/lib/provider/amino/types/liquidityPool.js +2 -0
- package/lib/provider/keplr/KeplrAccount.js +5 -0
- package/lib/util/address.d.ts +1 -0
- package/lib/util/address.js +8 -0
- package/lib/util/number.d.ts +1 -0
- package/lib/util/number.js +2 -1
- package/lib/util/tx.d.ts +75 -10
- package/lib/wallet/CarbonSigner.d.ts +5 -2
- package/lib/wallet/CarbonSigner.js +13 -0
- package/lib/wallet/CarbonWallet.js +0 -1
- package/lib/websocket/channel.js +115 -21
- package/lib/websocket/models.d.ts +155 -0
- package/lib/websocket/types.d.ts +87 -3
- package/lib/websocket/types.js +31 -0
- package/package.json +1 -1
package/lib/websocket/channel.js
CHANGED
|
@@ -68,60 +68,104 @@ const generateChannelId = (params) => {
|
|
|
68
68
|
const { channel, id } = params;
|
|
69
69
|
return [channel, id].join(':');
|
|
70
70
|
}
|
|
71
|
+
case types_1.WSChannel.token_prices: {
|
|
72
|
+
const { channel } = params;
|
|
73
|
+
return [channel].join(':');
|
|
74
|
+
}
|
|
75
|
+
case types_1.WSChannel.token_prices_by_denom: {
|
|
76
|
+
const { channel, denom } = params;
|
|
77
|
+
return [channel, denom].join(':');
|
|
78
|
+
}
|
|
71
79
|
case types_1.WSChannel.commitments: {
|
|
72
80
|
const { channel, address } = params;
|
|
73
81
|
return [channel, address].join(':');
|
|
74
82
|
}
|
|
83
|
+
case types_1.WSChannel.cdp_borrows: {
|
|
84
|
+
const { channel, address } = params;
|
|
85
|
+
return [channel, address].join(':');
|
|
86
|
+
}
|
|
87
|
+
case types_1.WSChannel.cdp_collaterals: {
|
|
88
|
+
const { channel, address } = params;
|
|
89
|
+
return [channel, address].join(':');
|
|
90
|
+
}
|
|
91
|
+
case types_1.WSChannel.cdp_liquidate_collaterals: {
|
|
92
|
+
const { channel } = params;
|
|
93
|
+
return [channel].join(':');
|
|
94
|
+
}
|
|
95
|
+
case types_1.WSChannel.cdp_token_debts: {
|
|
96
|
+
const { channel } = params;
|
|
97
|
+
return [channel].join(':');
|
|
98
|
+
}
|
|
99
|
+
case types_1.WSChannel.cdp_token_debts_by_denom: {
|
|
100
|
+
const { channel, denom } = params;
|
|
101
|
+
return [channel, denom].join(':');
|
|
102
|
+
}
|
|
103
|
+
case types_1.WSChannel.cdp_reward_schemes: {
|
|
104
|
+
const { channel } = params;
|
|
105
|
+
return [channel].join(':');
|
|
106
|
+
}
|
|
107
|
+
case types_1.WSChannel.cdp_reward_debts: {
|
|
108
|
+
const { channel, address } = params;
|
|
109
|
+
return [channel, address].join(':');
|
|
110
|
+
}
|
|
111
|
+
case types_1.WSChannel.cdp_token_supply: {
|
|
112
|
+
const { channel } = params;
|
|
113
|
+
return [channel].join(':');
|
|
114
|
+
}
|
|
115
|
+
case types_1.WSChannel.cdp_token_supply_by_denom: {
|
|
116
|
+
const { channel, denom } = params;
|
|
117
|
+
return [channel, denom].join(':');
|
|
118
|
+
}
|
|
75
119
|
default:
|
|
76
120
|
throw new Error(`invalid subscription channel: ${params.channel}`);
|
|
77
121
|
}
|
|
78
122
|
};
|
|
79
123
|
exports.generateChannelId = generateChannelId;
|
|
80
124
|
const parseChannelId = (rawChannelId) => {
|
|
81
|
-
const [channel,
|
|
125
|
+
const [channel, param0, param1] = rawChannelId.split(':');
|
|
82
126
|
switch (channel) {
|
|
83
127
|
case types_1.WSChannel.candlesticks:
|
|
84
128
|
return {
|
|
85
129
|
channel,
|
|
86
|
-
market,
|
|
87
|
-
resolution,
|
|
130
|
+
market: param0,
|
|
131
|
+
resolution: param1,
|
|
88
132
|
};
|
|
89
133
|
case types_1.WSChannel.books:
|
|
90
134
|
return {
|
|
91
135
|
channel,
|
|
92
|
-
market,
|
|
136
|
+
market: param0,
|
|
93
137
|
};
|
|
94
138
|
case types_1.WSChannel.recent_trades:
|
|
95
139
|
return {
|
|
96
140
|
channel,
|
|
97
|
-
market,
|
|
141
|
+
market: param0,
|
|
98
142
|
};
|
|
99
143
|
case types_1.WSChannel.orders:
|
|
100
144
|
return {
|
|
101
145
|
channel,
|
|
102
|
-
address,
|
|
146
|
+
address: param0,
|
|
103
147
|
};
|
|
104
148
|
case types_1.WSChannel.orders_by_market:
|
|
105
149
|
return {
|
|
106
150
|
channel,
|
|
107
|
-
market,
|
|
108
|
-
address,
|
|
151
|
+
market: param0,
|
|
152
|
+
address: param1,
|
|
109
153
|
};
|
|
110
154
|
case types_1.WSChannel.balances:
|
|
111
155
|
return {
|
|
112
156
|
channel,
|
|
113
|
-
address,
|
|
157
|
+
address: param0,
|
|
114
158
|
};
|
|
115
159
|
case types_1.WSChannel.account_trades:
|
|
116
160
|
return {
|
|
117
161
|
channel,
|
|
118
|
-
address,
|
|
162
|
+
address: param0,
|
|
119
163
|
};
|
|
120
164
|
case types_1.WSChannel.account_trades_by_market:
|
|
121
165
|
return {
|
|
122
166
|
channel,
|
|
123
|
-
market,
|
|
124
|
-
address,
|
|
167
|
+
market: param0,
|
|
168
|
+
address: param1,
|
|
125
169
|
};
|
|
126
170
|
case types_1.WSChannel.market_stats:
|
|
127
171
|
return {
|
|
@@ -130,29 +174,29 @@ const parseChannelId = (rawChannelId) => {
|
|
|
130
174
|
case types_1.WSChannel.market_stats_by_market:
|
|
131
175
|
return {
|
|
132
176
|
channel,
|
|
133
|
-
market,
|
|
177
|
+
market: param0,
|
|
134
178
|
};
|
|
135
179
|
case types_1.WSChannel.leverages:
|
|
136
180
|
return {
|
|
137
181
|
channel,
|
|
138
|
-
address,
|
|
182
|
+
address: param0,
|
|
139
183
|
};
|
|
140
184
|
case types_1.WSChannel.leverages_by_market:
|
|
141
185
|
return {
|
|
142
186
|
channel,
|
|
143
|
-
market,
|
|
144
|
-
address,
|
|
187
|
+
market: param0,
|
|
188
|
+
address: param1,
|
|
145
189
|
};
|
|
146
190
|
case types_1.WSChannel.positions:
|
|
147
191
|
return {
|
|
148
192
|
channel,
|
|
149
|
-
address,
|
|
193
|
+
address: param0,
|
|
150
194
|
};
|
|
151
195
|
case types_1.WSChannel.positions_by_market:
|
|
152
196
|
return {
|
|
153
197
|
channel,
|
|
154
|
-
market,
|
|
155
|
-
address,
|
|
198
|
+
market: param0,
|
|
199
|
+
address: param1,
|
|
156
200
|
};
|
|
157
201
|
case types_1.WSChannel.pools:
|
|
158
202
|
return {
|
|
@@ -161,12 +205,62 @@ const parseChannelId = (rawChannelId) => {
|
|
|
161
205
|
case types_1.WSChannel.pools_by_id:
|
|
162
206
|
return {
|
|
163
207
|
channel,
|
|
164
|
-
id,
|
|
208
|
+
id: param0,
|
|
165
209
|
};
|
|
166
210
|
case types_1.WSChannel.commitments:
|
|
167
211
|
return {
|
|
168
212
|
channel,
|
|
169
|
-
address,
|
|
213
|
+
address: param0,
|
|
214
|
+
};
|
|
215
|
+
case types_1.WSChannel.token_prices:
|
|
216
|
+
return {
|
|
217
|
+
channel,
|
|
218
|
+
};
|
|
219
|
+
case types_1.WSChannel.token_prices:
|
|
220
|
+
return {
|
|
221
|
+
channel,
|
|
222
|
+
denom: param0,
|
|
223
|
+
};
|
|
224
|
+
case types_1.WSChannel.cdp_borrows:
|
|
225
|
+
return {
|
|
226
|
+
channel,
|
|
227
|
+
address: param0,
|
|
228
|
+
};
|
|
229
|
+
case types_1.WSChannel.cdp_collaterals:
|
|
230
|
+
return {
|
|
231
|
+
channel,
|
|
232
|
+
address: param0,
|
|
233
|
+
};
|
|
234
|
+
case types_1.WSChannel.cdp_liquidate_collaterals:
|
|
235
|
+
return {
|
|
236
|
+
channel,
|
|
237
|
+
};
|
|
238
|
+
case types_1.WSChannel.cdp_token_debts:
|
|
239
|
+
return {
|
|
240
|
+
channel,
|
|
241
|
+
};
|
|
242
|
+
case types_1.WSChannel.cdp_token_debts_by_denom:
|
|
243
|
+
return {
|
|
244
|
+
channel,
|
|
245
|
+
denom: param0,
|
|
246
|
+
};
|
|
247
|
+
case types_1.WSChannel.cdp_reward_schemes:
|
|
248
|
+
return {
|
|
249
|
+
channel,
|
|
250
|
+
};
|
|
251
|
+
case types_1.WSChannel.cdp_reward_debts:
|
|
252
|
+
return {
|
|
253
|
+
channel,
|
|
254
|
+
address: param0,
|
|
255
|
+
};
|
|
256
|
+
case types_1.WSChannel.cdp_token_supply:
|
|
257
|
+
return {
|
|
258
|
+
channel,
|
|
259
|
+
};
|
|
260
|
+
case types_1.WSChannel.cdp_token_supply_by_denom:
|
|
261
|
+
return {
|
|
262
|
+
channel,
|
|
263
|
+
denom: param0,
|
|
170
264
|
};
|
|
171
265
|
default:
|
|
172
266
|
throw new Error('Error parsing channelId');
|
|
@@ -143,6 +143,9 @@ export interface Pool {
|
|
|
143
143
|
num_quotes: number;
|
|
144
144
|
shares_amount: string;
|
|
145
145
|
market: string;
|
|
146
|
+
amp_bps: string;
|
|
147
|
+
v_amount_a: string;
|
|
148
|
+
v_amount_b: string;
|
|
146
149
|
};
|
|
147
150
|
rewards_weight: string;
|
|
148
151
|
total_commitment: string;
|
|
@@ -160,3 +163,155 @@ export interface Commitment {
|
|
|
160
163
|
export interface CommitmentEvent extends Commitment {
|
|
161
164
|
Type?: string;
|
|
162
165
|
}
|
|
166
|
+
export interface TokenPrice {
|
|
167
|
+
denom: string;
|
|
168
|
+
index: string;
|
|
169
|
+
index_updated_at: string;
|
|
170
|
+
twap: string;
|
|
171
|
+
}
|
|
172
|
+
export interface CDPParams {
|
|
173
|
+
interest_fee: string;
|
|
174
|
+
liquidation_fee: string;
|
|
175
|
+
stablecoin_interest_rate: string;
|
|
176
|
+
complete_liquidation_threshold: string;
|
|
177
|
+
minimum_close_factor: string;
|
|
178
|
+
small_liquidation_size: string;
|
|
179
|
+
}
|
|
180
|
+
export interface RateStrategy {
|
|
181
|
+
name: string;
|
|
182
|
+
optimal_usage: string;
|
|
183
|
+
base_variable_borrow_rate: string;
|
|
184
|
+
variable_rate_slope_1: string;
|
|
185
|
+
variable_rate_slope_2: string;
|
|
186
|
+
base_stable_borrow_rate: string;
|
|
187
|
+
stable_rate_slope_1: string;
|
|
188
|
+
stable_rate_slope_2: string;
|
|
189
|
+
optimal_stable_to_total_debt_ratio: string;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* @deprecated old websocket response struct for get_cdp_assets_all
|
|
193
|
+
* use AssetParams instead
|
|
194
|
+
*/
|
|
195
|
+
export interface Asset {
|
|
196
|
+
asset_params: {
|
|
197
|
+
denom: string;
|
|
198
|
+
oracle_id: string;
|
|
199
|
+
rate_strategy_name: string;
|
|
200
|
+
loan_to_value: string;
|
|
201
|
+
liquidation_threshold: string;
|
|
202
|
+
liquidation_bonus: string;
|
|
203
|
+
supply_cap: string;
|
|
204
|
+
borrow_cap: string;
|
|
205
|
+
};
|
|
206
|
+
asset_utilization: {
|
|
207
|
+
denom: string;
|
|
208
|
+
total_borrowed: string;
|
|
209
|
+
total_amount: string;
|
|
210
|
+
utilization_rate: string;
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
export interface AssetParams {
|
|
214
|
+
denom: string;
|
|
215
|
+
oracle_id: string;
|
|
216
|
+
rate_strategy_name: string;
|
|
217
|
+
allow_repay_stablecoin_interest_debt: boolean;
|
|
218
|
+
loan_to_value: string;
|
|
219
|
+
liquidation_threshold: string;
|
|
220
|
+
liquidation_discount: string;
|
|
221
|
+
supply_cap: string;
|
|
222
|
+
borrow_cap: string;
|
|
223
|
+
}
|
|
224
|
+
export interface Collateral {
|
|
225
|
+
cdp_denom: string;
|
|
226
|
+
denom: string;
|
|
227
|
+
collateral_amount: string;
|
|
228
|
+
}
|
|
229
|
+
export interface Debt {
|
|
230
|
+
denom: string;
|
|
231
|
+
principal_debt: string;
|
|
232
|
+
initial_cumulative_interest_multiplier: string;
|
|
233
|
+
}
|
|
234
|
+
export interface AccountData {
|
|
235
|
+
total_collaterals_usd: string;
|
|
236
|
+
total_debts_usd: string;
|
|
237
|
+
available_borrows_usd: string;
|
|
238
|
+
curr_liquidation_threshold: string;
|
|
239
|
+
health_factor: string;
|
|
240
|
+
}
|
|
241
|
+
export interface CDPAccountStablecoin {
|
|
242
|
+
principal_debt: string;
|
|
243
|
+
interest_debt: string;
|
|
244
|
+
initial_cumulative_interest_multiplier: string;
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Response for get_cdp_total_borrows and get_cdp_borrows
|
|
248
|
+
* Do not confuse with Debt
|
|
249
|
+
*/
|
|
250
|
+
export interface CDPBorrow {
|
|
251
|
+
address: string;
|
|
252
|
+
amount: string;
|
|
253
|
+
denom: string;
|
|
254
|
+
type: string;
|
|
255
|
+
initial_cumulative_interest_multiplier?: string;
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Response for get_cdp_total_collaterals and get_cdp_collaterals
|
|
259
|
+
* Do not confuse with Collateral
|
|
260
|
+
*/
|
|
261
|
+
export interface CDPCollateral {
|
|
262
|
+
address: string;
|
|
263
|
+
amount: string;
|
|
264
|
+
denom: string;
|
|
265
|
+
}
|
|
266
|
+
export interface CDPDebtInfo {
|
|
267
|
+
denom: string;
|
|
268
|
+
last_updated_time: string;
|
|
269
|
+
total_principal: string;
|
|
270
|
+
cumulative_interest_multiplier: string;
|
|
271
|
+
total_accumulated_interest: string;
|
|
272
|
+
utilization_rate: string;
|
|
273
|
+
}
|
|
274
|
+
export interface CDPStableCoinDebtInfo {
|
|
275
|
+
denom: string;
|
|
276
|
+
last_updated_time: string;
|
|
277
|
+
total_principal: string;
|
|
278
|
+
cumulative_interest_multiplier: string;
|
|
279
|
+
total_accumulated_interest: string;
|
|
280
|
+
}
|
|
281
|
+
export interface CDPLiquidation {
|
|
282
|
+
liquidator: string;
|
|
283
|
+
debtor: string;
|
|
284
|
+
collateral_denom: string;
|
|
285
|
+
collateral_amount_liquidated: string;
|
|
286
|
+
collateral_amount_liquidator: string;
|
|
287
|
+
collateral_amount_fee: string;
|
|
288
|
+
liquidation_price: string;
|
|
289
|
+
market_price: string;
|
|
290
|
+
discount: string;
|
|
291
|
+
debt_denom: string;
|
|
292
|
+
debt_amount: string;
|
|
293
|
+
block_height: number;
|
|
294
|
+
block_time: string;
|
|
295
|
+
transaction_hash: string;
|
|
296
|
+
}
|
|
297
|
+
export interface RewardScheme {
|
|
298
|
+
id: number;
|
|
299
|
+
creator: string;
|
|
300
|
+
reward_denom: string;
|
|
301
|
+
asset_denom: string;
|
|
302
|
+
reward_type: string;
|
|
303
|
+
reward_amount_per_second: string;
|
|
304
|
+
start_time: string;
|
|
305
|
+
end_time: string;
|
|
306
|
+
reward_per_share_last_updated_at: string;
|
|
307
|
+
reward_per_share: string;
|
|
308
|
+
}
|
|
309
|
+
export interface RewardDebt {
|
|
310
|
+
user_address: string;
|
|
311
|
+
reward_scheme_id: number;
|
|
312
|
+
reward_debt: string;
|
|
313
|
+
}
|
|
314
|
+
export interface CDPTokenSupply {
|
|
315
|
+
cdp_denom: string;
|
|
316
|
+
amount: string;
|
|
317
|
+
}
|
package/lib/websocket/types.d.ts
CHANGED
|
@@ -15,7 +15,18 @@ export declare enum WSChannel {
|
|
|
15
15
|
positions_by_market = "positions_by_market",
|
|
16
16
|
pools = "pools",
|
|
17
17
|
pools_by_id = "pools_by_id",
|
|
18
|
-
|
|
18
|
+
token_prices = "token_prices",
|
|
19
|
+
token_prices_by_denom = "token_prices_by_denom",
|
|
20
|
+
commitments = "commitments",
|
|
21
|
+
cdp_borrows = "cdp_borrows",
|
|
22
|
+
cdp_collaterals = "cdp_collaterals",
|
|
23
|
+
cdp_liquidate_collaterals = "cdp_liquidate_collaterals",
|
|
24
|
+
cdp_token_debts = "cdp_token_debts",
|
|
25
|
+
cdp_token_debts_by_denom = "cdp_token_debts_by_denom",
|
|
26
|
+
cdp_reward_schemes = "cdp_reward_schemes",
|
|
27
|
+
cdp_reward_debts = "cdp_reward_debts",
|
|
28
|
+
cdp_token_supply = "cdp_token_supply",
|
|
29
|
+
cdp_token_supply_by_denom = "cdp_token_supply_by_denom"
|
|
19
30
|
}
|
|
20
31
|
export declare enum WSRequest {
|
|
21
32
|
MarketStats = "get_market_stats",
|
|
@@ -31,7 +42,27 @@ export declare enum WSRequest {
|
|
|
31
42
|
Balances = "get_balances",
|
|
32
43
|
OrderBook = "get_orderbook",
|
|
33
44
|
Pools = "get_pools",
|
|
34
|
-
Commitments = "get_commitments"
|
|
45
|
+
Commitments = "get_commitments",
|
|
46
|
+
CDPAllAssets = "get_cdp_all_assets",
|
|
47
|
+
CDPAssets = "get_cdp_assets",
|
|
48
|
+
CDPAccountCollaterals = "get_cdp_account_collaterals",
|
|
49
|
+
CDPAccountDebts = "get_cdp_account_debts",
|
|
50
|
+
CDPAccountData = "get_cdp_account_data",
|
|
51
|
+
CDPParams = "get_cdp_params",
|
|
52
|
+
CDPAllRateStrategies = "get_cdp_all_rate_strategies",
|
|
53
|
+
CDPRateStrategies = "get_cdp_rate_strategies",
|
|
54
|
+
CDPBorrows = "get_cdp_borrows",
|
|
55
|
+
CDPTotalBorrows = "get_cdp_total_borrows",
|
|
56
|
+
CDPCollaterals = "get_cdp_collaterals",
|
|
57
|
+
CDPTotalCollaterals = "get_cdp_total_collaterals",
|
|
58
|
+
CDPLiquidateCollateral = "get_cdp_liquidate_collateral",
|
|
59
|
+
CDPTokenDebt = "get_cdp_token_debt",
|
|
60
|
+
CDPAllTokenDebts = "get_cdp_all_token_debts",
|
|
61
|
+
CDPStablecoinDebt = "get_cdp_stablecoin_debt",
|
|
62
|
+
CDPLiquidations = "get_cdp_liquidations",
|
|
63
|
+
CDPAccountStablecoin = "get_cdp_account_stablecoin",
|
|
64
|
+
CDPRewardSchemes = "get_cdp_reward_schemes",
|
|
65
|
+
CDPRewardsDebts = "get_cdp_reward_debts"
|
|
35
66
|
}
|
|
36
67
|
export interface WsGetRecentTradesParams {
|
|
37
68
|
market: string;
|
|
@@ -75,6 +106,31 @@ export interface WsGetPositionsParams {
|
|
|
75
106
|
export interface WsGetCommitmentsParams {
|
|
76
107
|
address: string;
|
|
77
108
|
}
|
|
109
|
+
export interface WsGetCDPParams {
|
|
110
|
+
}
|
|
111
|
+
export interface WsGetCDPAssetParams {
|
|
112
|
+
denom: string;
|
|
113
|
+
}
|
|
114
|
+
export interface WsGetCDPAccountParams {
|
|
115
|
+
address: string;
|
|
116
|
+
}
|
|
117
|
+
export interface WsGetCDPRateStrategiesParams {
|
|
118
|
+
name: string;
|
|
119
|
+
}
|
|
120
|
+
export interface WsGetCdpTokenDebt {
|
|
121
|
+
denom: string;
|
|
122
|
+
}
|
|
123
|
+
export interface WsGetCdpAllTokenDebts {
|
|
124
|
+
}
|
|
125
|
+
export interface WsGetCdpStablecoinDebt {
|
|
126
|
+
}
|
|
127
|
+
export interface WsGetCdpLiquidations {
|
|
128
|
+
}
|
|
129
|
+
export interface WsGetCdpRewardSchemes {
|
|
130
|
+
}
|
|
131
|
+
export interface WsGetCdpRewardDebts {
|
|
132
|
+
address: string;
|
|
133
|
+
}
|
|
78
134
|
export interface WsSubscribeParams {
|
|
79
135
|
channel: WSChannel;
|
|
80
136
|
}
|
|
@@ -137,4 +193,32 @@ export interface WsUnsubscribeCandlesticksParams extends WsSubscribeParams {
|
|
|
137
193
|
market: string;
|
|
138
194
|
resolution: string;
|
|
139
195
|
}
|
|
140
|
-
export
|
|
196
|
+
export interface WsSubscribeCDPBorrows extends WsSubscribeParams {
|
|
197
|
+
address: string;
|
|
198
|
+
}
|
|
199
|
+
export interface WsSubscribeCDPCollaterals extends WsSubscribeParams {
|
|
200
|
+
address: string;
|
|
201
|
+
}
|
|
202
|
+
export interface WsSubscribeCDPLiquidateCollaterals extends WsSubscribeParams {
|
|
203
|
+
}
|
|
204
|
+
export interface WsSubscribeTokenDebts extends WsSubscribeParams {
|
|
205
|
+
}
|
|
206
|
+
export interface WsSubscribeTokenDebtByDenom extends WsSubscribeParams {
|
|
207
|
+
denom: string;
|
|
208
|
+
}
|
|
209
|
+
export interface WsSubscribeRewardSchemes extends WsSubscribeParams {
|
|
210
|
+
}
|
|
211
|
+
export interface WsSubscribeRewardDebts extends WsSubscribeParams {
|
|
212
|
+
address?: string;
|
|
213
|
+
}
|
|
214
|
+
export interface WsSubscribeTokenPrices extends WsSubscribeParams {
|
|
215
|
+
denom: string;
|
|
216
|
+
}
|
|
217
|
+
export interface WsSubscribeAllTokenPrices extends WsSubscribeParams {
|
|
218
|
+
}
|
|
219
|
+
export interface WsSubscribeCDPTokenSupplyByDenom extends WsSubscribeParams {
|
|
220
|
+
denom: string;
|
|
221
|
+
}
|
|
222
|
+
export interface WsSubscribeCDPTokenSupply extends WsSubscribeParams {
|
|
223
|
+
}
|
|
224
|
+
export declare type WsSubscriptionParams = WsSubscribeCandlesticksParams | WsSubscribeBooksParams | WsSubscribeRecentTradesParams | WsSubscribeOrdersAllParams | WsSubscribeOrdersByMarketParams | WsSubscribeWalletBalanceParams | WsSubscribeAccountTradesAllParams | WsSubscribeAccountTradesByMarketParams | WsSubscribeMarketStatsAllParams | WsSubscribeMarketStatsByMarketParams | WsSubscribeLeveragesAllParams | WsSubscribeLeveragesByMarketParams | WsSubscribePositionsAllParams | WsSubscribePositionsByMarketParams | WsSubscribePoolsAllParams | WsSubscribePoolsByIdParams | WsSubscribeTokenPrices | WsSubscribeAllTokenPrices | WsSubscribeCommitmentParams | WsUnsubscribeCandlesticksParams | WsSubscribeCDPBorrows | WsSubscribeCDPCollaterals | WsSubscribeCDPLiquidateCollaterals | WsSubscribeTokenDebts | WsSubscribeTokenDebtByDenom | WsSubscribeRewardSchemes | WsSubscribeRewardDebts | WsSubscribeCDPTokenSupply | WsSubscribeCDPTokenSupplyByDenom;
|
package/lib/websocket/types.js
CHANGED
|
@@ -19,7 +19,18 @@ var WSChannel;
|
|
|
19
19
|
WSChannel["positions_by_market"] = "positions_by_market";
|
|
20
20
|
WSChannel["pools"] = "pools";
|
|
21
21
|
WSChannel["pools_by_id"] = "pools_by_id";
|
|
22
|
+
WSChannel["token_prices"] = "token_prices";
|
|
23
|
+
WSChannel["token_prices_by_denom"] = "token_prices_by_denom";
|
|
22
24
|
WSChannel["commitments"] = "commitments";
|
|
25
|
+
WSChannel["cdp_borrows"] = "cdp_borrows";
|
|
26
|
+
WSChannel["cdp_collaterals"] = "cdp_collaterals";
|
|
27
|
+
WSChannel["cdp_liquidate_collaterals"] = "cdp_liquidate_collaterals";
|
|
28
|
+
WSChannel["cdp_token_debts"] = "cdp_token_debts";
|
|
29
|
+
WSChannel["cdp_token_debts_by_denom"] = "cdp_token_debts_by_denom";
|
|
30
|
+
WSChannel["cdp_reward_schemes"] = "cdp_reward_schemes";
|
|
31
|
+
WSChannel["cdp_reward_debts"] = "cdp_reward_debts";
|
|
32
|
+
WSChannel["cdp_token_supply"] = "cdp_token_supply";
|
|
33
|
+
WSChannel["cdp_token_supply_by_denom"] = "cdp_token_supply_by_denom";
|
|
23
34
|
})(WSChannel = exports.WSChannel || (exports.WSChannel = {}));
|
|
24
35
|
var WSRequest;
|
|
25
36
|
(function (WSRequest) {
|
|
@@ -37,4 +48,24 @@ var WSRequest;
|
|
|
37
48
|
WSRequest["OrderBook"] = "get_orderbook";
|
|
38
49
|
WSRequest["Pools"] = "get_pools";
|
|
39
50
|
WSRequest["Commitments"] = "get_commitments";
|
|
51
|
+
WSRequest["CDPAllAssets"] = "get_cdp_all_assets";
|
|
52
|
+
WSRequest["CDPAssets"] = "get_cdp_assets";
|
|
53
|
+
WSRequest["CDPAccountCollaterals"] = "get_cdp_account_collaterals";
|
|
54
|
+
WSRequest["CDPAccountDebts"] = "get_cdp_account_debts";
|
|
55
|
+
WSRequest["CDPAccountData"] = "get_cdp_account_data";
|
|
56
|
+
WSRequest["CDPParams"] = "get_cdp_params";
|
|
57
|
+
WSRequest["CDPAllRateStrategies"] = "get_cdp_all_rate_strategies";
|
|
58
|
+
WSRequest["CDPRateStrategies"] = "get_cdp_rate_strategies";
|
|
59
|
+
WSRequest["CDPBorrows"] = "get_cdp_borrows";
|
|
60
|
+
WSRequest["CDPTotalBorrows"] = "get_cdp_total_borrows";
|
|
61
|
+
WSRequest["CDPCollaterals"] = "get_cdp_collaterals";
|
|
62
|
+
WSRequest["CDPTotalCollaterals"] = "get_cdp_total_collaterals";
|
|
63
|
+
WSRequest["CDPLiquidateCollateral"] = "get_cdp_liquidate_collateral";
|
|
64
|
+
WSRequest["CDPTokenDebt"] = "get_cdp_token_debt";
|
|
65
|
+
WSRequest["CDPAllTokenDebts"] = "get_cdp_all_token_debts";
|
|
66
|
+
WSRequest["CDPStablecoinDebt"] = "get_cdp_stablecoin_debt";
|
|
67
|
+
WSRequest["CDPLiquidations"] = "get_cdp_liquidations";
|
|
68
|
+
WSRequest["CDPAccountStablecoin"] = "get_cdp_account_stablecoin";
|
|
69
|
+
WSRequest["CDPRewardSchemes"] = "get_cdp_reward_schemes";
|
|
70
|
+
WSRequest["CDPRewardsDebts"] = "get_cdp_reward_debts";
|
|
40
71
|
})(WSRequest = exports.WSRequest || (exports.WSRequest = {}));
|