cryptocoin_payable 1.0.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 (103) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +5 -0
  3. data/.rspec +1 -0
  4. data/.rubocop.yml +36 -0
  5. data/Gemfile +8 -0
  6. data/LICENSE.txt +22 -0
  7. data/README.md +237 -0
  8. data/Rakefile +3 -0
  9. data/bin/console +15 -0
  10. data/bin/setup +8 -0
  11. data/cryptocoin_payable.gemspec +39 -0
  12. data/features/coin_payments.feature +51 -0
  13. data/features/default.feature +5 -0
  14. data/features/pricing_processor.feature +4 -0
  15. data/features/step_definitions/coin_payment_steps.rb +45 -0
  16. data/features/step_definitions/currency_conversion_steps.rb +12 -0
  17. data/features/step_definitions/model_step.rb +11 -0
  18. data/features/step_definitions/processor_steps.rb +7 -0
  19. data/features/step_definitions/widget_steps.rb +3 -0
  20. data/features/support/env.rb +26 -0
  21. data/lib/cryptocoin_payable/adapters/base.rb +99 -0
  22. data/lib/cryptocoin_payable/adapters/bitcoin.rb +93 -0
  23. data/lib/cryptocoin_payable/adapters/bitcoin_cash.rb +34 -0
  24. data/lib/cryptocoin_payable/adapters/ethereum.rb +77 -0
  25. data/lib/cryptocoin_payable/adapters.rb +27 -0
  26. data/lib/cryptocoin_payable/coin_payment.rb +141 -0
  27. data/lib/cryptocoin_payable/coin_payment_transaction.rb +5 -0
  28. data/lib/cryptocoin_payable/commands/payment_processor.rb +67 -0
  29. data/lib/cryptocoin_payable/commands/pricing_processor.rb +43 -0
  30. data/lib/cryptocoin_payable/config.rb +65 -0
  31. data/lib/cryptocoin_payable/currency_conversion.rb +11 -0
  32. data/lib/cryptocoin_payable/errors.rb +7 -0
  33. data/lib/cryptocoin_payable/has_coin_payments.rb +15 -0
  34. data/lib/cryptocoin_payable/tasks.rb +20 -0
  35. data/lib/cryptocoin_payable/version.rb +3 -0
  36. data/lib/cryptocoin_payable.rb +18 -0
  37. data/lib/generators/cryptocoin_payable/install_generator.rb +27 -0
  38. data/lib/generators/cryptocoin_payable/templates/create_coin_payment_transactions.rb +16 -0
  39. data/lib/generators/cryptocoin_payable/templates/create_coin_payments.rb +19 -0
  40. data/lib/generators/cryptocoin_payable/templates/create_currency_conversions.rb +11 -0
  41. data/spec/acceptance/adapters/bitcoin_cash_spec.rb +54 -0
  42. data/spec/acceptance/adapters/bitcoin_spec.rb +79 -0
  43. data/spec/acceptance/adapters/ethereum_spec.rb +77 -0
  44. data/spec/dummy/README.rdoc +28 -0
  45. data/spec/dummy/Rakefile +6 -0
  46. data/spec/dummy/app/assets/images/.keep +0 -0
  47. data/spec/dummy/app/assets/javascripts/application.js +13 -0
  48. data/spec/dummy/app/assets/stylesheets/application.css +13 -0
  49. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  50. data/spec/dummy/app/controllers/concerns/.keep +0 -0
  51. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  52. data/spec/dummy/app/mailers/.keep +0 -0
  53. data/spec/dummy/app/models/.keep +0 -0
  54. data/spec/dummy/app/models/concerns/.keep +0 -0
  55. data/spec/dummy/app/models/widget.rb +3 -0
  56. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  57. data/spec/dummy/bin/bundle +3 -0
  58. data/spec/dummy/bin/rails +4 -0
  59. data/spec/dummy/bin/rake +4 -0
  60. data/spec/dummy/config/application.rb +22 -0
  61. data/spec/dummy/config/boot.rb +5 -0
  62. data/spec/dummy/config/database.yml +25 -0
  63. data/spec/dummy/config/environment.rb +5 -0
  64. data/spec/dummy/config/environments/development.rb +29 -0
  65. data/spec/dummy/config/environments/production.rb +80 -0
  66. data/spec/dummy/config/environments/test.rb +36 -0
  67. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  68. data/spec/dummy/config/initializers/cryptocoin_payable.rb +23 -0
  69. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  70. data/spec/dummy/config/initializers/inflections.rb +16 -0
  71. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  72. data/spec/dummy/config/initializers/secret_token.rb +14 -0
  73. data/spec/dummy/config/initializers/session_store.rb +3 -0
  74. data/spec/dummy/config/initializers/state_machine.rb +10 -0
  75. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  76. data/spec/dummy/config/locales/en.yml +23 -0
  77. data/spec/dummy/config/routes.rb +56 -0
  78. data/spec/dummy/config.ru +4 -0
  79. data/spec/dummy/db/development.sqlite3 +0 -0
  80. data/spec/dummy/db/migrate/20140510023211_create_widgets.rb +5 -0
  81. data/spec/dummy/db/migrate/20171227225132_create_coin_payments.rb +19 -0
  82. data/spec/dummy/db/migrate/20171227225133_create_coin_payment_transactions.rb +16 -0
  83. data/spec/dummy/db/migrate/20171227225134_create_currency_conversions.rb +11 -0
  84. data/spec/dummy/db/schema.rb +54 -0
  85. data/spec/dummy/lib/assets/.keep +0 -0
  86. data/spec/dummy/log/.keep +0 -0
  87. data/spec/dummy/public/404.html +58 -0
  88. data/spec/dummy/public/422.html +58 -0
  89. data/spec/dummy/public/500.html +57 -0
  90. data/spec/dummy/public/favicon.ico +0 -0
  91. data/spec/dummy/test/fixtures/widgets.yml +11 -0
  92. data/spec/dummy/test/models/widget_test.rb +7 -0
  93. data/spec/fixtures/vcr_cassettes/CryptocoinPayable_Adapters_Bitcoin/gets_an_empty_result_when_no_transactions_found.yml +67 -0
  94. data/spec/fixtures/vcr_cassettes/CryptocoinPayable_Adapters_Bitcoin/gets_transactions_for_a_given_address.yml +73 -0
  95. data/spec/fixtures/vcr_cassettes/CryptocoinPayable_Adapters_Bitcoin/raises_an_error_when_an_invalid_address_is_passed.yml +103 -0
  96. data/spec/fixtures/vcr_cassettes/CryptocoinPayable_Adapters_Bitcoin/when_the_Block_Explorer_API_fails/falls_back_to_using_the_BlockCypher_API.yml +171 -0
  97. data/spec/fixtures/vcr_cassettes/CryptocoinPayable_Adapters_BitcoinCash/gets_an_empty_result_when_no_transactions_found.yml +62 -0
  98. data/spec/fixtures/vcr_cassettes/CryptocoinPayable_Adapters_BitcoinCash/gets_transactions_for_a_given_address.yml +65 -0
  99. data/spec/fixtures/vcr_cassettes/CryptocoinPayable_Adapters_Ethereum/gets_an_empty_result_when_no_transactions_found.yml +44 -0
  100. data/spec/fixtures/vcr_cassettes/CryptocoinPayable_Adapters_Ethereum/gets_transactions_for_a_given_address.yml +44 -0
  101. data/spec/fixtures/vcr_cassettes/CryptocoinPayable_Adapters_Ethereum/raises_an_error_when_an_invalid_address_is_passed.yml +44 -0
  102. data/spec/spec_helper.rb +112 -0
  103. metadata +428 -0
@@ -0,0 +1,14 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key is used for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+
6
+ # Make sure the secret is at least 30 characters and all random,
7
+ # no regular words or you'll be exposed to dictionary attacks.
8
+ # You can use `rake secret` to generate a secure secret key.
9
+
10
+ # Make sure your secret_key_base is kept private
11
+ # if you're sharing your code publicly.
12
+ # rubocop:disable Metrics/LineLength
13
+ Dummy::Application.config.secret_key_base = '138c9dde72de8eb2544bc525694ea35b9cf95cb3703796f4c1863593c46838206cf9a0fb1872729d14c1fcf59cf22690c3777e9f66e15a30603a75f78da01498'
14
+ # rubocop:enable Metrics/LineLength
@@ -0,0 +1,3 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Dummy::Application.config.session_store :cookie_store, key: '_dummy_session'
@@ -0,0 +1,10 @@
1
+ module StateMachine
2
+ module Integrations
3
+ module ActiveModel
4
+ alias around_validation_protected around_validation
5
+ def around_validation(*args, &block)
6
+ around_validation_protected(*args, &block)
7
+ end
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,14 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # This file contains settings for ActionController::ParamsWrapper which
4
+ # is enabled by default.
5
+
6
+ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
+ ActiveSupport.on_load(:action_controller) do
8
+ wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
9
+ end
10
+
11
+ # To enable root element in JSON for ActiveRecord objects.
12
+ # ActiveSupport.on_load(:active_record) do
13
+ # self.include_root_in_json = true
14
+ # end
@@ -0,0 +1,23 @@
1
+ # Files in the config/locales directory are used for internationalization
2
+ # and are automatically loaded by Rails. If you want to use locales other
3
+ # than English, add the necessary files in this directory.
4
+ #
5
+ # To use the locales, use `I18n.t`:
6
+ #
7
+ # I18n.t 'hello'
8
+ #
9
+ # In views, this is aliased to just `t`:
10
+ #
11
+ # <%= t('hello') %>
12
+ #
13
+ # To use a different locale, set it with `I18n.locale`:
14
+ #
15
+ # I18n.locale = :es
16
+ #
17
+ # This would use the information in config/locales/es.yml.
18
+ #
19
+ # To learn more, please read the Rails Internationalization guide
20
+ # available at http://guides.rubyonrails.org/i18n.html.
21
+
22
+ en:
23
+ hello: "Hello world"
@@ -0,0 +1,56 @@
1
+ Dummy::Application.routes.draw do
2
+ # The priority is based upon order of creation: first created -> highest priority.
3
+ # See how all your routes lay out with "rake routes".
4
+
5
+ # You can have the root of your site routed with "root"
6
+ # root 'welcome#index'
7
+
8
+ # Example of regular route:
9
+ # get 'products/:id' => 'catalog#view'
10
+
11
+ # Example of named route that can be invoked with purchase_url(id: product.id)
12
+ # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase
13
+
14
+ # Example resource route (maps HTTP verbs to controller actions automatically):
15
+ # resources :products
16
+
17
+ # Example resource route with options:
18
+ # resources :products do
19
+ # member do
20
+ # get 'short'
21
+ # post 'toggle'
22
+ # end
23
+ #
24
+ # collection do
25
+ # get 'sold'
26
+ # end
27
+ # end
28
+
29
+ # Example resource route with sub-resources:
30
+ # resources :products do
31
+ # resources :comments, :sales
32
+ # resource :seller
33
+ # end
34
+
35
+ # Example resource route with more complex sub-resources:
36
+ # resources :products do
37
+ # resources :comments
38
+ # resources :sales do
39
+ # get 'recent', on: :collection
40
+ # end
41
+ # end
42
+
43
+ # Example resource route with concerns:
44
+ # concern :toggleable do
45
+ # post 'toggle'
46
+ # end
47
+ # resources :posts, concerns: :toggleable
48
+ # resources :photos, concerns: :toggleable
49
+
50
+ # Example resource route within a namespace:
51
+ # namespace :admin do
52
+ # # Directs /admin/products/* to Admin::ProductsController
53
+ # # (app/controllers/admin/products_controller.rb)
54
+ # resources :products
55
+ # end
56
+ end
@@ -0,0 +1,4 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require File.expand_path('config/environment', __dir__)
4
+ run Rails.application
Binary file
@@ -0,0 +1,5 @@
1
+ class CreateWidgets < ActiveRecord::Migration[5.1]
2
+ def change
3
+ create_table :widgets, &:timestamps
4
+ end
5
+ end
@@ -0,0 +1,19 @@
1
+ class CreateCoinPayments < ActiveRecord::Migration[5.1]
2
+ def change
3
+ create_table :coin_payments do |t|
4
+ t.string :payable_type
5
+ t.integer :coin_type
6
+ t.integer :payable_id
7
+ t.string :currency
8
+ t.string :reason
9
+ t.integer :price, limit: 8
10
+ t.decimal :coin_amount_due, default: 0, precision: 24, scale: 0
11
+ t.string :address
12
+ t.string :state, default: 'pending'
13
+ t.datetime :created_at
14
+ t.datetime :updated_at
15
+ t.decimal :coin_conversion, precision: 24, scale: 0
16
+ end
17
+ add_index :coin_payments, %i[payable_type payable_id]
18
+ end
19
+ end
@@ -0,0 +1,16 @@
1
+ class CreateCoinPaymentTransactions < ActiveRecord::Migration[5.1]
2
+ def change
3
+ create_table :coin_payment_transactions do |t|
4
+ t.decimal :estimated_value, precision: 24, scale: 0
5
+ t.string :transaction_hash
6
+ t.string :block_hash
7
+ t.datetime :block_time
8
+ t.datetime :estimated_time
9
+ t.integer :coin_payment_id
10
+ t.decimal :coin_conversion, precision: 24, scale: 0
11
+ t.integer :confirmations, default: 0
12
+ end
13
+
14
+ add_index :coin_payment_transactions, :coin_payment_id
15
+ end
16
+ end
@@ -0,0 +1,11 @@
1
+ class CreateCurrencyConversions < ActiveRecord::Migration[5.1]
2
+ def change
3
+ create_table :currency_conversions do |t|
4
+ t.integer :currency
5
+ t.decimal :price, precision: 24, scale: 0
6
+ t.integer :coin_type
7
+ t.datetime :created_at
8
+ t.datetime :updated_at
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,54 @@
1
+ # This file is auto-generated from the current state of the database. Instead
2
+ # of editing this file, please use the migrations feature of Active Record to
3
+ # incrementally modify your database, and then regenerate this schema definition.
4
+ #
5
+ # Note that this schema.rb definition is the authoritative source for your
6
+ # database schema. If you need to create the application database on another
7
+ # system, you should be using db:schema:load, not running all the migrations
8
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
9
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
10
+ #
11
+ # It's strongly recommended that you check this file into your version control system.
12
+
13
+ ActiveRecord::Schema.define(version: 20_171_227_225_134) do
14
+ create_table 'coin_payment_transactions', force: :cascade do |t|
15
+ t.decimal 'estimated_value', precision: 24
16
+ t.string 'transaction_hash'
17
+ t.string 'block_hash'
18
+ t.datetime 'block_time'
19
+ t.datetime 'estimated_time'
20
+ t.integer 'coin_payment_id'
21
+ t.decimal 'coin_conversion', precision: 24
22
+ t.integer 'confirmations', default: 0
23
+ t.index ['coin_payment_id'], name: 'index_coin_payment_transactions_on_coin_payment_id'
24
+ end
25
+
26
+ create_table 'coin_payments', force: :cascade do |t|
27
+ t.string 'payable_type'
28
+ t.integer 'coin_type'
29
+ t.integer 'payable_id'
30
+ t.string 'currency'
31
+ t.string 'reason'
32
+ t.integer 'price', limit: 8
33
+ t.decimal 'coin_amount_due', precision: 24, default: '0'
34
+ t.string 'address'
35
+ t.string 'state', default: 'pending'
36
+ t.datetime 'created_at'
37
+ t.datetime 'updated_at'
38
+ t.decimal 'coin_conversion', precision: 24
39
+ t.index %w[payable_type payable_id], name: 'index_coin_payments_on_payable_type_and_payable_id'
40
+ end
41
+
42
+ create_table 'currency_conversions', force: :cascade do |t|
43
+ t.integer 'currency'
44
+ t.decimal 'price', precision: 24
45
+ t.integer 'coin_type'
46
+ t.datetime 'created_at'
47
+ t.datetime 'updated_at'
48
+ end
49
+
50
+ create_table 'widgets', force: :cascade do |t|
51
+ t.datetime 'created_at', null: false
52
+ t.datetime 'updated_at', null: false
53
+ end
54
+ end
File without changes
File without changes
@@ -0,0 +1,58 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <style>
6
+ body {
7
+ background-color: #EFEFEF;
8
+ color: #2E2F30;
9
+ text-align: center;
10
+ font-family: arial, sans-serif;
11
+ }
12
+
13
+ div.dialog {
14
+ width: 25em;
15
+ margin: 4em auto 0 auto;
16
+ border: 1px solid #CCC;
17
+ border-right-color: #999;
18
+ border-left-color: #999;
19
+ border-bottom-color: #BBB;
20
+ border-top: #B00100 solid 4px;
21
+ border-top-left-radius: 9px;
22
+ border-top-right-radius: 9px;
23
+ background-color: white;
24
+ padding: 7px 4em 0 4em;
25
+ }
26
+
27
+ h1 {
28
+ font-size: 100%;
29
+ color: #730E15;
30
+ line-height: 1.5em;
31
+ }
32
+
33
+ body > p {
34
+ width: 33em;
35
+ margin: 0 auto 1em;
36
+ padding: 1em 0;
37
+ background-color: #F7F7F7;
38
+ border: 1px solid #CCC;
39
+ border-right-color: #999;
40
+ border-bottom-color: #999;
41
+ border-bottom-left-radius: 4px;
42
+ border-bottom-right-radius: 4px;
43
+ border-top-color: #DADADA;
44
+ color: #666;
45
+ box-shadow:0 3px 8px rgba(50, 50, 50, 0.17);
46
+ }
47
+ </style>
48
+ </head>
49
+
50
+ <body>
51
+ <!-- This file lives in public/404.html -->
52
+ <div class="dialog">
53
+ <h1>The page you were looking for doesn't exist.</h1>
54
+ <p>You may have mistyped the address or the page may have moved.</p>
55
+ </div>
56
+ <p>If you are the application owner check the logs for more information.</p>
57
+ </body>
58
+ </html>
@@ -0,0 +1,58 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <style>
6
+ body {
7
+ background-color: #EFEFEF;
8
+ color: #2E2F30;
9
+ text-align: center;
10
+ font-family: arial, sans-serif;
11
+ }
12
+
13
+ div.dialog {
14
+ width: 25em;
15
+ margin: 4em auto 0 auto;
16
+ border: 1px solid #CCC;
17
+ border-right-color: #999;
18
+ border-left-color: #999;
19
+ border-bottom-color: #BBB;
20
+ border-top: #B00100 solid 4px;
21
+ border-top-left-radius: 9px;
22
+ border-top-right-radius: 9px;
23
+ background-color: white;
24
+ padding: 7px 4em 0 4em;
25
+ }
26
+
27
+ h1 {
28
+ font-size: 100%;
29
+ color: #730E15;
30
+ line-height: 1.5em;
31
+ }
32
+
33
+ body > p {
34
+ width: 33em;
35
+ margin: 0 auto 1em;
36
+ padding: 1em 0;
37
+ background-color: #F7F7F7;
38
+ border: 1px solid #CCC;
39
+ border-right-color: #999;
40
+ border-bottom-color: #999;
41
+ border-bottom-left-radius: 4px;
42
+ border-bottom-right-radius: 4px;
43
+ border-top-color: #DADADA;
44
+ color: #666;
45
+ box-shadow:0 3px 8px rgba(50, 50, 50, 0.17);
46
+ }
47
+ </style>
48
+ </head>
49
+
50
+ <body>
51
+ <!-- This file lives in public/422.html -->
52
+ <div class="dialog">
53
+ <h1>The change you wanted was rejected.</h1>
54
+ <p>Maybe you tried to change something you didn't have access to.</p>
55
+ </div>
56
+ <p>If you are the application owner check the logs for more information.</p>
57
+ </body>
58
+ </html>
@@ -0,0 +1,57 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <style>
6
+ body {
7
+ background-color: #EFEFEF;
8
+ color: #2E2F30;
9
+ text-align: center;
10
+ font-family: arial, sans-serif;
11
+ }
12
+
13
+ div.dialog {
14
+ width: 25em;
15
+ margin: 4em auto 0 auto;
16
+ border: 1px solid #CCC;
17
+ border-right-color: #999;
18
+ border-left-color: #999;
19
+ border-bottom-color: #BBB;
20
+ border-top: #B00100 solid 4px;
21
+ border-top-left-radius: 9px;
22
+ border-top-right-radius: 9px;
23
+ background-color: white;
24
+ padding: 7px 4em 0 4em;
25
+ }
26
+
27
+ h1 {
28
+ font-size: 100%;
29
+ color: #730E15;
30
+ line-height: 1.5em;
31
+ }
32
+
33
+ body > p {
34
+ width: 33em;
35
+ margin: 0 auto 1em;
36
+ padding: 1em 0;
37
+ background-color: #F7F7F7;
38
+ border: 1px solid #CCC;
39
+ border-right-color: #999;
40
+ border-bottom-color: #999;
41
+ border-bottom-left-radius: 4px;
42
+ border-bottom-right-radius: 4px;
43
+ border-top-color: #DADADA;
44
+ color: #666;
45
+ box-shadow:0 3px 8px rgba(50, 50, 50, 0.17);
46
+ }
47
+ </style>
48
+ </head>
49
+
50
+ <body>
51
+ <!-- This file lives in public/500.html -->
52
+ <div class="dialog">
53
+ <h1>We're sorry, but something went wrong.</h1>
54
+ </div>
55
+ <p>If you are the application owner check the logs for more information.</p>
56
+ </body>
57
+ </html>
File without changes
@@ -0,0 +1,11 @@
1
+ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2
+
3
+ # This model initially had no columns defined. If you add columns to the
4
+ # model remove the '{}' from the fixture names and add the columns immediately
5
+ # below each fixture, per the syntax in the comments below
6
+ #
7
+ one: {}
8
+ # column: value
9
+ #
10
+ two: {}
11
+ # column: value
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class WidgetTest < ActiveSupport::TestCase
4
+ # test "the truth" do
5
+ # assert true
6
+ # end
7
+ end
@@ -0,0 +1,67 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://blockexplorer.com/api/txs/?address=1twtr17A65VAPhJDJRxhoMSpLBTR5Xy44
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - "*/*"
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Date:
22
+ - Sun, 14 Oct 2018 10:35:50 GMT
23
+ Content-Type:
24
+ - application/json; charset=utf-8
25
+ Content-Length:
26
+ - '25'
27
+ Connection:
28
+ - keep-alive
29
+ Set-Cookie:
30
+ - __cfduid=d47ff8371481605e635f17b28a5748d871539513349; expires=Mon, 14-Oct-19
31
+ 10:35:49 GMT; path=/; domain=.blockexplorer.com; HttpOnly; Secure
32
+ X-Powered-By:
33
+ - Express
34
+ X-Ratelimit-Limit:
35
+ - '10800'
36
+ X-Ratelimit-Remaining:
37
+ - '10788'
38
+ Access-Control-Allow-Origin:
39
+ - "*"
40
+ Access-Control-Allow-Methods:
41
+ - GET, HEAD, PUT, POST, OPTIONS
42
+ Access-Control-Allow-Headers:
43
+ - Origin, X-Requested-With, Content-Type, Accept, Content-Length, Cache-Control,
44
+ cf-connecting-ip
45
+ Cache-Control:
46
+ - public, max-age=30
47
+ X-Content-Type-Options:
48
+ - nosniff
49
+ - nosniff
50
+ Etag:
51
+ - W/"19-ateSR7OFd51Y/7Qm9D9BXg"
52
+ Vary:
53
+ - Accept-Encoding
54
+ Cf-Cache-Status:
55
+ - MISS
56
+ Expect-Ct:
57
+ - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
58
+ Server:
59
+ - cloudflare
60
+ Cf-Ray:
61
+ - 469966c21862c338-SIN
62
+ body:
63
+ encoding: UTF-8
64
+ string: '{"pagesTotal":0,"txs":[]}'
65
+ http_version:
66
+ recorded_at: Sun, 14 Oct 2018 10:35:52 GMT
67
+ recorded_with: VCR 4.0.0
@@ -0,0 +1,73 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://blockexplorer.com/api/txs/?address=3HR9xYD7MybbE7JLVTjwijYse48BtfEKni
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - "*/*"
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Date:
22
+ - Sun, 14 Oct 2018 10:35:49 GMT
23
+ Content-Type:
24
+ - application/json; charset=utf-8
25
+ Transfer-Encoding:
26
+ - chunked
27
+ Connection:
28
+ - keep-alive
29
+ Set-Cookie:
30
+ - __cfduid=dfbf39137c18550c63fcc8c85bee8b7e41539513348; expires=Mon, 14-Oct-19
31
+ 10:35:48 GMT; path=/; domain=.blockexplorer.com; HttpOnly; Secure
32
+ X-Powered-By:
33
+ - Express
34
+ X-Ratelimit-Limit:
35
+ - '10800'
36
+ X-Ratelimit-Remaining:
37
+ - '10789'
38
+ Access-Control-Allow-Origin:
39
+ - "*"
40
+ Access-Control-Allow-Methods:
41
+ - GET, HEAD, PUT, POST, OPTIONS
42
+ Access-Control-Allow-Headers:
43
+ - Origin, X-Requested-With, Content-Type, Accept, Content-Length, Cache-Control,
44
+ cf-connecting-ip
45
+ Cache-Control:
46
+ - public, max-age=30
47
+ X-Content-Type-Options:
48
+ - nosniff
49
+ - nosniff
50
+ Etag:
51
+ - W/"d6f-oVIhbGDsjzojZRPbIeFCTg"
52
+ Vary:
53
+ - Accept-Encoding
54
+ Cf-Cache-Status:
55
+ - EXPIRED
56
+ Expect-Ct:
57
+ - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
58
+ Server:
59
+ - cloudflare
60
+ Cf-Ray:
61
+ - 469966babf93c347-SIN
62
+ body:
63
+ encoding: ASCII-8BIT
64
+ string: '{"pagesTotal":1,"txs":[{"txid":"5bdeaf7829148d7e0e1e7b5233512a2c5ae54ef7ccbc8e68b2f85b7e49c917a0","version":1,"locktime":0,"vin":[{"txid":"252dde616fbbd25ebaf37ee8df82c38d2135a87100cc1f0315797b1b42f52f01","vout":0,"scriptSig":{"asm":"304402206b40298326b6c4ab181c4c61b43569490e91773997c0ec53309ab01851098c1002202731263d747aba117b65aaf7d5ee0ad5e88c2e3b4dc3e47d6ecc414e3bbb38e8[ALL]
65
+ 02027fcba75d05e735e734d9287c3b22b90465e30ee87ff064303b8175ddeb48fa","hex":"47304402206b40298326b6c4ab181c4c61b43569490e91773997c0ec53309ab01851098c1002202731263d747aba117b65aaf7d5ee0ad5e88c2e3b4dc3e47d6ecc414e3bbb38e8012102027fcba75d05e735e734d9287c3b22b90465e30ee87ff064303b8175ddeb48fa"},"sequence":4294967295,"n":0,"addr":"1CJzCcrY9WarJ5nZCcfbNu2eAnuHqSGqJP","valueSat":826658803,"value":8.26658803,"doubleSpentTxID":null}],"vout":[{"value":"4.99000000","n":0,"scriptPubKey":{"hex":"a914ac82105dbe13eb1b2b606b8fa4e58ced5b317ceb87","asm":"OP_HASH160
66
+ ac82105dbe13eb1b2b606b8fa4e58ced5b317ceb OP_EQUAL","addresses":["3HR9xYD7MybbE7JLVTjwijYse48BtfEKni"],"type":"scripthash"},"spentTxId":null,"spentIndex":null,"spentHeight":null},{"value":"3.27645063","n":1,"scriptPubKey":{"hex":"76a9147dfed19339f4a44a5a9888448ebb270656e2919488ac","asm":"OP_DUP
67
+ OP_HASH160 7dfed19339f4a44a5a9888448ebb270656e29194 OP_EQUALVERIFY OP_CHECKSIG","addresses":["1CVCj6B2Q4DJ1rFEhaXDdcEcaQQho37yrT"],"type":"pubkeyhash"},"spentTxId":"08aee92c75baa331b66aaf8ad27fdaea80053f3fdb090112ce332983cb63de00","spentIndex":3,"spentHeight":432992}],"blockhash":"0000000000000000048e8ea3fdd2c3a59ddcbcf7575f82cb96ce9fd17da9f2f4","blockheight":429632,"confirmations":116077,"time":1473781260,"blocktime":1473781260,"valueOut":8.26645063,"size":223,"valueIn":8.26658803,"fees":0.0001374},{"txid":"e7bcdb13d9c903973bd8a740054d4c056a559bae67d4e8f6d0a42b4bab552623","version":1,"locktime":0,"vin":[{"txid":"e5c2d3a1ffa653121e38d051274dcbfde19ec53ed13d5e4eba54fdf77e8fbf60","vout":0,"scriptSig":{"asm":"304402201d1d8197bd319e43ca5931023dad0bd4fbcd5d941f7bbf51e5ea6390bdf59c3702202303a697a6f722a90981e3fd1d7f0f27d397de3e1ee601e0f681ec933b809ccd[ALL]
68
+ 028ee20d4ea0b72c78caf36b803a79e5a315c61f6d76193130699040cded33ad90","hex":"47304402201d1d8197bd319e43ca5931023dad0bd4fbcd5d941f7bbf51e5ea6390bdf59c3702202303a697a6f722a90981e3fd1d7f0f27d397de3e1ee601e0f681ec933b809ccd0121028ee20d4ea0b72c78caf36b803a79e5a315c61f6d76193130699040cded33ad90"},"sequence":4294967295,"n":0,"addr":"1GWPE3nEHHLY6C5U4c6qj3wxZvx4hiVDxZ","valueSat":465006260,"value":4.6500626,"doubleSpentTxID":null}],"vout":[{"value":"4.63992520","n":0,"scriptPubKey":{"hex":"76a9141a984f5195f48bcd9995ec4bb5ed5a386a10dfdf88ac","asm":"OP_DUP
69
+ OP_HASH160 1a984f5195f48bcd9995ec4bb5ed5a386a10dfdf OP_EQUALVERIFY OP_CHECKSIG","addresses":["13Rd2fKcsUQ9eChqMZGprGeo8XAMAsQhMV"],"type":"pubkeyhash"},"spentTxId":"5c9864d21dca5bd4715a5489fad9e51dbdcde1588e03d58ddbbbcabc0de54e32","spentIndex":0,"spentHeight":429716},{"value":"0.01000000","n":1,"scriptPubKey":{"hex":"a914ac82105dbe13eb1b2b606b8fa4e58ced5b317ceb87","asm":"OP_HASH160
70
+ ac82105dbe13eb1b2b606b8fa4e58ced5b317ceb OP_EQUAL","addresses":["3HR9xYD7MybbE7JLVTjwijYse48BtfEKni"],"type":"scripthash"},"spentTxId":null,"spentIndex":null,"spentHeight":null}],"blockhash":"000000000000000001af27feb303ad97af81a5882157f166781784c639f8e896","blockheight":429629,"confirmations":116080,"time":1473780162,"blocktime":1473780162,"valueOut":4.6499252,"size":223,"valueIn":4.6500626,"fees":0.0001374}]}'
71
+ http_version:
72
+ recorded_at: Sun, 14 Oct 2018 10:35:51 GMT
73
+ recorded_with: VCR 4.0.0