@siafoundation/sia-central-js
TypeScript icon, indicating that this package has built-in type declarations

0.5.2 • Public • Published

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 })
}

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.5.2
    2
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.5.2
    2
  • 0.5.1
    1
  • 0.5.0
    0
  • 0.4.0
    1

Package Sidebar

Install

npm i @siafoundation/sia-central-js

Weekly Downloads

4

Version

0.5.2

License

MIT

Unpacked Size

12.1 kB

Total Files

8

Last publish

Collaborators

  • alexfreska
  • alex_sia