@acala-network/chopsticks 0.13.1 → 0.13.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.
@@ -87,12 +87,13 @@ const genesisFromUrl = async (url)=>{
87
87
  return new _chopstickscore.GenesisProvider(await getFile(url));
88
88
  };
89
89
  const setupContext = async (argv, overrideParent = false)=>{
90
+ const chainSpec = argv['chain-spec'] ?? argv.genesis;
90
91
  let genesis;
91
- if (argv.genesis) {
92
- if (typeof argv.genesis === 'string') {
93
- genesis = await genesisFromUrl(argv.genesis);
92
+ if (chainSpec) {
93
+ if (typeof chainSpec === 'string') {
94
+ genesis = await genesisFromUrl(chainSpec);
94
95
  } else {
95
- genesis = new _chopstickscore.GenesisProvider(argv.genesis);
96
+ genesis = new _chopstickscore.GenesisProvider(chainSpec);
96
97
  }
97
98
  }
98
99
  const chain = await (0, _chopstickscore.setup)({
@@ -77,6 +77,66 @@ export declare const dryRunSchema: z.ZodObject<{
77
77
  };
78
78
  };
79
79
  }>]>>;
80
+ 'chain-spec': z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodObject<{
81
+ id: z.ZodString;
82
+ name: z.ZodString;
83
+ properties: z.ZodObject<{
84
+ ss58Format: z.ZodOptional<z.ZodNumber>;
85
+ tokenDecimals: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodArray<z.ZodNumber, "many">]>>;
86
+ tokenSymbol: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
87
+ }, "strip", z.ZodTypeAny, {
88
+ ss58Format?: number | undefined;
89
+ tokenDecimals?: number | number[] | undefined;
90
+ tokenSymbol?: string | string[] | undefined;
91
+ }, {
92
+ ss58Format?: number | undefined;
93
+ tokenDecimals?: number | number[] | undefined;
94
+ tokenSymbol?: string | string[] | undefined;
95
+ }>;
96
+ genesis: z.ZodObject<{
97
+ raw: z.ZodObject<{
98
+ top: z.ZodRecord<z.ZodString, z.ZodString>;
99
+ }, "strip", z.ZodTypeAny, {
100
+ top: Record<string, string>;
101
+ }, {
102
+ top: Record<string, string>;
103
+ }>;
104
+ }, "strip", z.ZodTypeAny, {
105
+ raw: {
106
+ top: Record<string, string>;
107
+ };
108
+ }, {
109
+ raw: {
110
+ top: Record<string, string>;
111
+ };
112
+ }>;
113
+ }, "strip", z.ZodTypeAny, {
114
+ name: string;
115
+ id: string;
116
+ properties: {
117
+ ss58Format?: number | undefined;
118
+ tokenDecimals?: number | number[] | undefined;
119
+ tokenSymbol?: string | string[] | undefined;
120
+ };
121
+ genesis: {
122
+ raw: {
123
+ top: Record<string, string>;
124
+ };
125
+ };
126
+ }, {
127
+ name: string;
128
+ id: string;
129
+ properties: {
130
+ ss58Format?: number | undefined;
131
+ tokenDecimals?: number | number[] | undefined;
132
+ tokenSymbol?: string | string[] | undefined;
133
+ };
134
+ genesis: {
135
+ raw: {
136
+ top: Record<string, string>;
137
+ };
138
+ };
139
+ }>]>>;
80
140
  timestamp: z.ZodOptional<z.ZodNumber>;
81
141
  'registered-types': z.ZodOptional<z.ZodAny>;
82
142
  'runtime-log-level': z.ZodOptional<z.ZodNumber>;
@@ -87,13 +147,7 @@ export declare const dryRunSchema: z.ZodObject<{
87
147
  }, "strip", z.ZodTypeAny, {
88
148
  port: number;
89
149
  'build-block-mode': import("@acala-network/chopsticks-core").BuildBlockMode;
90
- extrinsic?: string | undefined;
91
- address?: string | undefined;
92
- preimage?: string | undefined;
93
150
  at?: string | undefined;
94
- "output-path"?: string | undefined;
95
- html?: boolean | undefined;
96
- open?: boolean | undefined;
97
151
  endpoint?: string | string[] | undefined;
98
152
  block?: string | number | null | undefined;
99
153
  'import-storage'?: any;
@@ -116,6 +170,20 @@ export declare const dryRunSchema: z.ZodObject<{
116
170
  };
117
171
  };
118
172
  } | undefined;
173
+ 'chain-spec'?: string | {
174
+ name: string;
175
+ id: string;
176
+ properties: {
177
+ ss58Format?: number | undefined;
178
+ tokenDecimals?: number | number[] | undefined;
179
+ tokenSymbol?: string | string[] | undefined;
180
+ };
181
+ genesis: {
182
+ raw: {
183
+ top: Record<string, string>;
184
+ };
185
+ };
186
+ } | undefined;
119
187
  timestamp?: number | undefined;
120
188
  'registered-types'?: any;
121
189
  'runtime-log-level'?: number | undefined;
@@ -123,14 +191,14 @@ export declare const dryRunSchema: z.ZodObject<{
123
191
  resume?: number | boolean | `0x${string}` | undefined;
124
192
  'process-queued-messages'?: boolean | undefined;
125
193
  'prefetch-storages'?: any;
126
- }, {
194
+ open?: boolean | undefined;
195
+ "output-path"?: string | undefined;
127
196
  extrinsic?: string | undefined;
128
197
  address?: string | undefined;
129
198
  preimage?: string | undefined;
130
- at?: string | undefined;
131
- "output-path"?: string | undefined;
132
199
  html?: boolean | undefined;
133
- open?: boolean | undefined;
200
+ }, {
201
+ at?: string | undefined;
134
202
  port?: number | undefined;
135
203
  endpoint?: string | string[] | undefined;
136
204
  block?: string | number | null | undefined;
@@ -155,6 +223,20 @@ export declare const dryRunSchema: z.ZodObject<{
155
223
  };
156
224
  };
157
225
  } | undefined;
226
+ 'chain-spec'?: string | {
227
+ name: string;
228
+ id: string;
229
+ properties: {
230
+ ss58Format?: number | undefined;
231
+ tokenDecimals?: number | number[] | undefined;
232
+ tokenSymbol?: string | string[] | undefined;
233
+ };
234
+ genesis: {
235
+ raw: {
236
+ top: Record<string, string>;
237
+ };
238
+ };
239
+ } | undefined;
158
240
  timestamp?: number | undefined;
159
241
  'registered-types'?: any;
160
242
  'runtime-log-level'?: number | undefined;
@@ -162,6 +244,12 @@ export declare const dryRunSchema: z.ZodObject<{
162
244
  resume?: number | boolean | `0x${string}` | undefined;
163
245
  'process-queued-messages'?: boolean | undefined;
164
246
  'prefetch-storages'?: any;
247
+ open?: boolean | undefined;
248
+ "output-path"?: string | undefined;
249
+ extrinsic?: string | undefined;
250
+ address?: string | undefined;
251
+ preimage?: string | undefined;
252
+ html?: boolean | undefined;
165
253
  }>;
166
254
  export type DryRunSchemaType = z.infer<typeof dryRunSchema>;
167
255
  export * from './cli.js';
@@ -36,12 +36,13 @@ declare const schema: z.ZodObject<{
36
36
  ump: z.ZodOptional<z.ZodRecord<z.ZodEffects<z.ZodString, number, string>, z.ZodArray<z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>, "many">>>;
37
37
  at: z.ZodOptional<z.ZodIntersection<z.ZodString, z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>>;
38
38
  }, "strip", z.ZodTypeAny, {
39
- raw?: boolean | undefined;
40
- html?: boolean | undefined;
39
+ at?: `0x${string}` | undefined;
41
40
  extrinsic?: `0x${string}` | {
42
41
  call: `0x${string}`;
43
42
  address: `0x${string}`;
44
43
  } | undefined;
44
+ html?: boolean | undefined;
45
+ raw?: boolean | undefined;
45
46
  hrmp?: Record<number, {
46
47
  data: `0x${string}`;
47
48
  sentAt: number;
@@ -51,14 +52,14 @@ declare const schema: z.ZodObject<{
51
52
  msg: `0x${string}`;
52
53
  }[] | undefined;
53
54
  ump?: Record<number, `0x${string}`[]> | undefined;
54
- at?: `0x${string}` | undefined;
55
55
  }, {
56
- raw?: boolean | undefined;
57
- html?: boolean | undefined;
56
+ at?: `0x${string}` | undefined;
58
57
  extrinsic?: `0x${string}` | {
59
58
  call: `0x${string}`;
60
59
  address: `0x${string}`;
61
60
  } | undefined;
61
+ html?: boolean | undefined;
62
+ raw?: boolean | undefined;
62
63
  hrmp?: Record<string, {
63
64
  data: `0x${string}`;
64
65
  sentAt: number;
@@ -68,7 +69,6 @@ declare const schema: z.ZodObject<{
68
69
  msg: `0x${string}`;
69
70
  }[] | undefined;
70
71
  ump?: Record<string, `0x${string}`[]> | undefined;
71
- at?: `0x${string}` | undefined;
72
72
  }>;
73
73
  type Params = z.infer<typeof schema>;
74
74
  export interface DryRunParams {
@@ -74,6 +74,66 @@ export declare const configSchema: z.ZodObject<{
74
74
  };
75
75
  };
76
76
  }>]>>;
77
+ 'chain-spec': z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodObject<{
78
+ id: z.ZodString;
79
+ name: z.ZodString;
80
+ properties: z.ZodObject<{
81
+ ss58Format: z.ZodOptional<z.ZodNumber>;
82
+ tokenDecimals: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodArray<z.ZodNumber, "many">]>>;
83
+ tokenSymbol: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
84
+ }, "strip", ZodTypeAny, {
85
+ ss58Format?: number | undefined;
86
+ tokenDecimals?: number | number[] | undefined;
87
+ tokenSymbol?: string | string[] | undefined;
88
+ }, {
89
+ ss58Format?: number | undefined;
90
+ tokenDecimals?: number | number[] | undefined;
91
+ tokenSymbol?: string | string[] | undefined;
92
+ }>;
93
+ genesis: z.ZodObject<{
94
+ raw: z.ZodObject<{
95
+ top: z.ZodRecord<z.ZodString, z.ZodString>;
96
+ }, "strip", ZodTypeAny, {
97
+ top: Record<string, string>;
98
+ }, {
99
+ top: Record<string, string>;
100
+ }>;
101
+ }, "strip", ZodTypeAny, {
102
+ raw: {
103
+ top: Record<string, string>;
104
+ };
105
+ }, {
106
+ raw: {
107
+ top: Record<string, string>;
108
+ };
109
+ }>;
110
+ }, "strip", ZodTypeAny, {
111
+ name: string;
112
+ id: string;
113
+ properties: {
114
+ ss58Format?: number | undefined;
115
+ tokenDecimals?: number | number[] | undefined;
116
+ tokenSymbol?: string | string[] | undefined;
117
+ };
118
+ genesis: {
119
+ raw: {
120
+ top: Record<string, string>;
121
+ };
122
+ };
123
+ }, {
124
+ name: string;
125
+ id: string;
126
+ properties: {
127
+ ss58Format?: number | undefined;
128
+ tokenDecimals?: number | number[] | undefined;
129
+ tokenSymbol?: string | string[] | undefined;
130
+ };
131
+ genesis: {
132
+ raw: {
133
+ top: Record<string, string>;
134
+ };
135
+ };
136
+ }>]>>;
77
137
  timestamp: z.ZodOptional<z.ZodNumber>;
78
138
  'registered-types': z.ZodOptional<z.ZodAny>;
79
139
  'runtime-log-level': z.ZodOptional<z.ZodNumber>;
@@ -106,6 +166,20 @@ export declare const configSchema: z.ZodObject<{
106
166
  };
107
167
  };
108
168
  } | undefined;
169
+ 'chain-spec'?: string | {
170
+ name: string;
171
+ id: string;
172
+ properties: {
173
+ ss58Format?: number | undefined;
174
+ tokenDecimals?: number | number[] | undefined;
175
+ tokenSymbol?: string | string[] | undefined;
176
+ };
177
+ genesis: {
178
+ raw: {
179
+ top: Record<string, string>;
180
+ };
181
+ };
182
+ } | undefined;
109
183
  timestamp?: number | undefined;
110
184
  'registered-types'?: any;
111
185
  'runtime-log-level'?: number | undefined;
@@ -138,6 +212,20 @@ export declare const configSchema: z.ZodObject<{
138
212
  };
139
213
  };
140
214
  } | undefined;
215
+ 'chain-spec'?: string | {
216
+ name: string;
217
+ id: string;
218
+ properties: {
219
+ ss58Format?: number | undefined;
220
+ tokenDecimals?: number | number[] | undefined;
221
+ tokenSymbol?: string | string[] | undefined;
222
+ };
223
+ genesis: {
224
+ raw: {
225
+ top: Record<string, string>;
226
+ };
227
+ };
228
+ } | undefined;
141
229
  timestamp?: number | undefined;
142
230
  'registered-types'?: any;
143
231
  'runtime-log-level'?: number | undefined;
@@ -75,7 +75,13 @@ const configSchema = _zod.z.object({
75
75
  _zod.z.string(),
76
76
  _chopstickscore.genesisSchema
77
77
  ], {
78
- description: 'URL to genesis config file. NOTE: Only parachains with AURA consensus are supported!'
78
+ description: 'Alias to `chain-spec`. URL to chain spec file. NOTE: Only parachains with AURA consensus are supported!'
79
+ }).optional(),
80
+ 'chain-spec': _zod.z.union([
81
+ _zod.z.string(),
82
+ _chopstickscore.genesisSchema
83
+ ], {
84
+ description: 'URL to chain spec file. NOTE: Only parachains with AURA consensus are supported!'
79
85
  }).optional(),
80
86
  timestamp: _zod.z.number().optional(),
81
87
  'registered-types': _zod.z.any().optional(),
@@ -220,7 +220,7 @@ const createServer = async (handler, port)=>{
220
220
  result: resp ?? null
221
221
  };
222
222
  } catch (e) {
223
- wsLogger.info('Error handling request: %o', e.stack);
223
+ wsLogger.error('Error handling request: %o', e.stack);
224
224
  return {
225
225
  id: req.id,
226
226
  jsonrpc: '2.0',
@@ -23,12 +23,13 @@ export const genesisFromUrl = async (url)=>{
23
23
  return new GenesisProvider(await getFile(url));
24
24
  };
25
25
  export const setupContext = async (argv, overrideParent = false)=>{
26
+ const chainSpec = argv['chain-spec'] ?? argv.genesis;
26
27
  let genesis;
27
- if (argv.genesis) {
28
- if (typeof argv.genesis === 'string') {
29
- genesis = await genesisFromUrl(argv.genesis);
28
+ if (chainSpec) {
29
+ if (typeof chainSpec === 'string') {
30
+ genesis = await genesisFromUrl(chainSpec);
30
31
  } else {
31
- genesis = new GenesisProvider(argv.genesis);
32
+ genesis = new GenesisProvider(chainSpec);
32
33
  }
33
34
  }
34
35
  const chain = await setup({
@@ -77,6 +77,66 @@ export declare const dryRunSchema: z.ZodObject<{
77
77
  };
78
78
  };
79
79
  }>]>>;
80
+ 'chain-spec': z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodObject<{
81
+ id: z.ZodString;
82
+ name: z.ZodString;
83
+ properties: z.ZodObject<{
84
+ ss58Format: z.ZodOptional<z.ZodNumber>;
85
+ tokenDecimals: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodArray<z.ZodNumber, "many">]>>;
86
+ tokenSymbol: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
87
+ }, "strip", z.ZodTypeAny, {
88
+ ss58Format?: number | undefined;
89
+ tokenDecimals?: number | number[] | undefined;
90
+ tokenSymbol?: string | string[] | undefined;
91
+ }, {
92
+ ss58Format?: number | undefined;
93
+ tokenDecimals?: number | number[] | undefined;
94
+ tokenSymbol?: string | string[] | undefined;
95
+ }>;
96
+ genesis: z.ZodObject<{
97
+ raw: z.ZodObject<{
98
+ top: z.ZodRecord<z.ZodString, z.ZodString>;
99
+ }, "strip", z.ZodTypeAny, {
100
+ top: Record<string, string>;
101
+ }, {
102
+ top: Record<string, string>;
103
+ }>;
104
+ }, "strip", z.ZodTypeAny, {
105
+ raw: {
106
+ top: Record<string, string>;
107
+ };
108
+ }, {
109
+ raw: {
110
+ top: Record<string, string>;
111
+ };
112
+ }>;
113
+ }, "strip", z.ZodTypeAny, {
114
+ name: string;
115
+ id: string;
116
+ properties: {
117
+ ss58Format?: number | undefined;
118
+ tokenDecimals?: number | number[] | undefined;
119
+ tokenSymbol?: string | string[] | undefined;
120
+ };
121
+ genesis: {
122
+ raw: {
123
+ top: Record<string, string>;
124
+ };
125
+ };
126
+ }, {
127
+ name: string;
128
+ id: string;
129
+ properties: {
130
+ ss58Format?: number | undefined;
131
+ tokenDecimals?: number | number[] | undefined;
132
+ tokenSymbol?: string | string[] | undefined;
133
+ };
134
+ genesis: {
135
+ raw: {
136
+ top: Record<string, string>;
137
+ };
138
+ };
139
+ }>]>>;
80
140
  timestamp: z.ZodOptional<z.ZodNumber>;
81
141
  'registered-types': z.ZodOptional<z.ZodAny>;
82
142
  'runtime-log-level': z.ZodOptional<z.ZodNumber>;
@@ -87,13 +147,7 @@ export declare const dryRunSchema: z.ZodObject<{
87
147
  }, "strip", z.ZodTypeAny, {
88
148
  port: number;
89
149
  'build-block-mode': import("@acala-network/chopsticks-core").BuildBlockMode;
90
- extrinsic?: string | undefined;
91
- address?: string | undefined;
92
- preimage?: string | undefined;
93
150
  at?: string | undefined;
94
- "output-path"?: string | undefined;
95
- html?: boolean | undefined;
96
- open?: boolean | undefined;
97
151
  endpoint?: string | string[] | undefined;
98
152
  block?: string | number | null | undefined;
99
153
  'import-storage'?: any;
@@ -116,6 +170,20 @@ export declare const dryRunSchema: z.ZodObject<{
116
170
  };
117
171
  };
118
172
  } | undefined;
173
+ 'chain-spec'?: string | {
174
+ name: string;
175
+ id: string;
176
+ properties: {
177
+ ss58Format?: number | undefined;
178
+ tokenDecimals?: number | number[] | undefined;
179
+ tokenSymbol?: string | string[] | undefined;
180
+ };
181
+ genesis: {
182
+ raw: {
183
+ top: Record<string, string>;
184
+ };
185
+ };
186
+ } | undefined;
119
187
  timestamp?: number | undefined;
120
188
  'registered-types'?: any;
121
189
  'runtime-log-level'?: number | undefined;
@@ -123,14 +191,14 @@ export declare const dryRunSchema: z.ZodObject<{
123
191
  resume?: number | boolean | `0x${string}` | undefined;
124
192
  'process-queued-messages'?: boolean | undefined;
125
193
  'prefetch-storages'?: any;
126
- }, {
194
+ open?: boolean | undefined;
195
+ "output-path"?: string | undefined;
127
196
  extrinsic?: string | undefined;
128
197
  address?: string | undefined;
129
198
  preimage?: string | undefined;
130
- at?: string | undefined;
131
- "output-path"?: string | undefined;
132
199
  html?: boolean | undefined;
133
- open?: boolean | undefined;
200
+ }, {
201
+ at?: string | undefined;
134
202
  port?: number | undefined;
135
203
  endpoint?: string | string[] | undefined;
136
204
  block?: string | number | null | undefined;
@@ -155,6 +223,20 @@ export declare const dryRunSchema: z.ZodObject<{
155
223
  };
156
224
  };
157
225
  } | undefined;
226
+ 'chain-spec'?: string | {
227
+ name: string;
228
+ id: string;
229
+ properties: {
230
+ ss58Format?: number | undefined;
231
+ tokenDecimals?: number | number[] | undefined;
232
+ tokenSymbol?: string | string[] | undefined;
233
+ };
234
+ genesis: {
235
+ raw: {
236
+ top: Record<string, string>;
237
+ };
238
+ };
239
+ } | undefined;
158
240
  timestamp?: number | undefined;
159
241
  'registered-types'?: any;
160
242
  'runtime-log-level'?: number | undefined;
@@ -162,6 +244,12 @@ export declare const dryRunSchema: z.ZodObject<{
162
244
  resume?: number | boolean | `0x${string}` | undefined;
163
245
  'process-queued-messages'?: boolean | undefined;
164
246
  'prefetch-storages'?: any;
247
+ open?: boolean | undefined;
248
+ "output-path"?: string | undefined;
249
+ extrinsic?: string | undefined;
250
+ address?: string | undefined;
251
+ preimage?: string | undefined;
252
+ html?: boolean | undefined;
165
253
  }>;
166
254
  export type DryRunSchemaType = z.infer<typeof dryRunSchema>;
167
255
  export * from './cli.js';
@@ -36,12 +36,13 @@ declare const schema: z.ZodObject<{
36
36
  ump: z.ZodOptional<z.ZodRecord<z.ZodEffects<z.ZodString, number, string>, z.ZodArray<z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>, "many">>>;
37
37
  at: z.ZodOptional<z.ZodIntersection<z.ZodString, z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>>;
38
38
  }, "strip", z.ZodTypeAny, {
39
- raw?: boolean | undefined;
40
- html?: boolean | undefined;
39
+ at?: `0x${string}` | undefined;
41
40
  extrinsic?: `0x${string}` | {
42
41
  call: `0x${string}`;
43
42
  address: `0x${string}`;
44
43
  } | undefined;
44
+ html?: boolean | undefined;
45
+ raw?: boolean | undefined;
45
46
  hrmp?: Record<number, {
46
47
  data: `0x${string}`;
47
48
  sentAt: number;
@@ -51,14 +52,14 @@ declare const schema: z.ZodObject<{
51
52
  msg: `0x${string}`;
52
53
  }[] | undefined;
53
54
  ump?: Record<number, `0x${string}`[]> | undefined;
54
- at?: `0x${string}` | undefined;
55
55
  }, {
56
- raw?: boolean | undefined;
57
- html?: boolean | undefined;
56
+ at?: `0x${string}` | undefined;
58
57
  extrinsic?: `0x${string}` | {
59
58
  call: `0x${string}`;
60
59
  address: `0x${string}`;
61
60
  } | undefined;
61
+ html?: boolean | undefined;
62
+ raw?: boolean | undefined;
62
63
  hrmp?: Record<string, {
63
64
  data: `0x${string}`;
64
65
  sentAt: number;
@@ -68,7 +69,6 @@ declare const schema: z.ZodObject<{
68
69
  msg: `0x${string}`;
69
70
  }[] | undefined;
70
71
  ump?: Record<string, `0x${string}`[]> | undefined;
71
- at?: `0x${string}` | undefined;
72
72
  }>;
73
73
  type Params = z.infer<typeof schema>;
74
74
  export interface DryRunParams {
@@ -74,6 +74,66 @@ export declare const configSchema: z.ZodObject<{
74
74
  };
75
75
  };
76
76
  }>]>>;
77
+ 'chain-spec': z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodObject<{
78
+ id: z.ZodString;
79
+ name: z.ZodString;
80
+ properties: z.ZodObject<{
81
+ ss58Format: z.ZodOptional<z.ZodNumber>;
82
+ tokenDecimals: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodArray<z.ZodNumber, "many">]>>;
83
+ tokenSymbol: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
84
+ }, "strip", ZodTypeAny, {
85
+ ss58Format?: number | undefined;
86
+ tokenDecimals?: number | number[] | undefined;
87
+ tokenSymbol?: string | string[] | undefined;
88
+ }, {
89
+ ss58Format?: number | undefined;
90
+ tokenDecimals?: number | number[] | undefined;
91
+ tokenSymbol?: string | string[] | undefined;
92
+ }>;
93
+ genesis: z.ZodObject<{
94
+ raw: z.ZodObject<{
95
+ top: z.ZodRecord<z.ZodString, z.ZodString>;
96
+ }, "strip", ZodTypeAny, {
97
+ top: Record<string, string>;
98
+ }, {
99
+ top: Record<string, string>;
100
+ }>;
101
+ }, "strip", ZodTypeAny, {
102
+ raw: {
103
+ top: Record<string, string>;
104
+ };
105
+ }, {
106
+ raw: {
107
+ top: Record<string, string>;
108
+ };
109
+ }>;
110
+ }, "strip", ZodTypeAny, {
111
+ name: string;
112
+ id: string;
113
+ properties: {
114
+ ss58Format?: number | undefined;
115
+ tokenDecimals?: number | number[] | undefined;
116
+ tokenSymbol?: string | string[] | undefined;
117
+ };
118
+ genesis: {
119
+ raw: {
120
+ top: Record<string, string>;
121
+ };
122
+ };
123
+ }, {
124
+ name: string;
125
+ id: string;
126
+ properties: {
127
+ ss58Format?: number | undefined;
128
+ tokenDecimals?: number | number[] | undefined;
129
+ tokenSymbol?: string | string[] | undefined;
130
+ };
131
+ genesis: {
132
+ raw: {
133
+ top: Record<string, string>;
134
+ };
135
+ };
136
+ }>]>>;
77
137
  timestamp: z.ZodOptional<z.ZodNumber>;
78
138
  'registered-types': z.ZodOptional<z.ZodAny>;
79
139
  'runtime-log-level': z.ZodOptional<z.ZodNumber>;
@@ -106,6 +166,20 @@ export declare const configSchema: z.ZodObject<{
106
166
  };
107
167
  };
108
168
  } | undefined;
169
+ 'chain-spec'?: string | {
170
+ name: string;
171
+ id: string;
172
+ properties: {
173
+ ss58Format?: number | undefined;
174
+ tokenDecimals?: number | number[] | undefined;
175
+ tokenSymbol?: string | string[] | undefined;
176
+ };
177
+ genesis: {
178
+ raw: {
179
+ top: Record<string, string>;
180
+ };
181
+ };
182
+ } | undefined;
109
183
  timestamp?: number | undefined;
110
184
  'registered-types'?: any;
111
185
  'runtime-log-level'?: number | undefined;
@@ -138,6 +212,20 @@ export declare const configSchema: z.ZodObject<{
138
212
  };
139
213
  };
140
214
  } | undefined;
215
+ 'chain-spec'?: string | {
216
+ name: string;
217
+ id: string;
218
+ properties: {
219
+ ss58Format?: number | undefined;
220
+ tokenDecimals?: number | number[] | undefined;
221
+ tokenSymbol?: string | string[] | undefined;
222
+ };
223
+ genesis: {
224
+ raw: {
225
+ top: Record<string, string>;
226
+ };
227
+ };
228
+ } | undefined;
141
229
  timestamp?: number | undefined;
142
230
  'registered-types'?: any;
143
231
  'runtime-log-level'?: number | undefined;
@@ -43,7 +43,13 @@ export const configSchema = z.object({
43
43
  z.string(),
44
44
  genesisSchema
45
45
  ], {
46
- description: 'URL to genesis config file. NOTE: Only parachains with AURA consensus are supported!'
46
+ description: 'Alias to `chain-spec`. URL to chain spec file. NOTE: Only parachains with AURA consensus are supported!'
47
+ }).optional(),
48
+ 'chain-spec': z.union([
49
+ z.string(),
50
+ genesisSchema
51
+ ], {
52
+ description: 'URL to chain spec file. NOTE: Only parachains with AURA consensus are supported!'
47
53
  }).optional(),
48
54
  timestamp: z.number().optional(),
49
55
  'registered-types': z.any().optional(),
@@ -205,7 +205,7 @@ export const createServer = async (handler, port)=>{
205
205
  result: resp ?? null
206
206
  };
207
207
  } catch (e) {
208
- wsLogger.info('Error handling request: %o', e.stack);
208
+ wsLogger.error('Error handling request: %o', e.stack);
209
209
  return {
210
210
  id: req.id,
211
211
  jsonrpc: '2.0',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acala-network/chopsticks",
3
- "version": "0.13.1",
3
+ "version": "0.13.3",
4
4
  "author": "Acala Developers <hello@acala.network>",
5
5
  "license": "Apache-2.0",
6
6
  "bin": "./chopsticks.cjs",
@@ -12,16 +12,16 @@
12
12
  "depcheck": "npx depcheck --ignore-patterns='*.test.ts'"
13
13
  },
14
14
  "dependencies": {
15
- "@acala-network/chopsticks-core": "0.13.1",
16
- "@acala-network/chopsticks-db": "0.13.1",
15
+ "@acala-network/chopsticks-core": "0.13.3",
16
+ "@acala-network/chopsticks-db": "0.13.3",
17
17
  "@pnpm/npm-conf": "^2.2.2",
18
- "@polkadot/api": "^12.1.1",
19
- "@polkadot/api-augment": "^12.1.1",
20
- "@polkadot/rpc-provider": "^12.1.1",
21
- "@polkadot/types": "^12.1.1",
22
- "@polkadot/util": "^12.6.2",
23
- "@polkadot/util-crypto": "^12.6.2",
24
- "axios": "^1.6.8",
18
+ "@polkadot/api": "^12.3.1",
19
+ "@polkadot/api-augment": "^12.3.1",
20
+ "@polkadot/rpc-provider": "^12.3.1",
21
+ "@polkadot/types": "^12.3.1",
22
+ "@polkadot/util": "^13.0.2",
23
+ "@polkadot/util-crypto": "^13.0.2",
24
+ "axios": "^1.7.4",
25
25
  "comlink": "^4.4.1",
26
26
  "dotenv": "^16.4.5",
27
27
  "global-agent": "^3.0.0",
@@ -34,7 +34,7 @@
34
34
  },
35
35
  "devDependencies": {
36
36
  "@swc/cli": "0.4.0",
37
- "@swc/core": "^1.6.7",
37
+ "@swc/core": "^1.7.6",
38
38
  "@types/global-agent": "^2.1.3",
39
39
  "@types/js-yaml": "^4.0.9",
40
40
  "@types/lodash": "^4.17.6",