SimBot 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f23731bdfcde34aa3eb420707de46304af93442a5ae88dd75259fb72b72db81c
4
- data.tar.gz: 96a2ceeec7de26a051c5058109280d9b4fb6980f4d5aa1e223c446d61c1a8dd9
3
+ metadata.gz: b1203e7840dfa4a705317a86ae74b56a6780f30bf06adf488c0eb0bcc63f84ba
4
+ data.tar.gz: c193c30f96d9e2e057de03585390028b33e10028315bed35957e9125f3faaa97
5
5
  SHA512:
6
- metadata.gz: 22c8bb00038be21ba541de53ea3885fd73e4f617e1b2f96eb3e3606562c8c4f74b904581d91482b529b7d34cbb5bd2ddf5573f21095c48e978f368c44e1c85bd
7
- data.tar.gz: c4618db0c1411cfa7e2cf65ce0f9b52e155e8bb62756a18093f7f498907144249b3478bb68afb77b821aa22d710156ad71af52478f5ebf15c25eedd6d42d3245
6
+ metadata.gz: ce52d9896959037efda86f73744096d2a2669fff998df465a2a14a0e8663f542379a10653f17e59c57ee128d884770dc41b39b5aff9952020b60fc94188fabed
7
+ data.tar.gz: 074f5246dbf1226bfea97862033ae360659a5b388231fa6cd9916a9401b1af94aea4e2c4e35f57d148b11dfdb92b289146be35bc70acab5ba26f100505cbbe44
data/.DS_Store CHANGED
Binary file
@@ -2,9 +2,8 @@
2
2
  <project version="4">
3
3
  <component name="ChangeListManager">
4
4
  <list default="true" id="d905eaf2-5cab-434b-a4d1-1ccf165356a4" name="Default" comment="">
5
- <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
6
- <change beforePath="$PROJECT_DIR$/SimBot-0.1.5.gem" beforeDir="false" />
7
- <change beforePath="$PROJECT_DIR$/SimBot-0.1.6.gem" beforeDir="false" />
5
+ <change beforePath="$PROJECT_DIR$/lib/SimBot/version.rb" beforeDir="false" afterPath="$PROJECT_DIR$/lib/SimBot/version.rb" afterDir="false" />
6
+ <change beforePath="$PROJECT_DIR$/lib/utils.rb" beforeDir="false" afterPath="$PROJECT_DIR$/lib/utils.rb" afterDir="false" />
8
7
  <change beforePath="$PROJECT_DIR$/lib/wash_trade.rb" beforeDir="false" afterPath="$PROJECT_DIR$/lib/wash_trade.rb" afterDir="false" />
9
8
  </list>
10
9
  <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
@@ -21,11 +20,11 @@
21
20
  <splitter split-orientation="horizontal" split-proportion="0.52644426">
22
21
  <split-first>
23
22
  <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
24
- <file leaf-file-name="SimBot.rb" pinned="false" current-in-tab="true">
23
+ <file leaf-file-name="SimBot.rb" pinned="false" current-in-tab="false">
25
24
  <entry file="file://$PROJECT_DIR$/lib/SimBot.rb">
26
25
  <provider selected="true" editor-type-id="text-editor">
27
- <state relative-caret-position="276">
28
- <caret line="12" column="62" selection-start-line="12" selection-start-column="54" selection-end-line="12" selection-end-column="62" />
26
+ <state relative-caret-position="669">
27
+ <caret line="39" column="7" lean-forward="true" selection-start-line="39" selection-start-column="7" selection-end-line="39" selection-end-column="7" />
29
28
  </state>
30
29
  </provider>
31
30
  </entry>
@@ -48,11 +47,11 @@
48
47
  </provider>
49
48
  </entry>
50
49
  </file>
51
- <file leaf-file-name="version.rb" pinned="false" current-in-tab="false">
50
+ <file leaf-file-name="version.rb" pinned="false" current-in-tab="true">
52
51
  <entry file="file://$PROJECT_DIR$/lib/SimBot/version.rb">
53
52
  <provider selected="true" editor-type-id="text-editor">
54
- <state relative-caret-position="69">
55
- <caret line="3" lean-forward="true" selection-start-line="3" selection-end-line="3" />
53
+ <state relative-caret-position="23">
54
+ <caret line="1" column="18" selection-start-line="1" selection-start-column="18" selection-end-line="1" selection-end-column="18" />
56
55
  </state>
57
56
  </provider>
58
57
  </entry>
@@ -70,11 +69,11 @@
70
69
  </split-first>
71
70
  <split-second>
72
71
  <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
73
- <file leaf-file-name="utils.rb" pinned="false" current-in-tab="false">
72
+ <file leaf-file-name="utils.rb" pinned="false" current-in-tab="true">
74
73
  <entry file="file://$PROJECT_DIR$/lib/utils.rb">
75
74
  <provider selected="true" editor-type-id="text-editor">
76
- <state relative-caret-position="322">
77
- <caret line="14" column="5" lean-forward="true" selection-start-line="14" selection-start-column="5" selection-end-line="14" selection-end-column="5" />
75
+ <state relative-caret-position="544">
76
+ <caret line="26" column="7" lean-forward="true" selection-start-line="26" selection-start-column="7" selection-end-line="26" selection-end-column="7" />
78
77
  </state>
79
78
  </provider>
80
79
  </entry>
@@ -106,11 +105,11 @@
106
105
  </provider>
107
106
  </entry>
108
107
  </file>
109
- <file leaf-file-name="wash_trade.rb" pinned="false" current-in-tab="true">
108
+ <file leaf-file-name="wash_trade.rb" pinned="false" current-in-tab="false">
110
109
  <entry file="file://$PROJECT_DIR$/lib/wash_trade.rb">
111
110
  <provider selected="true" editor-type-id="text-editor">
112
- <state relative-caret-position="236">
113
- <caret line="29" column="18" lean-forward="true" selection-start-line="29" selection-start-column="18" selection-end-line="29" selection-end-column="18" />
111
+ <state relative-caret-position="322">
112
+ <caret line="14" column="13" lean-forward="true" selection-start-line="14" selection-start-column="13" selection-end-line="14" selection-end-column="13" />
114
113
  </state>
115
114
  </provider>
116
115
  </entry>
@@ -147,10 +146,10 @@
147
146
  <option value="$PROJECT_DIR$/lib/Deamons/WashTrade.rb" />
148
147
  <option value="$PROJECT_DIR$/lib/Deamons/deamon.rb" />
149
148
  <option value="$PROJECT_DIR$/lib/Deamons/wash_trade.rb" />
150
- <option value="$PROJECT_DIR$/lib/utils.rb" />
151
149
  <option value="$PROJECT_DIR$/lib/SimBot.rb" />
152
- <option value="$PROJECT_DIR$/lib/SimBot/version.rb" />
153
150
  <option value="$PROJECT_DIR$/lib/wash_trade.rb" />
151
+ <option value="$PROJECT_DIR$/lib/utils.rb" />
152
+ <option value="$PROJECT_DIR$/lib/SimBot/version.rb" />
154
153
  </list>
155
154
  </option>
156
155
  </component>
@@ -208,6 +207,7 @@
208
207
  <property name="WebServerToolWindowFactoryState" value="false" />
209
208
  <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
210
209
  <property name="nodejs_npm_path_reset_for_default_project" value="true" />
210
+ <property name="settings.editor.selected.configurable" value="preferences.pluginManager" />
211
211
  </component>
212
212
  <component name="RecentsManager">
213
213
  <key name="MoveFile.RECENT_KEYS">
@@ -263,59 +263,60 @@
263
263
  <option name="presentableId" value="Default" />
264
264
  <updated>1525279604835</updated>
265
265
  <workItem from="1525279607229" duration="36216000" />
266
- <workItem from="1528301072964" duration="33362000" />
266
+ <workItem from="1528301072964" duration="35313000" />
267
+ <workItem from="1528709208580" duration="6190000" />
267
268
  </task>
268
269
  <servers />
269
270
  </component>
270
271
  <component name="TimeTrackingManager">
271
- <option name="totallyTimeSpent" value="69578000" />
272
+ <option name="totallyTimeSpent" value="77719000" />
272
273
  </component>
273
274
  <component name="ToolWindowManager">
274
275
  <frame x="1440" y="22" width="1615" height="1058" extended-state="0" />
275
276
  <editor active="true" />
276
277
  <layout>
278
+ <window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.22759059" />
277
279
  <window_info anchor="bottom" id="TODO" order="6" />
280
+ <window_info anchor="bottom" id="Docker" order="7" show_stripe_button="false" />
278
281
  <window_info anchor="bottom" id="Event Log" order="7" sideWeight="0.50380623" side_tool="true" weight="0.28540304" />
282
+ <window_info anchor="right" id="Database" order="3" />
279
283
  <window_info anchor="bottom" id="Database Changes" order="7" show_stripe_button="false" />
280
284
  <window_info anchor="bottom" id="Version Control" order="7" />
281
285
  <window_info anchor="bottom" id="Run" order="2" sideWeight="0.48719722" weight="0.28540304" />
282
- <window_info anchor="bottom" id="Terminal" order="7" sideWeight="0.49619377" weight="0.41463414" />
283
- <window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.22504768" />
284
- <window_info anchor="bottom" id="Docker" order="7" show_stripe_button="false" />
285
- <window_info anchor="right" id="Database" order="3" />
286
- <window_info anchor="bottom" id="Find" order="1" sideWeight="0.49896193" weight="0.32897604" />
287
286
  <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
287
+ <window_info anchor="bottom" id="Terminal" order="7" sideWeight="0.49619377" weight="0.41463414" />
288
288
  <window_info id="Favorites" order="2" side_tool="true" />
289
289
  <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
290
290
  <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
291
291
  <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
292
292
  <window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
293
293
  <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
294
+ <window_info anchor="bottom" id="Messages" order="7" sideWeight="0.49965397" weight="0.3293348" />
294
295
  <window_info anchor="bottom" id="Message" order="0" />
295
296
  <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
296
- <window_info anchor="bottom" id="Messages" order="7" sideWeight="0.49965397" weight="0.3293348" />
297
+ <window_info anchor="bottom" id="Find" order="1" sideWeight="0.49896193" weight="0.32897604" />
297
298
  </layout>
298
299
  <layout-to-restore>
299
300
  <window_info anchor="right" content_ui="combo" id="Hierarchy" order="3" weight="0.25" />
300
301
  <window_info anchor="bottom" id="Docker" order="0" show_stripe_button="false" />
301
302
  <window_info anchor="bottom" id="Run" order="8" sideWeight="0.48719722" weight="0.2780807" />
302
- <window_info id="Favorites" order="0" side_tool="true" />
303
+ <window_info anchor="bottom" id="Cvs" order="10" weight="0.25" />
303
304
  <window_info content_ui="combo" id="Project" order="1" visible="true" weight="0.24982698" />
304
305
  <window_info id="Structure" order="2" side_tool="true" weight="0.25" />
305
306
  <window_info anchor="right" id="Commander" internal_type="SLIDING" order="1" type="SLIDING" weight="0.4" />
306
307
  <window_info anchor="right" id="Ant Build" order="2" weight="0.25" />
307
308
  <window_info anchor="bottom" id="TODO" order="12" />
308
- <window_info anchor="bottom" id="Version Control" order="3" />
309
+ <window_info anchor="bottom" id="Inspection" order="11" weight="0.4" />
309
310
  <window_info anchor="bottom" id="Find" order="7" sideWeight="0.49896193" weight="0.32897604" />
310
311
  <window_info anchor="right" id="Database" order="0" />
311
312
  <window_info active="true" anchor="bottom" id="Terminal" order="2" sideWeight="0.49619377" visible="true" weight="0.20261438" />
312
313
  <window_info anchor="bottom" id="Debug" order="9" weight="0.4" />
313
314
  <window_info anchor="bottom" id="Database Changes" order="1" show_stripe_button="false" />
314
- <window_info anchor="bottom" id="Cvs" order="10" weight="0.25" />
315
+ <window_info anchor="bottom" id="Version Control" order="3" />
315
316
  <window_info anchor="bottom" id="Event Log" order="4" sideWeight="0.50380623" side_tool="true" weight="0.3293348" />
316
317
  <window_info anchor="bottom" id="Message" order="6" />
317
318
  <window_info anchor="bottom" id="Messages" order="5" sideWeight="0.49965397" weight="0.3293348" />
318
- <window_info anchor="bottom" id="Inspection" order="11" weight="0.4" />
319
+ <window_info id="Favorites" order="0" side_tool="true" />
319
320
  </layout-to-restore>
320
321
  </component>
321
322
  <component name="TypeScriptGeneratedFilesManager">
@@ -333,6 +334,76 @@
333
334
  </breakpoint-manager>
334
335
  </component>
335
336
  <component name="editorHistoryManager">
337
+ <entry file="file://$PROJECT_DIR$/lib/SimBot.rb">
338
+ <provider selected="true" editor-type-id="text-editor">
339
+ <state relative-caret-position="345">
340
+ <caret line="15" column="18" selection-start-line="15" selection-start-column="18" selection-end-line="15" selection-end-column="18" />
341
+ </state>
342
+ </provider>
343
+ </entry>
344
+ <entry file="file://$PROJECT_DIR$/exe/SimBot">
345
+ <provider selected="true" editor-type-id="text-editor">
346
+ <state relative-caret-position="92">
347
+ <caret line="4" column="7" selection-start-line="4" selection-start-column="7" selection-end-line="4" selection-end-column="7" />
348
+ </state>
349
+ </provider>
350
+ </entry>
351
+ <entry file="file://$PROJECT_DIR$/.gitignore">
352
+ <provider selected="true" editor-type-id="text-editor">
353
+ <state relative-caret-position="322">
354
+ <caret line="14" selection-start-line="14" selection-end-line="14" />
355
+ </state>
356
+ </provider>
357
+ </entry>
358
+ <entry file="file://$PROJECT_DIR$/lib/SimBot/version.rb">
359
+ <provider selected="true" editor-type-id="text-editor">
360
+ <state relative-caret-position="69">
361
+ <caret line="3" lean-forward="true" selection-start-line="3" selection-end-line="3" />
362
+ </state>
363
+ </provider>
364
+ </entry>
365
+ <entry file="file://$PROJECT_DIR$/lib/api_controller.rb">
366
+ <provider selected="true" editor-type-id="text-editor">
367
+ <state relative-caret-position="184">
368
+ <caret line="8" column="24" selection-start-line="8" selection-start-column="24" selection-end-line="8" selection-end-column="24" />
369
+ </state>
370
+ </provider>
371
+ </entry>
372
+ <entry file="file://$PROJECT_DIR$/lib/utils.rb">
373
+ <provider selected="true" editor-type-id="text-editor">
374
+ <state relative-caret-position="483">
375
+ <caret line="21" column="13" selection-start-line="21" selection-start-column="13" selection-end-line="21" selection-end-column="13" />
376
+ </state>
377
+ </provider>
378
+ </entry>
379
+ <entry file="file://$PROJECT_DIR$/Gemfile">
380
+ <provider selected="true" editor-type-id="text-editor">
381
+ <state relative-caret-position="138">
382
+ <caret line="6" selection-start-line="6" selection-end-line="6" />
383
+ </state>
384
+ </provider>
385
+ </entry>
386
+ <entry file="file://$PROJECT_DIR$/lib/barong.rb">
387
+ <provider selected="true" editor-type-id="text-editor">
388
+ <state relative-caret-position="115">
389
+ <caret line="5" selection-start-line="5" selection-end-line="8" selection-end-column="7" />
390
+ </state>
391
+ </provider>
392
+ </entry>
393
+ <entry file="file://$PROJECT_DIR$/SimBot.gemspec">
394
+ <provider selected="true" editor-type-id="text-editor">
395
+ <state relative-caret-position="483">
396
+ <caret line="21" column="32" selection-start-line="21" selection-start-column="32" selection-end-line="21" selection-end-column="32" />
397
+ </state>
398
+ </provider>
399
+ </entry>
400
+ <entry file="file://$PROJECT_DIR$/lib/wash_trade.rb">
401
+ <provider selected="true" editor-type-id="text-editor">
402
+ <state relative-caret-position="460">
403
+ <caret line="20" column="15" lean-forward="true" selection-start-line="20" selection-start-column="15" selection-end-line="20" selection-end-column="15" />
404
+ </state>
405
+ </provider>
406
+ </entry>
336
407
  <entry file="file://$PROJECT_DIR$/lib/SimBot.rb">
337
408
  <provider selected="true" editor-type-id="text-editor">
338
409
  <state relative-caret-position="782">
@@ -449,13 +520,7 @@
449
520
  </state>
450
521
  </provider>
451
522
  </entry>
452
- <entry file="file://$PROJECT_DIR$/lib/Deamons/deamon.rb">
453
- <provider selected="true" editor-type-id="text-editor">
454
- <state relative-caret-position="69">
455
- <caret line="3" column="3" lean-forward="true" selection-start-line="3" selection-start-column="3" selection-end-line="3" selection-end-column="3" />
456
- </state>
457
- </provider>
458
- </entry>
523
+ <entry file="file://$PROJECT_DIR$/lib/Deamons/deamon.rb" />
459
524
  <entry file="file://$PROJECT_DIR$/exe/SimBot">
460
525
  <provider selected="true" editor-type-id="text-editor">
461
526
  <state relative-caret-position="92">
@@ -463,31 +528,31 @@
463
528
  </state>
464
529
  </provider>
465
530
  </entry>
466
- <entry file="file://$PROJECT_DIR$/lib/utils.rb">
531
+ <entry file="file://$PROJECT_DIR$/lib/wash_trade.rb">
467
532
  <provider selected="true" editor-type-id="text-editor">
468
533
  <state relative-caret-position="322">
469
- <caret line="14" column="5" lean-forward="true" selection-start-line="14" selection-start-column="5" selection-end-line="14" selection-end-column="5" />
534
+ <caret line="14" column="13" lean-forward="true" selection-start-line="14" selection-start-column="13" selection-end-line="14" selection-end-column="13" />
470
535
  </state>
471
536
  </provider>
472
537
  </entry>
473
- <entry file="file://$PROJECT_DIR$/lib/SimBot/version.rb">
538
+ <entry file="file://$PROJECT_DIR$/lib/utils.rb">
474
539
  <provider selected="true" editor-type-id="text-editor">
475
- <state relative-caret-position="69">
476
- <caret line="3" lean-forward="true" selection-start-line="3" selection-end-line="3" />
540
+ <state relative-caret-position="544">
541
+ <caret line="26" column="7" lean-forward="true" selection-start-line="26" selection-start-column="7" selection-end-line="26" selection-end-column="7" />
477
542
  </state>
478
543
  </provider>
479
544
  </entry>
480
545
  <entry file="file://$PROJECT_DIR$/lib/SimBot.rb">
481
546
  <provider selected="true" editor-type-id="text-editor">
482
- <state relative-caret-position="276">
483
- <caret line="12" column="62" selection-start-line="12" selection-start-column="54" selection-end-line="12" selection-end-column="62" />
547
+ <state relative-caret-position="669">
548
+ <caret line="39" column="7" lean-forward="true" selection-start-line="39" selection-start-column="7" selection-end-line="39" selection-end-column="7" />
484
549
  </state>
485
550
  </provider>
486
551
  </entry>
487
- <entry file="file://$PROJECT_DIR$/lib/wash_trade.rb">
552
+ <entry file="file://$PROJECT_DIR$/lib/SimBot/version.rb">
488
553
  <provider selected="true" editor-type-id="text-editor">
489
- <state relative-caret-position="236">
490
- <caret line="29" column="18" lean-forward="true" selection-start-line="29" selection-start-column="18" selection-end-line="29" selection-end-column="18" />
554
+ <state relative-caret-position="23">
555
+ <caret line="1" column="18" selection-start-line="1" selection-start-column="18" selection-end-line="1" selection-end-column="18" />
491
556
  </state>
492
557
  </provider>
493
558
  </entry>
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- SimBot (0.1.6)
4
+ SimBot (0.1.7)
5
5
  json
6
6
  pusher-client
7
7
  rest-client
@@ -34,17 +34,9 @@ module SimBot
34
34
  def test_ws
35
35
  Barong::API.log_in("hi there","my man")
36
36
  end
37
- desc 'bchbtc_price', 'get the price of BCH in BTC'
38
- def bchbtc_price
39
- puts Utils.get_bchbtc_price
40
- end
41
- desc 'bchxrp_price', 'get the price of BCH in XRP'
42
- def bchxrp_price
43
- puts Utils.get_bchxrp_price
44
- end
45
- desc 'eoseth_price', 'get the price of EOS in ETH'
46
- def eoseth_price
47
- puts Utils.get_eoseth_price
37
+ desc 'quote market', 'get the quote for the given market e.g. btc/eth'
38
+ def quote(market)
39
+ puts "#{market}: #{Utils.quote(market)}"
48
40
  end
49
41
  end
50
42
  end
@@ -1,3 +1,3 @@
1
1
  module SimBot
2
- VERSION = "0.1.7"
2
+ VERSION = "0.1.8"
3
3
  end
@@ -1,20 +1,99 @@
1
1
  class Utils
2
- def self.get_bchxrp_price
3
- # fetch bch/xrp price from coin market cap
4
- factor = rand(1...1.01)
2
+ # accept market paramter and return the coinmarket cap quote for said market
3
+ # @param [String] market
4
+ # @return [FalseClass and Float]
5
+ def self.quote(market)
6
+ case market
7
+ when 'bchxrp'
8
+ bchxrp_price
9
+ when 'bchbtc'
10
+ bchbtc_price
11
+ when 'btcxrp'
12
+ btcxrp_price
13
+ when 'eoseth'
14
+ eoseth_price
15
+ when 'btcltc'
16
+ btcltc_price
17
+ when 'ltcbtc'
18
+ ltcbtc_price
19
+ when 'bchxrp'
20
+ bchxrp_price
21
+ when 'ltcbch'
22
+ ltcbch_price
23
+ when 'ltcxrp'
24
+ ltcxrp_price
25
+ else
26
+ false
27
+ end
28
+ end
29
+
30
+ # fetch ltc/xrp price from coin market cap
31
+ # @return [float] rate
32
+ def self.ltcxrp_price
33
+ response = RestClient.get('https://api.coinmarketcap.com/v2/ticker/2/?convert=XRP')
34
+ hash = JSON.parse(response.body)
35
+ hash['data']['quotes']['XRP']['price'].to_f.round(4)
36
+ end
37
+
38
+ # fetch ltc/bch price from coin market cap
39
+ # @return [float] rate
40
+ def self.ltcbch_price
41
+ response = RestClient.get('https://api.coinmarketcap.com/v2/ticker/2/?convert=BCH')
42
+ hash = JSON.parse(response.body)
43
+ hash['data']['quotes']['BCH']['price'].to_f.round(4)
44
+ end
45
+
46
+ # fetch bch/xrp price from coin market cap
47
+ # @return [float] rate
48
+ def self.bchxrp_price
5
49
  response = RestClient.get('https://api.coinmarketcap.com/v2/ticker/1831/?convert=XRP')
6
- hash = JSON.parse (response.body)
7
- return hash['data']['quotes']['XRP']['price'].to_f.round(4) * factor
50
+ hash = JSON.parse(response.body)
51
+ hash['data']['quotes']['XRP']['price'].to_f.round(4)
8
52
  end
9
- def self.get_bchbtc_price
10
- # fetch bch/xrp price from coin market cap
11
- factor = rand(1...1.01)
53
+
54
+ # fetch ltc/btc price from coin market cap
55
+ # @return [float] rate
56
+ def self.ltcbtc_price
57
+ response = RestClient.get('https://api.coinmarketcap.com/v2/ticker/2/?convert=BTC')
58
+ hash = JSON.parse(response.body)
59
+ hash['data']['quotes']['BTC']['price'].to_f.round(4)
60
+ end
61
+
62
+ # fetch btc/ltc price from coin market cap
63
+ # @return [float] rate
64
+ def self.btcltc_price
65
+ response = RestClient.get('https://api.coinmarketcap.com/v2/ticker/1/?convert=LTC')
66
+ hash = JSON.parse(response.body)
67
+ hash['data']['quotes']['LTC']['price'].to_f.round(4)
68
+ end
69
+
70
+ # fetch bch/xrp price from coin market cap
71
+ # @return [float] rate
72
+ def self.bchxrp_price
73
+ response = RestClient.get('https://api.coinmarketcap.com/v2/ticker/1831/?convert=XRP')
74
+ hash = JSON.parse(response.body)
75
+ hash['data']['quotes']['XRP']['price'].to_f.round(4)
76
+ end
77
+
78
+ # fetch bch/btc price from coin market cap
79
+ # @return [float] rate
80
+ def self.bchbtc_price
12
81
  response = RestClient.get('https://api.coinmarketcap.com/v2/ticker/1831/?convert=BTC')
13
82
  hash = JSON.parse (response.body)
14
- return hash['data']['quotes']['BTC']['price'].to_f.round(4) * factor
83
+ hash['data']['quotes']['BTC']['price'].to_f.round(4)
15
84
  end
16
- def self.get_eoseth_price
17
- # fetch bch/xrp price from coin market cap
85
+
86
+ # fetch btc/xrp price from coin market cap
87
+ # @return [float] rate
88
+ def self.btcxrp_price
89
+ response = RestClient.get('https://api.coinmarketcap.com/v2/ticker/1/?convert=XRP')
90
+ hash = JSON.parse (response.body)
91
+ hash['data']['quotes']['XRP']['price'].to_f.round(4)
92
+ end
93
+
94
+ # fetch eos/eth price from coin market cap
95
+ # @return [float] rate
96
+ def self.eoseth_price
18
97
  response = RestClient.get('https://api.coinmarketcap.com/v2/ticker/1765/?convert=ETH')
19
98
  hash = JSON.parse (response.body)
20
99
  return hash['data']['quotes']['ETH']['price'].to_f.round(4)
@@ -22,6 +101,8 @@ class Utils
22
101
 
23
102
  # Try and read the existing pid from the pid file and signal the
24
103
  # process. Returns true for a non blocking status.
104
+ # @param [Integer] pid
105
+ # @return [FalseClass and TrueClass]
25
106
  def self.kill_process(pid)
26
107
  opid = File.read("#{pid}.pid").strip.to_i
27
108
  Process.kill "HUP", opid
@@ -20,8 +20,8 @@ module Deamons
20
20
  def start
21
21
  count = 0
22
22
  loop do
23
- vol = rand(0.2...2)
24
- price = Utils.get_bchbtc_price
23
+ vol = rand(0.2...3)
24
+ price = Utils.quote(@market)
25
25
  @api.post_order(@market, price, vol, 'sell')
26
26
  delay = (1.00 / @freq)
27
27
  sleep(delay)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: SimBot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Ovadia