Struct kucoin_rs::kucoin::client::Kucoin[][src]

pub struct Kucoin {
    pub prefix: String,
    pub client: Client,
    // some fields omitted
}

Fields

prefix: Stringclient: Client

Implementations

impl Kucoin[src]

pub fn new(
    environment: KucoinEnv,
    credentials: Option<Credentials>
) -> Result<Self, Error>
[src]

pub async fn get(
    &self,
    url: String,
    sign: Option<HeaderMap>
) -> Result<Response, APIError>
[src]

pub async fn post(
    &self,
    url: String,
    sign: Option<HeaderMap>,
    params: Option<HashMap<String, String>>
) -> Result<Response, APIError>
[src]

pub async fn delete(
    &self,
    url: String,
    sign: Option<HeaderMap>
) -> Result<Response, APIError>
[src]

pub fn sign_headers(
    &self,
    endpoint: String,
    params: Option<&HashMap<String, String>>,
    query: Option<String>,
    method: Method
) -> Result<HeaderMap, Error>
[src]

impl Kucoin[src]

pub async fn get_mark_price(
    &self,
    symbol: &str
) -> Result<APIDatum<MarkPrice>, APIError>
[src]

pub async fn get_margin_config_info(
    &self
) -> Result<APIDatum<MarginInfo>, APIError>
[src]

pub async fn get_margin_accounts(
    &self
) -> Result<APIDatum<MarginAccounts>, APIError>
[src]

pub async fn post_borrow_order(
    &self,
    currency: &str,
    trade_type: &str,
    size: f64,
    max_rate: Option<f64>,
    term: Option<&str>
) -> Result<APIDatum<BorrowOrderId>, APIError>
[src]

Term param is comma delimited. Avaialble terms are 7,14,28

pub async fn get_borrow_order(
    &self,
    order_id: &str
) -> Result<APIDatum<BorrowOrder>, APIError>
[src]

pub async fn get_repay_record(
    &self,
    currency: Option<&str>,
    current_page: Option<i32>,
    page_size: Option<i32>
) -> Result<APIDatum<Pagination<RepayRecord>>, APIError>
[src]

pub async fn get_repayment_record(
    &self,
    currency: Option<&str>,
    current_page: Option<i32>,
    page_size: Option<i32>
) -> Result<APIDatum<Pagination<RepaymentRecord>>, APIError>
[src]

pub async fn one_click_repayment(
    &self,
    currency: &str,
    sequence: &str,
    size: f64
) -> Result<APIDatum<String>, APIError>
[src]

pub async fn repay_single_order(
    &self,
    currency: &str,
    trade_id: &str,
    size: f64
) -> Result<APIDatum<String>, APIError>
[src]

pub async fn post_lend_order(
    &self,
    currency: &str,
    size: f32,
    daily_int_rate: f32,
    term: i32
) -> Result<APIDatum<MarginOrderId>, APIError>
[src]

pub async fn cancel_lend_order(
    &self,
    order_id: &str
) -> Result<APIDatum<String>, APIError>
[src]

pub async fn set_auto_lend(
    &self,
    currency: &str,
    is_enable: bool,
    retain_size: Option<f32>,
    daily_int_rate: Option<f32>,
    term: Option<i32>
) -> Result<APIDatum<String>, APIError>
[src]

pub async fn get_active_order(
    &self,
    currency: &str,
    current_page: Option<i32>,
    page_size: Option<i32>
) -> Result<APIDatum<Pagination<MarginOrder>>, APIError>
[src]

pub async fn get_lend_history(
    &self,
    currency: Option<&str>,
    current_page: Option<i32>,
    page_size: Option<i32>
) -> Result<APIDatum<Pagination<MarginHistory>>, APIError>
[src]

pub async fn get_active_lend(
    &self,
    currency: Option<&str>,
    current_page: Option<i32>,
    page_size: Option<i32>
) -> Result<APIDatum<Pagination<LendOrder>>, APIError>
[src]

pub async fn get_settled_lend(
    &self,
    currency: Option<&str>,
    current_page: Option<i32>,
    page_size: Option<i32>
) -> Result<APIDatum<Pagination<LendHistory>>, APIError>
[src]

pub async fn get_lend_record(
    &self,
    currency: Option<&str>
) -> Result<APIData<LendRecord>, APIError>
[src]

pub async fn get_lend_market_data(
    &self,
    currency: &str,
    term: Option<i32>
) -> Result<APIData<LendMarketData>, APIError>
[src]

pub async fn get_margin_trade_data(
    &self,
    currency: &str
) -> Result<APIData<MarginTradeData>, APIError>
[src]

impl Kucoin[src]

pub async fn get_symbol_list(
    &self,
    market: Option<&str>
) -> Result<APIData<SymbolList>, APIError>
[src]

pub async fn get_ticker(
    &self,
    symbol: &str
) -> Result<APIDatum<Ticker>, APIError>
[src]

pub async fn get_all_tickers(&self) -> Result<APIDatum<AllTickers>, APIError>[src]

pub async fn get_daily_stats(
    &self,
    symbol: &str
) -> Result<APIDatum<DailyStats>, APIError>
[src]

pub async fn get_market_list(&self) -> Result<APIData<String>, APIError>[src]

pub async fn get_orderbook(
    &self,
    symbol: &str,
    amount: OrderBookType
) -> Result<APIDatum<OrderBook>, APIError>
[src]

pub async fn get_atomic_orderbook(
    &self,
    symbol: &str
) -> Result<APIDatum<AtomicOrderBook>, APIError>
[src]

pub async fn get_trade_histories(
    &self,
    symbol: &str
) -> Result<APIData<TradeHistories>, APIError>
[src]

pub async fn get_klines(
    &self,
    klines: Klines,
    symbol: &str,
    start_at: Option<i64>,
    end_at: Option<i64>
) -> Result<APIData<Vec<String>>, APIError>
[src]

pub async fn get_currencies(&self) -> Result<APIData<Currency>, APIError>[src]

pub async fn get_currency(
    &self,
    currency: &str,
    chain: Option<Chain>
) -> Result<APIDatum<Currency>, APIError>
[src]

pub async fn get_fiat_prices(
    &self,
    base: Option<&str>,
    currencies: Option<&str>
) -> Result<APIDatum<HashMap<String, String>>, APIError>
[src]

pub async fn get_server_time(&self) -> Result<APIDatum<i64>, APIError>[src]

impl Kucoin[src]

pub async fn post_limit_order(
    &self,
    client_oid: &str,
    symbol: &str,
    side: &str,
    price: &str,
    size: &str,
    optionals: Option<OrderOptionals<'_>>
) -> Result<APIDatum<OrderResp>, APIError>
[src]

Places a limit order. Takes required inputs directly and a Some type, or None for optional inputs. See OrderOptionals for build pattern usage to simplify generating optional params.

pub async fn post_market_order(
    &self,
    client_oid: &str,
    symbol: &str,
    side: &str,
    size: Option<f32>,
    funds: Option<f32>,
    optionals: Option<OrderOptionals<'_>>
) -> Result<APIDatum<OrderResp>, APIError>
[src]

Places a market order. Takes required inputs directly and a Some type, or None for optional inputs. See OrderOptionals for build pattern usage to simplify generating optional params.

Note that size is the amount in the base currency and funds is the amount in quote currency. Users should only use one or the other the order will fail. One of the two is a required parameter.

pub async fn cancel_order(
    &self,
    order_id: &str
) -> Result<APIDatum<CancelResp>, APIError>
[src]

Cancels an order based on the provided order id (required).

pub async fn cancel_order_by_client_oid(
    &self,
    client_oid: &str
) -> Result<APIDatum<CancelByClientOidResp>, APIError>
[src]

Cancels an order based on the provided order id (required).

pub async fn cancel_all_orders(
    &self,
    symbol: Option<&str>,
    trade_type: Option<&str>
) -> Result<APIDatum<CancelResp>, APIError>
[src]

pub async fn get_orders(
    &self,
    optionals: Option<OrderInfoOptionals<'_>>
) -> Result<APIDatum<Pagination<OrderInfo>>, APIError>
[src]

pub async fn get_v1_historical_orders(
    &self,
    symbol: Option<&str>,
    start_at: Option<i64>,
    end_at: Option<i64>,
    side: Option<&str>,
    current_page: Option<i32>,
    page_size: Option<i32>
) -> Result<APIDatum<Pagination<HistoricalOrder>>, APIError>
[src]

pub async fn get_recent_orders(&self) -> Result<APIData<OrderInfo>, APIError>[src]

pub async fn get_order(
    &self,
    order_id: &str
) -> Result<APIDatum<OrderInfo>, APIError>
[src]

pub async fn get_fills(
    &self,
    optionals: Option<FillsOptionals<'_>>
) -> Result<APIDatum<Pagination<FillsInfo>>, APIError>
[src]

pub async fn get_recent_fills(&self) -> Result<APIData<FillsInfo>, APIError>[src]

impl Kucoin[src]

pub async fn get_user_subaccount_info(
    &self
) -> Result<APIData<UserInfo>, APIError>
[src]

pub async fn create_account(
    &self,
    account_type: AccountType,
    currency: &str
) -> Result<APIDatum<AccountId>, APIError>
[src]

pub async fn get_accounts_list(
    &self,
    currency: Option<&str>,
    acct_type: Option<&str>
) -> Result<APIData<Accounts>, APIError>
[src]

pub async fn get_account(
    &self,
    account_id: &str
) -> Result<APIDatum<SingleAccount>, APIError>
[src]

pub async fn get_account_ledgers(
    &self,
    account_id: &str,
    start_at: Option<i64>,
    end_at: Option<i64>,
    current_page: Option<i32>,
    page_size: Option<i32>
) -> Result<APIDatum<Pagination<AccountInfo>>, APIError>
[src]

pub async fn get_hold(
    &self,
    account_id: &str,
    current_page: Option<i32>,
    page_size: Option<i32>
) -> Result<APIDatum<Pagination<AccountHolds>>, APIError>
[src]

pub async fn get_subaccount_balances(
    &self,
    account_id: &str
) -> Result<APIDatum<SubAccountBalances>, APIError>
[src]

pub async fn get_all_subaccount_balances(
    &self
) -> Result<APIData<SubAccountBalances>, APIError>
[src]

pub async fn get_transferable_balance(
    &self,
    currency: &str,
    account_type: AccountType
) -> Result<APIDatum<TransferableBalance>, APIError>
[src]

pub async fn transfer_to_subaccount(
    &self,
    client_oid: &str,
    currency: &str,
    amount: f32,
    direction: &str,
    sub_user_id: &str,
    account_type: Option<&str>,
    sub_account_type: Option<&str>
) -> Result<APIDatum<OrderId>, APIError>
[src]

pub async fn inner_transfer(
    &self,
    client_oid: &str,
    currency: &str,
    from: &str,
    to: &str,
    amount: &str
) -> Result<APIDatum<OrderId>, APIError>
[src]

pub async fn create_deposit_address(
    &self,
    currency: &str,
    chain: Option<&str>
) -> Result<APIDatum<DepositAddress>, APIError>
[src]

pub async fn get_deposit_address(
    &self,
    currency: &str,
    chain: Option<&str>
) -> Result<APIDatum<DepositAddress>, APIError>
[src]

pub async fn get_deposit_list(
    &self,
    currency: Option<&str>,
    start_at: Option<i64>,
    end_at: Option<i64>,
    status: Option<&str>,
    current_page: Option<i32>,
    page_size: Option<i32>
) -> Result<APIDatum<Pagination<DepositList>>, APIError>
[src]

pub async fn get_v1_deposit_list(
    &self,
    currency: Option<&str>,
    start_at: Option<i64>,
    end_at: Option<i64>,
    status: Option<&str>,
    current_page: Option<i32>,
    page_size: Option<i32>
) -> Result<APIDatum<Pagination<DepositListV1>>, APIError>
[src]

pub async fn get_withdrawals_list(
    &self,
    currency: Option<&str>,
    start_at: Option<i64>,
    end_at: Option<i64>,
    status: Option<&str>,
    current_page: Option<i32>,
    page_size: Option<i32>
) -> Result<APIDatum<Pagination<WithdrawalList>>, APIError>
[src]

pub async fn get_v1_withdrawals_list(
    &self,
    currency: Option<&str>,
    start_at: Option<i64>,
    end_at: Option<i64>,
    status: Option<&str>,
    current_page: Option<i32>,
    page_size: Option<i32>
) -> Result<APIDatum<Pagination<WithdrawalListV1>>, APIError>
[src]

pub async fn get_withdrawals_quotas(
    &self,
    currency: &str,
    chain: Option<&str>
) -> Result<APIDatum<WithdrawalQuotas>, APIError>
[src]

pub async fn apply_withdrawal(
    &self,
    currency: &str,
    address: &str,
    amount: i32,
    memo: Option<&str>,
    is_inner: Option<bool>,
    remark: Option<&str>,
    chain: Option<&str>
) -> Result<APIDatum<WithdrawalId>, APIError>
[src]

pub async fn cancel_withdrawal(
    &self,
    withdrawal_id: &str
) -> Result<String, APIError>
[src]

impl Kucoin[src]

pub fn websocket(&self) -> KucoinWebsocket[src]

pub async fn ws_bullet_private(
    &self
) -> Result<APIDatum<InstanceServers>, APIError>
[src]

pub async fn ws_bullet_public(
    &self
) -> Result<APIDatum<InstanceServers>, APIError>
[src]

pub async fn get_socket_endpoint(
    &self,
    ws_type: WSType
) -> Result<String, APIError>
[src]

Trait Implementations

impl Clone for Kucoin[src]

fn clone(&self) -> Kucoin[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Kucoin[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl !RefUnwindSafe for Kucoin

impl Send for Kucoin

impl Sync for Kucoin

impl Unpin for Kucoin

impl !UnwindSafe for Kucoin

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T> Instrument for T[src]

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

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

fn in_current_span(self) -> Instrumented<Self>[src]

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

pub fn vzip(self) -> V