Skip to content

Commit

Permalink
An other config - this one for remote devnet (parfit)
Browse files Browse the repository at this point in the history
  • Loading branch information
radicleart committed Oct 31, 2023
1 parent 79ebbfa commit 226ebe1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/lib/components/settings/Networks.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
</p>
<p class="text-white font-normal">
<span class="inline-flex bg-black rounded-xl text-white px-4 py-1 font-normal">
{CONFIG.VITE_NETWORK}
{CONFIG.VITE_ENVIRONMENT}
</span>
</p>
<div id="po-network" class="">
Expand Down
13 changes: 4 additions & 9 deletions src/lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const SIMNET_CONFIG = {
}

const DEVNET_REMOTE_CONFIG = {
VITE_ENVIRONMENT: 'devnet',
VITE_ENVIRONMENT: 'devenv',
VITE_PUBLIC_APP_NAME: 'sBTC Bridge Devenv',
VITE_PUBLIC_APP_VERSION: '1.0.0',
VITE_NETWORK: 'devnet',
Expand Down Expand Up @@ -41,7 +41,7 @@ const DEVNET_CONFIG = {
}

const DEV_TESTNET_CONFIG = {
VITE_ENVIRONMENT: 'devnet',
VITE_ENVIRONMENT: 'testnet',
VITE_PUBLIC_APP_NAME: 'sBTC Bridge Devnet',
VITE_PUBLIC_APP_VERSION: '1.0.0',
VITE_NETWORK: 'testnet',
Expand All @@ -55,7 +55,7 @@ const DEV_TESTNET_CONFIG = {
}

const TESTNET_CONFIG = {
VITE_ENVIRONMENT: 'staging',
VITE_ENVIRONMENT: 'testnet',
VITE_PUBLIC_APP_NAME: 'sBTC Bridge Testnet',
VITE_PUBLIC_APP_VERSION: '1.0.0',
VITE_BRIDGE_WS: 'ws://bridge.sbtc.tech',
Expand All @@ -69,7 +69,7 @@ const TESTNET_CONFIG = {
}

const MAINNET_CONFIG = {
VITE_ENVIRONMENT: 'production',
VITE_ENVIRONMENT: 'mainnet',
VITE_PUBLIC_APP_NAME: 'sBTC Bridge',
VITE_PUBLIC_APP_VERSION: '1.0.0',
VITE_BRIDGE_WS: 'ws://bridge.sbtc.tech',
Expand Down Expand Up @@ -113,8 +113,3 @@ export function setConfig(network:string) {
CONFIG.VITE_BRIDGE_API = 'https://bridge.sbtc.tech/bridge-api/v1'
}
}

export function isSimnet() {
return CONFIG.VITE_ENVIRONMENT === 'simnet'
}

3 changes: 1 addition & 2 deletions src/lib/stacks_connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ export function isAllowed(address:string) {
export function getStacksNetwork() {
const network = CONFIG.VITE_NETWORK;
let stxNetwork:StacksMainnet|StacksTestnet;
if (CONFIG.VITE_ENVIRONMENT === 'simnet') stxNetwork = new StacksMocknet();
else if (network === 'devnet') stxNetwork = new StacksMocknet();
if (network === 'devnet') stxNetwork = new StacksMocknet();
else if (network === 'testnet') stxNetwork = new StacksTestnet();
else if (network === 'mainnet') stxNetwork = new StacksMainnet();
else stxNetwork = new StacksMocknet();
Expand Down

0 comments on commit 226ebe1

Please sign in to comment.