televerse-dao-typechain-types 1.0.8-alpha.20 → 1.0.8-alpha.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "televerse-dao-typechain-types",
3
3
  "sourceType": "commonjs",
4
- "version": "1.0.8-alpha.20",
4
+ "version": "1.0.8-alpha.22",
5
5
  "description": "The typechain types for the Televerse DAO smart contracts.",
6
6
  "license": "MIT",
7
7
  "files": [
@@ -89,6 +89,7 @@
89
89
  "axios": "^1.10.0",
90
90
  "did-jwt": "^8.0.18",
91
91
  "dotenv": "17.1.0",
92
+ "televerse-shared-schema": "0.0.2-alpha.2",
92
93
  "ts-node": "10.9.2",
93
94
  "typescript": "5.8.3",
94
95
  "web3": "^4.16.0",
@@ -17,13 +17,145 @@ export declare const gisPointSchema: z.ZodObject<{
17
17
  lat: z.ZodNumber;
18
18
  lng: z.ZodNumber;
19
19
  }, z.core.$strip>;
20
+ export declare const searchRequestPointSchema: z.ZodObject<{
21
+ uuid: z.ZodUUID;
22
+ coordinate: z.ZodObject<{
23
+ lat: z.ZodNumber;
24
+ lng: z.ZodNumber;
25
+ }, z.core.$strip>;
26
+ }, z.core.$strip>;
27
+ export declare const searchRequestPayloadSchema: z.ZodUnion<[z.ZodObject<{
28
+ service_type: z.ZodEnum<{
29
+ readonly POINT_TO_POINT: "POINT_TO_POINT";
30
+ readonly INTERNET: "INTERNET";
31
+ }>;
32
+ src_point: z.ZodObject<{
33
+ uuid: z.ZodUUID;
34
+ coordinate: z.ZodObject<{
35
+ lat: z.ZodNumber;
36
+ lng: z.ZodNumber;
37
+ }, z.core.$strip>;
38
+ }, z.core.$strip>;
39
+ dest_point: z.ZodObject<{
40
+ uuid: z.ZodUUID;
41
+ coordinate: z.ZodObject<{
42
+ lat: z.ZodNumber;
43
+ lng: z.ZodNumber;
44
+ }, z.core.$strip>;
45
+ }, z.core.$strip>;
46
+ speed: z.ZodNumber;
47
+ contract_period_count: z.ZodNumber;
48
+ contract_period_unit: z.ZodEnum<{
49
+ readonly DAILY: "DAILY";
50
+ readonly WEEKLY: "WEEKLY";
51
+ readonly MONTHLY: "MONTHLY";
52
+ readonly SEMIANNUALLY: "SEMIANNUALLY";
53
+ readonly ANNUALLY: "ANNUALLY";
54
+ }>;
55
+ rfq_uuid: z.ZodUUID;
56
+ created_at: z.ZodString;
57
+ tender_sec: z.ZodNumber;
58
+ }, z.core.$strip>, z.ZodObject<{
59
+ service_type: z.ZodEnum<{
60
+ readonly POINT_TO_POINT: "POINT_TO_POINT";
61
+ readonly INTERNET: "INTERNET";
62
+ }>;
63
+ src_point: z.ZodObject<{
64
+ uuid: z.ZodUUID;
65
+ coordinate: z.ZodObject<{
66
+ lat: z.ZodNumber;
67
+ lng: z.ZodNumber;
68
+ }, z.core.$strip>;
69
+ }, z.core.$strip>;
70
+ dest_point: z.ZodObject<{
71
+ uuid: z.ZodUUID;
72
+ coordinate: z.ZodObject<{
73
+ lat: z.ZodNumber;
74
+ lng: z.ZodNumber;
75
+ }, z.core.$strip>;
76
+ }, z.core.$strip>;
77
+ speed: z.ZodNumber;
78
+ contract_period_count: z.ZodNumber;
79
+ contract_period_unit: z.ZodEnum<{
80
+ readonly DAILY: "DAILY";
81
+ readonly WEEKLY: "WEEKLY";
82
+ readonly MONTHLY: "MONTHLY";
83
+ readonly SEMIANNUALLY: "SEMIANNUALLY";
84
+ readonly ANNUALLY: "ANNUALLY";
85
+ }>;
86
+ rfq_uuid: z.ZodString;
87
+ created_at: z.ZodString;
88
+ tender_sec: z.ZodNumber;
89
+ }, z.core.$strip>]>;
90
+ export declare const searchRequestWithoutRfqUuidSchema: z.ZodUnion<[z.ZodObject<{
91
+ src_point: z.ZodObject<{
92
+ uuid: z.ZodUUID;
93
+ coordinate: z.ZodObject<{
94
+ lat: z.ZodNumber;
95
+ lng: z.ZodNumber;
96
+ }, z.core.$strip>;
97
+ }, z.core.$strip>;
98
+ dest_point: z.ZodObject<{
99
+ uuid: z.ZodUUID;
100
+ coordinate: z.ZodObject<{
101
+ lat: z.ZodNumber;
102
+ lng: z.ZodNumber;
103
+ }, z.core.$strip>;
104
+ }, z.core.$strip>;
105
+ service_type: z.ZodEnum<{
106
+ readonly POINT_TO_POINT: "POINT_TO_POINT";
107
+ readonly INTERNET: "INTERNET";
108
+ }>;
109
+ speed: z.ZodNumber;
110
+ contract_period_count: z.ZodNumber;
111
+ contract_period_unit: z.ZodEnum<{
112
+ readonly DAILY: "DAILY";
113
+ readonly WEEKLY: "WEEKLY";
114
+ readonly MONTHLY: "MONTHLY";
115
+ readonly SEMIANNUALLY: "SEMIANNUALLY";
116
+ readonly ANNUALLY: "ANNUALLY";
117
+ }>;
118
+ created_at: z.ZodString;
119
+ tender_sec: z.ZodNumber;
120
+ }, z.core.$strip>, z.ZodObject<{
121
+ src_point: z.ZodObject<{
122
+ uuid: z.ZodUUID;
123
+ coordinate: z.ZodObject<{
124
+ lat: z.ZodNumber;
125
+ lng: z.ZodNumber;
126
+ }, z.core.$strip>;
127
+ }, z.core.$strip>;
128
+ dest_point: z.ZodObject<{
129
+ uuid: z.ZodUUID;
130
+ coordinate: z.ZodObject<{
131
+ lat: z.ZodNumber;
132
+ lng: z.ZodNumber;
133
+ }, z.core.$strip>;
134
+ }, z.core.$strip>;
135
+ service_type: z.ZodEnum<{
136
+ readonly POINT_TO_POINT: "POINT_TO_POINT";
137
+ readonly INTERNET: "INTERNET";
138
+ }>;
139
+ speed: z.ZodNumber;
140
+ contract_period_count: z.ZodNumber;
141
+ contract_period_unit: z.ZodEnum<{
142
+ readonly DAILY: "DAILY";
143
+ readonly WEEKLY: "WEEKLY";
144
+ readonly MONTHLY: "MONTHLY";
145
+ readonly SEMIANNUALLY: "SEMIANNUALLY";
146
+ readonly ANNUALLY: "ANNUALLY";
147
+ }>;
148
+ created_at: z.ZodString;
149
+ tender_sec: z.ZodNumber;
150
+ }, z.core.$strip>]>;
151
+ export type SearchRequestPayload = z.infer<typeof searchRequestPayloadSchema>;
20
152
  export declare const DIDCommQuoteMessageSchema: z.ZodObject<{
21
153
  rfq_uuid: z.ZodUUID;
22
154
  quote_uuid: z.ZodUUID;
23
- start_point_uuid: z.ZodString;
24
- start_point_other_uuid: z.ZodOptional<z.ZodString>;
25
- end_point_uuid: z.ZodString;
26
- end_point_other_uuid: z.ZodOptional<z.ZodString>;
155
+ start_point_uuid: z.ZodUUID;
156
+ start_point_other_uuid: z.ZodOptional<z.ZodUUID>;
157
+ end_point_uuid: z.ZodUUID;
158
+ end_point_other_uuid: z.ZodOptional<z.ZodUUID>;
27
159
  validity_time: z.ZodNumber;
28
160
  created_at: z.ZodString;
29
161
  lead_time: z.ZodNumber;
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DecryptedDidCommMessageBodySchema = exports.DecryptedMessageListResultSchema = exports.DecryptedMessageResultSchema = exports.JWESchema = exports.RecipientSchema = exports.RecipientHeaderSchema = exports.EphemeralPublicKeySchema = exports.ResultSchema = 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.DIDCommQuoteMessageSchema = exports.gisPointSchema = exports.postMessagePayloadSchema = exports.postMessageSchema = exports.zOnChainState = void 0;
3
+ exports.DecryptedDidCommMessageBodySchema = exports.DecryptedMessageListResultSchema = exports.DecryptedMessageResultSchema = exports.JWESchema = exports.RecipientSchema = exports.RecipientHeaderSchema = exports.EphemeralPublicKeySchema = exports.ResultSchema = 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.DIDCommQuoteMessageSchema = exports.searchRequestWithoutRfqUuidSchema = exports.searchRequestPayloadSchema = exports.searchRequestPointSchema = exports.gisPointSchema = exports.postMessagePayloadSchema = exports.postMessageSchema = exports.zOnChainState = void 0;
4
4
  const zod_1 = require("zod");
5
+ const televerse_shared_schema_1 = require("televerse-shared-schema");
5
6
  exports.zOnChainState = zod_1.z.object({
6
7
  ed25519Exists: zod_1.z.boolean(),
7
8
  x25519Exists: zod_1.z.boolean(),
@@ -15,13 +16,47 @@ exports.postMessagePayloadSchema = zod_1.z.object({
15
16
  token: zod_1.z.string().min(1, 'JWT token cannot be empty.'),
16
17
  });
17
18
  exports.gisPointSchema = zod_1.z.object({ lat: zod_1.z.number(), lng: zod_1.z.number() });
19
+ exports.searchRequestPointSchema = zod_1.z.object({
20
+ uuid: zod_1.z.uuid(),
21
+ coordinate: exports.gisPointSchema,
22
+ });
23
+ const point2PointRequestSchema = zod_1.z.object({
24
+ service_type: zod_1.z.enum(televerse_shared_schema_1.ServiceType),
25
+ src_point: exports.searchRequestPointSchema,
26
+ dest_point: exports.searchRequestPointSchema,
27
+ speed: zod_1.z.number(),
28
+ contract_period_count: zod_1.z.number(),
29
+ contract_period_unit: zod_1.z.enum(televerse_shared_schema_1.ChargeFrequency),
30
+ rfq_uuid: zod_1.z.uuid(),
31
+ created_at: zod_1.z.string(),
32
+ tender_sec: zod_1.z.number().min(1),
33
+ });
34
+ const networkRequestSchema = zod_1.z.object({
35
+ service_type: zod_1.z.enum(televerse_shared_schema_1.ServiceType),
36
+ src_point: exports.searchRequestPointSchema,
37
+ dest_point: exports.searchRequestPointSchema,
38
+ speed: zod_1.z.number(),
39
+ contract_period_count: zod_1.z.number(),
40
+ contract_period_unit: zod_1.z.enum(televerse_shared_schema_1.ChargeFrequency),
41
+ rfq_uuid: zod_1.z.string(),
42
+ created_at: zod_1.z.string(),
43
+ tender_sec: zod_1.z.number().min(1),
44
+ });
45
+ // TODO: Determine type schema for each serviceType
46
+ // This is just an prototype for implementation
47
+ exports.searchRequestPayloadSchema = point2PointRequestSchema.or(networkRequestSchema);
48
+ // Note: This is used inside SNAP that will generate 'rfq_uuid'after receiving this
49
+ const omitFields = { rfq_uuid: true };
50
+ exports.searchRequestWithoutRfqUuidSchema = point2PointRequestSchema
51
+ .omit(omitFields)
52
+ .or(networkRequestSchema.omit(omitFields));
18
53
  exports.DIDCommQuoteMessageSchema = zod_1.z.object({
19
54
  rfq_uuid: zod_1.z.uuid(),
20
55
  quote_uuid: zod_1.z.uuid(),
21
- start_point_uuid: zod_1.z.string(),
22
- start_point_other_uuid: zod_1.z.string().optional(),
23
- end_point_uuid: zod_1.z.string(),
24
- end_point_other_uuid: zod_1.z.string().optional(),
56
+ start_point_uuid: zod_1.z.uuid(),
57
+ start_point_other_uuid: zod_1.z.uuid().optional(),
58
+ end_point_uuid: zod_1.z.uuid(),
59
+ end_point_other_uuid: zod_1.z.uuid().optional(),
25
60
  validity_time: zod_1.z.number(),
26
61
  created_at: zod_1.z.string(),
27
62
  lead_time: zod_1.z.number(),