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.
Files changed (25) hide show
  1. package/package.json +3 -3
  2. package/televerse-utils/helper.d.ts +1 -0
  3. package/televerse-utils/helper.js +28 -0
  4. package/televerse-utils/index.d.ts +3 -422
  5. package/televerse-utils/index.js +16 -209
  6. package/televerse-utils/types.d.ts +32 -0
  7. package/televerse-utils/types.js +13 -0
  8. package/televerse-utils/validators.d.ts +422 -0
  9. package/televerse-utils/validators.js +212 -0
  10. package/televerse-utils/zodValidators.d.ts +357 -0
  11. package/televerse-utils/zodValidators.js +191 -0
  12. package/typechain-types/contracts/televerse/TeleverseToken.d.ts +14 -0
  13. package/typechain-types/contracts/televerse/TeleverseToken.ts +12 -0
  14. package/typechain-types/factories/contracts/televerse/CommitteeElection__factory.d.ts +1 -1
  15. package/typechain-types/factories/contracts/televerse/CommitteeElection__factory.js +1 -1
  16. package/typechain-types/factories/contracts/televerse/CommitteeElection__factory.ts +1 -1
  17. package/typechain-types/factories/contracts/televerse/ContractService__factory.d.ts +1 -1
  18. package/typechain-types/factories/contracts/televerse/ContractService__factory.js +1 -1
  19. package/typechain-types/factories/contracts/televerse/ContractService__factory.ts +1 -1
  20. package/typechain-types/factories/contracts/televerse/Governance__factory.d.ts +1 -1
  21. package/typechain-types/factories/contracts/televerse/Governance__factory.js +1 -1
  22. package/typechain-types/factories/contracts/televerse/Governance__factory.ts +1 -1
  23. package/typechain-types/factories/contracts/televerse/TeleverseToken__factory.d.ts +19 -14
  24. package/typechain-types/factories/contracts/televerse/TeleverseToken__factory.js +25 -18
  25. package/typechain-types/factories/contracts/televerse/TeleverseToken__factory.ts +25 -26
@@ -1,212 +1,19 @@
1
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(),
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
47
12
  }));
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',
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
70
15
  };
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
- });
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./helper"), exports);
18
+ __exportStar(require("./types"), exports);
19
+ __exportStar(require("./zodValidators"), exports);
@@ -0,0 +1,32 @@
1
+ export declare enum ChainId {
2
+ Mainnet = 1,
3
+ SepoliaTestnet = 11155111,
4
+ MumbaiTestnet = 80001,
5
+ Linea = 59144,
6
+ LineaTestnet = 59141,
7
+ HederaTestnet = 296,
8
+ ZkevmCardonaTestnet = 2442
9
+ }
10
+ export interface NetworkChainConfig {
11
+ chainId: ChainId;
12
+ chainName: string;
13
+ nativeCurrency?: {
14
+ name: string;
15
+ symbol: string;
16
+ decimals: number;
17
+ };
18
+ /**
19
+ * The URL of the network's RPC provider, used (required) for adding the network to Metamask
20
+ */
21
+ rpcUrls?: string[];
22
+ blockExplorerUrls?: string[];
23
+ }
24
+ export interface SetCurrentAccountRequestParams {
25
+ account: string;
26
+ }
27
+ export interface DecryptJweDidCommMessageParams {
28
+ message: string;
29
+ }
30
+ export interface DecryptJweDidCommMessageListParams {
31
+ message: string[];
32
+ }
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ChainId = void 0;
4
+ var ChainId;
5
+ (function (ChainId) {
6
+ ChainId[ChainId["Mainnet"] = 1] = "Mainnet";
7
+ ChainId[ChainId["SepoliaTestnet"] = 11155111] = "SepoliaTestnet";
8
+ ChainId[ChainId["MumbaiTestnet"] = 80001] = "MumbaiTestnet";
9
+ ChainId[ChainId["Linea"] = 59144] = "Linea";
10
+ ChainId[ChainId["LineaTestnet"] = 59141] = "LineaTestnet";
11
+ ChainId[ChainId["HederaTestnet"] = 296] = "HederaTestnet";
12
+ ChainId[ChainId["ZkevmCardonaTestnet"] = 2442] = "ZkevmCardonaTestnet";
13
+ })(ChainId || (exports.ChainId = ChainId = {}));