• Stars
    star
    124
  • Rank 288,207 (Top 6 %)
  • Language
    Ruby
  • Created over 13 years ago
  • Updated over 10 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Provides a Ruby library to the complete Bitcoin JSON-RPC API. Implements all methods listed at https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_Calls_list .

bitcoin-client <img src=“https://travis-ci.org/sinisterchipmunk/bitcoin-client.png?branch=master” alt=“Build Status” /> <img src=“https://codeclimate.com/github/sinisterchipmunk/bitcoin-client.png” /> <img src=“https://coveralls.io/repos/sinisterchipmunk/bitcoin-client/badge.png” alt=“Coverage Status” />

Provides a Ruby library to the complete Bitcoin JSON-RPC API. Implements all methods listed at en.bitcoin.it/wiki/Original_Bitcoin_client/API_Calls_list. Also supports customizing the host and port number to connect to.

Installation

On Ruby 1.9, you can just install the gem and start using it. On 1.8, the ‘json’ gem is also required, so you’ll need to install that first:

gem install json

Or, if you’re using Bundler (and you should be), just add it to the Gemfile:

gem 'json', '~> 1.5.3'

Usage

As with most Ruby gems, you first need to require the library into your project:

require 'bitcon_client'

After doing this, the simplest possible usage looks like this:

BitcoinClient('username', 'password').balance
# => 0.001

Or, if you prefer a somewhat more explicit representation, the following code performs the exact same task:

client = BitcoinClient::Client.new('username', 'password')
client.balance
# => 0.001

The third and final way to use the library is by taking advantage of a simple DSL:

include BitcoinClient

# set up credentials
username 'username'
password 'password'

balance
# => 0.001

accounts
# => {"account" => 0.001}

The RPC method names available to you are exactly the same as those listed on the Bitcoin wiki (again, that’s en.bitcoin.it/wiki/Original_Bitcoin_client/API_Calls_list). Some aliases have been added to make them more “ruby-ish,” but none of the original names have been changed.

Host, Port and SSL

Here are several examples of how you can change the host information:

BitcoinClient('username', 'password', :host => 'example.com', :port => 38332, :ssl => true)

client = BitcoinClient::Client.new('username', 'password', :host => 'example.com')
client.port = 38332
client.ssl = true
client.ssl?
# => true

include BitcoinClient
host 'example.com'
port 38332
ssl?
# => false
ssl true
ssl?
# => true

You should see the BitcoinClient::Client class documentation if you’d like to see the other options and methods that are made available.

Donations

If you found this library useful and feel inclined to compensate me for my trouble, I’m certainly not going to turn you down!

Bitcoin donations can be sent to:

1HawYer58J9Vy3iju1w7jsRVci5tzaxkwn

Thanks!

More Repositories

1

rspec-prof

Integrates ruby-prof with RSpec, allowing you to easily profile your RSpec examples.
Ruby
136
star
2

gravatar

A gem for interfacing with the entire Gravatar API: not just images, but the XML-RPC API too!
Ruby
120
star
3

jax

Framework for creating rich WebGL-enabled applications using JavaScript and Ruby
CoffeeScript
94
star
4

bot-away

Silently, unobtrusively masks Rails-generated forms in order to filter out spambot submissions.
Ruby
62
star
5

eve

A Ruby library for interfacing with all aspects of the EVE Online MMO. It is designed for use within a Ruby on Rails project, but does not require Rails as a dependency. That means there‘s nothing preventing you from writing a stand-alone application or script using this library.
Ruby
31
star
6

node.rb

Embeds a Ruby interpreter into Node.js, so you can execute Ruby code from within your Node-based JavaScript
Ruby
20
star
7

genspec

An RSpec-based library for concisely and efficiently testing Rails generators
Ruby
19
star
8

bitpool

a Ruby-based bitcoin mining pool
Ruby
18
star
9

vulkan-ruby

Vulkan bindings for Ruby
Ruby
15
star
10

redis-orm

Easy-to-use object relational mapping for Redis.
Ruby
14
star
11

xmlsec

C
14
star
12

webgl-compat

Standards-compliant WebGL compatability layer using Canvas2D
JavaScript
14
star
13

webgl

Home to my various tests and demos using WebGL; see them in action at http://webgldemos.thoughtsincomputation.com
JavaScript
11
star
14

bvh

A library for loading, modifying and saving BVH motion capture files.
Ruby
11
star
15

normal-map

normal-map
Ruby
9
star
16

acts_as_awesome

This gem does absolutely nothing. It's part of my response to http://stackoverflow.com/questions/4018469/rails3-gem-acts-as-something
Ruby
9
star
17

sinisterchipmunk.github.com

Live demos of the Jax WebGL framework
JavaScript
8
star
18

active-gist

ActiveModel-based wrapper around the Gist API. Because I can.
Ruby
7
star
19

shader-script

Generate shaders with CoffeeScript, and unit test it using the simulator!
JavaScript
7
star
20

sc2sim

Attempts to simulate StarCraft 2 mechanics, primarily to test the timing of build orders.
Ruby
6
star
21

rails-webgl

A WebGL framework for Ruby on Rails
JavaScript
6
star
22

md2

A Ruby library for loading MD2 3D model files.
Ruby
4
star
23

sc-ansi

Handles every aspect (that I could think of) of dealing with ANSI escape sequences.
Ruby
4
star
24

rink

Makes interactive consoles awesome.
Ruby
4
star
25

cglm-ruby

Ruby bindings for CGLM (https://github.com/recp/cglm), a high performance math library for OpenGL.
C
4
star
26

google-blogsearch-pings

Utilizes the Google Blog Search Pinging Service API in order to notify Google of updates to your blog so that it can be reindexed more quickly. See also: http://www.google.com/help/blogsearch/pinging_API.html
Ruby
4
star
27

rubyjs

Generates JavaScript classes from Ruby code; works fine on its own but is designed for Rails
Ruby
4
star
28

nuklear-ruby

Nuklear GUI bindings for Ruby
C
3
star
29

test-spec

The test-spec framework with added global before and after hooks
Ruby
3
star
30

eve-dump

ActiveResource models, migrations and seeds for reproducing the EVE database.
Ruby
3
star
31

rpm

Builds RPMs out of RubyGems or Rails projects
Ruby
3
star
32

jax-coldet

A fast collision detection library for Jax
JavaScript
3
star
33

jax-guides-getting-started

The Jax "Getting Started" guide, committed step-by-step, for your reference.
Ruby
2
star
34

tiny_gltf-ruby

Provides a Ruby extension for TinyGLTF, a C++ glTF 2.0 library.
C++
2
star
35

sparkly-auth

Rails authentication with Sparkles!
Ruby
2
star
36

mist

a git-powered, gist-backed blogging engine for Rails 3
Ruby
2
star
37

sizes

A very simple gem that exposes the C *sizeof* keyword to Ruby.
Ruby
2
star
38

testbeds

Manages multiple testbeds within which to test your gems (or other code)
Ruby
2
star
39

divinity

A new kind of game engine. Check back when the project has something worthwhile in it, because right now it's just a place for me to put stuff.
Ruby
2
star
40

tomato

Leverages Google's V8 JavaScript library to interface Ruby code with JavaScript code.
C++
2
star
41

authgen

Configures a Rails application for use with the authlogic and declarative_authorization gems, and generates all code (migrations, models, controller methods, routes, roles, seeds, etc.) required.
Ruby
2
star
42

ambrosia

coming soon
CoffeeScript
1
star
43

tinyobj-ruby

Provides a Ruby interface around TinyOBJ.
C++
1
star
44

core-ext

A collection of Ruby core extensions that I've built up over time. They rely on ActiveSupport.
Ruby
1
star
45

swarm

Ruby
1
star
46

sample_app_three

Ruby
1
star
47

voidrepublic

Void republic issues tracking
1
star
48

blog

A blog engine that I'm writing, mostly 'cause I can.
Ruby
1
star
49

jax-blender-models

a Jax plugin adding support for models built in Blender. Includes model importers and exporters for Blender.
Python
1
star
50

tiny_mce

This plugin adapts the TinyMCE JavaScript library from Moxiecode Systems to a Ruby on Rails application. The TinyMCE version bundled with this plugin is Version 3.2.7 (2009-09-22).
Ruby
1
star
51

jax-fractals

Fractal textures and terrain for Jax!
Ruby
1
star
52

jax-dungeon

A dungeon demo built using the Jax WebGL framework.
JavaScript
1
star
53

pingbacks

Git repo to track the progress of my Coding Gems for Rails 3 tutorial series. See tags to jump to the snapshot for a specific segment.
Ruby
1
star
54

widgets

widget, n : a device that is very useful for a particular job
Ruby
1
star
55

sdl2_vulkan

Exposes the Vulkan functions in SDL2 to Ruby
Ruby
1
star
56

spirv-cross-ruby

Ruby bindings for SPIRV-Cross to provide reflection of SPIR-V shaders.
C++
1
star
57

dock

Documentation generator for multi-language projects
JavaScript
1
star
58

rubytastic

Part of my answer on stack overflow: http://stackoverflow.com/questions/11383048/serious-stuck-on-validations-not-triggered-for-nested-resource-with-fields-for/11495512#11495512
Ruby
1
star
59

c4

Toy SPA framework, highly experimental. Probably wouldn't work in the real world. You've been warned.
JavaScript
1
star