solscan_api_ruby 1.0.0.pre

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: e3645e722bdb9887561e0642d3a03dc4d9a1d102b89ddde6456df249633f0c56
4
+ data.tar.gz: 3bc3831db0bda733bc23720d7b17bb7c7ede5420c2aa82f40285c440ff6c2ac6
5
+ SHA512:
6
+ metadata.gz: ed9991e1751e0a0e28ffef256d9df2c60dcec3ada6a873c62ee219d40d79881437f7849511130abc2ab45dbeba1e3dbabe2a06bd0b43ce6bb5d5f09c7714968b
7
+ data.tar.gz: 787092d4b8583298a7e73ff49c0a9e1d735edfca99de68c2cfaf9b5dd8a0b7a1e575a94ae9741f5fa992a7642cfb9b774fcf1c33f0e79b4d04fbc1808fdaf17b
@@ -0,0 +1,77 @@
1
+
2
+ # Contributor Covenant Code of Conduct
3
+
4
+ ## Our Pledge
5
+
6
+ In the interest of fostering an open and welcoming environment, we as
7
+ contributors and maintainers pledge to make participation in our project and
8
+ our community a harassment-free experience for everyone, regardless of age, body
9
+ size, disability, ethnicity, sex characteristics, gender identity and expression,
10
+ level of experience, education, socio-economic status, nationality, personal
11
+ appearance, race, religion, or sexual identity and orientation.
12
+
13
+ ## Our Standards
14
+
15
+ Examples of behavior that contributes to creating a positive environment
16
+ include:
17
+
18
+ * Using welcoming and inclusive language
19
+ * Being respectful of differing viewpoints and experiences
20
+ * Gracefully accepting constructive criticism
21
+ * Focusing on what is best for the community
22
+ * Showing empathy towards other community members
23
+
24
+ Examples of unacceptable behavior by participants include:
25
+
26
+ * The use of sexualized language or imagery and unwelcome sexual attention or
27
+ advances
28
+ * Trolling, insulting/derogatory comments, and personal or political attacks
29
+ * Public or private harassment
30
+ * Publishing others' private information, such as a physical or electronic
31
+ address, without explicit permission
32
+ * Other conduct which could reasonably be considered inappropriate in a
33
+ professional setting
34
+
35
+ ## Our Responsibilities
36
+
37
+ Project maintainers are responsible for clarifying the standards of acceptable
38
+ behavior and are expected to take appropriate and fair corrective action in
39
+ response to any instances of unacceptable behavior.
40
+
41
+ Project maintainers have the right and responsibility to remove, edit, or
42
+ reject comments, commits, code, wiki edits, issues, and other contributions
43
+ that are not aligned to this Code of Conduct, or to ban temporarily or
44
+ permanently any contributor for other behaviors that they deem inappropriate,
45
+ threatening, offensive, or harmful.
46
+
47
+ ## Scope
48
+
49
+ This Code of Conduct applies within all project spaces, and it also applies when
50
+ an individual is representing the project or its community in public spaces.
51
+ Examples of representing a project or community include using an official
52
+ project e-mail address, posting via an official social media account, or acting
53
+ as an appointed representative at an online or offline event. Representation of
54
+ a project may be further defined and clarified by project maintainers.
55
+
56
+ ## Enforcement
57
+
58
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
59
+ reported by contacting the project team at [INSERT EMAIL ADDRESS]. All
60
+ complaints will be reviewed and investigated and will result in a response that
61
+ is deemed necessary and appropriate to the circumstances. The project team is
62
+ obligated to maintain confidentiality with regard to the reporter of an incident.
63
+ Further details of specific enforcement policies may be posted separately.
64
+
65
+ Project maintainers who do not follow or enforce the Code of Conduct in good
66
+ faith may face temporary or permanent repercussions as determined by other
67
+ members of the project's leadership.
68
+
69
+ ## Attribution
70
+
71
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
72
+ available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
73
+
74
+ [homepage]: https://www.contributor-covenant.org
75
+
76
+ For answers to common questions about this code of conduct, see
77
+ https://www.contributor-covenant.org/faq
@@ -0,0 +1,14 @@
1
+ # Contributing
2
+
3
+ 1. [Fork the repository.][fork]
4
+ 2. [Create a topic branch.][branch]
5
+ 3. Implement your feature or bug fix.
6
+ 4. Don't forget to add specs and make sure they pass by running `rspec .`.
7
+ 5. Make sure your code complies with the style guide by running `rubocop`. `rubocop -a` can automatically fix most issues for you.
8
+ 6. If necessary, add documentation for your feature or bug fix.
9
+ 7. Commit and push your changes.
10
+ 8. [Submit a pull request.][pr]
11
+
12
+ [fork]: http://help.github.com/fork-a-repo/
13
+ [branch]: https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-branches
14
+ [pr]: https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests
@@ -0,0 +1,11 @@
1
+ ### Summary
2
+
3
+ Provide a general description of the code changes in your pull
4
+ request. Were there any bugs you had fixed? If so, mention them. If
5
+ these bugs have open GitHub issues, be sure to tag them here as well,
6
+ to keep the conversation linked together.
7
+
8
+ ### Other Information
9
+
10
+ If there's anything else that's important and relevant to your pull
11
+ request, mention that information here.
data/CHANGELOG.md ADDED
@@ -0,0 +1,3 @@
1
+ # Changelog
2
+ ## 1.0.0.pre (31-Jan-22)
3
+ * Initial release
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ # lokalise_rails/Gemfile
2
+ source 'http://rubygems.org'
3
+
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Block Logic
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,37 @@
1
+
2
+
3
+ ![specs](https://github.com/Block-Logic/solscan-api-ruby/actions/workflows/specs.yml/badge.svg)
4
+ ![Maintained](https://img.shields.io/badge/Maintained%3F-yes-green.svg)
5
+ ![Last Commit](https://img.shields.io/github/last-commit/Block-Logic/solscan-api-ruby)
6
+ ![Tag](https://img.shields.io/github/v/tag/Block-Logic/solscan-api-ruby)
7
+ ![Stars](https://img.shields.io/github/stars/Block-Logic/solscan-api-ruby.svg)
8
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
9
+ # solscan-api-ruby
10
+ Ruby Client for the Solscan API. This gem provides a wrapper methods for Solscan API https://public-api.solscan.io/docs
11
+
12
+ ## Getting started
13
+
14
+ ### Requirements
15
+
16
+ This gem requires Ruby 2.6+. It MIGHT work with lower versions, but was not tested with them.
17
+ Add the following line to your Gemfile:
18
+
19
+ ```ruby
20
+ gem 'solscan_api_ruby'
21
+ ```
22
+
23
+ Then run `bundle install`
24
+
25
+ ### Usage examples
26
+
27
+ #### Solscan API
28
+ ```ruby
29
+ # If you set default cluster you don't need to pass it every time.
30
+ method_wrapper = SolscanApiRuby::Methods.new
31
+
32
+ response = method_wrapper.block_last
33
+ puts response
34
+ ```
35
+
36
+ ### Tip
37
+ There is a limit of 50 records mentioned in Solscan docs for some endpoints, but you can try get a bit more than this.
data/Rakefile ADDED
@@ -0,0 +1,7 @@
1
+ require 'rake'
2
+ require 'rubocop/rake_task'
3
+
4
+ RuboCop::RakeTask.new do |task|
5
+ task.requires << 'rubocop-performance'
6
+ task.requires << 'rubocop-rspec'
7
+ end
@@ -0,0 +1,33 @@
1
+ require 'oj'
2
+
3
+ module SolscanApiRuby
4
+ module Client
5
+ ##
6
+ # ApiError is a wrapper class for errors.
7
+ #
8
+ class ApiError < StandardError
9
+ # Error code.
10
+ # @return [Integer]
11
+ attr_reader :status
12
+
13
+ # Error message.
14
+ # @return [Hash]
15
+ attr_reader :error
16
+
17
+ # Initialize object with json response from the API with error.
18
+ #
19
+ # @param api_response [Object]
20
+ #
21
+ # @return [SolscanApiRuby::Client::ApiError]
22
+ def initialize(api_response)
23
+ body = Oj.load(api_response.body)
24
+
25
+ @error = body['error']
26
+ @status = body['status']
27
+ rescue Oj::ParseError
28
+ @error = api_response.body
29
+ @status = api_response.status
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,20 @@
1
+ module SolscanApiRuby
2
+ module Client
3
+ class Base
4
+ attr_accessor :api_url
5
+
6
+ def initialize(api_url: SolscanApiRuby::API_URL)
7
+ @api_url = api_url
8
+ end
9
+
10
+ def call_api
11
+ raise 'Method call_api needs to be implemented in child class'
12
+ end
13
+
14
+ protected
15
+ def create_endpoint_url(endpoint)
16
+ "#{@api_url}/#{endpoint}"
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,39 @@
1
+ require 'faraday'
2
+ require 'faraday/net_http'
3
+ require 'oj'
4
+ require 'pry'
5
+
6
+ require_relative "http_codes"
7
+ require_relative "api_error"
8
+
9
+ module SolscanApiRuby
10
+
11
+ module Client
12
+ class FaradayClient < Base
13
+ include SolscanApiRuby::Client::HttpCodes
14
+
15
+ Faraday.default_adapter = :net_http
16
+
17
+ def call_api(endpoint:, http_method:, params: {})
18
+ endpoint_url = create_endpoint_url(endpoint)
19
+
20
+ api_response = client.public_send(http_method, endpoint_url, params)
21
+ if api_response.status == HTTP_OK_CODE
22
+ Response.new(api_response)
23
+ else
24
+ fail ApiError.new(api_response)
25
+ end
26
+ end
27
+
28
+ private
29
+
30
+ def client
31
+ Faraday.new(@api_url) do |client|
32
+ client.request :url_encoded
33
+ client.adapter Faraday.default_adapter
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
39
+
@@ -0,0 +1,13 @@
1
+ module SolscanApiRuby
2
+ module Client
3
+ module HttpCodes
4
+ HTTP_OK_CODE = 200
5
+ HTTP_BAD_REQUEST_CODE = 400
6
+ HTTP_UNAUTHORIZED_CODE = 401
7
+ HTTP_FORBIDDEN_CODE = 403
8
+ HTTP_NOT_FOUND_CODE = 404
9
+ HTTP_UNPROCESSABLE_ENTITY_CODE = 429
10
+ HTTP_INTERNAL_SERVER_ERROR = 500
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,43 @@
1
+ require 'oj'
2
+ require_relative 'http_codes'
3
+
4
+ module SolscanApiRuby
5
+ module Client
6
+ ##
7
+ # Response class parses response from the API to the more convenient format.
8
+ #
9
+ class Response
10
+ include HttpCodes
11
+
12
+ # Initialize object with response body in json format.
13
+ #
14
+ # @param response [Hash] hash with response from the API.
15
+ def initialize(response)
16
+ @response = response
17
+ end
18
+
19
+ # @return [Hash] parsed response body.
20
+ def body
21
+ @body ||= Oj.load(@response.body)
22
+
23
+ rescue Oj::ParseError
24
+ @response.body
25
+ end
26
+
27
+ # @return [Hash] response headers.
28
+ def headers
29
+ @response.headers
30
+ end
31
+
32
+ # @return [Integer] response status.
33
+ def status
34
+ @response.status
35
+ end
36
+
37
+ # @return [Boolean] response success.
38
+ def successfull?
39
+ @response.success?
40
+ end
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,14 @@
1
+ module SolscanApiRuby
2
+ module Methods
3
+ class Base
4
+ def initialize(api_client: SolscanApiRuby::Client::FaradayClient)
5
+ @api_client = api_client
6
+ end
7
+
8
+ protected
9
+ def create_endpoint_from_method(method)
10
+ method.to_s.split("_").join("/")
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,304 @@
1
+ module SolscanApiRuby
2
+ module Methods
3
+ class Public < Base
4
+ # @see https://public-api.solscan.io/docs/#/Block/get_block_last
5
+ #
6
+ # Get last [limit] blocks
7
+ #
8
+ # @param limit [Integer]
9
+ #
10
+ # @return [Response, ApiError] Response when success, ApiError on failure.
11
+ def block_last(limit: nil)
12
+ params = {}
13
+
14
+ params[:limit] = limit if limit
15
+
16
+ send_request(__method__, params: params)
17
+ end
18
+
19
+ # @see https://public-api.solscan.io/docs/#/Block/get_block_transactions
20
+ #
21
+ # Get block transactions. MaxLimit 50 records per request
22
+ #
23
+ # @param block [Integer]
24
+ # @param offset [Integer]
25
+ # @param limit [Integer]
26
+ #
27
+ # @return [Response, ApiError] Response when success, ApiError on failure.
28
+ def block_transactions(block, offset: nil, limit: nil)
29
+ params = {}
30
+
31
+ params[:block] = block
32
+ params[:offset] = offset if offset
33
+ params[:limit] = limit if limit
34
+
35
+ send_request(__method__, params: params)
36
+ end
37
+
38
+ # @see https://public-api.solscan.io/docs/#/Block/get_block__block_
39
+ #
40
+ # Detail information of given block
41
+ #
42
+ # @param block [Integer]
43
+ #
44
+ # @return [Response, ApiError] Response when success, ApiError on failure.
45
+ def block(block)
46
+ method = "#{__method__}/#{block}"
47
+
48
+ send_request(method)
49
+ end
50
+
51
+ # @see https://public-api.solscan.io/docs/#/Transaction/get_transaction_last
52
+ #
53
+ # Get last [limit] transactions
54
+ #
55
+ # @param limit [Integer]
56
+ #
57
+ # @return [Response, ApiError] Response when success, ApiError on failure.
58
+ def transaction_last(limit: nil)
59
+ params = {}
60
+
61
+ params[:limit] = limit if limit
62
+
63
+ send_request(__method__, params: params)
64
+ end
65
+
66
+ # @see https://public-api.solscan.io/docs/#/Transaction/get_transaction__signature_
67
+ #
68
+ # Detail information of given transaction signature
69
+ #
70
+ # @param signature [String]
71
+ #
72
+ # @return [Response, ApiError] Response when success, ApiError on failure.
73
+ def transaction(signature)
74
+ method = "#{__method__}/#{signature}"
75
+
76
+ send_request(method)
77
+ end
78
+
79
+ # @see https://public-api.solscan.io/docs/#/Account/get_account_tokens
80
+ #
81
+ # Get token balances of the given account
82
+ #
83
+ # @param account [String]
84
+ #
85
+ # @return [Response, ApiError] Response when success, ApiError on failure.
86
+ def account_tokens(account)
87
+ params = {}
88
+
89
+ params[:account] = account if account
90
+
91
+ send_request(__method__, params: params)
92
+ end
93
+
94
+ # @see https://public-api.solscan.io/docs/#/Account/get_account_transactions
95
+ #
96
+ # Get list of transactions of the given account. MaxLimit 50 records per request
97
+ #
98
+ # @param account [String]
99
+ # @param beforeHash [String]
100
+ # @param limit [String]
101
+ #
102
+ # @return [Response, ApiError] Response when success, ApiError on failure.
103
+ def account_transactions(account, before_hash: '', limit: nil)
104
+ params = {}
105
+
106
+ params[:account] = account
107
+ params[:before_hash] = before_hash if before_hash
108
+ params[:limit] = limit if limit
109
+
110
+ send_request(__method__, params: params)
111
+ end
112
+
113
+ # @see https://public-api.solscan.io/docs/#/Account/get_account_stakeAccounts
114
+ #
115
+ # Get staking accounts of the given account
116
+ #
117
+ # @param account [String]
118
+ #
119
+ # @return [Response, ApiError] Response when success, ApiError on failure.
120
+ def account_stakeAccounts(account)
121
+ params = {}
122
+
123
+ params[:account] = account if account
124
+
125
+ send_request(__method__, params: params)
126
+ end
127
+
128
+ # @see https://public-api.solscan.io/docs/#/Account/get_account_splTransfers
129
+ #
130
+ # Get list of transactions make tokenBalance changes. MaxLimit 50 records per request
131
+ #
132
+ # @param account [String]
133
+ # @param fromTime [Integer]
134
+ # @param toTime [Integer]
135
+ # @param offset [Integer]
136
+ # @param limit [Integer]
137
+ #
138
+ # @return [Response, ApiError] Response when success, ApiError on failure.
139
+ def account_splTransfers(account, from_time: nil, to_time: nil, offset: nil, limit: nil)
140
+ params = {}
141
+
142
+ params[:account] = account
143
+ params[:fromTime] = from_time if from_time
144
+ params[:toTime] = to_time if to_time
145
+ params[:offset] = offset if offset
146
+ params[:limit] = limit if limit
147
+
148
+ send_request(__method__, params: params)
149
+ end
150
+
151
+ # @see https://public-api.solscan.io/docs/#/Account/get_account_solTransfers
152
+ #
153
+ # Get list of transactions make tokenBalance changes. MaxLimit 50 records per request
154
+ #
155
+ # @param account [String]
156
+ # @param fromTime [Integer]
157
+ # @param toTime [Integer]
158
+ # @param offset [Integer]
159
+ # @param limit [Integer]
160
+ #
161
+ # @return [Response, ApiError] Response when success, ApiError on failure.
162
+ def account_solTransfers(account, from_time: nil, to_time: nil, offset: nil, limit: nil)
163
+ params = {}
164
+
165
+ params[:account] = account
166
+ params[:fromTime] = from_time if from_time
167
+ params[:toTime] = to_time if to_time
168
+ params[:offset] = offset if offset
169
+ params[:limit] = limit if limit
170
+
171
+ send_request(__method__, params: params)
172
+ end
173
+
174
+ # @see https://public-api.solscan.io/docs/#/Account/get_account_exportTransactions
175
+ #
176
+ # Export transactions to CSV. MaxLimit 5000 records per request
177
+ #
178
+ # @param account [String]
179
+ # @param type [String] Allowed types: tokenchange | soltransfer | all
180
+ # @param fromTime [Integer]
181
+ # @param toTime [Integer]
182
+ #
183
+ # @return [Response, ApiError] Response when success, ApiError on failure.
184
+ def account_exportTransactions(account, type:, from_time:, to_time:)
185
+ params = {}
186
+
187
+ params[:account] = account
188
+ params[:type] = type
189
+ params[:fromTime] = from_time
190
+ params[:toTime] = to_time
191
+
192
+ send_request(__method__, params: params)
193
+ end
194
+
195
+ # @see https://public-api.solscan.io/docs/#/Account/get_account__account_
196
+ #
197
+ # Get overall account information, including program account, NFT metadata information
198
+ #
199
+ # @param account [String]
200
+ #
201
+ # @return [Response, ApiError] Response when success, ApiError on failure.
202
+ def account(account)
203
+ method = "#{__method__}/#{account}"
204
+
205
+ send_request(method)
206
+ end
207
+
208
+
209
+ # @see https://public-api.solscan.io/docs/#/Token/get_token_holders
210
+ #
211
+ # Get token holders
212
+ #
213
+ # @param token_address [String]
214
+ # @param offset [Integer]
215
+ # @param limit [Integer]
216
+ #
217
+ # @return [Response, ApiError] Response when success, ApiError on failure.
218
+ def token_holders(token_address, offset: nil, limit: nil)
219
+ params = {}
220
+
221
+ params[:tokenAddress] = token_address
222
+ params[:offset] = offset if offset
223
+ params[:limit] = limit if limit
224
+
225
+ send_request(__method__, params: params)
226
+ end
227
+
228
+ # @see https://public-api.solscan.io/docs/#/Token/get_token_meta
229
+ #
230
+ # Get metadata of given token.
231
+ #
232
+ # @param token_address [String]
233
+ #
234
+ # @return [Response, ApiError] Response when success, ApiError on failure.
235
+ def token_meta(token_address)
236
+ params = {}
237
+
238
+ params[:tokenAddress] = token_address
239
+
240
+ send_request(__method__, params: params)
241
+ end
242
+
243
+ # @see https://public-api.solscan.io/docs/#/Token/get_token_list
244
+ #
245
+ # Get list of tokens. MaxLimit 50 records per request.
246
+ #
247
+ # @param sort_by [String] Available values : market_cap, volume, holder,
248
+ # price, price_change_24h, price_change_7d,
249
+ # price_change_14d, price_change_30d,
250
+ # price_change_60d, price_change_200d,
251
+ # price_change_1y
252
+ #
253
+ # @param direction [String] desc or asc, default desc
254
+ # @param limit [Integer]
255
+ # @param offset [Integer]
256
+ #
257
+ # @return [Response, ApiError] Response when success, ApiError on failure.
258
+ def token_list(sort_by: 'market_cap', direction: 'desc', limit: nil, offset: nil)
259
+ params = {}
260
+
261
+ params[:sortBy] = sort_by if sort_by
262
+ params[:direction] = direction if direction
263
+ params[:limit] = limit if limit
264
+ params[:offset] = offset if offset
265
+
266
+ send_request(__method__, params: params)
267
+ end
268
+
269
+ # @see https://public-api.solscan.io/docs/#/Market/get_market_token__tokenAddress_
270
+ #
271
+ # Get market information of the given token
272
+ #
273
+ # @param token_address [String]
274
+ #
275
+ # @return [Response, ApiError] Response when success, ApiError on failure.
276
+ def market_token(token_address)
277
+ method = "#{__method__}/#{token_address}"
278
+
279
+ send_request(method)
280
+ end
281
+
282
+ # @see https://public-api.solscan.io/docs/#/Chain%20Information/get_chaininfo_
283
+ #
284
+ # Blockchain overall information
285
+ #
286
+ # @return [Response, ApiError] Response when success, ApiError on failure.
287
+ def chaininfo
288
+ send_request(__method__)
289
+ end
290
+
291
+ private
292
+
293
+ def send_request(method, http_method: :get, params: {})
294
+ endpoint = create_endpoint_from_method(method)
295
+
296
+ @api_client.new.call_api(
297
+ endpoint: endpoint,
298
+ http_method: http_method,
299
+ params: params
300
+ )
301
+ end
302
+ end
303
+ end
304
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SolscanApiRuby
4
+ VERSION = '1.0.0.pre'
5
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ # /client
4
+ require_relative "solscan_api_ruby/client/base"
5
+ require_relative "solscan_api_ruby/client/faraday_client"
6
+ require_relative "solscan_api_ruby/client/response"
7
+ require_relative "solscan_api_ruby/client/http_codes"
8
+
9
+ # /methods
10
+ require_relative "solscan_api_ruby/methods/base"
11
+ require_relative "solscan_api_ruby/methods/public"
12
+
13
+ module SolscanApiRuby
14
+ # Api url.
15
+ # @return [String] api url.
16
+ API_URL = "https://public-api.solscan.io"
17
+ end
@@ -0,0 +1,44 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'lib/solscan_api_ruby/version'
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = 'solscan_api_ruby'
7
+ spec.version = SolscanApiRuby::VERSION
8
+ spec.authors = ['Block Logic Team']
9
+ spec.email = ['email@example.com']
10
+ spec.summary = 'Ruby wrapper for solscan public API (https://public-api.solscan.io/docs/#/).'
11
+ spec.description = 'This gem allows to use solscan public API witihin ruby ecosystem.'
12
+ spec.homepage = 'https://github.com/Block-Logic/solscan-api-ruby'
13
+ spec.license = 'MIT'
14
+ spec.platform = Gem::Platform::RUBY
15
+ spec.required_ruby_version = '>= 2.6.5'
16
+ spec.files = Dir[
17
+ 'README.md', 'LICENSE', 'CHANGELOG.md',
18
+ 'lib/**/*.rb',
19
+ 'lib/**/*.rake',
20
+ 'solscan_api_ruby.gemspec',
21
+ '.github/*.md',
22
+ 'Gemfile',
23
+ 'Rakefile'
24
+ ]
25
+ spec.extra_rdoc_files = ['README.md']
26
+ spec.metadata= {
27
+ 'documentation_uri' => 'https://www.rubydoc.info/github/Block-Logic/solscan-api-ruby',
28
+ 'source_code_uri' => 'https://github.com/Block-Logic/solscan-api-ruby'
29
+ }
30
+
31
+ spec.add_development_dependency 'pry', '~> 0.14'
32
+ spec.add_development_dependency 'rubocop', '~> 1.25'
33
+ spec.add_development_dependency 'rubocop-performance', '~> 1.13'
34
+ spec.add_development_dependency 'rubocop-rspec', '~> 2.3'
35
+ spec.add_development_dependency 'rails', '~> 6.1'
36
+ spec.add_development_dependency 'rake', '~> 13.0'
37
+ spec.add_development_dependency 'rspec', '~> 3.10'
38
+ spec.add_development_dependency 'rspec-rails', '~> 5.0'
39
+ spec.add_development_dependency 'vcr', '~> 6.0'
40
+ spec.add_development_dependency 'webmock', '~> 3.14'
41
+
42
+ spec.add_runtime_dependency 'faraday', '~> 2.1'
43
+ spec.add_runtime_dependency 'oj', '~> 3.13'
44
+ end
metadata ADDED
@@ -0,0 +1,232 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: solscan_api_ruby
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0.pre
5
+ platform: ruby
6
+ authors:
7
+ - Block Logic Team
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2022-01-31 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: pry
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.14'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0.14'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rubocop
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.25'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.25'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rubocop-performance
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.13'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.13'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rubocop-rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '2.3'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '2.3'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rails
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '6.1'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '6.1'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rake
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '13.0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '13.0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rspec
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '3.10'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '3.10'
111
+ - !ruby/object:Gem::Dependency
112
+ name: rspec-rails
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '5.0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '5.0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: vcr
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '6.0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: '6.0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: webmock
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: '3.14'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: '3.14'
153
+ - !ruby/object:Gem::Dependency
154
+ name: faraday
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - "~>"
158
+ - !ruby/object:Gem::Version
159
+ version: '2.1'
160
+ type: :runtime
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - "~>"
165
+ - !ruby/object:Gem::Version
166
+ version: '2.1'
167
+ - !ruby/object:Gem::Dependency
168
+ name: oj
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - "~>"
172
+ - !ruby/object:Gem::Version
173
+ version: '3.13'
174
+ type: :runtime
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - "~>"
179
+ - !ruby/object:Gem::Version
180
+ version: '3.13'
181
+ description: This gem allows to use solscan public API witihin ruby ecosystem.
182
+ email:
183
+ - email@example.com
184
+ executables: []
185
+ extensions: []
186
+ extra_rdoc_files:
187
+ - README.md
188
+ files:
189
+ - ".github/CODE_OF_CONDUCT.md"
190
+ - ".github/CONTRIBUTING.md"
191
+ - ".github/PULL_REQUEST_TEMPLATE.md"
192
+ - CHANGELOG.md
193
+ - Gemfile
194
+ - LICENSE
195
+ - README.md
196
+ - Rakefile
197
+ - lib/solscan_api_ruby.rb
198
+ - lib/solscan_api_ruby/client/api_error.rb
199
+ - lib/solscan_api_ruby/client/base.rb
200
+ - lib/solscan_api_ruby/client/faraday_client.rb
201
+ - lib/solscan_api_ruby/client/http_codes.rb
202
+ - lib/solscan_api_ruby/client/response.rb
203
+ - lib/solscan_api_ruby/methods/base.rb
204
+ - lib/solscan_api_ruby/methods/public.rb
205
+ - lib/solscan_api_ruby/version.rb
206
+ - solscan_api_ruby.gemspec
207
+ homepage: https://github.com/Block-Logic/solscan-api-ruby
208
+ licenses:
209
+ - MIT
210
+ metadata:
211
+ documentation_uri: https://www.rubydoc.info/github/Block-Logic/solscan-api-ruby
212
+ source_code_uri: https://github.com/Block-Logic/solscan-api-ruby
213
+ post_install_message:
214
+ rdoc_options: []
215
+ require_paths:
216
+ - lib
217
+ required_ruby_version: !ruby/object:Gem::Requirement
218
+ requirements:
219
+ - - ">="
220
+ - !ruby/object:Gem::Version
221
+ version: 2.6.5
222
+ required_rubygems_version: !ruby/object:Gem::Requirement
223
+ requirements:
224
+ - - ">"
225
+ - !ruby/object:Gem::Version
226
+ version: 1.3.1
227
+ requirements: []
228
+ rubygems_version: 3.1.6
229
+ signing_key:
230
+ specification_version: 4
231
+ summary: Ruby wrapper for solscan public API (https://public-api.solscan.io/docs/#/).
232
+ test_files: []