File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,11 @@ const api = new OpenAPIHono();
19
19
api . use ( logger ( ) ) ;
20
20
api . use (
21
21
rateLimiter ( {
22
- keyGenerator : ( c ) => getConnInfo ( c ) . remote . address ?? nanoid ( ) ,
22
+ skip : ( c ) => c . req . path !== "/api" || c . req . method !== "POST" ,
23
+ keyGenerator : ( c ) =>
24
+ c . req . header ( "x-forwarded-for" ) ??
25
+ getConnInfo ( c ) . remote . address ??
26
+ nanoid ( ) ,
23
27
limit : 10 ,
24
28
} ) ,
25
29
) ;
Original file line number Diff line number Diff line change @@ -5,13 +5,15 @@ import { z } from "zod";
5
5
6
6
const NetworkMatcher = z . enum ( [ "mainnet" , "devnet" ] ) ;
7
7
8
- export const createClient = ( { network } : { network : 'mainnet' | 'devnet' } ) => {
8
+ export const createClient = ( {
9
+ network,
10
+ } : { network : "mainnet" | "devnet" } ) => {
9
11
return match ( NetworkMatcher . parse ( network ) )
10
12
. with ( "devnet" , ( ) =>
11
13
hc < KlesiaRpc > ( "https://devnet.klesia.palladians.xyz/api" ) ,
12
14
)
13
15
. with ( "mainnet" , ( ) =>
14
16
hc < KlesiaRpc > ( "https://mainnet.klesia.palladians.xyz/api" ) ,
15
17
)
16
- . exhaustive ( ) ;
18
+ . exhaustive ( ) ;
17
19
} ;
You can’t perform that action at this time.
0 commit comments