Javascript bot programming using Gemini API, NodeJS and CryptoCompare - DISCUSSION

1 step further, now i see the gemini-api directory, thanks

BUt the issue i got now after running the script :

Hi RLion,

The error says: or by rejecting a promise which was not handled with .catch().

You have to add:
.catch(error => console.error(error)
after the .then()

thus like:
restClient.newOrder({amount:10,price:100,side:“buy”,symbol:“btcusd”})
.then(response => console.log(response))
.catch(error => console.error(error));

Ivan tells this catch line later on…, but is needed!

1 Like

after copy paste you code i get :

image

I see that the quotes are different and changed to
restClient.newOrder({amount:10,price:100,side:“buy”,symbol:“btcusd”})
.then(response => console.log(response))
.catch(error => console.error(error));

now

image

A syntax error is a typo: somewhere a char is missing or has to be removed…
What is complete code?
javascript can be very strict… a comma missing or ; wrong…

1 Like

key and secret are ok and not reversed?

see my post 4d ago:

I got “InvalidSignature” error message (due the added catch part, which must be available nowadays).
I saw : I exchanged the key and secret strings!
The key start with “account-”, one with “master-” does not work for me.

1 Like

Jeay, it worked :slight_smile:

image

Thanks,
missed the account- before the key.

Again thanks for the fast support !!

you’re welcome, my pleasure

Nice to help you, makes my day (too) :grinning:

1 Like

Thanks,

i will go further with the cource now :slight_smile:

maybe you know why the order cancels ??

return restClient.newOrder({ amount:1,
price:12000,
side:“buy”,
symbol:symbol,
options:[“immediate-or-cancel”]})

},

image

reason: ‘ExceedsPriceLimits’,

but 12000 is avobe current price so ???

do not choose ‘too-high’… try somewhat lower

1 Like

image

does not help …

If i am not wrong was exercise to set price (far) higher to get the cancel effect?

1 Like

Yes, but that seems not to work in my situation.
i have no idea what the problem can be here …

just tried again …
and now it worked … strange

Hello, I’m getting this message (below) when trying to install yarn on Mac terminal. I can’t imagine why this could be a permissions issue… any suggestions would be greatly appreciated.

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules

npm ERR! code EACCES

npm ERR! syscall access

npm ERR! path /usr/local/lib/node_modules

npm ERR! errno -13

npm ERR! Error: EACCES: permission denied, access ‘/usr/local/lib/node_modules’

npm ERR! [Error: EACCES: permission denied, access ‘/usr/local/lib/node_modules’] {

npm ERR! errno: -13,

npm ERR! code: ‘EACCES’,

npm ERR! syscall: ‘access’,

npm ERR! path: ‘/usr/local/lib/node_modules’

npm ERR! }

npm ERR!

npm ERR! The operation was rejected by your operating system.

npm ERR! It is likely you do not have the permissions to access this file as the current user

npm ERR!

npm ERR! If you believe this might be a permissions issue, please double-check the

npm ERR! permissions of the file and its containing directories, or try running

npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:

npm ERR! /Users/byron/.npm/_logs/2020-06-26T14_50_00_104Z-debug.log

Hi @ Ivan or anyone one else, I’m using a Macbook Pro. It seems there is a download version of Powershell for iOS, but I might also need something else to support it? Do you have any instructions geared twoard those of us with Macs? This is where I’m kind of stuck and it may take some time to figure it out. Any guidance is appreciated. Thanks!

You can use terminal for macs. All instructions should be the same … I think.

Hi,
Can anybody help me with this issue?
I am at the stage of the Algo trading course where we need to install yarn to continue.

Everything went smoothly until this step.
Below is the command i entered into powershell and the error i recieved.
Any help much appreciated…

PS C:\Users\Andy\Desktop\Programming Course\Algo Course> yarn add gemini-api
yarn : File C:\Users\Andy\AppData\Roaming\npm\yarn.ps1 cannot be loaded because running scripts is disabled on this
system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1

  • yarn add gemini-api
  •   + CategoryInfo          : SecurityError: (:) [], PSSecurityException
      + FullyQualifiedErrorId : UnauthorizedAccess

I found the issue.
It seems that running scripts is disabled by default on windows.

@ivan
Maybe you could help with this issue, i cannot find the answer on Google

I am trying to create my first buy order after watching the lecture on “Gemini - Buy Order”.

I have the code written the same way you have it in the video but am getting this error from Powershell:

(node:4916) UnhandledPromiseRejectionWarning: #
(node:4916) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 3)
(node:4916) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

I see that someone else posted the same link that im posting but i have tried the solution to that issue and i get a different error where is does not recognize the .catch

I am very new to programming, sorry.
I have spent a good 2 hrs trying to solve this.

Many thanks
Andy

How do you get nodejs with chromeOS?