carbon-js-sdk 0.4.31 → 0.4.33

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 (39) hide show
  1. package/lib/codec/cdp/cdp_liquidations.d.ts +32 -0
  2. package/lib/codec/cdp/cdp_liquidations.js +288 -0
  3. package/lib/codec/{crisis/genesis.d.ts → evmmerge/address.d.ts} +10 -9
  4. package/lib/codec/evmmerge/address.js +75 -0
  5. package/lib/codec/perpsliquidity/event.d.ts +1 -0
  6. package/lib/codec/perpsliquidity/event.js +18 -3
  7. package/lib/codec/perpsliquidity/params.d.ts +0 -2
  8. package/lib/codec/perpsliquidity/params.js +1 -18
  9. package/lib/codec/perpsliquidity/pool.d.ts +19 -1
  10. package/lib/codec/perpsliquidity/pool.js +150 -26
  11. package/lib/codec/perpsliquidity/query.d.ts +1 -1
  12. package/lib/codec/perpsliquidity/tx.d.ts +4 -1
  13. package/lib/codec/perpsliquidity/tx.js +32 -2
  14. package/lib/modules/erc20.d.ts +26 -0
  15. package/lib/modules/erc20.js +79 -0
  16. package/lib/modules/ibc.d.ts +5 -1
  17. package/lib/modules/ibc.js +18 -20
  18. package/lib/modules/perpsliquidity.d.ts +2 -7
  19. package/lib/modules/perpsliquidity.js +9 -8
  20. package/lib/provider/amino/types/erc20.d.ts +4 -0
  21. package/lib/provider/amino/types/erc20.js +40 -0
  22. package/lib/provider/amino/types/perpsliquidity.js +2 -1
  23. package/lib/provider/metamask/legacy-accounts.d.ts +1 -0
  24. package/lib/provider/metamask/legacy-accounts.js +28 -3
  25. package/lib/util/ethermint.js +3 -1
  26. package/package.json +1 -1
  27. package/lib/codec/crisis/genesis.js +0 -46
  28. package/lib/codec/crisis/query.d.ts +0 -43
  29. package/lib/codec/crisis/query.js +0 -103
  30. package/lib/codec/crisis/tx.d.ts +0 -12
  31. package/lib/codec/crisis/tx.js +0 -20
  32. package/lib/codec/ibc/applications/interchain_accounts/v1/genesis.d.ts +0 -76
  33. package/lib/codec/ibc/applications/interchain_accounts/v1/genesis.js +0 -424
  34. package/lib/codec/market/legacy.d.ts +0 -62
  35. package/lib/codec/market/legacy.js +0 -630
  36. package/lib/codec/query/pagination.d.ts +0 -29
  37. package/lib/codec/query/pagination.js +0 -126
  38. package/lib/modules/vault.d.ts +0 -56
  39. package/lib/modules/vault.js +0 -128
@@ -0,0 +1,32 @@
1
+ import Long from "long";
2
+ import _m0 from "protobufjs/minimal";
3
+ export declare const protobufPackage = "Switcheo.carbon.cdp";
4
+ export interface CDPLiquidations {
5
+ id: Long;
6
+ liquidator: string;
7
+ debtor: string;
8
+ collateralDenom: string;
9
+ collateralAmountLiquidated: string;
10
+ collateralAmountLiquidator: string;
11
+ collateralAmountFee: string;
12
+ liquidationPrice: string;
13
+ marketPrice: string;
14
+ discount: string;
15
+ debtDenom: string;
16
+ debtAmount: string;
17
+ blockHeight: Long;
18
+ blockTime?: Date;
19
+ transactionHash: string;
20
+ }
21
+ export declare const CDPLiquidations: {
22
+ encode(message: CDPLiquidations, writer?: _m0.Writer): _m0.Writer;
23
+ decode(input: _m0.Reader | Uint8Array, length?: number | undefined): CDPLiquidations;
24
+ fromJSON(object: any): CDPLiquidations;
25
+ toJSON(message: CDPLiquidations): unknown;
26
+ fromPartial(object: DeepPartial<CDPLiquidations>): CDPLiquidations;
27
+ };
28
+ declare type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
29
+ export declare type DeepPartial<T> = T extends Builtin ? T : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
30
+ [K in keyof T]?: DeepPartial<T[K]>;
31
+ } : Partial<T>;
32
+ export {};
@@ -0,0 +1,288 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.CDPLiquidations = exports.protobufPackage = void 0;
7
+ /* eslint-disable */
8
+ const long_1 = __importDefault(require("long"));
9
+ const minimal_1 = __importDefault(require("protobufjs/minimal"));
10
+ const timestamp_1 = require("../google/protobuf/timestamp");
11
+ exports.protobufPackage = "Switcheo.carbon.cdp";
12
+ const baseCDPLiquidations = {
13
+ id: long_1.default.UZERO,
14
+ liquidator: "",
15
+ debtor: "",
16
+ collateralDenom: "",
17
+ collateralAmountLiquidated: "",
18
+ collateralAmountLiquidator: "",
19
+ collateralAmountFee: "",
20
+ liquidationPrice: "",
21
+ marketPrice: "",
22
+ discount: "",
23
+ debtDenom: "",
24
+ debtAmount: "",
25
+ blockHeight: long_1.default.ZERO,
26
+ transactionHash: "",
27
+ };
28
+ exports.CDPLiquidations = {
29
+ encode(message, writer = minimal_1.default.Writer.create()) {
30
+ if (!message.id.isZero()) {
31
+ writer.uint32(8).uint64(message.id);
32
+ }
33
+ if (message.liquidator !== "") {
34
+ writer.uint32(18).string(message.liquidator);
35
+ }
36
+ if (message.debtor !== "") {
37
+ writer.uint32(26).string(message.debtor);
38
+ }
39
+ if (message.collateralDenom !== "") {
40
+ writer.uint32(34).string(message.collateralDenom);
41
+ }
42
+ if (message.collateralAmountLiquidated !== "") {
43
+ writer.uint32(42).string(message.collateralAmountLiquidated);
44
+ }
45
+ if (message.collateralAmountLiquidator !== "") {
46
+ writer.uint32(50).string(message.collateralAmountLiquidator);
47
+ }
48
+ if (message.collateralAmountFee !== "") {
49
+ writer.uint32(58).string(message.collateralAmountFee);
50
+ }
51
+ if (message.liquidationPrice !== "") {
52
+ writer.uint32(66).string(message.liquidationPrice);
53
+ }
54
+ if (message.marketPrice !== "") {
55
+ writer.uint32(74).string(message.marketPrice);
56
+ }
57
+ if (message.discount !== "") {
58
+ writer.uint32(82).string(message.discount);
59
+ }
60
+ if (message.debtDenom !== "") {
61
+ writer.uint32(90).string(message.debtDenom);
62
+ }
63
+ if (message.debtAmount !== "") {
64
+ writer.uint32(98).string(message.debtAmount);
65
+ }
66
+ if (!message.blockHeight.isZero()) {
67
+ writer.uint32(104).int64(message.blockHeight);
68
+ }
69
+ if (message.blockTime !== undefined) {
70
+ timestamp_1.Timestamp.encode(toTimestamp(message.blockTime), writer.uint32(114).fork()).ldelim();
71
+ }
72
+ if (message.transactionHash !== "") {
73
+ writer.uint32(122).string(message.transactionHash);
74
+ }
75
+ return writer;
76
+ },
77
+ decode(input, length) {
78
+ const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
79
+ let end = length === undefined ? reader.len : reader.pos + length;
80
+ const message = Object.assign({}, baseCDPLiquidations);
81
+ while (reader.pos < end) {
82
+ const tag = reader.uint32();
83
+ switch (tag >>> 3) {
84
+ case 1:
85
+ message.id = reader.uint64();
86
+ break;
87
+ case 2:
88
+ message.liquidator = reader.string();
89
+ break;
90
+ case 3:
91
+ message.debtor = reader.string();
92
+ break;
93
+ case 4:
94
+ message.collateralDenom = reader.string();
95
+ break;
96
+ case 5:
97
+ message.collateralAmountLiquidated = reader.string();
98
+ break;
99
+ case 6:
100
+ message.collateralAmountLiquidator = reader.string();
101
+ break;
102
+ case 7:
103
+ message.collateralAmountFee = reader.string();
104
+ break;
105
+ case 8:
106
+ message.liquidationPrice = reader.string();
107
+ break;
108
+ case 9:
109
+ message.marketPrice = reader.string();
110
+ break;
111
+ case 10:
112
+ message.discount = reader.string();
113
+ break;
114
+ case 11:
115
+ message.debtDenom = reader.string();
116
+ break;
117
+ case 12:
118
+ message.debtAmount = reader.string();
119
+ break;
120
+ case 13:
121
+ message.blockHeight = reader.int64();
122
+ break;
123
+ case 14:
124
+ message.blockTime = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
125
+ break;
126
+ case 15:
127
+ message.transactionHash = reader.string();
128
+ break;
129
+ default:
130
+ reader.skipType(tag & 7);
131
+ break;
132
+ }
133
+ }
134
+ return message;
135
+ },
136
+ fromJSON(object) {
137
+ const message = Object.assign({}, baseCDPLiquidations);
138
+ message.id =
139
+ object.id !== undefined && object.id !== null
140
+ ? long_1.default.fromString(object.id)
141
+ : long_1.default.UZERO;
142
+ message.liquidator =
143
+ object.liquidator !== undefined && object.liquidator !== null
144
+ ? String(object.liquidator)
145
+ : "";
146
+ message.debtor =
147
+ object.debtor !== undefined && object.debtor !== null
148
+ ? String(object.debtor)
149
+ : "";
150
+ message.collateralDenom =
151
+ object.collateralDenom !== undefined && object.collateralDenom !== null
152
+ ? String(object.collateralDenom)
153
+ : "";
154
+ message.collateralAmountLiquidated =
155
+ object.collateralAmountLiquidated !== undefined &&
156
+ object.collateralAmountLiquidated !== null
157
+ ? String(object.collateralAmountLiquidated)
158
+ : "";
159
+ message.collateralAmountLiquidator =
160
+ object.collateralAmountLiquidator !== undefined &&
161
+ object.collateralAmountLiquidator !== null
162
+ ? String(object.collateralAmountLiquidator)
163
+ : "";
164
+ message.collateralAmountFee =
165
+ object.collateralAmountFee !== undefined &&
166
+ object.collateralAmountFee !== null
167
+ ? String(object.collateralAmountFee)
168
+ : "";
169
+ message.liquidationPrice =
170
+ object.liquidationPrice !== undefined && object.liquidationPrice !== null
171
+ ? String(object.liquidationPrice)
172
+ : "";
173
+ message.marketPrice =
174
+ object.marketPrice !== undefined && object.marketPrice !== null
175
+ ? String(object.marketPrice)
176
+ : "";
177
+ message.discount =
178
+ object.discount !== undefined && object.discount !== null
179
+ ? String(object.discount)
180
+ : "";
181
+ message.debtDenom =
182
+ object.debtDenom !== undefined && object.debtDenom !== null
183
+ ? String(object.debtDenom)
184
+ : "";
185
+ message.debtAmount =
186
+ object.debtAmount !== undefined && object.debtAmount !== null
187
+ ? String(object.debtAmount)
188
+ : "";
189
+ message.blockHeight =
190
+ object.blockHeight !== undefined && object.blockHeight !== null
191
+ ? long_1.default.fromString(object.blockHeight)
192
+ : long_1.default.ZERO;
193
+ message.blockTime =
194
+ object.blockTime !== undefined && object.blockTime !== null
195
+ ? fromJsonTimestamp(object.blockTime)
196
+ : undefined;
197
+ message.transactionHash =
198
+ object.transactionHash !== undefined && object.transactionHash !== null
199
+ ? String(object.transactionHash)
200
+ : "";
201
+ return message;
202
+ },
203
+ toJSON(message) {
204
+ const obj = {};
205
+ message.id !== undefined &&
206
+ (obj.id = (message.id || long_1.default.UZERO).toString());
207
+ message.liquidator !== undefined && (obj.liquidator = message.liquidator);
208
+ message.debtor !== undefined && (obj.debtor = message.debtor);
209
+ message.collateralDenom !== undefined &&
210
+ (obj.collateralDenom = message.collateralDenom);
211
+ message.collateralAmountLiquidated !== undefined &&
212
+ (obj.collateralAmountLiquidated = message.collateralAmountLiquidated);
213
+ message.collateralAmountLiquidator !== undefined &&
214
+ (obj.collateralAmountLiquidator = message.collateralAmountLiquidator);
215
+ message.collateralAmountFee !== undefined &&
216
+ (obj.collateralAmountFee = message.collateralAmountFee);
217
+ message.liquidationPrice !== undefined &&
218
+ (obj.liquidationPrice = message.liquidationPrice);
219
+ message.marketPrice !== undefined &&
220
+ (obj.marketPrice = message.marketPrice);
221
+ message.discount !== undefined && (obj.discount = message.discount);
222
+ message.debtDenom !== undefined && (obj.debtDenom = message.debtDenom);
223
+ message.debtAmount !== undefined && (obj.debtAmount = message.debtAmount);
224
+ message.blockHeight !== undefined &&
225
+ (obj.blockHeight = (message.blockHeight || long_1.default.ZERO).toString());
226
+ message.blockTime !== undefined &&
227
+ (obj.blockTime = message.blockTime.toISOString());
228
+ message.transactionHash !== undefined &&
229
+ (obj.transactionHash = message.transactionHash);
230
+ return obj;
231
+ },
232
+ fromPartial(object) {
233
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
234
+ const message = Object.assign({}, baseCDPLiquidations);
235
+ message.id =
236
+ object.id !== undefined && object.id !== null
237
+ ? long_1.default.fromValue(object.id)
238
+ : long_1.default.UZERO;
239
+ message.liquidator = (_a = object.liquidator) !== null && _a !== void 0 ? _a : "";
240
+ message.debtor = (_b = object.debtor) !== null && _b !== void 0 ? _b : "";
241
+ message.collateralDenom = (_c = object.collateralDenom) !== null && _c !== void 0 ? _c : "";
242
+ message.collateralAmountLiquidated =
243
+ (_d = object.collateralAmountLiquidated) !== null && _d !== void 0 ? _d : "";
244
+ message.collateralAmountLiquidator =
245
+ (_e = object.collateralAmountLiquidator) !== null && _e !== void 0 ? _e : "";
246
+ message.collateralAmountFee = (_f = object.collateralAmountFee) !== null && _f !== void 0 ? _f : "";
247
+ message.liquidationPrice = (_g = object.liquidationPrice) !== null && _g !== void 0 ? _g : "";
248
+ message.marketPrice = (_h = object.marketPrice) !== null && _h !== void 0 ? _h : "";
249
+ message.discount = (_j = object.discount) !== null && _j !== void 0 ? _j : "";
250
+ message.debtDenom = (_k = object.debtDenom) !== null && _k !== void 0 ? _k : "";
251
+ message.debtAmount = (_l = object.debtAmount) !== null && _l !== void 0 ? _l : "";
252
+ message.blockHeight =
253
+ object.blockHeight !== undefined && object.blockHeight !== null
254
+ ? long_1.default.fromValue(object.blockHeight)
255
+ : long_1.default.ZERO;
256
+ message.blockTime = (_m = object.blockTime) !== null && _m !== void 0 ? _m : undefined;
257
+ message.transactionHash = (_o = object.transactionHash) !== null && _o !== void 0 ? _o : "";
258
+ return message;
259
+ },
260
+ };
261
+ function toTimestamp(date) {
262
+ const seconds = numberToLong(date.getTime() / 1000);
263
+ const nanos = (date.getTime() % 1000) * 1000000;
264
+ return { seconds, nanos };
265
+ }
266
+ function fromTimestamp(t) {
267
+ let millis = t.seconds.toNumber() * 1000;
268
+ millis += t.nanos / 1000000;
269
+ return new Date(millis);
270
+ }
271
+ function fromJsonTimestamp(o) {
272
+ if (o instanceof Date) {
273
+ return o;
274
+ }
275
+ else if (typeof o === "string") {
276
+ return new Date(o);
277
+ }
278
+ else {
279
+ return fromTimestamp(timestamp_1.Timestamp.fromJSON(o));
280
+ }
281
+ }
282
+ function numberToLong(number) {
283
+ return long_1.default.fromNumber(number);
284
+ }
285
+ if (minimal_1.default.util.Long !== long_1.default) {
286
+ minimal_1.default.util.Long = long_1.default;
287
+ minimal_1.default.configure();
288
+ }
@@ -1,15 +1,16 @@
1
1
  import Long from "long";
2
2
  import _m0 from "protobufjs/minimal";
3
- export declare const protobufPackage = "Switcheo.carbon.crisis";
4
- /** GenesisState defines the crisis module's genesis state. */
5
- export interface GenesisState {
3
+ export declare const protobufPackage = "Switcheo.carbon.evmmerge";
4
+ export interface EthCosmosAddressWrapper {
5
+ ethAddress: string;
6
+ cosmosAddress: string;
6
7
  }
7
- export declare const GenesisState: {
8
- encode(_: GenesisState, writer?: _m0.Writer): _m0.Writer;
9
- decode(input: _m0.Reader | Uint8Array, length?: number | undefined): GenesisState;
10
- fromJSON(_: any): GenesisState;
11
- toJSON(_: GenesisState): unknown;
12
- fromPartial(_: DeepPartial<GenesisState>): GenesisState;
8
+ export declare const EthCosmosAddressWrapper: {
9
+ encode(message: EthCosmosAddressWrapper, writer?: _m0.Writer): _m0.Writer;
10
+ decode(input: _m0.Reader | Uint8Array, length?: number | undefined): EthCosmosAddressWrapper;
11
+ fromJSON(object: any): EthCosmosAddressWrapper;
12
+ toJSON(message: EthCosmosAddressWrapper): unknown;
13
+ fromPartial(object: DeepPartial<EthCosmosAddressWrapper>): EthCosmosAddressWrapper;
13
14
  };
14
15
  declare type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
15
16
  export declare type DeepPartial<T> = T extends Builtin ? T : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.EthCosmosAddressWrapper = exports.protobufPackage = void 0;
7
+ /* eslint-disable */
8
+ const long_1 = __importDefault(require("long"));
9
+ const minimal_1 = __importDefault(require("protobufjs/minimal"));
10
+ exports.protobufPackage = "Switcheo.carbon.evmmerge";
11
+ const baseEthCosmosAddressWrapper = {
12
+ ethAddress: "",
13
+ cosmosAddress: "",
14
+ };
15
+ exports.EthCosmosAddressWrapper = {
16
+ encode(message, writer = minimal_1.default.Writer.create()) {
17
+ if (message.ethAddress !== "") {
18
+ writer.uint32(10).string(message.ethAddress);
19
+ }
20
+ if (message.cosmosAddress !== "") {
21
+ writer.uint32(18).string(message.cosmosAddress);
22
+ }
23
+ return writer;
24
+ },
25
+ decode(input, length) {
26
+ const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
27
+ let end = length === undefined ? reader.len : reader.pos + length;
28
+ const message = Object.assign({}, baseEthCosmosAddressWrapper);
29
+ while (reader.pos < end) {
30
+ const tag = reader.uint32();
31
+ switch (tag >>> 3) {
32
+ case 1:
33
+ message.ethAddress = reader.string();
34
+ break;
35
+ case 2:
36
+ message.cosmosAddress = reader.string();
37
+ break;
38
+ default:
39
+ reader.skipType(tag & 7);
40
+ break;
41
+ }
42
+ }
43
+ return message;
44
+ },
45
+ fromJSON(object) {
46
+ const message = Object.assign({}, baseEthCosmosAddressWrapper);
47
+ message.ethAddress =
48
+ object.ethAddress !== undefined && object.ethAddress !== null
49
+ ? String(object.ethAddress)
50
+ : "";
51
+ message.cosmosAddress =
52
+ object.cosmosAddress !== undefined && object.cosmosAddress !== null
53
+ ? String(object.cosmosAddress)
54
+ : "";
55
+ return message;
56
+ },
57
+ toJSON(message) {
58
+ const obj = {};
59
+ message.ethAddress !== undefined && (obj.ethAddress = message.ethAddress);
60
+ message.cosmosAddress !== undefined &&
61
+ (obj.cosmosAddress = message.cosmosAddress);
62
+ return obj;
63
+ },
64
+ fromPartial(object) {
65
+ var _a, _b;
66
+ const message = Object.assign({}, baseEthCosmosAddressWrapper);
67
+ message.ethAddress = (_a = object.ethAddress) !== null && _a !== void 0 ? _a : "";
68
+ message.cosmosAddress = (_b = object.cosmosAddress) !== null && _b !== void 0 ? _b : "";
69
+ return message;
70
+ },
71
+ };
72
+ if (minimal_1.default.util.Long !== long_1.default) {
73
+ minimal_1.default.util.Long = long_1.default;
74
+ minimal_1.default.configure();
75
+ }
@@ -29,6 +29,7 @@ export interface DepositToPoolEvent {
29
29
  amount: string;
30
30
  shareDenom: string;
31
31
  shareAmount: string;
32
+ initialShareAmountBurnt: string;
32
33
  depositor: string;
33
34
  }
34
35
  export interface WithdrawFromPoolEvent {
@@ -347,6 +347,7 @@ const baseDepositToPoolEvent = {
347
347
  amount: "",
348
348
  shareDenom: "",
349
349
  shareAmount: "",
350
+ initialShareAmountBurnt: "",
350
351
  depositor: "",
351
352
  };
352
353
  exports.DepositToPoolEvent = {
@@ -366,8 +367,11 @@ exports.DepositToPoolEvent = {
366
367
  if (message.shareAmount !== "") {
367
368
  writer.uint32(42).string(message.shareAmount);
368
369
  }
370
+ if (message.initialShareAmountBurnt !== "") {
371
+ writer.uint32(50).string(message.initialShareAmountBurnt);
372
+ }
369
373
  if (message.depositor !== "") {
370
- writer.uint32(50).string(message.depositor);
374
+ writer.uint32(58).string(message.depositor);
371
375
  }
372
376
  return writer;
373
377
  },
@@ -394,6 +398,9 @@ exports.DepositToPoolEvent = {
394
398
  message.shareAmount = reader.string();
395
399
  break;
396
400
  case 6:
401
+ message.initialShareAmountBurnt = reader.string();
402
+ break;
403
+ case 7:
397
404
  message.depositor = reader.string();
398
405
  break;
399
406
  default:
@@ -425,6 +432,11 @@ exports.DepositToPoolEvent = {
425
432
  object.shareAmount !== undefined && object.shareAmount !== null
426
433
  ? String(object.shareAmount)
427
434
  : "";
435
+ message.initialShareAmountBurnt =
436
+ object.initialShareAmountBurnt !== undefined &&
437
+ object.initialShareAmountBurnt !== null
438
+ ? String(object.initialShareAmountBurnt)
439
+ : "";
428
440
  message.depositor =
429
441
  object.depositor !== undefined && object.depositor !== null
430
442
  ? String(object.depositor)
@@ -440,11 +452,13 @@ exports.DepositToPoolEvent = {
440
452
  message.shareDenom !== undefined && (obj.shareDenom = message.shareDenom);
441
453
  message.shareAmount !== undefined &&
442
454
  (obj.shareAmount = message.shareAmount);
455
+ message.initialShareAmountBurnt !== undefined &&
456
+ (obj.initialShareAmountBurnt = message.initialShareAmountBurnt);
443
457
  message.depositor !== undefined && (obj.depositor = message.depositor);
444
458
  return obj;
445
459
  },
446
460
  fromPartial(object) {
447
- var _a, _b, _c, _d, _e;
461
+ var _a, _b, _c, _d, _e, _f;
448
462
  const message = Object.assign({}, baseDepositToPoolEvent);
449
463
  message.poolId =
450
464
  object.poolId !== undefined && object.poolId !== null
@@ -454,7 +468,8 @@ exports.DepositToPoolEvent = {
454
468
  message.amount = (_b = object.amount) !== null && _b !== void 0 ? _b : "";
455
469
  message.shareDenom = (_c = object.shareDenom) !== null && _c !== void 0 ? _c : "";
456
470
  message.shareAmount = (_d = object.shareAmount) !== null && _d !== void 0 ? _d : "";
457
- message.depositor = (_e = object.depositor) !== null && _e !== void 0 ? _e : "";
471
+ message.initialShareAmountBurnt = (_e = object.initialShareAmountBurnt) !== null && _e !== void 0 ? _e : "";
472
+ message.depositor = (_f = object.depositor) !== null && _f !== void 0 ? _f : "";
458
473
  return message;
459
474
  },
460
475
  };
@@ -7,8 +7,6 @@ export interface Params {
7
7
  quoteIndexPriceFluctuationToleranceRatio: string;
8
8
  /** requotes after orders are x seconds old */
9
9
  quoteExpirySeconds: Long;
10
- /** requotes when open position change threshold exceeded (in ratio) */
11
- lpOpenPositionFluctuationToleranceRatio: string;
12
10
  }
13
11
  export declare const Params: {
14
12
  encode(message: Params, writer?: _m0.Writer): _m0.Writer;
@@ -11,7 +11,6 @@ exports.protobufPackage = "Switcheo.carbon.perpsliquidity";
11
11
  const baseParams = {
12
12
  quoteIndexPriceFluctuationToleranceRatio: "",
13
13
  quoteExpirySeconds: long_1.default.UZERO,
14
- lpOpenPositionFluctuationToleranceRatio: "",
15
14
  };
16
15
  exports.Params = {
17
16
  encode(message, writer = minimal_1.default.Writer.create()) {
@@ -23,9 +22,6 @@ exports.Params = {
23
22
  if (!message.quoteExpirySeconds.isZero()) {
24
23
  writer.uint32(16).uint64(message.quoteExpirySeconds);
25
24
  }
26
- if (message.lpOpenPositionFluctuationToleranceRatio !== "") {
27
- writer.uint32(26).string(message.lpOpenPositionFluctuationToleranceRatio);
28
- }
29
25
  return writer;
30
26
  },
31
27
  decode(input, length) {
@@ -41,9 +37,6 @@ exports.Params = {
41
37
  case 2:
42
38
  message.quoteExpirySeconds = reader.uint64();
43
39
  break;
44
- case 3:
45
- message.lpOpenPositionFluctuationToleranceRatio = reader.string();
46
- break;
47
40
  default:
48
41
  reader.skipType(tag & 7);
49
42
  break;
@@ -63,11 +56,6 @@ exports.Params = {
63
56
  object.quoteExpirySeconds !== null
64
57
  ? long_1.default.fromString(object.quoteExpirySeconds)
65
58
  : long_1.default.UZERO;
66
- message.lpOpenPositionFluctuationToleranceRatio =
67
- object.lpOpenPositionFluctuationToleranceRatio !== undefined &&
68
- object.lpOpenPositionFluctuationToleranceRatio !== null
69
- ? String(object.lpOpenPositionFluctuationToleranceRatio)
70
- : "";
71
59
  return message;
72
60
  },
73
61
  toJSON(message) {
@@ -77,13 +65,10 @@ exports.Params = {
77
65
  message.quoteIndexPriceFluctuationToleranceRatio);
78
66
  message.quoteExpirySeconds !== undefined &&
79
67
  (obj.quoteExpirySeconds = (message.quoteExpirySeconds || long_1.default.UZERO).toString());
80
- message.lpOpenPositionFluctuationToleranceRatio !== undefined &&
81
- (obj.lpOpenPositionFluctuationToleranceRatio =
82
- message.lpOpenPositionFluctuationToleranceRatio);
83
68
  return obj;
84
69
  },
85
70
  fromPartial(object) {
86
- var _a, _b;
71
+ var _a;
87
72
  const message = Object.assign({}, baseParams);
88
73
  message.quoteIndexPriceFluctuationToleranceRatio =
89
74
  (_a = object.quoteIndexPriceFluctuationToleranceRatio) !== null && _a !== void 0 ? _a : "";
@@ -92,8 +77,6 @@ exports.Params = {
92
77
  object.quoteExpirySeconds !== null
93
78
  ? long_1.default.fromValue(object.quoteExpirySeconds)
94
79
  : long_1.default.UZERO;
95
- message.lpOpenPositionFluctuationToleranceRatio =
96
- (_b = object.lpOpenPositionFluctuationToleranceRatio) !== null && _b !== void 0 ? _b : "";
97
80
  return message;
98
81
  },
99
82
  };
@@ -19,12 +19,15 @@ export interface PlPool {
19
19
  depositFeeBps: string;
20
20
  /** withdrawal fee to charge on a successful withdrawal from PLP in bps */
21
21
  withdrawalFeeBps: string;
22
+ /** borrow fee in bps per time period to charge on use of liquidity in pool */
23
+ borrowFeeBps: string;
22
24
  }
23
25
  export interface UpdatePlPoolParams {
24
26
  name?: string;
25
- supplyCap?: Long;
27
+ supplyCap: string;
26
28
  depositFeeBps?: Long;
27
29
  withdrawalFeeBps?: Long;
30
+ borrowFeeBps?: Long;
28
31
  }
29
32
  /** PoolDetails used for for querying. same as Pool but appended with registered_markets */
30
33
  export interface PoolDetails {
@@ -45,6 +48,8 @@ export interface MarketConfig {
45
48
  * ratio where 0 < max_liquidity_ratio <= 1
46
49
  */
47
50
  maxLiquidityRatio: string;
51
+ /** borrow_fee_multiplier controls the multiplier for the base borrow fee charged on the pool. riskier markets should have a higher multiplier */
52
+ borrowFeeMultiplier: string;
48
53
  /**
49
54
  * Available modes:
50
55
  * active - market is active for quoting
@@ -57,6 +62,7 @@ export interface MarketConfig {
57
62
  }
58
63
  export interface UpdateMarketConfigParams {
59
64
  maxLiquidityRatio: string;
65
+ borrowFeeMultiplier: string;
60
66
  mode?: string;
61
67
  quoteShape: Quote[];
62
68
  }
@@ -74,6 +80,11 @@ export interface WithdrawFromPoolParams {
74
80
  shareAmount: string;
75
81
  minWithdrawAmount: string;
76
82
  }
83
+ /** DepositToBonusContractParams params required for enqueuing into deposit transient store */
84
+ export interface DepositToBonusContractParams {
85
+ bonusVaultId: Long;
86
+ isLongUnbond: boolean;
87
+ }
77
88
  export declare const PlPool: {
78
89
  encode(message: PlPool, writer?: _m0.Writer): _m0.Writer;
79
90
  decode(input: _m0.Reader | Uint8Array, length?: number | undefined): PlPool;
@@ -130,6 +141,13 @@ export declare const WithdrawFromPoolParams: {
130
141
  toJSON(message: WithdrawFromPoolParams): unknown;
131
142
  fromPartial(object: DeepPartial<WithdrawFromPoolParams>): WithdrawFromPoolParams;
132
143
  };
144
+ export declare const DepositToBonusContractParams: {
145
+ encode(message: DepositToBonusContractParams, writer?: _m0.Writer): _m0.Writer;
146
+ decode(input: _m0.Reader | Uint8Array, length?: number | undefined): DepositToBonusContractParams;
147
+ fromJSON(object: any): DepositToBonusContractParams;
148
+ toJSON(message: DepositToBonusContractParams): unknown;
149
+ fromPartial(object: DeepPartial<DepositToBonusContractParams>): DepositToBonusContractParams;
150
+ };
133
151
  declare type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
134
152
  export declare type DeepPartial<T> = T extends Builtin ? T : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
135
153
  [K in keyof T]?: DeepPartial<T[K]>;