fireblocks-sdk 2026.3.27

Rust implementation of the Fireblocks SDK
Documentation
// Fireblocks API
//
// 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)
//
// The version of the OpenAPI document: 1.8.0
// Contact: developers@fireblocks.com
// Generated by: https://openapi-generator.tech

use {
    crate::models,
    serde::{Deserialize, Serialize},
};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct WriteCallFunctionDto {
    /// The vault account id this contract was deploy from
    #[serde(rename = "vaultAccountId")]
    pub vault_account_id: String,
    #[serde(rename = "abiFunction")]
    pub abi_function: models::WriteCallFunctionDtoAbiFunction,
    /// Amount in base asset. Being used in payable functions
    #[serde(rename = "amount", skip_serializing_if = "Option::is_none")]
    pub amount: Option<String>,
    /// Fee level for the write function transaction. interchangeable with the
    /// 'fee' field
    #[serde(rename = "feeLevel", skip_serializing_if = "Option::is_none")]
    pub fee_level: Option<FeeLevel>,
    /// Max fee amount for the write function transaction. interchangeable with
    /// the 'feeLevel' field
    #[serde(rename = "fee", skip_serializing_if = "Option::is_none")]
    pub fee: Option<String>,
    /// Custom note, not sent to the blockchain, that describes the transaction
    /// at your Fireblocks workspace
    #[serde(rename = "note", skip_serializing_if = "Option::is_none")]
    pub note: Option<String>,
    /// Indicates whether the token should be created in a gasless manner,
    /// utilizing the ERC-2771 standard. When set to true, the transaction will
    /// be relayed by a designated relayer. The workspace must be configured to
    /// use Fireblocks gasless relay.
    #[serde(rename = "useGasless", skip_serializing_if = "Option::is_none")]
    pub use_gasless: Option<bool>,
    /// External id that can be used to identify the transaction in your system.
    /// The unique identifier of the transaction outside of Fireblocks with max
    /// length of 255 characters
    #[serde(rename = "externalId", skip_serializing_if = "Option::is_none")]
    pub external_id: Option<String>,
}

impl WriteCallFunctionDto {
    pub fn new(
        vault_account_id: String,
        abi_function: models::WriteCallFunctionDtoAbiFunction,
    ) -> WriteCallFunctionDto {
        WriteCallFunctionDto {
            vault_account_id,
            abi_function,
            amount: None,
            fee_level: None,
            fee: None,
            note: None,
            use_gasless: None,
            external_id: None,
        }
    }
}
/// Fee level for the write function transaction. interchangeable with the 'fee'
/// field
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum FeeLevel {
    #[serde(rename = "LOW")]
    Low,
    #[serde(rename = "MEDIUM")]
    Medium,
    #[serde(rename = "HIGH")]
    High,
}

impl Default for FeeLevel {
    fn default() -> FeeLevel {
        Self::Low
    }
}