use serde::Serialize;
#[derive(Debug, Clone, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct FundsTransferRequest {
ccy: String,
amt: String,
#[serde(rename = "from")]
from_account: String,
to: String,
#[serde(rename = "type", skip_serializing_if = "Option::is_none")]
transfer_type: Option<String>,
#[serde(rename = "subAcct", skip_serializing_if = "Option::is_none")]
sub_account: Option<String>,
#[serde(rename = "instId", skip_serializing_if = "Option::is_none")]
inst_id: Option<String>,
#[serde(rename = "toInstId", skip_serializing_if = "Option::is_none")]
to_inst_id: Option<String>,
#[serde(rename = "loanTrans", skip_serializing_if = "Option::is_none")]
loan_transfer: Option<String>,
}
impl FundsTransferRequest {
pub fn new(
ccy: impl Into<String>,
amt: impl Into<String>,
from_account: impl Into<String>,
to: impl Into<String>,
) -> Self {
Self {
ccy: ccy.into(),
amt: amt.into(),
from_account: from_account.into(),
to: to.into(),
transfer_type: None,
sub_account: None,
inst_id: None,
to_inst_id: None,
loan_transfer: None,
}
}
pub fn transfer_type(mut self, transfer_type: impl Into<String>) -> Self {
self.transfer_type = Some(transfer_type.into());
self
}
pub fn sub_account(mut self, sub_account: impl Into<String>) -> Self {
self.sub_account = Some(sub_account.into());
self
}
pub fn inst_id(mut self, inst_id: impl Into<String>) -> Self {
self.inst_id = Some(inst_id.into());
self
}
pub fn to_inst_id(mut self, to_inst_id: impl Into<String>) -> Self {
self.to_inst_id = Some(to_inst_id.into());
self
}
pub fn loan_transfer(mut self, loan_transfer: impl Into<String>) -> Self {
self.loan_transfer = Some(loan_transfer.into());
self
}
}
#[derive(Debug, Clone, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct WithdrawalRequest {
ccy: String,
amt: String,
dest: String,
#[serde(rename = "toAddr")]
to_addr: String,
#[serde(skip_serializing_if = "Option::is_none")]
chain: Option<String>,
#[serde(rename = "areaCode", skip_serializing_if = "Option::is_none")]
area_code: Option<String>,
#[serde(rename = "clientId", skip_serializing_if = "Option::is_none")]
client_id: Option<String>,
#[serde(rename = "toAddrType", skip_serializing_if = "Option::is_none")]
to_addr_type: Option<String>,
}
impl WithdrawalRequest {
pub fn new(
ccy: impl Into<String>,
amt: impl Into<String>,
dest: impl Into<String>,
to_addr: impl Into<String>,
) -> Self {
Self {
ccy: ccy.into(),
amt: amt.into(),
dest: dest.into(),
to_addr: to_addr.into(),
chain: None,
area_code: None,
client_id: None,
to_addr_type: None,
}
}
pub fn chain(mut self, chain: impl Into<String>) -> Self {
self.chain = Some(chain.into());
self
}
pub fn area_code(mut self, area_code: impl Into<String>) -> Self {
self.area_code = Some(area_code.into());
self
}
pub fn client_id(mut self, client_id: impl Into<String>) -> Self {
self.client_id = Some(client_id.into());
self
}
pub fn to_addr_type(mut self, to_addr_type: impl Into<String>) -> Self {
self.to_addr_type = Some(to_addr_type.into());
self
}
}
#[derive(Debug, Clone, Default, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct DepositHistoryRequest {
#[serde(skip_serializing_if = "Option::is_none")]
ccy: Option<String>,
#[serde(rename = "type", skip_serializing_if = "Option::is_none")]
deposit_type: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
state: 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>,
#[serde(rename = "txId", skip_serializing_if = "Option::is_none")]
tx_id: Option<String>,
#[serde(rename = "depId", skip_serializing_if = "Option::is_none")]
dep_id: Option<String>,
#[serde(rename = "fromWdId", skip_serializing_if = "Option::is_none")]
from_wd_id: Option<String>,
}
impl DepositHistoryRequest {
pub fn new() -> Self {
Self::default()
}
pub fn currency(mut self, ccy: impl Into<String>) -> Self {
self.ccy = Some(ccy.into());
self
}
pub fn deposit_type(mut self, deposit_type: impl Into<String>) -> Self {
self.deposit_type = Some(deposit_type.into());
self
}
pub fn state(mut self, state: impl Into<String>) -> Self {
self.state = Some(state.into());
self
}
pub fn after(mut self, after: impl Into<String>) -> Self {
self.after = Some(after.into());
self
}
pub fn before(mut self, before: impl Into<String>) -> Self {
self.before = Some(before.into());
self
}
pub fn limit(mut self, limit: u32) -> Self {
self.limit = Some(limit);
self
}
pub fn tx_id(mut self, tx_id: impl Into<String>) -> Self {
self.tx_id = Some(tx_id.into());
self
}
pub fn dep_id(mut self, dep_id: impl Into<String>) -> Self {
self.dep_id = Some(dep_id.into());
self
}
pub fn from_wd_id(mut self, from_wd_id: impl Into<String>) -> Self {
self.from_wd_id = Some(from_wd_id.into());
self
}
}
#[derive(Debug, Clone, Default, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct WithdrawalHistoryRequest {
#[serde(skip_serializing_if = "Option::is_none")]
ccy: Option<String>,
#[serde(rename = "wdId", skip_serializing_if = "Option::is_none")]
wd_id: Option<String>,
#[serde(rename = "clientId", skip_serializing_if = "Option::is_none")]
client_id: Option<String>,
#[serde(rename = "txId", skip_serializing_if = "Option::is_none")]
tx_id: Option<String>,
#[serde(rename = "type", skip_serializing_if = "Option::is_none")]
withdrawal_type: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
state: 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>,
#[serde(rename = "toAddrType", skip_serializing_if = "Option::is_none")]
to_addr_type: Option<String>,
}
impl WithdrawalHistoryRequest {
pub fn new() -> Self {
Self::default()
}
pub fn currency(mut self, ccy: impl Into<String>) -> Self {
self.ccy = Some(ccy.into());
self
}
pub fn withdrawal_id(mut self, wd_id: impl Into<String>) -> Self {
self.wd_id = Some(wd_id.into());
self
}
pub fn client_id(mut self, client_id: impl Into<String>) -> Self {
self.client_id = Some(client_id.into());
self
}
pub fn tx_id(mut self, tx_id: impl Into<String>) -> Self {
self.tx_id = Some(tx_id.into());
self
}
pub fn withdrawal_type(mut self, withdrawal_type: impl Into<String>) -> Self {
self.withdrawal_type = Some(withdrawal_type.into());
self
}
pub fn state(mut self, state: impl Into<String>) -> Self {
self.state = Some(state.into());
self
}
pub fn after(mut self, after: impl Into<String>) -> Self {
self.after = Some(after.into());
self
}
pub fn before(mut self, before: impl Into<String>) -> Self {
self.before = Some(before.into());
self
}
pub fn limit(mut self, limit: u32) -> Self {
self.limit = Some(limit);
self
}
pub fn to_addr_type(mut self, to_addr_type: impl Into<String>) -> Self {
self.to_addr_type = Some(to_addr_type.into());
self
}
}
#[derive(Debug, Clone, Default, Serialize)]
pub struct FundingBillsRequest {
#[serde(skip_serializing_if = "Option::is_none")]
ccy: Option<String>,
#[serde(rename = "type", skip_serializing_if = "Option::is_none")]
bill_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 FundingBillsRequest {
pub fn new() -> Self {
Self::default()
}
pub fn currency(mut self, ccy: impl Into<String>) -> Self {
self.ccy = Some(ccy.into());
self
}
pub fn bill_type(mut self, bill_type: impl Into<String>) -> Self {
self.bill_type = Some(bill_type.into());
self
}
pub fn after(mut self, after: impl Into<String>) -> Self {
self.after = Some(after.into());
self
}
pub fn before(mut self, before: impl Into<String>) -> Self {
self.before = Some(before.into());
self
}
pub fn limit(mut self, limit: u32) -> Self {
self.limit = Some(limit);
self
}
}
#[derive(Debug, Clone, Serialize)]
pub struct DepositLightningRequest {
ccy: String,
amt: String,
#[serde(skip_serializing_if = "Option::is_none")]
to: Option<String>,
}
impl DepositLightningRequest {
pub fn new(ccy: impl Into<String>, amt: impl Into<String>) -> Self {
Self {
ccy: ccy.into(),
amt: amt.into(),
to: None,
}
}
pub fn to(mut self, to: impl Into<String>) -> Self {
self.to = Some(to.into());
self
}
}
#[derive(Debug, Clone, Serialize)]
pub struct WithdrawalLightningRequest {
ccy: String,
invoice: String,
#[serde(skip_serializing_if = "Option::is_none")]
memo: Option<String>,
}
impl WithdrawalLightningRequest {
pub fn new(ccy: impl Into<String>, invoice: impl Into<String>) -> Self {
Self {
ccy: ccy.into(),
invoice: invoice.into(),
memo: None,
}
}
pub fn memo(mut self, memo: impl Into<String>) -> Self {
self.memo = Some(memo.into());
self
}
}
#[derive(Debug, Clone, Default, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct DepositWithdrawStatusRequest {
#[serde(rename = "wdId", skip_serializing_if = "Option::is_none")]
wd_id: Option<String>,
#[serde(rename = "txId", skip_serializing_if = "Option::is_none")]
tx_id: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
ccy: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
to: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
chain: Option<String>,
}
impl DepositWithdrawStatusRequest {
pub fn new() -> Self {
Self::default()
}
pub fn withdrawal_id(mut self, wd_id: impl Into<String>) -> Self {
self.wd_id = Some(wd_id.into());
self
}
pub fn tx_id(mut self, tx_id: impl Into<String>) -> Self {
self.tx_id = Some(tx_id.into());
self
}
pub fn currency(mut self, ccy: impl Into<String>) -> Self {
self.ccy = Some(ccy.into());
self
}
pub fn to(mut self, to: impl Into<String>) -> Self {
self.to = Some(to.into());
self
}
pub fn chain(mut self, chain: impl Into<String>) -> Self {
self.chain = Some(chain.into());
self
}
}