January 2020
Intermediate to advanced
530 pages
11h 11m
English
Our exchange has three orderbook asset pairs upon which traders can trade.
The user can switch between the orderbook pairs by clicking the buttons for the respective currency pair on top of the orderbook.
The setOrderbookPair method is invoked every time the orderbook pair is changed.
The method accepts the pair number as an input parameter. The pair number is mapped to the asset pair, as follows:
So, if pair is set to 1, it indicates the trading pair of USD-GBP.
The method checks the value of the pair input parameter and updates the base and counter asset in the app state accordingly, as follows:
setOrderbookPair = (pair) => {if(pair == 1) { this.setState ({ counter: this.USD, ...Read now
Unlock full access