Skip to content

Commit

Permalink
fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
feruzm committed Sep 6, 2024
2 parents 997890a + 876ce93 commit dac3fe3
Show file tree
Hide file tree
Showing 4 changed files with 190 additions and 200 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"dependencies": {
"@hiveio/dhive": "^1.2.7",
"axios": "^0.21.1",
"axios": "^1.7.3",
"cors": "^2.8.5",
"express": "^4.17.1",
"hivesigner": "^3.2.5",
Expand Down
15 changes: 2 additions & 13 deletions src/server/handlers/hive-explorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,15 @@ const BASE_URL = 'https://hivexplorer.com/api';

export const fetchGlobalProps = async () => {
let globalDynamic;
let medianHistory;

try {

const _globalPropsUrl = `${BASE_URL}/get_dynamic_global_properties`;
const _mediaHistoryUrl = `${BASE_URL}/get_current_median_history_price`;

const globalDynamicResp = await baseApiRequest(_globalPropsUrl, 'GET');
const medianHistoryResp = await baseApiRequest(_mediaHistoryUrl, 'GET');

globalDynamic = globalDynamicResp.data;
medianHistory = medianHistoryResp.data;

if (!globalDynamic || !medianHistory) {

if (!globalDynamic) {
throw new Error("Invalid global props data")
}

Expand All @@ -40,14 +35,8 @@ export const fetchGlobalProps = async () => {
(_totalFunds / _totalShares) * 1e6;



const base = parseAsset(medianHistory.base).amount;
const quote = parseAsset(medianHistory.quote).amount;

const globalProps = {
hivePerMVests,
base,
quote,
};

return globalProps;
Expand Down
Loading

0 comments on commit dac3fe3

Please sign in to comment.