carbon-js-sdk 0.2.13 → 0.2.14-dev.2

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.
Files changed (267) hide show
  1. package/lib/clients/NEOClient.js +1 -1
  2. package/lib/clients/TokenClient.d.ts +5 -0
  3. package/lib/clients/TokenClient.js +29 -7
  4. package/lib/codec/book/genesis.d.ts +1 -1
  5. package/lib/codec/book/genesis.js +1 -1
  6. package/lib/codec/book/query.d.ts +1 -1
  7. package/lib/codec/book/query.js +1 -1
  8. package/lib/codec/broker/genesis.d.ts +1 -1
  9. package/lib/codec/broker/genesis.js +1 -1
  10. package/lib/codec/broker/query.d.ts +3 -3
  11. package/lib/codec/broker/query.js +3 -3
  12. package/lib/codec/btcx/denom_cross_chain_info.d.ts +1 -1
  13. package/lib/codec/btcx/denom_cross_chain_info.js +1 -1
  14. package/lib/codec/btcx/query.d.ts +1 -1
  15. package/lib/codec/btcx/query.js +1 -1
  16. package/lib/codec/ccm/genesis.d.ts +1 -1
  17. package/lib/codec/ccm/genesis.js +1 -1
  18. package/lib/codec/cdp/asset_params.d.ts +1 -12
  19. package/lib/codec/cdp/asset_params.js +14 -81
  20. package/lib/codec/cdp/debt_info.d.ts +1 -1
  21. package/lib/codec/cdp/debt_info.js +11 -13
  22. package/lib/codec/cdp/event.d.ts +345 -22
  23. package/lib/codec/cdp/event.js +2247 -81
  24. package/lib/codec/cdp/genesis.d.ts +80 -4
  25. package/lib/codec/cdp/genesis.js +531 -22
  26. package/lib/codec/cdp/params.d.ts +35 -0
  27. package/lib/codec/cdp/params.js +47 -1
  28. package/lib/codec/cdp/query.d.ts +437 -89
  29. package/lib/codec/cdp/query.js +1966 -177
  30. package/lib/codec/cdp/reward_scheme.d.ts +85 -0
  31. package/lib/codec/cdp/reward_scheme.js +656 -0
  32. package/lib/codec/cdp/stablecoin_debt_info.d.ts +1 -1
  33. package/lib/codec/cdp/stablecoin_debt_info.js +11 -13
  34. package/lib/codec/cdp/tx.d.ts +696 -96
  35. package/lib/codec/cdp/tx.js +3392 -243
  36. package/lib/codec/coin/event.d.ts +1 -1
  37. package/lib/codec/coin/event.js +1 -1
  38. package/lib/codec/coin/genesis.d.ts +2 -2
  39. package/lib/codec/coin/genesis.js +2 -2
  40. package/lib/codec/coin/proposal.d.ts +1 -1
  41. package/lib/codec/coin/proposal.js +1 -1
  42. package/lib/codec/coin/query.d.ts +2 -5
  43. package/lib/codec/coin/query.js +2 -8
  44. package/lib/codec/coin/token.d.ts +11 -0
  45. package/lib/codec/coin/token.js +65 -1
  46. package/lib/codec/coin/tx.d.ts +1 -1
  47. package/lib/codec/coin/tx.js +1 -1
  48. package/lib/codec/cosmos/auth/v1beta1/genesis.d.ts +1 -1
  49. package/lib/codec/cosmos/auth/v1beta1/genesis.js +1 -1
  50. package/lib/codec/cosmos/auth/v1beta1/query.d.ts +2 -2
  51. package/lib/codec/cosmos/auth/v1beta1/query.js +2 -2
  52. package/lib/codec/cosmos/authz/v1beta1/authz.d.ts +19 -0
  53. package/lib/codec/cosmos/authz/v1beta1/authz.js +89 -1
  54. package/lib/codec/cosmos/authz/v1beta1/genesis.d.ts +1 -15
  55. package/lib/codec/cosmos/authz/v1beta1/genesis.js +7 -120
  56. package/lib/codec/cosmos/authz/v1beta1/query.d.ts +70 -2
  57. package/lib/codec/cosmos/authz/v1beta1/query.js +275 -3
  58. package/lib/codec/cosmos/authz/v1beta1/tx.d.ts +1 -1
  59. package/lib/codec/cosmos/authz/v1beta1/tx.js +1 -1
  60. package/lib/codec/cosmos/bank/v1beta1/authz.d.ts +1 -1
  61. package/lib/codec/cosmos/bank/v1beta1/authz.js +1 -1
  62. package/lib/codec/cosmos/bank/v1beta1/bank.d.ts +1 -1
  63. package/lib/codec/cosmos/bank/v1beta1/bank.js +1 -1
  64. package/lib/codec/cosmos/bank/v1beta1/export.d.ts +1 -1
  65. package/lib/codec/cosmos/bank/v1beta1/export.js +3 -1
  66. package/lib/codec/cosmos/bank/v1beta1/genesis.d.ts +2 -2
  67. package/lib/codec/cosmos/bank/v1beta1/genesis.js +2 -2
  68. package/lib/codec/cosmos/bank/v1beta1/query.d.ts +43 -3
  69. package/lib/codec/cosmos/bank/v1beta1/query.js +140 -4
  70. package/lib/codec/cosmos/bank/v1beta1/tx.d.ts +2 -2
  71. package/lib/codec/cosmos/bank/v1beta1/tx.js +2 -2
  72. package/lib/codec/cosmos/base/snapshots/v1beta1/snapshot.d.ts +64 -0
  73. package/lib/codec/cosmos/base/snapshots/v1beta1/snapshot.js +343 -1
  74. package/lib/codec/cosmos/base/tendermint/v1beta1/query.d.ts +1 -1
  75. package/lib/codec/cosmos/base/tendermint/v1beta1/query.js +1 -1
  76. package/lib/codec/cosmos/capability/v1beta1/genesis.d.ts +1 -1
  77. package/lib/codec/cosmos/capability/v1beta1/genesis.js +1 -1
  78. package/lib/codec/cosmos/crisis/v1beta1/genesis.d.ts +1 -1
  79. package/lib/codec/cosmos/crisis/v1beta1/genesis.js +1 -1
  80. package/lib/codec/cosmos/distribution/v1beta1/distribution.d.ts +1 -1
  81. package/lib/codec/cosmos/distribution/v1beta1/distribution.js +1 -1
  82. package/lib/codec/cosmos/distribution/v1beta1/genesis.d.ts +2 -2
  83. package/lib/codec/cosmos/distribution/v1beta1/genesis.js +2 -2
  84. package/lib/codec/cosmos/distribution/v1beta1/query.d.ts +3 -3
  85. package/lib/codec/cosmos/distribution/v1beta1/query.js +3 -3
  86. package/lib/codec/cosmos/distribution/v1beta1/tx.d.ts +1 -1
  87. package/lib/codec/cosmos/distribution/v1beta1/tx.js +1 -1
  88. package/lib/codec/cosmos/evidence/v1beta1/query.d.ts +1 -1
  89. package/lib/codec/cosmos/evidence/v1beta1/query.js +1 -1
  90. package/lib/codec/cosmos/feegrant/v1beta1/feegrant.d.ts +1 -1
  91. package/lib/codec/cosmos/feegrant/v1beta1/feegrant.js +1 -1
  92. package/lib/codec/cosmos/feegrant/v1beta1/genesis.d.ts +1 -1
  93. package/lib/codec/cosmos/feegrant/v1beta1/genesis.js +1 -1
  94. package/lib/codec/cosmos/feegrant/v1beta1/query.d.ts +35 -2
  95. package/lib/codec/cosmos/feegrant/v1beta1/query.js +139 -3
  96. package/lib/codec/cosmos/gov/v1beta1/genesis.d.ts +1 -1
  97. package/lib/codec/cosmos/gov/v1beta1/genesis.js +1 -1
  98. package/lib/codec/cosmos/gov/v1beta1/gov.d.ts +1 -1
  99. package/lib/codec/cosmos/gov/v1beta1/gov.js +1 -1
  100. package/lib/codec/cosmos/gov/v1beta1/query.d.ts +2 -2
  101. package/lib/codec/cosmos/gov/v1beta1/query.js +2 -2
  102. package/lib/codec/cosmos/gov/v1beta1/tx.d.ts +2 -2
  103. package/lib/codec/cosmos/gov/v1beta1/tx.js +2 -2
  104. package/lib/codec/cosmos/mint/v1beta1/genesis.d.ts +1 -1
  105. package/lib/codec/cosmos/mint/v1beta1/genesis.js +1 -1
  106. package/lib/codec/cosmos/mint/v1beta1/query.d.ts +1 -1
  107. package/lib/codec/cosmos/mint/v1beta1/query.js +1 -1
  108. package/lib/codec/cosmos/params/v1beta1/query.d.ts +1 -1
  109. package/lib/codec/cosmos/params/v1beta1/query.js +1 -1
  110. package/lib/codec/cosmos/slashing/v1beta1/genesis.d.ts +1 -1
  111. package/lib/codec/cosmos/slashing/v1beta1/genesis.js +1 -1
  112. package/lib/codec/cosmos/slashing/v1beta1/query.d.ts +2 -2
  113. package/lib/codec/cosmos/slashing/v1beta1/query.js +2 -2
  114. package/lib/codec/cosmos/staking/v1beta1/authz.d.ts +1 -1
  115. package/lib/codec/cosmos/staking/v1beta1/authz.js +1 -1
  116. package/lib/codec/cosmos/staking/v1beta1/genesis.d.ts +1 -1
  117. package/lib/codec/cosmos/staking/v1beta1/genesis.js +1 -1
  118. package/lib/codec/cosmos/staking/v1beta1/query.d.ts +2 -2
  119. package/lib/codec/cosmos/staking/v1beta1/query.js +2 -2
  120. package/lib/codec/cosmos/staking/v1beta1/staking.d.ts +1 -1
  121. package/lib/codec/cosmos/staking/v1beta1/staking.js +1 -1
  122. package/lib/codec/cosmos/staking/v1beta1/tx.d.ts +2 -2
  123. package/lib/codec/cosmos/staking/v1beta1/tx.js +2 -2
  124. package/lib/codec/cosmos/tx/signing/v1beta1/signing.d.ts +14 -1
  125. package/lib/codec/cosmos/tx/signing/v1beta1/signing.js +19 -1
  126. package/lib/codec/cosmos/tx/v1beta1/export.d.ts +1 -1
  127. package/lib/codec/cosmos/tx/v1beta1/export.js +3 -1
  128. package/lib/codec/cosmos/tx/v1beta1/service.d.ts +53 -5
  129. package/lib/codec/cosmos/tx/v1beta1/service.js +179 -4
  130. package/lib/codec/cosmos/tx/v1beta1/tx.d.ts +3 -3
  131. package/lib/codec/cosmos/tx/v1beta1/tx.js +3 -3
  132. package/lib/codec/cosmos/upgrade/v1beta1/query.d.ts +1 -1
  133. package/lib/codec/cosmos/upgrade/v1beta1/query.js +1 -1
  134. package/lib/codec/cosmos/vesting/v1beta1/tx.d.ts +1 -1
  135. package/lib/codec/cosmos/vesting/v1beta1/tx.js +1 -1
  136. package/lib/codec/cosmos/vesting/v1beta1/vesting.d.ts +2 -2
  137. package/lib/codec/cosmos/vesting/v1beta1/vesting.js +2 -2
  138. package/lib/codec/fee/genesis.d.ts +1 -1
  139. package/lib/codec/fee/genesis.js +1 -1
  140. package/lib/codec/fee/proposal.d.ts +1 -1
  141. package/lib/codec/fee/proposal.js +1 -1
  142. package/lib/codec/fee/query.d.ts +1 -1
  143. package/lib/codec/fee/query.js +1 -1
  144. package/lib/codec/fee/tx.d.ts +1 -1
  145. package/lib/codec/fee/tx.js +1 -1
  146. package/lib/codec/headersync/genesis.d.ts +1 -1
  147. package/lib/codec/headersync/genesis.js +1 -1
  148. package/lib/codec/headersync/query.d.ts +1 -1
  149. package/lib/codec/headersync/query.js +1 -1
  150. package/lib/codec/index.d.ts +73 -23
  151. package/lib/codec/index.js +597 -384
  152. package/lib/codec/inflation/genesis.d.ts +1 -1
  153. package/lib/codec/inflation/genesis.js +1 -1
  154. package/lib/codec/inflation/query.d.ts +1 -1
  155. package/lib/codec/inflation/query.js +1 -1
  156. package/lib/codec/insurance/genesis.d.ts +1 -1
  157. package/lib/codec/insurance/genesis.js +1 -1
  158. package/lib/codec/leverage/genesis.d.ts +1 -1
  159. package/lib/codec/leverage/genesis.js +1 -1
  160. package/lib/codec/leverage/query.d.ts +1 -1
  161. package/lib/codec/leverage/query.js +1 -1
  162. package/lib/codec/liquidation/genesis.d.ts +1 -1
  163. package/lib/codec/liquidation/genesis.js +1 -1
  164. package/lib/codec/liquidation/query.d.ts +1 -1
  165. package/lib/codec/liquidation/query.js +1 -1
  166. package/lib/codec/liquidation/quote_changes.d.ts +1 -1
  167. package/lib/codec/liquidation/quote_changes.js +1 -1
  168. package/lib/codec/liquiditypool/event.d.ts +2 -2
  169. package/lib/codec/liquiditypool/event.js +2 -2
  170. package/lib/codec/liquiditypool/genesis.d.ts +2 -2
  171. package/lib/codec/liquiditypool/genesis.js +2 -2
  172. package/lib/codec/liquiditypool/proposal.d.ts +1 -1
  173. package/lib/codec/liquiditypool/proposal.js +1 -1
  174. package/lib/codec/liquiditypool/query.d.ts +2 -2
  175. package/lib/codec/liquiditypool/query.js +2 -2
  176. package/lib/codec/liquiditypool/tx.d.ts +1 -1
  177. package/lib/codec/liquiditypool/tx.js +1 -1
  178. package/lib/codec/lockproxy/genesis.d.ts +1 -1
  179. package/lib/codec/lockproxy/genesis.js +1 -1
  180. package/lib/codec/lockproxy/query.d.ts +1 -1
  181. package/lib/codec/lockproxy/query.js +1 -1
  182. package/lib/codec/market/event.d.ts +1 -1
  183. package/lib/codec/market/event.js +1 -1
  184. package/lib/codec/market/genesis.d.ts +2 -1
  185. package/lib/codec/market/genesis.js +20 -2
  186. package/lib/codec/market/proposal.d.ts +1 -1
  187. package/lib/codec/market/proposal.js +1 -1
  188. package/lib/codec/market/query.d.ts +1 -1
  189. package/lib/codec/market/query.js +1 -1
  190. package/lib/codec/market/tx.d.ts +1 -1
  191. package/lib/codec/market/tx.js +1 -1
  192. package/lib/codec/marketstats/genesis.d.ts +1 -1
  193. package/lib/codec/marketstats/genesis.js +1 -1
  194. package/lib/codec/marketstats/query.d.ts +2 -2
  195. package/lib/codec/marketstats/query.js +2 -2
  196. package/lib/codec/misc/message.d.ts +1 -1
  197. package/lib/codec/misc/message.js +1 -1
  198. package/lib/codec/misc/query.d.ts +3 -3
  199. package/lib/codec/misc/query.js +3 -3
  200. package/lib/codec/misc/trade.d.ts +1 -0
  201. package/lib/codec/misc/trade.js +17 -0
  202. package/lib/codec/misc/transaction.d.ts +1 -1
  203. package/lib/codec/misc/transaction.js +1 -1
  204. package/lib/codec/oracle/event.d.ts +1 -1
  205. package/lib/codec/oracle/event.js +1 -1
  206. package/lib/codec/oracle/genesis.d.ts +1 -1
  207. package/lib/codec/oracle/genesis.js +1 -1
  208. package/lib/codec/oracle/proposal.d.ts +1 -1
  209. package/lib/codec/oracle/proposal.js +1 -1
  210. package/lib/codec/oracle/query.d.ts +2 -2
  211. package/lib/codec/oracle/query.js +2 -2
  212. package/lib/codec/order/event.d.ts +1 -1
  213. package/lib/codec/order/event.js +1 -1
  214. package/lib/codec/order/genesis.d.ts +1 -1
  215. package/lib/codec/order/genesis.js +1 -1
  216. package/lib/codec/order/query.d.ts +1 -1
  217. package/lib/codec/order/query.js +1 -1
  218. package/lib/codec/position/event.d.ts +1 -1
  219. package/lib/codec/position/event.js +1 -1
  220. package/lib/codec/position/genesis.d.ts +1 -1
  221. package/lib/codec/position/genesis.js +1 -1
  222. package/lib/codec/position/query.d.ts +1 -1
  223. package/lib/codec/position/query.js +1 -1
  224. package/lib/codec/pricing/event.d.ts +11 -1
  225. package/lib/codec/pricing/event.js +52 -2
  226. package/lib/codec/pricing/genesis.d.ts +2 -1
  227. package/lib/codec/pricing/genesis.js +20 -5
  228. package/lib/codec/pricing/pricing.d.ts +13 -0
  229. package/lib/codec/pricing/pricing.js +83 -1
  230. package/lib/codec/pricing/query.d.ts +68 -1
  231. package/lib/codec/pricing/query.js +321 -2
  232. package/lib/codec/profile/event.d.ts +1 -1
  233. package/lib/codec/profile/event.js +1 -1
  234. package/lib/codec/profile/genesis.d.ts +1 -1
  235. package/lib/codec/profile/genesis.js +1 -1
  236. package/lib/codec/profile/query.d.ts +1 -1
  237. package/lib/codec/profile/query.js +1 -1
  238. package/lib/codec/subaccount/genesis.d.ts +1 -1
  239. package/lib/codec/subaccount/genesis.js +1 -1
  240. package/lib/codec/subaccount/query.d.ts +1 -1
  241. package/lib/codec/subaccount/query.js +1 -1
  242. package/lib/codec/tendermint/abci/types.d.ts +4 -4
  243. package/lib/codec/tendermint/abci/types.js +4 -4
  244. package/lib/codec/tendermint/types/block.d.ts +2 -2
  245. package/lib/codec/tendermint/types/block.js +2 -2
  246. package/lib/codec/tendermint/types/evidence.d.ts +2 -2
  247. package/lib/codec/tendermint/types/evidence.js +2 -2
  248. package/lib/codec/tendermint/types/types.d.ts +3 -3
  249. package/lib/codec/tendermint/types/types.js +3 -3
  250. package/lib/codec/tendermint/types/validator.d.ts +1 -1
  251. package/lib/codec/tendermint/types/validator.js +1 -1
  252. package/lib/modules/admin.d.ts +53 -1
  253. package/lib/modules/admin.js +175 -43
  254. package/lib/modules/cdp.d.ts +105 -13
  255. package/lib/modules/cdp.js +628 -20
  256. package/lib/provider/amino/types/admin.js +48 -7
  257. package/lib/provider/amino/types/cdp.js +72 -32
  258. package/lib/util/number.d.ts +1 -0
  259. package/lib/util/number.js +2 -1
  260. package/lib/util/tx.d.ts +60 -14
  261. package/lib/wallet/CarbonSigningClient.js +27 -2
  262. package/lib/wallet/CarbonWallet.js +0 -1
  263. package/lib/websocket/channel.js +60 -0
  264. package/lib/websocket/models.d.ts +180 -21
  265. package/lib/websocket/types.d.ts +69 -3
  266. package/lib/websocket/types.js +27 -0
  267. package/package.json +1 -1
@@ -2,6 +2,7 @@ export interface RecentTrade {
2
2
  block_created_at: string;
3
3
  block_height: number;
4
4
  id: number;
5
+ liquidation?: string;
5
6
  maker_address: string;
6
7
  maker_fee_amount: string;
7
8
  maker_fee_denom: string;
@@ -19,18 +20,19 @@ export interface RecentTrade {
19
20
  export interface HistoryOrder {
20
21
  address: string;
21
22
  allocated_margin: string;
23
+ avg_filled_price: string;
22
24
  available: string;
23
25
  block_created_at: string;
24
26
  block_height: number;
25
27
  filled: string;
26
28
  id: string;
27
29
  initiator: string;
28
- is_liquidation: boolean;
29
- is_post_only: boolean;
30
- is_reduce_only: boolean;
30
+ is_liquidation?: boolean;
31
+ is_post_only?: boolean;
32
+ is_reduce_only?: boolean;
31
33
  market: string;
32
- order_id: string;
33
34
  order_type: string;
35
+ pool_id?: number;
34
36
  price: string;
35
37
  quantity: string;
36
38
  side: string;
@@ -39,47 +41,52 @@ export interface HistoryOrder {
39
41
  time_in_force: string;
40
42
  trigger_type: string;
41
43
  triggered_block_height: number;
42
- type: string;
43
- username: string;
44
+ referral_address?: string;
45
+ referral_commission?: number;
46
+ referral_kickback?: number;
44
47
  }
45
48
  export interface BaseHistoryOrder {
46
49
  allocated_margin_amount: string;
47
50
  allocated_margin_denom: string;
51
+ last_updated_block_height: number;
48
52
  order: HistoryOrder;
53
+ username?: string;
54
+ }
55
+ export interface BaseHistoryOrderEvent extends BaseHistoryOrder {
56
+ type?: string;
49
57
  }
50
58
  export interface Candlestick {
51
- time: any;
59
+ time: string;
52
60
  close: string;
61
+ market: string;
53
62
  open: string;
54
63
  high: string;
55
64
  low: string;
56
65
  volume: string;
57
66
  quote_volume: string;
67
+ resolution: number;
58
68
  }
59
69
  export interface AccountTrade {
60
70
  address: string;
61
- base_precision: number;
62
71
  block_created_at: string;
63
- block_height: string;
72
+ block_height: number;
64
73
  fee_amount: string;
65
74
  fee_denom: string;
66
- fee_precision: number;
67
- id: number;
68
75
  market: string;
69
76
  order_id: string;
70
77
  price: string;
71
78
  quantity: string;
72
- quote_precision: number;
73
79
  side: string;
80
+ trade_id: number;
74
81
  }
75
82
  export interface Position {
76
83
  market: string;
77
84
  address: string;
78
85
  trade_id: string;
79
86
  side: string;
80
- opened_block_height: string;
81
- updated_block_height: string;
82
- closed_block_height: string;
87
+ opened_block_height: number;
88
+ updated_block_height: number;
89
+ closed_block_height?: number;
83
90
  realized_pnl: string;
84
91
  max_lots: string;
85
92
  total_fee_amount: string;
@@ -89,7 +96,7 @@ export interface Position {
89
96
  allocated_margin: string;
90
97
  lots: string;
91
98
  opened_at: string;
92
- closed_at: string;
99
+ closed_at?: string;
93
100
  }
94
101
  export interface MarketStat {
95
102
  day_high: string;
@@ -103,18 +110,22 @@ export interface MarketStat {
103
110
  last_price: string;
104
111
  market: string;
105
112
  market_type: string;
106
- premium_rate?: string;
107
- last_funding_at?: string;
108
- open_interest?: string;
113
+ premium_rate: string;
114
+ last_funding_at: string;
115
+ open_interest: string;
109
116
  }
110
117
  export interface PriceLevel {
111
118
  price: string;
112
119
  quantity: string;
120
+ market?: string;
121
+ side?: string;
122
+ }
123
+ export interface PriceLevelEvent extends PriceLevel {
124
+ type?: string;
113
125
  }
114
126
  export interface Leverage {
115
- market: string;
127
+ market?: string;
116
128
  leverage: string;
117
- originator?: string;
118
129
  }
119
130
  export interface Pool {
120
131
  pool: {
@@ -141,6 +152,154 @@ export interface Commitment {
141
152
  amount: string;
142
153
  start_time: string;
143
154
  end_time: string;
155
+ duration?: number;
156
+ is_locked: boolean;
144
157
  commitment_power: string;
145
158
  boost_factor: string;
146
159
  }
160
+ export interface CommitmentEvent extends Commitment {
161
+ Type?: string;
162
+ }
163
+ export interface CDPParams {
164
+ interest_fee: string;
165
+ liquidation_fee: string;
166
+ stablecoin_interest_rate: string;
167
+ complete_liquidation_threshold: string;
168
+ minimum_close_factor: string;
169
+ small_liquidation_size: string;
170
+ }
171
+ export interface RateStrategy {
172
+ name: string;
173
+ optimal_usage: string;
174
+ base_variable_borrow_rate: string;
175
+ variable_rate_slope_1: string;
176
+ variable_rate_slope_2: string;
177
+ base_stable_borrow_rate: string;
178
+ stable_rate_slope_1: string;
179
+ stable_rate_slope_2: string;
180
+ optimal_stable_to_total_debt_ratio: string;
181
+ }
182
+ /**
183
+ * @deprecated old websocket response struct for get_cdp_assets_all
184
+ * use AssetParams instead
185
+ */
186
+ export interface Asset {
187
+ asset_params: {
188
+ denom: string;
189
+ oracle_id: string;
190
+ rate_strategy_name: string;
191
+ loan_to_value: string;
192
+ liquidation_threshold: string;
193
+ liquidation_bonus: string;
194
+ supply_cap: string;
195
+ borrow_cap: string;
196
+ };
197
+ asset_utilization: {
198
+ denom: string;
199
+ total_borrowed: string;
200
+ total_amount: string;
201
+ utilization_rate: string;
202
+ };
203
+ }
204
+ export interface AssetParams {
205
+ denom: string;
206
+ oracle_id: string;
207
+ rate_strategy_name: string;
208
+ allow_repay_stablecoin_interest_debt: boolean;
209
+ loan_to_value: string;
210
+ liquidation_threshold: string;
211
+ liquidation_bonus: string;
212
+ supply_cap: string;
213
+ borrow_cap: string;
214
+ }
215
+ export interface Collateral {
216
+ cdp_denom: string;
217
+ denom: string;
218
+ collateral_amount: string;
219
+ }
220
+ export interface Debt {
221
+ denom: string;
222
+ principal_debt: string;
223
+ initial_cumulative_interest_multiplier: string;
224
+ }
225
+ export interface AccountData {
226
+ total_collaterals_usd: string;
227
+ total_debts_usd: string;
228
+ available_borrows_usd: string;
229
+ curr_liquidation_threshold: string;
230
+ health_factor: string;
231
+ }
232
+ export interface CDPAccountStablecoin {
233
+ principal_debt: string;
234
+ interest_debt: string;
235
+ initial_cumulative_interest_multiplier: string;
236
+ }
237
+ /**
238
+ * Response for get_cdp_total_borrows and get_cdp_borrows
239
+ * Do not confuse with Debt
240
+ */
241
+ export interface CDPBorrow {
242
+ address: string;
243
+ amount: string;
244
+ denom: string;
245
+ type: string;
246
+ initial_cumulative_interest_multiplier?: string;
247
+ }
248
+ /**
249
+ * Response for get_cdp_total_collaterals and get_cdp_collaterals
250
+ * Do not confuse with Collateral
251
+ */
252
+ export interface CDPCollateral {
253
+ address: string;
254
+ amount: string;
255
+ denom: string;
256
+ }
257
+ export interface CDPDebtInfo {
258
+ denom: string;
259
+ last_updated_time: string;
260
+ total_principal: string;
261
+ cumulative_interest_multiplier: string;
262
+ total_accumulated_interest: string;
263
+ utilization_rate: string;
264
+ }
265
+ export interface CDPStableCoinDebtInfo {
266
+ denom: string;
267
+ last_updated_time: string;
268
+ total_principal: string;
269
+ cumulative_interest_multiplier: string;
270
+ total_accumulated_interest: string;
271
+ }
272
+ export interface CDPLiquidation {
273
+ liquidator: string;
274
+ debtor: string;
275
+ collateral_denom: string;
276
+ collateral_amount_liquidated: string;
277
+ collateral_amount_liquidator: string;
278
+ collateral_amount_fee: string;
279
+ liquidation_price: string;
280
+ market_price: string;
281
+ discount: string;
282
+ debt_denom: string;
283
+ debt_amount: string;
284
+ block_height: number;
285
+ block_time: string;
286
+ transaction_hash: string;
287
+ }
288
+ export interface RewardScheme {
289
+ id: number;
290
+ creator: string;
291
+ reward_denom: string;
292
+ asset_denom: string;
293
+ reward_type: string;
294
+ reward_amount_per_second: string;
295
+ start_time: string;
296
+ end_time: string;
297
+ reward_reserve_amount: string;
298
+ reward_per_share_last_updated_at: string;
299
+ reward_per_share: string;
300
+ }
301
+ export interface RewardDebt {
302
+ user_address: string;
303
+ reward_scheme_id: number;
304
+ reward_debt: string;
305
+ }
@@ -15,7 +15,14 @@ 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
- commitments = "commitments"
18
+ commitments = "commitments",
19
+ cdp_borrows = "cdp_borrows",
20
+ cdp_collaterals = "cdp_collaterals",
21
+ cdp_liquidate_collaterals = "cdp_liquidate_collaterals",
22
+ cdp_all_token_debts = "cdp_all_token_debts",
23
+ cdp_token_debt = "cdp_token_debt",
24
+ cdp_reward_schemes = "cdp_reward_schemes",
25
+ cdp_reward_debts = "cdp_reward_debts"
19
26
  }
20
27
  export declare enum WSRequest {
21
28
  MarketStats = "get_market_stats",
@@ -31,7 +38,27 @@ export declare enum WSRequest {
31
38
  Balances = "get_balances",
32
39
  OrderBook = "get_orderbook",
33
40
  Pools = "get_pools",
34
- Commitments = "get_commitments"
41
+ Commitments = "get_commitments",
42
+ CDPAllAssets = "get_cdp_all_assets",
43
+ CDPAssets = "get_cdp_assets",
44
+ CDPAccountCollaterals = "get_cdp_account_collaterals",
45
+ CDPAccountDebts = "get_cdp_account_debts",
46
+ CDPAccountData = "get_cdp_account_data",
47
+ CDPParams = "get_cdp_params",
48
+ CDPAllRateStrategies = "get_cdp_all_rate_strategies",
49
+ CDPRateStrategies = "get_cdp_rate_strategies",
50
+ CDPBorrows = "get_cdp_borrows",
51
+ CDPTotalBorrows = "get_cdp_total_borrows",
52
+ CDPCollaterals = "get_cdp_collaterals",
53
+ CDPTotalCollaterals = "get_cdp_total_collaterals",
54
+ CDPLiquidateCollateral = "get_cdp_liquidate_collateral",
55
+ CDPTokenDebt = "get_cdp_token_debt",
56
+ CDPAllTokenDebts = "get_cdp_all_token_debts",
57
+ CDPStablecoinDebt = "get_cdp_stablecoin_debt",
58
+ CDPLiquidations = "get_cdp_liquidations",
59
+ CDPAccountStablecoin = "get_cdp_account_stablecoin",
60
+ CDPRewardSchemes = "get_reward_schemes",
61
+ CDPRewardsDebts = "get_reward_debts"
35
62
  }
36
63
  export interface WsGetRecentTradesParams {
37
64
  market: string;
@@ -75,6 +102,26 @@ export interface WsGetPositionsParams {
75
102
  export interface WsGetCommitmentsParams {
76
103
  address: string;
77
104
  }
105
+ export interface WsGetCDPParams {
106
+ }
107
+ export interface WsGetCDPAssetParams {
108
+ denom: string;
109
+ }
110
+ export interface WsGetCDPAccountParams {
111
+ address: string;
112
+ }
113
+ export interface WsGetCDPRateStrategiesParams {
114
+ name: string;
115
+ }
116
+ export interface WsGetCdpTokenDebt {
117
+ denom: string;
118
+ }
119
+ export interface WsGetCdpAllTokenDebts {
120
+ }
121
+ export interface WsGetCdpStablecoinDebt {
122
+ }
123
+ export interface WsGetCdpLiquidations {
124
+ }
78
125
  export interface WsSubscribeParams {
79
126
  channel: WSChannel;
80
127
  }
@@ -137,4 +184,23 @@ export interface WsUnsubscribeCandlesticksParams extends WsSubscribeParams {
137
184
  market: string;
138
185
  resolution: string;
139
186
  }
140
- export declare type WsSubscriptionParams = WsSubscribeCandlesticksParams | WsSubscribeBooksParams | WsSubscribeRecentTradesParams | WsSubscribeOrdersAllParams | WsSubscribeOrdersByMarketParams | WsSubscribeWalletBalanceParams | WsSubscribeAccountTradesAllParams | WsSubscribeAccountTradesByMarketParams | WsSubscribeMarketStatsAllParams | WsSubscribeMarketStatsByMarketParams | WsSubscribeLeveragesAllParams | WsSubscribeLeveragesByMarketParams | WsSubscribePositionsAllParams | WsSubscribePositionsByMarketParams | WsSubscribePoolsAllParams | WsSubscribePoolsByIdParams | WsSubscribeCommitmentParams | WsUnsubscribeCandlesticksParams;
187
+ export interface WsSubscribeCDPBorrows extends WsSubscribeParams {
188
+ address: string;
189
+ }
190
+ export interface WsSubscribeCDPCollaterals extends WsSubscribeParams {
191
+ address: string;
192
+ }
193
+ export interface WsSubscribeCDPLiquidateCollaterals extends WsSubscribeParams {
194
+ }
195
+ export interface WsSubscribeAllTokenDebts extends WsSubscribeParams {
196
+ }
197
+ export interface WsSubscribeTokenDebt extends WsSubscribeParams {
198
+ denom: string;
199
+ }
200
+ export interface WsSubscribeRewardSchemes extends WsSubscribeParams {
201
+ address?: string;
202
+ }
203
+ export interface WsSubscribeRewardDebts extends WsSubscribeParams {
204
+ address?: string;
205
+ }
206
+ export declare type WsSubscriptionParams = WsSubscribeCandlesticksParams | WsSubscribeBooksParams | WsSubscribeRecentTradesParams | WsSubscribeOrdersAllParams | WsSubscribeOrdersByMarketParams | WsSubscribeWalletBalanceParams | WsSubscribeAccountTradesAllParams | WsSubscribeAccountTradesByMarketParams | WsSubscribeMarketStatsAllParams | WsSubscribeMarketStatsByMarketParams | WsSubscribeLeveragesAllParams | WsSubscribeLeveragesByMarketParams | WsSubscribePositionsAllParams | WsSubscribePositionsByMarketParams | WsSubscribePoolsAllParams | WsSubscribePoolsByIdParams | WsSubscribeCommitmentParams | WsUnsubscribeCandlesticksParams | WsSubscribeCDPBorrows | WsSubscribeCDPCollaterals | WsSubscribeCDPLiquidateCollaterals | WsSubscribeAllTokenDebts | WsSubscribeTokenDebt | WsSubscribeRewardSchemes | WsSubscribeRewardDebts;
@@ -20,6 +20,13 @@ var WSChannel;
20
20
  WSChannel["pools"] = "pools";
21
21
  WSChannel["pools_by_id"] = "pools_by_id";
22
22
  WSChannel["commitments"] = "commitments";
23
+ WSChannel["cdp_borrows"] = "cdp_borrows";
24
+ WSChannel["cdp_collaterals"] = "cdp_collaterals";
25
+ WSChannel["cdp_liquidate_collaterals"] = "cdp_liquidate_collaterals";
26
+ WSChannel["cdp_all_token_debts"] = "cdp_all_token_debts";
27
+ WSChannel["cdp_token_debt"] = "cdp_token_debt";
28
+ WSChannel["cdp_reward_schemes"] = "cdp_reward_schemes";
29
+ WSChannel["cdp_reward_debts"] = "cdp_reward_debts";
23
30
  })(WSChannel = exports.WSChannel || (exports.WSChannel = {}));
24
31
  var WSRequest;
25
32
  (function (WSRequest) {
@@ -37,4 +44,24 @@ var WSRequest;
37
44
  WSRequest["OrderBook"] = "get_orderbook";
38
45
  WSRequest["Pools"] = "get_pools";
39
46
  WSRequest["Commitments"] = "get_commitments";
47
+ WSRequest["CDPAllAssets"] = "get_cdp_all_assets";
48
+ WSRequest["CDPAssets"] = "get_cdp_assets";
49
+ WSRequest["CDPAccountCollaterals"] = "get_cdp_account_collaterals";
50
+ WSRequest["CDPAccountDebts"] = "get_cdp_account_debts";
51
+ WSRequest["CDPAccountData"] = "get_cdp_account_data";
52
+ WSRequest["CDPParams"] = "get_cdp_params";
53
+ WSRequest["CDPAllRateStrategies"] = "get_cdp_all_rate_strategies";
54
+ WSRequest["CDPRateStrategies"] = "get_cdp_rate_strategies";
55
+ WSRequest["CDPBorrows"] = "get_cdp_borrows";
56
+ WSRequest["CDPTotalBorrows"] = "get_cdp_total_borrows";
57
+ WSRequest["CDPCollaterals"] = "get_cdp_collaterals";
58
+ WSRequest["CDPTotalCollaterals"] = "get_cdp_total_collaterals";
59
+ WSRequest["CDPLiquidateCollateral"] = "get_cdp_liquidate_collateral";
60
+ WSRequest["CDPTokenDebt"] = "get_cdp_token_debt";
61
+ WSRequest["CDPAllTokenDebts"] = "get_cdp_all_token_debts";
62
+ WSRequest["CDPStablecoinDebt"] = "get_cdp_stablecoin_debt";
63
+ WSRequest["CDPLiquidations"] = "get_cdp_liquidations";
64
+ WSRequest["CDPAccountStablecoin"] = "get_cdp_account_stablecoin";
65
+ WSRequest["CDPRewardSchemes"] = "get_reward_schemes";
66
+ WSRequest["CDPRewardsDebts"] = "get_reward_debts";
40
67
  })(WSRequest = exports.WSRequest || (exports.WSRequest = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carbon-js-sdk",
3
- "version": "0.2.13",
3
+ "version": "0.2.14-dev.2+8037d7433bdd",
4
4
  "description": "TypeScript SDK for Carbon blockchain",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",