tebello-thejane / bitx.hs Goto Github PK
View Code? Open in Web Editor NEW(Hopefully useful) Haskell bindings to the BitX bitcoin exchange's API.
License: BSD 3-Clause "New" or "Revised" License
(Hopefully useful) Haskell bindings to the BitX bitcoin exchange's API.
License: BSD 3-Clause "New" or "Revised" License
Currently a new connection manager is created for every request. This is fairly expensive, mainly because for TLS all of the certificates in the certificate store need to be parsed and loaded. If I replace globalManager
with this, my CPU usage goes down a lot:
{-# NOINLINE yuck #-}
yuck :: NetCon.Manager
yuck = unsafePerformIO (NetCon.newManager NetCon.tlsManagerSettings)
globalManager :: IO NetCon.Manager
globalManager = pure yuck
(Obviously this isn't a great thing to do, it's just a quick'n'dirty PoC of sharing the manager)
What we probably want is some way to pass a manager in to the operation to be used, but I'm not quite sure how to do this without creating duplicate variants of every operation in the API, which sounds tedious.
Currently these are Int
, which is fine for XBTZAR
since no decimals are allowed in the price, but useless for ETHXBT
since the prices are always fractional in this market.
The travis jobs randomly time out when testing live API connectivity. This might be due to the default (non-container-based) infrastructure sharing the same IP address between multiple instances running the same test, and thus flooding BitX.
Perhaps moving to container-based infrastructure might help.
Luno recently added this (along with the ETH asset). Should be a pretty easy change, I'll try send a PR shortly.
src/Network/Bitcoin/BitX/Internal.hs:26:1: error:
Could not find module ‘Network’
Use -v to see a list of the files searched for.
|
26 | import Network (withSocketsDo)
If you request trade information where no trades match, the Luno API returns null
instead of an empty array, causing a parse failure.
Citing from http://hydra.cryp.to/build/926883/nixlog/1/raw:
src/Network/Bitcoin/BitX/Internal.hs:25:8:
Could not find module ‘Record.Lens’
Use -v to see a list of the files searched for.
λ> B.postEncode $ B.OrderRequest B.XRPXBT B.BID 673 0.00002683
[("pair","XRPXBT"),("type","BID"),("volume","673"),("price","0.000026")]
Not sure where we're losing precision but this is clearly wrong!
Failures:
test/Network/Bitcoin/BitX/Spec/Specs/NetSpec.hs:24:
1) Network.Bitcoin.BitX.Spec.Specs.Net,
Public BitX connectivity,
getTrades connects to BitX and works
I have some code implementing the streaming websocket API which I'd like to contribute, but it probably needs some more cleaning up. Also I used type-level symbols for pairs rather than value-level constants, so the API will probably need to be changed. Filing this so I hopefully don't forget forever.
We have basically given up on Travis-CI as it has a lot of noisy failures.
Get this shit stable and fixed, so that we don't ignore valid failures due to all this noise.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.