solana-ruby 0.1.3 → 0.1.5

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: 610330d9aad4553f79f8d9101c8e1180491a6a59a8f8451f23d149cf3590222f
4
- data.tar.gz: c797a3326c255ff331fb5f112a65839eb20ca941fd4120728263b84555baa0af
3
+ metadata.gz: 2e0202ab58e2b0ccb77296d5ffa26a1408527e52dbc3e35231c6751b2b7d4a5c
4
+ data.tar.gz: f2fa02339b07a39149bad5a5466b976df22af33065ad870481313d2b23a450ef
5
5
  SHA512:
6
- metadata.gz: 7cd1980321c6947394ac1e9456d4312395670977d3774195ce93d6b0faa8c44377185aad3aad0b8d5706fa82a0e58ea0ca6fcea79b28ecdd43c1593702900913
7
- data.tar.gz: 1b389ab381b782be91396fd0f8aea16ae9bf094ecff2f3dce366e9674fee6a50779d44a1d900206dd556ddc46a4ff99178409311fe76646c4d2aa5ebcc04c764
6
+ metadata.gz: bea7c63739520e701323f6449b21d097eebbf31e79dc659d0ccc1417baa113ef64e786f6d2006c910f5773f12bd157e0606ee6e56409946bdabbe2116abf5466
7
+ data.tar.gz: 4b00e4f10ea497dec5a32515b323b1eb5b76f2a0e3a34c4b9a91b7b80c2913ff6a2c5441bc5e51278262b08d4060a27141dff0813a87b5fa3d599c9475e94ac0
@@ -12,9 +12,8 @@ module Solana
12
12
  ##
13
13
  # Initializes a new Client.
14
14
  #
15
- # @param [String, nil] api_key Optional API key for authentication.
16
- def initialize(api_endpoint = Solana::Utils::MAINNET, api_key = nil)
17
- @api_key = api_key
15
+ # @param [String, nil] api_endpoint Optional API endpoint. Mainnet by default
16
+ def initialize(api_endpoint = Solana::Utils::MAINNET)
18
17
  @api_endpoint = api_endpoint
19
18
  end
20
19
 
@@ -80,21 +79,19 @@ module Solana
80
79
  # Retrieves the estimated production time of a specific block.
81
80
  #
82
81
  # @param [Integer] slot_number The slot number of the block.
83
- # @param [Hash] options Optional parameters for the request.
84
82
  # @return [Integer] The estimated production time in seconds.
85
- def get_block_time(slot_number, options = {}, &block)
86
- request_http('getBlockTime', [slot_number, options], &block)
83
+ def get_block_time(slot_number, &block)
84
+ request_http('getBlockTime', [slot_number], &block)
87
85
  end
88
86
 
89
87
  ##
90
88
  # Retrieves a list of confirmed blocks between two slot numbers.
91
89
  #
92
90
  # @param [Integer] start_slot The start slot number.
93
- # @param [Integer] end_slot The end slot number.
94
91
  # @param [Hash] options Optional parameters for the request.
95
92
  # @return [Array<Integer>] The list of confirmed blocks.
96
- def get_blocks(start_slot, end_slot, options = {}, &block)
97
- request_http('getBlocks', [start_slot, end_slot, options], &block)
93
+ def get_blocks(start_slot, options = {}, &block)
94
+ request_http('getBlocks', [start_slot, options], &block)
98
95
  end
99
96
 
100
97
  ##
@@ -111,10 +108,9 @@ module Solana
111
108
  ##
112
109
  # Retrieves the list of cluster nodes.
113
110
  #
114
- # @param [Hash] options Optional parameters for the request.
115
111
  # @return [Array<Hash>] The list of cluster nodes.
116
- def get_cluster_nodes(options = {}, &block)
117
- request_http('getClusterNodes', [options], &block)
112
+ def get_cluster_nodes(&block)
113
+ request_http('getClusterNodes', &block)
118
114
  end
119
115
 
120
116
  ##
@@ -129,10 +125,9 @@ module Solana
129
125
  ##
130
126
  # Retrieves the epoch schedule.
131
127
  #
132
- # @param [Hash] options Optional parameters for the request.
133
128
  # @return [Hash] The epoch schedule.
134
- def get_epoch_schedule(options = {}, &block)
135
- request_http('getEpochSchedule', [options], &block)
129
+ def get_epoch_schedule(&block)
130
+ request_http('getEpochSchedule', &block)
136
131
  end
137
132
 
138
133
  ##
@@ -148,46 +143,41 @@ module Solana
148
143
  ##
149
144
  # Retrieves the slot of the first available block.
150
145
  #
151
- # @param [Hash] options Optional parameters for the request.
152
146
  # @return [Integer] The slot of the first available block.
153
- def get_first_available_block(options = {}, &block)
154
- request_http('getFirstAvailableBlock', [options], &block)
147
+ def get_first_available_block(&block)
148
+ request_http('getFirstAvailableBlock', &block)
155
149
  end
156
150
 
157
151
  ##
158
152
  # Retrieves the genesis hash.
159
153
  #
160
- # @param [Hash] options Optional parameters for the request.
161
154
  # @return [String] The genesis hash.
162
- def get_genesis_hash(options = {}, &block)
163
- request_http('getGenesisHash', [options], &block)
155
+ def get_genesis_hash(&block)
156
+ request_http('getGenesisHash', &block)
164
157
  end
165
158
 
166
159
  ##
167
160
  # Checks the health of the node.
168
161
  #
169
- # @param [Hash] options Optional parameters for the request.
170
162
  # @return [String] The health status of the node.
171
- def get_health(options = {}, &block)
172
- request_http('getHealth', [options], &block)
163
+ def get_health(&block)
164
+ request_http('getHealth', &block)
173
165
  end
174
166
 
175
167
  ##
176
168
  # Retrieves the highest snapshot slot.
177
169
  #
178
- # @param [Hash] options Optional parameters for the request.
179
170
  # @return [Integer] The highest snapshot slot.
180
- def get_highest_snapshot_slot(options = {}, &block)
181
- request_http('getHighestSnapshotSlot', [options], &block)
171
+ def get_highest_snapshot_slot(&block)
172
+ request_http('getHighestSnapshotSlot', &block)
182
173
  end
183
174
 
184
175
  ##
185
176
  # Retrieves the identity of the node.
186
177
  #
187
- # @param [Hash] options Optional parameters for the request.
188
178
  # @return [Hash] The identity information of the node.
189
- def get_identity(options = {}, &block)
190
- request_http('getIdentity', [options], &block)
179
+ def get_identity(&block)
180
+ request_http('getIdentity', &block)
191
181
  end
192
182
 
193
183
  ##
@@ -202,10 +192,9 @@ module Solana
202
192
  ##
203
193
  # Retrieves the current inflation rate.
204
194
  #
205
- # @param [Hash] options Optional parameters for the request.
206
195
  # @return [Hash] The inflation rate.
207
- def get_inflation_rate(options = {}, &block)
208
- request_http('getInflationRate', [options], &block)
196
+ def get_inflation_rate(&block)
197
+ request_http('getInflationRate', &block)
209
198
  end
210
199
 
211
200
  ##
@@ -236,31 +225,30 @@ module Solana
236
225
  request_http('getLatestBlockhash', [options], &block)
237
226
  end
238
227
 
228
+ ## TODO
239
229
  ##
240
230
  # Retrieves the leader schedule.
241
231
  #
242
232
  # @param [Hash] options Optional parameters for the request.
243
233
  # @return [Hash] The leader schedule.
244
- def get_leader_schedule(options = {}, &block)
245
- request_http('getLeaderSchedule', [options], &block)
234
+ def get_leader_schedule(slot_number = nil, options = {}, &block)
235
+ request_http('getLeaderSchedule', [slot_number, options], &block)
246
236
  end
247
237
 
248
238
  ##
249
239
  # Retrieves the maximum retransmit slot.
250
240
  #
251
- # @param [Hash] options Optional parameters for the request.
252
241
  # @return [Integer] The maximum retransmit slot.
253
- def get_max_retransmit_slot(options = {}, &block)
254
- request_http('getMaxRetransmitSlot', [options], &block)
242
+ def get_max_retransmit_slot(&block)
243
+ request_http('getMaxRetransmitSlot', &block)
255
244
  end
256
245
 
257
246
  ##
258
247
  # Retrieves the maximum shred insert slot.
259
248
  #
260
- # @param [Hash] options Optional parameters for the request.
261
249
  # @return [Integer] The maximum shred insert slot.
262
- def get_max_shred_insert_slot(options = {}, &block)
263
- request_http('getMaxShredInsertSlot', [options], &block)
250
+ def get_max_shred_insert_slot(&block)
251
+ request_http('getMaxShredInsertSlot', &block)
264
252
  end
265
253
 
266
254
  ##
@@ -296,19 +284,20 @@ module Solana
296
284
  ##
297
285
  # Retrieves recent performance samples.
298
286
  #
287
+ # @param [Integer] limit The number of performance samples to retrieve.
299
288
  # @param [Hash] options Optional parameters for the request.
300
289
  # @return [Array<Hash>] The recent performance samples.
301
- def get_recent_performance_samples(options = {}, &block)
302
- request_http('getRecentPerformanceSamples', [options], &block)
290
+ def get_recent_performance_samples(limit = 720, options = {}, &block)
291
+ request_http('getRecentPerformanceSamples', [limit, options], &block)
303
292
  end
304
293
 
305
294
  ##
306
295
  # Retrieves recent prioritization fees.
307
296
  #
308
- # @param [Hash] options Optional parameters for the request.
297
+ # @param [Array<String>] addresses Optional array of addresses to filter the fees by.
309
298
  # @return [Hash] The recent prioritization fees.
310
- def get_recent_prioritization_fees(options = {}, &block)
311
- request_http('getRecentPrioritizationFees', [options], &block)
299
+ def get_recent_prioritization_fees(addresses = [], &block)
300
+ request_http('getRecentPrioritizationFees', [addresses], &block)
312
301
  end
313
302
 
314
303
  ##
@@ -491,8 +480,8 @@ module Solana
491
480
  #
492
481
  # @param [Hash] options Optional parameters for the request.
493
482
  # @return [Integer] The minimum ledger slot.
494
- def minimum_ledger_slot(options = {}, &block)
495
- request_http('minimumLedgerSlot', [options], &block)
483
+ def minimum_ledger_slot(&block)
484
+ request_http('minimumLedgerSlot', &block)
496
485
  end
497
486
 
498
487
  ##
@@ -510,9 +499,10 @@ module Solana
510
499
  # Sends a transaction.
511
500
  #
512
501
  # @param [Hash] transaction The transaction to send.
502
+ # @param [Hash] options Optional parameters for the request.
513
503
  # @return [Hash] The response from the send transaction request.
514
- def send_transaction(transaction, &block)
515
- request_http('sendTransaction', [transaction.to_json], &block)
504
+ def send_transaction(transaction, options = {}, &block)
505
+ request_http('sendTransaction', [transaction.to_json, options], &block)
516
506
  end
517
507
 
518
508
  ##
@@ -549,8 +539,8 @@ module Solana
549
539
  #
550
540
  # @param [Hash] options Optional parameters for the subscription.
551
541
  # @yield [Object] The response from the subscription.
552
- def block_subscribe(options = {}, &block)
553
- request_ws('blockSubscribe', [options], &block)
542
+ def block_subscribe(filter, options = {}, &block)
543
+ request_ws('blockSubscribe', [filter, options], &block)
554
544
  end
555
545
 
556
546
  ##
@@ -1,3 +1,3 @@
1
1
  module Solana
2
- VERSION = '0.1.3'.freeze
2
+ VERSION = '0.1.5'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solana-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fabrice Renard
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-07-01 00:00:00.000000000 Z
11
+ date: 2024-07-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httpx