Skip to content

Commit

Permalink
Merge pull request #9 from noumantahir/nt/wallet-api
Browse files Browse the repository at this point in the history
maintaining a set of available engine nodes
  • Loading branch information
feruzm authored Jul 29, 2024
2 parents f3a7795 + 6e6ce3a commit c55389c
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/server/handlers/wallet-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,19 @@ import { EngineContracts, EngineIds, EngineMetric, EngineRequestPayload, EngineT
import { convertEngineToken, convertRewardsStatus } from "../../models/converters";

//docs: https://hive-engine.github.io/engine-docs/
const BASE_ENGINE_URL = 'https://api2.hive-engine.com';//'https://api2.hive-engine.com';
//available nodes: https://beacon.peakd.com/ select tab 'Hive Engine'
const ENGINE_NODES = [
"https://engine.rishipanthee.com",
"https://herpc.dtools.dev",
"https://api.hive-engine.com/rpc/",
"https://ha.herpc.dtools.dev",
"https://herpc.kanibot.com",
"https://he.sourov.dev",
"https://herpc.actifit.io",
"https://api2.hive-engine.com/rpc/"
];

const BASE_ENGINE_URL = ENGINE_NODES[2];
const BASE_SPK_URL = 'https://spk.good-karma.xyz';

const ENGINE_REWARDS_URL = 'https://scot-api.hive-engine.com/';
Expand All @@ -16,7 +28,6 @@ const ENGINE_CHART_URL = 'https://info-api.tribaldex.com/market/ohlcv';
//docs: https://github.com/hive-engine/ssc_tokens_history/tree/hive#api-usage
const ENGINE_ACCOUNT_HISTORY_URL = 'https://history.hive-engine.com/accountHistory';

const PATH_RPC = 'rpc';
export const PATH_CONTRACTS = 'contracts';


Expand Down Expand Up @@ -54,7 +65,7 @@ export const engineAccountHistory = (req: express.Request, res: express.Response

//raw engine api call
const engineContractsRequest = (data: EngineRequestPayload) => {
const url = `${BASE_ENGINE_URL}/${PATH_RPC}/${PATH_CONTRACTS}`;
const url = `${BASE_ENGINE_URL}/${PATH_CONTRACTS}`;
const headers = { 'Content-type': 'application/json', 'User-Agent': 'Ecency' };

return baseApiRequest(url, "POST", headers, data)
Expand Down

0 comments on commit c55389c

Please sign in to comment.