RPC Providers
solana.rpc.async_http_provider
Async HTTP RPC Provider.
AsyncHTTPProvider
Async HTTP provider to interact with the http rpc endpoint.
Source code in src/solana/rpc/async_http_provider.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 | |
__init__(endpoint=None, extra_headers=None, timeout=None, proxy=None, rate_limit=0, max_connections=None, max_keepalive_connections=None, keepalive_expiry=None, http2=True, max_transport_retries=DEFAULT_MAX_TRANSPORT_RETRIES)
Init AsyncHTTPProvider.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
endpoint
|
str | None
|
URL of the RPC endpoint. |
None
|
extra_headers
|
dict[str, str] | None
|
Extra headers to pass for HTTP request. |
None
|
timeout
|
float | None
|
HTTP request timeout in seconds. |
None
|
proxy
|
str | None
|
Proxy URL to pass to the HTTP client. |
None
|
rate_limit
|
float
|
Maximum requests per second. |
0
|
max_connections
|
int | None
|
Maximum number of concurrent connections. |
None
|
max_keepalive_connections
|
int | None
|
Maximum number of idle keep-alive connections. |
None
|
keepalive_expiry
|
float | None
|
Idle keep-alive connection expiry in seconds. |
None
|
http2
|
bool
|
Enable HTTP/2 support. |
True
|
max_transport_retries
|
int
|
Maximum number of times to retry httpx2 transport errors. |
DEFAULT_MAX_TRANSPORT_RETRIES
|
Source code in src/solana/rpc/async_http_provider.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | |
close()
async
Close session.
Source code in src/solana/rpc/async_http_provider.py
150 151 152 | |
make_request(body, parser)
async
Make an async HTTP request to an http rpc endpoint.
Source code in src/solana/rpc/async_http_provider.py
105 106 107 108 109 | |
make_request_unparsed(body)
async
Make an async HTTP request to an http rpc endpoint.
Source code in src/solana/rpc/async_http_provider.py
111 112 113 114 115 116 117 118 | |
get_default_endpoint()
Get the default http rpc endpoint.
Source code in src/solana/rpc/async_http_provider.py
27 28 29 | |