You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/rpc_client.rs
+18-6Lines changed: 18 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -1,20 +1,20 @@
1
1
/// # RPC Client for Helius
2
2
///
3
-
/// This module provides access to the Helius API using an RPC client with an embedded Solana client
3
+
/// This module provides access to the Helius API using an RPC client with an embedded Solana client.
4
4
///
5
5
/// ## Errors
6
6
///
7
-
/// Most methods in this client will return a `Result<T, HeliusError>`, where `HeliusError` can be:
7
+
/// Most methods in this client will return a `Result<T, HeliusError>`, where common variants include:
8
8
/// - `BadRequest`: Incorrect request format or parameters. Check the path and the text for details
9
9
/// - `Unauthorized`: Incorrect or missing API key. Ensure you've provided the correct API key
10
10
/// - `NotFound`: The requested resource was not found. This could mean an invalid ID or a non-existent endpoint
11
11
/// - `RateLimitExceeded`: Too many requests have been sent in a short period. Consider implementing retries with an exponential backoff
12
12
/// - `InternalError`: Server-side errors. These are rare and typically indicate issues on the server side. If these issues persist, please contact Helius support
13
-
/// - `Network`: Errors during HTTP communication, typically from underlying network issues
13
+
/// - `ReqwestError`: Errors during HTTP communication, typically from underlying network issues
14
14
/// - `SerdeJson`: Errors during the serialization or deserialization process
15
15
/// - `Unknown`: Catch-all for unclassified errors, with a status code and message provided for further investigation
16
16
///
17
-
/// Ensure to handle these errors gracefully in your application to maintain robustness and stellar UX
17
+
/// See [`HeliusError`](crate::error::HeliusError) for the full list of error variants.
18
18
use std::collections::HashMap;
19
19
use std::fmt::Debug;
20
20
use std::sync::Arc;
@@ -39,9 +39,21 @@ use serde::Serialize;
39
39
use solana_client::rpc_client::RpcClientasSolanaRpcClient;
40
40
use solana_commitment_config::CommitmentConfig;
41
41
42
+
/// Helius RPC client with an embedded Solana RPC client.
43
+
///
44
+
/// Provides methods for interacting with the Helius DAS API, priority fee estimation,
45
+
/// and enhanced RPC V2 endpoints (`getProgramAccountsV2`, `getTokenAccountsByOwnerV2`,
46
+
/// `getTransactionsForAddress`). The embedded Solana client handles standard Solana
47
+
/// RPC calls.
48
+
///
49
+
/// Constructed internally by [`Helius`](crate::Helius) — use [`HeliusBuilder`](crate::HeliusBuilder)
50
+
/// or [`Helius::new`](crate::Helius::new) to create a client.
42
51
pubstructRpcClient{
52
+
/// HTTP request handler for Helius API calls
43
53
pubhandler:RequestHandler,
54
+
/// Shared SDK configuration (API key, endpoints)
44
55
pubconfig:Arc<Config>,
56
+
/// Embedded Solana RPC client for standard RPC methods
45
57
pubsolana_client:Arc<SolanaRpcClient>,
46
58
}
47
59
@@ -289,7 +301,7 @@ impl RpcClient {
289
301
///
290
302
/// # Pagination
291
303
/// * If `pagination_key` is `Some`, pass it into the **next** request to continue
292
-
/// * If `pagination_key` is `None`, ypu've reached the end
304
+
/// * If `pagination_key` is `None`, you've reached the end
293
305
/// * Note that if there are fewer than `limit` accounts in a given page it does not imply the end; always check the cursor
294
306
///
295
307
/// # Incremental Updates
@@ -321,7 +333,7 @@ impl RpcClient {
321
333
///
322
334
/// # Pagination
323
335
/// * If `pagination_key` is `Some`, pass it into the **next** request to continue
324
-
/// * If `pagination_key` is `None`, ypu've reached the end
336
+
/// * If `pagination_key` is `None`, you've reached the end
325
337
/// * Note that if there are fewer than `limit` accounts in a given page it does not imply the end; always check the cursor
0 commit comments