mirror of
https://github.com/FlipsideCrypto/flipside-js.git
synced 2026-02-06 10:48:11 +00:00
Upgrade to 1.0.1
This commit is contained in:
parent
3b49874d09
commit
b9a98e75f3
22
README.md
22
README.md
@ -1,11 +1,17 @@
|
||||
# FlipsideJS
|
||||
|
||||
FlipsideJS provides a library embeddable widgets that display data from the Flipside Platform API, including FCAS.
|
||||
FlipsideJS provides a library of embeddable widgets that display data from the Flipside Platform API, including FCAS.
|
||||
|
||||
## Example
|
||||
|
||||
[View Live FCAS Example](https://jsfiddle.net/flipsidejim/f7zpd0uj/12/)
|
||||
|
||||
## Install
|
||||
|
||||
The FlipsideJS library is made available over our CDN to ensure a speedy response time.
|
||||
|
||||
```html
|
||||
<script src="https://js.flipsidecrypto.com/flipside-v1.0.0.js"></script>
|
||||
<script src="https://d3sek7b10w79kp.cloudfront.net/flipside-v1.0.0.js"></script>
|
||||
```
|
||||
|
||||
## Usage
|
||||
@ -14,18 +20,18 @@ FlipsideJS provides a library embeddable widgets that display data from the Flip
|
||||
<div id="container"></div>
|
||||
<script>
|
||||
var flipside = new Flipside(YOUR_FLIPSIDE_API_KEY);
|
||||
flipside.create("container", "BTC");
|
||||
flipside.create("container", "ZEC");
|
||||
</script>
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
_create(id: string, symbol: string, options: object)_
|
||||
Creates an FCAS widget in the given element ID.
|
||||
Creates an FCAS widget in the given DOM element ID.
|
||||
|
||||
#### Parameters
|
||||
|
||||
- _id_: ID of the element in which to create the widget.
|
||||
- _id_: ID of the DOM element in which to create the widget.
|
||||
- _symbol_: Symbol of the asset. e.g "BTC"
|
||||
- _opts_: Display options for the widget
|
||||
|
||||
@ -56,9 +62,3 @@ flipside.create("container", "ETH", {
|
||||
```
|
||||
$ yarn run build
|
||||
```
|
||||
|
||||
## Development
|
||||
|
||||
```
|
||||
$ yarn run dev
|
||||
```
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "flipside-js",
|
||||
"version": "1.0.0",
|
||||
"version": "1.0.1",
|
||||
"description": "FlipsideJS provides a library embeddable widgets that display data from the Flipside Platform API, including FCAS.",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
||||
@ -7,7 +7,8 @@ class Flipside {
|
||||
this.api = new API(apiKey);
|
||||
}
|
||||
|
||||
create(id, symbol, opts) {
|
||||
createFCAS(id, symbol, opts) {
|
||||
let symbol = symbol.toLowerCase();
|
||||
const defaults = {
|
||||
score: true,
|
||||
plot: true,
|
||||
@ -17,6 +18,7 @@ class Flipside {
|
||||
rank: true
|
||||
};
|
||||
const mergedOpts = Object.assign({}, defaults, opts);
|
||||
|
||||
render(
|
||||
<FCAS symbol={symbol} api={this.api} opts={mergedOpts} />,
|
||||
document.getElementById(id)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user