From 2aefd8856084b314f0ea640b2136a5fce2d529c0 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 11 Nov 2024 16:42:15 -0800 Subject: set fixer base to USD --- lib/rates.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/rates.ts b/lib/rates.ts index 1778cdd1..5f98af42 100644 --- a/lib/rates.ts +++ b/lib/rates.ts @@ -1,8 +1,8 @@ -import got from "got"; import config from "$config"; -import { err } from "$lib/logging"; import { g, s } from "$lib/db"; +import { err } from "$lib/logging"; import { sleep } from "$lib/utils"; +import got from "got"; import WebSocket from "ws"; export let rate; @@ -58,8 +58,9 @@ export const getFx = async () => { try { if (config.fixer) { ({ rates: fx } = (await got( - `http://data.fixer.io/api/latest?access_key=${config.fixer}`, + `http://data.fixer.io/api/latest?access_key=${config.fixer}&base=USD`, ).json()) as any); + } else { ({ fx } = (await got("https://coinos.io/api/fx").json()) as any); } -- cgit v1.2.3