pub struct RpcConfig {
pub endpoint_url: Option<String>,
pub seed: Option<CachedToken>,
pub refresh_margin_secs: Option<i64>,
pub networks: Option<HashMap<String, String>>,
pub payment: Option<PaymentConfig>,
}Fields§
§endpoint_url: Option<String>Custom HTTP URL to send JSON-RPC calls to, bypassing the Tooling Access
endpoint. When set, every rpc.call on this client goes straight to this
URL with NO session token minted or attached — the URL is treated as a
self-authenticating endpoint (e.g. a provisioned .quiknode.pro URL that
already embeds its token, or a self-hosted node). A per-call
endpoint_url overrides this default. Unset means tooling-JWT mode.
seed: Option<CachedToken>Optional pre-existing token to seed the in-memory cache (e.g. loaded from a host’s on-disk cache). Advisory: a malformed or expired seed is treated as a cache miss and a fresh token is minted.
refresh_margin_secs: Option<i64>Seconds before exp at which the client proactively refreshes. The
margin also absorbs clock skew between client and endpoint. Defaults to
60 when unset.
networks: Option<HashMap<String, String>>Per-network URL map for multichain routing: network key (e.g.
"solana-mainnet", "polygon") -> full http_url. Built from
admin.get_endpoint_urls(...).multichain_urls. When set, rpc.call with
a network resolves the target URL here. Optional; the default-network
call path needs no map.
payment: Option<PaymentConfig>Crypto-micropayment lane. When set, rpc.call pays per request with a
stablecoin against Quicknode’s x402/MPP gateways instead of using the
account API key + session JWT. #[serde(skip)] so from_env can never
populate it — an env-derived private key is exactly what we don’t want;
callers must pass this programmatically. The field is always present
(plain data), but the payment lane is only wired into rpc.call when a
crypto feature (payments/payments-svm/payments-tempo) is enabled;
built without any of them, a set payment is ignored and rpc.call
keeps its normal tooling-JWT behavior. The precompiled Python/Node/Ruby
packages always ship with the payment features on.