File tree Expand file tree Collapse file tree 1 file changed +12
-11
lines changed Expand file tree Collapse file tree 1 file changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -25,17 +25,18 @@ export const createClient = ({
25
25
customUrl,
26
26
throwable = true ,
27
27
} : CreateClientProps ) => {
28
- const baseClient = match ( KlesiaNetwork . parse ( network ) )
29
- . with ( "devnet" , ( ) =>
30
- hc < KlesiaRpc > ( customUrl ?? "https://devnet.klesia.palladians.xyz" ) ,
31
- )
32
- . with ( "mainnet" , ( ) =>
33
- hc < KlesiaRpc > ( customUrl ?? "https://mainnet.klesia.palladians.xyz" ) ,
34
- )
35
- . with ( "zeko_devnet" , ( ) =>
36
- hc < KlesiaRpc > ( customUrl ?? "https://zeko-devnet.klesia.palladians.xyz" ) ,
37
- )
38
- . exhaustive ( ) ;
28
+ const baseUrl = customUrl
29
+ ? customUrl
30
+ : match ( KlesiaNetwork . parse ( network ) )
31
+ . with ( "devnet" , ( ) => "https://devnet.klesia.palladians.xyz" )
32
+ . with ( "mainnet" , ( ) => "https://mainnet.klesia.palladians.xyz" )
33
+ . with ( "zeko_devnet" , ( ) => "https://zeko-devnet.klesia.palladians.xyz" )
34
+ . exhaustive ( ) ;
35
+ const baseClient = hc < KlesiaRpc > ( baseUrl , {
36
+ headers : {
37
+ "Access-Control-Allow-Origin" : "*" ,
38
+ } ,
39
+ } ) ;
39
40
const rpcHandler = baseClient . api . $post ;
40
41
type RpcRequest = Parameters < typeof rpcHandler > [ 0 ] ;
41
42
const request = async < T extends string > ( req : RpcRequest [ "json" ] ) => {
You can’t perform that action at this time.
0 commit comments