@avalabs/vm-module-types
Advanced tools
Comparing version 0.0.1 to 0.0.3
{ | ||
"name": "@avalabs/vm-module-types", | ||
"version": "0.0.1", | ||
"version": "0.0.3", | ||
"main": "src/index.ts", | ||
"dependencies": { | ||
"zod": "3.23.8" | ||
}, | ||
"devDependencies": { | ||
"@internal/types": "0.0.1", | ||
"eslint-config-custom": "0.0.1" | ||
@@ -8,0 +10,0 @@ }, |
@@ -5,3 +5,3 @@ # VM Module Types | ||
This package exposes the types for the VM modules | ||
This package exposes the types for the VM modules. | ||
@@ -8,0 +8,0 @@ ## Installation |
@@ -1,2 +0,2 @@ | ||
import type { Manifest } from '@internal/types'; | ||
import { object, string, boolean, z } from 'zod'; | ||
@@ -118,2 +118,39 @@ export enum TransactionType { | ||
export type { Manifest }; | ||
const sourceSchema = object({ | ||
checksum: string(), | ||
location: object({ | ||
npm: object({ | ||
filePath: string(), | ||
packageName: string(), | ||
registry: string(), | ||
}), | ||
}), | ||
}); | ||
const manifestSchema = object({ | ||
name: string(), | ||
version: string(), | ||
description: string(), | ||
sources: object({ | ||
module: sourceSchema, | ||
provider: sourceSchema.optional(), | ||
}), | ||
network: object({ | ||
chainIds: string().array(), | ||
namespaces: string().array(), | ||
}), | ||
cointype: string(), | ||
permissions: object({ | ||
rpc: object({ | ||
dapps: boolean(), | ||
methods: string().array(), | ||
}), | ||
}), | ||
manifestVersion: string(), | ||
}); | ||
export type Manifest = z.infer<typeof manifestSchema>; | ||
export const parseManifest = (params: unknown): z.SafeParseReturnType<unknown, Manifest> => { | ||
return manifestSchema.safeParse(params); | ||
}; |
Sorry, the diff of this file is not supported yet
4327
1
7
150
1
+ Addedzod@3.23.8
+ Addedzod@3.23.8(transitive)