pub struct TransferParams {
pub currency: String,
pub amount: Decimal,
pub from_account: AccountType,
pub to_account: AccountType,
}Expand description
Parameters for transferring funds between accounts.
§Example
use ccxt_core::types::params::{TransferParams, AccountType};
use rust_decimal_macros::dec;
// Transfer from spot to futures
let params = TransferParams::spot_to_futures("USDT", dec!(1000));
// Custom transfer
let params = TransferParams::new("BTC", dec!(0.1), AccountType::Spot, AccountType::Margin);Fields§
§currency: StringCurrency code to transfer.
amount: DecimalAmount to transfer.
from_account: AccountTypeSource account type.
to_account: AccountTypeDestination account type.
Implementations§
Source§impl TransferParams
impl TransferParams
Sourcepub fn new(
currency: &str,
amount: Decimal,
from: AccountType,
to: AccountType,
) -> TransferParams
pub fn new( currency: &str, amount: Decimal, from: AccountType, to: AccountType, ) -> TransferParams
Create new transfer parameters.
Sourcepub fn spot_to_futures(currency: &str, amount: Decimal) -> TransferParams
pub fn spot_to_futures(currency: &str, amount: Decimal) -> TransferParams
Transfer from spot to futures account.
Sourcepub fn futures_to_spot(currency: &str, amount: Decimal) -> TransferParams
pub fn futures_to_spot(currency: &str, amount: Decimal) -> TransferParams
Transfer from futures to spot account.
Sourcepub fn spot_to_margin(currency: &str, amount: Decimal) -> TransferParams
pub fn spot_to_margin(currency: &str, amount: Decimal) -> TransferParams
Transfer from spot to margin account.
Sourcepub fn margin_to_spot(currency: &str, amount: Decimal) -> TransferParams
pub fn margin_to_spot(currency: &str, amount: Decimal) -> TransferParams
Transfer from margin to spot account.
Trait Implementations§
Source§impl Clone for TransferParams
impl Clone for TransferParams
Source§fn clone(&self) -> TransferParams
fn clone(&self) -> TransferParams
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TransferParams
impl RefUnwindSafe for TransferParams
impl Send for TransferParams
impl Sync for TransferParams
impl Unpin for TransferParams
impl UnwindSafe for TransferParams
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more