televerse-dao-typechain-types 1.0.8-alpha.14 → 1.0.8-alpha.16
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 +3 -3
- package/televerse-utils/helper.d.ts +1 -0
- package/televerse-utils/helper.js +28 -0
- package/televerse-utils/index.d.ts +3 -422
- package/televerse-utils/index.js +16 -209
- package/televerse-utils/types.d.ts +32 -0
- package/televerse-utils/types.js +13 -0
- package/televerse-utils/validators.d.ts +422 -0
- package/televerse-utils/validators.js +212 -0
- package/televerse-utils/zodValidators.d.ts +357 -0
- package/televerse-utils/zodValidators.js +191 -0
- package/typechain-types/contracts/televerse/TeleverseToken.d.ts +14 -0
- package/typechain-types/contracts/televerse/TeleverseToken.ts +12 -0
- package/typechain-types/factories/contracts/televerse/CommitteeElection__factory.d.ts +1 -1
- package/typechain-types/factories/contracts/televerse/CommitteeElection__factory.js +1 -1
- package/typechain-types/factories/contracts/televerse/CommitteeElection__factory.ts +1 -1
- package/typechain-types/factories/contracts/televerse/ContractService__factory.d.ts +1 -1
- package/typechain-types/factories/contracts/televerse/ContractService__factory.js +1 -1
- package/typechain-types/factories/contracts/televerse/ContractService__factory.ts +1 -1
- package/typechain-types/factories/contracts/televerse/Governance__factory.d.ts +1 -1
- package/typechain-types/factories/contracts/televerse/Governance__factory.js +1 -1
- package/typechain-types/factories/contracts/televerse/Governance__factory.ts +1 -1
- package/typechain-types/factories/contracts/televerse/TeleverseToken__factory.d.ts +19 -14
- package/typechain-types/factories/contracts/televerse/TeleverseToken__factory.js +25 -18
- package/typechain-types/factories/contracts/televerse/TeleverseToken__factory.ts +25 -26
|
@@ -0,0 +1,422 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const ChargeFrequency: {
|
|
3
|
+
readonly DAILY: "DAILY";
|
|
4
|
+
readonly WEEKLY: "WEEKLY";
|
|
5
|
+
readonly MONTHLY: "MONTHLY";
|
|
6
|
+
readonly SEMIANNUALLY: "SEMIANNUALLY";
|
|
7
|
+
readonly ANNUALLY: "ANNUALLY";
|
|
8
|
+
};
|
|
9
|
+
export declare const postMessageSchema: z.ZodIntersection<z.ZodObject<{
|
|
10
|
+
type: z.ZodOptional<z.ZodString>;
|
|
11
|
+
}, z.core.$strip>, z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
12
|
+
export declare const postMessagePayloadSchema: z.ZodObject<{
|
|
13
|
+
type: z.ZodLiteral<"JWT_TOKEN">;
|
|
14
|
+
token: z.ZodString;
|
|
15
|
+
}, z.core.$strip>;
|
|
16
|
+
export type PostMessagePayload = z.infer<typeof postMessagePayloadSchema>;
|
|
17
|
+
export declare const nniPayloadSchema: z.ZodObject<{
|
|
18
|
+
nni_uuid: z.ZodString;
|
|
19
|
+
name: z.ZodString;
|
|
20
|
+
}, z.core.$strip>;
|
|
21
|
+
export type nniPayload = z.infer<typeof nniPayloadSchema>;
|
|
22
|
+
export type ChargeFrequency = (typeof ChargeFrequency)[keyof typeof ChargeFrequency];
|
|
23
|
+
export declare const GisPointSchema: z.ZodObject<{
|
|
24
|
+
lat: z.ZodNumber;
|
|
25
|
+
lng: z.ZodNumber;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
export declare const DIDCommQuoteMessageSchema: z.ZodObject<{
|
|
28
|
+
rfq_uuid: z.ZodUUID;
|
|
29
|
+
quote_uuid: z.ZodUUID;
|
|
30
|
+
start_point_uuid: z.ZodString;
|
|
31
|
+
start_point_other_uuid: z.ZodOptional<z.ZodString>;
|
|
32
|
+
end_point_uuid: z.ZodString;
|
|
33
|
+
end_point_other_uuid: z.ZodOptional<z.ZodString>;
|
|
34
|
+
validity_time: z.ZodNumber;
|
|
35
|
+
created_at: z.ZodString;
|
|
36
|
+
lead_time: z.ZodNumber;
|
|
37
|
+
initial_charge: z.ZodNumber;
|
|
38
|
+
recurring_charge: z.ZodNumber;
|
|
39
|
+
usage_charge: z.ZodNumber;
|
|
40
|
+
escrow_dole_schedule: z.ZodNumber;
|
|
41
|
+
escrow_settlement_schedule: z.ZodNumber;
|
|
42
|
+
gis_data: z.ZodArray<z.ZodObject<{
|
|
43
|
+
lat: z.ZodNumber;
|
|
44
|
+
lng: z.ZodNumber;
|
|
45
|
+
}, z.core.$strip>>;
|
|
46
|
+
contract_period: z.ZodNumber;
|
|
47
|
+
}, z.core.$strip>;
|
|
48
|
+
export type DIDCommQuotePayload = z.infer<typeof DIDCommQuoteMessageSchema>;
|
|
49
|
+
export declare const QuoteSchema: z.ZodIntersection<z.ZodObject<{
|
|
50
|
+
rfq_uuid: z.ZodUUID;
|
|
51
|
+
quote_uuid: z.ZodUUID;
|
|
52
|
+
start_point_uuid: z.ZodString;
|
|
53
|
+
start_point_other_uuid: z.ZodOptional<z.ZodString>;
|
|
54
|
+
end_point_uuid: z.ZodString;
|
|
55
|
+
end_point_other_uuid: z.ZodOptional<z.ZodString>;
|
|
56
|
+
validity_time: z.ZodNumber;
|
|
57
|
+
created_at: z.ZodString;
|
|
58
|
+
lead_time: z.ZodNumber;
|
|
59
|
+
initial_charge: z.ZodNumber;
|
|
60
|
+
recurring_charge: z.ZodNumber;
|
|
61
|
+
usage_charge: z.ZodNumber;
|
|
62
|
+
escrow_dole_schedule: z.ZodNumber;
|
|
63
|
+
escrow_settlement_schedule: z.ZodNumber;
|
|
64
|
+
gis_data: z.ZodArray<z.ZodObject<{
|
|
65
|
+
lat: z.ZodNumber;
|
|
66
|
+
lng: z.ZodNumber;
|
|
67
|
+
}, z.core.$strip>>;
|
|
68
|
+
contract_period: z.ZodNumber;
|
|
69
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
70
|
+
date: z.ZodString;
|
|
71
|
+
solutionProvider: z.ZodString;
|
|
72
|
+
hashHex: z.ZodString;
|
|
73
|
+
encryptedMessage: z.ZodString;
|
|
74
|
+
}, z.core.$strip>>;
|
|
75
|
+
export declare const SearchPointSchema: z.ZodObject<{
|
|
76
|
+
uuid: z.ZodUUID;
|
|
77
|
+
coordinate: z.ZodObject<{
|
|
78
|
+
lat: z.ZodNumber;
|
|
79
|
+
lng: z.ZodNumber;
|
|
80
|
+
}, z.core.$strip>;
|
|
81
|
+
}, z.core.$strip>;
|
|
82
|
+
export type Rfq = z.infer<typeof searchRequestSchema>;
|
|
83
|
+
export declare const searchRequestSchema: z.ZodObject<{
|
|
84
|
+
service_type: z.ZodString;
|
|
85
|
+
src_point: z.ZodObject<{
|
|
86
|
+
uuid: z.ZodUUID;
|
|
87
|
+
coordinate: z.ZodObject<{
|
|
88
|
+
lat: z.ZodNumber;
|
|
89
|
+
lng: z.ZodNumber;
|
|
90
|
+
}, z.core.$strip>;
|
|
91
|
+
}, z.core.$strip>;
|
|
92
|
+
dest_point: z.ZodObject<{
|
|
93
|
+
uuid: z.ZodUUID;
|
|
94
|
+
coordinate: z.ZodObject<{
|
|
95
|
+
lat: z.ZodNumber;
|
|
96
|
+
lng: z.ZodNumber;
|
|
97
|
+
}, z.core.$strip>;
|
|
98
|
+
}, z.core.$strip>;
|
|
99
|
+
speed: z.ZodNumber;
|
|
100
|
+
contract_period: z.ZodNumber;
|
|
101
|
+
charge_frequency: z.ZodEnum<{
|
|
102
|
+
readonly DAILY: "DAILY";
|
|
103
|
+
readonly WEEKLY: "WEEKLY";
|
|
104
|
+
readonly MONTHLY: "MONTHLY";
|
|
105
|
+
readonly SEMIANNUALLY: "SEMIANNUALLY";
|
|
106
|
+
readonly ANNUALLY: "ANNUALLY";
|
|
107
|
+
}>;
|
|
108
|
+
rfq_uuid: z.ZodUUID;
|
|
109
|
+
created_at: z.ZodString;
|
|
110
|
+
}, z.core.$strip>;
|
|
111
|
+
export declare const jwtSchema: z.ZodString;
|
|
112
|
+
export type JwtToken = z.infer<typeof jwtSchema>;
|
|
113
|
+
export declare const supportedNetworks: {
|
|
114
|
+
readonly holesky: "holesky";
|
|
115
|
+
readonly sepolia: "sepolia";
|
|
116
|
+
readonly lineaSepolia: "linea-sepolia";
|
|
117
|
+
};
|
|
118
|
+
export declare const supportedNetworkEnumSchema: z.ZodEnum<{
|
|
119
|
+
readonly holesky: "holesky";
|
|
120
|
+
readonly sepolia: "sepolia";
|
|
121
|
+
readonly lineaSepolia: "linea-sepolia";
|
|
122
|
+
}>;
|
|
123
|
+
export type NetworkId = z.infer<typeof supportedNetworkEnumSchema>;
|
|
124
|
+
declare const networkConfigSchema: z.ZodObject<{
|
|
125
|
+
name: z.ZodEnum<{
|
|
126
|
+
readonly holesky: "holesky";
|
|
127
|
+
readonly sepolia: "sepolia";
|
|
128
|
+
readonly lineaSepolia: "linea-sepolia";
|
|
129
|
+
}>;
|
|
130
|
+
registryAddress: z.ZodString;
|
|
131
|
+
intChainId: z.ZodNumber;
|
|
132
|
+
hexChainId: z.ZodString;
|
|
133
|
+
providers: z.ZodArray<z.ZodObject<{
|
|
134
|
+
name: z.ZodString;
|
|
135
|
+
rpcUrl: z.ZodString;
|
|
136
|
+
apiKeyRequired: z.ZodBoolean;
|
|
137
|
+
}, z.core.$strip>>;
|
|
138
|
+
}, z.core.$strip>;
|
|
139
|
+
export declare const configJsonSchema: z.ZodObject<{
|
|
140
|
+
networkSelection: z.ZodEnum<{
|
|
141
|
+
readonly holesky: "holesky";
|
|
142
|
+
readonly sepolia: "sepolia";
|
|
143
|
+
readonly lineaSepolia: "linea-sepolia";
|
|
144
|
+
}>;
|
|
145
|
+
selectedNetwork: z.ZodOptional<z.ZodObject<{
|
|
146
|
+
name: z.ZodEnum<{
|
|
147
|
+
readonly holesky: "holesky";
|
|
148
|
+
readonly sepolia: "sepolia";
|
|
149
|
+
readonly lineaSepolia: "linea-sepolia";
|
|
150
|
+
}>;
|
|
151
|
+
registryAddress: z.ZodString;
|
|
152
|
+
intChainId: z.ZodNumber;
|
|
153
|
+
hexChainId: z.ZodString;
|
|
154
|
+
providers: z.ZodArray<z.ZodObject<{
|
|
155
|
+
name: z.ZodString;
|
|
156
|
+
rpcUrl: z.ZodString;
|
|
157
|
+
apiKeyRequired: z.ZodBoolean;
|
|
158
|
+
}, z.core.$strip>>;
|
|
159
|
+
}, z.core.$strip>>;
|
|
160
|
+
}, z.core.$strip>;
|
|
161
|
+
export type NetworkConfig = z.infer<typeof networkConfigSchema>;
|
|
162
|
+
export declare const networksSchema: z.ZodRecord<z.ZodEnum<{
|
|
163
|
+
readonly holesky: "holesky";
|
|
164
|
+
readonly sepolia: "sepolia";
|
|
165
|
+
readonly lineaSepolia: "linea-sepolia";
|
|
166
|
+
}>, z.ZodObject<{
|
|
167
|
+
name: z.ZodEnum<{
|
|
168
|
+
readonly holesky: "holesky";
|
|
169
|
+
readonly sepolia: "sepolia";
|
|
170
|
+
readonly lineaSepolia: "linea-sepolia";
|
|
171
|
+
}>;
|
|
172
|
+
registryAddress: z.ZodString;
|
|
173
|
+
intChainId: z.ZodNumber;
|
|
174
|
+
hexChainId: z.ZodString;
|
|
175
|
+
providers: z.ZodArray<z.ZodObject<{
|
|
176
|
+
name: z.ZodString;
|
|
177
|
+
rpcUrl: z.ZodString;
|
|
178
|
+
apiKeyRequired: z.ZodBoolean;
|
|
179
|
+
}, z.core.$strip>>;
|
|
180
|
+
}, z.core.$strip>>;
|
|
181
|
+
export declare const issuerTypeSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
182
|
+
id: z.ZodString;
|
|
183
|
+
}, z.core.$strip>, z.ZodString]>;
|
|
184
|
+
export declare const credentialSubjectSchema: z.ZodObject<{
|
|
185
|
+
id: z.ZodOptional<z.ZodString>;
|
|
186
|
+
message: z.ZodOptional<z.ZodString>;
|
|
187
|
+
}, z.core.$strip>;
|
|
188
|
+
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>]>>]>;
|
|
189
|
+
export declare const credentialStatusReferenceSchema: z.ZodObject<{
|
|
190
|
+
id: z.ZodString;
|
|
191
|
+
type: z.ZodString;
|
|
192
|
+
}, z.core.$strip>;
|
|
193
|
+
export declare const unsignedCredentialSchema: z.ZodObject<{
|
|
194
|
+
issuer: z.ZodUnion<readonly [z.ZodObject<{
|
|
195
|
+
id: z.ZodString;
|
|
196
|
+
}, z.core.$strip>, z.ZodString]>;
|
|
197
|
+
credentialSubject: z.ZodObject<{
|
|
198
|
+
id: z.ZodOptional<z.ZodString>;
|
|
199
|
+
message: z.ZodOptional<z.ZodString>;
|
|
200
|
+
}, z.core.$strip>;
|
|
201
|
+
credentialSchema: z.ZodOptional<z.ZodObject<{
|
|
202
|
+
id: z.ZodOptional<z.ZodString>;
|
|
203
|
+
type: z.ZodOptional<z.ZodString>;
|
|
204
|
+
}, z.core.$strip>>;
|
|
205
|
+
type: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodString]>>;
|
|
206
|
+
'@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>]>>]>;
|
|
207
|
+
issuanceDate: z.ZodString;
|
|
208
|
+
expirationDate: z.ZodOptional<z.ZodString>;
|
|
209
|
+
credentialStatus: z.ZodOptional<z.ZodObject<{
|
|
210
|
+
id: z.ZodString;
|
|
211
|
+
type: z.ZodString;
|
|
212
|
+
}, z.core.$strip>>;
|
|
213
|
+
id: z.ZodOptional<z.ZodString>;
|
|
214
|
+
}, z.core.$strip>;
|
|
215
|
+
export declare const jwtProofTypeSchema: z.ZodObject<{
|
|
216
|
+
type: z.ZodOptional<z.ZodString>;
|
|
217
|
+
jwt: z.ZodOptional<z.ZodString>;
|
|
218
|
+
}, z.core.$strip>;
|
|
219
|
+
export declare const eip712ProofTypeSchema: z.ZodObject<{
|
|
220
|
+
type: z.ZodOptional<z.ZodString>;
|
|
221
|
+
verificationMethod: z.ZodOptional<z.ZodString>;
|
|
222
|
+
created: z.ZodOptional<z.ZodString>;
|
|
223
|
+
proofPurpose: z.ZodOptional<z.ZodString>;
|
|
224
|
+
proofValue: z.ZodOptional<z.ZodString>;
|
|
225
|
+
eip712: z.ZodOptional<z.ZodObject<{
|
|
226
|
+
domain: z.ZodOptional<z.ZodObject<{
|
|
227
|
+
chainId: z.ZodNumber;
|
|
228
|
+
name: z.ZodString;
|
|
229
|
+
version: z.ZodString;
|
|
230
|
+
}, z.core.$strip>>;
|
|
231
|
+
types: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
232
|
+
primaryType: z.ZodOptional<z.ZodString>;
|
|
233
|
+
}, z.core.$strip>>;
|
|
234
|
+
}, z.core.$strip>;
|
|
235
|
+
export declare const proofTypeSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
236
|
+
type: z.ZodOptional<z.ZodString>;
|
|
237
|
+
jwt: z.ZodOptional<z.ZodString>;
|
|
238
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
239
|
+
type: z.ZodOptional<z.ZodString>;
|
|
240
|
+
verificationMethod: z.ZodOptional<z.ZodString>;
|
|
241
|
+
created: z.ZodOptional<z.ZodString>;
|
|
242
|
+
proofPurpose: z.ZodOptional<z.ZodString>;
|
|
243
|
+
proofValue: z.ZodOptional<z.ZodString>;
|
|
244
|
+
eip712: z.ZodOptional<z.ZodObject<{
|
|
245
|
+
domain: z.ZodOptional<z.ZodObject<{
|
|
246
|
+
chainId: z.ZodNumber;
|
|
247
|
+
name: z.ZodString;
|
|
248
|
+
version: z.ZodString;
|
|
249
|
+
}, z.core.$strip>>;
|
|
250
|
+
types: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
251
|
+
primaryType: z.ZodOptional<z.ZodString>;
|
|
252
|
+
}, z.core.$strip>>;
|
|
253
|
+
}, z.core.$strip>]>;
|
|
254
|
+
export declare const VerifiableCredentialSchema: z.ZodIntersection<z.ZodObject<{
|
|
255
|
+
issuer: z.ZodUnion<readonly [z.ZodObject<{
|
|
256
|
+
id: z.ZodString;
|
|
257
|
+
}, z.core.$strip>, z.ZodString]>;
|
|
258
|
+
credentialSubject: z.ZodObject<{
|
|
259
|
+
id: z.ZodOptional<z.ZodString>;
|
|
260
|
+
message: z.ZodOptional<z.ZodString>;
|
|
261
|
+
}, z.core.$strip>;
|
|
262
|
+
credentialSchema: z.ZodOptional<z.ZodObject<{
|
|
263
|
+
id: z.ZodOptional<z.ZodString>;
|
|
264
|
+
type: z.ZodOptional<z.ZodString>;
|
|
265
|
+
}, z.core.$strip>>;
|
|
266
|
+
type: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodString]>>;
|
|
267
|
+
'@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>]>>]>;
|
|
268
|
+
issuanceDate: z.ZodString;
|
|
269
|
+
expirationDate: z.ZodOptional<z.ZodString>;
|
|
270
|
+
credentialStatus: z.ZodOptional<z.ZodObject<{
|
|
271
|
+
id: z.ZodString;
|
|
272
|
+
type: z.ZodString;
|
|
273
|
+
}, z.core.$strip>>;
|
|
274
|
+
id: z.ZodOptional<z.ZodString>;
|
|
275
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
276
|
+
proof: z.ZodUnion<readonly [z.ZodObject<{
|
|
277
|
+
type: z.ZodOptional<z.ZodString>;
|
|
278
|
+
jwt: z.ZodOptional<z.ZodString>;
|
|
279
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
280
|
+
type: z.ZodOptional<z.ZodString>;
|
|
281
|
+
verificationMethod: z.ZodOptional<z.ZodString>;
|
|
282
|
+
created: z.ZodOptional<z.ZodString>;
|
|
283
|
+
proofPurpose: z.ZodOptional<z.ZodString>;
|
|
284
|
+
proofValue: z.ZodOptional<z.ZodString>;
|
|
285
|
+
eip712: z.ZodOptional<z.ZodObject<{
|
|
286
|
+
domain: z.ZodOptional<z.ZodObject<{
|
|
287
|
+
chainId: z.ZodNumber;
|
|
288
|
+
name: z.ZodString;
|
|
289
|
+
version: z.ZodString;
|
|
290
|
+
}, z.core.$strip>>;
|
|
291
|
+
types: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
292
|
+
primaryType: z.ZodOptional<z.ZodString>;
|
|
293
|
+
}, z.core.$strip>>;
|
|
294
|
+
}, z.core.$strip>]>;
|
|
295
|
+
}, z.core.$strip>>;
|
|
296
|
+
export declare const CreateSearchVcSchema: z.ZodTuple<[z.ZodString, z.ZodIntersection<z.ZodObject<{
|
|
297
|
+
issuer: z.ZodUnion<readonly [z.ZodObject<{
|
|
298
|
+
id: z.ZodString;
|
|
299
|
+
}, z.core.$strip>, z.ZodString]>;
|
|
300
|
+
credentialSubject: z.ZodObject<{
|
|
301
|
+
id: z.ZodOptional<z.ZodString>;
|
|
302
|
+
message: z.ZodOptional<z.ZodString>;
|
|
303
|
+
}, z.core.$strip>;
|
|
304
|
+
credentialSchema: z.ZodOptional<z.ZodObject<{
|
|
305
|
+
id: z.ZodOptional<z.ZodString>;
|
|
306
|
+
type: z.ZodOptional<z.ZodString>;
|
|
307
|
+
}, z.core.$strip>>;
|
|
308
|
+
type: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodString]>>;
|
|
309
|
+
'@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>]>>]>;
|
|
310
|
+
issuanceDate: z.ZodString;
|
|
311
|
+
expirationDate: z.ZodOptional<z.ZodString>;
|
|
312
|
+
credentialStatus: z.ZodOptional<z.ZodObject<{
|
|
313
|
+
id: z.ZodString;
|
|
314
|
+
type: z.ZodString;
|
|
315
|
+
}, z.core.$strip>>;
|
|
316
|
+
id: z.ZodOptional<z.ZodString>;
|
|
317
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
318
|
+
proof: z.ZodUnion<readonly [z.ZodObject<{
|
|
319
|
+
type: z.ZodOptional<z.ZodString>;
|
|
320
|
+
jwt: z.ZodOptional<z.ZodString>;
|
|
321
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
322
|
+
type: z.ZodOptional<z.ZodString>;
|
|
323
|
+
verificationMethod: z.ZodOptional<z.ZodString>;
|
|
324
|
+
created: z.ZodOptional<z.ZodString>;
|
|
325
|
+
proofPurpose: z.ZodOptional<z.ZodString>;
|
|
326
|
+
proofValue: z.ZodOptional<z.ZodString>;
|
|
327
|
+
eip712: z.ZodOptional<z.ZodObject<{
|
|
328
|
+
domain: z.ZodOptional<z.ZodObject<{
|
|
329
|
+
chainId: z.ZodNumber;
|
|
330
|
+
name: z.ZodString;
|
|
331
|
+
version: z.ZodString;
|
|
332
|
+
}, z.core.$strip>>;
|
|
333
|
+
types: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
334
|
+
primaryType: z.ZodOptional<z.ZodString>;
|
|
335
|
+
}, z.core.$strip>>;
|
|
336
|
+
}, z.core.$strip>]>;
|
|
337
|
+
}, z.core.$strip>>], null>;
|
|
338
|
+
export declare const IErrorSchema: z.ZodObject<{
|
|
339
|
+
message: z.ZodOptional<z.ZodString>;
|
|
340
|
+
errorCode: z.ZodOptional<z.ZodString>;
|
|
341
|
+
}, z.core.$strip>;
|
|
342
|
+
export declare const IVerifyResultSchema: z.ZodIntersection<z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodObject<{
|
|
343
|
+
verified: z.ZodBoolean;
|
|
344
|
+
error: z.ZodOptional<z.ZodObject<{
|
|
345
|
+
message: z.ZodOptional<z.ZodString>;
|
|
346
|
+
errorCode: z.ZodOptional<z.ZodString>;
|
|
347
|
+
}, z.core.$strip>>;
|
|
348
|
+
}, z.core.$strip>>;
|
|
349
|
+
export declare const LoginVcMessageSchema: z.ZodObject<{
|
|
350
|
+
nonce: z.ZodString;
|
|
351
|
+
}, z.core.$strip>;
|
|
352
|
+
export declare const ResultSchema: <T extends z.ZodTypeAny>(dataSchema: T) => z.ZodUnion<readonly [z.ZodTuple<[z.ZodLiteral<true>, T], null>, z.ZodTuple<[z.ZodLiteral<false>, z.ZodString], null>]>;
|
|
353
|
+
export declare const EphemeralPublicKeySchema: z.ZodObject<{
|
|
354
|
+
kty: z.ZodOptional<z.ZodString>;
|
|
355
|
+
crv: z.ZodOptional<z.ZodString>;
|
|
356
|
+
x: z.ZodOptional<z.ZodString>;
|
|
357
|
+
y: z.ZodOptional<z.ZodString>;
|
|
358
|
+
n: z.ZodOptional<z.ZodString>;
|
|
359
|
+
e: z.ZodOptional<z.ZodString>;
|
|
360
|
+
}, z.core.$strip>;
|
|
361
|
+
export declare const RecipientHeaderSchema: z.ZodObject<{
|
|
362
|
+
alg: z.ZodOptional<z.ZodString>;
|
|
363
|
+
iv: z.ZodOptional<z.ZodString>;
|
|
364
|
+
tag: z.ZodOptional<z.ZodString>;
|
|
365
|
+
epk: z.ZodOptional<z.ZodObject<{
|
|
366
|
+
kty: z.ZodOptional<z.ZodString>;
|
|
367
|
+
crv: z.ZodOptional<z.ZodString>;
|
|
368
|
+
x: z.ZodOptional<z.ZodString>;
|
|
369
|
+
y: z.ZodOptional<z.ZodString>;
|
|
370
|
+
n: z.ZodOptional<z.ZodString>;
|
|
371
|
+
e: z.ZodOptional<z.ZodString>;
|
|
372
|
+
}, z.core.$strip>>;
|
|
373
|
+
kid: z.ZodOptional<z.ZodString>;
|
|
374
|
+
apv: z.ZodOptional<z.ZodString>;
|
|
375
|
+
apu: z.ZodOptional<z.ZodString>;
|
|
376
|
+
}, z.core.$strip>;
|
|
377
|
+
export declare const RecipientSchema: z.ZodObject<{
|
|
378
|
+
header: z.ZodObject<{
|
|
379
|
+
alg: z.ZodOptional<z.ZodString>;
|
|
380
|
+
iv: z.ZodOptional<z.ZodString>;
|
|
381
|
+
tag: z.ZodOptional<z.ZodString>;
|
|
382
|
+
epk: z.ZodOptional<z.ZodObject<{
|
|
383
|
+
kty: z.ZodOptional<z.ZodString>;
|
|
384
|
+
crv: z.ZodOptional<z.ZodString>;
|
|
385
|
+
x: z.ZodOptional<z.ZodString>;
|
|
386
|
+
y: z.ZodOptional<z.ZodString>;
|
|
387
|
+
n: z.ZodOptional<z.ZodString>;
|
|
388
|
+
e: z.ZodOptional<z.ZodString>;
|
|
389
|
+
}, z.core.$strip>>;
|
|
390
|
+
kid: z.ZodOptional<z.ZodString>;
|
|
391
|
+
apv: z.ZodOptional<z.ZodString>;
|
|
392
|
+
apu: z.ZodOptional<z.ZodString>;
|
|
393
|
+
}, z.core.$strip>;
|
|
394
|
+
encrypted_key: z.ZodString;
|
|
395
|
+
}, z.core.$strip>;
|
|
396
|
+
export declare const JWESchema: z.ZodObject<{
|
|
397
|
+
protected: z.ZodString;
|
|
398
|
+
iv: z.ZodString;
|
|
399
|
+
ciphertext: z.ZodString;
|
|
400
|
+
tag: z.ZodString;
|
|
401
|
+
add: z.ZodOptional<z.ZodString>;
|
|
402
|
+
recipients: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
403
|
+
header: z.ZodObject<{
|
|
404
|
+
alg: z.ZodOptional<z.ZodString>;
|
|
405
|
+
iv: z.ZodOptional<z.ZodString>;
|
|
406
|
+
tag: z.ZodOptional<z.ZodString>;
|
|
407
|
+
epk: z.ZodOptional<z.ZodObject<{
|
|
408
|
+
kty: z.ZodOptional<z.ZodString>;
|
|
409
|
+
crv: z.ZodOptional<z.ZodString>;
|
|
410
|
+
x: z.ZodOptional<z.ZodString>;
|
|
411
|
+
y: z.ZodOptional<z.ZodString>;
|
|
412
|
+
n: z.ZodOptional<z.ZodString>;
|
|
413
|
+
e: z.ZodOptional<z.ZodString>;
|
|
414
|
+
}, z.core.$strip>>;
|
|
415
|
+
kid: z.ZodOptional<z.ZodString>;
|
|
416
|
+
apv: z.ZodOptional<z.ZodString>;
|
|
417
|
+
apu: z.ZodOptional<z.ZodString>;
|
|
418
|
+
}, z.core.$strip>;
|
|
419
|
+
encrypted_key: z.ZodString;
|
|
420
|
+
}, z.core.$strip>>>;
|
|
421
|
+
}, z.core.$strip>;
|
|
422
|
+
export {};
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.JWESchema = exports.RecipientSchema = exports.RecipientHeaderSchema = exports.EphemeralPublicKeySchema = exports.ResultSchema = exports.LoginVcMessageSchema = exports.IVerifyResultSchema = exports.IErrorSchema = exports.CreateSearchVcSchema = exports.VerifiableCredentialSchema = exports.proofTypeSchema = exports.eip712ProofTypeSchema = exports.jwtProofTypeSchema = exports.unsignedCredentialSchema = exports.credentialStatusReferenceSchema = exports.contextTypeSchema = exports.credentialSubjectSchema = exports.issuerTypeSchema = exports.networksSchema = exports.configJsonSchema = exports.supportedNetworkEnumSchema = exports.supportedNetworks = exports.jwtSchema = exports.searchRequestSchema = exports.SearchPointSchema = exports.QuoteSchema = exports.DIDCommQuoteMessageSchema = exports.GisPointSchema = exports.nniPayloadSchema = exports.postMessagePayloadSchema = exports.postMessageSchema = exports.ChargeFrequency = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.ChargeFrequency = {
|
|
6
|
+
DAILY: 'DAILY',
|
|
7
|
+
WEEKLY: 'WEEKLY',
|
|
8
|
+
MONTHLY: 'MONTHLY',
|
|
9
|
+
SEMIANNUALLY: 'SEMIANNUALLY',
|
|
10
|
+
ANNUALLY: 'ANNUALLY',
|
|
11
|
+
};
|
|
12
|
+
exports.postMessageSchema = zod_1.z.intersection(zod_1.z.object({
|
|
13
|
+
type: zod_1.z.string().optional(),
|
|
14
|
+
}), zod_1.z.record(zod_1.z.string(), zod_1.z.any()));
|
|
15
|
+
exports.postMessagePayloadSchema = zod_1.z.object({
|
|
16
|
+
type: zod_1.z.literal('JWT_TOKEN'),
|
|
17
|
+
token: zod_1.z.string().min(1, 'JWT token cannot be empty.'),
|
|
18
|
+
});
|
|
19
|
+
exports.nniPayloadSchema = zod_1.z.object({
|
|
20
|
+
nni_uuid: zod_1.z.string(),
|
|
21
|
+
name: zod_1.z.string(),
|
|
22
|
+
});
|
|
23
|
+
exports.GisPointSchema = zod_1.z.object({ lat: zod_1.z.number(), lng: zod_1.z.number() });
|
|
24
|
+
exports.DIDCommQuoteMessageSchema = zod_1.z.object({
|
|
25
|
+
rfq_uuid: zod_1.z.uuid(),
|
|
26
|
+
quote_uuid: zod_1.z.uuid(),
|
|
27
|
+
start_point_uuid: zod_1.z.string(),
|
|
28
|
+
start_point_other_uuid: zod_1.z.string().optional(),
|
|
29
|
+
end_point_uuid: zod_1.z.string(),
|
|
30
|
+
end_point_other_uuid: zod_1.z.string().optional(),
|
|
31
|
+
validity_time: zod_1.z.number(),
|
|
32
|
+
created_at: zod_1.z.string(),
|
|
33
|
+
lead_time: zod_1.z.number(),
|
|
34
|
+
initial_charge: zod_1.z.number(),
|
|
35
|
+
recurring_charge: zod_1.z.number(),
|
|
36
|
+
usage_charge: zod_1.z.number(),
|
|
37
|
+
escrow_dole_schedule: zod_1.z.number(),
|
|
38
|
+
escrow_settlement_schedule: zod_1.z.number(),
|
|
39
|
+
gis_data: zod_1.z.array(exports.GisPointSchema),
|
|
40
|
+
contract_period: zod_1.z.number(),
|
|
41
|
+
});
|
|
42
|
+
exports.QuoteSchema = exports.DIDCommQuoteMessageSchema.and(zod_1.z.object({
|
|
43
|
+
date: zod_1.z.string(),
|
|
44
|
+
solutionProvider: zod_1.z.string(),
|
|
45
|
+
hashHex: zod_1.z.string(),
|
|
46
|
+
encryptedMessage: zod_1.z.string(),
|
|
47
|
+
}));
|
|
48
|
+
exports.SearchPointSchema = zod_1.z.object({
|
|
49
|
+
uuid: zod_1.z.uuid(),
|
|
50
|
+
coordinate: exports.GisPointSchema,
|
|
51
|
+
});
|
|
52
|
+
// TODO: This is build on the fly to verify for RFQ table
|
|
53
|
+
exports.searchRequestSchema = zod_1.z.object({
|
|
54
|
+
service_type: zod_1.z.string(),
|
|
55
|
+
src_point: exports.SearchPointSchema,
|
|
56
|
+
dest_point: exports.SearchPointSchema,
|
|
57
|
+
speed: zod_1.z.number(),
|
|
58
|
+
contract_period: zod_1.z.number(),
|
|
59
|
+
charge_frequency: zod_1.z.enum(exports.ChargeFrequency),
|
|
60
|
+
rfq_uuid: zod_1.z.uuid(),
|
|
61
|
+
created_at: zod_1.z.string(),
|
|
62
|
+
});
|
|
63
|
+
exports.jwtSchema = zod_1.z
|
|
64
|
+
.string()
|
|
65
|
+
.regex(/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+$/, 'Invalid JWT format');
|
|
66
|
+
exports.supportedNetworks = {
|
|
67
|
+
holesky: 'holesky',
|
|
68
|
+
sepolia: 'sepolia',
|
|
69
|
+
lineaSepolia: 'linea-sepolia',
|
|
70
|
+
};
|
|
71
|
+
exports.supportedNetworkEnumSchema = zod_1.z.enum(exports.supportedNetworks);
|
|
72
|
+
const networkProviderSchema = zod_1.z.object({
|
|
73
|
+
name: zod_1.z.string().min(1),
|
|
74
|
+
rpcUrl: zod_1.z.string().min(1),
|
|
75
|
+
apiKeyRequired: zod_1.z.boolean(),
|
|
76
|
+
});
|
|
77
|
+
const networkConfigSchema = zod_1.z
|
|
78
|
+
.object({
|
|
79
|
+
name: exports.supportedNetworkEnumSchema,
|
|
80
|
+
registryAddress: zod_1.z.string().startsWith('0x'),
|
|
81
|
+
intChainId: zod_1.z.number(),
|
|
82
|
+
hexChainId: zod_1.z.string().startsWith('0x'),
|
|
83
|
+
providers: zod_1.z.array(networkProviderSchema),
|
|
84
|
+
})
|
|
85
|
+
.refine((val) => {
|
|
86
|
+
const { intChainId, hexChainId } = val;
|
|
87
|
+
// Convert hex chain id to number
|
|
88
|
+
const hexInInt = parseInt(hexChainId, 16);
|
|
89
|
+
return !isNaN(hexInInt) && hexInInt === intChainId;
|
|
90
|
+
}, {
|
|
91
|
+
message: 'hexChainId does not match intChainId',
|
|
92
|
+
});
|
|
93
|
+
exports.configJsonSchema = zod_1.z.object({
|
|
94
|
+
networkSelection: exports.supportedNetworkEnumSchema,
|
|
95
|
+
selectedNetwork: networkConfigSchema.optional(),
|
|
96
|
+
});
|
|
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
|
+
exports.jwtProofTypeSchema = zod_1.z.object({
|
|
134
|
+
type: zod_1.z.string().optional(),
|
|
135
|
+
jwt: zod_1.z.string().optional(),
|
|
136
|
+
});
|
|
137
|
+
exports.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
|
+
exports.jwtProofTypeSchema,
|
|
159
|
+
exports.eip712ProofTypeSchema,
|
|
160
|
+
]);
|
|
161
|
+
exports.VerifiableCredentialSchema = exports.unsignedCredentialSchema.and(zod_1.z.object({
|
|
162
|
+
proof: exports.proofTypeSchema,
|
|
163
|
+
}));
|
|
164
|
+
exports.CreateSearchVcSchema = zod_1.z.tuple([
|
|
165
|
+
zod_1.z.string(),
|
|
166
|
+
exports.VerifiableCredentialSchema,
|
|
167
|
+
]);
|
|
168
|
+
exports.IErrorSchema = zod_1.z.object({
|
|
169
|
+
message: zod_1.z.string().optional(),
|
|
170
|
+
errorCode: zod_1.z.string().optional(),
|
|
171
|
+
});
|
|
172
|
+
exports.IVerifyResultSchema = zod_1.z.record(zod_1.z.string(), zod_1.z.any()).and(zod_1.z.object({
|
|
173
|
+
verified: zod_1.z.boolean(),
|
|
174
|
+
error: exports.IErrorSchema.optional(),
|
|
175
|
+
}));
|
|
176
|
+
exports.LoginVcMessageSchema = zod_1.z.object({
|
|
177
|
+
nonce: zod_1.z.string(),
|
|
178
|
+
});
|
|
179
|
+
const ResultSchema = (dataSchema) => zod_1.z.union([
|
|
180
|
+
zod_1.z.tuple([zod_1.z.literal(true), dataSchema]),
|
|
181
|
+
zod_1.z.tuple([zod_1.z.literal(false), zod_1.z.string()]),
|
|
182
|
+
]);
|
|
183
|
+
exports.ResultSchema = ResultSchema;
|
|
184
|
+
exports.EphemeralPublicKeySchema = zod_1.z.object({
|
|
185
|
+
kty: zod_1.z.string().optional(),
|
|
186
|
+
crv: zod_1.z.string().optional(),
|
|
187
|
+
x: zod_1.z.string().optional(),
|
|
188
|
+
y: zod_1.z.string().optional(),
|
|
189
|
+
n: zod_1.z.string().optional(),
|
|
190
|
+
e: zod_1.z.string().optional(),
|
|
191
|
+
});
|
|
192
|
+
exports.RecipientHeaderSchema = zod_1.z.object({
|
|
193
|
+
alg: zod_1.z.string().optional(),
|
|
194
|
+
iv: zod_1.z.string().optional(),
|
|
195
|
+
tag: zod_1.z.string().optional(),
|
|
196
|
+
epk: exports.EphemeralPublicKeySchema.optional(),
|
|
197
|
+
kid: zod_1.z.string().optional(),
|
|
198
|
+
apv: zod_1.z.string().optional(),
|
|
199
|
+
apu: zod_1.z.string().optional(),
|
|
200
|
+
});
|
|
201
|
+
exports.RecipientSchema = zod_1.z.object({
|
|
202
|
+
header: exports.RecipientHeaderSchema,
|
|
203
|
+
encrypted_key: zod_1.z.string(),
|
|
204
|
+
});
|
|
205
|
+
exports.JWESchema = zod_1.z.object({
|
|
206
|
+
protected: zod_1.z.string(),
|
|
207
|
+
iv: zod_1.z.string(),
|
|
208
|
+
ciphertext: zod_1.z.string(),
|
|
209
|
+
tag: zod_1.z.string(),
|
|
210
|
+
add: zod_1.z.string().optional(),
|
|
211
|
+
recipients: zod_1.z.array(exports.RecipientSchema).optional(),
|
|
212
|
+
});
|