GithubHelp home page GithubHelp logo

fio-supply's Introduction

fio-supply

CodeQL Gosec

This is a microservice for getting current token state: total supply, circulating supply, locked tokens, bp bucket, and bp rewards. By default it returns the response in whole FIO as a float with 9 digits of precision. The values are calculated every 126 seconds (each full production round), and will return the previous calculation if there is an error getting the values. The X-Last-Refreshed: header in the response has the time of the most recent refresh.

All heavy lifting is performed by the fio-go library. Included is a Postman collection to assist in using the service.

Running

The nodeos URL and Listen Port (does not support TLS, assumes that the service runs behind a proxy) can be set using either a command line flag or via environment variable.

Examples:

fio-supply -u https://fio.nodeos-host -p 8080
# -OR-
URL=https://fio.nodeos-host PORT=8080 fio-supply

The valid paths are:

  • /supply or /minted for current supply.
  • /locked for current count of locked tokens
  • /bprewards
  • /bpbucket
  • /circulating == (supply - locked - bprewards - bpbucket)

Modifiers:

  • Adding /suf to the path will return the value as an unsigned integer in smallest units instead of a float.
  • Adding /int to the path will return the value as an unsigned integer in whole FIO instead of a float.
  • Adding ?json=true will return the result as a json object.

A live version of this service is available on the fioprotocol.io site, for example to get the circulating tokens in whole FIO as a float formatted as JSON:

curl -s https://fioprotocol.io/circulating?json

Additional examples:

  • https://fioprotocol.io/circulating
  • https://fioprotocol.io/supply/suf
  • https://fioprotocol.io/locked?json=true
  • https://fioprotocol.io/bpbucket/suf?json=true

fio-supply's People

Contributors

blockpane avatar

Watchers

 avatar James Cloos avatar  avatar nicolasMazuryk avatar  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.