UNPKG

ccxt-compiled

Version:

A JavaScript / Python / PHP cryptocurrency trading library with support for 90+ exchanges

33 lines (26 loc) 883 B
<!DOCTYPE HTML> <html> <head> <title>CCXT Basic example for the browser</title> <script type="text/javascript" src="https://unpkg.com/ccxt"></script> <script> document.addEventListener ("DOMContentLoaded", function () { alert ('ccxt version ' + ccxt.version + ' supporting '+ ccxt.exchanges.length.toString () + ' exchanges'); const exchange = new ccxt.poloniex () const symbol = 'ETH/BTC' exchange.fetchTicker (symbol).then (ticker => { const text = [ exchange.id, symbol, JSON.stringify (ticker, undefined, '\n\t') ] document.getElementById ('content').innerHTML = text.join (' ') }) }) </script> </head> <body> <h1>Hello, CCXT!</h1> <pre id="content"></pre> </body> </html>