https://github.com/bpanel-org/price
A middleware plugin for bPanel that fetches crypto/fiat exchange rates
https://github.com/bpanel-org/price
Last synced: about 1 year ago
JSON representation
A middleware plugin for bPanel that fetches crypto/fiat exchange rates
- Host: GitHub
- URL: https://github.com/bpanel-org/price
- Owner: bpanel-org
- Created: 2018-12-02T19:33:41.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-01-23T19:53:44.000Z (over 7 years ago)
- Last Synced: 2025-03-17T20:54:14.700Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 157 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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](https://github.com/bpanel-org/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](https://github.com/bpanel-org/bpanel-cli)
```bash
$ bpanel-cli i @bpanel/curl
```