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 +4 -4
- data/.DS_Store +0 -0
- data/README.md +68 -15
- data/lib/solana_ruby/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 769dd8aff42953255243d337b811ab9bd61e27e19e6957d235e9e015300f925b
|
4
|
+
data.tar.gz: e940aa048c15af34c5f06bf5de1db3716e8f68f1f83c41fe480a6de748082310
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
72
|
+
- **commitment**: Specifies the level of commitment desired when querying state. Options include:
|
73
73
|
|
74
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
83
|
-
|
84
|
-
|
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
|
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
|
-
|
93
|
-
|
142
|
+
``filters = [{
|
143
|
+
memcmp: {
|
144
|
+
offset: 0,
|
145
|
+
bytes: 'Base58EncodedBytes'
|
146
|
+
}
|
147
|
+
}]``
|
94
148
|
|
95
|
-
|
96
|
-
filters = { programId: 'TokenProgramPublicKey' }
|
149
|
+
``result = client.get_program_accounts('ProgramPublicKey', filters)``
|
97
150
|
|
98
151
|
## WebSocket Methods
|
99
152
|
|
data/lib/solana_ruby/version.rb
CHANGED