coinrpc 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +4 -4
- data/lib/coinrpc/version.rb +1 -1
- data/lib/coinrpc.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f80efb4ad16cc2494f8c143fa84607c207317cfe0594f086d59fa068a4807072
|
4
|
+
data.tar.gz: d9c5104d11491b5495eda5aa23eb275d576ccd5d7e934c79d22309abc81727b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9dc237a79a5084bb2457faefdf885d49f5c50c5543ffa9f9c65ac0b66d7fa8454559433caae0f92d08c82dbf7124809b8810a815194ac21cd56125f5e35e4fa8
|
7
|
+
data.tar.gz: 35f065275ae97da765aee7054ec77836928356d8d2efbd17fdd046f6337d71c6fb6c8ae997258c1fd7c7d60e167c2f5bf52fc1faece9cce387e8d9ba59c1e3ce
|
data/README.md
CHANGED
@@ -6,7 +6,7 @@ A simple client for Bitcoin Core style RPC. Supports batch requests.
|
|
6
6
|
|
7
7
|
Add this line to your application's Gemfile:
|
8
8
|
|
9
|
-
gem
|
9
|
+
gem "coinrpc"
|
10
10
|
|
11
11
|
And then execute:
|
12
12
|
|
@@ -19,7 +19,7 @@ Or install it yourself as:
|
|
19
19
|
## Usage
|
20
20
|
|
21
21
|
```
|
22
|
-
require
|
22
|
+
require "coinrpc"
|
23
23
|
client = CoinRPC::Client.new("http://username:password@hostname:port")
|
24
24
|
puts client.getblockchaininfo
|
25
25
|
```
|
@@ -27,13 +27,13 @@ Or install it yourself as:
|
|
27
27
|
Responses will contain coin values as BigDecimals:
|
28
28
|
|
29
29
|
```
|
30
|
-
puts client.getrawtransaction(txid)[
|
30
|
+
puts client.getrawtransaction(txid)["vout"].first["value"].to_s("F")
|
31
31
|
```
|
32
32
|
|
33
33
|
## Contributing
|
34
34
|
|
35
35
|
1. Fork it ( https://github.com/doersf/coinrpc/fork )
|
36
36
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
37
|
-
3. Commit your changes (`git commit -am
|
37
|
+
3. Commit your changes (`git commit -am "Add some feature"`)
|
38
38
|
4. Push to the branch (`git push origin my-new-feature`)
|
39
39
|
5. Create a new Pull Request
|
data/lib/coinrpc/version.rb
CHANGED
data/lib/coinrpc.rb
CHANGED
@@ -45,7 +45,7 @@ module CoinRPC
|
|
45
45
|
# this won"t work without Oj.mimic_JSON
|
46
46
|
result = Oj.strict_load(response, :decimal_class => BigDecimal)
|
47
47
|
|
48
|
-
raise result["error"]["message"] if result.is_a?(Hash) and result
|
48
|
+
raise result["error"]["message"] if result.is_a?(Hash) and !result["error"].nil?
|
49
49
|
|
50
50
|
if result.is_a?(Hash) then
|
51
51
|
result["result"]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: coinrpc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Atif Nazir
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-07-
|
11
|
+
date: 2022-07-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|