paxful_client 0.3.0 → 1.0.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
  SHA256:
3
- metadata.gz: f4f2db608ddceb40e4e29da6a0361216a461969a95c8179515f04bd8b975f256
4
- data.tar.gz: 2ead2910725c7649bae0015e049e5ea12f40a8ff29cccac24b3fcb25a4a1c403
3
+ metadata.gz: 66e7dd2c722899ff116712986c06f49dc4890323f20c83357584974c2d15f258
4
+ data.tar.gz: d1d24de558f4183569d63e930763cb126ba9b573214460ac519969e02f734945
5
5
  SHA512:
6
- metadata.gz: cf3ebdf5000d7fe7a3085cfa57166b0fa59174f6427b3d5cc2f3fffa03bf832a9f1f1fb12a420e93c8429032c2fe4d56392b01e3f580372f23ddd80176a99036
7
- data.tar.gz: e8f72c926f62c588a1c7c71241d647e7d74823f089b51bcb97fc7a321f306fe28ebdfa2e540a87d5b337126a6ff7ec931d79992cc855765d2fd242f68ae67cb4
6
+ metadata.gz: f7c58c18354557383e81f69221ce6a64fe342b36a3637aa9914afd2ce806805189bc491113a3776e10de7cb8432fcae5dfd3e809515340ad7eccaf4c98ec7fcc
7
+ data.tar.gz: 9293af9c62f8a7b2195398e9b7210aa55475d7a3766a6c5b773ffbc1f7be6fc2eff32e659103f094651c5086821ca059da3aa7db81eabf55b8c38a9012f28976
@@ -20,14 +20,12 @@ jobs:
20
20
 
21
21
  steps:
22
22
  - uses: actions/checkout@v2
23
- - name: Set up Ruby
24
- # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
25
- # change this to (see https://github.com/ruby/setup-ruby#versioning):
26
- # uses: ruby/setup-ruby@v1
27
- uses: ruby/setup-ruby@ec106b438a1ff6ff109590de34ddc62c540232e0
23
+ - uses: actions/setup-ruby@v1
28
24
  with:
29
- ruby-version: 2.6
25
+ ruby-version: '2.7'
30
26
  - name: Install dependencies
31
27
  run: bundle install
28
+ - name: Copy config.yml
29
+ run: cp spec/config.yml{.sample,}
32
30
  - name: Run tests
33
31
  run: bundle exec rake
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
5
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [1.0.0] - 2020-11-19
8
+ ### Added
9
+ - Ensure that `key` and `secret` are present; raise exception otherwise
10
+
7
11
  ## [0.3.0] - 2020-10-12
8
12
  ### Added
9
13
  - add `trade/completed` endpoint
@@ -1,9 +1,10 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- paxful_client (0.3.0)
4
+ paxful_client (1.0.0)
5
5
  activesupport
6
6
  api_client_base
7
+ dry-validation (~> 0.13)
7
8
  typhoeus
8
9
 
9
10
  GEM
@@ -34,6 +35,35 @@ GEM
34
35
  descendants_tracker (0.0.4)
35
36
  thread_safe (~> 0.3, >= 0.3.1)
36
37
  diff-lcs (1.4.4)
38
+ dry-configurable (0.11.6)
39
+ concurrent-ruby (~> 1.0)
40
+ dry-core (~> 0.4, >= 0.4.7)
41
+ dry-equalizer (~> 0.2)
42
+ dry-container (0.7.2)
43
+ concurrent-ruby (~> 1.0)
44
+ dry-configurable (~> 0.1, >= 0.1.3)
45
+ dry-core (0.4.9)
46
+ concurrent-ruby (~> 1.0)
47
+ dry-equalizer (0.3.0)
48
+ dry-inflector (0.2.0)
49
+ dry-logic (0.6.1)
50
+ concurrent-ruby (~> 1.0)
51
+ dry-core (~> 0.2)
52
+ dry-equalizer (~> 0.2)
53
+ dry-types (0.14.1)
54
+ concurrent-ruby (~> 1.0)
55
+ dry-container (~> 0.3)
56
+ dry-core (~> 0.4, >= 0.4.4)
57
+ dry-equalizer (~> 0.2)
58
+ dry-inflector (~> 0.1, >= 0.1.2)
59
+ dry-logic (~> 0.5, >= 0.5)
60
+ dry-validation (0.13.3)
61
+ concurrent-ruby (~> 1.0)
62
+ dry-configurable (~> 0.1, >= 0.1.3)
63
+ dry-core (~> 0.2, >= 0.2.1)
64
+ dry-equalizer (~> 0.2)
65
+ dry-logic (~> 0.5, >= 0.5.0)
66
+ dry-types (~> 0.14.0)
37
67
  equalizer (0.0.11)
38
68
  ethon (0.12.0)
39
69
  ffi (>= 1.3.0)
@@ -67,7 +97,7 @@ GEM
67
97
  thread_safe (0.3.6)
68
98
  typhoeus (1.4.0)
69
99
  ethon (>= 0.9.0)
70
- tzinfo (1.2.7)
100
+ tzinfo (1.2.8)
71
101
  thread_safe (~> 0.1)
72
102
  vcr (3.0.3)
73
103
  virtus (1.0.5)
@@ -79,7 +109,7 @@ GEM
79
109
  addressable (>= 2.3.6)
80
110
  crack (>= 0.3.2)
81
111
  hashdiff
82
- zeitwerk (2.4.0)
112
+ zeitwerk (2.4.1)
83
113
 
84
114
  PLATFORMS
85
115
  ruby
data/README.md CHANGED
@@ -22,18 +22,24 @@ Or install it yourself as:
22
22
 
23
23
  ```ruby
24
24
  client = PaxfulClient.new(host: "host", key: "key", secret: "secret")
25
+
26
+ # Get balance
25
27
  response = client.get_balance
26
28
  wallet = response.wallet
27
-
28
- # get the balance
29
29
  wallet.balance
30
+
31
+ # Get completed trades
32
+ response = client.get_completed_trades
33
+ order_book = response.order_book
34
+ order_book.trades
30
35
  ```
31
36
 
32
37
  ## Development
33
38
 
34
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
35
-
36
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
39
+ ```
40
+ cp spec/config.yml{.sample,}
41
+ rspec
42
+ ```
37
43
 
38
44
  ## Contributing
39
45
 
@@ -1,5 +1,6 @@
1
1
  require "paxful_client/version"
2
2
  require "api_client_base"
3
+ require "dry-validation"
3
4
 
4
5
  require "json"
5
6
  require "active_support/core_ext/hash/indifferent_access"
@@ -15,6 +16,9 @@ require "paxful_client/requests/get_completed_trades_request"
15
16
  require "paxful_client/responses/base_response"
16
17
  require "paxful_client/responses/get_balance_response"
17
18
  require "paxful_client/responses/get_completed_trades_response"
19
+ require "paxful_client/schemas/base_request_schema"
20
+ require "paxful_client/schemas/get_balance_request_schema"
21
+ require "paxful_client/schemas/get_completed_trades_request_schema"
18
22
 
19
23
  module PaxfulClient
20
24
  include APIClientBase::Base.module
@@ -11,8 +11,8 @@ module PaxfulClient
11
11
  def body
12
12
  nonce = Time.now.to_i
13
13
  apiseal = OpenSSL::HMAC.hexdigest(
14
- "SHA256",
15
- secret,
14
+ "SHA256",
15
+ secret,
16
16
  "apikey=#{key}&nonce=#{nonce}",
17
17
  )
18
18
 
@@ -0,0 +1,8 @@
1
+ module PaxfulClient
2
+ BaseRequestSchema = Dry::Validation.Schema do
3
+
4
+ required(:key).filled(:str?)
5
+ required(:secret).filled(:str?)
6
+
7
+ end
8
+ end
@@ -0,0 +1,3 @@
1
+ module PaxfulClient
2
+ GetBalanceRequestSchema = BaseRequestSchema
3
+ end
@@ -0,0 +1,3 @@
1
+ module PaxfulClient
2
+ GetCompletedTradesRequestSchema = BaseRequestSchema
3
+ end
@@ -1,3 +1,3 @@
1
1
  module PaxfulClient
2
- VERSION = "0.3.0"
2
+ VERSION = "1.0.0"
3
3
  end
@@ -28,6 +28,7 @@ Gem::Specification.new do |spec|
28
28
  spec.add_dependency "api_client_base"
29
29
  spec.add_dependency "typhoeus"
30
30
  spec.add_dependency "activesupport"
31
+ spec.add_dependency "dry-validation", "~> 0.13"
31
32
 
32
33
  spec.add_development_dependency "pry"
33
34
  spec.add_development_dependency "vcr", "~> 3.0"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paxful_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Chavez
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-10-12 00:00:00.000000000 Z
11
+ date: 2020-11-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: api_client_base
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: dry-validation
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '0.13'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '0.13'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: pry
57
71
  requirement: !ruby/object:Gem::Requirement
@@ -124,6 +138,9 @@ files:
124
138
  - lib/paxful_client/responses/base_response.rb
125
139
  - lib/paxful_client/responses/get_balance_response.rb
126
140
  - lib/paxful_client/responses/get_completed_trades_response.rb
141
+ - lib/paxful_client/schemas/base_request_schema.rb
142
+ - lib/paxful_client/schemas/get_balance_request_schema.rb
143
+ - lib/paxful_client/schemas/get_completed_trades_request_schema.rb
127
144
  - lib/paxful_client/version.rb
128
145
  - paxful_client.gemspec
129
146
  homepage: https://github.com/MarkFChavez/paxful_client-ruby
@@ -148,8 +165,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
148
165
  - !ruby/object:Gem::Version
149
166
  version: '0'
150
167
  requirements: []
151
- rubyforge_project:
152
- rubygems_version: 2.7.6
168
+ rubygems_version: 3.0.8
153
169
  signing_key:
154
170
  specification_version: 4
155
171
  summary: API wrapper for Paxful