@verana-labs/verana-types 0.10.0 → 0.10.1-dev.11

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 (89) hide show
  1. package/README.md +1 -1
  2. package/dist/amino-converter/cs.d.ts +7 -0
  3. package/dist/amino-converter/cs.js +169 -0
  4. package/dist/amino-converter/de.d.ts +3 -0
  5. package/dist/amino-converter/de.js +53 -0
  6. package/dist/amino-converter/di.d.ts +2 -0
  7. package/dist/amino-converter/di.js +23 -0
  8. package/dist/amino-converter/perm.d.ts +12 -0
  9. package/dist/amino-converter/perm.js +313 -0
  10. package/dist/amino-converter/td.d.ts +4 -0
  11. package/dist/amino-converter/td.js +45 -0
  12. package/dist/amino-converter/tr.d.ts +6 -0
  13. package/dist/amino-converter/tr.js +107 -0
  14. package/dist/amino-converter/util/helpers.d.ts +30 -0
  15. package/dist/amino-converter/util/helpers.js +88 -0
  16. package/dist/amino-converter/xr.d.ts +4 -0
  17. package/dist/amino-converter/xr.js +74 -0
  18. package/dist/codec/cosmos/base/v1beta1/coin.d.ts +1 -1
  19. package/dist/codec/google/protobuf/descriptor.d.ts +5 -0
  20. package/dist/codec/google/protobuf/descriptor.js +16 -2
  21. package/dist/codec/google/protobuf/timestamp.d.ts +3 -3
  22. package/dist/codec/verana/cs/v1/query.d.ts +4 -3
  23. package/dist/codec/verana/cs/v1/query.js +36 -19
  24. package/dist/codec/verana/cs/v1/tx.d.ts +106 -11
  25. package/dist/codec/verana/cs/v1/tx.js +529 -45
  26. package/dist/codec/verana/cs/v1/types.d.ts +69 -14
  27. package/dist/codec/verana/cs/v1/types.js +392 -55
  28. package/dist/codec/verana/de/v1/genesis.d.ts +9 -0
  29. package/dist/codec/verana/de/v1/genesis.js +80 -2
  30. package/dist/codec/verana/de/v1/query.d.ts +41 -3
  31. package/dist/codec/verana/de/v1/query.js +153 -9
  32. package/dist/codec/verana/de/v1/tx.d.ts +27 -10
  33. package/dist/codec/verana/de/v1/tx.js +35 -18
  34. package/dist/codec/verana/de/v1/types.d.ts +42 -4
  35. package/dist/codec/verana/de/v1/types.js +113 -17
  36. package/dist/codec/verana/{dd/module → di/module/v1}/module.d.ts +5 -2
  37. package/dist/codec/verana/{dd/module → di/module/v1}/module.js +2 -2
  38. package/dist/codec/verana/{dd → di}/v1/genesis.d.ts +5 -4
  39. package/dist/codec/verana/{dd → di}/v1/genesis.js +11 -13
  40. package/dist/codec/verana/di/v1/params.d.ts +24 -0
  41. package/dist/codec/verana/di/v1/params.js +81 -0
  42. package/dist/codec/verana/di/v1/query.d.ts +99 -0
  43. package/dist/codec/verana/{dd → di}/v1/query.js +65 -166
  44. package/dist/codec/verana/di/v1/tx.d.ts +120 -0
  45. package/dist/codec/verana/di/v1/tx.js +409 -0
  46. package/dist/codec/verana/perm/v1/query.d.ts +0 -1
  47. package/dist/codec/verana/perm/v1/query.js +3 -17
  48. package/dist/codec/verana/perm/v1/tx.d.ts +105 -59
  49. package/dist/codec/verana/perm/v1/tx.js +631 -272
  50. package/dist/codec/verana/perm/v1/types.d.ts +30 -30
  51. package/dist/codec/verana/perm/v1/types.js +241 -208
  52. package/dist/codec/verana/td/v1/genesis.d.ts +4 -2
  53. package/dist/codec/verana/td/v1/genesis.js +31 -17
  54. package/dist/codec/verana/td/v1/params.d.ts +2 -0
  55. package/dist/codec/verana/td/v1/params.js +18 -1
  56. package/dist/codec/verana/td/v1/query.d.ts +1 -1
  57. package/dist/codec/verana/td/v1/query.js +8 -8
  58. package/dist/codec/verana/td/v1/tx.d.ts +26 -40
  59. package/dist/codec/verana/td/v1/tx.js +78 -188
  60. package/dist/codec/verana/td/v1/types.d.ts +5 -7
  61. package/dist/codec/verana/td/v1/types.js +32 -47
  62. package/dist/codec/verana/tr/v1/query.d.ts +1 -2
  63. package/dist/codec/verana/tr/v1/query.js +8 -8
  64. package/dist/codec/verana/tr/v1/tx.d.ts +32 -32
  65. package/dist/codec/verana/tr/v1/tx.js +89 -89
  66. package/dist/codec/verana/tr/v1/types.d.ts +2 -5
  67. package/dist/codec/verana/tr/v1/types.js +25 -55
  68. package/dist/codec/verana/xr/module/v1/module.d.ts +29 -0
  69. package/dist/codec/verana/xr/module/v1/module.js +98 -0
  70. package/dist/codec/verana/xr/v1/genesis.d.ts +32 -0
  71. package/dist/codec/verana/xr/v1/genesis.js +149 -0
  72. package/dist/codec/verana/{dd → xr}/v1/params.d.ts +4 -3
  73. package/dist/codec/verana/{dd → xr}/v1/params.js +16 -44
  74. package/dist/codec/verana/xr/v1/query.d.ts +162 -0
  75. package/dist/codec/verana/xr/v1/query.js +775 -0
  76. package/dist/codec/verana/xr/v1/tx.d.ts +195 -0
  77. package/dist/codec/verana/xr/v1/tx.js +939 -0
  78. package/dist/helpers/aminoConverters.d.ts +8 -32
  79. package/dist/helpers/aminoConverters.js +21 -589
  80. package/dist/index.d.ts +9 -1
  81. package/dist/index.js +9 -1
  82. package/dist/signing.d.ts +65 -0
  83. package/dist/signing.js +121 -0
  84. package/package.json +31 -5
  85. package/dist/codec/verana/dd/v1/query.d.ts +0 -108
  86. package/dist/codec/verana/dd/v1/tx.d.ts +0 -173
  87. package/dist/codec/verana/dd/v1/tx.js +0 -636
  88. package/dist/codec/verana/dd/v1/types.d.ts +0 -30
  89. package/dist/codec/verana/dd/v1/types.js +0 -206
@@ -3,8 +3,8 @@ 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
5
  export interface OperatorAuthorization {
6
- /** authority is the group granting the authorization. */
7
- authority: string;
6
+ /** corporation is the group granting the authorization. */
7
+ corporation: string;
8
8
  /** operator is the account receiving the authorization. */
9
9
  operator: string;
10
10
  /** msg_types is the list of module message types this authorization applies to. */
@@ -27,6 +27,36 @@ export interface OperatorAuthorization {
27
27
  /** period is the reset period for spend_limit and fee_spend_limit. */
28
28
  period: Duration | undefined;
29
29
  }
30
+ /**
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."
39
+ *
40
+ * Stored in the DE module keyed by (corporation, operator) just like the
41
+ * parent OperatorAuthorization record.
42
+ */
43
+ 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;
48
+ /**
49
+ * remaining is the balance still available inside the current period.
50
+ * Decremented on each successful execution that consumed funds.
51
+ */
52
+ remaining: Coin[];
53
+ /**
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.
57
+ */
58
+ lastReset: Date | undefined;
59
+ }
30
60
  export interface FeeGrant {
31
61
  /** grantor is the authority group granting the fee allowance. */
32
62
  grantor: string;
@@ -48,8 +78,8 @@ export interface FeeGrant {
48
78
  period: Duration | undefined;
49
79
  }
50
80
  export interface VSOperatorAuthorization {
51
- /** authority is the group granting the authorization. */
52
- authority: string;
81
+ /** corporation is the group granting the authorization. */
82
+ corporation: string;
53
83
  /** vs_operator is the operator account receiving the authorization. */
54
84
  vsOperator: string;
55
85
  /**
@@ -66,6 +96,14 @@ export declare const OperatorAuthorization: {
66
96
  create<I extends Exact<DeepPartial<OperatorAuthorization>, I>>(base?: I): OperatorAuthorization;
67
97
  fromPartial<I extends Exact<DeepPartial<OperatorAuthorization>, I>>(object: I): OperatorAuthorization;
68
98
  };
99
+ export declare const OperatorAuthorizationUsage: {
100
+ encode(message: OperatorAuthorizationUsage, writer?: _m0.Writer): _m0.Writer;
101
+ decode(input: _m0.Reader | Uint8Array, length?: number): OperatorAuthorizationUsage;
102
+ fromJSON(object: any): OperatorAuthorizationUsage;
103
+ toJSON(message: OperatorAuthorizationUsage): unknown;
104
+ create<I extends Exact<DeepPartial<OperatorAuthorizationUsage>, I>>(base?: I): OperatorAuthorizationUsage;
105
+ fromPartial<I extends Exact<DeepPartial<OperatorAuthorizationUsage>, I>>(object: I): OperatorAuthorizationUsage;
106
+ };
69
107
  export declare const FeeGrant: {
70
108
  encode(message: FeeGrant, writer?: _m0.Writer): _m0.Writer;
71
109
  decode(input: _m0.Reader | Uint8Array, length?: number): FeeGrant;
@@ -38,7 +38,7 @@ var __importStar = (this && this.__importStar) || (function () {
38
38
  };
39
39
  })();
40
40
  Object.defineProperty(exports, "__esModule", { value: true });
41
- exports.VSOperatorAuthorization = exports.FeeGrant = exports.OperatorAuthorization = exports.protobufPackage = void 0;
41
+ exports.VSOperatorAuthorization = exports.FeeGrant = exports.OperatorAuthorizationUsage = exports.OperatorAuthorization = exports.protobufPackage = void 0;
42
42
  /* eslint-disable */
43
43
  const _m0 = __importStar(require("protobufjs/minimal"));
44
44
  const coin_1 = require("../../../cosmos/base/v1beta1/coin");
@@ -48,7 +48,7 @@ const Long = require("long");
48
48
  exports.protobufPackage = "verana.de.v1";
49
49
  function createBaseOperatorAuthorization() {
50
50
  return {
51
- authority: "",
51
+ corporation: "",
52
52
  operator: "",
53
53
  msgTypes: [],
54
54
  spendLimit: [],
@@ -59,8 +59,8 @@ function createBaseOperatorAuthorization() {
59
59
  }
60
60
  exports.OperatorAuthorization = {
61
61
  encode(message, writer = _m0.Writer.create()) {
62
- if (message.authority !== "") {
63
- writer.uint32(10).string(message.authority);
62
+ if (message.corporation !== "") {
63
+ writer.uint32(10).string(message.corporation);
64
64
  }
65
65
  if (message.operator !== "") {
66
66
  writer.uint32(18).string(message.operator);
@@ -93,7 +93,7 @@ exports.OperatorAuthorization = {
93
93
  if (tag !== 10) {
94
94
  break;
95
95
  }
96
- message.authority = reader.string();
96
+ message.corporation = reader.string();
97
97
  continue;
98
98
  case 2:
99
99
  if (tag !== 18) {
@@ -141,7 +141,7 @@ exports.OperatorAuthorization = {
141
141
  },
142
142
  fromJSON(object) {
143
143
  return {
144
- authority: isSet(object.authority) ? globalThis.String(object.authority) : "",
144
+ corporation: isSet(object.corporation) ? globalThis.String(object.corporation) : "",
145
145
  operator: isSet(object.operator) ? globalThis.String(object.operator) : "",
146
146
  msgTypes: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.msgTypes) ? object.msgTypes.map((e) => globalThis.String(e)) : [],
147
147
  spendLimit: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.spendLimit)
@@ -157,8 +157,8 @@ exports.OperatorAuthorization = {
157
157
  toJSON(message) {
158
158
  var _a, _b, _c;
159
159
  const obj = {};
160
- if (message.authority !== "") {
161
- obj.authority = message.authority;
160
+ if (message.corporation !== "") {
161
+ obj.corporation = message.corporation;
162
162
  }
163
163
  if (message.operator !== "") {
164
164
  obj.operator = message.operator;
@@ -186,7 +186,7 @@ exports.OperatorAuthorization = {
186
186
  fromPartial(object) {
187
187
  var _a, _b, _c, _d, _e, _f;
188
188
  const message = createBaseOperatorAuthorization();
189
- message.authority = (_a = object.authority) !== null && _a !== void 0 ? _a : "";
189
+ message.corporation = (_a = object.corporation) !== null && _a !== void 0 ? _a : "";
190
190
  message.operator = (_b = object.operator) !== null && _b !== void 0 ? _b : "";
191
191
  message.msgTypes = ((_c = object.msgTypes) === null || _c === void 0 ? void 0 : _c.map((e) => e)) || [];
192
192
  message.spendLimit = ((_d = object.spendLimit) === null || _d === void 0 ? void 0 : _d.map((e) => coin_1.Coin.fromPartial(e))) || [];
@@ -198,6 +198,102 @@ exports.OperatorAuthorization = {
198
198
  return message;
199
199
  },
200
200
  };
201
+ function createBaseOperatorAuthorizationUsage() {
202
+ return { corporation: "", operator: "", remaining: [], lastReset: undefined };
203
+ }
204
+ exports.OperatorAuthorizationUsage = {
205
+ encode(message, writer = _m0.Writer.create()) {
206
+ if (message.corporation !== "") {
207
+ writer.uint32(10).string(message.corporation);
208
+ }
209
+ if (message.operator !== "") {
210
+ writer.uint32(18).string(message.operator);
211
+ }
212
+ for (const v of message.remaining) {
213
+ coin_1.Coin.encode(v, writer.uint32(26).fork()).ldelim();
214
+ }
215
+ if (message.lastReset !== undefined) {
216
+ timestamp_1.Timestamp.encode(toTimestamp(message.lastReset), writer.uint32(34).fork()).ldelim();
217
+ }
218
+ return writer;
219
+ },
220
+ decode(input, length) {
221
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
222
+ let end = length === undefined ? reader.len : reader.pos + length;
223
+ const message = createBaseOperatorAuthorizationUsage();
224
+ while (reader.pos < end) {
225
+ const tag = reader.uint32();
226
+ switch (tag >>> 3) {
227
+ case 1:
228
+ if (tag !== 10) {
229
+ break;
230
+ }
231
+ message.corporation = reader.string();
232
+ continue;
233
+ case 2:
234
+ if (tag !== 18) {
235
+ break;
236
+ }
237
+ message.operator = reader.string();
238
+ continue;
239
+ case 3:
240
+ if (tag !== 26) {
241
+ break;
242
+ }
243
+ message.remaining.push(coin_1.Coin.decode(reader, reader.uint32()));
244
+ continue;
245
+ case 4:
246
+ if (tag !== 34) {
247
+ break;
248
+ }
249
+ message.lastReset = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
250
+ continue;
251
+ }
252
+ if ((tag & 7) === 4 || tag === 0) {
253
+ break;
254
+ }
255
+ reader.skipType(tag & 7);
256
+ }
257
+ return message;
258
+ },
259
+ fromJSON(object) {
260
+ return {
261
+ corporation: isSet(object.corporation) ? globalThis.String(object.corporation) : "",
262
+ operator: isSet(object.operator) ? globalThis.String(object.operator) : "",
263
+ remaining: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.remaining) ? object.remaining.map((e) => coin_1.Coin.fromJSON(e)) : [],
264
+ lastReset: isSet(object.lastReset) ? fromJsonTimestamp(object.lastReset) : undefined,
265
+ };
266
+ },
267
+ toJSON(message) {
268
+ var _a;
269
+ const obj = {};
270
+ if (message.corporation !== "") {
271
+ obj.corporation = message.corporation;
272
+ }
273
+ if (message.operator !== "") {
274
+ obj.operator = message.operator;
275
+ }
276
+ if ((_a = message.remaining) === null || _a === void 0 ? void 0 : _a.length) {
277
+ obj.remaining = message.remaining.map((e) => coin_1.Coin.toJSON(e));
278
+ }
279
+ if (message.lastReset !== undefined) {
280
+ obj.lastReset = message.lastReset.toISOString();
281
+ }
282
+ return obj;
283
+ },
284
+ create(base) {
285
+ return exports.OperatorAuthorizationUsage.fromPartial(base !== null && base !== void 0 ? base : {});
286
+ },
287
+ fromPartial(object) {
288
+ var _a, _b, _c, _d;
289
+ const message = createBaseOperatorAuthorizationUsage();
290
+ message.corporation = (_a = object.corporation) !== null && _a !== void 0 ? _a : "";
291
+ message.operator = (_b = object.operator) !== null && _b !== void 0 ? _b : "";
292
+ message.remaining = ((_c = object.remaining) === null || _c === void 0 ? void 0 : _c.map((e) => coin_1.Coin.fromPartial(e))) || [];
293
+ message.lastReset = (_d = object.lastReset) !== null && _d !== void 0 ? _d : undefined;
294
+ return message;
295
+ },
296
+ };
201
297
  function createBaseFeeGrant() {
202
298
  return { grantor: "", grantee: "", msgTypes: [], spendLimit: [], expiration: undefined, period: undefined };
203
299
  }
@@ -327,12 +423,12 @@ exports.FeeGrant = {
327
423
  },
328
424
  };
329
425
  function createBaseVSOperatorAuthorization() {
330
- return { authority: "", vsOperator: "", permissions: [] };
426
+ return { corporation: "", vsOperator: "", permissions: [] };
331
427
  }
332
428
  exports.VSOperatorAuthorization = {
333
429
  encode(message, writer = _m0.Writer.create()) {
334
- if (message.authority !== "") {
335
- writer.uint32(10).string(message.authority);
430
+ if (message.corporation !== "") {
431
+ writer.uint32(10).string(message.corporation);
336
432
  }
337
433
  if (message.vsOperator !== "") {
338
434
  writer.uint32(18).string(message.vsOperator);
@@ -355,7 +451,7 @@ exports.VSOperatorAuthorization = {
355
451
  if (tag !== 10) {
356
452
  break;
357
453
  }
358
- message.authority = reader.string();
454
+ message.corporation = reader.string();
359
455
  continue;
360
456
  case 2:
361
457
  if (tag !== 18) {
@@ -386,7 +482,7 @@ exports.VSOperatorAuthorization = {
386
482
  },
387
483
  fromJSON(object) {
388
484
  return {
389
- authority: isSet(object.authority) ? globalThis.String(object.authority) : "",
485
+ corporation: isSet(object.corporation) ? globalThis.String(object.corporation) : "",
390
486
  vsOperator: isSet(object.vsOperator) ? globalThis.String(object.vsOperator) : "",
391
487
  permissions: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.permissions)
392
488
  ? object.permissions.map((e) => globalThis.Number(e))
@@ -396,8 +492,8 @@ exports.VSOperatorAuthorization = {
396
492
  toJSON(message) {
397
493
  var _a;
398
494
  const obj = {};
399
- if (message.authority !== "") {
400
- obj.authority = message.authority;
495
+ if (message.corporation !== "") {
496
+ obj.corporation = message.corporation;
401
497
  }
402
498
  if (message.vsOperator !== "") {
403
499
  obj.vsOperator = message.vsOperator;
@@ -413,7 +509,7 @@ exports.VSOperatorAuthorization = {
413
509
  fromPartial(object) {
414
510
  var _a, _b, _c;
415
511
  const message = createBaseVSOperatorAuthorization();
416
- message.authority = (_a = object.authority) !== null && _a !== void 0 ? _a : "";
512
+ message.corporation = (_a = object.corporation) !== null && _a !== void 0 ? _a : "";
417
513
  message.vsOperator = (_b = object.vsOperator) !== null && _b !== void 0 ? _b : "";
418
514
  message.permissions = ((_c = object.permissions) === null || _c === void 0 ? void 0 : _c.map((e) => e)) || [];
419
515
  return message;
@@ -1,8 +1,11 @@
1
1
  import * as _m0 from "protobufjs/minimal";
2
- export declare const protobufPackage = "verana.dd.module";
2
+ export declare const protobufPackage = "verana.di.module.v1";
3
3
  /** Module is the config object for the module. */
4
4
  export interface Module {
5
- /** authority defines the custom module authority. If not set, defaults to the governance module. */
5
+ /**
6
+ * authority defines the custom module authority.
7
+ * If not set, defaults to the governance module.
8
+ */
6
9
  authority: string;
7
10
  }
8
11
  export declare const Module: {
@@ -3,7 +3,7 @@
3
3
  // versions:
4
4
  // protoc-gen-ts_proto v1.181.2
5
5
  // protoc unknown
6
- // source: verana/dd/module/module.proto
6
+ // source: verana/di/module/v1/module.proto
7
7
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
8
8
  if (k2 === undefined) k2 = k;
9
9
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -41,7 +41,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
41
41
  exports.Module = exports.protobufPackage = void 0;
42
42
  /* eslint-disable */
43
43
  const _m0 = __importStar(require("protobufjs/minimal"));
44
- exports.protobufPackage = "verana.dd.module";
44
+ exports.protobufPackage = "verana.di.module.v1";
45
45
  function createBaseModule() {
46
46
  return { authority: "" };
47
47
  }
@@ -1,12 +1,13 @@
1
1
  import * as _m0 from "protobufjs/minimal";
2
2
  import { Params } from "./params";
3
- import { DIDDirectory } from "./types";
4
- export declare const protobufPackage = "verana.dd.v1";
5
- /** GenesisState defines the diddirectory module's genesis state. */
3
+ import { Digest } from "./tx";
4
+ export declare const protobufPackage = "verana.di.v1";
5
+ /** GenesisState defines the di module's genesis state. */
6
6
  export interface GenesisState {
7
7
  /** params defines all the parameters of the module. */
8
8
  params: Params | undefined;
9
- didDirectories: DIDDirectory[];
9
+ /** digests is the list of all stored digests. */
10
+ digests: Digest[];
10
11
  }
11
12
  export declare const GenesisState: {
12
13
  encode(message: GenesisState, writer?: _m0.Writer): _m0.Writer;
@@ -3,7 +3,7 @@
3
3
  // versions:
4
4
  // protoc-gen-ts_proto v1.181.2
5
5
  // protoc unknown
6
- // source: verana/dd/v1/genesis.proto
6
+ // source: verana/di/v1/genesis.proto
7
7
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
8
8
  if (k2 === undefined) k2 = k;
9
9
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -42,18 +42,18 @@ exports.GenesisState = exports.protobufPackage = void 0;
42
42
  /* eslint-disable */
43
43
  const _m0 = __importStar(require("protobufjs/minimal"));
44
44
  const params_1 = require("./params");
45
- const types_1 = require("./types");
46
- exports.protobufPackage = "verana.dd.v1";
45
+ const tx_1 = require("./tx");
46
+ exports.protobufPackage = "verana.di.v1";
47
47
  function createBaseGenesisState() {
48
- return { params: undefined, didDirectories: [] };
48
+ return { params: undefined, digests: [] };
49
49
  }
50
50
  exports.GenesisState = {
51
51
  encode(message, writer = _m0.Writer.create()) {
52
52
  if (message.params !== undefined) {
53
53
  params_1.Params.encode(message.params, writer.uint32(10).fork()).ldelim();
54
54
  }
55
- for (const v of message.didDirectories) {
56
- types_1.DIDDirectory.encode(v, writer.uint32(18).fork()).ldelim();
55
+ for (const v of message.digests) {
56
+ tx_1.Digest.encode(v, writer.uint32(18).fork()).ldelim();
57
57
  }
58
58
  return writer;
59
59
  },
@@ -74,7 +74,7 @@ exports.GenesisState = {
74
74
  if (tag !== 18) {
75
75
  break;
76
76
  }
77
- message.didDirectories.push(types_1.DIDDirectory.decode(reader, reader.uint32()));
77
+ message.digests.push(tx_1.Digest.decode(reader, reader.uint32()));
78
78
  continue;
79
79
  }
80
80
  if ((tag & 7) === 4 || tag === 0) {
@@ -87,9 +87,7 @@ exports.GenesisState = {
87
87
  fromJSON(object) {
88
88
  return {
89
89
  params: isSet(object.params) ? params_1.Params.fromJSON(object.params) : undefined,
90
- didDirectories: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.didDirectories)
91
- ? object.didDirectories.map((e) => types_1.DIDDirectory.fromJSON(e))
92
- : [],
90
+ digests: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.digests) ? object.digests.map((e) => tx_1.Digest.fromJSON(e)) : [],
93
91
  };
94
92
  },
95
93
  toJSON(message) {
@@ -98,8 +96,8 @@ exports.GenesisState = {
98
96
  if (message.params !== undefined) {
99
97
  obj.params = params_1.Params.toJSON(message.params);
100
98
  }
101
- if ((_a = message.didDirectories) === null || _a === void 0 ? void 0 : _a.length) {
102
- obj.didDirectories = message.didDirectories.map((e) => types_1.DIDDirectory.toJSON(e));
99
+ if ((_a = message.digests) === null || _a === void 0 ? void 0 : _a.length) {
100
+ obj.digests = message.digests.map((e) => tx_1.Digest.toJSON(e));
103
101
  }
104
102
  return obj;
105
103
  },
@@ -112,7 +110,7 @@ exports.GenesisState = {
112
110
  message.params = (object.params !== undefined && object.params !== null)
113
111
  ? params_1.Params.fromPartial(object.params)
114
112
  : undefined;
115
- message.didDirectories = ((_a = object.didDirectories) === null || _a === void 0 ? void 0 : _a.map((e) => types_1.DIDDirectory.fromPartial(e))) || [];
113
+ message.digests = ((_a = object.digests) === null || _a === void 0 ? void 0 : _a.map((e) => tx_1.Digest.fromPartial(e))) || [];
116
114
  return message;
117
115
  },
118
116
  };
@@ -0,0 +1,24 @@
1
+ import * as _m0 from "protobufjs/minimal";
2
+ export declare const protobufPackage = "verana.di.v1";
3
+ /** Params defines the parameters for the module. */
4
+ export interface Params {
5
+ }
6
+ export declare const Params: {
7
+ encode(_: Params, writer?: _m0.Writer): _m0.Writer;
8
+ decode(input: _m0.Reader | Uint8Array, length?: number): Params;
9
+ fromJSON(_: any): Params;
10
+ toJSON(_: Params): unknown;
11
+ create<I extends Exact<DeepPartial<Params>, I>>(base?: I): Params;
12
+ fromPartial<I extends Exact<DeepPartial<Params>, I>>(_: I): Params;
13
+ };
14
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
15
+ export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
16
+ [K in keyof T]?: DeepPartial<T[K]>;
17
+ } : Partial<T>;
18
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
19
+ export type Exact<P, I extends P> = P extends Builtin ? P : P & {
20
+ [K in keyof P]: Exact<P[K], I[K]>;
21
+ } & {
22
+ [K in Exclude<keyof I, KeysOfUnion<P>>]: never;
23
+ };
24
+ export {};
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
+ // versions:
4
+ // protoc-gen-ts_proto v1.181.2
5
+ // protoc unknown
6
+ // source: verana/di/v1/params.proto
7
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
8
+ if (k2 === undefined) k2 = k;
9
+ var desc = Object.getOwnPropertyDescriptor(m, k);
10
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
11
+ desc = { enumerable: true, get: function() { return m[k]; } };
12
+ }
13
+ Object.defineProperty(o, k2, desc);
14
+ }) : (function(o, m, k, k2) {
15
+ if (k2 === undefined) k2 = k;
16
+ o[k2] = m[k];
17
+ }));
18
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
19
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
20
+ }) : function(o, v) {
21
+ o["default"] = v;
22
+ });
23
+ var __importStar = (this && this.__importStar) || (function () {
24
+ var ownKeys = function(o) {
25
+ ownKeys = Object.getOwnPropertyNames || function (o) {
26
+ var ar = [];
27
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
28
+ return ar;
29
+ };
30
+ return ownKeys(o);
31
+ };
32
+ return function (mod) {
33
+ if (mod && mod.__esModule) return mod;
34
+ var result = {};
35
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
36
+ __setModuleDefault(result, mod);
37
+ return result;
38
+ };
39
+ })();
40
+ Object.defineProperty(exports, "__esModule", { value: true });
41
+ exports.Params = exports.protobufPackage = void 0;
42
+ /* eslint-disable */
43
+ const _m0 = __importStar(require("protobufjs/minimal"));
44
+ exports.protobufPackage = "verana.di.v1";
45
+ function createBaseParams() {
46
+ return {};
47
+ }
48
+ exports.Params = {
49
+ encode(_, writer = _m0.Writer.create()) {
50
+ return writer;
51
+ },
52
+ decode(input, length) {
53
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
54
+ let end = length === undefined ? reader.len : reader.pos + length;
55
+ const message = createBaseParams();
56
+ while (reader.pos < end) {
57
+ const tag = reader.uint32();
58
+ switch (tag >>> 3) {
59
+ }
60
+ if ((tag & 7) === 4 || tag === 0) {
61
+ break;
62
+ }
63
+ reader.skipType(tag & 7);
64
+ }
65
+ return message;
66
+ },
67
+ fromJSON(_) {
68
+ return {};
69
+ },
70
+ toJSON(_) {
71
+ const obj = {};
72
+ return obj;
73
+ },
74
+ create(base) {
75
+ return exports.Params.fromPartial(base !== null && base !== void 0 ? base : {});
76
+ },
77
+ fromPartial(_) {
78
+ const message = createBaseParams();
79
+ return message;
80
+ },
81
+ };
@@ -0,0 +1,99 @@
1
+ import * as _m0 from "protobufjs/minimal";
2
+ import { Params } from "./params";
3
+ export declare const protobufPackage = "verana.di.v1";
4
+ /** QueryParamsRequest is request type for the Query/Params RPC method. */
5
+ export interface QueryParamsRequest {
6
+ }
7
+ /** QueryParamsResponse is response type for the Query/Params RPC method. */
8
+ export interface QueryParamsResponse {
9
+ /** params holds all the parameters of this module. */
10
+ params: Params | undefined;
11
+ }
12
+ /** QueryGetDigestRequest is the request type for the Query/GetDigest RPC method. */
13
+ export interface QueryGetDigestRequest {
14
+ /** digest is the digest string to look up. */
15
+ digest: string;
16
+ }
17
+ /** DigestInfo is the stored digest record returned by queries. */
18
+ export interface DigestInfo {
19
+ /** digest is the digest string. */
20
+ digest: string;
21
+ /** created is the timestamp when the digest was stored. */
22
+ created: Date | undefined;
23
+ }
24
+ /** QueryGetDigestResponse is the response type for the Query/GetDigest RPC method. */
25
+ export interface QueryGetDigestResponse {
26
+ /** digest is the stored digest entry. */
27
+ digest: DigestInfo | undefined;
28
+ }
29
+ export declare const QueryParamsRequest: {
30
+ encode(_: QueryParamsRequest, writer?: _m0.Writer): _m0.Writer;
31
+ decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest;
32
+ fromJSON(_: any): QueryParamsRequest;
33
+ toJSON(_: QueryParamsRequest): unknown;
34
+ create<I extends Exact<DeepPartial<QueryParamsRequest>, I>>(base?: I): QueryParamsRequest;
35
+ fromPartial<I extends Exact<DeepPartial<QueryParamsRequest>, I>>(_: I): QueryParamsRequest;
36
+ };
37
+ export declare const QueryParamsResponse: {
38
+ encode(message: QueryParamsResponse, writer?: _m0.Writer): _m0.Writer;
39
+ decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse;
40
+ fromJSON(object: any): QueryParamsResponse;
41
+ toJSON(message: QueryParamsResponse): unknown;
42
+ create<I extends Exact<DeepPartial<QueryParamsResponse>, I>>(base?: I): QueryParamsResponse;
43
+ fromPartial<I extends Exact<DeepPartial<QueryParamsResponse>, I>>(object: I): QueryParamsResponse;
44
+ };
45
+ export declare const QueryGetDigestRequest: {
46
+ encode(message: QueryGetDigestRequest, writer?: _m0.Writer): _m0.Writer;
47
+ decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetDigestRequest;
48
+ fromJSON(object: any): QueryGetDigestRequest;
49
+ toJSON(message: QueryGetDigestRequest): unknown;
50
+ create<I extends Exact<DeepPartial<QueryGetDigestRequest>, I>>(base?: I): QueryGetDigestRequest;
51
+ fromPartial<I extends Exact<DeepPartial<QueryGetDigestRequest>, I>>(object: I): QueryGetDigestRequest;
52
+ };
53
+ export declare const DigestInfo: {
54
+ encode(message: DigestInfo, writer?: _m0.Writer): _m0.Writer;
55
+ decode(input: _m0.Reader | Uint8Array, length?: number): DigestInfo;
56
+ fromJSON(object: any): DigestInfo;
57
+ toJSON(message: DigestInfo): unknown;
58
+ create<I extends Exact<DeepPartial<DigestInfo>, I>>(base?: I): DigestInfo;
59
+ fromPartial<I extends Exact<DeepPartial<DigestInfo>, I>>(object: I): DigestInfo;
60
+ };
61
+ export declare const QueryGetDigestResponse: {
62
+ encode(message: QueryGetDigestResponse, writer?: _m0.Writer): _m0.Writer;
63
+ decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetDigestResponse;
64
+ fromJSON(object: any): QueryGetDigestResponse;
65
+ toJSON(message: QueryGetDigestResponse): unknown;
66
+ create<I extends Exact<DeepPartial<QueryGetDigestResponse>, I>>(base?: I): QueryGetDigestResponse;
67
+ fromPartial<I extends Exact<DeepPartial<QueryGetDigestResponse>, I>>(object: I): QueryGetDigestResponse;
68
+ };
69
+ /** Query defines the gRPC querier service. */
70
+ export interface Query {
71
+ /** Parameters queries the parameters of the module. */
72
+ Params(request: QueryParamsRequest): Promise<QueryParamsResponse>;
73
+ /** [MOD-DI-QRY-1] GetDigest returns a stored digest by its digest string. */
74
+ GetDigest(request: QueryGetDigestRequest): Promise<QueryGetDigestResponse>;
75
+ }
76
+ export declare const QueryServiceName = "verana.di.v1.Query";
77
+ export declare class QueryClientImpl implements Query {
78
+ private readonly rpc;
79
+ private readonly service;
80
+ constructor(rpc: Rpc, opts?: {
81
+ service?: string;
82
+ });
83
+ Params(request: QueryParamsRequest): Promise<QueryParamsResponse>;
84
+ GetDigest(request: QueryGetDigestRequest): Promise<QueryGetDigestResponse>;
85
+ }
86
+ interface Rpc {
87
+ request(service: string, method: string, data: Uint8Array): Promise<Uint8Array>;
88
+ }
89
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
90
+ export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
91
+ [K in keyof T]?: DeepPartial<T[K]>;
92
+ } : Partial<T>;
93
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
94
+ export type Exact<P, I extends P> = P extends Builtin ? P : P & {
95
+ [K in keyof P]: Exact<P[K], I[K]>;
96
+ } & {
97
+ [K in Exclude<keyof I, KeysOfUnion<P>>]: never;
98
+ };
99
+ export {};