@verana-labs/verana-types 0.10.1-dev.16 → 0.10.1-dev.17

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.
@@ -6,7 +6,7 @@ const helpers_1 = require("./util/helpers");
6
6
  exports.MsgGrantOperatorAuthorizationAminoConverter = {
7
7
  aminoType: "verana/x/de/MsgGrantOpAuthorization",
8
8
  toAmino: (m) => {
9
- var _a, _b, _c, _d;
9
+ var _a, _b, _c;
10
10
  return (0, helpers_1.clean)({
11
11
  corporation: m.corporation || undefined,
12
12
  operator: m.operator || undefined,
@@ -18,11 +18,10 @@ exports.MsgGrantOperatorAuthorizationAminoConverter = {
18
18
  with_feegrant: m.withFeegrant || undefined,
19
19
  feegrant_spend_limit: ((_c = m.feegrantSpendLimit) === null || _c === void 0 ? void 0 : _c.length) ? m.feegrantSpendLimit : undefined,
20
20
  feegrant_spend_limit_period: (0, helpers_1.durationToAmino)(m.feegrantSpendLimitPeriod),
21
- fee_spend_limit: ((_d = m.feeSpendLimit) === null || _d === void 0 ? void 0 : _d.length) ? m.feeSpendLimit : undefined,
22
21
  });
23
22
  },
24
23
  fromAmino: (a) => {
25
- var _a, _b, _c, _d, _e, _f, _g, _h;
24
+ var _a, _b, _c, _d, _e, _f, _g;
26
25
  return tx_1.MsgGrantOperatorAuthorization.fromPartial({
27
26
  corporation: (_a = a.corporation) !== null && _a !== void 0 ? _a : "",
28
27
  operator: (_b = a.operator) !== null && _b !== void 0 ? _b : "",
@@ -34,7 +33,6 @@ exports.MsgGrantOperatorAuthorizationAminoConverter = {
34
33
  withFeegrant: (_f = a.with_feegrant) !== null && _f !== void 0 ? _f : false,
35
34
  feegrantSpendLimit: (_g = a.feegrant_spend_limit) !== null && _g !== void 0 ? _g : [],
36
35
  feegrantSpendLimitPeriod: (0, helpers_1.aminoToDuration)(a.feegrant_spend_limit_period),
37
- feeSpendLimit: (_h = a.fee_spend_limit) !== null && _h !== void 0 ? _h : [],
38
36
  });
39
37
  },
40
38
  };
@@ -71,11 +71,6 @@ export interface MsgGrantOperatorAuthorization {
71
71
  * feegrant_spend_limit. Ignored if with_feegrant is false.
72
72
  */
73
73
  feegrantSpendLimitPeriod: Duration | undefined;
74
- /**
75
- * fee_spend_limit is the maximum total amount of fees this authorization
76
- * allows the grantee to spend (stored on the OperatorAuthorization record).
77
- */
78
- feeSpendLimit: Coin[];
79
74
  }
80
75
  /**
81
76
  * MsgGrantOperatorAuthorizationResponse defines the response for
@@ -164,7 +164,6 @@ function createBaseMsgGrantOperatorAuthorization() {
164
164
  withFeegrant: false,
165
165
  feegrantSpendLimit: [],
166
166
  feegrantSpendLimitPeriod: undefined,
167
- feeSpendLimit: [],
168
167
  };
169
168
  }
170
169
  exports.MsgGrantOperatorAuthorization = {
@@ -199,9 +198,6 @@ exports.MsgGrantOperatorAuthorization = {
199
198
  if (message.feegrantSpendLimitPeriod !== undefined) {
200
199
  duration_1.Duration.encode(message.feegrantSpendLimitPeriod, writer.uint32(82).fork()).ldelim();
201
200
  }
202
- for (const v of message.feeSpendLimit) {
203
- coin_1.Coin.encode(v, writer.uint32(90).fork()).ldelim();
204
- }
205
201
  return writer;
206
202
  },
207
203
  decode(input, length) {
@@ -271,12 +267,6 @@ exports.MsgGrantOperatorAuthorization = {
271
267
  }
272
268
  message.feegrantSpendLimitPeriod = duration_1.Duration.decode(reader, reader.uint32());
273
269
  continue;
274
- case 11:
275
- if (tag !== 90) {
276
- break;
277
- }
278
- message.feeSpendLimit.push(coin_1.Coin.decode(reader, reader.uint32()));
279
- continue;
280
270
  }
281
271
  if ((tag & 7) === 4 || tag === 0) {
282
272
  break;
@@ -305,13 +295,10 @@ exports.MsgGrantOperatorAuthorization = {
305
295
  feegrantSpendLimitPeriod: isSet(object.feegrantSpendLimitPeriod)
306
296
  ? duration_1.Duration.fromJSON(object.feegrantSpendLimitPeriod)
307
297
  : undefined,
308
- feeSpendLimit: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.feeSpendLimit)
309
- ? object.feeSpendLimit.map((e) => coin_1.Coin.fromJSON(e))
310
- : [],
311
298
  };
312
299
  },
313
300
  toJSON(message) {
314
- var _a, _b, _c, _d;
301
+ var _a, _b, _c;
315
302
  const obj = {};
316
303
  if (message.corporation !== "") {
317
304
  obj.corporation = message.corporation;
@@ -343,16 +330,13 @@ exports.MsgGrantOperatorAuthorization = {
343
330
  if (message.feegrantSpendLimitPeriod !== undefined) {
344
331
  obj.feegrantSpendLimitPeriod = duration_1.Duration.toJSON(message.feegrantSpendLimitPeriod);
345
332
  }
346
- if ((_d = message.feeSpendLimit) === null || _d === void 0 ? void 0 : _d.length) {
347
- obj.feeSpendLimit = message.feeSpendLimit.map((e) => coin_1.Coin.toJSON(e));
348
- }
349
333
  return obj;
350
334
  },
351
335
  create(base) {
352
336
  return exports.MsgGrantOperatorAuthorization.fromPartial(base !== null && base !== void 0 ? base : {});
353
337
  },
354
338
  fromPartial(object) {
355
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
339
+ var _a, _b, _c, _d, _e, _f, _g, _h;
356
340
  const message = createBaseMsgGrantOperatorAuthorization();
357
341
  message.corporation = (_a = object.corporation) !== null && _a !== void 0 ? _a : "";
358
342
  message.operator = (_b = object.operator) !== null && _b !== void 0 ? _b : "";
@@ -370,7 +354,6 @@ exports.MsgGrantOperatorAuthorization = {
370
354
  (object.feegrantSpendLimitPeriod !== undefined && object.feegrantSpendLimitPeriod !== null)
371
355
  ? duration_1.Duration.fromPartial(object.feegrantSpendLimitPeriod)
372
356
  : undefined;
373
- message.feeSpendLimit = ((_j = object.feeSpendLimit) === null || _j === void 0 ? void 0 : _j.map((e) => coin_1.Coin.fromPartial(e))) || [];
374
357
  return message;
375
358
  },
376
359
  };
@@ -26,25 +26,12 @@ export interface OperatorAuthorization {
26
26
  * spend_limit is set.
27
27
  */
28
28
  remainingSpend: Coin[];
29
- /**
30
- * fee_spend_limit is the maximum total amount of fees that can be paid using
31
- * this authorization.
32
- */
33
- feeSpendLimit: Coin[];
34
- /**
35
- * remaining_fee_spend is the runtime balance for fee_spend_limit. Present iff
36
- * fee_spend_limit is set.
37
- */
38
- remainingFeeSpend: Coin[];
39
29
  /**
40
30
  * expiration is the timestamp after which the authorization is no longer
41
31
  * valid.
42
32
  */
43
33
  expiration: Date | undefined;
44
- /**
45
- * period is the reset period for spend_limit and fee_spend_limit. If set,
46
- * expiration MUST also be set.
47
- */
34
+ /** period is the reset period for spend_limit. If set, expiration MUST also be set. */
48
35
  period: Duration | undefined;
49
36
  }
50
37
  /**
@@ -54,8 +54,6 @@ function createBaseOperatorAuthorization() {
54
54
  msgTypes: [],
55
55
  spendLimit: [],
56
56
  remainingSpend: [],
57
- feeSpendLimit: [],
58
- remainingFeeSpend: [],
59
57
  expiration: undefined,
60
58
  period: undefined,
61
59
  };
@@ -80,12 +78,6 @@ exports.OperatorAuthorization = {
80
78
  for (const v of message.remainingSpend) {
81
79
  coin_1.Coin.encode(v, writer.uint32(50).fork()).ldelim();
82
80
  }
83
- for (const v of message.feeSpendLimit) {
84
- coin_1.Coin.encode(v, writer.uint32(58).fork()).ldelim();
85
- }
86
- for (const v of message.remainingFeeSpend) {
87
- coin_1.Coin.encode(v, writer.uint32(66).fork()).ldelim();
88
- }
89
81
  if (message.expiration !== undefined) {
90
82
  timestamp_1.Timestamp.encode(toTimestamp(message.expiration), writer.uint32(74).fork()).ldelim();
91
83
  }
@@ -137,18 +129,6 @@ exports.OperatorAuthorization = {
137
129
  }
138
130
  message.remainingSpend.push(coin_1.Coin.decode(reader, reader.uint32()));
139
131
  continue;
140
- case 7:
141
- if (tag !== 58) {
142
- break;
143
- }
144
- message.feeSpendLimit.push(coin_1.Coin.decode(reader, reader.uint32()));
145
- continue;
146
- case 8:
147
- if (tag !== 66) {
148
- break;
149
- }
150
- message.remainingFeeSpend.push(coin_1.Coin.decode(reader, reader.uint32()));
151
- continue;
152
132
  case 9:
153
133
  if (tag !== 74) {
154
134
  break;
@@ -181,18 +161,12 @@ exports.OperatorAuthorization = {
181
161
  remainingSpend: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.remainingSpend)
182
162
  ? object.remainingSpend.map((e) => coin_1.Coin.fromJSON(e))
183
163
  : [],
184
- feeSpendLimit: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.feeSpendLimit)
185
- ? object.feeSpendLimit.map((e) => coin_1.Coin.fromJSON(e))
186
- : [],
187
- remainingFeeSpend: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.remainingFeeSpend)
188
- ? object.remainingFeeSpend.map((e) => coin_1.Coin.fromJSON(e))
189
- : [],
190
164
  expiration: isSet(object.expiration) ? fromJsonTimestamp(object.expiration) : undefined,
191
165
  period: isSet(object.period) ? duration_1.Duration.fromJSON(object.period) : undefined,
192
166
  };
193
167
  },
194
168
  toJSON(message) {
195
- var _a, _b, _c, _d, _e;
169
+ var _a, _b, _c;
196
170
  const obj = {};
197
171
  if (message.id !== 0) {
198
172
  obj.id = Math.round(message.id);
@@ -212,12 +186,6 @@ exports.OperatorAuthorization = {
212
186
  if ((_c = message.remainingSpend) === null || _c === void 0 ? void 0 : _c.length) {
213
187
  obj.remainingSpend = message.remainingSpend.map((e) => coin_1.Coin.toJSON(e));
214
188
  }
215
- if ((_d = message.feeSpendLimit) === null || _d === void 0 ? void 0 : _d.length) {
216
- obj.feeSpendLimit = message.feeSpendLimit.map((e) => coin_1.Coin.toJSON(e));
217
- }
218
- if ((_e = message.remainingFeeSpend) === null || _e === void 0 ? void 0 : _e.length) {
219
- obj.remainingFeeSpend = message.remainingFeeSpend.map((e) => coin_1.Coin.toJSON(e));
220
- }
221
189
  if (message.expiration !== undefined) {
222
190
  obj.expiration = message.expiration.toISOString();
223
191
  }
@@ -230,7 +198,7 @@ exports.OperatorAuthorization = {
230
198
  return exports.OperatorAuthorization.fromPartial(base !== null && base !== void 0 ? base : {});
231
199
  },
232
200
  fromPartial(object) {
233
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
201
+ var _a, _b, _c, _d, _e, _f, _g;
234
202
  const message = createBaseOperatorAuthorization();
235
203
  message.id = (_a = object.id) !== null && _a !== void 0 ? _a : 0;
236
204
  message.corporationId = (_b = object.corporationId) !== null && _b !== void 0 ? _b : 0;
@@ -238,9 +206,7 @@ exports.OperatorAuthorization = {
238
206
  message.msgTypes = ((_d = object.msgTypes) === null || _d === void 0 ? void 0 : _d.map((e) => e)) || [];
239
207
  message.spendLimit = ((_e = object.spendLimit) === null || _e === void 0 ? void 0 : _e.map((e) => coin_1.Coin.fromPartial(e))) || [];
240
208
  message.remainingSpend = ((_f = object.remainingSpend) === null || _f === void 0 ? void 0 : _f.map((e) => coin_1.Coin.fromPartial(e))) || [];
241
- message.feeSpendLimit = ((_g = object.feeSpendLimit) === null || _g === void 0 ? void 0 : _g.map((e) => coin_1.Coin.fromPartial(e))) || [];
242
- message.remainingFeeSpend = ((_h = object.remainingFeeSpend) === null || _h === void 0 ? void 0 : _h.map((e) => coin_1.Coin.fromPartial(e))) || [];
243
- message.expiration = (_j = object.expiration) !== null && _j !== void 0 ? _j : undefined;
209
+ message.expiration = (_g = object.expiration) !== null && _g !== void 0 ? _g : undefined;
244
210
  message.period = (object.period !== undefined && object.period !== null)
245
211
  ? duration_1.Duration.fromPartial(object.period)
246
212
  : undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verana-labs/verana-types",
3
- "version": "0.10.1-dev.16",
3
+ "version": "0.10.1-dev.17",
4
4
  "description": "Generated TypeScript protobuf codecs for the Verana blockchain.",
5
5
  "license": "AGPL-3.0-only",
6
6
  "main": "dist/index.js",