@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.
- package/README.md +1 -1
- package/dist/amino-converter/cs.d.ts +7 -0
- package/dist/amino-converter/cs.js +169 -0
- package/dist/amino-converter/de.d.ts +3 -0
- package/dist/amino-converter/de.js +53 -0
- package/dist/amino-converter/di.d.ts +2 -0
- package/dist/amino-converter/di.js +23 -0
- package/dist/amino-converter/perm.d.ts +12 -0
- package/dist/amino-converter/perm.js +313 -0
- package/dist/amino-converter/td.d.ts +4 -0
- package/dist/amino-converter/td.js +45 -0
- package/dist/amino-converter/tr.d.ts +6 -0
- package/dist/amino-converter/tr.js +107 -0
- package/dist/amino-converter/util/helpers.d.ts +30 -0
- package/dist/amino-converter/util/helpers.js +88 -0
- package/dist/amino-converter/xr.d.ts +4 -0
- package/dist/amino-converter/xr.js +74 -0
- package/dist/codec/cosmos/base/v1beta1/coin.d.ts +1 -1
- package/dist/codec/google/protobuf/descriptor.d.ts +5 -0
- package/dist/codec/google/protobuf/descriptor.js +16 -2
- package/dist/codec/google/protobuf/timestamp.d.ts +3 -3
- package/dist/codec/verana/cs/v1/query.d.ts +4 -3
- package/dist/codec/verana/cs/v1/query.js +36 -19
- package/dist/codec/verana/cs/v1/tx.d.ts +106 -11
- package/dist/codec/verana/cs/v1/tx.js +529 -45
- package/dist/codec/verana/cs/v1/types.d.ts +69 -14
- package/dist/codec/verana/cs/v1/types.js +392 -55
- package/dist/codec/verana/de/v1/genesis.d.ts +9 -0
- package/dist/codec/verana/de/v1/genesis.js +80 -2
- package/dist/codec/verana/de/v1/query.d.ts +41 -3
- package/dist/codec/verana/de/v1/query.js +153 -9
- package/dist/codec/verana/de/v1/tx.d.ts +27 -10
- package/dist/codec/verana/de/v1/tx.js +35 -18
- package/dist/codec/verana/de/v1/types.d.ts +42 -4
- package/dist/codec/verana/de/v1/types.js +113 -17
- package/dist/codec/verana/{dd/module → di/module/v1}/module.d.ts +5 -2
- package/dist/codec/verana/{dd/module → di/module/v1}/module.js +2 -2
- package/dist/codec/verana/{dd → di}/v1/genesis.d.ts +5 -4
- package/dist/codec/verana/{dd → di}/v1/genesis.js +11 -13
- package/dist/codec/verana/di/v1/params.d.ts +24 -0
- package/dist/codec/verana/di/v1/params.js +81 -0
- package/dist/codec/verana/di/v1/query.d.ts +99 -0
- package/dist/codec/verana/{dd → di}/v1/query.js +65 -166
- package/dist/codec/verana/di/v1/tx.d.ts +120 -0
- package/dist/codec/verana/di/v1/tx.js +409 -0
- package/dist/codec/verana/perm/v1/query.d.ts +0 -1
- package/dist/codec/verana/perm/v1/query.js +3 -17
- package/dist/codec/verana/perm/v1/tx.d.ts +105 -59
- package/dist/codec/verana/perm/v1/tx.js +631 -272
- package/dist/codec/verana/perm/v1/types.d.ts +30 -30
- package/dist/codec/verana/perm/v1/types.js +241 -208
- package/dist/codec/verana/td/v1/genesis.d.ts +4 -2
- package/dist/codec/verana/td/v1/genesis.js +31 -17
- package/dist/codec/verana/td/v1/params.d.ts +2 -0
- package/dist/codec/verana/td/v1/params.js +18 -1
- package/dist/codec/verana/td/v1/query.d.ts +1 -1
- package/dist/codec/verana/td/v1/query.js +8 -8
- package/dist/codec/verana/td/v1/tx.d.ts +26 -40
- package/dist/codec/verana/td/v1/tx.js +78 -188
- package/dist/codec/verana/td/v1/types.d.ts +5 -7
- package/dist/codec/verana/td/v1/types.js +32 -47
- package/dist/codec/verana/tr/v1/query.d.ts +1 -2
- package/dist/codec/verana/tr/v1/query.js +8 -8
- package/dist/codec/verana/tr/v1/tx.d.ts +32 -32
- package/dist/codec/verana/tr/v1/tx.js +89 -89
- package/dist/codec/verana/tr/v1/types.d.ts +2 -5
- package/dist/codec/verana/tr/v1/types.js +25 -55
- package/dist/codec/verana/xr/module/v1/module.d.ts +29 -0
- package/dist/codec/verana/xr/module/v1/module.js +98 -0
- package/dist/codec/verana/xr/v1/genesis.d.ts +32 -0
- package/dist/codec/verana/xr/v1/genesis.js +149 -0
- package/dist/codec/verana/{dd → xr}/v1/params.d.ts +4 -3
- package/dist/codec/verana/{dd → xr}/v1/params.js +16 -44
- package/dist/codec/verana/xr/v1/query.d.ts +162 -0
- package/dist/codec/verana/xr/v1/query.js +775 -0
- package/dist/codec/verana/xr/v1/tx.d.ts +195 -0
- package/dist/codec/verana/xr/v1/tx.js +939 -0
- package/dist/helpers/aminoConverters.d.ts +8 -32
- package/dist/helpers/aminoConverters.js +21 -589
- package/dist/index.d.ts +9 -1
- package/dist/index.js +9 -1
- package/dist/signing.d.ts +65 -0
- package/dist/signing.js +121 -0
- package/package.json +31 -5
- package/dist/codec/verana/dd/v1/query.d.ts +0 -108
- package/dist/codec/verana/dd/v1/tx.d.ts +0 -173
- package/dist/codec/verana/dd/v1/tx.js +0 -636
- package/dist/codec/verana/dd/v1/types.d.ts +0 -30
- package/dist/codec/verana/dd/v1/types.js +0 -206
package/README.md
CHANGED
|
@@ -48,7 +48,7 @@ npm run build # Build the package (emits dist/)
|
|
|
48
48
|
### What Gets Generated
|
|
49
49
|
|
|
50
50
|
The generator creates TypeScript files for:
|
|
51
|
-
- **Verana modules**: `tr`, `cs`, `dd`, `perm`, `td` (Trust Registry, Credential Schema, DID Directory, Permission, Trust Deposit)
|
|
51
|
+
- **Verana modules**: `tr`, `cs`, `dd`, `perm`, `td`, `de` (Trust Registry, Credential Schema, DID Directory, Permission, Trust Deposit, Delegation Engine)
|
|
52
52
|
- **Cosmos SDK types**: Base types, queries, messages
|
|
53
53
|
- **Google protobuf types**: Timestamps, durations, etc.
|
|
54
54
|
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { AminoConverter } from "@cosmjs/stargate";
|
|
2
|
+
export declare const MsgCreateCredentialSchemaAminoConverter: AminoConverter;
|
|
3
|
+
export declare const MsgUpdateCredentialSchemaAminoConverter: AminoConverter;
|
|
4
|
+
export declare const MsgArchiveCredentialSchemaAminoConverter: AminoConverter;
|
|
5
|
+
export declare const MsgCreateSchemaAuthorizationPolicyAminoConverter: AminoConverter;
|
|
6
|
+
export declare const MsgIncreaseActiveSchemaAuthorizationPolicyVersionAminoConverter: AminoConverter;
|
|
7
|
+
export declare const MsgRevokeSchemaAuthorizationPolicyAminoConverter: AminoConverter;
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MsgRevokeSchemaAuthorizationPolicyAminoConverter = exports.MsgIncreaseActiveSchemaAuthorizationPolicyVersionAminoConverter = exports.MsgCreateSchemaAuthorizationPolicyAminoConverter = exports.MsgArchiveCredentialSchemaAminoConverter = exports.MsgUpdateCredentialSchemaAminoConverter = exports.MsgCreateCredentialSchemaAminoConverter = void 0;
|
|
4
|
+
const tx_1 = require("../codec/verana/cs/v1/tx");
|
|
5
|
+
const helpers_1 = require("./util/helpers");
|
|
6
|
+
exports.MsgCreateCredentialSchemaAminoConverter = {
|
|
7
|
+
aminoType: "verana/x/cs/MsgCreateCredentialSchema",
|
|
8
|
+
toAmino: (m) => {
|
|
9
|
+
var _a, _b, _c, _d, _e, _f;
|
|
10
|
+
return (0, helpers_1.clean)({
|
|
11
|
+
corporation: (_a = m.corporation) !== null && _a !== void 0 ? _a : "",
|
|
12
|
+
operator: (_b = m.operator) !== null && _b !== void 0 ? _b : "",
|
|
13
|
+
tr_id: (0, helpers_1.u64ToStr)(m.trId),
|
|
14
|
+
json_schema: (_c = m.jsonSchema) !== null && _c !== void 0 ? _c : "",
|
|
15
|
+
issuer_grantor_validation_validity_period: (0, helpers_1.toOptU32Amino)(m.issuerGrantorValidationValidityPeriod),
|
|
16
|
+
verifier_grantor_validation_validity_period: (0, helpers_1.toOptU32Amino)(m.verifierGrantorValidationValidityPeriod),
|
|
17
|
+
issuer_validation_validity_period: (0, helpers_1.toOptU32Amino)(m.issuerValidationValidityPeriod),
|
|
18
|
+
verifier_validation_validity_period: (0, helpers_1.toOptU32Amino)(m.verifierValidationValidityPeriod),
|
|
19
|
+
holder_validation_validity_period: (0, helpers_1.toOptU32Amino)(m.holderValidationValidityPeriod),
|
|
20
|
+
issuer_onboarding_mode: (0, helpers_1.u32ToAmino)(m.issuerOnboardingMode),
|
|
21
|
+
verifier_onboarding_mode: (0, helpers_1.u32ToAmino)(m.verifierOnboardingMode),
|
|
22
|
+
holder_onboarding_mode: (0, helpers_1.u32ToAmino)(m.holderOnboardingMode),
|
|
23
|
+
pricing_asset_type: (_d = m.pricingAssetType) !== null && _d !== void 0 ? _d : 0,
|
|
24
|
+
pricing_asset: (_e = m.pricingAsset) !== null && _e !== void 0 ? _e : "",
|
|
25
|
+
digest_algorithm: (_f = m.digestAlgorithm) !== null && _f !== void 0 ? _f : "",
|
|
26
|
+
});
|
|
27
|
+
},
|
|
28
|
+
fromAmino: (a) => {
|
|
29
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
30
|
+
return tx_1.MsgCreateCredentialSchema.fromPartial({
|
|
31
|
+
corporation: (_a = a.corporation) !== null && _a !== void 0 ? _a : "",
|
|
32
|
+
operator: (_b = a.operator) !== null && _b !== void 0 ? _b : "",
|
|
33
|
+
trId: (0, helpers_1.strToU64)(a.tr_id) != null ? Number((0, helpers_1.strToU64)(a.tr_id).toString()) : 0,
|
|
34
|
+
jsonSchema: (_c = a.json_schema) !== null && _c !== void 0 ? _c : "",
|
|
35
|
+
issuerGrantorValidationValidityPeriod: (0, helpers_1.fromOptU32Amino)(a.issuer_grantor_validation_validity_period),
|
|
36
|
+
verifierGrantorValidationValidityPeriod: (0, helpers_1.fromOptU32Amino)(a.verifier_grantor_validation_validity_period),
|
|
37
|
+
issuerValidationValidityPeriod: (0, helpers_1.fromOptU32Amino)(a.issuer_validation_validity_period),
|
|
38
|
+
verifierValidationValidityPeriod: (0, helpers_1.fromOptU32Amino)(a.verifier_validation_validity_period),
|
|
39
|
+
holderValidationValidityPeriod: (0, helpers_1.fromOptU32Amino)(a.holder_validation_validity_period),
|
|
40
|
+
issuerOnboardingMode: (_d = a.issuer_onboarding_mode) !== null && _d !== void 0 ? _d : 0,
|
|
41
|
+
verifierOnboardingMode: (_e = a.verifier_onboarding_mode) !== null && _e !== void 0 ? _e : 0,
|
|
42
|
+
holderOnboardingMode: (_f = a.holder_onboarding_mode) !== null && _f !== void 0 ? _f : 0,
|
|
43
|
+
pricingAssetType: (_g = a.pricing_asset_type) !== null && _g !== void 0 ? _g : 0,
|
|
44
|
+
pricingAsset: (_h = a.pricing_asset) !== null && _h !== void 0 ? _h : "",
|
|
45
|
+
digestAlgorithm: (_j = a.digest_algorithm) !== null && _j !== void 0 ? _j : "",
|
|
46
|
+
});
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
exports.MsgUpdateCredentialSchemaAminoConverter = {
|
|
50
|
+
aminoType: "verana/x/cs/MsgUpdateCredentialSchema",
|
|
51
|
+
toAmino: (m) => {
|
|
52
|
+
var _a, _b;
|
|
53
|
+
return (0, helpers_1.clean)({
|
|
54
|
+
corporation: (_a = m.corporation) !== null && _a !== void 0 ? _a : "",
|
|
55
|
+
operator: (_b = m.operator) !== null && _b !== void 0 ? _b : "",
|
|
56
|
+
id: (0, helpers_1.u64ToStr)(m.id),
|
|
57
|
+
issuer_grantor_validation_validity_period: (0, helpers_1.toOptU32Amino)(m.issuerGrantorValidationValidityPeriod),
|
|
58
|
+
verifier_grantor_validation_validity_period: (0, helpers_1.toOptU32Amino)(m.verifierGrantorValidationValidityPeriod),
|
|
59
|
+
issuer_validation_validity_period: (0, helpers_1.toOptU32Amino)(m.issuerValidationValidityPeriod),
|
|
60
|
+
verifier_validation_validity_period: (0, helpers_1.toOptU32Amino)(m.verifierValidationValidityPeriod),
|
|
61
|
+
holder_validation_validity_period: (0, helpers_1.toOptU32Amino)(m.holderValidationValidityPeriod),
|
|
62
|
+
});
|
|
63
|
+
},
|
|
64
|
+
fromAmino: (a) => {
|
|
65
|
+
var _a, _b;
|
|
66
|
+
return tx_1.MsgUpdateCredentialSchema.fromPartial({
|
|
67
|
+
corporation: (_a = a.corporation) !== null && _a !== void 0 ? _a : "",
|
|
68
|
+
operator: (_b = a.operator) !== null && _b !== void 0 ? _b : "",
|
|
69
|
+
id: (0, helpers_1.strToU64)(a.id) != null ? Number((0, helpers_1.strToU64)(a.id).toString()) : 0,
|
|
70
|
+
issuerGrantorValidationValidityPeriod: (0, helpers_1.fromOptU32Amino)(a.issuer_grantor_validation_validity_period),
|
|
71
|
+
verifierGrantorValidationValidityPeriod: (0, helpers_1.fromOptU32Amino)(a.verifier_grantor_validation_validity_period),
|
|
72
|
+
issuerValidationValidityPeriod: (0, helpers_1.fromOptU32Amino)(a.issuer_validation_validity_period),
|
|
73
|
+
verifierValidationValidityPeriod: (0, helpers_1.fromOptU32Amino)(a.verifier_validation_validity_period),
|
|
74
|
+
holderValidationValidityPeriod: (0, helpers_1.fromOptU32Amino)(a.holder_validation_validity_period),
|
|
75
|
+
});
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
exports.MsgArchiveCredentialSchemaAminoConverter = {
|
|
79
|
+
aminoType: "verana/x/cs/MsgArchiveCredentialSchema",
|
|
80
|
+
toAmino: (m) => {
|
|
81
|
+
var _a, _b, _c;
|
|
82
|
+
return ({
|
|
83
|
+
corporation: (_a = m.corporation) !== null && _a !== void 0 ? _a : "",
|
|
84
|
+
operator: (_b = m.operator) !== null && _b !== void 0 ? _b : "",
|
|
85
|
+
id: (0, helpers_1.u64ToStr)(m.id),
|
|
86
|
+
archive: (_c = m.archive) !== null && _c !== void 0 ? _c : false,
|
|
87
|
+
});
|
|
88
|
+
},
|
|
89
|
+
fromAmino: (a) => {
|
|
90
|
+
var _a;
|
|
91
|
+
return tx_1.MsgArchiveCredentialSchema.fromPartial({
|
|
92
|
+
corporation: a.corporation,
|
|
93
|
+
operator: a.operator,
|
|
94
|
+
id: (0, helpers_1.strToU64)(a.id) != null ? Number((0, helpers_1.strToU64)(a.id).toString()) : 0,
|
|
95
|
+
archive: (_a = a.archive) !== null && _a !== void 0 ? _a : false,
|
|
96
|
+
});
|
|
97
|
+
},
|
|
98
|
+
};
|
|
99
|
+
exports.MsgCreateSchemaAuthorizationPolicyAminoConverter = {
|
|
100
|
+
aminoType: "verana/x/cs/MsgCreateSchemaAuthPolicy",
|
|
101
|
+
// [MOD-CS-MSG-5-1] Spec v4 draft 13: parameters are corporation, operator,
|
|
102
|
+
// schema_id, role, url, digest_sri. effective_from/until are set to null at creation.
|
|
103
|
+
toAmino: (m) => {
|
|
104
|
+
var _a, _b, _c, _d, _e;
|
|
105
|
+
return (0, helpers_1.clean)({
|
|
106
|
+
corporation: (_a = m.corporation) !== null && _a !== void 0 ? _a : "",
|
|
107
|
+
operator: (_b = m.operator) !== null && _b !== void 0 ? _b : "",
|
|
108
|
+
schema_id: (0, helpers_1.u64ToStr)(m.schemaId),
|
|
109
|
+
role: (_c = m.role) !== null && _c !== void 0 ? _c : 0,
|
|
110
|
+
url: (_d = m.url) !== null && _d !== void 0 ? _d : "",
|
|
111
|
+
digest_sri: (_e = m.digestSri) !== null && _e !== void 0 ? _e : "",
|
|
112
|
+
});
|
|
113
|
+
},
|
|
114
|
+
fromAmino: (a) => {
|
|
115
|
+
var _a, _b, _c, _d, _e;
|
|
116
|
+
return tx_1.MsgCreateSchemaAuthorizationPolicy.fromPartial({
|
|
117
|
+
corporation: (_a = a.corporation) !== null && _a !== void 0 ? _a : "",
|
|
118
|
+
operator: (_b = a.operator) !== null && _b !== void 0 ? _b : "",
|
|
119
|
+
schemaId: (0, helpers_1.strToU64)(a.schema_id) != null ? Number((0, helpers_1.strToU64)(a.schema_id).toString()) : 0,
|
|
120
|
+
role: (_c = a.role) !== null && _c !== void 0 ? _c : 0,
|
|
121
|
+
url: (_d = a.url) !== null && _d !== void 0 ? _d : "",
|
|
122
|
+
digestSri: (_e = a.digest_sri) !== null && _e !== void 0 ? _e : "",
|
|
123
|
+
});
|
|
124
|
+
},
|
|
125
|
+
};
|
|
126
|
+
exports.MsgIncreaseActiveSchemaAuthorizationPolicyVersionAminoConverter = {
|
|
127
|
+
aminoType: "verana/x/cs/MsgIncSchemaAuthPolicyVer",
|
|
128
|
+
toAmino: (m) => {
|
|
129
|
+
var _a, _b, _c;
|
|
130
|
+
return ({
|
|
131
|
+
corporation: (_a = m.corporation) !== null && _a !== void 0 ? _a : "",
|
|
132
|
+
operator: (_b = m.operator) !== null && _b !== void 0 ? _b : "",
|
|
133
|
+
schema_id: (0, helpers_1.u64ToStr)(m.schemaId),
|
|
134
|
+
role: (_c = m.role) !== null && _c !== void 0 ? _c : 0,
|
|
135
|
+
});
|
|
136
|
+
},
|
|
137
|
+
fromAmino: (a) => {
|
|
138
|
+
var _a, _b, _c;
|
|
139
|
+
return tx_1.MsgIncreaseActiveSchemaAuthorizationPolicyVersion.fromPartial({
|
|
140
|
+
corporation: (_a = a.corporation) !== null && _a !== void 0 ? _a : "",
|
|
141
|
+
operator: (_b = a.operator) !== null && _b !== void 0 ? _b : "",
|
|
142
|
+
schemaId: (0, helpers_1.strToU64)(a.schema_id) != null ? Number((0, helpers_1.strToU64)(a.schema_id).toString()) : 0,
|
|
143
|
+
role: (_c = a.role) !== null && _c !== void 0 ? _c : 0,
|
|
144
|
+
});
|
|
145
|
+
},
|
|
146
|
+
};
|
|
147
|
+
exports.MsgRevokeSchemaAuthorizationPolicyAminoConverter = {
|
|
148
|
+
aminoType: "verana/x/cs/MsgRevokeSchemaAuthPolicy",
|
|
149
|
+
toAmino: (m) => {
|
|
150
|
+
var _a, _b, _c, _d;
|
|
151
|
+
return ({
|
|
152
|
+
corporation: (_a = m.corporation) !== null && _a !== void 0 ? _a : "",
|
|
153
|
+
operator: (_b = m.operator) !== null && _b !== void 0 ? _b : "",
|
|
154
|
+
schema_id: (0, helpers_1.u64ToStr)(m.schemaId),
|
|
155
|
+
role: (_c = m.role) !== null && _c !== void 0 ? _c : 0,
|
|
156
|
+
version: (_d = m.version) !== null && _d !== void 0 ? _d : 0,
|
|
157
|
+
});
|
|
158
|
+
},
|
|
159
|
+
fromAmino: (a) => {
|
|
160
|
+
var _a, _b, _c, _d;
|
|
161
|
+
return tx_1.MsgRevokeSchemaAuthorizationPolicy.fromPartial({
|
|
162
|
+
corporation: (_a = a.corporation) !== null && _a !== void 0 ? _a : "",
|
|
163
|
+
operator: (_b = a.operator) !== null && _b !== void 0 ? _b : "",
|
|
164
|
+
schemaId: (0, helpers_1.strToU64)(a.schema_id) != null ? Number((0, helpers_1.strToU64)(a.schema_id).toString()) : 0,
|
|
165
|
+
role: (_c = a.role) !== null && _c !== void 0 ? _c : 0,
|
|
166
|
+
version: (_d = a.version) !== null && _d !== void 0 ? _d : 0,
|
|
167
|
+
});
|
|
168
|
+
},
|
|
169
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MsgRevokeOperatorAuthorizationAminoConverter = exports.MsgGrantOperatorAuthorizationAminoConverter = void 0;
|
|
4
|
+
const tx_1 = require("../codec/verana/de/v1/tx");
|
|
5
|
+
const helpers_1 = require("./util/helpers");
|
|
6
|
+
exports.MsgGrantOperatorAuthorizationAminoConverter = {
|
|
7
|
+
aminoType: "verana/x/de/MsgGrantOpAuthorization",
|
|
8
|
+
toAmino: (m) => {
|
|
9
|
+
var _a, _b, _c, _d;
|
|
10
|
+
return (0, helpers_1.clean)({
|
|
11
|
+
corporation: m.corporation || undefined,
|
|
12
|
+
operator: m.operator || undefined,
|
|
13
|
+
grantee: m.grantee || undefined,
|
|
14
|
+
msg_types: ((_a = m.msgTypes) === null || _a === void 0 ? void 0 : _a.length) ? m.msgTypes : undefined,
|
|
15
|
+
expiration: (0, helpers_1.dateToIsoAmino)(m.expiration),
|
|
16
|
+
authz_spend_limit: ((_b = m.authzSpendLimit) === null || _b === void 0 ? void 0 : _b.length) ? m.authzSpendLimit : undefined,
|
|
17
|
+
authz_spend_limit_period: (0, helpers_1.durationToAmino)(m.authzSpendLimitPeriod),
|
|
18
|
+
with_feegrant: m.withFeegrant || undefined,
|
|
19
|
+
feegrant_spend_limit: ((_c = m.feegrantSpendLimit) === null || _c === void 0 ? void 0 : _c.length) ? m.feegrantSpendLimit : undefined,
|
|
20
|
+
feegrant_spend_limit_period: (0, helpers_1.durationToAmino)(m.feegrantSpendLimitPeriod),
|
|
21
|
+
fee_spend_limit: ((_d = m.feeSpendLimit) === null || _d === void 0 ? void 0 : _d.length) ? m.feeSpendLimit : undefined,
|
|
22
|
+
});
|
|
23
|
+
},
|
|
24
|
+
fromAmino: (a) => {
|
|
25
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
26
|
+
return tx_1.MsgGrantOperatorAuthorization.fromPartial({
|
|
27
|
+
corporation: (_a = a.corporation) !== null && _a !== void 0 ? _a : "",
|
|
28
|
+
operator: (_b = a.operator) !== null && _b !== void 0 ? _b : "",
|
|
29
|
+
grantee: (_c = a.grantee) !== null && _c !== void 0 ? _c : "",
|
|
30
|
+
msgTypes: (_d = a.msg_types) !== null && _d !== void 0 ? _d : [],
|
|
31
|
+
expiration: (0, helpers_1.isoToDate)(a.expiration),
|
|
32
|
+
authzSpendLimit: (_e = a.authz_spend_limit) !== null && _e !== void 0 ? _e : [],
|
|
33
|
+
authzSpendLimitPeriod: (0, helpers_1.aminoToDuration)(a.authz_spend_limit_period),
|
|
34
|
+
withFeegrant: (_f = a.with_feegrant) !== null && _f !== void 0 ? _f : false,
|
|
35
|
+
feegrantSpendLimit: (_g = a.feegrant_spend_limit) !== null && _g !== void 0 ? _g : [],
|
|
36
|
+
feegrantSpendLimitPeriod: (0, helpers_1.aminoToDuration)(a.feegrant_spend_limit_period),
|
|
37
|
+
feeSpendLimit: (_h = a.fee_spend_limit) !== null && _h !== void 0 ? _h : [],
|
|
38
|
+
});
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
exports.MsgRevokeOperatorAuthorizationAminoConverter = {
|
|
42
|
+
aminoType: "verana/x/de/MsgRevokeOpAuthorization",
|
|
43
|
+
toAmino: ({ corporation, operator, grantee }) => (0, helpers_1.clean)({
|
|
44
|
+
corporation: corporation || undefined,
|
|
45
|
+
operator: operator || undefined,
|
|
46
|
+
grantee: grantee || undefined,
|
|
47
|
+
}),
|
|
48
|
+
fromAmino: (value) => tx_1.MsgRevokeOperatorAuthorization.fromPartial({
|
|
49
|
+
corporation: value.corporation,
|
|
50
|
+
operator: value.operator,
|
|
51
|
+
grantee: value.grantee,
|
|
52
|
+
}),
|
|
53
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MsgStoreDigestAminoConverter = void 0;
|
|
4
|
+
const tx_1 = require("../codec/verana/di/v1/tx");
|
|
5
|
+
const helpers_1 = require("./util/helpers");
|
|
6
|
+
exports.MsgStoreDigestAminoConverter = {
|
|
7
|
+
aminoType: "verana/x/di/MsgStoreDigest",
|
|
8
|
+
toAmino: (m) => (0, helpers_1.clean)({
|
|
9
|
+
authority: m.authority || undefined,
|
|
10
|
+
operator: m.operator || undefined,
|
|
11
|
+
digest: m.digest || undefined,
|
|
12
|
+
digest_algorithm: m.digestAlgorithm || undefined,
|
|
13
|
+
}),
|
|
14
|
+
fromAmino: (a) => {
|
|
15
|
+
var _a, _b, _c, _d;
|
|
16
|
+
return tx_1.MsgStoreDigest.fromPartial({
|
|
17
|
+
authority: (_a = a.authority) !== null && _a !== void 0 ? _a : "",
|
|
18
|
+
operator: (_b = a.operator) !== null && _b !== void 0 ? _b : "",
|
|
19
|
+
digest: (_c = a.digest) !== null && _c !== void 0 ? _c : "",
|
|
20
|
+
digestAlgorithm: (_d = a.digest_algorithm) !== null && _d !== void 0 ? _d : "",
|
|
21
|
+
});
|
|
22
|
+
},
|
|
23
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { AminoConverter } from "@cosmjs/stargate";
|
|
2
|
+
export declare const MsgCreateRootPermissionAminoConverter: AminoConverter;
|
|
3
|
+
export declare const MsgAdjustPermissionAminoConverter: AminoConverter;
|
|
4
|
+
export declare const MsgRevokePermissionAminoConverter: AminoConverter;
|
|
5
|
+
export declare const MsgStartPermissionVPAminoConverter: AminoConverter;
|
|
6
|
+
export declare const MsgRenewPermissionVPAminoConverter: AminoConverter;
|
|
7
|
+
export declare const MsgSetPermissionVPToValidatedAminoConverter: AminoConverter;
|
|
8
|
+
export declare const MsgCancelPermissionVPLastRequestAminoConverter: AminoConverter;
|
|
9
|
+
export declare const MsgCreateOrUpdatePermissionSessionAminoConverter: AminoConverter;
|
|
10
|
+
export declare const MsgSlashPermissionTrustDepositAminoConverter: AminoConverter;
|
|
11
|
+
export declare const MsgRepayPermissionSlashedTrustDepositAminoConverter: AminoConverter;
|
|
12
|
+
export declare const MsgSelfCreatePermissionAminoConverter: AminoConverter;
|
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MsgSelfCreatePermissionAminoConverter = exports.MsgRepayPermissionSlashedTrustDepositAminoConverter = exports.MsgSlashPermissionTrustDepositAminoConverter = exports.MsgCreateOrUpdatePermissionSessionAminoConverter = exports.MsgCancelPermissionVPLastRequestAminoConverter = exports.MsgSetPermissionVPToValidatedAminoConverter = exports.MsgRenewPermissionVPAminoConverter = exports.MsgStartPermissionVPAminoConverter = exports.MsgRevokePermissionAminoConverter = exports.MsgAdjustPermissionAminoConverter = exports.MsgCreateRootPermissionAminoConverter = void 0;
|
|
4
|
+
const tx_1 = require("../codec/verana/perm/v1/tx");
|
|
5
|
+
const types_1 = require("../codec/verana/perm/v1/types");
|
|
6
|
+
const helpers_1 = require("./util/helpers");
|
|
7
|
+
exports.MsgCreateRootPermissionAminoConverter = {
|
|
8
|
+
aminoType: "verana/x/perm/MsgCreateRootPermission",
|
|
9
|
+
// [MOD-PERM-MSG-7-3] spec v4 draft 13: perm.type is hardcoded to ECOSYSTEM;
|
|
10
|
+
// vs_operator is not set on root permissions.
|
|
11
|
+
toAmino: (m) => {
|
|
12
|
+
var _a, _b, _c;
|
|
13
|
+
return (0, helpers_1.clean)({
|
|
14
|
+
corporation: (_a = m.corporation) !== null && _a !== void 0 ? _a : "",
|
|
15
|
+
operator: (_b = m.operator) !== null && _b !== void 0 ? _b : "",
|
|
16
|
+
schema_id: (0, helpers_1.u64ToStr)(m.schemaId),
|
|
17
|
+
did: (_c = m.did) !== null && _c !== void 0 ? _c : "",
|
|
18
|
+
effective_from: (0, helpers_1.dateToIsoAmino)(m.effectiveFrom),
|
|
19
|
+
effective_until: (0, helpers_1.dateToIsoAmino)(m.effectiveUntil),
|
|
20
|
+
validation_fees: (0, helpers_1.u64ToStr)(m.validationFees),
|
|
21
|
+
issuance_fees: (0, helpers_1.u64ToStr)(m.issuanceFees),
|
|
22
|
+
verification_fees: (0, helpers_1.u64ToStr)(m.verificationFees),
|
|
23
|
+
});
|
|
24
|
+
},
|
|
25
|
+
fromAmino: (a) => {
|
|
26
|
+
var _a, _b, _c;
|
|
27
|
+
return tx_1.MsgCreateRootPermission.fromPartial({
|
|
28
|
+
corporation: (_a = a.corporation) !== null && _a !== void 0 ? _a : "",
|
|
29
|
+
operator: (_b = a.operator) !== null && _b !== void 0 ? _b : "",
|
|
30
|
+
schemaId: (0, helpers_1.strToU64)(a.schema_id) != null ? Number((0, helpers_1.strToU64)(a.schema_id).toString()) : 0,
|
|
31
|
+
did: (_c = a.did) !== null && _c !== void 0 ? _c : "",
|
|
32
|
+
effectiveFrom: (0, helpers_1.isoToDate)(a.effective_from),
|
|
33
|
+
effectiveUntil: (0, helpers_1.isoToDate)(a.effective_until),
|
|
34
|
+
validationFees: (0, helpers_1.strToU64)(a.validation_fees) != null ? Number((0, helpers_1.strToU64)(a.validation_fees).toString()) : 0,
|
|
35
|
+
issuanceFees: (0, helpers_1.strToU64)(a.issuance_fees) != null ? Number((0, helpers_1.strToU64)(a.issuance_fees).toString()) : 0,
|
|
36
|
+
verificationFees: (0, helpers_1.strToU64)(a.verification_fees) != null ? Number((0, helpers_1.strToU64)(a.verification_fees).toString()) : 0,
|
|
37
|
+
});
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
exports.MsgAdjustPermissionAminoConverter = {
|
|
41
|
+
aminoType: "verana/x/perm/MsgAdjustPermission",
|
|
42
|
+
toAmino: (m) => {
|
|
43
|
+
var _a, _b;
|
|
44
|
+
return (0, helpers_1.clean)({
|
|
45
|
+
corporation: (_a = m.corporation) !== null && _a !== void 0 ? _a : "",
|
|
46
|
+
operator: (_b = m.operator) !== null && _b !== void 0 ? _b : "",
|
|
47
|
+
id: (0, helpers_1.u64ToStr)(m.id),
|
|
48
|
+
effective_until: (0, helpers_1.dateToIsoAmino)(m.effectiveUntil),
|
|
49
|
+
});
|
|
50
|
+
},
|
|
51
|
+
fromAmino: (a) => {
|
|
52
|
+
var _a, _b;
|
|
53
|
+
return tx_1.MsgAdjustPermission.fromPartial({
|
|
54
|
+
corporation: (_a = a.corporation) !== null && _a !== void 0 ? _a : "",
|
|
55
|
+
operator: (_b = a.operator) !== null && _b !== void 0 ? _b : "",
|
|
56
|
+
id: (0, helpers_1.strToU64)(a.id) != null ? Number((0, helpers_1.strToU64)(a.id).toString()) : 0,
|
|
57
|
+
effectiveUntil: (0, helpers_1.isoToDate)(a.effective_until),
|
|
58
|
+
});
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
exports.MsgRevokePermissionAminoConverter = {
|
|
62
|
+
aminoType: "verana/x/perm/MsgRevokePermission",
|
|
63
|
+
toAmino: (m) => {
|
|
64
|
+
var _a, _b;
|
|
65
|
+
return (0, helpers_1.clean)({
|
|
66
|
+
corporation: (_a = m.corporation) !== null && _a !== void 0 ? _a : "",
|
|
67
|
+
operator: (_b = m.operator) !== null && _b !== void 0 ? _b : "",
|
|
68
|
+
id: (0, helpers_1.u64ToStr)(m.id),
|
|
69
|
+
});
|
|
70
|
+
},
|
|
71
|
+
fromAmino: (a) => {
|
|
72
|
+
var _a, _b;
|
|
73
|
+
return tx_1.MsgRevokePermission.fromPartial({
|
|
74
|
+
corporation: (_a = a.corporation) !== null && _a !== void 0 ? _a : "",
|
|
75
|
+
operator: (_b = a.operator) !== null && _b !== void 0 ? _b : "",
|
|
76
|
+
id: (0, helpers_1.strToU64)(a.id) != null ? Number((0, helpers_1.strToU64)(a.id).toString()) : 0,
|
|
77
|
+
});
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
exports.MsgStartPermissionVPAminoConverter = {
|
|
81
|
+
aminoType: "verana/x/perm/MsgStartPermissionVP",
|
|
82
|
+
toAmino: (m) => {
|
|
83
|
+
var _a, _b, _c, _d, _e, _f;
|
|
84
|
+
return (0, helpers_1.clean)({
|
|
85
|
+
corporation: (_a = m.corporation) !== null && _a !== void 0 ? _a : "",
|
|
86
|
+
operator: (_b = m.operator) !== null && _b !== void 0 ? _b : "",
|
|
87
|
+
type: (_c = m.type) !== null && _c !== void 0 ? _c : types_1.PermissionType.UNSPECIFIED,
|
|
88
|
+
validator_perm_id: (0, helpers_1.u64ToStr)(m.validatorPermId),
|
|
89
|
+
did: (_d = m.did) !== null && _d !== void 0 ? _d : "",
|
|
90
|
+
validation_fees: m.validationFees ? { value: (0, helpers_1.u64ToStr)(m.validationFees.value) } : undefined,
|
|
91
|
+
issuance_fees: m.issuanceFees ? { value: (0, helpers_1.u64ToStr)(m.issuanceFees.value) } : undefined,
|
|
92
|
+
verification_fees: m.verificationFees ? { value: (0, helpers_1.u64ToStr)(m.verificationFees.value) } : undefined,
|
|
93
|
+
vs_operator: m.vsOperator || undefined,
|
|
94
|
+
vs_operator_authz_enabled: m.vsOperatorAuthzEnabled || undefined,
|
|
95
|
+
vs_operator_authz_spend_limit: (_e = m.vsOperatorAuthzSpendLimit) !== null && _e !== void 0 ? _e : [],
|
|
96
|
+
vs_operator_authz_with_feegrant: m.vsOperatorAuthzWithFeegrant || undefined,
|
|
97
|
+
vs_operator_authz_fee_spend_limit: (_f = m.vsOperatorAuthzFeeSpendLimit) !== null && _f !== void 0 ? _f : [],
|
|
98
|
+
vs_operator_authz_spend_period: (0, helpers_1.durationToAmino)(m.vsOperatorAuthzSpendPeriod),
|
|
99
|
+
});
|
|
100
|
+
},
|
|
101
|
+
fromAmino: (a) => {
|
|
102
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
103
|
+
return tx_1.MsgStartPermissionVP.fromPartial({
|
|
104
|
+
corporation: (_a = a.corporation) !== null && _a !== void 0 ? _a : "",
|
|
105
|
+
operator: (_b = a.operator) !== null && _b !== void 0 ? _b : "",
|
|
106
|
+
type: (_c = a.type) !== null && _c !== void 0 ? _c : types_1.PermissionType.UNSPECIFIED,
|
|
107
|
+
validatorPermId: (0, helpers_1.strToU64)(a.validator_perm_id) != null ? Number((0, helpers_1.strToU64)(a.validator_perm_id).toString()) : 0,
|
|
108
|
+
did: (_d = a.did) !== null && _d !== void 0 ? _d : "",
|
|
109
|
+
validationFees: a.validation_fees ? { value: Number((_e = a.validation_fees.value) !== null && _e !== void 0 ? _e : a.validation_fees) } : undefined,
|
|
110
|
+
issuanceFees: a.issuance_fees ? { value: Number((_f = a.issuance_fees.value) !== null && _f !== void 0 ? _f : a.issuance_fees) } : undefined,
|
|
111
|
+
verificationFees: a.verification_fees ? { value: Number((_g = a.verification_fees.value) !== null && _g !== void 0 ? _g : a.verification_fees) } : undefined,
|
|
112
|
+
vsOperator: (_h = a.vs_operator) !== null && _h !== void 0 ? _h : "",
|
|
113
|
+
vsOperatorAuthzEnabled: (_j = a.vs_operator_authz_enabled) !== null && _j !== void 0 ? _j : false,
|
|
114
|
+
vsOperatorAuthzSpendLimit: (_k = a.vs_operator_authz_spend_limit) !== null && _k !== void 0 ? _k : [],
|
|
115
|
+
vsOperatorAuthzWithFeegrant: (_l = a.vs_operator_authz_with_feegrant) !== null && _l !== void 0 ? _l : false,
|
|
116
|
+
vsOperatorAuthzFeeSpendLimit: (_m = a.vs_operator_authz_fee_spend_limit) !== null && _m !== void 0 ? _m : [],
|
|
117
|
+
vsOperatorAuthzSpendPeriod: (0, helpers_1.aminoToDuration)(a.vs_operator_authz_spend_period),
|
|
118
|
+
});
|
|
119
|
+
},
|
|
120
|
+
};
|
|
121
|
+
exports.MsgRenewPermissionVPAminoConverter = {
|
|
122
|
+
aminoType: "verana/x/perm/MsgRenewPermissionVP",
|
|
123
|
+
// [MOD-PERM-MSG-2-1] spec v4 draft 13 parameters: corporation, operator, id.
|
|
124
|
+
toAmino: (m) => {
|
|
125
|
+
var _a, _b;
|
|
126
|
+
return (0, helpers_1.clean)({
|
|
127
|
+
corporation: (_a = m.corporation) !== null && _a !== void 0 ? _a : "",
|
|
128
|
+
operator: (_b = m.operator) !== null && _b !== void 0 ? _b : "",
|
|
129
|
+
id: (0, helpers_1.u64ToStr)(m.id),
|
|
130
|
+
});
|
|
131
|
+
},
|
|
132
|
+
fromAmino: (a) => {
|
|
133
|
+
var _a, _b;
|
|
134
|
+
return tx_1.MsgRenewPermissionVP.fromPartial({
|
|
135
|
+
corporation: (_a = a.corporation) !== null && _a !== void 0 ? _a : "",
|
|
136
|
+
operator: (_b = a.operator) !== null && _b !== void 0 ? _b : "",
|
|
137
|
+
id: (0, helpers_1.strToU64)(a.id) != null ? Number((0, helpers_1.strToU64)(a.id).toString()) : 0,
|
|
138
|
+
});
|
|
139
|
+
},
|
|
140
|
+
};
|
|
141
|
+
exports.MsgSetPermissionVPToValidatedAminoConverter = {
|
|
142
|
+
aminoType: "verana/x/perm/MsgSetPermVPValidated",
|
|
143
|
+
toAmino: (m) => {
|
|
144
|
+
var _a, _b, _c;
|
|
145
|
+
return (0, helpers_1.clean)({
|
|
146
|
+
corporation: (_a = m.corporation) !== null && _a !== void 0 ? _a : "",
|
|
147
|
+
operator: (_b = m.operator) !== null && _b !== void 0 ? _b : "",
|
|
148
|
+
id: (0, helpers_1.u64ToStr)(m.id),
|
|
149
|
+
effective_until: (0, helpers_1.dateToIsoAmino)(m.effectiveUntil),
|
|
150
|
+
validation_fees: (0, helpers_1.u64ToStr)(m.validationFees),
|
|
151
|
+
issuance_fees: (0, helpers_1.u64ToStr)(m.issuanceFees),
|
|
152
|
+
verification_fees: (0, helpers_1.u64ToStr)(m.verificationFees),
|
|
153
|
+
vp_summary_digest: (_c = m.vpSummaryDigest) !== null && _c !== void 0 ? _c : "",
|
|
154
|
+
issuance_fee_discount: (0, helpers_1.u64ToStr)(m.issuanceFeeDiscount),
|
|
155
|
+
verification_fee_discount: (0, helpers_1.u64ToStr)(m.verificationFeeDiscount),
|
|
156
|
+
});
|
|
157
|
+
},
|
|
158
|
+
fromAmino: (a) => {
|
|
159
|
+
var _a, _b, _c;
|
|
160
|
+
return tx_1.MsgSetPermissionVPToValidated.fromPartial({
|
|
161
|
+
corporation: (_a = a.corporation) !== null && _a !== void 0 ? _a : "",
|
|
162
|
+
operator: (_b = a.operator) !== null && _b !== void 0 ? _b : "",
|
|
163
|
+
id: (0, helpers_1.strToU64)(a.id) != null ? Number((0, helpers_1.strToU64)(a.id).toString()) : 0,
|
|
164
|
+
effectiveUntil: (0, helpers_1.isoToDate)(a.effective_until),
|
|
165
|
+
validationFees: (0, helpers_1.strToU64)(a.validation_fees) != null ? Number((0, helpers_1.strToU64)(a.validation_fees).toString()) : 0,
|
|
166
|
+
issuanceFees: (0, helpers_1.strToU64)(a.issuance_fees) != null ? Number((0, helpers_1.strToU64)(a.issuance_fees).toString()) : 0,
|
|
167
|
+
verificationFees: (0, helpers_1.strToU64)(a.verification_fees) != null ? Number((0, helpers_1.strToU64)(a.verification_fees).toString()) : 0,
|
|
168
|
+
vpSummaryDigest: (_c = a.vp_summary_digest) !== null && _c !== void 0 ? _c : "",
|
|
169
|
+
issuanceFeeDiscount: (0, helpers_1.strToU64)(a.issuance_fee_discount) != null
|
|
170
|
+
? Number((0, helpers_1.strToU64)(a.issuance_fee_discount).toString())
|
|
171
|
+
: 0,
|
|
172
|
+
verificationFeeDiscount: (0, helpers_1.strToU64)(a.verification_fee_discount) != null
|
|
173
|
+
? Number((0, helpers_1.strToU64)(a.verification_fee_discount).toString())
|
|
174
|
+
: 0,
|
|
175
|
+
});
|
|
176
|
+
},
|
|
177
|
+
};
|
|
178
|
+
exports.MsgCancelPermissionVPLastRequestAminoConverter = {
|
|
179
|
+
aminoType: "verana/x/perm/MsgCancelPermVPLastReq",
|
|
180
|
+
toAmino: (m) => {
|
|
181
|
+
var _a, _b;
|
|
182
|
+
return (0, helpers_1.clean)({
|
|
183
|
+
corporation: (_a = m.corporation) !== null && _a !== void 0 ? _a : "",
|
|
184
|
+
operator: (_b = m.operator) !== null && _b !== void 0 ? _b : "",
|
|
185
|
+
id: (0, helpers_1.u64ToStr)(m.id),
|
|
186
|
+
});
|
|
187
|
+
},
|
|
188
|
+
fromAmino: (a) => {
|
|
189
|
+
var _a, _b;
|
|
190
|
+
return tx_1.MsgCancelPermissionVPLastRequest.fromPartial({
|
|
191
|
+
corporation: (_a = a.corporation) !== null && _a !== void 0 ? _a : "",
|
|
192
|
+
operator: (_b = a.operator) !== null && _b !== void 0 ? _b : "",
|
|
193
|
+
id: (0, helpers_1.strToU64)(a.id) != null ? Number((0, helpers_1.strToU64)(a.id).toString()) : 0,
|
|
194
|
+
});
|
|
195
|
+
},
|
|
196
|
+
};
|
|
197
|
+
exports.MsgCreateOrUpdatePermissionSessionAminoConverter = {
|
|
198
|
+
aminoType: "verana/x/perm/MsgCreateOrUpdatePermSess",
|
|
199
|
+
toAmino: (m) => {
|
|
200
|
+
var _a, _b, _c, _d;
|
|
201
|
+
return (0, helpers_1.clean)({
|
|
202
|
+
corporation: (_a = m.corporation) !== null && _a !== void 0 ? _a : "",
|
|
203
|
+
operator: (_b = m.operator) !== null && _b !== void 0 ? _b : "",
|
|
204
|
+
id: (_c = m.id) !== null && _c !== void 0 ? _c : "",
|
|
205
|
+
issuer_perm_id: (0, helpers_1.u64ToStr)(m.issuerPermId),
|
|
206
|
+
verifier_perm_id: (0, helpers_1.u64ToStr)(m.verifierPermId),
|
|
207
|
+
agent_perm_id: (0, helpers_1.u64ToStr)(m.agentPermId),
|
|
208
|
+
wallet_agent_perm_id: (0, helpers_1.u64ToStr)(m.walletAgentPermId),
|
|
209
|
+
digest: (_d = m.digest) !== null && _d !== void 0 ? _d : undefined,
|
|
210
|
+
});
|
|
211
|
+
},
|
|
212
|
+
fromAmino: (a) => {
|
|
213
|
+
var _a, _b, _c, _d;
|
|
214
|
+
return tx_1.MsgCreateOrUpdatePermissionSession.fromPartial({
|
|
215
|
+
corporation: (_a = a.corporation) !== null && _a !== void 0 ? _a : "",
|
|
216
|
+
operator: (_b = a.operator) !== null && _b !== void 0 ? _b : "",
|
|
217
|
+
id: (_c = a.id) !== null && _c !== void 0 ? _c : "",
|
|
218
|
+
issuerPermId: (0, helpers_1.strToU64)(a.issuer_perm_id) != null ? Number((0, helpers_1.strToU64)(a.issuer_perm_id).toString()) : 0,
|
|
219
|
+
verifierPermId: (0, helpers_1.strToU64)(a.verifier_perm_id) != null ? Number((0, helpers_1.strToU64)(a.verifier_perm_id).toString()) : 0,
|
|
220
|
+
agentPermId: (0, helpers_1.strToU64)(a.agent_perm_id) != null ? Number((0, helpers_1.strToU64)(a.agent_perm_id).toString()) : 0,
|
|
221
|
+
walletAgentPermId: (0, helpers_1.strToU64)(a.wallet_agent_perm_id) != null
|
|
222
|
+
? Number((0, helpers_1.strToU64)(a.wallet_agent_perm_id).toString())
|
|
223
|
+
: 0,
|
|
224
|
+
digest: (_d = a.digest) !== null && _d !== void 0 ? _d : "",
|
|
225
|
+
});
|
|
226
|
+
},
|
|
227
|
+
};
|
|
228
|
+
exports.MsgSlashPermissionTrustDepositAminoConverter = {
|
|
229
|
+
aminoType: "verana/x/perm/MsgSlashPermTD",
|
|
230
|
+
// [MOD-PERM-MSG-12-1] spec v4 draft 13 adds mandatory reason.
|
|
231
|
+
toAmino: (m) => {
|
|
232
|
+
var _a, _b, _c;
|
|
233
|
+
return (0, helpers_1.clean)({
|
|
234
|
+
corporation: (_a = m.corporation) !== null && _a !== void 0 ? _a : "",
|
|
235
|
+
operator: (_b = m.operator) !== null && _b !== void 0 ? _b : "",
|
|
236
|
+
id: (0, helpers_1.u64ToStr)(m.id),
|
|
237
|
+
amount: (0, helpers_1.u64ToStr)(m.amount),
|
|
238
|
+
reason: (_c = m.reason) !== null && _c !== void 0 ? _c : "",
|
|
239
|
+
});
|
|
240
|
+
},
|
|
241
|
+
fromAmino: (a) => {
|
|
242
|
+
var _a, _b, _c;
|
|
243
|
+
return tx_1.MsgSlashPermissionTrustDeposit.fromPartial({
|
|
244
|
+
corporation: (_a = a.corporation) !== null && _a !== void 0 ? _a : "",
|
|
245
|
+
operator: (_b = a.operator) !== null && _b !== void 0 ? _b : "",
|
|
246
|
+
id: (0, helpers_1.strToU64)(a.id) != null ? Number((0, helpers_1.strToU64)(a.id).toString()) : 0,
|
|
247
|
+
amount: (0, helpers_1.strToU64)(a.amount) != null ? Number((0, helpers_1.strToU64)(a.amount).toString()) : 0,
|
|
248
|
+
reason: (_c = a.reason) !== null && _c !== void 0 ? _c : "",
|
|
249
|
+
});
|
|
250
|
+
},
|
|
251
|
+
};
|
|
252
|
+
exports.MsgRepayPermissionSlashedTrustDepositAminoConverter = {
|
|
253
|
+
aminoType: "verana/x/perm/MsgRepayPermSlashedTD",
|
|
254
|
+
toAmino: (m) => {
|
|
255
|
+
var _a, _b;
|
|
256
|
+
return (0, helpers_1.clean)({
|
|
257
|
+
corporation: (_a = m.corporation) !== null && _a !== void 0 ? _a : "",
|
|
258
|
+
operator: (_b = m.operator) !== null && _b !== void 0 ? _b : "",
|
|
259
|
+
id: (0, helpers_1.u64ToStr)(m.id),
|
|
260
|
+
});
|
|
261
|
+
},
|
|
262
|
+
fromAmino: (a) => {
|
|
263
|
+
var _a, _b;
|
|
264
|
+
return tx_1.MsgRepayPermissionSlashedTrustDeposit.fromPartial({
|
|
265
|
+
corporation: (_a = a.corporation) !== null && _a !== void 0 ? _a : "",
|
|
266
|
+
operator: (_b = a.operator) !== null && _b !== void 0 ? _b : "",
|
|
267
|
+
id: (0, helpers_1.strToU64)(a.id) != null ? Number((0, helpers_1.strToU64)(a.id).toString()) : 0,
|
|
268
|
+
});
|
|
269
|
+
},
|
|
270
|
+
};
|
|
271
|
+
exports.MsgSelfCreatePermissionAminoConverter = {
|
|
272
|
+
aminoType: "verana/x/perm/MsgSelfCreatePermission",
|
|
273
|
+
toAmino: (m) => {
|
|
274
|
+
var _a, _b, _c, _d, _e, _f;
|
|
275
|
+
return (0, helpers_1.clean)({
|
|
276
|
+
corporation: (_a = m.corporation) !== null && _a !== void 0 ? _a : "",
|
|
277
|
+
operator: (_b = m.operator) !== null && _b !== void 0 ? _b : "",
|
|
278
|
+
type: (_c = m.type) !== null && _c !== void 0 ? _c : 0,
|
|
279
|
+
validator_perm_id: (0, helpers_1.u64ToStr)(m.validatorPermId),
|
|
280
|
+
did: (_d = m.did) !== null && _d !== void 0 ? _d : "",
|
|
281
|
+
effective_from: (0, helpers_1.dateToIsoAmino)(m.effectiveFrom),
|
|
282
|
+
effective_until: (0, helpers_1.dateToIsoAmino)(m.effectiveUntil),
|
|
283
|
+
verification_fees: (0, helpers_1.u64ToStrIfNonZero)(m.verificationFees),
|
|
284
|
+
validation_fees: (0, helpers_1.u64ToStrIfNonZero)(m.validationFees),
|
|
285
|
+
vs_operator: m.vsOperator || undefined,
|
|
286
|
+
vs_operator_authz_enabled: m.vsOperatorAuthzEnabled || undefined,
|
|
287
|
+
vs_operator_authz_spend_limit: (_e = m.vsOperatorAuthzSpendLimit) !== null && _e !== void 0 ? _e : [],
|
|
288
|
+
vs_operator_authz_with_feegrant: m.vsOperatorAuthzWithFeegrant || undefined,
|
|
289
|
+
vs_operator_authz_fee_spend_limit: (_f = m.vsOperatorAuthzFeeSpendLimit) !== null && _f !== void 0 ? _f : [],
|
|
290
|
+
vs_operator_authz_spend_period: (0, helpers_1.durationToAmino)(m.vsOperatorAuthzSpendPeriod),
|
|
291
|
+
});
|
|
292
|
+
},
|
|
293
|
+
fromAmino: (a) => {
|
|
294
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
295
|
+
return tx_1.MsgSelfCreatePermission.fromPartial({
|
|
296
|
+
corporation: (_a = a.corporation) !== null && _a !== void 0 ? _a : "",
|
|
297
|
+
operator: (_b = a.operator) !== null && _b !== void 0 ? _b : "",
|
|
298
|
+
type: (_c = a.type) !== null && _c !== void 0 ? _c : 0,
|
|
299
|
+
validatorPermId: (0, helpers_1.strToU64)(a.validator_perm_id) != null ? Number((0, helpers_1.strToU64)(a.validator_perm_id).toString()) : 0,
|
|
300
|
+
did: (_d = a.did) !== null && _d !== void 0 ? _d : "",
|
|
301
|
+
effectiveFrom: (0, helpers_1.isoToDate)(a.effective_from),
|
|
302
|
+
effectiveUntil: (0, helpers_1.isoToDate)(a.effective_until),
|
|
303
|
+
verificationFees: (0, helpers_1.strToU64)(a.verification_fees) != null ? Number((0, helpers_1.strToU64)(a.verification_fees).toString()) : 0,
|
|
304
|
+
validationFees: (0, helpers_1.strToU64)(a.validation_fees) != null ? Number((0, helpers_1.strToU64)(a.validation_fees).toString()) : 0,
|
|
305
|
+
vsOperator: (_e = a.vs_operator) !== null && _e !== void 0 ? _e : "",
|
|
306
|
+
vsOperatorAuthzEnabled: (_f = a.vs_operator_authz_enabled) !== null && _f !== void 0 ? _f : false,
|
|
307
|
+
vsOperatorAuthzSpendLimit: (_g = a.vs_operator_authz_spend_limit) !== null && _g !== void 0 ? _g : [],
|
|
308
|
+
vsOperatorAuthzWithFeegrant: (_h = a.vs_operator_authz_with_feegrant) !== null && _h !== void 0 ? _h : false,
|
|
309
|
+
vsOperatorAuthzFeeSpendLimit: (_j = a.vs_operator_authz_fee_spend_limit) !== null && _j !== void 0 ? _j : [],
|
|
310
|
+
vsOperatorAuthzSpendPeriod: (0, helpers_1.aminoToDuration)(a.vs_operator_authz_spend_period),
|
|
311
|
+
});
|
|
312
|
+
},
|
|
313
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { AminoConverter } from "@cosmjs/stargate";
|
|
2
|
+
export declare const MsgReclaimTrustDepositYieldAminoConverter: AminoConverter;
|
|
3
|
+
export declare const MsgRepaySlashedTrustDepositAminoConverter: AminoConverter;
|
|
4
|
+
export declare const MsgSlashTrustDepositAminoConverter: AminoConverter;
|