Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/narkoz/bitcoiner
Ruby interface to the 'bitcoind' JSON-RPC API
https://github.com/narkoz/bitcoiner
bitcoin bitcoin-api bitcoind bitcoinrpc btc coin cryptocurrency json-rpc wallet
Last synced: 3 months ago
JSON representation
Ruby interface to the 'bitcoind' JSON-RPC API
- Host: GitHub
- URL: https://github.com/narkoz/bitcoiner
- Owner: NARKOZ
- License: mit
- Created: 2017-12-27T05:44:18.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2021-12-26T00:13:56.000Z (about 3 years ago)
- Last Synced: 2024-05-01T23:14:53.655Z (8 months ago)
- Topics: bitcoin, bitcoin-api, bitcoind, bitcoinrpc, btc, coin, cryptocurrency, json-rpc, wallet
- Language: Ruby
- Size: 30.3 KB
- Stars: 16
- Watchers: 4
- Forks: 12
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE.txt
Awesome Lists containing this project
README
# Bitcoiner [![Build Status](https://travis-ci.org/NARKOZ/bitcoiner.svg?branch=master)](https://travis-ci.org/NARKOZ/bitcoiner)
Automate your [Bitcoin](https://bitcoin.org/) transactions with this Ruby
interface to the `bitcoind` JSON-RPC API. This is a fork of
[bitcoind](https://github.com/bkerley/bitcoind) Ruby gem.![Super Mario Coin](https://user-images.githubusercontent.com/253398/34371748-45c440f2-eae9-11e7-84ba-fddae754d59a.jpg)
## Installation
Install it from rubygems:
```
gem install bitcoiner
```Or add to a Gemfile:
```ruby
gem 'bitcoiner'
# gem 'bitcoiner', github: 'NARKOZ/bitcoiner'
```## Usage
### Connecting
Before connecting, you will need to configure a username and password for
`bitcoind`, and start `bitcoind`. Once that's done:```ruby
client = Bitcoiner.new 'username', 'password' # REPLACE WITH YOUR bitcoin.conf rpcuser/rpcpassword
# => #
```### Account Balances
You can get the balance of all addresses controlled by the client:
```ruby
client.balance
# => 12.34
```You can also get a hash of all accounts the client controls:
```ruby
client.accounts
# => {"Your Address"=>#, "eve-online ransoms"=>#}
```And of course each account has its own balance too:
```ruby
ransom = client.accounts['eve-online ransoms']
# => #ransom.balance
# => 2.19
```### Transactions
You can get all the transactions in an account:
```ruby
ransom.transactions
# => [#]
```You can send money from an account too:
```ruby
ransom.send_to 'destinationaddress', 2
# => #
```### Making Accounts
Creating an account with an associated address is done through the accounts
interface:```ruby
tiny_wings = client.accounts.new 'tiny wings ransoms'
# => #tiny_wings.address
# => "1KV5khnHbbHF2nNQkk7Pe5nPndEj43U27r"
```### Logging
You may log requests (responses aren't logged) by setting a logger:
```
logger = Logger.new(STDOUT)
client = Bitcoiner::Client.new('username', 'password', 'http://a.c', {
logger: logger,
})
```## License
Released under the MIT license. See LICENSE.txt for details.