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

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_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_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 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 async fn post_limit_order<'_, '_, '_, '_, '_>(
    &'_ self,
    client_oid: &'_ str,
    symbol: &'_ str,
    side: &'_ str,
    price: f32,
    size: f32,
    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_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 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]

impl Debug for Kucoin[src]

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]

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

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

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

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

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

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.

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.

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.

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