Skip to content

Commit

Permalink
ALL-9108 Implement feedback from Filip
Browse files Browse the repository at this point in the history
  • Loading branch information
juraj.bacovcin committed Oct 10, 2024
1 parent 90f9caa commit 5d070cc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/connector/tatum.connector.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import process from 'process'
import { Container, Service } from 'typedi'
import { JsonRpcCall } from '../dto'
import { ApiVersion } from '../service'
Expand Down
7 changes: 5 additions & 2 deletions src/util/network.utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Network, NETWORK_METADATA, NetworkMetadata } from '../dto'
import process from 'process'
import { EnvUtils } from './env'

export const NetworkUtils = {
getNetworkMetadata: (network: Network): NetworkMetadata => {
Expand All @@ -19,5 +19,8 @@ export const NetworkUtils = {
const metadata = NetworkUtils.getNetworkMetadata(network)
return metadata.testnet && !metadata.defaultTestnet
},
getV4ApiKeyForNetwork: (network: Network) => NetworkUtils.isTestnet(network) ? process.env.V4_API_KEY_TESTNET : process.env.V4_API_KEY_MAINNET
getV4ApiKeyForNetwork: (network: Network) => {
if (!EnvUtils.isProcessAvailable()) return undefined
return NetworkUtils.isTestnet(network) ? process.env?.V4_API_KEY_TESTNET : process.env?.V4_API_KEY_MAINNET
},
}

0 comments on commit 5d070cc

Please sign in to comment.