doge_coin 0.0.1 → 0.9.0

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.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/.rspec +2 -0
  3. data/Gemfile.lock +51 -0
  4. data/README.md +42 -2
  5. data/doge_coin.gemspec +8 -1
  6. data/lib/doge_coin.rb +14 -1
  7. data/lib/doge_coin/client.rb +99 -0
  8. data/lib/doge_coin/configuration.rb +24 -0
  9. data/lib/doge_coin/errors.rb +7 -0
  10. data/lib/doge_coin/version.rb +1 -1
  11. data/spec/blockchain_captured_responses/addressbalance/.json +1 -0
  12. data/spec/blockchain_captured_responses/addressbalance/DFrwT5zteXdvfgz3vjhWNcpXMXDiVPmkXN.json +1 -0
  13. data/spec/blockchain_captured_responses/addressbalance/DMP2WQ1pjCqSNCdvn4HMFztmLG7an9hNWT.json +1 -0
  14. data/spec/blockchain_captured_responses/addressbalance/DMP2WQ1pjCqSNCdvn4HMFztmLG7an9hNWT_---.json +1 -0
  15. data/spec/blockchain_captured_responses/addressbalance/abcdef.json +1 -0
  16. data/spec/blockchain_captured_responses/addresstohash/DMP2WQ1pjCqSNCdvn4HMFztmLG7an9hNWT.json +1 -0
  17. data/spec/blockchain_captured_responses/checkaddress/DMP2WQ1pjCqSNCdvn4HMFztmLG7an9hNWT.json +1 -0
  18. data/spec/blockchain_captured_responses/checkaddress/DMP2WQ1pjCqSNCdvn4HMFztmLG7an9hNWTBB.json +1 -0
  19. data/spec/blockchain_captured_responses/checkaddress/lol.json +1 -0
  20. data/spec/blockchain_captured_responses/decode_address/DMP2WQ1pjCqSNCdvn4HMFztmLG7an9hNWT.json +1 -0
  21. data/spec/blockchain_captured_responses/getblockcount.json +1 -0
  22. data/spec/blockchain_captured_responses/getdifficulty.json +1 -0
  23. data/spec/blockchain_captured_responses/getreceivedbyaddress/.json +1 -0
  24. data/spec/blockchain_captured_responses/getreceivedbyaddress/DFrwT5zteXdvfgz3vjhWNcpXMXDiVPmkXN.json +1 -0
  25. data/spec/blockchain_captured_responses/getreceivedbyaddress/DMP2WQ1pjCqSNCdvn4HMFztmLG7an9hNWT.json +1 -0
  26. data/spec/blockchain_captured_responses/getreceivedbyaddress/DMP2WQ1pjCqSNCdvn4HMFztmLG7an9hNWT_---.json +1 -0
  27. data/spec/blockchain_captured_responses/getreceivedbyaddress/abcdef.json +1 -0
  28. data/spec/blockchain_captured_responses/getsentbyaddress/.json +1 -0
  29. data/spec/blockchain_captured_responses/getsentbyaddress/DABmu1j1hD2HeFEiMGUByuc1HwwZguQvWg.json +1 -0
  30. data/spec/blockchain_captured_responses/getsentbyaddress/DMP2WQ1pjCqSNCdvn4HMFztmLG7an9hNWT.json +1 -0
  31. data/spec/blockchain_captured_responses/getsentbyaddress/DMP2WQ1pjCqSNCdvn4HMFztmLG7an9hNWT_---.json +1 -0
  32. data/spec/blockchain_captured_responses/getsentbyaddress/abcdef.json +1 -0
  33. data/spec/blockchain_captured_responses/hashtoaddress/B224785E7F7D213AF75AB440DB1108C07ED38D80.json +1 -0
  34. data/spec/blockchain_captured_responses/totalbc.json +1 -0
  35. data/spec/blockchain_captured_responses/transactions.json +1 -0
  36. data/spec/client_spec.rb +74 -0
  37. data/spec/spec_helper.rb +18 -0
  38. metadata +150 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a0299d7125f678d2577b588d27f26c77adf70a4f
4
- data.tar.gz: 12c5e0387b22893746e1dccee34a965945d71109
3
+ metadata.gz: 668ef2b6b9a1556865ee6fce61221f1abcfc4ce5
4
+ data.tar.gz: b3a50c25822071faa018eff7484992e7d4619c23
5
5
  SHA512:
6
- metadata.gz: dca6853ee8da84b28f097317b602b63d4f6563635fc6a528511312966a6a5082b496fdb0c0a036a482678f11194dae5ee70f13c228f372cf9832d22311203e9c
7
- data.tar.gz: 580b94939a4fdf680e6bc6b25ce05054085a85f8e7dbbbec8d6e35e7baf66b555c62206456c0ed262eb8444ee676aac49b264709a6a22e3f2c184b4439144eb1
6
+ metadata.gz: 0a2054db5836ea5e5a79847d987464bf663c1bba4bc3474d3454701907bea424eb8d3a7cdd1330bcd20983a40ee49f11284d0de414a864e199757bdfd2c897a4
7
+ data.tar.gz: 50df9ec6c068fc988c63e03342078a8f4272b6d4d6463436b475dbe47209310948edbcdff01009ec5c08e3b9263e5cf240ad6ade31e6409e3841ae5fdef6e228
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ -f d
data/Gemfile.lock ADDED
@@ -0,0 +1,51 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ doge_coin (0.0.1)
5
+ faraday (~> 0.9)
6
+ multi_json (~> 1.8)
7
+ vcr (~> 2.8)
8
+
9
+ GEM
10
+ remote: https://rubygems.org/
11
+ specs:
12
+ addressable (2.3.5)
13
+ coderay (1.1.0)
14
+ crack (0.4.1)
15
+ safe_yaml (~> 0.9.0)
16
+ diff-lcs (1.2.5)
17
+ faraday (0.9.0)
18
+ multipart-post (>= 1.2, < 3)
19
+ method_source (0.8.2)
20
+ multi_json (1.8.4)
21
+ multipart-post (2.0.0)
22
+ pry (0.9.12.6)
23
+ coderay (~> 1.0)
24
+ method_source (~> 0.8)
25
+ slop (~> 3.4)
26
+ rake (10.1.1)
27
+ rspec (2.14.1)
28
+ rspec-core (~> 2.14.0)
29
+ rspec-expectations (~> 2.14.0)
30
+ rspec-mocks (~> 2.14.0)
31
+ rspec-core (2.14.7)
32
+ rspec-expectations (2.14.4)
33
+ diff-lcs (>= 1.1.3, < 2.0)
34
+ rspec-mocks (2.14.4)
35
+ safe_yaml (0.9.7)
36
+ slop (3.4.7)
37
+ vcr (2.8.0)
38
+ webmock (1.15.0)
39
+ addressable (>= 2.2.7)
40
+ crack (>= 0.3.2)
41
+
42
+ PLATFORMS
43
+ ruby
44
+
45
+ DEPENDENCIES
46
+ bundler (~> 1.5)
47
+ doge_coin!
48
+ pry
49
+ rake (~> 10.1)
50
+ rspec (~> 2.14)
51
+ webmock (= 1.15)
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # DogeCoin
2
2
 
3
- TODO: Write a gem description
3
+ The purpose of this gem is to explore the DogeCoin blockchain.
4
+ For the moment it wraps the [Dogechain](http://dogechain.info) API, but this could change in the future.
4
5
 
5
6
  ## Installation
6
7
 
@@ -18,7 +19,46 @@ Or install it yourself as:
18
19
 
19
20
  ## Usage
20
21
 
21
- TODO: Write usage instructions here
22
+ ### Instruction
23
+
24
+ There is a call mapped for nearly all the [dogechain API](http://dogechain.info/chain/Dogecoin/q).
25
+
26
+ The current calls are:
27
+ ```ruby
28
+ get_block_count
29
+ get_difficulty
30
+ get_total_mined
31
+ transactions
32
+ address_balance (address)
33
+ total_received (address)
34
+ total_sent (address)
35
+ address_to_hash (address)
36
+ hash_to_address (address)
37
+ valid_address? (address)
38
+ decode_address (address)
39
+ ```
40
+
41
+ In a close-future, I would like to add methods to check if an address received new transactions, check how much validations it got etc...
42
+
43
+ Feel free to contribute !
44
+
45
+ ### Configuration
46
+
47
+ You can configure the gem to use [VCR](https://github.com/vcr/vcr) (e.g: for test purpose).
48
+ Simply add the following to your spec_helper.rb
49
+
50
+ ```ruby
51
+ DogeCoin.configure do |c|
52
+ c.vcr_mode = true
53
+ end
54
+ ```
55
+
56
+ ## Testing
57
+
58
+ Checkout the gem, then simply run
59
+ ```shell
60
+ rspec
61
+ ```
22
62
 
23
63
  ## Contributing
24
64
 
data/doge_coin.gemspec CHANGED
@@ -18,6 +18,13 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
+ spec.add_dependency "vcr", '~> 2.8'
22
+ spec.add_dependency 'multi_json', '~> 1.8'
23
+ spec.add_dependency 'faraday', '~> 0.9'
24
+
21
25
  spec.add_development_dependency "bundler", "~> 1.5"
22
- spec.add_development_dependency "rake"
26
+ spec.add_development_dependency "rake", '~> 10.1'
27
+ spec.add_development_dependency "rspec", '~> 2.14'
28
+ spec.add_development_dependency 'webmock', '1.15'
29
+ spec.add_development_dependency "pry", '~> 0.9'
23
30
  end
data/lib/doge_coin.rb CHANGED
@@ -1,5 +1,18 @@
1
1
  require "doge_coin/version"
2
+ require "doge_coin/configuration"
3
+ require "doge_coin/client"
4
+ require 'faraday'
2
5
 
3
6
  module DogeCoin
4
- # Your code goes here...
7
+ extend DogeCoin::Configuration
8
+
9
+ def self.method_missing(method, *args, &block)
10
+ new_client.send(method, *args, &block)
11
+ end
12
+
13
+ private
14
+
15
+ def self.new_client
16
+ @client ||= DogeCoin::Client.new
17
+ end
5
18
  end
@@ -0,0 +1,99 @@
1
+ require 'doge_coin/errors'
2
+ require 'faraday'
3
+
4
+ module DogeCoin
5
+ class Client
6
+ include Faraday
7
+ VALID_FLOAT_REGEXP = /\A(\d)+(\.\d+)?\z/
8
+
9
+ # Returns the current block count
10
+ def get_block_count
11
+ call_blockchain_api('getblockcount').to_i
12
+ end
13
+ # Returns the current difficulty
14
+ def get_difficulty
15
+ call_blockchain_api('getdifficulty').to_f
16
+ end
17
+ # Returns the total of mined doges
18
+ def get_total_mined
19
+ call_blockchain_api('totalbc').to_f
20
+ end
21
+
22
+ # Returns the amount transactions of the last blocks as an Array object
23
+ def transactions
24
+ JSON.parse(call_blockchain_api("transactions"))
25
+ end
26
+
27
+ # Returns the address balance (received - sent)
28
+ # Raise error if address is invalid
29
+ def address_balance address
30
+ balance = call_blockchain_api("addressbalance/#{address}")
31
+
32
+ raise DogeCoin::InvalidAddress unless is_a_float?(balance)
33
+
34
+ balance.to_f
35
+ end
36
+
37
+ # Returns the total sent
38
+ # Raise error if address is invalid
39
+ def total_received address
40
+ balance = call_blockchain_api("getreceivedbyaddress/#{address}")
41
+
42
+ raise DogeCoin::InvalidAddress unless is_a_float?(balance)
43
+
44
+ balance.to_f
45
+ end
46
+
47
+ # Returns the total sent
48
+ # Raise error if address is invalid
49
+ def total_sent address
50
+ balance = call_blockchain_api("getsentbyaddress/#{address}")
51
+
52
+ raise DogeCoin::InvalidAddress unless is_a_float?(balance)
53
+
54
+ balance.to_f
55
+ end
56
+
57
+ # Shows the 160-bit hash encoded in ADDRESS.
58
+ # For BBE compatibility, the address is not checked for validity.
59
+ def address_to_hash address
60
+ call_blockchain_api("addresstohash/#{address}")
61
+ end
62
+
63
+ # Converts a 160-bit hash and address version to an address.
64
+ def hash_to_address address
65
+ call_blockchain_api("hashtoaddress/#{address}")
66
+ end
67
+
68
+ # Returns true if the adress is valid, and false otherwise
69
+ def valid_address? address
70
+ code = call_blockchain_api("checkaddress/#{address}")
71
+
72
+ !['X5', 'SZ', 'CK'].include?(code)
73
+ end
74
+
75
+ # Shows ADDRESS's version byte(s) and public key hash as hex strings separated by colon (":").
76
+ def decode_address address
77
+ call_blockchain_api("decode_address/#{address}")
78
+ end
79
+
80
+ private
81
+ def is_a_float? nb
82
+ nb.match(VALID_FLOAT_REGEXP) ? true : false
83
+ end
84
+ def call_blockchain_api(params)
85
+ if DogeCoin.vcr_mode
86
+ DogeCoin::Configuration.configure_vcr
87
+
88
+ ::VCR.use_cassette(params, match_requests_on: [:method, :uri]) do
89
+ do_call params
90
+ end
91
+ else
92
+ do_call params
93
+ end
94
+ end
95
+ def do_call params
96
+ Faraday.get(DogeCoin::Configuration::DOGECHAIN_BASE_URL + params).body
97
+ end
98
+ end
99
+ end
@@ -0,0 +1,24 @@
1
+ require 'vcr'
2
+
3
+ module DogeCoin
4
+ module Configuration
5
+ attr_accessor :vcr_mode
6
+
7
+ DOGECHAIN_BASE_URL = 'http://dogechain.info/chain/Dogecoin/q/'
8
+
9
+ def configure
10
+ yield self
11
+ end
12
+
13
+ def self.configure_vcr
14
+ VCR.configure do |c|
15
+ c.cassette_library_dir = 'spec/blockchain_captured_responses'
16
+ c.default_cassette_options = { serialize_with: :json }
17
+ c.preserve_exact_body_bytes do |http_message|
18
+ http_message.body.encoding.name == 'ASCII-8BIT' || !http_message.body.valid_encoding?
19
+ end
20
+ c.hook_into :webmock
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,7 @@
1
+ module DogeCoin
2
+ class InvalidAddress < StandardError
3
+ def intialize msg = "Not a valid address"
4
+ super msg
5
+ end
6
+ end
7
+ end
@@ -1,3 +1,3 @@
1
1
  module DogeCoin
2
- VERSION = "0.0.1"
2
+ VERSION = "0.9.0"
3
3
  end
@@ -0,0 +1 @@
1
+ {"http_interactions":[{"request":{"method":"get","uri":"http://dogechain.info/chain/Dogecoin/q/addressbalance/","body":{"encoding":"US-ASCII","string":""},"headers":{"User-Agent":["Faraday v0.9.0"],"Accept-Encoding":["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"],"Accept":["*/*"]}},"response":{"status":{"code":200,"message":"OK"},"headers":{"Date":["Wed, 29 Jan 2014 21:33:02 GMT"],"Server":["Apache/2.2.22 (Debian)"],"X-Powered-By":["PHP/5.4.4-14+deb7u7"],"Vary":["Accept-Encoding"],"Content-Length":["97"],"Content-Type":["text/plain"]},"body":{"encoding":"UTF-8","string":"returns amount of money at the given address\n/chain/CHAIN/q/addressbalance/ADDRESS"},"http_version":null},"recorded_at":"Wed, 29 Jan 2014 21:36:16 GMT"}],"recorded_with":"VCR 2.8.0"}
@@ -0,0 +1 @@
1
+ {"http_interactions":[{"request":{"method":"get","uri":"http://dogechain.info/chain/Dogecoin/q/addressbalance/DFrwT5zteXdvfgz3vjhWNcpXMXDiVPmkXN","body":{"encoding":"US-ASCII","string":""},"headers":{"User-Agent":["Faraday v0.9.0"],"Accept-Encoding":["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"],"Accept":["*/*"]}},"response":{"status":{"code":200,"message":"OK"},"headers":{"Date":["Wed, 29 Jan 2014 21:33:02 GMT"],"Server":["Apache/2.2.22 (Debian)"],"X-Powered-By":["PHP/5.4.4-14+deb7u7"],"Vary":["Accept-Encoding"],"Content-Length":["34"],"Content-Type":["text/plain"]},"body":{"encoding":"UTF-8","string":"18712.33473684"},"http_version":null},"recorded_at":"Wed, 29 Jan 2014 21:36:15 GMT"}],"recorded_with":"VCR 2.8.0"}
@@ -0,0 +1 @@
1
+ {"http_interactions":[{"request":{"method":"get","uri":"http://dogechain.info/chain/Dogecoin/q/addressbalance/DMP2WQ1pjCqSNCdvn4HMFztmLG7an9hNWT","body":{"encoding":"US-ASCII","string":""},"headers":{"User-Agent":["Faraday v0.9.0"],"Accept-Encoding":["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"],"Accept":["*/*"]}},"response":{"status":{"code":200,"message":"OK"},"headers":{"Date":["Wed, 29 Jan 2014 21:33:02 GMT"],"Server":["Apache/2.2.22 (Debian)"],"X-Powered-By":["PHP/5.4.4-14+deb7u7"],"Vary":["Accept-Encoding"],"Content-Length":["21"],"Content-Type":["text/plain"]},"body":{"encoding":"UTF-8","string":"0"},"http_version":null},"recorded_at":"Wed, 29 Jan 2014 21:36:15 GMT"}],"recorded_with":"VCR 2.8.0"}
@@ -0,0 +1 @@
1
+ {"http_interactions":[{"request":{"method":"get","uri":"http://dogechain.info/chain/Dogecoin/q/addressbalance/DMP2WQ1pjCqSNCdvn4HMFztmLG7an9hNWT+---","body":{"encoding":"US-ASCII","string":""},"headers":{"User-Agent":["Faraday v0.9.0"],"Accept-Encoding":["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"],"Accept":["*/*"]}},"response":{"status":{"code":400,"message":"Bad Request"},"headers":{"Date":["Wed, 29 Jan 2014 21:33:03 GMT"],"Server":["Apache/2.2.22 (Debian)"],"X-Powered-By":["PHP/5.4.4-14+deb7u7"],"Vary":["Accept-Encoding"],"Content-Length":["613"],"Connection":["close"],"Content-Type":["text/html"]},"body":{"encoding":"UTF-8","string":"<!DOCTYPE html>\n<html class=\"no-js\" lang=\"en\">\n\t<head>\n\t\t<meta charset=\"utf-8\">\n\t\t<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n\t\t<title>Dogechain - Page not found</title>\n\t\t<meta name=\"description\" content=\"\">\n\t\t<meta name=\"robots\" content=\"index, follow\">\n\t\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n\t\t\n\t\t<!-- Styles -->\n\t\t<link rel=\"stylesheet\" href=\"/content/css/sangoma-blue.css\">\n\n\t\t<!-- JS Libs -->\n\t\t<script src=\"//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js\"></script>\n\t\t<script>window.jQuery || document.write('<script src=\"/content/js/libs/jquery.js\"><\\/script>')</script>\n\t\t<script src=\"/content/js/libs/modernizr.js\"></script>\n\n\t\t<!-- IE8 support of media queries and CSS 2/3 selectors -->\n\t\t<!--[if lt IE 9]>\n\t\t\t<script src=\"/content/js/libs/respond.min.js\"></script>\n\t\t\t<script src=\"/content/js/libs/selectivizr.js\"></script>\n\t\t<![endif]-->\n\n\t</head>\n\t<body class=\"error-page\">\n\t\t\n\t\t<!-- Error page container -->\n\t\t<section class=\"container\">\n\t\t\n\t\t\t<h1>Error</h1>\n\t\t\t<p class=\"description\">An Error Was Encountered</p>\n\t\t\t<p>The URI you submitted has disallowed characters.</p>\t\t</section>\n\t\t<!-- /Error page container -->\n\t\t\n\t</body>\n</html>"},"http_version":null},"recorded_at":"Wed, 29 Jan 2014 21:36:16 GMT"}],"recorded_with":"VCR 2.8.0"}
@@ -0,0 +1 @@
1
+ {"http_interactions":[{"request":{"method":"get","uri":"http://dogechain.info/chain/Dogecoin/q/addressbalance/abcdef","body":{"encoding":"US-ASCII","string":""},"headers":{"User-Agent":["Faraday v0.9.0"],"Accept-Encoding":["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"],"Accept":["*/*"]}},"response":{"status":{"code":200,"message":"OK"},"headers":{"Date":["Wed, 29 Jan 2014 21:33:03 GMT"],"Server":["Apache/2.2.22 (Debian)"],"X-Powered-By":["PHP/5.4.4-14+deb7u7"],"Vary":["Accept-Encoding"],"Content-Length":["42"],"Content-Type":["text/plain"]},"body":{"encoding":"UTF-8","string":"ERROR: address invalid"},"http_version":null},"recorded_at":"Wed, 29 Jan 2014 21:36:16 GMT"}],"recorded_with":"VCR 2.8.0"}
@@ -0,0 +1 @@
1
+ {"http_interactions":[{"request":{"method":"get","uri":"http://dogechain.info/chain/Dogecoin/q/addresstohash/DMP2WQ1pjCqSNCdvn4HMFztmLG7an9hNWT","body":{"encoding":"US-ASCII","string":""},"headers":{"User-Agent":["Faraday v0.9.0"],"Accept-Encoding":["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"],"Accept":["*/*"]}},"response":{"status":{"code":200,"message":"OK"},"headers":{"Date":["Wed, 29 Jan 2014 21:33:03 GMT"],"Server":["Apache/2.2.22 (Debian)"],"X-Powered-By":["PHP/5.4.4-14+deb7u7"],"Vary":["Accept-Encoding"],"Content-Length":["56"],"Content-Type":["text/plain"]},"body":{"encoding":"UTF-8","string":"B224785E7F7D213AF75AB440DB1108C07ED38D80"},"http_version":null},"recorded_at":"Wed, 29 Jan 2014 21:36:16 GMT"}],"recorded_with":"VCR 2.8.0"}
@@ -0,0 +1 @@
1
+ {"http_interactions":[{"request":{"method":"get","uri":"http://dogechain.info/chain/Dogecoin/q/checkaddress/DMP2WQ1pjCqSNCdvn4HMFztmLG7an9hNWT","body":{"encoding":"US-ASCII","string":""},"headers":{"User-Agent":["Faraday v0.9.0"],"Accept-Encoding":["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"],"Accept":["*/*"]}},"response":{"status":{"code":200,"message":"OK"},"headers":{"Date":["Wed, 29 Jan 2014 21:33:01 GMT"],"Server":["Apache/2.2.22 (Debian)"],"X-Powered-By":["PHP/5.4.4-14+deb7u7"],"Vary":["Accept-Encoding"],"Content-Length":["22"],"Content-Type":["text/plain"]},"body":{"encoding":"UTF-8","string":"1E"},"http_version":null},"recorded_at":"Wed, 29 Jan 2014 21:36:14 GMT"}],"recorded_with":"VCR 2.8.0"}
@@ -0,0 +1 @@
1
+ {"http_interactions":[{"request":{"method":"get","uri":"http://dogechain.info/chain/Dogecoin/q/checkaddress/DMP2WQ1pjCqSNCdvn4HMFztmLG7an9hNWTBB","body":{"encoding":"US-ASCII","string":""},"headers":{"User-Agent":["Faraday v0.9.0"],"Accept-Encoding":["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"],"Accept":["*/*"]}},"response":{"status":{"code":200,"message":"OK"},"headers":{"Date":["Wed, 29 Jan 2014 21:33:01 GMT"],"Server":["Apache/2.2.22 (Debian)"],"X-Powered-By":["PHP/5.4.4-14+deb7u7"],"Vary":["Accept-Encoding"],"Content-Length":["22"],"Content-Type":["text/plain"]},"body":{"encoding":"UTF-8","string":"CK"},"http_version":null},"recorded_at":"Wed, 29 Jan 2014 21:36:15 GMT"}],"recorded_with":"VCR 2.8.0"}
@@ -0,0 +1 @@
1
+ {"http_interactions":[{"request":{"method":"get","uri":"http://dogechain.info/chain/Dogecoin/q/checkaddress/lol","body":{"encoding":"US-ASCII","string":""},"headers":{"User-Agent":["Faraday v0.9.0"],"Accept-Encoding":["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"],"Accept":["*/*"]}},"response":{"status":{"code":200,"message":"OK"},"headers":{"Date":["Wed, 29 Jan 2014 21:33:01 GMT"],"Server":["Apache/2.2.22 (Debian)"],"X-Powered-By":["PHP/5.4.4-14+deb7u7"],"Vary":["Accept-Encoding"],"Content-Length":["22"],"Content-Type":["text/plain"]},"body":{"encoding":"UTF-8","string":"SZ"},"http_version":null},"recorded_at":"Wed, 29 Jan 2014 21:36:14 GMT"}],"recorded_with":"VCR 2.8.0"}
@@ -0,0 +1 @@
1
+ {"http_interactions":[{"request":{"method":"get","uri":"http://dogechain.info/chain/Dogecoin/q/decode_address/DMP2WQ1pjCqSNCdvn4HMFztmLG7an9hNWT","body":{"encoding":"US-ASCII","string":""},"headers":{"User-Agent":["Faraday v0.9.0"],"Accept-Encoding":["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"],"Accept":["*/*"]}},"response":{"status":{"code":200,"message":"OK"},"headers":{"Date":["Wed, 29 Jan 2014 21:33:04 GMT"],"Server":["Apache/2.2.22 (Debian)"],"X-Powered-By":["PHP/5.4.4-14+deb7u7"],"Vary":["Accept-Encoding"],"Content-Length":["61"],"Content-Type":["text/plain"]},"body":{"encoding":"UTF-8","string":"1e:B224785E7F7D213AF75AB440DB1108C07ED38D80"},"http_version":null},"recorded_at":"Wed, 29 Jan 2014 21:36:17 GMT"}],"recorded_with":"VCR 2.8.0"}
@@ -0,0 +1 @@
1
+ {"http_interactions":[{"request":{"method":"get","uri":"http://dogechain.info/chain/Dogecoin/q/getblockcount","body":{"encoding":"US-ASCII","string":""},"headers":{"User-Agent":["Faraday v0.9.0"],"Accept-Encoding":["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"],"Accept":["*/*"]}},"response":{"status":{"code":200,"message":"OK"},"headers":{"Date":["Wed, 29 Jan 2014 19:59:24 GMT"],"Server":["Apache/2.2.22 (Debian)"],"X-Powered-By":["PHP/5.4.4-14+deb7u7"],"Vary":["Accept-Encoding"],"Content-Length":["25"],"Content-Type":["text/plain"]},"body":{"encoding":"UTF-8","string":"77974"},"http_version":null},"recorded_at":"Wed, 29 Jan 2014 20:02:37 GMT"}],"recorded_with":"VCR 2.8.0"}
@@ -0,0 +1 @@
1
+ {"http_interactions":[{"request":{"method":"get","uri":"http://dogechain.info/chain/Dogecoin/q/getdifficulty","body":{"encoding":"US-ASCII","string":""},"headers":{"User-Agent":["Faraday v0.9.0"],"Accept-Encoding":["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"],"Accept":["*/*"]}},"response":{"status":{"code":200,"message":"OK"},"headers":{"Date":["Wed, 29 Jan 2014 21:33:01 GMT"],"Server":["Apache/2.2.22 (Debian)"],"X-Powered-By":["PHP/5.4.4-14+deb7u7"],"Vary":["Accept-Encoding"],"Content-Length":["28"],"Content-Type":["text/plain"]},"body":{"encoding":"UTF-8","string":"1009.723"},"http_version":null},"recorded_at":"Wed, 29 Jan 2014 21:36:14 GMT"}],"recorded_with":"VCR 2.8.0"}
@@ -0,0 +1 @@
1
+ {"http_interactions":[{"request":{"method":"get","uri":"http://dogechain.info/chain/Dogecoin/q/getreceivedbyaddress/","body":{"encoding":"US-ASCII","string":""},"headers":{"User-Agent":["Faraday v0.9.0"],"Accept-Encoding":["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"],"Accept":["*/*"]}},"response":{"status":{"code":200,"message":"OK"},"headers":{"Date":["Wed, 29 Jan 2014 21:34:45 GMT"],"Server":["Apache/2.2.22 (Debian)"],"X-Powered-By":["PHP/5.4.4-14+deb7u7"],"Vary":["Accept-Encoding"],"Content-Length":["130"],"Content-Type":["text/html"]},"body":{"encoding":"UTF-8","string":"returns amount of money received by given address (not balance, sends are not subtracted)\n/chain/CHAIN/q/getreceivedbyaddress/ADDRESS"},"http_version":null},"recorded_at":"Wed, 29 Jan 2014 21:37:59 GMT"}],"recorded_with":"VCR 2.8.0"}
@@ -0,0 +1 @@
1
+ {"http_interactions":[{"request":{"method":"get","uri":"http://dogechain.info/chain/Dogecoin/q/getreceivedbyaddress/DFrwT5zteXdvfgz3vjhWNcpXMXDiVPmkXN","body":{"encoding":"US-ASCII","string":""},"headers":{"User-Agent":["Faraday v0.9.0"],"Accept-Encoding":["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"],"Accept":["*/*"]}},"response":{"status":{"code":200,"message":"OK"},"headers":{"Date":["Wed, 29 Jan 2014 21:34:44 GMT"],"Server":["Apache/2.2.22 (Debian)"],"X-Powered-By":["PHP/5.4.4-14+deb7u7"],"Vary":["Accept-Encoding"],"Content-Length":["34"],"Content-Type":["text/html"]},"body":{"encoding":"UTF-8","string":"18712.33473684"},"http_version":null},"recorded_at":"Wed, 29 Jan 2014 21:37:57 GMT"}],"recorded_with":"VCR 2.8.0"}
@@ -0,0 +1 @@
1
+ {"http_interactions":[{"request":{"method":"get","uri":"http://dogechain.info/chain/Dogecoin/q/getreceivedbyaddress/DMP2WQ1pjCqSNCdvn4HMFztmLG7an9hNWT","body":{"encoding":"US-ASCII","string":""},"headers":{"User-Agent":["Faraday v0.9.0"],"Accept-Encoding":["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"],"Accept":["*/*"]}},"response":{"status":{"code":200,"message":"OK"},"headers":{"Date":["Wed, 29 Jan 2014 21:34:44 GMT"],"Server":["Apache/2.2.22 (Debian)"],"X-Powered-By":["PHP/5.4.4-14+deb7u7"],"Vary":["Accept-Encoding"],"Content-Length":["21"],"Content-Type":["text/html"]},"body":{"encoding":"UTF-8","string":"0"},"http_version":null},"recorded_at":"Wed, 29 Jan 2014 21:37:58 GMT"}],"recorded_with":"VCR 2.8.0"}
@@ -0,0 +1 @@
1
+ {"http_interactions":[{"request":{"method":"get","uri":"http://dogechain.info/chain/Dogecoin/q/getreceivedbyaddress/DMP2WQ1pjCqSNCdvn4HMFztmLG7an9hNWT+---","body":{"encoding":"US-ASCII","string":""},"headers":{"User-Agent":["Faraday v0.9.0"],"Accept-Encoding":["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"],"Accept":["*/*"]}},"response":{"status":{"code":400,"message":"Bad Request"},"headers":{"Date":["Wed, 29 Jan 2014 21:34:48 GMT"],"Server":["Apache/2.2.22 (Debian)"],"X-Powered-By":["PHP/5.4.4-14+deb7u7"],"Vary":["Accept-Encoding"],"Content-Length":["613"],"Connection":["close"],"Content-Type":["text/html"]},"body":{"encoding":"UTF-8","string":"<!DOCTYPE html>\n<html class=\"no-js\" lang=\"en\">\n\t<head>\n\t\t<meta charset=\"utf-8\">\n\t\t<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n\t\t<title>Dogechain - Page not found</title>\n\t\t<meta name=\"description\" content=\"\">\n\t\t<meta name=\"robots\" content=\"index, follow\">\n\t\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n\t\t\n\t\t<!-- Styles -->\n\t\t<link rel=\"stylesheet\" href=\"/content/css/sangoma-blue.css\">\n\n\t\t<!-- JS Libs -->\n\t\t<script src=\"//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js\"></script>\n\t\t<script>window.jQuery || document.write('<script src=\"/content/js/libs/jquery.js\"><\\/script>')</script>\n\t\t<script src=\"/content/js/libs/modernizr.js\"></script>\n\n\t\t<!-- IE8 support of media queries and CSS 2/3 selectors -->\n\t\t<!--[if lt IE 9]>\n\t\t\t<script src=\"/content/js/libs/respond.min.js\"></script>\n\t\t\t<script src=\"/content/js/libs/selectivizr.js\"></script>\n\t\t<![endif]-->\n\n\t</head>\n\t<body class=\"error-page\">\n\t\t\n\t\t<!-- Error page container -->\n\t\t<section class=\"container\">\n\t\t\n\t\t\t<h1>Error</h1>\n\t\t\t<p class=\"description\">An Error Was Encountered</p>\n\t\t\t<p>The URI you submitted has disallowed characters.</p>\t\t</section>\n\t\t<!-- /Error page container -->\n\t\t\n\t</body>\n</html>"},"http_version":null},"recorded_at":"Wed, 29 Jan 2014 21:38:02 GMT"}],"recorded_with":"VCR 2.8.0"}
@@ -0,0 +1 @@
1
+ {"http_interactions":[{"request":{"method":"get","uri":"http://dogechain.info/chain/Dogecoin/q/getreceivedbyaddress/abcdef","body":{"encoding":"US-ASCII","string":""},"headers":{"User-Agent":["Faraday v0.9.0"],"Accept-Encoding":["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"],"Accept":["*/*"]}},"response":{"status":{"code":200,"message":"OK"},"headers":{"Date":["Wed, 29 Jan 2014 21:34:47 GMT"],"Server":["Apache/2.2.22 (Debian)"],"X-Powered-By":["PHP/5.4.4-14+deb7u7"],"Vary":["Accept-Encoding"],"Content-Length":["42"],"Content-Type":["text/html"]},"body":{"encoding":"UTF-8","string":"ERROR: address invalid"},"http_version":null},"recorded_at":"Wed, 29 Jan 2014 21:38:01 GMT"}],"recorded_with":"VCR 2.8.0"}
@@ -0,0 +1 @@
1
+ {"http_interactions":[{"request":{"method":"get","uri":"http://dogechain.info/chain/Dogecoin/q/getsentbyaddress/","body":{"encoding":"US-ASCII","string":""},"headers":{"User-Agent":["Faraday v0.9.0"],"Accept-Encoding":["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"],"Accept":["*/*"]}},"response":{"status":{"code":200,"message":"OK"},"headers":{"Date":["Wed, 29 Jan 2014 21:38:23 GMT"],"Server":["Apache/2.2.22 (Debian)"],"X-Powered-By":["PHP/5.4.4-14+deb7u7"],"Vary":["Accept-Encoding"],"Content-Length":["98"],"Content-Type":["text/html"]},"body":{"encoding":"UTF-8","string":"returns amount of money sent from given address\n/chain/CHAIN/q/getsentbyaddress/ADDRESS"},"http_version":null},"recorded_at":"Wed, 29 Jan 2014 21:41:36 GMT"}],"recorded_with":"VCR 2.8.0"}
@@ -0,0 +1 @@
1
+ {"http_interactions":[{"request":{"method":"get","uri":"http://dogechain.info/chain/Dogecoin/q/getsentbyaddress/DABmu1j1hD2HeFEiMGUByuc1HwwZguQvWg","body":{"encoding":"US-ASCII","string":""},"headers":{"User-Agent":["Faraday v0.9.0"],"Accept-Encoding":["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"],"Accept":["*/*"]}},"response":{"status":{"code":200,"message":"OK"},"headers":{"Date":["Wed, 29 Jan 2014 21:38:22 GMT"],"Server":["Apache/2.2.22 (Debian)"],"X-Powered-By":["PHP/5.4.4-14+deb7u7"],"Vary":["Accept-Encoding"],"Content-Length":["34"],"Content-Type":["text/html"]},"body":{"encoding":"UTF-8","string":"86136.83368812"},"http_version":null},"recorded_at":"Wed, 29 Jan 2014 21:41:35 GMT"}],"recorded_with":"VCR 2.8.0"}
@@ -0,0 +1 @@
1
+ {"http_interactions":[{"request":{"method":"get","uri":"http://dogechain.info/chain/Dogecoin/q/getsentbyaddress/DMP2WQ1pjCqSNCdvn4HMFztmLG7an9hNWT","body":{"encoding":"US-ASCII","string":""},"headers":{"User-Agent":["Faraday v0.9.0"],"Accept-Encoding":["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"],"Accept":["*/*"]}},"response":{"status":{"code":200,"message":"OK"},"headers":{"Date":["Wed, 29 Jan 2014 21:38:23 GMT"],"Server":["Apache/2.2.22 (Debian)"],"X-Powered-By":["PHP/5.4.4-14+deb7u7"],"Vary":["Accept-Encoding"],"Content-Length":["21"],"Content-Type":["text/html"]},"body":{"encoding":"UTF-8","string":"0"},"http_version":null},"recorded_at":"Wed, 29 Jan 2014 21:41:36 GMT"}],"recorded_with":"VCR 2.8.0"}
@@ -0,0 +1 @@
1
+ {"http_interactions":[{"request":{"method":"get","uri":"http://dogechain.info/chain/Dogecoin/q/getsentbyaddress/DMP2WQ1pjCqSNCdvn4HMFztmLG7an9hNWT+---","body":{"encoding":"US-ASCII","string":""},"headers":{"User-Agent":["Faraday v0.9.0"],"Accept-Encoding":["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"],"Accept":["*/*"]}},"response":{"status":{"code":400,"message":"Bad Request"},"headers":{"Date":["Wed, 29 Jan 2014 21:38:24 GMT"],"Server":["Apache/2.2.22 (Debian)"],"X-Powered-By":["PHP/5.4.4-14+deb7u7"],"Vary":["Accept-Encoding"],"Content-Length":["613"],"Connection":["close"],"Content-Type":["text/html"]},"body":{"encoding":"UTF-8","string":"<!DOCTYPE html>\n<html class=\"no-js\" lang=\"en\">\n\t<head>\n\t\t<meta charset=\"utf-8\">\n\t\t<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n\t\t<title>Dogechain - Page not found</title>\n\t\t<meta name=\"description\" content=\"\">\n\t\t<meta name=\"robots\" content=\"index, follow\">\n\t\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n\t\t\n\t\t<!-- Styles -->\n\t\t<link rel=\"stylesheet\" href=\"/content/css/sangoma-blue.css\">\n\n\t\t<!-- JS Libs -->\n\t\t<script src=\"//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js\"></script>\n\t\t<script>window.jQuery || document.write('<script src=\"/content/js/libs/jquery.js\"><\\/script>')</script>\n\t\t<script src=\"/content/js/libs/modernizr.js\"></script>\n\n\t\t<!-- IE8 support of media queries and CSS 2/3 selectors -->\n\t\t<!--[if lt IE 9]>\n\t\t\t<script src=\"/content/js/libs/respond.min.js\"></script>\n\t\t\t<script src=\"/content/js/libs/selectivizr.js\"></script>\n\t\t<![endif]-->\n\n\t</head>\n\t<body class=\"error-page\">\n\t\t\n\t\t<!-- Error page container -->\n\t\t<section class=\"container\">\n\t\t\n\t\t\t<h1>Error</h1>\n\t\t\t<p class=\"description\">An Error Was Encountered</p>\n\t\t\t<p>The URI you submitted has disallowed characters.</p>\t\t</section>\n\t\t<!-- /Error page container -->\n\t\t\n\t</body>\n</html>"},"http_version":null},"recorded_at":"Wed, 29 Jan 2014 21:41:37 GMT"}],"recorded_with":"VCR 2.8.0"}
@@ -0,0 +1 @@
1
+ {"http_interactions":[{"request":{"method":"get","uri":"http://dogechain.info/chain/Dogecoin/q/getsentbyaddress/abcdef","body":{"encoding":"US-ASCII","string":""},"headers":{"User-Agent":["Faraday v0.9.0"],"Accept-Encoding":["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"],"Accept":["*/*"]}},"response":{"status":{"code":200,"message":"OK"},"headers":{"Date":["Wed, 29 Jan 2014 21:38:23 GMT"],"Server":["Apache/2.2.22 (Debian)"],"X-Powered-By":["PHP/5.4.4-14+deb7u7"],"Vary":["Accept-Encoding"],"Content-Length":["42"],"Content-Type":["text/html"]},"body":{"encoding":"UTF-8","string":"ERROR: address invalid"},"http_version":null},"recorded_at":"Wed, 29 Jan 2014 21:41:36 GMT"}],"recorded_with":"VCR 2.8.0"}
@@ -0,0 +1 @@
1
+ {"http_interactions":[{"request":{"method":"get","uri":"http://dogechain.info/chain/Dogecoin/q/hashtoaddress/B224785E7F7D213AF75AB440DB1108C07ED38D80","body":{"encoding":"US-ASCII","string":""},"headers":{"User-Agent":["Faraday v0.9.0"],"Accept-Encoding":["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"],"Accept":["*/*"]}},"response":{"status":{"code":200,"message":"OK"},"headers":{"Date":["Wed, 29 Jan 2014 21:33:04 GMT"],"Server":["Apache/2.2.22 (Debian)"],"X-Powered-By":["PHP/5.4.4-14+deb7u7"],"Vary":["Accept-Encoding"],"Content-Length":["54"],"Content-Type":["text/html"]},"body":{"encoding":"UTF-8","string":"DMP2WQ1pjCqSNCdvn4HMFztmLG7an9hNWT"},"http_version":null},"recorded_at":"Wed, 29 Jan 2014 21:36:17 GMT"}],"recorded_with":"VCR 2.8.0"}
@@ -0,0 +1 @@
1
+ {"http_interactions":[{"request":{"method":"get","uri":"http://dogechain.info/chain/Dogecoin/q/totalbc","body":{"encoding":"US-ASCII","string":""},"headers":{"User-Agent":["Faraday v0.9.0"],"Accept-Encoding":["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"],"Accept":["*/*"]}},"response":{"status":{"code":200,"message":"OK"},"headers":{"Date":["Wed, 29 Jan 2014 21:40:06 GMT"],"Server":["Apache/2.2.22 (Debian)"],"X-Powered-By":["PHP/5.4.4-14+deb7u7"],"Vary":["Accept-Encoding"],"Content-Length":["40"],"Content-Type":["text/plain"]},"body":{"encoding":"UTF-8","string":"38898180040.54100037"},"http_version":null},"recorded_at":"Wed, 29 Jan 2014 21:43:20 GMT"}],"recorded_with":"VCR 2.8.0"}
@@ -0,0 +1 @@
1
+ {"http_interactions":[{"request":{"method":"get","uri":"http://dogechain.info/chain/Dogecoin/q/transactions","body":{"encoding":"US-ASCII","string":""},"headers":{"User-Agent":["Faraday v0.9.0"],"Accept-Encoding":["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"],"Accept":["*/*"]}},"response":{"status":{"code":200,"message":"OK"},"headers":{"Date":["Wed, 29 Jan 2014 21:42:05 GMT"],"Server":["Apache/2.2.22 (Debian)"],"X-Powered-By":["PHP/5.4.4-14+deb7u7"],"Content-Length":["3415"],"Content-Type":["application/json"]},"body":{"encoding":"UTF-8","string":"[[500,1386475886,1],[1000,1386481098,1],[1500,1386502787,5],[2000,1386525878,1],[2500,1386547883,20],[3000,1386578142,3],[3500,1386604879,17],[4000,1386632799,2],[4500,1386660584,3],[5000,1386689081,7],[5500,1386722845,7],[6000,1386747831,2],[6500,1386775649,2],[7000,1386806037,3],[7500,1386832869,20],[8000,1386862884,15],[8500,1386894675,14],[9000,1386921194,20],[9500,1386949902,35],[10000,1386976507,40],[10500,1387003002,4],[11000,1387032616,117],[11500,1387059151,140],[12000,1387087438,12],[12500,1387112572,96],[13000,1387136994,95],[13500,1387164357,203],[14000,1387191530,15],[14500,1387221926,31],[15000,1387248986,104],[15500,1387279568,37],[16000,1387309712,196],[16500,1387337230,22],[17000,1387363763,11],[17500,1387397828,113],[18000,1387421658,135],[18500,1387450373,10],[19000,1387479231,126],[19500,1387505638,26],[20000,1387534464,44],[20500,1387564774,49],[21000,1387593136,60],[21500,1387627043,73],[22000,1387655643,482],[22500,1387684851,136],[23000,1387718706,32],[23500,1387746707,31],[24000,1387777985,19],[24500,1387806287,99],[25000,1387836151,136],[25500,1387864159,105],[26000,1387893795,34],[26500,1387924225,100],[27000,1387952095,12],[27500,1387982776,79],[28000,1388013114,82],[28500,1388043228,124],[29000,1388075043,50],[29500,1388103339,89],[30000,1388133665,156],[30500,1388165522,66],[31000,1388196430,34],[31500,1388225598,60],[32000,1388255897,151],[32500,1388287354,35],[33000,1388319215,11],[33500,1388347598,90],[34000,1388378337,43],[34500,1388409878,270],[35000,1388439361,28],[35500,1388470462,50],[36000,1388499584,19],[36500,1388530886,10],[37000,1388559136,46],[37500,1388588846,98],[38000,1388620041,82],[38500,1388649714,11],[39000,1388682262,15],[39500,1388710769,69],[40000,1388740613,51],[40500,1388773764,122],[41000,1388804300,42],[41500,1388836376,30],[42000,1388865799,95],[42500,1388898408,52],[43000,1388925957,22],[43500,1388955796,10],[44000,1388986902,37],[44500,1389017907,5],[45000,1389050143,13],[45500,1389081564,17],[46000,1389109279,68],[46500,1389140386,158],[47000,1389170935,21],[47500,1389200872,25],[48000,1389234256,10],[48500,1389261155,36],[49000,1389291613,47],[49500,1389319697,67],[50000,1389349309,8],[50500,1389378897,88],[51000,1389407229,99],[51500,1389436319,10],[52000,1389467814,57],[52500,1389497390,3],[53000,1389529329,38],[53500,1389562731,6],[54000,1389590609,105],[54500,1389620821,3],[55000,1389652909,36],[55500,1389682876,13],[56000,1389712859,7],[56500,1389741710,16],[57000,1389769890,45],[57500,1389799481,14],[58000,1389828500,83],[58500,1389861084,3],[59000,1389889461,13],[59500,1389919687,27],[60000,1389950047,103],[60500,1389978241,123],[61000,1390008267,20],[61500,1390036861,198],[62000,1390065260,167],[62500,1390096819,21],[63000,1390124726,3],[63500,1390154395,7],[64000,1390184154,58],[64500,1390213880,3],[65000,1390242241,59],[65500,1390271894,95],[66000,1390301280,195],[66500,1390328153,3],[67000,1390357497,171],[67500,1390387792,307],[68000,1390416857,223],[68500,1390447997,105],[69000,1390478375,9],[69500,1390508824,43],[70000,1390537379,6],[70500,1390567507,383],[71000,1390596599,58],[71500,1390628597,24],[72000,1390657333,84],[72500,1390689486,195],[73000,1390715648,19],[73500,1390751128,3],[74000,1390781652,60],[74500,1390812032,392],[75000,1390841574,3],[75500,1390871692,7],[76000,1390902445,23],[76500,1390932955,97],[77000,1390964228,33],[77500,1390997581,3],[78000,1391027611,29]]"},"http_version":null},"recorded_at":"Wed, 29 Jan 2014 21:45:18 GMT"}],"recorded_with":"VCR 2.8.0"}
@@ -0,0 +1,74 @@
1
+ require 'spec_helper'
2
+
3
+ describe DogeCoin do
4
+ ADDRESS_FOR_DONATIONS = 'DMP2WQ1pjCqSNCdvn4HMFztmLG7an9hNWT'
5
+ HASH_FROM_ADDRESS_FOR_DONATION = 'B224785E7F7D213AF75AB440DB1108C07ED38D80'
6
+
7
+ it '#get_block_count' do
8
+ blockcount = DogeCoin.get_block_count
9
+
10
+ # As recorded in the tape
11
+ blockcount.should == 77974
12
+ blockcount.should be_a(Integer)
13
+ end
14
+ it '#get_difficulty' do
15
+ difficulty = DogeCoin.get_difficulty
16
+
17
+ # As recorded in the tape
18
+ difficulty.should == 1009.723
19
+ difficulty.should be_a(Float)
20
+ end
21
+ it '#get_total_mined' do
22
+ difficulty = DogeCoin.get_total_mined
23
+
24
+ # As recorded in the tape
25
+ difficulty.should be_within(0.1).of(38898180040.5)
26
+ difficulty.should be_a(Float)
27
+ end
28
+ it '#get_total_mined' do
29
+ DogeCoin.transactions.should be_a(Array)
30
+ end
31
+
32
+ it '#address_balance' do
33
+ DogeCoin.address_balance('DFrwT5zteXdvfgz3vjhWNcpXMXDiVPmkXN').should be_within(0.1).of(18712.3)
34
+ DogeCoin.address_balance(ADDRESS_FOR_DONATIONS).should be_within(0.1).of(0)
35
+
36
+ ['', 'abcdef', "#{ADDRESS_FOR_DONATIONS}+---"].each do |invalid_address|
37
+ expect { DogeCoin.address_balance(invalid_address) }.to raise_error(DogeCoin::InvalidAddress)
38
+ end
39
+ end
40
+ it '#total_received' do
41
+ DogeCoin.total_received('DFrwT5zteXdvfgz3vjhWNcpXMXDiVPmkXN').should be_within(0.1).of(18712.3)
42
+ DogeCoin.total_received(ADDRESS_FOR_DONATIONS).should be_within(0.1).of(0)
43
+
44
+ ['', 'abcdef', "#{ADDRESS_FOR_DONATIONS}+---"].each do |invalid_address|
45
+ expect { DogeCoin.total_received(invalid_address) }.to raise_error(DogeCoin::InvalidAddress)
46
+ end
47
+ end
48
+ it '#total_sent' do
49
+ DogeCoin.total_sent('DABmu1j1hD2HeFEiMGUByuc1HwwZguQvWg').should be_within(0.1).of(86136.8)
50
+ DogeCoin.total_sent(ADDRESS_FOR_DONATIONS).should be_within(0.1).of(0)
51
+
52
+ ['', 'abcdef', "#{ADDRESS_FOR_DONATIONS}+---"].each do |invalid_address|
53
+ expect { DogeCoin.total_sent(invalid_address) }.to raise_error(DogeCoin::InvalidAddress)
54
+ end
55
+ end
56
+
57
+ it '#address_to_hash & #hash_to_address' do
58
+ hash = DogeCoin.address_to_hash(ADDRESS_FOR_DONATIONS)
59
+
60
+ hash.should == HASH_FROM_ADDRESS_FOR_DONATION
61
+
62
+ DogeCoin.hash_to_address(hash).should == ADDRESS_FOR_DONATIONS
63
+ end
64
+
65
+ it '#valid_address?' do
66
+ DogeCoin.valid_address?(ADDRESS_FOR_DONATIONS).should be_true
67
+ DogeCoin.valid_address?('lol').should be_false
68
+ DogeCoin.valid_address?("#{ADDRESS_FOR_DONATIONS}BB").should be_false
69
+ end
70
+
71
+ it '#decode_address' do
72
+ DogeCoin.decode_address(ADDRESS_FOR_DONATIONS).should == "1e:#{HASH_FROM_ADDRESS_FOR_DONATION}"
73
+ end
74
+ end
@@ -0,0 +1,18 @@
1
+ require 'doge_coin'
2
+ require 'pry'
3
+
4
+ RSpec.configure do |config|
5
+ config.treat_symbols_as_metadata_keys_with_true_values = true
6
+ config.run_all_when_everything_filtered = true
7
+ config.filter_run :focus
8
+
9
+ # Run specs in random order to surface order dependencies. If you find an
10
+ # order dependency and want to debug it, you can fix the order by providing
11
+ # the seed, which is printed after each run.
12
+ # --seed 1234
13
+ config.order = 'random'
14
+
15
+ DogeCoin.configure do |c|
16
+ c.vcr_mode = true
17
+ end
18
+ end
metadata CHANGED
@@ -1,15 +1,57 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: doge_coin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dimitri Jorge
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-28 00:00:00.000000000 Z
11
+ date: 2014-01-29 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: vcr
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '2.8'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '2.8'
27
+ - !ruby/object:Gem::Dependency
28
+ name: multi_json
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.8'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.8'
41
+ - !ruby/object:Gem::Dependency
42
+ name: faraday
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '0.9'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '0.9'
13
55
  - !ruby/object:Gem::Dependency
14
56
  name: bundler
15
57
  requirement: !ruby/object:Gem::Requirement
@@ -28,16 +70,58 @@ dependencies:
28
70
  name: rake
29
71
  requirement: !ruby/object:Gem::Requirement
30
72
  requirements:
31
- - - ">="
73
+ - - "~>"
32
74
  - !ruby/object:Gem::Version
33
- version: '0'
75
+ version: '10.1'
34
76
  type: :development
35
77
  prerelease: false
36
78
  version_requirements: !ruby/object:Gem::Requirement
37
79
  requirements:
38
- - - ">="
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '10.1'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rspec
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '2.14'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '2.14'
97
+ - !ruby/object:Gem::Dependency
98
+ name: webmock
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - '='
102
+ - !ruby/object:Gem::Version
103
+ version: '1.15'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - '='
109
+ - !ruby/object:Gem::Version
110
+ version: '1.15'
111
+ - !ruby/object:Gem::Dependency
112
+ name: pry
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '0.9'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
39
123
  - !ruby/object:Gem::Version
40
- version: '0'
124
+ version: '0.9'
41
125
  description: This is a wrapper for the dogechain.info api calls. Make verifications
42
126
  on transactions, check amounts received and sent, execute block on a given verification
43
127
  count etc..
@@ -48,14 +132,46 @@ extensions: []
48
132
  extra_rdoc_files: []
49
133
  files:
50
134
  - ".gitignore"
135
+ - ".rspec"
51
136
  - Gemfile
137
+ - Gemfile.lock
52
138
  - LICENSE
53
139
  - LICENSE.txt
54
140
  - README.md
55
141
  - Rakefile
56
142
  - doge_coin.gemspec
57
143
  - lib/doge_coin.rb
144
+ - lib/doge_coin/client.rb
145
+ - lib/doge_coin/configuration.rb
146
+ - lib/doge_coin/errors.rb
58
147
  - lib/doge_coin/version.rb
148
+ - spec/blockchain_captured_responses/addressbalance/.json
149
+ - spec/blockchain_captured_responses/addressbalance/DFrwT5zteXdvfgz3vjhWNcpXMXDiVPmkXN.json
150
+ - spec/blockchain_captured_responses/addressbalance/DMP2WQ1pjCqSNCdvn4HMFztmLG7an9hNWT.json
151
+ - spec/blockchain_captured_responses/addressbalance/DMP2WQ1pjCqSNCdvn4HMFztmLG7an9hNWT_---.json
152
+ - spec/blockchain_captured_responses/addressbalance/abcdef.json
153
+ - spec/blockchain_captured_responses/addresstohash/DMP2WQ1pjCqSNCdvn4HMFztmLG7an9hNWT.json
154
+ - spec/blockchain_captured_responses/checkaddress/DMP2WQ1pjCqSNCdvn4HMFztmLG7an9hNWT.json
155
+ - spec/blockchain_captured_responses/checkaddress/DMP2WQ1pjCqSNCdvn4HMFztmLG7an9hNWTBB.json
156
+ - spec/blockchain_captured_responses/checkaddress/lol.json
157
+ - spec/blockchain_captured_responses/decode_address/DMP2WQ1pjCqSNCdvn4HMFztmLG7an9hNWT.json
158
+ - spec/blockchain_captured_responses/getblockcount.json
159
+ - spec/blockchain_captured_responses/getdifficulty.json
160
+ - spec/blockchain_captured_responses/getreceivedbyaddress/.json
161
+ - spec/blockchain_captured_responses/getreceivedbyaddress/DFrwT5zteXdvfgz3vjhWNcpXMXDiVPmkXN.json
162
+ - spec/blockchain_captured_responses/getreceivedbyaddress/DMP2WQ1pjCqSNCdvn4HMFztmLG7an9hNWT.json
163
+ - spec/blockchain_captured_responses/getreceivedbyaddress/DMP2WQ1pjCqSNCdvn4HMFztmLG7an9hNWT_---.json
164
+ - spec/blockchain_captured_responses/getreceivedbyaddress/abcdef.json
165
+ - spec/blockchain_captured_responses/getsentbyaddress/.json
166
+ - spec/blockchain_captured_responses/getsentbyaddress/DABmu1j1hD2HeFEiMGUByuc1HwwZguQvWg.json
167
+ - spec/blockchain_captured_responses/getsentbyaddress/DMP2WQ1pjCqSNCdvn4HMFztmLG7an9hNWT.json
168
+ - spec/blockchain_captured_responses/getsentbyaddress/DMP2WQ1pjCqSNCdvn4HMFztmLG7an9hNWT_---.json
169
+ - spec/blockchain_captured_responses/getsentbyaddress/abcdef.json
170
+ - spec/blockchain_captured_responses/hashtoaddress/B224785E7F7D213AF75AB440DB1108C07ED38D80.json
171
+ - spec/blockchain_captured_responses/totalbc.json
172
+ - spec/blockchain_captured_responses/transactions.json
173
+ - spec/client_spec.rb
174
+ - spec/spec_helper.rb
59
175
  homepage: https://github.com/jorge-d/dogecoin
60
176
  licenses:
61
177
  - MIT
@@ -80,4 +196,31 @@ rubygems_version: 2.2.0
80
196
  signing_key:
81
197
  specification_version: 4
82
198
  summary: A simple wrapper for dogechain.info api calls
83
- test_files: []
199
+ test_files:
200
+ - spec/blockchain_captured_responses/addressbalance/.json
201
+ - spec/blockchain_captured_responses/addressbalance/DFrwT5zteXdvfgz3vjhWNcpXMXDiVPmkXN.json
202
+ - spec/blockchain_captured_responses/addressbalance/DMP2WQ1pjCqSNCdvn4HMFztmLG7an9hNWT.json
203
+ - spec/blockchain_captured_responses/addressbalance/DMP2WQ1pjCqSNCdvn4HMFztmLG7an9hNWT_---.json
204
+ - spec/blockchain_captured_responses/addressbalance/abcdef.json
205
+ - spec/blockchain_captured_responses/addresstohash/DMP2WQ1pjCqSNCdvn4HMFztmLG7an9hNWT.json
206
+ - spec/blockchain_captured_responses/checkaddress/DMP2WQ1pjCqSNCdvn4HMFztmLG7an9hNWT.json
207
+ - spec/blockchain_captured_responses/checkaddress/DMP2WQ1pjCqSNCdvn4HMFztmLG7an9hNWTBB.json
208
+ - spec/blockchain_captured_responses/checkaddress/lol.json
209
+ - spec/blockchain_captured_responses/decode_address/DMP2WQ1pjCqSNCdvn4HMFztmLG7an9hNWT.json
210
+ - spec/blockchain_captured_responses/getblockcount.json
211
+ - spec/blockchain_captured_responses/getdifficulty.json
212
+ - spec/blockchain_captured_responses/getreceivedbyaddress/.json
213
+ - spec/blockchain_captured_responses/getreceivedbyaddress/DFrwT5zteXdvfgz3vjhWNcpXMXDiVPmkXN.json
214
+ - spec/blockchain_captured_responses/getreceivedbyaddress/DMP2WQ1pjCqSNCdvn4HMFztmLG7an9hNWT.json
215
+ - spec/blockchain_captured_responses/getreceivedbyaddress/DMP2WQ1pjCqSNCdvn4HMFztmLG7an9hNWT_---.json
216
+ - spec/blockchain_captured_responses/getreceivedbyaddress/abcdef.json
217
+ - spec/blockchain_captured_responses/getsentbyaddress/.json
218
+ - spec/blockchain_captured_responses/getsentbyaddress/DABmu1j1hD2HeFEiMGUByuc1HwwZguQvWg.json
219
+ - spec/blockchain_captured_responses/getsentbyaddress/DMP2WQ1pjCqSNCdvn4HMFztmLG7an9hNWT.json
220
+ - spec/blockchain_captured_responses/getsentbyaddress/DMP2WQ1pjCqSNCdvn4HMFztmLG7an9hNWT_---.json
221
+ - spec/blockchain_captured_responses/getsentbyaddress/abcdef.json
222
+ - spec/blockchain_captured_responses/hashtoaddress/B224785E7F7D213AF75AB440DB1108C07ED38D80.json
223
+ - spec/blockchain_captured_responses/totalbc.json
224
+ - spec/blockchain_captured_responses/transactions.json
225
+ - spec/client_spec.rb
226
+ - spec/spec_helper.rb