@verana-labs/verana-types 0.10.1-dev.10 → 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.
|
@@ -6,9 +6,10 @@ const types_1 = require("../codec/verana/perm/v1/types");
|
|
|
6
6
|
const helpers_1 = require("./util/helpers");
|
|
7
7
|
exports.MsgCreateRootPermissionAminoConverter = {
|
|
8
8
|
aminoType: "verana/x/perm/MsgCreateRootPermission",
|
|
9
|
-
// [MOD-PERM-MSG-7-
|
|
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.
|
|
10
11
|
toAmino: (m) => {
|
|
11
|
-
var _a, _b, _c
|
|
12
|
+
var _a, _b, _c;
|
|
12
13
|
return (0, helpers_1.clean)({
|
|
13
14
|
corporation: (_a = m.corporation) !== null && _a !== void 0 ? _a : "",
|
|
14
15
|
operator: (_b = m.operator) !== null && _b !== void 0 ? _b : "",
|
|
@@ -19,12 +20,10 @@ exports.MsgCreateRootPermissionAminoConverter = {
|
|
|
19
20
|
validation_fees: (0, helpers_1.u64ToStr)(m.validationFees),
|
|
20
21
|
issuance_fees: (0, helpers_1.u64ToStr)(m.issuanceFees),
|
|
21
22
|
verification_fees: (0, helpers_1.u64ToStr)(m.verificationFees),
|
|
22
|
-
permission_type: (_d = m.permissionType) !== null && _d !== void 0 ? _d : 0,
|
|
23
|
-
vs_operator: (_e = m.vsOperator) !== null && _e !== void 0 ? _e : "",
|
|
24
23
|
});
|
|
25
24
|
},
|
|
26
25
|
fromAmino: (a) => {
|
|
27
|
-
var _a, _b, _c
|
|
26
|
+
var _a, _b, _c;
|
|
28
27
|
return tx_1.MsgCreateRootPermission.fromPartial({
|
|
29
28
|
corporation: (_a = a.corporation) !== null && _a !== void 0 ? _a : "",
|
|
30
29
|
operator: (_b = a.operator) !== null && _b !== void 0 ? _b : "",
|
|
@@ -35,8 +34,6 @@ exports.MsgCreateRootPermissionAminoConverter = {
|
|
|
35
34
|
validationFees: (0, helpers_1.strToU64)(a.validation_fees) != null ? Number((0, helpers_1.strToU64)(a.validation_fees).toString()) : 0,
|
|
36
35
|
issuanceFees: (0, helpers_1.strToU64)(a.issuance_fees) != null ? Number((0, helpers_1.strToU64)(a.issuance_fees).toString()) : 0,
|
|
37
36
|
verificationFees: (0, helpers_1.strToU64)(a.verification_fees) != null ? Number((0, helpers_1.strToU64)(a.verification_fees).toString()) : 0,
|
|
38
|
-
permissionType: (_d = a.permission_type) !== null && _d !== void 0 ? _d : 0,
|
|
39
|
-
vsOperator: (_e = a.vs_operator) !== null && _e !== void 0 ? _e : "",
|
|
40
37
|
});
|
|
41
38
|
},
|
|
42
39
|
};
|
|
@@ -123,23 +120,21 @@ exports.MsgStartPermissionVPAminoConverter = {
|
|
|
123
120
|
};
|
|
124
121
|
exports.MsgRenewPermissionVPAminoConverter = {
|
|
125
122
|
aminoType: "verana/x/perm/MsgRenewPermissionVP",
|
|
126
|
-
// [MOD-PERM-MSG-2-1] spec v4 draft 13
|
|
123
|
+
// [MOD-PERM-MSG-2-1] spec v4 draft 13 parameters: corporation, operator, id.
|
|
127
124
|
toAmino: (m) => {
|
|
128
|
-
var _a, _b
|
|
125
|
+
var _a, _b;
|
|
129
126
|
return (0, helpers_1.clean)({
|
|
130
127
|
corporation: (_a = m.corporation) !== null && _a !== void 0 ? _a : "",
|
|
131
128
|
operator: (_b = m.operator) !== null && _b !== void 0 ? _b : "",
|
|
132
129
|
id: (0, helpers_1.u64ToStr)(m.id),
|
|
133
|
-
permission_type: (_c = m.permissionType) !== null && _c !== void 0 ? _c : 0,
|
|
134
130
|
});
|
|
135
131
|
},
|
|
136
132
|
fromAmino: (a) => {
|
|
137
|
-
var _a, _b
|
|
133
|
+
var _a, _b;
|
|
138
134
|
return tx_1.MsgRenewPermissionVP.fromPartial({
|
|
139
135
|
corporation: (_a = a.corporation) !== null && _a !== void 0 ? _a : "",
|
|
140
136
|
operator: (_b = a.operator) !== null && _b !== void 0 ? _b : "",
|
|
141
137
|
id: (0, helpers_1.strToU64)(a.id) != null ? Number((0, helpers_1.strToU64)(a.id).toString()) : 0,
|
|
142
|
-
permissionType: (_c = a.permission_type) !== null && _c !== void 0 ? _c : 0,
|
|
143
138
|
});
|
|
144
139
|
},
|
|
145
140
|
};
|
|
@@ -48,15 +48,11 @@ export interface MsgStartPermissionVPResponse {
|
|
|
48
48
|
}
|
|
49
49
|
/** MsgRenewPermissionVP represents a message to renew a permission validation process */
|
|
50
50
|
export interface MsgRenewPermissionVP {
|
|
51
|
+
/** [MOD-PERM-MSG-2-1] Spec v4 draft 13 parameters: corporation, operator, id. */
|
|
51
52
|
corporation: string;
|
|
52
53
|
operator: string;
|
|
53
54
|
/** ID of the permission to renew */
|
|
54
55
|
id: number;
|
|
55
|
-
/**
|
|
56
|
-
* [MOD-PERM-MSG-2-1] permission_type mandatory per spec v4 draft 13.
|
|
57
|
-
* Must match the existing permission's type.
|
|
58
|
-
*/
|
|
59
|
-
permissionType: PermissionType;
|
|
60
56
|
}
|
|
61
57
|
/** MsgRenewPermissionVPResponse defines the Msg/RenewPermissionVP response type */
|
|
62
58
|
export interface MsgRenewPermissionVPResponse {
|
|
@@ -95,6 +91,11 @@ export interface MsgCancelPermissionVPLastRequest {
|
|
|
95
91
|
export interface MsgCancelPermissionVPLastRequestResponse {
|
|
96
92
|
}
|
|
97
93
|
export interface MsgCreateRootPermission {
|
|
94
|
+
/**
|
|
95
|
+
* [MOD-PERM-MSG-7-1] Spec v4 draft 13 parameters.
|
|
96
|
+
* perm.type is hardcoded to ECOSYSTEM by the handler per [MOD-PERM-MSG-7-3];
|
|
97
|
+
* vs_operator is not set on root permissions.
|
|
98
|
+
*/
|
|
98
99
|
corporation: string;
|
|
99
100
|
operator: string;
|
|
100
101
|
schemaId: number;
|
|
@@ -104,13 +105,6 @@ export interface MsgCreateRootPermission {
|
|
|
104
105
|
validationFees: number;
|
|
105
106
|
issuanceFees: number;
|
|
106
107
|
verificationFees: number;
|
|
107
|
-
/**
|
|
108
|
-
* [MOD-PERM-MSG-7-1] permission_type mandatory per spec v4 draft 13:
|
|
109
|
-
* one of ISSUER, VERIFIER, ISSUER_GRANTOR, VERIFIER_GRANTOR.
|
|
110
|
-
*/
|
|
111
|
-
permissionType: PermissionType;
|
|
112
|
-
/** [MOD-PERM-MSG-7-1] vs_operator mandatory per spec v4 draft 13. */
|
|
113
|
-
vsOperator: string;
|
|
114
108
|
}
|
|
115
109
|
export interface MsgCreateRootPermissionResponse {
|
|
116
110
|
/** ID of the created permission */
|
|
@@ -476,7 +476,7 @@ exports.MsgStartPermissionVPResponse = {
|
|
|
476
476
|
},
|
|
477
477
|
};
|
|
478
478
|
function createBaseMsgRenewPermissionVP() {
|
|
479
|
-
return { corporation: "", operator: "", id: 0
|
|
479
|
+
return { corporation: "", operator: "", id: 0 };
|
|
480
480
|
}
|
|
481
481
|
exports.MsgRenewPermissionVP = {
|
|
482
482
|
encode(message, writer = _m0.Writer.create()) {
|
|
@@ -489,9 +489,6 @@ exports.MsgRenewPermissionVP = {
|
|
|
489
489
|
if (message.id !== 0) {
|
|
490
490
|
writer.uint32(24).uint64(message.id);
|
|
491
491
|
}
|
|
492
|
-
if (message.permissionType !== 0) {
|
|
493
|
-
writer.uint32(32).int32(message.permissionType);
|
|
494
|
-
}
|
|
495
492
|
return writer;
|
|
496
493
|
},
|
|
497
494
|
decode(input, length) {
|
|
@@ -519,12 +516,6 @@ exports.MsgRenewPermissionVP = {
|
|
|
519
516
|
}
|
|
520
517
|
message.id = longToNumber(reader.uint64());
|
|
521
518
|
continue;
|
|
522
|
-
case 4:
|
|
523
|
-
if (tag !== 32) {
|
|
524
|
-
break;
|
|
525
|
-
}
|
|
526
|
-
message.permissionType = reader.int32();
|
|
527
|
-
continue;
|
|
528
519
|
}
|
|
529
520
|
if ((tag & 7) === 4 || tag === 0) {
|
|
530
521
|
break;
|
|
@@ -538,7 +529,6 @@ exports.MsgRenewPermissionVP = {
|
|
|
538
529
|
corporation: isSet(object.corporation) ? globalThis.String(object.corporation) : "",
|
|
539
530
|
operator: isSet(object.operator) ? globalThis.String(object.operator) : "",
|
|
540
531
|
id: isSet(object.id) ? globalThis.Number(object.id) : 0,
|
|
541
|
-
permissionType: isSet(object.permissionType) ? (0, types_1.permissionTypeFromJSON)(object.permissionType) : 0,
|
|
542
532
|
};
|
|
543
533
|
},
|
|
544
534
|
toJSON(message) {
|
|
@@ -552,21 +542,17 @@ exports.MsgRenewPermissionVP = {
|
|
|
552
542
|
if (message.id !== 0) {
|
|
553
543
|
obj.id = Math.round(message.id);
|
|
554
544
|
}
|
|
555
|
-
if (message.permissionType !== 0) {
|
|
556
|
-
obj.permissionType = (0, types_1.permissionTypeToJSON)(message.permissionType);
|
|
557
|
-
}
|
|
558
545
|
return obj;
|
|
559
546
|
},
|
|
560
547
|
create(base) {
|
|
561
548
|
return exports.MsgRenewPermissionVP.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
562
549
|
},
|
|
563
550
|
fromPartial(object) {
|
|
564
|
-
var _a, _b, _c
|
|
551
|
+
var _a, _b, _c;
|
|
565
552
|
const message = createBaseMsgRenewPermissionVP();
|
|
566
553
|
message.corporation = (_a = object.corporation) !== null && _a !== void 0 ? _a : "";
|
|
567
554
|
message.operator = (_b = object.operator) !== null && _b !== void 0 ? _b : "";
|
|
568
555
|
message.id = (_c = object.id) !== null && _c !== void 0 ? _c : 0;
|
|
569
|
-
message.permissionType = (_d = object.permissionType) !== null && _d !== void 0 ? _d : 0;
|
|
570
556
|
return message;
|
|
571
557
|
},
|
|
572
558
|
};
|
|
@@ -965,8 +951,6 @@ function createBaseMsgCreateRootPermission() {
|
|
|
965
951
|
validationFees: 0,
|
|
966
952
|
issuanceFees: 0,
|
|
967
953
|
verificationFees: 0,
|
|
968
|
-
permissionType: 0,
|
|
969
|
-
vsOperator: "",
|
|
970
954
|
};
|
|
971
955
|
}
|
|
972
956
|
exports.MsgCreateRootPermission = {
|
|
@@ -998,12 +982,6 @@ exports.MsgCreateRootPermission = {
|
|
|
998
982
|
if (message.verificationFees !== 0) {
|
|
999
983
|
writer.uint32(72).uint64(message.verificationFees);
|
|
1000
984
|
}
|
|
1001
|
-
if (message.permissionType !== 0) {
|
|
1002
|
-
writer.uint32(80).int32(message.permissionType);
|
|
1003
|
-
}
|
|
1004
|
-
if (message.vsOperator !== "") {
|
|
1005
|
-
writer.uint32(90).string(message.vsOperator);
|
|
1006
|
-
}
|
|
1007
985
|
return writer;
|
|
1008
986
|
},
|
|
1009
987
|
decode(input, length) {
|
|
@@ -1067,18 +1045,6 @@ exports.MsgCreateRootPermission = {
|
|
|
1067
1045
|
}
|
|
1068
1046
|
message.verificationFees = longToNumber(reader.uint64());
|
|
1069
1047
|
continue;
|
|
1070
|
-
case 10:
|
|
1071
|
-
if (tag !== 80) {
|
|
1072
|
-
break;
|
|
1073
|
-
}
|
|
1074
|
-
message.permissionType = reader.int32();
|
|
1075
|
-
continue;
|
|
1076
|
-
case 11:
|
|
1077
|
-
if (tag !== 90) {
|
|
1078
|
-
break;
|
|
1079
|
-
}
|
|
1080
|
-
message.vsOperator = reader.string();
|
|
1081
|
-
continue;
|
|
1082
1048
|
}
|
|
1083
1049
|
if ((tag & 7) === 4 || tag === 0) {
|
|
1084
1050
|
break;
|
|
@@ -1098,8 +1064,6 @@ exports.MsgCreateRootPermission = {
|
|
|
1098
1064
|
validationFees: isSet(object.validationFees) ? globalThis.Number(object.validationFees) : 0,
|
|
1099
1065
|
issuanceFees: isSet(object.issuanceFees) ? globalThis.Number(object.issuanceFees) : 0,
|
|
1100
1066
|
verificationFees: isSet(object.verificationFees) ? globalThis.Number(object.verificationFees) : 0,
|
|
1101
|
-
permissionType: isSet(object.permissionType) ? (0, types_1.permissionTypeFromJSON)(object.permissionType) : 0,
|
|
1102
|
-
vsOperator: isSet(object.vsOperator) ? globalThis.String(object.vsOperator) : "",
|
|
1103
1067
|
};
|
|
1104
1068
|
},
|
|
1105
1069
|
toJSON(message) {
|
|
@@ -1131,19 +1095,13 @@ exports.MsgCreateRootPermission = {
|
|
|
1131
1095
|
if (message.verificationFees !== 0) {
|
|
1132
1096
|
obj.verificationFees = Math.round(message.verificationFees);
|
|
1133
1097
|
}
|
|
1134
|
-
if (message.permissionType !== 0) {
|
|
1135
|
-
obj.permissionType = (0, types_1.permissionTypeToJSON)(message.permissionType);
|
|
1136
|
-
}
|
|
1137
|
-
if (message.vsOperator !== "") {
|
|
1138
|
-
obj.vsOperator = message.vsOperator;
|
|
1139
|
-
}
|
|
1140
1098
|
return obj;
|
|
1141
1099
|
},
|
|
1142
1100
|
create(base) {
|
|
1143
1101
|
return exports.MsgCreateRootPermission.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
1144
1102
|
},
|
|
1145
1103
|
fromPartial(object) {
|
|
1146
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j
|
|
1104
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
1147
1105
|
const message = createBaseMsgCreateRootPermission();
|
|
1148
1106
|
message.corporation = (_a = object.corporation) !== null && _a !== void 0 ? _a : "";
|
|
1149
1107
|
message.operator = (_b = object.operator) !== null && _b !== void 0 ? _b : "";
|
|
@@ -1154,8 +1112,6 @@ exports.MsgCreateRootPermission = {
|
|
|
1154
1112
|
message.validationFees = (_g = object.validationFees) !== null && _g !== void 0 ? _g : 0;
|
|
1155
1113
|
message.issuanceFees = (_h = object.issuanceFees) !== null && _h !== void 0 ? _h : 0;
|
|
1156
1114
|
message.verificationFees = (_j = object.verificationFees) !== null && _j !== void 0 ? _j : 0;
|
|
1157
|
-
message.permissionType = (_k = object.permissionType) !== null && _k !== void 0 ? _k : 0;
|
|
1158
|
-
message.vsOperator = (_l = object.vsOperator) !== null && _l !== void 0 ? _l : "";
|
|
1159
1115
|
return message;
|
|
1160
1116
|
},
|
|
1161
1117
|
};
|
package/package.json
CHANGED