Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting error message regarding keys #5

Open
alex4bes opened this issue Jan 6, 2021 · 4 comments
Open

Getting error message regarding keys #5

alex4bes opened this issue Jan 6, 2021 · 4 comments

Comments

@alex4bes
Copy link

alex4bes commented Jan 6, 2021

Error message as follows. Im a complete noob, any help appreciated.

TypeError [ERR_INVALID_ARG_TYPE]: The "key" argument must be of type string or an instance of ArrayBuffer, Buffer, TypedArray, DataView, KeyObject, or CryptoKey. Received undefined
at new NodeError (node:internal/errors:278:15)
at prepareSecretKey (node:internal/crypto/keys:384:11)
at new Hmac (node:internal/crypto/hash:132:9)
at Object.createHmac (node:crypto:155:10)
at BinanceRest._sign (/Users/alexanderforbes/cms-bot/node_modules/binance/lib/rest.js:163:23)
at BinanceRest._makeRequest (/Users/alexanderforbes/cms-bot/node_modules/binance/lib/rest.js:51:46)
at BinanceRest.account (/Users/alexanderforbes/cms-bot/node_modules/binance/lib/rest.js:331:21)
at Bot.syncBalances (/Users/alexanderforbes/cms-bot/trader.js:370:28)
at Bot.initTrader (/Users/alexanderforbes/cms-bot/trader.js:53:20)
at processTicksAndRejections (node:internal/process/task_queues:93:5)
at async Bot.startTrading (/Users/alexanderforbes/cms-bot/trader.js:103:9)
at async startTrader (/Users/alexanderforbes/cms-bot/index.js:348:9) {
code: 'ERR_INVALID_ARG_TYPE'

@talvasconcelos
Copy link
Owner

It seems you're not specifying the API Key from binance. you must fill in the config.js

@alex4bes
Copy link
Author

alex4bes commented Jan 6, 2021

I have filled in the API_Key and API_Secret as follows, and saved as config.js in the folder.

I have with the ' ' and without..

config.js is as follows:

const config = {}

config.API_KEY = 'wJFNzZAc7hxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxutM9Y8Ivl7XXD2O8dp'
config.API_SECRET = 'P0dLoZ6xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxe6bdmetG'

config.currency = 'BTC' //for now only BTC is working properly

config.TAKE_PROFIT = 5 // max % to take profit (don't get greedy)
config.PARTIAL_TP = 2.5 // minimum take profit
config.STOP_LIMIT = 2.5 // stop limit
config.TRAILING_SL = 0.5 // once you're in profit (PARTIAL_TP) bot activates a sell if price drops this %
config.MAX_BALANCE = 0 // in %, 0 to disable ex: 50, use only 50% off account balance

config.strategy = 'microtradesV3'

config.interval = 60000 //bot console update in milliseconds (seconds * 1000)

config.telegram = false
config.telegramAPI = ''
config.telegramUserID = 000000 // Get ID from @get_id_bot on Telegram

module.exports = config

@alex4bes
Copy link
Author

alex4bes commented Jan 6, 2021

Have tried now with ; at the end of each line and still receiving the same error????

@talvasconcelos
Copy link
Owner

talvasconcelos commented Jan 6, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants