Client

Struct Client 

Source
pub struct Client { /* private fields */ }
Expand description

CSFloat API Client

Implementations§

Source§

impl Client

Source

pub fn new(api_key: impl Into<String>) -> Result<Self>

Create a new CSFloat client with API key

Source

pub fn with_proxy( api_key: impl Into<String>, proxy_url: impl AsRef<str>, ) -> Result<Self>

Create a new CSFloat client with API key and proxy

Source

pub async fn get_exchange_rates(&self) -> Result<ExchangeRates>

Get exchange rates

Source

pub async fn get_me(&self) -> Result<Me>

Get authenticated user profile

Source

pub async fn get_location(&self) -> Result<Value>

Get user’s location

Source

pub async fn get_transactions(&self, page: u32, limit: u32) -> Result<Value>

Get transactions

Source

pub async fn get_account_standing(&self) -> Result<Value>

Get account standing

Source

pub async fn get_pending_trades(&self, limit: u32, page: u32) -> Result<Value>

Get pending trades

Source

pub async fn get_similar(&self, listing_id: &str) -> Result<Vec<Listing>>

Get similar listings

Source

pub async fn get_buy_orders( &self, listing_id: &str, limit: u32, ) -> Result<Vec<BuyOrder>>

Get buy orders for a listing

Source

pub async fn get_my_buy_orders(&self, page: u32, limit: u32) -> Result<Value>

Get user’s own buy orders

Source

pub async fn get_sales( &self, market_hash_name: &str, paint_index: Option<i32>, ) -> Result<Value>

Get sales history

Source

pub async fn get_schema(&self) -> Result<SchemaResponse>

Get schema with weapon pricing data This endpoint returns average prices for each skin in different wear conditions

Source

pub fn get_all_listings(&self) -> ListingsRequestBuilder<'_>

Get all listings with builder pattern

Source

pub async fn get_specific_listing(&self, listing_id: &str) -> Result<Listing>

Get specific listing

Source

pub async fn get_stall(&self, user_id: &str, limit: u32) -> Result<Stall>

Get user’s stall

Source

pub async fn get_inventory(&self) -> Result<Value>

Get inventory

Source

pub async fn get_watchlist(&self, limit: u32) -> Result<Value>

Get watchlist

Source

pub async fn get_offers(&self, limit: u32) -> Result<Value>

Get offers

Source

pub async fn get_trade_history( &self, role: TradeRole, limit: u32, page: u32, ) -> Result<Value>

Get trade history

Source

pub async fn delete_listing(&self, listing_id: &str) -> Result<Value>

Delete a listing

Source

pub async fn delete_buy_order(&self, id: &str) -> Result<Value>

Delete a buy order

Source

pub async fn delete_watchlist(&self, id: i64) -> Result<Value>

Delete from watchlist

Source

pub async fn create_listing( &self, request: CreateListingRequest, ) -> Result<Value>

Create a listing

Source

pub async fn create_buy_order( &self, request: CreateBuyOrderRequest, ) -> Result<Value>

Create a buy order

Source

pub async fn make_offer(&self, listing_id: &str, price: i32) -> Result<Value>

Make an offer

Source

pub async fn buy_now(&self, total_price: i32, listing_id: &str) -> Result<Value>

Buy now

Source

pub async fn accept_sale(&self, trade_ids: Vec<String>) -> Result<Value>

Accept sales

Source

pub async fn update_listing_price( &self, listing_id: &str, price: i32, ) -> Result<Value>

Update listing price

Auto Trait Implementations§

§

impl Freeze for Client

§

impl !RefUnwindSafe for Client

§

impl Send for Client

§

impl Sync for Client

§

impl Unpin for Client

§

impl !UnwindSafe for Client

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,