From 28d43359971dcdfc74c845ddd8933673a5b30530 Mon Sep 17 00:00:00 2001 From: Ramon Tayag Date: Tue, 25 Oct 2016 14:12:01 +0800 Subject: [PATCH 1/7] Move away from global variables --- spec/blockcypher/api_spec.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/spec/blockcypher/api_spec.rb b/spec/blockcypher/api_spec.rb index 4c41be6..624f565 100644 --- a/spec/blockcypher/api_spec.rb +++ b/spec/blockcypher/api_spec.rb @@ -12,20 +12,20 @@ module BlockCypher }) end + let(:addr1) { api.address_generate } + let(:addr2) { api.address_generate } context '#address_generate' do it 'should generate new addresses' do - $addr1 = api.address_generate - $addr2 = api.address_generate - expect($addr1["address"]).to be_a(String) - expect($addr2["address"]).to be_a(String) + expect(addr1["address"]).to be_a(String) + expect(addr2["address"]).to be_a(String) end end - let(:address_1) { $addr1["address"].to_s } - let(:address_1_private_key) { $addr1["private"].to_s } + let(:address_1) { addr1["address"].to_s } + let(:address_1_private_key) { addr1["private"].to_s } - let(:address_2) { $addr2["address"].to_s } - let(:address_2_private_key) { $addr2["private"].to_s } + let(:address_2) { addr2["address"].to_s } + let(:address_2_private_key) { addr2["private"].to_s } context '#faucet' do it 'should fund a bcy test address with the faucet' do From c59b3a6056db4e9f5f97641ff10afad60eba548c Mon Sep 17 00:00:00 2001 From: Ramon Tayag Date: Tue, 25 Oct 2016 14:15:26 +0800 Subject: [PATCH 2/7] Use rspec-style of `require 'spec_helper'` --- Gemfile | 2 +- spec/blockcypher/api_spec.rb | 2 +- spec/spec_helper.rb | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 spec/spec_helper.rb diff --git a/Gemfile b/Gemfile index cd8aa9e..fa75df1 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,3 @@ source 'https://rubygems.org' -gemspec \ No newline at end of file +gemspec diff --git a/spec/blockcypher/api_spec.rb b/spec/blockcypher/api_spec.rb index 624f565..53cc7b4 100644 --- a/spec/blockcypher/api_spec.rb +++ b/spec/blockcypher/api_spec.rb @@ -1,4 +1,4 @@ -require 'blockcypher' +require 'spec_helper' module BlockCypher diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb new file mode 100644 index 0000000..8faaf10 --- /dev/null +++ b/spec/spec_helper.rb @@ -0,0 +1,2 @@ +require "rspec" +require "blockcypher" From 6f0420c66a62a271add0cb2810535d83d2c6c3b4 Mon Sep 17 00:00:00 2001 From: Ramon Tayag Date: Tue, 25 Oct 2016 14:15:43 +0800 Subject: [PATCH 3/7] Add pry for development --- spec/spec_helper.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 8faaf10..f71f846 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,2 +1,3 @@ +require "pry" require "rspec" require "blockcypher" From 52a0d903228c247aa3441208092d0acd94529273 Mon Sep 17 00:00:00 2001 From: Ramon Tayag Date: Tue, 25 Oct 2016 14:21:38 +0800 Subject: [PATCH 4/7] Allow developer to set their test token This fixes the rate limit issue --- .gitignore | 3 ++- Gemfile.lock | 15 +++++++++++++++ README.md | 5 +++++ blockcypher-ruby.gemspec | 1 + spec/blockcypher/api_spec.rb | 2 +- spec/config.yml.sample | 2 ++ spec/spec_helper.rb | 7 +++++++ 7 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 spec/config.yml.sample diff --git a/.gitignore b/.gitignore index 68feb7d..500fb92 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -Gemfile.lock \ No newline at end of file +Gemfile.lock +spec/config.yml diff --git a/Gemfile.lock b/Gemfile.lock index db235dc..3e762a3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -8,11 +8,19 @@ PATH GEM remote: https://rubygems.org/ specs: + activesupport (5.0.0) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (~> 0.7) + minitest (~> 5.1) + tzinfo (~> 1.1) bitcoin-ruby (0.0.6) coderay (1.1.0) + concurrent-ruby (1.0.2) diff-lcs (1.2.5) ffi (1.9.8) + i18n (0.7.0) method_source (0.8.2) + minitest (5.9.0) pry (0.10.1) coderay (~> 1.1.0) method_source (~> 0.8.1) @@ -32,13 +40,20 @@ GEM rspec-support (~> 3.2.0) rspec-support (3.2.2) slop (3.6.0) + thread_safe (0.3.5) + tzinfo (1.2.2) + thread_safe (~> 0.1) PLATFORMS ruby DEPENDENCIES + activesupport blockcypher-ruby! bundler (~> 1.6) pry rake rspec + +BUNDLED WITH + 1.13.1 diff --git a/README.md b/README.md index bd5dfa5..2cb329a 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,11 @@ For more information check the API docs at: http://dev.blockcypher.com +## Development + +- Copy `spec/config.yml.sample` to `spec/config.yml` and put your test API token +- `rspec spec` + ## Contributors Contributions from [CoinHako](http://www.coinhako.com) and [meXBT](https://mexbt.com) diff --git a/blockcypher-ruby.gemspec b/blockcypher-ruby.gemspec index 000fd59..7938b40 100644 --- a/blockcypher-ruby.gemspec +++ b/blockcypher-ruby.gemspec @@ -16,4 +16,5 @@ Gem::Specification.new do |s| s.add_development_dependency "rake" s.add_development_dependency "rspec" s.add_development_dependency "pry" + s.add_development_dependency "activesupport" end diff --git a/spec/blockcypher/api_spec.rb b/spec/blockcypher/api_spec.rb index 53cc7b4..81f6d2b 100644 --- a/spec/blockcypher/api_spec.rb +++ b/spec/blockcypher/api_spec.rb @@ -5,7 +5,7 @@ module BlockCypher describe Api do let(:api) do BlockCypher::Api.new({ - api_token: 'testtoken', + api_token: CONFIG[:api_token], currency: BlockCypher::BCY, network: BlockCypher::TEST_NET, version: BlockCypher::V1 diff --git a/spec/config.yml.sample b/spec/config.yml.sample new file mode 100644 index 0000000..fdb595c --- /dev/null +++ b/spec/config.yml.sample @@ -0,0 +1,2 @@ +--- +api_token: testtoken-changeme diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index f71f846..e61f617 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,3 +1,10 @@ require "pry" require "rspec" +require "yaml" +require "active_support/core_ext/hash/indifferent_access" +require "pathname" require "blockcypher" + +SPEC_DIR = Pathname.new(File.dirname(__FILE__)) +CONFIG_FILE = SPEC_DIR.join("config.yml") +CONFIG = YAML.load_file(CONFIG_FILE).with_indifferent_access From 7c48e43955878b2d8c5b06ab8697dca0ad69eb78 Mon Sep 17 00:00:00 2001 From: Ramon Tayag Date: Tue, 25 Oct 2016 14:41:08 +0800 Subject: [PATCH 5/7] Use VCR and get most specs to pass, and pass quickly Still need to figure out a way to credit an address before spending from it, to get those tests to pass as well --- Gemfile.lock | 12 + blockcypher-ruby.gemspec | 2 + spec/blockcypher/api_spec.rb | 2 +- .../Asset_Transfer/should_transfer_asset.yml | 1349 +++++++++++++++++ ...ic_oap_address_original_address_hashes.yml | 51 + .../Issue_Asset/should_issue_asset.yml | 156 ++ .../should_get_the_balance_of_an_address.yml | 102 ++ .../should_generate_new_addresses.yml | 97 ++ ...ting_a_payment_forward_with_a_callback.yml | 100 ++ ...and_confirmation_notifications_enabled.yml | 101 ++ .../creates_a_payment_forward.yml | 99 ++ ...e_the_alias_create_payments_forwarding.yml | 99 ++ ...reviously_created_forwarding_addresses.yml | 269 ++++ ...und_a_bcy_test_address_with_the_faucet.yml | 96 ++ ...ng_addresses_created_for_a_given_token.yml | 119 ++ .../should_call_the_txs/new_api.yml | 187 +++ .../should_call_txs/send_api.yml | 187 +++ spec/spec_helper.rb | 3 + spec/support/vcr.rb | 8 + 19 files changed, 3038 insertions(+), 1 deletion(-) create mode 100644 spec/fixtures/vcr_cassettes/BlockCypher_Api/Asset_API/Asset_Transfer/should_transfer_asset.yml create mode 100644 spec/fixtures/vcr_cassettes/BlockCypher_Api/Asset_API/Generate_Asset_Address/should_include_private_public_oap_address_original_address_hashes.yml create mode 100644 spec/fixtures/vcr_cassettes/BlockCypher_Api/Asset_API/Issue_Asset/should_issue_asset.yml create mode 100644 spec/fixtures/vcr_cassettes/BlockCypher_Api/_address_final_balance/should_get_the_balance_of_an_address.yml create mode 100644 spec/fixtures/vcr_cassettes/BlockCypher_Api/_address_generate/should_generate_new_addresses.yml create mode 100644 spec/fixtures/vcr_cassettes/BlockCypher_Api/_create_forwarding_address/allows_creating_a_payment_forward_with_a_callback.yml create mode 100644 spec/fixtures/vcr_cassettes/BlockCypher_Api/_create_forwarding_address/allows_creating_a_payment_forward_with_a_callback_and_confirmation_notifications_enabled.yml create mode 100644 spec/fixtures/vcr_cassettes/BlockCypher_Api/_create_forwarding_address/creates_a_payment_forward.yml create mode 100644 spec/fixtures/vcr_cassettes/BlockCypher_Api/_create_forwarding_address/is_possible_to_use_the_alias_create_payments_forwarding.yml create mode 100644 spec/fixtures/vcr_cassettes/BlockCypher_Api/_delete_forwarding_address/deletes_all_previously_created_forwarding_addresses.yml create mode 100644 spec/fixtures/vcr_cassettes/BlockCypher_Api/_faucet/should_fund_a_bcy_test_address_with_the_faucet.yml create mode 100644 spec/fixtures/vcr_cassettes/BlockCypher_Api/_list_forwarding_addresses/lists_all_forwading_addresses_created_for_a_given_token.yml create mode 100644 spec/fixtures/vcr_cassettes/BlockCypher_Api/_transaction_new/should_call_the_txs/new_api.yml create mode 100644 spec/fixtures/vcr_cassettes/BlockCypher_Api/_transaction_sign_and_send/should_call_txs/send_api.yml create mode 100644 spec/support/vcr.rb diff --git a/Gemfile.lock b/Gemfile.lock index 3e762a3..de840d4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -13,11 +13,15 @@ GEM i18n (~> 0.7) minitest (~> 5.1) tzinfo (~> 1.1) + addressable (2.4.0) bitcoin-ruby (0.0.6) coderay (1.1.0) concurrent-ruby (1.0.2) + crack (0.4.3) + safe_yaml (~> 1.0.0) diff-lcs (1.2.5) ffi (1.9.8) + hashdiff (0.3.0) i18n (0.7.0) method_source (0.8.2) minitest (5.9.0) @@ -39,10 +43,16 @@ GEM diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.2.0) rspec-support (3.2.2) + safe_yaml (1.0.4) slop (3.6.0) thread_safe (0.3.5) tzinfo (1.2.2) thread_safe (~> 0.1) + vcr (3.0.3) + webmock (2.1.0) + addressable (>= 2.3.6) + crack (>= 0.3.2) + hashdiff PLATFORMS ruby @@ -54,6 +64,8 @@ DEPENDENCIES pry rake rspec + vcr + webmock BUNDLED WITH 1.13.1 diff --git a/blockcypher-ruby.gemspec b/blockcypher-ruby.gemspec index 7938b40..b2be740 100644 --- a/blockcypher-ruby.gemspec +++ b/blockcypher-ruby.gemspec @@ -17,4 +17,6 @@ Gem::Specification.new do |s| s.add_development_dependency "rspec" s.add_development_dependency "pry" s.add_development_dependency "activesupport" + s.add_development_dependency "vcr" + s.add_development_dependency "webmock" end diff --git a/spec/blockcypher/api_spec.rb b/spec/blockcypher/api_spec.rb index 81f6d2b..fa3b532 100644 --- a/spec/blockcypher/api_spec.rb +++ b/spec/blockcypher/api_spec.rb @@ -2,7 +2,7 @@ module BlockCypher - describe Api do + describe Api, vcr: {record: :once} do let(:api) do BlockCypher::Api.new({ api_token: CONFIG[:api_token], diff --git a/spec/fixtures/vcr_cassettes/BlockCypher_Api/Asset_API/Asset_Transfer/should_transfer_asset.yml b/spec/fixtures/vcr_cassettes/BlockCypher_Api/Asset_API/Asset_Transfer/should_transfer_asset.yml new file mode 100644 index 0000000..9225e1d --- /dev/null +++ b/spec/fixtures/vcr_cassettes/BlockCypher_Api/Asset_API/Asset_Transfer/should_transfer_asset.yml @@ -0,0 +1,1349 @@ +--- +http_interactions: +- request: + method: post + uri: https://api.blockcypher.com/v1/bcy/test/oap/addrs?token= + body: + encoding: UTF-8 + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 201 + message: Created + headers: + Server: + - nginx/1.9.12 + Date: + - Tue, 25 Oct 2016 06:36:14 GMT + Content-Type: + - application/json + Content-Length: + - '346' + Connection: + - keep-alive + Access-Control-Allow-Headers: + - Origin, X-Requested-With, Content-Type, Accept + Access-Control-Allow-Methods: + - GET, POST, PUT, DELETE + Access-Control-Allow-Origin: + - "*" + X-Ratelimit-Remaining: + - '193' + body: + encoding: UTF-8 + string: |- + { + "private": "99c29b6b5747520393a0909b1f456bf3554f143d4a10746954c648754243e2cf", + "public": "0362ad182ac03e9066954541c03f0f8d690636cb0512e16970768f30388f5b91ac", + "oap_address": "1C2YtDp89Q5sgWC7t6YG16fPt472RvRe7TJ", + "original_address": "C2YtDp89Q5sgWC7t6YG16fPt472RydThBC", + "wif": "BtUvLkU99feNqycFjreLzU5LoiSCKA37e9fm5HGomof2Knp3vHDz" + } + http_version: + recorded_at: Tue, 25 Oct 2016 06:36:14 GMT +- request: + method: post + uri: https://api.blockcypher.com/v1/bcy/test/oap/addrs?token= + body: + encoding: UTF-8 + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 201 + message: Created + headers: + Server: + - nginx/1.11.2 + Date: + - Tue, 25 Oct 2016 06:36:15 GMT + Content-Type: + - application/json + Content-Length: + - '346' + Connection: + - keep-alive + Access-Control-Allow-Headers: + - Origin, X-Requested-With, Content-Type, Accept + Access-Control-Allow-Methods: + - GET, POST, PUT, DELETE + Access-Control-Allow-Origin: + - "*" + X-Ratelimit-Remaining: + - '175' + body: + encoding: UTF-8 + string: |- + { + "private": "13aef44a99a64093d7b31e80118b94d3f59862f51fc8772b4cc8d7c5cf5e704f", + "public": "02aeddc171605fa302075648eefdefe0e23c8d15b4e96c6a034f7eeee6d126b399", + "oap_address": "1BwWYuiH9eAfea9RAstAnG7wT1pFWTzjXpD", + "original_address": "BwWYuiH9eAfea9RAstAnG7wT1pFWTw8BAt", + "wif": "BozHw75Ua9P5URwVi1SQaBz21cNz7DzGwfpERA9UE2yJ5NTbCQyT" + } + http_version: + recorded_at: Tue, 25 Oct 2016 06:36:15 GMT +- request: + method: post + uri: https://api.blockcypher.com/v1/bcy/test/faucet?token= + body: + encoding: UTF-8 + string: '{"address":"C2YtDp89Q5sgWC7t6YG16fPt472RydThBC","amount":100000000}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + Content-Type: + - application/json + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx/1.9.12 + Date: + - Tue, 25 Oct 2016 06:36:17 GMT + Content-Type: + - application/json + Content-Length: + - '82' + Connection: + - keep-alive + Access-Control-Allow-Headers: + - Origin, X-Requested-With, Content-Type, Accept + Access-Control-Allow-Methods: + - GET, POST, PUT, DELETE + Access-Control-Allow-Origin: + - "*" + X-Ratelimit-Remaining: + - '169' + body: + encoding: UTF-8 + string: |- + { + "tx_ref": "204eb3489a0f469db1e79b821717081c19562f90b3cb90b8d459d03d5d30ebfe" + } + http_version: + recorded_at: Tue, 25 Oct 2016 06:36:17 GMT +- request: + method: post + uri: https://api.blockcypher.com/v1/bcy/test/oap/issue?token= + body: + encoding: UTF-8 + string: '{"from_private":"99c29b6b5747520393a0909b1f456bf3554f143d4a10746954c648754243e2cf","to_address":"1C2YtDp89Q5sgWC7t6YG16fPt472RvRe7TJ","amount":1000}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + Content-Type: + - application/json + response: + status: + code: 201 + message: Created + headers: + Server: + - nginx/1.9.12 + Date: + - Tue, 25 Oct 2016 06:36:18 GMT + Content-Type: + - application/json + Content-Length: + - '392' + Connection: + - keep-alive + Access-Control-Allow-Headers: + - Origin, X-Requested-With, Content-Type, Accept + Access-Control-Allow-Methods: + - GET, POST, PUT, DELETE + Access-Control-Allow-Origin: + - "*" + X-Ratelimit-Remaining: + - '168' + body: + encoding: UTF-8 + string: |- + { + "ver": 1, + "assetid": "15EMVQjPto24Rrq4YTeFhv1yADGzt7DSuw", + "oap_meta": "", + "hash": "bc745e9001ff0cc4cbac30616df2a4b71436919fb91b687f9dd43dd04c52d9ea", + "received": "2016-10-25T06:36:18.366529246Z", + "double_spend": false, + "inputs": [], + "outputs": [ + { + "address": "1C2YtDp89Q5sgWC7t6YG16fPt472RvRe7TJ", + "value": 1000, + "original_output_index": 0 + } + ] + } + http_version: + recorded_at: Tue, 25 Oct 2016 06:36:18 GMT +- request: + method: get + uri: https://api.blockcypher.com/v1/bcy/test/oap/15EMVQjPto24Rrq4YTeFhv1yADGzt7DSuw/addrs/1C2YtDp89Q5sgWC7t6YG16fPt472RvRe7TJ?token= + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx/1.11.2 + Date: + - Tue, 25 Oct 2016 06:36:19 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Access-Control-Allow-Headers: + - Origin, X-Requested-With, Content-Type, Accept + Access-Control-Allow-Methods: + - GET, POST, PUT, DELETE + Access-Control-Allow-Origin: + - "*" + X-Ratelimit-Remaining: + - '169' + body: + encoding: ASCII-8BIT + string: |- + { + "address": "1C2YtDp89Q5sgWC7t6YG16fPt472RvRe7TJ", + "total_received": 0, + "total_sent": 0, + "balance": 0, + "unconfirmed_balance": 0, + "final_balance": 0, + "n_tx": 0, + "unconfirmed_n_tx": 0, + "final_n_tx": 0, + "tx_url": "https://api.blockcypher.com/v1/bcy/test/txs/" + } + http_version: + recorded_at: Tue, 25 Oct 2016 06:36:19 GMT +- request: + method: get + uri: https://api.blockcypher.com/v1/bcy/test/oap/15EMVQjPto24Rrq4YTeFhv1yADGzt7DSuw/addrs/1C2YtDp89Q5sgWC7t6YG16fPt472RvRe7TJ?token= + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx/1.9.12 + Date: + - Tue, 25 Oct 2016 06:36:22 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Access-Control-Allow-Headers: + - Origin, X-Requested-With, Content-Type, Accept + Access-Control-Allow-Methods: + - GET, POST, PUT, DELETE + Access-Control-Allow-Origin: + - "*" + X-Ratelimit-Remaining: + - '178' + body: + encoding: ASCII-8BIT + string: |- + { + "address": "1C2YtDp89Q5sgWC7t6YG16fPt472RvRe7TJ", + "total_received": 0, + "total_sent": 0, + "balance": 0, + "unconfirmed_balance": 0, + "final_balance": 0, + "n_tx": 0, + "unconfirmed_n_tx": 0, + "final_n_tx": 0, + "tx_url": "https://api.blockcypher.com/v1/bcy/test/txs/" + } + http_version: + recorded_at: Tue, 25 Oct 2016 06:36:22 GMT +- request: + method: get + uri: https://api.blockcypher.com/v1/bcy/test/oap/15EMVQjPto24Rrq4YTeFhv1yADGzt7DSuw/addrs/1C2YtDp89Q5sgWC7t6YG16fPt472RvRe7TJ?token= + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx/1.9.12 + Date: + - Tue, 25 Oct 2016 06:36:24 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Access-Control-Allow-Headers: + - Origin, X-Requested-With, Content-Type, Accept + Access-Control-Allow-Methods: + - GET, POST, PUT, DELETE + Access-Control-Allow-Origin: + - "*" + X-Ratelimit-Remaining: + - '177' + body: + encoding: ASCII-8BIT + string: |- + { + "address": "1C2YtDp89Q5sgWC7t6YG16fPt472RvRe7TJ", + "total_received": 0, + "total_sent": 0, + "balance": 0, + "unconfirmed_balance": 0, + "final_balance": 0, + "n_tx": 0, + "unconfirmed_n_tx": 0, + "final_n_tx": 0, + "tx_url": "https://api.blockcypher.com/v1/bcy/test/txs/" + } + http_version: + recorded_at: Tue, 25 Oct 2016 06:36:25 GMT +- request: + method: get + uri: https://api.blockcypher.com/v1/bcy/test/oap/15EMVQjPto24Rrq4YTeFhv1yADGzt7DSuw/addrs/1C2YtDp89Q5sgWC7t6YG16fPt472RvRe7TJ?token= + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx/1.11.2 + Date: + - Tue, 25 Oct 2016 06:36:27 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Access-Control-Allow-Headers: + - Origin, X-Requested-With, Content-Type, Accept + Access-Control-Allow-Methods: + - GET, POST, PUT, DELETE + Access-Control-Allow-Origin: + - "*" + X-Ratelimit-Remaining: + - '168' + body: + encoding: ASCII-8BIT + string: |- + { + "address": "1C2YtDp89Q5sgWC7t6YG16fPt472RvRe7TJ", + "total_received": 0, + "total_sent": 0, + "balance": 0, + "unconfirmed_balance": 0, + "final_balance": 0, + "n_tx": 0, + "unconfirmed_n_tx": 0, + "final_n_tx": 0, + "tx_url": "https://api.blockcypher.com/v1/bcy/test/txs/" + } + http_version: + recorded_at: Tue, 25 Oct 2016 06:36:27 GMT +- request: + method: get + uri: https://api.blockcypher.com/v1/bcy/test/oap/15EMVQjPto24Rrq4YTeFhv1yADGzt7DSuw/addrs/1C2YtDp89Q5sgWC7t6YG16fPt472RvRe7TJ?token= + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx/1.9.12 + Date: + - Tue, 25 Oct 2016 06:36:29 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Access-Control-Allow-Headers: + - Origin, X-Requested-With, Content-Type, Accept + Access-Control-Allow-Methods: + - GET, POST, PUT, DELETE + Access-Control-Allow-Origin: + - "*" + X-Ratelimit-Remaining: + - '176' + body: + encoding: ASCII-8BIT + string: |- + { + "address": "1C2YtDp89Q5sgWC7t6YG16fPt472RvRe7TJ", + "total_received": 0, + "total_sent": 0, + "balance": 0, + "unconfirmed_balance": 0, + "final_balance": 0, + "n_tx": 0, + "unconfirmed_n_tx": 0, + "final_n_tx": 0, + "tx_url": "https://api.blockcypher.com/v1/bcy/test/txs/" + } + http_version: + recorded_at: Tue, 25 Oct 2016 06:36:30 GMT +- request: + method: get + uri: https://api.blockcypher.com/v1/bcy/test/oap/15EMVQjPto24Rrq4YTeFhv1yADGzt7DSuw/addrs/1C2YtDp89Q5sgWC7t6YG16fPt472RvRe7TJ?token= + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx/1.9.12 + Date: + - Tue, 25 Oct 2016 06:36:32 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Access-Control-Allow-Headers: + - Origin, X-Requested-With, Content-Type, Accept + Access-Control-Allow-Methods: + - GET, POST, PUT, DELETE + Access-Control-Allow-Origin: + - "*" + X-Ratelimit-Remaining: + - '157' + body: + encoding: ASCII-8BIT + string: |- + { + "address": "1C2YtDp89Q5sgWC7t6YG16fPt472RvRe7TJ", + "total_received": 0, + "total_sent": 0, + "balance": 0, + "unconfirmed_balance": 0, + "final_balance": 0, + "n_tx": 0, + "unconfirmed_n_tx": 0, + "final_n_tx": 0, + "tx_url": "https://api.blockcypher.com/v1/bcy/test/txs/" + } + http_version: + recorded_at: Tue, 25 Oct 2016 06:36:32 GMT +- request: + method: get + uri: https://api.blockcypher.com/v1/bcy/test/oap/15EMVQjPto24Rrq4YTeFhv1yADGzt7DSuw/addrs/1C2YtDp89Q5sgWC7t6YG16fPt472RvRe7TJ?token= + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx/1.9.12 + Date: + - Tue, 25 Oct 2016 06:36:34 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Access-Control-Allow-Headers: + - Origin, X-Requested-With, Content-Type, Accept + Access-Control-Allow-Methods: + - GET, POST, PUT, DELETE + Access-Control-Allow-Origin: + - "*" + X-Ratelimit-Remaining: + - '167' + body: + encoding: ASCII-8BIT + string: |- + { + "address": "1C2YtDp89Q5sgWC7t6YG16fPt472RvRe7TJ", + "total_received": 0, + "total_sent": 0, + "balance": 0, + "unconfirmed_balance": 0, + "final_balance": 0, + "n_tx": 0, + "unconfirmed_n_tx": 0, + "final_n_tx": 0, + "tx_url": "https://api.blockcypher.com/v1/bcy/test/txs/" + } + http_version: + recorded_at: Tue, 25 Oct 2016 06:36:34 GMT +- request: + method: get + uri: https://api.blockcypher.com/v1/bcy/test/oap/15EMVQjPto24Rrq4YTeFhv1yADGzt7DSuw/addrs/1C2YtDp89Q5sgWC7t6YG16fPt472RvRe7TJ?token= + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx/1.9.12 + Date: + - Tue, 25 Oct 2016 06:36:36 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Access-Control-Allow-Headers: + - Origin, X-Requested-With, Content-Type, Accept + Access-Control-Allow-Methods: + - GET, POST, PUT, DELETE + Access-Control-Allow-Origin: + - "*" + X-Ratelimit-Remaining: + - '175' + body: + encoding: ASCII-8BIT + string: |- + { + "address": "1C2YtDp89Q5sgWC7t6YG16fPt472RvRe7TJ", + "total_received": 0, + "total_sent": 0, + "balance": 0, + "unconfirmed_balance": 0, + "final_balance": 0, + "n_tx": 0, + "unconfirmed_n_tx": 0, + "final_n_tx": 0, + "tx_url": "https://api.blockcypher.com/v1/bcy/test/txs/" + } + http_version: + recorded_at: Tue, 25 Oct 2016 06:36:37 GMT +- request: + method: get + uri: https://api.blockcypher.com/v1/bcy/test/oap/15EMVQjPto24Rrq4YTeFhv1yADGzt7DSuw/addrs/1C2YtDp89Q5sgWC7t6YG16fPt472RvRe7TJ?token= + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx/1.9.12 + Date: + - Tue, 25 Oct 2016 06:36:39 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Access-Control-Allow-Headers: + - Origin, X-Requested-With, Content-Type, Accept + Access-Control-Allow-Methods: + - GET, POST, PUT, DELETE + Access-Control-Allow-Origin: + - "*" + X-Ratelimit-Remaining: + - '174' + body: + encoding: ASCII-8BIT + string: |- + { + "address": "1C2YtDp89Q5sgWC7t6YG16fPt472RvRe7TJ", + "total_received": 0, + "total_sent": 0, + "balance": 0, + "unconfirmed_balance": 0, + "final_balance": 0, + "n_tx": 0, + "unconfirmed_n_tx": 0, + "final_n_tx": 0, + "tx_url": "https://api.blockcypher.com/v1/bcy/test/txs/" + } + http_version: + recorded_at: Tue, 25 Oct 2016 06:36:39 GMT +- request: + method: get + uri: https://api.blockcypher.com/v1/bcy/test/oap/15EMVQjPto24Rrq4YTeFhv1yADGzt7DSuw/addrs/1C2YtDp89Q5sgWC7t6YG16fPt472RvRe7TJ?token= + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx/1.11.2 + Date: + - Tue, 25 Oct 2016 06:36:41 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Access-Control-Allow-Headers: + - Origin, X-Requested-With, Content-Type, Accept + Access-Control-Allow-Methods: + - GET, POST, PUT, DELETE + Access-Control-Allow-Origin: + - "*" + X-Ratelimit-Remaining: + - '167' + body: + encoding: ASCII-8BIT + string: |- + { + "address": "1C2YtDp89Q5sgWC7t6YG16fPt472RvRe7TJ", + "total_received": 0, + "total_sent": 0, + "balance": 0, + "unconfirmed_balance": 0, + "final_balance": 0, + "n_tx": 0, + "unconfirmed_n_tx": 0, + "final_n_tx": 0, + "tx_url": "https://api.blockcypher.com/v1/bcy/test/txs/" + } + http_version: + recorded_at: Tue, 25 Oct 2016 06:36:41 GMT +- request: + method: get + uri: https://api.blockcypher.com/v1/bcy/test/oap/15EMVQjPto24Rrq4YTeFhv1yADGzt7DSuw/addrs/1C2YtDp89Q5sgWC7t6YG16fPt472RvRe7TJ?token= + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx/1.9.12 + Date: + - Tue, 25 Oct 2016 06:36:43 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Access-Control-Allow-Headers: + - Origin, X-Requested-With, Content-Type, Accept + Access-Control-Allow-Methods: + - GET, POST, PUT, DELETE + Access-Control-Allow-Origin: + - "*" + X-Ratelimit-Remaining: + - '173' + body: + encoding: ASCII-8BIT + string: |- + { + "address": "1C2YtDp89Q5sgWC7t6YG16fPt472RvRe7TJ", + "total_received": 0, + "total_sent": 0, + "balance": 0, + "unconfirmed_balance": 0, + "final_balance": 0, + "n_tx": 0, + "unconfirmed_n_tx": 0, + "final_n_tx": 0, + "tx_url": "https://api.blockcypher.com/v1/bcy/test/txs/" + } + http_version: + recorded_at: Tue, 25 Oct 2016 06:36:43 GMT +- request: + method: get + uri: https://api.blockcypher.com/v1/bcy/test/oap/15EMVQjPto24Rrq4YTeFhv1yADGzt7DSuw/addrs/1C2YtDp89Q5sgWC7t6YG16fPt472RvRe7TJ?token= + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx/1.9.12 + Date: + - Tue, 25 Oct 2016 06:36:46 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Access-Control-Allow-Headers: + - Origin, X-Requested-With, Content-Type, Accept + Access-Control-Allow-Methods: + - GET, POST, PUT, DELETE + Access-Control-Allow-Origin: + - "*" + X-Ratelimit-Remaining: + - '172' + body: + encoding: ASCII-8BIT + string: |- + { + "address": "1C2YtDp89Q5sgWC7t6YG16fPt472RvRe7TJ", + "total_received": 0, + "total_sent": 0, + "balance": 0, + "unconfirmed_balance": 0, + "final_balance": 0, + "n_tx": 0, + "unconfirmed_n_tx": 0, + "final_n_tx": 0, + "tx_url": "https://api.blockcypher.com/v1/bcy/test/txs/" + } + http_version: + recorded_at: Tue, 25 Oct 2016 06:36:46 GMT +- request: + method: get + uri: https://api.blockcypher.com/v1/bcy/test/oap/15EMVQjPto24Rrq4YTeFhv1yADGzt7DSuw/addrs/1C2YtDp89Q5sgWC7t6YG16fPt472RvRe7TJ?token= + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx/1.9.12 + Date: + - Tue, 25 Oct 2016 06:36:49 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Access-Control-Allow-Headers: + - Origin, X-Requested-With, Content-Type, Accept + Access-Control-Allow-Methods: + - GET, POST, PUT, DELETE + Access-Control-Allow-Origin: + - "*" + X-Ratelimit-Remaining: + - '166' + body: + encoding: ASCII-8BIT + string: |- + { + "address": "1C2YtDp89Q5sgWC7t6YG16fPt472RvRe7TJ", + "total_received": 0, + "total_sent": 0, + "balance": 0, + "unconfirmed_balance": 0, + "final_balance": 0, + "n_tx": 0, + "unconfirmed_n_tx": 0, + "final_n_tx": 0, + "tx_url": "https://api.blockcypher.com/v1/bcy/test/txs/" + } + http_version: + recorded_at: Tue, 25 Oct 2016 06:36:49 GMT +- request: + method: get + uri: https://api.blockcypher.com/v1/bcy/test/oap/15EMVQjPto24Rrq4YTeFhv1yADGzt7DSuw/addrs/1C2YtDp89Q5sgWC7t6YG16fPt472RvRe7TJ?token= + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx/1.9.12 + Date: + - Tue, 25 Oct 2016 06:36:52 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Access-Control-Allow-Headers: + - Origin, X-Requested-With, Content-Type, Accept + Access-Control-Allow-Methods: + - GET, POST, PUT, DELETE + Access-Control-Allow-Origin: + - "*" + X-Ratelimit-Remaining: + - '156' + body: + encoding: ASCII-8BIT + string: |- + { + "address": "1C2YtDp89Q5sgWC7t6YG16fPt472RvRe7TJ", + "total_received": 0, + "total_sent": 0, + "balance": 0, + "unconfirmed_balance": 0, + "final_balance": 0, + "n_tx": 0, + "unconfirmed_n_tx": 0, + "final_n_tx": 0, + "tx_url": "https://api.blockcypher.com/v1/bcy/test/txs/" + } + http_version: + recorded_at: Tue, 25 Oct 2016 06:36:52 GMT +- request: + method: get + uri: https://api.blockcypher.com/v1/bcy/test/oap/15EMVQjPto24Rrq4YTeFhv1yADGzt7DSuw/addrs/1C2YtDp89Q5sgWC7t6YG16fPt472RvRe7TJ?token= + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx/1.11.2 + Date: + - Tue, 25 Oct 2016 06:36:55 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Access-Control-Allow-Headers: + - Origin, X-Requested-With, Content-Type, Accept + Access-Control-Allow-Methods: + - GET, POST, PUT, DELETE + Access-Control-Allow-Origin: + - "*" + X-Ratelimit-Remaining: + - '166' + body: + encoding: ASCII-8BIT + string: |- + { + "address": "1C2YtDp89Q5sgWC7t6YG16fPt472RvRe7TJ", + "total_received": 0, + "total_sent": 0, + "balance": 0, + "unconfirmed_balance": 0, + "final_balance": 0, + "n_tx": 0, + "unconfirmed_n_tx": 0, + "final_n_tx": 0, + "tx_url": "https://api.blockcypher.com/v1/bcy/test/txs/" + } + http_version: + recorded_at: Tue, 25 Oct 2016 06:36:55 GMT +- request: + method: get + uri: https://api.blockcypher.com/v1/bcy/test/oap/15EMVQjPto24Rrq4YTeFhv1yADGzt7DSuw/addrs/1C2YtDp89Q5sgWC7t6YG16fPt472RvRe7TJ?token= + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx/1.9.12 + Date: + - Tue, 25 Oct 2016 06:36:58 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Access-Control-Allow-Headers: + - Origin, X-Requested-With, Content-Type, Accept + Access-Control-Allow-Methods: + - GET, POST, PUT, DELETE + Access-Control-Allow-Origin: + - "*" + X-Ratelimit-Remaining: + - '146' + body: + encoding: ASCII-8BIT + string: |- + { + "address": "1C2YtDp89Q5sgWC7t6YG16fPt472RvRe7TJ", + "total_received": 0, + "total_sent": 0, + "balance": 0, + "unconfirmed_balance": 0, + "final_balance": 0, + "n_tx": 0, + "unconfirmed_n_tx": 0, + "final_n_tx": 0, + "tx_url": "https://api.blockcypher.com/v1/bcy/test/txs/" + } + http_version: + recorded_at: Tue, 25 Oct 2016 06:36:58 GMT +- request: + method: get + uri: https://api.blockcypher.com/v1/bcy/test/oap/15EMVQjPto24Rrq4YTeFhv1yADGzt7DSuw/addrs/1C2YtDp89Q5sgWC7t6YG16fPt472RvRe7TJ?token= + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx/1.11.2 + Date: + - Tue, 25 Oct 2016 06:37:00 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Access-Control-Allow-Headers: + - Origin, X-Requested-With, Content-Type, Accept + Access-Control-Allow-Methods: + - GET, POST, PUT, DELETE + Access-Control-Allow-Origin: + - "*" + X-Ratelimit-Remaining: + - '165' + body: + encoding: ASCII-8BIT + string: |- + { + "address": "1C2YtDp89Q5sgWC7t6YG16fPt472RvRe7TJ", + "total_received": 0, + "total_sent": 0, + "balance": 0, + "unconfirmed_balance": 0, + "final_balance": 0, + "n_tx": 0, + "unconfirmed_n_tx": 0, + "final_n_tx": 0, + "tx_url": "https://api.blockcypher.com/v1/bcy/test/txs/" + } + http_version: + recorded_at: Tue, 25 Oct 2016 06:37:00 GMT +- request: + method: get + uri: https://api.blockcypher.com/v1/bcy/test/oap/15EMVQjPto24Rrq4YTeFhv1yADGzt7DSuw/addrs/1C2YtDp89Q5sgWC7t6YG16fPt472RvRe7TJ?token= + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx/1.9.12 + Date: + - Tue, 25 Oct 2016 06:37:02 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Access-Control-Allow-Headers: + - Origin, X-Requested-With, Content-Type, Accept + Access-Control-Allow-Methods: + - GET, POST, PUT, DELETE + Access-Control-Allow-Origin: + - "*" + X-Ratelimit-Remaining: + - '145' + body: + encoding: ASCII-8BIT + string: |- + { + "address": "1C2YtDp89Q5sgWC7t6YG16fPt472RvRe7TJ", + "total_received": 0, + "total_sent": 0, + "balance": 0, + "unconfirmed_balance": 0, + "final_balance": 0, + "n_tx": 0, + "unconfirmed_n_tx": 0, + "final_n_tx": 0, + "tx_url": "https://api.blockcypher.com/v1/bcy/test/txs/" + } + http_version: + recorded_at: Tue, 25 Oct 2016 06:37:02 GMT +- request: + method: get + uri: https://api.blockcypher.com/v1/bcy/test/oap/15EMVQjPto24Rrq4YTeFhv1yADGzt7DSuw/addrs/1C2YtDp89Q5sgWC7t6YG16fPt472RvRe7TJ?token= + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx/1.9.12 + Date: + - Tue, 25 Oct 2016 06:37:04 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Access-Control-Allow-Headers: + - Origin, X-Requested-With, Content-Type, Accept + Access-Control-Allow-Methods: + - GET, POST, PUT, DELETE + Access-Control-Allow-Origin: + - "*" + X-Ratelimit-Remaining: + - '140' + body: + encoding: ASCII-8BIT + string: |- + { + "address": "1C2YtDp89Q5sgWC7t6YG16fPt472RvRe7TJ", + "total_received": 0, + "total_sent": 0, + "balance": 0, + "unconfirmed_balance": 0, + "final_balance": 0, + "n_tx": 0, + "unconfirmed_n_tx": 0, + "final_n_tx": 0, + "tx_url": "https://api.blockcypher.com/v1/bcy/test/txs/" + } + http_version: + recorded_at: Tue, 25 Oct 2016 06:37:05 GMT +- request: + method: get + uri: https://api.blockcypher.com/v1/bcy/test/oap/15EMVQjPto24Rrq4YTeFhv1yADGzt7DSuw/addrs/1C2YtDp89Q5sgWC7t6YG16fPt472RvRe7TJ?token= + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx/1.9.12 + Date: + - Tue, 25 Oct 2016 06:37:07 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Access-Control-Allow-Headers: + - Origin, X-Requested-With, Content-Type, Accept + Access-Control-Allow-Methods: + - GET, POST, PUT, DELETE + Access-Control-Allow-Origin: + - "*" + X-Ratelimit-Remaining: + - '155' + body: + encoding: ASCII-8BIT + string: |- + { + "address": "1C2YtDp89Q5sgWC7t6YG16fPt472RvRe7TJ", + "total_received": 1000, + "total_sent": 0, + "balance": 1000, + "unconfirmed_balance": 0, + "final_balance": 1000, + "n_tx": 1, + "unconfirmed_n_tx": 0, + "final_n_tx": 1, + "txrefs": [ + { + "tx_hash": "bc745e9001ff0cc4cbac30616df2a4b71436919fb91b687f9dd43dd04c52d9ea", + "block_height": 1030276, + "tx_input_n": -1, + "tx_output_n": 0, + "value": 1000, + "ref_balance": 1000, + "spent": false, + "confirmations": 1, + "confirmed": "2016-10-25T06:37:06Z", + "double_spend": false + } + ], + "tx_url": "https://api.blockcypher.com/v1/bcy/test/txs/" + } + http_version: + recorded_at: Tue, 25 Oct 2016 06:37:07 GMT +- request: + method: post + uri: https://api.blockcypher.com/v1/bcy/test/oap/15EMVQjPto24Rrq4YTeFhv1yADGzt7DSuw/transfer?token= + body: + encoding: UTF-8 + string: '{"from_private":"99c29b6b5747520393a0909b1f456bf3554f143d4a10746954c648754243e2cf","to_address":"1BwWYuiH9eAfea9RAstAnG7wT1pFWTzjXpD","amount":100}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + Content-Type: + - application/json + response: + status: + code: 201 + message: Created + headers: + Server: + - nginx/1.11.2 + Date: + - Tue, 25 Oct 2016 06:37:10 GMT + Content-Type: + - application/json + Content-Length: + - '723' + Connection: + - keep-alive + Access-Control-Allow-Headers: + - Origin, X-Requested-With, Content-Type, Accept + Access-Control-Allow-Methods: + - GET, POST, PUT, DELETE + Access-Control-Allow-Origin: + - "*" + X-Ratelimit-Remaining: + - '164' + body: + encoding: UTF-8 + string: |- + { + "ver": 1, + "assetid": "15EMVQjPto24Rrq4YTeFhv1yADGzt7DSuw", + "oap_meta": "", + "hash": "8e3b6b88f061a9792c14cabd6d9f161daeba4461ecc648ea82b72af49febafa8", + "received": "2016-10-25T06:37:10.109238234Z", + "double_spend": false, + "inputs": [ + { + "prev_hash": "bc745e9001ff0cc4cbac30616df2a4b71436919fb91b687f9dd43dd04c52d9ea", + "output_index": 0, + "address": "1C2YtDp89Q5sgWC7t6YG16fPt472RvRe7TJ", + "output_value": 1000 + } + ], + "outputs": [ + { + "address": "1BwWYuiH9eAfea9RAstAnG7wT1pFWTzjXpD", + "value": 100, + "original_output_index": 1 + }, + { + "address": "1C2YtDp89Q5sgWC7t6YG16fPt472RvRe7TJ", + "value": 900, + "original_output_index": 2 + } + ] + } + http_version: + recorded_at: Tue, 25 Oct 2016 06:37:10 GMT +recorded_with: VCR 3.0.3 diff --git a/spec/fixtures/vcr_cassettes/BlockCypher_Api/Asset_API/Generate_Asset_Address/should_include_private_public_oap_address_original_address_hashes.yml b/spec/fixtures/vcr_cassettes/BlockCypher_Api/Asset_API/Generate_Asset_Address/should_include_private_public_oap_address_original_address_hashes.yml new file mode 100644 index 0000000..14a0c9c --- /dev/null +++ b/spec/fixtures/vcr_cassettes/BlockCypher_Api/Asset_API/Generate_Asset_Address/should_include_private_public_oap_address_original_address_hashes.yml @@ -0,0 +1,51 @@ +--- +http_interactions: +- request: + method: post + uri: https://api.blockcypher.com/v1/bcy/test/oap/addrs?token= + body: + encoding: UTF-8 + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 201 + message: Created + headers: + Server: + - nginx/1.9.12 + Date: + - Tue, 25 Oct 2016 06:36:08 GMT + Content-Type: + - application/json + Content-Length: + - '346' + Connection: + - keep-alive + Access-Control-Allow-Headers: + - Origin, X-Requested-With, Content-Type, Accept + Access-Control-Allow-Methods: + - GET, POST, PUT, DELETE + Access-Control-Allow-Origin: + - "*" + X-Ratelimit-Remaining: + - '179' + body: + encoding: UTF-8 + string: |- + { + "private": "7ac4a4899444c04253d731ad792e4c287e022d199560d14c638c4935cd8ae1ff", + "public": "023e05052f7c9ba4f341649237ebbe901bf9c5968b656239115c72ed15d743e860", + "oap_address": "1C1f946JkAnYYQUEr45YLjUDFB16nT4oR2j", + "original_address": "C1f946JkAnYYQUEr45YLjUDFB16nQAKtrh", + "wif": "BsSgAH7YPHMmWgryXLAnkUvJTLruvLQx7drWefhiiMTWqLCMRq3H" + } + http_version: + recorded_at: Tue, 25 Oct 2016 06:36:08 GMT +recorded_with: VCR 3.0.3 diff --git a/spec/fixtures/vcr_cassettes/BlockCypher_Api/Asset_API/Issue_Asset/should_issue_asset.yml b/spec/fixtures/vcr_cassettes/BlockCypher_Api/Asset_API/Issue_Asset/should_issue_asset.yml new file mode 100644 index 0000000..e1c903e --- /dev/null +++ b/spec/fixtures/vcr_cassettes/BlockCypher_Api/Asset_API/Issue_Asset/should_issue_asset.yml @@ -0,0 +1,156 @@ +--- +http_interactions: +- request: + method: post + uri: https://api.blockcypher.com/v1/bcy/test/oap/addrs?token= + body: + encoding: UTF-8 + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 201 + message: Created + headers: + Server: + - nginx/1.9.12 + Date: + - Tue, 25 Oct 2016 06:36:09 GMT + Content-Type: + - application/json + Content-Length: + - '346' + Connection: + - keep-alive + Access-Control-Allow-Headers: + - Origin, X-Requested-With, Content-Type, Accept + Access-Control-Allow-Methods: + - GET, POST, PUT, DELETE + Access-Control-Allow-Origin: + - "*" + X-Ratelimit-Remaining: + - '195' + body: + encoding: UTF-8 + string: |- + { + "private": "c5b98c7a8c7bd1825410a58313e516d62326e9b4969e8d9ec09be955446c4907", + "public": "02f2c92c8f0925a2ef5eef62cfd19cf72d236d780755cc4aaf6dea63f195d70b2e", + "oap_address": "1C5cM5T8vXfe9SaJKWCgMrgTixnxZcmDb4y", + "original_address": "C5cM5T8vXfe9SaJKWCgMrgTixnxZYUKnT1", + "wif": "BuxP78R9erkyRXco5p1baiEZM3rEGqpury2oSSK9pXBgxxfyAurr" + } + http_version: + recorded_at: Tue, 25 Oct 2016 06:36:10 GMT +- request: + method: post + uri: https://api.blockcypher.com/v1/bcy/test/faucet?token= + body: + encoding: UTF-8 + string: '{"address":"C5cM5T8vXfe9SaJKWCgMrgTixnxZYUKnT1","amount":1000000}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + Content-Type: + - application/json + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx/1.11.2 + Date: + - Tue, 25 Oct 2016 06:36:11 GMT + Content-Type: + - application/json + Content-Length: + - '82' + Connection: + - keep-alive + Access-Control-Allow-Headers: + - Origin, X-Requested-With, Content-Type, Accept + Access-Control-Allow-Methods: + - GET, POST, PUT, DELETE + Access-Control-Allow-Origin: + - "*" + X-Ratelimit-Remaining: + - '176' + body: + encoding: UTF-8 + string: |- + { + "tx_ref": "b6e86704af5d31955370c5df3acdd5c8cd73a05ff934eb78aac03175e1c25a86" + } + http_version: + recorded_at: Tue, 25 Oct 2016 06:36:11 GMT +- request: + method: post + uri: https://api.blockcypher.com/v1/bcy/test/oap/issue?token= + body: + encoding: UTF-8 + string: '{"from_private":"c5b98c7a8c7bd1825410a58313e516d62326e9b4969e8d9ec09be955446c4907","to_address":"1C5cM5T8vXfe9SaJKWCgMrgTixnxZcmDb4y","amount":1000}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + Content-Type: + - application/json + response: + status: + code: 201 + message: Created + headers: + Server: + - nginx/1.9.12 + Date: + - Tue, 25 Oct 2016 06:36:13 GMT + Content-Type: + - application/json + Content-Length: + - '392' + Connection: + - keep-alive + Access-Control-Allow-Headers: + - Origin, X-Requested-With, Content-Type, Accept + Access-Control-Allow-Methods: + - GET, POST, PUT, DELETE + Access-Control-Allow-Origin: + - "*" + X-Ratelimit-Remaining: + - '194' + body: + encoding: UTF-8 + string: |- + { + "ver": 1, + "assetid": "1EfiAViDcsVHJoabNnaSHGh7EogkAboW1b", + "oap_meta": "", + "hash": "a9ee3352e4c5f39b9a887740ddf5f2359096e1dbf84402b4f3652ce5c4aed96c", + "received": "2016-10-25T06:36:13.085784805Z", + "double_spend": false, + "inputs": [], + "outputs": [ + { + "address": "1C5cM5T8vXfe9SaJKWCgMrgTixnxZcmDb4y", + "value": 1000, + "original_output_index": 0 + } + ] + } + http_version: + recorded_at: Tue, 25 Oct 2016 06:36:13 GMT +recorded_with: VCR 3.0.3 diff --git a/spec/fixtures/vcr_cassettes/BlockCypher_Api/_address_final_balance/should_get_the_balance_of_an_address.yml b/spec/fixtures/vcr_cassettes/BlockCypher_Api/_address_final_balance/should_get_the_balance_of_an_address.yml new file mode 100644 index 0000000..b5ded4c --- /dev/null +++ b/spec/fixtures/vcr_cassettes/BlockCypher_Api/_address_final_balance/should_get_the_balance_of_an_address.yml @@ -0,0 +1,102 @@ +--- +http_interactions: +- request: + method: post + uri: https://api.blockcypher.com/v1/bcy/test/addrs?token= + body: + encoding: UTF-8 + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 201 + message: Created + headers: + Server: + - nginx/1.9.12 + Date: + - Tue, 25 Oct 2016 06:35:44 GMT + Content-Type: + - application/json + Content-Length: + - '281' + Connection: + - keep-alive + Access-Control-Allow-Headers: + - Origin, X-Requested-With, Content-Type, Accept + Access-Control-Allow-Methods: + - GET, POST, PUT, DELETE + Access-Control-Allow-Origin: + - "*" + X-Ratelimit-Remaining: + - '182' + body: + encoding: UTF-8 + string: |- + { + "private": "f29b1419cd0b3943ba595cdfb1e0c8ed666693997e1cf1097c906baeab927358", + "public": "03ea9a402647cced83b71ea92a96a5ffcf85ebfdc9e3e19fcf71d318f9408591bd", + "address": "C964NAK4Refx6XGoynP6wvF3RDE8d6AJzb", + "wif": "BwTdBkEPSpczgQyBxGGRJ6q5b94jLamSzELWj5WDnyPZUCJWD9KQ" + } + http_version: + recorded_at: Tue, 25 Oct 2016 06:35:45 GMT +- request: + method: get + uri: https://api.blockcypher.com/v1/bcy/test/addrs/C964NAK4Refx6XGoynP6wvF3RDE8d6AJzb/balance?omitWalletAddresses=false&token= + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx/1.9.12 + Date: + - Tue, 25 Oct 2016 06:35:46 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Access-Control-Allow-Headers: + - Origin, X-Requested-With, Content-Type, Accept + Access-Control-Allow-Methods: + - GET, POST, PUT, DELETE + Access-Control-Allow-Origin: + - "*" + X-Ratelimit-Remaining: + - '181' + body: + encoding: ASCII-8BIT + string: |- + { + "address": "C964NAK4Refx6XGoynP6wvF3RDE8d6AJzb", + "total_received": 0, + "total_sent": 0, + "balance": 0, + "unconfirmed_balance": 0, + "final_balance": 0, + "n_tx": 0, + "unconfirmed_n_tx": 0, + "final_n_tx": 0 + } + http_version: + recorded_at: Tue, 25 Oct 2016 06:35:46 GMT +recorded_with: VCR 3.0.3 diff --git a/spec/fixtures/vcr_cassettes/BlockCypher_Api/_address_generate/should_generate_new_addresses.yml b/spec/fixtures/vcr_cassettes/BlockCypher_Api/_address_generate/should_generate_new_addresses.yml new file mode 100644 index 0000000..79e59c1 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/BlockCypher_Api/_address_generate/should_generate_new_addresses.yml @@ -0,0 +1,97 @@ +--- +http_interactions: +- request: + method: post + uri: https://api.blockcypher.com/v1/bcy/test/addrs?token= + body: + encoding: UTF-8 + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 201 + message: Created + headers: + Server: + - nginx/1.9.12 + Date: + - Tue, 25 Oct 2016 06:34:55 GMT + Content-Type: + - application/json + Content-Length: + - '281' + Connection: + - keep-alive + Access-Control-Allow-Headers: + - Origin, X-Requested-With, Content-Type, Accept + Access-Control-Allow-Methods: + - GET, POST, PUT, DELETE + Access-Control-Allow-Origin: + - "*" + X-Ratelimit-Remaining: + - '185' + body: + encoding: UTF-8 + string: |- + { + "private": "3ec42fb035d591cd252a30441c105d2d44b9ae51cf69c0fcfc0b771feaa01ddf", + "public": "0228287639157aa3f437c99aa25ca91fbecdd7246cd48e0c111998ec28179e5e3c", + "address": "C4n93JUZetFGG9pt4K56kcknHCm4r1Ek9k", + "wif": "BqS3J2y63KzB7p4YWTRXHAP8oU55XtQRwMdsC67ixBBMnLnUsRib" + } + http_version: + recorded_at: Tue, 25 Oct 2016 06:34:55 GMT +- request: + method: post + uri: https://api.blockcypher.com/v1/bcy/test/addrs?token= + body: + encoding: UTF-8 + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 201 + message: Created + headers: + Server: + - nginx/1.9.12 + Date: + - Tue, 25 Oct 2016 06:34:56 GMT + Content-Type: + - application/json + Content-Length: + - '281' + Connection: + - keep-alive + Access-Control-Allow-Headers: + - Origin, X-Requested-With, Content-Type, Accept + Access-Control-Allow-Methods: + - GET, POST, PUT, DELETE + Access-Control-Allow-Origin: + - "*" + X-Ratelimit-Remaining: + - '184' + body: + encoding: UTF-8 + string: |- + { + "private": "36ab071c346df251b5a0380e274103cccf208a43f7f8c6163f984ade033d7838", + "public": "02f665c1397cae5f82236af90eab78c686d63a41ff5906d92812c83d47474d6c98", + "address": "Btr8fDMAKwXHSZQyoEtyDeEa7dcq7QXbYo", + "wif": "BqAJFyyReBUaPnEaLzRKPUuAsNYbswP2rcWqoC2brnVDTCSs82eF" + } + http_version: + recorded_at: Tue, 25 Oct 2016 06:34:56 GMT +recorded_with: VCR 3.0.3 diff --git a/spec/fixtures/vcr_cassettes/BlockCypher_Api/_create_forwarding_address/allows_creating_a_payment_forward_with_a_callback.yml b/spec/fixtures/vcr_cassettes/BlockCypher_Api/_create_forwarding_address/allows_creating_a_payment_forward_with_a_callback.yml new file mode 100644 index 0000000..bc2ac33 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/BlockCypher_Api/_create_forwarding_address/allows_creating_a_payment_forward_with_a_callback.yml @@ -0,0 +1,100 @@ +--- +http_interactions: +- request: + method: post + uri: https://api.blockcypher.com/v1/bcy/test/addrs?token= + body: + encoding: UTF-8 + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 201 + message: Created + headers: + Server: + - nginx/1.9.12 + Date: + - Tue, 25 Oct 2016 06:35:50 GMT + Content-Type: + - application/json + Content-Length: + - '281' + Connection: + - keep-alive + Access-Control-Allow-Headers: + - Origin, X-Requested-With, Content-Type, Accept + Access-Control-Allow-Methods: + - GET, POST, PUT, DELETE + Access-Control-Allow-Origin: + - "*" + X-Ratelimit-Remaining: + - '186' + body: + encoding: UTF-8 + string: |- + { + "private": "203ec39df399ebc4a2a7f4cf3aae689cb810f63dce2393cfc203767795b991b0", + "public": "035a9b2851abf125d1eb2ccffd6360c108b705a753abda1d7fa957951c54b10d0a", + "address": "Bz1kdFmvRP3sxw3YTG1iz6Q1xvFSV3taLd", + "wif": "BpQiCeoPkejjPHD3c6ijkEw4SN1PjwzZzE6d1U6TSxF8akF4YirN" + } + http_version: + recorded_at: Tue, 25 Oct 2016 06:35:50 GMT +- request: + method: post + uri: https://api.blockcypher.com/v1/bcy/test/payments?token= + body: + encoding: UTF-8 + string: '{"destination":"Bz1kdFmvRP3sxw3YTG1iz6Q1xvFSV3taLd","callback_url":"http://test.com/foo","enable_confirmations":false}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + Content-Type: + - application/json + response: + status: + code: 201 + message: Created + headers: + Server: + - nginx/1.9.12 + Date: + - Tue, 25 Oct 2016 06:35:51 GMT + Content-Type: + - application/json + Content-Length: + - '250' + Connection: + - keep-alive + Access-Control-Allow-Headers: + - Origin, X-Requested-With, Content-Type, Accept + Access-Control-Allow-Methods: + - GET, POST, PUT, DELETE + Access-Control-Allow-Origin: + - "*" + X-Ratelimit-Remaining: + - '180' + body: + encoding: UTF-8 + string: |- + { + "id": "94f44d55-8155-458d-b3b9-142084c1ad5e", + "token": "", + "destination": "Bz1kdFmvRP3sxw3YTG1iz6Q1xvFSV3taLd", + "input_address": "CD3jhqqaS8QvaNG7aVzPUGuWbFhdHknRkR", + "callback_url": "http://test.com/foo" + } + http_version: + recorded_at: Tue, 25 Oct 2016 06:35:52 GMT +recorded_with: VCR 3.0.3 diff --git a/spec/fixtures/vcr_cassettes/BlockCypher_Api/_create_forwarding_address/allows_creating_a_payment_forward_with_a_callback_and_confirmation_notifications_enabled.yml b/spec/fixtures/vcr_cassettes/BlockCypher_Api/_create_forwarding_address/allows_creating_a_payment_forward_with_a_callback_and_confirmation_notifications_enabled.yml new file mode 100644 index 0000000..31859e1 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/BlockCypher_Api/_create_forwarding_address/allows_creating_a_payment_forward_with_a_callback_and_confirmation_notifications_enabled.yml @@ -0,0 +1,101 @@ +--- +http_interactions: +- request: + method: post + uri: https://api.blockcypher.com/v1/bcy/test/addrs?token= + body: + encoding: UTF-8 + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 201 + message: Created + headers: + Server: + - nginx/1.9.12 + Date: + - Tue, 25 Oct 2016 06:35:53 GMT + Content-Type: + - application/json + Content-Length: + - '281' + Connection: + - keep-alive + Access-Control-Allow-Headers: + - Origin, X-Requested-With, Content-Type, Accept + Access-Control-Allow-Methods: + - GET, POST, PUT, DELETE + Access-Control-Allow-Origin: + - "*" + X-Ratelimit-Remaining: + - '193' + body: + encoding: UTF-8 + string: |- + { + "private": "08d702a8bb315b51e3ecee8c2f702cfd83ff79ca2f4b5d74733d217ed5d17839", + "public": "03b64a83867eda56bce7a7b29e507fe42ea9302e01abe6f5aed60eaab4a638682c", + "address": "BsR3qRSngCXnyvQ2t4gE6TMPWWjPjFPmTt", + "wif": "BodDPLxoBhw9Fdt9AnHoP2mQNjHRDtTAG9w225W4xJBJTYTpu5AZ" + } + http_version: + recorded_at: Tue, 25 Oct 2016 06:35:53 GMT +- request: + method: post + uri: https://api.blockcypher.com/v1/bcy/test/payments?token= + body: + encoding: UTF-8 + string: '{"destination":"BsR3qRSngCXnyvQ2t4gE6TMPWWjPjFPmTt","callback_url":"http://test.com/foo","enable_confirmations":true}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + Content-Type: + - application/json + response: + status: + code: 201 + message: Created + headers: + Server: + - nginx/1.9.12 + Date: + - Tue, 25 Oct 2016 06:35:54 GMT + Content-Type: + - application/json + Content-Length: + - '282' + Connection: + - keep-alive + Access-Control-Allow-Headers: + - Origin, X-Requested-With, Content-Type, Accept + Access-Control-Allow-Methods: + - GET, POST, PUT, DELETE + Access-Control-Allow-Origin: + - "*" + X-Ratelimit-Remaining: + - '176' + body: + encoding: UTF-8 + string: |- + { + "id": "97b0be31-75bf-457f-a3e8-4752250c00b9", + "token": "", + "destination": "BsR3qRSngCXnyvQ2t4gE6TMPWWjPjFPmTt", + "input_address": "CAevgagGLaA5Qmgb7tQguZPyf2fSwVRAea", + "enable_confirmations": true, + "callback_url": "http://test.com/foo" + } + http_version: + recorded_at: Tue, 25 Oct 2016 06:35:54 GMT +recorded_with: VCR 3.0.3 diff --git a/spec/fixtures/vcr_cassettes/BlockCypher_Api/_create_forwarding_address/creates_a_payment_forward.yml b/spec/fixtures/vcr_cassettes/BlockCypher_Api/_create_forwarding_address/creates_a_payment_forward.yml new file mode 100644 index 0000000..6720ca4 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/BlockCypher_Api/_create_forwarding_address/creates_a_payment_forward.yml @@ -0,0 +1,99 @@ +--- +http_interactions: +- request: + method: post + uri: https://api.blockcypher.com/v1/bcy/test/addrs?token= + body: + encoding: UTF-8 + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 201 + message: Created + headers: + Server: + - nginx/1.9.12 + Date: + - Tue, 25 Oct 2016 06:35:47 GMT + Content-Type: + - application/json + Content-Length: + - '281' + Connection: + - keep-alive + Access-Control-Allow-Headers: + - Origin, X-Requested-With, Content-Type, Accept + Access-Control-Allow-Methods: + - GET, POST, PUT, DELETE + Access-Control-Allow-Origin: + - "*" + X-Ratelimit-Remaining: + - '195' + body: + encoding: UTF-8 + string: |- + { + "private": "8b9e2e67691f746a67cbc5bc88af354825a3ec930f5e3109a1e3641e0c68225b", + "public": "03dc4b03f1be17602841febb2a5d22790273296ca46d596c71ff78253ac4fe132a", + "address": "C5YjzvfcXhCRfzPCNtHHJ2KKJ3bt9NgA1j", + "wif": "Bt1RsqAfSoZYHSt9NZnJf8vL5a6nPztkDxT2pYx8N9DMuCsvtr8R" + } + http_version: + recorded_at: Tue, 25 Oct 2016 06:35:48 GMT +- request: + method: post + uri: https://api.blockcypher.com/v1/bcy/test/payments?token= + body: + encoding: UTF-8 + string: '{"destination":"C5YjzvfcXhCRfzPCNtHHJ2KKJ3bt9NgA1j","callback_url":null,"enable_confirmations":false}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + Content-Type: + - application/json + response: + status: + code: 201 + message: Created + headers: + Server: + - nginx/1.9.12 + Date: + - Tue, 25 Oct 2016 06:35:48 GMT + Content-Type: + - application/json + Content-Length: + - '209' + Connection: + - keep-alive + Access-Control-Allow-Headers: + - Origin, X-Requested-With, Content-Type, Accept + Access-Control-Allow-Methods: + - GET, POST, PUT, DELETE + Access-Control-Allow-Origin: + - "*" + X-Ratelimit-Remaining: + - '194' + body: + encoding: UTF-8 + string: |- + { + "id": "28947218-5742-42a3-afc8-085028220361", + "token": "", + "destination": "C5YjzvfcXhCRfzPCNtHHJ2KKJ3bt9NgA1j", + "input_address": "CC9fcp6E8kDGjn3HcvHNbKaroq88yecqhE" + } + http_version: + recorded_at: Tue, 25 Oct 2016 06:35:49 GMT +recorded_with: VCR 3.0.3 diff --git a/spec/fixtures/vcr_cassettes/BlockCypher_Api/_create_forwarding_address/is_possible_to_use_the_alias_create_payments_forwarding.yml b/spec/fixtures/vcr_cassettes/BlockCypher_Api/_create_forwarding_address/is_possible_to_use_the_alias_create_payments_forwarding.yml new file mode 100644 index 0000000..3837117 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/BlockCypher_Api/_create_forwarding_address/is_possible_to_use_the_alias_create_payments_forwarding.yml @@ -0,0 +1,99 @@ +--- +http_interactions: +- request: + method: post + uri: https://api.blockcypher.com/v1/bcy/test/addrs?token= + body: + encoding: UTF-8 + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 201 + message: Created + headers: + Server: + - nginx/1.9.12 + Date: + - Tue, 25 Oct 2016 06:35:55 GMT + Content-Type: + - application/json + Content-Length: + - '281' + Connection: + - keep-alive + Access-Control-Allow-Headers: + - Origin, X-Requested-With, Content-Type, Accept + Access-Control-Allow-Methods: + - GET, POST, PUT, DELETE + Access-Control-Allow-Origin: + - "*" + X-Ratelimit-Remaining: + - '192' + body: + encoding: UTF-8 + string: |- + { + "private": "c010b688ab9d8a1029a3a5a5b352d5953dc88cf57d694d1080ef23686a6be22e", + "public": "03bef1e8e3c27f69cfb0f688a20f0f19c620233f4a7677f4882df22d4afafb8b08", + "address": "Bsw87oXJeVuwz8VVbR9zQm1i9i39fmy8Pr", + "wif": "BumP2ZhwCbPvPak1uwv7HpSUVXr74hae3V9zFqpUkSJLDuJEBXdC" + } + http_version: + recorded_at: Tue, 25 Oct 2016 06:35:55 GMT +- request: + method: post + uri: https://api.blockcypher.com/v1/bcy/test/payments?token= + body: + encoding: UTF-8 + string: '{"destination":"Bsw87oXJeVuwz8VVbR9zQm1i9i39fmy8Pr","callback_url":null,"enable_confirmations":false}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + Content-Type: + - application/json + response: + status: + code: 201 + message: Created + headers: + Server: + - nginx/1.9.12 + Date: + - Tue, 25 Oct 2016 06:35:57 GMT + Content-Type: + - application/json + Content-Length: + - '209' + Connection: + - keep-alive + Access-Control-Allow-Headers: + - Origin, X-Requested-With, Content-Type, Accept + Access-Control-Allow-Methods: + - GET, POST, PUT, DELETE + Access-Control-Allow-Origin: + - "*" + X-Ratelimit-Remaining: + - '191' + body: + encoding: UTF-8 + string: |- + { + "id": "8e0103af-33c6-4262-9dfa-b29b3e2f6a2f", + "token": "", + "destination": "Bsw87oXJeVuwz8VVbR9zQm1i9i39fmy8Pr", + "input_address": "C1nXb9WcayTNHaX5rAPjhxTrsfwGgAym7c" + } + http_version: + recorded_at: Tue, 25 Oct 2016 06:35:57 GMT +recorded_with: VCR 3.0.3 diff --git a/spec/fixtures/vcr_cassettes/BlockCypher_Api/_delete_forwarding_address/deletes_all_previously_created_forwarding_addresses.yml b/spec/fixtures/vcr_cassettes/BlockCypher_Api/_delete_forwarding_address/deletes_all_previously_created_forwarding_addresses.yml new file mode 100644 index 0000000..342fa94 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/BlockCypher_Api/_delete_forwarding_address/deletes_all_previously_created_forwarding_addresses.yml @@ -0,0 +1,269 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.blockcypher.com/v1/bcy/test/payments?token= + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx/1.9.12 + Date: + - Tue, 25 Oct 2016 06:36:01 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Access-Control-Allow-Headers: + - Origin, X-Requested-With, Content-Type, Accept + Access-Control-Allow-Methods: + - GET, POST, PUT, DELETE + Access-Control-Allow-Origin: + - "*" + X-Ratelimit-Remaining: + - '189' + body: + encoding: ASCII-8BIT + string: |- + [ + { + "id": "28947218-5742-42a3-afc8-085028220361", + "token": "", + "destination": "C5YjzvfcXhCRfzPCNtHHJ2KKJ3bt9NgA1j", + "input_address": "CC9fcp6E8kDGjn3HcvHNbKaroq88yecqhE" + }, + { + "id": "8e0103af-33c6-4262-9dfa-b29b3e2f6a2f", + "token": "", + "destination": "Bsw87oXJeVuwz8VVbR9zQm1i9i39fmy8Pr", + "input_address": "C1nXb9WcayTNHaX5rAPjhxTrsfwGgAym7c" + }, + { + "id": "94f44d55-8155-458d-b3b9-142084c1ad5e", + "token": "", + "destination": "Bz1kdFmvRP3sxw3YTG1iz6Q1xvFSV3taLd", + "input_address": "CD3jhqqaS8QvaNG7aVzPUGuWbFhdHknRkR", + "callback_url": "http://test.com/foo" + }, + { + "id": "97b0be31-75bf-457f-a3e8-4752250c00b9", + "token": "", + "destination": "BsR3qRSngCXnyvQ2t4gE6TMPWWjPjFPmTt", + "input_address": "CAevgagGLaA5Qmgb7tQguZPyf2fSwVRAea", + "callback_url": "http://test.com/foo" + } + ] + http_version: + recorded_at: Tue, 25 Oct 2016 06:36:01 GMT +- request: + method: delete + uri: https://api.blockcypher.com/v1/bcy/test/payments/28947218-5742-42a3-afc8-085028220361?token= + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 204 + message: No Content + headers: + Server: + - nginx/1.9.12 + Date: + - Tue, 25 Oct 2016 06:36:02 GMT + Content-Type: + - application/json + Connection: + - keep-alive + Access-Control-Allow-Headers: + - Origin, X-Requested-With, Content-Type, Accept + Access-Control-Allow-Methods: + - GET, POST, PUT, DELETE + Access-Control-Allow-Origin: + - "*" + X-Ratelimit-Remaining: + - '175' + body: + encoding: UTF-8 + string: '' + http_version: + recorded_at: Tue, 25 Oct 2016 06:36:02 GMT +- request: + method: delete + uri: https://api.blockcypher.com/v1/bcy/test/payments/8e0103af-33c6-4262-9dfa-b29b3e2f6a2f?token= + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 204 + message: No Content + headers: + Server: + - nginx/1.9.12 + Date: + - Tue, 25 Oct 2016 06:36:03 GMT + Content-Type: + - application/json + Connection: + - keep-alive + Access-Control-Allow-Headers: + - Origin, X-Requested-With, Content-Type, Accept + Access-Control-Allow-Methods: + - GET, POST, PUT, DELETE + Access-Control-Allow-Origin: + - "*" + X-Ratelimit-Remaining: + - '178' + body: + encoding: UTF-8 + string: '' + http_version: + recorded_at: Tue, 25 Oct 2016 06:36:03 GMT +- request: + method: delete + uri: https://api.blockcypher.com/v1/bcy/test/payments/94f44d55-8155-458d-b3b9-142084c1ad5e?token= + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 204 + message: No Content + headers: + Server: + - nginx/1.9.12 + Date: + - Tue, 25 Oct 2016 06:36:04 GMT + Content-Type: + - application/json + Connection: + - keep-alive + Access-Control-Allow-Headers: + - Origin, X-Requested-With, Content-Type, Accept + Access-Control-Allow-Methods: + - GET, POST, PUT, DELETE + Access-Control-Allow-Origin: + - "*" + X-Ratelimit-Remaining: + - '188' + body: + encoding: UTF-8 + string: '' + http_version: + recorded_at: Tue, 25 Oct 2016 06:36:04 GMT +- request: + method: delete + uri: https://api.blockcypher.com/v1/bcy/test/payments/97b0be31-75bf-457f-a3e8-4752250c00b9?token= + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 204 + message: No Content + headers: + Server: + - nginx/1.11.2 + Date: + - Tue, 25 Oct 2016 06:36:05 GMT + Content-Type: + - application/json + Connection: + - keep-alive + Access-Control-Allow-Headers: + - Origin, X-Requested-With, Content-Type, Accept + Access-Control-Allow-Methods: + - GET, POST, PUT, DELETE + Access-Control-Allow-Origin: + - "*" + X-Ratelimit-Remaining: + - '184' + body: + encoding: UTF-8 + string: '' + http_version: + recorded_at: Tue, 25 Oct 2016 06:36:06 GMT +- request: + method: get + uri: https://api.blockcypher.com/v1/bcy/test/payments?token= + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx/1.11.2 + Date: + - Tue, 25 Oct 2016 06:36:07 GMT + Content-Type: + - application/json + Content-Length: + - '2' + Connection: + - keep-alive + Access-Control-Allow-Headers: + - Origin, X-Requested-With, Content-Type, Accept + Access-Control-Allow-Methods: + - GET, POST, PUT, DELETE + Access-Control-Allow-Origin: + - "*" + X-Ratelimit-Remaining: + - '183' + body: + encoding: UTF-8 + string: "[]" + http_version: + recorded_at: Tue, 25 Oct 2016 06:36:07 GMT +recorded_with: VCR 3.0.3 diff --git a/spec/fixtures/vcr_cassettes/BlockCypher_Api/_faucet/should_fund_a_bcy_test_address_with_the_faucet.yml b/spec/fixtures/vcr_cassettes/BlockCypher_Api/_faucet/should_fund_a_bcy_test_address_with_the_faucet.yml new file mode 100644 index 0000000..ae2b951 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/BlockCypher_Api/_faucet/should_fund_a_bcy_test_address_with_the_faucet.yml @@ -0,0 +1,96 @@ +--- +http_interactions: +- request: + method: post + uri: https://api.blockcypher.com/v1/bcy/test/addrs?token= + body: + encoding: UTF-8 + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 201 + message: Created + headers: + Server: + - nginx/1.9.12 + Date: + - Tue, 25 Oct 2016 06:35:33 GMT + Content-Type: + - application/json + Content-Length: + - '281' + Connection: + - keep-alive + Access-Control-Allow-Headers: + - Origin, X-Requested-With, Content-Type, Accept + Access-Control-Allow-Methods: + - GET, POST, PUT, DELETE + Access-Control-Allow-Origin: + - "*" + X-Ratelimit-Remaining: + - '196' + body: + encoding: UTF-8 + string: |- + { + "private": "b6725f5acfc23fcbe9c20bfe5823d697bbfbfa885149b7d6847f789b8ec36b43", + "public": "031ecaaedf71f50d2ce9206c518852847cc2a969b18d9dd97f3705a283c05f5a0c", + "address": "C2SJopG4bZm2kXtYFFoGVfXLrtXvnvdqQk", + "wif": "BuSgbP1hnPNFoB2ErWURBbu37gDtmsxBao9vb52xHFSw18qTGN4n" + } + http_version: + recorded_at: Tue, 25 Oct 2016 06:35:33 GMT +- request: + method: post + uri: https://api.blockcypher.com/v1/bcy/test/faucet?token= + body: + encoding: UTF-8 + string: '{"address":"C2SJopG4bZm2kXtYFFoGVfXLrtXvnvdqQk","amount":100000}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + Content-Type: + - application/json + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx/1.9.12 + Date: + - Tue, 25 Oct 2016 06:35:35 GMT + Content-Type: + - application/json + Content-Length: + - '82' + Connection: + - keep-alive + Access-Control-Allow-Headers: + - Origin, X-Requested-With, Content-Type, Accept + Access-Control-Allow-Methods: + - GET, POST, PUT, DELETE + Access-Control-Allow-Origin: + - "*" + X-Ratelimit-Remaining: + - '185' + body: + encoding: UTF-8 + string: |- + { + "tx_ref": "16ae510fd385405f697954fc0a4f6964304176036857ea7fe6e1f297d3a7c286" + } + http_version: + recorded_at: Tue, 25 Oct 2016 06:35:35 GMT +recorded_with: VCR 3.0.3 diff --git a/spec/fixtures/vcr_cassettes/BlockCypher_Api/_list_forwarding_addresses/lists_all_forwading_addresses_created_for_a_given_token.yml b/spec/fixtures/vcr_cassettes/BlockCypher_Api/_list_forwarding_addresses/lists_all_forwading_addresses_created_for_a_given_token.yml new file mode 100644 index 0000000..de6452f --- /dev/null +++ b/spec/fixtures/vcr_cassettes/BlockCypher_Api/_list_forwarding_addresses/lists_all_forwading_addresses_created_for_a_given_token.yml @@ -0,0 +1,119 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.blockcypher.com/v1/bcy/test/payments?token= + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx/1.9.12 + Date: + - Tue, 25 Oct 2016 06:35:58 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Access-Control-Allow-Headers: + - Origin, X-Requested-With, Content-Type, Accept + Access-Control-Allow-Methods: + - GET, POST, PUT, DELETE + Access-Control-Allow-Origin: + - "*" + X-Ratelimit-Remaining: + - '179' + body: + encoding: ASCII-8BIT + string: |- + [ + { + "id": "28947218-5742-42a3-afc8-085028220361", + "token": "", + "destination": "C5YjzvfcXhCRfzPCNtHHJ2KKJ3bt9NgA1j", + "input_address": "CC9fcp6E8kDGjn3HcvHNbKaroq88yecqhE" + }, + { + "id": "8e0103af-33c6-4262-9dfa-b29b3e2f6a2f", + "token": "", + "destination": "Bsw87oXJeVuwz8VVbR9zQm1i9i39fmy8Pr", + "input_address": "C1nXb9WcayTNHaX5rAPjhxTrsfwGgAym7c" + }, + { + "id": "94f44d55-8155-458d-b3b9-142084c1ad5e", + "token": "", + "destination": "Bz1kdFmvRP3sxw3YTG1iz6Q1xvFSV3taLd", + "input_address": "CD3jhqqaS8QvaNG7aVzPUGuWbFhdHknRkR", + "callback_url": "http://test.com/foo" + }, + { + "id": "97b0be31-75bf-457f-a3e8-4752250c00b9", + "token": "", + "destination": "BsR3qRSngCXnyvQ2t4gE6TMPWWjPjFPmTt", + "input_address": "CAevgagGLaA5Qmgb7tQguZPyf2fSwVRAea", + "callback_url": "http://test.com/foo" + } + ] + http_version: + recorded_at: Tue, 25 Oct 2016 06:35:59 GMT +- request: + method: post + uri: https://api.blockcypher.com/v1/bcy/test/addrs?token= + body: + encoding: UTF-8 + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 201 + message: Created + headers: + Server: + - nginx/1.9.12 + Date: + - Tue, 25 Oct 2016 06:36:00 GMT + Content-Type: + - application/json + Content-Length: + - '281' + Connection: + - keep-alive + Access-Control-Allow-Headers: + - Origin, X-Requested-With, Content-Type, Accept + Access-Control-Allow-Methods: + - GET, POST, PUT, DELETE + Access-Control-Allow-Origin: + - "*" + X-Ratelimit-Remaining: + - '190' + body: + encoding: UTF-8 + string: |- + { + "private": "79b2236ca43a95c5002ade6e787115a5ef2495625a353e857159b956631a83d6", + "public": "02ff5abdc7da47f6c1b51d377ea765c07c42da0f8b58916b4ccf9c65bd1f53b3df", + "address": "C6gPm4ECoXn7t1hbMfrf83SbauB21cGPkg", + "wif": "BsQbGS6VGL6yiV7cD5XdfN7yiPZTKF1fDqaAgUL8N5TT55fGhJQc" + } + http_version: + recorded_at: Tue, 25 Oct 2016 06:36:00 GMT +recorded_with: VCR 3.0.3 diff --git a/spec/fixtures/vcr_cassettes/BlockCypher_Api/_transaction_new/should_call_the_txs/new_api.yml b/spec/fixtures/vcr_cassettes/BlockCypher_Api/_transaction_new/should_call_the_txs/new_api.yml new file mode 100644 index 0000000..723c494 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/BlockCypher_Api/_transaction_new/should_call_the_txs/new_api.yml @@ -0,0 +1,187 @@ +--- +http_interactions: +- request: + method: post + uri: https://api.blockcypher.com/v1/bcy/test/addrs?token= + body: + encoding: UTF-8 + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 201 + message: Created + headers: + Server: + - nginx/1.11.2 + Date: + - Tue, 25 Oct 2016 06:35:37 GMT + Content-Type: + - application/json + Content-Length: + - '281' + Connection: + - keep-alive + Access-Control-Allow-Headers: + - Origin, X-Requested-With, Content-Type, Accept + Access-Control-Allow-Methods: + - GET, POST, PUT, DELETE + Access-Control-Allow-Origin: + - "*" + X-Ratelimit-Remaining: + - '187' + body: + encoding: UTF-8 + string: |- + { + "private": "bf3f100f90443f6b6dcaa55420bbf8c232978108d8689074c96391a79704ce5b", + "public": "031574fb8e2b683bea793b95d0a8a38d69ecf9a06cd7f643454eb9d4d906fed021", + "address": "BxxtivRxGuCeH5WjwzzRB2iiBtNU3w2qzc", + "wif": "BujnhL4rRfLWZ518JKMgsKNUUHh2MHncJSesauoa1hqSWT1DdsA8" + } + http_version: + recorded_at: Tue, 25 Oct 2016 06:35:37 GMT +- request: + method: post + uri: https://api.blockcypher.com/v1/bcy/test/addrs?token= + body: + encoding: UTF-8 + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 201 + message: Created + headers: + Server: + - nginx/1.9.12 + Date: + - Tue, 25 Oct 2016 06:35:38 GMT + Content-Type: + - application/json + Content-Length: + - '281' + Connection: + - keep-alive + Access-Control-Allow-Headers: + - Origin, X-Requested-With, Content-Type, Accept + Access-Control-Allow-Methods: + - GET, POST, PUT, DELETE + Access-Control-Allow-Origin: + - "*" + X-Ratelimit-Remaining: + - '188' + body: + encoding: UTF-8 + string: |- + { + "private": "cf2bb04f64a634a8c5b672058e08e8adc961ae125df61e7b3f1d468b396d5688", + "public": "03efbdfe061ff6239dec460b0fd9351ef8950040b6208852adcd0a44e710b938ee", + "address": "Bv36KLaVDoa2zEFhrhb6L3MY8Q1wxei9Fk", + "wif": "BvGk5GXxxkU3pSk9gLfDNyQE27DdH4ePypZcg2QRbiaKttMieWBr" + } + http_version: + recorded_at: Tue, 25 Oct 2016 06:35:38 GMT +- request: + method: post + uri: https://api.blockcypher.com/v1/bcy/test/txs/new?token= + body: + encoding: UTF-8 + string: '{"inputs":[{"addresses":["BxxtivRxGuCeH5WjwzzRB2iiBtNU3w2qzc"]}],"outputs":[{"addresses":["Bv36KLaVDoa2zEFhrhb6L3MY8Q1wxei9Fk"],"value":20000}]}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + Content-Type: + - application/json + response: + status: + code: 400 + message: Bad Request + headers: + Server: + - nginx/1.9.12 + Date: + - Tue, 25 Oct 2016 06:35:39 GMT + Content-Type: + - application/json + Content-Length: + - '1217' + Connection: + - keep-alive + Access-Control-Allow-Headers: + - Origin, X-Requested-With, Content-Type, Accept + Access-Control-Allow-Methods: + - GET, POST, PUT, DELETE + Access-Control-Allow-Origin: + - "*" + X-Ratelimit-Remaining: + - '187' + body: + encoding: UTF-8 + string: |- + { + "errors": [ + { + "error": "Unable to find a transaction to spend for address BxxtivRxGuCeH5WjwzzRB2iiBtNU3w2qzc." + }, + { + "error": "Not enough funds in 0 inputs to pay for 1 outputs, missing -20000." + }, + { + "error": "Not enough funds after fees in 0 inputs to pay for 1 outputs, missing -26200." + }, + { + "error": "Error validating generated transaction: Transaction missing input or output." + } + ], + "tx": { + "block_height": -1, + "block_index": -1, + "hash": "0b01cf6dfd07f7fb1ddfd1c3082102b6b2c1dffc4f6ec0c4313cbea29e1e7446", + "addresses": [ + "Bv36KLaVDoa2zEFhrhb6L3MY8Q1wxei9Fk" + ], + "total": 20000, + "fees": 0, + "size": 44, + "preference": "low", + "relayed_by": "49.147.26.15", + "received": "2016-10-25T06:35:39.722334707Z", + "ver": 1, + "lock_time": 0, + "double_spend": false, + "vin_sz": 0, + "vout_sz": 1, + "confirmations": 0, + "inputs": [], + "outputs": [ + { + "value": 20000, + "script": "76a9141fece4093456039701d0574cbdcf61e17c91c71388ac", + "addresses": [ + "Bv36KLaVDoa2zEFhrhb6L3MY8Q1wxei9Fk" + ], + "script_type": "pay-to-pubkey-hash" + } + ] + } + } + http_version: + recorded_at: Tue, 25 Oct 2016 06:35:39 GMT +recorded_with: VCR 3.0.3 diff --git a/spec/fixtures/vcr_cassettes/BlockCypher_Api/_transaction_sign_and_send/should_call_txs/send_api.yml b/spec/fixtures/vcr_cassettes/BlockCypher_Api/_transaction_sign_and_send/should_call_txs/send_api.yml new file mode 100644 index 0000000..39d43d8 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/BlockCypher_Api/_transaction_sign_and_send/should_call_txs/send_api.yml @@ -0,0 +1,187 @@ +--- +http_interactions: +- request: + method: post + uri: https://api.blockcypher.com/v1/bcy/test/addrs?token= + body: + encoding: UTF-8 + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 201 + message: Created + headers: + Server: + - nginx/1.11.2 + Date: + - Tue, 25 Oct 2016 06:35:41 GMT + Content-Type: + - application/json + Content-Length: + - '281' + Connection: + - keep-alive + Access-Control-Allow-Headers: + - Origin, X-Requested-With, Content-Type, Accept + Access-Control-Allow-Methods: + - GET, POST, PUT, DELETE + Access-Control-Allow-Origin: + - "*" + X-Ratelimit-Remaining: + - '186' + body: + encoding: UTF-8 + string: |- + { + "private": "8bae0c4ce609e94254040a942149290548feec158b7f0a60284ff2564f5d02a0", + "public": "0268f766cd3bc58bbef0ebd08a58d00dfa69946c4625b8ad0ca37e3b9b0fdb69a8", + "address": "CA9r6ndZWxUvvmbPYhVn9QHdeRS5ajWKSV", + "wif": "Bt1Ys8KKDx6Ax5EVyvsv87VhhofSHJHFvDpLe79kFw8UrxCa9n9b" + } + http_version: + recorded_at: Tue, 25 Oct 2016 06:35:41 GMT +- request: + method: post + uri: https://api.blockcypher.com/v1/bcy/test/addrs?token= + body: + encoding: UTF-8 + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 201 + message: Created + headers: + Server: + - nginx/1.11.2 + Date: + - Tue, 25 Oct 2016 06:35:42 GMT + Content-Type: + - application/json + Content-Length: + - '281' + Connection: + - keep-alive + Access-Control-Allow-Headers: + - Origin, X-Requested-With, Content-Type, Accept + Access-Control-Allow-Methods: + - GET, POST, PUT, DELETE + Access-Control-Allow-Origin: + - "*" + X-Ratelimit-Remaining: + - '185' + body: + encoding: UTF-8 + string: |- + { + "private": "5862790427c6c3775763c35e37e319c3d4ca37ad94e3263acc37d4e55c3062c8", + "public": "027d4b986f5ced3c011666637bd217cf6568c5d8bf83f47251f50356b1752b58d8", + "address": "CB8yB1Z4hQorCxktksHshHMQNSrqNB51fc", + "wif": "BrHqcfDCjLuqiYWVKKieAmXM1TB89sQdczRQ67sYR7ucpfw9V7Z2" + } + http_version: + recorded_at: Tue, 25 Oct 2016 06:35:42 GMT +- request: + method: post + uri: https://api.blockcypher.com/v1/bcy/test/txs/new?token= + body: + encoding: UTF-8 + string: '{"inputs":[{"addresses":["CA9r6ndZWxUvvmbPYhVn9QHdeRS5ajWKSV"]}],"outputs":[{"addresses":["CB8yB1Z4hQorCxktksHshHMQNSrqNB51fc"],"value":10000}]}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + Content-Type: + - application/json + response: + status: + code: 400 + message: Bad Request + headers: + Server: + - nginx/1.9.12 + Date: + - Tue, 25 Oct 2016 06:35:43 GMT + Content-Type: + - application/json + Content-Length: + - '1216' + Connection: + - keep-alive + Access-Control-Allow-Headers: + - Origin, X-Requested-With, Content-Type, Accept + Access-Control-Allow-Methods: + - GET, POST, PUT, DELETE + Access-Control-Allow-Origin: + - "*" + X-Ratelimit-Remaining: + - '183' + body: + encoding: UTF-8 + string: |- + { + "errors": [ + { + "error": "Unable to find a transaction to spend for address CA9r6ndZWxUvvmbPYhVn9QHdeRS5ajWKSV." + }, + { + "error": "Not enough funds in 0 inputs to pay for 1 outputs, missing -10000." + }, + { + "error": "Not enough funds after fees in 0 inputs to pay for 1 outputs, missing -16200." + }, + { + "error": "Error validating generated transaction: Transaction missing input or output." + } + ], + "tx": { + "block_height": -1, + "block_index": -1, + "hash": "df4f2ee0c21ea6188aef3178c6a2eabb12370fa7b316fc1328ca07bca9402e42", + "addresses": [ + "CB8yB1Z4hQorCxktksHshHMQNSrqNB51fc" + ], + "total": 10000, + "fees": 0, + "size": 44, + "preference": "low", + "relayed_by": "49.147.26.15", + "received": "2016-10-25T06:35:43.52179618Z", + "ver": 1, + "lock_time": 0, + "double_spend": false, + "vin_sz": 0, + "vout_sz": 1, + "confirmations": 0, + "inputs": [], + "outputs": [ + { + "value": 10000, + "script": "76a914c5934f647fed62615424b25cd0dcdb8467ae1b5188ac", + "addresses": [ + "CB8yB1Z4hQorCxktksHshHMQNSrqNB51fc" + ], + "script_type": "pay-to-pubkey-hash" + } + ] + } + } + http_version: + recorded_at: Tue, 25 Oct 2016 06:35:43 GMT +recorded_with: VCR 3.0.3 diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index e61f617..953993e 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -6,5 +6,8 @@ require "blockcypher" SPEC_DIR = Pathname.new(File.dirname(__FILE__)) + +Dir[SPEC_DIR.join("support", "**", "*.rb")].each {|f| require f} + CONFIG_FILE = SPEC_DIR.join("config.yml") CONFIG = YAML.load_file(CONFIG_FILE).with_indifferent_access diff --git a/spec/support/vcr.rb b/spec/support/vcr.rb new file mode 100644 index 0000000..5aec29c --- /dev/null +++ b/spec/support/vcr.rb @@ -0,0 +1,8 @@ +require 'vcr' + +VCR.configure do |config| + config.cassette_library_dir = "spec/fixtures/vcr_cassettes" + config.hook_into :webmock + config.configure_rspec_metadata! + config.filter_sensitive_data("") { CONFIG[:api_token] } +end From 2e4c35b210a851c1ba44fdd0a1dead49ff9e8747 Mon Sep 17 00:00:00 2001 From: Ramon Tayag Date: Tue, 25 Oct 2016 14:42:09 +0800 Subject: [PATCH 6/7] Collapse two #create_forwarding_address specs that tested for options into one --- spec/blockcypher/api_spec.rb | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/spec/blockcypher/api_spec.rb b/spec/blockcypher/api_spec.rb index fa3b532..076384d 100644 --- a/spec/blockcypher/api_spec.rb +++ b/spec/blockcypher/api_spec.rb @@ -74,14 +74,11 @@ module BlockCypher expect(forward_details["input_address"].length).to be(34) # Ok this isn't strictly true but.. end - it 'allows creating a payment forward with a callback' do - forward_details = api.create_forwarding_address(address_1, callback_url: "http://test.com/foo") - expect(forward_details["callback_url"]).to eql("http://test.com/foo") - expect(forward_details["enable_confirmations"]).to be nil - end - - it 'allows creating a payment forward with a callback and confirmation notifications enabled' do - forward_details = api.create_forwarding_address(address_1, callback_url: "http://test.com/foo", enable_confirmations: true) + it 'allows creating a payment forward with options' do + forward_details = api.create_forwarding_address(address_1, { + callback_url: "http://test.com/foo", + enable_confirmations: true, + }) expect(forward_details["callback_url"]).to eql("http://test.com/foo") expect(forward_details["enable_confirmations"]).to be true end From 824832f0758a8ec1e201edc798d31e554c96585f Mon Sep 17 00:00:00 2001 From: Ramon Tayag Date: Tue, 25 Oct 2016 14:47:06 +0800 Subject: [PATCH 7/7] Allow setting of mining_fees_satoshis with create_forwarding_address --- lib/blockcypher/api.rb | 10 +- spec/blockcypher/api_spec.rb | 2 + ...reating_a_payment_forward_with_options.yml | 102 ++++++++++++++++++ 3 files changed, 112 insertions(+), 2 deletions(-) create mode 100644 spec/fixtures/vcr_cassettes/BlockCypher_Api/_create_forwarding_address/allows_creating_a_payment_forward_with_options.yml diff --git a/lib/blockcypher/api.rb b/lib/blockcypher/api.rb index 4a2b6d6..edb74fb 100644 --- a/lib/blockcypher/api.rb +++ b/lib/blockcypher/api.rb @@ -287,11 +287,17 @@ def event_webhook_delete(id) # Payments and Forwarding API ################## - def create_forwarding_address(destination, callback_url: nil, enable_confirmations: false) + def create_forwarding_address( + destination, + callback_url: nil, + enable_confirmations: false, + mining_fees_satoshis: nil + ) payload = { destination: destination, callback_url: callback_url, - enable_confirmations: enable_confirmations + enable_confirmations: enable_confirmations, + mining_fees_satoshis: mining_fees_satoshis, } api_http_post('/payments', json_payload: payload) end diff --git a/spec/blockcypher/api_spec.rb b/spec/blockcypher/api_spec.rb index 076384d..3b32eb6 100644 --- a/spec/blockcypher/api_spec.rb +++ b/spec/blockcypher/api_spec.rb @@ -78,9 +78,11 @@ module BlockCypher forward_details = api.create_forwarding_address(address_1, { callback_url: "http://test.com/foo", enable_confirmations: true, + mining_fees_satoshis: 20_000, }) expect(forward_details["callback_url"]).to eql("http://test.com/foo") expect(forward_details["enable_confirmations"]).to be true + expect(forward_details["mining_fees_satoshis"]).to be 20_000 end it 'is possible to use the alias create_payments_forwarding' do diff --git a/spec/fixtures/vcr_cassettes/BlockCypher_Api/_create_forwarding_address/allows_creating_a_payment_forward_with_options.yml b/spec/fixtures/vcr_cassettes/BlockCypher_Api/_create_forwarding_address/allows_creating_a_payment_forward_with_options.yml new file mode 100644 index 0000000..6e6e87e --- /dev/null +++ b/spec/fixtures/vcr_cassettes/BlockCypher_Api/_create_forwarding_address/allows_creating_a_payment_forward_with_options.yml @@ -0,0 +1,102 @@ +--- +http_interactions: +- request: + method: post + uri: https://api.blockcypher.com/v1/bcy/test/addrs?token= + body: + encoding: UTF-8 + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 201 + message: Created + headers: + Server: + - nginx/1.11.2 + Date: + - Tue, 25 Oct 2016 06:46:13 GMT + Content-Type: + - application/json + Content-Length: + - '281' + Connection: + - keep-alive + Access-Control-Allow-Headers: + - Origin, X-Requested-With, Content-Type, Accept + Access-Control-Allow-Methods: + - GET, POST, PUT, DELETE + Access-Control-Allow-Origin: + - "*" + X-Ratelimit-Remaining: + - '123' + body: + encoding: UTF-8 + string: |- + { + "private": "2b7f65e2e228ac81e699c1bb1c2080cb254f782fe39a9d4420406af4ba6e6d13", + "public": "02d0f59c30f685b9057b533f51d67b5ac1209e9f2392d3a3266fa6924ec224f5c8", + "address": "C5jgwN4gjAh2FyGdjeFi739BvttoFFvtjw", + "wif": "BpnaraVw7KLb9mcLd2FRcBy64ce6DDega1uaFHFJtYMjZdSZW5JF" + } + http_version: + recorded_at: Tue, 25 Oct 2016 06:46:13 GMT +- request: + method: post + uri: https://api.blockcypher.com/v1/bcy/test/payments?token= + body: + encoding: UTF-8 + string: '{"destination":"C5jgwN4gjAh2FyGdjeFi739BvttoFFvtjw","callback_url":"http://test.com/foo","enable_confirmations":true,"mining_fees_satoshis":20000}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + Content-Type: + - application/json + response: + status: + code: 201 + message: Created + headers: + Server: + - nginx/1.9.12 + Date: + - Tue, 25 Oct 2016 06:46:14 GMT + Content-Type: + - application/json + Content-Length: + - '315' + Connection: + - keep-alive + Access-Control-Allow-Headers: + - Origin, X-Requested-With, Content-Type, Accept + Access-Control-Allow-Methods: + - GET, POST, PUT, DELETE + Access-Control-Allow-Origin: + - "*" + X-Ratelimit-Remaining: + - '160' + body: + encoding: UTF-8 + string: |- + { + "id": "fe22b32c-bcf4-43a7-9b15-1d710bfeed1e", + "token": "", + "destination": "C5jgwN4gjAh2FyGdjeFi739BvttoFFvtjw", + "input_address": "C9oBeTobGbwKPXiHUuLEYAYL1kc7KTXqyH", + "enable_confirmations": true, + "mining_fees_satoshis": 20000, + "callback_url": "http://test.com/foo" + } + http_version: + recorded_at: Tue, 25 Oct 2016 06:46:14 GMT +recorded_with: VCR 3.0.3