bitstamp_client 1.0.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/bitstamp_client.gemspec +1 -1
- data/lib/bitstamp_client/factories.rb +13 -5
- data/lib/bitstamp_client/models/market_order.rb +15 -0
- data/lib/bitstamp_client/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3b8a4f622fc63947b187391a2f3cf52db990a1f793dd5cc6d832670afbbb9153
|
4
|
+
data.tar.gz: 6f22c74ebdb91f9afa9f36fddb144a752ed439451b0f9aea6886006bd0705fd5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e7f33f7f4fd5d1bd9ef0454111577eef0886d094164df6321ea560402b7c7f791b7f83917284ffaad89e709d7f6c6f14727cc5678ea6b68a33db86f80e9124c
|
7
|
+
data.tar.gz: 8576a8c6f58623a34119806c2015eb208422396751f6620c0e2da8fe56e7e9fc9dda8e622e120733a1ce19f7d010acb518be18b442dfb3591022b8531f93c406
|
data/CHANGELOG.md
CHANGED
@@ -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.1.0] - 2019-01-07
|
8
|
+
### Fixed
|
9
|
+
- Factories updated to FactoryBot
|
10
|
+
|
11
|
+
### Added
|
12
|
+
- `MarketOrder` `#buy` and `#sell`
|
13
|
+
|
7
14
|
## [1.0.1] - 2019-01-07
|
8
15
|
### Fixed
|
9
16
|
- All responses are not successful when Bitstamp's response has a `status` key
|
data/bitstamp_client.gemspec
CHANGED
@@ -41,5 +41,5 @@ Gem::Specification.new do |spec|
|
|
41
41
|
spec.add_development_dependency "vcr", "~> 3.0"
|
42
42
|
spec.add_development_dependency "webmock", "~> 2.3"
|
43
43
|
spec.add_development_dependency "virtus-matchers", ">= 0.4.0"
|
44
|
-
spec.add_development_dependency "
|
44
|
+
spec.add_development_dependency "factory_bot"
|
45
45
|
end
|
@@ -1,19 +1,19 @@
|
|
1
|
-
|
1
|
+
FactoryBot.define do
|
2
2
|
|
3
3
|
factory :bitstamp_client_order_book, class: "BitstampClient::OrderBook" do
|
4
4
|
timestamp { Time.now.to_i }
|
5
5
|
|
6
6
|
bids do
|
7
7
|
[
|
8
|
-
|
9
|
-
|
8
|
+
FactoryBot.build(:bitstamp_client_order),
|
9
|
+
FactoryBot.build(:bitstamp_client_order),
|
10
10
|
]
|
11
11
|
end
|
12
12
|
|
13
13
|
asks do
|
14
14
|
[
|
15
|
-
|
16
|
-
|
15
|
+
FactoryBot.build(:bitstamp_client_order),
|
16
|
+
FactoryBot.build(:bitstamp_client_order),
|
17
17
|
]
|
18
18
|
end
|
19
19
|
end
|
@@ -23,4 +23,12 @@ FactoryGirl.define do
|
|
23
23
|
volume { 2 }
|
24
24
|
end
|
25
25
|
|
26
|
+
factory :bitstamp_client_market_order, class: "BitstampClient::MarketOrder" do
|
27
|
+
sequence(:id) {|n| n}
|
28
|
+
datetime { DateTime.now }
|
29
|
+
type { "0" }
|
30
|
+
price { 4000.99 }
|
31
|
+
amount { 0.01 }
|
32
|
+
end
|
33
|
+
|
26
34
|
end
|
@@ -1,11 +1,26 @@
|
|
1
1
|
module BitstampClient
|
2
2
|
class MarketOrder < BaseModel
|
3
3
|
|
4
|
+
BUY_CODE = "0".freeze
|
5
|
+
SELL_CODE = "1".freeze
|
6
|
+
|
4
7
|
attribute :id, String
|
5
8
|
attribute :datetime, DateTime
|
6
9
|
attribute :type, String
|
7
10
|
attribute :price, BigDecimal
|
8
11
|
attribute :amount, BigDecimal
|
12
|
+
attribute :buy, Boolean, default: :default_buy, lazy: true
|
13
|
+
attribute :sell, Boolean, default: :default_sell, lazy: true
|
14
|
+
|
15
|
+
private
|
16
|
+
|
17
|
+
def default_buy
|
18
|
+
type == BUY_CODE
|
19
|
+
end
|
20
|
+
|
21
|
+
def default_sell
|
22
|
+
type == SELL_CODE
|
23
|
+
end
|
9
24
|
|
10
25
|
end
|
11
26
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bitstamp_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ramon Tayag
|
@@ -137,7 +137,7 @@ dependencies:
|
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: 0.4.0
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
|
-
name:
|
140
|
+
name: factory_bot
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
143
|
- - ">="
|