Skip to content

Latest commit

 

History

History

sia-central-js

sia-central-js

Methods and types for interacting with the Sia Central API.

Installation

npm install @siafoundation/sia-central-js

Usage

import { SiaCentral } from '@siafoundation/sia-central-js'

export async function example() {
  const siaCentral = SiaCentral()
  const latestBlock = await siaCentral.blockLatest()
  const metrics = await siaCentral.hostsNetworkMetrics()
  const averages = await siaCentral.hostsNetworkAverages()
  const exchangeRates = await siaCentral.exchangeRates({
    params: {
      currencies: 'sc',
    },
  })
  console.log({ latestBlock, metrics, averages, exchangeRates })
}