ccxt 4.3.17 → 4.3.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -5
- package/dist/cjs/ccxt.js +6 -1
- package/dist/cjs/src/abstract/woofipro.js +9 -0
- package/dist/cjs/src/ascendex.js +3 -4
- package/dist/cjs/src/base/Exchange.js +43 -3
- package/dist/cjs/src/base/functions/crypto.js +10 -3
- package/dist/cjs/src/base/functions/encode.js +6 -3
- package/dist/cjs/src/base/functions/number.js +8 -5
- package/dist/cjs/src/base/functions/rsa.js +5 -5
- package/dist/cjs/src/bigone.js +1 -1
- package/dist/cjs/src/binance.js +32 -8
- package/dist/cjs/src/bitfinex.js +25 -1
- package/dist/cjs/src/bitfinex2.js +59 -51
- package/dist/cjs/src/bitget.js +1 -5
- package/dist/cjs/src/bitmart.js +3 -3
- package/dist/cjs/src/bitstamp.js +1 -3
- package/dist/cjs/src/bybit.js +1 -0
- package/dist/cjs/src/coinex.js +321 -537
- package/dist/cjs/src/coinlist.js +1 -2
- package/dist/cjs/src/deribit.js +1 -1
- package/dist/cjs/src/hollaex.js +3 -3
- package/dist/cjs/src/htx.js +1 -1
- package/dist/cjs/src/indodax.js +1 -1
- package/dist/cjs/src/latoken.js +1 -1
- package/dist/cjs/src/mexc.js +1 -1
- package/dist/cjs/src/novadax.js +0 -1
- package/dist/cjs/src/okx.js +17 -0
- package/dist/cjs/src/poloniex.js +1 -2
- package/dist/cjs/src/pro/bitget.js +136 -192
- package/dist/cjs/src/pro/bybit.js +4 -2
- package/dist/cjs/src/pro/coinbaseinternational.js +9 -1
- package/dist/cjs/src/pro/okx.js +85 -0
- package/dist/cjs/src/pro/woofipro.js +1263 -0
- package/dist/cjs/src/wavesexchange.js +2 -2
- package/dist/cjs/src/woo.js +17 -3
- package/dist/cjs/src/woofipro.js +2698 -0
- package/js/ccxt.d.ts +8 -2
- package/js/ccxt.js +6 -2
- package/js/src/abstract/bybit.d.ts +1 -0
- package/js/src/abstract/okx.d.ts +1 -0
- package/js/src/abstract/woofipro.d.ts +122 -0
- package/js/src/abstract/woofipro.js +11 -0
- package/js/src/ace.d.ts +2 -2
- package/js/src/ascendex.d.ts +5 -15
- package/js/src/ascendex.js +3 -4
- package/js/src/base/Exchange.d.ts +27 -18
- package/js/src/base/Exchange.js +43 -3
- package/js/src/base/functions/crypto.d.ts +1 -1
- package/js/src/base/functions/crypto.js +10 -3
- package/js/src/base/functions/encode.d.ts +1 -1
- package/js/src/base/functions/encode.js +6 -3
- package/js/src/base/functions/number.d.ts +1 -1
- package/js/src/base/functions/number.js +8 -5
- package/js/src/base/functions/rsa.js +6 -6
- package/js/src/base/types.d.ts +4 -0
- package/js/src/bigone.d.ts +4 -14
- package/js/src/bigone.js +1 -1
- package/js/src/binance.d.ts +13 -71
- package/js/src/binance.js +32 -8
- package/js/src/binancecoinm.d.ts +2 -22
- package/js/src/binanceusdm.d.ts +2 -22
- package/js/src/bingx.d.ts +4 -14
- package/js/src/bit2c.d.ts +2 -2
- package/js/src/bitbank.d.ts +2 -2
- package/js/src/bitbns.d.ts +2 -2
- package/js/src/bitfinex.d.ts +6 -16
- package/js/src/bitfinex.js +25 -1
- package/js/src/bitfinex2.d.ts +6 -16
- package/js/src/bitfinex2.js +59 -51
- package/js/src/bitflyer.d.ts +2 -2
- package/js/src/bitget.d.ts +7 -17
- package/js/src/bitget.js +1 -5
- package/js/src/bithumb.d.ts +3 -3
- package/js/src/bitmart.d.ts +5 -14
- package/js/src/bitmart.js +3 -3
- package/js/src/bitmex.d.ts +4 -4
- package/js/src/bitopro.d.ts +2 -2
- package/js/src/bitrue.d.ts +5 -5
- package/js/src/bitso.d.ts +2 -2
- package/js/src/bitstamp.d.ts +3 -3
- package/js/src/bitstamp.js +1 -3
- package/js/src/bitteam.d.ts +2 -2
- package/js/src/bitvavo.d.ts +5 -5
- package/js/src/bl3p.d.ts +2 -2
- package/js/src/blockchaincom.d.ts +2 -2
- package/js/src/blofin.d.ts +4 -14
- package/js/src/btcalpha.d.ts +2 -2
- package/js/src/btcbox.d.ts +2 -2
- package/js/src/btcmarkets.d.ts +2 -2
- package/js/src/btcturk.d.ts +2 -2
- package/js/src/bybit.d.ts +8 -56
- package/js/src/bybit.js +1 -0
- package/js/src/cex.d.ts +2 -2
- package/js/src/coinbase.d.ts +4 -4
- package/js/src/coinbasepro.d.ts +3 -3
- package/js/src/coincheck.d.ts +2 -2
- package/js/src/coinex.d.ts +6 -16
- package/js/src/coinex.js +321 -537
- package/js/src/coinlist.d.ts +5 -15
- package/js/src/coinlist.js +1 -2
- package/js/src/coinmate.d.ts +2 -2
- package/js/src/coinmetro.d.ts +3 -3
- package/js/src/coinone.d.ts +2 -2
- package/js/src/coinsph.d.ts +2 -2
- package/js/src/coinspot.d.ts +2 -2
- package/js/src/cryptocom.d.ts +2 -2
- package/js/src/currencycom.d.ts +3 -3
- package/js/src/delta.d.ts +5 -43
- package/js/src/deribit.d.ts +7 -55
- package/js/src/deribit.js +1 -1
- package/js/src/digifinex.d.ts +5 -15
- package/js/src/exmo.d.ts +2 -2
- package/js/src/gate.d.ts +6 -54
- package/js/src/gemini.d.ts +2 -2
- package/js/src/hitbtc.d.ts +4 -14
- package/js/src/hollaex.d.ts +3 -3
- package/js/src/hollaex.js +3 -3
- package/js/src/htx.d.ts +6 -16
- package/js/src/htx.js +1 -1
- package/js/src/huobijp.d.ts +4 -4
- package/js/src/hyperliquid.d.ts +1 -1
- package/js/src/idex.d.ts +3 -3
- package/js/src/independentreserve.d.ts +2 -2
- package/js/src/indodax.d.ts +2 -2
- package/js/src/indodax.js +1 -1
- package/js/src/kraken.d.ts +4 -14
- package/js/src/krakenfutures.d.ts +4 -14
- package/js/src/kucoin.d.ts +5 -15
- package/js/src/kucoinfutures.d.ts +4 -14
- package/js/src/kuna.d.ts +2 -2
- package/js/src/latoken.d.ts +5 -15
- package/js/src/latoken.js +1 -1
- package/js/src/lbank.d.ts +2 -2
- package/js/src/luno.d.ts +2 -2
- package/js/src/lykke.d.ts +2 -2
- package/js/src/mercado.d.ts +2 -2
- package/js/src/mexc.d.ts +8 -28
- package/js/src/mexc.js +1 -1
- package/js/src/ndax.d.ts +2 -2
- package/js/src/novadax.d.ts +4 -15
- package/js/src/novadax.js +0 -1
- package/js/src/okcoin.d.ts +4 -14
- package/js/src/okx.d.ts +10 -68
- package/js/src/okx.js +17 -0
- package/js/src/onetrading.d.ts +2 -2
- package/js/src/paymium.d.ts +4 -14
- package/js/src/phemex.d.ts +5 -15
- package/js/src/poloniex.d.ts +3 -13
- package/js/src/poloniex.js +1 -2
- package/js/src/poloniexfutures.d.ts +2 -2
- package/js/src/pro/bitget.js +137 -193
- package/js/src/pro/bybit.js +4 -2
- package/js/src/pro/coinbaseinternational.d.ts +3 -3
- package/js/src/pro/coinbaseinternational.js +9 -1
- package/js/src/pro/okx.d.ts +4 -1
- package/js/src/pro/okx.js +85 -0
- package/js/src/pro/woofipro.d.ts +47 -0
- package/js/src/pro/woofipro.js +1264 -0
- package/js/src/probit.d.ts +3 -3
- package/js/src/timex.d.ts +2 -2
- package/js/src/tokocrypto.d.ts +3 -3
- package/js/src/upbit.d.ts +2 -2
- package/js/src/wavesexchange.d.ts +3 -3
- package/js/src/wavesexchange.js +2 -2
- package/js/src/wazirx.d.ts +2 -2
- package/js/src/whitebit.d.ts +3 -13
- package/js/src/woo.d.ts +7 -17
- package/js/src/woo.js +17 -3
- package/js/src/woofipro.d.ts +131 -0
- package/js/src/woofipro.js +2699 -0
- package/js/src/yobit.d.ts +2 -2
- package/js/src/zaif.d.ts +2 -2
- package/js/src/zonda.d.ts +4 -14
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# CCXT – CryptoCurrency eXchange Trading Library
|
|
2
2
|
|
|
3
|
-
[](https://travis-ci.com/ccxt/ccxt) [](https://npmjs.com/package/ccxt) [](https://pypi.python.org/pypi/ccxt) [](https://www.npmjs.com/package/ccxt) [](https://discord.gg/ccxt) [](https://travis-ci.com/ccxt/ccxt) [](https://npmjs.com/package/ccxt) [](https://pypi.python.org/pypi/ccxt) [](https://www.npmjs.com/package/ccxt) [](https://discord.gg/ccxt) [](https://github.com/ccxt/ccxt/wiki/Exchange-Markets) [](https://twitter.com/ccxt_official)
|
|
4
4
|
|
|
5
5
|
A JavaScript / Python / PHP / C# library for cryptocurrency trading and e-commerce with support for many bitcoin/ether/altcoin exchange markets and merchant APIs.
|
|
6
6
|
|
|
@@ -52,10 +52,11 @@ Current feature list:
|
|
|
52
52
|
| [](https://m.mexc.com/auth/signup?inviteCode=1FQ1G) | mexc | [MEXC Global](https://m.mexc.com/auth/signup?inviteCode=1FQ1G) | [](https://mexcdevelop.github.io/apidocs/) | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) | |
|
|
53
53
|
| [](https://www.okx.com/join/CCXT2023) | okx | [OKX](https://www.okx.com/join/CCXT2023) | [](https://www.okx.com/docs-v5/en/) | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) | [](https://www.okx.com/join/CCXT2023) |
|
|
54
54
|
| [](https://x.woo.org/register?ref=YWOWC96B) | woo | [WOO X](https://x.woo.org/register?ref=YWOWC96B) | [](https://docs.woo.org/) | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) | [](https://x.woo.org/register?ref=YWOWC96B) |
|
|
55
|
+
| [](https://dex.woo.org/en/trade?ref=CCXT) | woofipro | [WOOFI PRO](https://dex.woo.org/en/trade?ref=CCXT) | [](https://orderly.network/docs/build-on-evm/building-on-evm) | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) | [](https://dex.woo.org/en/trade?ref=CCXT) |
|
|
55
56
|
|
|
56
57
|
## Supported Cryptocurrency Exchanges
|
|
57
58
|
|
|
58
|
-
The CCXT library currently supports the following
|
|
59
|
+
The CCXT library currently supports the following 98 cryptocurrency exchange markets and trading APIs:
|
|
59
60
|
|
|
60
61
|
| logo | id | name | ver | certified | pro |
|
|
61
62
|
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------|-------------------------------------------------------------------------------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------------:|-----------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------|
|
|
@@ -153,6 +154,7 @@ The CCXT library currently supports the following 97 cryptocurrency exchange mar
|
|
|
153
154
|
| [](https://wazirx.com/invite/k7rrnks5) | wazirx | [WazirX](https://wazirx.com/invite/k7rrnks5) | [](https://docs.wazirx.com/#public-rest-api-for-wazirx) | | [](https://ccxt.pro) |
|
|
154
155
|
| [](https://whitebit.com/referral/d9bdf40e-28f2-4b52-b2f9-cd1415d82963) | whitebit | [WhiteBit](https://whitebit.com/referral/d9bdf40e-28f2-4b52-b2f9-cd1415d82963) | [](https://github.com/whitebit-exchange/api-docs) | | [](https://ccxt.pro) |
|
|
155
156
|
| [](https://x.woo.org/register?ref=YWOWC96B) | woo | [WOO X](https://x.woo.org/register?ref=YWOWC96B) | [](https://docs.woo.org/) | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) |
|
|
157
|
+
| [](https://dex.woo.org/en/trade?ref=CCXT) | woofipro | [WOOFI PRO](https://dex.woo.org/en/trade?ref=CCXT) | [](https://orderly.network/docs/build-on-evm/building-on-evm) | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) |
|
|
156
158
|
| [](https://www.yobit.net) | yobit | [YoBit](https://www.yobit.net) | [](https://www.yobit.net/en/api/) | | |
|
|
157
159
|
| [](https://zaif.jp) | zaif | [Zaif](https://zaif.jp) | [](https://techbureau-api-document.readthedocs.io/ja/latest/index.html) | | |
|
|
158
160
|
| [](https://auth.zondaglobal.com/ref/jHlbB4mIkdS1) | zonda | [Zonda](https://auth.zondaglobal.com/ref/jHlbB4mIkdS1) | [](https://docs.zondacrypto.exchange/) | | |
|
|
@@ -213,13 +215,13 @@ console.log(version, Object.keys(exchanges));
|
|
|
213
215
|
|
|
214
216
|
All-in-one browser bundle (dependencies included), served from a CDN of your choice:
|
|
215
217
|
|
|
216
|
-
* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.3.
|
|
217
|
-
* unpkg: https://unpkg.com/ccxt@4.3.
|
|
218
|
+
* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.3.19/dist/ccxt.browser.js
|
|
219
|
+
* unpkg: https://unpkg.com/ccxt@4.3.19/dist/ccxt.browser.js
|
|
218
220
|
|
|
219
221
|
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.
|
|
220
222
|
|
|
221
223
|
```HTML
|
|
222
|
-
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.3.
|
|
224
|
+
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.3.19/dist/ccxt.browser.js"></script>
|
|
223
225
|
```
|
|
224
226
|
|
|
225
227
|
Creates a global `ccxt` object:
|
package/dist/cjs/ccxt.js
CHANGED
|
@@ -112,6 +112,7 @@ var wavesexchange = require('./src/wavesexchange.js');
|
|
|
112
112
|
var wazirx = require('./src/wazirx.js');
|
|
113
113
|
var whitebit = require('./src/whitebit.js');
|
|
114
114
|
var woo = require('./src/woo.js');
|
|
115
|
+
var woofipro = require('./src/woofipro.js');
|
|
115
116
|
var yobit = require('./src/yobit.js');
|
|
116
117
|
var zaif = require('./src/zaif.js');
|
|
117
118
|
var zonda = require('./src/zonda.js');
|
|
@@ -179,10 +180,11 @@ var upbit$1 = require('./src/pro/upbit.js');
|
|
|
179
180
|
var wazirx$1 = require('./src/pro/wazirx.js');
|
|
180
181
|
var whitebit$1 = require('./src/pro/whitebit.js');
|
|
181
182
|
var woo$1 = require('./src/pro/woo.js');
|
|
183
|
+
var woofipro$1 = require('./src/pro/woofipro.js');
|
|
182
184
|
|
|
183
185
|
//-----------------------------------------------------------------------------
|
|
184
186
|
// this is updated by vss.js when building
|
|
185
|
-
const version = '4.3.
|
|
187
|
+
const version = '4.3.19';
|
|
186
188
|
Exchange["default"].ccxtVersion = version;
|
|
187
189
|
const exchanges = {
|
|
188
190
|
'ace': ace,
|
|
@@ -285,6 +287,7 @@ const exchanges = {
|
|
|
285
287
|
'wazirx': wazirx,
|
|
286
288
|
'whitebit': whitebit,
|
|
287
289
|
'woo': woo,
|
|
290
|
+
'woofipro': woofipro,
|
|
288
291
|
'yobit': yobit,
|
|
289
292
|
'zaif': zaif,
|
|
290
293
|
'zonda': zonda,
|
|
@@ -354,6 +357,7 @@ const pro = {
|
|
|
354
357
|
'wazirx': wazirx$1,
|
|
355
358
|
'whitebit': whitebit$1,
|
|
356
359
|
'woo': woo$1,
|
|
360
|
+
'woofipro': woofipro$1,
|
|
357
361
|
};
|
|
358
362
|
pro.exchanges = Object.keys(pro);
|
|
359
363
|
pro['Exchange'] = Exchange["default"]; // now the same for rest and ts
|
|
@@ -502,6 +506,7 @@ exports.wavesexchange = wavesexchange;
|
|
|
502
506
|
exports.wazirx = wazirx;
|
|
503
507
|
exports.whitebit = whitebit;
|
|
504
508
|
exports.woo = woo;
|
|
509
|
+
exports.woofipro = woofipro;
|
|
505
510
|
exports.yobit = yobit;
|
|
506
511
|
exports.zaif = zaif;
|
|
507
512
|
exports.zonda = zonda;
|
package/dist/cjs/src/ascendex.js
CHANGED
|
@@ -3162,7 +3162,6 @@ class ascendex extends ascendex$1 {
|
|
|
3162
3162
|
const account = this.safeValue(this.accounts, 0, {});
|
|
3163
3163
|
const accountGroup = this.safeString(account, 'id');
|
|
3164
3164
|
const currency = this.currency(code);
|
|
3165
|
-
amount = this.currencyToPrecision(code, amount);
|
|
3166
3165
|
const accountsByType = this.safeValue(this.options, 'accountsByType', {});
|
|
3167
3166
|
const fromId = this.safeString(accountsByType, fromAccount, fromAccount);
|
|
3168
3167
|
const toId = this.safeString(accountsByType, toAccount, toAccount);
|
|
@@ -3171,7 +3170,7 @@ class ascendex extends ascendex$1 {
|
|
|
3171
3170
|
}
|
|
3172
3171
|
const request = {
|
|
3173
3172
|
'account-group': accountGroup,
|
|
3174
|
-
'amount': amount,
|
|
3173
|
+
'amount': this.currencyToPrecision(code, amount),
|
|
3175
3174
|
'asset': currency['id'],
|
|
3176
3175
|
'fromAccount': fromId,
|
|
3177
3176
|
'toAccount': toId,
|
|
@@ -3195,7 +3194,7 @@ class ascendex extends ascendex$1 {
|
|
|
3195
3194
|
//
|
|
3196
3195
|
// { "code": "0" }
|
|
3197
3196
|
//
|
|
3198
|
-
const status = this.
|
|
3197
|
+
const status = this.safeString(transfer, 'code');
|
|
3199
3198
|
const currencyCode = this.safeCurrencyCode(undefined, currency);
|
|
3200
3199
|
return {
|
|
3201
3200
|
'info': transfer,
|
|
@@ -3210,7 +3209,7 @@ class ascendex extends ascendex$1 {
|
|
|
3210
3209
|
};
|
|
3211
3210
|
}
|
|
3212
3211
|
parseTransferStatus(status) {
|
|
3213
|
-
if (status === 0) {
|
|
3212
|
+
if (status === '0') {
|
|
3214
3213
|
return 'ok';
|
|
3215
3214
|
}
|
|
3216
3215
|
return 'failed';
|
|
@@ -44,7 +44,7 @@ function _interopNamespace(e) {
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
// ----------------------------------------------------------------------------
|
|
47
|
-
const { isNode, deepExtend, extend, clone, flatten, unique, indexBy, sortBy, sortBy2, safeFloat2, groupBy, aggregate, uuid, unCamelCase, precisionFromString, Throttler, capitalize, now, decimalToPrecision, safeValue, safeValue2, safeString, safeString2, seconds, milliseconds, binaryToBase16, numberToBE, base16ToBinary, iso8601, omit, isJsonEncodedObject, safeInteger, sum, omitZero, implodeParams, extractParams, json, merge, binaryConcat, hash, ecdsa, arrayConcat, encode, urlencode, hmac, numberToString, parseTimeframe, safeInteger2, safeStringLower, parse8601, yyyymmdd, safeStringUpper, safeTimestamp, binaryConcatArray, uuidv1, numberToLE, ymdhms, stringToBase64, decode, uuid22, safeIntegerProduct2, safeIntegerProduct, safeStringLower2, yymmdd, base58ToBinary, binaryToBase58, safeTimestamp2, rawencode, keysort, inArray, isEmpty, ordered, filterBy, uuid16, safeFloat, base64ToBinary, safeStringUpper2, urlencodeWithArrayRepeat, microseconds, binaryToBase64, strip, toArray, safeFloatN, safeIntegerN, safeIntegerProductN, safeTimestampN, safeValueN, safeStringN, safeStringLowerN, safeStringUpperN, urlencodeNested, parseDate, ymd, base64ToString, crc32, packb, TRUNCATE, ROUND, DECIMAL_PLACES, NO_PADDING, TICK_SIZE, SIGNIFICANT_DIGITS } = functions;
|
|
47
|
+
const { isNode, deepExtend, extend, clone, flatten, unique, indexBy, sortBy, sortBy2, safeFloat2, groupBy, aggregate, uuid, unCamelCase, precisionFromString, Throttler, capitalize, now, decimalToPrecision, safeValue, safeValue2, safeString, safeString2, seconds, milliseconds, binaryToBase16, numberToBE, base16ToBinary, iso8601, omit, isJsonEncodedObject, safeInteger, sum, omitZero, implodeParams, extractParams, json, merge, binaryConcat, hash, ecdsa, arrayConcat, encode, urlencode, hmac, numberToString, parseTimeframe, safeInteger2, safeStringLower, parse8601, yyyymmdd, safeStringUpper, safeTimestamp, binaryConcatArray, uuidv1, numberToLE, ymdhms, stringToBase64, decode, uuid22, safeIntegerProduct2, safeIntegerProduct, safeStringLower2, yymmdd, base58ToBinary, binaryToBase58, safeTimestamp2, rawencode, keysort, inArray, isEmpty, ordered, filterBy, uuid16, safeFloat, base64ToBinary, safeStringUpper2, urlencodeWithArrayRepeat, microseconds, binaryToBase64, strip, toArray, safeFloatN, safeIntegerN, safeIntegerProductN, safeTimestampN, safeValueN, safeStringN, safeStringLowerN, safeStringUpperN, urlencodeNested, urlencodeBase64, parseDate, ymd, base64ToString, crc32, packb, TRUNCATE, ROUND, DECIMAL_PLACES, NO_PADDING, TICK_SIZE, SIGNIFICANT_DIGITS } = functions;
|
|
48
48
|
// ----------------------------------------------------------------------------
|
|
49
49
|
/**
|
|
50
50
|
* @class Exchange
|
|
@@ -83,6 +83,7 @@ class Exchange {
|
|
|
83
83
|
this.balance = {};
|
|
84
84
|
this.orderbooks = {};
|
|
85
85
|
this.tickers = {};
|
|
86
|
+
this.fundingRates = {};
|
|
86
87
|
this.bidsasks = {};
|
|
87
88
|
this.orders = undefined;
|
|
88
89
|
this.triggerOrders = undefined;
|
|
@@ -232,6 +233,7 @@ class Exchange {
|
|
|
232
233
|
this.base64ToString = base64ToString;
|
|
233
234
|
this.crc32 = crc32;
|
|
234
235
|
this.packb = packb;
|
|
236
|
+
this.urlencodeBase64 = urlencodeBase64;
|
|
235
237
|
this.httpProxyAgentModule = undefined;
|
|
236
238
|
this.httpsProxyAgentModule = undefined;
|
|
237
239
|
this.socksProxyAgentModule = undefined;
|
|
@@ -586,6 +588,7 @@ class Exchange {
|
|
|
586
588
|
'apiKey': true,
|
|
587
589
|
'secret': true,
|
|
588
590
|
'uid': false,
|
|
591
|
+
'accountId': false,
|
|
589
592
|
'login': false,
|
|
590
593
|
'password': false,
|
|
591
594
|
'twofa': false,
|
|
@@ -2158,6 +2161,13 @@ class Exchange {
|
|
|
2158
2161
|
const res = this.parseToNumeric((value % 1));
|
|
2159
2162
|
return res === 0;
|
|
2160
2163
|
}
|
|
2164
|
+
safeIntegerOmitZero(obj, key, defaultValue = undefined) {
|
|
2165
|
+
const timestamp = this.safeInteger(obj, key, defaultValue);
|
|
2166
|
+
if (timestamp === undefined || timestamp === 0) {
|
|
2167
|
+
return undefined;
|
|
2168
|
+
}
|
|
2169
|
+
return timestamp;
|
|
2170
|
+
}
|
|
2161
2171
|
afterConstruct() {
|
|
2162
2172
|
this.createNetworksByIdObject();
|
|
2163
2173
|
}
|
|
@@ -3383,7 +3393,7 @@ class Exchange {
|
|
|
3383
3393
|
}
|
|
3384
3394
|
return networkId;
|
|
3385
3395
|
}
|
|
3386
|
-
networkIdToCode(networkId, currencyCode = undefined) {
|
|
3396
|
+
networkIdToCode(networkId = undefined, currencyCode = undefined) {
|
|
3387
3397
|
/**
|
|
3388
3398
|
* @ignore
|
|
3389
3399
|
* @method
|
|
@@ -5246,6 +5256,7 @@ class Exchange {
|
|
|
5246
5256
|
//
|
|
5247
5257
|
// the value of tickers is either a dict or a list
|
|
5248
5258
|
//
|
|
5259
|
+
//
|
|
5249
5260
|
// dict
|
|
5250
5261
|
//
|
|
5251
5262
|
// {
|
|
@@ -5340,13 +5351,17 @@ class Exchange {
|
|
|
5340
5351
|
}
|
|
5341
5352
|
return result;
|
|
5342
5353
|
}
|
|
5343
|
-
|
|
5354
|
+
handleTriggerAndParams(params) {
|
|
5344
5355
|
const isTrigger = this.safeBool2(params, 'trigger', 'stop');
|
|
5345
5356
|
if (isTrigger) {
|
|
5346
5357
|
params = this.omit(params, ['trigger', 'stop']);
|
|
5347
5358
|
}
|
|
5348
5359
|
return [isTrigger, params];
|
|
5349
5360
|
}
|
|
5361
|
+
isTriggerOrder(params) {
|
|
5362
|
+
// for backwards compatibility
|
|
5363
|
+
return this.handleTriggerAndParams(params);
|
|
5364
|
+
}
|
|
5350
5365
|
isPostOnly(isMarketOrder, exchangeSpecificParam, params = {}) {
|
|
5351
5366
|
/**
|
|
5352
5367
|
* @ignore
|
|
@@ -6298,6 +6313,31 @@ class Exchange {
|
|
|
6298
6313
|
}
|
|
6299
6314
|
return marginModifications;
|
|
6300
6315
|
}
|
|
6316
|
+
async fetchTransfer(id, code = undefined, params = {}) {
|
|
6317
|
+
/**
|
|
6318
|
+
* @method
|
|
6319
|
+
* @name exchange#fetchTransfer
|
|
6320
|
+
* @description fetches a transfer
|
|
6321
|
+
* @param {string} id transfer id
|
|
6322
|
+
* @param {[string]} code unified currency code
|
|
6323
|
+
* @param {object} params extra parameters specific to the exchange api endpoint
|
|
6324
|
+
* @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
6325
|
+
*/
|
|
6326
|
+
throw new errors.NotSupported(this.id + ' fetchTransfer () is not supported yet');
|
|
6327
|
+
}
|
|
6328
|
+
async fetchTransfers(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
6329
|
+
/**
|
|
6330
|
+
* @method
|
|
6331
|
+
* @name exchange#fetchTransfer
|
|
6332
|
+
* @description fetches a transfer
|
|
6333
|
+
* @param {string} id transfer id
|
|
6334
|
+
* @param {int} [since] timestamp in ms of the earliest transfer to fetch
|
|
6335
|
+
* @param {int} [limit] the maximum amount of transfers to fetch
|
|
6336
|
+
* @param {object} params extra parameters specific to the exchange api endpoint
|
|
6337
|
+
* @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
6338
|
+
*/
|
|
6339
|
+
throw new errors.NotSupported(this.id + ' fetchTransfers () is not supported yet');
|
|
6340
|
+
}
|
|
6301
6341
|
}
|
|
6302
6342
|
|
|
6303
6343
|
exports.Exchange = Exchange;
|
|
@@ -91,9 +91,16 @@ function axolotl(request, secret, curve) {
|
|
|
91
91
|
return index.base58.encode(signature);
|
|
92
92
|
}
|
|
93
93
|
function eddsa(request, secret, curve) {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
94
|
+
let privateKey = undefined;
|
|
95
|
+
if (secret.length === 32) {
|
|
96
|
+
// ed25519 secret is 32 bytes
|
|
97
|
+
privateKey = secret;
|
|
98
|
+
}
|
|
99
|
+
else if (typeof secret === 'string') {
|
|
100
|
+
// secret is the base64 pem encoded key
|
|
101
|
+
// we get the last 32 bytes
|
|
102
|
+
privateKey = new Uint8Array(base64.Base64.unarmor(secret).slice(16));
|
|
103
|
+
}
|
|
97
104
|
const signature = curve.sign(request, privateKey);
|
|
98
105
|
return index.base64.encode(signature);
|
|
99
106
|
}
|
|
@@ -15,9 +15,12 @@ const json = (data, params = undefined) => JSON.stringify(data), isJsonEncodedOb
|
|
|
15
15
|
, urlencodeWithArrayRepeat = (object) => index$1.stringify(object, { arrayFormat: 'repeat' }), rawencode = (object) => index$1.stringify(object, { encode: false }), encode = index.utf8.decode // lol
|
|
16
16
|
, decode = index.utf8.encode
|
|
17
17
|
// Url-safe-base64 without equals signs, with + replaced by - and slashes replaced by underscores
|
|
18
|
-
, urlencodeBase64 = (
|
|
19
|
-
|
|
20
|
-
.replace(
|
|
18
|
+
, urlencodeBase64 = (payload) => {
|
|
19
|
+
const payload64 = (typeof payload === 'string') ? stringToBase64(payload) : binaryToBase64(payload);
|
|
20
|
+
return payload64.replace(/[=]+$/, '')
|
|
21
|
+
.replace(/\+/g, '-')
|
|
22
|
+
.replace(/\//g, '_');
|
|
23
|
+
}, numberToLE = (n, padding) => utils.numberToBytesLE(BigInt(n), padding), numberToBE = (n, padding) => utils.numberToBytesBE(BigInt(n), padding);
|
|
21
24
|
function packb(req) {
|
|
22
25
|
return msgpack.serialize(req);
|
|
23
26
|
}
|
|
@@ -96,6 +96,9 @@ function precisionFromString(str) {
|
|
|
96
96
|
}
|
|
97
97
|
/* ------------------------------------------------------------------------ */
|
|
98
98
|
const decimalToPrecision = (x, roundingMode, numPrecisionDigits, countingMode = DECIMAL_PLACES, paddingMode = NO_PADDING) => {
|
|
99
|
+
return _decimalToPrecision(x, roundingMode, numPrecisionDigits, countingMode, paddingMode);
|
|
100
|
+
};
|
|
101
|
+
const _decimalToPrecision = (x, roundingMode, numPrecisionDigits, countingMode = DECIMAL_PLACES, paddingMode = NO_PADDING) => {
|
|
99
102
|
if (countingMode === TICK_SIZE) {
|
|
100
103
|
if (typeof numPrecisionDigits === 'string') {
|
|
101
104
|
numPrecisionDigits = parseFloat(numPrecisionDigits);
|
|
@@ -107,7 +110,7 @@ const decimalToPrecision = (x, roundingMode, numPrecisionDigits, countingMode =
|
|
|
107
110
|
if (numPrecisionDigits < 0) {
|
|
108
111
|
const toNearest = Math.pow(10, -numPrecisionDigits);
|
|
109
112
|
if (roundingMode === ROUND) {
|
|
110
|
-
return (toNearest *
|
|
113
|
+
return (toNearest * _decimalToPrecision(x / toNearest, roundingMode, 0, countingMode, paddingMode)).toString();
|
|
111
114
|
}
|
|
112
115
|
if (roundingMode === TRUNCATE) {
|
|
113
116
|
return (x - (x % toNearest)).toString();
|
|
@@ -115,12 +118,12 @@ const decimalToPrecision = (x, roundingMode, numPrecisionDigits, countingMode =
|
|
|
115
118
|
}
|
|
116
119
|
/* handle tick size */
|
|
117
120
|
if (countingMode === TICK_SIZE) {
|
|
118
|
-
const precisionDigitsString =
|
|
121
|
+
const precisionDigitsString = _decimalToPrecision(numPrecisionDigits, ROUND, 22, DECIMAL_PLACES, NO_PADDING);
|
|
119
122
|
const newNumPrecisionDigits = precisionFromString(precisionDigitsString);
|
|
120
123
|
let missing = x % numPrecisionDigits;
|
|
121
124
|
// See: https://github.com/ccxt/ccxt/pull/6486
|
|
122
|
-
missing = Number(
|
|
123
|
-
const fpError =
|
|
125
|
+
missing = Number(_decimalToPrecision(missing, ROUND, 8, DECIMAL_PLACES, NO_PADDING));
|
|
126
|
+
const fpError = _decimalToPrecision(missing / numPrecisionDigits, ROUND, Math.max(newNumPrecisionDigits, 8), DECIMAL_PLACES, NO_PADDING);
|
|
124
127
|
if (precisionFromString(fpError) !== 0) {
|
|
125
128
|
if (roundingMode === ROUND) {
|
|
126
129
|
if (x > 0) {
|
|
@@ -144,7 +147,7 @@ const decimalToPrecision = (x, roundingMode, numPrecisionDigits, countingMode =
|
|
|
144
147
|
x = x - missing;
|
|
145
148
|
}
|
|
146
149
|
}
|
|
147
|
-
return
|
|
150
|
+
return _decimalToPrecision(x, ROUND, newNumPrecisionDigits, DECIMAL_PLACES, paddingMode);
|
|
148
151
|
}
|
|
149
152
|
/* Convert to a string (if needed), skip leading minus sign (if any) */
|
|
150
153
|
const str = numberToString(x);
|
|
@@ -25,22 +25,22 @@ function jwt(request, secret, hash, isRSA = false, opts = {}) {
|
|
|
25
25
|
request['iat'] = header['iat'];
|
|
26
26
|
delete header['iat'];
|
|
27
27
|
}
|
|
28
|
-
const encodedHeader = encode.urlencodeBase64(
|
|
29
|
-
const encodedData = encode.urlencodeBase64(
|
|
28
|
+
const encodedHeader = encode.urlencodeBase64(JSON.stringify(header));
|
|
29
|
+
const encodedData = encode.urlencodeBase64(JSON.stringify(request));
|
|
30
30
|
const token = [encodedHeader, encodedData].join('.');
|
|
31
31
|
const algoType = alg.slice(0, 2);
|
|
32
32
|
let signature = undefined;
|
|
33
33
|
if (algoType === 'HS') {
|
|
34
|
-
signature = encode.urlencodeBase64(crypto.hmac(token, secret, hash, '
|
|
34
|
+
signature = encode.urlencodeBase64(crypto.hmac(token, secret, hash, 'binary'));
|
|
35
35
|
}
|
|
36
36
|
else if (isRSA || algoType === 'RS') {
|
|
37
|
-
signature = encode.urlencodeBase64(rsa(token, index.utf8.encode(secret), hash));
|
|
37
|
+
signature = encode.urlencodeBase64(encode.base64ToBinary(rsa(token, index.utf8.encode(secret), hash)));
|
|
38
38
|
}
|
|
39
39
|
else if (algoType === 'ES') {
|
|
40
40
|
const signedHash = crypto.ecdsa(token, index.utf8.encode(secret), p256.P256, hash);
|
|
41
41
|
const r = signedHash.r.padStart(64, '0');
|
|
42
42
|
const s = signedHash.s.padStart(64, '0');
|
|
43
|
-
signature = encode.urlencodeBase64(encode.
|
|
43
|
+
signature = encode.urlencodeBase64(encode.base16ToBinary(r + s));
|
|
44
44
|
}
|
|
45
45
|
return [token, signature].join('.');
|
|
46
46
|
}
|
package/dist/cjs/src/bigone.js
CHANGED
package/dist/cjs/src/binance.js
CHANGED
|
@@ -5747,6 +5747,7 @@ class binance extends binance$1 {
|
|
|
5747
5747
|
* @param {float} [params.stopLossPrice] the price that a stop loss order is triggered at
|
|
5748
5748
|
* @param {float} [params.takeProfitPrice] the price that a take profit order is triggered at
|
|
5749
5749
|
* @param {boolean} [params.portfolioMargin] set to true if you would like to create an order in a portfolio margin account
|
|
5750
|
+
* @param {string} [params.stopLossOrTakeProfit] 'stopLoss' or 'takeProfit', required for spot trailing orders
|
|
5750
5751
|
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
5751
5752
|
*/
|
|
5752
5753
|
await this.loadMarkets();
|
|
@@ -5872,8 +5873,8 @@ class binance extends binance$1 {
|
|
|
5872
5873
|
const stopLossPrice = this.safeString(params, 'stopLossPrice', triggerPrice); // fallback to stopLoss
|
|
5873
5874
|
const takeProfitPrice = this.safeString(params, 'takeProfitPrice');
|
|
5874
5875
|
const trailingDelta = this.safeString(params, 'trailingDelta');
|
|
5875
|
-
const trailingTriggerPrice = this.safeString2(params, 'trailingTriggerPrice', 'activationPrice'
|
|
5876
|
-
const trailingPercent = this.
|
|
5876
|
+
const trailingTriggerPrice = this.safeString2(params, 'trailingTriggerPrice', 'activationPrice');
|
|
5877
|
+
const trailingPercent = this.safeStringN(params, ['trailingPercent', 'callbackRate', 'trailingDelta']);
|
|
5877
5878
|
const priceMatch = this.safeString(params, 'priceMatch');
|
|
5878
5879
|
const isTrailingPercentOrder = trailingPercent !== undefined;
|
|
5879
5880
|
const isStopLoss = stopLossPrice !== undefined || trailingDelta !== undefined;
|
|
@@ -5885,10 +5886,33 @@ class binance extends binance$1 {
|
|
|
5885
5886
|
let uppercaseType = type.toUpperCase();
|
|
5886
5887
|
let stopPrice = undefined;
|
|
5887
5888
|
if (isTrailingPercentOrder) {
|
|
5888
|
-
|
|
5889
|
-
|
|
5890
|
-
|
|
5891
|
-
|
|
5889
|
+
if (market['swap']) {
|
|
5890
|
+
uppercaseType = 'TRAILING_STOP_MARKET';
|
|
5891
|
+
request['callbackRate'] = trailingPercent;
|
|
5892
|
+
if (trailingTriggerPrice !== undefined) {
|
|
5893
|
+
request['activationPrice'] = this.priceToPrecision(symbol, trailingTriggerPrice);
|
|
5894
|
+
}
|
|
5895
|
+
}
|
|
5896
|
+
else {
|
|
5897
|
+
if (isMarketOrder) {
|
|
5898
|
+
throw new errors.InvalidOrder(this.id + ' trailingPercent orders are not supported for ' + symbol + ' ' + type + ' orders');
|
|
5899
|
+
}
|
|
5900
|
+
const stopLossOrTakeProfit = this.safeString(params, 'stopLossOrTakeProfit');
|
|
5901
|
+
params = this.omit(params, 'stopLossOrTakeProfit');
|
|
5902
|
+
if (stopLossOrTakeProfit !== 'stopLoss' && stopLossOrTakeProfit !== 'takeProfit') {
|
|
5903
|
+
throw new errors.InvalidOrder(this.id + symbol + ' trailingPercent orders require a stopLossOrTakeProfit parameter of either stopLoss or takeProfit');
|
|
5904
|
+
}
|
|
5905
|
+
if (stopLossOrTakeProfit === 'stopLoss') {
|
|
5906
|
+
uppercaseType = 'STOP_LOSS_LIMIT';
|
|
5907
|
+
}
|
|
5908
|
+
else if (stopLossOrTakeProfit === 'takeProfit') {
|
|
5909
|
+
uppercaseType = 'TAKE_PROFIT_LIMIT';
|
|
5910
|
+
}
|
|
5911
|
+
if (trailingTriggerPrice !== undefined) {
|
|
5912
|
+
stopPrice = this.priceToPrecision(symbol, trailingTriggerPrice);
|
|
5913
|
+
}
|
|
5914
|
+
const trailingPercentConverted = Precise["default"].stringMul(trailingPercent, '100');
|
|
5915
|
+
request['trailingDelta'] = trailingPercentConverted;
|
|
5892
5916
|
}
|
|
5893
5917
|
}
|
|
5894
5918
|
else if (isStopLoss) {
|
|
@@ -6075,8 +6099,8 @@ class binance extends binance$1 {
|
|
|
6075
6099
|
}
|
|
6076
6100
|
else {
|
|
6077
6101
|
// check for delta price as well
|
|
6078
|
-
if (trailingDelta === undefined && stopPrice === undefined) {
|
|
6079
|
-
throw new errors.InvalidOrder(this.id + ' createOrder() requires a stopPrice or
|
|
6102
|
+
if (trailingDelta === undefined && stopPrice === undefined && trailingPercent === undefined) {
|
|
6103
|
+
throw new errors.InvalidOrder(this.id + ' createOrder() requires a stopPrice, trailingDelta or trailingPercent param for a ' + type + ' order');
|
|
6080
6104
|
}
|
|
6081
6105
|
}
|
|
6082
6106
|
if (stopPrice !== undefined) {
|
package/dist/cjs/src/bitfinex.js
CHANGED
|
@@ -860,7 +860,7 @@ class bitfinex extends bitfinex$1 {
|
|
|
860
860
|
const response = await this.publicGetTickers(params);
|
|
861
861
|
const result = {};
|
|
862
862
|
for (let i = 0; i < response.length; i++) {
|
|
863
|
-
const ticker = this.parseTicker(response[i]);
|
|
863
|
+
const ticker = this.parseTicker({ 'result': response[i] });
|
|
864
864
|
const symbol = ticker['symbol'];
|
|
865
865
|
result[symbol] = ticker;
|
|
866
866
|
}
|
|
@@ -882,9 +882,33 @@ class bitfinex extends bitfinex$1 {
|
|
|
882
882
|
'symbol': market['id'],
|
|
883
883
|
};
|
|
884
884
|
const ticker = await this.publicGetPubtickerSymbol(this.extend(request, params));
|
|
885
|
+
//
|
|
886
|
+
// {
|
|
887
|
+
// mid: '63560.5',
|
|
888
|
+
// bid: '63560.0',
|
|
889
|
+
// ask: '63561.0',
|
|
890
|
+
// last_price: '63547.0',
|
|
891
|
+
// low: '62812.0',
|
|
892
|
+
// high: '64480.0',
|
|
893
|
+
// volume: '517.25634977',
|
|
894
|
+
// timestamp: '1715102384.9849467'
|
|
895
|
+
// }
|
|
896
|
+
//
|
|
885
897
|
return this.parseTicker(ticker, market);
|
|
886
898
|
}
|
|
887
899
|
parseTicker(ticker, market = undefined) {
|
|
900
|
+
//
|
|
901
|
+
// {
|
|
902
|
+
// mid: '63560.5',
|
|
903
|
+
// bid: '63560.0',
|
|
904
|
+
// ask: '63561.0',
|
|
905
|
+
// last_price: '63547.0',
|
|
906
|
+
// low: '62812.0',
|
|
907
|
+
// high: '64480.0',
|
|
908
|
+
// volume: '517.25634977',
|
|
909
|
+
// timestamp: '1715102384.9849467'
|
|
910
|
+
// }
|
|
911
|
+
//
|
|
888
912
|
const timestamp = this.safeTimestamp(ticker, 'timestamp');
|
|
889
913
|
const marketId = this.safeString(ticker, 'pair');
|
|
890
914
|
market = this.safeMarket(marketId, market);
|