@avalabs/vm-module-types 0.0.1 → 0.0.3
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/.turbo/turbo-lint.log +1 -1
- package/CHANGELOG.md +13 -0
- package/README.md +1 -1
- package/package.json +4 -2
- package/src/types.ts +39 -2
package/.turbo/turbo-lint.log
CHANGED
package/CHANGELOG.md
ADDED
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@avalabs/vm-module-types",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"main": "src/index.ts",
|
|
5
|
+
"dependencies": {
|
|
6
|
+
"zod": "3.23.8"
|
|
7
|
+
},
|
|
5
8
|
"devDependencies": {
|
|
6
|
-
"@internal/types": "0.0.1",
|
|
7
9
|
"eslint-config-custom": "0.0.1"
|
|
8
10
|
},
|
|
9
11
|
"scripts": {
|
package/src/types.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { object, string, boolean, z } from 'zod';
|
|
2
2
|
|
|
3
3
|
export enum TransactionType {
|
|
4
4
|
BRIDGE = 'Bridge',
|
|
@@ -115,4 +115,41 @@ export interface NetworkToken {
|
|
|
115
115
|
logoUri: string;
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
|
|
118
|
+
const sourceSchema = object({
|
|
119
|
+
checksum: string(),
|
|
120
|
+
location: object({
|
|
121
|
+
npm: object({
|
|
122
|
+
filePath: string(),
|
|
123
|
+
packageName: string(),
|
|
124
|
+
registry: string(),
|
|
125
|
+
}),
|
|
126
|
+
}),
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
const manifestSchema = object({
|
|
130
|
+
name: string(),
|
|
131
|
+
version: string(),
|
|
132
|
+
description: string(),
|
|
133
|
+
sources: object({
|
|
134
|
+
module: sourceSchema,
|
|
135
|
+
provider: sourceSchema.optional(),
|
|
136
|
+
}),
|
|
137
|
+
network: object({
|
|
138
|
+
chainIds: string().array(),
|
|
139
|
+
namespaces: string().array(),
|
|
140
|
+
}),
|
|
141
|
+
cointype: string(),
|
|
142
|
+
permissions: object({
|
|
143
|
+
rpc: object({
|
|
144
|
+
dapps: boolean(),
|
|
145
|
+
methods: string().array(),
|
|
146
|
+
}),
|
|
147
|
+
}),
|
|
148
|
+
manifestVersion: string(),
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
export type Manifest = z.infer<typeof manifestSchema>;
|
|
152
|
+
|
|
153
|
+
export const parseManifest = (params: unknown): z.SafeParseReturnType<unknown, Manifest> => {
|
|
154
|
+
return manifestSchema.safeParse(params);
|
|
155
|
+
};
|