fireblocks_sdk/models/write_call_function_dto.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 WriteCallFunctionDto {
16 /// The vault account id this contract was deploy from
17 #[serde(rename = "vaultAccountId")]
18 pub vault_account_id: String,
19 #[serde(rename = "abiFunction")]
20 pub abi_function: models::WriteAbiFunction,
21 /// Amount in base asset. Being used in payable functions
22 #[serde(rename = "amount", skip_serializing_if = "Option::is_none")]
23 pub amount: Option<String>,
24 /// Fee level for the write function transaction. interchangeable with the
25 /// 'fee' field
26 #[serde(rename = "feeLevel", skip_serializing_if = "Option::is_none")]
27 pub fee_level: Option<FeeLevel>,
28 /// Max fee amount for the write function transaction. interchangeable with
29 /// the 'feeLevel' field
30 #[serde(rename = "fee", skip_serializing_if = "Option::is_none")]
31 pub fee: Option<String>,
32 /// Custom note, not sent to the blockchain, that describes the transaction
33 /// at your Fireblocks workspace
34 #[serde(rename = "note", skip_serializing_if = "Option::is_none")]
35 pub note: Option<String>,
36 /// Indicates whether the token should be created in a gasless manner,
37 /// utilizing the ERC-2771 standard. When set to true, the transaction will
38 /// be relayed by a designated relayer. The workspace must be configured to
39 /// use Fireblocks gasless relay.
40 #[serde(rename = "useGasless", skip_serializing_if = "Option::is_none")]
41 pub use_gasless: Option<bool>,
42 /// External id that can be used to identify the transaction in your system.
43 /// The unique identifier of the transaction outside of Fireblocks with max
44 /// length of 255 characters
45 #[serde(rename = "externalId", skip_serializing_if = "Option::is_none")]
46 pub external_id: Option<String>,
47}
48
49impl WriteCallFunctionDto {
50 pub fn new(
51 vault_account_id: String,
52 abi_function: models::WriteAbiFunction,
53 ) -> WriteCallFunctionDto {
54 WriteCallFunctionDto {
55 vault_account_id,
56 abi_function,
57 amount: None,
58 fee_level: None,
59 fee: None,
60 note: None,
61 use_gasless: None,
62 external_id: None,
63 }
64 }
65}
66/// Fee level for the write function transaction. interchangeable with the 'fee'
67/// field
68#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
69pub enum FeeLevel {
70 #[serde(rename = "LOW")]
71 Low,
72 #[serde(rename = "MEDIUM")]
73 Medium,
74 #[serde(rename = "HIGH")]
75 High,
76}
77
78impl Default for FeeLevel {
79 fn default() -> FeeLevel {
80 Self::Low
81 }
82}