pub struct CoinbaseIntxHttpClient { /* private fields */ }
Expand description
Provides a higher-level HTTP client for the Coinbase International REST API.
This client wraps the underlying CoinbaseIntxHttpInnerClient
to handle conversions
into the Nautilus domain model.
Implementations§
Source§impl CoinbaseIntxHttpClient
impl CoinbaseIntxHttpClient
Sourcepub fn new(base_url: Option<String>, timeout_secs: Option<u64>) -> Self
pub fn new(base_url: Option<String>, timeout_secs: Option<u64>) -> Self
Creates a new CoinbaseIntxHttpClient
using the default Coinbase HTTP URL,
optionally overridden with a custom base url.
This version of the client has no credentials, so it can only call publicly accessible endpoints.
Sourcepub fn from_env() -> Result<Self>
pub fn from_env() -> Result<Self>
Creates a new authenticated CoinbaseIntxHttpClient
using environment variables and
the default Coinbase International HTTP base url.
Sourcepub fn with_credentials(
api_key: Option<String>,
api_secret: Option<String>,
api_passphrase: Option<String>,
base_url: Option<String>,
timeout_secs: Option<u64>,
) -> Result<Self>
pub fn with_credentials( api_key: Option<String>, api_secret: Option<String>, api_passphrase: Option<String>, base_url: Option<String>, timeout_secs: Option<u64>, ) -> Result<Self>
Creates a new CoinbaseIntxHttpClient
configured with credentials
for authenticated requests, optionally using a custom base url.
Sourcepub const fn is_initialized(&self) -> bool
pub const fn is_initialized(&self) -> bool
Checks if the client is initialized.
The client is considered initialized if any instruments have been cached from the venue.
Sourcepub fn get_cached_symbols(&self) -> Vec<String>
pub fn get_cached_symbols(&self) -> Vec<String>
Returns the cached instrument symbols.
Sourcepub fn add_instruments(&mut self, instruments: Vec<InstrumentAny>)
pub fn add_instruments(&mut self, instruments: Vec<InstrumentAny>)
Adds the given instruments into the clients instrument cache.
Any existing instruments will be replaced.
Sourcepub fn add_instrument(&mut self, instrument: InstrumentAny)
pub fn add_instrument(&mut self, instrument: InstrumentAny)
Adds the given instrument into the clients instrument cache.
Any existing instrument will be replaced.
Sourcepub async fn list_portfolios(&self) -> Result<Vec<CoinbaseIntxPortfolio>>
pub async fn list_portfolios(&self) -> Result<Vec<CoinbaseIntxPortfolio>>
Requests a list of portfolio details from Coinbase International.
Sourcepub async fn request_account_state(
&self,
account_id: AccountId,
) -> Result<AccountState>
pub async fn request_account_state( &self, account_id: AccountId, ) -> Result<AccountState>
Requests the account state for the given account ID from Coinbase International.
Sourcepub async fn request_instruments(&self) -> Result<Vec<InstrumentAny>>
pub async fn request_instruments(&self) -> Result<Vec<InstrumentAny>>
Requests all instruments from Coinbase International.
Sourcepub async fn request_instrument(&self, symbol: &Symbol) -> Result<InstrumentAny>
pub async fn request_instrument(&self, symbol: &Symbol) -> Result<InstrumentAny>
Requests the instrument for the given symbol from Coinbase International.
Sourcepub async fn request_order_status_report(
&self,
account_id: AccountId,
venue_order_id: VenueOrderId,
) -> Result<OrderStatusReport>
pub async fn request_order_status_report( &self, account_id: AccountId, venue_order_id: VenueOrderId, ) -> Result<OrderStatusReport>
Requests an order status reports for the given venue order ID from Coinbase International.
Sourcepub async fn request_order_status_reports(
&self,
account_id: AccountId,
symbol: Symbol,
) -> Result<Vec<OrderStatusReport>>
pub async fn request_order_status_reports( &self, account_id: AccountId, symbol: Symbol, ) -> Result<Vec<OrderStatusReport>>
Requests order status reports for all open orders from Coinbase International.
Sourcepub async fn request_fill_reports(
&self,
account_id: AccountId,
client_order_id: Option<ClientOrderId>,
start: Option<DateTime<Utc>>,
) -> Result<Vec<FillReport>>
pub async fn request_fill_reports( &self, account_id: AccountId, client_order_id: Option<ClientOrderId>, start: Option<DateTime<Utc>>, ) -> Result<Vec<FillReport>>
Requests all fill reports from Coinbase International.
Sourcepub async fn request_position_status_report(
&self,
account_id: AccountId,
symbol: Symbol,
) -> Result<PositionStatusReport>
pub async fn request_position_status_report( &self, account_id: AccountId, symbol: Symbol, ) -> Result<PositionStatusReport>
Requests a position status report from Coinbase International.
Sourcepub async fn request_position_status_reports(
&self,
account_id: AccountId,
) -> Result<Vec<PositionStatusReport>>
pub async fn request_position_status_reports( &self, account_id: AccountId, ) -> Result<Vec<PositionStatusReport>>
Requests all position status reports from Coinbase International.
Sourcepub async fn submit_order(
&self,
account_id: AccountId,
client_order_id: ClientOrderId,
symbol: Symbol,
order_side: OrderSide,
order_type: OrderType,
quantity: Quantity,
time_in_force: TimeInForce,
expire_time: Option<DateTime<Utc>>,
price: Option<Price>,
trigger_price: Option<Price>,
post_only: Option<bool>,
reduce_only: Option<bool>,
) -> Result<OrderStatusReport>
pub async fn submit_order( &self, account_id: AccountId, client_order_id: ClientOrderId, symbol: Symbol, order_side: OrderSide, order_type: OrderType, quantity: Quantity, time_in_force: TimeInForce, expire_time: Option<DateTime<Utc>>, price: Option<Price>, trigger_price: Option<Price>, post_only: Option<bool>, reduce_only: Option<bool>, ) -> Result<OrderStatusReport>
Submits a new order to Coinbase International.
Sourcepub async fn cancel_order(
&self,
account_id: AccountId,
client_order_id: ClientOrderId,
) -> Result<OrderStatusReport>
pub async fn cancel_order( &self, account_id: AccountId, client_order_id: ClientOrderId, ) -> Result<OrderStatusReport>
Cancels a currently open order on Coinbase International.
Sourcepub async fn cancel_orders(
&self,
account_id: AccountId,
symbol: Symbol,
order_side: Option<OrderSide>,
) -> Result<Vec<OrderStatusReport>>
pub async fn cancel_orders( &self, account_id: AccountId, symbol: Symbol, order_side: Option<OrderSide>, ) -> Result<Vec<OrderStatusReport>>
Cancels all orders for the given account ID and filter params on Coinbase International.
Source§impl CoinbaseIntxHttpClient
impl CoinbaseIntxHttpClient
pub fn py_base_url(&self) -> &str
pub fn py_api_key(&self) -> Option<&str>
pub const fn py_is_initialized(&self) -> bool
pub fn py_get_cached_symbols(&self) -> Vec<String>
pub fn py_add_instrument( &mut self, py: Python<'_>, instrument: PyObject, ) -> PyResult<()>
pub fn py_list_portfolios<'py>( &mut self, py: Python<'py>, ) -> PyResult<Bound<'py, PyAny>>
Trait Implementations§
Source§impl Clone for CoinbaseIntxHttpClient
impl Clone for CoinbaseIntxHttpClient
Source§fn clone(&self) -> CoinbaseIntxHttpClient
fn clone(&self) -> CoinbaseIntxHttpClient
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Default for CoinbaseIntxHttpClient
impl Default for CoinbaseIntxHttpClient
Source§impl IntoPy<Py<PyAny>> for CoinbaseIntxHttpClient
impl IntoPy<Py<PyAny>> for CoinbaseIntxHttpClient
Source§impl<'py> IntoPyObject<'py> for CoinbaseIntxHttpClient
impl<'py> IntoPyObject<'py> for CoinbaseIntxHttpClient
Source§type Target = CoinbaseIntxHttpClient
type Target = CoinbaseIntxHttpClient
Source§type Output = Bound<'py, <CoinbaseIntxHttpClient as IntoPyObject<'py>>::Target>
type Output = Bound<'py, <CoinbaseIntxHttpClient as IntoPyObject<'py>>::Target>
Source§fn into_pyobject(
self,
py: Python<'py>,
) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
fn into_pyobject( self, py: Python<'py>, ) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
Source§impl PyClass for CoinbaseIntxHttpClient
impl PyClass for CoinbaseIntxHttpClient
Source§impl PyClassImpl for CoinbaseIntxHttpClient
impl PyClassImpl for CoinbaseIntxHttpClient
Source§const IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
Source§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
Source§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
Source§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
Source§type ThreadChecker = SendablePyClass<CoinbaseIntxHttpClient>
type ThreadChecker = SendablePyClass<CoinbaseIntxHttpClient>
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 dict_offset() -> Option<isize>
fn weaklist_offset() -> Option<isize>
Source§impl PyClassNewTextSignature<CoinbaseIntxHttpClient> for PyClassImplCollector<CoinbaseIntxHttpClient>
impl PyClassNewTextSignature<CoinbaseIntxHttpClient> for PyClassImplCollector<CoinbaseIntxHttpClient>
fn new_text_signature(self) -> Option<&'static str>
Source§impl<'a, 'py> PyFunctionArgument<'a, 'py, false> for &'a CoinbaseIntxHttpClient
impl<'a, 'py> PyFunctionArgument<'a, 'py, false> for &'a CoinbaseIntxHttpClient
Source§impl<'a, 'py> PyFunctionArgument<'a, 'py, false> for &'a mut CoinbaseIntxHttpClient
impl<'a, 'py> PyFunctionArgument<'a, 'py, false> for &'a mut CoinbaseIntxHttpClient
Source§impl PyMethods<CoinbaseIntxHttpClient> for PyClassImplCollector<CoinbaseIntxHttpClient>
impl PyMethods<CoinbaseIntxHttpClient> for PyClassImplCollector<CoinbaseIntxHttpClient>
fn py_methods(self) -> &'static PyClassItems
Source§impl PyTypeInfo for CoinbaseIntxHttpClient
impl PyTypeInfo for CoinbaseIntxHttpClient
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 type_object_bound(py: Python<'_>) -> Bound<'_, PyType>
fn type_object_bound(py: Python<'_>) -> Bound<'_, PyType>
PyTypeInfo::type_object
PyTypeInfo::type_object
].§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_type_of_bound(object: &Bound<'_, PyAny>) -> bool
fn is_type_of_bound(object: &Bound<'_, PyAny>) -> bool
PyTypeInfo::is_type_of
PyTypeInfo::is_type_of
].§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.§fn is_exact_type_of_bound(object: &Bound<'_, PyAny>) -> bool
fn is_exact_type_of_bound(object: &Bound<'_, PyAny>) -> bool
PyTypeInfo::is_exact_type_of
PyTypeInfo::is_exact_type_of
].impl DerefToPyAny for CoinbaseIntxHttpClient
Auto Trait Implementations§
impl Freeze for CoinbaseIntxHttpClient
impl !RefUnwindSafe for CoinbaseIntxHttpClient
impl Send for CoinbaseIntxHttpClient
impl Sync for CoinbaseIntxHttpClient
impl Unpin for CoinbaseIntxHttpClient
impl !UnwindSafe for CoinbaseIntxHttpClient
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FromPyObject<'_> for Twhere
T: PyClass + Clone,
impl<T> FromPyObject<'_> for Twhere
T: PyClass + Clone,
§fn extract_bound(obj: &Bound<'_, PyAny>) -> Result<T, PyErr>
fn extract_bound(obj: &Bound<'_, PyAny>) -> Result<T, PyErr>
§impl<'py, T> FromPyObjectBound<'_, 'py> for Twhere
T: FromPyObject<'py>,
impl<'py, T> FromPyObjectBound<'_, 'py> for Twhere
T: FromPyObject<'py>,
§fn from_py_object_bound(ob: Borrowed<'_, 'py, PyAny>) -> Result<T, PyErr>
fn from_py_object_bound(ob: Borrowed<'_, 'py, PyAny>) -> Result<T, PyErr>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§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