WaffleAPI
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
Licence
Released under the MIT License. See the LICENSE file for further details.