Calling ccxt from HTML
See original GitHub issueCan you please post an example of how to use ccxt in a browser context? I have this simple test html:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html> <head>
<title>CCXT Test</title>
<script type="text/javascript" src="scripts/ccxt.js"></script>
</head>
<body>
<script type="text/javascript">
console.log (ccxt.exchanges)
</script>
</body> </html>
Of course the ccxt.exchanges call throws a reference exception. I tried to copy ccxt.js into my local directory but when looking at the source I see a bunch of require imports to /js/base/… which require node.js. I even tried to set up require.js on my server but wasn’t able to make this work.
Definitely open to ideas, thanks!
Issue Analytics
- State:
- Created 3 years ago
- Comments:39 (20 by maintainers)
Top Results From Across the Web
Exchanges — ccxt 2.4.71 documentation
The ccxt library is a collection of available crypto exchanges or exchange classes. Each class implements the public and private API for a...
Read more >How to use fetchBalance() parameters with ccxt - Stack Overflow
The params argument on fetchBalances() is for passing exchange specific data to the request. As each exchange offers different endpoints, ...
Read more >ccxt/README.md - UNPKG
The **CCXT** library is used to connect and trade with cryptocurrency exchanges and payment processing services worldwide. It provides quick access to market ......
Read more >ccxt-dev/ccxt - Gitter
import ccxt import cfscrape client = ccxt.coinegg({'apiKey': key, 'secret': secret, ... raceback (most recent call last): File ...
Read more >ccxt Documentation - Read the Docs
14 CCXT – CryptoCurrency eXchange Trading Library ... https://docs.aiohttp.org/en/stable/client_advanced.html#proxy-support.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Quick update - I copied my OS X binary over to CentOS and got it working. In the interim I upgraded my server to python 3.8 and was able to get tox installed there as well. I’m now able to run the build script on both platforms.
When loading my JS test page it shows only the needed exchanges:
Then it retrieved the OHLCV data just fine. MUCH quicker load time as ccxt.browser.js now is 1.5Mb as opposed to 6.3MB. So definitely worth all the pain to get it working.
Thanks a ton for your help and I hope that my trials and tribulations made your install procedure more anti-fragile 😉
Okay a few pointers for your tutorial:
pip install tox is missing - you already know that.
echo is not reliable on bash across various platforms. Your call did not work for me on both OS X and CentOS. However what makes it work is the -e flag:
echo -e “binance\nkraken\nbittrex\ncoinbase\nkucoin” > exchanges.cfg
Tested it on both and it produces a carriage return.
It’s not putting it into build but into dist - fortunately I caught that watching the install log.
So got it to work on OS X at least.