mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
34 lines
834 B
JavaScript
34 lines
834 B
JavaScript
import axios from "axios";
|
|
|
|
const baseURL = process.env.NODE_ENV === "development" ? "http://localhost:8080" : ""
|
|
|
|
export function querySessions(cb) {
|
|
axios.get(baseURL + '/api/sessions', {})
|
|
.then(response => {
|
|
cb(response.data.sessions)
|
|
});
|
|
}
|
|
|
|
export function queryClosedOrders(params, cb) {
|
|
axios.get(baseURL + '/api/orders/closed', { params: params })
|
|
.then(response => {
|
|
cb(response.data.orders)
|
|
});
|
|
}
|
|
|
|
export function queryAssets(cb) {
|
|
axios.get(baseURL + '/api/assets', {})
|
|
.then(response => {
|
|
cb(response.data.assets)
|
|
});
|
|
}
|
|
|
|
export function queryTradingVolume(params, cb) {
|
|
axios.get(baseURL + '/api/trading-volume', { params: params })
|
|
.then(response => {
|
|
cb(response.data.tradingVolumes)
|
|
});
|
|
}
|
|
|
|
|