Skip to content

Commit

Permalink
chore(repo): ignore .turbo
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcnk committed Sep 2, 2024
1 parent 8d932ac commit e25e977
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 97 deletions.
1 change: 1 addition & 0 deletions apps/klesia/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"start": "bun dist/index.js"
},
"dependencies": {
"@mina-js/shared": "workspace:*",
"@hono/zod-openapi": "^0.16.0",
"@scalar/hono-api-reference": "^0.5.143",
"@urql/core": "^5.0.6",
Expand Down
5 changes: 3 additions & 2 deletions apps/klesia/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { match } from "ts-pattern";
import { mina } from "./methods/mina";
import { RpcMethodSchema, RpcResponseSchema } from "./schema";
import { buildResponse } from "./utils/build-response";
import { PublicKeySchema } from "@mina-js/shared";

const api = new OpenAPIHono();

Expand Down Expand Up @@ -41,12 +42,12 @@ api.openapi(rpcRoute, async ({ req, json }) => {
return match(body)
.with({ method: "mina_getTransactionCount" }, async ({ params }) => {
const [publicKey] = params;
const result = await mina.getTransactionCount({ publicKey });
const result = await mina.getTransactionCount({ publicKey: PublicKeySchema.parse(publicKey) });
return json(buildResponse(result), 200);
})
.with({ method: "mina_getBalance" }, async ({ params }) => {
const [publicKey] = params;
const result = await mina.getBalance({ publicKey });
const result = await mina.getBalance({ publicKey: PublicKeySchema.parse(publicKey) });
return json(buildResponse(result), 200);
})
.with({ method: "mina_blockHash" }, async () => {
Expand Down
5 changes: 3 additions & 2 deletions apps/klesia/src/methods/mina.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { gql } from "@urql/core";
import { match } from "ts-pattern";
import { getNodeClient } from "../utils/node";
import { SignedTransactionSchema } from "@mina-js/shared";

const getTransactionCount = async ({ publicKey }: { publicKey: string }) => {
const client = getNodeClient();
Expand Down Expand Up @@ -75,7 +76,7 @@ const sendTransaction = async ({
const client = getNodeClient();
return match(type)
.with("payment", async () => {
const { signature, data: input } = signedTransaction;
const { signature, data: input } = SignedTransactionSchema.parse(signedTransaction)
const { data } = await client.mutation(
gql`
mutation {
Expand All @@ -91,7 +92,7 @@ const sendTransaction = async ({
return data.sendPayment.payment.hash;
})
.with("delegation", async () => {
const { signature, data: input } = signedTransaction;
const { signature, data: input } = SignedTransactionSchema.parse(signedTransaction)
const { data } = await client.mutation(
gql`
mutation {
Expand Down
2 changes: 1 addition & 1 deletion apps/klesia/src/schema.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { PublicKeySchema } from "@mina-js/shared";
import { z } from "zod";

export const PublicKeySchema = z.string().length(55);
export const PublicKeyParamsSchema = z.array(PublicKeySchema).length(1);
export const EmptyParamsSchema = z.array(z.string()).length(0).optional();
export const SendTransactionSchema = z.array(z.any(), z.string()).length(2);
Expand Down
Binary file modified bun.lockb
Binary file not shown.
20 changes: 0 additions & 20 deletions packages/accounts/.turbo/turbo-build.log

This file was deleted.

20 changes: 0 additions & 20 deletions packages/connect/.turbo/turbo-build.log

This file was deleted.

20 changes: 0 additions & 20 deletions packages/providers/.turbo/turbo-build.log

This file was deleted.

20 changes: 0 additions & 20 deletions packages/shared/.turbo/turbo-build.log

This file was deleted.

24 changes: 12 additions & 12 deletions turbo.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"$schema": "https://turbo.build/schema.json",
"tasks": {
"build": {
"dependsOn": ["^build"],
"outputs": ["dist/**"]
},
"cleanup": {},
"dev": {
"persistent": true,
"cache": false
}
}
"$schema": "https://turbo.build/schema.json",
"tasks": {
"build": {
"dependsOn": ["^build"],
"outputs": ["dist/**"]
},
"cleanup": {},
"dev": {
"persistent": true,
"cache": false
}
}
}

0 comments on commit e25e977

Please sign in to comment.