diff --git a/.env.example b/.env.example index 06a8e8d..c9ee101 100644 --- a/.env.example +++ b/.env.example @@ -82,8 +82,8 @@ SIGNED_COOKIE_THEME_EXPIRES_IN_MS=31536000000 # 365 days COINGECKO_API_BASE_URL=https://api.coingecko.com/api/v3 COINGECKO_RATE_FETCH_TIMEOUT_MS=5000 -KRAKEN_API_BASE_URL=https://api.kraken.com/0/public -KRAKEN_RATE_FETCH_TIMEOUT_MS=5000 +COINPAPRIKA_API_BASE_URL=https://api.coinpaprika.com/v1 +COINPAPRIKA_RATE_FETCH_TIMEOUT_MS=5000 BASE64_ENCRYPTION_KEY="nyRya1KpYSQ+drpO132mkOEMUR+uq6K7tWvpMfppIME=" # Generate with: openssl rand -base64 32 diff --git a/backend/src/config/index.ts b/backend/src/config/index.ts index e6ae381..dcd7597 100644 --- a/backend/src/config/index.ts +++ b/backend/src/config/index.ts @@ -4,7 +4,7 @@ import { EncryptionConfig, InvoiceConfig, JwtConfig, - KrakenConfig, + CoinPaprikaConfig, MulterConfig, OrderConfig, PostgresConfig, @@ -163,10 +163,10 @@ export const getCoingeckoConfig = (): CoingeckoConfig => { }; }; -export const getKrakenConfig = (): KrakenConfig => { +export const getCoinPaprikaConfig = (): CoinPaprikaConfig => { return { - apiBaseUrl: env('KRAKEN_API_BASE_URL'), - rateFetchTimeoutMs: envInt('KRAKEN_RATE_FETCH_TIMEOUT_MS') + apiBaseUrl: env('COINPAPRIKA_API_BASE_URL'), + rateFetchTimeoutMs: envInt('COINPAPRIKA_RATE_FETCH_TIMEOUT_MS') }; }; @@ -214,7 +214,7 @@ export default () => ({ app: getAppConfig(), jwt: getJwtConfig(), coingecko: getCoingeckoConfig(), - kraken: getKrakenConfig(), + coinPaprika: getCoinPaprikaConfig(), encryption: getEncryptionConfig(), shopSettings: getShopSettingsConfig(), order: getOrderConfig(), diff --git a/backend/src/config/validate.ts b/backend/src/config/validate.ts index ec9d5ff..ba4eb57 100644 --- a/backend/src/config/validate.ts +++ b/backend/src/config/validate.ts @@ -246,12 +246,12 @@ class EnvironmentVariables { @IsNotEmpty() @IsString() - KRAKEN_API_BASE_URL: string; + COINPAPRIKA_API_BASE_URL: string; @IsNotEmpty() @IsNumber() @Min(1) - KRAKEN_RATE_FETCH_TIMEOUT_MS: number; + COINPAPRIKA_RATE_FETCH_TIMEOUT_MS: number; @IsNotEmpty() @IsNumber() diff --git a/backend/src/types/Config.ts b/backend/src/types/Config.ts index 5dd2b58..a9f940c 100644 --- a/backend/src/types/Config.ts +++ b/backend/src/types/Config.ts @@ -87,7 +87,7 @@ export interface CoingeckoConfig { rateFetchTimeoutMs: number; } -export interface KrakenConfig { +export interface CoinPaprikaConfig { apiBaseUrl: string; rateFetchTimeoutMs: number; } @@ -112,7 +112,7 @@ export interface Config { postgres: PostgresConfig; jwt: JwtConfig; coingecko: CoingeckoConfig; - kraken: KrakenConfig; + coinPaprika: CoinPaprikaConfig; encryption: EncryptionConfig; shopSettings: ShopSettingsConfig; order: OrderConfig;