HiveXPH SDKhivexph-sdk
NPM
Developer toolkit for Hive Custom JSON and Hive Engine transactions.

Configuration

RPC resolution

Node selection belongs to the RPC system, not to configurations. That keeps account setup portable across environments and nodes swappable at runtime.

Switch nodes live

Default endpoint

TypeScript
import { DEFAULT_RPC_ENDPOINT } from "hivexph-sdk";

const hive = new HiveClient();
hive.endpoint; // DEFAULT_RPC_ENDPOINT

Custom endpoint

TypeScript
const hive = new HiveClient({ endpoint: "https://api.deathwing.me" });

await hive.rpc.getDynamicGlobalProperties();
await hive.rpc.getHeadBlockNumber();

Every module bound to a configuration — reader, stream, issuer — uses that configuration's RPC client, so a single endpoint change applies everywhere.

Beacon discovery & failover

Without an endpoint override, the RPC client resolves nodes automatically: it asks Beacon for the top-ranked healthy node, falls back to DEFAULT_RPC_ENDPOINT when that node fails, and then retries with the next best Beacon node that has not been tried yet.

TypeScript
const hive = new HiveClient(); // beacon top node -> default -> next beacon node

await hive.rpc.getHeadBlockNumber();
hive.rpc.endpoint;         // node currently in use
hive.rpc.fallbackEndpoint; // failover endpoint
hive.rpc.resetEndpoint();  // forget failures, re-run discovery

// Explicit override disables discovery and failover entirely:
const pinned = new HiveClient({ endpoint: "https://api.deathwing.me" });

Note

Only transport errors (network failures and non-2xx responses) trigger failover. A valid JSON-RPC error is returned to the caller as-is.