Skip to content

Commit ebd8427

Browse files
committed
fix(klesia): just cors things
1 parent 752528a commit ebd8427

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

packages/klesia-sdk/src/client.ts

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,18 @@ export const createClient = ({
2525
customUrl,
2626
throwable = true,
2727
}: 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+
});
3940
const rpcHandler = baseClient.api.$post;
4041
type RpcRequest = Parameters<typeof rpcHandler>[0];
4142
const request = async <T extends string>(req: RpcRequest["json"]) => {

0 commit comments

Comments
 (0)