Skip to content

Commit

Permalink
1.33.95
Browse files Browse the repository at this point in the history
[ci skip]
  • Loading branch information
Travis CI committed Sep 3, 2020
1 parent c1e2514 commit 40d30a0
Show file tree
Hide file tree
Showing 13 changed files with 119 additions and 121 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,13 +226,13 @@ console.log (ccxt.exchanges) // print all available exchanges

All-in-one browser bundle (dependencies included), served from a CDN of your choice:

* jsDelivr: https://cdn.jsdelivr.net/npm/[email protected].94/dist/ccxt.browser.js
* unpkg: https://unpkg.com/[email protected].94/dist/ccxt.browser.js
* jsDelivr: https://cdn.jsdelivr.net/npm/[email protected].95/dist/ccxt.browser.js
* unpkg: https://unpkg.com/[email protected].95/dist/ccxt.browser.js

CDNs are not updated in real-time and may have delays. Defaulting to the most recent version without specifying the version number is not recommended. Please, keep in mind that we are not responsible for the correct operation of those CDN servers.

```HTML
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/[email protected].94/dist/ccxt.browser.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/[email protected].95/dist/ccxt.browser.js"></script>
```

Creates a global `ccxt` object:
Expand Down
2 changes: 1 addition & 1 deletion ccxt.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const Exchange = require ('./js/base/Exchange')
//-----------------------------------------------------------------------------
// this is updated by vss.js when building

const version = '1.33.94'
const version = '1.33.95'

Exchange.ccxtVersion = version

Expand Down
202 changes: 100 additions & 102 deletions dist/ccxt.browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const Exchange = require ('./js/base/Exchange')
//-----------------------------------------------------------------------------
// this is updated by vss.js when building

const version = '1.33.94'
const version = '1.33.95'

Exchange.ccxtVersion = version

Expand Down Expand Up @@ -3710,40 +3710,31 @@ module.exports['byteArrayToWordArray'] = byteArrayToWordArray
},{"../../static_dependencies/BN/bn":122,"../../static_dependencies/crypto-js/crypto-js":123,"../../static_dependencies/qs/index":158}],11:[function(require,module,exports){
"use strict";

/* ------------------------------------------------------------------------ */
// ----------------------------------------------------------------------------

const { isObject, isNumber, isDictionary, isArray } = require ('./type')

/* ------------------------------------------------------------------------ */
// ----------------------------------------------------------------------------

const keys = Object.keys

, values = x => !isArray (x) // don't copy arrays if they're already arrays!
? Object.values (x)
: x

, index = x => new Set (values (x))

, values = (x) => ((!isArray (x)) ? Object.values (x) : x) // don't copy arrays if they're already arrays
, index = (x) => new Set (values (x))
, extend = (...args) => Object.assign ({}, ...args) // NB: side-effect free
, clone = (x) => (isArray (x) ? Array.from (x) : extend (x)) // clone arrays or objects

, clone = x => isArray (x)
? Array.from (x) // clones arrays
: extend (x) // clones objects

/* ------------------------------------------------------------------------ */

module.exports =
// ----------------------------------------------------------------------------

{ keys
module.exports = {
keys
, values
, extend
, clone
, index
, ordered: x => x // a stub to keep assoc keys in order (in JS it does nothing, it's mostly for Python)
, unique: x => Array.from (index (x))
, ordered: (x) => x // a stub to keep assoc keys in order (in JS it does nothing, it's mostly for Python)
, unique: (x) => Array.from (index (x))
, arrayConcat: (a, b) => a.concat (b)

/* ............................................. */
// ------------------------------------------------------------------------

, inArray (needle, haystack) {

Expand All @@ -3756,12 +3747,13 @@ module.exports =
}

, isEmpty (object) {
if (!object)
return true;
if (!object) {
return true
}
return (Array.isArray (object) ? object : Object.keys (object)).length < 1;
}

/* ............................................. */
// ------------------------------------------------------------------------

, keysort (x, out = {}) {

Expand All @@ -3771,55 +3763,57 @@ module.exports =
return out
}

/* ............................................. */
// ------------------------------------------------------------------------

/*
Accepts a map/array of objects and a key name to be used as an index:
array = [
{ someKey: 'value1', anotherKey: 'anotherValue1' },
{ someKey: 'value2', anotherKey: 'anotherValue2' },
{ someKey: 'value3', anotherKey: 'anotherValue3' },
]
key = 'someKey'

Returns a map:
{
value1: { someKey: 'value1', anotherKey: 'anotherValue1' },
value2: { someKey: 'value2', anotherKey: 'anotherValue2' },
value3: { someKey: 'value3', anotherKey: 'anotherValue3' },
}
Accepts a map/array of objects and a key name to be used as an index:
array = [
{ someKey: 'value1', anotherKey: 'anotherValue1' },
{ someKey: 'value2', anotherKey: 'anotherValue2' },
{ someKey: 'value3', anotherKey: 'anotherValue3' },
]
key = 'someKey'

Returns a map:
{
value1: { someKey: 'value1', anotherKey: 'anotherValue1' },
value2: { someKey: 'value2', anotherKey: 'anotherValue2' },
value3: { someKey: 'value3', anotherKey: 'anotherValue3' },
}
*/

, indexBy (x, k, out = {}) {

for (const v of values (x))
if (k in v)
for (const v of values (x)) {
if (k in v) {
out[v[k]] = v
}
}

return out
}

/* ............................................. */
// ------------------------------------------------------------------------

/*
Accepts a map/array of objects and a key name to be used as a grouping parameter:
array = [
{ someKey: 'value1', anotherKey: 'anotherValue1' },
{ someKey: 'value1', anotherKey: 'anotherValue2' },
{ someKey: 'value3', anotherKey: 'anotherValue3' },
]
key = 'someKey'

Returns a map:
{
value1: [
Accepts a map/array of objects and a key name to be used as a grouping parameter:
array = [
{ someKey: 'value1', anotherKey: 'anotherValue1' },
{ someKey: 'value1', anotherKey: 'anotherValue2' },
]
value3: [
{ someKey: 'value3', anotherKey: 'anotherValue3' }
],
}
{ someKey: 'value3', anotherKey: 'anotherValue3' },
]
key = 'someKey'

Returns a map:
{
value1: [
{ someKey: 'value1', anotherKey: 'anotherValue1' },
{ someKey: 'value1', anotherKey: 'anotherValue2' },
]
value3: [
{ someKey: 'value3', anotherKey: 'anotherValue3' }
],
}
*/

, groupBy (x, k, out = {}) {
Expand All @@ -3834,61 +3828,68 @@ module.exports =
return out
}

/* ............................................. */
// ------------------------------------------------------------------------

/*
Accepts a map/array of objects, a key name and a key value to be used as a filter:
array = [
{ someKey: 'value1', anotherKey: 'anotherValue1' },
{ someKey: 'value2', anotherKey: 'anotherValue2' },
{ someKey: 'value3', anotherKey: 'anotherValue3' },
]
key = 'someKey'
value = 'value1'

Returns an array:
[
value1: { someKey: 'value1', anotherKey: 'anotherValue1' },
]
Accepts a map/array of objects, a key name and a key value to be used as a filter:
array = [
{ someKey: 'value1', anotherKey: 'anotherValue1' },
{ someKey: 'value2', anotherKey: 'anotherValue2' },
{ someKey: 'value3', anotherKey: 'anotherValue3' },
]
key = 'someKey'
value = 'value1'

Returns an array:
[
value1: { someKey: 'value1', anotherKey: 'anotherValue1' },
]
*/

, filterBy (x, k, value = undefined, out = []) {

for (const v of values (x))
if (v[k] === value)
for (const v of values (x)) {
if (v[k] === value) {
out.push (v)
}
}

return out
}

/* ............................................. */
// ------------------------------------------------------------------------
// NB: MUTATES ARRAY!

, sortBy: (array, // NB: MUTATES ARRAY!
key,
descending = false,
direction = descending ? -1 : 1) => array.sort ((a, b) =>
((a[key] < b[key]) ? -direction :
((a[key] > b[key]) ? direction : 0)))
, sortBy: (array, key, descending = false, direction = descending ? -1 : 1) => array.sort ((a, b) => {
if (a[key] < b[key]) {
return -direction
} else if (a[key] > b[key]) {
return direction
} else {
return 0
}
})

/* ............................................. */
// ------------------------------------------------------------------------

, flatten: function flatten (x, out = []) {

for (const v of x) {
if (isArray (v)) flatten (v, out)
else out.push (v)
if (isArray (v)) {
flatten (v, out)
} else {
out.push (v)
}
}

return out
}

/* ............................................. */
// ------------------------------------------------------------------------

, pluck: (x, k) => values (x)
.filter (v => k in v)
.map (v => v[k])
, pluck: (x, k) => values (x).filter ((v) => k in v).map ((v) => v[k])

/* ............................................. */
// ------------------------------------------------------------------------

, omit (x, ...args) {

Expand All @@ -3897,15 +3898,13 @@ module.exports =
const out = clone (x)

for (const k of args) {

if (isArray (k)) { // omit (x, ['a', 'b'])

for (const kk of k) {
delete out[kk]
}
} else {
delete out[k] // omit (x, 'a', 'b')
}

else delete out[k] // omit (x, 'a', 'b')
}

return out
Expand All @@ -3914,24 +3913,22 @@ module.exports =
return x
}

/* ............................................. */
// ------------------------------------------------------------------------

, sum (...xs) {

const ns = xs.filter (isNumber) // leave only numbers

return (ns.length > 0)
? ns.reduce ((a, b) => a + b, 0)
: undefined
return (ns.length > 0) ? ns.reduce ((a, b) => a + b, 0) : undefined
}

/* ............................................. */
// ------------------------------------------------------------------------

, deepExtend: function deepExtend (...xs) {
let out = undefined
for (const x of xs) {
if (isDictionary (x)) {
if (!isObject (out)) {
if (!isDictionary (out)) {
out = {}
}
for (const k in x) {
Expand All @@ -3944,7 +3941,7 @@ module.exports =
return out
}

/* ------------------------------------------------------------------------ */
// ----------------------------------------------------------------------------

}

Expand Down Expand Up @@ -4760,9 +4757,10 @@ const isNumber = Number.isFinite
, isInteger = Number.isInteger
, isArray = Array.isArray
, hasProps = o => ((o !== undefined) && (o !== null))
, isString = s => (typeof s === 'string')
, isString = s => (typeof s === 'string')
, isObject = o => ((o !== null) && (typeof o === 'object'))
, isDictionary = o => (isObject (o) && !isArray (o))
, isRegExp = o => (o instanceof RegExp)
, isDictionary = o => (isObject (o) && !isArray (o) && !isRegExp (o))
, isStringCoercible = x => ((hasProps (x) && x.toString) || isNumber (x))

/* ............................................. */
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ccxt",
"version": "1.33.94",
"version": "1.33.95",
"description": "A JavaScript / Python / PHP cryptocurrency trading library with support for 130+ exchanges",
"main": "./ccxt.js",
"unpkg": "dist/ccxt.browser.js",
Expand Down
4 changes: 2 additions & 2 deletions php/base/Exchange.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
use Elliptic\EdDSA;
use BN\BN;

$version = '1.33.94';
$version = '1.33.95';

// rounding mode
const TRUNCATE = 0;
Expand All @@ -55,7 +55,7 @@

class Exchange {

const VERSION = '1.33.94';
const VERSION = '1.33.95';

private static $base58_alphabet = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';
private static $base58_encoder = null;
Expand Down
Loading

0 comments on commit 40d30a0

Please sign in to comment.