talvasconcelos / cms-bot

NodeJS Trader Bot using AI signals
https://coinmarketscanner.app
MIT License
14 stars 5 forks source link

Getting error message regarding keys #5

Open alex4bes opened 3 years ago

alex4bes commented 3 years ago

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 commented 3 years ago

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

alex4bes commented 3 years ago

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 commented 3 years ago

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

talvasconcelos commented 3 years ago

I haven't used the bot for a while, it seems something might be broken with the binance API. I'll review it as soon as I can! sorry about that...

On Wed, Jan 6, 2021 at 3:23 PM alex4bes notifications@github.com wrote:

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

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/talvasconcelos/cms-bot/issues/5#issuecomment-755362989, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC4F74SPWPCVGOQZTSAAZ3TSYR55JANCNFSM4VXMQR5A .