fireblocks_sdk/models/
quote_request.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 QuoteRequest {
16    /// The id of the vault account or account id
17    #[serde(rename = "accountId", skip_serializing_if = "Option::is_none")]
18    pub account_id: Option<String>,
19    /// The amount of tokens the swapper will provide, positive number, can be a
20    /// decimal.
21    #[serde(rename = "inputAmount")]
22    pub input_amount: String,
23    /// The id of the asset the swapper will provide
24    #[serde(rename = "inputAsset")]
25    pub input_asset: String,
26    /// The id of the asset the swapper will receive
27    #[serde(rename = "outputAsset")]
28    pub output_asset: String,
29    /// The slippage tolerance is a percentage. The slippage tolerance is the
30    /// maximum amount the price can change between the time the transaction is
31    /// submitted and the time it is executed
32    #[serde(rename = "slippageTolerance")]
33    pub slippage_tolerance: f64,
34    #[serde(rename = "protocol")]
35    pub protocol: models::SwapProviderProtocolsEnum,
36}
37
38impl QuoteRequest {
39    pub fn new(
40        input_amount: String,
41        input_asset: String,
42        output_asset: String,
43        slippage_tolerance: f64,
44        protocol: models::SwapProviderProtocolsEnum,
45    ) -> QuoteRequest {
46        QuoteRequest {
47            account_id: None,
48            input_amount,
49            input_asset,
50            output_asset,
51            slippage_tolerance,
52            protocol,
53        }
54    }
55}