Skip to content

A middleware plugin for bPanel that fetches crypto/fiat exchange rates

Notifications You must be signed in to change notification settings

bpanel-org/price

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Price

This plugin runs entirely in middleware and has no views.

It listens for the following actions:

UPDATE_PRICE
UPDATE_FIAT
UPDATE_CRYPTO
UPDATE_FEED
UPDATE_AVAIL_FIATS
REFRESH_PRICE
SET_CURRENT_CLIENT

...and maintains price data in the application state like this:

state.plugins.price = {
  price: "137.53000000"
  fiat: "GBP"
  fiatSymbol: "£"
  crypto: "BCH"
  feed: "Coinbase"
}

Additional APIs can be added in lib/feeds.js, template and details are in the comments.

Price data can be displayed and modified from other plugins, such as the simple footer widget price-widget. On its own, this plugin will ONLY fetch the price on application load, and whenever STATE_REFRESHED is dispatched. Otherwise it requires an additional plugin (like the footer widget) to dispatch REFRESH_PRICE.

Important: This plug in currently requires the bPanel backend plugin @bpanel/curl to be installed separately by the user:

Using bpanel-cli

$ bpanel-cli i @bpanel/curl

About

A middleware plugin for bPanel that fetches crypto/fiat exchange rates

Resources

Stars

Watchers

Forks

Packages

No packages published