fireblocks_sdk/models/
transaction_response.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 TransactionResponse {
16    /// Fireblocks Transaction ID
17    //#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
18    pub id: String,
19    /// Unique external transaction identifier provided by the user. Used to
20    /// help prevent duplicate transactions. **Will become a required parameter
21    /// for all transaction types on March 1, 2026.**
22    #[serde(rename = "externalTxId", skip_serializing_if = "Option::is_none")]
23    pub external_tx_id: Option<String>,
24    //    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
25    //   pub status: Option<models::TransactionStatus>,
26    #[serde(rename = "status")]
27    pub status: models::TransactionStatus,
28    #[serde(rename = "subStatus", skip_serializing_if = "Option::is_none")]
29    pub sub_status: Option<models::TransactionSubStatus>,
30    /// The hash of the transaction on the blockchain.  * This parameter exists
31    /// if at least one of the following conditions is met:       1. The
32    /// transaction’s source type is `UNKNOWN`, `WHITELISTED_ADDRESS`,
33    /// `NETWORK_CONNECTION`, `ONE_TIME_ADDRESS`, `FIAT_ACCOUNT` or
34    /// `GAS_STATION`.       2. The transaction’s source type is `VAULT` and the
35    /// status is either: `CONFIRMING`, `COMPLETED`, or was in any of these
36    /// statuses prior to changing to `FAILED` or `REJECTED`. In some instances,
37    /// transactions in status `BROADCASTING` will include the txHash as well.
38    /// 3. The transaction’s source type is `EXCHANGE_ACCOUNT` and the
39    /// transaction’s destination type is `VAULT`, and the status is either:
40    /// `CONFIRMING`, `COMPLETED`, or was in any of these status prior to
41    /// changing to `FAILED`.   * In addition, the following conditions must be
42    /// met:      1. The asset is a crypto asset (not fiat).      2. The
43    /// transaction operation is not `RAW` or `TYPED_MESSAGE`.
44    #[serde(rename = "txHash", skip_serializing_if = "Option::is_none")]
45    pub tx_hash: Option<String>,
46    #[serde(rename = "operation", skip_serializing_if = "Option::is_none")]
47    pub operation: Option<models::GetTransactionOperation>,
48    /// Custom note, not sent to the blockchain, that describes the transaction
49    /// at your Fireblocks workspace.
50    #[serde(rename = "note", skip_serializing_if = "Option::is_none")]
51    pub note: Option<String>,
52    /// A JSON used to store additional blockchain-specific data.  **Example:**
53    /// In HBAR, this property will have the txHash in addition to the txID.
54    #[serde(rename = "blockchainInfo", skip_serializing_if = "Option::is_none")]
55    pub blockchain_info: Option<String>,
56    /// The ID of the asset for `TRANSFER`, `MINT`, `BURN`, `ENABLE_ASSET`,`STAKE` ,`UNSTAKE` or `WITHDRAW` operations. See the [list of supported assets and their IDs on Fireblocks](https://developers.fireblocks.com/reference/getsupportedassets).
57    #[serde(rename = "assetId", skip_serializing_if = "Option::is_none")]
58    pub asset_id: Option<String>,
59    /// Type classification of the asset
60    #[serde(rename = "assetType", skip_serializing_if = "Option::is_none")]
61    pub asset_type: Option<String>,
62    #[serde(rename = "source", skip_serializing_if = "Option::is_none")]
63    pub source: Option<models::SourceTransferPeerPathResponse>,
64    /// For account based assets only, the source address of the transaction.
65    /// **Note:** If the status is `CONFIRMING`, `COMPLETED`, or has been
66    /// `CONFIRMING`; then moved forward to `FAILED` or `REJECTED`, then this
67    /// parameter will contain the source address. In any other case, this
68    /// parameter will be empty.
69    #[serde(rename = "sourceAddress", skip_serializing_if = "Option::is_none")]
70    pub source_address: Option<String>,
71    /// Source address tag for Tag/Memo supporting assets, or Bank Transfer
72    /// Description for the fiat provider BLINC (by BCB Group).
73    #[serde(rename = "tag", skip_serializing_if = "Option::is_none")]
74    pub tag: Option<String>,
75    #[serde(rename = "destination", skip_serializing_if = "Option::is_none")]
76    pub destination: Option<models::DestinationTransferPeerPathResponse>,
77    /// The transaction’s destinations. **Note:** In case the transaction is
78    /// sent to a single destination, the `destination` parameter is used
79    /// instead of this.
80    #[serde(rename = "destinations", skip_serializing_if = "Option::is_none")]
81    pub destinations: Option<Vec<models::TransactionResponseDestination>>,
82    /// Address where the asset were transferred. Notes:   - For [Multi destination transactions](https://support.fireblocks.io/hc/en-us/articles/360018447980-Multi-destination-transactions), this parameter will be empty. In this case, you should refer to the destinations field.   - If the status is `CONFIRMING`, `COMPLETED`, or has been `CONFIRMING`; then moved forward to `FAILED` or `REJECTED`, then this parameter will contain the destination address. In any other case, this parameter will be empty.
83    #[serde(rename = "destinationAddress", skip_serializing_if = "Option::is_none")]
84    pub destination_address: Option<String>,
85    /// Description of the destination address.
86    #[serde(
87        rename = "destinationAddressDescription",
88        skip_serializing_if = "Option::is_none"
89    )]
90    pub destination_address_description: Option<String>,
91    /// Destination address tag for Tag/Memo supporting assets, or Bank Transfer
92    /// Description for the fiat provider BLINC (by BCB Group).
93    #[serde(rename = "destinationTag", skip_serializing_if = "Option::is_none")]
94    pub destination_tag: Option<String>,
95    #[serde(
96        rename = "contractCallDecodedData",
97        skip_serializing_if = "Option::is_none"
98    )]
99    pub contract_call_decoded_data: Option<models::TransactionResponseContractCallDecodedData>,
100    #[serde(rename = "amountInfo", skip_serializing_if = "Option::is_none")]
101    pub amount_info: Option<models::AmountInfo>,
102    /// For transactions initiated via this Fireblocks workspace, when set to
103    /// `true`, the fee is deducted from the requested amount.  **Note:** This
104    /// parameter can only be considered if a transaction's asset is a base
105    /// asset, such as ETH or MATIC. If the asset can't be used for transaction
106    /// fees, like USDC, this parameter is ignored and the fee is deducted from
107    /// the relevant base asset wallet in the source account.
108    #[serde(rename = "treatAsGrossAmount", skip_serializing_if = "Option::is_none")]
109    pub treat_as_gross_amount: Option<bool>,
110    #[serde(rename = "feeInfo", skip_serializing_if = "Option::is_none")]
111    pub fee_info: Option<models::FeeInfo>,
112    /// The asset which was withdrawn to pay the transaction fee, for example
113    /// ETH for EVM-based blockchains, BTC for Tether Omni.
114    #[serde(rename = "feeCurrency", skip_serializing_if = "Option::is_none")]
115    pub fee_currency: Option<String>,
116    /// In case a single transaction resulted with multiple transfers, for
117    /// example a result of a contract call, then this parameter specifies each
118    /// transfer that took place on the blockchain.
119    #[serde(rename = "networkRecords", skip_serializing_if = "Option::is_none")]
120    pub network_records: Option<Vec<models::NetworkRecord>>,
121    /// The transaction’s creation date and time, in unix timestamp.
122    #[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")]
123    pub created_at: Option<f64>,
124    /// The transaction’s last update date and time, in unix timestamp.
125    #[serde(rename = "lastUpdated", skip_serializing_if = "Option::is_none")]
126    pub last_updated: Option<f64>,
127    /// User ID of the initiator of the transaction.
128    #[serde(rename = "createdBy", skip_serializing_if = "Option::is_none")]
129    pub created_by: Option<String>,
130    /// User ID’s of the signers of the transaction.
131    #[serde(rename = "signedBy", skip_serializing_if = "Option::is_none")]
132    pub signed_by: Option<Vec<String>>,
133    /// User ID of the user that rejected the transaction (in case it was
134    /// rejected).
135    #[serde(rename = "rejectedBy", skip_serializing_if = "Option::is_none")]
136    pub rejected_by: Option<String>,
137    #[serde(rename = "authorizationInfo", skip_serializing_if = "Option::is_none")]
138    pub authorization_info: Option<models::AuthorizationInfo>,
139    /// If the transaction originated from an exchange, this is the ID of this
140    /// transaction at the exchange.
141    #[serde(rename = "exchangeTxId", skip_serializing_if = "Option::is_none")]
142    pub exchange_tx_id: Option<String>,
143    /// The ID for AML providers to associate the owner of funds with
144    /// transactions.
145    #[serde(rename = "customerRefId", skip_serializing_if = "Option::is_none")]
146    pub customer_ref_id: Option<String>,
147    #[serde(rename = "amlScreeningResult", skip_serializing_if = "Option::is_none")]
148    pub aml_screening_result: Option<models::AmlScreeningResult>,
149    #[serde(rename = "complianceResult", skip_serializing_if = "Option::is_none")]
150    pub compliance_result: Option<models::ComplianceResult>,
151    /// Indicates the transaction was not broadcast by Fireblocks
152    #[serde(
153        rename = "notBroadcastByFireblocks",
154        skip_serializing_if = "Option::is_none"
155    )]
156    pub not_broadcast_by_fireblocks: Option<bool>,
157    /// dApp URL for Web3 transactions
158    #[serde(rename = "dappUrl", skip_serializing_if = "Option::is_none")]
159    pub dapp_url: Option<String>,
160    /// Gas limit for EVM-based blockchain transactions
161    #[serde(rename = "gasLimit", skip_serializing_if = "Option::is_none")]
162    pub gas_limit: Option<String>,
163    /// Blockchain-specific index or identifier for the transaction
164    #[serde(rename = "blockchainIndex", skip_serializing_if = "Option::is_none")]
165    pub blockchain_index: Option<String>,
166    /// Solana rent payment amount
167    #[serde(rename = "paidRent", skip_serializing_if = "Option::is_none")]
168    pub paid_rent: Option<String>,
169    #[serde(rename = "extraParameters", skip_serializing_if = "Option::is_none")]
170    pub extra_parameters: Option<models::ExtraParameters>,
171    /// An array of signed messages
172    #[serde(rename = "signedMessages", skip_serializing_if = "Option::is_none")]
173    pub signed_messages: Option<Vec<models::SignedMessage>>,
174    /// The number of confirmations of the transaction. The number will increase
175    /// until the transaction will be considered completed according to the
176    /// confirmation policy.
177    #[serde(rename = "numOfConfirmations", skip_serializing_if = "Option::is_none")]
178    pub num_of_confirmations: Option<f64>,
179    #[serde(rename = "blockInfo", skip_serializing_if = "Option::is_none")]
180    pub block_info: Option<models::BlockInfo>,
181    /// For UTXO based assets this is the vOut, for Ethereum based, this is the
182    /// index of the event of the contract call.  **Note:** This field is not
183    /// returned if a transaction uses the `destinations` object with more than
184    /// one value.
185    #[serde(rename = "index", skip_serializing_if = "Option::is_none")]
186    pub index: Option<f64>,
187    #[serde(rename = "rewardInfo", skip_serializing_if = "Option::is_none")]
188    pub reward_info: Option<models::RewardInfo>,
189    #[serde(rename = "feePayerInfo", skip_serializing_if = "Option::is_none")]
190    pub fee_payer_info: Option<models::FeePayerInfo>,
191    #[serde(rename = "systemMessages", skip_serializing_if = "Option::is_none")]
192    pub system_messages: Option<models::SystemMessageInfo>,
193    #[serde(rename = "addressType", skip_serializing_if = "Option::is_none")]
194    pub address_type: Option<AddressType>,
195    /// The amount requested by the user. Deprecated - please use the
196    /// `amountInfo` field for accuracy.
197    #[serde(rename = "requestedAmount", skip_serializing_if = "Option::is_none")]
198    pub requested_amount: Option<f64>,
199    /// If the transfer is a withdrawal from an exchange, the actual amount that
200    /// was requested to be transferred. Otherwise, the requested amount.
201    /// Deprecated - please use the `amountInfo` field for accuracy.
202    #[serde(rename = "amount", skip_serializing_if = "Option::is_none")]
203    pub amount: Option<f64>,
204    /// The net amount of the transaction, after fee deduction. Deprecated -
205    /// please use the `amountInfo` field for accuracy.
206    #[serde(rename = "netAmount", skip_serializing_if = "Option::is_none")]
207    pub net_amount: Option<f64>,
208    /// The USD value of the requested amount. Deprecated - please use the
209    /// `amountInfo` field for accuracy.
210    #[serde(
211        rename = "amountUSD",
212        default,
213        with = "::serde_with::rust::double_option",
214        skip_serializing_if = "Option::is_none"
215    )]
216    pub amount_usd: Option<Option<f64>>,
217    /// The total fee deducted by the exchange from the actual requested amount
218    /// (`serviceFee` = `amount` - `netAmount`). Deprecated - please use the
219    /// `feeInfo` field for accuracy.
220    #[serde(rename = "serviceFee", skip_serializing_if = "Option::is_none")]
221    pub service_fee: Option<f64>,
222    /// Deprecated - please use the `feeInfo` field for accuracy.
223    #[serde(rename = "fee", skip_serializing_if = "Option::is_none")]
224    pub fee: Option<f64>,
225    /// The fee paid to the network. Deprecated - please use the `feeInfo` field
226    /// for accuracy.
227    #[serde(rename = "networkFee", skip_serializing_if = "Option::is_none")]
228    pub network_fee: Option<f64>,
229    /// The transaction's revert reason. This field will be returned when
230    /// `subStatus` =  'SMART_CONTRACT_EXECUTION_FAILED'.
231    #[serde(rename = "errorDescription", skip_serializing_if = "Option::is_none")]
232    pub error_description: Option<String>,
233    /// If the transaction is a Replace-By-Fee (RBF) transaction, this is the
234    /// hash of the transaction that was replaced.
235    #[serde(rename = "replacedTxByHash", skip_serializing_if = "Option::is_none")]
236    pub replaced_tx_by_hash: Option<String>,
237    /// Blockchain nonce for the transaction
238    #[serde(rename = "nonce", skip_serializing_if = "Option::is_none")]
239    pub nonce: Option<String>,
240}
241
242impl TransactionResponse {
243    pub fn new() -> TransactionResponse {
244        TransactionResponse {
245            id: String::new(),
246            external_tx_id: None,
247            status: models::TransactionStatus::default(),
248            sub_status: None,
249            tx_hash: None,
250            operation: None,
251            note: None,
252            blockchain_info: None,
253            asset_id: None,
254            asset_type: None,
255            source: None,
256            source_address: None,
257            tag: None,
258            destination: None,
259            destinations: None,
260            destination_address: None,
261            destination_address_description: None,
262            destination_tag: None,
263            contract_call_decoded_data: None,
264            amount_info: None,
265            treat_as_gross_amount: None,
266            fee_info: None,
267            fee_currency: None,
268            network_records: None,
269            created_at: None,
270            last_updated: None,
271            created_by: None,
272            signed_by: None,
273            rejected_by: None,
274            authorization_info: None,
275            exchange_tx_id: None,
276            customer_ref_id: None,
277            aml_screening_result: None,
278            compliance_result: None,
279            not_broadcast_by_fireblocks: None,
280            dapp_url: None,
281            gas_limit: None,
282            blockchain_index: None,
283            paid_rent: None,
284            extra_parameters: None,
285            signed_messages: None,
286            num_of_confirmations: None,
287            block_info: None,
288            index: None,
289            reward_info: None,
290            fee_payer_info: None,
291            system_messages: None,
292            address_type: None,
293            requested_amount: None,
294            amount: None,
295            net_amount: None,
296            amount_usd: None,
297            service_fee: None,
298            fee: None,
299            network_fee: None,
300            error_description: None,
301            replaced_tx_by_hash: None,
302            nonce: None,
303        }
304    }
305}
306///
307#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
308pub enum AddressType {
309    #[serde(rename = "")]
310    Empty,
311    #[serde(rename = "WHITELISTED")]
312    Whitelisted,
313    #[serde(rename = "ONE_TIME")]
314    OneTime,
315}
316
317impl Default for AddressType {
318    fn default() -> AddressType {
319        Self::Empty
320    }
321}