rbtc_arbitrage 2.2.1 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 003fb356e8d918847a8e6264c4d9b5cb92faa9bf
4
- data.tar.gz: c71f37d6eff0c7acfc9d18b675f8a69dca12b427
3
+ metadata.gz: 8aa43ebb666ac66292270a13719ad9f80a37f298
4
+ data.tar.gz: 0ea12000e83dcd7fef47e5377dff2746432fcd96
5
5
  SHA512:
6
- metadata.gz: 7384118643af66aff89842e6d40c633450146821b189ea3a88098813e0d5250c10366d9477e9a72bd19fdc9df98f9c48f31a9e38127850126b1a8c928f5731ef
7
- data.tar.gz: 61064f0b85a60aebbc20a9af7aaa13966b20907b9bb6e2379ff431c8ec488808dc9160d53c2f6b547ee5f4522e71b544385261c769948d4a1b09765845d41fad
6
+ metadata.gz: 3f1a36a82a20c19335a1d74c60c12aecd802aeeab37949a77f535690c31bf07b766ebfaad8f464500c1b9d399b7ef561998fc7dc597415113557b19c43231176
7
+ data.tar.gz: 1819e937e4eea6eac95e66d1152d83cbf0293c9d84566db9a1cf74189b04b6f6262e886fcc792f3d0348e20a50c2443887ead3c6477a716b18221d8c70ade887
data/Gemfile.lock CHANGED
@@ -1,12 +1,12 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rbtc_arbitrage (2.2.1)
4
+ rbtc_arbitrage (2.3.0)
5
5
  activemodel (>= 3.1)
6
6
  activesupport (>= 3.1)
7
7
  btce (= 0.2.4)
8
8
  bundler (~> 1.3)
9
- coinbase (= 1.2.6)
9
+ coinbase (= 1.3.0)
10
10
  faraday (= 0.8.8)
11
11
  pony
12
12
  rake (= 10.1.1)
@@ -44,7 +44,7 @@ GEM
44
44
  codeclimate-test-reporter (0.2.0)
45
45
  simplecov (>= 0.7.1, < 1.0.0)
46
46
  coderay (1.1.0)
47
- coinbase (1.2.6)
47
+ coinbase (1.3.0)
48
48
  hashie (>= 1.2.0)
49
49
  httparty (>= 0.8.3)
50
50
  money (= 5.1.1)
@@ -74,7 +74,7 @@ GEM
74
74
  guard (>= 2.1.1)
75
75
  rspec (~> 3.0.0.beta, >= 2.14, < 4.0)
76
76
  hashie (2.0.5)
77
- httparty (0.13.0)
77
+ httparty (0.13.1)
78
78
  json (~> 1.8)
79
79
  multi_xml (>= 0.5.2)
80
80
  i18n (0.6.9)
data/README.md CHANGED
@@ -10,19 +10,16 @@ A Ruby gem for executing arbitrage between different Bitcoin exchanges. Supports
10
10
 
11
11
  ## Meta
12
12
 
13
- Please contribute! There are always new exchanges that could be easily supported.
13
+ Please contribute with code! There are always new exchanges that could be easily supported.
14
14
  Check out the [contribution guidelines](https://github.com/hstove/rbtc_arbitrage/blob/master/CONTRIBUTING.md)
15
15
  for instructions. Earn Bitcoin for every commit:
16
16
 
17
17
  [![tip for next commit](http://tip4commit.com/projects/698.svg)](http://tip4commit.com/projects/698)
18
18
 
19
- [Explanation of bitcoin arbitrage](http://hankstoever.com/posts/13-Everything-you-need-to-know-about-Bitcoin-arbitrage)
20
-
21
- [Why I open sourced a bitcoin arbitrate bot](http://hankstoever.com/posts/2-Why-I-open-sourced-a-bitcoin-arbitrage-bot)
22
-
23
- I'm also creating a course on [creating your own bitcoin arbitrage bot](https://www.uludum.org/funds/2)
24
-
25
- [CHANGELOG](https://github.com/hstove/rbtc_arbitrage/releases).
19
+ - [Explanation of bitcoin arbitrage](http://hankstoever.com/posts/13-Everything-you-need-to-know-about-Bitcoin-arbitrage)
20
+ - [Why I open sourced a bitcoin arbitrate bot](http://hankstoever.com/posts/2-Why-I-open-sourced-a-bitcoin-arbitrage-bot)
21
+ - I made a course about [using this to run your own arbitrage bot](https://www.uludum.org/funds/2).
22
+ - [CHANGELOG](https://github.com/hstove/rbtc_arbitrage/releases).
26
23
 
27
24
  Donations accepted: **16BMcqf93eEpb2aWgMkJCSQQH85WzrpbdZ**
28
25
 
@@ -78,24 +75,49 @@ I, [APR 6 2014 7:14:37 AM -0700#52261] INFO -- : profit: $-0.05 (-1.18%) is b
78
75
  You will need to configure the following environment variables
79
76
  to trade with real accounts.
80
77
 
81
- ##### Bitstamp
78
+ ##### `BitstampClient`
82
79
 
83
80
  * BITSTAMP_KEY
84
81
  * BITSTAMP_SECRET
85
82
  * BITSTAMP_ADDRESS
86
83
  * BITSTAMP_CLIENT_ID
87
84
 
88
- ##### CampBX
85
+ ##### `CampbxClient`
89
86
 
90
87
  - CAMPBX_KEY
91
88
  - CAMPBX_SECRET
92
89
 
93
- ##### BTC-E
90
+ ##### `BtceClient`
94
91
 
95
92
  * BTCE_KEY
96
93
  * BTCE_SECRET
97
94
  * BTCE_ADDRESS
98
95
 
99
- ##### Coinbase
96
+ ##### `CoinbaseClient`
100
97
 
101
98
  * COINBASE_KEY
99
+ * COINBASE_SECRET
100
+
101
+ ## Exchange Adapters
102
+
103
+ `rbtc_arbtitrage` also exposes a handy interface for interacting with different
104
+ bitcoin clients. For example:
105
+
106
+ ~~~ruby
107
+ client = RbtcArbitrage::Clients::BitstampClient.new
108
+ client.price :buy
109
+ => 462.88
110
+ client.price :sell
111
+ => 462.88
112
+ client.balance
113
+ => [0.0079, 1.41] # [btc, usd]
114
+ client.options[:volume] = 0.5 # default is 0.01
115
+ # client.trade uses market price
116
+ client.trade :buy
117
+ client.trade :sell
118
+ client.address # for deposits
119
+ => "16rQQYMTTKb9cnnSX3xYkN4hcKXoYcXXXX"
120
+ # send btc to an address
121
+ coinbase = RbtcArbitrage::Clients::CoinbaseClient.new
122
+ client.transfer coinbase.address
123
+ ~~~
@@ -41,7 +41,7 @@ module RbtcArbitrage
41
41
  end
42
42
 
43
43
  def address
44
- @address ||= interface.get_btc_address
44
+ @address ||= interface.get_btc_address["Success"]
45
45
  end
46
46
  end
47
47
  end
@@ -47,7 +47,8 @@ module RbtcArbitrage
47
47
  end
48
48
 
49
49
  def interface
50
- @interface ||= Coinbase::Client.new(ENV['COINBASE_KEY'])
50
+ secret = ENV['COINBASE_SECRET'] || ''
51
+ @interface ||= Coinbase::Client.new(ENV['COINBASE_KEY'], secret)
51
52
  end
52
53
 
53
54
  def address
@@ -1,3 +1,3 @@
1
1
  module RbtcArbitrage
2
- VERSION = "2.2.1"
2
+ VERSION = "2.3.0"
3
3
  end
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ["hstove@gmail.com"]
11
11
  spec.description = %q{A gem for conducting arbitrage with Bitcoin.}
12
12
  spec.summary = %q{A gem for conducting arbitrage with Bitcoin.}
13
- spec.homepage = ""
13
+ spec.homepage = "https://github.com/hstove/rbtc_arbitrage"
14
14
  spec.license = "MIT"
15
15
 
16
16
  spec.files = `git ls-files`.split($/)
@@ -47,7 +47,7 @@ Gem::Specification.new do |spec|
47
47
  spec.add_dependency "activesupport", ">= 3.1"
48
48
  spec.add_dependency "thor"
49
49
  spec.add_dependency "btce", '0.2.4'
50
- spec.add_dependency "coinbase", '1.2.6'
50
+ spec.add_dependency "coinbase", '1.3.0'
51
51
  spec.add_dependency "pony"
52
52
  spec.add_dependency "tco", "0.1.0"
53
53
  end
@@ -59,8 +59,8 @@ describe RbtcArbitrage::Clients::CampbxClient do
59
59
 
60
60
  describe "#address" do
61
61
  it "calls campbx" do
62
- campbx.should_receive(:get_btc_address)
63
- client.address
62
+ campbx.should_receive(:get_btc_address).and_return({"Success" => "xxx"})
63
+ client.address.should eq("xxx")
64
64
  end
65
65
  end
66
66
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbtc_arbitrage
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.1
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hank Stoever
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-06 00:00:00.000000000 Z
11
+ date: 2014-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -114,14 +114,14 @@ dependencies:
114
114
  requirements:
115
115
  - - '='
116
116
  - !ruby/object:Gem::Version
117
- version: 1.2.6
117
+ version: 1.3.0
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - '='
123
123
  - !ruby/object:Gem::Version
124
- version: 1.2.6
124
+ version: 1.3.0
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: pony
127
127
  requirement: !ruby/object:Gem::Requirement
@@ -252,7 +252,7 @@ files:
252
252
  - spec/support/cassettes/RbtcArbitrage_Trader/_fetch_prices/gets_the_right_price_set.yml
253
253
  - spec/support/cassettes/RbtcArbitrage_Trader/_get_balance/fetches_the_right_balance.yml
254
254
  - spec/trader_spec.rb
255
- homepage: ''
255
+ homepage: https://github.com/hstove/rbtc_arbitrage
256
256
  licenses:
257
257
  - MIT
258
258
  metadata: {}
@@ -272,7 +272,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
272
272
  version: '0'
273
273
  requirements: []
274
274
  rubyforge_project:
275
- rubygems_version: 2.2.0
275
+ rubygems_version: 2.2.2
276
276
  signing_key:
277
277
  specification_version: 4
278
278
  summary: A gem for conducting arbitrage with Bitcoin.