use serde::Serialize;
#[derive(Debug, Clone, Serialize)]
pub struct SpotManualBorrowRepayRequest {
ccy: String,
side: String,
amt: String,
}
impl SpotManualBorrowRepayRequest {
pub fn new(ccy: impl Into<String>, side: impl Into<String>, amt: impl Into<String>) -> Self {
Self {
ccy: ccy.into(),
side: side.into(),
amt: amt.into(),
}
}
}
#[derive(Debug, Clone, Serialize)]
pub struct SetAutoRepayRequest {
#[serde(rename = "autoRepay")]
auto_repay: bool,
}
impl SetAutoRepayRequest {
pub fn new(auto_repay: bool) -> Self {
Self { auto_repay }
}
}
#[derive(Debug, Clone, Default, Serialize)]
pub struct SpotBorrowRepayHistoryRequest {
#[serde(skip_serializing_if = "Option::is_none")]
ccy: Option<String>,
#[serde(rename = "type", skip_serializing_if = "Option::is_none")]
event_type: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
after: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
before: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
limit: Option<u32>,
}
impl SpotBorrowRepayHistoryRequest {
pub fn new() -> Self {
Self::default()
}
pub fn currency(mut self, value: impl Into<String>) -> Self {
self.ccy = Some(value.into());
self
}
pub fn event_type(mut self, value: impl Into<String>) -> Self {
self.event_type = Some(value.into());
self
}
pub fn after(mut self, value: impl Into<String>) -> Self {
self.after = Some(value.into());
self
}
pub fn before(mut self, value: impl Into<String>) -> Self {
self.before = Some(value.into());
self
}
pub fn limit(mut self, value: u32) -> Self {
self.limit = Some(value);
self
}
}
#[derive(Debug, Clone, Serialize)]
pub struct SetAutoEarnRequest {
#[serde(rename = "earnType")]
earn_type: String,
ccy: String,
action: String,
}
impl SetAutoEarnRequest {
pub fn new(
earn_type: impl Into<String>,
ccy: impl Into<String>,
action: impl Into<String>,
) -> Self {
Self {
earn_type: earn_type.into(),
ccy: ccy.into(),
action: action.into(),
}
}
}