hive-tx v7
GitHub npm

Use

Configuration

The config object sets the nodes, timeout, retries, chain id, and address prefix.

import { config } from 'hive-tx'

console.log(config.nodes)  // the default public JSON-RPC nodes

config.nodes = ['https://api.hive.blog', 'https://api.deathwing.me']
config.restNodes = ['https://rpc.mahdiyari.info']
config.timeout = 5_000
config.retry = 3
FieldTypeDefault
nodesURL arrayPublic JSON-RPC nodes, maintained with each release
restNodesURL array, no trailing slashPublic REST nodes, maintained with each release
timeoutmilliseconds10000
retrycount8
address_prefixstringSTM
chain_id64 hex charactersHive mainnet: beeab0de00…00

Calls go to the current node and move down the list on failure, wrapping around at the end; they stay on the node that worked. Put your preferred node first. For a testnet, set chain_id, address_prefix, and nodes to the testnet's values; changes apply to the next call and signature.

Caution config is global to the process. Set it once at startup; changing config.nodes while calls are in flight can send them to the wrong node.