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

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: b4523cc4b31deed37187c1f16585843ad9cb30fb65fa6e1ffd623f40a77cba0b
4
- data.tar.gz: 95b7f14f5202f681d19e8ce09c466660d583fd84a4fb82213b77c1eff633164e
3
+ metadata.gz: 769dd8aff42953255243d337b811ab9bd61e27e19e6957d235e9e015300f925b
4
+ data.tar.gz: e940aa048c15af34c5f06bf5de1db3716e8f68f1f83c41fe480a6de748082310
5
5
  SHA512:
6
- metadata.gz: f5e042632802df702a40a514f7fae3d0c2c5d3d3d6cbe563e94f5a8d5b8be2e9bb8b61b0da2cec398f3c9d9f71247162f281e31770d2559d41a9ed85596142eb
7
- data.tar.gz: be74a999f1eebc3eb4cded2b4d594aa9a90dca57589af40ce360636efe3cb150317e948ab8b9f95eba8485846a56dde9405d65465615e34ad5c246da8c84e90e
6
+ metadata.gz: 7cd8eb6a1ff5a1c749cb1ded759323bd1a7a43dea78e6d19444f1d1e8dc77ca24f757c5fc53412431020f09960db0cef8f2bd519641a0bdc5790c4dc8e60a581
7
+ data.tar.gz: d6c68d6c97ae798d5b79b4fcaae962ac3e34e7e2d28d61b80124b4725b3926803c49f20bd055bc7c6af9b46229558111a3ea0dae932d15750f726484a0c6b460
data/.DS_Store CHANGED
Binary file
data/README.md CHANGED
@@ -67,33 +67,86 @@ For a more detailed overview of Solana's available RPC methods, visit the offici
67
67
 
68
68
  ### Options Parameter
69
69
 
70
- 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
71
 
72
- commitment: Specifies the level of commitment desired when querying state.
72
+ - **commitment**: Specifies the level of commitment desired when querying state. Options include:
73
73
 
74
- Options include:
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.
75
77
 
76
- 'finalized': Query the most recent block confirmed by supermajority of the cluster.
77
- 'confirmed': Query the most recent block that has been voted on by supermajority of the cluster.
78
- 'processed': Query the most recent block regardless of cluster voting.
78
+ - **encoding**: Defines the format of the returned account data. Possible values include:
79
79
 
80
- encoding: Defines the format of the returned account data. Possible values include:
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.
81
83
 
82
- 'jsonParsed': Returns data in a JSON-parsed format.
83
- 'base64': Returns raw account data in Base64 encoding.
84
- 'base64+zstd': Returns compressed Base64 data.
84
+ - **epoch**: Specify the epoch when querying for certain information like epoch details.
85
+
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.
85
91
 
86
92
  By providing options, you can control the nature of the returned data and the reliability of the query.
87
93
 
88
94
  ### Filters Parameter
89
95
 
90
- 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.
91
141
 
92
- # Mint Filter: Filter by a specific token mint. This retrieves accounts holding tokens of that mint.
93
- filters = { mint: 'TokenMintPublicKey' }
142
+ ``filters = [{
143
+ memcmp: {
144
+ offset: 0,
145
+ bytes: 'Base58EncodedBytes'
146
+ }
147
+ }]``
94
148
 
95
- # Program Filter: Filter by a specific program (e.g., the token program).
96
- filters = { programId: 'TokenProgramPublicKey' }
149
+ ``result = client.get_program_accounts('ProgramPublicKey', filters)``
97
150
 
98
151
  ## WebSocket Methods
99
152
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SolanaRuby
4
- VERSION = "1.0.1.beta2"
4
+ VERSION = "1.0.1.beta3"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solana-ruby-web3js
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1.beta2
4
+ version: 1.0.1.beta3
5
5
  platform: ruby
6
6
  authors:
7
7
  - BuildSquad