0.0.29 • Published 7 years ago
finevo-web
Licence
ISC
Version
0.0.29
Deps
9
Size
332 kB
Vulns
27
Weekly
0
Finevo-Web
A web component wrapper library around React implementation
Install
npm install finevo-web
yarn add finevo-web
Usage
If you have not started with web components, we suggest you to visit the official docs
import { FinOrderForm, FinOrderBook } from 'finevo-web';
//register the component as a custom element with the browser
customElements.define('fin-order-form', FinOrderForm);
customElements.define('fin-order-book', FinOrderForm);
And using it with the accessToken
<fin-order-form accessToken="a-valid-jwt-token"></fin-order-form>
You will need to define an options property for the order form component in the following format (The order form will not load unless these properties as defined):
const FinOrderForm = document.querySelector('fin-order-form');
//attaching default properties
FinOrderForm.options = {
config: {...},
order:{
uuid: 'unique-id-for-the-orders',
price: 5.29,
side: '1',
triggerType: '3',
triggerPriceDirection: '1'
},
company: {
name: 'CIMB',
id: '1023',
exchange: 'BM',
type: 'NM',
}
};
//attaching listener to listen for order events from our Market Order Aggregator
OrderForm.addEventListener('order', event => console.log(event));
Alternatively, using js
const FinOrderForm = document.createElement('fin-order-form');
FinOrderForm.setAttribute('accessToken', 'a-valid-jwt-token');
document.body.appendChild(FinOrderForm);
FinOrderForm.options = {...};
Property Configuration
Under construction