diff options
| author | Adam Soltys <[email protected]> | 2024-11-11 16:42:15 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2024-11-11 16:42:15 -0800 |
| commit | 2aefd8856084b314f0ea640b2136a5fce2d529c0 (patch) | |
| tree | 93662303cc7672afd22d7734a6684c0308ea7518 | |
| parent | f34b4c0210eaa8fb5ef62aba8f1bbaf3ccabb83f (diff) | |
| download | coinos-server-2aefd8856084b314f0ea640b2136a5fce2d529c0.tar.gz coinos-server-2aefd8856084b314f0ea640b2136a5fce2d529c0.zip | |
set fixer base to USD
| -rw-r--r-- | lib/rates.ts | 7 |
1 files changed, 4 insertions, 3 deletions
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); } |
