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 +4 -4
- data/README.md +12 -12
- data/lib/cmc/base.rb +0 -16
- data/lib/cmc/resources/exchange.rb +10 -4
- data/lib/cmc/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: c1b43fea2f1d24084bf8642ec05d3397541b49a3bbf0baa54508ec4190d670f9
|
4
|
+
data.tar.gz: 9093e29ff3238ac781c6f8c4826a47a6d21ae4f98100d226c1eb277671a76160
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
-
-
|
8
|
-
-
|
9
|
-
-
|
10
|
-
-
|
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-
|
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
|
-
|
30
|
-
response =
|
29
|
+
c = Cmc::Exchange.new({:slug => 'bitcoin'})
|
30
|
+
response = c.list
|
31
31
|
|
32
|
-
puts response
|
33
|
-
puts response[
|
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-
|
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.
|
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
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
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
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.
|
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
|
@@ -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.
|
216
|
+
summary: cmc v-0.0.1
|
217
217
|
test_files: []
|