solana-ruby 0.1.3 → 0.1.4

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: '0009e34787d1786fde5b184a9e9d4ba090b52175abd8cc5d2efba47dbbc8eea9'
4
+ data.tar.gz: 3761ee4dcb2b182b8469c60814045581180770e555844dc74caf27ef27c3364a
5
5
  SHA512:
6
- metadata.gz: 7cd1980321c6947394ac1e9456d4312395670977d3774195ce93d6b0faa8c44377185aad3aad0b8d5706fa82a0e58ea0ca6fcea79b28ecdd43c1593702900913
7
- data.tar.gz: 1b389ab381b782be91396fd0f8aea16ae9bf094ecff2f3dce366e9674fee6a50779d44a1d900206dd556ddc46a4ff99178409311fe76646c4d2aa5ebcc04c764
6
+ metadata.gz: 77af58126eb32a211745baa0e1ce8d9a22249723bd2e77f4669d497e841ba7f55c74d0e5cb464f0ee75a195351a4ae1f73bf82677d3bcb19ad09d891088ab773
7
+ data.tar.gz: 70694ab44025b3fe3ad4310f5e49f1649fabb6254c766a369ae4da4f2c8b4bb15a8c6f0c8d2ecd1f9b9803e5c907d62949cc463b16634a8ac0ae7b2ee93a4f2c
@@ -82,19 +82,18 @@ module Solana
82
82
  # @param [Integer] slot_number The slot number of the block.
83
83
  # @param [Hash] options Optional parameters for the request.
84
84
  # @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)
85
+ def get_block_time(slot_number, &block)
86
+ request_http('getBlockTime', [slot_number], &block)
87
87
  end
88
88
 
89
89
  ##
90
90
  # Retrieves a list of confirmed blocks between two slot numbers.
91
91
  #
92
92
  # @param [Integer] start_slot The start slot number.
93
- # @param [Integer] end_slot The end slot number.
94
93
  # @param [Hash] options Optional parameters for the request.
95
94
  # @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)
95
+ def get_blocks(start_slot, options = {}, &block)
96
+ request_http('getBlocks', [start_slot, options], &block)
98
97
  end
99
98
 
100
99
  ##
@@ -111,10 +110,9 @@ module Solana
111
110
  ##
112
111
  # Retrieves the list of cluster nodes.
113
112
  #
114
- # @param [Hash] options Optional parameters for the request.
115
113
  # @return [Array<Hash>] The list of cluster nodes.
116
- def get_cluster_nodes(options = {}, &block)
117
- request_http('getClusterNodes', [options], &block)
114
+ def get_cluster_nodes(&block)
115
+ request_http('getClusterNodes', &block)
118
116
  end
119
117
 
120
118
  ##
@@ -129,10 +127,9 @@ module Solana
129
127
  ##
130
128
  # Retrieves the epoch schedule.
131
129
  #
132
- # @param [Hash] options Optional parameters for the request.
133
130
  # @return [Hash] The epoch schedule.
134
- def get_epoch_schedule(options = {}, &block)
135
- request_http('getEpochSchedule', [options], &block)
131
+ def get_epoch_schedule(&block)
132
+ request_http('getEpochSchedule', &block)
136
133
  end
137
134
 
138
135
  ##
@@ -148,46 +145,41 @@ module Solana
148
145
  ##
149
146
  # Retrieves the slot of the first available block.
150
147
  #
151
- # @param [Hash] options Optional parameters for the request.
152
148
  # @return [Integer] The slot of the first available block.
153
- def get_first_available_block(options = {}, &block)
154
- request_http('getFirstAvailableBlock', [options], &block)
149
+ def get_first_available_block(&block)
150
+ request_http('getFirstAvailableBlock', &block)
155
151
  end
156
152
 
157
153
  ##
158
154
  # Retrieves the genesis hash.
159
155
  #
160
- # @param [Hash] options Optional parameters for the request.
161
156
  # @return [String] The genesis hash.
162
- def get_genesis_hash(options = {}, &block)
163
- request_http('getGenesisHash', [options], &block)
157
+ def get_genesis_hash(&block)
158
+ request_http('getGenesisHash', &block)
164
159
  end
165
160
 
166
161
  ##
167
162
  # Checks the health of the node.
168
163
  #
169
- # @param [Hash] options Optional parameters for the request.
170
164
  # @return [String] The health status of the node.
171
- def get_health(options = {}, &block)
172
- request_http('getHealth', [options], &block)
165
+ def get_health(&block)
166
+ request_http('getHealth', &block)
173
167
  end
174
168
 
175
169
  ##
176
170
  # Retrieves the highest snapshot slot.
177
171
  #
178
- # @param [Hash] options Optional parameters for the request.
179
172
  # @return [Integer] The highest snapshot slot.
180
- def get_highest_snapshot_slot(options = {}, &block)
181
- request_http('getHighestSnapshotSlot', [options], &block)
173
+ def get_highest_snapshot_slot(&block)
174
+ request_http('getHighestSnapshotSlot', &block)
182
175
  end
183
176
 
184
177
  ##
185
178
  # Retrieves the identity of the node.
186
179
  #
187
- # @param [Hash] options Optional parameters for the request.
188
180
  # @return [Hash] The identity information of the node.
189
- def get_identity(options = {}, &block)
190
- request_http('getIdentity', [options], &block)
181
+ def get_identity(&block)
182
+ request_http('getIdentity', &block)
191
183
  end
192
184
 
193
185
  ##
@@ -202,10 +194,9 @@ module Solana
202
194
  ##
203
195
  # Retrieves the current inflation rate.
204
196
  #
205
- # @param [Hash] options Optional parameters for the request.
206
197
  # @return [Hash] The inflation rate.
207
- def get_inflation_rate(options = {}, &block)
208
- request_http('getInflationRate', [options], &block)
198
+ def get_inflation_rate(&block)
199
+ request_http('getInflationRate', &block)
209
200
  end
210
201
 
211
202
  ##
@@ -236,31 +227,30 @@ module Solana
236
227
  request_http('getLatestBlockhash', [options], &block)
237
228
  end
238
229
 
230
+ ## TODO
239
231
  ##
240
232
  # Retrieves the leader schedule.
241
233
  #
242
234
  # @param [Hash] options Optional parameters for the request.
243
235
  # @return [Hash] The leader schedule.
244
- def get_leader_schedule(options = {}, &block)
245
- request_http('getLeaderSchedule', [options], &block)
236
+ def get_leader_schedule(slot_number = nil, options = {}, &block)
237
+ request_http('getLeaderSchedule', [slot_number, options], &block)
246
238
  end
247
239
 
248
240
  ##
249
241
  # Retrieves the maximum retransmit slot.
250
242
  #
251
- # @param [Hash] options Optional parameters for the request.
252
243
  # @return [Integer] The maximum retransmit slot.
253
- def get_max_retransmit_slot(options = {}, &block)
254
- request_http('getMaxRetransmitSlot', [options], &block)
244
+ def get_max_retransmit_slot(&block)
245
+ request_http('getMaxRetransmitSlot', &block)
255
246
  end
256
247
 
257
248
  ##
258
249
  # Retrieves the maximum shred insert slot.
259
250
  #
260
- # @param [Hash] options Optional parameters for the request.
261
251
  # @return [Integer] The maximum shred insert slot.
262
- def get_max_shred_insert_slot(options = {}, &block)
263
- request_http('getMaxShredInsertSlot', [options], &block)
252
+ def get_max_shred_insert_slot(&block)
253
+ request_http('getMaxShredInsertSlot', &block)
264
254
  end
265
255
 
266
256
  ##
@@ -298,8 +288,8 @@ module Solana
298
288
  #
299
289
  # @param [Hash] options Optional parameters for the request.
300
290
  # @return [Array<Hash>] The recent performance samples.
301
- def get_recent_performance_samples(options = {}, &block)
302
- request_http('getRecentPerformanceSamples', [options], &block)
291
+ def get_recent_performance_samples(limit = 720, options = {}, &block)
292
+ request_http('getRecentPerformanceSamples', [limit, options], &block)
303
293
  end
304
294
 
305
295
  ##
@@ -307,8 +297,8 @@ module Solana
307
297
  #
308
298
  # @param [Hash] options Optional parameters for the request.
309
299
  # @return [Hash] The recent prioritization fees.
310
- def get_recent_prioritization_fees(options = {}, &block)
311
- request_http('getRecentPrioritizationFees', [options], &block)
300
+ def get_recent_prioritization_fees(addresses = [], &block)
301
+ request_http('getRecentPrioritizationFees', [addresses], &block)
312
302
  end
313
303
 
314
304
  ##
@@ -420,6 +410,7 @@ module Solana
420
410
  request_http('getTokenAccountsByOwner', [owner, opts, options], &block)
421
411
  end
422
412
 
413
+ ## TODO
423
414
  ##
424
415
  # Retrieves the largest accounts for a given token.
425
416
  #
@@ -491,8 +482,8 @@ module Solana
491
482
  #
492
483
  # @param [Hash] options Optional parameters for the request.
493
484
  # @return [Integer] The minimum ledger slot.
494
- def minimum_ledger_slot(options = {}, &block)
495
- request_http('minimumLedgerSlot', [options], &block)
485
+ def minimum_ledger_slot(&block)
486
+ request_http('minimumLedgerSlot', &block)
496
487
  end
497
488
 
498
489
  ##
@@ -510,9 +501,10 @@ module Solana
510
501
  # Sends a transaction.
511
502
  #
512
503
  # @param [Hash] transaction The transaction to send.
504
+ # @param [Hash] options Optional parameters for the request.
513
505
  # @return [Hash] The response from the send transaction request.
514
- def send_transaction(transaction, &block)
515
- request_http('sendTransaction', [transaction.to_json], &block)
506
+ def send_transaction(transaction, options = {}, &block)
507
+ request_http('sendTransaction', [transaction.to_json, options], &block)
516
508
  end
517
509
 
518
510
  ##
@@ -549,8 +541,8 @@ module Solana
549
541
  #
550
542
  # @param [Hash] options Optional parameters for the subscription.
551
543
  # @yield [Object] The response from the subscription.
552
- def block_subscribe(options = {}, &block)
553
- request_ws('blockSubscribe', [options], &block)
544
+ def block_subscribe(filter, options = {}, &block)
545
+ request_ws('blockSubscribe', [filter, options], &block)
554
546
  end
555
547
 
556
548
  ##
@@ -1,3 +1,3 @@
1
1
  module Solana
2
- VERSION = '0.1.3'.freeze
2
+ VERSION = '0.1.4'.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.4
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-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httpx