televerse-dao-typechain-types 1.0.8-alpha.2 → 1.0.8-alpha.5
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/package.json +1 -1
- package/televerse-utils/index.d.ts +117 -0
- package/televerse-utils/index.js +71 -1
package/package.json
CHANGED
|
@@ -124,6 +124,28 @@ declare const networkConfigSchema: z.ZodObject<{
|
|
|
124
124
|
apiKeyRequired: z.ZodBoolean;
|
|
125
125
|
}, z.core.$strip>>;
|
|
126
126
|
}, z.core.$strip>;
|
|
127
|
+
export declare const configJsonSchema: z.ZodObject<{
|
|
128
|
+
networkSelection: z.ZodEnum<{
|
|
129
|
+
readonly holesky: "holesky";
|
|
130
|
+
readonly sepolia: "sepolia";
|
|
131
|
+
readonly lineaSepolia: "linea-sepolia";
|
|
132
|
+
}>;
|
|
133
|
+
selectedNetwork: z.ZodOptional<z.ZodObject<{
|
|
134
|
+
name: z.ZodEnum<{
|
|
135
|
+
readonly holesky: "holesky";
|
|
136
|
+
readonly sepolia: "sepolia";
|
|
137
|
+
readonly lineaSepolia: "linea-sepolia";
|
|
138
|
+
}>;
|
|
139
|
+
registryAddress: z.ZodString;
|
|
140
|
+
intChainId: z.ZodNumber;
|
|
141
|
+
hexChainId: z.ZodString;
|
|
142
|
+
providers: z.ZodArray<z.ZodObject<{
|
|
143
|
+
name: z.ZodString;
|
|
144
|
+
rpcUrl: z.ZodString;
|
|
145
|
+
apiKeyRequired: z.ZodBoolean;
|
|
146
|
+
}, z.core.$strip>>;
|
|
147
|
+
}, z.core.$strip>>;
|
|
148
|
+
}, z.core.$strip>;
|
|
127
149
|
export type NetworkConfig = z.infer<typeof networkConfigSchema>;
|
|
128
150
|
export declare const networksSchema: z.ZodRecord<z.ZodEnum<{
|
|
129
151
|
readonly holesky: "holesky";
|
|
@@ -144,4 +166,99 @@ export declare const networksSchema: z.ZodRecord<z.ZodEnum<{
|
|
|
144
166
|
apiKeyRequired: z.ZodBoolean;
|
|
145
167
|
}, z.core.$strip>>;
|
|
146
168
|
}, z.core.$strip>>;
|
|
169
|
+
export declare const issuerTypeSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
170
|
+
id: z.ZodString;
|
|
171
|
+
}, z.core.$strip>, z.ZodString]>;
|
|
172
|
+
export declare const credentialSubjectSchema: z.ZodObject<{
|
|
173
|
+
id: z.ZodOptional<z.ZodString>;
|
|
174
|
+
message: z.ZodOptional<z.ZodString>;
|
|
175
|
+
}, z.core.$strip>;
|
|
176
|
+
export declare const contextTypeSchema: z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodAny>]>>]>;
|
|
177
|
+
export declare const credentialStatusReferenceSchema: z.ZodObject<{
|
|
178
|
+
id: z.ZodString;
|
|
179
|
+
type: z.ZodString;
|
|
180
|
+
}, z.core.$strip>;
|
|
181
|
+
export declare const unsignedCredentialSchema: z.ZodObject<{
|
|
182
|
+
issuer: z.ZodUnion<readonly [z.ZodObject<{
|
|
183
|
+
id: z.ZodString;
|
|
184
|
+
}, z.core.$strip>, z.ZodString]>;
|
|
185
|
+
credentialSubject: z.ZodObject<{
|
|
186
|
+
id: z.ZodOptional<z.ZodString>;
|
|
187
|
+
message: z.ZodOptional<z.ZodString>;
|
|
188
|
+
}, z.core.$strip>;
|
|
189
|
+
credentialSchema: z.ZodOptional<z.ZodObject<{
|
|
190
|
+
id: z.ZodOptional<z.ZodString>;
|
|
191
|
+
type: z.ZodOptional<z.ZodString>;
|
|
192
|
+
}, z.core.$strip>>;
|
|
193
|
+
type: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodString]>>;
|
|
194
|
+
'@context': z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodAny>]>>]>;
|
|
195
|
+
issuanceDate: z.ZodString;
|
|
196
|
+
expirationDate: z.ZodOptional<z.ZodString>;
|
|
197
|
+
credentialStatus: z.ZodOptional<z.ZodObject<{
|
|
198
|
+
id: z.ZodString;
|
|
199
|
+
type: z.ZodString;
|
|
200
|
+
}, z.core.$strip>>;
|
|
201
|
+
id: z.ZodOptional<z.ZodString>;
|
|
202
|
+
}, z.core.$strip>;
|
|
203
|
+
export declare const proofTypeSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
204
|
+
type: z.ZodOptional<z.ZodString>;
|
|
205
|
+
jwt: z.ZodOptional<z.ZodString>;
|
|
206
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
207
|
+
type: z.ZodOptional<z.ZodString>;
|
|
208
|
+
verificationMethod: z.ZodOptional<z.ZodString>;
|
|
209
|
+
created: z.ZodOptional<z.ZodString>;
|
|
210
|
+
proofPurpose: z.ZodOptional<z.ZodString>;
|
|
211
|
+
proofValue: z.ZodOptional<z.ZodString>;
|
|
212
|
+
eip712: z.ZodOptional<z.ZodObject<{
|
|
213
|
+
domain: z.ZodOptional<z.ZodObject<{
|
|
214
|
+
chainId: z.ZodNumber;
|
|
215
|
+
name: z.ZodString;
|
|
216
|
+
version: z.ZodString;
|
|
217
|
+
}, z.core.$strip>>;
|
|
218
|
+
types: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
219
|
+
primaryType: z.ZodOptional<z.ZodString>;
|
|
220
|
+
}, z.core.$strip>>;
|
|
221
|
+
}, z.core.$strip>]>;
|
|
222
|
+
export declare const VerifiableCredentialSchema: z.ZodIntersection<z.ZodObject<{
|
|
223
|
+
issuer: z.ZodUnion<readonly [z.ZodObject<{
|
|
224
|
+
id: z.ZodString;
|
|
225
|
+
}, z.core.$strip>, z.ZodString]>;
|
|
226
|
+
credentialSubject: z.ZodObject<{
|
|
227
|
+
id: z.ZodOptional<z.ZodString>;
|
|
228
|
+
message: z.ZodOptional<z.ZodString>;
|
|
229
|
+
}, z.core.$strip>;
|
|
230
|
+
credentialSchema: z.ZodOptional<z.ZodObject<{
|
|
231
|
+
id: z.ZodOptional<z.ZodString>;
|
|
232
|
+
type: z.ZodOptional<z.ZodString>;
|
|
233
|
+
}, z.core.$strip>>;
|
|
234
|
+
type: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodString]>>;
|
|
235
|
+
'@context': z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodAny>]>>]>;
|
|
236
|
+
issuanceDate: z.ZodString;
|
|
237
|
+
expirationDate: z.ZodOptional<z.ZodString>;
|
|
238
|
+
credentialStatus: z.ZodOptional<z.ZodObject<{
|
|
239
|
+
id: z.ZodString;
|
|
240
|
+
type: z.ZodString;
|
|
241
|
+
}, z.core.$strip>>;
|
|
242
|
+
id: z.ZodOptional<z.ZodString>;
|
|
243
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
244
|
+
proof: z.ZodUnion<readonly [z.ZodObject<{
|
|
245
|
+
type: z.ZodOptional<z.ZodString>;
|
|
246
|
+
jwt: z.ZodOptional<z.ZodString>;
|
|
247
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
248
|
+
type: z.ZodOptional<z.ZodString>;
|
|
249
|
+
verificationMethod: z.ZodOptional<z.ZodString>;
|
|
250
|
+
created: z.ZodOptional<z.ZodString>;
|
|
251
|
+
proofPurpose: z.ZodOptional<z.ZodString>;
|
|
252
|
+
proofValue: z.ZodOptional<z.ZodString>;
|
|
253
|
+
eip712: z.ZodOptional<z.ZodObject<{
|
|
254
|
+
domain: z.ZodOptional<z.ZodObject<{
|
|
255
|
+
chainId: z.ZodNumber;
|
|
256
|
+
name: z.ZodString;
|
|
257
|
+
version: z.ZodString;
|
|
258
|
+
}, z.core.$strip>>;
|
|
259
|
+
types: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
260
|
+
primaryType: z.ZodOptional<z.ZodString>;
|
|
261
|
+
}, z.core.$strip>>;
|
|
262
|
+
}, z.core.$strip>]>;
|
|
263
|
+
}, z.core.$strip>>;
|
|
147
264
|
export {};
|
package/televerse-utils/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.networksSchema = exports.supportedNetworkEnumSchema = exports.jwtSchema = exports.searchRequestSchema = exports.QuoteSchema = exports.DIDCommQuoteMessageSchema = exports.GisPointSchema = exports.nniPayloadSchema = exports.postMessagePayloadSchema = exports.postMessageSchema = exports.ChargeFrequency = void 0;
|
|
3
|
+
exports.VerifiableCredentialSchema = exports.proofTypeSchema = exports.unsignedCredentialSchema = exports.credentialStatusReferenceSchema = exports.contextTypeSchema = exports.credentialSubjectSchema = exports.issuerTypeSchema = exports.networksSchema = exports.configJsonSchema = exports.supportedNetworkEnumSchema = exports.jwtSchema = exports.searchRequestSchema = exports.QuoteSchema = exports.DIDCommQuoteMessageSchema = exports.GisPointSchema = exports.nniPayloadSchema = exports.postMessagePayloadSchema = exports.postMessageSchema = exports.ChargeFrequency = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
exports.ChargeFrequency = {
|
|
6
6
|
DAILY: 'DAILY',
|
|
@@ -90,4 +90,74 @@ const networkConfigSchema = zod_1.z
|
|
|
90
90
|
}, {
|
|
91
91
|
message: 'hexChainId does not match intChainId',
|
|
92
92
|
});
|
|
93
|
+
exports.configJsonSchema = zod_1.z.object({
|
|
94
|
+
networkSelection: exports.supportedNetworkEnumSchema,
|
|
95
|
+
selectedNetwork: networkConfigSchema.optional(),
|
|
96
|
+
});
|
|
93
97
|
exports.networksSchema = zod_1.z.record(exports.supportedNetworkEnumSchema, networkConfigSchema);
|
|
98
|
+
exports.issuerTypeSchema = zod_1.z.union([
|
|
99
|
+
zod_1.z.object({
|
|
100
|
+
id: zod_1.z.string(),
|
|
101
|
+
}),
|
|
102
|
+
zod_1.z.string(),
|
|
103
|
+
]);
|
|
104
|
+
exports.credentialSubjectSchema = zod_1.z.object({
|
|
105
|
+
id: zod_1.z.string().optional(),
|
|
106
|
+
message: zod_1.z.string().optional(),
|
|
107
|
+
});
|
|
108
|
+
exports.contextTypeSchema = zod_1.z.union([
|
|
109
|
+
zod_1.z.string(),
|
|
110
|
+
zod_1.z.record(zod_1.z.string(), zod_1.z.any()),
|
|
111
|
+
zod_1.z.array(zod_1.z.union([zod_1.z.string(), zod_1.z.record(zod_1.z.string(), zod_1.z.any())])),
|
|
112
|
+
]);
|
|
113
|
+
exports.credentialStatusReferenceSchema = zod_1.z.object({
|
|
114
|
+
id: zod_1.z.string(),
|
|
115
|
+
type: zod_1.z.string(),
|
|
116
|
+
});
|
|
117
|
+
// Derived from generated VC upon passing to veramo API with the payload
|
|
118
|
+
const credentialSchema = zod_1.z.object({
|
|
119
|
+
id: zod_1.z.string().optional(),
|
|
120
|
+
type: zod_1.z.string().optional(),
|
|
121
|
+
});
|
|
122
|
+
exports.unsignedCredentialSchema = zod_1.z.object({
|
|
123
|
+
issuer: exports.issuerTypeSchema,
|
|
124
|
+
credentialSubject: exports.credentialSubjectSchema,
|
|
125
|
+
credentialSchema: credentialSchema.optional(),
|
|
126
|
+
type: zod_1.z.union([zod_1.z.array(zod_1.z.string()), zod_1.z.string()]).optional(),
|
|
127
|
+
'@context': exports.contextTypeSchema,
|
|
128
|
+
issuanceDate: zod_1.z.string(),
|
|
129
|
+
expirationDate: zod_1.z.string().optional(),
|
|
130
|
+
credentialStatus: exports.credentialStatusReferenceSchema.optional(),
|
|
131
|
+
id: zod_1.z.string().optional(),
|
|
132
|
+
});
|
|
133
|
+
const jwtProofTypeSchema = zod_1.z.object({
|
|
134
|
+
type: zod_1.z.string().optional(),
|
|
135
|
+
jwt: zod_1.z.string().optional(),
|
|
136
|
+
});
|
|
137
|
+
const eip712ProofTypeSchema = zod_1.z.object({
|
|
138
|
+
type: zod_1.z.string().optional(),
|
|
139
|
+
verificationMethod: zod_1.z.string().optional(),
|
|
140
|
+
created: zod_1.z.string().optional(),
|
|
141
|
+
proofPurpose: zod_1.z.string().optional(),
|
|
142
|
+
proofValue: zod_1.z.string().optional(),
|
|
143
|
+
eip712: zod_1.z
|
|
144
|
+
.object({
|
|
145
|
+
domain: zod_1.z
|
|
146
|
+
.object({
|
|
147
|
+
chainId: zod_1.z.number(),
|
|
148
|
+
name: zod_1.z.string(),
|
|
149
|
+
version: zod_1.z.string(),
|
|
150
|
+
})
|
|
151
|
+
.optional(),
|
|
152
|
+
types: zod_1.z.record(zod_1.z.string(), zod_1.z.any()).optional(),
|
|
153
|
+
primaryType: zod_1.z.string().optional(),
|
|
154
|
+
})
|
|
155
|
+
.optional(),
|
|
156
|
+
});
|
|
157
|
+
exports.proofTypeSchema = zod_1.z.union([
|
|
158
|
+
jwtProofTypeSchema,
|
|
159
|
+
eip712ProofTypeSchema,
|
|
160
|
+
]);
|
|
161
|
+
exports.VerifiableCredentialSchema = exports.unsignedCredentialSchema.and(zod_1.z.object({
|
|
162
|
+
proof: exports.proofTypeSchema,
|
|
163
|
+
}));
|