Skip to content

Commit 20b7c2c

Browse files
committed
Change RPC and Network type checking approach
1 parent 8a113f6 commit 20b7c2c

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

eslint.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import reactX from "eslint-plugin-react-x";
77
import tseslint from "typescript-eslint";
88

99
export default tseslint.config(
10-
{ ignores: ["dist", "packages"] },
10+
{ ignores: ["dist", "packages", "src/contracts"] },
1111
{
1212
extends: [
1313
js.configs.recommended,

src/contracts/util.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
const envRPC = import.meta.env.PUBLIC_SOROBAN_RPC_URL;
12
export const rpcUrl =
2-
import.meta.env.PUBLIC_SOROBAN_RPC_URL as string ?? "http://localhost:8000/rpc";
3+
envRPC && typeof envRPC === "string"
4+
? envRPC : "http://localhost:8000/rpc";
5+
6+
const envNetworkPassphrase = import.meta.env.PUBLIC_NETWORK_PASSPHRASE;
37
export const networkPassphrase =
4-
import.meta.env.PUBLIC_SOROBAN_NETWORK_PASSPHRASE as string ??
5-
"Standalone Network ; February 2017";
8+
envNetworkPassphrase && envNetworkPassphrase === "string"
9+
? envRPC : "Standalone Network ; February 2017";

0 commit comments

Comments
 (0)