lightspark/objects/
post_transaction_data.rs

1// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2use crate::objects::currency_amount::CurrencyAmount;
3use serde::{Deserialize, Serialize};
4
5/// This object represents post-transaction data that could be used to register payment for KYT.
6#[derive(Debug, Clone, Deserialize, Serialize)]
7pub struct PostTransactionData {
8    /// The utxo of the channel over which the payment went through in the format of <transaction_hash>:<output_index>.
9    #[serde(rename = "post_transaction_data_utxo")]
10    pub utxo: String,
11
12    /// The amount of funds transferred in the payment.
13    #[serde(rename = "post_transaction_data_amount")]
14    pub amount: CurrencyAmount,
15}
16
17pub const FRAGMENT: &str = "
18fragment PostTransactionDataFragment on PostTransactionData {
19    __typename
20    post_transaction_data_utxo: utxo
21    post_transaction_data_amount: amount {
22        __typename
23        currency_amount_original_value: original_value
24        currency_amount_original_unit: original_unit
25        currency_amount_preferred_currency_unit: preferred_currency_unit
26        currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
27        currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
28    }
29}
30";