pub struct KalshiDataClientConfig {
pub api_key_id: Option<SecretString>,
pub private_key: Option<SecretString>,
pub environment: KalshiEnvironment,
pub base_url_http: Option<SecretString>,
pub base_url_ws: Option<SecretString>,
pub proxy_url: Option<SecretString>,
pub http_timeout_secs: u64,
pub ws_timeout_secs: u64,
pub book_snapshot_timeout_secs: u64,
pub update_instruments_interval_mins: u64,
pub transport_backend: TransportBackend,
pub instrument_ids: Vec<InstrumentId>,
}Expand description
Configuration for the Kalshi data client.
Fields§
§api_key_id: Option<SecretString>Kalshi API key ID; supply with private_key or leave both absent.
private_key: Option<SecretString>PEM-encoded RSA-PSS or Ed25519 private key.
environment: KalshiEnvironmentTarget API and credential environment.
base_url_http: Option<SecretString>Optional REST base URL override.
base_url_ws: Option<SecretString>Optional WebSocket URL override.
proxy_url: Option<SecretString>Optional HTTP/HTTPS proxy URL.
http_timeout_secs: u64Positive HTTP request timeout in seconds within the transport clock range.
ws_timeout_secs: u64Positive WebSocket connection timeout in seconds.
book_snapshot_timeout_secs: u64Snapshot deadline in seconds; zero disables snapshot deadlines.
update_instruments_interval_mins: u64Positive instrument metadata refresh interval in minutes.
transport_backend: TransportBackendWebSocket transport backend; only Sockudo is supported.
instrument_ids: Vec<InstrumentId>Bootstrap markets. Empty is valid for transport-only configuration; the data factory requires at least one distinct Kalshi instrument ID.
Implementations§
Source§impl KalshiDataClientConfig
impl KalshiDataClientConfig
Sourcepub fn builder() -> KalshiDataClientConfigBuilder
pub fn builder() -> KalshiDataClientConfigBuilder
Create an instance of KalshiDataClientConfig using the builder syntax
Source§impl KalshiDataClientConfig
impl KalshiDataClientConfig
Sourcepub fn has_credentials(&self) -> bool
pub fn has_credentials(&self) -> bool
Returns whether both explicit credential fields contain non-empty values.
Sourcepub fn http_url(&self) -> &str
pub fn http_url(&self) -> &str
Returns the REST base URL, with an explicit override taking precedence.
Sourcepub fn ws_url(&self) -> &str
pub fn ws_url(&self) -> &str
Returns the WebSocket URL, with an explicit override taking precedence.
Sourcepub fn validate(&self) -> ConfigResult<()>
pub fn validate(&self) -> ConfigResult<()>
Validates explicit credentials, endpoints, and supported timing values.
This does not read credentials from the environment or validate key algorithms.
§Errors
Returns an error if credential fields are incomplete or invalid, URLs select the wrong venue environment or have an invalid format, the backend is unsupported, or timing values require positive values or exceed the supported range.
Trait Implementations§
Source§impl ClientConfig for KalshiDataClientConfig
impl ClientConfig for KalshiDataClientConfig
Source§impl Clone for KalshiDataClientConfig
impl Clone for KalshiDataClientConfig
Source§impl Debug for KalshiDataClientConfig
impl Debug for KalshiDataClientConfig
Source§impl Default for KalshiDataClientConfig
impl Default for KalshiDataClientConfig
impl DerefToPyAny for KalshiDataClientConfig
Source§impl<'de> Deserialize<'de> for KalshiDataClientConfigwhere
KalshiDataClientConfig: Default,
impl<'de> Deserialize<'de> for KalshiDataClientConfigwhere
KalshiDataClientConfig: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for KalshiDataClientConfig
Source§impl<'a, 'py> FromPyObject<'a, 'py> for KalshiDataClientConfigwhere
Self: Clone,
impl<'a, 'py> FromPyObject<'a, 'py> for KalshiDataClientConfigwhere
Self: Clone,
Source§impl<'py> IntoPyObject<'py> for KalshiDataClientConfig
impl<'py> IntoPyObject<'py> for KalshiDataClientConfig
Source§type Target = KalshiDataClientConfig
type Target = KalshiDataClientConfig
Source§type Output = Bound<'py, KalshiDataClientConfig>
type Output = Bound<'py, KalshiDataClientConfig>
Source§fn into_pyobject(self, py: Python<'py>) -> PyResult<Bound<'py, Self>>
fn into_pyobject(self, py: Python<'py>) -> PyResult<Bound<'py, Self>>
Source§impl PartialEq for KalshiDataClientConfig
impl PartialEq for KalshiDataClientConfig
Source§impl PyClass for KalshiDataClientConfig
impl PyClass for KalshiDataClientConfig
Source§impl PyClassImpl for KalshiDataClientConfig
impl PyClassImpl for KalshiDataClientConfig
Source§const RAW_DOC: &'static CStr = /// Configuration for the Kalshi data client.
const RAW_DOC: &'static CStr = /// Configuration for the Kalshi data client.
Source§const DOC: &'static CStr
const DOC: &'static CStr
text_signature if a constructor is defined. Read moreSource§type Layout = <<KalshiDataClientConfig as PyClassImpl>::BaseNativeType as PyClassBaseType>::Layout<KalshiDataClientConfig>
type Layout = <<KalshiDataClientConfig as PyClassImpl>::BaseNativeType as PyClassBaseType>::Layout<KalshiDataClientConfig>
Source§type ThreadChecker = NoopThreadChecker
type ThreadChecker = NoopThreadChecker
type Inventory = Pyo3MethodsInventoryForKalshiDataClientConfig
Source§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
Source§type BaseNativeType = PyAny
type BaseNativeType = PyAny
PyAny by default, and when you declare
#[pyclass(extends=PyDict)], it’s PyDict.fn items_iter() -> PyClassItemsIter
fn lazy_type_object() -> &'static LazyTypeObject<Self>
fn __traverse__(&self, visit: PyVisit<'_>) -> Result<(), PyTraverseError>
§const IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
§const IS_IMMUTABLE_TYPE: bool = false
const IS_IMMUTABLE_TYPE: bool = false
§fn dict_offset() -> Option<PyObjectOffset>
fn dict_offset() -> Option<PyObjectOffset>
§fn weaklist_offset() -> Option<PyObjectOffset>
fn weaklist_offset() -> Option<PyObjectOffset>
Source§impl PyClassNewTextSignature for KalshiDataClientConfig
impl PyClassNewTextSignature for KalshiDataClientConfig
const TEXT_SIGNATURE: &'static str = "(api_key_id=None, private_key=None, environment=None, base_url_http=None, base_url_ws=None, proxy_url=None, http_timeout_secs=None, ws_timeout_secs=None, update_instruments_interval_mins=None, transport_backend=None, book_snapshot_timeout_secs=None, instrument_ids=None)"
Source§impl PyStubType for KalshiDataClientConfig
impl PyStubType for KalshiDataClientConfig
Source§fn type_output() -> TypeInfo
fn type_output() -> TypeInfo
§fn type_input() -> TypeInfo
fn type_input() -> TypeInfo
Source§impl PyTypeInfo for KalshiDataClientConfig
impl PyTypeInfo for KalshiDataClientConfig
Source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
§fn type_object(py: Python<'_>) -> Bound<'_, PyType>
fn type_object(py: Python<'_>) -> Bound<'_, PyType>
§fn is_type_of(object: &Bound<'_, PyAny>) -> bool
fn is_type_of(object: &Bound<'_, PyAny>) -> bool
object is an instance of this type or a subclass of this type.§fn is_exact_type_of(object: &Bound<'_, PyAny>) -> bool
fn is_exact_type_of(object: &Bound<'_, PyAny>) -> bool
object is an instance of this type.Source§impl Serialize for KalshiDataClientConfig
impl Serialize for KalshiDataClientConfig
impl StructuralPartialEq for KalshiDataClientConfig
Auto Trait Implementations§
impl Freeze for KalshiDataClientConfig
impl RefUnwindSafe for KalshiDataClientConfig
impl Send for KalshiDataClientConfig
impl Sync for KalshiDataClientConfig
impl Unpin for KalshiDataClientConfig
impl UnsafeUnpin for KalshiDataClientConfig
impl UnwindSafe for KalshiDataClientConfig
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
impl<'py, T> FromPyObjectOwned<'py> for Twhere
T: for<'a> FromPyObject<'a, 'py>,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
§fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
self into an owned Python object, dropping type information.§fn into_py_any(self, py: Python<'py>) -> Result<Py<PyAny>, PyErr>
fn into_py_any(self, py: Python<'py>) -> Result<Py<PyAny>, PyErr>
self into an owned Python object, dropping type information and unbinding it
from the 'py lifetime.§fn into_pyobject_or_pyerr(self, py: Python<'py>) -> Result<Self::Output, PyErr>
fn into_pyobject_or_pyerr(self, py: Python<'py>) -> Result<Self::Output, PyErr>
self into a Python object. Read more§impl<'py, T> IntoPyObjectNautilusExt<'py> for Twhere
T: IntoPyObjectExt<'py>,
impl<'py, T> IntoPyObjectNautilusExt<'py> for Twhere
T: IntoPyObjectExt<'py>,
§fn into_py_any_unwrap(self, py: Python<'py>) -> Py<PyAny>where
Self: IntoPyObject<'py, Error = !>,
fn into_py_any_unwrap(self, py: Python<'py>) -> Py<PyAny>where
Self: IntoPyObject<'py, Error = !>,
self into a [Py<PyAny>] when the underlying conversion is infallible.§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> PyErrArguments for T
impl<T> PyErrArguments for T
§impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
§fn type_check(object: &Bound<'_, PyAny>) -> bool
fn type_check(object: &Bound<'_, PyAny>) -> bool
§fn classinfo_object(py: Python<'_>) -> Bound<'_, PyAny>
fn classinfo_object(py: Python<'_>) -> Bound<'_, PyAny>
isinstance and issubclass function. Read more