@@ -5,29 +5,29 @@ import { bot } from '../../../../bot'
5
5
import { BlocklyError } from '../../../../../common/error'
6
6
7
7
export default ( ) => {
8
- const symbolNames = bot . symbol . activeSymbols . getSymbolNames ( )
9
- for ( const symbol of Object . keys ( symbolNames ) ) {
10
- const allowedCategories = bot . symbol . getAllowedCategoryNames ( symbol )
8
+ const symbols = bot . symbol . activeSymbols . getSymbols ( )
9
+ for ( const k of Object . keys ( symbols ) ) {
10
+ const allowedCategories = bot . symbol . getAllowedCategoryNames ( k )
11
11
if ( allowedCategories . length ) {
12
- Blockly . Blocks [ symbol ] = {
12
+ Blockly . Blocks [ k ] = {
13
13
init : function init ( ) {
14
14
this . appendDummyInput ( )
15
- . appendField ( symbolNames [ symbol ] )
15
+ . appendField ( symbols [ k ] . display )
16
16
this . appendDummyInput ( )
17
17
. appendField ( `${ translator . translateText ( 'Accepts' ) } : (${ allowedCategories } )` )
18
18
this . appendStatementInput ( 'CONDITION' )
19
19
. setCheck ( 'Condition' )
20
20
this . setInputsInline ( false )
21
21
this . setPreviousStatement ( true , null )
22
22
this . setColour ( '#f2f2f2' )
23
- this . setTooltip ( `${ translator . translateText ( 'Chooses the symbol:' ) } ${ symbolNames [ symbol ] } ` ) ; // eslint-disable-line max-len
23
+ this . setTooltip ( `${ translator . translateText ( 'Chooses the symbol:' ) } ${ symbols [ k ] . display } ` ) ; // eslint-disable-line max-len
24
24
this . setHelpUrl ( 'https://github.com/binary-com/binary-bot/wiki' )
25
25
} ,
26
26
onchange : function onchange ( ev ) {
27
27
submarket ( this , ev )
28
28
} ,
29
29
}
30
- Blockly . JavaScript [ symbol ] = function market ( block ) {
30
+ Blockly . JavaScript [ k ] = function market ( block ) {
31
31
const condition = Blockly . JavaScript . statementToCode ( block , 'CONDITION' )
32
32
if ( ! condition ) {
33
33
return new BlocklyError (
@@ -37,7 +37,7 @@ export default () => {
37
37
getTradeOptions = function getTradeOptions() {
38
38
var tradeOptions = {}
39
39
tradeOptions = ${ condition . trim ( ) }
40
- tradeOptions.symbol = '${ bot . symbol . activeSymbols . getSymbols ( ) [ symbol ] . symbol } '
40
+ tradeOptions.symbol = '${ symbols [ k ] . symbol } '
41
41
return tradeOptions
42
42
}
43
43
`
0 commit comments