aga-cmc 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: 818692734e778568df44f917306f0b1e8f9e4599f6b3ebca18a197526cc31f95
4
- data.tar.gz: 4c609c8d6fa45c27b195b3495ee4b47c273d23fe92fe0c247c5615f26429da13
3
+ metadata.gz: c1b43fea2f1d24084bf8642ec05d3397541b49a3bbf0baa54508ec4190d670f9
4
+ data.tar.gz: 9093e29ff3238ac781c6f8c4826a47a6d21ae4f98100d226c1eb277671a76160
5
5
  SHA512:
6
- metadata.gz: b0a072c8e1bba0b4e321e92cb988a747eb2aa97d42ca3c4ba2b2a316d2eba0738876fe01a511477e73447e03c11f364065b3d525dfa58ed4d07335070a3740c4
7
- data.tar.gz: 82b1ec59babc535fe4288522a57769e8f3d6ef5b85f643eaa3ed4d5def332f53fdc15b4ef27efb1d965b46a3cdee8f4b13867f6b60d2ffe627a63bc31f64db0f
6
+ metadata.gz: 536f76ee8af74ea41a170468da0563141957bfe9353d65664c254e824ca679caf23e3103f8eafd592702ac438f4fe5d2fc20b0271cae1cff0234e4548d6845c7
7
+ data.tar.gz: e760394873ab59e5f0564bb21481553d8b15797a60f0f86b99aef18b2d720c4cf4a4ef525985650ff986e3106553a4cef4c89eef0aa49b3746003d6d94a38805
data/README.md CHANGED
@@ -1,13 +1,13 @@
1
1
  # Aga-cmc
2
2
 
3
- Aga request is a Ruby gem that provides a convenient way to make HTTP requests, including passing parameters, headers, and more. It simplifies the process of interacting with APIs and web services and handles the complexities of handling HTTP requests and responses.
3
+ Aga-cmc is a Ruby gem that provides a convenient way to interact with the CoinMarketCap API and retrieve information about cryptocurrency exchanges. It allows you to fetch data about exchanges, including trading pairs, trading volume, and other relevant information.
4
4
 
5
5
  ## Features
6
6
 
7
- - Make GET, POST, PUT, DELETE, and other HTTP requests easily.
8
- - Pass parameters and headers with the requests.
9
- - Handle response parsing automatically, returning JSON responses.
10
- - Get access to the response status, headers, and body.
7
+ - Retrieve detailed information about a specific exchange, including its name, website, and location.
8
+ - Fetch trading pairs supported by an exchange, along with their trading volumes and price information.
9
+ - Filter exchanges based on specific criteria, such as volume, location, or supported trading pairs.
10
+ - Access real-time market data for exchanges, including trading volume, liquidity, and more.
11
11
 
12
12
  ## Installation
13
13
 
@@ -21,27 +21,27 @@ If bundler is not being used to manage dependencies, install the gem by executin
21
21
 
22
22
  ## Usage
23
23
 
24
- To use Aga-request in your application, require the gem and start making requests. Here's a basic example:
24
+ To use Aga-cmc in your application, require the gem and start making requests. Here's a basic example:
25
25
 
26
26
  ```
27
27
  require 'cmc'
28
28
 
29
- r = Request::Http.new
30
- response = r.get('https://api.example.com/resource', { 'key' => 'value' }, { 'Authorization' => 'Bearer TOKEN' })
29
+ c = Cmc::Exchange.new({:slug => 'bitcoin'})
30
+ response = c.list
31
31
 
32
- puts response[:status] # Output: true or false
33
- puts response[:response] # Output: {"data": "example"}
32
+ puts response.status # Output: 200
33
+ puts response.body.data.marketPairs[0].exchangeName # Output: 'Binance'
34
34
 
35
35
  ```
36
36
 
37
37
  ## Contributing
38
38
 
39
- Contributions to Aga-request are welcome! If you encounter any issues or have suggestions for improvements, please submit an issue on the repository. Pull requests are also encouraged.
39
+ Contributions to Aga-cmc are welcome! If you encounter any issues or have suggestions for improvements, please submit an issue on the repository. Pull requests are also encouraged.
40
40
 
41
41
 
42
42
  ## Private License
43
43
 
44
- Version 0.0.2, 01/06/2023
44
+ Version 0.0.3, 01/06/2023
45
45
 
46
46
  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.
47
47
 
data/lib/cmc/base.rb CHANGED
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'request'
4
- require 'uri'
5
4
 
6
5
  module Cmc
7
6
  class Base
@@ -9,21 +8,6 @@ module Cmc
9
8
  attr_accessor :app_info, :path_prefix
10
9
 
11
10
  def initialize; end
12
-
13
- def request
14
- Request::Http.new
15
- end
16
-
17
- def headers
18
- { 'Content-Type' => 'application/json' }
19
- end
20
-
21
- private
22
-
23
- def build_url(path, params)
24
- query = URI.encode_www_form(params)
25
- "#{Cmc::Base.path_prefix}#{path}?#{query}"
26
- end
27
11
  end
28
12
 
29
13
  self.app_info = ::ENV['APP_INFO'] || "#{::Cmc::NAME} V#{::Cmc.version}"
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'ostruct'
4
+
3
5
  module Cmc
4
6
  class Exchange
5
7
  LIMIT = 1000
@@ -13,10 +15,14 @@ module Cmc
13
15
  end
14
16
 
15
17
  def list
16
- url = Cmc::Base.send(:build_url, '', slug: @slug, start: @start,
17
- quoteCurrencyId: @quote, limit: @limit, category: 'spot',
18
- centerType: 'all', sort: 'cmc_rank_advanced')
19
- Cmc::Base.request.get(url, headers: Cmc::Base.headers)
18
+ options = OpenStruct.new(http_method: 'get', url: Cmc::Base.path_prefix,
19
+ headers: { 'Content-Type' => 'application/json' }, data: {},
20
+ params: {
21
+ slug: @slug, start: @start, quoteCurrencyId: @quote, limit: @limit,
22
+ category: 'spot', centerType: 'all', sort: 'cmc_rank_advanced'
23
+ }, auth: nil, proxy: nil, options: {})
24
+
25
+ Request::Client.request(options)
20
26
  end
21
27
  end
22
28
  end
data/lib/cmc/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Cmc
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-cmc
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-03 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
@@ -213,5 +213,5 @@ requirements: []
213
213
  rubygems_version: 3.3.24
214
214
  signing_key:
215
215
  specification_version: 4
216
- summary: cmc v-0.0.0
216
+ summary: cmc v-0.0.1
217
217
  test_files: []