validators_app_ruby 1.0.0.pre → 2.0.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c89330eeb681aa1a95f35231cad1864b73f0eb60052edfd56023147e8c17fdae
4
- data.tar.gz: 93f5c1fe5ed43e7836c0a9c14b9e377f9135899ab96767295784433d7b14c947
3
+ metadata.gz: 4d5c1e348a8a7bfbae7893ad0cf85b1ec593140ca9125606e6c626563a0e8865
4
+ data.tar.gz: 3973572fb5db3ef259e3e8ce53442aa6b5a33d0317edf19689560ef345513c74
5
5
  SHA512:
6
- metadata.gz: 6b94f47e28ce30f70a5a15fbf8a64ee1bc3baebc7ab51dea0c45af7665240c7f7e7a1128d576e91dea7c0dd8ff7d542da585028ac574462398fccea0fdbc958b
7
- data.tar.gz: 76d99a7e2a1d9f580f6fbef5d1b0cc2f3d5f12f77ee9114eec7b47f63b7c3766accb0e1097c4b7fcb658b85d716296d9886ea7ce29b38a982c8537b1e1405a18
6
+ metadata.gz: 9269e0ac99652ab3e4f11bb6da9772e9d5c8090fb7f5329b5fce12f83c84015e293dae73eebe9111ab000c09486017ae881facfccb0cabb024b177691fbf339c
7
+ data.tar.gz: fa30e48726209dcb7b80eada280de81c42c644955b8c5cdd3dffaf79dc65a5dbc376322b6c753d26da71f7afc264c75a14c20cd63a2049ecd9fc15b081abf5e1
@@ -4,25 +4,25 @@ on: [push]
4
4
 
5
5
  jobs:
6
6
  test:
7
- runs-on: ubuntu-20.04
7
+ runs-on: ubuntu-22.04
8
8
  strategy:
9
9
  fail-fast: false
10
10
  matrix:
11
- ruby-version: [3.0, 2.7, 2.6]
11
+ ruby-version: ['3.1.4', '3.2']
12
12
  steps:
13
- - uses: actions/checkout@v2
13
+ - uses: actions/checkout@v4
14
14
  - name: Set up Ruby ${{ matrix.ruby-version }}
15
15
  uses: ruby/setup-ruby@v1
16
16
  with:
17
17
  ruby-version: ${{ matrix.ruby-version }}
18
18
  bundler-cache: true
19
- - name: bundle install
20
- run: bundle install
21
19
  - name: set up dotenv
22
20
  env:
23
21
  API_TOKEN: ${{ secrets.API_TOKEN }}
24
22
  run: |
25
23
  echo $API_TOKEN | base64 --decode > .env
24
+ - name: bundle install
25
+ run: bundle install
26
26
  - name: Run tests
27
27
  env:
28
28
  RAILS_ENV: test
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.7.5
1
+ 3.1.4
data/CHANGELOG.md ADDED
@@ -0,0 +1,6 @@
1
+ # Changelog
2
+ ## 1.0.0
3
+ * Initial release
4
+
5
+ ## 2.0.0
6
+ * Update ruby to v3.1.4 and bump gems versions
data/Gemfile CHANGED
@@ -7,8 +7,10 @@ gemspec
7
7
 
8
8
  gem "rake", "~> 13.0"
9
9
 
10
- gem "minitest", "~> 5.0"
10
+ gem "minitest", "~> 5.25"
11
11
 
12
- gem "rubocop", "~> 0.80"
12
+ gem "rubocop", "~> 0.81"
13
13
 
14
- gem "httparty", "~> 0.20"
14
+ gem "httparty", "~> 0.23"
15
+
16
+ gem "concurrent-ruby", "1.3.4"
data/Gemfile.lock CHANGED
@@ -1,41 +1,43 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- validators_app_ruby (1.0.0.pre)
4
+ validators_app_ruby (2.0.0)
5
5
  httparty (~> 0.20)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- addressable (2.8.0)
11
- public_suffix (>= 2.0.2, < 5.0)
12
- ast (2.4.2)
13
- crack (0.4.5)
10
+ addressable (2.8.7)
11
+ public_suffix (>= 2.0.2, < 7.0)
12
+ ast (2.4.3)
13
+ base64 (0.3.0)
14
+ bigdecimal (3.2.3)
15
+ concurrent-ruby (1.3.4)
16
+ crack (1.0.0)
17
+ bigdecimal
14
18
  rexml
19
+ csv (3.3.5)
15
20
  dotenv (2.7.6)
16
- hashdiff (1.0.1)
17
- httparty (0.20.0)
18
- mime-types (~> 3.0)
21
+ hashdiff (1.2.1)
22
+ httparty (0.23.1)
23
+ csv
24
+ mini_mime (>= 1.0.0)
19
25
  multi_xml (>= 0.5.2)
20
- mime-types (3.4.1)
21
- mime-types-data (~> 3.2015)
22
- mime-types-data (3.2022.0105)
23
- minispec-metadata (2.0.0)
24
- minitest
25
- minitest (5.15.0)
26
- minitest-vcr (1.4.0)
27
- minispec-metadata (~> 2.0)
28
- minitest (>= 4.7.5)
29
- vcr (>= 2.9)
30
- multi_xml (0.6.0)
31
- parallel (1.22.1)
32
- parser (3.1.1.0)
26
+ mini_mime (1.1.5)
27
+ minitest (5.25.5)
28
+ multi_xml (0.7.1)
29
+ bigdecimal (~> 3.1)
30
+ parallel (1.27.0)
31
+ parser (3.3.9.0)
33
32
  ast (~> 2.4.1)
34
- public_suffix (4.0.6)
33
+ racc
34
+ prism (1.5.1)
35
+ public_suffix (6.0.2)
36
+ racc (1.8.1)
35
37
  rainbow (3.1.1)
36
- rake (13.0.6)
37
- regexp_parser (2.2.1)
38
- rexml (3.2.5)
38
+ rake (13.3.0)
39
+ regexp_parser (2.11.3)
40
+ rexml (3.4.4)
39
41
  rubocop (0.93.1)
40
42
  parallel (~> 1.10)
41
43
  parser (>= 2.7.1.5)
@@ -45,29 +47,32 @@ GEM
45
47
  rubocop-ast (>= 0.6.0)
46
48
  ruby-progressbar (~> 1.7)
47
49
  unicode-display_width (>= 1.4.0, < 2.0)
48
- rubocop-ast (1.16.0)
49
- parser (>= 3.1.1.0)
50
- ruby-progressbar (1.11.0)
50
+ rubocop-ast (1.47.1)
51
+ parser (>= 3.3.7.2)
52
+ prism (~> 1.4)
53
+ ruby-progressbar (1.13.0)
51
54
  unicode-display_width (1.8.0)
52
- vcr (6.1.0)
55
+ vcr (6.3.1)
56
+ base64
53
57
  webmock (3.14.0)
54
58
  addressable (>= 2.8.0)
55
59
  crack (>= 0.3.2)
56
60
  hashdiff (>= 0.4.0, < 2.0.0)
57
61
 
58
62
  PLATFORMS
59
- x86_64-darwin-20
63
+ arm64-darwin-24
60
64
  x86_64-linux
61
65
 
62
66
  DEPENDENCIES
67
+ concurrent-ruby (= 1.3.4)
63
68
  dotenv (~> 2.7.6)
64
- httparty (~> 0.20)
65
- minitest (~> 5.0)
66
- minitest-vcr (~> 1.4.0)
69
+ httparty (~> 0.23)
70
+ minitest (~> 5.25)
67
71
  rake (~> 13.0)
68
- rubocop (~> 0.80)
72
+ rubocop (~> 0.81)
69
73
  validators_app_ruby!
74
+ vcr (~> 6.0)
70
75
  webmock (~> 3.14.0)
71
76
 
72
77
  BUNDLED WITH
73
- 2.3.5
78
+ 2.3.26
data/README.md CHANGED
@@ -7,7 +7,7 @@ This gem helps to utilize the validators.app API.
7
7
  Add this line to your application's Gemfile:
8
8
 
9
9
  ```ruby
10
- gem 'validators-app-ruby'
10
+ gem 'validators_app_ruby'
11
11
  ```
12
12
 
13
13
  And then execute:
@@ -40,7 +40,9 @@ Example:
40
40
 
41
41
  ```ruby
42
42
  client = ValidatorsAppRuby.new(token: "your_api_token")
43
- client.get_validators(network: "testnet", order: "score")
43
+ response = client.get_validators(network: "testnet", order: "score")
44
+ response.body # response in json format
45
+ response.parsed_response # response as a ruby hash
44
46
 
45
47
  # returns a list of validators from testnet ordered by score
46
48
  ```
@@ -55,61 +57,59 @@ client = ValidatorsAppRuby.new(token: "your_api_token")
55
57
 
56
58
  client.get_ping
57
59
 
60
+
58
61
  # Validators List
59
62
  # The Validators endpoint will return a list of validators for the requested network.
60
63
 
61
64
  client.get_validators(
62
- network: "testnet",
65
+ network: "mainnet",
63
66
  order: "score",
64
67
  limit: 100,
65
68
  page: 1,
66
- q: "example"
69
+ q: "Block Logic"
67
70
  )
68
71
 
72
+
69
73
  # Validator Detail
70
74
  # The Validators endpoint will return a single validator for the requested network and account.
71
75
 
72
76
  client.get_validators(
73
- network: "testnet",
74
- id: "validator_account",
77
+ network: "mainnet",
78
+ id: "DDnAqxJVFo2GVTujibHt5cjevHMSE9bo8HJaydHoshdp",
75
79
  with_history: true
76
80
  )
77
81
 
82
+
78
83
  # Validator Block Production History
79
84
  # The Validator Block History endpoint will return a history of block production stats for the requested network and account.
80
85
 
81
- client.get_validator_block_history(
82
- network: "testnet",
83
- id: "validator_account"
84
- )
86
+ client.get_validator_block_history(network: "testnet", id: "DDnAqxJVFo2GVTujibHt5cjevHMSE9bo8HJaydHoshdp")
87
+
85
88
 
86
89
  # Epoch Index
87
90
  # The Epoch endpoint will return all epoch data.
88
91
 
89
- client.get_epochs(
90
- network: "testnet",
91
- per: 10,
92
- page: 2
93
- )
92
+ client.get_epochs(network: "testnet", per: 10, page: 2)
93
+
94
94
 
95
95
  # Commission Change Index
96
96
  # The Commission Change endpoint will return all the changes in commission for a given period of time.
97
97
 
98
98
  client.get_commission_changes(
99
- network: "testnet",
99
+ network: "mainnet",
100
100
  date_from: DateTime.now - 30.days,
101
101
  date_to: DateTime.now,
102
102
  per: 100,
103
103
  page: 1,
104
- query: "example"
104
+ query: "Block Logic"
105
105
  )
106
106
 
107
+
107
108
  # Stake Pools
108
109
  # The Stake Pools endpoint will return all the stake pools.
109
110
 
110
- client.get_stake_pools(
111
- network: "testnet"
112
- )
111
+ client.get_stake_pools(network: "testnet")
112
+
113
113
 
114
114
  # Stake Accounts
115
115
  # The Stake Accounts endpoint will return all the stake accounts grouped by vote accounts.
@@ -122,6 +122,16 @@ client.get_stake_accounts(
122
122
  page: 1
123
123
  )
124
124
 
125
+
126
+ # Stake Explorer
127
+ # The Explorer Stake Accounts endpoint will return all the stake accounts according to provided criteria. Only mainnet network is available for this query.
128
+
129
+ client.get_stake_explorer(
130
+ network: "mainnet"
131
+ staker: "DDnAqxJVFo2GVTujibHt5cjevHMSE9bo8HJaydHoshdp"
132
+ )
133
+
134
+
125
135
  # Ping Thing Post
126
136
  # The Ping Thing Post endpoint allows you to push information about transaction times.
127
137
 
@@ -136,6 +146,7 @@ client.post_ping_thing(
136
146
  transaction_type: "transfer"
137
147
  )
138
148
 
149
+
139
150
  # Ping Thing Post Batch
140
151
  # The Ping Thing Batch endpoint allows you to push multiple transaction informations at once.
141
152
 
@@ -154,14 +165,12 @@ client.post_ping_thing_batch(
154
165
  ]
155
166
  )
156
167
 
168
+
157
169
  # Ping Thing List
158
170
  # This Ping Thing List endpoint will return a list of pings for the requested network.
159
171
 
160
- client.get_ping_thing(
161
- network: "testnet",
162
- limit: 100,
163
- page: 1
164
- )
172
+ client.get_ping_thing(network: "testnet", limit: 100, page: 1)
173
+
165
174
 
166
175
  # Sol Prices
167
176
  # The Sol Prices endpoind will return prices gathered from multiple exchanges.
data/demo.rb CHANGED
@@ -4,4 +4,4 @@ require_relative "lib/validators_app_ruby"
4
4
 
5
5
  client = ValidatorsAppRuby.new("token")
6
6
 
7
- puts client.getting_ping
7
+ puts client.get_ping
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ValidatorsAppRubyVersion
4
- VERSION = "1.0.0.pre"
4
+ VERSION = "2.0.0"
5
5
  end
@@ -3,6 +3,7 @@
3
3
  require 'httparty'
4
4
  require_relative "validators_app_ruby/version"
5
5
 
6
+
6
7
  class ValidatorsAppRuby
7
8
  class Error < StandardError; end
8
9
 
@@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
28
28
  spec.add_dependency "httparty", "~> 0.20"
29
29
 
30
30
  spec.add_development_dependency "dotenv", "~> 2.7.6"
31
- spec.add_development_dependency "minitest-vcr", "~> 1.4.0"
31
+ spec.add_development_dependency "vcr", "~> 6.0"
32
32
  spec.add_development_dependency "webmock", "~> 3.14.0"
33
33
 
34
34
  # Uncomment to register a new dependency of your gem
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: validators_app_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.pre
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - BlockLogic team
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-03-30 00:00:00.000000000 Z
11
+ date: 2025-10-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -39,19 +39,19 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: 2.7.6
41
41
  - !ruby/object:Gem::Dependency
42
- name: minitest-vcr
42
+ name: vcr
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 1.4.0
47
+ version: '6.0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 1.4.0
54
+ version: '6.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: webmock
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -77,6 +77,7 @@ files:
77
77
  - ".gitignore"
78
78
  - ".rubocop.yml"
79
79
  - ".ruby-version"
80
+ - CHANGELOG.md
80
81
  - CODE_OF_CONDUCT.md
81
82
  - Gemfile
82
83
  - Gemfile.lock
@@ -107,11 +108,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
107
108
  version: 2.3.0
108
109
  required_rubygems_version: !ruby/object:Gem::Requirement
109
110
  requirements:
110
- - - ">"
111
+ - - ">="
111
112
  - !ruby/object:Gem::Version
112
- version: 1.3.1
113
+ version: '0'
113
114
  requirements: []
114
- rubygems_version: 3.0.9
115
+ rubygems_version: 3.3.26
115
116
  signing_key:
116
117
  specification_version: 4
117
118
  summary: Ruby wrapper for validators.app API endpoints