helloblock 0.0.1 → 0.0.2

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
  SHA1:
3
- metadata.gz: d5705b196e7b8ac0e977d9958c959f8126f21fd5
4
- data.tar.gz: a16a2f4bcc24a6cb4f42a2cacb0dfa6875987526
3
+ metadata.gz: fefb5b840f196c87db851fa8d97ff42a4008ac9f
4
+ data.tar.gz: af25f058449f8b1a971e0b858642e3caa5391b61
5
5
  SHA512:
6
- metadata.gz: 5df3bdc542e11603862ca74da25cebec116923d61b8d5cd0c365047fb0e63768f7204290a568351797b514048a797d9349589fe4371d9e3c0e4637749a9b27fb
7
- data.tar.gz: 970ea0b35c990cddeb516cca21ee03946a84feaff1ba02228dffb3e6f8e903950e88de61924fc049f5d7bd3ee25bfbd35afd3f374b3bdde4ba48bea2137665b9
6
+ metadata.gz: 6e5d093d68c3d438fa592ba9e01a468cc827a0f221b02d460c984cd66fd6cafb392e7e114dc26fea8096c36d8851f77ef6b2bda26a4edff4c771e4891fe8392a
7
+ data.tar.gz: b974d8a7cde7389668c060552a9d93df3f141cfc4a77fb6d8c264605578797d7f4b8ddebad930fcc59d3d9aea97116630aee8445e6f3216a324c985af585a56c
@@ -0,0 +1,26 @@
1
+ Changelog
2
+ ===
3
+
4
+ **Version 0.0.2**
5
+
6
+ * Add temporary support for bitcoin ruby RPC endpoint
7
+ * Add JSON dependency
8
+ * Add changelog
9
+
10
+ **Version 0.0.1**
11
+
12
+ Wrapper is fully functional for the following endpoints:
13
+ * Single address
14
+ * Batch addresses
15
+ * Unspents for single address
16
+ * Unspents for batch addresses
17
+ * Single transaction
18
+ * Batch transactions
19
+ * Transactions for an address
20
+ * Latest transactions
21
+ * Propagate a transaction
22
+ * Single block
23
+ * Latest block
24
+ * Wallet information
25
+ * Unspents from a faucet
26
+ * Withdraw from a faucet
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # HelloBlock
2
2
 
3
+ [![Code Climate](https://codeclimate.com/github/NathanielWroblewski/helloblock.png)](https://codeclimate.com/github/NathanielWroblewski/helloblock)
4
+
3
5
  Fluent ruby wrapper for the [HelloBlock](http://www.helloblock.io) API. For a simple, non-fluent wrapper that avoids the Singleton pattern, see [helloblock-ruby](http://github.com/nathanielwroblewski/helloblock-ruby).
4
6
 
5
7
  ## Installation
@@ -26,6 +26,7 @@ Gem::Specification.new do |spec|
26
26
  spec.add_development_dependency 'guard-rspec', '~> 4.2'
27
27
 
28
28
  spec.add_runtime_dependency 'multi_json', '~> 1.9'
29
+ spec.add_runtime_dependency 'json'
29
30
  spec.add_runtime_dependency 'yajl-ruby', '~> 1.2'
30
31
  spec.add_runtime_dependency 'faraday_middleware', '~> 0.9'
31
32
  spec.add_runtime_dependency 'rash', '~> 0.4'
@@ -6,6 +6,7 @@ require 'helloblock/resources/transaction'
6
6
  require 'helloblock/resources/block'
7
7
  require 'helloblock/resources/wallet'
8
8
  require 'helloblock/resources/faucet'
9
+ require 'helloblock/resources/rpc'
9
10
  require 'helloblock/http/connection'
10
11
  require 'helloblock/http/request'
11
12
  require 'helloblock/configuration'
@@ -9,7 +9,8 @@ module HelloBlock
9
9
  wallet: '/wallet',
10
10
  block: '/blocks/',
11
11
  faucet: '/faucet',
12
- withdraw: '/faucet/withdrawal'
12
+ withdraw: '/faucet/withdrawal',
13
+ rpc: '/getrawtransaction'
13
14
  }
14
15
 
15
16
  def base_url
@@ -0,0 +1,11 @@
1
+ require 'helloblock/resources/query'
2
+ require 'helloblock/api_interface/endpoints'
3
+
4
+ # this is a temporary class that exists for compatibility with bitcoin-ruby
5
+
6
+ module HelloBlock
7
+ class RPC
8
+ extend HelloBlock::Query
9
+ include HelloBlock::Endpoints
10
+ end
11
+ end
@@ -1,3 +1,3 @@
1
1
  module HelloBlock
2
- VERSION = "0.0.1"
2
+ VERSION = '0.0.2'
3
3
  end
@@ -0,0 +1,42 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://testnet.helloblock.io/v1/getrawtransaction?txHashes%5B0%5D=f37e6181661473c14a123cca6f0ad0ab3303d011246f1d4bb4ccf3fccef2d700&txHashes%5B1%5D=f37e6181661473c14a123cca6f0ad0ab3303d011246f1d4bb4ccf3fccef2d700
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - '*/*'
12
+ User-Agent:
13
+ - HelloBlock Gem 0.0.1
14
+ Content-Type:
15
+ - application/json; charset=UTF-8
16
+ Accept-Encoding:
17
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Access-Control-Allow-Origin:
24
+ - '*'
25
+ Content-Type:
26
+ - application/json; charset=utf-8
27
+ Date:
28
+ - Fri, 21 Mar 2014 03:25:04 GMT
29
+ Etag:
30
+ - '"-1541430146"'
31
+ X-Powered-By:
32
+ - Express
33
+ Content-Length:
34
+ - '1130'
35
+ Connection:
36
+ - keep-alive
37
+ body:
38
+ encoding: UTF-8
39
+ string: '{"status":"success","data":{"transactions":[{"txHash":"f37e6181661473c14a123cca6f0ad0ab3303d011246f1d4bb4ccf3fccef2d700","rawTxHex":"0100000001a6ff3ed4a04fdc81630172c202e5eb3fcf5acb7651a1c233a1057728db550816010000006a47304402204bcc88caaefba54dfd2c7494af1898fa85af2cd0ece2070db618a9d3711772ce02201fd92149c149ebd9451a50013ef3e197e7e701283d5c25808ef0a3f933ab33e50121025c1ad4bc312481611e783751b8fc4de830a4436c129c4b82d704e728f3a5c1a3ffffffff02905f0100000000001976a914c081d02953f84ab9cb7aff43a845afb689d0c7ed88ac403d7800000000001976a914e64bae89305148c4098b1117594f802bcfcafdab88ac00000000"},{"txHash":"f37e6181661473c14a123cca6f0ad0ab3303d011246f1d4bb4ccf3fccef2d700","rawTxHex":"0100000001a6ff3ed4a04fdc81630172c202e5eb3fcf5acb7651a1c233a1057728db550816010000006a47304402204bcc88caaefba54dfd2c7494af1898fa85af2cd0ece2070db618a9d3711772ce02201fd92149c149ebd9451a50013ef3e197e7e701283d5c25808ef0a3f933ab33e50121025c1ad4bc312481611e783751b8fc4de830a4436c129c4b82d704e728f3a5c1a3ffffffff02905f0100000000001976a914c081d02953f84ab9cb7aff43a845afb689d0c7ed88ac403d7800000000001976a914e64bae89305148c4098b1117594f802bcfcafdab88ac00000000"}]}}'
40
+ http_version:
41
+ recorded_at: Fri, 21 Mar 2014 03:25:04 GMT
42
+ recorded_with: VCR 2.8.0
@@ -174,3 +174,16 @@ describe HelloBlock::Faucet, '.withdraw' do
174
174
  end
175
175
  end
176
176
  end
177
+
178
+
179
+ describe HelloBlock::RPC, '.where' do
180
+ let(:tx) { 'f37e6181661473c14a123cca6f0ad0ab3303d011246f1d4bb4ccf3fccef2d700' }
181
+
182
+ it 'hits a temporary api endpoint for compatibility with bitcoin ruby' do
183
+ VCR.use_cassette(:rpc) do
184
+ response = HelloBlock::RPC.where(transaction: [tx, tx])
185
+
186
+ expect(response['status']).to eq 'success'
187
+ end
188
+ end
189
+ end
@@ -0,0 +1,15 @@
1
+ require 'spec_helper'
2
+
3
+ describe HelloBlock::RPC, '.where' do
4
+ let(:tx) { 'f37e6181661473c14a123cca6f0ad0ab3303d011246f1d4bb4ccf3fccef2d700' }
5
+ before :each do
6
+ HelloBlock::RPC.inspect
7
+ end
8
+
9
+ it 'uses a temporary api endpoint for bitcoin ruby compatibility' do
10
+ HelloBlock::RPC.where(transaction: [tx, tx])
11
+
12
+ expect(HelloBlock::RPC.query[:path]).to eq '/getrawtransaction'
13
+ expect(HelloBlock::RPC.query[:params]).to eq({ txHashes: [tx, tx]})
14
+ end
15
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: helloblock
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathaniel Wroblewski
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-19 00:00:00.000000000 Z
11
+ date: 2014-03-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -108,6 +108,20 @@ dependencies:
108
108
  - - ~>
109
109
  - !ruby/object:Gem::Version
110
110
  version: '1.9'
111
+ - !ruby/object:Gem::Dependency
112
+ name: json
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - '>='
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - '>='
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
111
125
  - !ruby/object:Gem::Dependency
112
126
  name: yajl-ruby
113
127
  requirement: !ruby/object:Gem::Requirement
@@ -158,6 +172,7 @@ extensions: []
158
172
  extra_rdoc_files: []
159
173
  files:
160
174
  - .gitignore
175
+ - CHANGELOG.md
161
176
  - Gemfile
162
177
  - LICENSE.txt
163
178
  - README.md
@@ -173,6 +188,7 @@ files:
173
188
  - lib/helloblock/resources/block.rb
174
189
  - lib/helloblock/resources/faucet.rb
175
190
  - lib/helloblock/resources/query.rb
191
+ - lib/helloblock/resources/rpc.rb
176
192
  - lib/helloblock/resources/transaction.rb
177
193
  - lib/helloblock/resources/wallet.rb
178
194
  - lib/helloblock/spec_helper.rb
@@ -187,6 +203,7 @@ files:
187
203
  - spec/fixture/vcr_cassettes/latest_blocks.yml
188
204
  - spec/fixture/vcr_cassettes/latest_transactions.yml
189
205
  - spec/fixture/vcr_cassettes/propagate.yml
206
+ - spec/fixture/vcr_cassettes/rpc.yml
190
207
  - spec/fixture/vcr_cassettes/single_address.yml
191
208
  - spec/fixture/vcr_cassettes/single_address_unspents.yml
192
209
  - spec/fixture/vcr_cassettes/single_block.yml
@@ -199,6 +216,7 @@ files:
199
216
  - spec/lib/faucet_spec.rb
200
217
  - spec/lib/helloblock_spec.rb
201
218
  - spec/lib/request_spec.rb
219
+ - spec/lib/rpc_spec.rb
202
220
  - spec/lib/transaction_spec.rb
203
221
  - spec/spec_helper.rb
204
222
  homepage: ''
@@ -235,6 +253,7 @@ test_files:
235
253
  - spec/fixture/vcr_cassettes/latest_blocks.yml
236
254
  - spec/fixture/vcr_cassettes/latest_transactions.yml
237
255
  - spec/fixture/vcr_cassettes/propagate.yml
256
+ - spec/fixture/vcr_cassettes/rpc.yml
238
257
  - spec/fixture/vcr_cassettes/single_address.yml
239
258
  - spec/fixture/vcr_cassettes/single_address_unspents.yml
240
259
  - spec/fixture/vcr_cassettes/single_block.yml
@@ -247,5 +266,6 @@ test_files:
247
266
  - spec/lib/faucet_spec.rb
248
267
  - spec/lib/helloblock_spec.rb
249
268
  - spec/lib/request_spec.rb
269
+ - spec/lib/rpc_spec.rb
250
270
  - spec/lib/transaction_spec.rb
251
271
  - spec/spec_helper.rb