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: StringCoin name, uppercase only
address: StringDestination wallet address, case-sensitive, or a Bybit UID when force_chain=2
amount: DecimalWithdraw amount
timestamp: i64Current timestamp (ms). Used to prevent replay attacks
account_type: StringWallet 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
impl WithdrawRequest
Sourcepub fn new(
coin: impl Into<String>,
address: impl Into<String>,
amount: Decimal,
timestamp: i64,
account_type: impl Into<String>,
) -> Self
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.
Sourcepub fn with_chain(self, v: impl Into<String>) -> Self
pub fn with_chain(self, v: impl Into<String>) -> Self
Set chain: chain name, from Client::get_coin_info. Required unless force_chain=2.
Sourcepub fn with_tag(self, v: impl Into<String>) -> Self
pub fn with_tag(self, v: impl Into<String>) -> Self
Set tag: tag/memo, required if the destination address needs one.
Sourcepub fn with_force_chain(self, v: i64) -> Self
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.
Sourcepub fn with_fee_type(self, v: i64) -> Self
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.
Sourcepub fn with_request_id(self, v: impl Into<String>) -> Self
pub fn with_request_id(self, v: impl Into<String>) -> Self
Set request_id: idempotent request ID, 1-32 alphanumeric characters.