luno 0.2.2 → 0.2.6

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: 7cb327dac23e013eeb890c1fadac8a791b988c62aa4b8e541f0637f97ce8003a
4
- data.tar.gz: daeb065c505b364c4438354493e65a736c82ed30fbb7c78fa1abeb45261c01e8
3
+ metadata.gz: 5be906cc2e61a53ca9220d0d5e5b6797fe65a3dc9f58f74908ace2d120204669
4
+ data.tar.gz: ac6a1a0e7792437dc7671354c1694f9377bdc1e34479c19c2c9fad736891dbdf
5
5
  SHA512:
6
- metadata.gz: 0ac185bf7b585d8aca16a6b60b4f9bc002ec363684cab3006cca098908ac1ab066612aec14407778dea430338e3edbac4ebd5027d1327fcf9869fa35dee94eda
7
- data.tar.gz: 47344ffeff6064c3aaef8ccb3cc17803ccd4d831d0880586ed116060469e4f3840bd0ff9d9d792d64d38d95fd68107ec74cae724e474df15a1dc940e6b56ef27
6
+ metadata.gz: 3bebcce777d62325feeee9c3214e57fff69b398aacb2032a1a0bac25d6e9e919f07c4b43c1827f43f730f97d47bf82f0fba0518107ee1bf80e326a6c437dca01
7
+ data.tar.gz: f9d3333b6d35341163387805c339ecfc2dd7d5c93571e7b13fcbc4f79fecf0056c070af320a4180abfebe92e5028906fe2b3b5e21aa6170f23bae08781970def
@@ -0,0 +1,18 @@
1
+ on:
2
+ pull_request: {}
3
+ push:
4
+ branches:
5
+ - main
6
+ - master
7
+ name: Semgrep
8
+ jobs:
9
+ semgrep:
10
+ name: Scan
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v2
14
+ - uses: returntocorp/semgrep-action@v1
15
+ with:
16
+ auditOn: push
17
+ publishToken: ${{ secrets.SEMGREP_APP_TOKEN }}
18
+ publishDeployment: 607
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.6.3
1
+ 3.0.2
data/Gemfile.lock CHANGED
@@ -1,105 +1,104 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- luno (0.2.0)
5
- active_attr (~> 0.15)
6
- httparty (~> 0.18)
7
- nokogiri (~> 1.10.9)
4
+ luno (0.2.5)
5
+ active_attr (~> 0.15.3)
6
+ httparty (~> 0.20.0)
7
+ nokogiri (~> 1.12.5)
8
8
 
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- actionpack (6.0.3.2)
13
- actionview (= 6.0.3.2)
14
- activesupport (= 6.0.3.2)
15
- rack (~> 2.0, >= 2.0.8)
12
+ actionpack (6.1.4.1)
13
+ actionview (= 6.1.4.1)
14
+ activesupport (= 6.1.4.1)
15
+ rack (~> 2.0, >= 2.0.9)
16
16
  rack-test (>= 0.6.3)
17
17
  rails-dom-testing (~> 2.0)
18
18
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
19
- actionview (6.0.3.2)
20
- activesupport (= 6.0.3.2)
19
+ actionview (6.1.4.1)
20
+ activesupport (= 6.1.4.1)
21
21
  builder (~> 3.1)
22
22
  erubi (~> 1.4)
23
23
  rails-dom-testing (~> 2.0)
24
24
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
25
- active_attr (0.15.0)
26
- actionpack (>= 3.0.2, < 6.1)
27
- activemodel (>= 3.0.2, < 6.1)
28
- activesupport (>= 3.0.2, < 6.1)
29
- activemodel (6.0.3.2)
30
- activesupport (= 6.0.3.2)
31
- activesupport (6.0.3.2)
25
+ active_attr (0.15.3)
26
+ actionpack (>= 3.0.2, < 7.0)
27
+ activemodel (>= 3.0.2, < 7.0)
28
+ activesupport (>= 3.0.2, < 7.0)
29
+ activemodel (6.1.4.1)
30
+ activesupport (= 6.1.4.1)
31
+ activesupport (6.1.4.1)
32
32
  concurrent-ruby (~> 1.0, >= 1.0.2)
33
- i18n (>= 0.7, < 2)
34
- minitest (~> 5.1)
35
- tzinfo (~> 1.1)
36
- zeitwerk (~> 2.2, >= 2.2.2)
37
- addressable (2.7.0)
33
+ i18n (>= 1.6, < 2)
34
+ minitest (>= 5.1)
35
+ tzinfo (~> 2.0)
36
+ zeitwerk (~> 2.3)
37
+ addressable (2.8.0)
38
38
  public_suffix (>= 2.0.2, < 5.0)
39
39
  ansi (1.5.0)
40
40
  builder (3.2.4)
41
41
  coderay (1.1.3)
42
- concurrent-ruby (1.1.6)
43
- crack (0.4.3)
44
- safe_yaml (~> 1.0.0)
42
+ concurrent-ruby (1.1.9)
43
+ crack (0.4.5)
44
+ rexml
45
45
  crass (1.0.6)
46
- erubi (1.9.0)
46
+ erubi (1.10.0)
47
47
  hashdiff (1.0.1)
48
- httparty (0.18.1)
48
+ httparty (0.20.0)
49
49
  mime-types (~> 3.0)
50
50
  multi_xml (>= 0.5.2)
51
- i18n (1.8.3)
51
+ i18n (1.8.10)
52
52
  concurrent-ruby (~> 1.0)
53
- loofah (2.6.0)
53
+ loofah (2.12.0)
54
54
  crass (~> 1.0.2)
55
55
  nokogiri (>= 1.5.9)
56
56
  method_source (1.0.0)
57
57
  mime-types (3.3.1)
58
58
  mime-types-data (~> 3.2015)
59
- mime-types-data (3.2020.0512)
60
- mini_portile2 (2.4.0)
61
- minitest (5.14.1)
59
+ mime-types-data (3.2021.0901)
60
+ minitest (5.14.4)
62
61
  minitest-focus (1.1.2)
63
62
  minitest (>= 4, < 6)
64
- minitest-reporters (1.4.2)
63
+ minitest-reporters (1.4.3)
65
64
  ansi
66
65
  builder
67
66
  minitest (>= 5.0)
68
67
  ruby-progressbar
69
68
  mocha (1.11.2)
70
69
  multi_xml (0.6.0)
71
- nokogiri (1.10.9)
72
- mini_portile2 (~> 2.4.0)
73
- pry (0.13.1)
70
+ nokogiri (1.12.5-arm64-darwin)
71
+ racc (~> 1.4)
72
+ pry (0.14.1)
74
73
  coderay (~> 1.1)
75
74
  method_source (~> 1.0)
76
- public_suffix (4.0.5)
75
+ public_suffix (4.0.6)
76
+ racc (1.5.2)
77
77
  rack (2.2.3)
78
78
  rack-test (1.1.0)
79
79
  rack (>= 1.0, < 3)
80
80
  rails-dom-testing (2.0.3)
81
81
  activesupport (>= 4.2.0)
82
82
  nokogiri (>= 1.6)
83
- rails-html-sanitizer (1.3.0)
83
+ rails-html-sanitizer (1.4.2)
84
84
  loofah (~> 2.3)
85
- rake (13.0.1)
86
- ruby-progressbar (1.10.1)
87
- safe_yaml (1.0.5)
88
- thread_safe (0.3.6)
89
- timecop (0.9.1)
90
- tzinfo (1.2.7)
91
- thread_safe (~> 0.1)
85
+ rake (13.0.6)
86
+ rexml (3.2.5)
87
+ ruby-progressbar (1.11.0)
88
+ timecop (0.9.4)
89
+ tzinfo (2.0.4)
90
+ concurrent-ruby (~> 1.0)
92
91
  webmock (3.8.3)
93
92
  addressable (>= 2.3.6)
94
93
  crack (>= 0.3.2)
95
94
  hashdiff (>= 0.4.0, < 2.0.0)
96
- zeitwerk (2.3.1)
95
+ zeitwerk (2.4.2)
97
96
 
98
97
  PLATFORMS
99
- ruby
98
+ arm64-darwin-20
100
99
 
101
100
  DEPENDENCIES
102
- bundler (~> 1.17)
101
+ bundler (~> 2.2.22)
103
102
  luno!
104
103
  minitest (~> 5.0)
105
104
  minitest-focus (~> 1.1.2)
@@ -111,4 +110,4 @@ DEPENDENCIES
111
110
  webmock (~> 3.8.3)
112
111
 
113
112
  BUNDLED WITH
114
- 1.17.2
113
+ 2.2.22
data/lib/luno/client.rb CHANGED
@@ -22,7 +22,7 @@ module Luno
22
22
 
23
23
  attr_reader :key, :secret, :base_path, :port
24
24
 
25
- def initialize(key:, secret:, base_path: 'https://api.mybitx.com/api/1', port: 80)
25
+ def initialize(key:, secret:, base_path: 'https://api.luno.com/api/1', port: 80)
26
26
  @key = key
27
27
  @secret = secret
28
28
  @base_path = base_path
@@ -12,6 +12,7 @@ module Luno
12
12
  ZMW: 'Zambian Kwacha'
13
13
  }
14
14
 
15
+ # TODO: Update, see: https://www.luno.com/en/countries
15
16
  CURRENCY_PAIRS = [
16
17
  'XBTEUR',
17
18
  'XBTZAR',
@@ -67,4 +68,4 @@ module Luno
67
68
  API_RATE_LIMIT = 5 # per second per ip
68
69
  API_BURST_RATE_LIMIT = 25 # per second per ip
69
70
  end
70
- end
71
+ end
data/lib/luno/orders.rb CHANGED
@@ -1,5 +1,21 @@
1
1
  module Luno
2
2
  module Orders
3
+ def get_fee_information(maker:, taker:)
4
+ path = "fee_info"
5
+ pair = "#{maker}#{taker}".upcase
3
6
 
7
+ # TODO: Validate pair from constants
8
+ authorise_and_send(http_method: :get, path: path, params: { pair: pair })
9
+ end
10
+
11
+ def list_orders
12
+ path = "list_orders"
13
+ authorise_and_send(http_method: :get, path: path)
14
+ end
15
+
16
+ def list_trades
17
+ path = "list_trades"
18
+ authorise_and_send(http_method: :get, path: path)
19
+ end
4
20
  end
5
- end
21
+ end
data/lib/luno/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Luno
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.6"
3
3
  end
data/luno.gemspec CHANGED
@@ -22,12 +22,12 @@ Gem::Specification.new do |spec|
22
22
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
23
23
  spec.require_paths = ["lib"]
24
24
 
25
- spec.add_dependency "httparty", "~> 0.18"
26
- spec.add_dependency "active_attr", "~> 0.15"
27
- spec.add_dependency "nokogiri", "~> 1.10.9"
25
+ spec.add_dependency "httparty", "~> 0.20.0"
26
+ spec.add_dependency "active_attr", "~> 0.15.3"
27
+ spec.add_dependency "nokogiri", "~> 1.12.5"
28
28
 
29
29
  # Development dependancies
30
- spec.add_development_dependency "bundler", "~> 1.17"
30
+ spec.add_development_dependency "bundler", "~> 2.2.22"
31
31
  spec.add_development_dependency "rake", "~> 13.0"
32
32
  spec.add_development_dependency "minitest", "~> 5.0"
33
33
  spec.add_development_dependency "minitest-focus", "~> 1.1.2"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: luno
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - trex22
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-10-25 00:00:00.000000000 Z
11
+ date: 2021-10-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -16,56 +16,56 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.18'
19
+ version: 0.20.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0.18'
26
+ version: 0.20.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: active_attr
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0.15'
33
+ version: 0.15.3
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0.15'
40
+ version: 0.15.3
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: nokogiri
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 1.10.9
47
+ version: 1.12.5
48
48
  type: :runtime
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.10.9
54
+ version: 1.12.5
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: bundler
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '1.17'
61
+ version: 2.2.22
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '1.17'
68
+ version: 2.2.22
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rake
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -186,6 +186,7 @@ executables: []
186
186
  extensions: []
187
187
  extra_rdoc_files: []
188
188
  files:
189
+ - ".github/workflows/semgrep.yml"
189
190
  - ".gitignore"
190
191
  - ".ruby-version"
191
192
  - CODE_OF_CONDUCT.md
@@ -233,7 +234,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
233
234
  - !ruby/object:Gem::Version
234
235
  version: '0'
235
236
  requirements: []
236
- rubygems_version: 3.1.4
237
+ rubygems_version: 3.2.22
237
238
  signing_key:
238
239
  specification_version: 4
239
240
  summary: A client for using the Luno API in Ruby.