fireblocks_sdk/models/
fee.rs

1// Fireblocks API
2//
3// Fireblocks provides a suite of applications to manage digital asset operations and a complete development platform to build your business on the blockchain.  - Visit our website for more information: [Fireblocks Website](https://fireblocks.com) - Visit our developer docs: [Fireblocks DevPortal](https://developers.fireblocks.com)
4//
5// The version of the OpenAPI document: 1.8.0
6// Contact: developers@fireblocks.com
7// Generated by: https://openapi-generator.tech
8
9use {
10    crate::models,
11    serde::{Deserialize, Serialize},
12};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct Fee {
16    /// The type of fee, such as ORDER, NETWORK, or SPREAD. - `ORDER`: Fee for
17    /// executing the order. - `NETWORK`: Fee for network transactions. -
18    /// `SPREAD`: Fee for the difference between buy and sell prices.
19    #[serde(rename = "feeType")]
20    pub fee_type: FeeType,
21    /// The asset identifier for the fee.
22    #[serde(rename = "assetId")]
23    pub asset_id: String,
24    #[serde(rename = "amountType")]
25    pub amount_type: AmountType,
26    /// Fee in basis points (1 = 0.01%, 10000 = 100%)
27    #[serde(rename = "amount")]
28    pub amount: f64,
29}
30
31impl Fee {
32    pub fn new(fee_type: FeeType, asset_id: String, amount_type: AmountType, amount: f64) -> Fee {
33        Fee {
34            fee_type,
35            asset_id,
36            amount_type,
37            amount,
38        }
39    }
40}
41/// The type of fee, such as ORDER, NETWORK, or SPREAD. - `ORDER`: Fee for
42/// executing the order. - `NETWORK`: Fee for network transactions. - `SPREAD`:
43/// Fee for the difference between buy and sell prices.
44#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
45pub enum FeeType {
46    #[serde(rename = "ORDER")]
47    Order,
48    #[serde(rename = "NETWORK")]
49    Network,
50    #[serde(rename = "SPREAD")]
51    Spread,
52}
53
54impl Default for FeeType {
55    fn default() -> FeeType {
56        Self::Order
57    }
58}
59///
60#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
61pub enum AmountType {
62    #[serde(rename = "BPS")]
63    Bps,
64}
65
66impl Default for AmountType {
67    fn default() -> AmountType {
68        Self::Bps
69    }
70}