Latest Threat Research:Malicious dYdX Packages Published to npm and PyPI After Maintainer Compromise.Details
Socket
Book a DemoInstallSign in
Socket

bitfinex-terminal-funding-encoding

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bitfinex-terminal-funding-encoding

The key and value encodings for the funding stats Dazaar db

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

bitfinex-terminal-funding-encoding

Hyperbee Key and Value-Encodings for the Bitfinex Terminal Funding Stats data set.

Example

const dazaar = require('dazaar')
const swarm = require('dazaar/swarm')
const Hyperbee = require('hyperbee')

// Load the encodings
const { keyEncoding, valueEncoding } = require('bitfinex-terminal-funding-encoding')

const card = require('../cards/free/bitfinex.terminal.funding.stats.json')
const buyer = market.buy(card, { sparse: true })


buyer.on('feed', function () {
  const db = new Hyperbee(buyer.feed, {
    keyEncoding,
    valueEncoding
  })

  doQuery(db)
})

function doQuery (db) {
  // Load the sub database for the currency you are looking for.
  db.sub('BTC').createReadStream({
    gte: new Date('2018-10-10T09:00:00.000Z'),
    lte: new Date('2019-10-10T09:00:00.000Z'),
    limit: 10,
    reverse: true
  }).on('data', (d) => {
    console.log(d)
  })
}


swarm(buyer)

API

Just pass the keyEncoding and valueEncoding modules to the Hyperbee constructor.

After that you can specify your range queries as dates for the currency sub database you want to query.

Keywords

bitfinex

FAQs

Package last updated on 02 Feb 2021

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