diff --git a/packages/accounts/package.json b/packages/accounts/package.json index 5c4f460..b0ec5bc 100644 --- a/packages/accounts/package.json +++ b/packages/accounts/package.json @@ -13,7 +13,7 @@ }, "files": ["dist"], "scripts": { - "build": "tsup", + "build": "tsc --noEmit && tsup", "test": "bun test", "cleanup": "rimraf dist .turbo" }, diff --git a/packages/connect/package.json b/packages/connect/package.json index 81b9ece..47c5313 100644 --- a/packages/connect/package.json +++ b/packages/connect/package.json @@ -17,7 +17,7 @@ }, "files": ["dist"], "scripts": { - "build": "tsup", + "build": "tsc --noEmit && tsup", "test": "bun test --rerun-each 3", "cleanup": "rimraf dist .turbo" }, diff --git a/packages/klesia-sdk/package.json b/packages/klesia-sdk/package.json index d0ec262..893c7b9 100644 --- a/packages/klesia-sdk/package.json +++ b/packages/klesia-sdk/package.json @@ -13,7 +13,7 @@ }, "files": ["dist"], "scripts": { - "build": "tsup", + "build": "tsc --noEmit && tsup", "test": "bun test --rerun-each 3", "cleanup": "rimraf dist .turbo" }, diff --git a/packages/providers/package.json b/packages/providers/package.json index df429eb..9dd907a 100644 --- a/packages/providers/package.json +++ b/packages/providers/package.json @@ -13,7 +13,7 @@ }, "files": ["dist"], "scripts": { - "build": "tsup", + "build": "tsc --noEmit && tsup", "test": "bun test", "cleanup": "rimraf dist .turbo" }, diff --git a/packages/utils/package.json b/packages/utils/package.json index 330f05a..d720b5c 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -13,7 +13,7 @@ }, "files": ["dist"], "scripts": { - "build": "tsup", + "build": "tsc --noEmit && tsup", "test": "bun test", "cleanup": "rimraf dist .turbo" }, diff --git a/packages/utils/src/types.ts b/packages/utils/src/types.ts index fdd870f..c1160fe 100644 --- a/packages/utils/src/types.ts +++ b/packages/utils/src/types.ts @@ -11,6 +11,7 @@ import type { TransactionBodySchema, TransactionPayloadSchema, TransactionReceiptSchema, + ZkAppCommandBodySchema, ZkAppCommandPayload, } from "./validation"; @@ -24,6 +25,7 @@ export type PrivateKey = z.infer; export type TransactionBody = z.infer; export type TransactionPayload = z.infer; export type PartialTransaction = z.infer; +export type ZkAppCommandBody = z.infer; export type ZkAppCommandProperties = z.infer; /** diff --git a/packages/utils/src/validation.ts b/packages/utils/src/validation.ts index 2185d3a..1b14a21 100644 --- a/packages/utils/src/validation.ts +++ b/packages/utils/src/validation.ts @@ -55,18 +55,24 @@ export const TransactionPayloadSchema = z }) .strict(); -export const PartialTransactionSchema = TransactionPayloadSchema.extend({ +export const PartialTransactionSchema = TransactionBodySchema.extend({ fee: z.coerce.string().optional(), nonce: z.coerce.string().optional(), }); -export const ZkAppCommandPayload = z +export const ZkAppCommandBodySchema = z .object({ zkappCommand: JsonSchema, feePayer: FeePayerSchema, }) .strict(); +export const ZkAppCommandPayload = z + .object({ + command: ZkAppCommandBodySchema, + }) + .strict(); + /** * Return type schemas */ @@ -112,7 +118,7 @@ export const SignedTransactionSchema = z .object({ signature: SignatureSchema, publicKey: PublicKeySchema, - data: z.union([TransactionBodySchema, ZkAppCommandPayload]), + data: z.union([TransactionBodySchema, ZkAppCommandBodySchema]), }) .strict(); diff --git a/tsconfig.json b/tsconfig.json index 78e22f0..fa8f218 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "@tsconfig/bun/tsconfig.json" + "extends": "@tsconfig/bun/tsconfig.json", + "exclude": ["apps"] }