0.5.3 • Published 6 months ago
@siafoundation/sia-central-js v0.5.3
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 })
}