Oak

Check-in [8321f1314c]
Login

Check-in [8321f1314c]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:ref(deps): Bump ln-sdk and powpub dependencies
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 8321f1314cddb687c75d2bd0e9d6064302074cf086a5b94dceea475785682269
User & Date: carlos 2023-10-22 09:46:53
Context
2023-10-27
14:56
ref(deps): Cache Nostr keys to avoid async calls check-in: 2be15f5044 user: carlos tags: trunk
2023-10-22
09:46
ref(deps): Bump ln-sdk and powpub dependencies check-in: 8321f1314c user: carlos tags: trunk
2023-10-19
08:37
ref(deps): Bump ln-sdk and powpub dependencies check-in: 56e9d9ba16 user: carlos tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to Cargo.lock.

2247
2248
2249
2250
2251
2252
2253









2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264














2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289

2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
name = "lightning"
version = "0.0.116"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "90a0f2155316f1570446a0447c993480673f840748c8ed25bbc59dfc442ac770"
dependencies = [
 "bitcoin 0.29.2",
]










[[package]]
name = "lightning-invoice"
version = "0.24.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1788c0158526ec27a502043c2911ea6ea58fdc656bdf8749484942c07b790d23"
dependencies = [
 "bech32",
 "bitcoin 0.29.2",
 "bitcoin_hashes 0.11.0",
 "lightning",














 "num-traits",
 "secp256k1 0.24.3",
]

[[package]]
name = "linked-hash-map"
version = "0.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f"

[[package]]
name = "linux-raw-sys"
version = "0.4.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1a9bad9f94746442c783ca431b22403b519cd7fbeed0533fdd6328b2f2212128"

[[package]]
name = "ln-sdk"
version = "0.2.0-SNAPSHOT"
source = "git+https://oak-node.net/cgit/ln-sdk.git?rev=7c7fa4a10700d564de26d3d98515aa031f177ac1#7c7fa4a10700d564de26d3d98515aa031f177ac1"
dependencies = [
 "anyhow",
 "async-trait",
 "base64 0.20.0",
 "bech32",

 "cfg_aliases",
 "hex",
 "lightning-invoice",
 "log",
 "reqwest",
 "serde",
 "serde_json",
 "serde_with",
 "utoipa",
]







>
>
>
>
>
>
>
>
>










|
>
>
>
>
>
>
>
>
>
>
>
>
>
>



















|





>


|







2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
name = "lightning"
version = "0.0.116"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "90a0f2155316f1570446a0447c993480673f840748c8ed25bbc59dfc442ac770"
dependencies = [
 "bitcoin 0.29.2",
]

[[package]]
name = "lightning"
version = "0.0.117"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cb0cb32c79c42444453bfabed7bd4f4ef64dfdd2e35e191fa8f3b9099ad2a186"
dependencies = [
 "bitcoin 0.29.2",
]

[[package]]
name = "lightning-invoice"
version = "0.24.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1788c0158526ec27a502043c2911ea6ea58fdc656bdf8749484942c07b790d23"
dependencies = [
 "bech32",
 "bitcoin 0.29.2",
 "bitcoin_hashes 0.11.0",
 "lightning 0.0.116",
 "num-traits",
 "secp256k1 0.24.3",
]

[[package]]
name = "lightning-invoice"
version = "0.25.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6d2380d053673c467c5f0be992cd4685e40d141d075647d74b64aba1b9c0b1ae"
dependencies = [
 "bech32",
 "bitcoin 0.29.2",
 "bitcoin_hashes 0.11.0",
 "lightning 0.0.117",
 "num-traits",
 "secp256k1 0.24.3",
]

[[package]]
name = "linked-hash-map"
version = "0.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f"

[[package]]
name = "linux-raw-sys"
version = "0.4.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1a9bad9f94746442c783ca431b22403b519cd7fbeed0533fdd6328b2f2212128"

[[package]]
name = "ln-sdk"
version = "0.2.0-SNAPSHOT"
source = "git+https://oak-node.net/cgit/ln-sdk.git?rev=6147917922b4405e73d4deb69bcee721709434cb#6147917922b4405e73d4deb69bcee721709434cb"
dependencies = [
 "anyhow",
 "async-trait",
 "base64 0.20.0",
 "bech32",
 "bitcoin_hashes 0.12.0",
 "cfg_aliases",
 "hex",
 "lightning-invoice 0.24.0",
 "log",
 "reqwest",
 "serde",
 "serde_json",
 "serde_with",
 "utoipa",
]
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
 "base64 0.20.0",
 "chrono",
 "deltachat",
 "futures-lite",
 "futures-util",
 "hex",
 "itertools 0.11.0",
 "lightning-invoice",
 "ln-sdk",
 "log",
 "log4rs",
 "mockall",
 "nostr",
 "nostr-sdk",
 "powpub",







|







2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
 "base64 0.20.0",
 "chrono",
 "deltachat",
 "futures-lite",
 "futures-util",
 "hex",
 "itertools 0.11.0",
 "lightning-invoice 0.25.0",
 "ln-sdk",
 "log",
 "log4rs",
 "mockall",
 "nostr",
 "nostr-sdk",
 "powpub",
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
 "flate2",
 "miniz_oxide",
]

[[package]]
name = "powpub"
version = "0.1.4-SNAPSHOT"
source = "git+https://oak-node.net/cgit/powpub.git?rev=bce7286270055ec85ff77cac19cd3df36228782a#bce7286270055ec85ff77cac19cd3df36228782a"
dependencies = [
 "anyhow",
 "async-trait",
 "base64 0.20.0",
 "bech32",
 "cfg_aliases",
 "env_logger",
 "figment",
 "futures-util",
 "hex",
 "lightning-invoice",
 "ln-sdk",
 "log",
 "nostr",
 "nostr-sdk",
 "rayon",
 "reqwest",
 "serde",







|










|







3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
 "flate2",
 "miniz_oxide",
]

[[package]]
name = "powpub"
version = "0.1.4-SNAPSHOT"
source = "git+https://oak-node.net/cgit/powpub.git?rev=cb9a9662810ccc43270a194bd6c4e579197e3879#cb9a9662810ccc43270a194bd6c4e579197e3879"
dependencies = [
 "anyhow",
 "async-trait",
 "base64 0.20.0",
 "bech32",
 "cfg_aliases",
 "env_logger",
 "figment",
 "futures-util",
 "hex",
 "lightning-invoice 0.24.0",
 "ln-sdk",
 "log",
 "nostr",
 "nostr-sdk",
 "rayon",
 "reqwest",
 "serde",

Changes to Cargo.toml.

10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
chrono = { version = "*", default-features = false }
deltachat = { git = "https://github.com/deltachat/deltachat-core-rust", tag="1.108.0"}
futures-lite = "*"
futures-util = "*"
hex = "*"
itertools = "*"
lightning-invoice = "*"
ln-sdk = { git = "https://oak-node.net/cgit/ln-sdk.git", rev = "7c7fa4a10700d564de26d3d98515aa031f177ac1", features = [ "client-lnd", "utoipa" ] }
log = "*"
log4rs = "*"
qrcode-generator = "*"
nostr = { git = "https://github.com/rust-nostr/nostr", default-features = false, features = ["nip04", "nip05", "nip47"], tag = "v0.24.0" }
nostr-sdk = { git = "https://github.com/rust-nostr/nostr", default-features = false, tag = "v0.24.0" }
powpub = { git = "https://oak-node.net/cgit/powpub.git", rev = "bce7286270055ec85ff77cac19cd3df36228782a", features = [ "client-lnd", "utoipa" ] }
reqwest = { version = "*", default-features = false, features = ["json", "native-tls", "socks"] }
rocket = { version = "0.5.0-rc.3", features = ["json"] }
rocket_db_pools = { version = "0.1.0-rc.3", features = ["sqlx_sqlite"] }
rocket_dyn_templates = { version = "0.1.0-rc.3", features = ["tera"] }
serde = "*"
serde_json = "*"
serde_with = "*"







|





|







10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
chrono = { version = "*", default-features = false }
deltachat = { git = "https://github.com/deltachat/deltachat-core-rust", tag="1.108.0"}
futures-lite = "*"
futures-util = "*"
hex = "*"
itertools = "*"
lightning-invoice = "*"
ln-sdk = { git = "https://oak-node.net/cgit/ln-sdk.git", rev = "6147917922b4405e73d4deb69bcee721709434cb", features = [ "client-lnd", "utoipa" ] }
log = "*"
log4rs = "*"
qrcode-generator = "*"
nostr = { git = "https://github.com/rust-nostr/nostr", default-features = false, features = ["nip04", "nip05", "nip47"], tag = "v0.24.0" }
nostr-sdk = { git = "https://github.com/rust-nostr/nostr", default-features = false, tag = "v0.24.0" }
powpub = { git = "https://oak-node.net/cgit/powpub.git", rev = "cb9a9662810ccc43270a194bd6c4e579197e3879", features = [ "client-lnd", "utoipa" ] }
reqwest = { version = "*", default-features = false, features = ["json", "native-tls", "socks"] }
rocket = { version = "0.5.0-rc.3", features = ["json"] }
rocket_db_pools = { version = "0.1.0-rc.3", features = ["sqlx_sqlite"] }
rocket_dyn_templates = { version = "0.1.0-rc.3", features = ["tera"] }
serde = "*"
serde_json = "*"
serde_with = "*"

Changes to src/bot/ons/nip47.rs.

174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
                    let req = Request::from_json(&decrypted)?;
                    match (req.method, req.params) {
                        (
                            Method::PayInvoice,
                            RequestParams::PayInvoice(PayInvoiceRequestParams { invoice }),
                        ) => {
                            let resp = match lnd_client.pay(&invoice).await {
                                Ok(preimage_base64) => {
                                    let preimage_decoded = base64::decode(preimage_base64)?;
                                    let preimage = hex::encode(preimage_decoded);

                                    let invoice_parsed = invoice.parse::<Bolt11Invoice>()?;

                                    info!("Payment was successful, amt={:?} msat, preimage: {preimage}",
                                            invoice_parsed.amount_milli_satoshis(),
                                        );
                                    Response {
                                        result_type: Method::PayInvoice,







|
<
|
<







174
175
176
177
178
179
180
181

182

183
184
185
186
187
188
189
                    let req = Request::from_json(&decrypted)?;
                    match (req.method, req.params) {
                        (
                            Method::PayInvoice,
                            RequestParams::PayInvoice(PayInvoiceRequestParams { invoice }),
                        ) => {
                            let resp = match lnd_client.pay(&invoice).await {
                                Ok(preimage_as_hash) => {

                                    let preimage = preimage_as_hash.to_string();

                                    let invoice_parsed = invoice.parse::<Bolt11Invoice>()?;

                                    info!("Payment was successful, amt={:?} msat, preimage: {preimage}",
                                            invoice_parsed.amount_milli_satoshis(),
                                        );
                                    Response {
                                        result_type: Method::PayInvoice,