@taqueria/protocol 0.14.2 → 0.16.0
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/SandboxConfig.ts +3 -0
- package/package.json +1 -1
- package/tzkt-config.ts +27 -0
package/SandboxConfig.ts
CHANGED
|
@@ -2,6 +2,7 @@ import createType from '@taqueria/protocol/Base';
|
|
|
2
2
|
import * as EconomicalProtocolHash from '@taqueria/protocol/EconomicalProtocolHash';
|
|
3
3
|
import * as HumanReadableIdentifier from '@taqueria/protocol/HumanReadableIdentifier';
|
|
4
4
|
import * as SandboxAccountConfig from '@taqueria/protocol/SandboxAccountConfig';
|
|
5
|
+
import * as TzKt from '@taqueria/protocol/tzkt-config';
|
|
5
6
|
import * as Url from '@taqueria/protocol/Url';
|
|
6
7
|
import * as Verb from '@taqueria/protocol/Verb';
|
|
7
8
|
import { z } from 'zod';
|
|
@@ -29,6 +30,7 @@ export const rawSchema = z.object({
|
|
|
29
30
|
z.object({ default: z.string().min(1) }),
|
|
30
31
|
z.record(SandboxAccountConfig.rawSchema),
|
|
31
32
|
], { description: 'Sandbox Accounts' }).optional(),
|
|
33
|
+
tzkt: TzKt.rawSchema.describe('TzKt config').optional(),
|
|
32
34
|
});
|
|
33
35
|
|
|
34
36
|
const internalSchema = z.object({
|
|
@@ -41,6 +43,7 @@ const internalSchema = z.object({
|
|
|
41
43
|
).optional(),
|
|
42
44
|
plugin: Verb.schemas.schema.describe('Sandbox Plugin').optional(),
|
|
43
45
|
accounts: accountMapSchema.optional(),
|
|
46
|
+
tzkt: TzKt.rawSchema.describe('TzKt config').optional(),
|
|
44
47
|
}, { description: 'Sandbox Configuration' });
|
|
45
48
|
|
|
46
49
|
type RawInput = z.infer<typeof rawSchema>;
|
package/package.json
CHANGED
package/tzkt-config.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import createType from '@taqueria/protocol/Base';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
|
|
4
|
+
export const rawSchema = z.object({
|
|
5
|
+
disableAutostartWithSandbox: z.boolean({ description: 'Do not start TzKt when sandbox starts' }).default(false),
|
|
6
|
+
postgresqlPort: z.number({ description: 'Port number for postgresql container' }).default(5432),
|
|
7
|
+
apiPort: z.number({ description: 'Port number for TzKt API' }).default(5000),
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
type Input = z.infer<typeof rawSchema>;
|
|
11
|
+
|
|
12
|
+
export const { schemas: generatedSchemas, factory } = createType<Input, Input>({
|
|
13
|
+
rawSchema,
|
|
14
|
+
parseErrMsg: (value: unknown) => `${value} is not a valid TzKt configuration `,
|
|
15
|
+
unknownErrMsg: 'Something went wrong trying to parse the TzKt configuration',
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export type TzKtConfig = z.infer<typeof generatedSchemas.schema>;
|
|
19
|
+
|
|
20
|
+
export type t = TzKtConfig;
|
|
21
|
+
|
|
22
|
+
export const { create, of, make } = factory;
|
|
23
|
+
|
|
24
|
+
export const schemas = {
|
|
25
|
+
...generatedSchemas,
|
|
26
|
+
schema: generatedSchemas.schema.transform(val => val as TzKtConfig),
|
|
27
|
+
};
|