solana-ruby-web3js 1.0.1.beta1 → 1.0.1.beta3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4347561fb0649ad1967e7900b9b0d918324d0b54d41c151073e179ffc062efbc
4
- data.tar.gz: 777a7663b8c1c8f986748bcd2ef2e4b18a57244d4b14c3734ea5385f35d640b4
3
+ metadata.gz: 769dd8aff42953255243d337b811ab9bd61e27e19e6957d235e9e015300f925b
4
+ data.tar.gz: e940aa048c15af34c5f06bf5de1db3716e8f68f1f83c41fe480a6de748082310
5
5
  SHA512:
6
- metadata.gz: d70fbb66c1467ca8c0d913072c1085ca231515a7b9dc0ee918dd5ab4976f42a7513534566bc70485e3a3103d9faa31573161a171cbd528d859192ff1700974cc
7
- data.tar.gz: a82cfa020893598eda4e95faef76b50a10eb3df871020997ac7ac2fb50f36e53625cc9f9550907331d2e086992a38edd2f049535e6aa1916edee1e4fd51cdabc
6
+ metadata.gz: 7cd8eb6a1ff5a1c749cb1ded759323bd1a7a43dea78e6d19444f1d1e8dc77ca24f757c5fc53412431020f09960db0cef8f2bd519641a0bdc5790c4dc8e60a581
7
+ data.tar.gz: d6c68d6c97ae798d5b79b4fcaae962ac3e34e7e2d28d61b80124b4725b3926803c49f20bd055bc7c6af9b46229558111a3ea0dae932d15750f726484a0c6b460
data/.DS_Store CHANGED
Binary file
data/Gemfile CHANGED
@@ -4,14 +4,3 @@ source "https://rubygems.org"
4
4
 
5
5
  # Specify your gem's dependencies in solana.gemspec
6
6
  gemspec
7
-
8
- gem "rake", "~> 13.0"
9
-
10
- gem "rubocop", "~> 1.21"
11
-
12
- group :development, :test do
13
- gem 'rspec'
14
- gem 'webmock'
15
- gem 'simplecov', require: false
16
- gem 'ed25519'
17
- end
data/Gemfile.lock CHANGED
@@ -1,11 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- solana_ruby (2.0.0)
5
- brakeman (~> 6.1.2)
6
- pry (~> 0.14.2)
7
- rubycritic (~> 4.9.0)
8
- simplecov (~> 0.22.0)
4
+ solana-ruby-web3js (1.0.1.beta1)
5
+ base58 (~> 0.2.3)
6
+ base64 (~> 0.2.0)
9
7
  websocket-client-simple (~> 0.8.0)
10
8
 
11
9
  GEM
@@ -18,14 +16,17 @@ GEM
18
16
  descendants_tracker (~> 0.0.4)
19
17
  ice_nine (~> 0.11.0)
20
18
  thread_safe (~> 0.3, >= 0.3.1)
19
+ base58 (0.2.3)
20
+ base64 (0.2.0)
21
21
  bigdecimal (3.1.8)
22
22
  brakeman (6.1.2)
23
23
  racc
24
- childprocess (5.0.0)
24
+ childprocess (5.1.0)
25
+ logger (~> 1.5)
25
26
  coderay (1.1.3)
26
27
  coercible (1.0.0)
27
28
  descendants_tracker (~> 0.0.1)
28
- concurrent-ruby (1.3.3)
29
+ concurrent-ruby (1.3.4)
29
30
  crack (1.0.0)
30
31
  bigdecimal
31
32
  rexml
@@ -79,19 +80,19 @@ GEM
79
80
  launchy (3.0.1)
80
81
  addressable (~> 2.8)
81
82
  childprocess (~> 5.0)
83
+ logger (1.6.1)
82
84
  method_source (1.1.0)
83
85
  parallel (1.25.1)
84
86
  parser (3.3.4.0)
85
87
  ast (~> 2.4.1)
86
88
  racc
87
- path_expander (1.1.2)
89
+ path_expander (1.1.3)
88
90
  pry (0.14.2)
89
91
  coderay (~> 1.1)
90
92
  method_source (~> 1.0)
91
93
  public_suffix (6.0.1)
92
94
  racc (1.8.1)
93
95
  rainbow (3.1.1)
94
- rake (13.2.1)
95
96
  reek (6.3.0)
96
97
  dry-schema (~> 1.13.0)
97
98
  parser (~> 3.3.0)
@@ -165,20 +166,24 @@ GEM
165
166
  websocket-client-simple (0.8.0)
166
167
  event_emitter
167
168
  websocket
168
- zeitwerk (2.6.17)
169
+ yard (0.9.37)
170
+ zeitwerk (2.6.18)
169
171
 
170
172
  PLATFORMS
171
173
  arm64-darwin-23
172
174
  ruby
173
175
 
174
176
  DEPENDENCIES
177
+ brakeman (~> 6.1.2)
175
178
  ed25519
176
- rake (~> 13.0)
179
+ pry (~> 0.14.2)
177
180
  rspec
178
181
  rubocop (~> 1.21)
179
- simplecov
180
- solana_ruby!
182
+ rubycritic (~> 4.9.0)
183
+ simplecov (~> 0.22.0)
184
+ solana-ruby-web3js!
181
185
  webmock
186
+ yard
182
187
 
183
188
  BUNDLED WITH
184
189
  2.5.16
data/README.md CHANGED
@@ -57,35 +57,96 @@ Once the client is initialized, you can make API calls to the Solana network. Fo
57
57
 
58
58
  puts result
59
59
 
60
+ ### More Information on Solana Methods
61
+
62
+ For a more detailed overview of Solana's available RPC methods, visit the official documentation:
63
+
64
+ - [Solana HTTP RPC Methods](https://solana.com/docs/rpc/http)
65
+ - [Solana WebSocket RPC Methods](https://solana.com/docs/rpc/websocket)
66
+ - [Solana web3.js Connection Methods](https://solana-labs.github.io/solana-web3.js/classes/Connection.html)
67
+
60
68
  ### Options Parameter
61
69
 
62
- The options parameter is a hash that can include the following fields:
70
+ The options parameter is a hash that can include the following fields and more, allowing for customized responses:
71
+
72
+ - **commitment**: Specifies the level of commitment desired when querying state. Options include:
63
73
 
64
- commitment: Specifies the level of commitment desired when querying state.
74
+ - 'finalized': Query the most recent block confirmed by supermajority of the cluster.
75
+ - 'confirmed': Query the most recent block that has been voted on by supermajority of the cluster.
76
+ - 'processed': Query the most recent block regardless of cluster voting.
65
77
 
66
- Options include:
78
+ - **encoding**: Defines the format of the returned account data. Possible values include:
67
79
 
68
- 'finalized': Query the most recent block confirmed by supermajority of the cluster.
69
- 'confirmed': Query the most recent block that has been voted on by supermajority of the cluster.
70
- 'processed': Query the most recent block regardless of cluster voting.
80
+ - 'jsonParsed': Returns data in a JSON-parsed format.
81
+ - 'base64': Returns raw account data in Base64 encoding.
82
+ - 'base64+zstd': Returns compressed Base64 data.
71
83
 
72
- encoding: Defines the format of the returned account data. Possible values include:
84
+ - **epoch**: Specify the epoch when querying for certain information like epoch details.
73
85
 
74
- 'jsonParsed': Returns data in a JSON-parsed format.
75
- 'base64': Returns raw account data in Base64 encoding.
76
- 'base64+zstd': Returns compressed Base64 data.
86
+ - **skipPreflight**: If true, skip the preflight transaction verification. Preflight ensures that a transaction is valid before sending it to the network, but skipping this can result in faster submission.
87
+
88
+ - **maxRetries**: Specify how many times to retry sending a transaction before giving up.
89
+
90
+ - **recentBlockhash**: Provide a custom recent blockhash for a transaction if not relying on the default.
77
91
 
78
92
  By providing options, you can control the nature of the returned data and the reliability of the query.
79
93
 
80
94
  ### Filters Parameter
81
95
 
82
- The filters parameter allows you to specify conditions for querying token accounts. Some common filter types include:
96
+ The filters parameter allows you to specify conditions when querying accounts and other resources. Here are some common filters:
97
+
98
+ #### Token Accounts by Owner
99
+
100
+ # Replace 'owner_pubkey' with the owner's public key
101
+ owner_pubkey = 'Fg6PaFpoGXkYsidMpWxTWqSKJf6KJkUxX92cnv7WMd2J'
102
+
103
+ # Query for token accounts owned by this public key
104
+ filters = [{ mint: 'TokenMintPublicKey' }]
105
+
106
+ result = client.get_token_accounts_by_owner(owner_pubkey, filters)
107
+
108
+ puts result
109
+
110
+ #### Account Filters
111
+
112
+ You can use the filters parameter to apply conditions for certain queries, such as fetching token accounts by a specific owner or a specific token program. Below are examples of filters that can be used in different queries.
113
+
114
+ #### Mint Filter
115
+
116
+ - Filter accounts by a specific token mint.
117
+
118
+ ``filters = [{ mint: 'TokenMintPublicKey' }]``
119
+
120
+ ``result = client.get_token_accounts_by_owner(owner_pubkey, filters)``
121
+
122
+ #### Program Filter
123
+
124
+ - Filter accounts associated with a particular program, such as the token program.
125
+
126
+ ``filters = [{ programId: 'TokenProgramPublicKey' }]``
127
+
128
+ ``result = client.get_token_accounts_by_owner(owner_pubkey, filters)``
129
+
130
+ #### Data Size Filter
131
+
132
+ - Filter accounts by the exact size of the account data.
133
+
134
+ ``filters = [{ dataSize: 165 }]``
135
+
136
+ ``result = client.get_program_accounts('ProgramPublicKey', filters)``
137
+
138
+ #### Memcmp Filter
139
+
140
+ - Filter by matching a specific slice of bytes at a given offset in account data.
83
141
 
84
- # Mint Filter: Filter by a specific token mint. This retrieves accounts holding tokens of that mint.
85
- filters = { mint: 'TokenMintPublicKey' }
142
+ ``filters = [{
143
+ memcmp: {
144
+ offset: 0,
145
+ bytes: 'Base58EncodedBytes'
146
+ }
147
+ }]``
86
148
 
87
- # Program Filter: Filter by a specific program (e.g., the token program).
88
- filters = { programId: 'TokenProgramPublicKey' }
149
+ ``result = client.get_program_accounts('ProgramPublicKey', filters)``
89
150
 
90
151
  ## WebSocket Methods
91
152
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SolanaRuby
4
- VERSION = "1.0.1.beta1"
4
+ VERSION = "1.0.1.beta3"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solana-ruby-web3js
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1.beta1
4
+ version: 1.0.1.beta3
5
5
  platform: ruby
6
6
  authors:
7
7
  - BuildSquad
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-10-01 00:00:00.000000000 Z
11
+ date: 2024-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: websocket-client-simple
@@ -52,6 +52,118 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: 0.2.0
55
+ - !ruby/object:Gem::Dependency
56
+ name: brakeman
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 6.1.2
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 6.1.2
69
+ - !ruby/object:Gem::Dependency
70
+ name: rubycritic
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 4.9.0
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 4.9.0
83
+ - !ruby/object:Gem::Dependency
84
+ name: simplecov
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: 0.22.0
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: 0.22.0
97
+ - !ruby/object:Gem::Dependency
98
+ name: pry
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: 0.14.2
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: 0.14.2
111
+ - !ruby/object:Gem::Dependency
112
+ name: rubocop
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '1.21'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '1.21'
125
+ - !ruby/object:Gem::Dependency
126
+ name: rspec
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '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: '0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
153
+ - !ruby/object:Gem::Dependency
154
+ name: ed25519
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
55
167
  - !ruby/object:Gem::Dependency
56
168
  name: yard
57
169
  requirement: !ruby/object:Gem::Requirement