Skip to content

Commit 7c4465d

Browse files
committed
Enable Signet
1 parent 27e6786 commit 7c4465d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+598
-192
lines changed

lightspark/src/objects/account.rs

Lines changed: 72 additions & 41 deletions
Large diffs are not rendered by default.

lightspark/src/objects/account_to_nodes_connection.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
22
use crate::objects::connection::Connection;
3+
use crate::objects::lightspark_node::LightsparkNode;
34
use crate::objects::lightspark_node::LightsparkNodeEnum;
45
use crate::objects::page_info::PageInfo;
56
use serde::{Deserialize, Serialize};

lightspark/src/objects/account_to_payment_requests_connection.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
22
use crate::objects::connection::Connection;
33
use crate::objects::page_info::PageInfo;
4+
use crate::objects::payment_request::PaymentRequest;
45
use crate::objects::payment_request::PaymentRequestEnum;
56
use serde::{Deserialize, Serialize};
67
use std::vec::Vec;

lightspark/src/objects/account_to_transactions_connection.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
use crate::objects::connection::Connection;
33
use crate::objects::currency_amount::CurrencyAmount;
44
use crate::objects::page_info::PageInfo;
5+
use crate::objects::transaction::Transaction;
56
use crate::objects::transaction::TransactionEnum;
67
use serde::{Deserialize, Serialize};
78
use std::vec::Vec;

lightspark/src/objects/bitcoin_network.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ pub enum BitcoinNetwork {
2424
Testnet,
2525
}
2626

27-
impl From<BitcoinNetwork> for Value {
28-
fn from(val: BitcoinNetwork) -> Self {
29-
Value::from(val.to_string())
27+
impl Into<Value> for BitcoinNetwork {
28+
fn into(self) -> Value {
29+
Value::from(self.to_string())
3030
}
3131
}
3232

lightspark/src/objects/channel.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,8 @@ impl Channel {
251251
variables.insert("after_date", after_date.map(|dt| dt.to_rfc3339()).into());
252252
variables.insert("before_date", before_date.map(|dt| dt.to_rfc3339()).into());
253253

254-
let value = serde_json::to_value(variables).map_err(Error::ConversionError)?;
255-
let result = requester.execute_graphql(query, Some(value)).await?;
254+
let value = serde_json::to_value(variables).map_err(|err| Error::ConversionError(err))?;
255+
let result = requester.execute_graphql(&query, Some(value)).await?;
256256
let json = result["entity"]["uptime_percentage"].clone();
257257
let result = json.as_i64();
258258
Ok(result)
@@ -305,10 +305,10 @@ impl Channel {
305305
variables.insert("after_date", after_date.map(|dt| dt.to_rfc3339()).into());
306306
variables.insert("before_date", before_date.map(|dt| dt.to_rfc3339()).into());
307307

308-
let value = serde_json::to_value(variables).map_err(Error::ConversionError)?;
309-
let result = requester.execute_graphql(query, Some(value)).await?;
308+
let value = serde_json::to_value(variables).map_err(|err| Error::ConversionError(err))?;
309+
let result = requester.execute_graphql(&query, Some(value)).await?;
310310
let json = result["entity"]["transactions"].clone();
311-
let result = serde_json::from_value(json).map_err(Error::JsonError)?;
311+
let result = serde_json::from_value(json).map_err(|err| Error::JsonError(err))?;
312312
Ok(result)
313313
}
314314
}

lightspark/src/objects/channel_status.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ pub enum ChannelStatus {
3636
Error,
3737
}
3838

39-
impl From<ChannelStatus> for Value {
40-
fn from(val: ChannelStatus) -> Self {
41-
Value::from(val.to_string())
39+
impl Into<Value> for ChannelStatus {
40+
fn into(self) -> Value {
41+
Value::from(self.to_string())
4242
}
4343
}
4444

lightspark/src/objects/compliance_provider.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ pub enum ComplianceProvider {
1010
Chainalysis,
1111
}
1212

13-
impl From<ComplianceProvider> for Value {
14-
fn from(val: ComplianceProvider) -> Self {
15-
Value::from(val.to_string())
13+
impl Into<Value> for ComplianceProvider {
14+
fn into(self) -> Value {
15+
Value::from(self.to_string())
1616
}
1717
}
1818

lightspark/src/objects/create_invoice_input.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,10 @@ pub struct CreateInvoiceInput {
1616

1717
/// The expiry of the invoice in seconds. Default value is 86400 (1 day).
1818
pub expiry_secs: Option<i64>,
19+
20+
/// The payment hash of the invoice. It should only be set if your node is a remote signing node. If not set, it will be requested through REMOTE_SIGNING webhooks with sub event type REQUEST_INVOICE_PAYMENT_HASH.
21+
pub payment_hash: Option<String>,
22+
23+
/// The 32-byte nonce used to generate the invoice preimage if applicable. It will later be included in RELEASE_PAYMENT_PREIMAGE webhook to help recover the raw preimage. This can only be specified when `payment_hash` is specified.
24+
pub preimage_nonce: Option<String>,
1925
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2+
use serde::{Deserialize, Serialize};
3+
4+
#[derive(Debug, Clone, Deserialize, Serialize)]
5+
pub struct CreateOfferInput {
6+
/// The node from which to create the offer.
7+
pub node_id: String,
8+
9+
/// The amount for which the offer should be created, in millisatoshis. Setting the amount to 0 will allow the payer to specify an amount.
10+
pub amount_msats: Option<i64>,
11+
12+
/// A short description of the offer.
13+
pub description: Option<String>,
14+
}

0 commit comments

Comments
 (0)