diff --git a/lightspark/src/objects/account.rs b/lightspark/src/objects/account.rs index de101fa..7269b1f 100644 --- a/lightspark/src/objects/account.rs +++ b/lightspark/src/objects/account.rs @@ -405,6 +405,33 @@ impl Account { } } lightspark_node_with_o_s_k_uma_prescreening_utxos: uma_prescreening_utxos + lightspark_node_with_o_s_k_balances: balances { + __typename + balances_owned_balance: owned_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + balances_available_to_send_balance: available_to_send_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + balances_available_to_withdraw_balance: available_to_withdraw_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + } lightspark_node_with_o_s_k_encrypted_signing_private_key: encrypted_signing_private_key { __typename secret_encrypted_value: encrypted_value @@ -510,6 +537,33 @@ impl Account { } } lightspark_node_with_remote_signing_uma_prescreening_utxos: uma_prescreening_utxos + lightspark_node_with_remote_signing_balances: balances { + __typename + balances_owned_balance: owned_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + balances_available_to_send_balance: available_to_send_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + balances_available_to_withdraw_balance: available_to_withdraw_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + } } } } @@ -1068,6 +1122,33 @@ impl Account { } } lightspark_node_with_o_s_k_uma_prescreening_utxos: uma_prescreening_utxos + lightspark_node_with_o_s_k_balances: balances { + __typename + balances_owned_balance: owned_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + balances_available_to_send_balance: available_to_send_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + balances_available_to_withdraw_balance: available_to_withdraw_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + } lightspark_node_with_o_s_k_encrypted_signing_private_key: encrypted_signing_private_key { __typename secret_encrypted_value: encrypted_value @@ -1173,6 +1254,33 @@ impl Account { } } lightspark_node_with_remote_signing_uma_prescreening_utxos: uma_prescreening_utxos + lightspark_node_with_remote_signing_balances: balances { + __typename + balances_owned_balance: owned_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + balances_available_to_send_balance: available_to_send_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + balances_available_to_withdraw_balance: available_to_withdraw_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + } } } } @@ -1451,6 +1559,33 @@ impl Account { } } lightspark_node_with_o_s_k_uma_prescreening_utxos: uma_prescreening_utxos + lightspark_node_with_o_s_k_balances: balances { + __typename + balances_owned_balance: owned_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + balances_available_to_send_balance: available_to_send_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + balances_available_to_withdraw_balance: available_to_withdraw_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + } lightspark_node_with_o_s_k_encrypted_signing_private_key: encrypted_signing_private_key { __typename secret_encrypted_value: encrypted_value @@ -1556,6 +1691,33 @@ impl Account { } } lightspark_node_with_remote_signing_uma_prescreening_utxos: uma_prescreening_utxos + lightspark_node_with_remote_signing_balances: balances { + __typename + balances_owned_balance: owned_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + balances_available_to_send_balance: available_to_send_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + balances_available_to_withdraw_balance: available_to_withdraw_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + } } } } diff --git a/lightspark/src/objects/account_to_payment_requests_connection.rs b/lightspark/src/objects/account_to_payment_requests_connection.rs index 73ad2b9..017321d 100644 --- a/lightspark/src/objects/account_to_payment_requests_connection.rs +++ b/lightspark/src/objects/account_to_payment_requests_connection.rs @@ -1,10 +1,11 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved use crate::objects::connection::Connection; -use crate::objects::page_info::PageInfo; -use crate::objects::payment_request::PaymentRequestEnum; use serde::Deserialize; use std::vec::Vec; +use crate::objects::page_info::PageInfo; +use crate::objects::payment_request::PaymentRequestEnum; + #[derive(Clone, Deserialize)] pub struct AccountToPaymentRequestsConnection { /// The total count of objects in this connection, using the current filters. It is different from the number of objects returned in the current page (in the `entities` field). diff --git a/lightspark/src/objects/account_to_transactions_connection.rs b/lightspark/src/objects/account_to_transactions_connection.rs index c8514d7..0629396 100644 --- a/lightspark/src/objects/account_to_transactions_connection.rs +++ b/lightspark/src/objects/account_to_transactions_connection.rs @@ -1,11 +1,11 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved -use crate::objects::page_info::PageInfo; +use crate::objects::currency_amount::CurrencyAmount; +use crate::objects::transaction::TransactionEnum; use serde::Deserialize; -use std::vec::Vec; use crate::objects::connection::Connection; -use crate::objects::currency_amount::CurrencyAmount; -use crate::objects::transaction::TransactionEnum; +use crate::objects::page_info::PageInfo; +use std::vec::Vec; #[derive(Clone, Deserialize)] pub struct AccountToTransactionsConnection { diff --git a/lightspark/src/objects/channel_snapshot.rs b/lightspark/src/objects/channel_snapshot.rs index 8896e05..ab6926c 100644 --- a/lightspark/src/objects/channel_snapshot.rs +++ b/lightspark/src/objects/channel_snapshot.rs @@ -1,9 +1,18 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved use crate::objects::currency_amount::CurrencyAmount; +use crate::types::custom_date_formats::custom_date_format; +use crate::types::entity_wrapper::EntityWrapper; +use chrono::{DateTime, Utc}; use serde::Deserialize; #[derive(Clone, Deserialize)] pub struct ChannelSnapshot { + #[serde(rename = "channel_snapshot_channel")] + pub channel: EntityWrapper, + + #[serde(with = "custom_date_format", rename = "channel_snapshot_timestamp")] + pub timestamp: DateTime, + #[serde(rename = "channel_snapshot_local_balance")] pub local_balance: Option, @@ -12,11 +21,21 @@ pub struct ChannelSnapshot { #[serde(rename = "channel_snapshot_local_channel_reserve")] pub local_channel_reserve: Option, + + #[serde(rename = "channel_snapshot_remote_balance")] + pub remote_balance: Option, + + #[serde(rename = "channel_snapshot_remote_unsettled_balance")] + pub remote_unsettled_balance: Option, } pub const FRAGMENT: &str = " fragment ChannelSnapshotFragment on ChannelSnapshot { __typename + channel_snapshot_channel: channel { + id + } + channel_snapshot_timestamp: timestamp channel_snapshot_local_balance: local_balance { __typename currency_amount_original_value: original_value @@ -41,5 +60,21 @@ fragment ChannelSnapshotFragment on ChannelSnapshot { currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } + channel_snapshot_remote_balance: remote_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + channel_snapshot_remote_unsettled_balance: remote_unsettled_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } } "; diff --git a/lightspark/src/objects/htlc_attempt_failure_code.rs b/lightspark/src/objects/htlc_attempt_failure_code.rs index e5d6dfb..a90ad64 100644 --- a/lightspark/src/objects/htlc_attempt_failure_code.rs +++ b/lightspark/src/objects/htlc_attempt_failure_code.rs @@ -78,6 +78,9 @@ pub enum HtlcAttemptFailureCode { #[serde(rename = "INVALID_ONION_PAYLOAD")] InvalidOnionPayload, + #[serde(rename = "INVALID_ONION_BLINDING")] + InvalidOnionBlinding, + #[serde(rename = "INTERNAL_FAILURE")] InternalFailure, @@ -123,6 +126,7 @@ impl fmt::Display for HtlcAttemptFailureCode { Self::ExpiryTooFar => write!(f, "EXPIRY_TOO_FAR"), Self::MppTimeout => write!(f, "MPP_TIMEOUT"), Self::InvalidOnionPayload => write!(f, "INVALID_ONION_PAYLOAD"), + Self::InvalidOnionBlinding => write!(f, "INVALID_ONION_BLINDING"), Self::InternalFailure => write!(f, "INTERNAL_FAILURE"), Self::UnknownFailure => write!(f, "UNKNOWN_FAILURE"), Self::UnreadableFailure => write!(f, "UNREADABLE_FAILURE"), diff --git a/lightspark/src/objects/invoice.rs b/lightspark/src/objects/invoice.rs index b162006..f62717f 100644 --- a/lightspark/src/objects/invoice.rs +++ b/lightspark/src/objects/invoice.rs @@ -228,6 +228,33 @@ fragment InvoiceFragment on Invoice { } } lightspark_node_with_o_s_k_uma_prescreening_utxos: uma_prescreening_utxos + lightspark_node_with_o_s_k_balances: balances { + __typename + balances_owned_balance: owned_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + balances_available_to_send_balance: available_to_send_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + balances_available_to_withdraw_balance: available_to_withdraw_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + } lightspark_node_with_o_s_k_encrypted_signing_private_key: encrypted_signing_private_key { __typename secret_encrypted_value: encrypted_value @@ -333,6 +360,33 @@ fragment InvoiceFragment on Invoice { } } lightspark_node_with_remote_signing_uma_prescreening_utxos: uma_prescreening_utxos + lightspark_node_with_remote_signing_balances: balances { + __typename + balances_owned_balance: owned_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + balances_available_to_send_balance: available_to_send_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + balances_available_to_withdraw_balance: available_to_withdraw_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + } } } } diff --git a/lightspark/src/objects/invoice_data.rs b/lightspark/src/objects/invoice_data.rs index 685f7bc..67aa50f 100644 --- a/lightspark/src/objects/invoice_data.rs +++ b/lightspark/src/objects/invoice_data.rs @@ -1,12 +1,12 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved -use crate::objects::bitcoin_network::BitcoinNetwork; -use crate::objects::node::NodeEnum; -use crate::types::custom_date_formats::custom_date_format; -use chrono::{DateTime, Utc}; use serde::Deserialize; +use crate::objects::bitcoin_network::BitcoinNetwork; use crate::objects::currency_amount::CurrencyAmount; +use crate::objects::node::NodeEnum; use crate::objects::payment_request_data::PaymentRequestData; +use crate::types::custom_date_formats::custom_date_format; +use chrono::{DateTime, Utc}; /// This object represents the data associated with a BOLT #11 invoice. You can retrieve this object to receive the relevant data associated with a specific invoice. #[derive(Clone, Deserialize)] @@ -186,6 +186,33 @@ fragment InvoiceDataFragment on InvoiceData { } } lightspark_node_with_o_s_k_uma_prescreening_utxos: uma_prescreening_utxos + lightspark_node_with_o_s_k_balances: balances { + __typename + balances_owned_balance: owned_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + balances_available_to_send_balance: available_to_send_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + balances_available_to_withdraw_balance: available_to_withdraw_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + } lightspark_node_with_o_s_k_encrypted_signing_private_key: encrypted_signing_private_key { __typename secret_encrypted_value: encrypted_value @@ -291,6 +318,33 @@ fragment InvoiceDataFragment on InvoiceData { } } lightspark_node_with_remote_signing_uma_prescreening_utxos: uma_prescreening_utxos + lightspark_node_with_remote_signing_balances: balances { + __typename + balances_owned_balance: owned_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + balances_available_to_send_balance: available_to_send_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + balances_available_to_withdraw_balance: available_to_withdraw_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + } } } } diff --git a/lightspark/src/objects/lightspark_node.rs b/lightspark/src/objects/lightspark_node.rs index 870686d..47c3cca 100644 --- a/lightspark/src/objects/lightspark_node.rs +++ b/lightspark/src/objects/lightspark_node.rs @@ -1,14 +1,16 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved use super::lightspark_node_with_o_s_k::LightsparkNodeWithOSK; -use super::lightspark_node_with_remote_signing::LightsparkNodeWithRemoteSigning; use crate::objects::blockchain_balance::BlockchainBalance; use crate::objects::currency_amount::CurrencyAmount; use crate::objects::entity::Entity; use crate::objects::lightspark_node_status::LightsparkNodeStatus; use crate::objects::node::Node; -use crate::types::entity_wrapper::EntityWrapper; use serde::{Deserialize, Deserializer}; use serde_json::Value; + +use super::lightspark_node_with_remote_signing::LightsparkNodeWithRemoteSigning; +use crate::objects::balances::Balances; +use crate::types::entity_wrapper::EntityWrapper; use std::vec::Vec; pub trait LightsparkNode: Node + Entity { @@ -36,6 +38,9 @@ pub trait LightsparkNode: Node + Entity { /// The utxos of the channels that are connected to this node. This is used in uma flow for pre-screening. fn get_uma_prescreening_utxos(&self) -> Vec; + /// The balances that describe the funds in this node. + fn get_balances(&self) -> Option; + fn type_name(&self) -> &'static str; } diff --git a/lightspark/src/objects/lightspark_node_with_o_s_k.rs b/lightspark/src/objects/lightspark_node_with_o_s_k.rs index 47ff90e..b6a2f7d 100644 --- a/lightspark/src/objects/lightspark_node_with_o_s_k.rs +++ b/lightspark/src/objects/lightspark_node_with_o_s_k.rs @@ -1,27 +1,28 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved -use crate::error::Error; -use crate::objects::lightspark_node_to_channels_connection::LightsparkNodeToChannelsConnection; +use crate::objects::blockchain_balance::BlockchainBalance; +use crate::objects::lightspark_node::LightsparkNode; +use crate::objects::node::Node; +use crate::objects::node_address_type::NodeAddressType; +use crate::objects::node_to_addresses_connection::NodeToAddressesConnection; +use crate::types::graphql_requester::GraphQLRequester; +use chrono::{DateTime, Utc}; use serde::Deserialize; -use std::collections::HashMap; +use std::vec::Vec; +use crate::error::Error; +use crate::objects::balances::Balances; use crate::objects::bitcoin_network::BitcoinNetwork; -use crate::objects::blockchain_balance::BlockchainBalance; use crate::objects::channel_status::ChannelStatus; use crate::objects::currency_amount::CurrencyAmount; use crate::objects::entity::Entity; -use crate::objects::lightspark_node::LightsparkNode; use crate::objects::lightspark_node_status::LightsparkNodeStatus; -use crate::objects::node::Node; -use crate::objects::node_address_type::NodeAddressType; -use crate::objects::node_to_addresses_connection::NodeToAddressesConnection; +use crate::objects::lightspark_node_to_channels_connection::LightsparkNodeToChannelsConnection; use crate::objects::secret::Secret; use crate::types::custom_date_formats::custom_date_format; use crate::types::entity_wrapper::EntityWrapper; use crate::types::get_entity::GetEntity; -use crate::types::graphql_requester::GraphQLRequester; -use chrono::{DateTime, Utc}; use serde_json::Value; -use std::vec::Vec; +use std::collections::HashMap; /// This is a Lightspark node with OSK. #[derive(Clone, Deserialize)] @@ -100,6 +101,10 @@ pub struct LightsparkNodeWithOSK { #[serde(rename = "lightspark_node_with_o_s_k_uma_prescreening_utxos")] pub uma_prescreening_utxos: Vec, + /// The balances that describe the funds in this node. + #[serde(rename = "lightspark_node_with_o_s_k_balances")] + pub balances: Option, + /// The private key client is using to sign a GraphQL request which will be verified at server side. #[serde(rename = "lightspark_node_with_o_s_k_encrypted_signing_private_key")] pub encrypted_signing_private_key: Option, @@ -146,6 +151,11 @@ impl LightsparkNode for LightsparkNodeWithOSK { self.uma_prescreening_utxos.clone() } + /// The balances that describe the funds in this node. + fn get_balances(&self) -> Option { + self.balances.clone() + } + fn type_name(&self) -> &'static str { "LightsparkNodeWithOSK" } @@ -326,6 +336,33 @@ fragment LightsparkNodeWithOSKFragment on LightsparkNodeWithOSK { } } lightspark_node_with_o_s_k_uma_prescreening_utxos: uma_prescreening_utxos + lightspark_node_with_o_s_k_balances: balances { + __typename + balances_owned_balance: owned_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + balances_available_to_send_balance: available_to_send_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + balances_available_to_withdraw_balance: available_to_withdraw_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + } lightspark_node_with_o_s_k_encrypted_signing_private_key: encrypted_signing_private_key { __typename secret_encrypted_value: encrypted_value diff --git a/lightspark/src/objects/lightspark_node_with_remote_signing.rs b/lightspark/src/objects/lightspark_node_with_remote_signing.rs index 76a0492..63e84c9 100644 --- a/lightspark/src/objects/lightspark_node_with_remote_signing.rs +++ b/lightspark/src/objects/lightspark_node_with_remote_signing.rs @@ -1,26 +1,27 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved -use crate::error::Error; -use crate::objects::lightspark_node_to_channels_connection::LightsparkNodeToChannelsConnection; +use crate::objects::blockchain_balance::BlockchainBalance; +use crate::objects::lightspark_node::LightsparkNode; +use crate::objects::node::Node; +use crate::objects::node_address_type::NodeAddressType; +use crate::objects::node_to_addresses_connection::NodeToAddressesConnection; +use crate::types::graphql_requester::GraphQLRequester; +use chrono::{DateTime, Utc}; use serde::Deserialize; -use std::collections::HashMap; +use std::vec::Vec; +use crate::error::Error; +use crate::objects::balances::Balances; use crate::objects::bitcoin_network::BitcoinNetwork; -use crate::objects::blockchain_balance::BlockchainBalance; use crate::objects::channel_status::ChannelStatus; use crate::objects::currency_amount::CurrencyAmount; use crate::objects::entity::Entity; -use crate::objects::lightspark_node::LightsparkNode; use crate::objects::lightspark_node_status::LightsparkNodeStatus; -use crate::objects::node::Node; -use crate::objects::node_address_type::NodeAddressType; -use crate::objects::node_to_addresses_connection::NodeToAddressesConnection; +use crate::objects::lightspark_node_to_channels_connection::LightsparkNodeToChannelsConnection; use crate::types::custom_date_formats::custom_date_format; use crate::types::entity_wrapper::EntityWrapper; use crate::types::get_entity::GetEntity; -use crate::types::graphql_requester::GraphQLRequester; -use chrono::{DateTime, Utc}; use serde_json::Value; -use std::vec::Vec; +use std::collections::HashMap; /// This is a Lightspark node with remote signing. #[derive(Clone, Deserialize)] @@ -98,6 +99,10 @@ pub struct LightsparkNodeWithRemoteSigning { /// The utxos of the channels that are connected to this node. This is used in uma flow for pre-screening. #[serde(rename = "lightspark_node_with_remote_signing_uma_prescreening_utxos")] pub uma_prescreening_utxos: Vec, + + /// The balances that describe the funds in this node. + #[serde(rename = "lightspark_node_with_remote_signing_balances")] + pub balances: Option, } impl LightsparkNode for LightsparkNodeWithRemoteSigning { @@ -141,6 +146,11 @@ impl LightsparkNode for LightsparkNodeWithRemoteSigning { self.uma_prescreening_utxos.clone() } + /// The balances that describe the funds in this node. + fn get_balances(&self) -> Option { + self.balances.clone() + } + fn type_name(&self) -> &'static str { "LightsparkNodeWithRemoteSigning" } @@ -321,6 +331,33 @@ fragment LightsparkNodeWithRemoteSigningFragment on LightsparkNodeWithRemoteSign } } lightspark_node_with_remote_signing_uma_prescreening_utxos: uma_prescreening_utxos + lightspark_node_with_remote_signing_balances: balances { + __typename + balances_owned_balance: owned_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + balances_available_to_send_balance: available_to_send_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + balances_available_to_withdraw_balance: available_to_withdraw_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + } } "; diff --git a/lightspark/src/objects/outgoing_payment.rs b/lightspark/src/objects/outgoing_payment.rs index 2599298..4834b30 100644 --- a/lightspark/src/objects/outgoing_payment.rs +++ b/lightspark/src/objects/outgoing_payment.rs @@ -1,26 +1,26 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved +use crate::objects::outgoing_payment_to_attempts_connection::OutgoingPaymentToAttemptsConnection; +use crate::types::graphql_requester::GraphQLRequester; +use chrono::{DateTime, Utc}; +use serde::Deserialize; +use std::vec::Vec; + use crate::error::Error; use crate::objects::currency_amount::CurrencyAmount; use crate::objects::entity::Entity; use crate::objects::lightning_transaction::LightningTransaction; -use crate::objects::outgoing_payment_to_attempts_connection::OutgoingPaymentToAttemptsConnection; use crate::objects::payment_failure_reason::PaymentFailureReason; use crate::objects::payment_request_data::PaymentRequestDataEnum; use crate::objects::post_transaction_data::PostTransactionData; +use crate::objects::rich_text::RichText; use crate::objects::transaction::Transaction; use crate::objects::transaction_status::TransactionStatus; use crate::types::custom_date_formats::custom_date_format; use crate::types::custom_date_formats::custom_date_format_option; use crate::types::entity_wrapper::EntityWrapper; use crate::types::get_entity::GetEntity; -use crate::types::graphql_requester::GraphQLRequester; -use chrono::{DateTime, Utc}; -use serde::Deserialize; use serde_json::Value; use std::collections::HashMap; -use std::vec::Vec; - -use crate::objects::rich_text::RichText; /// This object represents a Lightning Network payment sent from a Lightspark Node. You can retrieve this object to receive payment related information about any payment sent from your Lightspark Node on the Lightning Network. #[derive(Clone, Deserialize)] @@ -322,6 +322,33 @@ fragment OutgoingPaymentFragment on OutgoingPayment { } } lightspark_node_with_o_s_k_uma_prescreening_utxos: uma_prescreening_utxos + lightspark_node_with_o_s_k_balances: balances { + __typename + balances_owned_balance: owned_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + balances_available_to_send_balance: available_to_send_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + balances_available_to_withdraw_balance: available_to_withdraw_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + } lightspark_node_with_o_s_k_encrypted_signing_private_key: encrypted_signing_private_key { __typename secret_encrypted_value: encrypted_value @@ -427,6 +454,33 @@ fragment OutgoingPaymentFragment on OutgoingPayment { } } lightspark_node_with_remote_signing_uma_prescreening_utxos: uma_prescreening_utxos + lightspark_node_with_remote_signing_balances: balances { + __typename + balances_owned_balance: owned_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + balances_available_to_send_balance: available_to_send_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + balances_available_to_withdraw_balance: available_to_withdraw_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + } } } } @@ -502,6 +556,10 @@ impl OutgoingPayment { } outgoing_payment_attempt_channel_snapshot: channel_snapshot { __typename + channel_snapshot_channel: channel { + id + } + channel_snapshot_timestamp: timestamp channel_snapshot_local_balance: local_balance { __typename currency_amount_original_value: original_value @@ -526,6 +584,22 @@ impl OutgoingPayment { currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } + channel_snapshot_remote_balance: remote_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + channel_snapshot_remote_unsettled_balance: remote_unsettled_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } } } } diff --git a/lightspark/src/objects/outgoing_payment_attempt.rs b/lightspark/src/objects/outgoing_payment_attempt.rs index fac07ae..70fd643 100644 --- a/lightspark/src/objects/outgoing_payment_attempt.rs +++ b/lightspark/src/objects/outgoing_payment_attempt.rs @@ -143,6 +143,10 @@ fragment OutgoingPaymentAttemptFragment on OutgoingPaymentAttempt { } outgoing_payment_attempt_channel_snapshot: channel_snapshot { __typename + channel_snapshot_channel: channel { + id + } + channel_snapshot_timestamp: timestamp channel_snapshot_local_balance: local_balance { __typename currency_amount_original_value: original_value @@ -167,6 +171,22 @@ fragment OutgoingPaymentAttemptFragment on OutgoingPaymentAttempt { currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } + channel_snapshot_remote_balance: remote_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + channel_snapshot_remote_unsettled_balance: remote_unsettled_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } } } "; diff --git a/lightspark/src/objects/wallet.rs b/lightspark/src/objects/wallet.rs index 2dcbfce..ede66fb 100644 --- a/lightspark/src/objects/wallet.rs +++ b/lightspark/src/objects/wallet.rs @@ -462,6 +462,33 @@ impl Wallet { } } lightspark_node_with_o_s_k_uma_prescreening_utxos: uma_prescreening_utxos + lightspark_node_with_o_s_k_balances: balances { + __typename + balances_owned_balance: owned_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + balances_available_to_send_balance: available_to_send_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + balances_available_to_withdraw_balance: available_to_withdraw_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + } lightspark_node_with_o_s_k_encrypted_signing_private_key: encrypted_signing_private_key { __typename secret_encrypted_value: encrypted_value @@ -567,6 +594,33 @@ impl Wallet { } } lightspark_node_with_remote_signing_uma_prescreening_utxos: uma_prescreening_utxos + lightspark_node_with_remote_signing_balances: balances { + __typename + balances_owned_balance: owned_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + balances_available_to_send_balance: available_to_send_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + balances_available_to_withdraw_balance: available_to_withdraw_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + } } } } @@ -842,6 +896,33 @@ impl Wallet { } } lightspark_node_with_o_s_k_uma_prescreening_utxos: uma_prescreening_utxos + lightspark_node_with_o_s_k_balances: balances { + __typename + balances_owned_balance: owned_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + balances_available_to_send_balance: available_to_send_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + balances_available_to_withdraw_balance: available_to_withdraw_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + } lightspark_node_with_o_s_k_encrypted_signing_private_key: encrypted_signing_private_key { __typename secret_encrypted_value: encrypted_value @@ -947,6 +1028,33 @@ impl Wallet { } } lightspark_node_with_remote_signing_uma_prescreening_utxos: uma_prescreening_utxos + lightspark_node_with_remote_signing_balances: balances { + __typename + balances_owned_balance: owned_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + balances_available_to_send_balance: available_to_send_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + balances_available_to_withdraw_balance: available_to_withdraw_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + } } } } diff --git a/lightspark/src/objects/wallet_to_payment_requests_connection.rs b/lightspark/src/objects/wallet_to_payment_requests_connection.rs index 8814e00..362c96c 100644 --- a/lightspark/src/objects/wallet_to_payment_requests_connection.rs +++ b/lightspark/src/objects/wallet_to_payment_requests_connection.rs @@ -1,10 +1,11 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved use crate::objects::connection::Connection; -use crate::objects::page_info::PageInfo; -use crate::objects::payment_request::PaymentRequestEnum; use serde::Deserialize; use std::vec::Vec; +use crate::objects::page_info::PageInfo; +use crate::objects::payment_request::PaymentRequestEnum; + #[derive(Clone, Deserialize)] pub struct WalletToPaymentRequestsConnection { /// The total count of objects in this connection, using the current filters. It is different from the number of objects returned in the current page (in the `entities` field). diff --git a/lightspark/src/objects/wallet_to_transactions_connection.rs b/lightspark/src/objects/wallet_to_transactions_connection.rs index dac24d5..7256741 100644 --- a/lightspark/src/objects/wallet_to_transactions_connection.rs +++ b/lightspark/src/objects/wallet_to_transactions_connection.rs @@ -1,10 +1,10 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved -use crate::objects::page_info::PageInfo; +use crate::objects::transaction::TransactionEnum; use serde::Deserialize; -use std::vec::Vec; use crate::objects::connection::Connection; -use crate::objects::transaction::TransactionEnum; +use crate::objects::page_info::PageInfo; +use std::vec::Vec; #[derive(Clone, Deserialize)] pub struct WalletToTransactionsConnection {