Project

waffle_api

0.0
No commit activity in last 3 years
No release in over 3 years
Simple gem to make fast and cached calls to Wafflepool API
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 0.7
~> 1.3
~> 10.3
~> 2.14
~> 1.4
~> 1.17
 Project Readme

WaffleAPI

Codeship Status

Build Status Gem Version Code Climate Coverage Status

Waffle pool API gem

Installation

Ruby 2+

gem install waffle_api

Usage

require 'waffle_api'
client = WaffleAPI::Client.new address: '1Ju8U9Ukfc5kiMqzQrRgQBP1JvRkeSv94V'

WaffleAPI::Client

# Hash rate in H/s
client.hashrate
#=> 1_234_567

# List of all workers
workers = client.workers
#=> [ #<WaffleAPI::Worker>, #<WaffleAPI::Worker>, ... ]

# Current balances
balances = client.balances
#=> #<WaffleAPI::Balances>

# 10 last recent payments
payments = client.payments
#=> [ #<WaffleAPI::Payment>, #<WaffleAPI::Payment>, ... ]

WaffleAPI::Worker

worker = workers.first
#=> #<WaffleAPI::Worker>

# Worker name, without an underscore in it
worker.name
#=> 1Ju8U9Ukfc5kiMqzQrRgQBP1JvRkeSv94V

# Worker name, with an underscore in it e.g: 1Ju8U...94V_worker0
worker.name
#=> worker0

# Hash rate in H/s
worker.hash_rate
#=> 723_456

# Stale rate in %
worker.stale_rate
#=> 3.6

# Last seen
worker.last_seen
#=> 2014-03-13 20:22:42 +0100

WaffleAPI::Balances

# BTC already paid
balances.sent
#=> 1.623456

# BTC confirmed but not yet paid
balances.confirmed
#=> 0.012345

# BTC not yet converted (approximate)
balances.unconverted
#=> 0.012345

# Expected BTC (confirmed + unconverted, approximate)
balances.expected
#=> 0.02469

WaffleAPI::Payment

payment = payments.first
#=> #<WaffleAPI::Payment>

# Payment amount
payment.amount
#=> 0.02469

# Payment paid date
payment.paid_at
#=> 2014-03-13 20:22:42 +0100

# Payment transaction hash
payment.transaction_hash
#=> "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b"

Contributing

Contributors and CONTRIBUTING

Licence

Released under the MIT License. See the LICENSE file for further details.