cryptoapis/models/prepare_an_account_based_transaction_from_hd_wallet_x_pub_y_pub_z_pub_ri.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
12
13
14#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
15pub struct PrepareAnAccountBasedTransactionFromHdWalletXPubYPubZPubRi {
16 /// Representation of the amount of the transaction
17 #[serde(rename = "amount")]
18 pub amount: String,
19 /// Representation of the data in hex value
20 #[serde(rename = "dataHex")]
21 pub data_hex: String,
22 /// Representation of the derivation index of the xpub address
23 #[serde(rename = "derivationIndex")]
24 pub derivation_index: i64,
25 #[serde(rename = "fee")]
26 pub fee: Box<crate::models::PrepareAnAccountBasedTransactionFromHdWalletXPubYPubZPubRiFee>,
27 /// 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.
28 #[serde(rename = "nonce")]
29 pub nonce: String,
30 /// Represents a recipient addresses. In account-based protocols like Ethereum there is only one address in this list.
31 #[serde(rename = "recipient")]
32 pub recipient: String,
33 /// Represents a sender address. In account-based protocols like Ethereum there is only one address in this list.
34 #[serde(rename = "sender")]
35 pub sender: String,
36 /// Representation of the hash that should be signed.
37 #[serde(rename = "sigHash")]
38 pub sig_hash: String,
39 /// Representation of the transaction type
40 #[serde(rename = "transactionType")]
41 pub transaction_type: TransactionType,
42}
43
44impl PrepareAnAccountBasedTransactionFromHdWalletXPubYPubZPubRi {
45 pub fn new(amount: String, data_hex: String, derivation_index: i64, fee: crate::models::PrepareAnAccountBasedTransactionFromHdWalletXPubYPubZPubRiFee, nonce: String, recipient: String, sender: String, sig_hash: String, transaction_type: TransactionType) -> PrepareAnAccountBasedTransactionFromHdWalletXPubYPubZPubRi {
46 PrepareAnAccountBasedTransactionFromHdWalletXPubYPubZPubRi {
47 amount,
48 data_hex,
49 derivation_index,
50 fee: Box::new(fee),
51 nonce,
52 recipient,
53 sender,
54 sig_hash,
55 transaction_type,
56 }
57 }
58}
59
60/// Representation of the transaction type
61#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
62pub enum TransactionType {
63 #[serde(rename = "legacy-transaction")]
64 LegacyTransaction,
65}
66