env defaults

This commit is contained in:
hatim boufnichel 2024-06-14 17:33:10 +02:00
parent aafa4bf3ad
commit c49627a6e8
2 changed files with 11 additions and 12 deletions

View file

@ -31,10 +31,11 @@ LIQUIDITY_PROVIDER_PUB=
#BOOTSTRAP=1 #BOOTSTRAP=1
#LSP #LSP
OLYMPUS_LSP_URL= OLYMPUS_LSP_URL=https://lsps1.lnolymp.us/api/v1
VOLTAGE_LSP_URL= VOLTAGE_LSP_URL=https://lsp.voltageapi.com/api/v1
LSP_CHANNEL_THRESHOLD=0 FLASHSATS_LSP_URL=https://lsp.flashsats.xyz/lsp/channel
LSP_MAX_FEE_BPS=0 LSP_CHANNEL_THRESHOLD=1000000
LSP_MAX_FEE_BPS=100
#ROOT_FEES #ROOT_FEES
# Applied to either debits or credits and sent to an admin account # Applied to either debits or credits and sent to an admin account

View file

@ -8,19 +8,17 @@ export type LSPSettings = {
olympusServiceUrl: string olympusServiceUrl: string
voltageServiceUrl: string voltageServiceUrl: string
flashsatsServiceUrl: string flashsatsServiceUrl: string
flashsatsNodeUri: string
channelThreshold: number channelThreshold: number
maxRelativeFee: number maxRelativeFee: number
} }
export const LoadLSPSettingsFromEnv = (): LSPSettings => { export const LoadLSPSettingsFromEnv = (): LSPSettings => {
const olympusServiceUrl = process.env.OLYMPUS_LSP_URL || "" const olympusServiceUrl = process.env.OLYMPUS_LSP_URL || "https://lsps1.lnolymp.us/api/v1"
const voltageServiceUrl = process.env.VOLTAGE_LSP_URL || "" const voltageServiceUrl = process.env.VOLTAGE_LSP_URL || "https://lsp.voltageapi.com/api/v1"
const flashsatsServiceUrl = process.env.FLASHSATS_LSP_URL || "" const flashsatsServiceUrl = process.env.FLASHSATS_LSP_URL || "https://lsp.flashsats.xyz/lsp/channel"
const flashsatsNodeUri = process.env.FLASHSATS_LSP_NODE_URI || "" const channelThreshold = EnvCanBeInteger("LSP_CHANNEL_THRESHOLD", 1000000)
const channelThreshold = EnvCanBeInteger("LSP_CHANNEL_THRESHOLD") const maxRelativeFee = EnvCanBeInteger("LSP_MAX_FEE_BPS", 100) / 10000
const maxRelativeFee = EnvCanBeInteger("LSP_MAX_FEE_BPS") / 10000 return { olympusServiceUrl, voltageServiceUrl, channelThreshold, maxRelativeFee, flashsatsServiceUrl }
return { olympusServiceUrl, voltageServiceUrl, channelThreshold, maxRelativeFee, flashsatsServiceUrl, flashsatsNodeUri }
} }
type OlympusOrder = { type OlympusOrder = {