UserClient

Struct UserClient 

Source
pub struct UserClient { /* private fields */ }

Implementations§

Source§

impl UserClient

Source

pub fn new(client: RestClient) -> Self

Source

pub async fn create_sub_member( &self, username: &str, member_type: i32, password: Option<&str>, note: Option<&str>, switch_option: Option<i32>, is_uta: Option<bool>, ) -> Result<ServerResponse<Value>>

Create a new sub user

API: POST /v5/user/create-sub-member https://bybit-exchange.github.io/docs/v5/user/create-subuid

Source

pub async fn create_sub_api( &self, sub_uid: i64, note: Option<&str>, read_only: i32, permissions: Value, ips: Option<Vec<String>>, ) -> Result<ServerResponse<Value>>

Create sub UID API key

API: POST /v5/user/create-sub-api https://bybit-exchange.github.io/docs/v5/user/create-subuid-apikey

Source

pub async fn query_sub_members( &self, page_size: Option<i32>, page: Option<i32>, ) -> Result<ServerResponse<Value>>

Get sub UID list

API: GET /v5/user/query-sub-members https://bybit-exchange.github.io/docs/v5/user/subuid-list

Source

pub async fn get_sub_members( &self, uid: Option<&str>, ) -> Result<ServerResponse<Value>>

Get all sub UID list (Alternative method)

API: GET /v5/user/submembers https://bybit-exchange.github.io/docs/v5/user/subuid-list-all

Source

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

Get API key information

API: GET /v5/user/query-api https://bybit-exchange.github.io/docs/v5/user/apikey-info

Source

pub async fn get_sub_api_keys( &self, sub_member_id: &str, limit: Option<i32>, cursor: Option<&str>, ) -> Result<ServerResponse<Value>>

Get sub account API keys

API: GET /v5/user/sub-apikeys https://bybit-exchange.github.io/docs/v5/user/sub-apikey-list

Source

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

Get user account type

API: GET /v5/user/get-member-type https://bybit-exchange.github.io/docs/v5/user/account-type

Source

pub async fn get_affiliate_customer_info( &self, uid: &str, ) -> Result<ServerResponse<Value>>

Get affiliate user info

API: GET /v5/user/aff-customer-info https://bybit-exchange.github.io/docs/v5/user/affiliate-info

Source

pub async fn freeze_sub_member( &self, sub_uid: i64, frozen: i32, ) -> Result<ServerResponse<Value>>

Freeze sub UID

API: POST /v5/user/frozen-sub-member https://bybit-exchange.github.io/docs/v5/user/frozen-subuid

Source

pub async fn delete_sub_member( &self, sub_member_id: &str, ) -> Result<ServerResponse<Value>>

Delete sub member

API: POST /v5/user/del-submember https://bybit-exchange.github.io/docs/v5/user/del-submember

Source

pub async fn update_api( &self, read_only: Option<i32>, ips: Option<Vec<String>>, permissions: Option<Value>, ) -> Result<ServerResponse<Value>>

Modify master API key

API: POST /v5/user/update-api https://bybit-exchange.github.io/docs/v5/user/modify-master-apikey

Source

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

Delete master API key

API: POST /v5/user/delete-api https://bybit-exchange.github.io/docs/v5/user/rm-master-apikey

Source

pub async fn update_sub_api( &self, api_key: &str, read_only: Option<i32>, ips: Option<Vec<String>>, permissions: Option<Value>, ) -> Result<ServerResponse<Value>>

Modify sub API key

API: POST /v5/user/update-sub-api https://bybit-exchange.github.io/docs/v5/user/modify-sub-apikey

Source

pub async fn delete_sub_api( &self, api_key: &str, ) -> Result<ServerResponse<Value>>

Delete sub API key

API: POST /v5/user/delete-sub-api https://bybit-exchange.github.io/docs/v5/user/rm-sub-apikey

Trait Implementations§

Source§

impl Clone for UserClient

Source§

fn clone(&self) -> UserClient

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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