Comments (6)
Update: It's in The Manual now.
from ccxt.
Furthemore, this should simplify unit tests for pair name conversion (since I think there are still issues with this)
from ccxt.
Hey! Thanks again for feedback, it's very constructive. Sure, I will expose the mapping.
In fact one half of that mapping (symbol → product id → symbol) is already there (you can use it right away):
# Python (almost identical to same code in JS and PHP, except for syntax)
symbol = 'BTC/USD'
print (market.products[symbol]['id']) # print product id by symbol
print (market.productId (symbol)) # same as previous line
product = market.product (symbol) get a full product dictionary by symbol
print (product['id']) # same as previous output
Will upload the other half (reworked) soon.
from ccxt.
Though, the existing mapping does not throw errors, but returns the input string untouched. I will update that part of the interface anyway.
from ccxt.
This feature will soon be ready, btw, Product Ids And Symbols. The Manual is frequently updated, I'm adding more and more details into it, so it's worth revisiting from time to time. I will also update it and add the two methods proposed here very soon.
from ccxt.
I've uploaded the interface to products, product symbols and product ids.
Here's how to use it:
import ccxt
k = ccxt.kraken ()
k.load_products ()
# symbol → product
k.products['BTC/USD']
# id → product
k.products_by_id['XXRPZUSD']
# symbol → id
k.products['BTC/USD']['id']
# id → symbol
k.products_by_id['XXRPZUSD']['symbol']
No functions, basic dictionaries indexed by appropriate fields. The are cached and can be force-reloaded if necessary.
You will get a userland standard Python exception if you access non-existent keys in these dicts.
I hope the above solution simplifies the usage, closing this issue down now. Will soon add it to the Manual. Thanks again!
from ccxt.
Related Issues (20)
- exchange.fetchConvertTradeHistory - error when output has no longer traded tokens - on binance HOT 3
- exchange.fetchConvertTradeHistory - no data if the period is longer than about half a year - on binance HOT 5
- Wrong channel for Watch MyTrades. C# HOT 6
- Internal errors are not visible in my code. C# HOT 5
- bybit fetchBalance not returning any balances HOT 2
- EditOrder behavior for Bitget. C# HOT 4
- Wrong calculations for orders. C# HOT 7
- Get all symbols which currently active on exchange HOT 2
- KUCOIN create stop limit doesnt work properly HOT 5
- MEXC: No fee info in watchMyTrades HOT 1
- ping-pong error HOT 3
- Binance - MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added to [TLSSocket] HOT 1
- python static method parse_date() incorrectly parse for some minutes or hour values with leading zeros HOT 2
- KeyError: 'fetchConvertTradeHistory' in exchange.has['fetchConvertTradeHistory'] - on phemex HOT 1
- Coinex ws freezes and does not show an error when the connection is lost HOT 3
- Missing side (buy|sell) in output of "fetchConvertTradeHistory" - binance HOT 1
- Kraken active flag giving false postive HOT 1
- Bybit fetchMyTrades USDT Perpetual not working HOT 2
- HTX exchange not available, but docs state its available. HOT 1
- [native fetch] fallback to native fetch doesn't support proxy agent HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ccxt.