Last active
March 10, 2018 23:11
-
-
Save adamjstevenson/220dc8c7cb11d7c6da09789d5cd35a2c to your computer and use it in GitHub Desktop.
Revisions
-
adamjstevenson revised this gist
Mar 10, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,7 @@ function buyOrder(orderSize, currentPrice){ const args = { 'product_id': 'ETH-USD', 'type': 'market', 'side': 'buy', 'size': orderSize } -
adamjstevenson created this gist
Mar 10, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ // Place a buy order function buyOrder(orderSize, currentPrice){ const args = { 'product_id': 'ETH-USD', 'type': 'market', 'side': 'buys', 'size': orderSize } gdaxClient.buy(args) .then(data => { // Send success notification sendSMS("💸 Purchased "+orderSize+" ETH! The current USD price of ETH is $"+currentPrice.substr(0,6)+"."); }) .catch(err => { // Dump the entire error and send failure notification console.error(err); sendSMS("Unable to place buy order for ETH. Response from GDAX: "+err.response.statusMessage+ ", "+err.data.message); }); }