@avalabs/vm-module-types 0.0.1 → 0.0.6

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.
@@ -1,4 +1,4 @@
1
1
 
2
- > @avalabs/vm-module-types@0.0.1 lint /home/runner/work/vm-modules/vm-modules/packages/vm-module-types
2
+ > @avalabs/vm-module-types@0.0.6 lint /home/runner/work/vm-modules/vm-modules/packages/types
3
3
  > eslint "src/**/*.ts"
4
4
 
package/CHANGELOG.md ADDED
@@ -0,0 +1,19 @@
1
+ # @avalabs/vm-module-types
2
+
3
+ ## 0.0.6
4
+
5
+ ### Patch Changes
6
+
7
+ - 1122704: test release
8
+
9
+ ## 0.0.3
10
+
11
+ ### Patch Changes
12
+
13
+ - 0b0c52e: Move types to @avalabs/vm-module-types
14
+
15
+ ## 0.0.2
16
+
17
+ ### Patch Changes
18
+
19
+ - 4b7d5e9: Move types from packages-internal/types to packages/types
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Overview
4
4
 
5
- This package exposes the types for the VM modules
5
+ This package exposes the types for the VM modules.
6
6
 
7
7
  ## Installation
8
8
 
package/package.json CHANGED
@@ -1,9 +1,11 @@
1
1
  {
2
2
  "name": "@avalabs/vm-module-types",
3
- "version": "0.0.1",
3
+ "version": "0.0.6",
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 type { Manifest } from '@internal/types';
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
- export type { Manifest };
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
+ };