Git Product home page Git Product logo

haskell-bitcoin-api's Introduction

haskell-bitcoin-api

Build Status Coverage Status MIT Haskell

The Bitcoin Core application provides an HTTP RPC interface for communication. This library implements access to these functions. It builds on top of the bitcoin-tx and bitcoin-script, and as such provides an extremely flexible environment to create, manipulate and store transactions and custom scripts.

haskell-bitcoin-api's People

Contributors

ketzacoatl avatar runeksvendsen avatar solatis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

haskell-bitcoin-api's Issues

Make "Now sending JSON command" putStrLn optional

Hi

Thanks for writing this library. I'm using it to create a test Bitcoin payment channel server, and I'd really like to keep the terminal output clean, so I'd love it if you could make this optional:

putStrLn ("Now sending JSON command: " ++ show (encode command))

By the way, I have written some code for a couple of additional RPC calls. The code is in my repo: master...runeksvendsen:master
Let me know if you want me to create a pull request. I haven't added tests for the calls, and currently don't plan to, but I haven't experienced any issues yet, except internal errors from bitcoind when I forget to limit the number of QuickCheck test runs, and accidentally spam it with 100 transactions in a second.

JSONError "Error in $.result.balance: expected Integer, encountered floating number

Hi, thanks for your work on this library. I created a simple demo using the bitcoin-api package, and based off https://github.com/solatis/haskell-bitcoin-api/blob/master/test/Network/Bitcoin/Api/WalletSpec.hs, the demo is https://github.com/ketzacoatl/btc-monitor/blob/master/src/Main.hs. It compiles just fine, but at runtime I get this funny error I don't know what to do about:

Now sending JSON command: "{\"jsonrpc\":\"2.0\",\"params\":[\"mywallet\"],\"method\":\"getaccount\",\"id\":1}"
Now sending JSON command: "{\"jsonrpc\":\"2.0\",\"params\":[1,false],\"method\":\"listaccounts\",\"id\":1}"
Now sending JSON command: "{\"jsonrpc\":\"2.0\",\"params\":[],\"method\":\"getinfo\",\"id\":1}"
btc-trx-monitor: JSONError "Error in $.result.balance: expected Integer, encountered floating number 1.3"

This 1.3 is coming from bitcoind when I query a real wallet that has BTC in it from a faucet (this is on the testnet).

Am I doing something wrong, or is there an error in the library? When I review the test specs, I'm not sure I see coverage for floating point numbers.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.