@verana-labs/verana-types 0.10.1-dev.2 → 0.10.1-dev.21
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/co.d.ts +3 -0
- package/dist/amino-converter/co.js +164 -0
- 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 +51 -0
- package/dist/amino-converter/di.d.ts +2 -0
- package/dist/amino-converter/di.js +23 -0
- package/dist/amino-converter/ec.d.ts +4 -0
- package/dist/amino-converter/ec.js +63 -0
- package/dist/amino-converter/gf.d.ts +3 -0
- package/dist/amino-converter/gf.js +48 -0
- package/dist/amino-converter/group.d.ts +3 -0
- package/dist/amino-converter/group.js +91 -0
- package/dist/amino-converter/pp.d.ts +13 -0
- package/dist/amino-converter/pp.js +347 -0
- package/dist/amino-converter/td.d.ts +4 -0
- package/dist/amino-converter/td.js +46 -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 +6 -0
- package/dist/amino-converter/xr.js +106 -0
- package/dist/codec/cosmos/base/v1beta1/coin.d.ts +1 -1
- package/dist/codec/google/protobuf/any.d.ts +143 -0
- package/dist/codec/{verana/dd/v1/params.js → google/protobuf/any.js} +46 -39
- 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/{perm/module → co/module/v1}/module.d.ts +5 -2
- package/dist/codec/verana/{perm/module → co/module/v1}/module.js +2 -2
- package/dist/codec/verana/co/v1/genesis.d.ts +28 -0
- package/dist/codec/verana/{dd → co}/v1/genesis.js +11 -11
- package/dist/codec/verana/co/v1/params.d.ts +29 -0
- package/dist/codec/verana/co/v1/params.js +81 -0
- package/dist/codec/verana/co/v1/query.d.ts +111 -0
- package/dist/codec/verana/{dd → co}/v1/query.js +151 -117
- package/dist/codec/verana/co/v1/tx.d.ts +172 -0
- package/dist/codec/verana/co/v1/tx.js +639 -0
- package/dist/codec/verana/co/v1/types.d.ts +60 -0
- package/dist/codec/verana/co/v1/types.js +384 -0
- package/dist/codec/verana/cs/v1/query.d.ts +57 -5
- package/dist/codec/verana/cs/v1/query.js +297 -38
- package/dist/codec/verana/cs/v1/tx.d.ts +107 -12
- package/dist/codec/verana/cs/v1/tx.js +548 -64
- package/dist/codec/verana/cs/v1/types.d.ts +75 -16
- package/dist/codec/verana/cs/v1/types.js +419 -82
- package/dist/codec/verana/de/v1/genesis.d.ts +7 -0
- package/dist/codec/verana/de/v1/genesis.js +57 -2
- package/dist/codec/verana/de/v1/query.d.ts +109 -3
- package/dist/codec/verana/de/v1/query.js +396 -10
- package/dist/codec/verana/de/v1/tx.d.ts +22 -10
- package/dist/codec/verana/de/v1/tx.js +16 -16
- package/dist/codec/verana/de/v1/types.d.ts +104 -21
- package/dist/codec/verana/de/v1/types.js +313 -83
- package/dist/codec/verana/di/module/v1/module.d.ts +29 -0
- package/dist/codec/verana/di/module/v1/module.js +98 -0
- package/dist/codec/verana/{dd → di}/v1/genesis.d.ts +5 -4
- package/dist/codec/verana/di/v1/genesis.js +119 -0
- 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/di/v1/query.js +349 -0
- 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/{dd → ec}/module/module.d.ts +1 -1
- package/dist/codec/verana/{dd → ec}/module/module.js +2 -2
- package/dist/codec/verana/{tr → ec}/v1/genesis.d.ts +10 -12
- package/dist/codec/verana/{tr → ec}/v1/genesis.js +16 -56
- package/dist/codec/verana/{tr → ec}/v1/params.d.ts +1 -1
- package/dist/codec/verana/{tr → ec}/v1/params.js +2 -2
- package/dist/codec/verana/ec/v1/query.d.ts +109 -0
- package/dist/codec/verana/{tr → ec}/v1/query.js +69 -71
- package/dist/codec/verana/ec/v1/tx.d.ts +152 -0
- package/dist/codec/verana/{dd → ec}/v1/tx.js +218 -216
- package/dist/codec/verana/ec/v1/types.d.ts +67 -0
- package/dist/codec/verana/ec/v1/types.js +422 -0
- package/dist/codec/verana/gf/module/v1/module.d.ts +29 -0
- package/dist/codec/verana/gf/module/v1/module.js +98 -0
- package/dist/codec/verana/gf/v1/genesis.d.ts +29 -0
- package/dist/codec/verana/gf/v1/genesis.js +137 -0
- package/dist/codec/verana/gf/v1/params.d.ts +28 -0
- package/dist/codec/verana/gf/v1/params.js +81 -0
- package/dist/codec/verana/gf/v1/query.d.ts +108 -0
- package/dist/codec/verana/gf/v1/query.js +462 -0
- package/dist/codec/verana/gf/v1/tx.d.ts +142 -0
- package/dist/codec/verana/gf/v1/tx.js +486 -0
- package/dist/codec/verana/{tr → gf}/v1/types.d.ts +18 -51
- package/dist/codec/verana/gf/v1/types.js +477 -0
- package/dist/codec/verana/{tr → pp}/module/module.d.ts +1 -1
- package/dist/codec/verana/{tr → pp}/module/module.js +2 -2
- package/dist/codec/verana/{perm → pp}/v1/genesis.d.ts +9 -9
- package/dist/codec/verana/{perm → pp}/v1/genesis.js +26 -26
- package/dist/codec/verana/{perm → pp}/v1/params.d.ts +1 -1
- package/dist/codec/verana/{perm → pp}/v1/params.js +2 -2
- package/dist/codec/verana/pp/v1/query.d.ts +220 -0
- package/dist/codec/verana/{perm → pp}/v1/query.js +305 -166
- package/dist/codec/verana/pp/v1/tx.d.ts +479 -0
- package/dist/codec/verana/pp/v1/tx.js +2574 -0
- package/dist/codec/verana/pp/v1/types.d.ts +137 -0
- package/dist/codec/verana/{perm → pp}/v1/types.js +312 -354
- package/dist/codec/verana/td/v1/genesis.d.ts +13 -3
- package/dist/codec/verana/td/v1/genesis.js +151 -35
- 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 +24 -10
- package/dist/codec/verana/td/v1/tx.d.ts +26 -40
- package/dist/codec/verana/td/v1/tx.js +80 -190
- package/dist/codec/verana/td/v1/types.d.ts +8 -8
- package/dist/codec/verana/td/v1/types.js +54 -69
- 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 +34 -0
- package/dist/codec/verana/xr/v1/genesis.js +166 -0
- package/dist/codec/verana/{dd → xr}/v1/params.d.ts +4 -3
- package/dist/codec/verana/xr/v1/params.js +104 -0
- package/dist/codec/verana/xr/v1/query.d.ts +166 -0
- package/dist/codec/verana/xr/v1/query.js +817 -0
- package/dist/codec/verana/xr/v1/tx.d.ts +284 -0
- package/dist/codec/verana/xr/v1/tx.js +1298 -0
- package/dist/helpers/aminoConverters.d.ts +10 -32
- package/dist/helpers/aminoConverters.js +23 -589
- package/dist/index.d.ts +11 -1
- package/dist/index.js +11 -1
- package/dist/signing.d.ts +75 -0
- package/dist/signing.js +147 -0
- package/package.json +32 -6
- 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/types.d.ts +0 -30
- package/dist/codec/verana/dd/v1/types.js +0 -206
- package/dist/codec/verana/perm/v1/query.d.ts +0 -209
- package/dist/codec/verana/perm/v1/tx.d.ts +0 -395
- package/dist/codec/verana/perm/v1/tx.js +0 -1995
- package/dist/codec/verana/perm/v1/types.d.ts +0 -134
- package/dist/codec/verana/tr/v1/query.d.ts +0 -118
- package/dist/codec/verana/tr/v1/tx.d.ts +0 -255
- package/dist/codec/verana/tr/v1/tx.js +0 -956
- package/dist/codec/verana/tr/v1/types.js +0 -839
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,164 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MsgUpdateCorporationAminoConverter = exports.MsgCreateCorporationAminoConverter = void 0;
|
|
4
|
+
const any_1 = require("../codec/google/protobuf/any");
|
|
5
|
+
const tx_1 = require("../codec/verana/co/v1/tx");
|
|
6
|
+
const types_1 = require("cosmjs-types/cosmos/group/v1/types");
|
|
7
|
+
const helpers_1 = require("./util/helpers");
|
|
8
|
+
// Members serialize as plain objects in amino.
|
|
9
|
+
function memberToAmino(m) {
|
|
10
|
+
return (0, helpers_1.clean)({
|
|
11
|
+
address: m.address || undefined,
|
|
12
|
+
weight: m.weight || undefined,
|
|
13
|
+
metadata: m.metadata || undefined,
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
function memberFromAmino(a) {
|
|
17
|
+
var _a, _b, _c;
|
|
18
|
+
return tx_1.Member.fromPartial({
|
|
19
|
+
address: (_a = a.address) !== null && _a !== void 0 ? _a : "",
|
|
20
|
+
weight: (_b = a.weight) !== null && _b !== void 0 ? _b : "",
|
|
21
|
+
metadata: (_c = a.metadata) !== null && _c !== void 0 ? _c : "",
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
// Convert a proto Duration ({ seconds: bigint, nanos: number }) to the amino
|
|
25
|
+
// nanosecond integer string that Go amino produces for time.Duration fields.
|
|
26
|
+
function durationToNanosStr(d) {
|
|
27
|
+
var _a, _b;
|
|
28
|
+
if (!d)
|
|
29
|
+
return "0";
|
|
30
|
+
const secs = (_a = d.seconds) !== null && _a !== void 0 ? _a : BigInt(0);
|
|
31
|
+
const nanos = (_b = d.nanos) !== null && _b !== void 0 ? _b : 0;
|
|
32
|
+
return String(secs * BigInt(1000000000) + BigInt(nanos));
|
|
33
|
+
}
|
|
34
|
+
function nanosStrToDuration(ns) {
|
|
35
|
+
const n = BigInt(ns !== null && ns !== void 0 ? ns : "0");
|
|
36
|
+
return { seconds: n / BigInt(1000000000), nanos: Number(n % BigInt(1000000000)) };
|
|
37
|
+
}
|
|
38
|
+
// decision_policy is a google.protobuf.Any wrapping a cosmos x/group decision
|
|
39
|
+
// policy. The Go amino codec encodes it as:
|
|
40
|
+
// {"type": "cosmos-sdk/ThresholdDecisionPolicy", "value": { ... amino fields ... }}
|
|
41
|
+
// where Duration fields are encoded as nanosecond integer strings.
|
|
42
|
+
function anyToAmino(a) {
|
|
43
|
+
if (!a)
|
|
44
|
+
return undefined;
|
|
45
|
+
if (a.typeUrl === "/cosmos.group.v1.ThresholdDecisionPolicy") {
|
|
46
|
+
const dp = types_1.ThresholdDecisionPolicy.decode(a.value);
|
|
47
|
+
return (0, helpers_1.clean)({
|
|
48
|
+
type: "cosmos-sdk/ThresholdDecisionPolicy",
|
|
49
|
+
value: (0, helpers_1.clean)({
|
|
50
|
+
threshold: dp.threshold || undefined,
|
|
51
|
+
windows: dp.windows
|
|
52
|
+
? {
|
|
53
|
+
voting_period: durationToNanosStr(dp.windows.votingPeriod),
|
|
54
|
+
min_execution_period: durationToNanosStr(dp.windows.minExecutionPeriod),
|
|
55
|
+
}
|
|
56
|
+
: undefined,
|
|
57
|
+
}),
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
if (a.typeUrl === "/cosmos.group.v1.PercentageDecisionPolicy") {
|
|
61
|
+
const dp = types_1.PercentageDecisionPolicy.decode(a.value);
|
|
62
|
+
return (0, helpers_1.clean)({
|
|
63
|
+
type: "cosmos-sdk/PercentageDecisionPolicy",
|
|
64
|
+
value: (0, helpers_1.clean)({
|
|
65
|
+
percentage: dp.percentage || undefined,
|
|
66
|
+
windows: dp.windows
|
|
67
|
+
? {
|
|
68
|
+
voting_period: durationToNanosStr(dp.windows.votingPeriod),
|
|
69
|
+
min_execution_period: durationToNanosStr(dp.windows.minExecutionPeriod),
|
|
70
|
+
}
|
|
71
|
+
: undefined,
|
|
72
|
+
}),
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
// Fallback for unknown Any types.
|
|
76
|
+
return (0, helpers_1.clean)({
|
|
77
|
+
type: a.typeUrl || undefined,
|
|
78
|
+
value: a.value && a.value.length > 0 ? Buffer.from(a.value).toString("base64") : undefined,
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
function anyFromAmino(v) {
|
|
82
|
+
var _a, _b, _c, _d, _e;
|
|
83
|
+
if (!v)
|
|
84
|
+
return any_1.Any.fromPartial({ typeUrl: "", value: new Uint8Array() });
|
|
85
|
+
if (v.type === "cosmos-sdk/ThresholdDecisionPolicy") {
|
|
86
|
+
const val = (_a = v.value) !== null && _a !== void 0 ? _a : {};
|
|
87
|
+
const dp = types_1.ThresholdDecisionPolicy.fromPartial({
|
|
88
|
+
threshold: (_b = val.threshold) !== null && _b !== void 0 ? _b : "",
|
|
89
|
+
windows: val.windows
|
|
90
|
+
? {
|
|
91
|
+
votingPeriod: nanosStrToDuration(val.windows.voting_period),
|
|
92
|
+
minExecutionPeriod: nanosStrToDuration(val.windows.min_execution_period),
|
|
93
|
+
}
|
|
94
|
+
: undefined,
|
|
95
|
+
});
|
|
96
|
+
return any_1.Any.fromPartial({
|
|
97
|
+
typeUrl: "/cosmos.group.v1.ThresholdDecisionPolicy",
|
|
98
|
+
value: types_1.ThresholdDecisionPolicy.encode(dp).finish(),
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
if (v.type === "cosmos-sdk/PercentageDecisionPolicy") {
|
|
102
|
+
const val = (_c = v.value) !== null && _c !== void 0 ? _c : {};
|
|
103
|
+
const dp = types_1.PercentageDecisionPolicy.fromPartial({
|
|
104
|
+
percentage: (_d = val.percentage) !== null && _d !== void 0 ? _d : "",
|
|
105
|
+
windows: val.windows
|
|
106
|
+
? {
|
|
107
|
+
votingPeriod: nanosStrToDuration(val.windows.voting_period),
|
|
108
|
+
minExecutionPeriod: nanosStrToDuration(val.windows.min_execution_period),
|
|
109
|
+
}
|
|
110
|
+
: undefined,
|
|
111
|
+
});
|
|
112
|
+
return any_1.Any.fromPartial({
|
|
113
|
+
typeUrl: "/cosmos.group.v1.PercentageDecisionPolicy",
|
|
114
|
+
value: types_1.PercentageDecisionPolicy.encode(dp).finish(),
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
// Fallback: treat value as base64-encoded proto bytes.
|
|
118
|
+
const bytes = v.value ? new Uint8Array(Buffer.from(v.value, "base64")) : new Uint8Array();
|
|
119
|
+
return any_1.Any.fromPartial({ typeUrl: (_e = v.type) !== null && _e !== void 0 ? _e : "", value: bytes });
|
|
120
|
+
}
|
|
121
|
+
exports.MsgCreateCorporationAminoConverter = {
|
|
122
|
+
aminoType: "verana/x/co/MsgCreateCorporation",
|
|
123
|
+
toAmino: (m) => (0, helpers_1.clean)({
|
|
124
|
+
signer: m.signer || undefined,
|
|
125
|
+
members: m.members && m.members.length > 0 ? m.members.map(memberToAmino) : undefined,
|
|
126
|
+
group_metadata: m.groupMetadata || undefined,
|
|
127
|
+
group_policy_metadata: m.groupPolicyMetadata || undefined,
|
|
128
|
+
decision_policy: anyToAmino(m.decisionPolicy),
|
|
129
|
+
did: m.did || undefined,
|
|
130
|
+
language: m.language || undefined,
|
|
131
|
+
doc_url: m.docUrl || undefined,
|
|
132
|
+
doc_digest_sri: m.docDigestSri || undefined,
|
|
133
|
+
}),
|
|
134
|
+
fromAmino: (a) => {
|
|
135
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
136
|
+
return tx_1.MsgCreateCorporation.fromPartial({
|
|
137
|
+
signer: (_a = a.signer) !== null && _a !== void 0 ? _a : "",
|
|
138
|
+
members: Array.isArray(a.members) ? a.members.map(memberFromAmino) : [],
|
|
139
|
+
groupMetadata: (_b = a.group_metadata) !== null && _b !== void 0 ? _b : "",
|
|
140
|
+
groupPolicyMetadata: (_c = a.group_policy_metadata) !== null && _c !== void 0 ? _c : "",
|
|
141
|
+
decisionPolicy: anyFromAmino(a.decision_policy),
|
|
142
|
+
did: (_d = a.did) !== null && _d !== void 0 ? _d : "",
|
|
143
|
+
language: (_e = a.language) !== null && _e !== void 0 ? _e : "",
|
|
144
|
+
docUrl: (_f = a.doc_url) !== null && _f !== void 0 ? _f : "",
|
|
145
|
+
docDigestSri: (_g = a.doc_digest_sri) !== null && _g !== void 0 ? _g : "",
|
|
146
|
+
});
|
|
147
|
+
},
|
|
148
|
+
};
|
|
149
|
+
exports.MsgUpdateCorporationAminoConverter = {
|
|
150
|
+
aminoType: "verana/x/co/MsgUpdateCorporation",
|
|
151
|
+
toAmino: ({ corporation, operator, did }) => (0, helpers_1.clean)({
|
|
152
|
+
corporation: corporation || undefined,
|
|
153
|
+
operator: operator || undefined,
|
|
154
|
+
did: did || undefined,
|
|
155
|
+
}),
|
|
156
|
+
fromAmino: (value) => {
|
|
157
|
+
var _a, _b, _c;
|
|
158
|
+
return tx_1.MsgUpdateCorporation.fromPartial({
|
|
159
|
+
corporation: (_a = value.corporation) !== null && _a !== void 0 ? _a : "",
|
|
160
|
+
operator: (_b = value.operator) !== null && _b !== void 0 ? _b : "",
|
|
161
|
+
did: (_c = value.did) !== null && _c !== void 0 ? _c : "",
|
|
162
|
+
});
|
|
163
|
+
},
|
|
164
|
+
};
|
|
@@ -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
|
+
ecosystem_id: (0, helpers_1.u64ToStr)(m.ecosystemId),
|
|
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
|
+
ecosystemId: (0, helpers_1.strToU64)(a.ecosystem_id) != null ? Number((0, helpers_1.strToU64)(a.ecosystem_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,51 @@
|
|
|
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;
|
|
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
|
+
});
|
|
22
|
+
},
|
|
23
|
+
fromAmino: (a) => {
|
|
24
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
25
|
+
return tx_1.MsgGrantOperatorAuthorization.fromPartial({
|
|
26
|
+
corporation: (_a = a.corporation) !== null && _a !== void 0 ? _a : "",
|
|
27
|
+
operator: (_b = a.operator) !== null && _b !== void 0 ? _b : "",
|
|
28
|
+
grantee: (_c = a.grantee) !== null && _c !== void 0 ? _c : "",
|
|
29
|
+
msgTypes: (_d = a.msg_types) !== null && _d !== void 0 ? _d : [],
|
|
30
|
+
expiration: (0, helpers_1.isoToDate)(a.expiration),
|
|
31
|
+
authzSpendLimit: (_e = a.authz_spend_limit) !== null && _e !== void 0 ? _e : [],
|
|
32
|
+
authzSpendLimitPeriod: (0, helpers_1.aminoToDuration)(a.authz_spend_limit_period),
|
|
33
|
+
withFeegrant: (_f = a.with_feegrant) !== null && _f !== void 0 ? _f : false,
|
|
34
|
+
feegrantSpendLimit: (_g = a.feegrant_spend_limit) !== null && _g !== void 0 ? _g : [],
|
|
35
|
+
feegrantSpendLimitPeriod: (0, helpers_1.aminoToDuration)(a.feegrant_spend_limit_period),
|
|
36
|
+
});
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
exports.MsgRevokeOperatorAuthorizationAminoConverter = {
|
|
40
|
+
aminoType: "verana/x/de/MsgRevokeOpAuthorization",
|
|
41
|
+
toAmino: ({ corporation, operator, grantee }) => (0, helpers_1.clean)({
|
|
42
|
+
corporation: corporation || undefined,
|
|
43
|
+
operator: operator || undefined,
|
|
44
|
+
grantee: grantee || undefined,
|
|
45
|
+
}),
|
|
46
|
+
fromAmino: (value) => tx_1.MsgRevokeOperatorAuthorization.fromPartial({
|
|
47
|
+
corporation: value.corporation,
|
|
48
|
+
operator: value.operator,
|
|
49
|
+
grantee: value.grantee,
|
|
50
|
+
}),
|
|
51
|
+
};
|
|
@@ -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,4 @@
|
|
|
1
|
+
import type { AminoConverter } from "@cosmjs/stargate";
|
|
2
|
+
export declare const MsgCreateEcosystemAminoConverter: AminoConverter;
|
|
3
|
+
export declare const MsgUpdateEcosystemAminoConverter: AminoConverter;
|
|
4
|
+
export declare const MsgArchiveEcosystemAminoConverter: AminoConverter;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MsgArchiveEcosystemAminoConverter = exports.MsgUpdateEcosystemAminoConverter = exports.MsgCreateEcosystemAminoConverter = void 0;
|
|
4
|
+
const tx_1 = require("../codec/verana/ec/v1/tx");
|
|
5
|
+
const helpers_1 = require("./util/helpers");
|
|
6
|
+
exports.MsgCreateEcosystemAminoConverter = {
|
|
7
|
+
aminoType: "verana/x/ec/MsgCreateEcosystem",
|
|
8
|
+
toAmino: ({ corporation, operator, did, language, docUrl, docDigestSri }) => (0, helpers_1.clean)({
|
|
9
|
+
corporation: corporation || undefined,
|
|
10
|
+
operator: operator || undefined,
|
|
11
|
+
did: did || undefined,
|
|
12
|
+
language: language || undefined,
|
|
13
|
+
doc_url: docUrl || undefined,
|
|
14
|
+
doc_digest_sri: docDigestSri || undefined,
|
|
15
|
+
}),
|
|
16
|
+
fromAmino: (value) => {
|
|
17
|
+
var _a, _b, _c, _d, _e, _f;
|
|
18
|
+
return tx_1.MsgCreateEcosystem.fromPartial({
|
|
19
|
+
corporation: (_a = value.corporation) !== null && _a !== void 0 ? _a : "",
|
|
20
|
+
operator: (_b = value.operator) !== null && _b !== void 0 ? _b : "",
|
|
21
|
+
did: (_c = value.did) !== null && _c !== void 0 ? _c : "",
|
|
22
|
+
language: (_d = value.language) !== null && _d !== void 0 ? _d : "",
|
|
23
|
+
docUrl: (_e = value.doc_url) !== null && _e !== void 0 ? _e : "",
|
|
24
|
+
docDigestSri: (_f = value.doc_digest_sri) !== null && _f !== void 0 ? _f : "",
|
|
25
|
+
});
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
exports.MsgUpdateEcosystemAminoConverter = {
|
|
29
|
+
aminoType: "verana/x/ec/MsgUpdateEcosystem",
|
|
30
|
+
toAmino: ({ corporation, operator, id, did }) => (0, helpers_1.clean)({
|
|
31
|
+
corporation: corporation || undefined,
|
|
32
|
+
operator: operator || undefined,
|
|
33
|
+
id: (0, helpers_1.u64ToStr)(id),
|
|
34
|
+
did: did || undefined,
|
|
35
|
+
}),
|
|
36
|
+
fromAmino: (value) => {
|
|
37
|
+
var _a, _b, _c;
|
|
38
|
+
return tx_1.MsgUpdateEcosystem.fromPartial({
|
|
39
|
+
corporation: (_a = value.corporation) !== null && _a !== void 0 ? _a : "",
|
|
40
|
+
operator: (_b = value.operator) !== null && _b !== void 0 ? _b : "",
|
|
41
|
+
id: value.id != null ? Number(value.id) : 0,
|
|
42
|
+
did: (_c = value.did) !== null && _c !== void 0 ? _c : "",
|
|
43
|
+
});
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
exports.MsgArchiveEcosystemAminoConverter = {
|
|
47
|
+
aminoType: "verana/x/ec/MsgArchiveEcosystem",
|
|
48
|
+
toAmino: ({ corporation, operator, id, archive }) => (0, helpers_1.clean)({
|
|
49
|
+
corporation: corporation || undefined,
|
|
50
|
+
operator: operator || undefined,
|
|
51
|
+
id: (0, helpers_1.u64ToStr)(id),
|
|
52
|
+
archive: archive,
|
|
53
|
+
}),
|
|
54
|
+
fromAmino: (value) => {
|
|
55
|
+
var _a, _b, _c;
|
|
56
|
+
return tx_1.MsgArchiveEcosystem.fromPartial({
|
|
57
|
+
corporation: (_a = value.corporation) !== null && _a !== void 0 ? _a : "",
|
|
58
|
+
operator: (_b = value.operator) !== null && _b !== void 0 ? _b : "",
|
|
59
|
+
id: value.id != null ? Number(value.id) : 0,
|
|
60
|
+
archive: (_c = value.archive) !== null && _c !== void 0 ? _c : false,
|
|
61
|
+
});
|
|
62
|
+
},
|
|
63
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MsgIncreaseActiveGovernanceFrameworkVersionAminoConverter = exports.MsgAddGovernanceFrameworkDocumentAminoConverter = void 0;
|
|
4
|
+
const tx_1 = require("../codec/verana/gf/v1/tx");
|
|
5
|
+
const helpers_1 = require("./util/helpers");
|
|
6
|
+
// MOD-GF Msgs extracted from x/tr in v4-rc2. ecosystem_id is the optional
|
|
7
|
+
// polymorphic subject discriminator: when zero/absent, the target is the
|
|
8
|
+
// signing corporation's own CGF; when set, the target is that Ecosystem.
|
|
9
|
+
exports.MsgAddGovernanceFrameworkDocumentAminoConverter = {
|
|
10
|
+
aminoType: "verana/x/gf/MsgAddGovernanceFrameworkDocument",
|
|
11
|
+
toAmino: ({ corporation, operator, ecosystemId, docLanguage, docUrl, docDigestSri, version, }) => (0, helpers_1.clean)({
|
|
12
|
+
corporation: corporation || undefined,
|
|
13
|
+
operator: operator || undefined,
|
|
14
|
+
ecosystem_id: (0, helpers_1.u64ToStr)(ecosystemId),
|
|
15
|
+
doc_language: docLanguage || undefined,
|
|
16
|
+
doc_url: docUrl || undefined,
|
|
17
|
+
doc_digest_sri: docDigestSri || undefined,
|
|
18
|
+
version: version || undefined,
|
|
19
|
+
}),
|
|
20
|
+
fromAmino: (value) => {
|
|
21
|
+
var _a, _b, _c, _d, _e, _f;
|
|
22
|
+
return tx_1.MsgAddGovernanceFrameworkDocument.fromPartial({
|
|
23
|
+
corporation: (_a = value.corporation) !== null && _a !== void 0 ? _a : "",
|
|
24
|
+
operator: (_b = value.operator) !== null && _b !== void 0 ? _b : "",
|
|
25
|
+
ecosystemId: value.ecosystem_id != null ? Number(value.ecosystem_id) : 0,
|
|
26
|
+
docLanguage: (_c = value.doc_language) !== null && _c !== void 0 ? _c : "",
|
|
27
|
+
docUrl: (_d = value.doc_url) !== null && _d !== void 0 ? _d : "",
|
|
28
|
+
docDigestSri: (_e = value.doc_digest_sri) !== null && _e !== void 0 ? _e : "",
|
|
29
|
+
version: (_f = value.version) !== null && _f !== void 0 ? _f : 0,
|
|
30
|
+
});
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
exports.MsgIncreaseActiveGovernanceFrameworkVersionAminoConverter = {
|
|
34
|
+
aminoType: "verana/x/gf/MsgIncreaseActiveGovernanceFrameworkVersion",
|
|
35
|
+
toAmino: ({ corporation, operator, ecosystemId }) => (0, helpers_1.clean)({
|
|
36
|
+
corporation: corporation || undefined,
|
|
37
|
+
operator: operator || undefined,
|
|
38
|
+
ecosystem_id: (0, helpers_1.u64ToStr)(ecosystemId),
|
|
39
|
+
}),
|
|
40
|
+
fromAmino: (value) => {
|
|
41
|
+
var _a, _b;
|
|
42
|
+
return tx_1.MsgIncreaseActiveGovernanceFrameworkVersion.fromPartial({
|
|
43
|
+
corporation: (_a = value.corporation) !== null && _a !== void 0 ? _a : "",
|
|
44
|
+
operator: (_b = value.operator) !== null && _b !== void 0 ? _b : "",
|
|
45
|
+
ecosystemId: value.ecosystem_id != null ? Number(value.ecosystem_id) : 0,
|
|
46
|
+
});
|
|
47
|
+
},
|
|
48
|
+
};
|