fireblocks_sdk/models/
transaction.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 Transaction {
16    #[serde(rename = "id")]
17    pub id: String,
18    #[serde(rename = "state")]
19    pub state: State,
20    #[serde(rename = "timestamp", skip_serializing_if = "Option::is_none")]
21    pub timestamp: Option<f64>,
22    #[serde(rename = "instructionId", skip_serializing_if = "Option::is_none")]
23    pub instruction_id: Option<String>,
24}
25
26impl Transaction {
27    pub fn new(id: String, state: State) -> Transaction {
28        Transaction {
29            id,
30            state,
31            timestamp: None,
32            instruction_id: None,
33        }
34    }
35}
36///
37#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
38pub enum State {
39    #[serde(rename = "SUBMITTED")]
40    Submitted,
41    #[serde(rename = "QUEUED")]
42    Queued,
43    #[serde(rename = "PENDING_AUTHORIZATION")]
44    PendingAuthorization,
45    #[serde(rename = "PENDING_SIGNATURE")]
46    PendingSignature,
47    #[serde(rename = "BROADCASTING")]
48    Broadcasting,
49    #[serde(rename = "PENDING_3RD_PARTY_MANUAL_APPROVAL")]
50    Pending3RdPartyManualApproval,
51    #[serde(rename = "PENDING_3RD_PARTY")]
52    Pending3RdParty,
53    #[serde(rename = "PENDING")]
54    Pending,
55    #[serde(rename = "CONFIRMING")]
56    Confirming,
57    #[serde(rename = "CONFIRMED")]
58    Confirmed,
59    #[serde(rename = "COMPLETED")]
60    Completed,
61    #[serde(rename = "PARTIALLY_COMPLETED")]
62    PartiallyCompleted,
63    #[serde(rename = "PENDING_AML_SCREENING")]
64    PendingAmlScreening,
65    #[serde(rename = "CANCELLING")]
66    Cancelling,
67    #[serde(rename = "CANCELLED")]
68    Cancelled,
69    #[serde(rename = "REJECTED")]
70    Rejected,
71    #[serde(rename = "BLOCKED")]
72    Blocked,
73    #[serde(rename = "FAILED")]
74    Failed,
75    #[serde(rename = "TIMEOUT")]
76    Timeout,
77}
78
79impl Default for State {
80    fn default() -> State {
81        Self::Submitted
82    }
83}