Socket
Book a DemoInstallSign in
Socket

@bandprotocol/bandchain.js

Package Overview
Dependencies
Maintainers
4
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bandprotocol/bandchain.js

Library for interacting with BandChain in browser and Node.js environments

Source
npmnpm
Version
2.5.0-alpha
Version published
Weekly downloads
51
18.6%
Maintainers
4
Weekly downloads
 
Created
Source

BandChain.js

BandChain.js is a library for interacting with BandChain in browser and Node.js environments. It uses gRPC-web as protocol.

⭐️ Features

  • Interacting with your BandChain wallet
  • Making transactions on BandChain
  • Making data requests to BandChain's oracle

📦 Installation

BandChain.js is currently supported on NodeJS 16.x, and 18.x.

NPM

npm install --save @bandprotocol/bandchain.js

Yarn

yarn add @bandprotocol/bandchain.js

Compatibility

Band 2.2.0, Cosmos SDK 0.44.0, IBC-go 1.1.0

Usage

Retrieving Price Data

const { Client } = require('@bandprotocol/bandchain.js')

// BandChain's Proof-of-Authority REST endpoint
const endpoint = 'https://laozi-testnet6.bandchain.org/grpc-web'
const client = new Client(endpoint)

// This example demonstrates how to query price data from
// Band's standard dataset
async function exampleGetReferenceData() {
  const rate = await client.getReferenceData(
    ['BTC/USD', 'BTC/ETH', 'EUR/USD', 'EUR/ETH'],
    3,
    4,
  )
  return rate
}

;(async () => {
  console.log(await exampleGetReferenceData())
})()

For more examples, please see example folder.

Keywords

oracle

FAQs

Package last updated on 25 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts