bittrex 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -0
- data/.ruby-version +1 -0
- data/README.md +28 -0
- data/Rakefile +10 -1
- data/bittrex.gemspec +1 -0
- data/config/application.yml.example +2 -0
- data/lib/bittrex.rb +1 -1
- data/lib/bittrex/client.rb +1 -0
- data/lib/bittrex/configuration.rb +2 -2
- data/lib/bittrex/market.rb +2 -0
- data/lib/bittrex/version.rb +1 -1
- data/lib/bittrex/wallet.rb +1 -1
- data/lib/bittrex/{withdrawl.rb → withdrawal.rb} +1 -1
- data/spec/fixtures/{withdrawl.json → withdrawal.json} +0 -0
- data/spec/models/{withdrawl_spec.rb → withdrawal_spec.rb} +3 -3
- data/spec/spec_helper.rb +2 -2
- metadata +24 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3deff4d67afa6d177474b50f61c96555e01d4237
|
4
|
+
data.tar.gz: 0a0b94bf9f4577c679da4a52a8c0c85d7c4064a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9139ad753901cc960de237d182ee302023fa37c0d4aabca9f3654d085012869fe9a5dd720952ab68163154e95361dbd7f70e159cf4e8a12abc4e724c6b9518aa
|
7
|
+
data.tar.gz: 81491a2f5d641e957287ec4341b4adee5a2919f2b548da9f9cab0a18aa1028a131c8223f54329a479c2674e82fcbdb10545d3b0d05035ba19b8345d504ebfdb6
|
data/.gitignore
CHANGED
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.3.3
|
data/README.md
CHANGED
@@ -16,6 +16,34 @@ Or install it yourself as:
|
|
16
16
|
|
17
17
|
$ gem install bittrex
|
18
18
|
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
The gem uses a simple mapping of API resources to models, with a majority of the attributes mapped to corresponding attributes on the corresponding class. There are some translations into a more "rubyish" verbage, but for the most part things are directly mapped.
|
22
|
+
|
23
|
+
require 'rubygems'
|
24
|
+
require 'bittrex'
|
25
|
+
>> Quote.current('BTC-LTC')
|
26
|
+
#=> #<Bittrex::Quote:0x000001015cd058 @market="BTC-LTC", @bid=0.015792, @ask=0.01602899, @last=0.015792, @raw={"Bid"=>0.015792, "Ask"=>0.01602899, "Last"=>0.015792}>
|
27
|
+
|
28
|
+
## Authentication
|
29
|
+
|
30
|
+
You can authenticate access to your Bittrex account by configuring your implementation of the bittrex gem. This is accomplished by using a config block at the top of your application.
|
31
|
+
|
32
|
+
Set up your keys at: https://bittrex.com/Manage#sectionApi
|
33
|
+
|
34
|
+
Bittrex.config do |c|
|
35
|
+
c.key = 'my_api_key'
|
36
|
+
c.secret = 'my_api_secret'
|
37
|
+
end
|
38
|
+
|
39
|
+
## Development
|
40
|
+
|
41
|
+
You can test out public API calls any time by running `bundle exec rake bittrex:console` and inputting your method.
|
42
|
+
|
43
|
+
If you want to test private API calls, you will need to create `config/application.yml` and add your Bittrex keys to it (`config/application.yml.example` provides a template for this).
|
44
|
+
|
45
|
+
Once you've added the API keys, run `bundle exec rake bittrex:console`
|
46
|
+
|
19
47
|
## Contributing
|
20
48
|
|
21
49
|
1. Fork it ( https://github.com/[my-github-username]/bittrex/fork )
|
data/Rakefile
CHANGED
@@ -1,2 +1,11 @@
|
|
1
|
-
require
|
1
|
+
require 'bundler/gem_tasks'
|
2
|
+
require 'figaro'
|
2
3
|
|
4
|
+
Figaro.application.path = File.expand_path('../config/application.yml', __FILE__)
|
5
|
+
Figaro.load
|
6
|
+
|
7
|
+
namespace :bittrex do
|
8
|
+
task :console do
|
9
|
+
exec "irb -r bittrex -I ./lib"
|
10
|
+
end
|
11
|
+
end
|
data/bittrex.gemspec
CHANGED
data/lib/bittrex.rb
CHANGED
@@ -10,7 +10,7 @@ module Bittrex
|
|
10
10
|
autoload :Quote, 'bittrex/quote'
|
11
11
|
autoload :Summary, 'bittrex/summary'
|
12
12
|
autoload :Wallet, 'bittrex/wallet'
|
13
|
-
autoload :
|
13
|
+
autoload :Withdrawal, 'bittrex/withdrawal'
|
14
14
|
|
15
15
|
def self.client
|
16
16
|
@client ||= Client.new(configuration.auth)
|
data/lib/bittrex/client.rb
CHANGED
data/lib/bittrex/market.rb
CHANGED
data/lib/bittrex/version.rb
CHANGED
data/lib/bittrex/wallet.rb
CHANGED
File without changes
|
@@ -1,8 +1,8 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe Bittrex::
|
4
|
-
let(:data){ fixture(:
|
5
|
-
let(:subject){ Bittrex::
|
3
|
+
describe Bittrex::Withdrawal do
|
4
|
+
let(:data){ fixture(:withdrawal) }
|
5
|
+
let(:subject){ Bittrex::Withdrawal.new(data) }
|
6
6
|
|
7
7
|
describe '#initialization' do
|
8
8
|
it { should_assign_attribute(subject, :id, 'c7f7b806-36cf-4xxx-b198-fcdeb1220762') }
|
data/spec/spec_helper.rb
CHANGED
@@ -10,7 +10,7 @@ Dir[File.join(Bittrex.root, 'spec/support/**/*.rb')].each {|f| require f}
|
|
10
10
|
|
11
11
|
RSpec.configure do |config|
|
12
12
|
config.before(:each) do
|
13
|
-
Bittrex.
|
13
|
+
allow(Bittrex).to receive(:client)
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
@@ -20,5 +20,5 @@ def fixture(resource)
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def should_assign_attribute(subject, method, value)
|
23
|
-
subject.send(method).
|
23
|
+
expect(subject.send(method)).to eq(value)
|
24
24
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bittrex
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthew Werner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-10-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -94,6 +94,20 @@ dependencies:
|
|
94
94
|
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: figaro
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
97
111
|
description: API Client for the Bittrex API
|
98
112
|
email:
|
99
113
|
- m@mjw.io
|
@@ -102,11 +116,13 @@ extensions: []
|
|
102
116
|
extra_rdoc_files: []
|
103
117
|
files:
|
104
118
|
- ".gitignore"
|
119
|
+
- ".ruby-version"
|
105
120
|
- Gemfile
|
106
121
|
- LICENSE.txt
|
107
122
|
- README.md
|
108
123
|
- Rakefile
|
109
124
|
- bittrex.gemspec
|
125
|
+
- config/application.yml.example
|
110
126
|
- lib/bittrex.rb
|
111
127
|
- lib/bittrex/client.rb
|
112
128
|
- lib/bittrex/configuration.rb
|
@@ -118,7 +134,7 @@ files:
|
|
118
134
|
- lib/bittrex/summary.rb
|
119
135
|
- lib/bittrex/version.rb
|
120
136
|
- lib/bittrex/wallet.rb
|
121
|
-
- lib/bittrex/
|
137
|
+
- lib/bittrex/withdrawal.rb
|
122
138
|
- spec/fixtures/currency.json
|
123
139
|
- spec/fixtures/deposit.json
|
124
140
|
- spec/fixtures/market.json
|
@@ -126,7 +142,7 @@ files:
|
|
126
142
|
- spec/fixtures/quote.json
|
127
143
|
- spec/fixtures/summary.json
|
128
144
|
- spec/fixtures/wallet.json
|
129
|
-
- spec/fixtures/
|
145
|
+
- spec/fixtures/withdrawal.json
|
130
146
|
- spec/models/configuration_spec.rb
|
131
147
|
- spec/models/currency_spec.rb
|
132
148
|
- spec/models/deposit_spec.rb
|
@@ -135,7 +151,7 @@ files:
|
|
135
151
|
- spec/models/quote_spec.rb
|
136
152
|
- spec/models/summary_spec.rb
|
137
153
|
- spec/models/wallet_spec.rb
|
138
|
-
- spec/models/
|
154
|
+
- spec/models/withdrawal_spec.rb
|
139
155
|
- spec/spec_helper.rb
|
140
156
|
- spec/support/api_helper.rb
|
141
157
|
homepage: https://github.com/mwerner/bittrex
|
@@ -158,7 +174,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
158
174
|
version: '0'
|
159
175
|
requirements: []
|
160
176
|
rubyforge_project:
|
161
|
-
rubygems_version: 2.
|
177
|
+
rubygems_version: 2.6.13
|
162
178
|
signing_key:
|
163
179
|
specification_version: 4
|
164
180
|
summary: API Client for the Bittrex API
|
@@ -170,7 +186,7 @@ test_files:
|
|
170
186
|
- spec/fixtures/quote.json
|
171
187
|
- spec/fixtures/summary.json
|
172
188
|
- spec/fixtures/wallet.json
|
173
|
-
- spec/fixtures/
|
189
|
+
- spec/fixtures/withdrawal.json
|
174
190
|
- spec/models/configuration_spec.rb
|
175
191
|
- spec/models/currency_spec.rb
|
176
192
|
- spec/models/deposit_spec.rb
|
@@ -179,6 +195,6 @@ test_files:
|
|
179
195
|
- spec/models/quote_spec.rb
|
180
196
|
- spec/models/summary_spec.rb
|
181
197
|
- spec/models/wallet_spec.rb
|
182
|
-
- spec/models/
|
198
|
+
- spec/models/withdrawal_spec.rb
|
183
199
|
- spec/spec_helper.rb
|
184
200
|
- spec/support/api_helper.rb
|