i have no coding experience. I still tried not to have too high hopes! can anyone explain where one newb can improve these results.
in Atom; path: C:\Users\papaf\Documents\IOTAcad\JS trading Bot programming\index.js
const GeminiAPI = required(âgemini-apiâ).default;
const secret = âdVn6PiCyFCEMxnPAErwACaChsapâ;
const key = âsZ8v0NzVGAO1Ap2v8vG8â;
const restClient = new GeminiAPI({key, secret, sandbox:true});
restClient.newOrder({amount:10,price:100,side:âbuyâ,symbol:btcusd"})
.then(response => console.log(response));
.catch(error => console.log(error));
Results showing in Windows PowerShell window (please note: no apparent additional clarity gained from adding the additional catch of promise ending code, as in .catch(error�) )
PS C:\Users\papaf\Documents\IOTAcad\JS trading Bot programming> node index.js
C:\Users\papaf\Documents\IOTAcad\JS trading Bot programming\index.js:5
restClient.newOrder({amount:10,price:100,side:âbuyâ,symbol:btcusd"})
^^^
SyntaxError: Invalid or unexpected token
â[90m at wrapSafe (internal/modules/cjs/loader.js:979:16)â[39m
â[90m at Module._compile (internal/modules/cjs/loader.js:1027:27)â[39m
â[90m at Object.Module._extensionsâŚjs (internal/modules/cjs/loader.js:1092:10)â[39m
â[90m at Module.load (internal/modules/cjs/loader.js:928:32)â[39m
â[90m at Function.Module._load (internal/modules/cjs/loader.js:769:14)â[39m
â[90m at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)â[39m
â[90m at internal/main/run_main_module.js:17:47â[39m
a few other point of clarity:
i have found a duplicate index.js being created inside my folder âŚJS trading Bot programming\ node_modules\index.js form where i was referncing it originally and you can see from my edits, i attempted to follow ivan on screen to ensure the files are outside the \node_modules folder.
(I re-ran the installer for node-v14.15.5-x64.msi and installed all of the following:
Chocolatey upgraded 17/17 packages.
See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
- Upgraded:
- chocolatey-dotnetfx.extension v1.0.1
- kb3033929 v1.0.5
- python3 v3.9.1
- visualstudio2017buildtools v15.9.33.0
- chocolatey-windowsupdate.extension v1.0.4
- vcredist140 v14.28.29325.2
- kb2999226 v1.0.20181019
- visualstudio-installer v2.0.1
- kb2919355 v1.0.20160915
- chocolatey-core.extension v1.3.5.1
- kb2919442 v1.0.20160915
- visualstudio2017-workload-vctools v1.3.2
- chocolatey-visualstudio.extension v1.8.1
- vcredist2015 v14.0.24215.20170201
- dotnetfx v4.8.0.20190930
- kb3035131 v1.0.3
- python v3.9.1
- Type ENTER to exit:
i attempted the add missing modules and even tried the homework of the following âholy taskâ: exercise to no avail. starting to think i must i retry/renew my keys for website login verification? (is about all I can think of, as side of some syntax error in plain sight!!?)
i have been moving on and removed the order commands and went to Getting Market Data from CryptoCompare module #19 and the new code/ new error now looks like this:
Code looks like:
global.fetch = require(ânode-fetchâ);
const GeminiAPI = required(âgemini-apiâ).default;
const secret = âdVn6PiCyFCEMxnPAErwACaChsapâ;
const key = âsZ8v0NzVGAO1Ap2v8vG8â;
const CCAPIKey = âfefef09fff45aca3afec947d5bafbd32d585714b093cc2d6da2bdd63c4ee334bâ;
const restClient = new GeminiAPI({key, secret, sandbox:true});
const CryptoCompareAPI = require(âcryptocompareâ);
CryptoCompareAPI.setApikey(CCAPIKey);
/restClient.newOrder({amount:10,price:100,side:âbuyâ,symbol:btcusd"})
.then(response => restClient.cancelOrder({order_id:response,order_id}))
.then(response => console.log(response))
.catch(error => console.log(error));/
CryptoCompareAPI.coinList()
.then(coinlist => {
console.log(coinlist)
})
the resultant error message, when i run the file path:
PS C:\Users\papaf\Documents\IOTAcad\JS trading Bot programming> node index.js
C:\Users\papaf\Documents\IOTAcad\JS trading Bot programming\index.js:3
const GeminiAPI = required(âgemini-apiâ).default;
^
ReferenceError: required is not defined
at Object. (C:\Users\papaf\Documents\IOTAcad\JS trading Bot programming\index.js:3:19)
â[90m at Module._compile (internal/modules/cjs/loader.js:1063:30)â[39m
â[90m at Object.Module._extensionsâŚjs (internal/modules/cjs/loader.js:1092:10)â[39m
â[90m at Module.load (internal/modules/cjs/loader.js:928:32)â[39m
â[90m at Function.Module._load (internal/modules/cjs/loader.js:769:14)â[39m
â[90m at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)â[39m
â[90m at internal/main/run_main_module.js:17:47â[39m
Also maybe made matters worst in my attempt to self-troubleshoot! In a failed attempt to trouble shoot my Sandbox Key, i may have made matters worst after I attempted to re-assigned at Gemini.Sandbox 's Secret and Security Key and now that I removed Security Key, the website is asking me to add a USB this looks bad lol âŚdo i go into the User Management to make a new profile as Admin???