Git Product home page Git Product logo

digibyte-price-decoder's Introduction

DigiByte Price Decoder

Every 15min digiassetX inc stores price conversion on DigiByte chain. Each of these values are the number of sats needed to make 1 unit of the listed type.

Installation

npm install digibyte-price-decoder

Usage

lookup op_return data in most recent transaction sent by the addresses listed in publishers then feed it in to the function

const priceDecoder=require('digibyte-price-decoder');
const rates=priceDecoder(
    'dgb1qunxh378eltj2jrwza5sj9grvu5xud43vqvudwh',  //fiat address
    'fc976aa6db1dd241da8be5b2ade3d6419ad335760113db410a22275a6562df41d3c0ac0e1e40d141a834ed4513fd6a41074201bf0515ac412e31e46506f3a6417f14a4051b48b0417202047ee74bd841' //value found in txid:  7154052d35c9c90beefe7b9c7150438a042a58765b045e43122cc1cb59ca3116
);

keep in mind the header value of '6a4c50' may be infront of the data depending where you source it from

  • 6a=op_return
  • 4c=next byte contains length
  • 50=80 bytes long

if new addresses are added with shorter payloads 4c maybe replaced with the data length

digibyte-price-decoder's People

Contributors

mctrivia avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.