carbon-js-sdk 0.2.14-dev.2 → 0.2.14-dev.3
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/query.d.ts +4 -3
- package/lib/codec/cdp/query.js +41 -12
- package/lib/codec/cdp/tx.d.ts +21 -0
- package/lib/codec/cdp/tx.js +84 -1
- package/lib/codec/index.d.ts +13 -2
- package/lib/codec/index.js +231 -195
- package/lib/codec/pricing/event.d.ts +45 -0
- package/lib/codec/pricing/event.js +247 -1
- package/lib/codec/pricing/pricing.d.ts +1 -0
- package/lib/codec/pricing/pricing.js +20 -0
- package/lib/codec/pricing/tx.d.ts +96 -0
- package/lib/codec/pricing/tx.js +399 -1
- package/lib/modules/admin.d.ts +64 -6
- package/lib/modules/admin.js +114 -10
- package/lib/modules/cdp.d.ts +32 -1
- package/lib/modules/cdp.js +77 -3
- package/lib/modules/fee.d.ts +2 -0
- package/lib/modules/liquiditypool.d.ts +3 -0
- package/lib/modules/oracle.d.ts +3 -0
- package/lib/modules/oracle.js +2 -0
- package/lib/modules/order.d.ts +3 -0
- package/lib/modules/order.js +2 -0
- package/lib/modules/position.d.ts +3 -0
- package/lib/modules/position.js +2 -0
- package/lib/modules/profile.d.ts +3 -0
- package/lib/modules/profile.js +2 -0
- package/lib/modules/subaccount.d.ts +3 -0
- package/lib/modules/subaccount.js +2 -0
- package/lib/provider/amino/types/admin.js +36 -12
- package/lib/provider/amino/types/cdp.js +30 -0
- package/lib/util/tx.d.ts +10 -0
- package/lib/websocket/types.d.ts +5 -0
- package/package.json +1 -1
package/lib/codec/pricing/tx.js
CHANGED
|
@@ -3,14 +3,412 @@ 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.MsgClientImpl = exports.protobufPackage = void 0;
|
|
6
|
+
exports.MsgClientImpl = exports.MsgSetStaleIndexAllowanceResponse = exports.MsgSetStaleIndexAllowance = exports.MsgSetImpactBandResponse = exports.MsgSetImpactBand = exports.MsgSetSmoothenBandResponse = exports.MsgSetSmoothenBand = exports.MsgSetBackfillTimeIntervalResponse = exports.MsgSetBackfillTimeInterval = exports.protobufPackage = void 0;
|
|
7
7
|
/* eslint-disable */
|
|
8
8
|
const long_1 = __importDefault(require("long"));
|
|
9
9
|
const minimal_1 = __importDefault(require("protobufjs/minimal"));
|
|
10
|
+
const duration_1 = require("../google/protobuf/duration");
|
|
10
11
|
exports.protobufPackage = "Switcheo.carbon.pricing";
|
|
12
|
+
const baseMsgSetBackfillTimeInterval = { creator: "" };
|
|
13
|
+
exports.MsgSetBackfillTimeInterval = {
|
|
14
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
15
|
+
if (message.creator !== "") {
|
|
16
|
+
writer.uint32(10).string(message.creator);
|
|
17
|
+
}
|
|
18
|
+
if (message.backfillTimeInterval !== undefined) {
|
|
19
|
+
duration_1.Duration.encode(message.backfillTimeInterval, writer.uint32(18).fork()).ldelim();
|
|
20
|
+
}
|
|
21
|
+
return writer;
|
|
22
|
+
},
|
|
23
|
+
decode(input, length) {
|
|
24
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
25
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
26
|
+
const message = Object.assign({}, baseMsgSetBackfillTimeInterval);
|
|
27
|
+
while (reader.pos < end) {
|
|
28
|
+
const tag = reader.uint32();
|
|
29
|
+
switch (tag >>> 3) {
|
|
30
|
+
case 1:
|
|
31
|
+
message.creator = reader.string();
|
|
32
|
+
break;
|
|
33
|
+
case 2:
|
|
34
|
+
message.backfillTimeInterval = duration_1.Duration.decode(reader, reader.uint32());
|
|
35
|
+
break;
|
|
36
|
+
default:
|
|
37
|
+
reader.skipType(tag & 7);
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return message;
|
|
42
|
+
},
|
|
43
|
+
fromJSON(object) {
|
|
44
|
+
const message = Object.assign({}, baseMsgSetBackfillTimeInterval);
|
|
45
|
+
message.creator =
|
|
46
|
+
object.creator !== undefined && object.creator !== null
|
|
47
|
+
? String(object.creator)
|
|
48
|
+
: "";
|
|
49
|
+
message.backfillTimeInterval =
|
|
50
|
+
object.backfillTimeInterval !== undefined &&
|
|
51
|
+
object.backfillTimeInterval !== null
|
|
52
|
+
? duration_1.Duration.fromJSON(object.backfillTimeInterval)
|
|
53
|
+
: undefined;
|
|
54
|
+
return message;
|
|
55
|
+
},
|
|
56
|
+
toJSON(message) {
|
|
57
|
+
const obj = {};
|
|
58
|
+
message.creator !== undefined && (obj.creator = message.creator);
|
|
59
|
+
message.backfillTimeInterval !== undefined &&
|
|
60
|
+
(obj.backfillTimeInterval = message.backfillTimeInterval
|
|
61
|
+
? duration_1.Duration.toJSON(message.backfillTimeInterval)
|
|
62
|
+
: undefined);
|
|
63
|
+
return obj;
|
|
64
|
+
},
|
|
65
|
+
fromPartial(object) {
|
|
66
|
+
var _a;
|
|
67
|
+
const message = Object.assign({}, baseMsgSetBackfillTimeInterval);
|
|
68
|
+
message.creator = (_a = object.creator) !== null && _a !== void 0 ? _a : "";
|
|
69
|
+
message.backfillTimeInterval =
|
|
70
|
+
object.backfillTimeInterval !== undefined &&
|
|
71
|
+
object.backfillTimeInterval !== null
|
|
72
|
+
? duration_1.Duration.fromPartial(object.backfillTimeInterval)
|
|
73
|
+
: undefined;
|
|
74
|
+
return message;
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
const baseMsgSetBackfillTimeIntervalResponse = {};
|
|
78
|
+
exports.MsgSetBackfillTimeIntervalResponse = {
|
|
79
|
+
encode(_, writer = minimal_1.default.Writer.create()) {
|
|
80
|
+
return writer;
|
|
81
|
+
},
|
|
82
|
+
decode(input, length) {
|
|
83
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
84
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
85
|
+
const message = Object.assign({}, baseMsgSetBackfillTimeIntervalResponse);
|
|
86
|
+
while (reader.pos < end) {
|
|
87
|
+
const tag = reader.uint32();
|
|
88
|
+
switch (tag >>> 3) {
|
|
89
|
+
default:
|
|
90
|
+
reader.skipType(tag & 7);
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return message;
|
|
95
|
+
},
|
|
96
|
+
fromJSON(_) {
|
|
97
|
+
const message = Object.assign({}, baseMsgSetBackfillTimeIntervalResponse);
|
|
98
|
+
return message;
|
|
99
|
+
},
|
|
100
|
+
toJSON(_) {
|
|
101
|
+
const obj = {};
|
|
102
|
+
return obj;
|
|
103
|
+
},
|
|
104
|
+
fromPartial(_) {
|
|
105
|
+
const message = Object.assign({}, baseMsgSetBackfillTimeIntervalResponse);
|
|
106
|
+
return message;
|
|
107
|
+
},
|
|
108
|
+
};
|
|
109
|
+
const baseMsgSetSmoothenBand = { creator: "", smoothenBand: 0 };
|
|
110
|
+
exports.MsgSetSmoothenBand = {
|
|
111
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
112
|
+
if (message.creator !== "") {
|
|
113
|
+
writer.uint32(10).string(message.creator);
|
|
114
|
+
}
|
|
115
|
+
if (message.smoothenBand !== 0) {
|
|
116
|
+
writer.uint32(16).uint32(message.smoothenBand);
|
|
117
|
+
}
|
|
118
|
+
return writer;
|
|
119
|
+
},
|
|
120
|
+
decode(input, length) {
|
|
121
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
122
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
123
|
+
const message = Object.assign({}, baseMsgSetSmoothenBand);
|
|
124
|
+
while (reader.pos < end) {
|
|
125
|
+
const tag = reader.uint32();
|
|
126
|
+
switch (tag >>> 3) {
|
|
127
|
+
case 1:
|
|
128
|
+
message.creator = reader.string();
|
|
129
|
+
break;
|
|
130
|
+
case 2:
|
|
131
|
+
message.smoothenBand = reader.uint32();
|
|
132
|
+
break;
|
|
133
|
+
default:
|
|
134
|
+
reader.skipType(tag & 7);
|
|
135
|
+
break;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
return message;
|
|
139
|
+
},
|
|
140
|
+
fromJSON(object) {
|
|
141
|
+
const message = Object.assign({}, baseMsgSetSmoothenBand);
|
|
142
|
+
message.creator =
|
|
143
|
+
object.creator !== undefined && object.creator !== null
|
|
144
|
+
? String(object.creator)
|
|
145
|
+
: "";
|
|
146
|
+
message.smoothenBand =
|
|
147
|
+
object.smoothenBand !== undefined && object.smoothenBand !== null
|
|
148
|
+
? Number(object.smoothenBand)
|
|
149
|
+
: 0;
|
|
150
|
+
return message;
|
|
151
|
+
},
|
|
152
|
+
toJSON(message) {
|
|
153
|
+
const obj = {};
|
|
154
|
+
message.creator !== undefined && (obj.creator = message.creator);
|
|
155
|
+
message.smoothenBand !== undefined &&
|
|
156
|
+
(obj.smoothenBand = message.smoothenBand);
|
|
157
|
+
return obj;
|
|
158
|
+
},
|
|
159
|
+
fromPartial(object) {
|
|
160
|
+
var _a, _b;
|
|
161
|
+
const message = Object.assign({}, baseMsgSetSmoothenBand);
|
|
162
|
+
message.creator = (_a = object.creator) !== null && _a !== void 0 ? _a : "";
|
|
163
|
+
message.smoothenBand = (_b = object.smoothenBand) !== null && _b !== void 0 ? _b : 0;
|
|
164
|
+
return message;
|
|
165
|
+
},
|
|
166
|
+
};
|
|
167
|
+
const baseMsgSetSmoothenBandResponse = {};
|
|
168
|
+
exports.MsgSetSmoothenBandResponse = {
|
|
169
|
+
encode(_, writer = minimal_1.default.Writer.create()) {
|
|
170
|
+
return writer;
|
|
171
|
+
},
|
|
172
|
+
decode(input, length) {
|
|
173
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
174
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
175
|
+
const message = Object.assign({}, baseMsgSetSmoothenBandResponse);
|
|
176
|
+
while (reader.pos < end) {
|
|
177
|
+
const tag = reader.uint32();
|
|
178
|
+
switch (tag >>> 3) {
|
|
179
|
+
default:
|
|
180
|
+
reader.skipType(tag & 7);
|
|
181
|
+
break;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
return message;
|
|
185
|
+
},
|
|
186
|
+
fromJSON(_) {
|
|
187
|
+
const message = Object.assign({}, baseMsgSetSmoothenBandResponse);
|
|
188
|
+
return message;
|
|
189
|
+
},
|
|
190
|
+
toJSON(_) {
|
|
191
|
+
const obj = {};
|
|
192
|
+
return obj;
|
|
193
|
+
},
|
|
194
|
+
fromPartial(_) {
|
|
195
|
+
const message = Object.assign({}, baseMsgSetSmoothenBandResponse);
|
|
196
|
+
return message;
|
|
197
|
+
},
|
|
198
|
+
};
|
|
199
|
+
const baseMsgSetImpactBand = { creator: "", impactBand: 0 };
|
|
200
|
+
exports.MsgSetImpactBand = {
|
|
201
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
202
|
+
if (message.creator !== "") {
|
|
203
|
+
writer.uint32(10).string(message.creator);
|
|
204
|
+
}
|
|
205
|
+
if (message.impactBand !== 0) {
|
|
206
|
+
writer.uint32(16).uint32(message.impactBand);
|
|
207
|
+
}
|
|
208
|
+
return writer;
|
|
209
|
+
},
|
|
210
|
+
decode(input, length) {
|
|
211
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
212
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
213
|
+
const message = Object.assign({}, baseMsgSetImpactBand);
|
|
214
|
+
while (reader.pos < end) {
|
|
215
|
+
const tag = reader.uint32();
|
|
216
|
+
switch (tag >>> 3) {
|
|
217
|
+
case 1:
|
|
218
|
+
message.creator = reader.string();
|
|
219
|
+
break;
|
|
220
|
+
case 2:
|
|
221
|
+
message.impactBand = reader.uint32();
|
|
222
|
+
break;
|
|
223
|
+
default:
|
|
224
|
+
reader.skipType(tag & 7);
|
|
225
|
+
break;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
return message;
|
|
229
|
+
},
|
|
230
|
+
fromJSON(object) {
|
|
231
|
+
const message = Object.assign({}, baseMsgSetImpactBand);
|
|
232
|
+
message.creator =
|
|
233
|
+
object.creator !== undefined && object.creator !== null
|
|
234
|
+
? String(object.creator)
|
|
235
|
+
: "";
|
|
236
|
+
message.impactBand =
|
|
237
|
+
object.impactBand !== undefined && object.impactBand !== null
|
|
238
|
+
? Number(object.impactBand)
|
|
239
|
+
: 0;
|
|
240
|
+
return message;
|
|
241
|
+
},
|
|
242
|
+
toJSON(message) {
|
|
243
|
+
const obj = {};
|
|
244
|
+
message.creator !== undefined && (obj.creator = message.creator);
|
|
245
|
+
message.impactBand !== undefined && (obj.impactBand = message.impactBand);
|
|
246
|
+
return obj;
|
|
247
|
+
},
|
|
248
|
+
fromPartial(object) {
|
|
249
|
+
var _a, _b;
|
|
250
|
+
const message = Object.assign({}, baseMsgSetImpactBand);
|
|
251
|
+
message.creator = (_a = object.creator) !== null && _a !== void 0 ? _a : "";
|
|
252
|
+
message.impactBand = (_b = object.impactBand) !== null && _b !== void 0 ? _b : 0;
|
|
253
|
+
return message;
|
|
254
|
+
},
|
|
255
|
+
};
|
|
256
|
+
const baseMsgSetImpactBandResponse = {};
|
|
257
|
+
exports.MsgSetImpactBandResponse = {
|
|
258
|
+
encode(_, writer = minimal_1.default.Writer.create()) {
|
|
259
|
+
return writer;
|
|
260
|
+
},
|
|
261
|
+
decode(input, length) {
|
|
262
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
263
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
264
|
+
const message = Object.assign({}, baseMsgSetImpactBandResponse);
|
|
265
|
+
while (reader.pos < end) {
|
|
266
|
+
const tag = reader.uint32();
|
|
267
|
+
switch (tag >>> 3) {
|
|
268
|
+
default:
|
|
269
|
+
reader.skipType(tag & 7);
|
|
270
|
+
break;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
return message;
|
|
274
|
+
},
|
|
275
|
+
fromJSON(_) {
|
|
276
|
+
const message = Object.assign({}, baseMsgSetImpactBandResponse);
|
|
277
|
+
return message;
|
|
278
|
+
},
|
|
279
|
+
toJSON(_) {
|
|
280
|
+
const obj = {};
|
|
281
|
+
return obj;
|
|
282
|
+
},
|
|
283
|
+
fromPartial(_) {
|
|
284
|
+
const message = Object.assign({}, baseMsgSetImpactBandResponse);
|
|
285
|
+
return message;
|
|
286
|
+
},
|
|
287
|
+
};
|
|
288
|
+
const baseMsgSetStaleIndexAllowance = { creator: "" };
|
|
289
|
+
exports.MsgSetStaleIndexAllowance = {
|
|
290
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
291
|
+
if (message.creator !== "") {
|
|
292
|
+
writer.uint32(10).string(message.creator);
|
|
293
|
+
}
|
|
294
|
+
if (message.staleIndexAllowance !== undefined) {
|
|
295
|
+
duration_1.Duration.encode(message.staleIndexAllowance, writer.uint32(18).fork()).ldelim();
|
|
296
|
+
}
|
|
297
|
+
return writer;
|
|
298
|
+
},
|
|
299
|
+
decode(input, length) {
|
|
300
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
301
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
302
|
+
const message = Object.assign({}, baseMsgSetStaleIndexAllowance);
|
|
303
|
+
while (reader.pos < end) {
|
|
304
|
+
const tag = reader.uint32();
|
|
305
|
+
switch (tag >>> 3) {
|
|
306
|
+
case 1:
|
|
307
|
+
message.creator = reader.string();
|
|
308
|
+
break;
|
|
309
|
+
case 2:
|
|
310
|
+
message.staleIndexAllowance = duration_1.Duration.decode(reader, reader.uint32());
|
|
311
|
+
break;
|
|
312
|
+
default:
|
|
313
|
+
reader.skipType(tag & 7);
|
|
314
|
+
break;
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
return message;
|
|
318
|
+
},
|
|
319
|
+
fromJSON(object) {
|
|
320
|
+
const message = Object.assign({}, baseMsgSetStaleIndexAllowance);
|
|
321
|
+
message.creator =
|
|
322
|
+
object.creator !== undefined && object.creator !== null
|
|
323
|
+
? String(object.creator)
|
|
324
|
+
: "";
|
|
325
|
+
message.staleIndexAllowance =
|
|
326
|
+
object.staleIndexAllowance !== undefined &&
|
|
327
|
+
object.staleIndexAllowance !== null
|
|
328
|
+
? duration_1.Duration.fromJSON(object.staleIndexAllowance)
|
|
329
|
+
: undefined;
|
|
330
|
+
return message;
|
|
331
|
+
},
|
|
332
|
+
toJSON(message) {
|
|
333
|
+
const obj = {};
|
|
334
|
+
message.creator !== undefined && (obj.creator = message.creator);
|
|
335
|
+
message.staleIndexAllowance !== undefined &&
|
|
336
|
+
(obj.staleIndexAllowance = message.staleIndexAllowance
|
|
337
|
+
? duration_1.Duration.toJSON(message.staleIndexAllowance)
|
|
338
|
+
: undefined);
|
|
339
|
+
return obj;
|
|
340
|
+
},
|
|
341
|
+
fromPartial(object) {
|
|
342
|
+
var _a;
|
|
343
|
+
const message = Object.assign({}, baseMsgSetStaleIndexAllowance);
|
|
344
|
+
message.creator = (_a = object.creator) !== null && _a !== void 0 ? _a : "";
|
|
345
|
+
message.staleIndexAllowance =
|
|
346
|
+
object.staleIndexAllowance !== undefined &&
|
|
347
|
+
object.staleIndexAllowance !== null
|
|
348
|
+
? duration_1.Duration.fromPartial(object.staleIndexAllowance)
|
|
349
|
+
: undefined;
|
|
350
|
+
return message;
|
|
351
|
+
},
|
|
352
|
+
};
|
|
353
|
+
const baseMsgSetStaleIndexAllowanceResponse = {};
|
|
354
|
+
exports.MsgSetStaleIndexAllowanceResponse = {
|
|
355
|
+
encode(_, writer = minimal_1.default.Writer.create()) {
|
|
356
|
+
return writer;
|
|
357
|
+
},
|
|
358
|
+
decode(input, length) {
|
|
359
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
360
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
361
|
+
const message = Object.assign({}, baseMsgSetStaleIndexAllowanceResponse);
|
|
362
|
+
while (reader.pos < end) {
|
|
363
|
+
const tag = reader.uint32();
|
|
364
|
+
switch (tag >>> 3) {
|
|
365
|
+
default:
|
|
366
|
+
reader.skipType(tag & 7);
|
|
367
|
+
break;
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
return message;
|
|
371
|
+
},
|
|
372
|
+
fromJSON(_) {
|
|
373
|
+
const message = Object.assign({}, baseMsgSetStaleIndexAllowanceResponse);
|
|
374
|
+
return message;
|
|
375
|
+
},
|
|
376
|
+
toJSON(_) {
|
|
377
|
+
const obj = {};
|
|
378
|
+
return obj;
|
|
379
|
+
},
|
|
380
|
+
fromPartial(_) {
|
|
381
|
+
const message = Object.assign({}, baseMsgSetStaleIndexAllowanceResponse);
|
|
382
|
+
return message;
|
|
383
|
+
},
|
|
384
|
+
};
|
|
11
385
|
class MsgClientImpl {
|
|
12
386
|
constructor(rpc) {
|
|
13
387
|
this.rpc = rpc;
|
|
388
|
+
this.SetBackfillTimeInterval = this.SetBackfillTimeInterval.bind(this);
|
|
389
|
+
this.SetSmoothenBand = this.SetSmoothenBand.bind(this);
|
|
390
|
+
this.SetImpactBand = this.SetImpactBand.bind(this);
|
|
391
|
+
this.SetStaleIndexAllowance = this.SetStaleIndexAllowance.bind(this);
|
|
392
|
+
}
|
|
393
|
+
SetBackfillTimeInterval(request) {
|
|
394
|
+
const data = exports.MsgSetBackfillTimeInterval.encode(request).finish();
|
|
395
|
+
const promise = this.rpc.request("Switcheo.carbon.pricing.Msg", "SetBackfillTimeInterval", data);
|
|
396
|
+
return promise.then((data) => exports.MsgSetBackfillTimeIntervalResponse.decode(new minimal_1.default.Reader(data)));
|
|
397
|
+
}
|
|
398
|
+
SetSmoothenBand(request) {
|
|
399
|
+
const data = exports.MsgSetSmoothenBand.encode(request).finish();
|
|
400
|
+
const promise = this.rpc.request("Switcheo.carbon.pricing.Msg", "SetSmoothenBand", data);
|
|
401
|
+
return promise.then((data) => exports.MsgSetSmoothenBandResponse.decode(new minimal_1.default.Reader(data)));
|
|
402
|
+
}
|
|
403
|
+
SetImpactBand(request) {
|
|
404
|
+
const data = exports.MsgSetImpactBand.encode(request).finish();
|
|
405
|
+
const promise = this.rpc.request("Switcheo.carbon.pricing.Msg", "SetImpactBand", data);
|
|
406
|
+
return promise.then((data) => exports.MsgSetImpactBandResponse.decode(new minimal_1.default.Reader(data)));
|
|
407
|
+
}
|
|
408
|
+
SetStaleIndexAllowance(request) {
|
|
409
|
+
const data = exports.MsgSetStaleIndexAllowance.encode(request).finish();
|
|
410
|
+
const promise = this.rpc.request("Switcheo.carbon.pricing.Msg", "SetStaleIndexAllowance", data);
|
|
411
|
+
return promise.then((data) => exports.MsgSetStaleIndexAllowanceResponse.decode(new minimal_1.default.Reader(data)));
|
|
14
412
|
}
|
|
15
413
|
}
|
|
16
414
|
exports.MsgClientImpl = MsgClientImpl;
|
package/lib/modules/admin.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Any, SettlementPriceParams } from "../codec";
|
|
2
2
|
import { Coin } from "../codec/cosmos/base/v1beta1/coin";
|
|
3
3
|
import { Description } from "../codec/cosmos/staking/v1beta1/staking";
|
|
4
|
+
import { CarbonWallet } from "../wallet";
|
|
4
5
|
import { CarbonTx } from "../util";
|
|
5
6
|
import BigNumber from "bignumber.js";
|
|
6
7
|
import Long from "long";
|
|
@@ -40,6 +41,12 @@ export declare class AdminModule extends BaseModule {
|
|
|
40
41
|
setLiquidationFee(params: AdminModule.SetLiquidationFeeParams, opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
|
|
41
42
|
setInterestFee(params: AdminModule.SetInterestFeeParams, opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
|
|
42
43
|
setStableCoinInterestRate(params: AdminModule.SetStableCoinInterestRateParams, opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
|
|
44
|
+
setCompleteLiquidationThreshold(params: AdminModule.SetCompleteLiquidationThresholdParams, opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
|
|
45
|
+
setMinimumCloseFactor(params: AdminModule.SetMinimumCloseFactorParams, opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
|
|
46
|
+
setSmallLiquidationSize(params: AdminModule.SetSmallLiquidationSizeParams, opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
|
|
47
|
+
createRewardScheme(params: AdminModule.CreateRewardSchemeParams, opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
|
|
48
|
+
updateRewardScheme(params: AdminModule.UpdateRewardSchemeParams, opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
|
|
49
|
+
addRewardReserve(params: AdminModule.AddRewardReserveParams, opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
|
|
43
50
|
}
|
|
44
51
|
export declare namespace AdminModule {
|
|
45
52
|
interface AuthorizeBridgeParams {
|
|
@@ -233,6 +240,39 @@ export declare namespace AdminModule {
|
|
|
233
240
|
interface SetStableCoinInterestRateParams {
|
|
234
241
|
stablecoinInterestRate: BigNumber;
|
|
235
242
|
}
|
|
243
|
+
interface SetCompleteLiquidationThresholdParams {
|
|
244
|
+
completeLiquidationThreshold: BigNumber;
|
|
245
|
+
}
|
|
246
|
+
interface SetMinimumCloseFactorParams {
|
|
247
|
+
minimumCloseFactor: BigNumber;
|
|
248
|
+
}
|
|
249
|
+
interface SetSmallLiquidationSizeParams {
|
|
250
|
+
smallLiquidationSize: BigNumber;
|
|
251
|
+
}
|
|
252
|
+
interface CreateRewardSchemeParams {
|
|
253
|
+
rewardDenom: string;
|
|
254
|
+
assetDenom: string;
|
|
255
|
+
rewardType: string;
|
|
256
|
+
rewardAmountPerSecond: BigNumber;
|
|
257
|
+
startTime?: Date;
|
|
258
|
+
endTime?: Date;
|
|
259
|
+
reservesAmount: BigNumber;
|
|
260
|
+
}
|
|
261
|
+
interface UpdateRewardSchemeParams {
|
|
262
|
+
rewardSchemeId: number;
|
|
263
|
+
rewardDenom?: string;
|
|
264
|
+
assetDenom?: string;
|
|
265
|
+
rewardType?: string;
|
|
266
|
+
rewardAmountPerSecond: BigNumber;
|
|
267
|
+
startTime?: Date;
|
|
268
|
+
endTime?: Date;
|
|
269
|
+
}
|
|
270
|
+
interface AddRewardReserveParams {
|
|
271
|
+
creator?: string;
|
|
272
|
+
rewardSchemeId: number;
|
|
273
|
+
amount: BigNumber;
|
|
274
|
+
denom: string;
|
|
275
|
+
}
|
|
236
276
|
}
|
|
237
277
|
export declare function transfromCreateOracleParams(msg: AdminModule.CreateOracleParams, address: string): {
|
|
238
278
|
creator: string;
|
|
@@ -259,12 +299,6 @@ export declare function transfromSyncTokenParams(msg: AdminModule.SyncTokenParam
|
|
|
259
299
|
syncer: string;
|
|
260
300
|
denom: string;
|
|
261
301
|
};
|
|
262
|
-
export declare function transfromCreateVaultTypeParams(msg: AdminModule.CreateVaultTypeParams, address: string): {
|
|
263
|
-
creator: string;
|
|
264
|
-
collateralDenom: string;
|
|
265
|
-
debtDenom: string;
|
|
266
|
-
collateralizationRatio: string;
|
|
267
|
-
};
|
|
268
302
|
export declare function transfromLinkPoolParams(msg: AdminModule.LinkPoolParams): {
|
|
269
303
|
poolId: Long.Long;
|
|
270
304
|
market: string;
|
|
@@ -313,3 +347,27 @@ export declare function transformSetSettlementPriceParams(msg: SettlementPricePa
|
|
|
313
347
|
settlementPrice: string;
|
|
314
348
|
};
|
|
315
349
|
export declare function transformCommunityPoolSpendAmount(amount: Coin[]): Coin[];
|
|
350
|
+
export declare function transformCreateRewardScheme(msg: AdminModule.CreateRewardSchemeParams): {
|
|
351
|
+
rewardDenom: string;
|
|
352
|
+
assetDenom: string;
|
|
353
|
+
rewardType: string;
|
|
354
|
+
rewardAmountPerSecond: string;
|
|
355
|
+
startTime: Date | undefined;
|
|
356
|
+
endTime: Date | undefined;
|
|
357
|
+
reservesAmount: string;
|
|
358
|
+
};
|
|
359
|
+
export declare function transformUpdateRewardScheme(msg: AdminModule.UpdateRewardSchemeParams): {
|
|
360
|
+
rewardSchemeId: Long.Long;
|
|
361
|
+
rewardDenom: string | undefined;
|
|
362
|
+
assetDenom: string | undefined;
|
|
363
|
+
rewardType: string | undefined;
|
|
364
|
+
rewardAmountPerSecond: string;
|
|
365
|
+
startTime: Date | undefined;
|
|
366
|
+
endTime: Date | undefined;
|
|
367
|
+
};
|
|
368
|
+
export declare function transformAddRewardReserve(msg: AdminModule.AddRewardReserveParams, wallet: CarbonWallet): {
|
|
369
|
+
creator: string;
|
|
370
|
+
rewardSchemeId: Long.Long;
|
|
371
|
+
amount: string;
|
|
372
|
+
denom: string;
|
|
373
|
+
};
|
package/lib/modules/admin.js
CHANGED
|
@@ -12,7 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.transformCommunityPoolSpendAmount = exports.transformSetSettlementPriceParams = exports.transfromSetMinGasPriceParams = exports.transfromSetMsgGasCostParams = exports.transfromSetTradingFlagParams = exports.transfromUpdatePoolParams = exports.transfromSetCommitmentCurveParams = exports.transfromSetRewardCurveParams = exports.transfromSetRewardsWeightsParams = exports.transfromUnlinkPoolParams = exports.transfromLinkPoolParams = exports.
|
|
15
|
+
exports.transformAddRewardReserve = exports.transformUpdateRewardScheme = exports.transformCreateRewardScheme = exports.transformCommunityPoolSpendAmount = exports.transformSetSettlementPriceParams = exports.transfromSetMinGasPriceParams = exports.transfromSetMsgGasCostParams = exports.transfromSetTradingFlagParams = exports.transfromUpdatePoolParams = exports.transfromSetCommitmentCurveParams = exports.transfromSetRewardCurveParams = exports.transfromSetRewardsWeightsParams = exports.transfromUnlinkPoolParams = exports.transfromLinkPoolParams = exports.transfromSyncTokenParams = exports.transfromCreateTokenParams = exports.transfromCreateOracleParams = exports.AdminModule = void 0;
|
|
16
16
|
const codec_1 = require("../codec");
|
|
17
17
|
const tx_1 = require("../codec/coin/tx");
|
|
18
18
|
const tx_2 = require("../codec/cosmos/staking/v1beta1/tx");
|
|
@@ -524,6 +524,84 @@ class AdminModule extends base_1.default {
|
|
|
524
524
|
}, opts);
|
|
525
525
|
});
|
|
526
526
|
}
|
|
527
|
+
setCompleteLiquidationThreshold(params, opts) {
|
|
528
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
529
|
+
const wallet = this.getWallet();
|
|
530
|
+
const value = codec_1.MsgSetCompleteLiquidationThreshold.fromPartial({
|
|
531
|
+
creator: wallet.bech32Address,
|
|
532
|
+
completeLiquidationThreshold: params.completeLiquidationThreshold.shiftedBy(18).toString(10),
|
|
533
|
+
});
|
|
534
|
+
return yield wallet.sendTx({
|
|
535
|
+
typeUrl: util_1.CarbonTx.Types.MsgSetCompleteLiquidationThreshold,
|
|
536
|
+
value,
|
|
537
|
+
}, opts);
|
|
538
|
+
});
|
|
539
|
+
}
|
|
540
|
+
setMinimumCloseFactor(params, opts) {
|
|
541
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
542
|
+
const wallet = this.getWallet();
|
|
543
|
+
const value = codec_1.MsgSetMinimumCloseFactor.fromPartial({
|
|
544
|
+
creator: wallet.bech32Address,
|
|
545
|
+
minimumCloseFactor: params.minimumCloseFactor.shiftedBy(18).toString(10),
|
|
546
|
+
});
|
|
547
|
+
return yield wallet.sendTx({
|
|
548
|
+
typeUrl: util_1.CarbonTx.Types.MsgSetMinimumCloseFactor,
|
|
549
|
+
value,
|
|
550
|
+
}, opts);
|
|
551
|
+
});
|
|
552
|
+
}
|
|
553
|
+
setSmallLiquidationSize(params, opts) {
|
|
554
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
555
|
+
const wallet = this.getWallet();
|
|
556
|
+
const value = codec_1.MsgSetSmallLiquidationSize.fromPartial({
|
|
557
|
+
creator: wallet.bech32Address,
|
|
558
|
+
smallLiquidationSize: params.smallLiquidationSize.shiftedBy(18).toString(10),
|
|
559
|
+
});
|
|
560
|
+
return yield wallet.sendTx({
|
|
561
|
+
typeUrl: util_1.CarbonTx.Types.MsgSetSmallLiquidationSize,
|
|
562
|
+
value,
|
|
563
|
+
}, opts);
|
|
564
|
+
});
|
|
565
|
+
}
|
|
566
|
+
createRewardScheme(params, opts) {
|
|
567
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
568
|
+
const wallet = this.getWallet();
|
|
569
|
+
const value = codec_1.MsgCreateRewardScheme.fromPartial({
|
|
570
|
+
creator: wallet.bech32Address,
|
|
571
|
+
createRewardSchemeParams: transformCreateRewardScheme(params),
|
|
572
|
+
});
|
|
573
|
+
return yield wallet.sendTx({
|
|
574
|
+
typeUrl: util_1.CarbonTx.Types.MsgCreateRewardScheme,
|
|
575
|
+
value,
|
|
576
|
+
}, opts);
|
|
577
|
+
});
|
|
578
|
+
}
|
|
579
|
+
updateRewardScheme(params, opts) {
|
|
580
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
581
|
+
const wallet = this.getWallet();
|
|
582
|
+
const value = codec_1.MsgUpdateRewardScheme.fromPartial({
|
|
583
|
+
updator: wallet.bech32Address,
|
|
584
|
+
updateRewardSchemeParams: transformUpdateRewardScheme(params),
|
|
585
|
+
});
|
|
586
|
+
return yield wallet.sendTx({
|
|
587
|
+
typeUrl: util_1.CarbonTx.Types.MsgUpdateRewardScheme,
|
|
588
|
+
value,
|
|
589
|
+
}, opts);
|
|
590
|
+
});
|
|
591
|
+
}
|
|
592
|
+
addRewardReserve(params, opts) {
|
|
593
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
594
|
+
const wallet = this.getWallet();
|
|
595
|
+
const value = codec_1.MsgAddRewardReserve.fromPartial({
|
|
596
|
+
creator: wallet.bech32Address,
|
|
597
|
+
addReservesParams: transformAddRewardReserve(params, wallet),
|
|
598
|
+
});
|
|
599
|
+
return yield wallet.sendTx({
|
|
600
|
+
typeUrl: util_1.CarbonTx.Types.MsgAddRewardReserve,
|
|
601
|
+
value,
|
|
602
|
+
}, opts);
|
|
603
|
+
});
|
|
604
|
+
}
|
|
527
605
|
}
|
|
528
606
|
exports.AdminModule = AdminModule;
|
|
529
607
|
;
|
|
@@ -561,15 +639,6 @@ function transfromSyncTokenParams(msg, address) {
|
|
|
561
639
|
};
|
|
562
640
|
}
|
|
563
641
|
exports.transfromSyncTokenParams = transfromSyncTokenParams;
|
|
564
|
-
function transfromCreateVaultTypeParams(msg, address) {
|
|
565
|
-
return {
|
|
566
|
-
creator: address,
|
|
567
|
-
collateralDenom: msg.collateralDenom,
|
|
568
|
-
debtDenom: msg.debtDenom,
|
|
569
|
-
collateralizationRatio: msg.collateralizationRatio.shiftedBy(18).toString(10),
|
|
570
|
-
};
|
|
571
|
-
}
|
|
572
|
-
exports.transfromCreateVaultTypeParams = transfromCreateVaultTypeParams;
|
|
573
642
|
function transfromLinkPoolParams(msg) {
|
|
574
643
|
return {
|
|
575
644
|
poolId: new long_1.default(msg.poolId),
|
|
@@ -660,3 +729,38 @@ function transformCommunityPoolSpendAmount(amount) {
|
|
|
660
729
|
return amounts;
|
|
661
730
|
}
|
|
662
731
|
exports.transformCommunityPoolSpendAmount = transformCommunityPoolSpendAmount;
|
|
732
|
+
function transformCreateRewardScheme(msg) {
|
|
733
|
+
return {
|
|
734
|
+
rewardDenom: msg.rewardDenom,
|
|
735
|
+
assetDenom: msg.assetDenom,
|
|
736
|
+
rewardType: msg.rewardType,
|
|
737
|
+
rewardAmountPerSecond: msg.rewardAmountPerSecond.toString(10),
|
|
738
|
+
startTime: msg.startTime,
|
|
739
|
+
endTime: msg.endTime,
|
|
740
|
+
reservesAmount: msg.reservesAmount.toString(10),
|
|
741
|
+
};
|
|
742
|
+
}
|
|
743
|
+
exports.transformCreateRewardScheme = transformCreateRewardScheme;
|
|
744
|
+
function transformUpdateRewardScheme(msg) {
|
|
745
|
+
var _a;
|
|
746
|
+
return {
|
|
747
|
+
rewardSchemeId: new long_1.default(msg.rewardSchemeId),
|
|
748
|
+
rewardDenom: msg.rewardDenom,
|
|
749
|
+
assetDenom: msg.assetDenom,
|
|
750
|
+
rewardType: msg.rewardType,
|
|
751
|
+
rewardAmountPerSecond: (_a = msg.rewardAmountPerSecond) === null || _a === void 0 ? void 0 : _a.toString(10),
|
|
752
|
+
startTime: msg.startTime,
|
|
753
|
+
endTime: msg.endTime,
|
|
754
|
+
};
|
|
755
|
+
}
|
|
756
|
+
exports.transformUpdateRewardScheme = transformUpdateRewardScheme;
|
|
757
|
+
function transformAddRewardReserve(msg, wallet) {
|
|
758
|
+
var _a;
|
|
759
|
+
return {
|
|
760
|
+
creator: (_a = msg.creator) !== null && _a !== void 0 ? _a : wallet.bech32Address,
|
|
761
|
+
rewardSchemeId: new long_1.default(msg.rewardSchemeId),
|
|
762
|
+
amount: msg.amount.toString(10),
|
|
763
|
+
denom: msg.denom,
|
|
764
|
+
};
|
|
765
|
+
}
|
|
766
|
+
exports.transformAddRewardReserve = transformAddRewardReserve;
|