@verana-labs/verana-types 0.10.1-dev.13 → 0.10.1-dev.14

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.
@@ -38,11 +38,12 @@ var __importStar = (this && this.__importStar) || (function () {
38
38
  };
39
39
  })();
40
40
  Object.defineProperty(exports, "__esModule", { value: true });
41
- exports.QueryClientImpl = exports.QueryServiceName = exports.QueryListVSOperatorAuthorizationsResponse = exports.QueryListVSOperatorAuthorizationsRequest = exports.QueryListOperatorAuthorizationsResponse = exports.QueryListOperatorAuthorizationsRequest = exports.QueryParamsResponse = exports.QueryParamsRequest = exports.protobufPackage = void 0;
41
+ exports.QueryClientImpl = exports.QueryServiceName = exports.QueryGetVSOperatorAuthorizationResponse = exports.QueryGetVSOperatorAuthorizationRequest = exports.QueryGetOperatorAuthorizationResponse = exports.QueryGetOperatorAuthorizationRequest = exports.QueryListVSOperatorAuthorizationsResponse = exports.QueryListVSOperatorAuthorizationsRequest = exports.QueryListOperatorAuthorizationsResponse = exports.QueryListOperatorAuthorizationsRequest = exports.QueryParamsResponse = exports.QueryParamsRequest = exports.protobufPackage = void 0;
42
42
  /* eslint-disable */
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.de.v1";
47
48
  function createBaseQueryParamsRequest() {
48
49
  return {};
@@ -134,12 +135,12 @@ exports.QueryParamsResponse = {
134
135
  },
135
136
  };
136
137
  function createBaseQueryListOperatorAuthorizationsRequest() {
137
- return { corporation: "", operator: "", responseMaxSize: 0 };
138
+ return { corporationId: 0, operator: "", responseMaxSize: 0 };
138
139
  }
139
140
  exports.QueryListOperatorAuthorizationsRequest = {
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(8).uint64(message.corporationId);
143
144
  }
144
145
  if (message.operator !== "") {
145
146
  writer.uint32(18).string(message.operator);
@@ -157,10 +158,10 @@ exports.QueryListOperatorAuthorizationsRequest = {
157
158
  const tag = reader.uint32();
158
159
  switch (tag >>> 3) {
159
160
  case 1:
160
- if (tag !== 10) {
161
+ if (tag !== 8) {
161
162
  break;
162
163
  }
163
- message.corporation = reader.string();
164
+ message.corporationId = longToNumber(reader.uint64());
164
165
  continue;
165
166
  case 2:
166
167
  if (tag !== 18) {
@@ -184,15 +185,15 @@ exports.QueryListOperatorAuthorizationsRequest = {
184
185
  },
185
186
  fromJSON(object) {
186
187
  return {
187
- corporation: isSet(object.corporation) ? globalThis.String(object.corporation) : "",
188
+ corporationId: isSet(object.corporationId) ? globalThis.Number(object.corporationId) : 0,
188
189
  operator: isSet(object.operator) ? globalThis.String(object.operator) : "",
189
190
  responseMaxSize: isSet(object.responseMaxSize) ? globalThis.Number(object.responseMaxSize) : 0,
190
191
  };
191
192
  },
192
193
  toJSON(message) {
193
194
  const obj = {};
194
- if (message.corporation !== "") {
195
- obj.corporation = message.corporation;
195
+ if (message.corporationId !== 0) {
196
+ obj.corporationId = Math.round(message.corporationId);
196
197
  }
197
198
  if (message.operator !== "") {
198
199
  obj.operator = message.operator;
@@ -208,7 +209,7 @@ exports.QueryListOperatorAuthorizationsRequest = {
208
209
  fromPartial(object) {
209
210
  var _a, _b, _c;
210
211
  const message = createBaseQueryListOperatorAuthorizationsRequest();
211
- message.corporation = (_a = object.corporation) !== null && _a !== void 0 ? _a : "";
212
+ message.corporationId = (_a = object.corporationId) !== null && _a !== void 0 ? _a : 0;
212
213
  message.operator = (_b = object.operator) !== null && _b !== void 0 ? _b : "";
213
214
  message.responseMaxSize = (_c = object.responseMaxSize) !== null && _c !== void 0 ? _c : 0;
214
215
  return message;
@@ -272,12 +273,12 @@ exports.QueryListOperatorAuthorizationsResponse = {
272
273
  },
273
274
  };
274
275
  function createBaseQueryListVSOperatorAuthorizationsRequest() {
275
- return { corporation: "", vsOperator: "", responseMaxSize: 0 };
276
+ return { corporationId: 0, vsOperator: "", responseMaxSize: 0 };
276
277
  }
277
278
  exports.QueryListVSOperatorAuthorizationsRequest = {
278
279
  encode(message, writer = _m0.Writer.create()) {
279
- if (message.corporation !== "") {
280
- writer.uint32(10).string(message.corporation);
280
+ if (message.corporationId !== 0) {
281
+ writer.uint32(8).uint64(message.corporationId);
281
282
  }
282
283
  if (message.vsOperator !== "") {
283
284
  writer.uint32(18).string(message.vsOperator);
@@ -295,10 +296,10 @@ exports.QueryListVSOperatorAuthorizationsRequest = {
295
296
  const tag = reader.uint32();
296
297
  switch (tag >>> 3) {
297
298
  case 1:
298
- if (tag !== 10) {
299
+ if (tag !== 8) {
299
300
  break;
300
301
  }
301
- message.corporation = reader.string();
302
+ message.corporationId = longToNumber(reader.uint64());
302
303
  continue;
303
304
  case 2:
304
305
  if (tag !== 18) {
@@ -322,15 +323,15 @@ exports.QueryListVSOperatorAuthorizationsRequest = {
322
323
  },
323
324
  fromJSON(object) {
324
325
  return {
325
- corporation: isSet(object.corporation) ? globalThis.String(object.corporation) : "",
326
+ corporationId: isSet(object.corporationId) ? globalThis.Number(object.corporationId) : 0,
326
327
  vsOperator: isSet(object.vsOperator) ? globalThis.String(object.vsOperator) : "",
327
328
  responseMaxSize: isSet(object.responseMaxSize) ? globalThis.Number(object.responseMaxSize) : 0,
328
329
  };
329
330
  },
330
331
  toJSON(message) {
331
332
  const obj = {};
332
- if (message.corporation !== "") {
333
- obj.corporation = message.corporation;
333
+ if (message.corporationId !== 0) {
334
+ obj.corporationId = Math.round(message.corporationId);
334
335
  }
335
336
  if (message.vsOperator !== "") {
336
337
  obj.vsOperator = message.vsOperator;
@@ -346,7 +347,7 @@ exports.QueryListVSOperatorAuthorizationsRequest = {
346
347
  fromPartial(object) {
347
348
  var _a, _b, _c;
348
349
  const message = createBaseQueryListVSOperatorAuthorizationsRequest();
349
- message.corporation = (_a = object.corporation) !== null && _a !== void 0 ? _a : "";
350
+ message.corporationId = (_a = object.corporationId) !== null && _a !== void 0 ? _a : 0;
350
351
  message.vsOperator = (_b = object.vsOperator) !== null && _b !== void 0 ? _b : "";
351
352
  message.responseMaxSize = (_c = object.responseMaxSize) !== null && _c !== void 0 ? _c : 0;
352
353
  return message;
@@ -409,6 +410,222 @@ exports.QueryListVSOperatorAuthorizationsResponse = {
409
410
  return message;
410
411
  },
411
412
  };
413
+ function createBaseQueryGetOperatorAuthorizationRequest() {
414
+ return { id: 0 };
415
+ }
416
+ exports.QueryGetOperatorAuthorizationRequest = {
417
+ encode(message, writer = _m0.Writer.create()) {
418
+ if (message.id !== 0) {
419
+ writer.uint32(8).uint64(message.id);
420
+ }
421
+ return writer;
422
+ },
423
+ decode(input, length) {
424
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
425
+ let end = length === undefined ? reader.len : reader.pos + length;
426
+ const message = createBaseQueryGetOperatorAuthorizationRequest();
427
+ while (reader.pos < end) {
428
+ const tag = reader.uint32();
429
+ switch (tag >>> 3) {
430
+ case 1:
431
+ if (tag !== 8) {
432
+ break;
433
+ }
434
+ message.id = longToNumber(reader.uint64());
435
+ continue;
436
+ }
437
+ if ((tag & 7) === 4 || tag === 0) {
438
+ break;
439
+ }
440
+ reader.skipType(tag & 7);
441
+ }
442
+ return message;
443
+ },
444
+ fromJSON(object) {
445
+ return { id: isSet(object.id) ? globalThis.Number(object.id) : 0 };
446
+ },
447
+ toJSON(message) {
448
+ const obj = {};
449
+ if (message.id !== 0) {
450
+ obj.id = Math.round(message.id);
451
+ }
452
+ return obj;
453
+ },
454
+ create(base) {
455
+ return exports.QueryGetOperatorAuthorizationRequest.fromPartial(base !== null && base !== void 0 ? base : {});
456
+ },
457
+ fromPartial(object) {
458
+ var _a;
459
+ const message = createBaseQueryGetOperatorAuthorizationRequest();
460
+ message.id = (_a = object.id) !== null && _a !== void 0 ? _a : 0;
461
+ return message;
462
+ },
463
+ };
464
+ function createBaseQueryGetOperatorAuthorizationResponse() {
465
+ return { operatorAuthorization: undefined };
466
+ }
467
+ exports.QueryGetOperatorAuthorizationResponse = {
468
+ encode(message, writer = _m0.Writer.create()) {
469
+ if (message.operatorAuthorization !== undefined) {
470
+ types_1.OperatorAuthorization.encode(message.operatorAuthorization, writer.uint32(10).fork()).ldelim();
471
+ }
472
+ return writer;
473
+ },
474
+ decode(input, length) {
475
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
476
+ let end = length === undefined ? reader.len : reader.pos + length;
477
+ const message = createBaseQueryGetOperatorAuthorizationResponse();
478
+ while (reader.pos < end) {
479
+ const tag = reader.uint32();
480
+ switch (tag >>> 3) {
481
+ case 1:
482
+ if (tag !== 10) {
483
+ break;
484
+ }
485
+ message.operatorAuthorization = types_1.OperatorAuthorization.decode(reader, reader.uint32());
486
+ continue;
487
+ }
488
+ if ((tag & 7) === 4 || tag === 0) {
489
+ break;
490
+ }
491
+ reader.skipType(tag & 7);
492
+ }
493
+ return message;
494
+ },
495
+ fromJSON(object) {
496
+ return {
497
+ operatorAuthorization: isSet(object.operatorAuthorization)
498
+ ? types_1.OperatorAuthorization.fromJSON(object.operatorAuthorization)
499
+ : undefined,
500
+ };
501
+ },
502
+ toJSON(message) {
503
+ const obj = {};
504
+ if (message.operatorAuthorization !== undefined) {
505
+ obj.operatorAuthorization = types_1.OperatorAuthorization.toJSON(message.operatorAuthorization);
506
+ }
507
+ return obj;
508
+ },
509
+ create(base) {
510
+ return exports.QueryGetOperatorAuthorizationResponse.fromPartial(base !== null && base !== void 0 ? base : {});
511
+ },
512
+ fromPartial(object) {
513
+ const message = createBaseQueryGetOperatorAuthorizationResponse();
514
+ message.operatorAuthorization =
515
+ (object.operatorAuthorization !== undefined && object.operatorAuthorization !== null)
516
+ ? types_1.OperatorAuthorization.fromPartial(object.operatorAuthorization)
517
+ : undefined;
518
+ return message;
519
+ },
520
+ };
521
+ function createBaseQueryGetVSOperatorAuthorizationRequest() {
522
+ return { id: 0 };
523
+ }
524
+ exports.QueryGetVSOperatorAuthorizationRequest = {
525
+ encode(message, writer = _m0.Writer.create()) {
526
+ if (message.id !== 0) {
527
+ writer.uint32(8).uint64(message.id);
528
+ }
529
+ return writer;
530
+ },
531
+ decode(input, length) {
532
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
533
+ let end = length === undefined ? reader.len : reader.pos + length;
534
+ const message = createBaseQueryGetVSOperatorAuthorizationRequest();
535
+ while (reader.pos < end) {
536
+ const tag = reader.uint32();
537
+ switch (tag >>> 3) {
538
+ case 1:
539
+ if (tag !== 8) {
540
+ break;
541
+ }
542
+ message.id = longToNumber(reader.uint64());
543
+ continue;
544
+ }
545
+ if ((tag & 7) === 4 || tag === 0) {
546
+ break;
547
+ }
548
+ reader.skipType(tag & 7);
549
+ }
550
+ return message;
551
+ },
552
+ fromJSON(object) {
553
+ return { id: isSet(object.id) ? globalThis.Number(object.id) : 0 };
554
+ },
555
+ toJSON(message) {
556
+ const obj = {};
557
+ if (message.id !== 0) {
558
+ obj.id = Math.round(message.id);
559
+ }
560
+ return obj;
561
+ },
562
+ create(base) {
563
+ return exports.QueryGetVSOperatorAuthorizationRequest.fromPartial(base !== null && base !== void 0 ? base : {});
564
+ },
565
+ fromPartial(object) {
566
+ var _a;
567
+ const message = createBaseQueryGetVSOperatorAuthorizationRequest();
568
+ message.id = (_a = object.id) !== null && _a !== void 0 ? _a : 0;
569
+ return message;
570
+ },
571
+ };
572
+ function createBaseQueryGetVSOperatorAuthorizationResponse() {
573
+ return { vsOperatorAuthorization: undefined };
574
+ }
575
+ exports.QueryGetVSOperatorAuthorizationResponse = {
576
+ encode(message, writer = _m0.Writer.create()) {
577
+ if (message.vsOperatorAuthorization !== undefined) {
578
+ types_1.VSOperatorAuthorization.encode(message.vsOperatorAuthorization, writer.uint32(10).fork()).ldelim();
579
+ }
580
+ return writer;
581
+ },
582
+ decode(input, length) {
583
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
584
+ let end = length === undefined ? reader.len : reader.pos + length;
585
+ const message = createBaseQueryGetVSOperatorAuthorizationResponse();
586
+ while (reader.pos < end) {
587
+ const tag = reader.uint32();
588
+ switch (tag >>> 3) {
589
+ case 1:
590
+ if (tag !== 10) {
591
+ break;
592
+ }
593
+ message.vsOperatorAuthorization = types_1.VSOperatorAuthorization.decode(reader, reader.uint32());
594
+ continue;
595
+ }
596
+ if ((tag & 7) === 4 || tag === 0) {
597
+ break;
598
+ }
599
+ reader.skipType(tag & 7);
600
+ }
601
+ return message;
602
+ },
603
+ fromJSON(object) {
604
+ return {
605
+ vsOperatorAuthorization: isSet(object.vsOperatorAuthorization)
606
+ ? types_1.VSOperatorAuthorization.fromJSON(object.vsOperatorAuthorization)
607
+ : undefined,
608
+ };
609
+ },
610
+ toJSON(message) {
611
+ const obj = {};
612
+ if (message.vsOperatorAuthorization !== undefined) {
613
+ obj.vsOperatorAuthorization = types_1.VSOperatorAuthorization.toJSON(message.vsOperatorAuthorization);
614
+ }
615
+ return obj;
616
+ },
617
+ create(base) {
618
+ return exports.QueryGetVSOperatorAuthorizationResponse.fromPartial(base !== null && base !== void 0 ? base : {});
619
+ },
620
+ fromPartial(object) {
621
+ const message = createBaseQueryGetVSOperatorAuthorizationResponse();
622
+ message.vsOperatorAuthorization =
623
+ (object.vsOperatorAuthorization !== undefined && object.vsOperatorAuthorization !== null)
624
+ ? types_1.VSOperatorAuthorization.fromPartial(object.vsOperatorAuthorization)
625
+ : undefined;
626
+ return message;
627
+ },
628
+ };
412
629
  exports.QueryServiceName = "verana.de.v1.Query";
413
630
  class QueryClientImpl {
414
631
  constructor(rpc, opts) {
@@ -417,6 +634,8 @@ class QueryClientImpl {
417
634
  this.Params = this.Params.bind(this);
418
635
  this.ListOperatorAuthorizations = this.ListOperatorAuthorizations.bind(this);
419
636
  this.ListVSOperatorAuthorizations = this.ListVSOperatorAuthorizations.bind(this);
637
+ this.GetOperatorAuthorization = this.GetOperatorAuthorization.bind(this);
638
+ this.GetVSOperatorAuthorization = this.GetVSOperatorAuthorization.bind(this);
420
639
  }
421
640
  Params(request) {
422
641
  const data = exports.QueryParamsRequest.encode(request).finish();
@@ -433,8 +652,31 @@ class QueryClientImpl {
433
652
  const promise = this.rpc.request(this.service, "ListVSOperatorAuthorizations", data);
434
653
  return promise.then((data) => exports.QueryListVSOperatorAuthorizationsResponse.decode(_m0.Reader.create(data)));
435
654
  }
655
+ GetOperatorAuthorization(request) {
656
+ const data = exports.QueryGetOperatorAuthorizationRequest.encode(request).finish();
657
+ const promise = this.rpc.request(this.service, "GetOperatorAuthorization", data);
658
+ return promise.then((data) => exports.QueryGetOperatorAuthorizationResponse.decode(_m0.Reader.create(data)));
659
+ }
660
+ GetVSOperatorAuthorization(request) {
661
+ const data = exports.QueryGetVSOperatorAuthorizationRequest.encode(request).finish();
662
+ const promise = this.rpc.request(this.service, "GetVSOperatorAuthorization", data);
663
+ return promise.then((data) => exports.QueryGetVSOperatorAuthorizationResponse.decode(_m0.Reader.create(data)));
664
+ }
436
665
  }
437
666
  exports.QueryClientImpl = QueryClientImpl;
667
+ function longToNumber(long) {
668
+ if (long.gt(globalThis.Number.MAX_SAFE_INTEGER)) {
669
+ throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
670
+ }
671
+ if (long.lt(globalThis.Number.MIN_SAFE_INTEGER)) {
672
+ throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
673
+ }
674
+ return long.toNumber();
675
+ }
676
+ if (_m0.util.Long !== Long) {
677
+ _m0.util.Long = Long;
678
+ _m0.configure();
679
+ }
438
680
  function isSet(value) {
439
681
  return value !== null && value !== undefined;
440
682
  }
@@ -2,64 +2,85 @@ import * as _m0 from "protobufjs/minimal";
2
2
  import { Coin } from "../../../cosmos/base/v1beta1/coin";
3
3
  import { Duration } from "../../../google/protobuf/duration";
4
4
  export declare const protobufPackage = "verana.de.v1";
5
+ /**
6
+ * OperatorAuthorization is the operator-delegation record. Per spec v4-rc2 it is
7
+ * keyed by its own uint64 id; (corporation_id, operator) is a unique secondary
8
+ * index.
9
+ */
5
10
  export interface OperatorAuthorization {
6
- /** corporation is the group granting the authorization. */
7
- corporation: string;
11
+ /** id is the own uint64 key of this OperatorAuthorization. */
12
+ id: number;
13
+ /**
14
+ * corporation_id is the id of the corporation granting the authorization. The
15
+ * (corporation_id, operator) tuple MUST be unique.
16
+ */
17
+ corporationId: number;
8
18
  /** operator is the account receiving the authorization. */
9
19
  operator: string;
10
20
  /** msg_types is the list of module message types this authorization applies to. */
11
21
  msgTypes: string[];
22
+ /** spend_limit is the maximum amount of funds the grantee is allowed to spend. */
23
+ spendLimit: Coin[];
12
24
  /**
13
- * spend_limit is the maximum amount of funds that the grantee is allowed to
14
- * spend as a direct consequence of executing authorized messages.
25
+ * remaining_spend is the runtime balance for spend_limit. Present iff
26
+ * spend_limit is set.
15
27
  */
16
- spendLimit: Coin[];
28
+ remainingSpend: Coin[];
17
29
  /**
18
30
  * fee_spend_limit is the maximum total amount of fees that can be paid using
19
31
  * this authorization.
20
32
  */
21
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[];
22
39
  /**
23
40
  * expiration is the timestamp after which the authorization is no longer
24
41
  * valid.
25
42
  */
26
43
  expiration: Date | undefined;
27
- /** period is the reset period for spend_limit and fee_spend_limit. */
44
+ /**
45
+ * period is the reset period for spend_limit and fee_spend_limit. If set,
46
+ * expiration MUST also be set.
47
+ */
28
48
  period: Duration | undefined;
29
49
  }
30
50
  /**
31
- * OperatorAuthorizationUsage tracks per-authorization spend consumption so
32
- * spec [AUTHZ-CHECK-1] can enforce the spend_limit / period-reset invariant:
33
- *
34
- * "If oauthz.spend_limit is set, the remaining balance MUST be sufficient
35
- * for the operation. After successful execution, the consumed amount MUST
36
- * be deducted from the remaining balance. If oauthz.period is set and the
37
- * current period has elapsed since the last reset, the remaining balance
38
- * MUST be reset to oauthz.spend_limit before evaluating the check above."
51
+ * OperatorAuthorizationUsage tracks per-authorization spend consumption so spec
52
+ * [AUTHZ-CHECK-1] can enforce the spend_limit / period-reset invariant. Keyed by
53
+ * the parent OperatorAuthorization id.
39
54
  *
40
- * Stored in the DE module keyed by (corporation, operator) just like the
41
- * parent OperatorAuthorization record.
55
+ * TODO(spec v4): the spec folds the runtime balance into OperatorAuthorization
56
+ * (remaining_spend / remaining_fee_spend). This separate ledger is retained to
57
+ * keep AUTHZ-CHECK-1 reset semantics unchanged (out of scope for the v4-rc2 VSOA
58
+ * rebase); unify when AUTHZ-CHECK-1 is aligned to the spec.
42
59
  */
43
60
  export interface OperatorAuthorizationUsage {
44
- /** corporation is the group that granted the authorization. */
45
- corporation: string;
46
- /** operator is the account holding the authorization. */
47
- operator: string;
61
+ /** operator_authorization_id is the id of the parent OperatorAuthorization. */
62
+ operatorAuthorizationId: number;
48
63
  /**
49
64
  * remaining is the balance still available inside the current period.
50
65
  * Decremented on each successful execution that consumed funds.
51
66
  */
52
67
  remaining: Coin[];
53
68
  /**
54
- * last_reset is the timestamp at which `remaining` was last refilled to
55
- * the parent authorization's spend_limit. Zero when no period has elapsed
56
- * since grant time.
69
+ * last_reset is the timestamp at which `remaining` was last refilled to the
70
+ * parent authorization's spend_limit.
57
71
  */
58
72
  lastReset: Date | undefined;
59
73
  }
74
+ /**
75
+ * FeeGrant is the chain-level fee allowance, keyed by the composite
76
+ * (grantor_corporation_id, grantee).
77
+ */
60
78
  export interface FeeGrant {
61
- /** grantor is the authority group granting the fee allowance. */
62
- grantor: string;
79
+ /**
80
+ * grantor_corporation_id is the id of the corporation granting the fee
81
+ * allowance. Together with grantee it forms the composite key.
82
+ */
83
+ grantorCorporationId: number;
63
84
  /** grantee is the account that receives the fee grant from grantor. */
64
85
  grantee: string;
65
86
  /**
@@ -67,26 +88,87 @@ export interface FeeGrant {
67
88
  * allowance applies.
68
89
  */
69
90
  msgTypes: string[];
91
+ /** spend_limit is the maximum amount of fees that can be spent using this grant. */
92
+ spendLimit: Coin[];
70
93
  /**
71
- * spend_limit is the maximum amount of fees that can be spent using this
72
- * grant.
94
+ * remaining_spend is the runtime balance for spend_limit. Present iff
95
+ * spend_limit is set.
73
96
  */
74
- spendLimit: Coin[];
97
+ remainingSpend: Coin[];
75
98
  /** expiration is the timestamp after which the fee grant is no longer valid. */
76
99
  expiration: Date | undefined;
77
- /** period is the reset period for spend_limit. */
100
+ /**
101
+ * period is the reset period for spend_limit. If set, expiration MUST also be
102
+ * set.
103
+ */
78
104
  period: Duration | undefined;
79
105
  }
106
+ /**
107
+ * ParticipantAuthorizationRecord is a per-participant VS-operator authorization
108
+ * nested inside a VSOperatorAuthorization. Keyed by participant_id, which is
109
+ * globally unique across all records of all VSOperatorAuthorizations.
110
+ */
111
+ export interface ParticipantAuthorizationRecord {
112
+ /**
113
+ * participant_id is the id of the Participant this record applies to. Globally
114
+ * unique across all ParticipantAuthorizationRecord entries.
115
+ */
116
+ participantId: number;
117
+ /**
118
+ * msg_types is the list of delegable message types the vs_operator is
119
+ * authorized for on behalf of corporation. Mandatory, frozen at create.
120
+ */
121
+ msgTypes: string[];
122
+ /** spend_limit is the maximum amount the vs_operator is allowed to spend. */
123
+ spendLimit: Coin[];
124
+ /**
125
+ * remaining_spend is the runtime balance for spend_limit. Present iff
126
+ * spend_limit is set.
127
+ */
128
+ remainingSpend: Coin[];
129
+ /**
130
+ * fee_spend_limit is the maximum total amount of transaction fees that can be
131
+ * spent by vs_operator.
132
+ */
133
+ feeSpendLimit: Coin[];
134
+ /**
135
+ * remaining_fee_spend is the runtime balance for fee_spend_limit. Present iff
136
+ * fee_spend_limit is set.
137
+ */
138
+ remainingFeeSpend: Coin[];
139
+ /**
140
+ * with_feegrant indicates the corporation pays the transaction fees for
141
+ * vs_operator.
142
+ */
143
+ withFeegrant: boolean;
144
+ /**
145
+ * expiration is the authorization window boundary. A record created before
146
+ * validation is disabled with expiration = now().
147
+ */
148
+ expiration: Date | undefined;
149
+ /** period is the reset period for spend_limit and fee_spend_limit. */
150
+ period: Duration | undefined;
151
+ }
152
+ /**
153
+ * VSOperatorAuthorization is the VS-operator delegation, keyed by its own uint64
154
+ * id; (corporation_id, vs_operator) is a unique secondary index. The entry
155
+ * exists iff it has at least one record.
156
+ */
80
157
  export interface VSOperatorAuthorization {
81
- /** corporation is the group granting the authorization. */
82
- corporation: string;
158
+ /** id is the own uint64 key of this VSOperatorAuthorization. */
159
+ id: number;
160
+ /**
161
+ * corporation_id is the id of the corporation granting the authorization. The
162
+ * (corporation_id, vs_operator) tuple MUST be unique.
163
+ */
164
+ corporationId: number;
83
165
  /** vs_operator is the operator account receiving the authorization. */
84
166
  vsOperator: string;
85
167
  /**
86
- * permissions is the list of permission ids for which this authorization is
87
- * granted.
168
+ * records is the list of per-participant authorization records granted to
169
+ * vs_operator by corporation_id.
88
170
  */
89
- permissions: number[];
171
+ records: ParticipantAuthorizationRecord[];
90
172
  }
91
173
  export declare const OperatorAuthorization: {
92
174
  encode(message: OperatorAuthorization, writer?: _m0.Writer): _m0.Writer;
@@ -112,6 +194,14 @@ export declare const FeeGrant: {
112
194
  create<I extends Exact<DeepPartial<FeeGrant>, I>>(base?: I): FeeGrant;
113
195
  fromPartial<I extends Exact<DeepPartial<FeeGrant>, I>>(object: I): FeeGrant;
114
196
  };
197
+ export declare const ParticipantAuthorizationRecord: {
198
+ encode(message: ParticipantAuthorizationRecord, writer?: _m0.Writer): _m0.Writer;
199
+ decode(input: _m0.Reader | Uint8Array, length?: number): ParticipantAuthorizationRecord;
200
+ fromJSON(object: any): ParticipantAuthorizationRecord;
201
+ toJSON(message: ParticipantAuthorizationRecord): unknown;
202
+ create<I extends Exact<DeepPartial<ParticipantAuthorizationRecord>, I>>(base?: I): ParticipantAuthorizationRecord;
203
+ fromPartial<I extends Exact<DeepPartial<ParticipantAuthorizationRecord>, I>>(object: I): ParticipantAuthorizationRecord;
204
+ };
115
205
  export declare const VSOperatorAuthorization: {
116
206
  encode(message: VSOperatorAuthorization, writer?: _m0.Writer): _m0.Writer;
117
207
  decode(input: _m0.Reader | Uint8Array, length?: number): VSOperatorAuthorization;