Git Product home page Git Product logo

price-bot's People

Contributors

gwmccubbin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

price-bot's Issues

Error: Returned error: execution reverted

I am having an issue when running the project with npm run start. The bot is able to check the first price but then crashes. Any help is appreciated!
Listening on 5000
Checking prices...
┌─────────┬─────────────┬──────────────┬──────────────┬────────────────────────┬────────────────────────┬───────────────────────┬─────────────────────────────┐
│ (index) │ Input Token │ Output Token │ Input Amount │ Uniswap Return │ Kyber Expected Rate │ Kyber Min Return │ Timestamp │
├─────────┼─────────────┼──────────────┼──────────────┼────────────────────────┼────────────────────────┼───────────────────────┼─────────────────────────────┤
│ 0 │ 'ETH' │ 'MKR' │ '1' │ '2.260300770597604295' │ '2.260080079622844114' │ '2.19227767723415879' │ '2022-09-14T19:50:39-05:00' │
└─────────┴─────────────┴──────────────┴──────────────┴────────────────────────┴────────────────────────┴───────────────────────┴─────────────────────────────┘
Error: Returned error: execution reverted
at Object.ErrorResponse (/Users/lukapiplica/Desktop/price-bot-master/node_modules/web3-core-helpers/src/errors.js:29:16)
at /Users/lukapiplica/Desktop/price-bot-master/node_modules/web3-core-requestmanager/src/index.js:140:36
at XMLHttpRequest.request.onreadystatechange (/Users/lukapiplica/Desktop/price-bot-master/node_modules/web3-providers-http/src/index.js:96:13)
at XMLHttpRequestEventTarget.dispatchEvent (/Users/lukapiplica/Desktop/price-bot-master/node_modules/xhr2-cookies/xml-http-request-event-target.ts:44:13)
at XMLHttpRequest._setReadyState (/Users/lukapiplica/Desktop/price-bot-master/node_modules/xhr2-cookies/xml-http-request.ts:219:8)
at XMLHttpRequest._onHttpResponseEnd (/Users/lukapiplica/Desktop/price-bot-master/node_modules/xhr2-cookies/xml-http-request.ts:345:8)
at IncomingMessage. (/Users/lukapiplica/Desktop/price-bot-master/node_modules/xhr2-cookies/xml-http-request.ts:311:39)
at IncomingMessage.emit (node:events:525:35)
at endReadableNT (node:internal/streams/readable:1358:12)
at processTicksAndRejections (node:internal/process/task_queues:83:21)

so this happend when i run npm install -g truffle.. what does this mean

PS C:\Users\shett\OneDrive\Desktop> npm install -g truffle
npm WARN deprecated [email protected]: This package is broken and no longer maintained. 'mkdirp' itself supports promises now, please switch to that.
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: This module has been superseded by the multiformats module
npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: request has been deprecated, see request/request#3142
npm WARN deprecated [email protected]: This module has been superseded by the multiformats module
npm WARN deprecated [email protected]: This module has been superseded by the multiformats module
npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: This module has been superseded by the multiformats module
npm WARN deprecated [email protected]: This module has been superseded by the multiformats module

changed 777 packages, and audited 811 packages in 2m

108 packages are looking for funding
run npm fund for details

9 moderate severity vulnerabilities

To address issues that do not require attention, run:
npm audit fix

Some issues need review, and may require choosing
a different dependency.

readme needed

Could you provide a readme for this project? I am willing to make it if you would send general info and short summary.

Error: Returned error: execution reverted

Getting this error on any check pair that is not ETH -> MKR.

Things I have done:

  1. Ensured I have a correct RPC_URL
  2. Commented out all other check pairs and tried them all
  3. ensured I have all npm packages

The complete error:

Listening on 5000
Checking prices...
Error: Returned error: execution reverted
    at Object.ErrorResponse (/Users/zoso/Dev/crypto/price-bot/node_modules/web3-core-helpers/src/errors.js:29:16)
    at /Users/zoso/Dev/crypto/price-bot/node_modules/web3-core-requestmanager/src/index.js:140:36
    at XMLHttpRequest.request.onreadystatechange (/Users/zoso/Dev/crypto/price-bot/node_modules/web3-providers-http/src/index.js:96:13)
    at XMLHttpRequestEventTarget.dispatchEvent (/Users/zoso/Dev/crypto/price-bot/node_modules/xhr2-cookies/xml-http-request-event-target.ts:44:13)
    at XMLHttpRequest._setReadyState (/Users/zoso/Dev/crypto/price-bot/node_modules/xhr2-cookies/xml-http-request.ts:219:8)
    at XMLHttpRequest._onHttpResponseEnd (/Users/zoso/Dev/crypto/price-bot/node_modules/xhr2-cookies/xml-http-request.ts:345:8)
    at IncomingMessage.<anonymous> (/Users/zoso/Dev/crypto/price-bot/node_modules/xhr2-cookies/xml-http-request.ts:311:39)
    at IncomingMessage.emit (events.js:327:22)
    at endReadableNT (internal/streams/readable.js:1327:12)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)

Error: Provider not set or invalid at Object.InvalidProvider (/home/ben/price-bot/node_modules/web3-core-helpers/src/errors.js:38:16) at RequestManager.send (/home/ben/price-bot/node_modules/web3-core-requestmanager/src/index.js:128:32) at sendRequest (/home/ben/price-bot/node_modules/web3-core-method/src/index.js:560:42) at send (/home/ben/price-bot/node_modules/web3-core-method/src/index.js:581:13) at Object._executeMethod (/home/ben/price-bot/node_modules/web3-eth-contract/src/index.js:826:24) at checkPair (/home/ben/price-bot/index.js:36:96) at monitorPrice (/home/ben/price-bot/index.js:68:11) at Timeout._onTimeout (/home/ben/price-bot/index.js:112:48) at listOnTimeout (internal/timers.js:554:17) at processTimers (internal/timers.js:497:7)

Error: Provider not set or invalid
at Object.InvalidProvider (/home/ben/price-bot/node_modules/web3-core-helpers/src/errors.js:38:16)
at RequestManager.send (/home/ben/price-bot/node_modules/web3-core-requestmanager/src/index.js:128:32)
at sendRequest (/home/ben/price-bot/node_modules/web3-core-method/src/index.js:560:42)
at send (/home/ben/price-bot/node_modules/web3-core-method/src/index.js:581:13)
at Object._executeMethod (/home/ben/price-bot/node_modules/web3-eth-contract/src/index.js:826:24)
at checkPair (/home/ben/price-bot/index.js:36:96)
at monitorPrice (/home/ben/price-bot/index.js:68:11)
at Timeout._onTimeout (/home/ben/price-bot/index.js:112:48)
at listOnTimeout (internal/timers.js:554:17)
at processTimers (internal/timers.js:497:7)

Invalid number of parameters for "getExpectedRate". Got 3 expected 4!

When I pulled changes from PR#13 i go this error:

Error: Invalid number of parameters for "getExpectedRate". Got 3 expected 4!
at Object.InvalidNumberOfParams (/home/skygate/Dokumenty/blockchain/price-bot/node_modules/web3-core-helpers/src/errors.js:32:16)
at Object._createTxObject (/home/skygate/Dokumenty/blockchain/price-bot/node_modules/web3-eth-contract/src/index.js:699:22)
at checkPair (/home/skygate/Dokumenty/blockchain/price-bot/index.js:69:6)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at monitorPrice (/home/skygate/Dokumenty/blockchain/price-bot/index.js:102:5)
at Timeout._onTimeout (/home/skygate/Dokumenty/blockchain/price-bot/index.js:146:3)

Error messages from npm install and npm run start. Willing to pay if resolved.

First string is from npm install, and second is from npm run start. I really hope someone can figure out how to fix these issues.

Microsoft Windows [Version 10.0.19041.928]
(c) Microsoft Corporation. All rights reserved.

C:\Users\user>cd price-bot/

C:\Users\user\price-bot>npm install
npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it!
npm WARN deprecated [email protected]: Package renamed: https://www.npmjs.com/package/eth-rpc-errors

[email protected] preinstall C:\Users\user\price-bot\node_modules\scrypt
node node-scrypt-preinstall.js

[email protected] install C:\Users\user\price-bot\node_modules\ethereum-cryptography\node_modules\keccak
node-gyp-build || exit 0

[email protected] install C:\Users\user\price-bot\node_modules\ethereum-cryptography\node_modules\secp256k1
node-gyp-build || exit 0

[email protected] install C:\Users\user\price-bot\node_modules\scrypt
node-gyp rebuild

C:\Users\user\price-bot\node_modules\scrypt>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
Warning: Missing input files:
C:\Users\user\price-bot\node_modules\scrypt\build..\scrypt\win\include\config.h
Building the projects in this solution one at a time. To enable parallel build, please add the "-m" switch.
Copying scrypt/win/include/config.h to scrypt/scrypt-1.2.0/config.h
The system cannot find the file specified.
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(24
0,5): warning MSB8064: Custom build for item "..\scrypt\win\include\config.h" succeeded, but specified dependency "c:\u
sers\user\price-bot\node_modules\scrypt\scrypt\win\include\config.h" does not exist. This may cause incremental build
to work incorrectly. [C:\Users\user\price-bot\node_modules\scrypt\build\copied_files.vcxproj]
win_delay_load_hook.cc
copied_files.vcxproj -> C:\Users\user\price-bot\node_modules\scrypt\build\Release\copied_files.node
memlimit.c
keyderivation.c
pickparams.c
hash.c
win_delay_load_hook.cc
scrypt_wrapper.vcxproj -> C:\Users\user\price-bot\node_modules\scrypt\build\Release\scrypt_wrapper.lib
crypto_scrypt.c
crypto_scrypt_smix.c
warnp.c
sha256.c
insecure_memzero.c
scryptenc_cpuperf.c
mman.c
gettimeofday.c
win_delay_load_hook.cc
scrypt_lib.vcxproj -> C:\Users\user\price-bot\node_modules\scrypt\build\Release\scrypt_lib.lib
scrypt_common.cc
scrypt_params_async.cc
scrypt_params_sync.cc
scrypt_kdf_async.cc
scrypt_kdf_sync.cc
scrypt_kdf-verify_sync.cc
scrypt_kdf-verify_async.cc
scrypt_hash_sync.cc
scrypt_hash_async.cc
scrypt_node.cc
win_delay_load_hook.cc
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\inc\scrypt_common.h(39,1): error C2661: 'v8::Object::
Get': no overloaded function takes 1 arguments (compiling source file ..\src\node-boilerplate\scrypt_params_async.cc) [
C:\Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\inc\scrypt_common.h(40,1): error C2661: 'v8::Object::
Get': no overloaded function takes 1 arguments (compiling source file ..\src\node-boilerplate\scrypt_params_async.cc) [
C:\Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\inc\scrypt_common.h(41,1): error C2661: 'v8::Object::
Get': no overloaded function takes 1 arguments (compiling source file ..\src\node-boilerplate\scrypt_params_async.cc) [
C:\Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\inc\scrypt_async.h(53,15): warning C4996: 'Nan::Callb
ack::Call': was declared deprecated (compiling source file ..\src\node-boilerplate\scrypt_params_async.cc) [C:\Users\st
ahe\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\inc\scrypt_common.h(39,1): error C2661: 'v8::Object::
Get': no overloaded function takes 1 arguments (compiling source file ..\src\node-boilerplate\scrypt_params_sync.cc) [C
:\Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\inc\scrypt_common.h(40,1): error C2661: 'v8::Object::
Get': no overloaded function takes 1 arguments (compiling source file ..\src\node-boilerplate\scrypt_params_sync.cc) [C
:\Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\inc\scrypt_params_async.h(35,1): error C2660: 'v8::Va
lue::NumberValue': function does not take 0 arguments (compiling source file ..\src\node-boilerplate\scrypt_params_asyn
c.cc) [C:\Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\AppData\Local\node-gyp\Cache\14.17.0\include\node\v8.h(2861,39): message : see declaration of 'v8::Value
::NumberValue' (compiling source file ..\src\node-boilerplate\scrypt_params_async.cc) [C:\Users\user\price-bot\node_mo
dules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\inc\scrypt_common.h(41,1): error C2661: 'v8::Object::
Get': no overloaded function takes 1 arguments (compiling source file ..\src\node-boilerplate\scrypt_params_sync.cc) [C
:\Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\inc\scrypt_common.h(39,1): error C2661: 'v8::Object::
Get': no overloaded function takes 1 arguments (compiling source file ..\src\node-boilerplate\scrypt_hash_sync.cc) [C:
Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\inc\scrypt_params_async.h(36,1): error C2660: 'v8::Va
lue::NumberValue': function does not take 0 arguments (compiling source file ..\src\node-boilerplate\scrypt_params_asyn
c.cc) [C:\Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\AppData\Local\node-gyp\Cache\14.17.0\include\node\v8.h(2861,39): message : see declaration of 'v8::Value
::NumberValue' (compiling source file ..\src\node-boilerplate\scrypt_params_async.cc) [C:\Users\user\price-bot\node_mo
dules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\scrypt_params_sync.cc(25,47): error C2660: 'v8::Value
::NumberValue': function does not take 0 arguments [C:\Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\AppData\Local\node-gyp\Cache\14.17.0\include\node\v8.h(2861,39): message : see declaration of 'v8::Value
::NumberValue' (compiling source file ..\src\node-boilerplate\scrypt_params_sync.cc) [C:\Users\user\price-bot\node_mod
ules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\inc\scrypt_common.h(40,1): error C2661: 'v8::Object::
Get': no overloaded function takes 1 arguments (compiling source file ..\src\node-boilerplate\scrypt_hash_sync.cc) [C:
Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\inc\scrypt_params_async.h(37,1): error C2660: 'v8::Va
lue::IntegerValue': function does not take 0 arguments (compiling source file ..\src\node-boilerplate\scrypt_params_asy
nc.cc) [C:\Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\AppData\Local\node-gyp\Cache\14.17.0\include\node\v8.h(2863,40): message : see declaration of 'v8::Value
::IntegerValue' (compiling source file ..\src\node-boilerplate\scrypt_params_async.cc) [C:\Users\user\price-bot\node_m
odules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\scrypt_params_sync.cc(25,16): error C2737: 'maxtime':
const object must be initialized [C:\Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\inc\scrypt_common.h(41,1): error C2661: 'v8::Object::
Get': no overloaded function takes 1 arguments (compiling source file ..\src\node-boilerplate\scrypt_hash_sync.cc) [C:
Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\inc\scrypt_params_async.h(38,1): error C2660: 'v8::Va
lue::IntegerValue': function does not take 0 arguments (compiling source file ..\src\node-boilerplate\scrypt_params_asy
nc.cc) [C:\Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\AppData\Local\node-gyp\Cache\14.17.0\include\node\v8.h(2863,40): message : see declaration of 'v8::Value
::IntegerValue' (compiling source file ..\src\node-boilerplate\scrypt_params_async.cc) [C:\Users\user\price-bot\node_m
odules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\scrypt_params_sync.cc(26,47): error C2660: 'v8::Value
::IntegerValue': function does not take 0 arguments [C:\Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\AppData\Local\node-gyp\Cache\14.17.0\include\node\v8.h(2863,40): message : see declaration of 'v8::Value
::IntegerValue' (compiling source file ..\src\node-boilerplate\scrypt_params_sync.cc) [C:\Users\user\price-bot\node_mo
dules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\scrypt_hash_sync.cc(24,55): error C2660: 'v8::Value::
ToObject': function does not take 0 arguments [C:\Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\AppData\Local\node-gyp\Cache\14.17.0\include\node\v8.h(2822,44): message : see declaration of 'v8::Value
::ToObject' (compiling source file ..\src\node-boilerplate\scrypt_hash_sync.cc) [C:\Users\user\price-bot\node_modules
scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\inc\scrypt_common.h(39,1): error C2661: 'v8::Object::
Get': no overloaded function takes 1 arguments (compiling source file ..\src\node-boilerplate\scrypt_kdf-verify_sync.cc
) [C:\Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\scrypt_params_sync.cc(26,16): error C2737: 'maxmem':
const object must be initialized [C:\Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\scrypt_hash_sync.cc(24,28): error C2737: 'params': co
nst object must be initialized [C:\Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\scrypt_params_async.cc(23,67): error C2661: 'v8::Obje
ct::Set': no overloaded function takes 2 arguments [C:\Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\inc\scrypt_common.h(40,1): error C2661: 'v8::Object::
Get': no overloaded function takes 1 arguments (compiling source file ..\src\node-boilerplate\scrypt_kdf-verify_sync.cc
) [C:\Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\scrypt_params_sync.cc(27,50): error C2660: 'v8::Value
::NumberValue': function does not take 0 arguments [C:\Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\AppData\Local\node-gyp\Cache\14.17.0\include\node\v8.h(2861,39): message : see declaration of 'v8::Value
::NumberValue' (compiling source file ..\src\node-boilerplate\scrypt_params_sync.cc) [C:\Users\user\price-bot\node_mod
ules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\scrypt_hash_sync.cc(25,50): error C2660: 'v8::Value::
IntegerValue': function does not take 0 arguments [C:\Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\AppData\Local\node-gyp\Cache\14.17.0\include\node\v8.h(2863,40): message : see declaration of 'v8::Value
::IntegerValue' (compiling source file ..\src\node-boilerplate\scrypt_hash_sync.cc) [C:\Users\user\price-bot\node_modu
les\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\scrypt_params_async.cc(24,64): error C2661: 'v8::Obje
ct::Set': no overloaded function takes 2 arguments [C:\Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\inc\scrypt_common.h(41,1): error C2661: 'v8::Object::
Get': no overloaded function takes 1 arguments (compiling source file ..\src\node-boilerplate\scrypt_kdf-verify_sync.cc
) [C:\Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\inc\scrypt_common.h(39,1): error C2661: 'v8::Object::
Get': no overloaded function takes 1 arguments (compiling source file ..\src\node-boilerplate\scrypt_kdf-verify_async.c
c) [C:\Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\scrypt_hash_sync.cc(25,16): error C2737: 'hash_size':
const object must be initialized [C:\Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\scrypt_params_sync.cc(27,16): error C2737: 'maxmemfra
c': const object must be initialized [C:\Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\scrypt_params_async.cc(25,64): error C2661: 'v8::Obje
ct::Set': no overloaded function takes 2 arguments [C:\Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\inc\scrypt_common.h(40,1): error C2661: 'v8::Object::
Get': no overloaded function takes 1 arguments (compiling source file ..\src\node-boilerplate\scrypt_kdf-verify_async.c
c) [C:\Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\scrypt_params_sync.cc(28,50): error C2660: 'v8::Value
::IntegerValue': function does not take 0 arguments [C:\Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\AppData\Local\node-gyp\Cache\14.17.0\include\node\v8.h(2863,40): message : see declaration of 'v8::Value
::IntegerValue' (compiling source file ..\src\node-boilerplate\scrypt_params_sync.cc) [C:\Users\user\price-bot\node_mo
dules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\inc\scrypt_common.h(41,1): error C2661: 'v8::Object::
Get': no overloaded function takes 1 arguments (compiling source file ..\src\node-boilerplate\scrypt_kdf-verify_async.c
c) [C:\Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\scrypt_params_async.cc(32,11): warning C4996: 'Nan::C
allback::Call': was declared deprecated [C:\Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\inc\scrypt_common.h(39,1): error C2661: 'v8::Object::
Get': no overloaded function takes 1 arguments (compiling source file ..\src\node-boilerplate\scrypt_hash_async.cc) [C:
\Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\inc\scrypt_common.h(39,1): error C2661: 'v8::Object::
Get': no overloaded function takes 1 arguments (compiling source file ..\src\node-boilerplate\scrypt_kdf_async.cc) [C:
Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\scrypt_params_sync.cc(28,16): error C2737: 'osfreemem
': const object must be initialized [C:\Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\inc\scrypt_common.h(40,1): error C2661: 'v8::Object::
Get': no overloaded function takes 1 arguments (compiling source file ..\src\node-boilerplate\scrypt_hash_async.cc) [C:
\Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\inc\scrypt_async.h(53,15): warning C4996: 'Nan::Callb
ack::Call': was declared deprecated (compiling source file ..\src\node-boilerplate\scrypt_kdf-verify_async.cc) [C:\User
s\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\inc\scrypt_common.h(39,1): error C2661: 'v8::Object::
Get': no overloaded function takes 1 arguments (compiling source file ..\src\node-boilerplate\scrypt_kdf_sync.cc) [C:\U
sers\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\inc\scrypt_common.h(40,1): error C2661: 'v8::Object::
Get': no overloaded function takes 1 arguments (compiling source file ..\src\node-boilerplate\scrypt_kdf_async.cc) [C:
Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\inc\scrypt_common.h(41,1): error C2661: 'v8::Object::
Get': no overloaded function takes 1 arguments (compiling source file ..\src\node-boilerplate\scrypt_hash_async.cc) [C:
\Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\inc\scrypt_common.h(40,1): error C2661: 'v8::Object::
Get': no overloaded function takes 1 arguments (compiling source file ..\src\node-boilerplate\scrypt_kdf_sync.cc) [C:\U
sers\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\inc\scrypt_kdf-verify_async.h(40,1): error C2661: 'v8
::Object::Set': no overloaded function takes 2 arguments (compiling source file ..\src\node-boilerplate\scrypt_kdf-veri
fy_async.cc) [C:\Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\scrypt_params_sync.cc(46,67): error C2661: 'v8::Objec
t::Set': no overloaded function takes 2 arguments [C:\Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\inc\scrypt_common.h(41,1): error C2661: 'v8::Object::
Get': no overloaded function takes 1 arguments (compiling source file ..\src\node-boilerplate\scrypt_kdf_async.cc) [C:
Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\inc\scrypt_kdf-verify_async.h(41,1): error C2661: 'v8
::Object::Set': no overloaded function takes 2 arguments (compiling source file ..\src\node-boilerplate\scrypt_kdf-veri
fy_async.cc) [C:\Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\inc\scrypt_common.h(41,1): error C2661: 'v8::Object::
Get': no overloaded function takes 1 arguments (compiling source file ..\src\node-boilerplate\scrypt_kdf_sync.cc) [C:\U
sers\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\scrypt_params_sync.cc(47,64): error C2661: 'v8::Objec
t::Set': no overloaded function takes 2 arguments [C:\Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\inc\scrypt_async.h(53,15): warning C4996: 'Nan::Callb
ack::Call': was declared deprecated (compiling source file ..\src\node-boilerplate\scrypt_hash_async.cc) [C:\Users\stah
e\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\inc\scrypt_async.h(53,15): warning C4996: 'Nan::Callb
ack::Call': was declared deprecated (compiling source file ..\src\node-boilerplate\scrypt_kdf_async.cc) [C:\Users\user
\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\scrypt_kdf-verify_async.cc(30,11): warning C4996: 'Na
n::Callback::Call': was declared deprecated [C:\Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\scrypt_params_sync.cc(48,64): error C2661: 'v8::Objec
t::Set': no overloaded function takes 2 arguments [C:\Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\scrypt_kdf_sync.cc(29,57): error C2660: 'v8::Value::T
oObject': function does not take 0 arguments [C:\Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\AppData\Local\node-gyp\Cache\14.17.0\include\node\v8.h(2822,44): message : see declaration of 'v8::Value
::ToObject' (compiling source file ..\src\node-boilerplate\scrypt_kdf_sync.cc) [C:\Users\user\price-bot\node_modules\s
crypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\scrypt_kdf_sync.cc(29,30): error C2737: 'params': con
st object must be initialized [C:\Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\inc\scrypt_hash_async.h(36,1): error C2660: 'v8::Valu
e::ToObject': function does not take 0 arguments (compiling source file ..\src\node-boilerplate\scrypt_hash_async.cc) [
C:\Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\AppData\Local\node-gyp\Cache\14.17.0\include\node\v8.h(2822,44): message : see declaration of 'v8::Value
::ToObject' (compiling source file ..\src\node-boilerplate\scrypt_hash_async.cc) [C:\Users\user\price-bot\node_modules
\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\inc\scrypt_kdf_async.h(36,1): error C2660: 'v8::Value
::ToObject': function does not take 0 arguments (compiling source file ..\src\node-boilerplate\scrypt_kdf_async.cc) [C:
\Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\AppData\Local\node-gyp\Cache\14.17.0\include\node\v8.h(2822,44): message : see declaration of 'v8::Value
::ToObject' (compiling source file ..\src\node-boilerplate\scrypt_kdf_async.cc) [C:\Users\user\price-bot\node_modules
scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\inc\scrypt_hash_async.h(37,1): error C2660: 'v8::Valu
e::IntegerValue': function does not take 0 arguments (compiling source file ..\src\node-boilerplate\scrypt_hash_async.c
c) [C:\Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\AppData\Local\node-gyp\Cache\14.17.0\include\node\v8.h(2863,40): message : see declaration of 'v8::Value
::IntegerValue' (compiling source file ..\src\node-boilerplate\scrypt_hash_async.cc) [C:\Users\user\price-bot\node_mod
ules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\inc\scrypt_kdf_async.h(36,13): error C2512: 'NodeScry
pt::Params::Params': no appropriate default constructor available (compiling source file ..\src\node-boilerplate\scrypt
_kdf_async.cc) [C:\Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\inc\scrypt_hash_async.h(36,13): error C2512: 'NodeScr
ypt::Params::Params': no appropriate default constructor available (compiling source file ..\src\node-boilerplate\scryp
t_hash_async.cc) [C:\Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\inc\scrypt_kdf_async.h(40,1): error C2661: 'v8::Objec
t::Set': no overloaded function takes 2 arguments (compiling source file ..\src\node-boilerplate\scrypt_kdf_async.cc) [
C:\Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\inc\scrypt_hash_async.h(42,1): error C2661: 'v8::Obje
ct::Set': no overloaded function takes 2 arguments (compiling source file ..\src\node-boilerplate\scrypt_hash_async.cc)
[C:\Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\inc\scrypt_hash_async.h(43,1): error C2661: 'v8::Obje
ct::Set': no overloaded function takes 2 arguments (compiling source file ..\src\node-boilerplate\scrypt_hash_async.cc)
[C:\Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\inc\scrypt_kdf_async.h(41,1): error C2661: 'v8::Objec
t::Set': no overloaded function takes 2 arguments (compiling source file ..\src\node-boilerplate\scrypt_kdf_async.cc) [
C:\Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\inc\scrypt_hash_async.h(44,1): error C2661: 'v8::Obje
ct::Set': no overloaded function takes 2 arguments (compiling source file ..\src\node-boilerplate\scrypt_hash_async.cc)
[C:\Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\inc\scrypt_kdf_async.h(42,1): error C2661: 'v8::Objec
t::Set': no overloaded function takes 2 arguments (compiling source file ..\src\node-boilerplate\scrypt_kdf_async.cc) [
C:\Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\inc\scrypt_kdf_async.h(45,1): error C2661: 'v8::Objec
t::Get': no overloaded function takes 1 arguments (compiling source file ..\src\node-boilerplate\scrypt_kdf_async.cc) [
C:\Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\inc\scrypt_hash_async.h(47,1): error C2661: 'v8::Obje
ct::Get': no overloaded function takes 1 arguments (compiling source file ..\src\node-boilerplate\scrypt_hash_async.cc)
[C:\Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\scrypt_kdf_async.cc(25,62): error C2660: 'v8::Value::
ToObject': function does not take 0 arguments [C:\Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\AppData\Local\node-gyp\Cache\14.17.0\include\node\v8.h(2822,44): message : see declaration of 'v8::Value
::ToObject' (compiling source file ..\src\node-boilerplate\scrypt_kdf_async.cc) [C:\Users\user\price-bot\node_modules
scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\scrypt_hash_async.cc(49,58): error C2660: 'v8::Value:
:ToObject': function does not take 0 arguments [C:\Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\AppData\Local\node-gyp\Cache\14.17.0\include\node\v8.h(2822,44): message : see declaration of 'v8::Value
::ToObject' (compiling source file ..\src\node-boilerplate\scrypt_hash_async.cc) [C:\Users\user\price-bot\node_modules
\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\scrypt_hash_async.cc(52,11): warning C4996: 'Nan::Cal
lback::Call': was declared deprecated [C:\Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
C:\Users\user\price-bot\node_modules\scrypt\src\node-boilerplate\scrypt_kdf_async.cc(28,13): warning C4996: 'Nan::Call
back::Call': was declared deprecated [C:\Users\user\price-bot\node_modules\scrypt\build\scrypt.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:376:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
gyp ERR! System Windows_NT 10.0.19041
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\user\price-bot\node_modules\scrypt
gyp ERR! node -v v14.17.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok

[email protected] install C:\Users\user\price-bot\node_modules\web3-providers-ws\node_modules\websocket
(node-gyp rebuild 2> builderror.log) || (exit 0)

C:\Users\user\price-bot\node_modules\web3-providers-ws\node_modules\websocket>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "-m" switch.
bufferutil.cc
win_delay_load_hook.cc
C:\Users\user\price-bot\node_modules\web3-providers-ws\node_modules\websocket\src\bufferutil.cc(34,1): error C2660: 'v
8::FunctionTemplate::GetFunction': function does not take 0 arguments [C:\Users\user\price-bot\node_modules\web3-provi
ders-ws\node_modules\websocket\build\bufferutil.vcxproj]
C:\Users\user\AppData\Local\node-gyp\Cache\14.17.0\include\node\v8.h(6482,46): message : see declaration of 'v8::Funct
ionTemplate::GetFunction' (compiling source file ..\src\bufferutil.cc) [C:\Users\user\price-bot\node_modules\web3-prov
iders-ws\node_modules\websocket\build\bufferutil.vcxproj]
C:\Users\user\price-bot\node_modules\web3-providers-ws\node_modules\websocket\src\bufferutil.cc(34,1): error C2661: 'N
an::Set': no overloaded function takes 2 arguments [C:\Users\user\price-bot\node_modules\web3-providers-ws\node_module
s\websocket\build\bufferutil.vcxproj]
C:\Users\user\price-bot\node_modules\web3-providers-ws\node_modules\websocket\src\bufferutil.cc(50,1): error C2660: 'v
8::Value::ToObject': function does not take 0 arguments [C:\Users\user\price-bot\node_modules\web3-providers-ws\node_m
odules\websocket\build\bufferutil.vcxproj]
C:\Users\user\AppData\Local\node-gyp\Cache\14.17.0\include\node\v8.h(2822,44): message : see declaration of 'v8::Value
::ToObject' (compiling source file ..\src\bufferutil.cc) [C:\Users\user\price-bot\node_modules\web3-providers-ws\node_
modules\websocket\build\bufferutil.vcxproj]
C:\Users\user\price-bot\node_modules\web3-providers-ws\node_modules\websocket\src\bufferutil.cc(57,1): error C2661: 'v
8::Object::Get': no overloaded function takes 1 arguments [C:\Users\user\price-bot\node_modules\web3-providers-ws\node
modules\websocket\build\bufferutil.vcxproj]
C:\Users\user\price-bot\node_modules\web3-providers-ws\node_modules\websocket\src\bufferutil.cc(68,1): error C2660: 'v
8::Value::ToObject': function does not take 0 arguments [C:\Users\user\price-bot\node_modules\web3-providers-ws\node_m
odules\websocket\build\bufferutil.vcxproj]
C:\Users\user\AppData\Local\node-gyp\Cache\14.17.0\include\node\v8.h(2822,44): message : see declaration of 'v8::Value
::ToObject' (compiling source file ..\src\bufferutil.cc) [C:\Users\user\price-bot\node_modules\web3-providers-ws\node

modules\websocket\build\bufferutil.vcxproj]
C:\Users\user\price-bot\node_modules\web3-providers-ws\node_modules\websocket\src\bufferutil.cc(70,1): error C2660: 'v
8::Value::ToObject': function does not take 0 arguments [C:\Users\user\price-bot\node_modules\web3-providers-ws\node_m
odules\websocket\build\bufferutil.vcxproj]
C:\Users\user\AppData\Local\node-gyp\Cache\14.17.0\include\node\v8.h(2822,44): message : see declaration of 'v8::Value
::ToObject' (compiling source file ..\src\bufferutil.cc) [C:\Users\user\price-bot\node_modules\web3-providers-ws\node_
modules\websocket\build\bufferutil.vcxproj]
C:\Users\user\price-bot\node_modules\web3-providers-ws\node_modules\websocket\src\bufferutil.cc(89,1): error C2660: 'v
8::Value::ToObject': function does not take 0 arguments [C:\Users\user\price-bot\node_modules\web3-providers-ws\node_m
odules\websocket\build\bufferutil.vcxproj]
C:\Users\user\AppData\Local\node-gyp\Cache\14.17.0\include\node\v8.h(2822,44): message : see declaration of 'v8::Value
::ToObject' (compiling source file ..\src\bufferutil.cc) [C:\Users\user\price-bot\node_modules\web3-providers-ws\node_
modules\websocket\build\bufferutil.vcxproj]
C:\Users\user\price-bot\node_modules\web3-providers-ws\node_modules\websocket\src\bufferutil.cc(90,1): error C2660: 'v
8::Value::ToObject': function does not take 0 arguments [C:\Users\user\price-bot\node_modules\web3-providers-ws\node_m
odules\websocket\build\bufferutil.vcxproj]
C:\Users\user\AppData\Local\node-gyp\Cache\14.17.0\include\node\v8.h(2822,44): message : see declaration of 'v8::Value
::ToObject' (compiling source file ..\src\bufferutil.cc) [C:\Users\user\price-bot\node_modules\web3-providers-ws\node_
modules\websocket\build\bufferutil.vcxproj]
C:\Users\user\price-bot\node_modules\web3-providers-ws\node_modules\websocket\src\bufferutil.cc(92,1): error C2660: 'v
8::Value::ToObject': function does not take 0 arguments [C:\Users\user\price-bot\node_modules\web3-providers-ws\node_m
odules\websocket\build\bufferutil.vcxproj]
C:\Users\user\AppData\Local\node-gyp\Cache\14.17.0\include\node\v8.h(2822,44): message : see declaration of 'v8::Value
::ToObject' (compiling source file ..\src\bufferutil.cc) [C:\Users\user\price-bot\node_modules\web3-providers-ws\node_
modules\websocket\build\bufferutil.vcxproj]
C:\Users\user\price-bot\node_modules\web3-providers-ws\node_modules\websocket\src\bufferutil.cc(93,1): error C2660: 'v
8::Value::Int32Value': function does not take 0 arguments [C:\Users\user\price-bot\node_modules\web3-providers-ws\node
modules\websocket\build\bufferutil.vcxproj]
C:\Users\user\AppData\Local\node-gyp\Cache\14.17.0\include\node\v8.h(2869,40): message : see declaration of 'v8::Value
::Int32Value' (compiling source file ..\src\bufferutil.cc) [C:\Users\user\price-bot\node_modules\web3-providers-ws\nod
e_modules\websocket\build\bufferutil.vcxproj]
C:\Users\user\price-bot\node_modules\web3-providers-ws\node_modules\websocket\src\bufferutil.cc(94,1): error C2660: 'v
8::Value::Int32Value': function does not take 0 arguments [C:\Users\user\price-bot\node_modules\web3-providers-ws\node
modules\websocket\build\bufferutil.vcxproj]
C:\Users\user\AppData\Local\node-gyp\Cache\14.17.0\include\node\v8.h(2869,40): message : see declaration of 'v8::Value
::Int32Value' (compiling source file ..\src\bufferutil.cc) [C:\Users\user\price-bot\node_modules\web3-providers-ws\nod
e_modules\websocket\build\bufferutil.vcxproj]
validation.cc
win_delay_load_hook.cc
C:\Users\user\price-bot\node_modules\web3-providers-ws\node_modules\websocket\src\validation.cc(114,1): error C2660: '
v8::FunctionTemplate::GetFunction': function does not take 0 arguments [C:\Users\user\price-bot\node_modules\web3-prov
iders-ws\node_modules\websocket\build\validation.vcxproj]
C:\Users\user\AppData\Local\node-gyp\Cache\14.17.0\include\node\v8.h(6482,46): message : see declaration of 'v8::Funct
ionTemplate::GetFunction' (compiling source file ..\src\validation.cc) [C:\Users\user\price-bot\node_modules\web3-prov
iders-ws\node_modules\websocket\build\validation.vcxproj]
C:\Users\user\price-bot\node_modules\web3-providers-ws\node_modules\websocket\src\validation.cc(114,1): error C2661: '
Nan::Set': no overloaded function takes 2 arguments [C:\Users\user\price-bot\node_modules\web3-providers-ws\node_modul
es\websocket\build\validation.vcxproj]
C:\Users\user\price-bot\node_modules\web3-providers-ws\node_modules\websocket\src\validation.cc(133,1): error C2660: '
v8::Value::ToObject': function does not take 0 arguments [C:\Users\user\price-bot\node_modules\web3-providers-ws\node

modules\websocket\build\validation.vcxproj]
C:\Users\user\AppData\Local\node-gyp\Cache\14.17.0\include\node\v8.h(2822,44): message : see declaration of 'v8::Value
::ToObject' (compiling source file ..\src\validation.cc) [C:\Users\user\price-bot\node_modules\web3-providers-ws\node

modules\websocket\build\validation.vcxproj]
npm WARN @babel/[email protected] requires a peer of @babel/core@^7.0.0-0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @babel/core@^7.0.0-0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @babel/core@^7.0.0-0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @babel/core@^7.0.0-0 but none is installed. You must install peer dependencies yourself.
npm WARN @babel/[email protected] requires a peer of @babel/core@^7.4.0-0 but none is installed. You must install peer dependencies yourself.
npm WARN @babel/[email protected] requires a peer of @babel/core@^7.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\scrypt):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] install: node-gyp rebuild
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

added 93 packages from 146 contributors, removed 3 packages, moved 7 packages and audited 701 packages in 27.489s

24 packages are looking for funding
run npm fund for details

found 3046 vulnerabilities (809 low, 434 moderate, 1803 high)
run npm audit fix to fix them, or npm audit for details

C:\Users\user\price-bot>

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

C:\Users\user\price-bot>npm run start

[email protected] start
node index.js

Listening on 5000
Checking prices...
Error: Provider not set or invalid
at Object.InvalidProvider (C:\Users\user\price-bot\node_modules\web3-core-helpers\src\errors.js:38:16)
at RequestManager.send (C:\Users\user\price-bot\node_modules\web3-core-requestmanager\src\index.js:128:32)
at sendRequest (C:\Users\user\price-bot\node_modules\web3-core-method\src\index.js:560:42)
at send (C:\Users\user\price-bot\node_modules\web3-core-method\src\index.js:581:13)
at Object._executeMethod (C:\Users\user\price-bot\node_modules\web3-eth-contract\src\index.js:826:24)
at checkPair (C:\Users\user\price-bot\index.js:36:96)
at monitorPrice (C:\Users\user\price-bot\index.js:68:11)
at Timeout._onTimeout (C:\Users\user\price-bot\index.js:112:48)
at listOnTimeout (node:internal/timers:557:17)
at processTimers (node:internal/timers:500:7)

Returned error: execution reverted

Hi Guys,

strange error message when i run the price bot. it successfully returns the price for the first token but then fails with the following error message.
Returned error: execution reverted.

any idea what this could be? Many Thanks

Error: listen EADDRINUSE: address already in use :::5000

Added my own RPC key URL and changed the input currency for the pairs to be USDC instead of ETH, but those are the only changes I've made so far.
Every time I try to run the script, I get this error message:

Error: listen EADDRINUSE: address already in use :::5000
at Server.setupListenHandle [as _listen2] (net.js:1317:16)
at listenInCluster (net.js:1365:12)
at Server.listen (net.js:1451:7)
at [stdin]:17:39
at Script.runInThisContext (vm.js:132:18)
at Object.runInThisContext (vm.js:309:38)
at internal/process/execution.js:77:19
at [stdin]-wrapper:6:22
at evalScript (internal/process/execution.js:76:60)
at internal/main/eval_stdin.js:29:5
at Socket. (internal/process/execution.js:198:5)
at Socket.emit (events.js:326:22)
at endReadableNT (_stream_readable.js:1252:12)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
[Finished in 1.312s]

Kyber Rates are 0

Kyber Rates for DAI, KNC, and LINK all return 0

Checking prices...
┌─────────┬─────────────┬──────────────┬──────────────┬────────────────────────┬────────────────────────┬───────────────────────┬─────────────────────────────┐
│ (index) │ Input Token │ Output Token │ Input Amount │     Uniswap Return     │  Kyber Expected Rate   │   Kyber Min Return    │          Timestamp          │
├─────────┼─────────────┼──────────────┼──────────────┼────────────────────────┼────────────────────────┼───────────────────────┼─────────────────────────────┤
│    0    │    'ETH'    │    'MKR'     │     '1'      │ '1.060152104433066426' │ '1.060046665374527588' │ '1.02824526541329176' │ '2020-12-02T08:09:37-06:00' │
└─────────┴─────────────┴──────────────┴──────────────┴────────────────────────┴────────────────────────┴───────────────────────┴─────────────────────────────┘
┌─────────┬─────────────┬──────────────┬──────────────┬──────────────────────────┬─────────────────────┬──────────────────┬─────────────────────────────┐
│ (index) │ Input Token │ Output Token │ Input Amount │      Uniswap Return      │ Kyber Expected Rate │ Kyber Min Return │          Timestamp          │
├─────────┼─────────────┼──────────────┼──────────────┼──────────────────────────┼─────────────────────┼──────────────────┼─────────────────────────────┤
│    0    │    'ETH'    │    'DAI'     │     '1'      │ '591.145732642784308457' │         '0'         │       '0'        │ '2020-12-02T08:09:37-06:00' │
└─────────┴─────────────┴──────────────┴──────────────┴──────────────────────────┴─────────────────────┴──────────────────┴─────────────────────────────┘
┌─────────┬─────────────┬──────────────┬──────────────┬──────────────────────────┬─────────────────────┬──────────────────┬─────────────────────────────┐
│ (index) │ Input Token │ Output Token │ Input Amount │      Uniswap Return      │ Kyber Expected Rate │ Kyber Min Return │          Timestamp          │
├─────────┼─────────────┼──────────────┼──────────────┼──────────────────────────┼─────────────────────┼──────────────────┼─────────────────────────────┤
│    0    │    'ETH'    │    'KNC'     │     '1'      │ '460.752628953645153198' │         '0'         │       '0'        │ '2020-12-02T08:09:37-06:00' │
└─────────┴─────────────┴──────────────┴──────────────┴──────────────────────────┴─────────────────────┴──────────────────┴─────────────────────────────┘
┌─────────┬─────────────┬──────────────┬──────────────┬─────────────────────────┬─────────────────────┬──────────────────┬─────────────────────────────┐
│ (index) │ Input Token │ Output Token │ Input Amount │     Uniswap Return      │ Kyber Expected Rate │ Kyber Min Return │          Timestamp          │
├─────────┼─────────────┼──────────────┼──────────────┼─────────────────────────┼─────────────────────┼──────────────────┼─────────────────────────────┤
│    0    │    'ETH'    │    'LINK'    │     '1'      │ '42.342745921953079737' │         '0'         │       '0'        │ '2020-12-02T08:09:37-06:00' │
└─────────┴─────────────┴──────────────┴──────────────┴─────────────────────────┴─────────────────────┴──────────────────┴─────────────────────────────┘

Please pass numbers as strings or BN objects to avoid precision errors.

I was getting a bunch of errors but i managed around them but now this is the final boss fight.

Error: Please pass numbers as strings or BN objects to avoid precision errors.
at Object.fromWei (/mnt/d/cryptobot/price-bot/node_modules/web3-utils/lib/index.js:219:15)
at checkPair (/mnt/d/cryptobot/price-bot/index.js:48:36)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async monitorPrice (/mnt/d/cryptobot/price-bot/index.js:68:5)
at async Timeout._onTimeout (/mnt/d/cryptobot/price-bot/index.js:112:42)

I have no idea what its talking about i checked everything that i imagine could be causing it but no idea to be honest

Value are not correct

If you check the values on uniswap you can see they are not the same of the program

Is there a way to get this to work? Cascading errors: web3.eth.Contract is not a constructor // TypeError: Cannot read properties of undefined (reading 'toWei')

When I try to npm run start this code I get this error:


TypeError: web3.eth.Contract is not a constructor
at Object. (C:\Users\John\demos\DAAP university\TAKE 2\price-bot\index.js:31:27)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
at node:internal/main/run_main_module:17:47


If I change the constructor format from
const uniswapFactoryContract = new web3.eth.Contract(UNISWAP_FACTORY_ABI, UNISWAP_FACTORY_ADDRESS)
to
const uniswapFactoryContract = web3.eth.contract(UNISWAP_FACTORY_ABI, UNISWAP_FACTORY_ADDRESS)

then I get this error
TypeError: Cannot read properties of undefined (reading 'toWei')
at monitorPrice (C:\Users\John\demos\DAAP university\TAKE 2\price-bot\index.js:73:31)
at Timeout._onTimeout (C:\Users\John\demos\DAAP university\TAKE 2\price-bot\index.js:112:48)
at listOnTimeout (node:internal/timers:559:17)
at processTimers (node:internal/timers:502:7)

is this tutorial dead or is there a way to make this code run?

web3.eth.Contract is not a constructor

  1. Fresh Git Clone
  2. Remove package-lock.json
  3. npm install
  4. npm install (to be sure all packages are installed)
  5. create .env with RPC URL on Mainnet
  6. npm run start

This is where I get the error "web3.eth.Contract is not a constructor"

Screen Shot 2022-05-29 at 15 14 57

npm: command not found

Hi Gregory, not sure if this is the right place to ask this question but i was trying to install the price bot,
but terminal gives me the following error when I try :

"npm install" and also with "npm run start":

bash: npm: command not found

Can you please help me out on this.

Love your videos keep it up!

Not working

''npm install'' gives the following.

`C:\Users\username\Documents\Dapp\price-bot

Mode LastWriteTime Length Name


-a--- 7/22/2022 3:08 AM 91 .env.example
-a--- 7/22/2022 3:08 AM 100 .gitignore
-a--- 7/22/2022 3:08 AM 21756 index.js
-a--- 7/22/2022 3:08 AM 203037 package-lock.json
-a--- 7/22/2022 3:08 AM 691 package.json

PS C:\Users\username\Documents\Dapp\price-bot> npm install
npm WARN config global --global, --local are deprecated. Use --location=global instead.
npm WARN old lockfile
npm WARN old lockfile The package-lock.json file was created with an old version of npm,
npm WARN old lockfile so supplemental metadata must be fetched from the registry.
npm WARN old lockfile
npm WARN old lockfile This is a one-time fix-up, please be patient...
npm WARN old lockfile
npm WARN old lockfile Error: git dep preparation failed
npm WARN old lockfile at ChildProcess. (C:\Program Files\nodejs\node_modules\npm\node_modules@npmcli\promise-spawn\lib\index.js:63:27)
npm WARN old lockfile at ChildProcess.emit (node:events:527:28)
npm WARN old lockfile at maybeClose (node:internal/child_process:1092:16)
npm WARN old lockfile at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
npm WARN old lockfile Could not fetch metadata for web3-provider-engine@git+ssh://[email protected]/trufflesuite/provider-engine.git#3538c60bc4836b73ccae1ac3f64c8fed8ef19c1a Error: git dep preparation failed
npm WARN old lockfile at ChildProcess. (C:\Program Files\nodejs\node_modules\npm\node_modules@npmcli\promise-spawn\lib\index.js:63:27)
npm WARN old lockfile at ChildProcess.emit (node:events:527:28)
npm WARN old lockfile at maybeClose (node:internal/child_process:1092:16)
npm WARN old lockfile at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5) {
npm WARN old lockfile cmd: 'C:\Program Files\nodejs\node.exe',
npm WARN old lockfile args: [
npm WARN old lockfile 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',
npm WARN old lockfile 'install',
npm WARN old lockfile '--force',
npm WARN old lockfile '--cache=C:\Users\username\AppData\Local\npm-cache',
npm WARN old lockfile '--prefer-offline=false',
npm WARN old lockfile '--prefer-online=false',
npm WARN old lockfile '--offline=false',
npm WARN old lockfile '--no-progress',
npm WARN old lockfile '--no-save',
npm WARN old lockfile '--no-audit',
npm WARN old lockfile '--include=dev',
npm WARN old lockfile '--include=peer',
npm WARN old lockfile '--include=optional',
npm WARN old lockfile '--no-package-lock-only',
npm WARN old lockfile '--no-dry-run'
npm WARN old lockfile ],
npm WARN old lockfile code: 1,
npm WARN old lockfile signal: null,
npm WARN old lockfile stdout: '\n' +
npm WARN old lockfile '> [email protected] prepublish\n' +
npm WARN old lockfile '> npm run build && npm run bundle\n' +
npm WARN old lockfile '\n' +
npm WARN old lockfile '\n' +
npm WARN old lockfile '> [email protected] build\n' +
npm WARN old lockfile '> babel zero.js index.js -d dist/es5 && babel subproviders -d dist/es5/subproviders && babel util -d dist/es5/util\n' +
npm WARN old lockfile '\n' +
npm WARN old lockfile 'zero.js -> dist\es5\zero.js\n' +
npm WARN old lockfile 'index.js -> dist\es5\index.js\n' +
npm WARN old lockfile 'subproviders\cache.js -> dist\es5\subproviders\cache.js\n' +
npm WARN old lockfile 'subproviders\default-fixture.js -> dist\es5\subproviders\default-fixture.js\n' +
npm WARN old lockfile 'subproviders\etherscan.js -> dist\es5\subproviders\etherscan.js\n' +
npm WARN old lockfile 'subproviders\fetch.js -> dist\es5\subproviders\fetch.js\n' +
npm WARN old lockfile 'subproviders\filters.js -> dist\es5\subproviders\filters.js\n' +
npm WARN old lockfile 'subproviders\fixture.js -> dist\es5\subproviders\fixture.js\n' +
npm WARN old lockfile 'subproviders\gasprice.js -> dist\es5\subproviders\gasprice.js\n' +
npm WARN old lockfile 'subproviders\hooked-wallet-ethtx.js -> dist\es5\subproviders\hooked-wallet-ethtx.js\n' +
npm WARN old lockfile 'subproviders\hooked-wallet.js -> dist\es5\subproviders\hooked-wallet.js\n' +
npm WARN old lockfile 'subproviders\inflight-cache.js -> dist\es5\subproviders\inflight-cache.js\n' +
npm WARN old lockfile 'subproviders\infura.js -> dist\es5\subproviders\infura.js\n' +
npm WARN old lockfile 'subproviders\ipc.js -> dist\es5\subproviders\ipc.js\n' +
npm WARN old lockfile 'subproviders\nonce-tracker.js -> dist\es5\subproviders\nonce-tracker.js\n' +
npm WARN old lockfile 'subproviders\provider.js -> dist\es5\subproviders\provider.js\n' +
npm WARN old lockfile 'subproviders\rpc.js -> dist\es5\subproviders\rpc.js\n' +
npm WARN old lockfile 'subproviders\sanitizer.js -> dist\es5\subproviders\sanitizer.js\n' +
npm WARN old lockfile 'subproviders\stream.js -> dist\es5\subproviders\stream.js\n' +
npm WARN old lockfile 'subproviders\subprovider.js -> dist\es5\subproviders\subprovider.js\n' +
npm WARN old lockfile 'subproviders\subscriptions.js -> dist\es5\subproviders\subscriptions.js\n' +
npm WARN old lockfile 'subproviders\vm.js -> dist\es5\subproviders\vm.js\n' +
npm WARN old lockfile 'subproviders\wallet.js -> dist\es5\subproviders\wallet.js\n' +
npm WARN old lockfile 'subproviders\websocket.js -> dist\es5\subproviders\websocket.js\n' +
npm WARN old lockfile 'subproviders\whitelist.js -> dist\es5\subproviders\whitelist.js\n' +
npm WARN old lockfile 'util\assert.js -> dist\es5\util\assert.js\n' +
npm WARN old lockfile 'util\async.js -> dist\es5\util\async.js\n' +
npm WARN old lockfile 'util\create-payload.js -> dist\es5\util\create-payload.js\n' +
npm WARN old lockfile 'util\estimate-gas.js -> dist\es5\util\estimate-gas.js\n' +
npm WARN old lockfile 'util\random-id.js -> dist\es5\util\random-id.js\n' +
npm WARN old lockfile 'util\rpc-cache-utils.js -> dist\es5\util\rpc-cache-utils.js\n' +
npm WARN old lockfile 'util\rpc-hex-encoding.js -> dist\es5\util\rpc-hex-encoding.js\n' +
npm WARN old lockfile 'util\stoplight.js -> dist\es5\util\stoplight.js\n' +
npm WARN old lockfile '\n' +
npm WARN old lockfile '> [email protected] bundle\n' +
npm WARN old lockfile '> mkdir -p ./dist && npm run bundle-engine && npm run bundle-zero\n' +
npm WARN old lockfile '\n',
npm WARN old lockfile stderr: 'npm WARN using --force Recommended protections disabled.\n' +
npm WARN old lockfile 'npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-url#deprecated\n' +
npm WARN old lockfile 'npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated\n' +
npm WARN old lockfile 'npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated\n' +
npm WARN old lockfile 'npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-resolve#deprecated\n' +
npm WARN old lockfile 'npm WARN deprecated [email protected]: this library is no longer supported\n' +
npm WARN old lockfile 'npm WARN deprecated [email protected]: Renamed to @metamask/safe-event-emitter\n' +
npm WARN old lockfile 'npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.\n' +
npm WARN old lockfile 'npm WARN deprecated [email protected]: 🙌 Thanks for using Babel: we recommend using babel-preset-env now: please read https://babeljs.io/env to update!\n' +
npm WARN old lockfile 'npm WARN deprecated [email protected]: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.\n' +
npm WARN old lockfile "npm WARN deprecated [email protected]: Deprecated in favor of '@metamask/eth-sig-util'\n" +
npm WARN old lockfile 'npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.\n' +
npm WARN old lockfile 'npm WARN deprecated [email protected]: New package name format for new versions: @ethereumjs/block. Please update.\n' +
npm WARN old lockfile 'npm WARN deprecated [email protected]: New package name format for new versions: @ethereumjs/tx. Please update.\n' +
npm WARN old lockfile 'npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142\n' +
npm WARN old lockfile 'npm WARN deprecated [email protected]: New package name format for new versions: @ethereumjs/tx. Please update.\n' +
npm WARN old lockfile 'npm WARN deprecated [email protected]: New package name format for new versions: @ethereumjs/block. Please update.\n' +
npm WARN old lockfile 'npm WARN deprecated [email protected]: New package name format for new versions: @ethereumjs/vm. Please update.\n' +
npm WARN old lockfile 'npm WARN deprecated [email protected]: New package name format for new versions: @ethereumjs/common. Please update.\n' +
npm WARN old lockfile 'npm WARN deprecated [email protected]: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.\n' +
npm WARN old lockfile 'npm WARN config global --global, --local are deprecated. Use --location=global instead.\n' +
npm WARN old lockfile 'npm WARN using --force Recommended protections disabled.\n' +
npm WARN old lockfile 'npm WARN using --force Recommended protections disabled.\n' +
npm WARN old lockfile 'npm WARN config global --global, --local are deprecated. Use --location=global instead.\n' +
npm WARN old lockfile 'npm WARN using --force Recommended protections disabled.\n' +
npm WARN old lockfile 'npm WARN using --force Recommended protections disabled.\n' +
npm WARN old lockfile 'The syntax of the command is incorrect.\r\n' +
npm WARN old lockfile 'npm ERR! code 1\n' +
npm WARN old lockfile 'npm ERR! path C:\Users\username\AppData\Local\npm-cache\_cacache\tmp\git-cloneg5Urm9\n' +
npm WARN old lockfile 'npm ERR! command failed\n' +
npm WARN old lockfile 'npm ERR! command C:\Windows\system32\cmd.exe /d /s /c npm run build && npm run bundle\n' +
npm WARN old lockfile '\n' +
npm WARN old lockfile 'npm ERR! A complete log of this run can be found in:\n' +
npm WARN old lockfile 'npm ERR! C:\Users\username\AppData\Local\npm-cache\_logs\2022-07-22T01_36_51_845Z-debug-0.log\n'
npm WARN old lockfile }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '[email protected]',
npm WARN EBADENGINE required: { node: '10.x' },
npm WARN EBADENGINE current: { node: 'v16.16.0', npm: '8.11.0' }
npm WARN EBADENGINE }
npm WARN deprecated [email protected]: Renamed to @metamask/safe-event-emitter
npm WARN deprecated [email protected]: New package name format for new versions: @ethereumjs/block. Please update.
npm WARN deprecated [email protected]: This package is broken and no longer maintained. 'mkdirp' itself supports promises now, please switch to that.
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: New package name format for new versions: @ethereumjs/tx. Please update.
npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: request has been deprecated, see request/request#3142
npm WARN deprecated [email protected]: Deprecated in favor of '@metamask/eth-sig-util'
npm WARN deprecated [email protected]: New package name format for new versions: @ethereumjs/tx. Please update.
npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: New package name format for new versions: @ethereumjs/block. Please update.
npm WARN deprecated [email protected]: New package name format for new versions: @ethereumjs/vm. Please update.
npm WARN deprecated [email protected]: Critical security vulnerability fixed in v0.21.1. For more information, see axios/axios#3410
npm WARN deprecated [email protected]: New package name format for new versions: @ethereumjs/common. Please update.
npm WARN deprecated [email protected]: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
npm notice
npm notice New minor version of npm available! 8.11.0 -> 8.15.0
npm notice Changelog: https://github.com/npm/cli/releases/tag/v8.15.0
npm notice Run npm install -g [email protected] to update!
npm notice
npm ERR! code 1
npm ERR! git dep preparation failed
npm ERR! command C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js install --force --cache=C:\Users\username\AppData\Local\npm-cache --prefer-offline=false --prefer-online=false --offline=false --no-progress --no-save --no-audit --include=dev --include=peer --include=optional --no-package-lock-only --no-dry-run
npm ERR! > [email protected] prepublish
npm ERR! > npm run build && npm run bundle
npm ERR!
npm ERR!
npm ERR! > [email protected] build
npm ERR! > babel zero.js index.js -d dist/es5 && babel subproviders -d dist/es5/subproviders && babel util -d dist/es5/util
npm ERR!
npm ERR! zero.js -> dist\es5\zero.js
npm ERR! index.js -> dist\es5\index.js
npm ERR! subproviders\cache.js -> dist\es5\subproviders\cache.js
npm ERR! subproviders\default-fixture.js -> dist\es5\subproviders\default-fixture.js
npm ERR! subproviders\etherscan.js -> dist\es5\subproviders\etherscan.js
npm ERR! subproviders\fetch.js -> dist\es5\subproviders\fetch.js
npm ERR! subproviders\filters.js -> dist\es5\subproviders\filters.js
npm ERR! subproviders\fixture.js -> dist\es5\subproviders\fixture.js
npm ERR! subproviders\gasprice.js -> dist\es5\subproviders\gasprice.js
npm ERR! subproviders\hooked-wallet-ethtx.js -> dist\es5\subproviders\hooked-wallet-ethtx.js
npm ERR! subproviders\hooked-wallet.js -> dist\es5\subproviders\hooked-wallet.js
npm ERR! subproviders\inflight-cache.js -> dist\es5\subproviders\inflight-cache.js
npm ERR! subproviders\infura.js -> dist\es5\subproviders\infura.js
npm ERR! subproviders\ipc.js -> dist\es5\subproviders\ipc.js
npm ERR! subproviders\nonce-tracker.js -> dist\es5\subproviders\nonce-tracker.js
npm ERR! subproviders\provider.js -> dist\es5\subproviders\provider.js
npm ERR! subproviders\rpc.js -> dist\es5\subproviders\rpc.js
npm ERR! subproviders\sanitizer.js -> dist\es5\subproviders\sanitizer.js
npm ERR! subproviders\stream.js -> dist\es5\subproviders\stream.js
npm ERR! subproviders\subprovider.js -> dist\es5\subproviders\subprovider.js
npm ERR! subproviders\subscriptions.js -> dist\es5\subproviders\subscriptions.js
npm ERR! subproviders\vm.js -> dist\es5\subproviders\vm.js
npm ERR! subproviders\wallet.js -> dist\es5\subproviders\wallet.js
npm ERR! subproviders\websocket.js -> dist\es5\subproviders\websocket.js
npm ERR! subproviders\whitelist.js -> dist\es5\subproviders\whitelist.js
npm ERR! util\assert.js -> dist\es5\util\assert.js
npm ERR! util\async.js -> dist\es5\util\async.js
npm ERR! util\create-payload.js -> dist\es5\util\create-payload.js
npm ERR! util\estimate-gas.js -> dist\es5\util\estimate-gas.js
npm ERR! util\random-id.js -> dist\es5\util\random-id.js
npm ERR! util\rpc-cache-utils.js -> dist\es5\util\rpc-cache-utils.js
npm ERR! util\rpc-hex-encoding.js -> dist\es5\util\rpc-hex-encoding.js
npm ERR! util\stoplight.js -> dist\es5\util\stoplight.js
npm ERR!
npm ERR! > [email protected] bundle
npm ERR! > mkdir -p ./dist && npm run bundle-engine && npm run bundle-zero
npm ERR! npm WARN using --force Recommended protections disabled.
npm ERR! npm WARN deprecated [email protected]: Renamed to @metamask/safe-event-emitter
npm ERR! npm WARN deprecated [email protected]: 🙌 Thanks for using Babel: we recommend using babel-preset-env now: please read https://babeljs.io/env to update!
npm ERR! npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-url#deprecated
npm ERR! npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm ERR! npm WARN deprecated [email protected]: this library is no longer supported
npm ERR! npm WARN deprecated [email protected]: Deprecated in favor of '@metamask/eth-sig-util'
npm ERR! npm WARN deprecated [email protected]: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm ERR! npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-resolve#deprecated
npm ERR! npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm ERR! npm WARN deprecated [email protected]: New package name format for new versions: @ethereumjs/block. Please update.
npm ERR! npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm ERR! npm WARN deprecated [email protected]: New package name format for new versions: @ethereumjs/tx. Please update.
npm ERR! npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm ERR! npm WARN deprecated [email protected]: request has been deprecated, see request/request#3142
npm ERR! npm WARN deprecated [email protected]: New package name format for new versions: @ethereumjs/tx. Please update.
npm ERR! npm WARN deprecated [email protected]: New package name format for new versions: @ethereumjs/block. Please update.
npm ERR! npm WARN deprecated [email protected]: New package name format for new versions: @ethereumjs/vm. Please update.
npm ERR! npm WARN deprecated [email protected]: New package name format for new versions: @ethereumjs/common. Please update.
npm ERR! npm WARN deprecated [email protected]: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
npm ERR! npm WARN config global --global, --local are deprecated. Use --location=global instead.
npm ERR! npm WARN using --force Recommended protections disabled.
npm ERR! npm WARN using --force Recommended protections disabled.
npm ERR! npm WARN config global --global, --local are deprecated. Use --location=global instead.
npm ERR! npm WARN using --force Recommended protections disabled.
npm ERR! npm WARN using --force Recommended protections disabled.
npm ERR! The syntax of the command is incorrect.
npm ERR! npm ERR! code 1
npm ERR! npm ERR! path C:\Users\username\AppData\Local\npm-cache_cacache\tmp\git-cloneCvu5ow
npm ERR! npm ERR! command failed
npm ERR! npm ERR! command C:\Windows\system32\cmd.exe /d /s /c npm run build && npm run bundle
npm ERR!
npm ERR! npm ERR! A complete log of this run can be found in:
npm ERR! npm ERR! C:\Users\username\AppData\Local\npm-cache_logs\2022-07-22T01_38_22_408Z-debug-0.log

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\username\AppData\Local\npm-cache_logs\2022-07-22T01_36_34_851Z-debug-0.log`

How to resolve this? Can the code be updated please or tell me what to do. I would really appreciate it.

Also ''npm start'' results in the following but I assume this happens since the ''npm install'' gave all those errors.

PS C:\Users\username\Documents\Dapp\price-bot> npm run start npm WARN config global --global, --localare deprecated. Use--location=global` instead.

[email protected] start
node index.js

node:internal/modules/cjs/loader:936
throw err;
^

Error: Cannot find module 'dotenv'
Require stack:

  • C:\Users\username\Documents\Dapp\price-bot\index.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object. (C:\Users\username\Documents\Dapp\price-bot\index.js:1:1)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [ 'C:\Users\username\Documents\Dapp\price-bot\index.js' ]`

NPM not found on ZSH

Hi I'm new to this, but I was watching one of your tutorials when I got an error building the price bot it was on one of the earlier steps "installing rpm" is when I noticed my Mac terminal was showing ZSH and not "bash:" when trying to run the rpm install.
This is why I am assuming my error is stemming from.

The tutorial I am speaking about above is https://www.youtube.com/watch?v=77G_-cMayRU

Error: Returned values aren't valid, did it run Out of Gas?

Hello, I am having the following issue, not sure how to fix this issue. Please help.

[email protected] start
node index.js

Listening on 5000
Checking prices...
Error: Returned values aren't valid, did it run Out of Gas?
at ABICoder.decodeParameters (/Users/custommortgage/Documents/trading-cat/price-bot/node_modules/web3-eth-abi/src/index.js:226:15)
at Contract._decodeMethodReturn (/Users/custommortgage/Documents/trading-cat/price-bot/node_modules/web3-eth-contract/src/index.js:465:22)
at Method.outputFormatter (/Users/custommortgage/Documents/trading-cat/price-bot/node_modules/web3-eth-contract/src/index.js:818:46)
at Method.formatOutput (/Users/custommortgage/Documents/trading-cat/price-bot/node_modules/web3-core-method/src/index.js:163:54)
at sendTxCallback (/Users/custommortgage/Documents/trading-cat/price-bot/node_modules/web3-core-method/src/index.js:473:33)
at /Users/custommortgage/Documents/trading-cat/price-bot/node_modules/web3-core-requestmanager/src/index.js:147:9
at XMLHttpRequest.request.onreadystatechange (/Users/custommortgage/Documents/trading-cat/price-bot/node_modules/web3-providers-http/src/index.js:96:13)
at XMLHttpRequestEventTarget.dispatchEvent (/Users/custommortgage/Documents/trading-cat/price-bot/node_modules/xhr2-cookies/xml-http-request-event-target.ts:44:13)
at XMLHttpRequest._setReadyState (/Users/custommortgage/Documents/trading-cat/price-bot/node_modules/xhr2-cookies/xml-http-request.ts:219:8)
at XMLHttpRequest._onHttpResponseEnd (/Users/custommortgage/Documents/trading-cat/price-bot/node_modules/xhr2-cookies/xml-http-request.ts:345:8)
at IncomingMessage. (/Users/custommortgage/Documents/trading-cat/price-bot/node_modules/xhr2-cookies/xml-http-request.ts:311:39)
at IncomingMessage.emit (events.js:327:22)
at endReadableNT (internal/streams/readable.js:1327:12)
at processTicksAndRejections (internal/process/task_queues.js:80:21)

Error: Invalid JSON RPC response: "invalid project id\n"

Hi there : ) can you please help me with this issue, I am really excited to run this bot with my daughter (9 yrs old), I am doing project based learning with her and this is one of our projects but we ran into this error when running this bot. Please help ; )

Listening on 5000
Checking prices...
Error: Invalid JSON RPC response: "invalid project id\n"
at Object.InvalidResponse (/Users/custommortgage/Documents/trading-cat/price-bot/node_modules/web3-core-helpers/src/errors.js:42:16)
at XMLHttpRequest.request.onreadystatechange (/Users/custommortgage/Documents/trading-cat/price-bot/node_modules/web3-providers-http/src/index.js:92:32)
at XMLHttpRequestEventTarget.dispatchEvent (/Users/custommortgage/Documents/trading-cat/price-bot/node_modules/xhr2-cookies/xml-http-request-event-target.ts:44:13)
at XMLHttpRequest._setReadyState (/Users/custommortgage/Documents/trading-cat/price-bot/node_modules/xhr2-cookies/xml-http-request.ts:219:8)
at XMLHttpRequest._onHttpResponseEnd (/Users/custommortgage/Documents/trading-cat/price-bot/node_modules/xhr2-cookies/xml-http-request.ts:345:8)
at IncomingMessage. (/Users/custommortgage/Documents/trading-cat/price-bot/node_modules/xhr2-cookies/xml-http-request.ts:311:39)
at IncomingMessage.emit (events.js:327:22)
at endReadableNT (internal/streams/readable.js:1327:12)
at processTicksAndRejections (internal/process/task_queues.js:80:21)

This is our .env file details:

RPC_URL="https://mainnet.infura.io/v3/njpp********************"
PRIVATE_KEY="**********************************************************"
ACCOUNT="0xCf9F30Ab738FD10D9189755b83f942e7Ad83f0D6"

Error: Returned error: execution reverted

Listening on 5000
Checking prices...
┌─────────┬─────────────┬──────────────┬──────────────┬────────────────────────┬────────────────────────┬───────────────────────┬─────────────────────────────┐
│ (index) │ Input Token │ Output Token │ Input Amount │ Uniswap Return │ Kyber Expected Rate │ Kyber Min Return │ Timestamp │
├─────────┼─────────────┼──────────────┼──────────────┼────────────────────────┼────────────────────────┼───────────────────────┼─────────────────────────────┤
│ 0 │ 'ETH' │ 'MKR' │ '1' │ '2.260300770597604295' │ '2.260080079622844114' │ '2.19227767723415879' │ '2022-09-15T00:15:18-05:00' │
└─────────┴─────────────┴──────────────┴──────────────┴────────────────────────┴────────────────────────┴───────────────────────┴─────────────────────────────┘
Error: Returned error: execution reverted
at Object.ErrorResponse (/Users/Desktop/dapp-bot/price-bot/node_modules/web3-core-helpers/src/errors.js:29:16)
at /Users/Desktop/dapp-bot/price-bot/node_modules/web3-core-requestmanager/src/index.js:140:36
at XMLHttpRequest.request.onreadystatechange (/Users/Desktop/dapp-bot/price-bot/node_modules/web3-providers-http/src/index.js:96:13)
at XMLHttpRequestEventTarget.dispatchEvent (/Users/Desktop/dapp-bot/price-bot/node_modules/xhr2-cookies/xml-http-request-event-target.ts:44:13)
at XMLHttpRequest._setReadyState (/Users/Desktop/dapp-bot/price-bot/node_modules/xhr2-cookies/xml-http-request.ts:219:8)
at XMLHttpRequest._onHttpResponseEnd (/Users/Desktop/dapp-bot/price-bot/node_modules/xhr2-cookies/xml-http-request.ts:345:8)
at IncomingMessage. (/Users/Desktop/dapp-bot/price-bot/node_modules/xhr2-cookies/xml-http-request.ts:311:39)
at IncomingMessage.emit (node:events:525:35)
at endReadableNT (node:internal/streams/readable:1358:12)
at processTicksAndRejections (node:internal/process/task_queues:83:21)

Error when executing: npm install

Hi,

I've got the following error:
(...)
(some warnings...)

npm ERR! code ENOENT
npm ERR! syscall spawn git
npm ERR! path git
npm ERR! errno -4058
npm ERR! enoent Error while executing:
npm ERR! enoent undefined ls-remote -h -t https://github.com/debris/bignumber.js.git
npm ERR! enoent
npm ERR! enoent
npm ERR! enoent spawn git ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

What might be the problem? Tks

Error: Returned values aren't valid

Listening on 5000
Checking prices...
Error: Returned values aren't valid, did it run Out of Gas? You might also see this error if you are not using the correct ABI for the contract you are retrieving data from, requesting data from a block number that does not exist, or querying a node which is not fully synced.
    at ABICoder.decodeParameters (/Users/codeme/code/defi/node_modules/web3-eth-abi/src/index.js:338:15)
    at Contract._decodeMethodReturn (/Users/codeme/code/defi/node_modules/web3-eth-contract/src/index.js:572:22)
    at Method.outputFormatter (/Users/codeme/code/defi/node_modules/web3-eth-contract/src/index.js:935:42)
    at Method.formatOutput (/Users/codeme/code/defi/node_modules/web3-core-method/src/index.js:169:54)
    at sendTxCallback (/Users/codeme/code/defi/node_modules/web3-core-method/src/index.js:653:33)
    at onJsonrpcResult (/Users/codeme/code/defi/node_modules/web3-core-requestmanager/src/index.js:179:9)
    at XMLHttpRequest.request.onreadystatechange (/Users/codeme/code/defi/node_modules/web3-providers-http/src/index.js:111:13)
    at XMLHttpRequestEventTarget.dispatchEvent (/Users/codeme/code/defi/node_modules/xhr2-cookies/xml-http-request-event-target.ts:44:13)
    at XMLHttpRequest._setReadyState (/Users/codeme/code/defi/node_modules/xhr2-cookies/xml-http-request.ts:219:8)
    at XMLHttpRequest._onHttpResponseEnd (/Users/codeme/code/defi/node_modules/xhr2-cookies/xml-http-request.ts:345:8)
    at IncomingMessage.<anonymous> (/Users/codeme/code/defi/node_modules/xhr2-cookies/xml-http-request.ts:311:39)
    at IncomingMessage.emit (events.js:333:22)
    at endReadableNT (_stream_readable.js:1201:12)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)
^C

The line causing the error is this:
const exchangeAddress = await uniswapFactoryContract.methods.getExchange(outputTokenAddress).call()
Is there a mismatch between the ABI and the bytecode?

TypeError: uniswapFactoryContract.methods.getExchange

Hi,

I updated the code to get values from Uniswap v2 but it seems to not identify the ABI Address.

const UNISWAP_FACTORY_ABI = [{"inputs":[{"internalType":"address","name":"_feeToSetter","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token0","type":"address"},{"indexed":true,"internalType":"address","name":"token1","type":"address"},{"indexed":false,"internalType":"address","name":"pair","type":"address"},{"indexed":false,"internalType":"uint256","name":"","type":"uint256"}],"name":"PairCreated","type":"event"},{"constant":true,"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"allPairs","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"allPairsLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"}],"name":"createPair","outputs":[{"internalType":"address","name":"pair","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"feeTo","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"feeToSetter","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"getPair","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_feeTo","type":"address"}],"name":"setFeeTo","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_feeToSetter","type":"address"}],"name":"setFeeToSetter","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"}]
const UNISWAP_FACTORY_ADDRESS = '0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f'

Error after checking price

TypeError: uniswapFactoryContract.methods.getExchange is not a function
at checkPair (/Users/price-bot/index.js:36:64)
at monitorPrice (/Users/price-bot/index.js:68:11)
at Timeout._onTimeout (/Users/price-bot/index.js:112:48)
at listOnTimeout (internal/timers.js:555:17)
at processTimers (internal/timers.js:498:7)

Error: Provider not set or invalid

Hi, i got this error, how to fix it ?

maurice@DESKTOP-K0CAPB1:~/price-bot$ npm run start

> [email protected] start /home/maurice/price-bot
> node index.js

Listening on 5000
Checking prices...
Error: Provider not set or invalid
    at Object.InvalidProvider (/home/maurice/price-bot/node_modules/web3-core-helpers/src/errors.js:41:16)
    at RequestManager.send (/home/maurice/price-bot/node_modules/web3-core-requestmanager/src/index.js:157:32)
    at sendRequest (/home/maurice/price-bot/node_modules/web3-core-method/src/index.js:763:42)
    at send (/home/maurice/price-bot/node_modules/web3-core-method/src/index.js:797:13)
    at Object._executeMethod (/home/maurice/price-bot/node_modules/web3-eth-contract/src/index.js:945:20)
    at checkPair (/home/maurice/price-bot/index.js:36:96)
    at monitorPrice (/home/maurice/price-bot/index.js:68:11)
    at Timeout.setInterval [as _onTimeout] (/home/maurice/price-bot/index.js:112:48)
    at ontimeout (timers.js:436:11)
    at tryOnTimeout (timers.js:300:5)
    at listOnTimeout (timers.js:263:5)
    at Timer.processTimers (timers.js:223:10)

Error: Returned values aren't valid, did it run Out of Gas?

Most coins I added give me this error, what am I doing wrong?
It will work for DAI, LINK, MKR, LEND, BAT, KNC but not COMP and others afterwards

Error: Returned values aren't valid, did it run Out of Gas?
at ABICoder.decodeParameters (/mnt/h/Code/price-bot/node_modules/web3-eth-abi/src/index.js:226:15)
at Contract._decodeMethodReturn (/mnt/h/Code/price-bot/node_modules/web3-eth-contract/src/index.js:465:22)
at Method.outputFormatter (/mnt/h/Code/price-bot/node_modules/web3-eth-contract/src/index.js:818:46)
at Method.formatOutput (/mnt/h/Code/price-bot/node_modules/web3-core-method/src/index.js:163:54)
at sendTxCallback (/mnt/h/Code/price-bot/node_modules/web3-core-method/src/index.js:473:33)
at /mnt/h/Code/price-bot/node_modules/web3-core-requestmanager/src/index.js:147:9
at XMLHttpRequest.request.onreadystatechange (/mnt/h/Code/price-bot/node_modules/web3-providers-http/src/index.js:96:13)
at XMLHttpRequestEventTarget.dispatchEvent (/mnt/h/Code/price-bot/node_modules/xhr2-cookies/xml-http-request-event-target.ts:44:13)
at XMLHttpRequest._setReadyState (/mnt/h/Code/price-bot/node_modules/xhr2-cookies/xml-http-request.ts:219:8)
at XMLHttpRequest._onHttpResponseEnd (/mnt/h/Code/price-bot/node_modules/xhr2-cookies/xml-http-request.ts:345:8)
at IncomingMessage. (/mnt/h/Code/price-bot/node_modules/xhr2-cookies/xml-http-request.ts:311:39)
at IncomingMessage.emit (events.js:203:15)
at endReadableNT (_stream_readable.js:1143:12)
at process._tickCallback (internal/process/next_tick.js:63:19)

Here is the gist of my code

`let pairs = [
// { symbol: 'DAI', address: '0x6b175474e89094c44da98b954eedeac495271d0f'},
// { symbol: 'LINK', address: '0x514910771af9ca656af840dff83e8264ecf986ca'},
// { symbol: 'MKR', address: '0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2'},
// { symbol: 'LEND', address: '0x80fB784B7eD66730e8b1DBd9820aFD29931aab03'},
// { symbol: 'BAT', address: '0x0d8775f648430679a709e98d2b0cb6250d2887ef'},
// { symbol: 'KNC', address: '0xdd974d5c2e2928dea5f71b9825b8b646686bd200'},
//{ symbol: 'COMP', address: '0xc00e94cb662c3520282e6f5717214004a7f26888' },
//{ symbol: 'VET', address: '0xd850942ef8811f2a866692a623011bde52a462c1' },
//{ symbol: 'YFI', address: '0x0bc529c00C6401aEF6D220BE8C6Ea1667F6Ad93e' },
//{ symbol: 'CRO', address: '0xa0b73e1ff0b80914ab6fe0444e65848c4c34450b ' },
{ symbol: 'HEX2T', address: '0xEd1199093b1aBd07a368Dd1C0Cdc77D8517BA2A0' },

];

async function monitorPrice() {
if(monitoringPrice) {
return
}

console.log("Checking prices...")
monitoringPrice = true

try {
for (p in pairs) {

  	console.log(p)
	await checkPair({
	  inputTokenSymbol: eth.symbol,
	  inputTokenAddress: eth.address,
	  outputTokenSymbol: pairs[p].symbol,
	  outputTokenAddress: pairs[p].address,
	  inputAmount: web3.utils.toWei('1', 'ETHER')
	})  


}

} catch (error) {
console.error(error)
monitoringPrice = false
clearInterval(priceMonitor)
return
}

monitoringPrice = false
}

`

cannot find module 'dotenv'

after running the npm run start command, i get the error below:

`

[email protected] start
node index.js

node:internal/modules/cjs/loader:927
throw err;
^

Error: Cannot find module 'dotenv'
Require stack:

  • C:\Users\user\price-bot\index.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:924:15)
    at Function.Module._load (node:internal/modules/cjs/loader:769:27)
    at Module.require (node:internal/modules/cjs/loader:996:19)
    at require (node:internal/modules/cjs/helpers:92:18)
    at Object. (C:\Users\user\price-bot\index.js:1:1)
    at Module._compile (node:internal/modules/cjs/loader:1092:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1121:10)
    at Module.load (node:internal/modules/cjs/loader:972:32)
    at Function.Module._load (node:internal/modules/cjs/loader:813:14)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [ 'C:\Users\user\price-bot\index.js' ]
    }`

Error: Returned values aren't valid, did it run Out of Gas? You might also see this error if you are not using the correct ABI for the contract you are retrieving data from, requesting data from a block number that does not exist, or querying a node which is not fully synced.

when I try to check the price of other tokens like CFI, MAHA, GRT, XED it gives me the following error. Did anyone encounter this so far?

Listening on 5000 Checking prices... Error: Returned values aren't valid, did it run Out of Gas? You might also see this error if you are not using the correct ABI for the contract you are retrieving data from, requesting data from a block number that does not exist, or querying a node which is not fully synced.

First price shows then I get this error

Listening on 5000
Checking prices...
┌─────────┬─────────────┬──────────────┬──────────────┬────────────────────────┬────────────────────────┬────────────────────────┬─────────────────────────────┐
│ (index) │ Input Token │ Output Token │ Input Amount │ Uniswap Return │ Kyber Expected Rate │ Kyber Min Return │ Timestamp │
├─────────┼─────────────┼──────────────┼──────────────┼────────────────────────┼────────────────────────┼────────────────────────┼─────────────────────────────┤
│ 0 │ 'ETH' │ 'MKR' │ '1' │ '0.788379287855327053' │ '0.788300854732243338' │ '0.764651829090276037' │ '2021-06-14T07:28:00-05:00' │
└─────────┴─────────────┴──────────────┴──────────────┴────────────────────────┴────────────────────────┴────────────────────────┴─────────────────────────────┘

Error: Returned error: execution reverted
at Object.ErrorResponse (C:\Users\user\price-bot\node_modules\web3-core-helpers\src\errors.js:29:16)
at C:\Users\user\price-bot\node_modules\web3-core-requestmanager\src\index.js:140:36
at XMLHttpRequest.request.onreadystatechange (C:\Users\user\price-bot\node_modules\web3-providers-http\src\index.js:96:13)
at XMLHttpRequestEventTarget.dispatchEvent (C:\Users\user\price-bot\node_modules\xhr2-cookies\xml-http-request-event-target.ts:44:13)
at XMLHttpRequest._setReadyState (C:\Users\user\price-bot\node_modules\xhr2-cookies\xml-http-request.ts:219:8)
at XMLHttpRequest._onHttpResponseEnd (C:\Users\user\price-bot\node_modules\xhr2-cookies\xml-http-request.ts:345:8)
at IncomingMessage. (C:\Users\user\price-bot\node_modules\xhr2-cookies\xml-http-request.ts:311:39)
at IncomingMessage.emit (events.js:388:22)
at endReadableNT (internal/streams/readable.js:1336:12)
at processTicksAndRejections (internal/process/task_queues.js:82:21)

every time I run it. I get the same issue. can someone please assist

tried NPM install and got this

i tried npm install and did npm start run and this is what i got.

PS C:\Users\jolt0> cd ./price-bot/
PS C:\Users\jolt0\price-bot> npm install
npm WARN [email protected] No repository field.

up to date in 11.754s
PS C:\Users\jolt0\price-bot> npm start run

[email protected] start C:\Users\jolt0\price-bot
node index.js "run"

Listening on 5000
Checking prices...
Error: Provider not set or invalid
at Object.InvalidProvider (C:\Users\jolt0\price-bot\node_modules\web3-core-helpers\src\errors.js:38:16)
at RequestManager.send (C:\Users\jolt0\price-bot\node_modules\web3-core-requestmanager\src\index.js:128:32)
at sendRequest (C:\Users\jolt0\price-bot\node_modules\web3-core-method\src\index.js:560:42)
at send (C:\Users\jolt0\price-bot\node_modules\web3-core-method\src\index.js:581:13)
at Object._executeMethod (C:\Users\jolt0\price-bot\node_modules\web3-eth-contract\src\index.js:826:24)
at checkPair (C:\Users\jolt0\price-bot\index.js:36:96)
at monitorPrice (C:\Users\jolt0\price-bot\index.js:68:11)
at Timeout.setInterval [as _onTimeout] (C:\Users\jolt0\price-bot\index.js:112:48)
at ontimeout (timers.js:466:11)
at tryOnTimeout (timers.js:304:5)
at Timer.listOnTimeout (timers.js:267:5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.