@verana-labs/verana-types 0.10.1-dev.18 → 0.10.1-dev.19

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.
@@ -41,6 +41,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
41
41
  exports.TrustDepositRecord = exports.GenesisState = exports.protobufPackage = void 0;
42
42
  /* eslint-disable */
43
43
  const _m0 = __importStar(require("protobufjs/minimal"));
44
+ const timestamp_1 = require("../../../google/protobuf/timestamp");
44
45
  const params_1 = require("./params");
45
46
  const Long = require("long");
46
47
  exports.protobufPackage = "verana.td.v1";
@@ -131,21 +132,46 @@ exports.GenesisState = {
131
132
  },
132
133
  };
133
134
  function createBaseTrustDepositRecord() {
134
- return { corporation: "", share: "", deposit: 0, claimable: 0 };
135
+ return {
136
+ share: "",
137
+ deposit: 0,
138
+ corporationId: 0,
139
+ refunded: 0,
140
+ slashedDeposit: 0,
141
+ repaidDeposit: 0,
142
+ lastSlashed: undefined,
143
+ lastRepaid: undefined,
144
+ slashCount: 0,
145
+ };
135
146
  }
136
147
  exports.TrustDepositRecord = {
137
148
  encode(message, writer = _m0.Writer.create()) {
138
- if (message.corporation !== "") {
139
- writer.uint32(10).string(message.corporation);
140
- }
141
149
  if (message.share !== "") {
142
150
  writer.uint32(18).string(message.share);
143
151
  }
144
152
  if (message.deposit !== 0) {
145
153
  writer.uint32(24).uint64(message.deposit);
146
154
  }
147
- if (message.claimable !== 0) {
148
- writer.uint32(32).uint64(message.claimable);
155
+ if (message.corporationId !== 0) {
156
+ writer.uint32(40).uint64(message.corporationId);
157
+ }
158
+ if (message.refunded !== 0) {
159
+ writer.uint32(48).uint64(message.refunded);
160
+ }
161
+ if (message.slashedDeposit !== 0) {
162
+ writer.uint32(56).uint64(message.slashedDeposit);
163
+ }
164
+ if (message.repaidDeposit !== 0) {
165
+ writer.uint32(64).uint64(message.repaidDeposit);
166
+ }
167
+ if (message.lastSlashed !== undefined) {
168
+ timestamp_1.Timestamp.encode(toTimestamp(message.lastSlashed), writer.uint32(74).fork()).ldelim();
169
+ }
170
+ if (message.lastRepaid !== undefined) {
171
+ timestamp_1.Timestamp.encode(toTimestamp(message.lastRepaid), writer.uint32(82).fork()).ldelim();
172
+ }
173
+ if (message.slashCount !== 0) {
174
+ writer.uint32(88).uint64(message.slashCount);
149
175
  }
150
176
  return writer;
151
177
  },
@@ -156,12 +182,6 @@ exports.TrustDepositRecord = {
156
182
  while (reader.pos < end) {
157
183
  const tag = reader.uint32();
158
184
  switch (tag >>> 3) {
159
- case 1:
160
- if (tag !== 10) {
161
- break;
162
- }
163
- message.corporation = reader.string();
164
- continue;
165
185
  case 2:
166
186
  if (tag !== 18) {
167
187
  break;
@@ -174,11 +194,47 @@ exports.TrustDepositRecord = {
174
194
  }
175
195
  message.deposit = longToNumber(reader.uint64());
176
196
  continue;
177
- case 4:
178
- if (tag !== 32) {
197
+ case 5:
198
+ if (tag !== 40) {
199
+ break;
200
+ }
201
+ message.corporationId = longToNumber(reader.uint64());
202
+ continue;
203
+ case 6:
204
+ if (tag !== 48) {
205
+ break;
206
+ }
207
+ message.refunded = longToNumber(reader.uint64());
208
+ continue;
209
+ case 7:
210
+ if (tag !== 56) {
211
+ break;
212
+ }
213
+ message.slashedDeposit = longToNumber(reader.uint64());
214
+ continue;
215
+ case 8:
216
+ if (tag !== 64) {
179
217
  break;
180
218
  }
181
- message.claimable = longToNumber(reader.uint64());
219
+ message.repaidDeposit = longToNumber(reader.uint64());
220
+ continue;
221
+ case 9:
222
+ if (tag !== 74) {
223
+ break;
224
+ }
225
+ message.lastSlashed = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
226
+ continue;
227
+ case 10:
228
+ if (tag !== 82) {
229
+ break;
230
+ }
231
+ message.lastRepaid = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
232
+ continue;
233
+ case 11:
234
+ if (tag !== 88) {
235
+ break;
236
+ }
237
+ message.slashCount = longToNumber(reader.uint64());
182
238
  continue;
183
239
  }
184
240
  if ((tag & 7) === 4 || tag === 0) {
@@ -190,25 +246,45 @@ exports.TrustDepositRecord = {
190
246
  },
191
247
  fromJSON(object) {
192
248
  return {
193
- corporation: isSet(object.corporation) ? globalThis.String(object.corporation) : "",
194
249
  share: isSet(object.share) ? globalThis.String(object.share) : "",
195
250
  deposit: isSet(object.deposit) ? globalThis.Number(object.deposit) : 0,
196
- claimable: isSet(object.claimable) ? globalThis.Number(object.claimable) : 0,
251
+ corporationId: isSet(object.corporationId) ? globalThis.Number(object.corporationId) : 0,
252
+ refunded: isSet(object.refunded) ? globalThis.Number(object.refunded) : 0,
253
+ slashedDeposit: isSet(object.slashedDeposit) ? globalThis.Number(object.slashedDeposit) : 0,
254
+ repaidDeposit: isSet(object.repaidDeposit) ? globalThis.Number(object.repaidDeposit) : 0,
255
+ lastSlashed: isSet(object.lastSlashed) ? fromJsonTimestamp(object.lastSlashed) : undefined,
256
+ lastRepaid: isSet(object.lastRepaid) ? fromJsonTimestamp(object.lastRepaid) : undefined,
257
+ slashCount: isSet(object.slashCount) ? globalThis.Number(object.slashCount) : 0,
197
258
  };
198
259
  },
199
260
  toJSON(message) {
200
261
  const obj = {};
201
- if (message.corporation !== "") {
202
- obj.corporation = message.corporation;
203
- }
204
262
  if (message.share !== "") {
205
263
  obj.share = message.share;
206
264
  }
207
265
  if (message.deposit !== 0) {
208
266
  obj.deposit = Math.round(message.deposit);
209
267
  }
210
- if (message.claimable !== 0) {
211
- obj.claimable = Math.round(message.claimable);
268
+ if (message.corporationId !== 0) {
269
+ obj.corporationId = Math.round(message.corporationId);
270
+ }
271
+ if (message.refunded !== 0) {
272
+ obj.refunded = Math.round(message.refunded);
273
+ }
274
+ if (message.slashedDeposit !== 0) {
275
+ obj.slashedDeposit = Math.round(message.slashedDeposit);
276
+ }
277
+ if (message.repaidDeposit !== 0) {
278
+ obj.repaidDeposit = Math.round(message.repaidDeposit);
279
+ }
280
+ if (message.lastSlashed !== undefined) {
281
+ obj.lastSlashed = message.lastSlashed.toISOString();
282
+ }
283
+ if (message.lastRepaid !== undefined) {
284
+ obj.lastRepaid = message.lastRepaid.toISOString();
285
+ }
286
+ if (message.slashCount !== 0) {
287
+ obj.slashCount = Math.round(message.slashCount);
212
288
  }
213
289
  return obj;
214
290
  },
@@ -216,15 +292,41 @@ exports.TrustDepositRecord = {
216
292
  return exports.TrustDepositRecord.fromPartial(base !== null && base !== void 0 ? base : {});
217
293
  },
218
294
  fromPartial(object) {
219
- var _a, _b, _c, _d;
295
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
220
296
  const message = createBaseTrustDepositRecord();
221
- message.corporation = (_a = object.corporation) !== null && _a !== void 0 ? _a : "";
222
- message.share = (_b = object.share) !== null && _b !== void 0 ? _b : "";
223
- message.deposit = (_c = object.deposit) !== null && _c !== void 0 ? _c : 0;
224
- message.claimable = (_d = object.claimable) !== null && _d !== void 0 ? _d : 0;
297
+ message.share = (_a = object.share) !== null && _a !== void 0 ? _a : "";
298
+ message.deposit = (_b = object.deposit) !== null && _b !== void 0 ? _b : 0;
299
+ message.corporationId = (_c = object.corporationId) !== null && _c !== void 0 ? _c : 0;
300
+ message.refunded = (_d = object.refunded) !== null && _d !== void 0 ? _d : 0;
301
+ message.slashedDeposit = (_e = object.slashedDeposit) !== null && _e !== void 0 ? _e : 0;
302
+ message.repaidDeposit = (_f = object.repaidDeposit) !== null && _f !== void 0 ? _f : 0;
303
+ message.lastSlashed = (_g = object.lastSlashed) !== null && _g !== void 0 ? _g : undefined;
304
+ message.lastRepaid = (_h = object.lastRepaid) !== null && _h !== void 0 ? _h : undefined;
305
+ message.slashCount = (_j = object.slashCount) !== null && _j !== void 0 ? _j : 0;
225
306
  return message;
226
307
  },
227
308
  };
309
+ function toTimestamp(date) {
310
+ const seconds = Math.trunc(date.getTime() / 1000);
311
+ const nanos = (date.getTime() % 1000) * 1000000;
312
+ return { seconds, nanos };
313
+ }
314
+ function fromTimestamp(t) {
315
+ let millis = (t.seconds || 0) * 1000;
316
+ millis += (t.nanos || 0) / 1000000;
317
+ return new globalThis.Date(millis);
318
+ }
319
+ function fromJsonTimestamp(o) {
320
+ if (o instanceof globalThis.Date) {
321
+ return o;
322
+ }
323
+ else if (typeof o === "string") {
324
+ return new globalThis.Date(o);
325
+ }
326
+ else {
327
+ return fromTimestamp(timestamp_1.Timestamp.fromJSON(o));
328
+ }
329
+ }
228
330
  function longToNumber(long) {
229
331
  if (long.gt(globalThis.Number.MAX_SAFE_INTEGER)) {
230
332
  throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
@@ -12,7 +12,7 @@ export interface QueryParamsResponse {
12
12
  }
13
13
  /** QueryGetTrustDepositRequest is request type for the GetTrustDeposit RPC method */
14
14
  export interface QueryGetTrustDepositRequest {
15
- corporation: string;
15
+ corporationId: number;
16
16
  }
17
17
  /** QueryGetTrustDepositResponse is response type for the GetTrustDeposit RPC method */
18
18
  export interface QueryGetTrustDepositResponse {
@@ -43,6 +43,7 @@ exports.QueryClientImpl = exports.QueryServiceName = exports.QueryGetTrustDeposi
43
43
  const _m0 = __importStar(require("protobufjs/minimal"));
44
44
  const params_1 = require("./params");
45
45
  const types_1 = require("./types");
46
+ const Long = require("long");
46
47
  exports.protobufPackage = "verana.td.v1";
47
48
  function createBaseQueryParamsRequest() {
48
49
  return {};
@@ -134,12 +135,12 @@ exports.QueryParamsResponse = {
134
135
  },
135
136
  };
136
137
  function createBaseQueryGetTrustDepositRequest() {
137
- return { corporation: "" };
138
+ return { corporationId: 0 };
138
139
  }
139
140
  exports.QueryGetTrustDepositRequest = {
140
141
  encode(message, writer = _m0.Writer.create()) {
141
- if (message.corporation !== "") {
142
- writer.uint32(10).string(message.corporation);
142
+ if (message.corporationId !== 0) {
143
+ writer.uint32(16).uint64(message.corporationId);
143
144
  }
144
145
  return writer;
145
146
  },
@@ -150,11 +151,11 @@ exports.QueryGetTrustDepositRequest = {
150
151
  while (reader.pos < end) {
151
152
  const tag = reader.uint32();
152
153
  switch (tag >>> 3) {
153
- case 1:
154
- if (tag !== 10) {
154
+ case 2:
155
+ if (tag !== 16) {
155
156
  break;
156
157
  }
157
- message.corporation = reader.string();
158
+ message.corporationId = longToNumber(reader.uint64());
158
159
  continue;
159
160
  }
160
161
  if ((tag & 7) === 4 || tag === 0) {
@@ -165,12 +166,12 @@ exports.QueryGetTrustDepositRequest = {
165
166
  return message;
166
167
  },
167
168
  fromJSON(object) {
168
- return { corporation: isSet(object.corporation) ? globalThis.String(object.corporation) : "" };
169
+ return { corporationId: isSet(object.corporationId) ? globalThis.Number(object.corporationId) : 0 };
169
170
  },
170
171
  toJSON(message) {
171
172
  const obj = {};
172
- if (message.corporation !== "") {
173
- obj.corporation = message.corporation;
173
+ if (message.corporationId !== 0) {
174
+ obj.corporationId = Math.round(message.corporationId);
174
175
  }
175
176
  return obj;
176
177
  },
@@ -180,7 +181,7 @@ exports.QueryGetTrustDepositRequest = {
180
181
  fromPartial(object) {
181
182
  var _a;
182
183
  const message = createBaseQueryGetTrustDepositRequest();
183
- message.corporation = (_a = object.corporation) !== null && _a !== void 0 ? _a : "";
184
+ message.corporationId = (_a = object.corporationId) !== null && _a !== void 0 ? _a : 0;
184
185
  return message;
185
186
  },
186
187
  };
@@ -256,6 +257,19 @@ class QueryClientImpl {
256
257
  }
257
258
  }
258
259
  exports.QueryClientImpl = QueryClientImpl;
260
+ function longToNumber(long) {
261
+ if (long.gt(globalThis.Number.MAX_SAFE_INTEGER)) {
262
+ throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
263
+ }
264
+ if (long.lt(globalThis.Number.MIN_SAFE_INTEGER)) {
265
+ throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
266
+ }
267
+ return long.toNumber();
268
+ }
269
+ if (_m0.util.Long !== Long) {
270
+ _m0.util.Long = Long;
271
+ _m0.configure();
272
+ }
259
273
  function isSet(value) {
260
274
  return value !== null && value !== undefined;
261
275
  }
@@ -39,8 +39,8 @@ export interface MsgReclaimTrustDepositYieldResponse {
39
39
  export interface MsgSlashTrustDeposit {
40
40
  /** authority is the address that controls the module (defaults to x/gov unless overwritten). */
41
41
  authority: string;
42
- /** corporation is the address of the corporation whose trust deposit will be slashed */
43
- corporation: string;
42
+ /** corporation_id is the registered Corporation id whose trust deposit will be slashed */
43
+ corporationId: number;
44
44
  /** deposit is the deposit amount to slash (in base denom) */
45
45
  deposit: string;
46
46
  /** [MOD-TD-MSG-5-1] reason for the slash (mandatory per spec v4 draft 13) */
@@ -269,15 +269,15 @@ exports.MsgReclaimTrustDepositYieldResponse = {
269
269
  },
270
270
  };
271
271
  function createBaseMsgSlashTrustDeposit() {
272
- return { authority: "", corporation: "", deposit: "", reason: "" };
272
+ return { authority: "", corporationId: 0, deposit: "", reason: "" };
273
273
  }
274
274
  exports.MsgSlashTrustDeposit = {
275
275
  encode(message, writer = _m0.Writer.create()) {
276
276
  if (message.authority !== "") {
277
277
  writer.uint32(10).string(message.authority);
278
278
  }
279
- if (message.corporation !== "") {
280
- writer.uint32(18).string(message.corporation);
279
+ if (message.corporationId !== 0) {
280
+ writer.uint32(40).uint64(message.corporationId);
281
281
  }
282
282
  if (message.deposit !== "") {
283
283
  writer.uint32(26).string(message.deposit);
@@ -300,11 +300,11 @@ exports.MsgSlashTrustDeposit = {
300
300
  }
301
301
  message.authority = reader.string();
302
302
  continue;
303
- case 2:
304
- if (tag !== 18) {
303
+ case 5:
304
+ if (tag !== 40) {
305
305
  break;
306
306
  }
307
- message.corporation = reader.string();
307
+ message.corporationId = longToNumber(reader.uint64());
308
308
  continue;
309
309
  case 3:
310
310
  if (tag !== 26) {
@@ -329,7 +329,7 @@ exports.MsgSlashTrustDeposit = {
329
329
  fromJSON(object) {
330
330
  return {
331
331
  authority: isSet(object.authority) ? globalThis.String(object.authority) : "",
332
- corporation: isSet(object.corporation) ? globalThis.String(object.corporation) : "",
332
+ corporationId: isSet(object.corporationId) ? globalThis.Number(object.corporationId) : 0,
333
333
  deposit: isSet(object.deposit) ? globalThis.String(object.deposit) : "",
334
334
  reason: isSet(object.reason) ? globalThis.String(object.reason) : "",
335
335
  };
@@ -339,8 +339,8 @@ exports.MsgSlashTrustDeposit = {
339
339
  if (message.authority !== "") {
340
340
  obj.authority = message.authority;
341
341
  }
342
- if (message.corporation !== "") {
343
- obj.corporation = message.corporation;
342
+ if (message.corporationId !== 0) {
343
+ obj.corporationId = Math.round(message.corporationId);
344
344
  }
345
345
  if (message.deposit !== "") {
346
346
  obj.deposit = message.deposit;
@@ -357,7 +357,7 @@ exports.MsgSlashTrustDeposit = {
357
357
  var _a, _b, _c, _d;
358
358
  const message = createBaseMsgSlashTrustDeposit();
359
359
  message.authority = (_a = object.authority) !== null && _a !== void 0 ? _a : "";
360
- message.corporation = (_b = object.corporation) !== null && _b !== void 0 ? _b : "";
360
+ message.corporationId = (_b = object.corporationId) !== null && _b !== void 0 ? _b : 0;
361
361
  message.deposit = (_c = object.deposit) !== null && _c !== void 0 ? _c : "";
362
362
  message.reason = (_d = object.reason) !== null && _d !== void 0 ? _d : "";
363
363
  return message;
@@ -2,15 +2,17 @@ import * as _m0 from "protobufjs/minimal";
2
2
  export declare const protobufPackage = "verana.td.v1";
3
3
  /** TrustDeposit represents a corporation's trust deposit */
4
4
  export interface TrustDeposit {
5
- corporation: string;
6
5
  share: string;
7
6
  deposit: number;
8
- claimable: number;
9
7
  slashedDeposit: number;
10
8
  repaidDeposit: number;
11
9
  lastSlashed: Date | undefined;
12
10
  lastRepaid: Date | undefined;
13
11
  slashCount: number;
12
+ /** corporation_id is the registered Corporation id that owns this trust deposit (primary key). */
13
+ corporationId: number;
14
+ /** refunded is the amount eligible to be recycled/reclaimed (was "claimable"). */
15
+ refunded: number;
14
16
  }
15
17
  export interface SlashTrustDepositProposal {
16
18
  title: string;
@@ -46,31 +46,25 @@ const Long = require("long");
46
46
  exports.protobufPackage = "verana.td.v1";
47
47
  function createBaseTrustDeposit() {
48
48
  return {
49
- corporation: "",
50
49
  share: "",
51
50
  deposit: 0,
52
- claimable: 0,
53
51
  slashedDeposit: 0,
54
52
  repaidDeposit: 0,
55
53
  lastSlashed: undefined,
56
54
  lastRepaid: undefined,
57
55
  slashCount: 0,
56
+ corporationId: 0,
57
+ refunded: 0,
58
58
  };
59
59
  }
60
60
  exports.TrustDeposit = {
61
61
  encode(message, writer = _m0.Writer.create()) {
62
- if (message.corporation !== "") {
63
- writer.uint32(10).string(message.corporation);
64
- }
65
62
  if (message.share !== "") {
66
63
  writer.uint32(18).string(message.share);
67
64
  }
68
65
  if (message.deposit !== 0) {
69
66
  writer.uint32(24).uint64(message.deposit);
70
67
  }
71
- if (message.claimable !== 0) {
72
- writer.uint32(32).uint64(message.claimable);
73
- }
74
68
  if (message.slashedDeposit !== 0) {
75
69
  writer.uint32(40).uint64(message.slashedDeposit);
76
70
  }
@@ -86,6 +80,12 @@ exports.TrustDeposit = {
86
80
  if (message.slashCount !== 0) {
87
81
  writer.uint32(72).uint64(message.slashCount);
88
82
  }
83
+ if (message.corporationId !== 0) {
84
+ writer.uint32(80).uint64(message.corporationId);
85
+ }
86
+ if (message.refunded !== 0) {
87
+ writer.uint32(88).uint64(message.refunded);
88
+ }
89
89
  return writer;
90
90
  },
91
91
  decode(input, length) {
@@ -95,12 +95,6 @@ exports.TrustDeposit = {
95
95
  while (reader.pos < end) {
96
96
  const tag = reader.uint32();
97
97
  switch (tag >>> 3) {
98
- case 1:
99
- if (tag !== 10) {
100
- break;
101
- }
102
- message.corporation = reader.string();
103
- continue;
104
98
  case 2:
105
99
  if (tag !== 18) {
106
100
  break;
@@ -113,12 +107,6 @@ exports.TrustDeposit = {
113
107
  }
114
108
  message.deposit = longToNumber(reader.uint64());
115
109
  continue;
116
- case 4:
117
- if (tag !== 32) {
118
- break;
119
- }
120
- message.claimable = longToNumber(reader.uint64());
121
- continue;
122
110
  case 5:
123
111
  if (tag !== 40) {
124
112
  break;
@@ -149,6 +137,18 @@ exports.TrustDeposit = {
149
137
  }
150
138
  message.slashCount = longToNumber(reader.uint64());
151
139
  continue;
140
+ case 10:
141
+ if (tag !== 80) {
142
+ break;
143
+ }
144
+ message.corporationId = longToNumber(reader.uint64());
145
+ continue;
146
+ case 11:
147
+ if (tag !== 88) {
148
+ break;
149
+ }
150
+ message.refunded = longToNumber(reader.uint64());
151
+ continue;
152
152
  }
153
153
  if ((tag & 7) === 4 || tag === 0) {
154
154
  break;
@@ -159,31 +159,25 @@ exports.TrustDeposit = {
159
159
  },
160
160
  fromJSON(object) {
161
161
  return {
162
- corporation: isSet(object.corporation) ? globalThis.String(object.corporation) : "",
163
162
  share: isSet(object.share) ? globalThis.String(object.share) : "",
164
163
  deposit: isSet(object.deposit) ? globalThis.Number(object.deposit) : 0,
165
- claimable: isSet(object.claimable) ? globalThis.Number(object.claimable) : 0,
166
164
  slashedDeposit: isSet(object.slashedDeposit) ? globalThis.Number(object.slashedDeposit) : 0,
167
165
  repaidDeposit: isSet(object.repaidDeposit) ? globalThis.Number(object.repaidDeposit) : 0,
168
166
  lastSlashed: isSet(object.lastSlashed) ? fromJsonTimestamp(object.lastSlashed) : undefined,
169
167
  lastRepaid: isSet(object.lastRepaid) ? fromJsonTimestamp(object.lastRepaid) : undefined,
170
168
  slashCount: isSet(object.slashCount) ? globalThis.Number(object.slashCount) : 0,
169
+ corporationId: isSet(object.corporationId) ? globalThis.Number(object.corporationId) : 0,
170
+ refunded: isSet(object.refunded) ? globalThis.Number(object.refunded) : 0,
171
171
  };
172
172
  },
173
173
  toJSON(message) {
174
174
  const obj = {};
175
- if (message.corporation !== "") {
176
- obj.corporation = message.corporation;
177
- }
178
175
  if (message.share !== "") {
179
176
  obj.share = message.share;
180
177
  }
181
178
  if (message.deposit !== 0) {
182
179
  obj.deposit = Math.round(message.deposit);
183
180
  }
184
- if (message.claimable !== 0) {
185
- obj.claimable = Math.round(message.claimable);
186
- }
187
181
  if (message.slashedDeposit !== 0) {
188
182
  obj.slashedDeposit = Math.round(message.slashedDeposit);
189
183
  }
@@ -199,6 +193,12 @@ exports.TrustDeposit = {
199
193
  if (message.slashCount !== 0) {
200
194
  obj.slashCount = Math.round(message.slashCount);
201
195
  }
196
+ if (message.corporationId !== 0) {
197
+ obj.corporationId = Math.round(message.corporationId);
198
+ }
199
+ if (message.refunded !== 0) {
200
+ obj.refunded = Math.round(message.refunded);
201
+ }
202
202
  return obj;
203
203
  },
204
204
  create(base) {
@@ -207,15 +207,15 @@ exports.TrustDeposit = {
207
207
  fromPartial(object) {
208
208
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
209
209
  const message = createBaseTrustDeposit();
210
- message.corporation = (_a = object.corporation) !== null && _a !== void 0 ? _a : "";
211
- message.share = (_b = object.share) !== null && _b !== void 0 ? _b : "";
212
- message.deposit = (_c = object.deposit) !== null && _c !== void 0 ? _c : 0;
213
- message.claimable = (_d = object.claimable) !== null && _d !== void 0 ? _d : 0;
214
- message.slashedDeposit = (_e = object.slashedDeposit) !== null && _e !== void 0 ? _e : 0;
215
- message.repaidDeposit = (_f = object.repaidDeposit) !== null && _f !== void 0 ? _f : 0;
216
- message.lastSlashed = (_g = object.lastSlashed) !== null && _g !== void 0 ? _g : undefined;
217
- message.lastRepaid = (_h = object.lastRepaid) !== null && _h !== void 0 ? _h : undefined;
218
- message.slashCount = (_j = object.slashCount) !== null && _j !== void 0 ? _j : 0;
210
+ message.share = (_a = object.share) !== null && _a !== void 0 ? _a : "";
211
+ message.deposit = (_b = object.deposit) !== null && _b !== void 0 ? _b : 0;
212
+ message.slashedDeposit = (_c = object.slashedDeposit) !== null && _c !== void 0 ? _c : 0;
213
+ message.repaidDeposit = (_d = object.repaidDeposit) !== null && _d !== void 0 ? _d : 0;
214
+ message.lastSlashed = (_e = object.lastSlashed) !== null && _e !== void 0 ? _e : undefined;
215
+ message.lastRepaid = (_f = object.lastRepaid) !== null && _f !== void 0 ? _f : undefined;
216
+ message.slashCount = (_g = object.slashCount) !== null && _g !== void 0 ? _g : 0;
217
+ message.corporationId = (_h = object.corporationId) !== null && _h !== void 0 ? _h : 0;
218
+ message.refunded = (_j = object.refunded) !== null && _j !== void 0 ? _j : 0;
219
219
  return message;
220
220
  },
221
221
  };
@@ -1,6 +1,6 @@
1
1
  import * as _m0 from "protobufjs/minimal";
2
2
  import { Params } from "./params";
3
- import { ExchangeRate } from "./tx";
3
+ import { ExchangeRate, ExchangeRateAuthorization } from "./tx";
4
4
  export declare const protobufPackage = "verana.xr.v1";
5
5
  /** GenesisState defines the xr module's genesis state. */
6
6
  export interface GenesisState {
@@ -10,6 +10,8 @@ export interface GenesisState {
10
10
  exchangeRates: ExchangeRate[];
11
11
  /** next_exchange_rate_id is the next auto-increment ID for exchange rates. */
12
12
  nextExchangeRateId: number;
13
+ /** exchange_rate_authorizations is the list of all exchange rate authorizations. */
14
+ exchangeRateAuthorizations: ExchangeRateAuthorization[];
13
15
  }
14
16
  export declare const GenesisState: {
15
17
  encode(message: GenesisState, writer?: _m0.Writer): _m0.Writer;
@@ -46,7 +46,7 @@ const tx_1 = require("./tx");
46
46
  const Long = require("long");
47
47
  exports.protobufPackage = "verana.xr.v1";
48
48
  function createBaseGenesisState() {
49
- return { params: undefined, exchangeRates: [], nextExchangeRateId: 0 };
49
+ return { params: undefined, exchangeRates: [], nextExchangeRateId: 0, exchangeRateAuthorizations: [] };
50
50
  }
51
51
  exports.GenesisState = {
52
52
  encode(message, writer = _m0.Writer.create()) {
@@ -59,6 +59,9 @@ exports.GenesisState = {
59
59
  if (message.nextExchangeRateId !== 0) {
60
60
  writer.uint32(24).uint64(message.nextExchangeRateId);
61
61
  }
62
+ for (const v of message.exchangeRateAuthorizations) {
63
+ tx_1.ExchangeRateAuthorization.encode(v, writer.uint32(34).fork()).ldelim();
64
+ }
62
65
  return writer;
63
66
  },
64
67
  decode(input, length) {
@@ -86,6 +89,12 @@ exports.GenesisState = {
86
89
  }
87
90
  message.nextExchangeRateId = longToNumber(reader.uint64());
88
91
  continue;
92
+ case 4:
93
+ if (tag !== 34) {
94
+ break;
95
+ }
96
+ message.exchangeRateAuthorizations.push(tx_1.ExchangeRateAuthorization.decode(reader, reader.uint32()));
97
+ continue;
89
98
  }
90
99
  if ((tag & 7) === 4 || tag === 0) {
91
100
  break;
@@ -101,10 +110,13 @@ exports.GenesisState = {
101
110
  ? object.exchangeRates.map((e) => tx_1.ExchangeRate.fromJSON(e))
102
111
  : [],
103
112
  nextExchangeRateId: isSet(object.nextExchangeRateId) ? globalThis.Number(object.nextExchangeRateId) : 0,
113
+ exchangeRateAuthorizations: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.exchangeRateAuthorizations)
114
+ ? object.exchangeRateAuthorizations.map((e) => tx_1.ExchangeRateAuthorization.fromJSON(e))
115
+ : [],
104
116
  };
105
117
  },
106
118
  toJSON(message) {
107
- var _a;
119
+ var _a, _b;
108
120
  const obj = {};
109
121
  if (message.params !== undefined) {
110
122
  obj.params = params_1.Params.toJSON(message.params);
@@ -115,19 +127,24 @@ exports.GenesisState = {
115
127
  if (message.nextExchangeRateId !== 0) {
116
128
  obj.nextExchangeRateId = Math.round(message.nextExchangeRateId);
117
129
  }
130
+ if ((_b = message.exchangeRateAuthorizations) === null || _b === void 0 ? void 0 : _b.length) {
131
+ obj.exchangeRateAuthorizations = message.exchangeRateAuthorizations.map((e) => tx_1.ExchangeRateAuthorization.toJSON(e));
132
+ }
118
133
  return obj;
119
134
  },
120
135
  create(base) {
121
136
  return exports.GenesisState.fromPartial(base !== null && base !== void 0 ? base : {});
122
137
  },
123
138
  fromPartial(object) {
124
- var _a, _b;
139
+ var _a, _b, _c;
125
140
  const message = createBaseGenesisState();
126
141
  message.params = (object.params !== undefined && object.params !== null)
127
142
  ? params_1.Params.fromPartial(object.params)
128
143
  : undefined;
129
144
  message.exchangeRates = ((_a = object.exchangeRates) === null || _a === void 0 ? void 0 : _a.map((e) => tx_1.ExchangeRate.fromPartial(e))) || [];
130
145
  message.nextExchangeRateId = (_b = object.nextExchangeRateId) !== null && _b !== void 0 ? _b : 0;
146
+ message.exchangeRateAuthorizations =
147
+ ((_c = object.exchangeRateAuthorizations) === null || _c === void 0 ? void 0 : _c.map((e) => tx_1.ExchangeRateAuthorization.fromPartial(e))) || [];
131
148
  return message;
132
149
  },
133
150
  };