baseAsset and quotedAsset refactoring
This commit is contained in:
1 parent
98389c3af8
commit
8911fa09c1
8 files changed
+25
-25
No files matched your search
@@ -229,7 +229,7 @@ function newPlottersManager () {
|
||||
moduleCodeName: pProductCard.product.plotter.moduleName,
|
||||
panelCodeName: panelConfig.codeName
|
||||
}
|
||||
let panelOwner = exchange + ' ' + market.assetB + '/' + market.assetA
|
||||
let panelOwner = exchange + ' ' + market.quotedAsset + '/' + market.baseAsset
|
||||
let plotterPanelHandle = canvas.panelsSpace.createNewPanel('Plotter Panel', parameters, panelOwner, pProductCard.session)
|
||||
let plotterPanel = canvas.panelsSpace.getPanel(plotterPanelHandle, panelOwner)
|
||||
/* Connect Panel to the Plotter via an Event. */
|
||||
@@ -250,7 +250,7 @@ function newPlottersManager () {
|
||||
moduleCodeName: pProductCard.product.plotter.moduleName,
|
||||
panelCodeName: panel.id
|
||||
}
|
||||
let panelOwner = exchange + ' ' + market.assetB + '/' + market.assetA
|
||||
let panelOwner = exchange + ' ' + market.quotedAsset + '/' + market.baseAsset
|
||||
let plotterPanelHandle = canvas.panelsSpace.createNewPanel('Plotter Panel', parameters, panelOwner, pProductCard.session, panel)
|
||||
let plotterPanel = canvas.panelsSpace.getPanel(plotterPanelHandle, panelOwner)
|
||||
|
||||
|
||||
@@ -172,8 +172,8 @@ function newTimeMachine () {
|
||||
|
||||
if (
|
||||
exchange === DEFAULT_EXCHANGE &&
|
||||
market.assetA === DEFAULT_MARKET.assetA &&
|
||||
market.assetB === DEFAULT_MARKET.assetB
|
||||
market.baseAsset === DEFAULT_MARKET.baseAsset &&
|
||||
market.quotedAsset === DEFAULT_MARKET.quotedAsset
|
||||
) { continue }
|
||||
|
||||
initializeTimelineChart(exchange, market)
|
||||
|
||||
@@ -30,8 +30,8 @@ function newTimelineChart () {
|
||||
let productsPanel
|
||||
|
||||
/* Background */
|
||||
let logoAssetA
|
||||
let logoAssetB
|
||||
let logoBaseAsset
|
||||
let logoQuotedAsset
|
||||
let logoExchange
|
||||
let logoAA
|
||||
let canDrawLogoA = false
|
||||
@@ -80,7 +80,7 @@ function newTimelineChart () {
|
||||
saveUserPosition(thisObject.container, timeLineCoordinateSystem, event)
|
||||
})
|
||||
|
||||
let panelOwner = exchange + ' ' + market.assetB + '/' + market.assetA
|
||||
let panelOwner = exchange + ' ' + market.quotedAsset + '/' + market.baseAsset
|
||||
productsPanelHandle = canvas.panelsSpace.createNewPanel('Products Panel', undefined, panelOwner)
|
||||
let productsPanel = canvas.panelsSpace.getPanel(productsPanelHandle, panelOwner)
|
||||
productsPanel.initialize(exchange, market)
|
||||
@@ -278,7 +278,7 @@ function newTimelineChart () {
|
||||
function drawBackground () {
|
||||
if (thisObject.container.frame.isInViewPort()) {
|
||||
if (window.CHART_ON_FOCUS === '') {
|
||||
window.CHART_ON_FOCUS = exchange + ' ' + market.assetB + '/' + market.assetA
|
||||
window.CHART_ON_FOCUS = exchange + ' ' + market.quotedAsset + '/' + market.baseAsset
|
||||
|
||||
drawChartsBackgroundImages()
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
function newAssetBalances () {
|
||||
function newQuotedAssetalances () {
|
||||
const MODULE_NAME = 'Asset Balances'
|
||||
|
||||
let thisObject = {
|
||||
@@ -87,10 +87,10 @@ function newAssetBalances () {
|
||||
speedometer.draw()
|
||||
}
|
||||
|
||||
drawAssetBalances()
|
||||
drawQuotedAssetalances()
|
||||
}
|
||||
|
||||
function drawAssetBalances () {
|
||||
function drawQuotedAssetalances () {
|
||||
if (thisObject.paramsArray === undefined) { return }
|
||||
|
||||
let fontSize
|
||||
|
||||
+2
-2
@@ -85,8 +85,8 @@ function newDashboard () {
|
||||
|
||||
let market = {
|
||||
id: 2,
|
||||
assetA: 'USDT',
|
||||
assetB: 'BTC'
|
||||
baseAsset: 'USDT',
|
||||
quotedAsset: 'BTC'
|
||||
}
|
||||
|
||||
markets = new Map()
|
||||
|
||||
+4
-4
@@ -7,14 +7,14 @@ const CANVAS_APP_NAME = 'Canvas App'
|
||||
const SUPPORTED_EXCHANGES = ["Poloniex"];
|
||||
const SUPPORTED_MARKETS = [
|
||||
{
|
||||
assetA: "USDT",
|
||||
assetB: "BTC",
|
||||
baseAsset: "USDT",
|
||||
quotedAsset: "BTC",
|
||||
}
|
||||
];
|
||||
const DEFAULT_EXCHANGE = "Poloniex";
|
||||
const DEFAULT_MARKET = {
|
||||
assetA: "USDT",
|
||||
assetB: "BTC",
|
||||
baseAsset: "USDT",
|
||||
quotedAsset: "BTC",
|
||||
};
|
||||
|
||||
UI_COLOR = {
|
||||
|
||||
@@ -42,7 +42,7 @@ function newProductsPanel () {
|
||||
exchange = pExchange
|
||||
market = pMarket
|
||||
|
||||
thisObject.container.name = 'Layers @ ' + exchange + ' ' + market.assetB + '/' + market.assetA
|
||||
thisObject.container.name = 'Layers @ ' + exchange + ' ' + market.quotedAsset + '/' + market.baseAsset
|
||||
thisObject.container.frame.containerName = thisObject.container.name
|
||||
thisObject.container.frame.width = UI_PANEL.WIDTH.LARGE
|
||||
thisObject.container.frame.height = UI_PANEL.HEIGHT.LARGE * 1.5 // viewPort.visibleArea.bottomLeft.y - viewPort.visibleArea.topLeft.y // UI_PANEL.HEIGHT.LARGE;
|
||||
@@ -212,7 +212,7 @@ function newProductsPanel () {
|
||||
productCard.bot = bot
|
||||
productCard.product = product
|
||||
productCard.fitFunction = thisObject.fitFunction
|
||||
productCard.code = exchange + '-' + market.assetB + '/' + market.assetA + '-' + dataMine.codeName + '-' + bot.codeName + '-' + product.codeName
|
||||
productCard.code = exchange + '-' + market.quotedAsset + '/' + market.baseAsset + '-' + dataMine.codeName + '-' + bot.codeName + '-' + product.codeName
|
||||
|
||||
if (session !== undefined) {
|
||||
productCard.code = productCard.code + '-' + session.id
|
||||
@@ -439,7 +439,7 @@ function newProductsPanel () {
|
||||
|
||||
if (product.codeName === layerCode.product) {
|
||||
/* We have a layer that is matching the current product */
|
||||
let cardCode = exchange + '-' + market.assetB + '/' + market.assetA + '-' + dataMine.codeName + '-' + bot.codeName + '-' + product.codeName + '-' + process.session.id
|
||||
let cardCode = exchange + '-' + market.quotedAsset + '/' + market.baseAsset + '-' + dataMine.codeName + '-' + bot.codeName + '-' + product.codeName + '-' + process.session.id
|
||||
let cardFound = removeFromLocalProductCards(cardCode)
|
||||
if (cardFound !== true) {
|
||||
productCard = addProductCard(dataMine, bot, product, process.session)
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
let thisObject = {
|
||||
container: undefined,
|
||||
status: 'BOTTOM',
|
||||
assetBalances: undefined,
|
||||
quotedAssetalances: undefined,
|
||||
fullscreen: undefined,
|
||||
toTop: toTop,
|
||||
toBottom: toBottom,
|
||||
@@ -40,7 +40,7 @@
|
||||
|
||||
thisObject.container.finalize()
|
||||
thisObject.container = undefined
|
||||
thisObject.assetBalances = undefined
|
||||
thisObject.quotedAssetalances = undefined
|
||||
thisObject.fullscreen = undefined
|
||||
}
|
||||
|
||||
@@ -65,8 +65,8 @@
|
||||
canvasBrowserResizedEventSubscriptionId = window.canvasApp.eventHandler.listenToEvent('Browser Resized', resize)
|
||||
selfMouseClickEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseClick', onMouseClick)
|
||||
|
||||
thisObject.assetBalances = newAssetBalances()
|
||||
thisObject.assetBalances.initialize()
|
||||
thisObject.quotedAssetalances = newQuotedAssetalances()
|
||||
thisObject.quotedAssetalances.initialize()
|
||||
|
||||
thisObject.fullscreen = newFullScreen()
|
||||
thisObject.fullscreen.container.connectToParent(thisObject.container)
|
||||
@@ -171,7 +171,7 @@
|
||||
|
||||
drawBackground()
|
||||
|
||||
thisObject.assetBalances.draw()
|
||||
thisObject.quotedAssetalances.draw()
|
||||
thisObject.fullscreen.draw()
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user