You also need to delete the semicolon at the end of this line
Hi Andy,
Try the code below:-
If you get an invalidSignature error you probably have got the secret password and the key switched. The key should begin with either account- or master-.
I hope this helps.
restClient.newOrder({amount:10, price:100, side:"buy", symbol:"btcusd"})
.then(response => console.log(response))
.catch(error => console.log(error));
,```
This error occurred when I tried getting market data from crypto compare. I was wondering why this is happening?
jessiebarbee@Jessies-MacBook-Pro ~ % node index.js
internal/modules/cjs/loader.js:969
throw err;
^
Error: Cannot find module â/Users/jessiebarbee/index.jsâ
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:966:15)
at Function.Module._load (internal/modules/cjs/loader.js:842:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47 {
code: âMODULE_NOT_FOUNDâ,
requireStack: []
}
Hi Joe,
Thanks for getting back to me, The issue is now fixed, as you said the key needs to begin with account-
So i tried that first without adding the .catch line of code and it worked.
Many thanks
Hi Andy,
If you add .catch error into your code it will give you proper error messages rather than the nonsence that it spews at the moment.
Good luck with programming.
Thanks Nile. Iâll take a look at terminal.
Germini Yarn Install - Windows PowerShell Warning - No repository field
- When attempting to install ânpm install yarn â globalâ I get the following warning:
npm WARN [email protected] No repository field.
+ [email protected]
+ [email protected]
updated 2 packages and audited 5 packages in 1.028s
found 0 vulnerabilities
- This leads to the following error when I try to install âyarn add gemini-apiâ:
yarn : The term âyarnâ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the
path is correct and try again.
At line:1 char:1
+ yarn add gemini-api
*+ ~~~~*
-
- CategoryInfo : ObjectNotFound: (yarn:String) [], CommandNotFoundException*
-
- FullyQualifiedErrorId : CommandNotFoundException*
- Iâm assuming this is stems from the npm WARN [email protected] No repository field from above. This has been an issue for others as well. Iâm new to this and not sure how to fix. I do not want to mess with this more without knowing what Iâm doing and am unable to go forward with the lessons without fixing.
I installed NodeJS on one computer and got an error message so I installed it on another computer and got the same messageâŚthe message is, Uncaught ReferenceError: node is not defined. What should I do?
Try following this: https://stackoverflow.com/questions/27170037/first-time-using-node-js-referenceerror-node-is-not-defined
Let me know if you have more success by following the steps above.
Has anyone recently been able to use the sandbox API to place a new order?
I get the feeling Gemini adjusted their API policies recently and it seems to me that they made âaccount-#####â keys to be read-only. I canât seem to make an order with the âaccount-####â key as it doesnât allow assinging trader roles. But if I use a âmaster-####â key then it complains of MissingAccounts (an optional parameter according to the gemini API doc for the nickname of the account being acted upon). I canât seem to pass the correct object for that parameter or I think the wrapper is broken due to Gemini API updates. Would appreciate any insight into thisâŚ
{
result: 'error',
reason: 'MissingAccounts',
message: 'Expected a JSON payload with accounts'
}
Yes I agree instructions for mac users would be very nice
I join the mac users movement, so far, it was a pain I have even tried to install a virtual box and windows10 to use the shell and follow the courseâŚ
Hi - I was able to use the updated API info
const key = "account-QIXkHGEGWE4SKT7gmbKWZ";
const secret = "3wEfedfewfewdefQf95KAAn6JSm6K";
const restClient = new GeminiAPI({key,secret,sandbox:true});
restClient.newOrder({
"symbol": "ethusd",
"amount": "5",
"price": "300.00",
"side": "buy",
})
.then(response => console.log(response))
.catch(console.error);
The forum swaps out quotes, so if you copy, replace the quotes. FYI,. Hope that helps
Also - I scrambled my keys in case someone wants to comment on my security habits. =)
Thanks for your reply. I am unsure how you did this without getting an error (and without editing the index.js within the Gemini-API package). I would expect that if you did this before Geminiâs recent API changes then you would not have faced the errors which I did. Did you do it within the last few days or had you done this course some time ago ( >3 weeks)?
I ask because when I did this for the first time 2 weeks ago and followed the course plan I was unable to produce the expected result. I would like to share my results in case it resonates with otherâs experience. When I tried this using an âaccount-XXxXXXXXXXxâ key to open a trade it resulted in a âMissing rolesâ error (account key cannot be assigned trading role in geminiâs sandbox exchange api settings). When I tried with a âmaster-XxXXxXXXxXâ key and received the âMissing Accountsâ error I did some reading of the API documentation and figured out that âaccounts: âprimaryââ needs to be added to the REST request through the extra parameters of each API function call. Alternatively one could edit the index.js of Gemini-API node package and add that account reference to line 47 (add bolded):
}, params), {account: âprimaryâ};
This change allowed me to use a âmaster-XxXXXXXXxâ key for private API calls and continue the course without too much deviation from the lesson plan.
I just recently completed this. - When I set up the key, I looked at the master and primary, decided on primary, but checked the boxes to allow trading. - I believe there were three checkbox options, and one was disabled. I worked through a couple errors, but did not experience the Missing Roles.
Hi Joe,
Is there any reason why the .catch would not be working on my powershell?
I have added this line below to my code and it is giving me a syntax error: unexpected token â.â
.catch(error => console.log(error));
Its very frustrating!!
Many thanks
Andy
Sorry, I figured it out,
I had a semicolon at the end of the previous line of code and the .catch line wasnt recognized apparently.
If someone could explain that to me it would be much appreciated.
Many thanks
It literally took me 3 days to do this. Errors but at least I got thru it. Keep pushing
intall hombrew, brew install yarn
Hi
When I place an order with high price in any other coin other than Bitcoin, it gets cancelled.
order_id: â636143186â,
id: â636143186â,
symbol: âltcusdâ,
exchange: âgeminiâ,
avg_execution_price: â0.00â,
side: âbuyâ,
type: âexchange limitâ,
timestamp: â1597531514â,
timestampms: 1597531514716,
is_live: false,
is_cancelled: true,
is_hidden: false,
was_forced: false,
executed_amount: â0â,
client_order_id: â-2AtmSRfnâ,
reason: âImmediateOrCancelWouldPostâ,
options: [ âimmediate-or-cancelâ ],
price: â100.00â,
original_amount: â1â,
remaining_amount: â1â
and the prices for the altcoins doesnt seem to be the correct one.
anyone having this issue?