aga-bnb 0.0.0 → 0.0.1

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: 214c3ce010d94cff9c9a5ffb49acf832b7d7d828b22a9fb91d229edd1616060e
4
- data.tar.gz: 06125c79a378ec9e18fba11bde9ed81d8ba4db6737054ed0ee2ded0e1d6c7433
3
+ metadata.gz: fddd5db9661e090fdecdfdea5e8b20fca2bcbe2df8a8ace05d36e11661a121cf
4
+ data.tar.gz: f2199e6cbb6d113a0337b4e8cfea5c4ae119d86e466bb6c336d1d262deec70e9
5
5
  SHA512:
6
- metadata.gz: c9e8bdc27a01a3689c757cea2a933b3d57af234daa0a80bbc21fdd1ba3ee8d7aa11992b5e5516497b4a4445c90e5ffa12435f756fc9351590c5c1b5f4a372e3b
7
- data.tar.gz: c033ed7ccdfe0b5d59f56a79275a4de32579e9de36a7bd1d7ff32052d9b2c595ccf3257c8ef14f580379fee42df42e4a5159f06ee2c0141a52cdaec2c605972f
6
+ metadata.gz: d73772cbce3e012845c5ce47b691aa35b86622a380612c0ed1fdcf92583be2030563074e3d01ccf79de5dae0dafb94d9885991fc2e0d5e5befe55a2ef4d4882c
7
+ data.tar.gz: c969c44f32eb4be3d46ff354aaae069ec521367ddb925bb79fa81837651a751220dd038549ef89ad12d2a3d33d2ea9204aa48054b02968a2b1367c31006c14ee
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Aga-bnb
2
2
 
3
- Aga request is a Ruby gem that provides a convenient way to interact with the Binance API. It allows you to retrieve information about new cryptocurrencies, all cryptocurrencies, and gainers (cryptocurrencies with price gains) from the Binance exchange.
3
+ Aga bnb is a Ruby gem that provides a convenient way to interact with the Binance API. It allows you to retrieve information about new cryptocurrencies, all cryptocurrencies, and gainers (cryptocurrencies with price gains) from the Binance exchange.
4
4
 
5
5
  ## Features
6
6
 
@@ -25,11 +25,11 @@ To use Aga-request in your application, require the gem and start making request
25
25
  ```
26
26
  require 'bnb'
27
27
 
28
- r = Request::Http.new
29
- response = r.get('https://api.example.com/resource', { 'key' => 'value' }, { 'Authorization' => 'Bearer TOKEN' })
28
+ b = Bnb::Gainer.new
29
+ response = b.list
30
30
 
31
- puts response[:status] # Output: true or false
32
- puts response[:response] # Output: {"data": "example"}
31
+ puts response.status # Output: 200
32
+ puts response.body.data.body.data.first.symbol # Output: 'TRUMP'
33
33
 
34
34
  ```
35
35
 
@@ -40,7 +40,7 @@ Contributions to Aga-bnb are welcome! If you encounter any issues or have sugges
40
40
 
41
41
  ## Private License
42
42
 
43
- Version 0.0.0, 01/06/2023
43
+ Version 0.0.1, 25/08/2023
44
44
 
45
45
  By obtaining a copy of this software and associated documentation files (the "Software"), you agree that the Software is proprietary to AIGreenAnt and is protected under intellectual property laws. This license grants you limited rights to use the Software solely for internal purposes within your organization.
46
46
 
data/lib/bnb/base.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'request'
4
- require 'uri'
4
+ require 'ostruct'
5
5
 
6
6
  module Bnb
7
7
  class Base
@@ -10,19 +10,10 @@ module Bnb
10
10
 
11
11
  def initialize; end
12
12
 
13
- def request
14
- Request::Http.new
15
- end
16
-
17
- def headers
18
- { 'Content-Type' => 'application/json' }
19
- end
20
-
21
13
  private
22
14
 
23
- def build_url(path, params)
24
- query = URI.encode_www_form(params)
25
- "#{Bnb::Base.path_prefix}#{path}?#{query}"
15
+ def build_url(path)
16
+ "#{Bnb::Base.path_prefix}#{path}"
26
17
  end
27
18
  end
28
19
 
@@ -10,8 +10,14 @@ module Bnb
10
10
  end
11
11
 
12
12
  def list
13
- url = Bnb::Base.send(:build_url, '/listings/latest', limit: @limit, start: @start)
14
- Bnb::Base.request.get(url, headers: Bnb::Base.headers)
13
+ url = Bnb::Base.send(:build_url, '/listings/latest')
14
+ options = OpenStruct.new(http_method: 'get', url: url,
15
+ headers: { 'Content-Type' => 'application/json' }, data: {},
16
+ params: {
17
+ start: @start, limit: @limit
18
+ }, auth: nil, proxy: nil, options: {})
19
+
20
+ Request::Client.request(options)
15
21
  end
16
22
  end
17
23
  end
@@ -10,8 +10,14 @@ module Bnb
10
10
  end
11
11
 
12
12
  def list
13
- url = Bnb::Base.send(:build_url, '/trending/gainers-losers', sort_dir: 'desc', limit: @limit, start: @start)
14
- Bnb::Base.request.get(url, headers: Bnb::Base.headers)
13
+ url = Bnb::Base.send(:build_url, '/trending/gainers-losers')
14
+ options = OpenStruct.new(http_method: 'get', url: url,
15
+ headers: { 'Content-Type' => 'application/json' }, data: {},
16
+ params: {
17
+ start: @start, limit: @limit, sort_dir: 'desc'
18
+ }, auth: nil, proxy: nil, options: {})
19
+
20
+ Request::Client.request(options)
15
21
  end
16
22
  end
17
23
  end
@@ -10,8 +10,14 @@ module Bnb
10
10
  end
11
11
 
12
12
  def list
13
- url = Bnb::Base.send(:build_url, '/listings/new', limit: @limit, start: @start)
14
- Bnb::Base.request.get(url, headers: Bnb::Base.headers)
13
+ url = Bnb::Base.send(:build_url, '/listings/new')
14
+ options = OpenStruct.new(http_method: 'get', url: url,
15
+ headers: { 'Content-Type' => 'application/json' }, data: {},
16
+ params: {
17
+ start: @start, limit: @limit
18
+ }, auth: nil, proxy: nil, options: {})
19
+
20
+ Request::Client.request(options)
15
21
  end
16
22
  end
17
23
  end
data/lib/bnb/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bnb
4
- VERSION = '0.0.0'
4
+ VERSION = '0.0.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aga-bnb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 0.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefano Baldazzi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-01 00:00:00.000000000 Z
11
+ date: 2023-08-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: zeitwerk
@@ -156,14 +156,14 @@ dependencies:
156
156
  requirements:
157
157
  - - "~>"
158
158
  - !ruby/object:Gem::Version
159
- version: 0.0.2
159
+ version: 0.0.3
160
160
  type: :development
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - "~>"
165
165
  - !ruby/object:Gem::Version
166
- version: 0.0.2
166
+ version: 0.0.3
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: pry
169
169
  requirement: !ruby/object:Gem::Requirement
@@ -215,5 +215,5 @@ requirements: []
215
215
  rubygems_version: 3.3.24
216
216
  signing_key:
217
217
  specification_version: 4
218
- summary: bnb v.0.0.0
218
+ summary: bnb v.0.0.1
219
219
  test_files: []