Skip to content

Commit d51e6fb

Browse files
committed
chore(providers): improve tx types
1 parent 8a4fc50 commit d51e6fb

File tree

8 files changed

+18
-9
lines changed

8 files changed

+18
-9
lines changed

packages/accounts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
},
1414
"files": ["dist"],
1515
"scripts": {
16-
"build": "tsup",
16+
"build": "tsc --noEmit && tsup",
1717
"test": "bun test",
1818
"cleanup": "rimraf dist .turbo"
1919
},

packages/connect/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
},
1818
"files": ["dist"],
1919
"scripts": {
20-
"build": "tsup",
20+
"build": "tsc --noEmit && tsup",
2121
"test": "bun test --rerun-each 3",
2222
"cleanup": "rimraf dist .turbo"
2323
},

packages/klesia-sdk/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
},
1414
"files": ["dist"],
1515
"scripts": {
16-
"build": "tsup",
16+
"build": "tsc --noEmit && tsup",
1717
"test": "bun test --rerun-each 3",
1818
"cleanup": "rimraf dist .turbo"
1919
},

packages/providers/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
},
1414
"files": ["dist"],
1515
"scripts": {
16-
"build": "tsup",
16+
"build": "tsc --noEmit && tsup",
1717
"test": "bun test",
1818
"cleanup": "rimraf dist .turbo"
1919
},

packages/utils/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
},
1414
"files": ["dist"],
1515
"scripts": {
16-
"build": "tsup",
16+
"build": "tsc --noEmit && tsup",
1717
"test": "bun test",
1818
"cleanup": "rimraf dist .turbo"
1919
},

packages/utils/src/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import type {
1111
TransactionBodySchema,
1212
TransactionPayloadSchema,
1313
TransactionReceiptSchema,
14+
ZkAppCommandBodySchema,
1415
ZkAppCommandPayload,
1516
} from "./validation";
1617

@@ -24,6 +25,7 @@ export type PrivateKey = z.infer<typeof PrivateKeySchema>;
2425
export type TransactionBody = z.infer<typeof TransactionBodySchema>;
2526
export type TransactionPayload = z.infer<typeof TransactionPayloadSchema>;
2627
export type PartialTransaction = z.infer<typeof PartialTransactionSchema>;
28+
export type ZkAppCommandBody = z.infer<typeof ZkAppCommandBodySchema>;
2729
export type ZkAppCommandProperties = z.infer<typeof ZkAppCommandPayload>;
2830

2931
/**

packages/utils/src/validation.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,24 @@ export const TransactionPayloadSchema = z
5555
})
5656
.strict();
5757

58-
export const PartialTransactionSchema = TransactionPayloadSchema.extend({
58+
export const PartialTransactionSchema = TransactionBodySchema.extend({
5959
fee: z.coerce.string().optional(),
6060
nonce: z.coerce.string().optional(),
6161
});
6262

63-
export const ZkAppCommandPayload = z
63+
export const ZkAppCommandBodySchema = z
6464
.object({
6565
zkappCommand: JsonSchema,
6666
feePayer: FeePayerSchema,
6767
})
6868
.strict();
6969

70+
export const ZkAppCommandPayload = z
71+
.object({
72+
command: ZkAppCommandBodySchema,
73+
})
74+
.strict();
75+
7076
/**
7177
* Return type schemas
7278
*/
@@ -112,7 +118,7 @@ export const SignedTransactionSchema = z
112118
.object({
113119
signature: SignatureSchema,
114120
publicKey: PublicKeySchema,
115-
data: z.union([TransactionBodySchema, ZkAppCommandPayload]),
121+
data: z.union([TransactionBodySchema, ZkAppCommandBodySchema]),
116122
})
117123
.strict();
118124

tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{
2-
"extends": "@tsconfig/bun/tsconfig.json"
2+
"extends": "@tsconfig/bun/tsconfig.json",
3+
"exclude": ["apps"]
34
}

0 commit comments

Comments
 (0)