File tree Expand file tree Collapse file tree 8 files changed +35
-22
lines changed Expand file tree Collapse file tree 8 files changed +35
-22
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @mina-js/klesia" ,
3
+ "type" : " module" ,
3
4
"scripts" : {
4
- "dev" : " bun run --hot src/index.ts"
5
+ "build" : " tsc --noEmit && bun build src/index.ts --outdir dist" ,
6
+ "dev" : " bun run --hot src/index.ts" ,
7
+ "start" : " bun dist/index.js"
5
8
},
6
9
"dependencies" : {
7
10
"@hono/zod-openapi" : " ^0.16.0" ,
Original file line number Diff line number Diff line change 1
1
import { OpenAPIHono , createRoute } from "@hono/zod-openapi" ;
2
2
import { apiReference } from "@scalar/hono-api-reference" ;
3
+ import { logger } from "hono/logger" ;
3
4
import { match } from "ts-pattern" ;
4
5
import { mina } from "./methods/mina" ;
5
6
import { RpcMethodSchema , RpcResponseSchema } from "./schema" ;
6
7
import { buildResponse } from "./utils/build-response" ;
7
8
8
9
const api = new OpenAPIHono ( ) ;
9
10
11
+ api . use ( logger ( ) ) ;
12
+
10
13
api . doc ( "/api/openapi" , {
11
14
openapi : "3.0.0" ,
12
15
info : {
Original file line number Diff line number Diff line change 1
1
import { Client , cacheExchange , fetchExchange } from "@urql/core" ;
2
2
import { match } from "ts-pattern" ;
3
+ import { z } from "zod" ;
3
4
4
- const MINA_NETWORK = process . env . MINA_NETWORK ;
5
+ const NetworkMatcher = z . enum ( [ "devnet" , "mainnet" ] ) ;
6
+
7
+ const MINA_NETWORK = NetworkMatcher . parse ( process . env . MINA_NETWORK ) ;
8
+ const NODE_API_DEVNET = z . string ( ) . parse ( process . env . NODE_API_DEVNET ) ;
9
+ const NODE_API_MAINNET = z . string ( ) . parse ( process . env . NODE_API_MAINNET ) ;
5
10
6
11
export const getNodeApiUrl = ( ) => {
7
12
return match ( MINA_NETWORK )
8
- . with ( "devnet" , ( ) => process . env . NODE_API_DEVNET )
9
- . with ( "mainnet" , ( ) => process . env . NODE_API_MAINNET )
10
- . run ( ) ;
13
+ . with ( "devnet" , ( ) => NODE_API_DEVNET )
14
+ . with ( "mainnet" , ( ) => NODE_API_MAINNET )
15
+ . exhaustive ( ) ;
11
16
} ;
12
17
13
18
export const getNodeClient = ( ) => {
Original file line number Diff line number Diff line change 1
1
{
2
+ "extends" : " @tsconfig/bun/tsconfig.json" ,
2
3
"compilerOptions" : {
3
4
"strict" : true ,
4
5
"jsx" : " react-jsx" ,
5
- "jsxImportSource" : " hono/jsx"
6
+ "jsxImportSource" : " hono/jsx" ,
7
+ "noPropertyAccessFromIndexSignature" : false
6
8
}
7
9
}
Original file line number Diff line number Diff line change 10
10
[34mCJS[39m Build start
11
11
[32mCJS[39m [1mdist/index.js [22m[32m2.25 KB[39m
12
12
[32mCJS[39m [1mdist/index.js.map [22m[32m1.44 KB[39m
13
- [32mCJS[39m ⚡️ Build success in 8ms
13
+ [32mCJS[39m ⚡️ Build success in 6ms
14
14
[32mESM[39m [1mdist/index.mjs [22m[32m575.00 B[39m
15
15
[32mESM[39m [1mdist/index.mjs.map [22m[32m1.35 KB[39m
16
- [32mESM[39m ⚡️ Build success in 8ms
16
+ [32mESM[39m ⚡️ Build success in 7ms
17
17
[34mDTS[39m Build start
18
- [32mDTS[39m ⚡️ Build success in 499ms
18
+ [32mDTS[39m ⚡️ Build success in 516ms
19
19
[32mDTS[39m [1mdist/index.d.mts [22m[32m631.00 B[39m
20
20
[32mDTS[39m [1mdist/index.d.ts [22m[32m631.00 B[39m
Original file line number Diff line number Diff line change 10
10
[34mCJS[39m Build start
11
11
[32mCJS[39m [1mdist/index.js [22m[32m3.07 KB[39m
12
12
[32mCJS[39m [1mdist/index.js.map [22m[32m6.11 KB[39m
13
- [32mCJS[39m ⚡️ Build success in 7ms
13
+ [32mCJS[39m ⚡️ Build success in 5ms
14
14
[32mESM[39m [1mdist/index.mjs [22m[32m1.99 KB[39m
15
15
[32mESM[39m [1mdist/index.mjs.map [22m[32m5.61 KB[39m
16
- [32mESM[39m ⚡️ Build success in 7ms
16
+ [32mESM[39m ⚡️ Build success in 6ms
17
17
[34mDTS[39m Build start
18
- [32mDTS[39m ⚡️ Build success in 574ms
18
+ [32mDTS[39m ⚡️ Build success in 594ms
19
19
[32mDTS[39m [1mdist/index.d.mts [22m[32m2.51 KB[39m
20
20
[32mDTS[39m [1mdist/index.d.ts [22m[32m2.51 KB[39m
Original file line number Diff line number Diff line change 10
10
[34mCJS[39m Build start
11
11
[32mESM[39m [1mdist/index.js [22m[32m1.52 KB[39m
12
12
[32mESM[39m [1mdist/index.js.map [22m[32m3.07 KB[39m
13
- [32mESM[39m ⚡️ Build success in 7ms
13
+ [32mESM[39m ⚡️ Build success in 6ms
14
14
[32mCJS[39m [1mdist/index.cjs [22m[32m3.40 KB[39m
15
15
[32mCJS[39m [1mdist/index.cjs.map [22m[32m3.24 KB[39m
16
- [32mCJS[39m ⚡️ Build success in 7ms
16
+ [32mCJS[39m ⚡️ Build success in 6ms
17
17
[34mDTS[39m Build start
18
- [32mDTS[39m ⚡️ Build success in 670ms
19
- [32mDTS[39m [1mdist/index.d.ts [22m[32m12.32 KB[39m
20
- [32mDTS[39m [1mdist/index.d.cts [22m[32m12.32 KB[39m
18
+ [32mDTS[39m ⚡️ Build success in 643ms
19
+ [32mDTS[39m [1mdist/index.d.ts [22m[32m12.33 KB[39m
20
+ [32mDTS[39m [1mdist/index.d.cts [22m[32m12.33 KB[39m
Original file line number Diff line number Diff line change 8
8
[34mCLI[39m Cleaning output folder
9
9
[34mESM[39m Build start
10
10
[34mCJS[39m Build start
11
- [32mESM[39m [1mdist/index.js [22m[32m2.33 KB[39m
12
- [32mESM[39m [1mdist/index.js.map [22m[32m4.16 KB[39m
13
- [32mESM[39m ⚡️ Build success in 7ms
14
11
[32mCJS[39m [1mdist/index.cjs [22m[32m4.62 KB[39m
15
12
[32mCJS[39m [1mdist/index.cjs.map [22m[32m4.36 KB[39m
16
- [32mCJS[39m ⚡️ Build success in 7ms
13
+ [32mCJS[39m ⚡️ Build success in 6ms
14
+ [32mESM[39m [1mdist/index.js [22m[32m2.33 KB[39m
15
+ [32mESM[39m [1mdist/index.js.map [22m[32m4.16 KB[39m
16
+ [32mESM[39m ⚡️ Build success in 6ms
17
17
[34mDTS[39m Build start
18
- [32mDTS[39m ⚡️ Build success in 728ms
18
+ [32mDTS[39m ⚡️ Build success in 719ms
19
19
[32mDTS[39m [1mdist/index.d.ts [22m[32m11.44 KB[39m
20
20
[32mDTS[39m [1mdist/index.d.cts [22m[32m11.44 KB[39m
You can’t perform that action at this time.
0 commit comments