From be9d724a86a71908fc1f24fdc480e8fa6c0c1b05 Mon Sep 17 00:00:00 2001 From: Shreya Vissamsetti Date: Mon, 1 Jul 2024 14:19:49 -0700 Subject: [PATCH] Regenerate SDK (#50) --- lightspark/src/objects/account.rs | 1 + .../objects/account_to_nodes_connection.rs | 4 +-- .../account_to_payment_requests_connection.rs | 2 +- .../account_to_transactions_connection.rs | 6 ++-- .../src/objects/create_lnurl_invoice_input.rs | 3 ++ .../src/objects/create_uma_invoice_input.rs | 2 ++ lightspark/src/objects/invoice_data.rs | 6 ++-- lightspark/src/objects/lightspark_node.rs | 6 ++-- .../src/objects/lightspark_node_with_o_s_k.rs | 22 +++++++-------- .../lightspark_node_with_remote_signing.rs | 20 ++++++------- lightspark/src/objects/mod.rs | 1 + lightspark/src/objects/outgoing_payment.rs | 16 +++++------ .../src/objects/pay_uma_invoice_input.rs | 3 ++ lightspark/src/objects/request_initiator.rs | 28 +++++++++++++++++++ lightspark/src/objects/wallet.rs | 1 + .../wallet_to_payment_requests_connection.rs | 2 +- .../wallet_to_transactions_connection.rs | 4 +-- lightspark/src/objects/withdrawal_request.rs | 6 ++++ 18 files changed, 89 insertions(+), 44 deletions(-) create mode 100644 lightspark/src/objects/request_initiator.rs diff --git a/lightspark/src/objects/account.rs b/lightspark/src/objects/account.rs index 2231196..a6d8366 100644 --- a/lightspark/src/objects/account.rs +++ b/lightspark/src/objects/account.rs @@ -1853,6 +1853,7 @@ impl Account { id } withdrawal_request_idempotency_key: idempotency_key + withdrawal_request_initiator: initiator } } } diff --git a/lightspark/src/objects/account_to_nodes_connection.rs b/lightspark/src/objects/account_to_nodes_connection.rs index f973d30..fbcba0e 100644 --- a/lightspark/src/objects/account_to_nodes_connection.rs +++ b/lightspark/src/objects/account_to_nodes_connection.rs @@ -1,11 +1,11 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved -use crate::objects::connection::Connection; use crate::objects::lightspark_node::LightsparkNodeEnum; use crate::objects::page_info::PageInfo; use serde::{Deserialize, Serialize}; - use std::vec::Vec; +use crate::objects::connection::Connection; + /// A connection between an account and the nodes it manages. #[derive(Debug, Clone, Deserialize, Serialize)] pub struct AccountToNodesConnection { diff --git a/lightspark/src/objects/account_to_payment_requests_connection.rs b/lightspark/src/objects/account_to_payment_requests_connection.rs index 0e6dad2..b61bf12 100644 --- a/lightspark/src/objects/account_to_payment_requests_connection.rs +++ b/lightspark/src/objects/account_to_payment_requests_connection.rs @@ -1,9 +1,9 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved +use crate::objects::page_info::PageInfo; use crate::objects::payment_request::PaymentRequestEnum; use serde::{Deserialize, Serialize}; use crate::objects::connection::Connection; -use crate::objects::page_info::PageInfo; use std::vec::Vec; #[derive(Debug, Clone, Deserialize, Serialize)] diff --git a/lightspark/src/objects/account_to_transactions_connection.rs b/lightspark/src/objects/account_to_transactions_connection.rs index 4adcfb4..9b8acc6 100644 --- a/lightspark/src/objects/account_to_transactions_connection.rs +++ b/lightspark/src/objects/account_to_transactions_connection.rs @@ -1,10 +1,10 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved -use serde::{Deserialize, Serialize}; - -use crate::objects::connection::Connection; use crate::objects::currency_amount::CurrencyAmount; use crate::objects::page_info::PageInfo; use crate::objects::transaction::TransactionEnum; +use serde::{Deserialize, Serialize}; + +use crate::objects::connection::Connection; use std::vec::Vec; #[derive(Debug, Clone, Deserialize, Serialize)] diff --git a/lightspark/src/objects/create_lnurl_invoice_input.rs b/lightspark/src/objects/create_lnurl_invoice_input.rs index 2bd10e9..742b22a 100644 --- a/lightspark/src/objects/create_lnurl_invoice_input.rs +++ b/lightspark/src/objects/create_lnurl_invoice_input.rs @@ -14,4 +14,7 @@ pub struct CreateLnurlInvoiceInput { /// The expiry of the invoice in seconds. Default value is 86400 (1 day). pub expiry_secs: Option, + + /// An optional, monthly-rotated, unique hashed identifier corresponding to the receiver of the payment. + pub receiver_hash: Option, } diff --git a/lightspark/src/objects/create_uma_invoice_input.rs b/lightspark/src/objects/create_uma_invoice_input.rs index 2742e3b..fffbd9f 100644 --- a/lightspark/src/objects/create_uma_invoice_input.rs +++ b/lightspark/src/objects/create_uma_invoice_input.rs @@ -10,4 +10,6 @@ pub struct CreateUmaInvoiceInput { pub metadata_hash: String, pub expiry_secs: Option, + + pub receiver_hash: Option, } diff --git a/lightspark/src/objects/invoice_data.rs b/lightspark/src/objects/invoice_data.rs index 614f6da..a4063c0 100644 --- a/lightspark/src/objects/invoice_data.rs +++ b/lightspark/src/objects/invoice_data.rs @@ -1,11 +1,11 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved use crate::objects::bitcoin_network::BitcoinNetwork; -use crate::objects::payment_request_data::PaymentRequestData; -use serde::{Deserialize, Serialize}; - 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 serde::{Deserialize, Serialize}; + 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. diff --git a/lightspark/src/objects/lightspark_node.rs b/lightspark/src/objects/lightspark_node.rs index dffa629..6a19bbe 100644 --- a/lightspark/src/objects/lightspark_node.rs +++ b/lightspark/src/objects/lightspark_node.rs @@ -1,16 +1,16 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved +use super::lightspark_node_with_o_s_k::LightsparkNodeWithOSK; +use crate::objects::balances::Balances; use crate::objects::entity::Entity; use crate::objects::node::Node; +use serde_json::Value; -use super::lightspark_node_with_o_s_k::LightsparkNodeWithOSK; use super::lightspark_node_with_remote_signing::LightsparkNodeWithRemoteSigning; -use crate::objects::balances::Balances; use crate::objects::blockchain_balance::BlockchainBalance; use crate::objects::currency_amount::CurrencyAmount; use crate::objects::lightspark_node_status::LightsparkNodeStatus; use crate::types::entity_wrapper::EntityWrapper; use serde::{Deserialize, Deserializer, Serialize}; -use serde_json::Value; use std::vec::Vec; pub trait LightsparkNode: Node + Entity { 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 22ec9be..89c88ed 100644 --- a/lightspark/src/objects/lightspark_node_with_o_s_k.rs +++ b/lightspark/src/objects/lightspark_node_with_o_s_k.rs @@ -1,32 +1,32 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved -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::lightning_payment_direction::LightningPaymentDirection; use crate::objects::lightspark_node::LightsparkNode; use crate::objects::lightspark_node_status::LightsparkNodeStatus; use crate::objects::lightspark_node_to_channels_connection::LightsparkNodeToChannelsConnection; +use crate::objects::lightspark_node_to_daily_liquidity_forecasts_connection::LightsparkNodeToDailyLiquidityForecastsConnection; use crate::objects::node_address_type::NodeAddressType; +use crate::objects::node_to_addresses_connection::NodeToAddressesConnection; +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::NaiveDate; use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; - -use crate::objects::bitcoin_network::BitcoinNetwork; -use crate::objects::blockchain_balance::BlockchainBalance; -use crate::objects::currency_amount::CurrencyAmount; -use crate::objects::entity::Entity; -use crate::objects::lightspark_node_to_daily_liquidity_forecasts_connection::LightsparkNodeToDailyLiquidityForecastsConnection; -use crate::objects::node::Node; -use crate::objects::node_to_addresses_connection::NodeToAddressesConnection; -use crate::objects::secret::Secret; -use crate::types::entity_wrapper::EntityWrapper; use serde_json::Value; use std::collections::HashMap; use std::vec::Vec; +use crate::error::Error; +use crate::objects::node::Node; + /// This is a Lightspark node with OSK. #[derive(Debug, Clone, Deserialize, Serialize)] pub struct LightsparkNodeWithOSK { diff --git a/lightspark/src/objects/lightspark_node_with_remote_signing.rs b/lightspark/src/objects/lightspark_node_with_remote_signing.rs index 5cb11f2..30fe42f 100644 --- a/lightspark/src/objects/lightspark_node_with_remote_signing.rs +++ b/lightspark/src/objects/lightspark_node_with_remote_signing.rs @@ -1,31 +1,31 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved -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::lightning_payment_direction::LightningPaymentDirection; use crate::objects::lightspark_node::LightsparkNode; use crate::objects::lightspark_node_status::LightsparkNodeStatus; use crate::objects::lightspark_node_to_channels_connection::LightsparkNodeToChannelsConnection; +use crate::objects::lightspark_node_to_daily_liquidity_forecasts_connection::LightsparkNodeToDailyLiquidityForecastsConnection; use crate::objects::node_address_type::NodeAddressType; +use crate::objects::node_to_addresses_connection::NodeToAddressesConnection; 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::NaiveDate; use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; - -use crate::objects::bitcoin_network::BitcoinNetwork; -use crate::objects::blockchain_balance::BlockchainBalance; -use crate::objects::currency_amount::CurrencyAmount; -use crate::objects::entity::Entity; -use crate::objects::lightspark_node_to_daily_liquidity_forecasts_connection::LightsparkNodeToDailyLiquidityForecastsConnection; -use crate::objects::node::Node; -use crate::objects::node_to_addresses_connection::NodeToAddressesConnection; -use crate::types::entity_wrapper::EntityWrapper; use serde_json::Value; use std::collections::HashMap; use std::vec::Vec; +use crate::error::Error; +use crate::objects::node::Node; + /// This is a Lightspark node with remote signing. #[derive(Debug, Clone, Deserialize, Serialize)] pub struct LightsparkNodeWithRemoteSigning { diff --git a/lightspark/src/objects/mod.rs b/lightspark/src/objects/mod.rs index a61784d..47610e7 100644 --- a/lightspark/src/objects/mod.rs +++ b/lightspark/src/objects/mod.rs @@ -124,6 +124,7 @@ pub mod release_channel_per_commitment_secret_output; pub mod release_payment_preimage_input; pub mod release_payment_preimage_output; pub mod remote_signing_sub_event_type; +pub mod request_initiator; pub mod request_withdrawal_input; pub mod request_withdrawal_output; pub mod rich_text; diff --git a/lightspark/src/objects/outgoing_payment.rs b/lightspark/src/objects/outgoing_payment.rs index cf65665..bf92593 100644 --- a/lightspark/src/objects/outgoing_payment.rs +++ b/lightspark/src/objects/outgoing_payment.rs @@ -1,27 +1,27 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved -use crate::objects::outgoing_payment_to_attempts_connection::OutgoingPaymentToAttemptsConnection; -use crate::types::custom_date_formats::custom_date_format_option; -use crate::types::graphql_requester::GraphQLRequester; -use serde::{Deserialize, Serialize}; - -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, Serialize}; use serde_json::Value; use std::collections::HashMap; use std::vec::Vec; +use crate::error::Error; +use crate::objects::post_transaction_data::PostTransactionData; +use crate::objects::transaction::Transaction; + /// 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(Debug, Clone, Deserialize, Serialize)] pub struct OutgoingPayment { diff --git a/lightspark/src/objects/pay_uma_invoice_input.rs b/lightspark/src/objects/pay_uma_invoice_input.rs index 22fd92c..0a3faca 100644 --- a/lightspark/src/objects/pay_uma_invoice_input.rs +++ b/lightspark/src/objects/pay_uma_invoice_input.rs @@ -14,4 +14,7 @@ pub struct PayUmaInvoiceInput { pub amount_msats: Option, pub idempotency_key: Option, + + /// An optional, monthly-rotated, unique hashed identifier corresponding to the sender of the payment. + pub sender_hash: Option, } diff --git a/lightspark/src/objects/request_initiator.rs b/lightspark/src/objects/request_initiator.rs new file mode 100644 index 0000000..9aca961 --- /dev/null +++ b/lightspark/src/objects/request_initiator.rs @@ -0,0 +1,28 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved +use serde::{Deserialize, Serialize}; +use serde_json::Value; +use std::fmt; + +#[derive(Debug, Clone, Deserialize, Serialize)] +pub enum RequestInitiator { + #[serde(rename = "CUSTOMER")] + Customer, + + #[serde(rename = "LIGHTSPARK")] + Lightspark, +} + +impl From for Value { + fn from(val: RequestInitiator) -> Self { + Value::from(val.to_string()) + } +} + +impl fmt::Display for RequestInitiator { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + match self { + Self::Customer => write!(f, "CUSTOMER"), + Self::Lightspark => write!(f, "LIGHTSPARK"), + } + } +} diff --git a/lightspark/src/objects/wallet.rs b/lightspark/src/objects/wallet.rs index 6e10061..18b70c4 100644 --- a/lightspark/src/objects/wallet.rs +++ b/lightspark/src/objects/wallet.rs @@ -1217,6 +1217,7 @@ impl Wallet { id } withdrawal_request_idempotency_key: idempotency_key + withdrawal_request_initiator: initiator } } } diff --git a/lightspark/src/objects/wallet_to_payment_requests_connection.rs b/lightspark/src/objects/wallet_to_payment_requests_connection.rs index 60a3535..6b91d17 100644 --- a/lightspark/src/objects/wallet_to_payment_requests_connection.rs +++ b/lightspark/src/objects/wallet_to_payment_requests_connection.rs @@ -1,9 +1,9 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved +use crate::objects::page_info::PageInfo; use crate::objects::payment_request::PaymentRequestEnum; use serde::{Deserialize, Serialize}; use crate::objects::connection::Connection; -use crate::objects::page_info::PageInfo; use std::vec::Vec; #[derive(Debug, Clone, Deserialize, Serialize)] diff --git a/lightspark/src/objects/wallet_to_transactions_connection.rs b/lightspark/src/objects/wallet_to_transactions_connection.rs index a39e4cf..09d14b9 100644 --- a/lightspark/src/objects/wallet_to_transactions_connection.rs +++ b/lightspark/src/objects/wallet_to_transactions_connection.rs @@ -1,9 +1,9 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved +use crate::objects::page_info::PageInfo; +use crate::objects::transaction::TransactionEnum; use serde::{Deserialize, Serialize}; use crate::objects::connection::Connection; -use crate::objects::page_info::PageInfo; -use crate::objects::transaction::TransactionEnum; use std::vec::Vec; #[derive(Debug, Clone, Deserialize, Serialize)] diff --git a/lightspark/src/objects/withdrawal_request.rs b/lightspark/src/objects/withdrawal_request.rs index c4ace3c..0687677 100644 --- a/lightspark/src/objects/withdrawal_request.rs +++ b/lightspark/src/objects/withdrawal_request.rs @@ -2,6 +2,7 @@ use crate::error::Error; use crate::objects::currency_amount::CurrencyAmount; use crate::objects::entity::Entity; +use crate::objects::request_initiator::RequestInitiator; use crate::objects::withdrawal_mode::WithdrawalMode; use crate::objects::withdrawal_request_status::WithdrawalRequestStatus; use crate::objects::withdrawal_request_to_channel_closing_transactions_connection::WithdrawalRequestToChannelClosingTransactionsConnection; @@ -79,6 +80,10 @@ pub struct WithdrawalRequest { #[serde(rename = "withdrawal_request_idempotency_key")] pub idempotency_key: Option, + /// The initiator of the withdrawal. + #[serde(rename = "withdrawal_request_initiator")] + pub initiator: RequestInitiator, + /// The typename of the object #[serde(rename = "__typename")] pub typename: String, @@ -177,6 +182,7 @@ fragment WithdrawalRequestFragment on WithdrawalRequest { id } withdrawal_request_idempotency_key: idempotency_key + withdrawal_request_initiator: initiator } ";