hive-tx v7
GitHub npm

Use

Configuration

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

import { config } from 'hive-tx'

config.nodes = [
  'https://api.hive.blog',
  'https://api.deathwing.me',
  'https://api.openhive.network',
  'https://rpc.mahdiyari.info',
  'https://techcoderx.com',
  'https://hiveapi.actifit.io',
  'https://api.c0ff33a.uk'
]
config.restNodes = [
  'https://api.hive.blog',
  'https://rpc.mahdiyari.info',
  'https://techcoderx.com',
  'https://hiveapi.actifit.io',
  'https://api.c0ff33a.uk'
]
config.timeout = 10_000
config.retry = 8
config.address_prefix = 'STM'
config.chain_id = 'beeab0de00000000000000000000000000000000000000000000000000000000'
FieldUnitDefault
nodesURL arrayPublic JSON-RPC nodes
restNodesURL array with no trailing slashPublic REST nodes
timeoutmilliseconds10000
retrycount8
address_prefixstringSTM
chain_id64 hex charactersHive mainnet chain id
Caution config is global for the process. Concurrent tasks that change config.nodes can select the wrong node. Set the node list once at start.

Timeout and expiration values are in milliseconds in v7. In v6 those values were in seconds.