An open API service indexing awesome lists of open source software.

https://github.com/iphytech/btc_calculator

A simple BTC to NGN calculator built with ruby and graphql.
https://github.com/iphytech/btc_calculator

btc gr ngn ru ruby

Last synced: 3 months ago
JSON representation

A simple BTC to NGN calculator built with ruby and graphql.

Awesome Lists containing this project

README

        

# How to use

Clone the repo `https://github.com/Iphytech/btc_calculator.git` to your computer

change to the project directory

NB: There is no database (because we ain't going to make use of it).

go to the terminal and run `bundle or bundle install`

We are making use of `Net::HTTP ` for the restful api calls - Read more about it here (https://apidock.com/ruby/Net/HTTP)

And we are consuming data from `Coindesk APi endpoint`

Start the project and test what we have built

```bash

rails s or rails server

```

Then open your browser and type `http://localhost:3000/graphiql`

sample request

```bash {
calculatePrice(
type: "sell"
margin: 0.1
exchangeRate: 370.0
) {
price
}
}

```

sample response

```bash
{
"data": {
"calculatePrice": {
"price": 2937074.4355499996
}
}
}
```

NB: If you encounter this error message when serving the app `Your Yarn packages are out of date!`

Please run `yarn install --check-files` to update.