Browse Source

fixed tradeEvent handling at telegrambot

develop
mark.sch 3 years ago
parent
commit
159b4e3c85
6 changed files with 409 additions and 20 deletions
  1. +4
    -5
      exchange/package-lock.json
  2. +3
    -3
      exchange/package.json
  3. +373
    -0
      package-lock.json
  4. +7
    -2
      package.json
  5. +5
    -3
      plugins/mailer.js
  6. +17
    -7
      plugins/telegrambot.js

+ 4
- 5
exchange/package-lock.json View File

@ -230,8 +230,7 @@
"ctype": {
"version": "0.5.3",
"resolved": "https://registry.npmjs.org/ctype/-/ctype-0.5.3.tgz",
"integrity": "sha1-gsGMJGH3QRTvFsE1IkrQuRRMoS8=",
"optional": true
"integrity": "sha1-gsGMJGH3QRTvFsE1IkrQuRRMoS8="
},
"dashdash": {
"version": "1.14.1",
@ -550,9 +549,9 @@
"integrity": "sha1-3z02Uqc/3ta5sLJBRub9BSNTRY4="
},
"moment": {
"version": "2.22.1",
"resolved": "https://registry.npmjs.org/moment/-/moment-2.22.1.tgz",
"integrity": "sha512-shJkRTSebXvsVqk56I+lkb2latjBs8I+pc2TzWc545y2iFnSjm7Wg0QMh+ZWcdSLQyGEau5jI8ocnmkyTgr9YQ=="
"version": "2.22.2",
"resolved": "https://registry.npmjs.org/moment/-/moment-2.22.2.tgz",
"integrity": "sha1-PCV/mDn8DpP/UxSWMiOeuQeD/2Y="
},
"ms": {
"version": "2.0.0",

+ 3
- 3
exchange/package.json View File

@ -29,10 +29,10 @@
"gdax": "^0.7.0",
"kraken-api": "^1.0.0",
"lodash": "^4.17.5",
"moment": "^2.22.1",
"moment": "^2.22.2",
"node.bittrex.api": "git://github.com/askmike/poloniex.js.git#69f5e254353e66d135070844fc3328efcbe3641c",
"poloniex.js": "git://github.com/askmike/poloniex.js.git#69f5e254353e66d135070844fc3328efcbe3641c",
"request-promise": "^4.2.2",
"retry": "^0.12.0",
"node.bittrex.api": "git://github.com/askmike/poloniex.js.git#69f5e254353e66d135070844fc3328efcbe3641c"
"retry": "^0.12.0"
}
}

+ 373
- 0
package-lock.json View File

@ -27,6 +27,11 @@
"negotiator": "0.6.1"
}
},
"addressparser": {
"version": "0.3.2",
"resolved": "https://registry.npmjs.org/addressparser/-/addressparser-0.3.2.tgz",
"integrity": "sha1-WYc/Nej89sc2HBAjkmHXbhU0i7I="
},
"ajv": {
"version": "5.5.2",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz",
@ -96,6 +101,15 @@
}
}
},
"array.prototype.findindex": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/array.prototype.findindex/-/array.prototype.findindex-2.0.2.tgz",
"integrity": "sha1-WAaNJYh+9QXknckssAxE3O5VsGc=",
"requires": {
"define-properties": "1.1.2",
"es-abstract": "1.12.0"
}
},
"asap": {
"version": "2.0.6",
"resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz",
@ -169,6 +183,11 @@
"tweetnacl": "0.14.5"
}
},
"bindings": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/bindings/-/bindings-1.3.0.tgz",
"integrity": "sha512-DpLh5EzMR2kzvX1KIlVC0VkC3iZtHKTgdtZ0a3pglBZdaQFjt5S9g9xd1lE+YvXyfd6mtCeRnrUfOLYiTMlNSw=="
},
"bitfinex-api-node": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/bitfinex-api-node/-/bitfinex-api-node-1.2.1.tgz",
@ -188,6 +207,15 @@
}
}
},
"bl": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/bl/-/bl-1.2.2.tgz",
"integrity": "sha512-e8tQYnZodmebYDWGH7KMRvtzKXaJHx3BbilrgZCfvyLUYdKpK1t5PSPmpkny/SgiTSCnjfLW7v5rlONXVFkQEA==",
"requires": {
"readable-stream": "2.3.6",
"safe-buffer": "5.1.2"
}
},
"bluebird": {
"version": "3.5.1",
"resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.1.tgz",
@ -208,6 +236,17 @@
"integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==",
"dev": true
},
"buffer-writer": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/buffer-writer/-/buffer-writer-1.0.1.tgz",
"integrity": "sha1-Iqk2kB4wKa/NdUfrRIfOtpejvwg="
},
"bufferjs": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/bufferjs/-/bufferjs-1.1.0.tgz",
"integrity": "sha1-CV/6OcXmtAoheKEWnJ7/xYSnMgE=",
"optional": true
},
"bytes": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz",
@ -399,6 +438,15 @@
"resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz",
"integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA=="
},
"define-properties": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.2.tgz",
"integrity": "sha1-g6c/L+pWmJj7c3GTyPhzyvbUXJQ=",
"requires": {
"foreach": "2.0.5",
"object-keys": "1.0.12"
}
},
"delayed-stream": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
@ -445,11 +493,68 @@
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
"integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0="
},
"emailjs": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/emailjs/-/emailjs-1.0.5.tgz",
"integrity": "sha1-nq7DZH6KwOXpwHw57/P3RgeNA+4=",
"requires": {
"addressparser": "0.3.2",
"bufferjs": "1.1.0",
"mimelib": "0.2.14",
"moment": "2.11.2",
"starttls": "1.0.1"
},
"dependencies": {
"moment": {
"version": "2.11.2",
"resolved": "https://registry.npmjs.org/moment/-/moment-2.11.2.tgz",
"integrity": "sha1-h5aOX5WsA4wuQqyVnHWBnNP1KQE="
}
}
},
"encoding": {
"version": "0.1.12",
"resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz",
"integrity": "sha1-U4tm8+5izRq1HsMjgp0flIDHS+s=",
"requires": {
"iconv-lite": "0.4.23"
}
},
"end-of-stream": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz",
"integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==",
"requires": {
"once": "1.4.0"
}
},
"error-inject": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/error-inject/-/error-inject-1.0.0.tgz",
"integrity": "sha1-4rPZG1Su1nLzCdlQ0VSFD6EdTzc="
},
"es-abstract": {
"version": "1.12.0",
"resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.12.0.tgz",
"integrity": "sha512-C8Fx/0jFmV5IPoMOFPA9P9G5NtqW+4cOPit3MIuvR2t7Ag2K15EJTpxnHAYTzL+aYQJIESYeXZmDBfOBE1HcpA==",
"requires": {
"es-to-primitive": "1.1.1",
"function-bind": "1.1.1",
"has": "1.0.3",
"is-callable": "1.1.4",
"is-regex": "1.0.4"
}
},
"es-to-primitive": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.1.1.tgz",
"integrity": "sha1-RTVSSKiJeQNLZ5Lhm7gfK3l13Q0=",
"requires": {
"is-callable": "1.1.4",
"is-date-object": "1.0.1",
"is-symbol": "1.0.1"
}
},
"escape-html": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
@ -465,6 +570,11 @@
"resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-2.2.2.tgz",
"integrity": "sha1-QH6nHCAgzVdTggOrfnpr3Pt2ktU="
},
"eventemitter3": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-3.1.0.tgz",
"integrity": "sha512-ivIvhpq/Y0uSjcHDcOIccjmYjGLcP09MFGE7ysAwkAvkXfpZlC985pH2/ui64DKazbTW/4kN3yqozUxlXzI6cA=="
},
"extend": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
@ -485,6 +595,11 @@
"resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz",
"integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I="
},
"file-type": {
"version": "3.9.0",
"resolved": "https://registry.npmjs.org/file-type/-/file-type-3.9.0.tgz",
"integrity": "sha1-JXoHg4TR24CHvESdEH1SpSZyuek="
},
"fill-keys": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/fill-keys/-/fill-keys-1.0.2.tgz",
@ -495,6 +610,11 @@
"merge-descriptors": "1.0.1"
}
},
"foreach": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz",
"integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k="
},
"forever-agent": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz",
@ -528,6 +648,11 @@
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="
},
"function-bind": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
"integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
},
"gauge": {
"version": "2.7.4",
"resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz",
@ -595,6 +720,14 @@
"har-schema": "2.0.0"
}
},
"has": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
"integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==",
"requires": {
"function-bind": "1.1.1"
}
},
"has-ansi": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz",
@ -723,6 +856,16 @@
"eventemitter2": "2.2.2"
}
},
"is-callable": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz",
"integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA=="
},
"is-date-object": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz",
"integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY="
},
"is-fullwidth-code-point": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz",
@ -737,6 +880,19 @@
"integrity": "sha1-iVJojF7C/9awPsyF52ngKQMINHA=",
"dev": true
},
"is-regex": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz",
"integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=",
"requires": {
"has": "1.0.3"
}
},
"is-symbol": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.1.tgz",
"integrity": "sha1-PMWfAAJRlLarLjjbrmaJJWtmBXI="
},
"is-typedarray": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz",
@ -937,6 +1093,11 @@
"resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz",
"integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4="
},
"mime": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
"integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg=="
},
"mime-db": {
"version": "1.35.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.35.0.tgz",
@ -950,6 +1111,27 @@
"mime-db": "1.35.0"
}
},
"mimelib": {
"version": "0.2.14",
"resolved": "https://registry.npmjs.org/mimelib/-/mimelib-0.2.14.tgz",
"integrity": "sha1-KhqnJL0ZC4W9Um5jF6thBu39aDE=",
"requires": {
"addressparser": "0.2.1",
"encoding": "0.1.12"
},
"dependencies": {
"addressparser": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/addressparser/-/addressparser-0.2.1.tgz",
"integrity": "sha1-0RpbLu2gTP7+vfMZbBCuE9ts1gc="
}
}
},
"minctest": {
"version": "0.0.2",
"resolved": "https://registry.npmjs.org/minctest/-/minctest-0.0.2.tgz",
"integrity": "sha1-mDOxA3vZWrkIYzrQ3Fkn0Ocq3tM="
},
"minimatch": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
@ -1114,6 +1296,34 @@
"tar": "4.4.6"
}
},
"node-telegram-bot-api": {
"version": "0.30.0",
"resolved": "https://registry.npmjs.org/node-telegram-bot-api/-/node-telegram-bot-api-0.30.0.tgz",
"integrity": "sha512-+EeM+fe3Xt81KIPqN3L6s6eK+FK4QaqyDcwCwkY/jqsleERXwwjGlVbf4lJCOZ0uJuF5PfqTmvVNtua7AZfBXg==",
"requires": {
"array.prototype.findindex": "2.0.2",
"bl": "1.2.2",
"bluebird": "3.5.1",
"debug": "3.1.0",
"depd": "1.1.2",
"eventemitter3": "3.1.0",
"file-type": "3.9.0",
"mime": "1.6.0",
"pump": "2.0.1",
"request": "2.87.0",
"request-promise": "4.2.2"
},
"dependencies": {
"debug": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
"integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
"requires": {
"ms": "2.0.0"
}
}
}
},
"nodegit-promise": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/nodegit-promise/-/nodegit-promise-4.0.0.tgz",
@ -1171,6 +1381,11 @@
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
"integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM="
},
"object-keys": {
"version": "1.0.12",
"resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.12.tgz",
"integrity": "sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag=="
},
"on-finished": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz",
@ -1220,6 +1435,11 @@
"os-tmpdir": "1.0.2"
}
},
"packet-reader": {
"version": "0.3.1",
"resolved": "https://registry.npmjs.org/packet-reader/-/packet-reader-0.3.1.tgz",
"integrity": "sha1-zWLmCvjX/qinBexP+ZCHHEaHHyc="
},
"parseurl": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz",
@ -1254,6 +1474,56 @@
"resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz",
"integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns="
},
"pg": {
"version": "7.4.3",
"resolved": "https://registry.npmjs.org/pg/-/pg-7.4.3.tgz",
"integrity": "sha1-97b5P1NA7MJZavu5ShPj1rYJg0s=",
"requires": {
"buffer-writer": "1.0.1",
"packet-reader": "0.3.1",
"pg-connection-string": "0.1.3",
"pg-pool": "2.0.3",
"pg-types": "1.12.1",
"pgpass": "1.0.2",
"semver": "4.3.2"
},
"dependencies": {
"semver": {
"version": "4.3.2",
"resolved": "https://registry.npmjs.org/semver/-/semver-4.3.2.tgz",
"integrity": "sha1-x6BxWKgL7dBSNVt3DYLWZA+AO+c="
}
}
},
"pg-connection-string": {
"version": "0.1.3",
"resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-0.1.3.tgz",
"integrity": "sha1-2hhHsglA5C7hSSvq9l1J2RskXfc="
},
"pg-pool": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-2.0.3.tgz",
"integrity": "sha1-wCIDLIlJ8xKk+R+2QJzgQHa+Mlc="
},
"pg-types": {
"version": "1.12.1",
"resolved": "https://registry.npmjs.org/pg-types/-/pg-types-1.12.1.tgz",
"integrity": "sha1-1kCH45A7WP+q0nnnWVxSIIoUw9I=",
"requires": {
"postgres-array": "1.0.2",
"postgres-bytea": "1.0.0",
"postgres-date": "1.0.3",
"postgres-interval": "1.1.2"
}
},
"pgpass": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.2.tgz",
"integrity": "sha1-Knu0G2BltnkH6R2hsHwYR8h3swY=",
"requires": {
"split": "1.0.1"
}
},
"pinkie": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz",
@ -1267,6 +1537,29 @@
"pinkie": "2.0.4"
}
},
"postgres-array": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-1.0.2.tgz",
"integrity": "sha1-jgsy6wO/d6XAp4UeBEHBaaJWojg="
},
"postgres-bytea": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.0.tgz",
"integrity": "sha1-AntTPAqokOJtFy1Hz5zOzFIazTU="
},
"postgres-date": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.3.tgz",
"integrity": "sha1-4tiXAu/bJY/52c7g/pG9BpdSV6g="
},
"postgres-interval": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.1.2.tgz",
"integrity": "sha512-fC3xNHeTskCxL1dC8KOtxXt7YeFmlbTYtn7ul8MkVERuTmf7pI4DrkAxcw3kh1fQ9uz4wQmd03a1mRiXUZChfQ==",
"requires": {
"xtend": "4.0.1"
}
},
"process-nextick-args": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz",
@ -1310,6 +1603,15 @@
"resolve": "1.1.7"
}
},
"pump": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz",
"integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==",
"requires": {
"end-of-stream": "1.4.1",
"once": "1.4.0"
}
},
"punycode": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz",
@ -1370,6 +1672,27 @@
"mute-stream": "0.0.7"
}
},
"readable-stream": {
"version": "2.3.6",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
"integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
"requires": {
"core-util-is": "1.0.2",
"inherits": "2.0.3",
"isarray": "1.0.0",
"process-nextick-args": "2.0.0",
"safe-buffer": "5.1.2",
"string_decoder": "1.1.1",
"util-deprecate": "1.0.2"
},
"dependencies": {
"isarray": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
}
}
},
"relieve": {
"version": "2.2.3",
"resolved": "https://registry.npmjs.org/relieve/-/relieve-2.2.3.tgz",
@ -1555,6 +1878,14 @@
}
}
},
"split": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/split/-/split-1.0.1.tgz",
"integrity": "sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==",
"requires": {
"through": "2.3.8"
}
},
"sqlite3": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/sqlite3/-/sqlite3-4.0.2.tgz",
@ -1581,6 +1912,11 @@
"tweetnacl": "0.14.5"
}
},
"starttls": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/starttls/-/starttls-1.0.1.tgz",
"integrity": "sha1-5ggcJd5rF49adfjyccFIdEkYO0I="
},
"stats-lite": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/stats-lite/-/stats-lite-2.1.1.tgz",
@ -1609,6 +1945,14 @@
"strip-ansi": "3.0.1"
}
},
"string_decoder": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
"requires": {
"safe-buffer": "5.1.2"
}
},
"strip-ansi": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
@ -1627,6 +1971,14 @@
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
"integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc="
},
"talib": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/talib/-/talib-1.0.5.tgz",
"integrity": "sha512-lR/6bwDugRG9iqTu4rM/jGKG2SL5qTvVnQzlhM4/Sns4jIJ+IDhoD9K7fuvpjgdY13b5yAAtixKLcQCNoqrvCw==",
"requires": {
"nan": "2.10.0"
}
},
"tar": {
"version": "4.4.6",
"resolved": "https://registry.npmjs.org/tar/-/tar-4.4.6.tgz",
@ -1663,6 +2015,11 @@
"thenify": "3.3.0"
}
},
"through": {
"version": "2.3.8",
"resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz",
"integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU="
},
"thunkify": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/thunkify/-/thunkify-0.0.1.tgz",
@ -1691,6 +2048,17 @@
"punycode": "1.4.1"
}
},
"tulind": {
"version": "0.8.11",
"resolved": "https://registry.npmjs.org/tulind/-/tulind-0.8.11.tgz",
"integrity": "sha512-JJj6RzG5TSAoa+x3hzVu8TfSm2jcfWXBdj3fCJ349pSMrU4Fa8HHdHpBp6x5/m9GhG/jt3rc3GytWUhPvhXifw==",
"requires": {
"bindings": "1.3.0",
"minctest": "0.0.2",
"nan": "2.10.0",
"node-pre-gyp": "0.10.3"
}
},
"tunnel-agent": {
"version": "0.6.0",
"resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz",
@ -1778,6 +2146,11 @@
"ultron": "1.1.1"
}
},
"xtend": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz",
"integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68="
},
"yallist": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.2.tgz",

+ 7
- 2
package.json View File

@ -19,6 +19,7 @@
"bitfinex-api-node": "^1.2.1",
"co-fs": "^1.2.0",
"commander": "^2.13.0",
"emailjs": "^1.0.5",
"gekko": "0.0.9",
"humanize-duration": "^3.10.0",
"koa": "^1.2.0",
@ -28,8 +29,10 @@
"koa-router": "^5.4.0",
"koa-static": "^2.0.0",
"lodash": "2.x",
"moment": "^2.20.1",
"moment": "^2.22.2",
"node-telegram-bot-api": "^0.30.0",
"opn": "^4.0.2",
"pg": "^7.4.3",
"promisify-node": "^0.5.0",
"prompt-lite": "0.1.1",
"relieve": "^2.1.3",
@ -37,8 +40,10 @@
"semver": "5.4.1",
"sqlite3": "^4.0.0",
"stats-lite": "^2.0.4",
"talib": "^1.0.5",
"tiny-promisify": "^0.1.1",
"toml": "^2.3.0"
"toml": "^2.3.0",
"tulind": "^0.8.11"
},
"devDependencies": {
"chai": "^4.1.2",

+ 5
- 3
plugins/mailer.js View File

@ -120,7 +120,7 @@ Mailer.prototype.processAdvice = function(advice) {
Mailer.prototype.processTradeInitiated = function(trade) {
/*
var text = [
'Gekko is watching ',
config.watch.exchange,
@ -133,9 +133,11 @@ Mailer.prototype.processTradeInitiated = function(trade) {
' ',
this.price,
'\n\nTrade initiated (UTC): ',
trade.date.format('YYYY-MM-DD HH:mm:ss')
trade.date.format('YYYY-MM-DD H:-mm:ss')
].join('');
*/
var text = JSON.stringify(trade);
console.log(text);
var subject = 'New trade advice: ' + trade.action.toUpperCase();
this.mail(subject, text);

+ 17
- 7
plugins/telegrambot.js View File

@ -95,7 +95,10 @@ if(emitTrades) {
var message = 'Trade initiated. ID: ' + tradeInitiated.id +
'\nAction: ' + tradeInitiated.action + '\nPortfolio: ' +
tradeInitiated.portfolio + '\nBalance: ' + tradeInitiated.balance;
this.bot.sendMessage(this.chatId, message);
this.subscribers.forEach(function(chatId) {
this.bot.sendMessage(chatId, message);
}, this);
}
Actor.prototype.processTradeCancelled = function (tradeCancelled) {
@ -106,13 +109,19 @@ if(emitTrades) {
Actor.prototype.processTradeAborted = function (tradeAborted) {
var message = 'Trade aborted. ID: ' + tradeAborted.id +
'\nNot creating order! Reason: ' + tradeAborted.reason;
this.bot.sendMessage(this.chatId, message);
this.subscribers.forEach(function(chatId) {
this.bot.sendMessage(chatId, message);
}, this);
}
Actor.prototype.processTradeErrored = function (tradeErrored) {
var message = 'Trade errored. ID: ' + tradeErrored.id +
'\nReason: ' + tradeErrored.reason;
this.bot.sendMessage(this.chatId, message);
this.subscribers.forEach(function(chatId) {
this.bot.sendMessage(chatId, message);
}, this);
}
Actor.prototype.processTradeCompleted = function (tradeCompleted) {
@ -120,12 +129,13 @@ if(emitTrades) {
'\nAction: ' + tradeCompleted.action +
'\nPrice: ' + tradeCompleted.price +
'\nAmount: ' + tradeCompleted.amount +
'\nCost: ' + tradeCompleted.cost +
'\nPortfolio: ' + tradeCompleted.portfolio +
'\nBalance: ' + tradeCompleted.balance +
'\nFee percent: ' + tradeCompleted.feePercent +
'\nEffective price: ' + tradeCompleted.effectivePrice;
this.bot.sendMessage(this.chatId, message);
this.subscribers.forEach(function(chatId) {
this.bot.sendMessage(chatId, message);
}, this);
}
}
@ -239,7 +249,7 @@ Actor.prototype.emitAdvice = function(chatId) {
message += 'None'
}
this.bot.sendMessage(chatId, message, this.keyboard);
this.bot.sendMessage(chatId, message);
};

Loading…
Cancel
Save