pub struct KalshiExecutionClientConfig {
pub account_id: AccountId,
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 exchange_index: u32,
pub transport_backend: TransportBackend,
}Expand description
Configuration for the Kalshi execution client.
Fields§
§account_id: AccountIdLocal account identifier for the primary account.
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.
exchange_index: u32Explicit exchange shard owned by this primary-account client.
transport_backend: TransportBackendWebSocket transport backend; only Sockudo is supported.
Implementations§
Source§impl KalshiExecutionClientConfig
impl KalshiExecutionClientConfig
Sourcepub fn builder() -> KalshiExecutionClientConfigBuilder
pub fn builder() -> KalshiExecutionClientConfigBuilder
Create an instance of KalshiExecutionClientConfig using the builder syntax
Source§impl KalshiExecutionClientConfig
impl KalshiExecutionClientConfig
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 positive 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 are zero or overflow.
Trait Implementations§
Source§impl ClientConfig for KalshiExecutionClientConfig
impl ClientConfig for KalshiExecutionClientConfig
Source§impl Clone for KalshiExecutionClientConfig
impl Clone for KalshiExecutionClientConfig
Source§impl Debug for KalshiExecutionClientConfig
impl Debug for KalshiExecutionClientConfig
impl DerefToPyAny for KalshiExecutionClientConfig
Source§impl<'de> Deserialize<'de> for KalshiExecutionClientConfigwhere
KalshiExecutionClientConfig: Default,
impl<'de> Deserialize<'de> for KalshiExecutionClientConfigwhere
KalshiExecutionClientConfig: 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 KalshiExecutionClientConfig
Source§impl<'a, 'py> FromPyObject<'a, 'py> for KalshiExecutionClientConfigwhere
Self: Clone,
impl<'a, 'py> FromPyObject<'a, 'py> for KalshiExecutionClientConfigwhere
Self: Clone,
Source§impl<'py> IntoPyObject<'py> for KalshiExecutionClientConfig
impl<'py> IntoPyObject<'py> for KalshiExecutionClientConfig
Source§type Target = KalshiExecutionClientConfig
type Target = KalshiExecutionClientConfig
Source§type Output = Bound<'py, KalshiExecutionClientConfig>
type Output = Bound<'py, KalshiExecutionClientConfig>
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 PyClass for KalshiExecutionClientConfig
impl PyClass for KalshiExecutionClientConfig
Source§impl PyClassImpl for KalshiExecutionClientConfig
impl PyClassImpl for KalshiExecutionClientConfig
Source§const RAW_DOC: &'static CStr = /// Configuration for the Kalshi execution client.
const RAW_DOC: &'static CStr = /// Configuration for the Kalshi execution client.
Source§const DOC: &'static CStr
const DOC: &'static CStr
text_signature if a constructor is defined. Read moreSource§type Layout = <<KalshiExecutionClientConfig as PyClassImpl>::BaseNativeType as PyClassBaseType>::Layout<KalshiExecutionClientConfig>
type Layout = <<KalshiExecutionClientConfig as PyClassImpl>::BaseNativeType as PyClassBaseType>::Layout<KalshiExecutionClientConfig>
Source§type ThreadChecker = NoopThreadChecker
type ThreadChecker = NoopThreadChecker
type Inventory = Pyo3MethodsInventoryForKalshiExecutionClientConfig
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 KalshiExecutionClientConfig
impl PyClassNewTextSignature for KalshiExecutionClientConfig
const TEXT_SIGNATURE: &'static str = "(account_id=None, 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, exchange_index=None, transport_backend=None)"
Source§impl PyStubType for KalshiExecutionClientConfig
impl PyStubType for KalshiExecutionClientConfig
Source§fn type_output() -> TypeInfo
fn type_output() -> TypeInfo
§fn type_input() -> TypeInfo
fn type_input() -> TypeInfo
Source§impl PyTypeInfo for KalshiExecutionClientConfig
impl PyTypeInfo for KalshiExecutionClientConfig
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.impl StructuralPartialEq for KalshiExecutionClientConfig
Auto Trait Implementations§
impl Freeze for KalshiExecutionClientConfig
impl RefUnwindSafe for KalshiExecutionClientConfig
impl Send for KalshiExecutionClientConfig
impl Sync for KalshiExecutionClientConfig
impl Unpin for KalshiExecutionClientConfig
impl UnsafeUnpin for KalshiExecutionClientConfig
impl UnwindSafe for KalshiExecutionClientConfig
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