silkroad 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c1a6b37fb9a99b76044b3d0929be27188bf0e9ed46890ad8bd2eb5c6197b9504
4
- data.tar.gz: fff1515809b4a8e7c3006cabdb937b4c8a28dd886e463c6097db225d522f82c8
3
+ metadata.gz: e8e1ac1da70003b497194b13d2b4b47569cfac43d3246b550b587e0dc4943bd6
4
+ data.tar.gz: 11a1d56e33e215f64decf92a5001cf135852d2cf9cfc61496c7003c7b027975e
5
5
  SHA512:
6
- metadata.gz: 67e1ea9a7165af2f822b7ea40fe4c83ac1781f0b19ac7e9469f3b9ae8ec4775d39c3dd93549c02fbeddb638fb16405a89ce47dbacfd8878000dde02f67c828f0
7
- data.tar.gz: e4fa7699c5aa35bbc46a100afafec6f63629b6abb94f97d174b10807369090cbdc66bdc5c7508fae29fe8b23fe5c35ffea08043ea237d111d35923d2b3630a75
6
+ metadata.gz: c55879c37d5a91144f5544ba406025a6da4bf199f413d8d95b8aba149084b15587704879eded937595e0cd7a288d4e549d6ba02685926995d26aa25f43abd6f1
7
+ data.tar.gz: 365f9dde3ac174af3e59982ac647465e8e6ad039e308ddec38dd57581dd05d592cd0e679806b94139c1c4fdc1a5483f4e4aa9e61fb6a2d2fe7127cd739a10ec4
data/README.md CHANGED
@@ -21,12 +21,12 @@ Or install it yourself as:
21
21
  Initialize the client:
22
22
 
23
23
  ```ruby
24
- silkroad = Silkroad::Client.new 'rpcuser', 'rpcpass'
24
+ silkroad = Silkroad::Client.new
25
25
  ```
26
26
 
27
- You can set a custom url:
27
+ You can set a custom uri:
28
28
  ```ruby
29
- silkroad = Silkroad::Client.new 'rpcuser', 'rpcpass', url: 'https://yourbitcoinddaemon.com:31337'
29
+ silkroad = Silkroad::Client.new 'https://rpcuser:rpcpass@yourbitcoinddaemon.com:31337'
30
30
  ```
31
31
 
32
32
  Now you can make RPC API calls (see the [API calls list](https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list)). Pass params as per the spec, and the result will be returned as a primitive type (string, number, boolean, and nil) or structured type (hash, array), depending on the call:
@@ -21,7 +21,7 @@ module Silkroad
21
21
  end
22
22
 
23
23
  def rpc(meth, *params)
24
- response = send jsonrpc: JSONRPC_VERSION, method: meth, params: params
24
+ response = send jsonrpc: JSONRPC_VERSION, method: meth, params: params, id: 1
25
25
 
26
26
  if response.code != '200'
27
27
  if response.body.nil?
@@ -1,3 +1,3 @@
1
1
  module Silkroad
2
- VERSION = '0.1.1'
2
+ VERSION = '0.2.0'
3
3
  end
@@ -41,7 +41,7 @@ describe Silkroad::Client do
41
41
 
42
42
  it 'makes a call' do
43
43
  stub_with_body(
44
- {jsonrpc: "2.0", method: "getbalance", params: ["tyler@example.com"]},
44
+ {jsonrpc: "2.0", method: "getbalance", params: ["tyler@example.com"], id: 1},
45
45
  {status: 200, body: {result: 31337}.to_json}
46
46
  )
47
47
 
@@ -50,7 +50,7 @@ describe Silkroad::Client do
50
50
 
51
51
  it 'works with ssl' do
52
52
  stub_with_body(
53
- {jsonrpc: "2.0", method: "getbalance", params: ["tyler@example.com"]},
53
+ {jsonrpc: "2.0", method: "getbalance", params: ["tyler@example.com"], id: 1},
54
54
  {status: 200, body: {result: 31337}.to_json},
55
55
  true
56
56
  )
@@ -61,7 +61,7 @@ describe Silkroad::Client do
61
61
 
62
62
  it 'fails with error' do
63
63
  stub_with_body(
64
- {jsonrpc: "2.0", method: "failbalance", params: ["tyler@example.com"]},
64
+ {jsonrpc: "2.0", method: "failbalance", params: ["tyler@example.com"], id: 1},
65
65
  {status: 200, body: {result: 31337}.to_json}
66
66
  )
67
67
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: silkroad
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kyle Drake