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 +4 -4
- data/README.md +6 -6
- data/lib/bnb/base.rb +3 -12
- data/lib/bnb/resources/all.rb +8 -2
- data/lib/bnb/resources/gainer.rb +8 -2
- data/lib/bnb/resources/new.rb +8 -2
- data/lib/bnb/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fddd5db9661e090fdecdfdea5e8b20fca2bcbe2df8a8ace05d36e11661a121cf
|
4
|
+
data.tar.gz: f2199e6cbb6d113a0337b4e8cfea5c4ae119d86e466bb6c336d1d262deec70e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
-
|
29
|
-
response =
|
28
|
+
b = Bnb::Gainer.new
|
29
|
+
response = b.list
|
30
30
|
|
31
|
-
puts response
|
32
|
-
puts response
|
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.
|
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 '
|
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
|
24
|
-
|
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
|
|
data/lib/bnb/resources/all.rb
CHANGED
@@ -10,8 +10,14 @@ module Bnb
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def list
|
13
|
-
url = Bnb::Base.send(:build_url, '/listings/latest'
|
14
|
-
|
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
|
data/lib/bnb/resources/gainer.rb
CHANGED
@@ -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'
|
14
|
-
|
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
|
data/lib/bnb/resources/new.rb
CHANGED
@@ -10,8 +10,14 @@ module Bnb
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def list
|
13
|
-
url = Bnb::Base.send(:build_url, '/listings/new'
|
14
|
-
|
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
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.
|
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-
|
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.
|
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.
|
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.
|
218
|
+
summary: bnb v.0.0.1
|
219
219
|
test_files: []
|