From b3d188618be488c3608d26f94081f1c9f6f94aaf Mon Sep 17 00:00:00 2001 From: feruzm Date: Mon, 22 Jul 2024 11:41:12 +0300 Subject: [PATCH] fix missing variables and other typos --- src/server/handlers/hive-explorer.ts | 4 ++-- src/server/handlers/wallet-api.ts | 8 ++++---- src/server/util.ts | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/server/handlers/hive-explorer.ts b/src/server/handlers/hive-explorer.ts index 610d5ab8..ba45cef7 100644 --- a/src/server/handlers/hive-explorer.ts +++ b/src/server/handlers/hive-explorer.ts @@ -52,7 +52,7 @@ export const fetchGlobalProps = async () => { return globalProps; } catch (e) { - throw new Error("Failed to get globalProps", e) + throw new Error("Failed to get globalProps") } }; @@ -74,6 +74,6 @@ export const getAccount = async (username: string) => { } catch (error) { - throw new Error("Failed to get account data", error) + throw new Error("Failed to get account data") } } diff --git a/src/server/handlers/wallet-api.ts b/src/server/handlers/wallet-api.ts index 3d698e4b..17de6e6e 100644 --- a/src/server/handlers/wallet-api.ts +++ b/src/server/handlers/wallet-api.ts @@ -7,7 +7,7 @@ import { EngineContracts, EngineIds, EngineMetric, EngineRequestPayload, EngineT import { convertEngineToken } from "../../models/converters"; //docs: https://hive-engine.github.io/engine-docs/ -const BASE_URL = 'https://api2.hive-engine.com';//'https://api2.hive-engine.com'; +const BASE_ENGINE_URL = 'https://api2.hive-engine.com';//'https://api2.hive-engine.com'; const BASE_SPK_URL = 'https://spk.good-karma.xyz'; const ENGINE_REWARDS_URL = 'https://scot-api.hive-engine.com/'; @@ -138,7 +138,7 @@ export const fetchEngineMetics = async (tokens: string[]): Promise const _userdata = await getAccount(username); //fetch points data - //TODO: put back api request + //TODO: put back api request // const _marketData = await apiRequest(`market-data/latest`, "GET"); const _marketData = await dummyMarketData() - //TODO: put back api request + //TODO: put back api request // const _pointsData =await apiRequest(`users/${username}`, "GET"); const _pointsData = await dummyPointSummary() diff --git a/src/server/util.ts b/src/server/util.ts index 783f5d61..73d0702e 100644 --- a/src/server/util.ts +++ b/src/server/util.ts @@ -1,4 +1,4 @@ -import { SMTAsset } from "@hiveio/dhive"; +import {Asset, SMTAsset} from "@hiveio/dhive"; import axios, {AxiosRequestConfig, AxiosResponse, Method} from "axios"; import express from "express"; @@ -27,7 +27,7 @@ export const baseApiRequest = (url: string, method: Method, headers: any = {}, p } -export const parseToken = (strVal: string | SMTAsset) => { +export const parseToken = (strVal: string) => { // checks if first part of string is float const regex = /^\-?[0-9]+(e[0-9]+)?(\.[0-9]+)? .*$/; if (!regex.test(strVal)) {