cryptoapis/models/
decode_raw_transaction_hex_ris.rs

1/*
2 * CryptoAPIs
3 *
4 * Crypto APIs is a complex and innovative infrastructure layer that radically simplifies the development of any Blockchain and Crypto related applications. Organized around REST, Crypto APIs can assist both novice Bitcoin/Ethereum enthusiasts and crypto experts with the development of their blockchain applications. Crypto APIs provides unified endpoints and data, raw data, automatic tokens and coins forwardings, callback functionalities, and much more.
5 *
6 * The version of the OpenAPI document: 2021-03-20
7 * Contact: developers@cryptoapis.io
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// DecodeRawTransactionHexRis : Represents the specific transaction data according to the blockchain
12
13
14
15#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
16pub struct DecodeRawTransactionHexRis {
17    /// Represents the locktime on the transaction on the specific blockchain, i.e. the blockheight at which the transaction is valid.
18    #[serde(rename = "locktime")]
19    pub locktime: i32,
20    /// Represents the same as transactionId for account-based protocols like Ethereum, while it could be different in UTXO-based protocols like Bitcoin. E.g., in UTXO-based protocols hash is different from transactionId for SegWit transactions.
21    #[serde(rename = "transactionHash")]
22    pub transaction_hash: String,
23    /// Represents the virtual size of this transaction.
24    #[serde(rename = "vSize")]
25    pub v_size: i32,
26    /// Represents the transaction version number.
27    #[serde(rename = "version")]
28    pub version: i32,
29    /// Represents the Inputs of the transaction
30    #[serde(rename = "vin")]
31    pub vin: Vec<crate::models::DecodeRawTransactionHexRiszVin>,
32    /// Represents the Inputs of the transaction
33    #[serde(rename = "vout")]
34    pub vout: Vec<crate::models::DecodeRawTransactionHexRiszVout>,
35    /// Represents the size of a block, measured in weight units and including the segwit discount.
36    #[serde(rename = "weight", skip_serializing_if = "Option::is_none")]
37    pub weight: Option<i32>,
38    /// Defines the approximate fee value. When isConfirmed is True - Defines the amount of the transaction fee When isConfirmed is False - For ETH-based blockchains this attribute represents the max fee value.
39    #[serde(rename = "approximateFee", skip_serializing_if = "Option::is_none")]
40    pub approximate_fee: Option<String>,
41    /// Defines the approximate minimum fee that is required for the transaction.
42    #[serde(rename = "approximateMinimumRequiredFee", skip_serializing_if = "Option::is_none")]
43    pub approximate_minimum_required_fee: Option<String>,
44    /// Represents the amount of gas used by this specific transaction alone.
45    #[serde(rename = "gasLimit")]
46    pub gas_limit: String,
47    /// Represents the amount of gas paid for the data in the transaction.
48    #[serde(rename = "gasPaidForData", skip_serializing_if = "Option::is_none")]
49    pub gas_paid_for_data: Option<String>,
50    /// Represents the price offered to the miner to purchase this amount of gas.
51    #[serde(rename = "gasPrice", skip_serializing_if = "Option::is_none")]
52    pub gas_price: Option<String>,
53    /// Represents additional information that is required for the transaction.
54    #[serde(rename = "inputData", skip_serializing_if = "Option::is_none")]
55    pub input_data: Option<String>,
56    /// Defines the maximum amount that customer is willing to pay per unit of gas to get his transaction included in a block.
57    #[serde(rename = "maxFeePerGas", skip_serializing_if = "Option::is_none")]
58    pub max_fee_per_gas: Option<String>,
59    /// Represents determined by the user value that is paid directly to miners.
60    #[serde(rename = "maxFeePriorityPerGas", skip_serializing_if = "Option::is_none")]
61    pub max_fee_priority_per_gas: Option<String>,
62    /// Represents the sequential running number for an address, starting from 0 for the first transaction. E.g., if the nonce of a transaction is 10, it would be the 11th transaction sent from the sender's address.
63    #[serde(rename = "nonce")]
64    pub nonce: i32,
65    /// Represents output of an ECDSA signature.
66    #[serde(rename = "r", skip_serializing_if = "Option::is_none")]
67    pub r: Option<String>,
68    /// The address which receives this transaction. In UTXO-based protocols like Bitcoin there could be several senders while in account-based protocols like Ethereum there is always only one recipient.
69    #[serde(rename = "recipient")]
70    pub recipient: String,
71    /// Represents output of an ECDSA signature.
72    #[serde(rename = "s", skip_serializing_if = "Option::is_none")]
73    pub s: Option<String>,
74    /// Represents the address which sends this transaction. In UTXO-based protocols like Bitcoin there could be several senders while in account-based protocols like Ethereum there is always only one sender.
75    #[serde(rename = "sender")]
76    pub sender: String,
77    /// Specifies the transaction type as one from three options: if response returns a `\"0\"` it means the raw transaction includes legacy transaction data, if it is `\"1\"` - includes access lists for EIP2930, and if it is `\"2\"` - EIP1559 data.
78    #[serde(rename = "type")]
79    pub _type: i32,
80    /// Defines the the recovery id.
81    #[serde(rename = "v", skip_serializing_if = "Option::is_none")]
82    pub v: Option<String>,
83    /// Represents the sent/received amount.
84    #[serde(rename = "value", skip_serializing_if = "Option::is_none")]
85    pub value: Option<String>,
86    /// Represents a block height after which the transaction will expire.
87    #[serde(rename = "expiryHeight")]
88    pub expiry_height: i32,
89    /// \"Overwinter\" is the network upgrade for the Zcash blockchain.
90    #[serde(rename = "overwintered")]
91    pub overwintered: bool,
92    /// Defines if the transaction includes sapling or not.
93    #[serde(rename = "saplinged")]
94    pub saplinged: bool,
95    /// Defines the transaction value balance.
96    #[serde(rename = "valueBalance")]
97    pub value_balance: String,
98    /// Represents the transaction version group ID
99    #[serde(rename = "versionGroupId")]
100    pub version_group_id: String,
101}
102
103impl DecodeRawTransactionHexRis {
104    /// Represents the specific transaction data according to the blockchain
105    pub fn new(locktime: i32, transaction_hash: String, v_size: i32, version: i32, vin: Vec<crate::models::DecodeRawTransactionHexRiszVin>, vout: Vec<crate::models::DecodeRawTransactionHexRiszVout>, gas_limit: String, nonce: i32, recipient: String, sender: String, _type: i32, expiry_height: i32, overwintered: bool, saplinged: bool, value_balance: String, version_group_id: String) -> DecodeRawTransactionHexRis {
106        DecodeRawTransactionHexRis {
107            locktime,
108            transaction_hash,
109            v_size,
110            version,
111            vin,
112            vout,
113            weight: None,
114            approximate_fee: None,
115            approximate_minimum_required_fee: None,
116            gas_limit,
117            gas_paid_for_data: None,
118            gas_price: None,
119            input_data: None,
120            max_fee_per_gas: None,
121            max_fee_priority_per_gas: None,
122            nonce,
123            r: None,
124            recipient,
125            s: None,
126            sender,
127            _type,
128            v: None,
129            value: None,
130            expiry_height,
131            overwintered,
132            saplinged,
133            value_balance,
134            version_group_id,
135        }
136    }
137}
138
139