ccxt-look 1.81.50
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/.cache/eslintcache +1 -0
- package/.dockerignore +6 -0
- package/.eslintignore +1 -0
- package/.gitattributes +5 -0
- package/.readthedocs.yaml +16 -0
- package/CONTRIBUTING.md +1049 -0
- package/LICENSE.txt +21 -0
- package/README.md +537 -0
- package/SECURITY.md +5 -0
- package/build/cleanup-old-tags.js +94 -0
- package/build/countries.js +256 -0
- package/build/export-exchanges.js +520 -0
- package/build/fs.js +51 -0
- package/build/transpile.js +1772 -0
- package/build/vss.js +78 -0
- package/ccxt.browser.js +7 -0
- package/ccxt.d.ts +692 -0
- package/ccxt.js +171 -0
- package/cleanup.sh +2 -0
- package/composer-install.sh +20 -0
- package/dist/ccxt.browser.js +208383 -0
- package/gource.sh +3 -0
- package/index.html +7 -0
- package/js/.eslintrc +87 -0
- package/js/aax.js +2686 -0
- package/js/ascendex.js +2584 -0
- package/js/base/.eslintrc.js +43 -0
- package/js/base/Exchange.js +2371 -0
- package/js/base/Precise.js +283 -0
- package/js/base/errorHierarchy.js +47 -0
- package/js/base/errors.js +55 -0
- package/js/base/functions/crypto.js +158 -0
- package/js/base/functions/encode.js +118 -0
- package/js/base/functions/generic.js +270 -0
- package/js/base/functions/misc.js +138 -0
- package/js/base/functions/number.js +329 -0
- package/js/base/functions/platform.js +38 -0
- package/js/base/functions/string.js +21 -0
- package/js/base/functions/throttle.js +79 -0
- package/js/base/functions/time.js +210 -0
- package/js/base/functions/type.js +66 -0
- package/js/base/functions.js +28 -0
- package/js/bequant.js +32 -0
- package/js/bibox.js +1407 -0
- package/js/bigone.js +1366 -0
- package/js/binance.js +5652 -0
- package/js/binancecoinm.js +46 -0
- package/js/binanceus.js +46 -0
- package/js/binanceusdm.js +49 -0
- package/js/bit2c.js +535 -0
- package/js/bitbank.js +842 -0
- package/js/bitbay.js +16 -0
- package/js/bitbns.js +1073 -0
- package/js/bitcoincom.js +15 -0
- package/js/bitfinex.js +1433 -0
- package/js/bitfinex2.js +2025 -0
- package/js/bitflyer.js +840 -0
- package/js/bitforex.js +614 -0
- package/js/bitget.js +2397 -0
- package/js/bithumb.js +980 -0
- package/js/bitmart.js +2516 -0
- package/js/bitmex.js +1809 -0
- package/js/bitopro.js +1443 -0
- package/js/bitpanda.js +1782 -0
- package/js/bitrue.js +1747 -0
- package/js/bitso.js +1062 -0
- package/js/bitstamp.js +1757 -0
- package/js/bitstamp1.js +343 -0
- package/js/bittrex.js +1876 -0
- package/js/bitvavo.js +1579 -0
- package/js/bkex.js +1233 -0
- package/js/bl3p.js +346 -0
- package/js/blockchaincom.js +969 -0
- package/js/btcalpha.js +680 -0
- package/js/btcbox.js +477 -0
- package/js/btcmarkets.js +1022 -0
- package/js/btctradeua.js +466 -0
- package/js/btcturk.js +734 -0
- package/js/buda.js +946 -0
- package/js/bw.js +1265 -0
- package/js/bybit.js +3372 -0
- package/js/bytetrade.js +1336 -0
- package/js/cdax.js +1646 -0
- package/js/cex.js +1410 -0
- package/js/coinbase.js +1342 -0
- package/js/coinbaseprime.js +31 -0
- package/js/coinbasepro.js +1466 -0
- package/js/coincheck.js +755 -0
- package/js/coinex.js +3400 -0
- package/js/coinfalcon.js +880 -0
- package/js/coinmate.js +794 -0
- package/js/coinone.js +816 -0
- package/js/coinspot.js +345 -0
- package/js/crex24.js +1636 -0
- package/js/cryptocom.js +1832 -0
- package/js/currencycom.js +1748 -0
- package/js/delta.js +1547 -0
- package/js/deribit.js +2148 -0
- package/js/digifinex.js +1585 -0
- package/js/eqonex.js +1660 -0
- package/js/exmo.js +1670 -0
- package/js/fairdesk.js +1231 -0
- package/js/flowbtc.js +35 -0
- package/js/fmfwio.js +34 -0
- package/js/ftx.js +2751 -0
- package/js/ftxus.js +38 -0
- package/js/gateio.js +4174 -0
- package/js/gemini.js +1397 -0
- package/js/hitbtc.js +1343 -0
- package/js/hitbtc3.js +2329 -0
- package/js/hollaex.js +1486 -0
- package/js/huobi.js +5706 -0
- package/js/huobijp.js +1710 -0
- package/js/huobipro.js +18 -0
- package/js/idex.js +1439 -0
- package/js/independentreserve.js +649 -0
- package/js/indodax.js +742 -0
- package/js/itbit.js +722 -0
- package/js/kraken.js +2179 -0
- package/js/kucoin.js +2571 -0
- package/js/kucoinfutures.js +1771 -0
- package/js/kuna.js +809 -0
- package/js/latoken.js +1445 -0
- package/js/lbank.js +760 -0
- package/js/liquid.js +1432 -0
- package/js/luno.js +873 -0
- package/js/lykke.js +1147 -0
- package/js/mercado.js +771 -0
- package/js/mexc.js +3151 -0
- package/js/ndax.js +2233 -0
- package/js/novadax.js +1318 -0
- package/js/oceanex.js +816 -0
- package/js/okcoin.js +3841 -0
- package/js/okex.js +16 -0
- package/js/okex5.js +16 -0
- package/js/okx.js +4795 -0
- package/js/paymium.js +498 -0
- package/js/phemex.js +2957 -0
- package/js/poloniex.js +1674 -0
- package/js/probit.js +1346 -0
- package/js/qtrade.js +1588 -0
- package/js/ripio.js +1061 -0
- package/js/static_dependencies/BN/bn.js +3526 -0
- package/js/static_dependencies/README.md +1 -0
- package/js/static_dependencies/crypto-js/crypto-js.js +5988 -0
- package/js/static_dependencies/elliptic/lib/elliptic/curve/base.js +375 -0
- package/js/static_dependencies/elliptic/lib/elliptic/curve/edwards.js +433 -0
- package/js/static_dependencies/elliptic/lib/elliptic/curve/index.js +8 -0
- package/js/static_dependencies/elliptic/lib/elliptic/curve/mont.js +180 -0
- package/js/static_dependencies/elliptic/lib/elliptic/curve/short.js +938 -0
- package/js/static_dependencies/elliptic/lib/elliptic/curves.js +204 -0
- package/js/static_dependencies/elliptic/lib/elliptic/ec/index.js +240 -0
- package/js/static_dependencies/elliptic/lib/elliptic/ec/key.js +119 -0
- package/js/static_dependencies/elliptic/lib/elliptic/ec/signature.js +24 -0
- package/js/static_dependencies/elliptic/lib/elliptic/eddsa/index.js +145 -0
- package/js/static_dependencies/elliptic/lib/elliptic/eddsa/key.js +100 -0
- package/js/static_dependencies/elliptic/lib/elliptic/eddsa/signature.js +65 -0
- package/js/static_dependencies/elliptic/lib/elliptic/precomputed/secp256k1.js +780 -0
- package/js/static_dependencies/elliptic/lib/elliptic/utils.js +214 -0
- package/js/static_dependencies/elliptic/lib/elliptic.js +22 -0
- package/js/static_dependencies/elliptic/lib/hmac-drbg/hmac-drbg.js +114 -0
- package/js/static_dependencies/fetch-ponyfill/fetch-node.js +39 -0
- package/js/static_dependencies/node-fetch/index.js +1564 -0
- package/js/static_dependencies/node-rsa/NodeRSA.js +223 -0
- package/js/static_dependencies/node-rsa/asn1/ber/errors.js +13 -0
- package/js/static_dependencies/node-rsa/asn1/ber/index.js +21 -0
- package/js/static_dependencies/node-rsa/asn1/ber/reader.js +262 -0
- package/js/static_dependencies/node-rsa/asn1/ber/types.js +36 -0
- package/js/static_dependencies/node-rsa/asn1/index.js +17 -0
- package/js/static_dependencies/node-rsa/encryptEngines/js.js +34 -0
- package/js/static_dependencies/node-rsa/formats/components.js +71 -0
- package/js/static_dependencies/node-rsa/formats/formats.js +31 -0
- package/js/static_dependencies/node-rsa/formats/pkcs1.js +148 -0
- package/js/static_dependencies/node-rsa/formats/pkcs8.js +187 -0
- package/js/static_dependencies/node-rsa/libs/jsbn.js +1252 -0
- package/js/static_dependencies/node-rsa/libs/rsa.js +147 -0
- package/js/static_dependencies/node-rsa/schemes/pkcs1.js +176 -0
- package/js/static_dependencies/node-rsa/schemes/schemes.js +21 -0
- package/js/static_dependencies/node-rsa/utils.js +98 -0
- package/js/static_dependencies/qs/formats.js +18 -0
- package/js/static_dependencies/qs/index.js +11 -0
- package/js/static_dependencies/qs/parse.js +242 -0
- package/js/static_dependencies/qs/stringify.js +269 -0
- package/js/static_dependencies/qs/utils.js +230 -0
- package/js/stex.js +1925 -0
- package/js/test/.eslintrc.js +42 -0
- package/js/test/Exchange/test.balance.js +61 -0
- package/js/test/Exchange/test.borrowRate.js +32 -0
- package/js/test/Exchange/test.currency.js +52 -0
- package/js/test/Exchange/test.fetchBalance.js +23 -0
- package/js/test/Exchange/test.fetchBorrowInterest.js +59 -0
- package/js/test/Exchange/test.fetchBorrowRate.js +32 -0
- package/js/test/Exchange/test.fetchBorrowRates.js +28 -0
- package/js/test/Exchange/test.fetchClosedOrders.js +32 -0
- package/js/test/Exchange/test.fetchCurrencies.js +35 -0
- package/js/test/Exchange/test.fetchDeposits.js +31 -0
- package/js/test/Exchange/test.fetchFundingFees.js +19 -0
- package/js/test/Exchange/test.fetchFundingRateHistory.js +40 -0
- package/js/test/Exchange/test.fetchL2OrderBook.js +23 -0
- package/js/test/Exchange/test.fetchLedger.js +42 -0
- package/js/test/Exchange/test.fetchLeverageTiers.js +33 -0
- package/js/test/Exchange/test.fetchMarketLeverageTiers.js +22 -0
- package/js/test/Exchange/test.fetchMarkets.js +33 -0
- package/js/test/Exchange/test.fetchMyTrades.js +42 -0
- package/js/test/Exchange/test.fetchOHLCV.js +46 -0
- package/js/test/Exchange/test.fetchOpenOrders.js +36 -0
- package/js/test/Exchange/test.fetchOrderBook.js +25 -0
- package/js/test/Exchange/test.fetchOrderBooks.js +35 -0
- package/js/test/Exchange/test.fetchOrders.js +41 -0
- package/js/test/Exchange/test.fetchPositions.js +47 -0
- package/js/test/Exchange/test.fetchStatus.js +35 -0
- package/js/test/Exchange/test.fetchTicker.js +38 -0
- package/js/test/Exchange/test.fetchTickers.js +49 -0
- package/js/test/Exchange/test.fetchTrades.js +39 -0
- package/js/test/Exchange/test.fetchTradingFee.js +18 -0
- package/js/test/Exchange/test.fetchTradingFees.js +22 -0
- package/js/test/Exchange/test.fetchTransactions.js +31 -0
- package/js/test/Exchange/test.fetchWithdrawals.js +31 -0
- package/js/test/Exchange/test.ledgerItem.js +46 -0
- package/js/test/Exchange/test.leverageTier.js +33 -0
- package/js/test/Exchange/test.loadMarkets.js +35 -0
- package/js/test/Exchange/test.market.js +129 -0
- package/js/test/Exchange/test.ohlcv.js +33 -0
- package/js/test/Exchange/test.order.js +62 -0
- package/js/test/Exchange/test.orderbook.js +61 -0
- package/js/test/Exchange/test.position.js +21 -0
- package/js/test/Exchange/test.throttle.js +94 -0
- package/js/test/Exchange/test.ticker.js +95 -0
- package/js/test/Exchange/test.trade.js +68 -0
- package/js/test/Exchange/test.tradingFee.js +34 -0
- package/js/test/Exchange/test.transaction.js +35 -0
- package/js/test/base/.eslintrc +38 -0
- package/js/test/base/functions/test.crypto.js +110 -0
- package/js/test/base/functions/test.datetime.js +62 -0
- package/js/test/base/functions/test.generic.js +152 -0
- package/js/test/base/functions/test.number.js +362 -0
- package/js/test/base/functions/test.time.js +56 -0
- package/js/test/base/functions/test.type.js +53 -0
- package/js/test/base/test.base.js +193 -0
- package/js/test/errors/test.InsufficientFunds.js +86 -0
- package/js/test/errors/test.InvalidNonce.js +64 -0
- package/js/test/errors/test.InvalidOrder.js +35 -0
- package/js/test/errors/test.OrderNotFound.js +39 -0
- package/js/test/test.js +426 -0
- package/js/test/test.timeout_hang.js +12 -0
- package/js/therock.js +1431 -0
- package/js/tidebit.js +632 -0
- package/js/tidex.js +939 -0
- package/js/timex.js +1283 -0
- package/js/upbit.js +1622 -0
- package/js/vcc.js +1353 -0
- package/js/wavesexchange.js +2185 -0
- package/js/wazirx.js +732 -0
- package/js/whitebit.js +1352 -0
- package/js/woo.js +1577 -0
- package/js/xena.js +1948 -0
- package/js/yobit.js +1129 -0
- package/js/zaif.js +647 -0
- package/js/zb.js +4088 -0
- package/js/zipmex.js +40 -0
- package/js/zonda.js +1497 -0
- package/multilang.sh +159 -0
- package/package.json +591 -0
- package/postinstall.js +103 -0
package/multilang.sh
ADDED
@@ -0,0 +1,159 @@
|
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
|
3
|
+
function usage() {
|
4
|
+
echo "usage: $0 [-clsh] exchange method [...args]"
|
5
|
+
echo " -c Number of lines to trim off the top and bottom of output"
|
6
|
+
echo " -l View in less editor"
|
7
|
+
echo " -s Remove special characters"
|
8
|
+
echo " -h Display help"
|
9
|
+
echo " -v Verbose mode"
|
10
|
+
echo " -k Stacked"
|
11
|
+
echo " -t Use table"
|
12
|
+
exit 1
|
13
|
+
}
|
14
|
+
|
15
|
+
if [[ $# < 1 ]]; then
|
16
|
+
usage
|
17
|
+
fi
|
18
|
+
|
19
|
+
cliFolder='./examples'
|
20
|
+
|
21
|
+
jsCli="${cliFolder}/js/cli.js"
|
22
|
+
pythonCli="${cliFolder}/py/cli.py"
|
23
|
+
phpCli="${cliFolder}/php/cli.php"
|
24
|
+
|
25
|
+
useLess=false
|
26
|
+
verbose=false
|
27
|
+
removeSpecial=false
|
28
|
+
numLines=0
|
29
|
+
stacked=false
|
30
|
+
useTable=false
|
31
|
+
|
32
|
+
function display {
|
33
|
+
# Displays output in a less window or just to stdout
|
34
|
+
if ${useLess}; then
|
35
|
+
less -S -R
|
36
|
+
else
|
37
|
+
tee
|
38
|
+
fi
|
39
|
+
}
|
40
|
+
|
41
|
+
function removeSpecial {
|
42
|
+
# Removes special characters
|
43
|
+
if ${removeSpecial}; then
|
44
|
+
sed -e 's/\[[0-9]\{1,2\}m//g'
|
45
|
+
else
|
46
|
+
tee
|
47
|
+
fi
|
48
|
+
}
|
49
|
+
|
50
|
+
function condense {
|
51
|
+
# Trims output down to a set number of lines on the top and the bottom
|
52
|
+
local pythonLength=$1
|
53
|
+
local half=$(($numLines / 2))
|
54
|
+
local continueFrom=
|
55
|
+
if [ $half -gt $pythonLength ]; then
|
56
|
+
continueFrom=${half}
|
57
|
+
else
|
58
|
+
continueFrom=$(($pythonLength - $half))
|
59
|
+
fi
|
60
|
+
if [ ${numLines} -gt 0 ]; then
|
61
|
+
sed -n "1,${half}p;${continueFrom},${pythonLength}p"
|
62
|
+
else
|
63
|
+
tee
|
64
|
+
fi
|
65
|
+
}
|
66
|
+
|
67
|
+
function removeAndColorLines {
|
68
|
+
sed -E -e '/.*(iteration|^Array|^202.*|^$)/d' -e 's/ / /g' -e 's/ / /g' -e "s/(.*)/$(tput setaf $color)\1/"
|
69
|
+
}
|
70
|
+
|
71
|
+
function writeOutput {
|
72
|
+
local interpretter="$1"
|
73
|
+
local path="$2"
|
74
|
+
local args="$3"
|
75
|
+
if result=$($interpretter "$path" $args); then
|
76
|
+
if ${verbose}; then
|
77
|
+
echo "$interpretter completed" >&2
|
78
|
+
fi
|
79
|
+
removeSpecial <<< "$result" | removeAndColorLines $color
|
80
|
+
else
|
81
|
+
exit $?
|
82
|
+
fi
|
83
|
+
}
|
84
|
+
|
85
|
+
function checkExitCode {
|
86
|
+
if [ $? -ne 0 ]; then
|
87
|
+
exit $?
|
88
|
+
fi
|
89
|
+
}
|
90
|
+
|
91
|
+
function padOutput {
|
92
|
+
local input="$1"
|
93
|
+
local length="$2"
|
94
|
+
echo "$input"
|
95
|
+
lines=$(wc -l <<< "$input")
|
96
|
+
toPad=$(($length - $lines))
|
97
|
+
if [ $toPad -gt 0 ]; then
|
98
|
+
yes "$(tput setaf 1)" | head -n $toPad
|
99
|
+
fi
|
100
|
+
}
|
101
|
+
|
102
|
+
# Loop through command line arguments
|
103
|
+
while getopts 'hc:slvtk' flag; do
|
104
|
+
case "${flag}" in
|
105
|
+
h) usage ;;
|
106
|
+
c) numLines="${OPTARG}" ;;
|
107
|
+
s) removeSpecial=true ;;
|
108
|
+
l) useLess=true ;;
|
109
|
+
v) verbose=true ;;
|
110
|
+
k) stacked=true ;;
|
111
|
+
t) useTable=true ;;
|
112
|
+
*) usage ;;
|
113
|
+
esac
|
114
|
+
done
|
115
|
+
|
116
|
+
shift $((OPTIND - 1))
|
117
|
+
|
118
|
+
if grep -q -e "-[^0-9]" <<< "$@"; then
|
119
|
+
usage
|
120
|
+
fi
|
121
|
+
|
122
|
+
if ${verbose}; then
|
123
|
+
args="--verbose $@"
|
124
|
+
else
|
125
|
+
args="$@"
|
126
|
+
fi
|
127
|
+
|
128
|
+
if ${useTable}; then
|
129
|
+
table=""
|
130
|
+
else
|
131
|
+
table="--no-table"
|
132
|
+
fi
|
133
|
+
|
134
|
+
jsArgs=$(<<< "$args" sed -E -e 's/(null|None)/undefined/g')
|
135
|
+
pythonArgs=$(<<< "$args" sed -E -e 's/(undefined|null)/None/g')
|
136
|
+
phpArgs=$(<<< "$args" sed -E -e 's/(undefined|None)/null/g')
|
137
|
+
|
138
|
+
color=3
|
139
|
+
jsOutput=$(writeOutput node $jsCli "${table} $jsArgs")
|
140
|
+
checkExitCode
|
141
|
+
((color++))
|
142
|
+
|
143
|
+
pythonOutput=$(writeOutput python3 $pythonCli "$pythonArgs")
|
144
|
+
checkExitCode
|
145
|
+
pythonLength=$(wc -l <<< "$pythonOutput")
|
146
|
+
((color++))
|
147
|
+
|
148
|
+
phpOutput=$(writeOutput php $phpCli "$phpArgs")
|
149
|
+
checkExitCode
|
150
|
+
|
151
|
+
if ${stacked}; then
|
152
|
+
echo -e "$jsOutput\n$phpOutput\n$pythonOutput" | display
|
153
|
+
else
|
154
|
+
# use padding here
|
155
|
+
length=$(wc -l <<< "$phpOutput")
|
156
|
+
jsOutput=$(padOutput "$jsOutput" $length)
|
157
|
+
pythonOutput=$(padOutput "$pythonOutput" $length)
|
158
|
+
paste <(echo "$jsOutput") <(echo "$phpOutput") <(echo "$pythonOutput") | column -s $'\t' -t | condense $pythonLength | display
|
159
|
+
fi
|