@verana-labs/verana-types 0.10.1-dev.21 → 0.10.1-dev.22
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/dist/codec/verana/co/v1/genesis.d.ts +1 -0
- package/dist/codec/verana/co/v1/genesis.js +30 -2
- package/dist/codec/verana/cs/v1/genesis.d.ts +3 -1
- package/dist/codec/verana/cs/v1/genesis.js +42 -3
- package/dist/codec/verana/gf/v1/genesis.d.ts +2 -0
- package/dist/codec/verana/gf/v1/genesis.js +44 -2
- package/package.json +1 -1
|
@@ -6,6 +6,7 @@ export declare const protobufPackage = "verana.co.v1";
|
|
|
6
6
|
export interface GenesisState {
|
|
7
7
|
params: Params | undefined;
|
|
8
8
|
corporations: Corporation[];
|
|
9
|
+
corporationCounter: number;
|
|
9
10
|
}
|
|
10
11
|
export declare const GenesisState: {
|
|
11
12
|
encode(message: GenesisState, writer?: _m0.Writer): _m0.Writer;
|
|
@@ -43,9 +43,10 @@ exports.GenesisState = exports.protobufPackage = void 0;
|
|
|
43
43
|
const _m0 = __importStar(require("protobufjs/minimal"));
|
|
44
44
|
const params_1 = require("./params");
|
|
45
45
|
const types_1 = require("./types");
|
|
46
|
+
const Long = require("long");
|
|
46
47
|
exports.protobufPackage = "verana.co.v1";
|
|
47
48
|
function createBaseGenesisState() {
|
|
48
|
-
return { params: undefined, corporations: [] };
|
|
49
|
+
return { params: undefined, corporations: [], corporationCounter: 0 };
|
|
49
50
|
}
|
|
50
51
|
exports.GenesisState = {
|
|
51
52
|
encode(message, writer = _m0.Writer.create()) {
|
|
@@ -55,6 +56,9 @@ exports.GenesisState = {
|
|
|
55
56
|
for (const v of message.corporations) {
|
|
56
57
|
types_1.Corporation.encode(v, writer.uint32(18).fork()).ldelim();
|
|
57
58
|
}
|
|
59
|
+
if (message.corporationCounter !== 0) {
|
|
60
|
+
writer.uint32(24).uint64(message.corporationCounter);
|
|
61
|
+
}
|
|
58
62
|
return writer;
|
|
59
63
|
},
|
|
60
64
|
decode(input, length) {
|
|
@@ -76,6 +80,12 @@ exports.GenesisState = {
|
|
|
76
80
|
}
|
|
77
81
|
message.corporations.push(types_1.Corporation.decode(reader, reader.uint32()));
|
|
78
82
|
continue;
|
|
83
|
+
case 3:
|
|
84
|
+
if (tag !== 24) {
|
|
85
|
+
break;
|
|
86
|
+
}
|
|
87
|
+
message.corporationCounter = longToNumber(reader.uint64());
|
|
88
|
+
continue;
|
|
79
89
|
}
|
|
80
90
|
if ((tag & 7) === 4 || tag === 0) {
|
|
81
91
|
break;
|
|
@@ -90,6 +100,7 @@ exports.GenesisState = {
|
|
|
90
100
|
corporations: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.corporations)
|
|
91
101
|
? object.corporations.map((e) => types_1.Corporation.fromJSON(e))
|
|
92
102
|
: [],
|
|
103
|
+
corporationCounter: isSet(object.corporationCounter) ? globalThis.Number(object.corporationCounter) : 0,
|
|
93
104
|
};
|
|
94
105
|
},
|
|
95
106
|
toJSON(message) {
|
|
@@ -101,21 +112,38 @@ exports.GenesisState = {
|
|
|
101
112
|
if ((_a = message.corporations) === null || _a === void 0 ? void 0 : _a.length) {
|
|
102
113
|
obj.corporations = message.corporations.map((e) => types_1.Corporation.toJSON(e));
|
|
103
114
|
}
|
|
115
|
+
if (message.corporationCounter !== 0) {
|
|
116
|
+
obj.corporationCounter = Math.round(message.corporationCounter);
|
|
117
|
+
}
|
|
104
118
|
return obj;
|
|
105
119
|
},
|
|
106
120
|
create(base) {
|
|
107
121
|
return exports.GenesisState.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
108
122
|
},
|
|
109
123
|
fromPartial(object) {
|
|
110
|
-
var _a;
|
|
124
|
+
var _a, _b;
|
|
111
125
|
const message = createBaseGenesisState();
|
|
112
126
|
message.params = (object.params !== undefined && object.params !== null)
|
|
113
127
|
? params_1.Params.fromPartial(object.params)
|
|
114
128
|
: undefined;
|
|
115
129
|
message.corporations = ((_a = object.corporations) === null || _a === void 0 ? void 0 : _a.map((e) => types_1.Corporation.fromPartial(e))) || [];
|
|
130
|
+
message.corporationCounter = (_b = object.corporationCounter) !== null && _b !== void 0 ? _b : 0;
|
|
116
131
|
return message;
|
|
117
132
|
},
|
|
118
133
|
};
|
|
134
|
+
function longToNumber(long) {
|
|
135
|
+
if (long.gt(globalThis.Number.MAX_SAFE_INTEGER)) {
|
|
136
|
+
throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
|
|
137
|
+
}
|
|
138
|
+
if (long.lt(globalThis.Number.MIN_SAFE_INTEGER)) {
|
|
139
|
+
throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
|
|
140
|
+
}
|
|
141
|
+
return long.toNumber();
|
|
142
|
+
}
|
|
143
|
+
if (_m0.util.Long !== Long) {
|
|
144
|
+
_m0.util.Long = Long;
|
|
145
|
+
_m0.configure();
|
|
146
|
+
}
|
|
119
147
|
function isSet(value) {
|
|
120
148
|
return value !== null && value !== undefined;
|
|
121
149
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _m0 from "protobufjs/minimal";
|
|
2
2
|
import { Params } from "./params";
|
|
3
|
-
import { CredentialSchema } from "./types";
|
|
3
|
+
import { CredentialSchema, SchemaAuthorizationPolicy } from "./types";
|
|
4
4
|
export declare const protobufPackage = "verana.cs.v1";
|
|
5
5
|
/** GenesisState defines the credentialschema module's genesis state. */
|
|
6
6
|
export interface GenesisState {
|
|
@@ -8,6 +8,8 @@ export interface GenesisState {
|
|
|
8
8
|
params: Params | undefined;
|
|
9
9
|
credentialSchemas: CredentialSchema[];
|
|
10
10
|
schemaCounter: number;
|
|
11
|
+
schemaAuthorizationPolicies: SchemaAuthorizationPolicy[];
|
|
12
|
+
schemaAuthorizationPolicyCounter: number;
|
|
11
13
|
}
|
|
12
14
|
export declare const GenesisState: {
|
|
13
15
|
encode(message: GenesisState, writer?: _m0.Writer): _m0.Writer;
|
|
@@ -46,7 +46,13 @@ const types_1 = require("./types");
|
|
|
46
46
|
const Long = require("long");
|
|
47
47
|
exports.protobufPackage = "verana.cs.v1";
|
|
48
48
|
function createBaseGenesisState() {
|
|
49
|
-
return {
|
|
49
|
+
return {
|
|
50
|
+
params: undefined,
|
|
51
|
+
credentialSchemas: [],
|
|
52
|
+
schemaCounter: 0,
|
|
53
|
+
schemaAuthorizationPolicies: [],
|
|
54
|
+
schemaAuthorizationPolicyCounter: 0,
|
|
55
|
+
};
|
|
50
56
|
}
|
|
51
57
|
exports.GenesisState = {
|
|
52
58
|
encode(message, writer = _m0.Writer.create()) {
|
|
@@ -59,6 +65,12 @@ exports.GenesisState = {
|
|
|
59
65
|
if (message.schemaCounter !== 0) {
|
|
60
66
|
writer.uint32(24).uint64(message.schemaCounter);
|
|
61
67
|
}
|
|
68
|
+
for (const v of message.schemaAuthorizationPolicies) {
|
|
69
|
+
types_1.SchemaAuthorizationPolicy.encode(v, writer.uint32(34).fork()).ldelim();
|
|
70
|
+
}
|
|
71
|
+
if (message.schemaAuthorizationPolicyCounter !== 0) {
|
|
72
|
+
writer.uint32(40).uint64(message.schemaAuthorizationPolicyCounter);
|
|
73
|
+
}
|
|
62
74
|
return writer;
|
|
63
75
|
},
|
|
64
76
|
decode(input, length) {
|
|
@@ -86,6 +98,18 @@ exports.GenesisState = {
|
|
|
86
98
|
}
|
|
87
99
|
message.schemaCounter = longToNumber(reader.uint64());
|
|
88
100
|
continue;
|
|
101
|
+
case 4:
|
|
102
|
+
if (tag !== 34) {
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
message.schemaAuthorizationPolicies.push(types_1.SchemaAuthorizationPolicy.decode(reader, reader.uint32()));
|
|
106
|
+
continue;
|
|
107
|
+
case 5:
|
|
108
|
+
if (tag !== 40) {
|
|
109
|
+
break;
|
|
110
|
+
}
|
|
111
|
+
message.schemaAuthorizationPolicyCounter = longToNumber(reader.uint64());
|
|
112
|
+
continue;
|
|
89
113
|
}
|
|
90
114
|
if ((tag & 7) === 4 || tag === 0) {
|
|
91
115
|
break;
|
|
@@ -101,10 +125,16 @@ exports.GenesisState = {
|
|
|
101
125
|
? object.credentialSchemas.map((e) => types_1.CredentialSchema.fromJSON(e))
|
|
102
126
|
: [],
|
|
103
127
|
schemaCounter: isSet(object.schemaCounter) ? globalThis.Number(object.schemaCounter) : 0,
|
|
128
|
+
schemaAuthorizationPolicies: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.schemaAuthorizationPolicies)
|
|
129
|
+
? object.schemaAuthorizationPolicies.map((e) => types_1.SchemaAuthorizationPolicy.fromJSON(e))
|
|
130
|
+
: [],
|
|
131
|
+
schemaAuthorizationPolicyCounter: isSet(object.schemaAuthorizationPolicyCounter)
|
|
132
|
+
? globalThis.Number(object.schemaAuthorizationPolicyCounter)
|
|
133
|
+
: 0,
|
|
104
134
|
};
|
|
105
135
|
},
|
|
106
136
|
toJSON(message) {
|
|
107
|
-
var _a;
|
|
137
|
+
var _a, _b;
|
|
108
138
|
const obj = {};
|
|
109
139
|
if (message.params !== undefined) {
|
|
110
140
|
obj.params = params_1.Params.toJSON(message.params);
|
|
@@ -115,19 +145,28 @@ exports.GenesisState = {
|
|
|
115
145
|
if (message.schemaCounter !== 0) {
|
|
116
146
|
obj.schemaCounter = Math.round(message.schemaCounter);
|
|
117
147
|
}
|
|
148
|
+
if ((_b = message.schemaAuthorizationPolicies) === null || _b === void 0 ? void 0 : _b.length) {
|
|
149
|
+
obj.schemaAuthorizationPolicies = message.schemaAuthorizationPolicies.map((e) => types_1.SchemaAuthorizationPolicy.toJSON(e));
|
|
150
|
+
}
|
|
151
|
+
if (message.schemaAuthorizationPolicyCounter !== 0) {
|
|
152
|
+
obj.schemaAuthorizationPolicyCounter = Math.round(message.schemaAuthorizationPolicyCounter);
|
|
153
|
+
}
|
|
118
154
|
return obj;
|
|
119
155
|
},
|
|
120
156
|
create(base) {
|
|
121
157
|
return exports.GenesisState.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
122
158
|
},
|
|
123
159
|
fromPartial(object) {
|
|
124
|
-
var _a, _b;
|
|
160
|
+
var _a, _b, _c, _d;
|
|
125
161
|
const message = createBaseGenesisState();
|
|
126
162
|
message.params = (object.params !== undefined && object.params !== null)
|
|
127
163
|
? params_1.Params.fromPartial(object.params)
|
|
128
164
|
: undefined;
|
|
129
165
|
message.credentialSchemas = ((_a = object.credentialSchemas) === null || _a === void 0 ? void 0 : _a.map((e) => types_1.CredentialSchema.fromPartial(e))) || [];
|
|
130
166
|
message.schemaCounter = (_b = object.schemaCounter) !== null && _b !== void 0 ? _b : 0;
|
|
167
|
+
message.schemaAuthorizationPolicies =
|
|
168
|
+
((_c = object.schemaAuthorizationPolicies) === null || _c === void 0 ? void 0 : _c.map((e) => types_1.SchemaAuthorizationPolicy.fromPartial(e))) || [];
|
|
169
|
+
message.schemaAuthorizationPolicyCounter = (_d = object.schemaAuthorizationPolicyCounter) !== null && _d !== void 0 ? _d : 0;
|
|
131
170
|
return message;
|
|
132
171
|
},
|
|
133
172
|
};
|
|
@@ -7,6 +7,8 @@ export interface GenesisState {
|
|
|
7
7
|
params: Params | undefined;
|
|
8
8
|
versions: GovernanceFrameworkVersion[];
|
|
9
9
|
documents: GovernanceFrameworkDocument[];
|
|
10
|
+
gfvCounter: number;
|
|
11
|
+
gfdCounter: number;
|
|
10
12
|
}
|
|
11
13
|
export declare const GenesisState: {
|
|
12
14
|
encode(message: GenesisState, writer?: _m0.Writer): _m0.Writer;
|
|
@@ -43,9 +43,10 @@ exports.GenesisState = exports.protobufPackage = void 0;
|
|
|
43
43
|
const _m0 = __importStar(require("protobufjs/minimal"));
|
|
44
44
|
const params_1 = require("./params");
|
|
45
45
|
const types_1 = require("./types");
|
|
46
|
+
const Long = require("long");
|
|
46
47
|
exports.protobufPackage = "verana.gf.v1";
|
|
47
48
|
function createBaseGenesisState() {
|
|
48
|
-
return { params: undefined, versions: [], documents: [] };
|
|
49
|
+
return { params: undefined, versions: [], documents: [], gfvCounter: 0, gfdCounter: 0 };
|
|
49
50
|
}
|
|
50
51
|
exports.GenesisState = {
|
|
51
52
|
encode(message, writer = _m0.Writer.create()) {
|
|
@@ -58,6 +59,12 @@ exports.GenesisState = {
|
|
|
58
59
|
for (const v of message.documents) {
|
|
59
60
|
types_1.GovernanceFrameworkDocument.encode(v, writer.uint32(26).fork()).ldelim();
|
|
60
61
|
}
|
|
62
|
+
if (message.gfvCounter !== 0) {
|
|
63
|
+
writer.uint32(32).uint64(message.gfvCounter);
|
|
64
|
+
}
|
|
65
|
+
if (message.gfdCounter !== 0) {
|
|
66
|
+
writer.uint32(40).uint64(message.gfdCounter);
|
|
67
|
+
}
|
|
61
68
|
return writer;
|
|
62
69
|
},
|
|
63
70
|
decode(input, length) {
|
|
@@ -85,6 +92,18 @@ exports.GenesisState = {
|
|
|
85
92
|
}
|
|
86
93
|
message.documents.push(types_1.GovernanceFrameworkDocument.decode(reader, reader.uint32()));
|
|
87
94
|
continue;
|
|
95
|
+
case 4:
|
|
96
|
+
if (tag !== 32) {
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
message.gfvCounter = longToNumber(reader.uint64());
|
|
100
|
+
continue;
|
|
101
|
+
case 5:
|
|
102
|
+
if (tag !== 40) {
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
message.gfdCounter = longToNumber(reader.uint64());
|
|
106
|
+
continue;
|
|
88
107
|
}
|
|
89
108
|
if ((tag & 7) === 4 || tag === 0) {
|
|
90
109
|
break;
|
|
@@ -102,6 +121,8 @@ exports.GenesisState = {
|
|
|
102
121
|
documents: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.documents)
|
|
103
122
|
? object.documents.map((e) => types_1.GovernanceFrameworkDocument.fromJSON(e))
|
|
104
123
|
: [],
|
|
124
|
+
gfvCounter: isSet(object.gfvCounter) ? globalThis.Number(object.gfvCounter) : 0,
|
|
125
|
+
gfdCounter: isSet(object.gfdCounter) ? globalThis.Number(object.gfdCounter) : 0,
|
|
105
126
|
};
|
|
106
127
|
},
|
|
107
128
|
toJSON(message) {
|
|
@@ -116,22 +137,43 @@ exports.GenesisState = {
|
|
|
116
137
|
if ((_b = message.documents) === null || _b === void 0 ? void 0 : _b.length) {
|
|
117
138
|
obj.documents = message.documents.map((e) => types_1.GovernanceFrameworkDocument.toJSON(e));
|
|
118
139
|
}
|
|
140
|
+
if (message.gfvCounter !== 0) {
|
|
141
|
+
obj.gfvCounter = Math.round(message.gfvCounter);
|
|
142
|
+
}
|
|
143
|
+
if (message.gfdCounter !== 0) {
|
|
144
|
+
obj.gfdCounter = Math.round(message.gfdCounter);
|
|
145
|
+
}
|
|
119
146
|
return obj;
|
|
120
147
|
},
|
|
121
148
|
create(base) {
|
|
122
149
|
return exports.GenesisState.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
123
150
|
},
|
|
124
151
|
fromPartial(object) {
|
|
125
|
-
var _a, _b;
|
|
152
|
+
var _a, _b, _c, _d;
|
|
126
153
|
const message = createBaseGenesisState();
|
|
127
154
|
message.params = (object.params !== undefined && object.params !== null)
|
|
128
155
|
? params_1.Params.fromPartial(object.params)
|
|
129
156
|
: undefined;
|
|
130
157
|
message.versions = ((_a = object.versions) === null || _a === void 0 ? void 0 : _a.map((e) => types_1.GovernanceFrameworkVersion.fromPartial(e))) || [];
|
|
131
158
|
message.documents = ((_b = object.documents) === null || _b === void 0 ? void 0 : _b.map((e) => types_1.GovernanceFrameworkDocument.fromPartial(e))) || [];
|
|
159
|
+
message.gfvCounter = (_c = object.gfvCounter) !== null && _c !== void 0 ? _c : 0;
|
|
160
|
+
message.gfdCounter = (_d = object.gfdCounter) !== null && _d !== void 0 ? _d : 0;
|
|
132
161
|
return message;
|
|
133
162
|
},
|
|
134
163
|
};
|
|
164
|
+
function longToNumber(long) {
|
|
165
|
+
if (long.gt(globalThis.Number.MAX_SAFE_INTEGER)) {
|
|
166
|
+
throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
|
|
167
|
+
}
|
|
168
|
+
if (long.lt(globalThis.Number.MIN_SAFE_INTEGER)) {
|
|
169
|
+
throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
|
|
170
|
+
}
|
|
171
|
+
return long.toNumber();
|
|
172
|
+
}
|
|
173
|
+
if (_m0.util.Long !== Long) {
|
|
174
|
+
_m0.util.Long = Long;
|
|
175
|
+
_m0.configure();
|
|
176
|
+
}
|
|
135
177
|
function isSet(value) {
|
|
136
178
|
return value !== null && value !== undefined;
|
|
137
179
|
}
|
package/package.json
CHANGED