@verana-labs/verana-types 0.10.1-dev.6 → 0.10.1-dev.8

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 (58) hide show
  1. package/dist/amino-converter/cs.d.ts +4 -0
  2. package/dist/amino-converter/cs.js +96 -0
  3. package/dist/amino-converter/de.d.ts +3 -0
  4. package/dist/amino-converter/de.js +51 -0
  5. package/dist/amino-converter/di.d.ts +2 -0
  6. package/dist/amino-converter/di.js +21 -0
  7. package/dist/amino-converter/perm.d.ts +12 -0
  8. package/dist/amino-converter/perm.js +307 -0
  9. package/dist/amino-converter/td.d.ts +5 -0
  10. package/dist/amino-converter/td.js +52 -0
  11. package/dist/amino-converter/tr.d.ts +6 -0
  12. package/dist/amino-converter/tr.js +91 -0
  13. package/dist/amino-converter/util/helpers.d.ts +30 -0
  14. package/dist/amino-converter/util/helpers.js +88 -0
  15. package/dist/amino-converter/xr.d.ts +4 -0
  16. package/dist/amino-converter/xr.js +68 -0
  17. package/dist/codec/cosmos/base/v1beta1/coin.d.ts +1 -1
  18. package/dist/codec/google/protobuf/descriptor.d.ts +5 -0
  19. package/dist/codec/google/protobuf/descriptor.js +16 -2
  20. package/dist/codec/google/protobuf/timestamp.d.ts +3 -3
  21. package/dist/codec/verana/de/v1/genesis.d.ts +7 -0
  22. package/dist/codec/verana/de/v1/genesis.js +57 -2
  23. package/dist/codec/verana/de/v1/query.d.ts +39 -1
  24. package/dist/codec/verana/de/v1/query.js +145 -1
  25. package/dist/codec/verana/{dd/module → di/module/v1}/module.d.ts +5 -2
  26. package/dist/codec/verana/{dd/module → di/module/v1}/module.js +2 -2
  27. package/dist/codec/verana/{dd → di}/v1/genesis.d.ts +5 -4
  28. package/dist/codec/verana/{dd → di}/v1/genesis.js +11 -13
  29. package/dist/codec/verana/{dd → di}/v1/params.d.ts +5 -7
  30. package/dist/codec/verana/di/v1/params.js +81 -0
  31. package/dist/codec/verana/di/v1/query.d.ts +99 -0
  32. package/dist/codec/verana/{dd → di}/v1/query.js +65 -166
  33. package/dist/codec/verana/di/v1/tx.d.ts +116 -0
  34. package/dist/codec/verana/di/v1/tx.js +381 -0
  35. package/dist/codec/verana/td/v1/genesis.d.ts +2 -0
  36. package/dist/codec/verana/td/v1/genesis.js +16 -2
  37. package/dist/codec/verana/xr/module/v1/module.d.ts +29 -0
  38. package/dist/codec/verana/xr/module/v1/module.js +98 -0
  39. package/dist/codec/verana/xr/v1/genesis.d.ts +32 -0
  40. package/dist/codec/verana/{dd/v1/params.js → xr/v1/genesis.js} +46 -29
  41. package/dist/codec/verana/xr/v1/params.d.ts +24 -0
  42. package/dist/codec/verana/xr/v1/params.js +81 -0
  43. package/dist/codec/verana/xr/v1/query.d.ts +162 -0
  44. package/dist/codec/verana/xr/v1/query.js +775 -0
  45. package/dist/codec/verana/xr/v1/tx.d.ts +190 -0
  46. package/dist/codec/verana/xr/v1/tx.js +894 -0
  47. package/dist/helpers/aminoConverters.d.ts +8 -36
  48. package/dist/helpers/aminoConverters.js +21 -703
  49. package/dist/index.d.ts +9 -1
  50. package/dist/index.js +9 -1
  51. package/dist/signing.d.ts +67 -0
  52. package/dist/signing.js +124 -0
  53. package/package.json +31 -5
  54. package/dist/codec/verana/dd/v1/query.d.ts +0 -108
  55. package/dist/codec/verana/dd/v1/tx.d.ts +0 -173
  56. package/dist/codec/verana/dd/v1/tx.js +0 -636
  57. package/dist/codec/verana/dd/v1/types.d.ts +0 -30
  58. package/dist/codec/verana/dd/v1/types.js +0 -206
@@ -1,706 +1,24 @@
1
1
  "use strict";
2
- /**
3
- * Amino Converters for Verana Message Types
4
- *
5
- * These converters match the frontend implementation to ensure compatibility.
6
- * They convert between Proto messages and Amino JSON format.
7
- */
8
- var __importDefault = (this && this.__importDefault) || function (mod) {
9
- return (mod && mod.__esModule) ? mod : { "default": mod };
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
10
15
  };
11
16
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.MsgRevokeOperatorAuthorizationAminoConverter = exports.MsgGrantOperatorAuthorizationAminoConverter = exports.MsgCreatePermissionAminoConverter = exports.MsgRepayPermissionSlashedTrustDepositAminoConverter = exports.MsgSlashPermissionTrustDepositAminoConverter = exports.MsgCreateOrUpdatePermissionSessionAminoConverter = exports.MsgCancelPermissionVPLastRequestAminoConverter = exports.MsgSetPermissionVPToValidatedAminoConverter = exports.MsgRenewPermissionVPAminoConverter = exports.MsgStartPermissionVPAminoConverter = exports.MsgRevokePermissionAminoConverter = exports.MsgAdjustPermissionAminoConverter = exports.MsgCreateRootPermissionAminoConverter = exports.MsgSlashTrustDepositAminoConverter = exports.MsgRepaySlashedTrustDepositAminoConverter = exports.MsgReclaimTrustDepositYieldAminoConverter = exports.MsgReclaimTrustDepositAminoConverter = exports.MsgArchiveCredentialSchemaAminoConverter = exports.MsgUpdateCredentialSchemaAminoConverter = exports.MsgCreateCredentialSchemaAminoConverter = exports.MsgRemoveDIDAminoConverter = exports.MsgTouchDIDAminoConverter = exports.MsgRenewDIDAminoConverter = exports.MsgAddDIDAminoConverter = exports.MsgIncreaseActiveGovernanceFrameworkVersionAminoConverter = exports.MsgAddGovernanceFrameworkDocumentAminoConverter = exports.MsgArchiveTrustRegistryAminoConverter = exports.MsgUpdateTrustRegistryAminoConverter = exports.MsgCreateTrustRegistryAminoConverter = void 0;
13
- const long_1 = __importDefault(require("long"));
14
- const tx_1 = require("../codec/verana/tr/v1/tx");
15
- const tx_2 = require("../codec/verana/de/v1/tx");
16
- const tx_3 = require("../codec/verana/dd/v1/tx");
17
- const tx_4 = require("../codec/verana/cs/v1/tx");
18
- const tx_5 = require("../codec/verana/td/v1/tx");
19
- const tx_6 = require("../codec/verana/perm/v1/tx");
20
- const types_1 = require("../codec/verana/perm/v1/types");
21
- // Helper functions for Amino conversion (matching frontend)
22
- const u64ToStr = (v) => v != null ? long_1.default.fromValue(v).toString() : undefined;
23
- const u64ToStrIfNonZero = (v) => {
24
- if (v == null)
25
- return undefined;
26
- const value = long_1.default.fromValue(v);
27
- return value.isZero() ? undefined : value.toString();
28
- };
29
- const strToU64 = (s) => s != null ? long_1.default.fromString(s) : undefined;
30
- const u32ToAmino = (n) => n == null ? undefined : (((n >>> 0) === 0) ? 0 : (n >>> 0));
31
- const pickU32 = (v) => v == null ? undefined : (Number(v) >>> 0);
32
- // Helper for OptionalUInt32: 0 => {} (omitempty), >0 => {value:n}
33
- const toOptU32Amino = (m) => {
34
- if (!m)
35
- return undefined;
36
- const value = (Number(m.value) >>> 0);
37
- return value === 0 ? {} : { value };
38
- };
39
- // Helper for OptionalUInt32: {} (=> 0), {value:n} => OptionalUInt32
40
- const fromOptU32Amino = (x) => {
41
- if (x == null)
42
- return undefined;
43
- // {} => wrapper, value default 0
44
- if (typeof x === "object" && x.value == null)
45
- return { value: 0 };
46
- const n = typeof x === "object" ? x.value : x;
47
- if (n === undefined || n === null)
48
- return undefined;
49
- if (typeof n === "string" && n.trim() === "")
50
- return undefined;
51
- const u = (Number(n) >>> 0);
52
- return { value: u };
53
- };
54
- const clean = (o) => {
55
- Object.keys(o).forEach((k) => o[k] === undefined && delete o[k]);
56
- return o;
57
- };
58
- // Helper for Date/Timestamp: Date -> RFC3339Nano-like string, ISO string -> Date
59
- // Go's legacy Amino JSON trims trailing zeros in fractional seconds (e.g. .830Z -> .83Z).
60
- // Matching this avoids intermittent sign-byte mismatches on LEGACY_AMINO_JSON signatures.
61
- const dateToAmino = (d) => {
62
- if (d == null)
63
- return undefined;
64
- return d
65
- .toISOString()
66
- .replace(/\.000Z$/, "Z")
67
- .replace(/(\.\d*?[1-9])0+Z$/, "$1Z");
68
- };
69
- const dateFromAmino = (s) => s != null ? new Date(s) : undefined;
70
- // ============================================================================
71
- // Trust Registry (TR) Module Converters
72
- // ============================================================================
73
- exports.MsgCreateTrustRegistryAminoConverter = {
74
- aminoType: '/verana.tr.v1.MsgCreateTrustRegistry',
75
- toAmino: ({ authority, operator, did, aka, language, docUrl, docDigestSri, }) => ({
76
- authority,
77
- operator,
78
- did,
79
- aka,
80
- language,
81
- doc_url: docUrl,
82
- doc_digest_sri: docDigestSri,
83
- }),
84
- fromAmino: (value) => tx_1.MsgCreateTrustRegistry.fromPartial({
85
- authority: value.authority,
86
- operator: value.operator,
87
- did: value.did,
88
- aka: value.aka,
89
- language: value.language,
90
- docUrl: value.doc_url,
91
- docDigestSri: value.doc_digest_sri,
92
- }),
93
- };
94
- exports.MsgUpdateTrustRegistryAminoConverter = {
95
- aminoType: '/verana.tr.v1.MsgUpdateTrustRegistry',
96
- toAmino: ({ authority, operator, id, did, aka }) => ({
97
- authority,
98
- operator,
99
- id: id != null ? id.toString() : undefined,
100
- did,
101
- aka,
102
- }),
103
- fromAmino: (value) => tx_1.MsgUpdateTrustRegistry.fromPartial({
104
- authority: value.authority,
105
- operator: value.operator,
106
- id: value.id != null ? Number(value.id) : 0,
107
- did: value.did,
108
- aka: value.aka,
109
- }),
110
- };
111
- exports.MsgArchiveTrustRegistryAminoConverter = {
112
- aminoType: '/verana.tr.v1.MsgArchiveTrustRegistry',
113
- toAmino: ({ authority, operator, id, archive }) => ({
114
- authority,
115
- operator,
116
- id: id != null ? id.toString() : undefined,
117
- archive,
118
- }),
119
- fromAmino: (value) => tx_1.MsgArchiveTrustRegistry.fromPartial({
120
- authority: value.authority,
121
- operator: value.operator,
122
- id: value.id != null ? Number(value.id) : 0,
123
- archive: value.archive,
124
- }),
125
- };
126
- exports.MsgAddGovernanceFrameworkDocumentAminoConverter = {
127
- aminoType: '/verana.tr.v1.MsgAddGovernanceFrameworkDocument',
128
- toAmino: ({ authority, operator, id, docLanguage, docUrl, docDigestSri, version, }) => ({
129
- authority,
130
- operator,
131
- id: id != null ? id.toString() : undefined,
132
- doc_language: docLanguage,
133
- doc_url: docUrl,
134
- doc_digest_sri: docDigestSri,
135
- version,
136
- }),
137
- fromAmino: (value) => tx_1.MsgAddGovernanceFrameworkDocument.fromPartial({
138
- authority: value.authority,
139
- operator: value.operator,
140
- id: value.id != null ? Number(value.id) : 0,
141
- docLanguage: value.doc_language,
142
- docUrl: value.doc_url,
143
- docDigestSri: value.doc_digest_sri,
144
- version: value.version,
145
- }),
146
- };
147
- exports.MsgIncreaseActiveGovernanceFrameworkVersionAminoConverter = {
148
- aminoType: '/verana.tr.v1.MsgIncreaseActiveGovernanceFrameworkVersion',
149
- toAmino: ({ authority, operator, id }) => ({
150
- authority,
151
- operator,
152
- id: id != null ? id.toString() : undefined,
153
- }),
154
- fromAmino: (value) => tx_1.MsgIncreaseActiveGovernanceFrameworkVersion.fromPartial({
155
- authority: value.authority,
156
- operator: value.operator,
157
- id: value.id != null ? Number(value.id) : 0,
158
- }),
159
- };
160
- // ============================================================================
161
- // DID Directory (DD) Module Converters
162
- // ============================================================================
163
- exports.MsgAddDIDAminoConverter = {
164
- aminoType: '/verana.dd.v1.MsgAddDID',
165
- toAmino: ({ creator, did, years }) => ({
166
- creator,
167
- did,
168
- years,
169
- }),
170
- fromAmino: (value) => tx_3.MsgAddDID.fromPartial({
171
- creator: value.creator,
172
- did: value.did,
173
- years: value.years,
174
- }),
175
- };
176
- exports.MsgRenewDIDAminoConverter = {
177
- aminoType: '/verana.dd.v1.MsgRenewDID',
178
- toAmino: ({ creator, did, years }) => ({
179
- creator,
180
- did,
181
- years,
182
- }),
183
- fromAmino: (value) => tx_3.MsgRenewDID.fromPartial({
184
- creator: value.creator,
185
- did: value.did,
186
- years: value.years,
187
- }),
188
- };
189
- exports.MsgTouchDIDAminoConverter = {
190
- aminoType: '/verana.dd.v1.MsgTouchDID',
191
- toAmino: ({ creator, did }) => ({
192
- creator,
193
- did,
194
- }),
195
- fromAmino: (value) => tx_3.MsgTouchDID.fromPartial({
196
- creator: value.creator,
197
- did: value.did,
198
- }),
199
- };
200
- exports.MsgRemoveDIDAminoConverter = {
201
- aminoType: '/verana.dd.v1.MsgRemoveDID',
202
- toAmino: ({ creator, did }) => ({
203
- creator,
204
- did,
205
- }),
206
- fromAmino: (value) => tx_3.MsgRemoveDID.fromPartial({
207
- creator: value.creator,
208
- did: value.did,
209
- }),
210
- };
211
- // ============================================================================
212
- // Credential Schema (CS) Module Converters
213
- // ============================================================================
214
- exports.MsgCreateCredentialSchemaAminoConverter = {
215
- aminoType: '/verana.cs.v1.MsgCreateCredentialSchema',
216
- toAmino: (m) => {
217
- var _a, _b, _c, _d, _e, _f;
218
- return clean({
219
- authority: (_a = m.authority) !== null && _a !== void 0 ? _a : '',
220
- operator: (_b = m.operator) !== null && _b !== void 0 ? _b : '',
221
- tr_id: u64ToStr(m.trId), // Use u64ToStr to match frontend (handles number/Long)
222
- json_schema: (_c = m.jsonSchema) !== null && _c !== void 0 ? _c : '',
223
- issuer_grantor_validation_validity_period: toOptU32Amino(m.issuerGrantorValidationValidityPeriod),
224
- verifier_grantor_validation_validity_period: toOptU32Amino(m.verifierGrantorValidationValidityPeriod),
225
- issuer_validation_validity_period: toOptU32Amino(m.issuerValidationValidityPeriod),
226
- verifier_validation_validity_period: toOptU32Amino(m.verifierValidationValidityPeriod),
227
- holder_validation_validity_period: toOptU32Amino(m.holderValidationValidityPeriod),
228
- issuer_perm_management_mode: u32ToAmino(m.issuerPermManagementMode),
229
- verifier_perm_management_mode: u32ToAmino(m.verifierPermManagementMode),
230
- pricing_asset_type: (_d = m.pricingAssetType) !== null && _d !== void 0 ? _d : 0,
231
- pricing_asset: (_e = m.pricingAsset) !== null && _e !== void 0 ? _e : '',
232
- digest_algorithm: (_f = m.digestAlgorithm) !== null && _f !== void 0 ? _f : '',
233
- });
234
- },
235
- fromAmino: (a) => {
236
- var _a, _b, _c, _d, _e, _f, _g, _h;
237
- return tx_4.MsgCreateCredentialSchema.fromPartial({
238
- authority: (_a = a.authority) !== null && _a !== void 0 ? _a : '',
239
- operator: (_b = a.operator) !== null && _b !== void 0 ? _b : '',
240
- trId: strToU64(a.tr_id) != null ? Number(strToU64(a.tr_id).toString()) : 0, // Convert Long to number
241
- jsonSchema: (_c = a.json_schema) !== null && _c !== void 0 ? _c : '',
242
- issuerGrantorValidationValidityPeriod: fromOptU32Amino(a.issuer_grantor_validation_validity_period),
243
- verifierGrantorValidationValidityPeriod: fromOptU32Amino(a.verifier_grantor_validation_validity_period),
244
- issuerValidationValidityPeriod: fromOptU32Amino(a.issuer_validation_validity_period),
245
- verifierValidationValidityPeriod: fromOptU32Amino(a.verifier_validation_validity_period),
246
- holderValidationValidityPeriod: fromOptU32Amino(a.holder_validation_validity_period),
247
- issuerPermManagementMode: (_d = a.issuer_perm_management_mode) !== null && _d !== void 0 ? _d : 0,
248
- verifierPermManagementMode: (_e = a.verifier_perm_management_mode) !== null && _e !== void 0 ? _e : 0,
249
- pricingAssetType: (_f = a.pricing_asset_type) !== null && _f !== void 0 ? _f : 0,
250
- pricingAsset: (_g = a.pricing_asset) !== null && _g !== void 0 ? _g : '',
251
- digestAlgorithm: (_h = a.digest_algorithm) !== null && _h !== void 0 ? _h : '',
252
- });
253
- },
254
- };
255
- exports.MsgUpdateCredentialSchemaAminoConverter = {
256
- aminoType: '/verana.cs.v1.MsgUpdateCredentialSchema',
257
- toAmino: (m) => {
258
- var _a, _b;
259
- return clean({
260
- authority: (_a = m.authority) !== null && _a !== void 0 ? _a : '',
261
- operator: (_b = m.operator) !== null && _b !== void 0 ? _b : '',
262
- id: u64ToStr(m.id), // Use u64ToStr to match frontend
263
- issuer_grantor_validation_validity_period: toOptU32Amino(m.issuerGrantorValidationValidityPeriod),
264
- verifier_grantor_validation_validity_period: toOptU32Amino(m.verifierGrantorValidationValidityPeriod),
265
- issuer_validation_validity_period: toOptU32Amino(m.issuerValidationValidityPeriod),
266
- verifier_validation_validity_period: toOptU32Amino(m.verifierValidationValidityPeriod),
267
- holder_validation_validity_period: toOptU32Amino(m.holderValidationValidityPeriod),
268
- });
269
- },
270
- fromAmino: (a) => {
271
- var _a, _b;
272
- return tx_4.MsgUpdateCredentialSchema.fromPartial({
273
- authority: (_a = a.authority) !== null && _a !== void 0 ? _a : '',
274
- operator: (_b = a.operator) !== null && _b !== void 0 ? _b : '',
275
- id: strToU64(a.id) != null ? Number(strToU64(a.id).toString()) : 0, // Convert Long to number
276
- issuerGrantorValidationValidityPeriod: fromOptU32Amino(a.issuer_grantor_validation_validity_period),
277
- verifierGrantorValidationValidityPeriod: fromOptU32Amino(a.verifier_grantor_validation_validity_period),
278
- issuerValidationValidityPeriod: fromOptU32Amino(a.issuer_validation_validity_period),
279
- verifierValidationValidityPeriod: fromOptU32Amino(a.verifier_validation_validity_period),
280
- holderValidationValidityPeriod: fromOptU32Amino(a.holder_validation_validity_period),
281
- });
282
- },
283
- };
284
- exports.MsgArchiveCredentialSchemaAminoConverter = {
285
- aminoType: '/verana.cs.v1.MsgArchiveCredentialSchema',
286
- toAmino: (m) => {
287
- var _a, _b, _c;
288
- return ({
289
- authority: (_a = m.authority) !== null && _a !== void 0 ? _a : '',
290
- operator: (_b = m.operator) !== null && _b !== void 0 ? _b : '',
291
- id: u64ToStr(m.id), // Use u64ToStr to match frontend
292
- archive: (_c = m.archive) !== null && _c !== void 0 ? _c : false,
293
- });
294
- },
295
- fromAmino: (a) => {
296
- var _a;
297
- return tx_4.MsgArchiveCredentialSchema.fromPartial({
298
- authority: a.authority,
299
- operator: a.operator,
300
- id: strToU64(a.id) != null ? Number(strToU64(a.id).toString()) : 0, // Convert Long to number
301
- archive: (_a = a.archive) !== null && _a !== void 0 ? _a : false,
302
- });
303
- },
304
- };
305
- // ============================================================================
306
- // Trust Deposit (TD) Module Converters
307
- // ============================================================================
308
- exports.MsgReclaimTrustDepositAminoConverter = {
309
- aminoType: '/verana.td.v1.MsgReclaimTrustDeposit',
310
- toAmino: ({ creator, claimed }) => ({
311
- creator,
312
- claimed: claimed != null ? claimed.toString() : undefined,
313
- }),
314
- fromAmino: (value) => tx_5.MsgReclaimTrustDeposit.fromPartial({
315
- creator: value.creator,
316
- claimed: value.claimed != null ? Number(value.claimed) : 0,
317
- }),
318
- };
319
- exports.MsgReclaimTrustDepositYieldAminoConverter = {
320
- aminoType: '/verana.td.v1.MsgReclaimTrustDepositYield',
321
- toAmino: ({ authority, operator }) => ({
322
- authority,
323
- operator,
324
- }),
325
- fromAmino: (value) => tx_5.MsgReclaimTrustDepositYield.fromPartial({
326
- authority: value.authority,
327
- operator: value.operator,
328
- }),
329
- };
330
- exports.MsgRepaySlashedTrustDepositAminoConverter = {
331
- aminoType: '/verana.td.v1.MsgRepaySlashedTrustDeposit',
332
- toAmino: ({ authority, operator, amount }) => ({
333
- authority,
334
- operator,
335
- amount: amount != null ? amount.toString() : undefined,
336
- }),
337
- fromAmino: (value) => tx_5.MsgRepaySlashedTrustDeposit.fromPartial({
338
- authority: value.authority,
339
- operator: value.operator,
340
- amount: value.amount != null ? Number(value.amount) : 0,
341
- }),
342
- };
343
- exports.MsgSlashTrustDepositAminoConverter = {
344
- aminoType: '/verana.td.v1.MsgSlashTrustDeposit',
345
- toAmino: ({ authority, account, amount }) => ({
346
- authority,
347
- account,
348
- amount,
349
- }),
350
- fromAmino: (value) => tx_5.MsgSlashTrustDeposit.fromPartial({
351
- authority: value.authority,
352
- account: value.account,
353
- amount: value.amount,
354
- }),
355
- };
356
- // ============================================================================
357
- // Permission (PERM) Module Converters
358
- // ============================================================================
359
- exports.MsgCreateRootPermissionAminoConverter = {
360
- aminoType: '/verana.perm.v1.MsgCreateRootPermission',
361
- toAmino: (m) => {
362
- var _a, _b, _c;
363
- return clean({
364
- authority: (_a = m.authority) !== null && _a !== void 0 ? _a : '',
365
- operator: (_b = m.operator) !== null && _b !== void 0 ? _b : '',
366
- schema_id: u64ToStr(m.schemaId),
367
- did: (_c = m.did) !== null && _c !== void 0 ? _c : '',
368
- effective_from: dateToAmino(m.effectiveFrom),
369
- effective_until: dateToAmino(m.effectiveUntil),
370
- validation_fees: u64ToStr(m.validationFees),
371
- issuance_fees: u64ToStr(m.issuanceFees),
372
- verification_fees: u64ToStr(m.verificationFees),
373
- });
374
- },
375
- fromAmino: (a) => {
376
- var _a, _b, _c;
377
- return tx_6.MsgCreateRootPermission.fromPartial({
378
- authority: (_a = a.authority) !== null && _a !== void 0 ? _a : '',
379
- operator: (_b = a.operator) !== null && _b !== void 0 ? _b : '',
380
- schemaId: strToU64(a.schema_id) != null ? Number(strToU64(a.schema_id).toString()) : 0,
381
- did: (_c = a.did) !== null && _c !== void 0 ? _c : '',
382
- effectiveFrom: dateFromAmino(a.effective_from),
383
- effectiveUntil: dateFromAmino(a.effective_until),
384
- validationFees: strToU64(a.validation_fees) != null ? Number(strToU64(a.validation_fees).toString()) : 0,
385
- issuanceFees: strToU64(a.issuance_fees) != null ? Number(strToU64(a.issuance_fees).toString()) : 0,
386
- verificationFees: strToU64(a.verification_fees) != null ? Number(strToU64(a.verification_fees).toString()) : 0,
387
- });
388
- },
389
- };
390
- exports.MsgAdjustPermissionAminoConverter = {
391
- aminoType: '/verana.perm.v1.MsgAdjustPermission',
392
- toAmino: (m) => {
393
- var _a, _b;
394
- return clean({
395
- authority: (_a = m.authority) !== null && _a !== void 0 ? _a : '',
396
- operator: (_b = m.operator) !== null && _b !== void 0 ? _b : '',
397
- id: u64ToStr(m.id),
398
- effective_until: dateToAmino(m.effectiveUntil),
399
- });
400
- },
401
- fromAmino: (a) => {
402
- var _a, _b;
403
- return tx_6.MsgAdjustPermission.fromPartial({
404
- authority: (_a = a.authority) !== null && _a !== void 0 ? _a : '',
405
- operator: (_b = a.operator) !== null && _b !== void 0 ? _b : '',
406
- id: strToU64(a.id) != null ? Number(strToU64(a.id).toString()) : 0,
407
- effectiveUntil: dateFromAmino(a.effective_until),
408
- });
409
- },
410
- };
411
- exports.MsgRevokePermissionAminoConverter = {
412
- aminoType: '/verana.perm.v1.MsgRevokePermission',
413
- toAmino: (m) => {
414
- var _a, _b;
415
- return clean({
416
- authority: (_a = m.authority) !== null && _a !== void 0 ? _a : '',
417
- operator: (_b = m.operator) !== null && _b !== void 0 ? _b : '',
418
- id: u64ToStr(m.id),
419
- });
420
- },
421
- fromAmino: (a) => {
422
- var _a, _b;
423
- return tx_6.MsgRevokePermission.fromPartial({
424
- authority: (_a = a.authority) !== null && _a !== void 0 ? _a : '',
425
- operator: (_b = a.operator) !== null && _b !== void 0 ? _b : '',
426
- id: strToU64(a.id) != null ? Number(strToU64(a.id).toString()) : 0,
427
- });
428
- },
429
- };
430
- exports.MsgStartPermissionVPAminoConverter = {
431
- aminoType: '/verana.perm.v1.MsgStartPermissionVP',
432
- toAmino: (m) => {
433
- var _a, _b, _c, _d, _e, _f, _g;
434
- return clean({
435
- authority: (_a = m.authority) !== null && _a !== void 0 ? _a : '',
436
- operator: (_b = m.operator) !== null && _b !== void 0 ? _b : '',
437
- type: (_c = m.type) !== null && _c !== void 0 ? _c : types_1.PermissionType.UNSPECIFIED,
438
- validator_perm_id: u64ToStr(m.validatorPermId),
439
- did: (_d = m.did) !== null && _d !== void 0 ? _d : '',
440
- validation_fees: m.validationFees ? { value: u64ToStr(m.validationFees.value) } : undefined,
441
- issuance_fees: m.issuanceFees ? { value: u64ToStr(m.issuanceFees.value) } : undefined,
442
- verification_fees: m.verificationFees ? { value: u64ToStr(m.verificationFees.value) } : undefined,
443
- vs_operator: m.vsOperator || undefined,
444
- vs_operator_authz_enabled: m.vsOperatorAuthzEnabled || undefined,
445
- vs_operator_authz_spend_limit: (_e = m.vsOperatorAuthzSpendLimit) !== null && _e !== void 0 ? _e : [],
446
- vs_operator_authz_with_feegrant: m.vsOperatorAuthzWithFeegrant || undefined,
447
- vs_operator_authz_fee_spend_limit: (_f = m.vsOperatorAuthzFeeSpendLimit) !== null && _f !== void 0 ? _f : [],
448
- vs_operator_authz_spend_period: (_g = m.vsOperatorAuthzSpendPeriod) !== null && _g !== void 0 ? _g : undefined,
449
- });
450
- },
451
- fromAmino: (a) => {
452
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
453
- return tx_6.MsgStartPermissionVP.fromPartial({
454
- authority: (_a = a.authority) !== null && _a !== void 0 ? _a : '',
455
- operator: (_b = a.operator) !== null && _b !== void 0 ? _b : '',
456
- type: (_c = a.type) !== null && _c !== void 0 ? _c : types_1.PermissionType.UNSPECIFIED,
457
- validatorPermId: strToU64(a.validator_perm_id) != null ? Number(strToU64(a.validator_perm_id).toString()) : 0,
458
- did: (_d = a.did) !== null && _d !== void 0 ? _d : '',
459
- validationFees: a.validation_fees ? { value: Number(a.validation_fees.value) } : undefined,
460
- issuanceFees: a.issuance_fees ? { value: Number(a.issuance_fees.value) } : undefined,
461
- verificationFees: a.verification_fees ? { value: Number(a.verification_fees.value) } : undefined,
462
- vsOperator: (_e = a.vs_operator) !== null && _e !== void 0 ? _e : '',
463
- vsOperatorAuthzEnabled: (_f = a.vs_operator_authz_enabled) !== null && _f !== void 0 ? _f : false,
464
- vsOperatorAuthzSpendLimit: (_g = a.vs_operator_authz_spend_limit) !== null && _g !== void 0 ? _g : [],
465
- vsOperatorAuthzWithFeegrant: (_h = a.vs_operator_authz_with_feegrant) !== null && _h !== void 0 ? _h : false,
466
- vsOperatorAuthzFeeSpendLimit: (_j = a.vs_operator_authz_fee_spend_limit) !== null && _j !== void 0 ? _j : [],
467
- vsOperatorAuthzSpendPeriod: (_k = a.vs_operator_authz_spend_period) !== null && _k !== void 0 ? _k : undefined,
468
- });
469
- },
470
- };
471
- exports.MsgRenewPermissionVPAminoConverter = {
472
- aminoType: '/verana.perm.v1.MsgRenewPermissionVP',
473
- toAmino: (m) => {
474
- var _a, _b;
475
- return clean({
476
- authority: (_a = m.authority) !== null && _a !== void 0 ? _a : '',
477
- operator: (_b = m.operator) !== null && _b !== void 0 ? _b : '',
478
- id: u64ToStr(m.id),
479
- });
480
- },
481
- fromAmino: (a) => {
482
- var _a, _b;
483
- return tx_6.MsgRenewPermissionVP.fromPartial({
484
- authority: (_a = a.authority) !== null && _a !== void 0 ? _a : '',
485
- operator: (_b = a.operator) !== null && _b !== void 0 ? _b : '',
486
- id: strToU64(a.id) != null ? Number(strToU64(a.id).toString()) : 0,
487
- });
488
- },
489
- };
490
- exports.MsgSetPermissionVPToValidatedAminoConverter = {
491
- aminoType: '/verana.perm.v1.MsgSetPermissionVPToValidated',
492
- toAmino: (m) => {
493
- var _a, _b, _c;
494
- return clean({
495
- authority: (_a = m.authority) !== null && _a !== void 0 ? _a : '',
496
- operator: (_b = m.operator) !== null && _b !== void 0 ? _b : '',
497
- id: u64ToStr(m.id),
498
- effective_until: dateToAmino(m.effectiveUntil),
499
- validation_fees: u64ToStr(m.validationFees),
500
- issuance_fees: u64ToStr(m.issuanceFees),
501
- verification_fees: u64ToStr(m.verificationFees),
502
- vp_summary_digest_sri: (_c = m.vpSummaryDigestSri) !== null && _c !== void 0 ? _c : '',
503
- issuance_fee_discount: u64ToStr(m.issuanceFeeDiscount),
504
- verification_fee_discount: u64ToStr(m.verificationFeeDiscount),
505
- });
506
- },
507
- fromAmino: (a) => {
508
- var _a, _b, _c;
509
- return tx_6.MsgSetPermissionVPToValidated.fromPartial({
510
- authority: (_a = a.authority) !== null && _a !== void 0 ? _a : '',
511
- operator: (_b = a.operator) !== null && _b !== void 0 ? _b : '',
512
- id: strToU64(a.id) != null ? Number(strToU64(a.id).toString()) : 0,
513
- effectiveUntil: dateFromAmino(a.effective_until),
514
- validationFees: strToU64(a.validation_fees) != null ? Number(strToU64(a.validation_fees).toString()) : 0,
515
- issuanceFees: strToU64(a.issuance_fees) != null ? Number(strToU64(a.issuance_fees).toString()) : 0,
516
- verificationFees: strToU64(a.verification_fees) != null ? Number(strToU64(a.verification_fees).toString()) : 0,
517
- vpSummaryDigestSri: (_c = a.vp_summary_digest_sri) !== null && _c !== void 0 ? _c : '',
518
- issuanceFeeDiscount: strToU64(a.issuance_fee_discount) != null ? Number(strToU64(a.issuance_fee_discount).toString()) : 0,
519
- verificationFeeDiscount: strToU64(a.verification_fee_discount) != null ? Number(strToU64(a.verification_fee_discount).toString()) : 0,
520
- });
521
- },
522
- };
523
- exports.MsgCancelPermissionVPLastRequestAminoConverter = {
524
- aminoType: '/verana.perm.v1.MsgCancelPermissionVPLastRequest',
525
- toAmino: (m) => {
526
- var _a, _b;
527
- return clean({
528
- authority: (_a = m.authority) !== null && _a !== void 0 ? _a : '',
529
- operator: (_b = m.operator) !== null && _b !== void 0 ? _b : '',
530
- id: u64ToStr(m.id),
531
- });
532
- },
533
- fromAmino: (a) => {
534
- var _a, _b;
535
- return tx_6.MsgCancelPermissionVPLastRequest.fromPartial({
536
- authority: (_a = a.authority) !== null && _a !== void 0 ? _a : '',
537
- operator: (_b = a.operator) !== null && _b !== void 0 ? _b : '',
538
- id: strToU64(a.id) != null ? Number(strToU64(a.id).toString()) : 0,
539
- });
540
- },
541
- };
542
- exports.MsgCreateOrUpdatePermissionSessionAminoConverter = {
543
- aminoType: '/verana.perm.v1.MsgCreateOrUpdatePermissionSession',
544
- toAmino: (m) => {
545
- var _a, _b, _c, _d;
546
- return clean({
547
- authority: (_a = m.authority) !== null && _a !== void 0 ? _a : '',
548
- operator: (_b = m.operator) !== null && _b !== void 0 ? _b : '',
549
- id: (_c = m.id) !== null && _c !== void 0 ? _c : '',
550
- issuer_perm_id: u64ToStr(m.issuerPermId),
551
- verifier_perm_id: u64ToStr(m.verifierPermId),
552
- agent_perm_id: u64ToStr(m.agentPermId),
553
- wallet_agent_perm_id: u64ToStr(m.walletAgentPermId),
554
- digest: (_d = m.digest) !== null && _d !== void 0 ? _d : undefined,
555
- });
556
- },
557
- fromAmino: (a) => {
558
- var _a, _b, _c, _d;
559
- return tx_6.MsgCreateOrUpdatePermissionSession.fromPartial({
560
- authority: (_a = a.authority) !== null && _a !== void 0 ? _a : '',
561
- operator: (_b = a.operator) !== null && _b !== void 0 ? _b : '',
562
- id: (_c = a.id) !== null && _c !== void 0 ? _c : '',
563
- issuerPermId: strToU64(a.issuer_perm_id) != null ? Number(strToU64(a.issuer_perm_id).toString()) : 0,
564
- verifierPermId: strToU64(a.verifier_perm_id) != null ? Number(strToU64(a.verifier_perm_id).toString()) : 0,
565
- agentPermId: strToU64(a.agent_perm_id) != null ? Number(strToU64(a.agent_perm_id).toString()) : 0,
566
- walletAgentPermId: strToU64(a.wallet_agent_perm_id) != null ? Number(strToU64(a.wallet_agent_perm_id).toString()) : 0,
567
- digest: (_d = a.digest) !== null && _d !== void 0 ? _d : '',
568
- });
569
- },
570
- };
571
- exports.MsgSlashPermissionTrustDepositAminoConverter = {
572
- aminoType: '/verana.perm.v1.MsgSlashPermissionTrustDeposit',
573
- toAmino: (m) => {
574
- var _a, _b;
575
- return clean({
576
- authority: (_a = m.authority) !== null && _a !== void 0 ? _a : '',
577
- operator: (_b = m.operator) !== null && _b !== void 0 ? _b : '',
578
- id: u64ToStr(m.id),
579
- amount: u64ToStr(m.amount),
580
- });
581
- },
582
- fromAmino: (a) => {
583
- var _a, _b;
584
- return tx_6.MsgSlashPermissionTrustDeposit.fromPartial({
585
- authority: (_a = a.authority) !== null && _a !== void 0 ? _a : '',
586
- operator: (_b = a.operator) !== null && _b !== void 0 ? _b : '',
587
- id: strToU64(a.id) != null ? Number(strToU64(a.id).toString()) : 0,
588
- amount: strToU64(a.amount) != null ? Number(strToU64(a.amount).toString()) : 0,
589
- });
590
- },
591
- };
592
- exports.MsgRepayPermissionSlashedTrustDepositAminoConverter = {
593
- aminoType: '/verana.perm.v1.MsgRepayPermissionSlashedTrustDeposit',
594
- toAmino: (m) => {
595
- var _a, _b;
596
- return clean({
597
- authority: (_a = m.authority) !== null && _a !== void 0 ? _a : '',
598
- operator: (_b = m.operator) !== null && _b !== void 0 ? _b : '',
599
- id: u64ToStr(m.id),
600
- });
601
- },
602
- fromAmino: (a) => {
603
- var _a, _b;
604
- return tx_6.MsgRepayPermissionSlashedTrustDeposit.fromPartial({
605
- authority: (_a = a.authority) !== null && _a !== void 0 ? _a : '',
606
- operator: (_b = a.operator) !== null && _b !== void 0 ? _b : '',
607
- id: strToU64(a.id) != null ? Number(strToU64(a.id).toString()) : 0,
608
- });
609
- },
610
- };
611
- exports.MsgCreatePermissionAminoConverter = {
612
- aminoType: '/verana.perm.v1.MsgCreatePermission',
613
- toAmino: (m) => {
614
- var _a, _b, _c, _d, _e, _f, _g;
615
- return clean({
616
- authority: (_a = m.authority) !== null && _a !== void 0 ? _a : '',
617
- operator: (_b = m.operator) !== null && _b !== void 0 ? _b : '',
618
- type: (_c = m.type) !== null && _c !== void 0 ? _c : 0,
619
- validator_perm_id: u64ToStr(m.validatorPermId),
620
- did: (_d = m.did) !== null && _d !== void 0 ? _d : '',
621
- effective_from: dateToAmino(m.effectiveFrom),
622
- effective_until: dateToAmino(m.effectiveUntil),
623
- verification_fees: u64ToStrIfNonZero(m.verificationFees),
624
- validation_fees: u64ToStrIfNonZero(m.validationFees),
625
- vs_operator: m.vsOperator || undefined,
626
- vs_operator_authz_enabled: m.vsOperatorAuthzEnabled || undefined,
627
- vs_operator_authz_spend_limit: (_e = m.vsOperatorAuthzSpendLimit) !== null && _e !== void 0 ? _e : [],
628
- vs_operator_authz_with_feegrant: m.vsOperatorAuthzWithFeegrant || undefined,
629
- vs_operator_authz_fee_spend_limit: (_f = m.vsOperatorAuthzFeeSpendLimit) !== null && _f !== void 0 ? _f : [],
630
- vs_operator_authz_spend_period: (_g = m.vsOperatorAuthzSpendPeriod) !== null && _g !== void 0 ? _g : undefined,
631
- });
632
- },
633
- fromAmino: (a) => {
634
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
635
- return tx_6.MsgCreatePermission.fromPartial({
636
- authority: (_a = a.authority) !== null && _a !== void 0 ? _a : '',
637
- operator: (_b = a.operator) !== null && _b !== void 0 ? _b : '',
638
- type: (_c = a.type) !== null && _c !== void 0 ? _c : 0,
639
- validatorPermId: strToU64(a.validator_perm_id) != null ? Number(strToU64(a.validator_perm_id).toString()) : 0,
640
- did: (_d = a.did) !== null && _d !== void 0 ? _d : '',
641
- effectiveFrom: dateFromAmino(a.effective_from),
642
- effectiveUntil: dateFromAmino(a.effective_until),
643
- verificationFees: strToU64(a.verification_fees) != null ? Number(strToU64(a.verification_fees).toString()) : 0,
644
- validationFees: strToU64(a.validation_fees) != null ? Number(strToU64(a.validation_fees).toString()) : 0,
645
- vsOperator: (_e = a.vs_operator) !== null && _e !== void 0 ? _e : '',
646
- vsOperatorAuthzEnabled: (_f = a.vs_operator_authz_enabled) !== null && _f !== void 0 ? _f : false,
647
- vsOperatorAuthzSpendLimit: (_g = a.vs_operator_authz_spend_limit) !== null && _g !== void 0 ? _g : [],
648
- vsOperatorAuthzWithFeegrant: (_h = a.vs_operator_authz_with_feegrant) !== null && _h !== void 0 ? _h : false,
649
- vsOperatorAuthzFeeSpendLimit: (_j = a.vs_operator_authz_fee_spend_limit) !== null && _j !== void 0 ? _j : [],
650
- vsOperatorAuthzSpendPeriod: (_k = a.vs_operator_authz_spend_period) !== null && _k !== void 0 ? _k : undefined,
651
- });
652
- },
653
- };
654
- // ============================================================================
655
- // Delegation Engine (DE) Module Converters
656
- // ============================================================================
657
- exports.MsgGrantOperatorAuthorizationAminoConverter = {
658
- aminoType: '/verana.de.v1.MsgGrantOperatorAuthorization',
659
- toAmino: (m) => {
660
- var _a, _b, _c, _d, _e;
661
- return clean({
662
- authority: m.authority || undefined,
663
- operator: m.operator || undefined,
664
- grantee: m.grantee || undefined,
665
- msg_types: ((_a = m.msgTypes) === null || _a === void 0 ? void 0 : _a.length) ? m.msgTypes : undefined,
666
- expiration: dateToAmino(m.expiration),
667
- authz_spend_limit: ((_b = m.authzSpendLimit) === null || _b === void 0 ? void 0 : _b.length) ? m.authzSpendLimit : undefined,
668
- authz_spend_limit_period: m.authzSpendLimitPeriod ? {
669
- seconds: (_c = m.authzSpendLimitPeriod.seconds) === null || _c === void 0 ? void 0 : _c.toString(),
670
- nanos: m.authzSpendLimitPeriod.nanos,
671
- } : undefined,
672
- with_feegrant: m.withFeegrant || undefined,
673
- feegrant_spend_limit: ((_d = m.feegrantSpendLimit) === null || _d === void 0 ? void 0 : _d.length) ? m.feegrantSpendLimit : undefined,
674
- feegrant_spend_limit_period: m.feegrantSpendLimitPeriod ? {
675
- seconds: (_e = m.feegrantSpendLimitPeriod.seconds) === null || _e === void 0 ? void 0 : _e.toString(),
676
- nanos: m.feegrantSpendLimitPeriod.nanos,
677
- } : undefined,
678
- });
679
- },
680
- fromAmino: (a) => {
681
- var _a, _b, _c, _d, _e, _f, _g;
682
- return tx_2.MsgGrantOperatorAuthorization.fromPartial({
683
- authority: (_a = a.authority) !== null && _a !== void 0 ? _a : '',
684
- operator: (_b = a.operator) !== null && _b !== void 0 ? _b : '',
685
- grantee: (_c = a.grantee) !== null && _c !== void 0 ? _c : '',
686
- msgTypes: (_d = a.msg_types) !== null && _d !== void 0 ? _d : [],
687
- expiration: dateFromAmino(a.expiration),
688
- authzSpendLimit: (_e = a.authz_spend_limit) !== null && _e !== void 0 ? _e : [],
689
- withFeegrant: (_f = a.with_feegrant) !== null && _f !== void 0 ? _f : false,
690
- feegrantSpendLimit: (_g = a.feegrant_spend_limit) !== null && _g !== void 0 ? _g : [],
691
- });
692
- },
693
- };
694
- exports.MsgRevokeOperatorAuthorizationAminoConverter = {
695
- aminoType: '/verana.de.v1.MsgRevokeOperatorAuthorization',
696
- toAmino: ({ authority, operator, grantee }) => clean({
697
- authority: authority || undefined,
698
- operator: operator || undefined,
699
- grantee: grantee || undefined,
700
- }),
701
- fromAmino: (value) => tx_2.MsgRevokeOperatorAuthorization.fromPartial({
702
- authority: value.authority,
703
- operator: value.operator,
704
- grantee: value.grantee,
705
- }),
706
- };
17
+ __exportStar(require("../amino-converter/tr"), exports);
18
+ __exportStar(require("../amino-converter/cs"), exports);
19
+ __exportStar(require("../amino-converter/td"), exports);
20
+ __exportStar(require("../amino-converter/perm"), exports);
21
+ __exportStar(require("../amino-converter/de"), exports);
22
+ __exportStar(require("../amino-converter/di"), exports);
23
+ __exportStar(require("../amino-converter/xr"), exports);
24
+ __exportStar(require("../amino-converter/util/helpers"), exports);