Skip to main content

WithdrawRequest

Struct WithdrawRequest 

Source
pub struct WithdrawRequest {
    pub coin: String,
    pub address: String,
    pub amount: Decimal,
    pub timestamp: i64,
    pub account_type: String,
    pub chain: Option<String>,
    pub tag: Option<String>,
    pub force_chain: Option<i64>,
    pub fee_type: Option<i64>,
    pub request_id: Option<String>,
}
Expand description

Request body for Client::withdraw.

Fields§

§coin: String

Coin name, uppercase only

§address: String

Destination wallet address, case-sensitive, or a Bybit UID when force_chain=2

§amount: Decimal

Withdraw amount

§timestamp: i64

Current timestamp (ms). Used to prevent replay attacks

§account_type: String

Wallet to withdraw from: FUND, UNIFIED/UTA, EARN, or a comma-separated combination, e.g. "FUND,UTA,EARN". Not the AccountType enum: this field accepts combinations that enum can’t represent

§chain: Option<String>

Chain name, from Client::get_coin_info. Required unless force_chain=2

§tag: Option<String>

Tag/memo, required if the destination address needs one

§force_chain: Option<i64>

0(default): on chain if the address isn’t recognized as an internal Bybit address, otherwise internal transfer. 1: force on chain. 2: force internal transfer by UID, address must be a Bybit UID

§fee_type: Option<i64>

0(default): withdrawal fee is deducted from amount. 1: fee is deducted separately by the system

§request_id: Option<String>

Idempotent request ID, 1-32 alphanumeric characters

Implementations§

Source§

impl WithdrawRequest

Source

pub fn new( coin: impl Into<String>, address: impl Into<String>, amount: Decimal, timestamp: i64, account_type: impl Into<String>, ) -> Self

Create with the required fields; set the optional ones with the with_* methods.

Source

pub fn with_chain(self, v: impl Into<String>) -> Self

Set chain: chain name, from Client::get_coin_info. Required unless force_chain=2.

Source

pub fn with_tag(self, v: impl Into<String>) -> Self

Set tag: tag/memo, required if the destination address needs one.

Source

pub fn with_force_chain(self, v: i64) -> Self

Set force_chain: 0(default): on chain if the address isn’t recognized as an internal Bybit address, otherwise internal transfer. 1: force on chain. 2: force internal transfer by UID, address must be a Bybit UID.

Source

pub fn with_fee_type(self, v: i64) -> Self

Set fee_type: 0(default): withdrawal fee is deducted from amount. 1: fee is deducted separately by the system.

Source

pub fn with_request_id(self, v: impl Into<String>) -> Self

Set request_id: idempotent request ID, 1-32 alphanumeric characters.

Trait Implementations§

Source§

impl Clone for WithdrawRequest

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for WithdrawRequest

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Serialize for WithdrawRequest

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. 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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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: Sized + 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: Sized + 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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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 = !

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

fn try_from(value: U) -> Result<T, !>

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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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