carbon-js-sdk 0.2.14-dev.4 → 0.2.14-dev.6
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/codec/cdp/asset_params.d.ts +1 -1
- package/lib/codec/cdp/asset_params.js +11 -10
- package/lib/codec/cdp/genesis.d.ts +18 -1
- package/lib/codec/cdp/genesis.js +153 -37
- package/lib/codec/cdp/tx.d.ts +0 -1
- package/lib/codec/cdp/tx.js +6 -20
- 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 +1 -1
- package/lib/codec/cosmos/authz/v1beta1/query.js +1 -1
- package/lib/codec/cosmos/tx/v1beta1/service.d.ts +1 -1
- package/lib/codec/cosmos/tx/v1beta1/service.js +1 -1
- package/lib/codec/index.d.ts +1 -0
- package/lib/codec/index.js +3 -1
- package/lib/codec/oracle/genesis.d.ts +3 -0
- package/lib/codec/oracle/genesis.js +33 -2
- package/lib/codec/pricing/genesis.d.ts +1 -1
- package/lib/codec/pricing/genesis.js +8 -8
- package/lib/codec/pricing/legacy.d.ts +22 -0
- package/lib/codec/pricing/legacy.js +93 -0
- package/lib/modules/admin.d.ts +1 -3
- package/lib/modules/admin.js +2 -3
- package/lib/modules/cdp.d.ts +24 -14
- package/lib/modules/cdp.js +196 -161
- package/lib/util/address.d.ts +1 -0
- package/lib/util/address.js +8 -0
- package/lib/websocket/channel.js +29 -29
- package/lib/websocket/models.d.ts +1 -2
- package/lib/websocket/types.d.ts +0 -1
- package/package.json +1 -1
package/lib/websocket/channel.js
CHANGED
|
@@ -93,8 +93,8 @@ const generateChannelId = (params) => {
|
|
|
93
93
|
return [channel, denom].join(':');
|
|
94
94
|
}
|
|
95
95
|
case types_1.WSChannel.cdp_reward_schemes: {
|
|
96
|
-
const { channel
|
|
97
|
-
return [channel
|
|
96
|
+
const { channel } = params;
|
|
97
|
+
return [channel].join(':');
|
|
98
98
|
}
|
|
99
99
|
case types_1.WSChannel.cdp_reward_debts: {
|
|
100
100
|
const { channel, address } = params;
|
|
@@ -106,50 +106,50 @@ const generateChannelId = (params) => {
|
|
|
106
106
|
};
|
|
107
107
|
exports.generateChannelId = generateChannelId;
|
|
108
108
|
const parseChannelId = (rawChannelId) => {
|
|
109
|
-
const [channel,
|
|
109
|
+
const [channel, param0, param1] = rawChannelId.split(':');
|
|
110
110
|
switch (channel) {
|
|
111
111
|
case types_1.WSChannel.candlesticks:
|
|
112
112
|
return {
|
|
113
113
|
channel,
|
|
114
|
-
market,
|
|
115
|
-
resolution,
|
|
114
|
+
market: param0,
|
|
115
|
+
resolution: param1,
|
|
116
116
|
};
|
|
117
117
|
case types_1.WSChannel.books:
|
|
118
118
|
return {
|
|
119
119
|
channel,
|
|
120
|
-
market,
|
|
120
|
+
market: param0,
|
|
121
121
|
};
|
|
122
122
|
case types_1.WSChannel.recent_trades:
|
|
123
123
|
return {
|
|
124
124
|
channel,
|
|
125
|
-
market,
|
|
125
|
+
market: param0,
|
|
126
126
|
};
|
|
127
127
|
case types_1.WSChannel.orders:
|
|
128
128
|
return {
|
|
129
129
|
channel,
|
|
130
|
-
address,
|
|
130
|
+
address: param0,
|
|
131
131
|
};
|
|
132
132
|
case types_1.WSChannel.orders_by_market:
|
|
133
133
|
return {
|
|
134
134
|
channel,
|
|
135
|
-
market,
|
|
136
|
-
address,
|
|
135
|
+
market: param0,
|
|
136
|
+
address: param1,
|
|
137
137
|
};
|
|
138
138
|
case types_1.WSChannel.balances:
|
|
139
139
|
return {
|
|
140
140
|
channel,
|
|
141
|
-
address,
|
|
141
|
+
address: param0,
|
|
142
142
|
};
|
|
143
143
|
case types_1.WSChannel.account_trades:
|
|
144
144
|
return {
|
|
145
145
|
channel,
|
|
146
|
-
address,
|
|
146
|
+
address: param0,
|
|
147
147
|
};
|
|
148
148
|
case types_1.WSChannel.account_trades_by_market:
|
|
149
149
|
return {
|
|
150
150
|
channel,
|
|
151
|
-
market,
|
|
152
|
-
address,
|
|
151
|
+
market: param0,
|
|
152
|
+
address: param1,
|
|
153
153
|
};
|
|
154
154
|
case types_1.WSChannel.market_stats:
|
|
155
155
|
return {
|
|
@@ -158,29 +158,29 @@ const parseChannelId = (rawChannelId) => {
|
|
|
158
158
|
case types_1.WSChannel.market_stats_by_market:
|
|
159
159
|
return {
|
|
160
160
|
channel,
|
|
161
|
-
market,
|
|
161
|
+
market: param0,
|
|
162
162
|
};
|
|
163
163
|
case types_1.WSChannel.leverages:
|
|
164
164
|
return {
|
|
165
165
|
channel,
|
|
166
|
-
address,
|
|
166
|
+
address: param0,
|
|
167
167
|
};
|
|
168
168
|
case types_1.WSChannel.leverages_by_market:
|
|
169
169
|
return {
|
|
170
170
|
channel,
|
|
171
|
-
market,
|
|
172
|
-
address,
|
|
171
|
+
market: param0,
|
|
172
|
+
address: param1,
|
|
173
173
|
};
|
|
174
174
|
case types_1.WSChannel.positions:
|
|
175
175
|
return {
|
|
176
176
|
channel,
|
|
177
|
-
address,
|
|
177
|
+
address: param0,
|
|
178
178
|
};
|
|
179
179
|
case types_1.WSChannel.positions_by_market:
|
|
180
180
|
return {
|
|
181
181
|
channel,
|
|
182
|
-
market,
|
|
183
|
-
address,
|
|
182
|
+
market: param0,
|
|
183
|
+
address: param1,
|
|
184
184
|
};
|
|
185
185
|
case types_1.WSChannel.pools:
|
|
186
186
|
return {
|
|
@@ -189,22 +189,22 @@ const parseChannelId = (rawChannelId) => {
|
|
|
189
189
|
case types_1.WSChannel.pools_by_id:
|
|
190
190
|
return {
|
|
191
191
|
channel,
|
|
192
|
-
id,
|
|
192
|
+
id: param0,
|
|
193
193
|
};
|
|
194
194
|
case types_1.WSChannel.commitments:
|
|
195
195
|
return {
|
|
196
196
|
channel,
|
|
197
|
-
address,
|
|
197
|
+
address: param0,
|
|
198
198
|
};
|
|
199
199
|
case types_1.WSChannel.cdp_borrows:
|
|
200
200
|
return {
|
|
201
201
|
channel,
|
|
202
|
-
address,
|
|
202
|
+
address: param0,
|
|
203
203
|
};
|
|
204
204
|
case types_1.WSChannel.cdp_collaterals:
|
|
205
205
|
return {
|
|
206
206
|
channel,
|
|
207
|
-
address,
|
|
207
|
+
address: param0,
|
|
208
208
|
};
|
|
209
209
|
case types_1.WSChannel.cdp_liquidate_collaterals:
|
|
210
210
|
return {
|
|
@@ -215,18 +215,18 @@ const parseChannelId = (rawChannelId) => {
|
|
|
215
215
|
channel,
|
|
216
216
|
};
|
|
217
217
|
case types_1.WSChannel.cdp_token_debt:
|
|
218
|
-
const denom = market;
|
|
219
218
|
return {
|
|
220
219
|
channel,
|
|
221
|
-
denom,
|
|
220
|
+
denom: param0,
|
|
222
221
|
};
|
|
223
222
|
case types_1.WSChannel.cdp_reward_schemes:
|
|
224
223
|
return {
|
|
225
|
-
|
|
224
|
+
channel,
|
|
226
225
|
};
|
|
227
226
|
case types_1.WSChannel.cdp_reward_debts:
|
|
228
227
|
return {
|
|
229
|
-
|
|
228
|
+
channel,
|
|
229
|
+
address: param0,
|
|
230
230
|
};
|
|
231
231
|
default:
|
|
232
232
|
throw new Error('Error parsing channelId');
|
|
@@ -208,7 +208,7 @@ export interface AssetParams {
|
|
|
208
208
|
allow_repay_stablecoin_interest_debt: boolean;
|
|
209
209
|
loan_to_value: string;
|
|
210
210
|
liquidation_threshold: string;
|
|
211
|
-
|
|
211
|
+
liquidation_discount: string;
|
|
212
212
|
supply_cap: string;
|
|
213
213
|
borrow_cap: string;
|
|
214
214
|
}
|
|
@@ -294,7 +294,6 @@ export interface RewardScheme {
|
|
|
294
294
|
reward_amount_per_second: string;
|
|
295
295
|
start_time: string;
|
|
296
296
|
end_time: string;
|
|
297
|
-
reward_reserve_amount: string;
|
|
298
297
|
reward_per_share_last_updated_at: string;
|
|
299
298
|
reward_per_share: string;
|
|
300
299
|
}
|
package/lib/websocket/types.d.ts
CHANGED
|
@@ -203,7 +203,6 @@ export interface WsSubscribeTokenDebt extends WsSubscribeParams {
|
|
|
203
203
|
denom: string;
|
|
204
204
|
}
|
|
205
205
|
export interface WsSubscribeRewardSchemes extends WsSubscribeParams {
|
|
206
|
-
address?: string;
|
|
207
206
|
}
|
|
208
207
|
export interface WsSubscribeRewardDebts extends WsSubscribeParams {
|
|
209
208
|
address?: string;
|