bitstamp-rbtc-arbitrage 0.4.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.
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --format progress
@@ -0,0 +1 @@
1
+ bitstamp
@@ -0,0 +1 @@
1
+ ruby-1.9.3
data/Gemfile ADDED
@@ -0,0 +1,26 @@
1
+ ruby '1.9.3'
2
+
3
+ source "http://rubygems.org"
4
+ # Add dependencies required to use your gem here.
5
+ # Example:
6
+ # gem "activesupport", ">= 2.3.5"
7
+ gem "activemodel", ">= 3.1"
8
+ gem "activesupport"#, ">= 3.1"
9
+ gem 'curb', '> 0.8.1'
10
+ gem "ruby-hmac", "0.4.0"
11
+ gem "i18n", "0.6.9"
12
+ gem 'tzinfo'
13
+
14
+ # Add dependencies to develop your gem here.
15
+ # Include everything needed to run rake, tests, features, etc.
16
+ group :development do
17
+ gem "rspec", ">= 0"
18
+ gem "rdoc", "~> 3.12"
19
+ # gem "bundler", "~> 1.3.5"
20
+ gem "jeweler"
21
+ end
22
+
23
+ group :test do
24
+ gem "vcr", "2.6.0"
25
+ gem "webmock", "1.13.0"
26
+ end
@@ -0,0 +1,94 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ activemodel (4.0.0.beta1)
5
+ activesupport (= 4.0.0.beta1)
6
+ builder (~> 3.1.0)
7
+ activesupport (4.0.0.beta1)
8
+ i18n (~> 0.6.2)
9
+ minitest (~> 4.2)
10
+ multi_json (~> 1.3)
11
+ thread_safe (~> 0.1)
12
+ tzinfo (~> 0.3.33)
13
+ addressable (2.3.5)
14
+ builder (3.1.4)
15
+ crack (0.4.1)
16
+ safe_yaml (~> 0.9.0)
17
+ curb (0.8.3)
18
+ descendants_tracker (0.0.4)
19
+ thread_safe (~> 0.3, >= 0.3.1)
20
+ diff-lcs (1.2.4)
21
+ faraday (0.9.0)
22
+ multipart-post (>= 1.2, < 3)
23
+ git (1.2.7)
24
+ github_api (0.11.3)
25
+ addressable (~> 2.3)
26
+ descendants_tracker (~> 0.0.1)
27
+ faraday (~> 0.8, < 0.10)
28
+ hashie (>= 1.2)
29
+ multi_json (>= 1.7.5, < 2.0)
30
+ nokogiri (~> 1.6.0)
31
+ oauth2
32
+ hashie (3.2.0)
33
+ highline (1.6.21)
34
+ i18n (0.6.9)
35
+ jeweler (2.0.1)
36
+ builder
37
+ bundler (>= 1.0)
38
+ git (>= 1.2.5)
39
+ github_api
40
+ highline (>= 1.6.15)
41
+ nokogiri (>= 1.5.10)
42
+ rake
43
+ rdoc
44
+ json (1.8.1)
45
+ jwt (1.0.0)
46
+ mini_portile (0.6.0)
47
+ minitest (4.7.5)
48
+ multi_json (1.10.1)
49
+ multi_xml (0.5.5)
50
+ multipart-post (2.0.0)
51
+ nokogiri (1.6.2.1)
52
+ mini_portile (= 0.6.0)
53
+ oauth2 (1.0.0)
54
+ faraday (>= 0.8, < 0.10)
55
+ jwt (~> 1.0)
56
+ multi_json (~> 1.3)
57
+ multi_xml (~> 0.5)
58
+ rack (~> 1.2)
59
+ rack (1.5.2)
60
+ rake (10.3.2)
61
+ rdoc (3.12.2)
62
+ json (~> 1.4)
63
+ rspec (2.13.0)
64
+ rspec-core (~> 2.13.0)
65
+ rspec-expectations (~> 2.13.0)
66
+ rspec-mocks (~> 2.13.0)
67
+ rspec-core (2.13.1)
68
+ rspec-expectations (2.13.0)
69
+ diff-lcs (>= 1.1.3, < 2.0)
70
+ rspec-mocks (2.13.1)
71
+ ruby-hmac (0.4.0)
72
+ safe_yaml (0.9.7)
73
+ thread_safe (0.3.4)
74
+ tzinfo (0.3.39)
75
+ vcr (2.6.0)
76
+ webmock (1.13.0)
77
+ addressable (>= 2.2.7)
78
+ crack (>= 0.3.2)
79
+
80
+ PLATFORMS
81
+ ruby
82
+
83
+ DEPENDENCIES
84
+ activemodel (>= 3.1)
85
+ activesupport
86
+ curb (> 0.8.1)
87
+ i18n (= 0.6.9)
88
+ jeweler
89
+ rdoc (~> 3.12)
90
+ rspec
91
+ ruby-hmac (= 0.4.0)
92
+ tzinfo
93
+ vcr (= 2.6.0)
94
+ webmock (= 1.13.0)
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2013 Kojn
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,96 @@
1
+ # Bitstamp Ruby API
2
+
3
+ Feel free to fork, modify & redistribute under the MIT license.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'bitstamp'
10
+
11
+ ## Create API Key
12
+
13
+ More info at: [https://www.bitstamp.net/article/api-key-implementation/](https://www.bitstamp.net/article/api-key-implementation/)
14
+
15
+ ## Setup
16
+
17
+ ```ruby
18
+ Bitstamp.setup do |config|
19
+ config.key = YOUR_API_KEY
20
+ config.secret = YOUR_API_SECRET
21
+ config.client_id = YOUR_BITSTAMP_USERNAME
22
+ end
23
+ ```
24
+
25
+ If you fail to set your `key` or `secret` or `client_id` a `MissingConfigExeception`
26
+ will be raised.
27
+
28
+ ## Bitstamp ticker
29
+
30
+ The bitstamp ticker. Returns `last`, `high`, `low`, `volume`, `bid` and `ask`
31
+
32
+ ```ruby
33
+ Bitstamp.ticker
34
+ ```
35
+
36
+ It's also possible to query through the `Bitstamp::Ticker` object with
37
+ each individual method.
38
+
39
+ ```ruby
40
+ Bitstamp::Ticker.low # => "109.00"
41
+ ```
42
+
43
+ ## Fetch your open order
44
+
45
+ Returns an array with your open orders.
46
+
47
+ ```ruby
48
+ Bitstamp.orders.all
49
+ ```
50
+
51
+ ## Create a sell order
52
+
53
+ Returns an `Order` object.
54
+
55
+ ```ruby
56
+ Bitstamp.orders.sell(amount: 1.0, price: 111)
57
+ ```
58
+
59
+ ## Create a buy order
60
+
61
+ Returns an `Order` object.
62
+
63
+ ```ruby
64
+ Bitstamp.orders.buy(amount: 1.0, price: 111)
65
+ ```
66
+
67
+ ## Fetch your transactions
68
+
69
+ Returns an `Array` of `UserTransaction`.
70
+
71
+ ```ruby
72
+ Bitstamp.user_transactions.all
73
+ ```
74
+
75
+ *To be continued!**
76
+
77
+ # Tests
78
+
79
+ If you'd like to run the tests you need to set the following environment variables:
80
+
81
+ ```
82
+ export BITSTAMP_KEY=xxx
83
+ export BITSTAMP_SECRET=yyy
84
+ export BITSTAMP_CLIENT_ID=zzz
85
+ ```
86
+
87
+ ## Contributing
88
+
89
+ 1. Fork it
90
+ 2. Create your feature branch (`git checkout -b
91
+ my-new-feature`)
92
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
93
+ 4. Push to the branch (`git push origin my-new-feature`)
94
+ 5. Create new Pull Request
95
+
96
+
@@ -0,0 +1,49 @@
1
+ # encoding: utf-8
2
+
3
+ require 'rubygems'
4
+ require 'bundler'
5
+ begin
6
+ Bundler.setup(:default, :development)
7
+ rescue Bundler::BundlerError => e
8
+ $stderr.puts e.message
9
+ $stderr.puts "Run `bundle install` to install missing gems"
10
+ exit e.status_code
11
+ end
12
+ require 'rake'
13
+
14
+ require 'jeweler'
15
+ Jeweler::Tasks.new do |gem|
16
+ # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
17
+ gem.name = "bitstamp-rbtc-arbitrage"
18
+ gem.homepage = "http://github.com/kojnapp/bitstamp"
19
+ gem.license = "MIT"
20
+ gem.summary = %Q{Bitstamp Ruby API - forked for rbtc-arbitrage}
21
+ gem.description = %Q{Ruby API for use with bitstamp.}
22
+ gem.email = "hstove@gmail.com"
23
+ gem.authors = ["Jeffrey Wilcke", "Hank Stoever"]
24
+ # dependencies defined in Gemfile
25
+ end
26
+ Jeweler::RubygemsDotOrgTasks.new
27
+
28
+ require 'rspec/core'
29
+ require 'rspec/core/rake_task'
30
+ RSpec::Core::RakeTask.new(:spec) do |spec|
31
+ spec.pattern = FileList['spec/**/*_spec.rb']
32
+ end
33
+
34
+ RSpec::Core::RakeTask.new(:rcov) do |spec|
35
+ spec.pattern = 'spec/**/*_spec.rb'
36
+ spec.rcov = true
37
+ end
38
+
39
+ task :default => :spec
40
+
41
+ require 'rdoc/task'
42
+ Rake::RDocTask.new do |rdoc|
43
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
44
+
45
+ rdoc.rdoc_dir = 'rdoc'
46
+ rdoc.title = "bitstamp #{version}"
47
+ rdoc.rdoc_files.include('README*')
48
+ rdoc.rdoc_files.include('lib/**/*.rb')
49
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.4.0
@@ -0,0 +1,97 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = "bitstamp-rbtc-arbitrage"
8
+ s.version = "0.4.0"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Jeffrey Wilcke", "Hank Stoever"]
12
+ s.date = "2014-07-12"
13
+ s.description = "Ruby API for use with bitstamp."
14
+ s.email = "hstove@gmail.com"
15
+ s.extra_rdoc_files = [
16
+ "LICENSE.txt",
17
+ "README.md"
18
+ ]
19
+ s.files = [
20
+ ".rspec",
21
+ ".ruby-gemset",
22
+ ".ruby-version",
23
+ "Gemfile",
24
+ "Gemfile.lock",
25
+ "LICENSE.txt",
26
+ "README.md",
27
+ "Rakefile",
28
+ "VERSION",
29
+ "bitstamp-rbtc-arbitrage.gemspec",
30
+ "bitstamp.gemspec",
31
+ "lib/bitstamp.rb",
32
+ "lib/bitstamp/collection.rb",
33
+ "lib/bitstamp/helper.rb",
34
+ "lib/bitstamp/model.rb",
35
+ "lib/bitstamp/net.rb",
36
+ "lib/bitstamp/orders.rb",
37
+ "lib/bitstamp/ticker.rb",
38
+ "lib/bitstamp/transactions.rb",
39
+ "spec/bitstamp_spec.rb",
40
+ "spec/collection_spec.rb",
41
+ "spec/fixtures/vcr_cassettes/bitstamp/balance.yml",
42
+ "spec/fixtures/vcr_cassettes/bitstamp/order_book.yml",
43
+ "spec/fixtures/vcr_cassettes/bitstamp/orders/all.yml",
44
+ "spec/fixtures/vcr_cassettes/bitstamp/orders/buy.yml",
45
+ "spec/fixtures/vcr_cassettes/bitstamp/orders/sell/failure.yml",
46
+ "spec/fixtures/vcr_cassettes/bitstamp/ticker.yml",
47
+ "spec/fixtures/vcr_cassettes/bitstamp/transactions.yml",
48
+ "spec/fixtures/vcr_cassettes/bitstamp/user_transactions/all.yml",
49
+ "spec/orders_spec.rb",
50
+ "spec/spec_helper.rb",
51
+ "spec/support/bitstamp_setup.rb",
52
+ "spec/support/vcr.rb",
53
+ "spec/transactions_spec.rb"
54
+ ]
55
+ s.homepage = "http://github.com/kojnapp/bitstamp"
56
+ s.licenses = ["MIT"]
57
+ s.require_paths = ["lib"]
58
+ s.rubygems_version = "1.8.23"
59
+ s.summary = "Bitstamp Ruby API - forked for rbtc-arbitrage"
60
+
61
+ if s.respond_to? :specification_version then
62
+ s.specification_version = 3
63
+
64
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
65
+ s.add_runtime_dependency(%q<activemodel>, [">= 3.1"])
66
+ s.add_runtime_dependency(%q<activesupport>, [">= 0"])
67
+ s.add_runtime_dependency(%q<curb>, ["> 0.8.1"])
68
+ s.add_runtime_dependency(%q<ruby-hmac>, ["= 0.4.0"])
69
+ s.add_runtime_dependency(%q<i18n>, ["= 0.6.9"])
70
+ s.add_runtime_dependency(%q<tzinfo>, [">= 0"])
71
+ s.add_development_dependency(%q<rspec>, [">= 0"])
72
+ s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
73
+ s.add_development_dependency(%q<jeweler>, [">= 0"])
74
+ else
75
+ s.add_dependency(%q<activemodel>, [">= 3.1"])
76
+ s.add_dependency(%q<activesupport>, [">= 0"])
77
+ s.add_dependency(%q<curb>, ["> 0.8.1"])
78
+ s.add_dependency(%q<ruby-hmac>, ["= 0.4.0"])
79
+ s.add_dependency(%q<i18n>, ["= 0.6.9"])
80
+ s.add_dependency(%q<tzinfo>, [">= 0"])
81
+ s.add_dependency(%q<rspec>, [">= 0"])
82
+ s.add_dependency(%q<rdoc>, ["~> 3.12"])
83
+ s.add_dependency(%q<jeweler>, [">= 0"])
84
+ end
85
+ else
86
+ s.add_dependency(%q<activemodel>, [">= 3.1"])
87
+ s.add_dependency(%q<activesupport>, [">= 0"])
88
+ s.add_dependency(%q<curb>, ["> 0.8.1"])
89
+ s.add_dependency(%q<ruby-hmac>, ["= 0.4.0"])
90
+ s.add_dependency(%q<i18n>, ["= 0.6.9"])
91
+ s.add_dependency(%q<tzinfo>, [">= 0"])
92
+ s.add_dependency(%q<rspec>, [">= 0"])
93
+ s.add_dependency(%q<rdoc>, ["~> 3.12"])
94
+ s.add_dependency(%q<jeweler>, [">= 0"])
95
+ end
96
+ end
97
+
@@ -0,0 +1,94 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+ # stub: bitstamp 0.4.0 ruby lib
6
+
7
+ Gem::Specification.new do |s|
8
+ s.name = "bitstamp-rbtc-arbitrage"
9
+ s.version = "0.4.0"
10
+
11
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
+ s.authors = ["Jeffrey Wilcke"]
13
+ s.date = "2014-03-09"
14
+ s.description = "Ruby API for use with bitstamp - forked for rbtc_arbitrage."
15
+ s.email = "stygeo@gmail.com"
16
+ s.extra_rdoc_files = [
17
+ "LICENSE.txt",
18
+ "README.md"
19
+ ]
20
+ s.files = [
21
+ ".rspec",
22
+ ".ruby-gemset",
23
+ ".ruby-version",
24
+ "Gemfile",
25
+ "Gemfile.lock",
26
+ "LICENSE.txt",
27
+ "README.md",
28
+ "Rakefile",
29
+ "VERSION",
30
+ "bitstamp.gemspec",
31
+ "lib/bitstamp.rb",
32
+ "lib/bitstamp/collection.rb",
33
+ "lib/bitstamp/helper.rb",
34
+ "lib/bitstamp/model.rb",
35
+ "lib/bitstamp/net.rb",
36
+ "lib/bitstamp/orders.rb",
37
+ "lib/bitstamp/ticker.rb",
38
+ "lib/bitstamp/transactions.rb",
39
+ "spec/bitstamp_spec.rb",
40
+ "spec/collection_spec.rb",
41
+ "spec/fixtures/vcr_cassettes/bitstamp/balance.yml",
42
+ "spec/fixtures/vcr_cassettes/bitstamp/order_book.yml",
43
+ "spec/fixtures/vcr_cassettes/bitstamp/orders/all.yml",
44
+ "spec/fixtures/vcr_cassettes/bitstamp/orders/buy.yml",
45
+ "spec/fixtures/vcr_cassettes/bitstamp/orders/sell/failure.yml",
46
+ "spec/fixtures/vcr_cassettes/bitstamp/ticker.yml",
47
+ "spec/fixtures/vcr_cassettes/bitstamp/transactions.yml",
48
+ "spec/fixtures/vcr_cassettes/bitstamp/user_transactions/all.yml",
49
+ "spec/orders_spec.rb",
50
+ "spec/spec_helper.rb",
51
+ "spec/support/bitstamp_setup.rb",
52
+ "spec/support/vcr.rb",
53
+ "spec/transactions_spec.rb"
54
+ ]
55
+ s.homepage = "http://github.com/kojnapp/bitstamp"
56
+ s.licenses = ["MIT"]
57
+ s.require_paths = ["lib"]
58
+ s.rubygems_version = "2.1.11"
59
+ s.summary = "Bitstamp Ruby API"
60
+
61
+ if s.respond_to? :specification_version then
62
+ s.specification_version = 4
63
+
64
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
65
+ s.add_runtime_dependency(%q<activemodel>, [">= 3.1"])
66
+ s.add_runtime_dependency(%q<activesupport>, [">= 3.1"])
67
+ s.add_runtime_dependency(%q<curb>, ["> 0.8.1"])
68
+ s.add_runtime_dependency(%q<ruby-hmac>, ["= 0.4.0"])
69
+ s.add_development_dependency(%q<rspec>, [">= 0"])
70
+ s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
71
+ s.add_development_dependency(%q<bundler>, ["~> 1.3.5"])
72
+ s.add_development_dependency(%q<jeweler>, ["~> 1.8.4"])
73
+ else
74
+ s.add_dependency(%q<activemodel>, [">= 3.1"])
75
+ s.add_dependency(%q<activesupport>, [">= 3.1"])
76
+ s.add_dependency(%q<curb>, ["> 0.8.1"])
77
+ s.add_dependency(%q<ruby-hmac>, ["= 0.4.0"])
78
+ s.add_dependency(%q<rspec>, [">= 0"])
79
+ s.add_dependency(%q<rdoc>, ["~> 3.12"])
80
+ s.add_dependency(%q<bundler>, ["~> 1.3.5"])
81
+ s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
82
+ end
83
+ else
84
+ s.add_dependency(%q<activemodel>, [">= 3.1"])
85
+ s.add_dependency(%q<activesupport>, [">= 3.1"])
86
+ s.add_dependency(%q<curb>, ["> 0.8.1"])
87
+ s.add_dependency(%q<ruby-hmac>, ["= 0.4.0"])
88
+ s.add_dependency(%q<rspec>, [">= 0"])
89
+ s.add_dependency(%q<rdoc>, ["~> 3.12"])
90
+ s.add_dependency(%q<bundler>, ["~> 1.3.5"])
91
+ s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
92
+ end
93
+ end
94
+