Compare commits
No files matched your search
@@ -1,7 +1,7 @@
|
||||
|
||||
#PORT NUMBERS: If any of these ports are already in use by a different app, please pick a new number between 1 and 50000.
|
||||
WEB_SERVER_PORT=34247
|
||||
WEB_SOCKETS_SERVER_PORT=8080
|
||||
WEB_SERVER_PORT=34248
|
||||
WEB_SOCKETS_SERVER_PORT=18041
|
||||
|
||||
|
||||
# TASK MANAGER VARIABLES:
|
||||
@@ -10,17 +10,13 @@ TASK_SERVER_PATH=./TaskServer
|
||||
|
||||
# TASK SERVER VARIABLES:
|
||||
|
||||
INTER_PROCESS_FILES_PATH=./Inter-Process-Files
|
||||
STORAGE_PATH=./Data-Storage
|
||||
PLOTTERS_PATH=./Legacy-Code
|
||||
DATA_MINES_PATH=./Data-Mines
|
||||
TRADING_SYSTEMS_PATH=./Trading-Systems
|
||||
SUPER_SCRIPTS_PATH=./Super-Scripts
|
||||
|
||||
USE_KEYVAULT=false
|
||||
WRITE_LOGS_TO_FILES=true
|
||||
BOTS_PATH=./Legacy-Code
|
||||
LOG_PATH=./Log-Files
|
||||
WEB_SERVER_URL=localhost
|
||||
|
||||
# WEB SERVER VARIABLES:
|
||||
|
||||
@@ -29,16 +25,11 @@ CONSOLE_LOG=false
|
||||
CONSOLE_ERROR_LOG=true
|
||||
LOG_FILE_CONTENT=false
|
||||
|
||||
# Server commands
|
||||
REINITIALIZE_COMMAND=sdnacGYGdw756dnxasxbGGGjsdbd5576576gfdsxgvbnFFF
|
||||
|
||||
PROJECTS_PATH=./Integrations/Projects
|
||||
PATH_TO_CANVAS_APP=./CanvasApp
|
||||
PATH_TO_FILES_COMPONENT=./Files-Component/src
|
||||
PATH_TO_WEB_SERVER=./WebServer/
|
||||
|
||||
APP_SCHEMA_PATH=./
|
||||
WORKSPACE_PATH=./
|
||||
|
||||
GATEWAY_ENDPOINT=https://demo-api-dev.superalgos.org/graphql
|
||||
|
||||
PATH_TO_WEB_SERVER=./BackendServers/
|
||||
|
||||
DEFAULT_WORKSPACE_PATH=./Integrations/Projects/Superalgos/Plugins/Workspaces
|
||||
MY_WORKSPACES_PATH=./My-Workspaces
|
||||
PATH_TO_FONTS=./BackendServers/WebServer/Fonts
|
||||
@@ -0,0 +1,66 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
## Before you open an issue
|
||||
|
||||
There are two requirements to open an issue:
|
||||
|
||||
1. You must first follow the [Troubleshooting Guide](https://docs.superalgos.org/suite-how-to-troubleshoot-an-issue.html)
|
||||
|
||||
2. If your issue hasn't been resolved by following the Troubleshooting Guide, then follow the guide on [How to Report an Issue](https://docs.superalgos.org/suite-how-to-report-an-issue.html).
|
||||
|
||||
## Context
|
||||
|
||||
*Complete and adjust the contents leaving the information that fits your case and deleting the information that doesn't.*
|
||||
|
||||
**Operating System:** Windows | MacOs | Linux | Other (include the version on either case)
|
||||
|
||||
**Software version:** today's master branch | today's develop branch
|
||||
|
||||
**Workspace version:** default Workspace.json (Getting Started Guide) | Simple Workspace.json | Workspace - Binance - WHB - BBTB.json | My custom workspace
|
||||
|
||||
**Reproducible:** the issue may | may not be reproduced.
|
||||
|
||||
## Explain your issue
|
||||
|
||||
### 1. Explain what the problem seems to be.
|
||||
|
||||
Type your explanation here.
|
||||
|
||||
### 2. Clearly explain what you wish to accomplish.
|
||||
|
||||
Type your explanation here.
|
||||
|
||||
### 3. Explain, step by step, what you've done to achieve the goal. The Team will follow these steps to reproduce the issue, so be precise.
|
||||
|
||||
Type your explanation here.
|
||||
|
||||
### 4. Explain what is the result you expect from your actions.
|
||||
|
||||
Type your explanation here.
|
||||
|
||||
### 5. Explain what happens instead of the expected results.
|
||||
|
||||
Type your explanation here.
|
||||
|
||||
### 6. Explain what errors you have found on-screen, on the browser console application, or in the ```Log-Files``` folder.
|
||||
|
||||
Type your explanation here.
|
||||
|
||||
## Attach a video reproducing the issue
|
||||
|
||||
Attach video here.
|
||||
|
||||
## Attach relevant log files and error screenshots
|
||||
|
||||
Attach logs here.
|
||||
|
||||
## Attach you custom workspace if any
|
||||
|
||||
Attach custom workspace here.
|
||||
@@ -0,0 +1,20 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
||||
@@ -1,2 +1,3 @@
|
||||
Data-Storage
|
||||
Log-Files
|
||||
Log-Files
|
||||
My-Workspaces
|
||||
@@ -8,5 +8,6 @@ WRITE_LOGS_TO_FILES=true
|
||||
BOTS_PATH=../Legacy-Code
|
||||
LOG_PATH=../Log-Files
|
||||
|
||||
WEB_SOCKETS_SERVER_PORT=8080
|
||||
|
||||
WEB_SOCKETS_SERVER_PORT=18041
|
||||
WEB_SERVER_PORT=34248
|
||||
WEB_SERVER_URL=localhost
|
||||
|
After Width: | Height: | Size: 5.3 MiB |
|
After Width: | Height: | Size: 11 MiB |
|
After Width: | Height: | Size: 987 KiB |
|
After Width: | Height: | Size: 945 KiB |
|
After Width: | Height: | Size: 18 MiB |
|
After Width: | Height: | Size: 10 MiB |
|
After Width: | Height: | Size: 13 MiB |
|
After Width: | Height: | Size: 16 MiB |
|
After Width: | Height: | Size: 38 MiB |
|
After Width: | Height: | Size: 25 MiB |
|
After Width: | Height: | Size: 21 MiB |
|
After Width: | Height: | Size: 762 KiB |
|
After Width: | Height: | Size: 726 KiB |
|
After Width: | Height: | Size: 361 KiB |
|
After Width: | Height: | Size: 644 KiB |
|
After Width: | Height: | Size: 317 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 5.4 KiB |
|
After Width: | Height: | Size: 5.2 KiB |
|
After Width: | Height: | Size: 247 KiB |
|
After Width: | Height: | Size: 5.4 KiB |
|
After Width: | Height: | Size: 1.1 MiB |
@@ -0,0 +1,11 @@
|
||||
function getNewPlotterPanel(pDataMineOrHost, pPlotter, pModule, pPanel) {
|
||||
let functionName = pDataMineOrHost + pPlotter + pModule + pPanel;
|
||||
functionName = functionName.replace(/-/g, "");
|
||||
functionName = 'new' + functionName
|
||||
try {
|
||||
return window[functionName]();
|
||||
} catch (err) {
|
||||
console.log('[ERROR] getNewPlotterPanel -> Error trying to Load a Plotter Panel. err = ' + err.stack)
|
||||
console.log('[ERROR] getNewPlotterPanel -> functionName = ' + functionName)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Web3=t():e.Web3=t()}(window,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=171)}([function(e,t,r){"use strict";e.exports=function(e){return e&&e.__esModule?e:{default:e}}},function(e,t,r){"use strict";function n(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=n=function(e){return typeof e}:e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(t)}e.exports=n},function(e,t,r){"use strict";(function(e){
|
||||
/*!
|
||||
* The buffer module from node.js, for the browser.
|
||||
*
|
||||
* @author Feross Aboukhadijeh <http://feross.org>
|
||||
* @license MIT
|
||||
*/
|
||||
var n=r(178),i=r(179),o=r(90);function a(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(a()<t)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=u.prototype:(null===e&&(e=new u(t)),e.length=t),e}function u(e,t,r){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(e,t,r);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return h(this,e)}return f(this,e,t,r)}function f(e,t,r,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");t=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n);u.TYPED_ARRAY_SUPPORT?(e=t).__proto__=u.prototype:e=d(e,t);return e}(e,t,r,n):"string"==typeof t?function(e,t,r){"string"==typeof r&&""!==r||(r="utf8");if(!u.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|p(t,r),i=(e=s(e,n)).write(t,r);i!==n&&(e=e.slice(0,i));return e}(e,t,r):function(e,t){if(u.isBuffer(t)){var r=0|l(t.length);return 0===(e=s(e,r)).length||t.copy(e,0,0,r),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(n=t.length)!=n?s(e,0):d(e,t);if("Buffer"===t.type&&o(t.data))return d(e,t.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function h(e,t){if(c(t),e=s(e,t<0?0:0|l(t)),!u.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function d(e,t){var r=t.length<0?0:0|l(t.length);e=s(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function l(e){if(e>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function p(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return D(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return q(e).length;default:if(n)return D(e).length;t=(""+t).toLowerCase(),n=!0}}function b(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return O(this,t,r);case"utf8":case"utf-8":return x(this,t,r);case"ascii":return M(this,t,r);case"latin1":case"binary":return I(this,t,r);case"base64":return E(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function m(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function y(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:v(e,t,r,n,i);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):v(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(e,t,r,n,i){var o,a=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,r/=2}function f(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var c=-1;for(o=r;o<s;o++)if(f(e,o)===f(t,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===u)return c*a}else-1!==c&&(o-=o-c),c=-1}else for(r+u>s&&(r=s-u),o=r;o>=0;o--){for(var h=!0,d=0;d<u;d++)if(f(e,o+d)!==f(t,d)){h=!1;break}if(h)return o}return-1}function g(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a<n;++a){var s=parseInt(t.substr(2*a,2),16);if(isNaN(s))return a;e[r+a]=s}return a}function w(e,t,r,n){return z(D(t,e.length-r),e,r,n)}function _(e,t,r,n){return z(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function k(e,t,r,n){return _(e,t,r,n)}function A(e,t,r,n){return z(q(t),eLine truncated
|
||||
/*
|
||||
object-assign
|
||||
(c) Sindre Sorhus
|
||||
@license MIT
|
||||
*/var n=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;function a(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var r,s,u=a(e),f=1;f<arguments.length;f++){for(var c in r=Object(arguments[f]))i.call(r,c)&&(u[c]=r[c]);if(n){s=n(r);for(var h=0;h<s.length;h++)o.call(r,s[h])&&(u[s[h]]=r[s[h]])}}return u}},function(e,t,r){"use strict";var n=r(445);e.exports=Function.prototype.bind||n},function(e,t,r){"use strict";var n=r(0)(r(1)),i=Function.prototype.toString,o=/^\s*class\b/,a=function(e){try{var t=i.call(e);return o.test(t)}catch(e){return!1}},s=Object.prototype.toString,u="function"==typeof Symbol&&"symbol"===(0,n.default)(Symbol.toStringTag);e.exports=function(e){if(!e)return!1;if("function"!=typeof e&&"object"!==(0,n.default)(e))return!1;if("function"==typeof e&&!e.prototype)return!0;if(u)return function(e){try{return!a(e)&&(i.call(e),!0)}catch(e){return!1}}(e);if(a(e))return!1;var t=s.call(e);return"[object Function]"===t||"[object GeneratorFunction]"===t}},function(e,t,r){"use strict";(function(e){var n=r(0)(r(1)),i=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n<t.length;n++)r[t[n]]=Object.getOwnPropertyDescriptor(e,t[n]);return r},o=/%[sdj%]/g;t.format=function(e){if(!v(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(u(arguments[r]));return t.join(" ")}r=1;for(var n=arguments,i=n.length,a=String(e).replace(o,(function(e){if("%%"===e)return"%";if(r>=i)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}})),s=n[r];r<i;s=n[++r])m(s)||!_(s)?a+=" "+s:a+=" "+u(s);return a},t.deprecate=function(r,n){if(void 0!==e&&!0===e.noDeprecation)return r;if(void 0===e)return function(){return t.deprecate(r,n).apply(this,arguments)};var i=!1;return function(){if(!i){if(e.throwDeprecation)throw new Error(n);e.traceDeprecation?console.trace(n):console.error(n),i=!0}return r.apply(this,arguments)}};var a,s={};function u(e,r){var n={seen:[],stylize:c};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),b(r)?n.showHidden=r:r&&t._extend(n,r),g(n.showHidden)&&(n.showHidden=!1),g(n.depth)&&(n.depth=2),g(n.colors)&&(n.colors=!1),g(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=f),h(n,e,n.depth)}function f(e,t){var r=u.styles[t];return r?"["+u.colors[r][0]+"m"+e+"["+u.colors[r][1]+"m":e}function c(e,t){return e}function h(e,r,n){if(e.customInspect&&r&&S(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,e);return v(i)||(i=h(e,i,n)),i}var o=function(e,t){if(g(t))return e.stylize("undefined","undefined");if(v(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(y(t))return e.stylize(""+t,"number");if(b(t))return e.stylize(""+t,"boolean");if(m(t))return e.stylize("null","null")}(e,r);if(o)return o;var a=Object.keys(r),s=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(r)),A(r)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return d(r);if(0===a.length){if(S(r)){var u=r.name?": "+r.name:"";return e.stylize("[Function"+u+"]","special")}if(w(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(k(r))return e.stylize(Date.prototype.toString.call(r),"date");if(A(r))return d(r)}var f,c="",_=!1,E=["{","}"];(p(r)&&(_=!0,E=["[","]"]),S(r))&&(c=" [Function"+(r.name?": "+r.name:"")+"]");return w(r)&&(c=" "+RegExp.prototype.toString.call(r)),k(r)&&(c=" "+Date.prototype.toUTCString.call(r)),A(r)&&(c=" "+d(r)),0!==a.length||_&&0!=r.length?n<0?w(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),f=_?function(e,t,r,n,i){for(var o=[],a=0,s=t.length;a<s;++a)O(t,String(a))?o.push(l(e,t,r,n,String(a),!0)):o.push("");return i.forEach((function(i){i.match(/^\d+$/)||o.push(l(e,t,r,n,i,!0))})),o}(e,r,n,s,a):a.map((function(t){return l(e,r,n,s,t,_)})),e.seen.pop(),function(e,t,r){if(e.reduce((function(e,t){return t.indexOf("\n")>=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(f,c,E)):E[0]+c+E[1]}function d(e){return"["+Error.prototype.toString.call(e)+"]"}function l(e,t,r,n,i,Line truncated
|
||||
/*! https://mths.be/utf8js v3.0.0 by @mathias */!function(e){var t,r,n,i=String.fromCharCode;function o(e){for(var t,r,n=[],i=0,o=e.length;i<o;)(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<o?56320==(64512&(r=e.charCodeAt(i++)))?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),i--):n.push(t);return n}function a(e){if(e>=55296&&e<=57343)throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value")}function s(e,t){return i(e>>t&63|128)}function u(e){if(0==(4294967168&e))return i(e);var t="";return 0==(4294965248&e)?t=i(e>>6&31|192):0==(4294901760&e)?(a(e),t=i(e>>12&15|224),t+=s(e,6)):0==(4292870144&e)&&(t=i(e>>18&7|240),t+=s(e,12),t+=s(e,6)),t+=i(63&e|128)}function f(){if(n>=r)throw Error("Invalid byte index");var e=255&t[n];if(n++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function c(){var e,i;if(n>r)throw Error("Invalid byte index");if(n==r)return!1;if(e=255&t[n],n++,0==(128&e))return e;if(192==(224&e)){if((i=(31&e)<<6|f())>=128)return i;throw Error("Invalid continuation byte")}if(224==(240&e)){if((i=(15&e)<<12|f()<<6|f())>=2048)return a(i),i;throw Error("Invalid continuation byte")}if(240==(248&e)&&(i=(7&e)<<18|f()<<12|f()<<6|f())>=65536&&i<=1114111)return i;throw Error("Invalid UTF-8 detected")}e.version="3.0.0",e.encode=function(e){for(var t=o(e),r=t.length,n=-1,i="";++n<r;)i+=u(t[n]);return i},e.decode=function(e){t=o(e),r=t.length,n=0;for(var a,s=[];!1!==(a=c());)s.push(a);return function(e){for(var t,r=e.length,n=-1,o="";++n<r;)(t=e[n])>65535&&(o+=i((t-=65536)>>>10&1023|55296),t=56320|1023&t),o+=i(t);return o}(s)}}(t)},function(e,t,r){"use strict";var n=r(0)(r(1));Object.defineProperty(t,"__esModule",{value:!0});var i=r(186);function o(e){return"string"==typeof e&&(!!/^(0x)?[0-9a-f]{512}$/i.test(e)&&!(!/^(0x)?[0-9a-f]{512}$/.test(e)&&!/^(0x)?[0-9A-F]{512}$/.test(e)))}function a(e,t){"object"===(0,n.default)(t)&&t.constructor===Uint8Array&&(t=i.bytesToHex(t));for(var r=i.keccak256(t).replace("0x",""),o=0;o<12;o+=4){var a=(parseInt(r.substr(o,2),16)<<8)+parseInt(r.substr(o+2,2),16)&2047,u=1<<a%4;if((s(e.charCodeAt(e.length-1-Math.floor(a/4)))&u)!==u)return!1}return!0}function s(e){if(e>=48&&e<=57)return e-48;if(e>=65&&e<=70)return e-55;if(e>=97&&e<=102)return e-87;throw new Error("invalid bloom")}function u(e){return"string"==typeof e&&(!!/^(0x)?[0-9a-f]{64}$/i.test(e)&&!(!/^(0x)?[0-9a-f]{64}$/.test(e)&&!/^(0x)?[0-9A-F]{64}$/.test(e)))}function f(e){return"string"==typeof e&&(!!e.match(/^(0x)?[0-9a-fA-F]{40}$/)||!!e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/))}t.isBloom=o,t.isInBloom=a,t.isUserEthereumAddressInBloom=function(e,t){if(!o(e))throw new Error("Invalid bloom given");if(!f(t))throw new Error('Invalid ethereum address given: "'.concat(t,'"'));return a(e,i.padLeft(t,64))},t.isContractAddressInBloom=function(e,t){if(!o(e))throw new Error("Invalid bloom given");if(!f(t))throw new Error('Invalid contract address given: "'.concat(t,'"'));return a(e,t)},t.isTopicInBloom=function(e,t){if(!o(e))throw new Error("Invalid bloom given");if(!u(t))throw new Error("Invalid topic");return a(e,t)},t.isTopic=u,t.isAddress=f},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(187);function i(e){if(null==e)throw new Error("cannot convert null value to array");if("string"==typeof e){var t=e.match(/^(0x)?[0-9a-fA-F]*$/);if(!t)throw new Error("invalid hexidecimal string");if("0x"!==t[1])throw new Error("hex string must have 0x prefix");(e=e.substring(2)).length%2&&(e="0"+e);for(var r=[],n=0;n<e.length;n+=2)r.push(parseInt(e.substr(n,2),16));return o(new Uint8Array(r))}if(function(e){if(!e||parseInt(String(e.length))!=e.length||"string"==typeof e)return!1;for(var t=0;t<e.length;t++){var r=e[t];if(r<0||r>=256||parseInt(String(r))!=r)return!1}return!0}(e))return o(new Uint8Array(e));throw new Error("invalid arrayify value")}function o(e){return e.slice||(e.slice=function(){var t=Array.prototype.slice.call(arguments);return o(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}t.keccak256=function(e){return"0x"+n.keccak_256(i(e))},t.padLeft=function(e,t){var r=/^0x/i.test(e)||"number"==typeof e,n=t-(e=e.toString().replace(/^0x/i,"")).length+1>=0?t-e.length+1:0;return(r?"0x":"")+new Array(n).join("0")+e},t.bytesToHex=function(e){for(var t=[],r=0;r<e.length;r++)t.push((e[r]>>>4).toString(16)),t.push((15&e[r]).toString(16));return"0x".concat(t.join("").replace(/^0+/,""))},t.toByteArray=i},function(e,t,r){"use strict";(function(e,n,i){var o,a=r(0)(r(1));
|
||||
/**
|
||||
* [js-sha3]{@link https://github.com/emn178/js-sha3}
|
||||
*
|
||||
* @version 0.8.0
|
||||
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
||||
* @copyright Chen, Yi-Cyuan 2015-2018
|
||||
* @license MIT
|
||||
*/
|
||||
!function(){var s="input is invalid type",u="object"===("undefined"==typeof window?"undefined":(0,a.default)(window)),f=u?window:{};f.JS_SHA3_NO_WINDOW&&(u=!1);var c=!u&&"object"===("undefined"==typeof self?"undefined":(0,a.default)(self));!f.JS_SHA3_NO_NODE_JS&&"object"===(void 0===e?"undefined":(0,a.default)(e))&&e.versions&&e.versions.node?f=n:c&&(f=self);var h=!f.JS_SHA3_NO_COMMON_JS&&"object"===(0,a.default)(i)&&i.exports,d=r(62),l=!f.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,p="0123456789abcdef".split(""),b=[4,1024,262144,67108864],m=[0,8,16,24],y=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],v=[224,256,384,512],g=[128,256],w=["hex","buffer","arrayBuffer","array","digest"],_={128:168,256:136};!f.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!l||!f.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"===(0,a.default)(e)&&e.buffer&&e.buffer.constructor===ArrayBuffer});for(var k=function(e,t,r){return function(n){return new j(e,t,e).update(n)[r]()}},A=function(e,t,r){return function(n,i){return new j(e,t,i).update(n)[r]()}},S=function(e,t,r){return function(t,n,i,o){return O["cshake"+e].update(t,n,i,o)[r]()}},E=function(e,t,r){return function(t,n,i,o){return O["kmac"+e].update(t,n,i,o)[r]()}},x=function(e,t,r,n){for(var i=0;i<w.length;++i){var o=w[i];e[o]=t(r,n,o)}return e},M=function(e,t){var r=k(e,t,"hex");return r.create=function(){return new j(e,t,e)},r.update=function(e){return r.create().update(e)},x(r,k,e,t)},I=[{name:"keccak",padding:[1,256,65536,16777216],bits:v,createMethod:M},{name:"sha3",padding:[6,1536,393216,100663296],bits:v,createMethod:M},{name:"shake",padding:[31,7936,2031616,520093696],bits:g,createMethod:function(e,t){var r=A(e,t,"hex");return r.create=function(r){return new j(e,t,r)},r.update=function(e,t){return r.create(t).update(e)},x(r,A,e,t)}},{name:"cshake",padding:b,bits:g,createMethod:function(e,t){var r=_[e],n=S(e,0,"hex");return n.create=function(n,i,o){return i||o?new j(e,t,n).bytepad([i,o],r):O["shake"+e].create(n)},n.update=function(e,t,r,i){return n.create(t,r,i).update(e)},x(n,S,e,t)}},{name:"kmac",padding:b,bits:g,createMethod:function(e,t){var r=_[e],n=E(e,0,"hex");return n.create=function(n,i,o){return new L(e,t,i).bytepad(["KMAC",o],r).bytepad([n],r)},n.update=function(e,t,r,i){return n.create(e,r,i).update(t)},x(n,E,e,t)}}],O={},C=[],P=0;P<I.length;++P)for(var T=I[P],U=T.bits,B=0;B<U.length;++B){var R=T.name+"_"+U[B];if(C.push(R),O[R]=T.createMethod(U[B],T.padding),"sha3"!==T.name){var N=T.name+U[B];C.push(N),O[N]=O[R]}}function j(e,t,r){this.blocks=[],this.s=[],this.padding=t,this.outputBits=r,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(e<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}function L(e,t,r){j.call(this,e,t,r)}j.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var t,r=(0,a.default)(e);if("string"!==r){if("object"!==r)throw new Error(s);if(null===e)throw new Error(s);if(l&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||l&&ArrayBuffer.isView(e)))throw new Error(s);t=!0}for(var n,i,o=this.blocks,u=this.byteCount,f=e.length,c=this.blockCount,h=0,d=this.s;h<f;){if(this.reset)for(this.reset=!1,o[0]=this.block,n=1;n<c+1;++n)o[n]=0;if(t)for(n=this.start;h<f&&n<u;++h)o[n>>2]|=e[h]<<m[3&n++];else for(n=this.start;h<f&&n<u;++h)(i=e.charCodeAt(h))<128?o[n>>2]|=i<<m[3&n++]:i<2048?(o[n>>2]|=(192|i>>6)<<m[3&n++],o[n>>2]|=(128|63&i)<<m[3&n++]):i<55296||i>=57344?(o[n>>2]|=(224|i>>12)<<m[3&n++],o[n>>2]|=(128|i>>6&63)<<m[3&n++],o[n>>2]|=(128|63&i)<<m[3&n++]):(i=65536+((1023&i)<<10|1023&e.charCodeAt(++h)),o[n>>2]|=(240|i>>18)<<m[3&n++],o[n>>2]|=(128|i>>12&63)<<m[3&n++],o[n>>2]|=(128|i>>6&63)<<m[3&n++],o[n>>2]|=(128|63&i)<<m[3&n++]);if(this.lastByteIndex=n,n>=u){for(this.start=n-u,this.block=o[c],n=0;n<c;++n)d[n]^=o[n];F(d),this.reset=!0}else this.start=n}return this},j.prototype.encode=function(e,t){var r=255&e,n=1,i=[r];for(r=255&(e>>=8);r>0;)i.unshift(r),r=255&(e>>=8),++n;return t?i.push(n):i.unshift(n),this.update(i),i.length},j.prototype.encodeString=function(e){var t,r=(0,a.default)(e);if("string"!==r){if("object"!==r)throw new Error(s);if(null===e)throw new Error(s);if(l&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||l&&ArrayBuffer.isView(e)))throw new Error(s);t=!0}var n=0,i=e.length;if(t)n=i;else for(var o=0;o<e.length;++o){var u=e.charCodeAt(o);u<128?n+=1:u<2048?n+=2:u<55296||u>=57344?n+=3:(u=65536+((1023&u)<<10|1023&Line truncated
|
||||
/*!
|
||||
* v2.1.4-104-gc868b3a
|
||||
*
|
||||
*/
|
||||
a=function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=7)}([function(e,t,r){r.d(t,"j",(function(){return i})),r.d(t,"d",(function(){return o})),r.d(t,"c",(function(){return a})),r.d(t,"h",(function(){return s})),r.d(t,"b",(function(){return u})),r.d(t,"k",(function(){return f})),r.d(t,"e",(function(){return c})),r.d(t,"g",(function(){return h})),r.d(t,"i",(function(){return d})),r.d(t,"a",(function(){return l})),r.d(t,"f",(function(){return p}));var n=r(1),i=f((function(e,t){var r=t.length;return f((function(n){for(var i=0;i<n.length;i++)t[r+i]=n[i];return t.length=r+n.length,e.apply(this,t)}))}));function o(e,t){return function(){return e.call(this,t.apply(this,arguments))}}function a(e){return function(t){return t[e]}}f((function(e){var t=Object(n.c)(e);function r(e,t){return[u(e,t)]}return f((function(e){return Object(n.f)(r,e,t)[0]}))}));var s=f((function(e){return f((function(t){for(var r,n=0;n<a("length")(e);n++)if(r=u(t,e[n]))return r}))}));function u(e,t){return t.apply(void 0,e)}function f(e){var t=e.length-1,r=Array.prototype.slice;if(0===t)return function(){return e.call(this,r.call(arguments))};if(1===t)return function(){return e.call(this,arguments[0],r.call(arguments,1))};var n=Array(e.length);return function(){for(var i=0;i<t;i++)n[i]=arguments[i];return n[t]=r.call(arguments,t),e.apply(this,n)}}function c(e){return function(t,r){return e(r,t)}}function h(e,t){return function(r){return e(r)&&t(r)}}function d(){}function l(){return!0}function p(e){return function(){return e}}},function(e,t,r){r.d(t,"d",(function(){return i})),r.d(t,"g",(function(){return o})),r.d(t,"l",(function(){return a})),r.d(t,"c",(function(){return s})),r.d(t,"h",(function(){return u})),r.d(t,"i",(function(){return f})),r.d(t,"j",(function(){return c})),r.d(t,"f",(function(){return h})),r.d(t,"m",(function(){return d})),r.d(t,"a",(function(){return l})),r.d(t,"b",(function(){return p})),r.d(t,"k",(function(){return b})),r.d(t,"e",(function(){return m}));var n=r(0);function i(e,t){return[e,t]}var o=Object(n.c)(0),a=Object(n.c)(1);function s(e){return b(e.reduce(Object(n.e)(i),null))}var u=Object(n.k)(s);function f(e){return h((function(e,t){return e.unshift(t),e}),[],e)}function c(e,t){return t?i(e(o(t)),c(e,a(t))):null}function h(e,t,r){return r?e(h(e,t,a(r)),o(r)):t}function d(e,t,r){return function e(r,n){return r?t(o(r))?(n(o(r)),a(r)):i(o(r),e(a(r),n)):null}(e,r||n.i)}function l(e,t){return!t||e(o(t))&&l(e,a(t))}function p(e,t){e&&(o(e).apply(null,t),p(a(e),t))}function b(e){return function e(t,r){return t?e(a(t),i(o(t),r)):r}(e,null)}function m(e,t){return t&&(e(o(t))?o(t):m(e,a(t)))}},function(e,t,r){r.d(t,"c",(function(){return o})),r.d(t,"e",(function(){return a})),r.d(t,"d",(function(){return s})),r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return f}));var n=r(1),i=r(0);function o(e,t){return t&&t.constructor===e}var a=Object(i.c)("length"),s=Object(i.j)(o,String);function u(e){return void 0!==e}function f(e,t){return t instanceof Object&&Object(n.a)((function(e){return e in t}),e)}},function(e,t,r){r.d(t,"f",(function(){return i})),r.d(t,"d",(function(){return o})),r.d(t,"g",(function(){return a})),r.d(t,"e",(function(){return s})),r.d(t,"b",(function(){return u})),r.d(t,"h",(function(){return f})),r.d(t,"i",(function(){return c})),r.d(t,"c",(function(){return h})),r.d(t,"m",(function(){return d})),r.d(t,"n",(function(){return l})),r.d(t,"a",(function(){return p})),r.d(t,"j",(function(){return b})),r.d(t,"l",(function(){return m})),r.d(t,"k",(function(){return y})),r.d(t,"o",(function(){return v}));var n=1,i=n++,o=n++,a=n++,s=n++,u="fail",f=n++,c=n++,h="start",d="data",l="end",p=n++,b=n++,m=n++,y=n++;function v(e,t,r){try{var n=JSON.parse(t)}catch(e){}return{statusCode:e,body:t,jsonBody:n,thrown:r}}},function(e,t,r){r.d(t,"b",(function(){return i})),r.d(t,"a",(function(){return o})),r.d(t,"c",(function(){return a}));var n=r(0);function i(e,t){return{key:e,node:t}}var o=Object(n.c)("key"),a=Object(n.c)("node")},function(e,t,r){r.d(t,"a",(function(){return u}));var n=r(1),i=r(0),o=r(2),a=r(8),s=r(9);function u(e){var t=Object(n.h)("resume","pause","pipe"),r=Object(i.j)(o.b,t);return e?r(e)||Object(o.d)(e)?Object(a.a)(s.a,e):Object(a.a)(s.a,e.url,e.method,e.body,e.headers,e.withCredentials,e.cached):Object(s.a)()}u.drop=function(){return u.drop}},function(e,t,r){r.d(t,"b",(function(){return u})),r.d(t,"a",(function(){return s}));var n=r(3),i=r(4),o=r(2),a=r(1),s={};function u(e){var t=e(n.f).emit,r=e(n.d).emit,u=e(n.i).emit,f=e(n.h).emit;function c(e,t,r){Object(i.c)(Object(a.g)Line truncated
|
||||
/**
|
||||
* [js-sha3]{@link https://github.com/emn178/js-sha3}
|
||||
*
|
||||
* @version 0.5.7
|
||||
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
||||
* @copyright Chen, Yi-Cyuan 2015-2016
|
||||
* @license MIT
|
||||
*/
|
||||
!function(){var r="object"===("undefined"==typeof window?"undefined":(0,i.default)(window))?window:{};!r.JS_SHA3_NO_NODE_JS&&"object"===(void 0===e?"undefined":(0,i.default)(e))&&e.versions&&e.versions.node&&(r=t);for(var o=!r.JS_SHA3_NO_COMMON_JS&&"object"===(0,i.default)(n)&&n.exports,a="0123456789abcdef".split(""),s=[0,8,16,24],u=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],f=[224,256,384,512],c=["hex","buffer","arrayBuffer","array"],h=function(e,t,r){return function(n){return new k(e,t,e).update(n)[r]()}},d=function(e,t,r){return function(n,i){return new k(e,t,i).update(n)[r]()}},l=function(e,t){var r=h(e,t,"hex");r.create=function(){return new k(e,t,e)},r.update=function(e){return r.create().update(e)};for(var n=0;n<c.length;++n){var i=c[n];r[i]=h(e,t,i)}return r},p=[{name:"keccak",padding:[1,256,65536,16777216],bits:f,createMethod:l},{name:"sha3",padding:[6,1536,393216,100663296],bits:f,createMethod:l},{name:"shake",padding:[31,7936,2031616,520093696],bits:[128,256],createMethod:function(e,t){var r=d(e,t,"hex");r.create=function(r){return new k(e,t,r)},r.update=function(e,t){return r.create(t).update(e)};for(var n=0;n<c.length;++n){var i=c[n];r[i]=d(e,t,i)}return r}}],b={},m=[],y=0;y<p.length;++y)for(var v=p[y],g=v.bits,w=0;w<g.length;++w){var _=v.name+"_"+g[w];m.push(_),b[_]=v.createMethod(g[w],v.padding)}function k(e,t,r){this.blocks=[],this.s=[],this.padding=t,this.outputBits=r,this.reset=!0,this.block=0,this.start=0,this.blockCount=1600-(e<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}k.prototype.update=function(e){var t="string"!=typeof e;t&&e.constructor===ArrayBuffer&&(e=new Uint8Array(e));for(var r,n,i=e.length,o=this.blocks,a=this.byteCount,u=this.blockCount,f=0,c=this.s;f<i;){if(this.reset)for(this.reset=!1,o[0]=this.block,r=1;r<u+1;++r)o[r]=0;if(t)for(r=this.start;f<i&&r<a;++f)o[r>>2]|=e[f]<<s[3&r++];else for(r=this.start;f<i&&r<a;++f)(n=e.charCodeAt(f))<128?o[r>>2]|=n<<s[3&r++]:n<2048?(o[r>>2]|=(192|n>>6)<<s[3&r++],o[r>>2]|=(128|63&n)<<s[3&r++]):n<55296||n>=57344?(o[r>>2]|=(224|n>>12)<<s[3&r++],o[r>>2]|=(128|n>>6&63)<<s[3&r++],o[r>>2]|=(128|63&n)<<s[3&r++]):(n=65536+((1023&n)<<10|1023&e.charCodeAt(++f)),o[r>>2]|=(240|n>>18)<<s[3&r++],o[r>>2]|=(128|n>>12&63)<<s[3&r++],o[r>>2]|=(128|n>>6&63)<<s[3&r++],o[r>>2]|=(128|63&n)<<s[3&r++]);if(this.lastByteIndex=r,r>=a){for(this.start=r-a,this.block=o[u],r=0;r<u;++r)c[r]^=o[r];A(c),this.reset=!0}else this.start=r}return this},k.prototype.finalize=function(){var e=this.blocks,t=this.lastByteIndex,r=this.blockCount,n=this.s;if(e[t>>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[r],t=1;t<r+1;++t)e[t]=0;for(e[r-1]|=2147483648,t=0;t<r;++t)n[t]^=e[t];A(n)},k.prototype.toString=k.prototype.hex=function(){this.finalize();for(var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,u="";s<n;){for(o=0;o<t&&s<n;++o,++s)e=r[o],u+=a[e>>4&15]+a[15&e]+a[e>>12&15]+a[e>>8&15]+a[e>>20&15]+a[e>>16&15]+a[e>>28&15]+a[e>>24&15];s%t==0&&(A(r),o=0)}return i&&(e=r[o],i>0&&(u+=a[e>>4&15]+a[15&e]),i>1&&(u+=a[e>>12&15]+a[e>>8&15]),i>2&&(u+=a[e>>20&15]+a[e>>16&15])),u},k.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,a=0,s=this.outputBits>>3;e=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(s);for(var u=new Uint32Array(e);a<n;){for(o=0;o<t&&a<n;++o,++a)u[a]=r[o];a%t==0&&A(r)}return i&&(u[o]=r[o],e=e.slice(0,s)),e},k.prototype.buffer=k.prototype.arrayBuffer,k.prototype.digest=k.prototype.array=function(){this.finalize();for(var e,t,r=this.blockCount,n=this.s,i=this.outputBlocks,o=this.extraBytes,a=0,s=0,u=[];s<i;){for(a=0;a<r&&s<i;++a,++s)e=s<<2,t=n[a],u[e]=255&t,u[e+1]=t>>8&255,u[e+2]=t>>16&255,u[e+3]=t>>24&255;s%r==0&&A(n)}return o&&(e=s<<2,t=n[a],o>0&&(u[e]=255&t),o>1&&(u[e+1]=t>>8&255),o>2&&(u[e+2]=t>>16&255)),u};var A=function(e){var t,r,n,i,o,a,s,f,c,h,d,l,p,b,m,y,v,g,w,_,k,A,S,E,x,M,I,O,C,P,T,U,B,R,N,j,L,F,D,q,z,H,K,V,G,W,Y,$,J,Z,X,Q,ee,te,re,ne,ie,oe,ae,se,ue,fe,ce;for(n=0;n<48;n+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],a=e[2]^e[12]^e[22]^e[32]^e[42],s=e[3]^e[13]^e[23]^e[33]^e[43],f=e[4]^e[14]^e[24]^e[34]^e[44],c=e[5]^e[15]^e[25]^e[35]^e[45],h=e[6]^e[16]^e[26]^e[36]^e[46],d=e[7]^e[17]^e[27]^e[37]^e[47],t=(l=e[8]^e[18]^e[28]^e[38]^e[48])^(a<<1|s>>>31),r=(p=e[9]^e[19]^e[29]^e[39]^e[49])^(s<<1|a>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=i^(f<<1|c>>>31),r=o^(c<<1|f>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=a^(h<<1|d>>>31),r=s^(d<<1|h>>>31),e[4]^=t,e[5]^=rLine truncated
|
||||
/**
|
||||
* [js-sha3]{@link https://github.com/emn178/js-sha3}
|
||||
*
|
||||
* @version 0.5.7
|
||||
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
||||
* @copyright Chen, Yi-Cyuan 2015-2016
|
||||
* @license MIT
|
||||
*/
|
||||
!function(){var r="object"===("undefined"==typeof window?"undefined":(0,i.default)(window))?window:{};!r.JS_SHA3_NO_NODE_JS&&"object"===(void 0===e?"undefined":(0,i.default)(e))&&e.versions&&e.versions.node&&(r=t);for(var o=!r.JS_SHA3_NO_COMMON_JS&&"object"===(0,i.default)(n)&&n.exports,a="0123456789abcdef".split(""),s=[0,8,16,24],u=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],f=[224,256,384,512],c=["hex","buffer","arrayBuffer","array"],h=function(e,t,r){return function(n){return new k(e,t,e).update(n)[r]()}},d=function(e,t,r){return function(n,i){return new k(e,t,i).update(n)[r]()}},l=function(e,t){var r=h(e,t,"hex");r.create=function(){return new k(e,t,e)},r.update=function(e){return r.create().update(e)};for(var n=0;n<c.length;++n){var i=c[n];r[i]=h(e,t,i)}return r},p=[{name:"keccak",padding:[1,256,65536,16777216],bits:f,createMethod:l},{name:"sha3",padding:[6,1536,393216,100663296],bits:f,createMethod:l},{name:"shake",padding:[31,7936,2031616,520093696],bits:[128,256],createMethod:function(e,t){var r=d(e,t,"hex");r.create=function(r){return new k(e,t,r)},r.update=function(e,t){return r.create(t).update(e)};for(var n=0;n<c.length;++n){var i=c[n];r[i]=d(e,t,i)}return r}}],b={},m=[],y=0;y<p.length;++y)for(var v=p[y],g=v.bits,w=0;w<g.length;++w){var _=v.name+"_"+g[w];m.push(_),b[_]=v.createMethod(g[w],v.padding)}function k(e,t,r){this.blocks=[],this.s=[],this.padding=t,this.outputBits=r,this.reset=!0,this.block=0,this.start=0,this.blockCount=1600-(e<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}k.prototype.update=function(e){var t="string"!=typeof e;t&&e.constructor===ArrayBuffer&&(e=new Uint8Array(e));for(var r,n,i=e.length,o=this.blocks,a=this.byteCount,u=this.blockCount,f=0,c=this.s;f<i;){if(this.reset)for(this.reset=!1,o[0]=this.block,r=1;r<u+1;++r)o[r]=0;if(t)for(r=this.start;f<i&&r<a;++f)o[r>>2]|=e[f]<<s[3&r++];else for(r=this.start;f<i&&r<a;++f)(n=e.charCodeAt(f))<128?o[r>>2]|=n<<s[3&r++]:n<2048?(o[r>>2]|=(192|n>>6)<<s[3&r++],o[r>>2]|=(128|63&n)<<s[3&r++]):n<55296||n>=57344?(o[r>>2]|=(224|n>>12)<<s[3&r++],o[r>>2]|=(128|n>>6&63)<<s[3&r++],o[r>>2]|=(128|63&n)<<s[3&r++]):(n=65536+((1023&n)<<10|1023&e.charCodeAt(++f)),o[r>>2]|=(240|n>>18)<<s[3&r++],o[r>>2]|=(128|n>>12&63)<<s[3&r++],o[r>>2]|=(128|n>>6&63)<<s[3&r++],o[r>>2]|=(128|63&n)<<s[3&r++]);if(this.lastByteIndex=r,r>=a){for(this.start=r-a,this.block=o[u],r=0;r<u;++r)c[r]^=o[r];A(c),this.reset=!0}else this.start=r}return this},k.prototype.finalize=function(){var e=this.blocks,t=this.lastByteIndex,r=this.blockCount,n=this.s;if(e[t>>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[r],t=1;t<r+1;++t)e[t]=0;for(e[r-1]|=2147483648,t=0;t<r;++t)n[t]^=e[t];A(n)},k.prototype.toString=k.prototype.hex=function(){this.finalize();for(var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,u="";s<n;){for(o=0;o<t&&s<n;++o,++s)e=r[o],u+=a[e>>4&15]+a[15&e]+a[e>>12&15]+a[e>>8&15]+a[e>>20&15]+a[e>>16&15]+a[e>>28&15]+a[e>>24&15];s%t==0&&(A(r),o=0)}return i&&(e=r[o],i>0&&(u+=a[e>>4&15]+a[15&e]),i>1&&(u+=a[e>>12&15]+a[e>>8&15]),i>2&&(u+=a[e>>20&15]+a[e>>16&15])),u},k.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,a=0,s=this.outputBits>>3;e=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(s);for(var u=new Uint32Array(e);a<n;){for(o=0;o<t&&a<n;++o,++a)u[a]=r[o];a%t==0&&A(r)}return i&&(u[o]=r[o],e=e.slice(0,s)),e},k.prototype.buffer=k.prototype.arrayBuffer,k.prototype.digest=k.prototype.array=function(){this.finalize();for(var e,t,r=this.blockCount,n=this.s,i=this.outputBlocks,o=this.extraBytes,a=0,s=0,u=[];s<i;){for(a=0;a<r&&s<i;++a,++s)e=s<<2,t=n[a],u[e]=255&t,u[e+1]=t>>8&255,u[e+2]=t>>16&255,u[e+3]=t>>24&255;s%r==0&&A(n)}return o&&(e=s<<2,t=n[a],o>0&&(u[e]=255&t),o>1&&(u[e+1]=t>>8&255),o>2&&(u[e+2]=t>>16&255)),u};var A=function(e){var t,r,n,i,o,a,s,f,c,h,d,l,p,b,m,y,v,g,w,_,k,A,S,E,x,M,I,O,C,P,T,U,B,R,N,j,L,F,D,q,z,H,K,V,G,W,Y,$,J,Z,X,Q,ee,te,re,ne,ie,oe,ae,se,ue,fe,ce;for(n=0;n<48;n+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],a=e[2]^e[12]^e[22]^e[32]^e[42],s=e[3]^e[13]^e[23]^e[33]^e[43],f=e[4]^e[14]^e[24]^e[34]^e[44],c=e[5]^e[15]^e[25]^e[35]^e[45],h=e[6]^e[16]^e[26]^e[36]^e[46],d=e[7]^e[17]^e[27]^e[37]^e[47],t=(l=e[8]^e[18]^e[28]^e[38]^e[48])^(a<<1|s>>>31),r=(p=e[9]^e[19]^e[29]^e[39]^e[49])^(s<<1|a>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=i^(f<<1|c>>>31),r=o^(c<<1|f>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=a^(h<<1|d>>>31),r=s^(d<<1|h>>>31),e[4]^=t,e[5]^=rLine truncated
|
||||
/*!
|
||||
* The buffer module from node.js, for the browser.
|
||||
*
|
||||
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
||||
* @license MIT
|
||||
*/
|
||||
function o(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0}function a(e){return t.Buffer&&"function"==typeof t.Buffer.isBuffer?t.Buffer.isBuffer(e):!(null==e||!e._isBuffer)}var s=r(88),u=Object.prototype.hasOwnProperty,f=Array.prototype.slice,c="foo"===function(){}.name;function h(e){return Object.prototype.toString.call(e)}function d(e){return!a(e)&&("function"==typeof t.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):!!e&&(e instanceof DataView||!!(e.buffer&&e.buffer instanceof ArrayBuffer))))}var l=e.exports=g,p=/\s*function\s+([^\(\s]*)\s*/;function b(e){if(s.isFunction(e)){if(c)return e.name;var t=e.toString().match(p);return t&&t[1]}}function m(e,t){return"string"==typeof e?e.length<t?e:e.slice(0,t):e}function y(e){if(c||!s.isFunction(e))return s.inspect(e);var t=b(e);return"[Function"+(t?": "+t:"")+"]"}function v(e,t,r,n,i){throw new l.AssertionError({message:r,actual:e,expected:t,operator:n,stackStartFunction:i})}function g(e,t){e||v(e,!0,t,"==",l.ok)}function w(e,t,r,i){if(e===t)return!0;if(a(e)&&a(t))return 0===o(e,t);if(s.isDate(e)&&s.isDate(t))return e.getTime()===t.getTime();if(s.isRegExp(e)&&s.isRegExp(t))return e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase;if(null!==e&&"object"===(0,n.default)(e)||null!==t&&"object"===(0,n.default)(t)){if(d(e)&&d(t)&&h(e)===h(t)&&!(e instanceof Float32Array||e instanceof Float64Array))return 0===o(new Uint8Array(e.buffer),new Uint8Array(t.buffer));if(a(e)!==a(t))return!1;var u=(i=i||{actual:[],expected:[]}).actual.indexOf(e);return-1!==u&&u===i.expected.indexOf(t)||(i.actual.push(e),i.expected.push(t),function(e,t,r,n){if(null==e||null==t)return!1;if(s.isPrimitive(e)||s.isPrimitive(t))return e===t;if(r&&Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;var i=_(e),o=_(t);if(i&&!o||!i&&o)return!1;if(i)return e=f.call(e),t=f.call(t),w(e,t,r);var a,u,c=S(e),h=S(t);if(c.length!==h.length)return!1;for(c.sort(),h.sort(),u=c.length-1;u>=0;u--)if(c[u]!==h[u])return!1;for(u=c.length-1;u>=0;u--)if(a=c[u],!w(e[a],t[a],r,n))return!1;return!0}(e,t,r,i))}return r?e===t:e==t}function _(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function k(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function A(e,t,r,n){var i;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),i=function(e){var t;try{e()}catch(e){t=e}return t}(t),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),e&&!i&&v(i,r,"Missing expected exception"+n);var o="string"==typeof n,a=!e&&i&&!r;if((!e&&s.isError(i)&&o&&k(i,r)||a)&&v(i,r,"Got unwanted exception"+n),e&&i&&r&&!k(i,r)||!e&&i)throw i}l.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=function(e){return m(y(e.actual),128)+" "+e.operator+" "+m(y(e.expected),128)}(this),this.generatedMessage=!0);var t=e.stackStartFunction||v;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var r=new Error;if(r.stack){var n=r.stack,i=b(t),o=n.indexOf("\n"+i);if(o>=0){var a=n.indexOf("\n",o+1);n=n.substring(a+1)}this.stack=n}}},s.inherits(l.AssertionError,Error),l.fail=v,l.ok=g,l.equal=function(e,t,r){e!=t&&v(e,t,r,"==",l.equal)},l.notEqual=function(e,t,r){e==t&&v(e,t,r,"!=",l.notEqual)},l.deepEqual=function(e,t,r){w(e,t,!1)||v(e,t,r,"deepEqual",l.deepEqual)},l.deepStrictEqual=function(e,t,r){w(e,t,!0)||v(e,t,r,"deepStrictEqual",l.deepStrictEqual)},l.notDeepEqual=function(e,t,r){w(e,t,!1)&&v(e,t,r,"notDeepEqual",l.notDeepEqual)},l.notDeepStrictEqual=function e(t,r,n){w(t,r,!0)&&v(t,r,n,"notDeepStrictEqual",e)},l.strictEqual=function(e,t,r){e!==t&&v(e,t,r,"===",l.strictEqual)},l.notStrictEqual=function(e,t,r){e===t&&v(e,t,r,"!==",l.notStrictEqual)},l.throws=function(e,t,r){A(!0,e,t,r)},l.doesNotThrow=function(e,t,r){A(!1,e,t,r)},l.ifError=function(e){if(e)throw e},l.strict=i((function e(t,r){t||v(t,!0,r,"==",e)}),l,{equal:l.strictEqual,deepEqual:l.deepStrictEqual,notEqual:l.notStrictEqual,notDeepEqual:l.notDeepStrictEqual}),l.strict.strict=l.strict;var S=Object.keys||function(e){var t=[];for(var r in e)u.call(e,r)&&t.push(r);return t}}).call(this,r(8))},function(e,t,r){"use strict";(function(t){var n=r(0)(r(1)),i=r(91),o=r(60);function a(e){var t=e;if("string"!=typeof t)throw new Error("[ethjs-util] while padding to even, value must be string, is currently "+(0,n.default)(t)+", while padToEven.");return t.length%2&&(t="0"+t),t}function s(e){return"0x"+e.toString(16)}e.exports={arrayContainsArray:function(e,t,r){if(!0!==Array.isArray(e))throw new Error("[ethjs-util] method arrayContainsArray requirLine truncated
|
||||
//# sourceMappingURL=web3.min.js.map
|
||||
@@ -0,0 +1,4 @@
|
||||
/*!
|
||||
* Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome
|
||||
* License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)
|
||||
*/@font-face{font-family:'FontAwesome';src:url('../Fonts/fontawesome-webfont.eot?v=4.7.0');src:url('../Fonts/fontawesome-webfont.eot?#iefix&v=4.7.0') format('embedded-opentype'),url('../Fonts/fontawesome-webfont.woff2?v=4.7.0') format('woff2'),url('../Fonts/fontawesome-webfont.woff?v=4.7.0') format('woff'),url('../Fonts/fontawesome-webfont.ttf?v=4.7.0') format('truetype'),url('../Fonts/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular') format('svg');font-weight:normal;font-style:normal}.fa{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.33333333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571429em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14285714em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14285714em;width:2.14285714em;top:.14285714em;text-align:center}.fa-li.fa-lg{left:-1.85714286em}.fa-border{padding:.2em .25em .15em;border:solid .08em #eee;border-radius:.1em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left{margin-right:.3em}.fa.fa-pull-right{margin-left:.3em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left{margin-right:.3em}.fa.pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}.fa-pulse{-webkit-animation:fa-spin 1s infinite steps(8);animation:fa-spin 1s infinite steps(8)}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";-webkit-transform:scale(-1, 1);-ms-transform:scale(-1, 1);transform:scale(-1, 1)}.fa-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";-webkit-transform:scale(1, -1);-ms-transform:scale(1, -1);transform:scale(1, -1)}:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-flip-horizontal,:root .fa-flip-vertical{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:"\f000"}.fa-music:before{content:"\f001"}.fa-search:before{content:"\f002"}.fa-envelope-o:before{content:"\f003"}.fa-heart:before{content:"\f004"}.fa-star:before{content:"\f005"}.fa-star-o:before{content:"\f006"}.fa-user:before{content:"\f007"}.fa-film:before{content:"\f008"}.fa-th-large:before{content:"\f009"}.fa-th:before{content:"\f00a"}.fa-th-list:before{content:"\f00b"}.fa-check:before{content:"\f00c"}.fa-remove:before,.fa-close:before,.fa-times:before{content:"\f00d"}.fa-search-plus:before{content:"\f00e"}.fa-search-minus:before{content:"\f010"}.fa-power-off:before{content:"\f011"}.fa-signal:before{content:"\f012"}.fa-gear:before,.fa-cog:before{content:"\f013"}.fa-trash-o:before{content:"\f014"}.fa-home:before{content:"\f015"}.fa-file-o:before{content:"\f016"}.fa-clock-o:before{content:"\f017"}.fa-road:before{content:"\f018"}.fa-download:before{content:"\f019"}.fa-arrow-circle-o-down:before{content:"\f01a"}.fa-arrow-circle-o-up:before{content:"\f01b"}.fa-inbox:before{content:"\f01c"}.fa-play-circle-o:before{content:"\f01d"}.fa-rotate-right:before,.fa-repeat:before{content:"\f01e"}.fa-refresh:before{content:"\f021"}.fa-list-alt:before{content:"\f022"}.fa-lock:before{content:"\f023"}.fa-flag:before{content:"\f024"}.fa-headphones:before{content:"\f025"}.fa-volume-off:before{content:"\f026"}.fa-volume-down:before{content:"\f027"}.fa-volume-up:before{content:"\f028"}.fa-qrcode:before{content:"\f029"}.fa-barcode:before{content:"\f02a"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-book:before{content:"\f02d"}.fa-bookmark:before{content:"\f02e"}.fa-print:before{content:"\f02f"}.fa-camera:before{content:"\f030"}.fa-font:before{content:"\f031"}.fa-bold:before{content:"\f032"}.fa-italic:before{content:"\f033"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f03Line truncated
|
||||
@@ -0,0 +1,99 @@
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Superalgos</title>
|
||||
<meta name="description" content="Free and Open Source Crypto Trading Tools">
|
||||
<link rel="stylesheet" href="main.css" type="text/css" charset="utf-8" />
|
||||
<link rel="stylesheet" href="font-awasome.css" type="text/css" />
|
||||
<link rel="shortcut icon" type="image/png/ico" href="Images/favicon.ico" />
|
||||
<script type="text/javascript" src="WebServer/require.js"></script>
|
||||
<script type="text/javascript" src="AppPreLoader.js"></script>
|
||||
<script src="externalScripts/CCapture.all.min.js"></script>
|
||||
<script src="externalScripts/web3.min.js"></script>
|
||||
|
||||
<!-- Documentation Style Sheets -->
|
||||
<!-- -->
|
||||
|
||||
<script type="text/javascript">
|
||||
function loadCanvas() {
|
||||
// Prevent click-jacking
|
||||
try {
|
||||
if (window == window.top || window.chrome && chrome.app && chrome.app.window) {
|
||||
document.documentElement.style.display = 'block'
|
||||
} else {
|
||||
top.location = self.location
|
||||
}
|
||||
} catch (e) { console.error('CJ protection', e) }
|
||||
|
||||
try {
|
||||
loadSuperalgos();
|
||||
} catch (err) {
|
||||
console.log("[ERROR] CanvasApp can not be started. Please check that WebServer is running.", err);
|
||||
}
|
||||
}
|
||||
|
||||
function onResize() {
|
||||
try {
|
||||
if (canvas === undefined) { return }
|
||||
if (canvas.eventHandler === undefined) { return }
|
||||
if (DISABLE_BROWSER_RESIZE_EVENT === true) { return }
|
||||
canvas.eventHandler.raiseEvent('Browser Resized')
|
||||
} catch (err) {
|
||||
console.log('Error Resizing. ' + err.stack)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body id="body" onload="loadCanvas()"
|
||||
style="overflow:hidden; background: url(Images/superalgos-platform.jpg); background-size: cover;"
|
||||
onresize="onResize()">
|
||||
<div id="contributors" class="credits">
|
||||
<p>Superalgos is <span class="red">free</span> and <span class="red">open-source</span>, and is <span class="red">constantly improving</span> thanks to the involvement of contributors:</p>
|
||||
<p>Luis Fernando Molina, Julian Molina, Andreja Cobeljic, Matías Benitez, Ira Miller, Eduardo Remis,
|
||||
Jeff Braun, rico4dev, 9808us, Barry Low, Nikola Bjelogrlic, Hirajin Koizuko, Francisco J. Santillán, Viktoria B., Guillermo V., Daniel J.,
|
||||
Javier A., Gustavo J., Romina GS, Pedro P., Thais M., Andrey M., Loui M., Natalia M., Bashar A., Carlos V., Diego M.,
|
||||
Sebastian E., Bogdan P., Marko V., Igor S., Niksa K., Rodrigo M., Nicanor M., Alejandro P., Mateo H., Lan T., Leon A., Uroš R., Filip M., Vladimir J. and Pavle B.</p>
|
||||
<p><span class="red">You too can help grow and improve Superalgos. Become a contributor!</span></p>
|
||||
</div>
|
||||
<div id="masterApp"></div>
|
||||
<div id="canvasApp"></div>
|
||||
<div id="docApp" style="position:fixed; top:100000px; left:100000px">
|
||||
<iframe id="docIFrame" style="border:none; " height="2000" width="900"></iframe>
|
||||
</div>
|
||||
<div id="chatApp" style="position:fixed; top:100000px; left:100000px">
|
||||
<iframe id="chatIFrame" style="border:none; " height="2000" width="900"></iframe>
|
||||
</div>
|
||||
<div id="textAreaDiv"></div>
|
||||
<div id="inputDiv" style="font-family:saira condensed;"> </div>
|
||||
|
||||
<!-- Tutorial Template Divs -->
|
||||
<div id="tutorialDiv" class="tutorial-step" style="position:fixed; top:100000px; left:100000px;"></div>
|
||||
<div id="tutorialFormDiv" class="tutorial-form" style="position:fixed; top:100000px; left:100000px;">
|
||||
<form>
|
||||
<table class="tutorial-buttonsTable">
|
||||
<tr>
|
||||
<td align="center">
|
||||
<label class="tutorial-font-small tutorial-stop-button" onclick="UI.projects.superalgos.spaces.tutorialSpace.stop()"
|
||||
value=""> Stop </label>
|
||||
</td>
|
||||
<td align="center">
|
||||
<label class="tutorial-font-small tutorial-skip-button" onclick="UI.projects.superalgos.spaces.tutorialSpace.skip()"
|
||||
value=""> Skip </label>
|
||||
</td>
|
||||
<td align="center">
|
||||
<label class="tutorial-font-small tutorial-previous-button"
|
||||
onclick="UI.projects.superalgos.spaces.tutorialSpace.previous()" value="">Previous</label>
|
||||
</td>
|
||||
<td align="center">
|
||||
<label class="tutorial-font-small tutorial-next-button" onclick="UI.projects.superalgos.spaces.tutorialSpace.next()"
|
||||
value=""> Next </label>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,346 @@
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Saira';
|
||||
font-style: normal;
|
||||
font-weight: 300;
|
||||
src: local('Saira Light'), local('Saira-Light'), url(Fonts/Saira.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Saira Condensed';
|
||||
font-style: normal;
|
||||
font-weight: 300;
|
||||
src: local('Saira Condensed Light'), local('SairaCondensed-Light'), url(Fonts/Saira-Condensed.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: segoeui;
|
||||
src: url(Fonts/segoeui.woff) format('woff');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
.credits {
|
||||
width: 100%;
|
||||
margin: auto;
|
||||
margin-bottom: 50;
|
||||
text-align: center;
|
||||
position:absolute;
|
||||
bottom:0;
|
||||
}
|
||||
|
||||
.credits p {
|
||||
font-family: 'Saira Condensed';
|
||||
font-size: 140%;
|
||||
color: whitesmoke;
|
||||
padding: 0 100;
|
||||
}
|
||||
|
||||
.red {
|
||||
color: #e3493c;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.tutorial-step {
|
||||
padding: 15px;
|
||||
margin-bottom: 20px;
|
||||
border: 2px solid;
|
||||
border-color: #1b998b;
|
||||
border-radius: 8px;
|
||||
background-color: #fdfdfd;
|
||||
}
|
||||
|
||||
.tutorial-summary {
|
||||
font-size:120%;
|
||||
color: #808080;
|
||||
margin:20px 0px 20px 0px;
|
||||
border-left: 5px solid #fd6a33;
|
||||
padding-left: 10px;
|
||||
|
||||
}
|
||||
|
||||
.tutorial-summary:before {
|
||||
content: "Summary: ";
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.tutorial-definitionTable {
|
||||
background-color: #f3f3f3;
|
||||
border-top-color: #a6e1ec;
|
||||
padding: 15px;
|
||||
margin: 20px 0;
|
||||
border: solid 0px;
|
||||
vertical-align: middle;
|
||||
min-width: 100px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.tutorial-alert-info {
|
||||
color: #31708f;
|
||||
background-color: #d9edf7;
|
||||
border-color: #bce8f1;
|
||||
padding: 15px;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 4px;
|
||||
margin: 20px 0;
|
||||
border-top-color: #a6e1ec;
|
||||
width: 90%;
|
||||
}
|
||||
|
||||
.tutorial-alert-success {
|
||||
color: #3c763d;
|
||||
background-color: #dff0d8;
|
||||
border-color: #d6e9c6;
|
||||
padding: 15px;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 4px;
|
||||
margin: 20px 0;
|
||||
border-top-color: #c9e2b3;
|
||||
width: 90%;
|
||||
}
|
||||
|
||||
.tutorial-alert-important {
|
||||
color: #8a6d3b;
|
||||
background-color: #fcf8e3;
|
||||
border-color: #faebcc;
|
||||
padding: 15px;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 4px;
|
||||
margin: 20px 0;
|
||||
border-top-color: #f7e1b5;
|
||||
width: 90%;
|
||||
}
|
||||
|
||||
.tutorial-alert-warning {
|
||||
color: #a94442;
|
||||
background-color: #f2dede;
|
||||
border-color: #ebccd1;
|
||||
padding: 15px;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 4px;
|
||||
margin: 20px 0;
|
||||
border-top-color: #e4b9c0;
|
||||
width: 90%;
|
||||
}
|
||||
|
||||
.tutorial-callout {
|
||||
padding: 20px;
|
||||
margin: 20px 0;
|
||||
border: 1px solid #eee;
|
||||
border-left-width: 5px;
|
||||
border-radius: 3px;
|
||||
border-left-color: #bcd643;
|
||||
font-weight: 500;
|
||||
width: 90%;
|
||||
}
|
||||
|
||||
.tutorial-info-circle:before {
|
||||
content:"\f05a"
|
||||
}
|
||||
|
||||
.tutorial-check-square-o:before {
|
||||
content:"\f046"
|
||||
}
|
||||
|
||||
.tutorial-exclamation-circle:before {
|
||||
content:"\f06a"
|
||||
}
|
||||
|
||||
.tutorial-warning:before,.fa-exclamation-triangle:before {
|
||||
content:"\f06a"
|
||||
}
|
||||
|
||||
.tutorial-fa {
|
||||
|
||||
font:normal normal normal 14px/1 FontAwesome;
|
||||
font-size:inherit;
|
||||
text-rendering:auto;
|
||||
-webkit-font-smoothing:antialiased;
|
||||
-moz-osx-font-smoothing:grayscale
|
||||
}
|
||||
|
||||
.tutorial-font-small {
|
||||
|
||||
font:normal normal normal 14px/1 "segoeui";
|
||||
font-size:inherit;
|
||||
text-rendering:auto;
|
||||
-webkit-font-smoothing:antialiased;
|
||||
-moz-osx-font-smoothing:grayscale;
|
||||
line-height: 150%
|
||||
}
|
||||
|
||||
li > .tutorial-font-small {
|
||||
margin-bottom:7px;
|
||||
}
|
||||
|
||||
div.tutorial-font-small {
|
||||
margin-bottom:7px;
|
||||
}
|
||||
|
||||
.tutorial-font-medium {
|
||||
|
||||
font:normal normal normal 32px/1 "segoeui";
|
||||
text-rendering:auto;
|
||||
-webkit-font-smoothing:antialiased;
|
||||
-moz-osx-font-smoothing:grayscale;
|
||||
line-height: 150%
|
||||
}
|
||||
|
||||
.tutorial-font-large {
|
||||
|
||||
font:bold normal normal 40px/1 "segoeui";
|
||||
text-rendering:auto;
|
||||
-webkit-font-smoothing:antialiased;
|
||||
-moz-osx-font-smoothing:grayscale;
|
||||
line-height: 150%
|
||||
}
|
||||
|
||||
.tutorial-font-bold-small {
|
||||
|
||||
font:bold normal normal 14px/1 "segoeui";
|
||||
font-size:inherit;
|
||||
text-rendering:auto;
|
||||
-webkit-font-smoothing:antialiased;
|
||||
-moz-osx-font-smoothing:grayscale;
|
||||
line-height: 150%
|
||||
}
|
||||
|
||||
.tutorial-stop-button {
|
||||
color: #a94442;
|
||||
background-color: #f2dede;
|
||||
border-color: #ebccd1;
|
||||
padding: 12px;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 4px;
|
||||
margin: 20px 0;
|
||||
border-top-color: #e4b9c0;
|
||||
min-width: 100px;
|
||||
}
|
||||
|
||||
.tutorial-skip-button {
|
||||
color: #8a6d3b;
|
||||
background-color: #fcf8e3;
|
||||
border-color: #faebcc;
|
||||
padding: 12px;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 4px;
|
||||
margin: 20px 0;
|
||||
border-top-color: #f7e1b5;
|
||||
min-width: 100px;
|
||||
}
|
||||
|
||||
.tutorial-previous-button {
|
||||
color: #31708f;
|
||||
background-color: #d9edf7;
|
||||
border-color: #bce8f1;
|
||||
padding: 12px;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 4px;
|
||||
margin: 20px 0;
|
||||
border-top-color: #c9e2b3;
|
||||
min-width: 100px;
|
||||
}
|
||||
|
||||
.tutorial-next-button {
|
||||
color: #3c763d;
|
||||
background-color: #dff0d8;
|
||||
border-color: #d6e9c6;
|
||||
padding: 12px;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 4px;
|
||||
margin: 20px 0;
|
||||
border-top-color: #c9e2b3;
|
||||
min-width: 100px;
|
||||
}
|
||||
|
||||
.tutorial-form {
|
||||
padding: 5px;
|
||||
border: solid 0px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
margin-bottom: 20px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.tutorial-buttonsTable {
|
||||
border-top-color: #a6e1ec;
|
||||
border: solid 0px;
|
||||
vertical-align: middle;
|
||||
min-width: 100px;
|
||||
width: 95%;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.tutorial-image-container {
|
||||
padding: 5px 15px 5px 5px;
|
||||
border: solid 0px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* Tooltip container */
|
||||
.tooltip {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
border-bottom: 1px dotted black; /* If you want dots under the hoverable text */
|
||||
}
|
||||
|
||||
/* Tooltip text */
|
||||
.tooltip .tooltiptext {
|
||||
visibility: hidden;
|
||||
width: 240px;
|
||||
background-color: #0295aa;
|
||||
color: #fff;
|
||||
font-weight: normal;
|
||||
font-size: 92%;
|
||||
line-height: 130%;
|
||||
text-align: center;
|
||||
padding: 15px;
|
||||
border-radius: 6px;
|
||||
|
||||
/* Position the tooltip text */
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
bottom: 125%;
|
||||
left: 50%;
|
||||
margin-left: -120px;
|
||||
|
||||
|
||||
/* Fade in tooltip */
|
||||
opacity: 0;
|
||||
transition: opacity 0.3s;
|
||||
}
|
||||
|
||||
/* Tooltip arrow */
|
||||
.tooltip .tooltiptext::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
left: 50%;
|
||||
margin-left: -5px;
|
||||
border-width: 5px;
|
||||
border-style: solid;
|
||||
border-color: #0295aa transparent transparent transparent;
|
||||
}
|
||||
|
||||
/* Show the tooltip text when you mouse over the tooltip container */
|
||||
.tooltip:hover .tooltiptext {
|
||||
visibility: visible;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
kbd {
|
||||
padding: 2px 8px;
|
||||
font-size: 125%;
|
||||
font-weight: 500;
|
||||
color: #000;
|
||||
background-color: #bcd643;
|
||||
border-radius: 5px;
|
||||
border-style: outset;
|
||||
border-width: 1px;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
<h2 id="trading-engine">Trading Engine</h2>
|
||||
|
||||
<table class="definitionTable"><tr><td>
|
||||
|
||||
<img src="images/icons/nodes/png150/trading-engine.png" />
|
||||
|
||||
</td><td>
|
||||
|
||||
<strong>The trading engine hierarchy is the data structure used by the trading bot to keep runtime information highly accessible and exposed to others.</strong>
|
||||
|
||||
</td></tr></table>
|
||||
|
||||
<p>You will use this hierarchy for two main purposes:</p>
|
||||
|
||||
<p>The hierarchy exposes—literally—all the information processed by the trading bot, providing a comprehensive feedback loop to trading systems and analysis capabilities to users. The hierarchy exposes—literally—all the information processed by the trading bot, providing a comprehensive feedback loop to trading systems and analysis capabilities to users.</p>
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<p><strong>To let your trading systems:</strong> This allows strategies to keep track of and react to current and past events—including those involving the exchange, such as orders placed or filled—as the bot is running.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><strong>To keep track of the actions:</strong> By analyzing runtime information, you may gain a detailed understanding of what happens, when, and why, throughout a trading session.</p>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<p>The hierarchy exposes—literally—all the information processed by the trading bot, providing a comprehensive feedback loop to trading systems and analysis capabilities to users.</p>
|
||||
|
||||
<div class="bs-callout bs-callout-success">Este callout se usa para resaltar una idea particularmente importante. Algo se sobresale, como una conclusion, o algo por el estilo.</div>
|
||||
|
||||
<p>The hierarchy exposes all the information processed by the trading bot, providing a comprehensive feedback loop to trading systems and analysis capabilities to users. The hierarchy exposes all the information processed by the trading bot, providing a comprehensive feedback loop to trading systems and analysis capabilities to users.</p>
|
||||
|
||||
<div class="alert alert-info" role="alert"><i class="fa fa-info-circle"></i> <b>Note:</b> Esto es una nota, algo noteworthy.</div>
|
||||
|
||||
<div class="alert alert-success" role="alert"><i class="fa fa-check-square-o"></i> <b>Tip:</b> Esto es un tip.</div>
|
||||
|
||||
<div class="alert alert-warning" role="alert"><i class="fa fa-warning"></i> <b>Important:</b> Esto es algo importante.</div>
|
||||
|
||||
<div class="alert alert-danger" role="alert"><i class="fa fa-exclamation-circle"></i> <b>Warning:</b> Esto es una aviso de alerta.</div>
|
||||
|
||||
<h4 id="adding-a-trading-engine-node">Adding a Trading Engine Node</h4>
|
||||
|
||||
<p>Calculo que con este segundo nivel de titulo alcanza.</p>
|
||||
|
||||
<h4 id="este-es-otro-formato-tipico-de-la-doc--trading-engine">Este es otro formato tipico de la doc: Trading Engine</h4>
|
||||
|
||||
<table class="definitionTable"><tr><td>
|
||||
|
||||
<img src="images/icons/nodes/png50/trading-engine.png" />
|
||||
|
||||
</td><td>
|
||||
|
||||
The trading engine hierarchy is the data structure used by the trading bot to keep runtime information highly accessible and exposed to others.
|
||||
|
||||
</td></tr></table>
|
||||
@@ -183,16 +183,20 @@
|
||||
function listenToEvent(eventHandlerName, eventType, callerId, handler, extraData) {
|
||||
let eventSubscriptionId = Math.trunc(Math.random() * 1000000)
|
||||
|
||||
let found = false
|
||||
/*
|
||||
We can not allow to have the exact same listener more than once. In case that we find a listener trying to listen again, the first record will
|
||||
be deleted and we are just going to consider the last one comming in.
|
||||
*/
|
||||
for (let i = 0; i < thisObject.listeners.length; i++) {
|
||||
if (eventHandlerName === thisObject.listeners[i][0] && eventType === thisObject.listeners[i][1] && callerId === thisObject.listeners[i][2]) {
|
||||
found = true
|
||||
thisObject.listeners.splice(i, 1)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if (found === false) {
|
||||
thisObject.listeners.push([eventHandlerName, eventType, callerId, handler, extraData, eventSubscriptionId])
|
||||
}
|
||||
|
||||
thisObject.listeners.push([eventHandlerName, eventType, callerId, handler, extraData, eventSubscriptionId])
|
||||
|
||||
|
||||
return eventSubscriptionId
|
||||
}
|
||||
|
||||
@@ -1,32 +1,27 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"balanced-match@1.0.0",
|
||||
"C:\\Users\\Luis\\source\\repos\\AAMasters\\WebServer"
|
||||
]
|
||||
],
|
||||
"_from": "balanced-match@1.0.0",
|
||||
"_from": "balanced-match@^1.0.0",
|
||||
"_id": "balanced-match@1.0.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
|
||||
"_location": "/balanced-match",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "balanced-match@1.0.0",
|
||||
"raw": "balanced-match@^1.0.0",
|
||||
"name": "balanced-match",
|
||||
"escapedName": "balanced-match",
|
||||
"rawSpec": "1.0.0",
|
||||
"rawSpec": "^1.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "1.0.0"
|
||||
"fetchSpec": "^1.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/brace-expansion"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
|
||||
"_spec": "1.0.0",
|
||||
"_where": "C:\\Users\\Luis\\source\\repos\\AAMasters\\WebServer",
|
||||
"_shasum": "89b4d199ab2bee49de164ea02b89ce462d71b767",
|
||||
"_spec": "balanced-match@^1.0.0",
|
||||
"_where": "C:\\Users\\Luis\\source\\repos\\AAMasters\\BackendServers\\node_modules\\brace-expansion",
|
||||
"author": {
|
||||
"name": "Julian Gruber",
|
||||
"email": "mail@juliangruber.com",
|
||||
@@ -35,7 +30,9 @@
|
||||
"bugs": {
|
||||
"url": "https://github.com/juliangruber/balanced-match/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {},
|
||||
"deprecated": false,
|
||||
"description": "Match balanced character pairs, like \"{\" and \"}\"",
|
||||
"devDependencies": {
|
||||
"matcha": "^0.7.0",
|
||||
@@ -1,32 +1,27 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"brace-expansion@1.1.11",
|
||||
"C:\\Users\\Luis\\source\\repos\\AAMasters\\WebServer"
|
||||
]
|
||||
],
|
||||
"_from": "brace-expansion@1.1.11",
|
||||
"_from": "brace-expansion@^1.1.7",
|
||||
"_id": "brace-expansion@1.1.11",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
||||
"_location": "/brace-expansion",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "brace-expansion@1.1.11",
|
||||
"raw": "brace-expansion@^1.1.7",
|
||||
"name": "brace-expansion",
|
||||
"escapedName": "brace-expansion",
|
||||
"rawSpec": "1.1.11",
|
||||
"rawSpec": "^1.1.7",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "1.1.11"
|
||||
"fetchSpec": "^1.1.7"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/minimatch"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||
"_spec": "1.1.11",
|
||||
"_where": "C:\\Users\\Luis\\source\\repos\\AAMasters\\WebServer",
|
||||
"_shasum": "3c7fcbf529d87226f3d2f52b966ff5271eb441dd",
|
||||
"_spec": "brace-expansion@^1.1.7",
|
||||
"_where": "C:\\Users\\Luis\\source\\repos\\AAMasters\\BackendServers\\node_modules\\minimatch",
|
||||
"author": {
|
||||
"name": "Julian Gruber",
|
||||
"email": "mail@juliangruber.com",
|
||||
@@ -35,10 +30,12 @@
|
||||
"bugs": {
|
||||
"url": "https://github.com/juliangruber/brace-expansion/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"balanced-match": "^1.0.0",
|
||||
"concat-map": "0.0.1"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Brace expansion as known from sh/bash",
|
||||
"devDependencies": {
|
||||
"matcha": "^0.7.0",
|
||||
@@ -26,9 +26,9 @@ function cleanupOldTags () {
|
||||
|
||||
const tagsByMajorMinor = values (groupBy (tags, 'key')).sort ((a, b) => a[0].key - b[0].key)
|
||||
|
||||
// Preserve all tags for first 3 minor versions
|
||||
// Preserve all tags for first 5 minor versions
|
||||
|
||||
for (let i = 0; i < 3; i++) {
|
||||
for (let i = 0; i < 5; i++) {
|
||||
|
||||
const tags = tagsByMajorMinor.pop ()
|
||||
|
||||
@@ -93,7 +93,7 @@ function createExchanges (ids) {
|
||||
// ----------------------------------------------------------------------------
|
||||
// TODO: REWRITE THIS ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
|
||||
|
||||
function exportSupportedAndCertifiedExchanges (exchanges, wikiPath) {
|
||||
function exportSupportedAndCertifiedExchanges (exchanges, { allExchangesPaths, certifiedExchangesPaths, exchangesByCountriesPaths, proExchangesPaths }) {
|
||||
|
||||
// ............................................................................
|
||||
// markup constants and helper functions
|
||||
@@ -109,33 +109,35 @@ function exportSupportedAndCertifiedExchanges (exchanges, wikiPath) {
|
||||
// ----------------------------------------------------------------------------
|
||||
// list all supported exchanges
|
||||
|
||||
const exchangesNotListedInDocs = []
|
||||
const exchangesNotListedInDocs = [ 'hitbtc2' ]
|
||||
|
||||
let tableData = values (exchanges)
|
||||
.filter (exchange => !exchangesNotListedInDocs.includes (exchange.id))
|
||||
.map (exchange => {
|
||||
let logo = exchange.urls['logo']
|
||||
let website = Array.isArray (exchange.urls.www) ? exchange.urls.www[0] : exchange.urls.www
|
||||
let url = exchange.urls.referral || website
|
||||
let doc = Array.isArray (exchange.urls.doc) ? exchange.urls.doc[0] : exchange.urls.doc
|
||||
let version = exchange.version ? exchange.version : '\*'
|
||||
let matches = version.match (/[^0-9]*([0-9].*)/)
|
||||
if (matches) {
|
||||
version = matches[1];
|
||||
}
|
||||
return [
|
||||
'[](' + url + ')',
|
||||
exchange.id,
|
||||
'[' + exchange.name + '](' + url + ')',
|
||||
version,
|
||||
'[API](' + doc + ')',
|
||||
exchange.certified ? ccxtCertifiedBadge : '',
|
||||
exchange.pro ? ccxtProBadge : '',
|
||||
]
|
||||
})
|
||||
function makeTableData (exchanges) {
|
||||
return (
|
||||
values (exchanges)
|
||||
.filter (exchange => !exchangesNotListedInDocs.includes (exchange.id))
|
||||
.map (exchange => {
|
||||
let logo = exchange.urls['logo']
|
||||
let website = Array.isArray (exchange.urls.www) ? exchange.urls.www[0] : exchange.urls.www
|
||||
let url = exchange.urls.referral || website
|
||||
let doc = Array.isArray (exchange.urls.doc) ? exchange.urls.doc[0] : exchange.urls.doc
|
||||
let version = exchange.version ? exchange.version : '\*'
|
||||
let matches = version.match (/[^0-9]*([0-9].*)/)
|
||||
if (matches) {
|
||||
version = matches[1];
|
||||
}
|
||||
return [
|
||||
'[](' + url + ')',
|
||||
exchange.id,
|
||||
'[' + exchange.name + '](' + url + ')',
|
||||
version,
|
||||
'[API](' + doc + ')',
|
||||
exchange.certified ? ccxtCertifiedBadge : '',
|
||||
exchange.pro ? ccxtProBadge : '',
|
||||
]
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
// prepend the table header
|
||||
tableData.splice (0, 0, tableHeadings)
|
||||
|
||||
function makeTable (jsonArray) {
|
||||
let table = asTable.configure ({ 'delimiter': ' | ' }) (jsonArray)
|
||||
@@ -148,88 +150,128 @@ function exportSupportedAndCertifiedExchanges (exchanges, wikiPath) {
|
||||
return lines.map (line => '|' + line + '|').join ("\n")
|
||||
}
|
||||
|
||||
const exchangesTable = makeTable (tableData)
|
||||
const numExchanges = keys (exchanges).length
|
||||
const beginning = "The ccxt library currently supports the following "
|
||||
const ending = " cryptocurrency exchange markets and trading APIs:\n\n"
|
||||
const totalString = beginning + numExchanges + ending
|
||||
const allExchanges = totalString + exchangesTable + "$1"
|
||||
const allExchangesRegex = new RegExp ("[^\n]+[\n]{2}\\|[^`]+\\|([\n][\n]|[\n]$|$)", 'm')
|
||||
logExportExchanges ('README.md', allExchangesRegex, allExchanges)
|
||||
logExportExchanges (wikiPath + '/Manual.md', allExchangesRegex, allExchanges)
|
||||
logExportExchanges (wikiPath + '/Exchange-Markets.md', allExchangesRegex, allExchanges)
|
||||
if (allExchangesPaths) {
|
||||
|
||||
const certifiedFieldIndex = tableHeadings.indexOf ('certified')
|
||||
const certified = tableData.filter ((x) => x[certifiedFieldIndex] !== '' )
|
||||
const certifiedExchangesRegex = new RegExp ("^(## Certified Cryptocurrency Exchanges\n{3})(?:\\|.+\\|$\n)+", 'm')
|
||||
const certifiedExchangesTable = makeTable (certified)
|
||||
const certifiedExchanges = '$1' + certifiedExchangesTable + "\n"
|
||||
logExportExchanges ('README.md', certifiedExchangesRegex, certifiedExchanges)
|
||||
const tableData = makeTableData (exchanges)
|
||||
const numExchanges = tableData.length
|
||||
// prepend the table header
|
||||
tableData.splice (0, 0, tableHeadings)
|
||||
const exchangesTable = makeTable (tableData)
|
||||
const beginning = "The CCXT library currently supports the following "
|
||||
const ending = " cryptocurrency exchange markets and trading APIs:\n\n"
|
||||
const totalString = beginning + numExchanges + ending
|
||||
const allExchanges = totalString + exchangesTable + "$1"
|
||||
const allExchangesRegex = new RegExp ("[^\n]+[\n]{2}\\|[^`]+\\|([\n][\n]|[\n]$|$)", 'm')
|
||||
|
||||
for (const path of allExchangesPaths) {
|
||||
logExportExchanges (path, allExchangesRegex, allExchanges)
|
||||
}
|
||||
|
||||
let exchangesByCountries = []
|
||||
keys (countries).forEach (code => {
|
||||
let country = countries[code]
|
||||
let result = []
|
||||
keys (exchanges).forEach (id => {
|
||||
let exchange = exchanges[id]
|
||||
let logo = exchange.urls['logo']
|
||||
let website = Array.isArray (exchange.urls.www) ? exchange.urls.www[0] : exchange.urls.www
|
||||
let url = exchange.urls.referral || website
|
||||
let doc = Array.isArray (exchange.urls.doc) ? exchange.urls.doc[0] : exchange.urls.doc
|
||||
let version = exchange.version ? exchange.version : '\*'
|
||||
let matches = version.match (/[^0-9]*([0-9].*)/)
|
||||
if (matches)
|
||||
version = matches[1];
|
||||
let shouldInclude = false
|
||||
if (Array.isArray (exchange.countries)) {
|
||||
if (exchange.countries.indexOf (code) > -1)
|
||||
shouldInclude = true
|
||||
// logExportExchanges ('README.md', allExchangesRegex, allExchanges)
|
||||
// logExportExchanges (wikiPath + '/Manual.md', allExchangesRegex, allExchanges)
|
||||
// logExportExchanges (wikiPath + '/Exchange-Markets.md', allExchangesRegex, allExchanges)
|
||||
}
|
||||
|
||||
if (proExchangesPaths) {
|
||||
const pro = values (exchanges).filter (exchange => exchange.pro)
|
||||
const tableData = makeTableData (pro)
|
||||
const numExchanges = tableData.length
|
||||
// prepend the table header
|
||||
tableData.splice (0, 0, tableHeadings)
|
||||
const exchangesTable = makeTable (tableData)
|
||||
const beginning = "The CCXT Pro library currently supports the following "
|
||||
const ending = " cryptocurrency exchange markets and WebSocket trading APIs:\n\n"
|
||||
const totalString = beginning + numExchanges + ending
|
||||
const proExchanges = totalString + exchangesTable + "$1"
|
||||
const proExchangesRegex = new RegExp ("[^\n]+[\n]{2}\\|[^`]+\\|([\n][\n]|[\n]$|$)", 'm')
|
||||
|
||||
for (const path of proExchangesPaths) {
|
||||
logExportExchanges (path, proExchangesRegex, proExchanges)
|
||||
}
|
||||
}
|
||||
|
||||
if (certifiedExchangesPaths) {
|
||||
const certified = values (exchanges).filter (exchange => exchange.certified)
|
||||
const tableData = makeTableData (certified)
|
||||
// prepend the table header
|
||||
tableData.splice (0, 0, tableHeadings)
|
||||
const certifiedExchangesRegex = new RegExp ("^(## Certified Cryptocurrency Exchanges\n{3})(?:\\|.+\\|$\n)+", 'm')
|
||||
const certifiedExchangesTable = makeTable (tableData)
|
||||
const certifiedExchanges = '$1' + certifiedExchangesTable + "\n"
|
||||
|
||||
for (const path of certifiedExchangesPaths) {
|
||||
logExportExchanges (path, certifiedExchangesRegex, certifiedExchanges)
|
||||
}
|
||||
|
||||
// logExportExchanges ('README.md', certifiedExchangesRegex, certifiedExchanges)
|
||||
}
|
||||
|
||||
if (exchangesByCountriesPaths) {
|
||||
let exchangesByCountries = []
|
||||
keys (countries).forEach (code => {
|
||||
let country = countries[code]
|
||||
let result = []
|
||||
keys (exchanges).forEach (id => {
|
||||
let exchange = exchanges[id]
|
||||
let logo = exchange.urls['logo']
|
||||
let website = Array.isArray (exchange.urls.www) ? exchange.urls.www[0] : exchange.urls.www
|
||||
let url = exchange.urls.referral || website
|
||||
let doc = Array.isArray (exchange.urls.doc) ? exchange.urls.doc[0] : exchange.urls.doc
|
||||
let version = exchange.version ? exchange.version : '\*'
|
||||
let matches = version.match (/[^0-9]*([0-9].*)/)
|
||||
if (matches)
|
||||
version = matches[1];
|
||||
let shouldInclude = false
|
||||
if (Array.isArray (exchange.countries)) {
|
||||
if (exchange.countries.indexOf (code) > -1)
|
||||
shouldInclude = true
|
||||
} else {
|
||||
if (code == exchange.countries)
|
||||
shouldInclude = true
|
||||
}
|
||||
if (shouldInclude) {
|
||||
let entry = [
|
||||
country,
|
||||
'[](' + url + ')',
|
||||
exchange.id,
|
||||
'[' + exchange.name + '](' + url + ')',
|
||||
version,
|
||||
'[API](' + doc + ')',
|
||||
// doesn't fit in width
|
||||
// exchange.certified ? ccxtCertifiedBadge : '',
|
||||
]
|
||||
result.push (entry)
|
||||
}
|
||||
})
|
||||
exchangesByCountries = exchangesByCountries.concat (result)
|
||||
});
|
||||
|
||||
const countryKeyIndex = exchangesByCountryHeading.indexOf ('country / region')
|
||||
exchangesByCountries = exchangesByCountries.sort ((a, b) => {
|
||||
const countryA = a[countryKeyIndex].toLowerCase ()
|
||||
const countryB = b[countryKeyIndex].toLowerCase ()
|
||||
if (countryA > countryB) {
|
||||
return 1
|
||||
} else if (countryA < countryB) {
|
||||
return -1;
|
||||
} else {
|
||||
if (code == exchange.countries)
|
||||
shouldInclude = true
|
||||
}
|
||||
if (shouldInclude) {
|
||||
let entry = [
|
||||
country,
|
||||
'[](' + url + ')',
|
||||
exchange.id,
|
||||
'[' + exchange.name + '](' + url + ')',
|
||||
version,
|
||||
'[API](' + doc + ')',
|
||||
// doesn't fit in width
|
||||
// exchange.certified ? ccxtCertifiedBadge : '',
|
||||
]
|
||||
result.push (entry)
|
||||
if (a['id'] > b['id'])
|
||||
return 1;
|
||||
else if (a['id'] < b['id'])
|
||||
return -1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
})
|
||||
exchangesByCountries = exchangesByCountries.concat (result)
|
||||
});
|
||||
|
||||
let countryKeyIndex = exchangesByCountryHeading.indexOf ('country / region')
|
||||
exchangesByCountries = exchangesByCountries.sort ((a, b) => {
|
||||
let countryA = a[countryKeyIndex].toLowerCase ()
|
||||
let countryB = b[countryKeyIndex].toLowerCase ()
|
||||
if (countryA > countryB) {
|
||||
return 1
|
||||
} else if (countryA < countryB) {
|
||||
return -1;
|
||||
} else {
|
||||
if (a['id'] > b['id'])
|
||||
return 1;
|
||||
else if (a['id'] < b['id'])
|
||||
return -1;
|
||||
else
|
||||
return 0;
|
||||
exchangesByCountries.splice (0, 0, exchangesByCountryHeading)
|
||||
const lines = makeTable (exchangesByCountries)
|
||||
const result = "# Exchanges By Country\n\nThe ccxt library currently supports the following cryptocurrency exchange markets and trading APIs:\n\n" + lines + "\n\n"
|
||||
for (const path of exchangesByCountriesPaths) {
|
||||
fs.truncateSync (path)
|
||||
fs.writeFileSync (path, result)
|
||||
}
|
||||
})
|
||||
|
||||
exchangesByCountries.splice (0, 0, exchangesByCountryHeading)
|
||||
let lines = makeTable (exchangesByCountries)
|
||||
let result = "# Exchanges By Country\n\nThe ccxt library currently supports the following cryptocurrency exchange markets and trading APIs:\n\n" + lines + "\n\n"
|
||||
let filename = wikiPath + '/Exchange-Markets-By-Country.md'
|
||||
fs.truncateSync (filename)
|
||||
fs.writeFileSync (filename, result)
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: REWRITE THIS ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑
|
||||
@@ -237,7 +279,9 @@ function exportSupportedAndCertifiedExchanges (exchanges, wikiPath) {
|
||||
|
||||
function exportExchangeIdsToExchangesJson (exchanges) {
|
||||
log.bright ('Exporting exchange ids to'.cyan, 'exchanges.json'.yellow)
|
||||
fs.writeFileSync ('exchanges.json', JSON.stringify ({ ids: keys (exchanges) }, null, 4))
|
||||
const ids = keys (exchanges)
|
||||
console.log (ids)
|
||||
fs.writeFileSync ('exchanges.json', JSON.stringify ({ ids }, null, 4))
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -284,19 +328,26 @@ function exportKeywordsToPackageJson (exchanges) {
|
||||
}
|
||||
|
||||
packageJSON.keywords = [...keywords]
|
||||
fs.writeFileSync ('./package.json', JSON.stringify (packageJSON, null, 2))
|
||||
fs.writeFileSync ('./package.json', JSON.stringify (packageJSON, null, 2) + "\n")
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
function flatten (nested, result = []) {
|
||||
for (const key in nested) {
|
||||
result.push (key)
|
||||
if (Object.keys (nested[key]).length)
|
||||
flatten (nested[key], result)
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
|
||||
function exportEverything () {
|
||||
|
||||
const wikiPath = 'wiki'
|
||||
, gitWikiPath = 'build/ccxt.wiki'
|
||||
|
||||
cloneGitHubWiki (gitWikiPath)
|
||||
|
||||
const ids = getIncludedExchangeIds ()
|
||||
const errorHierarchy = require ('../js/base/errorHierarchy.js')
|
||||
const flat = flatten (errorHierarchy)
|
||||
flat.push ('error_hierarchy')
|
||||
|
||||
const replacements = [
|
||||
{
|
||||
@@ -314,6 +365,16 @@ function exportEverything () {
|
||||
regex: /(?:from ccxt\.[^\.]+ import [^\s]+\s+\# noqa\: F401[\r]?[\n])+[\r]?[\n]exchanges/,
|
||||
replacement: ids.map (id => ('from ccxt.' + id + ' import ' + id).padEnd (60) + '# noqa: F401').join ("\n") + "\n\nexchanges",
|
||||
},
|
||||
{
|
||||
file: './python/ccxt/__init__.py',
|
||||
regex: /(?:from ccxt\.base\.errors import [^\s]+\s+\# noqa\: F401[\r]?[\n])+[\r]?[\n]/,
|
||||
replacement: flat.map (error => ('from ccxt.base.errors' + ' import ' + error).padEnd (60) + '# noqa: F401').join ("\n") + "\n\n",
|
||||
},
|
||||
{
|
||||
file: './python/ccxt/async_support/__init__.py',
|
||||
regex: /(?:from ccxt\.base\.errors import [^\s]+\s+\# noqa\: F401[\r]?[\n])+[\r]?[\n]/,
|
||||
replacement: flat.map (error => ('from ccxt.base.errors' + ' import ' + error).padEnd (60) + '# noqa: F401').join ("\n") + "\n\n",
|
||||
},
|
||||
{
|
||||
file: './python/ccxt/async_support/__init__.py',
|
||||
regex: /(?:from ccxt\.async_support\.[^\.]+ import [^\s]+\s+\# noqa\: F401[\r]?[\n])+[\r]?[\n]exchanges/,
|
||||
@@ -336,7 +397,28 @@ function exportEverything () {
|
||||
// strategically placed exactly here (we can require it AFTER the export)
|
||||
const exchanges = createExchanges (ids)
|
||||
|
||||
exportSupportedAndCertifiedExchanges (exchanges, wikiPath)
|
||||
const wikiPath = 'wiki'
|
||||
, gitWikiPath = 'build/ccxt.wiki'
|
||||
|
||||
cloneGitHubWiki (gitWikiPath)
|
||||
|
||||
exportSupportedAndCertifiedExchanges (exchanges, {
|
||||
allExchangesPaths: [
|
||||
'README.md',
|
||||
wikiPath + '/Manual.md',
|
||||
wikiPath + '/Exchange-Markets.md'
|
||||
],
|
||||
certifiedExchangesPaths: [
|
||||
'README.md',
|
||||
],
|
||||
exchangesByCountriesPaths: [
|
||||
wikiPath + '/Exchange-Markets-By-Country.md'
|
||||
],
|
||||
proExchangesPaths: [
|
||||
wikiPath + '/ccxt.pro.manual.md',
|
||||
],
|
||||
})
|
||||
|
||||
exportExchangeIdsToExchangesJson (exchanges)
|
||||
exportWikiToGitHub (wikiPath, gitWikiPath)
|
||||
exportKeywordsToPackageJson (exchanges)
|
||||
@@ -5,16 +5,23 @@
|
||||
"use strict";
|
||||
|
||||
const fs = require ('fs')
|
||||
, log = require ('ololog')
|
||||
, log = require ('ololog').unlimited
|
||||
, _ = require ('ansicolor').nice
|
||||
, errors = require ('../js/base/errors.js')
|
||||
, { unCamelCase, precisionConstants, safeString } = require ('../js/base/functions.js')
|
||||
, functions = require ('../js/base/functions.js')
|
||||
, {
|
||||
unCamelCase,
|
||||
precisionConstants,
|
||||
safeString,
|
||||
unique,
|
||||
} = functions
|
||||
, { basename } = require ('path')
|
||||
, {
|
||||
createFolderRecursively,
|
||||
replaceInFile,
|
||||
overwriteFile,
|
||||
} = require ('./fs.js')
|
||||
, Exchange = require ('../js/base/Exchange.js')
|
||||
|
||||
class Transpiler {
|
||||
|
||||
@@ -60,6 +67,7 @@ class Transpiler {
|
||||
[ /\.parseTrades\s/g, '.parse_trades'],
|
||||
[ /\.parseTrade\s/g, '.parse_trade'],
|
||||
[ /\.parseTradingViewOHLCV\s/g, '.parse_trading_view_ohlcv'],
|
||||
[ /\.convertTradingViewToOHLCV\s/g, '.convert_trading_view_to_ohlcv'],
|
||||
[ /\.parseTransaction\s/g, '.parse_transaction'],
|
||||
[ /\.parseTransactions\s/g, '.parse_transactions'],
|
||||
[ /\.parseOrderBook\s/g, '.parse_order_book'],
|
||||
@@ -299,7 +307,9 @@ class Transpiler {
|
||||
[ /this\.stringToBase64\s/g, 'base64_encode' ],
|
||||
[ /this\.binaryToBase16\s/g, 'bin2hex' ],
|
||||
[ /this\.base64ToBinary\s/g, 'base64_decode' ],
|
||||
[ /this\.deepExtend\s/g, 'array_replace_recursive'],
|
||||
// deepExtend is commented for PHP because it does not overwrite linear arrays
|
||||
// a proper \ccxt\Exchange::deep_extend() base method is implemented instead
|
||||
// [ /this\.deepExtend\s/g, 'array_replace_recursive'],
|
||||
[ /(\w+)\.shift\s*\(\)/g, 'array_shift($1)' ],
|
||||
[ /(\w+)\.pop\s*\(\)/g, 'array_pop($1)' ],
|
||||
[ /Number\.MAX_SAFE_INTEGER/g, 'PHP_INT_MAX' ],
|
||||
@@ -382,12 +392,27 @@ class Transpiler {
|
||||
])
|
||||
}
|
||||
|
||||
getBaseClass () {
|
||||
return new Exchange ()
|
||||
}
|
||||
|
||||
getBaseMethods () {
|
||||
const baseExchange = this.getBaseClass ()
|
||||
let object = baseExchange
|
||||
let properties = []
|
||||
while (object !== Object.prototype) {
|
||||
properties = properties.concat (Object.getOwnPropertyNames (object))
|
||||
object = Object.getPrototypeOf (object)
|
||||
}
|
||||
return properties.filter (x => typeof baseExchange[x] === 'function')
|
||||
}
|
||||
|
||||
getPythonBaseMethods () {
|
||||
return []
|
||||
return this.getBaseMethods ()
|
||||
}
|
||||
|
||||
getPHPBaseMethods () {
|
||||
return []
|
||||
return this.getBaseMethods ()
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
@@ -589,10 +614,10 @@ class Transpiler {
|
||||
methods = methods.concat (this.getPHPBaseMethods ())
|
||||
|
||||
for (let method of methods) {
|
||||
const regex = new RegExp ('\\$this->(' + method + ')(\\s\\(|[^a-zA-Z0-9_])', 'g')
|
||||
const regex = new RegExp ('\\$this->(' + method + ')\\s?(\\(|[^a-zA-Z0-9_])', 'g')
|
||||
bodyAsString = bodyAsString.replace (regex,
|
||||
(match, p1, p2) => {
|
||||
return ((p2 === ' (') ?
|
||||
return ((p2 === '(') ?
|
||||
('$this->' + unCamelCase (p1) + p2) : // support direct php calls
|
||||
("array($this, '" + unCamelCase (p1) + "')" + p2)) // as well as passing instance methods as callables
|
||||
})
|
||||
@@ -748,7 +773,7 @@ class Transpiler {
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
transpileDerivedExchangeClass (contents) {
|
||||
transpileDerivedExchangeClass (contents, methodNames = undefined) {
|
||||
|
||||
let exchangeClassDeclarationMatches = contents.match (/^module\.exports\s*=\s*class\s+([\S]+)\s+extends\s+([\S]+)\s+{([\s\S]+?)^};*/m)
|
||||
|
||||
@@ -763,7 +788,7 @@ class Transpiler {
|
||||
let python3 = []
|
||||
let php = []
|
||||
|
||||
let methodNames = []
|
||||
methodNames = [] // methodNames || []
|
||||
|
||||
// run through all methods
|
||||
for (let i = 0; i < methods.length; i++) {
|
||||
@@ -839,7 +864,7 @@ class Transpiler {
|
||||
|
||||
// compile signature + body for PHP
|
||||
php.push ('');
|
||||
php.push (' public function ' + method + ' (' + phpArgs + ') {');
|
||||
php.push (' public function ' + method + '(' + phpArgs + ') {');
|
||||
php.push (phpBody);
|
||||
php.push (' }')
|
||||
|
||||
@@ -866,8 +891,25 @@ class Transpiler {
|
||||
try {
|
||||
|
||||
const { python2Folder, python3Folder, phpFolder } = options
|
||||
const contents = fs.readFileSync (jsFolder + filename, 'utf8')
|
||||
const { python2, python3, php, className, baseClass } = this.transpileDerivedExchangeClass (contents)
|
||||
const path = jsFolder + filename
|
||||
const contents = fs.readFileSync (path, 'utf8')
|
||||
|
||||
// function getMethodNames (object) {
|
||||
// let functions = []
|
||||
// let o = object
|
||||
// do {
|
||||
// functions = functions.concat (Object.getOwnPropertyNames (o))
|
||||
// } while (o = Object.getPrototypeOf (o))
|
||||
// return unique (functions.filter (f => (typeof object[f] === 'function')))
|
||||
// }
|
||||
// const exchangeClass = require ('.' + path)
|
||||
// const exchange = new exchangeClass ()
|
||||
// const methodNames = getMethodNames (exchange)
|
||||
// const { python2, python3, php, className, baseClass } =
|
||||
// this.transpileDerivedExchangeClass (contents, methodNames)
|
||||
|
||||
const { python2, python3, php, className, baseClass } =
|
||||
this.transpileDerivedExchangeClass (contents)
|
||||
|
||||
log.cyan ('Transpiling from', filename.yellow)
|
||||
|
||||
@@ -943,9 +985,7 @@ class Transpiler {
|
||||
|
||||
// ========================================================================
|
||||
|
||||
exportTypeScriptDeclarations (classes) {
|
||||
|
||||
const file = './ccxt.d.ts'
|
||||
exportTypeScriptDeclarations (file, classes) {
|
||||
|
||||
log.bright.cyan ('Exporting TypeScript declarations →', file.yellow)
|
||||
|
||||
@@ -1134,11 +1174,11 @@ class Transpiler {
|
||||
"",
|
||||
"",
|
||||
"def toWei(amount, decimals):",
|
||||
" return Exchange.toWei(amount, decimals)",
|
||||
" return Exchange.to_wei(amount, decimals)",
|
||||
"",
|
||||
"",
|
||||
"def fromWei(amount, decimals):",
|
||||
" return Exchange.fromWei(amount, decimals)",
|
||||
" return Exchange.from_wei(amount, decimals)",
|
||||
"",
|
||||
"",
|
||||
].join ("\n")
|
||||
@@ -1163,10 +1203,10 @@ class Transpiler {
|
||||
" return Exchange::number_to_string ($x);",
|
||||
"}",
|
||||
"function toWei ($amount, $decimals) {",
|
||||
" return Exchange::toWei ($amount, $decimals);",
|
||||
" return Exchange::to_wei ($amount, $decimals);",
|
||||
"}",
|
||||
"function fromWei ($amount, $decimals) {",
|
||||
" return Exchange::fromWei ($amount, $decimals);",
|
||||
" return Exchange::from_wei ($amount, $decimals);",
|
||||
"}",
|
||||
"",
|
||||
].join ("\n")
|
||||
@@ -1274,7 +1314,7 @@ class Transpiler {
|
||||
|
||||
// HINT: if we're going to support specific class definitions
|
||||
// this process won't work anymore as it will override the definitions
|
||||
this.exportTypeScriptDeclarations (classes)
|
||||
this.exportTypeScriptDeclarations ('./ccxt.d.ts', classes)
|
||||
|
||||
//*/
|
||||
|
||||
@@ -35,7 +35,7 @@ const Exchange = require ('./js/base/Exchange')
|
||||
//-----------------------------------------------------------------------------
|
||||
// this is updated by vss.js when building
|
||||
|
||||
const version = '1.23.67'
|
||||
const version = '1.26.45'
|
||||
|
||||
Exchange.ccxtVersion = version
|
||||
|
||||
@@ -46,6 +46,7 @@ const exchanges = {
|
||||
'acx': require ('./js/acx.js'),
|
||||
'adara': require ('./js/adara.js'),
|
||||
'anxpro': require ('./js/anxpro.js'),
|
||||
'aofex': require ('./js/aofex.js'),
|
||||
'bcex': require ('./js/bcex.js'),
|
||||
'bequant': require ('./js/bequant.js'),
|
||||
'bibox': require ('./js/bibox.js'),
|
||||
@@ -62,7 +63,6 @@ const exchanges = {
|
||||
'bitforex': require ('./js/bitforex.js'),
|
||||
'bithumb': require ('./js/bithumb.js'),
|
||||
'bitkk': require ('./js/bitkk.js'),
|
||||
'bitlish': require ('./js/bitlish.js'),
|
||||
'bitmart': require ('./js/bitmart.js'),
|
||||
'bitmax': require ('./js/bitmax.js'),
|
||||
'bitmex': require ('./js/bitmex.js'),
|
||||
@@ -76,17 +76,16 @@ const exchanges = {
|
||||
'braziliex': require ('./js/braziliex.js'),
|
||||
'btcalpha': require ('./js/btcalpha.js'),
|
||||
'btcbox': require ('./js/btcbox.js'),
|
||||
'btcchina': require ('./js/btcchina.js'),
|
||||
'btcmarkets': require ('./js/btcmarkets.js'),
|
||||
'btctradeim': require ('./js/btctradeim.js'),
|
||||
'btctradeua': require ('./js/btctradeua.js'),
|
||||
'btcturk': require ('./js/btcturk.js'),
|
||||
'buda': require ('./js/buda.js'),
|
||||
'bw': require ('./js/bw.js'),
|
||||
'bybit': require ('./js/bybit.js'),
|
||||
'bytetrade': require ('./js/bytetrade.js'),
|
||||
'cex': require ('./js/cex.js'),
|
||||
'chilebit': require ('./js/chilebit.js'),
|
||||
'cobinhood': require ('./js/cobinhood.js'),
|
||||
'coinbase': require ('./js/coinbase.js'),
|
||||
'coinbaseprime': require ('./js/coinbaseprime.js'),
|
||||
'coinbasepro': require ('./js/coinbasepro.js'),
|
||||
@@ -140,10 +139,8 @@ const exchanges = {
|
||||
'mercado': require ('./js/mercado.js'),
|
||||
'mixcoins': require ('./js/mixcoins.js'),
|
||||
'oceanex': require ('./js/oceanex.js'),
|
||||
'okcoincny': require ('./js/okcoincny.js'),
|
||||
'okcoinusd': require ('./js/okcoinusd.js'),
|
||||
'okcoin': require ('./js/okcoin.js'),
|
||||
'okex': require ('./js/okex.js'),
|
||||
'okex3': require ('./js/okex3.js'),
|
||||
'paymium': require ('./js/paymium.js'),
|
||||
'poloniex': require ('./js/poloniex.js'),
|
||||
'rightbtc': require ('./js/rightbtc.js'),
|
||||
@@ -134,6 +134,8 @@ module.exports = class acx extends Exchange {
|
||||
'quoteId': quoteId,
|
||||
'precision': precision,
|
||||
'info': market,
|
||||
'active': undefined,
|
||||
'limits': this.limits,
|
||||
});
|
||||
}
|
||||
return result;
|
||||
@@ -325,6 +327,7 @@ module.exports = class acx extends Exchange {
|
||||
const id = this.safeString (order, 'id');
|
||||
return {
|
||||
'id': id,
|
||||
'clientOrderId': undefined,
|
||||
'timestamp': timestamp,
|
||||
'datetime': this.iso8601 (timestamp),
|
||||
'lastTradeTimestamp': undefined,
|
||||
@@ -339,6 +342,8 @@ module.exports = class acx extends Exchange {
|
||||
'trades': undefined,
|
||||
'fee': undefined,
|
||||
'info': order,
|
||||
'cost': undefined,
|
||||
'average': undefined,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -469,6 +469,7 @@ module.exports = class anxpro extends Exchange {
|
||||
'cost': cost,
|
||||
'fee': undefined,
|
||||
'info': trade,
|
||||
'takerOrMaker': undefined,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -974,6 +975,7 @@ module.exports = class anxpro extends Exchange {
|
||||
const cost = executedAverageRate * filled;
|
||||
return {
|
||||
'id': this.safeString (order, 'orderId'),
|
||||
'clientOrderId': undefined,
|
||||
'symbol': symbol,
|
||||
'timestamp': timestamp,
|
||||
'datetime': this.iso8601 (timestamp),
|
||||
@@ -989,6 +991,7 @@ module.exports = class anxpro extends Exchange {
|
||||
'fee': undefined,
|
||||
'trades': trades,
|
||||
'info': order,
|
||||
'average': undefined,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1066,6 +1069,7 @@ module.exports = class anxpro extends Exchange {
|
||||
return {
|
||||
'info': order,
|
||||
'id': id,
|
||||
'clientOrderId': undefined,
|
||||
'symbol': symbol,
|
||||
'timestamp': timestamp,
|
||||
'datetime': this.iso8601 (timestamp),
|
||||
@@ -1080,6 +1084,7 @@ module.exports = class anxpro extends Exchange {
|
||||
'status': status,
|
||||
'fee': fee,
|
||||
'trades': trades,
|
||||
'average': undefined,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -166,6 +166,7 @@ module.exports = class Exchange {
|
||||
'429': RateLimitExceeded,
|
||||
'404': ExchangeNotAvailable,
|
||||
'409': ExchangeNotAvailable,
|
||||
'410': ExchangeNotAvailable,
|
||||
'500': ExchangeNotAvailable,
|
||||
'501': ExchangeNotAvailable,
|
||||
'502': ExchangeNotAvailable,
|
||||
@@ -461,42 +462,50 @@ module.exports = class Exchange {
|
||||
}
|
||||
}
|
||||
|
||||
print (... args) {
|
||||
console.log (... args)
|
||||
}
|
||||
|
||||
fetch (url, method = 'GET', headers = undefined, body = undefined) {
|
||||
|
||||
if (isNode && this.userAgent) {
|
||||
if (typeof this.userAgent === 'string')
|
||||
if (typeof this.userAgent === 'string') {
|
||||
headers = extend ({ 'User-Agent': this.userAgent }, headers)
|
||||
else if ((typeof this.userAgent === 'object') && ('User-Agent' in this.userAgent))
|
||||
} else if ((typeof this.userAgent === 'object') && ('User-Agent' in this.userAgent)) {
|
||||
headers = extend (this.userAgent, headers)
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof this.proxy === 'function') {
|
||||
|
||||
url = this.proxy (url)
|
||||
if (isNode)
|
||||
if (isNode) {
|
||||
headers = extend ({ 'Origin': this.origin }, headers)
|
||||
}
|
||||
|
||||
} else if (typeof this.proxy === 'string') {
|
||||
|
||||
if (this.proxy.length)
|
||||
if (isNode)
|
||||
headers = extend ({ 'Origin': this.origin }, headers)
|
||||
if (this.proxy.length && isNode) {
|
||||
headers = extend ({ 'Origin': this.origin }, headers)
|
||||
}
|
||||
|
||||
url = this.proxy + url
|
||||
}
|
||||
|
||||
headers = extend (this.headers, headers)
|
||||
|
||||
if (this.verbose)
|
||||
console.log ("fetch:\n", this.id, method, url, "\nRequest:\n", headers, "\n", body, "\n")
|
||||
if (this.verbose) {
|
||||
this.print ("fetch:\n", this.id, method, url, "\nRequest:\n", headers, "\n", body, "\n")
|
||||
}
|
||||
|
||||
return this.executeRestRequest (url, method, headers, body)
|
||||
}
|
||||
|
||||
async fetch2 (path, type = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
|
||||
|
||||
if (this.enableRateLimit)
|
||||
if (this.enableRateLimit) {
|
||||
await this.throttle (this.rateLimit)
|
||||
}
|
||||
|
||||
const request = this.sign (path, type, method, params, headers, body)
|
||||
return this.fetch (request.url, request.method, request.headers, request.body)
|
||||
@@ -611,8 +620,9 @@ module.exports = class Exchange {
|
||||
this.last_json_response = json // FIXME: for those classes that haven't switched to handleErrors yet
|
||||
}
|
||||
|
||||
if (this.verbose)
|
||||
console.log ("handleRestResponse:\n", this.id, method, url, response.status, response.statusText, "\nResponse:\n", responseHeaders, "\n", responseBody, "\n")
|
||||
if (this.verbose) {
|
||||
this.print ("handleRestResponse:\n", this.id, method, url, response.status, response.statusText, "\nResponse:\n", responseHeaders, "\n", responseBody, "\n")
|
||||
}
|
||||
|
||||
this.handleErrors (response.status, response.statusText, url, method, responseHeaders, responseBody, json, requestHeaders, requestBody)
|
||||
this.defaultErrorHandler (response.status, response.statusText, url, method, responseHeaders, responseBody, json)
|
||||
@@ -634,7 +644,7 @@ module.exports = class Exchange {
|
||||
if (currencies) {
|
||||
this.currencies = deepExtend (currencies, this.currencies)
|
||||
} else {
|
||||
const baseCurrencies =
|
||||
let baseCurrencies =
|
||||
values.filter (market => 'base' in market)
|
||||
.map (market => ({
|
||||
id: market.baseId || market.base,
|
||||
@@ -642,7 +652,7 @@ module.exports = class Exchange {
|
||||
code: market.base,
|
||||
precision: market.precision ? (market.precision.base || market.precision.amount) : 8,
|
||||
}))
|
||||
const quoteCurrencies =
|
||||
let quoteCurrencies =
|
||||
values.filter (market => 'quote' in market)
|
||||
.map (market => ({
|
||||
id: market.quoteId || market.quote,
|
||||
@@ -650,6 +660,10 @@ module.exports = class Exchange {
|
||||
code: market.quote,
|
||||
precision: market.precision ? (market.precision.quote || market.precision.price) : 8,
|
||||
}))
|
||||
baseCurrencies = sortBy (baseCurrencies, 'code')
|
||||
quoteCurrencies = sortBy (quoteCurrencies, 'code')
|
||||
this.baseCurrencies = indexBy (baseCurrencies, 'code')
|
||||
this.quoteCurrencies = indexBy (quoteCurrencies, 'code')
|
||||
const allCurrencies = baseCurrencies.concat (quoteCurrencies)
|
||||
const groupedCurrencies = groupBy (allCurrencies, 'code')
|
||||
const currencies = Object.keys (groupedCurrencies).map (code =>
|
||||
@@ -677,27 +691,19 @@ module.exports = class Exchange {
|
||||
return this.setMarkets (markets, currencies)
|
||||
}
|
||||
|
||||
async loadMarkets (reload = false, params = {}) {
|
||||
if (this.marketsLoaded) {
|
||||
if (reload) {
|
||||
return this.loadMarketsHelper (reload, params)
|
||||
}
|
||||
return this.markets
|
||||
} else {
|
||||
if (!this.marketsLoading) {
|
||||
this.marketsLoading = new Promise (async (resolve, reject) => {
|
||||
try {
|
||||
const result = await this.loadMarketsHelper (reload, params)
|
||||
this.marketsLoaded = true
|
||||
this.marketsLoading = false
|
||||
resolve (result)
|
||||
} catch (e) {
|
||||
reject (e)
|
||||
}
|
||||
})
|
||||
}
|
||||
return this.marketsLoading
|
||||
// is async (returns a promise)
|
||||
loadMarkets (reload = false, params = {}) {
|
||||
if ((reload && !this.reloadingMarkets) || !this.marketsLoading) {
|
||||
this.reloadingMarkets = true
|
||||
this.marketsLoading = this.loadMarketsHelper (reload, params).then ((resolved) => {
|
||||
this.reloadingMarkets = false
|
||||
return resolved
|
||||
}, (error) => {
|
||||
this.reloadingMarkets = false
|
||||
throw error
|
||||
})
|
||||
}
|
||||
return this.marketsLoading
|
||||
}
|
||||
|
||||
async loadAccounts (reload = false, params = {}) {
|
||||
@@ -737,43 +743,42 @@ module.exports = class Exchange {
|
||||
}
|
||||
|
||||
parseTradingViewOHLCV (ohlcvs, market = undefined, timeframe = '1m', since = undefined, limit = undefined) {
|
||||
const result = this.convertTradingViewToOHLCV (ohlcvs);
|
||||
return this.parseOHLCVs (result, market, timeframe, since, limit);
|
||||
const result = this.convertTradingViewToOHLCV (ohlcvs)
|
||||
return this.parseOHLCVs (result, market, timeframe, since, limit)
|
||||
}
|
||||
|
||||
convertTradingViewToOHLCV (ohlcvs) {
|
||||
convertTradingViewToOHLCV (ohlcvs, t = 't', o = 'o', h = 'h', l = 'l', c = 'c', v = 'v', ms = false) {
|
||||
const result = [];
|
||||
for (let i = 0; i < ohlcvs['t'].length; i++) {
|
||||
for (let i = 0; i < ohlcvs[t].length; i++) {
|
||||
result.push ([
|
||||
ohlcvs['t'][i] * 1000,
|
||||
ohlcvs['o'][i],
|
||||
ohlcvs['h'][i],
|
||||
ohlcvs['l'][i],
|
||||
ohlcvs['c'][i],
|
||||
ohlcvs['v'][i],
|
||||
]);
|
||||
ms ? ohlcvs[t][i] : (ohlcvs[t][i] * 1000),
|
||||
ohlcvs[o][i],
|
||||
ohlcvs[h][i],
|
||||
ohlcvs[l][i],
|
||||
ohlcvs[c][i],
|
||||
ohlcvs[v][i],
|
||||
])
|
||||
}
|
||||
return result;
|
||||
return result
|
||||
}
|
||||
|
||||
convertOHLCVToTradingView (ohlcvs) {
|
||||
const result = {
|
||||
't': [],
|
||||
'o': [],
|
||||
'h': [],
|
||||
'l': [],
|
||||
'c': [],
|
||||
'v': [],
|
||||
};
|
||||
convertOHLCVToTradingView (ohlcvs, t = 't', o = 'o', h = 'h', l = 'l', c = 'c', v = 'v', ms = false) {
|
||||
const result = {}
|
||||
result[t] = []
|
||||
result[o] = []
|
||||
result[h] = []
|
||||
result[l] = []
|
||||
result[c] = []
|
||||
result[v] = []
|
||||
for (let i = 0; i < ohlcvs.length; i++) {
|
||||
result['t'].push (parseInt (ohlcvs[i][0] / 1000));
|
||||
result['o'].push (ohlcvs[i][1]);
|
||||
result['h'].push (ohlcvs[i][2]);
|
||||
result['l'].push (ohlcvs[i][3]);
|
||||
result['c'].push (ohlcvs[i][4]);
|
||||
result['v'].push (ohlcvs[i][5]);
|
||||
result[t].push (ms ? ohlcvs[i][0] : parseInt (ohlcvs[i][0] / 1000))
|
||||
result[o].push (ohlcvs[i][1])
|
||||
result[h].push (ohlcvs[i][2])
|
||||
result[l].push (ohlcvs[i][3])
|
||||
result[c].push (ohlcvs[i][4])
|
||||
result[v].push (ohlcvs[i][5])
|
||||
}
|
||||
return result;
|
||||
return result
|
||||
}
|
||||
|
||||
fetchTicker (symbol, params = {}) {
|
||||
@@ -1038,27 +1043,34 @@ module.exports = class Exchange {
|
||||
return this.markets;
|
||||
}
|
||||
|
||||
filterBySinceLimit (array, since = undefined, limit = undefined, key = 'timestamp') {
|
||||
if (since !== undefined && since !== null)
|
||||
array = array.filter (entry => entry[key] >= since)
|
||||
if (limit !== undefined && limit !== null)
|
||||
array = array.slice (0, limit)
|
||||
filterBySinceLimit (array, since = undefined, limit = undefined, key = 'timestamp', tail = false) {
|
||||
const sinceIsDefined = (since !== undefined && since !== null)
|
||||
if (sinceIsDefined) {
|
||||
array = array.filter ((entry) => entry[key] >= since)
|
||||
}
|
||||
if (limit !== undefined && limit !== null) {
|
||||
array = (tail && !sinceIsDefined) ? array.slice (-limit) : array.slice (0, limit)
|
||||
}
|
||||
return array
|
||||
}
|
||||
|
||||
filterByValueSinceLimit (array, field, value = undefined, since = undefined, limit = undefined) {
|
||||
filterByValueSinceLimit (array, field, value = undefined, since = undefined, limit = undefined, key = 'timestamp', tail = false) {
|
||||
|
||||
const valueIsDefined = value !== undefined && value !== null
|
||||
const sinceIsDefined = since !== undefined && since !== null
|
||||
|
||||
// single-pass filter for both symbol and since
|
||||
if (valueIsDefined || sinceIsDefined)
|
||||
array = Object.values (array).filter (entry =>
|
||||
((valueIsDefined ? (entry[field] === value) : true) &&
|
||||
(sinceIsDefined ? (entry.timestamp >= since) : true)))
|
||||
if (valueIsDefined || sinceIsDefined) {
|
||||
array = Object.values (array).filter ((entry) =>
|
||||
((valueIsDefined ? (entry[field] === value) : true) &&
|
||||
(sinceIsDefined ? (entry[key] >= since) : true)))
|
||||
}
|
||||
|
||||
if (limit !== undefined && limit !== null)
|
||||
array = Object.values (array).slice (0, limit)
|
||||
if (limit !== undefined && limit !== null) {
|
||||
array = ((tail && !sinceIsDefined) ?
|
||||
Object.values (array).slice (-limit) :
|
||||
Object.values (array).slice (0, limit))
|
||||
}
|
||||
|
||||
return array
|
||||
}
|
||||
@@ -1076,13 +1088,15 @@ module.exports = class Exchange {
|
||||
objects = Object.values (objects)
|
||||
|
||||
// return all of them if no values were passed
|
||||
if (values === undefined || values === null)
|
||||
if (values === undefined || values === null) {
|
||||
return indexed ? indexBy (objects, key) : objects
|
||||
}
|
||||
|
||||
const result = []
|
||||
for (let i = 0; i < objects.length; i++) {
|
||||
if (values.includes (objects[i][key]))
|
||||
if (values.includes (objects[i][key])) {
|
||||
result.push (objects[i])
|
||||
}
|
||||
}
|
||||
|
||||
return indexed ? indexBy (result, key) : result
|
||||
@@ -1093,7 +1107,7 @@ module.exports = class Exchange {
|
||||
// if (!this.isArray (trades)) {
|
||||
// throw new ExchangeError (this.id + ' parseTrades expected an array in the trades argument, but got ' + typeof trades);
|
||||
// }
|
||||
let result = Object.values (trades || []).map (trade => this.extend (this.parseTrade (trade, market), params))
|
||||
let result = Object.values (trades || []).map ((trade) => this.extend (this.parseTrade (trade, market), params))
|
||||
result = sortBy (result, 'timestamp')
|
||||
const symbol = (market !== undefined) ? market['symbol'] : undefined
|
||||
return this.filterBySymbolSinceLimit (result, symbol, since, limit)
|
||||
@@ -1104,7 +1118,7 @@ module.exports = class Exchange {
|
||||
// if (!this.isArray (transactions)) {
|
||||
// throw new ExchangeError (this.id + ' parseTransactions expected an array in the transactions argument, but got ' + typeof transactions);
|
||||
// }
|
||||
let result = Object.values (transactions || []).map (transaction => this.extend (this.parseTransaction (transaction, currency), params))
|
||||
let result = Object.values (transactions || []).map ((transaction) => this.extend (this.parseTransaction (transaction, currency), params))
|
||||
result = this.sortBy (result, 'timestamp');
|
||||
const code = (currency !== undefined) ? currency['code'] : undefined;
|
||||
return this.filterByCurrencySinceLimit (result, code, since, limit);
|
||||
@@ -218,22 +218,19 @@ module.exports =
|
||||
/* ............................................. */
|
||||
|
||||
, deepExtend: function deepExtend (...xs) {
|
||||
|
||||
let out = undefined
|
||||
|
||||
for (const x of xs) {
|
||||
|
||||
if (isDictionary (x)) {
|
||||
|
||||
if (!isObject (out))
|
||||
if (!isObject (out)) {
|
||||
out = {}
|
||||
|
||||
for (const k in x)
|
||||
}
|
||||
for (const k in x) {
|
||||
out[k] = deepExtend (out[k], x[k])
|
||||
|
||||
} else out = x
|
||||
}
|
||||
} else {
|
||||
out = x
|
||||
}
|
||||
}
|
||||
|
||||
return out
|
||||
}
|
||||
|
||||
@@ -45,23 +45,27 @@ function numberToString (x) { // avoids scientific notation for too large and to
|
||||
|
||||
if (typeof x === 'string') return x
|
||||
|
||||
const s = x.toString ()
|
||||
if (Math.abs (x) < 1.0) {
|
||||
const s = x.toString ()
|
||||
const e = parseInt (s.split ('e-')[1])
|
||||
const neg = (s[0] === '-')
|
||||
if (e) {
|
||||
x *= Math.pow (10, e - 1)
|
||||
x = (neg ? '-' : '') + '0.' + (new Array (e)).join ('0') + x.toString ().substring (neg ? 3 : 2)
|
||||
return x
|
||||
}
|
||||
} else {
|
||||
let e = parseInt (x.toString ().split ('+')[1])
|
||||
if (e > 20) {
|
||||
e -= 20
|
||||
x /= Math.pow (10, e)
|
||||
x += (new Array (e + 1)).join ('0')
|
||||
const parts = s.split ('e')
|
||||
if (parts[1]) {
|
||||
let e = parseInt (parts[1])
|
||||
const m = parts[0].split ('.')
|
||||
if (m[1]) {
|
||||
e -= m[1].length
|
||||
}
|
||||
return m[0] + m[1] + (new Array (e + 1)).join ('0')
|
||||
}
|
||||
}
|
||||
return x.toString ()
|
||||
return s;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -108,8 +112,9 @@ const decimalToPrecision = (x, roundingMode
|
||||
if (countingMode === TICK_SIZE) {
|
||||
const precisionDigitsString = decimalToPrecision (numPrecisionDigits, ROUND, 100, DECIMAL_PLACES, NO_PADDING)
|
||||
const newNumPrecisionDigits = precisionFromString (precisionDigitsString)
|
||||
const missing = x % numPrecisionDigits
|
||||
let missing = x % numPrecisionDigits
|
||||
// See: https://github.com/ccxt/ccxt/pull/6486
|
||||
missing = Number (decimalToPrecision (missing, ROUND, 8, DECIMAL_PLACES, NO_PADDING));
|
||||
const fpError = decimalToPrecision (missing / numPrecisionDigits, ROUND, Math.max (newNumPrecisionDigits, 8), DECIMAL_PLACES, NO_PADDING)
|
||||
if (precisionFromString (fpError) !== 0) {
|
||||
if (roundingMode === ROUND) {
|
||||
@@ -29,7 +29,7 @@ module.exports = class bcex extends Exchange {
|
||||
'fetchTradingLimits': true,
|
||||
},
|
||||
'urls': {
|
||||
'logo': 'https://user-images.githubusercontent.com/1294454/43362240-21c26622-92ee-11e8-9464-5801ec526d77.jpg',
|
||||
'logo': 'https://user-images.githubusercontent.com/51840849/77231516-851c6900-6bac-11ea-8fd6-ee5c23eddbd4.jpg',
|
||||
'api': 'https://www.bcex.top',
|
||||
'www': 'https://www.bcex.top',
|
||||
'doc': 'https://github.com/BCEX-TECHNOLOGY-LIMITED/API_Docs/wiki/Interface',
|
||||
@@ -75,8 +75,8 @@ module.exports = class bcex extends Exchange {
|
||||
'trading': {
|
||||
'tierBased': false,
|
||||
'percentage': true,
|
||||
'buy': 0.0,
|
||||
'sell': 0.2 / 100,
|
||||
'maker': 0.1 / 100,
|
||||
'taker': 0.2 / 100,
|
||||
},
|
||||
'funding': {
|
||||
'tierBased': false,
|
||||
@@ -369,6 +369,7 @@ module.exports = class bcex extends Exchange {
|
||||
'cost': cost,
|
||||
'order': orderId,
|
||||
'fee': undefined,
|
||||
'takerOrMaker': undefined,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -517,6 +518,8 @@ module.exports = class bcex extends Exchange {
|
||||
'remaining': this.safeFloat (order, 'numberover'),
|
||||
'status': status,
|
||||
'fee': undefined,
|
||||
'clientOrderId': undefined,
|
||||
'trades': undefined,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -543,6 +546,7 @@ module.exports = class bcex extends Exchange {
|
||||
const result = {
|
||||
'info': order,
|
||||
'id': id,
|
||||
'clientOrderId': undefined,
|
||||
'timestamp': timestamp,
|
||||
'datetime': this.iso8601 (timestamp),
|
||||
'lastTradeTimestamp': undefined,
|
||||
@@ -557,6 +561,7 @@ module.exports = class bcex extends Exchange {
|
||||
'remaining': remaining,
|
||||
'status': status,
|
||||
'fee': fee,
|
||||
'trades': undefined,
|
||||
};
|
||||
return result;
|
||||
}
|
||||
@@ -671,16 +676,4 @@ module.exports = class bcex extends Exchange {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
calculateFee (symbol, type, side, amount, price, takerOrMaker = 'taker', params = {}) {
|
||||
const market = this.markets[symbol];
|
||||
const rate = market[side];
|
||||
const cost = parseFloat (this.costToPrecision (symbol, amount * price));
|
||||
return {
|
||||
'type': takerOrMaker,
|
||||
'currency': market['quote'],
|
||||
'rate': rate,
|
||||
'cost': parseFloat (this.feeToPrecision (symbol, rate * cost)),
|
||||
};
|
||||
}
|
||||
};
|
||||
@@ -2,18 +2,22 @@
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
const hitbtc2 = require ('./hitbtc2');
|
||||
const hitbtc = require ('./hitbtc');
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
module.exports = class bequant extends hitbtc2 {
|
||||
module.exports = class bequant extends hitbtc {
|
||||
describe () {
|
||||
return this.deepExtend (super.describe (), {
|
||||
'id': 'bequant',
|
||||
'name': 'Bequant',
|
||||
'countries': [ 'MT' ], // Malta
|
||||
'pro': true,
|
||||
'urls': {
|
||||
'logo': 'https://user-images.githubusercontent.com/1294454/55248342-a75dfe00-525a-11e9-8aa2-05e9dca943c6.jpg',
|
||||
'api': 'https://api.bequant.io',
|
||||
'api': {
|
||||
'public': 'https://api.bequant.io',
|
||||
'private': 'https://api.bequant.io',
|
||||
},
|
||||
'www': 'https://bequant.io',
|
||||
'doc': [
|
||||
'https://api.bequant.io/',
|
||||
@@ -46,14 +46,14 @@ module.exports = class bibox extends Exchange {
|
||||
'1w': 'week',
|
||||
},
|
||||
'urls': {
|
||||
'logo': 'https://user-images.githubusercontent.com/1294454/34902611-2be8bf1a-f830-11e7-91a2-11b2f292e750.jpg',
|
||||
'logo': 'https://user-images.githubusercontent.com/51840849/77257418-3262b000-6c85-11ea-8fb8-20bdf20b3592.jpg',
|
||||
'api': 'https://api.bibox.com',
|
||||
'www': 'https://www.bibox.com',
|
||||
'doc': [
|
||||
'https://biboxcom.github.io/en/',
|
||||
],
|
||||
'fees': 'https://bibox.zendesk.com/hc/en-us/articles/360002336133',
|
||||
'referral': 'https://www.bibox.com/signPage?id=11114745&lang=en',
|
||||
'referral': 'https://w2.bibox.com/login/register?invite_code=05Kj3I',
|
||||
},
|
||||
'api': {
|
||||
'public': {
|
||||
@@ -86,7 +86,7 @@ module.exports = class bibox extends Exchange {
|
||||
'tierBased': false,
|
||||
'percentage': true,
|
||||
'taker': 0.001,
|
||||
'maker': 0.001,
|
||||
'maker': 0.0008,
|
||||
},
|
||||
'funding': {
|
||||
'tierBased': false,
|
||||
@@ -713,6 +713,7 @@ module.exports = class bibox extends Exchange {
|
||||
return {
|
||||
'info': order,
|
||||
'id': id,
|
||||
'clientOrderId': undefined,
|
||||
'timestamp': timestamp,
|
||||
'datetime': this.iso8601 (timestamp),
|
||||
'lastTradeTimestamp': undefined,
|
||||
@@ -727,6 +728,7 @@ module.exports = class bibox extends Exchange {
|
||||
'remaining': remaining,
|
||||
'status': status,
|
||||
'fee': fee,
|
||||
'trades': undefined,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -735,6 +735,7 @@ module.exports = class bigone extends Exchange {
|
||||
return {
|
||||
'info': order,
|
||||
'id': id,
|
||||
'clientOrderId': undefined,
|
||||
'timestamp': timestamp,
|
||||
'datetime': this.iso8601 (timestamp),
|
||||
'lastTradeTimestamp': lastTradeTimestamp,
|
||||
@@ -922,7 +923,7 @@ module.exports = class bigone extends Exchange {
|
||||
// }
|
||||
//
|
||||
const trades = this.safeValue (response, 'data', []);
|
||||
return this.parseTrades (trades, market, since, limit, params);
|
||||
return this.parseTrades (trades, market, since, limit);
|
||||
}
|
||||
|
||||
parseOrderStatus (status) {
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
const Exchange = require ('./base/Exchange');
|
||||
const { ExchangeError, ArgumentsRequired, ExchangeNotAvailable, InsufficientFunds, OrderNotFound, InvalidOrder, DDoSProtection, InvalidNonce, AuthenticationError, InvalidAddress, RateLimitExceeded, PermissionDenied } = require ('./base/errors');
|
||||
const { ROUND } = require ('./base/functions/number');
|
||||
const { ROUND, TRUNCATE } = require ('./base/functions/number');
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
@@ -57,6 +57,10 @@ module.exports = class binance extends Exchange {
|
||||
},
|
||||
'urls': {
|
||||
'logo': 'https://user-images.githubusercontent.com/1294454/29604020-d5483cdc-87ee-11e7-94c7-d1a8d9169293.jpg',
|
||||
'test': {
|
||||
'fapiPublic': 'https://testnet.binancefuture.com/fapi/v1',
|
||||
'fapiPrivate': 'https://testnet.binancefuture.com/fapi/v1',
|
||||
},
|
||||
'api': {
|
||||
'web': 'https://www.binance.com',
|
||||
'wapi': 'https://api.binance.com/wapi/v3',
|
||||
@@ -192,6 +196,8 @@ module.exports = class binance extends Exchange {
|
||||
'ticker/24hr',
|
||||
'ticker/price',
|
||||
'ticker/bookTicker',
|
||||
'allForceOrders',
|
||||
'openInterest',
|
||||
'leverageBracket',
|
||||
],
|
||||
},
|
||||
@@ -209,6 +215,8 @@ module.exports = class binance extends Exchange {
|
||||
'income',
|
||||
],
|
||||
'post': [
|
||||
'batchOrders',
|
||||
'positionSide/dual',
|
||||
'positionMargin',
|
||||
'marginType',
|
||||
'order',
|
||||
@@ -219,6 +227,7 @@ module.exports = class binance extends Exchange {
|
||||
'listenKey',
|
||||
],
|
||||
'delete': [
|
||||
'batchOrders',
|
||||
'order',
|
||||
'allOpenOrders',
|
||||
'listenKey',
|
||||
@@ -504,6 +513,13 @@ module.exports = class binance extends Exchange {
|
||||
'max': this.safeFloat (filter, 'maxQty'),
|
||||
};
|
||||
}
|
||||
if ('MARKET_LOT_SIZE' in filters) {
|
||||
const filter = this.safeValue (filters, 'MARKET_LOT_SIZE', {});
|
||||
entry['limits']['market'] = {
|
||||
'min': this.safeFloat (filter, 'minQty'),
|
||||
'max': this.safeFloat (filter, 'maxQty'),
|
||||
};
|
||||
}
|
||||
if ('MIN_NOTIONAL' in filters) {
|
||||
entry['limits']['cost']['min'] = this.safeFloat (filters['MIN_NOTIONAL'], 'minNotional');
|
||||
}
|
||||
@@ -678,7 +694,7 @@ module.exports = class binance extends Exchange {
|
||||
}
|
||||
|
||||
async fetchStatus (params = {}) {
|
||||
const response = await this.wapiGetSystemStatus ();
|
||||
const response = await this.wapiGetSystemStatus (params);
|
||||
let status = this.safeValue (response, 'status');
|
||||
if (status !== undefined) {
|
||||
status = (status === 0) ? 'ok' : 'maintenance';
|
||||
@@ -965,6 +981,46 @@ module.exports = class binance extends Exchange {
|
||||
}
|
||||
|
||||
parseOrder (order, market = undefined) {
|
||||
//
|
||||
// spot
|
||||
//
|
||||
// {
|
||||
// "symbol": "LTCBTC",
|
||||
// "orderId": 1,
|
||||
// "clientOrderId": "myOrder1",
|
||||
// "price": "0.1",
|
||||
// "origQty": "1.0",
|
||||
// "executedQty": "0.0",
|
||||
// "cummulativeQuoteQty": "0.0",
|
||||
// "status": "NEW",
|
||||
// "timeInForce": "GTC",
|
||||
// "type": "LIMIT",
|
||||
// "side": "BUY",
|
||||
// "stopPrice": "0.0",
|
||||
// "icebergQty": "0.0",
|
||||
// "time": 1499827319559,
|
||||
// "updateTime": 1499827319559,
|
||||
// "isWorking": true
|
||||
// }
|
||||
//
|
||||
// futures
|
||||
//
|
||||
// {
|
||||
// "symbol": "BTCUSDT",
|
||||
// "orderId": 1,
|
||||
// "clientOrderId": "myOrder1",
|
||||
// "price": "0.1",
|
||||
// "origQty": "1.0",
|
||||
// "executedQty": "1.0",
|
||||
// "cumQuote": "10.0",
|
||||
// "status": "NEW",
|
||||
// "timeInForce": "GTC",
|
||||
// "type": "LIMIT",
|
||||
// "side": "BUY",
|
||||
// "stopPrice": "0.0",
|
||||
// "updateTime": 1499827319559
|
||||
// }
|
||||
//
|
||||
const status = this.parseOrderStatus (this.safeString (order, 'status'));
|
||||
let symbol = undefined;
|
||||
const marketId = this.safeString (order, 'symbol');
|
||||
@@ -1049,9 +1105,11 @@ module.exports = class binance extends Exchange {
|
||||
cost = parseFloat (this.costToPrecision (symbol, cost));
|
||||
}
|
||||
}
|
||||
const clientOrderId = this.safeString (order, 'clientOrderId');
|
||||
return {
|
||||
'info': order,
|
||||
'id': id,
|
||||
'clientOrderId': clientOrderId,
|
||||
'timestamp': timestamp,
|
||||
'datetime': this.iso8601 (timestamp),
|
||||
'lastTradeTimestamp': undefined,
|
||||
@@ -1094,10 +1152,12 @@ module.exports = class binance extends Exchange {
|
||||
};
|
||||
if (uppercaseType === 'MARKET') {
|
||||
const quoteOrderQty = this.safeFloat (params, 'quoteOrderQty');
|
||||
const precision = market['precision']['price'];
|
||||
if (quoteOrderQty !== undefined) {
|
||||
request['quoteOrderQty'] = this.costToPrecision (symbol, quoteOrderQty);
|
||||
request['quoteOrderQty'] = this.decimalToPrecision (quoteOrderQty, TRUNCATE, precision, this.precisionMode);
|
||||
params = this.omit (params, 'quoteOrderQty');
|
||||
} else if (price !== undefined) {
|
||||
request['quoteOrderQty'] = this.costToPrecision (symbol, amount * price);
|
||||
request['quoteOrderQty'] = this.decimalToPrecision (amount * price, TRUNCATE, precision, this.precisionMode);
|
||||
} else {
|
||||
request['quantity'] = this.amountToPrecision (symbol, amount);
|
||||
}
|
||||
@@ -1772,7 +1832,7 @@ module.exports = class binance extends Exchange {
|
||||
if (api === 'wapi') {
|
||||
url += '.html';
|
||||
}
|
||||
const userDataStream = (path === 'userDataStream');
|
||||
const userDataStream = (path === 'userDataStream') || (path === 'listenKey');
|
||||
if (path === 'historicalTrades') {
|
||||
if (this.apiKey) {
|
||||
headers = {
|
||||
@@ -1882,7 +1942,7 @@ module.exports = class binance extends Exchange {
|
||||
}
|
||||
// a workaround for {"code":-2015,"msg":"Invalid API-key, IP, or permissions for action."}
|
||||
// despite that their message is very confusing, it is raised by Binance
|
||||
// on a temporary ban (the API key is valid, but disabled for a while)
|
||||
// on a temporary ban, the API key is valid, but disabled for a while
|
||||
if ((error === '-2015') && this.options['hasAlreadyAuthenticatedSuccessfully']) {
|
||||
throw new DDoSProtection (this.id + ' temporary banned: ' + body);
|
||||
}
|
||||
@@ -279,6 +279,7 @@ module.exports = class bit2c extends Exchange {
|
||||
const status = this.safeString (order, 'status');
|
||||
return {
|
||||
'id': id,
|
||||
'clientOrderId': undefined,
|
||||
'timestamp': timestamp,
|
||||
'datetime': this.iso8601 (timestamp),
|
||||
'lastTradeTimestamp': undefined,
|
||||
@@ -294,6 +295,7 @@ module.exports = class bit2c extends Exchange {
|
||||
'trades': undefined,
|
||||
'fee': undefined,
|
||||
'info': order,
|
||||
'average': undefined,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -313,6 +313,7 @@ module.exports = class bitbank extends Exchange {
|
||||
const side = this.safeStringLower (order, 'side');
|
||||
return {
|
||||
'id': id,
|
||||
'clientOrderId': undefined,
|
||||
'datetime': this.iso8601 (timestamp),
|
||||
'timestamp': timestamp,
|
||||
'lastTradeTimestamp': undefined,
|
||||
@@ -3,7 +3,7 @@
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
const Exchange = require ('./base/Exchange');
|
||||
const { InvalidNonce, InsufficientFunds, AuthenticationError, InvalidOrder, ExchangeError, OrderNotFound, AccountSuspended, BadSymbol } = require ('./base/errors');
|
||||
const { InvalidNonce, InsufficientFunds, AuthenticationError, InvalidOrder, ExchangeError, OrderNotFound, AccountSuspended, BadSymbol, OrderImmediatelyFillable, RateLimitExceeded } = require ('./base/errors');
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
@@ -53,6 +53,7 @@ module.exports = class bitbay extends Exchange {
|
||||
'https://github.com/BitBayNet/API',
|
||||
'https://docs.bitbay.net/v1.0.1-en/reference',
|
||||
],
|
||||
'support': 'https://support.bitbay.net',
|
||||
'fees': 'https://bitbay.net/en/fees',
|
||||
},
|
||||
'api': {
|
||||
@@ -157,6 +158,8 @@ module.exports = class bitbay extends Exchange {
|
||||
'FUNDS_NOT_SUFFICIENT': InsufficientFunds,
|
||||
'OFFER_FUNDS_NOT_EXCEEDING_MINIMUMS': InvalidOrder,
|
||||
'OFFER_NOT_FOUND': OrderNotFound,
|
||||
'OFFER_WOULD_HAVE_BEEN_PARTIALLY_FILLED': OrderImmediatelyFillable,
|
||||
'ACTION_LIMIT_EXCEEDED': RateLimitExceeded,
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -288,6 +291,7 @@ module.exports = class bitbay extends Exchange {
|
||||
}
|
||||
return {
|
||||
'id': this.safeString (order, 'id'),
|
||||
'clientOrderId': undefined,
|
||||
'info': order,
|
||||
'timestamp': timestamp,
|
||||
'datetime': this.iso8601 (timestamp),
|
||||
@@ -1043,6 +1047,7 @@ module.exports = class bitbay extends Exchange {
|
||||
'average': undefined,
|
||||
'fee': undefined,
|
||||
'trades': trades,
|
||||
'clientOrderId': undefined,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -845,6 +845,7 @@ module.exports = class bitfinex extends Exchange {
|
||||
return {
|
||||
'info': order,
|
||||
'id': id,
|
||||
'clientOrderId': undefined,
|
||||
'timestamp': timestamp,
|
||||
'datetime': this.iso8601 (timestamp),
|
||||
'lastTradeTimestamp': undefined,
|
||||
@@ -858,6 +859,8 @@ module.exports = class bitfinex extends Exchange {
|
||||
'filled': this.safeFloat (order, 'executed_amount'),
|
||||
'status': status,
|
||||
'fee': undefined,
|
||||
'cost': undefined,
|
||||
'trades': undefined,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -517,6 +517,26 @@ module.exports = class bitfinex2 extends bitfinex {
|
||||
return this.parseTicker (ticker, market);
|
||||
}
|
||||
|
||||
parseSymbol (marketId) {
|
||||
if (marketId === undefined) {
|
||||
return marketId;
|
||||
}
|
||||
marketId = marketId.replace ('t', '');
|
||||
let baseId = undefined;
|
||||
let quoteId = undefined;
|
||||
if (marketId.indexOf (':') >= 0) {
|
||||
const parts = marketId.split (':');
|
||||
baseId = parts[0];
|
||||
quoteId = parts[1];
|
||||
} else {
|
||||
baseId = marketId.slice (0, 3);
|
||||
quoteId = marketId.slice (3, 6);
|
||||
}
|
||||
const base = this.safeCurrencyCode (baseId);
|
||||
const quote = this.safeCurrencyCode (quoteId);
|
||||
return base + '/' + quote;
|
||||
}
|
||||
|
||||
parseTrade (trade, market = undefined) {
|
||||
//
|
||||
// fetchTrades (public)
|
||||
@@ -563,21 +583,29 @@ module.exports = class bitfinex2 extends bitfinex {
|
||||
const timestamp = trade[timestampIndex];
|
||||
if (isPrivate) {
|
||||
const marketId = trade[1];
|
||||
if (marketId !== undefined) {
|
||||
if (marketId in this.markets_by_id) {
|
||||
market = this.markets_by_id[marketId];
|
||||
symbol = market['symbol'];
|
||||
} else {
|
||||
symbol = marketId;
|
||||
}
|
||||
if (marketId in this.markets_by_id) {
|
||||
market = this.markets_by_id[marketId];
|
||||
symbol = market['symbol'];
|
||||
} else {
|
||||
symbol = this.parseSymbol (marketId);
|
||||
}
|
||||
orderId = trade[3].toString ();
|
||||
takerOrMaker = (trade[8] === 1) ? 'maker' : 'taker';
|
||||
const feeCost = trade[9];
|
||||
let feeCost = trade[9];
|
||||
const feeCurrency = this.safeCurrencyCode (trade[10]);
|
||||
if (feeCost !== undefined) {
|
||||
feeCost = -feeCost;
|
||||
if (symbol in this.markets) {
|
||||
feeCost = this.feeToPrecision (symbol, feeCost);
|
||||
} else {
|
||||
const currencyId = 'f' + feeCurrency;
|
||||
if (currencyId in this.currencies_by_id) {
|
||||
const currency = this.currencies_by_id[currencyId];
|
||||
feeCost = this.currencyToPrecision (currency['code'], feeCost);
|
||||
}
|
||||
}
|
||||
fee = {
|
||||
'cost': parseFloat (this.feeToPrecision (symbol, Math.abs (feeCost))),
|
||||
'cost': parseFloat (feeCost),
|
||||
'currency': feeCurrency,
|
||||
};
|
||||
}
|
||||
@@ -671,7 +699,9 @@ module.exports = class bitfinex2 extends bitfinex {
|
||||
'PARTIALLY FILLED': 'open',
|
||||
'EXECUTED': 'closed',
|
||||
'CANCELED': 'canceled',
|
||||
'CANCELED was: PARTIALLY FILLED': 'canceled',
|
||||
'INSUFFICIENT MARGIN': 'canceled',
|
||||
'INSUFFICIENT BALANCE (G1) was: PARTIALLY FILLED': 'canceled',
|
||||
'RSN_DUST': 'rejected',
|
||||
'RSN_PAUSE': 'rejected',
|
||||
};
|
||||
@@ -684,11 +714,15 @@ module.exports = class bitfinex2 extends bitfinex {
|
||||
const marketId = this.safeString (order, 3);
|
||||
if (marketId in this.markets_by_id) {
|
||||
market = this.markets_by_id[marketId];
|
||||
} else {
|
||||
symbol = this.parseSymbol (marketId);
|
||||
}
|
||||
if (market !== undefined) {
|
||||
if ((symbol === undefined) && (market !== undefined)) {
|
||||
symbol = market['symbol'];
|
||||
}
|
||||
const timestamp = this.safeTimestamp (order, 5);
|
||||
// https://github.com/ccxt/ccxt/issues/6686
|
||||
// const timestamp = this.safeTimestamp (order, 5);
|
||||
const timestamp = this.safeInteger (order, 5);
|
||||
const remaining = Math.abs (this.safeFloat (order, 6));
|
||||
const amount = Math.abs (this.safeFloat (order, 7));
|
||||
const filled = amount - remaining;
|
||||
@@ -704,9 +738,11 @@ module.exports = class bitfinex2 extends bitfinex {
|
||||
const price = this.safeFloat (order, 16);
|
||||
const average = this.safeFloat (order, 17);
|
||||
const cost = price * filled;
|
||||
const clientOrderId = this.safeString (order, 2);
|
||||
return {
|
||||
'info': order,
|
||||
'id': id,
|
||||
'clientOrderId': clientOrderId,
|
||||
'timestamp': timestamp,
|
||||
'datetime': this.iso8601 (timestamp),
|
||||
'lastTradeTimestamp': undefined,
|
||||
@@ -356,6 +356,7 @@ module.exports = class bitflyer extends Exchange {
|
||||
const id = this.safeString (order, 'child_order_acceptance_id');
|
||||
return {
|
||||
'id': id,
|
||||
'clientOrderId': undefined,
|
||||
'info': order,
|
||||
'timestamp': timestamp,
|
||||
'datetime': this.iso8601 (timestamp),
|
||||
@@ -370,6 +371,8 @@ module.exports = class bitflyer extends Exchange {
|
||||
'filled': filled,
|
||||
'remaining': remaining,
|
||||
'fee': fee,
|
||||
'average': undefined,
|
||||
'trades': undefined,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -312,6 +312,7 @@ module.exports = class bitforex extends Exchange {
|
||||
'cost': cost,
|
||||
'order': orderId,
|
||||
'fee': undefined,
|
||||
'takerOrMaker': undefined,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -465,6 +466,7 @@ module.exports = class bitforex extends Exchange {
|
||||
const result = {
|
||||
'info': order,
|
||||
'id': id,
|
||||
'clientOrderId': undefined,
|
||||
'timestamp': timestamp,
|
||||
'datetime': this.iso8601 (timestamp),
|
||||
'lastTradeTimestamp': lastTradeTimestamp,
|
||||
@@ -479,6 +481,7 @@ module.exports = class bitforex extends Exchange {
|
||||
'remaining': remaining,
|
||||
'status': status,
|
||||
'fee': fee,
|
||||
'trades': undefined,
|
||||
};
|
||||
return result;
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
const Exchange = require ('./base/Exchange');
|
||||
const { ExchangeError, ExchangeNotAvailable, AuthenticationError, BadRequest, PermissionDenied, InvalidAddress } = require ('./base/errors');
|
||||
const { ExchangeError, ExchangeNotAvailable, AuthenticationError, BadRequest, PermissionDenied, InvalidAddress, ArgumentsRequired } = require ('./base/errors');
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
@@ -129,6 +129,8 @@ module.exports = class bithumb extends Exchange {
|
||||
'max': undefined,
|
||||
},
|
||||
},
|
||||
'baseId': undefined,
|
||||
'quoteId': undefined,
|
||||
});
|
||||
}
|
||||
return result;
|
||||
@@ -342,18 +344,20 @@ module.exports = class bithumb extends Exchange {
|
||||
async cancelOrder (id, symbol = undefined, params = {}) {
|
||||
const side_in_params = ('side' in params);
|
||||
if (!side_in_params) {
|
||||
throw new ExchangeError (this.id + ' cancelOrder requires a `side` parameter (sell or buy) and a `currency` parameter');
|
||||
throw new ArgumentsRequired (this.id + ' cancelOrder requires a `symbol` argument and a `side` parameter (sell or buy)');
|
||||
}
|
||||
const currency = this.safeString (params, 'currency');
|
||||
if (currency === undefined) {
|
||||
throw new ExchangeError (this.id + ' cancelOrder requires a `currency` parameter (a currency id)');
|
||||
if (symbol === undefined) {
|
||||
throw new ArgumentsRequired (this.id + ' cancelOrder requires a `symbol` argument and a `side` parameter (sell or buy)');
|
||||
}
|
||||
const market = this.market (symbol);
|
||||
const side = (params['side'] === 'buy') ? 'bid' : 'ask';
|
||||
params = this.omit (params, [ 'side', 'currency' ]);
|
||||
// https://github.com/ccxt/ccxt/issues/6771
|
||||
const request = {
|
||||
'order_id': id,
|
||||
'type': side,
|
||||
'currency': currency,
|
||||
'order_currency': market['base'],
|
||||
'payment_currency': market['quote'],
|
||||
};
|
||||
return await this.privatePostTradeCancel (this.extend (request, params));
|
||||
}
|
||||
@@ -370,7 +374,7 @@ module.exports = class bithumb extends Exchange {
|
||||
if (currency === 'XRP' || currency === 'XMR') {
|
||||
const destination = this.safeString (params, 'destination');
|
||||
if ((tag === undefined) && (destination === undefined)) {
|
||||
throw new ExchangeError (this.id + ' ' + code + ' withdraw() requires a tag argument or an extra destination param');
|
||||
throw new ArgumentsRequired (this.id + ' ' + code + ' withdraw() requires a tag argument or an extra destination param');
|
||||
} else if (tag !== undefined) {
|
||||
request['destination'] = tag;
|
||||
}
|
||||
@@ -42,6 +42,7 @@ module.exports = class bitmart extends Exchange {
|
||||
'www': 'https://www.bitmart.com/',
|
||||
'doc': 'https://github.com/bitmartexchange/bitmart-official-api-docs',
|
||||
'referral': 'http://www.bitmart.com/?r=rQCFLh',
|
||||
'fees': 'https://www.bitmart.com/fee/en',
|
||||
},
|
||||
'requiredCredentials': {
|
||||
'apiKey': true,
|
||||
@@ -249,6 +250,7 @@ module.exports = class bitmart extends Exchange {
|
||||
'precision': precision,
|
||||
'limits': limits,
|
||||
'info': market,
|
||||
'active': undefined,
|
||||
});
|
||||
}
|
||||
return result;
|
||||
@@ -682,6 +684,7 @@ module.exports = class bitmart extends Exchange {
|
||||
const type = undefined;
|
||||
return {
|
||||
'id': id,
|
||||
'clientOrderId': undefined,
|
||||
'info': order,
|
||||
'timestamp': timestamp,
|
||||
'datetime': this.iso8601 (timestamp),
|
||||
@@ -52,7 +52,7 @@ module.exports = class bitmax extends Exchange {
|
||||
'urls': {
|
||||
'logo': 'https://user-images.githubusercontent.com/1294454/66820319-19710880-ef49-11e9-8fbe-16be62a11992.jpg',
|
||||
'api': 'https://bitmax.io',
|
||||
'test': 'https://bitmax-test.io/api',
|
||||
'test': 'https://bitmax-test.io',
|
||||
'www': 'https://bitmax.io',
|
||||
'doc': [
|
||||
'https://github.com/bitmax-exchange/api-doc/blob/master/bitmax-api-doc-v1.2.md',
|
||||
@@ -121,12 +121,17 @@ module.exports = class bitmax extends Exchange {
|
||||
'exact': {
|
||||
'2100': AuthenticationError, // {"code":2100,"message":"ApiKeyFailure"}
|
||||
'5002': BadSymbol, // {"code":5002,"message":"Invalid Symbol"}
|
||||
'6001': BadSymbol, // {"code":6001,"message":"Trading is disabled on symbol."}
|
||||
'6010': InsufficientFunds, // {'code': 6010, 'message': 'Not enough balance.'}
|
||||
'60060': InvalidOrder, // { 'code': 60060, 'message': 'The order is already filled or canceled.' }
|
||||
'600503': InvalidOrder, // {"code":600503,"message":"Notional is too small."}
|
||||
},
|
||||
'broad': {},
|
||||
},
|
||||
'commonCurrencies': {
|
||||
'BTCBEAR': 'BEAR',
|
||||
'BTCBULL': 'BULL',
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -722,9 +727,11 @@ module.exports = class bitmax extends Exchange {
|
||||
'currency': this.safeString (order, 'feeAsset'),
|
||||
};
|
||||
const average = this.safeFloat (order, 'avgPrice');
|
||||
const clientOrderId = id;
|
||||
return {
|
||||
'info': order,
|
||||
'id': id,
|
||||
'clientOrderId': clientOrderId,
|
||||
'timestamp': timestamp,
|
||||
'datetime': this.iso8601 (timestamp),
|
||||
'lastTradeTimestamp': undefined,
|
||||
@@ -1145,7 +1152,7 @@ module.exports = class bitmax extends Exchange {
|
||||
headers['x-auth-coid'] = coid;
|
||||
}
|
||||
const signature = this.hmac (this.encode (auth), this.encode (this.secret), 'sha256', 'base64');
|
||||
headers['x-auth-signature'] = signature;
|
||||
headers['x-auth-signature'] = this.decode (signature);
|
||||
if (method === 'GET') {
|
||||
if (Object.keys (query).length) {
|
||||
url += '?' + this.urlencode (query);
|
||||
@@ -53,7 +53,7 @@ module.exports = class bitmex extends Exchange {
|
||||
'https://github.com/BitMEX/api-connectors/tree/master/official-http',
|
||||
],
|
||||
'fees': 'https://www.bitmex.com/app/fees',
|
||||
'referral': 'https://www.bitmex.com/register/rm3C16',
|
||||
'referral': 'https://www.bitmex.com/register/upZpOX',
|
||||
},
|
||||
'api': {
|
||||
'public': {
|
||||
@@ -1111,9 +1111,11 @@ module.exports = class bitmex extends Exchange {
|
||||
const id = this.safeString (order, 'orderID');
|
||||
const type = this.safeStringLower (order, 'ordType');
|
||||
const side = this.safeStringLower (order, 'side');
|
||||
const clientOrderId = this.safeString (order, 'clOrdID');
|
||||
return {
|
||||
'info': order,
|
||||
'id': id,
|
||||
'clientOrderId': clientOrderId,
|
||||
'timestamp': timestamp,
|
||||
'datetime': this.iso8601 (timestamp),
|
||||
'lastTradeTimestamp': lastTradeTimestamp,
|
||||
@@ -1128,6 +1130,7 @@ module.exports = class bitmex extends Exchange {
|
||||
'remaining': remaining,
|
||||
'status': status,
|
||||
'fee': undefined,
|
||||
'trades': undefined,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -139,6 +139,7 @@ module.exports = class bitso extends Exchange {
|
||||
'info': market,
|
||||
'limits': limits,
|
||||
'precision': precision,
|
||||
'active': undefined,
|
||||
});
|
||||
}
|
||||
return result;
|
||||
@@ -369,9 +370,11 @@ module.exports = class bitso extends Exchange {
|
||||
filled = amount - remaining;
|
||||
}
|
||||
}
|
||||
const clientOrderId = this.safeString (order, 'client_id');
|
||||
return {
|
||||
'info': order,
|
||||
'id': id,
|
||||
'clientOrderId': clientOrderId,
|
||||
'timestamp': timestamp,
|
||||
'datetime': this.iso8601 (timestamp),
|
||||
'lastTradeTimestamp': undefined,
|
||||
@@ -385,6 +388,8 @@ module.exports = class bitso extends Exchange {
|
||||
'filled': filled,
|
||||
'status': status,
|
||||
'fee': undefined,
|
||||
'average': undefined,
|
||||
'trades': undefined,
|
||||
};
|
||||
}
|
||||
|
||||