bitstamp_client 1.2.1 → 1.2.2

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
  SHA256:
3
- metadata.gz: 2576e794d88ec74414b95244a440d9eeb4fb84e1260ed49329822653a95816ac
4
- data.tar.gz: ac8592282d6aa12ebfd17d0e302940d7b3adc9e2a51214d62582a1537d34a53e
3
+ metadata.gz: f5f891fcf088ca5c7de2ebf3f7b9278cd5dcf2da656111bd85b8e7545a8a178a
4
+ data.tar.gz: 4e3ba70c70b3fc4d48fd4df4a2e90449882914c0a3fbea495ea56ea7986374f1
5
5
  SHA512:
6
- metadata.gz: b9a0f9d97001b5db5241110d973546a20dbd3a61eecefc9cdda1f50c279a4faa7e6e52a0bd60d56382c506458a7b5f4ebae375d72853d8d645d688969bf157ec
7
- data.tar.gz: 3fefb6c26826fef8199bf1c5d5107698647b8eeef7a8bcc720c1f29a43c62c0130fe33fa2eb164a424ff75bd9da43e7fb6d2b1ad0f93e856604ee0f86053917f
6
+ metadata.gz: 828e7216ad247f733817a69dc1f36e95f2ef0185668c009ec93c72dee427544d81ad253abf418365670e0ed21895df7ede2f7fcafdec752e2a9abd63581a4456
7
+ data.tar.gz: aa34e0f6e78f517db198d4932de36d718d4de7c2fc9cfbdc3dfe657dffcbdadac4de2898afe4adb5ce12c65753314b66c923213591ffdf13bef97212b03cfb64
@@ -0,0 +1,3 @@
1
+ KEY=changeme
2
+ SECRET=changeme
3
+ CUSTOMER=1234
@@ -0,0 +1,23 @@
1
+ name: Ruby Tests
2
+
3
+ on:
4
+ push:
5
+ branches: [ $default-branch ]
6
+ pull_request:
7
+ branches: [ $default-branch ]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v2
14
+ - name: Set up Ruby
15
+ # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
16
+ # change this to (see https://github.com/ruby/setup-ruby#versioning):
17
+ # uses: ruby/setup-ruby@v1
18
+ uses: ruby/setup-ruby@ec106b438a1ff6ff109590de34ddc62c540232e0
19
+ - name: Install dependencies
20
+ run: bundle install
21
+ - name: Run tests
22
+ run: bundle exec rspec spec
23
+
data/.gitignore CHANGED
@@ -11,3 +11,6 @@
11
11
 
12
12
  # rspec failure tracking
13
13
  .rspec_status
14
+
15
+ .env
16
+ .env.local
@@ -1 +1 @@
1
- ruby-2.5.3
1
+ 2.6.6
@@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](http://keepachangelog.com/)
5
5
  and this project adheres to [Semantic Versioning](http://semver.org/).
6
6
 
7
+ ## [1.2.2] - 2021-01-05
8
+ ### Changed
9
+ - `BalanceResponse` now returns fields, only if `parsed_body` is present
10
+ - Update bundler and ruby versions
11
+ - Moved away from `config.yml` variables to `ENV` variables
12
+ - Added initial Github action for running tests
13
+
7
14
  ## [1.2.1] - 2019-02-15
8
15
  ### Fixed
9
16
  - OrderBook: do not blow up with `JSON::ParserError` when response isn't JSON
data/README.md CHANGED
@@ -1,8 +1,6 @@
1
1
  # BitstampClient
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/bitstamp_client`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
3
+ API wrapper for Bitstamp.
6
4
 
7
5
  ## Installation
8
6
 
@@ -23,6 +21,7 @@ Or install it yourself as:
23
21
  ## Usage
24
22
 
25
23
  ```ruby
24
+ # Orderbook
26
25
  client = BitstampClient.new
27
26
  response = client.order_book("btcusd")
28
27
  response.success? # true
@@ -32,6 +31,16 @@ order_book.bids # Array of Order instances
32
31
  order_book.asks # Array of Order instances
33
32
  ```
34
33
 
34
+ ```ruby
35
+ # Balance
36
+ client = BitstampClient.new
37
+ response = client.balance(nonce: ...)
38
+ response.success? # true
39
+
40
+ response.usd_balance # BigDecimal
41
+ response.btc_reserved # BigDecimal
42
+ ```
43
+
35
44
  For more, see the files in `spec/acceptance`.
36
45
 
37
46
  ## Development
@@ -34,12 +34,13 @@ Gem::Specification.new do |spec|
34
34
  spec.add_dependency "api_client_base", "~> 1.0"
35
35
  spec.add_dependency "typhoeus", "~> 1.0"
36
36
 
37
- spec.add_development_dependency "bundler", "~> 1.14"
37
+ spec.add_development_dependency "bundler", "~> 2.2"
38
+ spec.add_development_dependency "dotenv", "~> 2.7"
39
+ spec.add_development_dependency "factory_bot"
38
40
  spec.add_development_dependency "rake", "~> 10.0"
39
41
  spec.add_development_dependency "rspec", "~> 3.5"
40
42
  spec.add_development_dependency "rspec-its", "~> 1.2"
41
43
  spec.add_development_dependency "vcr", "~> 3.0"
42
- spec.add_development_dependency "webmock", "~> 2.3"
43
44
  spec.add_development_dependency "virtus-matchers", ">= 0.4.0"
44
- spec.add_development_dependency "factory_bot"
45
+ spec.add_development_dependency "webmock", "~> 2.3"
45
46
  end
@@ -27,7 +27,7 @@ module BitstampClient
27
27
  attribute field, BigDecimal, default: :"default_#{field}"
28
28
 
29
29
  define_method :"default_#{field}" do
30
- parsed_body[field.to_s]
30
+ parsed_body[field.to_s] if parsed_body.present?
31
31
  end
32
32
  end
33
33
 
@@ -1,3 +1,3 @@
1
1
  module BitstampClient
2
- VERSION = "1.2.1"
2
+ VERSION = "1.2.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bitstamp_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ramon Tayag
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-02-15 00:00:00.000000000 Z
11
+ date: 2021-01-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: api_client_base
@@ -44,14 +44,42 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '1.14'
47
+ version: '2.2'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '1.14'
54
+ version: '2.2'
55
+ - !ruby/object:Gem::Dependency
56
+ name: dotenv
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '2.7'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '2.7'
69
+ - !ruby/object:Gem::Dependency
70
+ name: factory_bot
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
55
83
  - !ruby/object:Gem::Dependency
56
84
  name: rake
57
85
  requirement: !ruby/object:Gem::Requirement
@@ -108,20 +136,6 @@ dependencies:
108
136
  - - "~>"
109
137
  - !ruby/object:Gem::Version
110
138
  version: '3.0'
111
- - !ruby/object:Gem::Dependency
112
- name: webmock
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - "~>"
116
- - !ruby/object:Gem::Version
117
- version: '2.3'
118
- type: :development
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - "~>"
123
- - !ruby/object:Gem::Version
124
- version: '2.3'
125
139
  - !ruby/object:Gem::Dependency
126
140
  name: virtus-matchers
127
141
  requirement: !ruby/object:Gem::Requirement
@@ -137,30 +151,31 @@ dependencies:
137
151
  - !ruby/object:Gem::Version
138
152
  version: 0.4.0
139
153
  - !ruby/object:Gem::Dependency
140
- name: factory_bot
154
+ name: webmock
141
155
  requirement: !ruby/object:Gem::Requirement
142
156
  requirements:
143
- - - ">="
157
+ - - "~>"
144
158
  - !ruby/object:Gem::Version
145
- version: '0'
159
+ version: '2.3'
146
160
  type: :development
147
161
  prerelease: false
148
162
  version_requirements: !ruby/object:Gem::Requirement
149
163
  requirements:
150
- - - ">="
164
+ - - "~>"
151
165
  - !ruby/object:Gem::Version
152
- version: '0'
153
- description:
166
+ version: '2.3'
167
+ description:
154
168
  email:
155
169
  - ramon.tayag@gmail.com
156
170
  executables: []
157
171
  extensions: []
158
172
  extra_rdoc_files: []
159
173
  files:
174
+ - ".env.sample"
175
+ - ".github/workflows/tests.yml"
160
176
  - ".gitignore"
161
177
  - ".rspec"
162
178
  - ".ruby-version"
163
- - ".travis.yml"
164
179
  - CHANGELOG.md
165
180
  - CODE_OF_CONDUCT.md
166
181
  - Gemfile
@@ -195,7 +210,7 @@ licenses:
195
210
  - MIT
196
211
  metadata:
197
212
  allowed_push_host: https://rubygems.org
198
- post_install_message:
213
+ post_install_message:
199
214
  rdoc_options: []
200
215
  require_paths:
201
216
  - lib
@@ -210,9 +225,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
210
225
  - !ruby/object:Gem::Version
211
226
  version: '0'
212
227
  requirements: []
213
- rubyforge_project:
214
- rubygems_version: 2.7.8
215
- signing_key:
228
+ rubygems_version: 3.0.3
229
+ signing_key:
216
230
  specification_version: 4
217
231
  summary: Ruby wrapper for Bitstamp's API
218
232
  test_files: []
@@ -1,7 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- rvm:
4
- - 2.5.3
5
- before_script:
6
- - cp spec/config.yml{.sample,}
7
- before_install: gem install bundler -v 1.14.6