From b9dd7890a486d82177abf4037552f121a99db2bb Mon Sep 17 00:00:00 2001 From: benthecarman Date: Fri, 22 Mar 2024 12:44:58 -0500 Subject: [PATCH 01/10] Update to 0.3.0-rc.1 --- Cargo.lock | 636 ++++++++++++++++++++++++++++++------------------ Cargo.toml | 17 +- src/invoice.rs | 22 +- src/lnurlp.rs | 10 +- src/main.rs | 7 +- src/mint.rs | 8 +- src/register.rs | 6 +- 7 files changed, 432 insertions(+), 274 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 587ca83..3198fa6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -34,6 +34,18 @@ version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8fd72866655d1904d6b0997d0b07ba561047d070fbe29de039031c641b61217" +[[package]] +name = "ahash" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + [[package]] name = "aho-corasick" version = "1.1.2" @@ -43,6 +55,12 @@ dependencies = [ "memchr", ] +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + [[package]] name = "android-tzdata" version = "0.1.1" @@ -60,22 +78,22 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.80" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ad32ce52e4161730f7098c077cd2ed6229b5804ccf99e5366be1ab72a98b4e1" +checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247" [[package]] name = "aquamarine" -version = "0.3.3" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1da02abba9f9063d786eab1509833ebb2fac0f966862ca59439c76b9c566760" +checksum = "21cc1548309245035eb18aa7f0967da6bc65587005170c56e6ef2788a4cf3f4e" dependencies = [ "include_dir", "itertools 0.10.5", "proc-macro-error", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.50", ] [[package]] @@ -108,11 +126,13 @@ dependencies = [ [[package]] name = "async-lock" -version = "2.8.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" +checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" dependencies = [ "event-listener", + "event-listener-strategy", + "pin-project-lite", ] [[package]] @@ -166,7 +186,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3716c0d3970fe92d79a8f4cda2caf91113574505dff5b18e455e549d4b078e98" dependencies = [ "futures-util", - "gloo-timers", + "gloo-timers 0.2.6", "tokio", "wasm-bindgen-futures", ] @@ -272,15 +292,15 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.20.0" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ea22880d78093b0cbe17c89f64a7d457941e65759157ec6cb31a31d652b05e5" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "base64" -version = "0.21.7" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +checksum = "9475866fec1451be56a3c2400fd081ff546538961565ccb5b7142cbd22bc7a51" [[package]] name = "base64-compat" @@ -336,17 +356,16 @@ dependencies = [ [[package]] name = "bindgen" -version = "0.65.1" +version = "0.69.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfdf7b466f9a4903edc73f95d6d2bcd5baf8ae620638762244d3f60143643cc5" +checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.2", "cexpr", "clang-sys", + "itertools 0.10.5", "lazy_static", "lazycell", - "peeking_take_while", - "prettyplease", "proc-macro2", "quote", "regex", @@ -472,6 +491,12 @@ version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" +[[package]] +name = "bitmaps" +version = "3.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d084b0137aaa901caf9f1e8b21daa6aa24d41cd806e111335541eff9683bd6" + [[package]] name = "bitvec" version = "1.0.1" @@ -501,13 +526,13 @@ dependencies = [ "async-trait", "axum", "base64 0.13.1", - "bls12_381", "chrono", "diesel", "dotenv", "fedimint-client", "fedimint-core", "fedimint-ln-client", + "fedimint-ln-common", "fedimint-mint-client", "fedimint-tbs", "fedimint-wallet-client", @@ -516,7 +541,6 @@ dependencies = [ "itertools 0.12.1", "jwt-compact", "lazy-regex", - "lightning-invoice 0.27.0", "log", "mockall", "mockito", @@ -768,6 +792,15 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "concurrent-queue" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d16048cd947b08fa32c24458a22f5dc5e835264f689f4f5653210c69fd107363" +dependencies = [ + "crossbeam-utils", +] + [[package]] name = "core-foundation" version = "0.9.4" @@ -843,6 +876,41 @@ dependencies = [ "typenum", ] +[[package]] +name = "darling" +version = "0.20.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54e36fcd13ed84ffdfda6f5be89b31287cbb80c439841fe69e04841435464391" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c2cf1c23a687a1feeb728783b993c4e1ad83d99f351801977dd809b48d0a70f" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.50", +] + +[[package]] +name = "darling_macro" +version = "0.20.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" +dependencies = [ + "darling_core", + "quote", + "syn 2.0.50", +] + [[package]] name = "data-encoding" version = "2.5.0" @@ -963,9 +1031,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "erased-serde" -version = "0.3.31" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c138974f9d5e7fe373eb04df7cae98833802ae4b11c24ac7039a21d5af4b26c" +checksum = "2b73807008a3c7f171cc40312f37d95ef0396e048b5848d775f54b1a4dd4a0d3" dependencies = [ "serde", ] @@ -994,27 +1062,35 @@ dependencies = [ [[package]] name = "event-listener" -version = "2.5.3" +version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" +checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] [[package]] -name = "fastrand" -version = "2.0.1" +name = "event-listener-strategy" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" +checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" +dependencies = [ + "event-listener", + "pin-project-lite", +] [[package]] -name = "fedimint" -version = "0.0.1" +name = "fastrand" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d79878f18e518d77cfb3126939d0e63a62cad845d51a3266f4ac866f2efe57f" +checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" [[package]] name = "fedimint-aead" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6258d6dbd7b7f5dc1d62f26e64d47692c495d24c17c7b113b01e0a40ef5d6235" +version = "0.3.0-rc.1" +source = "git+https://github.com/fedimint/fedimint?tag=v0.3.0-rc.1#c51ea0c85576008dcbf9d94e2fe994dfa34bca61" dependencies = [ "anyhow", "argon2", @@ -1025,9 +1101,8 @@ dependencies = [ [[package]] name = "fedimint-bitcoind" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a746535346df82a3c6e8646364dec07112fe64bb7c2491bd5c3b0830c082e16" +version = "0.3.0-rc.1" +source = "git+https://github.com/fedimint/fedimint?tag=v0.3.0-rc.1#c51ea0c85576008dcbf9d94e2fe994dfa34bca61" dependencies = [ "anyhow", "async-trait", @@ -1040,24 +1115,23 @@ dependencies = [ "lazy_static", "rand", "serde", + "serde_json", "tracing", "url", ] [[package]] name = "fedimint-build" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48daee360af91937bf9f6c35e6da164d8574eb934d14b47f92668223b74cf995" +version = "0.3.0-rc.1" +source = "git+https://github.com/fedimint/fedimint?tag=v0.3.0-rc.1#c51ea0c85576008dcbf9d94e2fe994dfa34bca61" dependencies = [ "serde_json", ] [[package]] name = "fedimint-client" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0e9c9046e3de54424108deefbd3501a92a48d2bc22f1af3d05242f29f5b7c31" +version = "0.3.0-rc.1" +source = "git+https://github.com/fedimint/fedimint?tag=v0.3.0-rc.1#c51ea0c85576008dcbf9d94e2fe994dfa34bca61" dependencies = [ "anyhow", "aquamarine", @@ -1071,7 +1145,7 @@ dependencies = [ "fedimint-derive-secret", "fedimint-logging", "futures", - "itertools 0.10.5", + "itertools 0.12.1", "rand", "ring 0.17.8", "secp256k1-zkp", @@ -1081,14 +1155,14 @@ dependencies = [ "strum_macros", "thiserror", "tokio", + "tokio-stream", "tracing", ] [[package]] name = "fedimint-core" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1397d89ac6951d49920001fd14b280b33a78de380e0d0db442021b00ca366e6" +version = "0.3.0-rc.1" +source = "git+https://github.com/fedimint/fedimint?tag=v0.3.0-rc.1#c51ea0c85576008dcbf9d94e2fe994dfa34bca61" dependencies = [ "anyhow", "async-lock", @@ -1108,18 +1182,20 @@ dependencies = [ "fedimint-threshold-crypto", "futures", "getrandom", - "gloo-timers", + "gloo-timers 0.3.0", "hex", - "itertools 0.10.5", + "imbl", + "itertools 0.12.1", "js-sys", "jsonrpsee-core", "jsonrpsee-types", "jsonrpsee-wasm-client", "jsonrpsee-ws-client", - "lightning 0.0.118", - "lightning-invoice 0.26.0", + "lightning", + "lightning-invoice", + "lru", "macro_rules_attribute", - "miniscript", + "miniscript 10.0.0", "parity-scale-codec", "rand", "secp256k1-zkp", @@ -1138,21 +1214,19 @@ dependencies = [ [[package]] name = "fedimint-derive" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7490ad865cb9d8a3b5d24e0d38578df143fbe167f6cc80669a3bc7d5bc5b36d0" +version = "0.3.0-rc.1" +source = "git+https://github.com/fedimint/fedimint?tag=v0.3.0-rc.1#c51ea0c85576008dcbf9d94e2fe994dfa34bca61" dependencies = [ - "itertools 0.11.0", + "itertools 0.12.1", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.50", ] [[package]] name = "fedimint-derive-secret" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faacc99cbacf014e999865150f82d43808c26ac6dd07725a1d22406dce4f7b3a" +version = "0.3.0-rc.1" +source = "git+https://github.com/fedimint/fedimint?tag=v0.3.0-rc.1#c51ea0c85576008dcbf9d94e2fe994dfa34bca61" dependencies = [ "anyhow", "fedimint-core", @@ -1164,18 +1238,16 @@ dependencies = [ [[package]] name = "fedimint-hkdf" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da421d229333ce5c80bf6403165a1afe831556145a3983ac3eecbce4f1a79132" +version = "0.3.0-rc.1" +source = "git+https://github.com/fedimint/fedimint?tag=v0.3.0-rc.1#c51ea0c85576008dcbf9d94e2fe994dfa34bca61" dependencies = [ "bitcoin_hashes 0.11.0", ] [[package]] name = "fedimint-ln-client" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f00f779dbc9b27274e166d4b0f790bf44bb9d3483db72f5c629e596d8218e2c9" +version = "0.3.0-rc.1" +source = "git+https://github.com/fedimint/fedimint?tag=v0.3.0-rc.1#c51ea0c85576008dcbf9d94e2fe994dfa34bca61" dependencies = [ "anyhow", "aquamarine", @@ -1190,8 +1262,8 @@ dependencies = [ "fedimint-ln-common", "fedimint-threshold-crypto", "futures", - "itertools 0.10.5", - "lightning-invoice 0.26.0", + "itertools 0.12.1", + "lightning-invoice", "rand", "reqwest", "secp256k1 0.24.3", @@ -1208,9 +1280,8 @@ dependencies = [ [[package]] name = "fedimint-ln-common" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b56e00695812c1b300d9a97ea58edb2a8fde1f9f4b9771085de8f2eead30e3d4" +version = "0.3.0-rc.1" +source = "git+https://github.com/fedimint/fedimint?tag=v0.3.0-rc.1#c51ea0c85576008dcbf9d94e2fe994dfa34bca61" dependencies = [ "anyhow", "aquamarine", @@ -1222,9 +1293,9 @@ dependencies = [ "fedimint-core", "fedimint-threshold-crypto", "futures", - "itertools 0.10.5", - "lightning 0.0.118", - "lightning-invoice 0.26.0", + "itertools 0.12.1", + "lightning", + "lightning-invoice", "rand", "secp256k1 0.24.3", "serde", @@ -1239,9 +1310,8 @@ dependencies = [ [[package]] name = "fedimint-logging" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14549cd81f904053dd43eeedc2c021c1f660f6d46257f8286b9d5d8c425bdb5e" +version = "0.3.0-rc.1" +source = "git+https://github.com/fedimint/fedimint?tag=v0.3.0-rc.1#c51ea0c85576008dcbf9d94e2fe994dfa34bca61" dependencies = [ "anyhow", "tracing-subscriber", @@ -1249,15 +1319,14 @@ dependencies = [ [[package]] name = "fedimint-mint-client" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee3945f8d4d9c807672ee10b8db4998e0718bcf9dfaa277755f8d03cc9cfc561" +version = "0.3.0-rc.1" +source = "git+https://github.com/fedimint/fedimint?tag=v0.3.0-rc.1#c51ea0c85576008dcbf9d94e2fe994dfa34bca61" dependencies = [ "anyhow", "aquamarine", "async-stream", "async-trait", - "base64 0.20.0", + "base64 0.22.0", "bincode", "bitcoin_hashes 0.11.0", "erased-serde", @@ -1269,7 +1338,7 @@ dependencies = [ "fedimint-tbs", "fedimint-threshold-crypto", "futures", - "itertools 0.10.5", + "itertools 0.12.1", "rand", "secp256k1 0.24.3", "secp256k1-zkp", @@ -1285,9 +1354,8 @@ dependencies = [ [[package]] name = "fedimint-mint-common" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d21c16ea6bec68e01fd8fa7a1d3526121c9679bc8fc83fd9d29b977cc447af4" +version = "0.3.0-rc.1" +source = "git+https://github.com/fedimint/fedimint?tag=v0.3.0-rc.1#c51ea0c85576008dcbf9d94e2fe994dfa34bca61" dependencies = [ "anyhow", "async-trait", @@ -1297,7 +1365,7 @@ dependencies = [ "fedimint-tbs", "fedimint-threshold-crypto", "futures", - "itertools 0.10.5", + "itertools 0.12.1", "rand", "secp256k1 0.24.3", "secp256k1-zkp", @@ -1310,9 +1378,8 @@ dependencies = [ [[package]] name = "fedimint-rocksdb" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e13f4613c2eba7cc6a371d37ab0d869d6e2ba6496882f8502cb00c3c3d57627" +version = "0.3.0-rc.1" +source = "git+https://github.com/fedimint/fedimint?tag=v0.3.0-rc.1#c51ea0c85576008dcbf9d94e2fe994dfa34bca61" dependencies = [ "anyhow", "async-trait", @@ -1325,9 +1392,8 @@ dependencies = [ [[package]] name = "fedimint-tbs" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9cfde5114fb8ccb2abc1b0a4807e5af9fa03027a54d75209cb301edd77c29cd" +version = "0.3.0-rc.1" +source = "git+https://github.com/fedimint/fedimint?tag=v0.3.0-rc.1#c51ea0c85576008dcbf9d94e2fe994dfa34bca61" dependencies = [ "bitcoin_hashes 0.11.0", "bls12_381", @@ -1363,9 +1429,8 @@ dependencies = [ [[package]] name = "fedimint-wallet-client" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69a4bafd7b495455f3c2fb4324fe4f7c15cf43ec01f9ce319805dc0af2708dac" +version = "0.3.0-rc.1" +source = "git+https://github.com/fedimint/fedimint?tag=v0.3.0-rc.1#c51ea0c85576008dcbf9d94e2fe994dfa34bca61" dependencies = [ "anyhow", "aquamarine", @@ -1379,7 +1444,7 @@ dependencies = [ "fedimint-wallet-common", "futures", "impl-tools", - "miniscript", + "miniscript 10.0.0", "rand", "secp256k1 0.24.3", "serde", @@ -1395,9 +1460,8 @@ dependencies = [ [[package]] name = "fedimint-wallet-common" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27dc03be27d18fdb4e444b4801267cc219b5eccd5e0ef3521faa42a508b0f341" +version = "0.3.0-rc.1" +source = "git+https://github.com/fedimint/fedimint?tag=v0.3.0-rc.1#c51ea0c85576008dcbf9d94e2fe994dfa34bca61" dependencies = [ "anyhow", "async-trait", @@ -1406,7 +1470,8 @@ dependencies = [ "fedimint-core", "futures", "impl-tools", - "miniscript", + "miniscript 10.0.0", + "miniscript 9.0.2", "rand", "secp256k1 0.24.3", "serde", @@ -1557,7 +1622,7 @@ version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" dependencies = [ - "gloo-timers", + "gloo-timers 0.2.6", "send_wrapper 0.4.0", ] @@ -1616,9 +1681,9 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "gloo-net" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ac9e8288ae2c632fa9f8657ac70bfe38a1530f345282d7ba66a1f70b72b7dc4" +checksum = "43aaa242d1239a8822c15c645f02166398da4f8b5c4bae795c1f5b44e9eee173" dependencies = [ "futures-channel", "futures-core", @@ -1647,6 +1712,18 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "gloo-timers" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbb143cf96099802033e0d4f4963b19fd2e0b728bcf076cd9cf7f6634f092994" +dependencies = [ + "futures-channel", + "futures-core", + "js-sys", + "wasm-bindgen", +] + [[package]] name = "gloo-utils" version = "0.2.0" @@ -1706,7 +1783,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e91b62f79061a0bc2e046024cb7ba44b08419ed238ecbd9adbd787434b9e8c25" dependencies = [ - "ahash", + "ahash 0.3.8", "autocfg", ] @@ -1721,6 +1798,10 @@ name = "hashbrown" version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +dependencies = [ + "ahash 0.8.11", + "allocator-api2", +] [[package]] name = "headers" @@ -1924,14 +2005,10 @@ dependencies = [ ] [[package]] -name = "idna" -version = "0.4.0" +name = "ident_case" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" @@ -1944,33 +2021,49 @@ dependencies = [ ] [[package]] -name = "if_chain" -version = "1.0.2" +name = "imbl" +version = "2.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "978d142c8028edf52095703af2fad11d6f611af1246685725d6b850634647085" +dependencies = [ + "bitmaps", + "imbl-sized-chunks", + "rand_core", + "rand_xoshiro", + "version_check", +] + +[[package]] +name = "imbl-sized-chunks" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb56e1aa765b4b4f3aadfab769793b7087bb03a4ea4920644a6d238e2df5b9ed" +checksum = "144006fb58ed787dcae3f54575ff4349755b00ccc99f4b4873860b654be1ed63" +dependencies = [ + "bitmaps", +] [[package]] name = "impl-tools" -version = "0.8.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bde75c0fa563af28932bd7317eaa58186d4d29043858f5f3a8c199076c06da7" +checksum = "d82c305b1081f1a99fda262883c788e50ab57d36c00830bdd7e0a82894ad965c" dependencies = [ "autocfg", "impl-tools-lib", "proc-macro-error", - "syn 1.0.109", + "syn 2.0.50", ] [[package]] name = "impl-tools-lib" -version = "0.8.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ffdf3b0bdfaa18798f4df71bc965704f63fba521b24d425cd61fb2bc771a77b" +checksum = "85d3946d886eaab0702fa0c6585adcced581513223fa9df7ccfabbd9fa331a88" dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.50", ] [[package]] @@ -2071,15 +2164,6 @@ dependencies = [ "either", ] -[[package]] -name = "itertools" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" -dependencies = [ - "either", -] - [[package]] name = "itertools" version = "0.12.1" @@ -2106,9 +2190,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.68" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "406cda4b368d531c842222cf9d2600a9a4acce8d29423695379c6868a143a9ee" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ "wasm-bindgen", ] @@ -2127,9 +2211,9 @@ dependencies = [ [[package]] name = "jsonrpsee-client-transport" -version = "0.20.3" +version = "0.22.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b005c793122d03217da09af68ba9383363caa950b90d3436106df8cabce935" +checksum = "9ab2e14e727d2faf388c99d9ca5210566ed3b044f07d92c29c3611718d178380" dependencies = [ "futures-channel", "futures-util", @@ -2137,21 +2221,22 @@ dependencies = [ "http", "jsonrpsee-core", "pin-project", + "rustls-pki-types", "soketto", "thiserror", "tokio", - "tokio-rustls 0.24.1", + "tokio-rustls 0.25.0", "tokio-util", "tracing", "url", - "webpki-roots", + "webpki-roots 0.26.1", ] [[package]] name = "jsonrpsee-core" -version = "0.20.3" +version = "0.22.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da2327ba8df2fdbd5e897e2b5ed25ce7f299d345b9736b6828814c3dbd1fd47b" +checksum = "71962a1c49af43adf81d337e4ebc93f3c915faf6eccaa14d74e255107dfd7723" dependencies = [ "anyhow", "async-lock", @@ -2160,34 +2245,35 @@ dependencies = [ "futures-timer", "futures-util", "jsonrpsee-types", + "pin-project", "rustc-hash", "serde", "serde_json", "thiserror", "tokio", + "tokio-stream", "tracing", "wasm-bindgen-futures", ] [[package]] name = "jsonrpsee-types" -version = "0.20.3" +version = "0.22.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5be0be325642e850ed0bdff426674d2e66b2b7117c9be23a7caef68a2902b7d9" +checksum = "1e53c72de6cd2ad6ac1aa6e848206ef8b736f92ed02354959130373dfa5b3cbd" dependencies = [ "anyhow", "beef", "serde", "serde_json", "thiserror", - "tracing", ] [[package]] name = "jsonrpsee-wasm-client" -version = "0.20.3" +version = "0.22.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c7cbb3447cf14fd4d2f407c3cc96e6c9634d5440aa1fbed868a31f3c02b27f0" +checksum = "8ae2c3f2411052b4a831cb7a34cd1498e0d8b9309bd49fca67567634ff64023d" dependencies = [ "jsonrpsee-client-transport", "jsonrpsee-core", @@ -2196,9 +2282,9 @@ dependencies = [ [[package]] name = "jsonrpsee-ws-client" -version = "0.20.3" +version = "0.22.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bca9cb3933ccae417eb6b08c3448eb1cb46e39834e5b503e395e5e5bd08546c0" +checksum = "c8a07ab8da9a283b906f6735ddd17d3680158bb72259e853441d1dd0167079ec" dependencies = [ "http", "jsonrpsee-client-transport", @@ -2297,9 +2383,9 @@ checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" [[package]] name = "librocksdb-sys" -version = "0.11.0+8.1.1" +version = "0.16.0+8.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3386f101bcb4bd252d8e9d2fb41ec3b0862a15a62b478c355b2982efa469e3e" +checksum = "ce3d60bc059831dc1c83903fb45c103f75db65c5a7bf22272764d9cc683e348c" dependencies = [ "bindgen", "bzip2-sys", @@ -2333,16 +2419,6 @@ dependencies = [ "hashbrown 0.8.2", ] -[[package]] -name = "lightning" -version = "0.0.119" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32899363dc48d297838ce1264c4bb6867ede6ec11f06f3b9823f3ff403f1ccc2" -dependencies = [ - "bitcoin 0.30.2", - "hex-conservative", -] - [[package]] name = "lightning-invoice" version = "0.26.0" @@ -2352,25 +2428,12 @@ dependencies = [ "bech32", "bitcoin 0.29.2", "bitcoin_hashes 0.11.0", - "lightning 0.0.118", + "lightning", "num-traits", "secp256k1 0.24.3", "serde", ] -[[package]] -name = "lightning-invoice" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd3421ccfaeac77763114f68f3fc5308f11a0e8a880618b4f84d1d22493aa465" -dependencies = [ - "bech32", - "bitcoin 0.30.2", - "lightning 0.0.119", - "num-traits", - "secp256k1 0.27.0", -] - [[package]] name = "linux-raw-sys" version = "0.4.13" @@ -2393,6 +2456,15 @@ version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +[[package]] +name = "lru" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3262e75e648fce39813cb56ac41f3c3e3f65217ebf3844d818d1f9398cfb0dc" +dependencies = [ + "hashbrown 0.14.3", +] + [[package]] name = "lz4-sys" version = "1.9.4" @@ -2405,9 +2477,9 @@ dependencies = [ [[package]] name = "macro_rules_attribute" -version = "0.1.3" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf0c9b980bf4f3a37fd7b1c066941dd1b1d0152ce6ee6e8fe8c49b9f6810d862" +checksum = "8a82271f7bc033d84bbca59a3ce3e4159938cb08a9c3aebbe54d215131518a13" dependencies = [ "macro_rules_attribute-proc_macro", "paste", @@ -2415,9 +2487,9 @@ dependencies = [ [[package]] name = "macro_rules_attribute-proc_macro" -version = "0.1.3" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58093314a45e00c77d5c508f76e77c3396afbbc0d01506e7fae47b018bac2b1d" +checksum = "b8dd856d451cc0da70e2ef2ce95a18e39a93b7558bedf10201ad28503f918568" [[package]] name = "matchers" @@ -2459,6 +2531,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5b106477a0709e2da253e5559ba4ab20a272f8577f1eefff72f3a905b5d35f5" dependencies = [ "bitcoin 0.29.2", +] + +[[package]] +name = "miniscript" +version = "10.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1eb102b66b2127a872dbcc73095b7b47aeb9d92f7b03c2b2298253ffc82c7594" +dependencies = [ + "bitcoin 0.30.2", + "bitcoin-private", "serde", ] @@ -2530,11 +2612,10 @@ dependencies = [ [[package]] name = "multimint" -version = "0.1.7" -source = "git+https://github.com/Kodylow/multimint?rev=00df9d34f0244d0200eee4d285094b22b34cf38b#00df9d34f0244d0200eee4d285094b22b34cf38b" +version = "0.1.12" +source = "git+https://github.com/fedimint/fedimint-clientd?rev=bb4f9c1bcc82b317329ffd32f7957ab66fc6516b#bb4f9c1bcc82b317329ffd32f7957ab66fc6516b" dependencies = [ "anyhow", - "fedimint", "fedimint-client", "fedimint-core", "fedimint-ln-client", @@ -2542,6 +2623,7 @@ dependencies = [ "fedimint-rocksdb", "fedimint-wallet-client", "futures-util", + "hex", "rand", "serde", "serde_json", @@ -2666,7 +2748,7 @@ dependencies = [ "tokio-tungstenite", "url-fork", "wasm-ws", - "webpki-roots", + "webpki-roots 0.25.4", ] [[package]] @@ -2830,6 +2912,12 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "parking" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" + [[package]] name = "parking_lot" version = "0.12.1" @@ -2870,12 +2958,6 @@ version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" -[[package]] -name = "peeking_take_while" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" - [[package]] name = "percent-encoding" version = "2.3.1" @@ -2985,16 +3067,6 @@ dependencies = [ "log", ] -[[package]] -name = "prettyplease" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a41cf62165e97c7f814d2221421dbb9afcbcdb0a88068e5ea206e19951c2cbb5" -dependencies = [ - "proc-macro2", - "syn 2.0.50", -] - [[package]] name = "proc-macro-crate" version = "2.0.2" @@ -3094,6 +3166,15 @@ dependencies = [ "getrandom", ] +[[package]] +name = "rand_xoshiro" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f97cdb2a36ed4183de61b2f824cc45c9f1037f28afe0a322e9fff4c108b5aaa" +dependencies = [ + "rand_core", +] + [[package]] name = "rayon" version = "1.8.1" @@ -3169,9 +3250,9 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "reqwest" -version = "0.11.24" +version = "0.11.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6920094eb85afde5e4a138be3f2de8bbdf28000f0029e72c45025a56b042251" +checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" dependencies = [ "base64 0.21.7", "bytes", @@ -3208,7 +3289,7 @@ dependencies = [ "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "webpki-roots", + "webpki-roots 0.25.4", "winreg", ] @@ -3244,9 +3325,9 @@ dependencies = [ [[package]] name = "rocksdb" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb6f170a4041d50a0ce04b0d2e14916d6ca863ea2e422689a5b694395d299ffe" +checksum = "6bd13e55d6d7b8cd0ea569161127567cd587676c99f4472f779a0279aa60a7a7" dependencies = [ "libc", "librocksdb-sys", @@ -3306,10 +3387,24 @@ checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" dependencies = [ "log", "ring 0.17.8", - "rustls-webpki", + "rustls-webpki 0.101.7", "sct", ] +[[package]] +name = "rustls" +version = "0.22.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e87c9956bd9807afa1f77e0f7594af32566e830e088a5576d27c5b6f30f49d41" +dependencies = [ + "log", + "ring 0.17.8", + "rustls-pki-types", + "rustls-webpki 0.102.2", + "subtle", + "zeroize", +] + [[package]] name = "rustls-pemfile" version = "1.0.4" @@ -3319,6 +3414,12 @@ dependencies = [ "base64 0.21.7", ] +[[package]] +name = "rustls-pki-types" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ede67b28608b4c60685c7d54122d4400d90f62b40caee7700e700380a390fa8" + [[package]] name = "rustls-webpki" version = "0.101.7" @@ -3329,6 +3430,17 @@ dependencies = [ "untrusted 0.9.0", ] +[[package]] +name = "rustls-webpki" +version = "0.102.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "faaa0a62740bedb9b2ef5afa303da42764c012f743917351dc9a237ea1663610" +dependencies = [ + "ring 0.17.8", + "rustls-pki-types", + "untrusted 0.9.0", +] + [[package]] name = "rustversion" version = "1.0.14" @@ -3696,21 +3808,21 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "strum" -version = "0.24.1" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" +checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29" [[package]] name = "strum_macros" -version = "0.24.3" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" +checksum = "c6cf59daf282c0a494ba14fd21610a0325f9f90ec9d1231dea26bcb1d696c946" dependencies = [ "heck", "proc-macro2", "quote", "rustversion", - "syn 1.0.109", + "syn 2.0.50", ] [[package]] @@ -3809,18 +3921,18 @@ checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" [[package]] name = "thiserror" -version = "1.0.57" +version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" +checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.57" +version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" +checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" dependencies = [ "proc-macro2", "quote", @@ -3923,6 +4035,17 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio-rustls" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" +dependencies = [ + "rustls 0.22.2", + "rustls-pki-types", + "tokio", +] + [[package]] name = "tokio-socks" version = "0.5.1" @@ -3935,6 +4058,18 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio-stream" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", + "tokio-util", +] + [[package]] name = "tokio-tungstenite" version = "0.20.1" @@ -3947,7 +4082,7 @@ dependencies = [ "tokio", "tokio-rustls 0.24.1", "tungstenite", - "webpki-roots", + "webpki-roots 0.25.4", ] [[package]] @@ -4162,7 +4297,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" dependencies = [ "form_urlencoded", - "idna 0.5.0", + "idna", "percent-encoding", "serde", ] @@ -4174,7 +4309,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7fa3323c39b8e786154d3000b70ae9af0e9bd746c9791456da0d4a1f68ad89d6" dependencies = [ "form_urlencoded", - "idna 0.5.0", + "idna", "percent-encoding", "serde", ] @@ -4187,12 +4322,12 @@ checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" [[package]] name = "validator" -version = "0.16.1" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b92f40481c04ff1f4f61f304d61793c7b56ff76ac1469f1beb199b1445b253bd" +checksum = "da339118f018cc70ebf01fafc103360528aad53717e4bf311db929cb01cb9345" dependencies = [ - "idna 0.4.0", - "lazy_static", + "idna", + "once_cell", "regex", "serde", "serde_derive", @@ -4203,28 +4338,16 @@ dependencies = [ [[package]] name = "validator_derive" -version = "0.16.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc44ca3088bb3ba384d9aecf40c6a23a676ce23e09bdaca2073d99c207f864af" +checksum = "76e88ea23b8f5e59230bff8a2f03c0ee0054a61d5b8343a38946bcd406fe624c" dependencies = [ - "if_chain", - "lazy_static", + "darling", "proc-macro-error", "proc-macro2", "quote", "regex", - "syn 1.0.109", - "validator_types", -] - -[[package]] -name = "validator_types" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "111abfe30072511849c5910134e8baf8dc05de4c0e5903d681cbd5c9c4d611e3" -dependencies = [ - "proc-macro2", - "syn 1.0.109", + "syn 2.0.50", ] [[package]] @@ -4262,9 +4385,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1e124130aee3fb58c5bdd6b639a0509486b0338acaaae0c84a5124b0f588b7f" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -4272,9 +4395,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9e7e1900c352b609c8488ad12639a311045f40a35491fb69ba8c12f758af70b" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", "log", @@ -4287,9 +4410,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.41" +version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877b9c3f61ceea0e56331985743b13f3d25c406a7098d45180fb5f09bc19ed97" +checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" dependencies = [ "cfg-if", "js-sys", @@ -4299,9 +4422,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b30af9e2d358182b5c7449424f017eba305ed32a7010509ede96cdc4696c46ed" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -4309,9 +4432,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", @@ -4322,9 +4445,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f186bd2dcf04330886ce82d6f33dd75a7bfcf69ecf5763b89fcde53b6ac9838" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "wasm-ws" @@ -4369,6 +4492,15 @@ version = "0.25.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" +[[package]] +name = "webpki-roots" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3de34ae270483955a94f4b21bdaaeb83d508bb84a01435f393818edb0012009" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "winapi" version = "0.3.9" @@ -4569,6 +4701,26 @@ dependencies = [ "tap", ] +[[package]] +name = "zerocopy" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.50", +] + [[package]] name = "zeroize" version = "1.7.0" diff --git a/Cargo.toml b/Cargo.toml index 7331136..14e18a5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,17 +16,16 @@ chrono = { version = "0.4.26", features = ["serde"] } diesel = { version = "2.1", features = ["postgres", "postgres_backend", "r2d2", "chrono", "numeric"] } dotenv = "0.15.0" async-trait = "0.1.77" -fedimint-tbs = "0.2.2" -fedimint-core = "0.2.2" -fedimint-client = "0.2.2" -fedimint-wallet-client = "0.2.2" -fedimint-mint-client = "0.2.2" -bls12_381 = { version = "0.7.1", features = [ "zeroize", "groups" ] } -fedimint-ln-client = "0.2.2" +fedimint-tbs = { git = "https://github.com/fedimint/fedimint", tag = "v0.3.0-rc.1" } +fedimint-core = { git = "https://github.com/fedimint/fedimint", tag = "v0.3.0-rc.1" } +fedimint-client = { git = "https://github.com/fedimint/fedimint", tag = "v0.3.0-rc.1" } +fedimint-wallet-client = { git = "https://github.com/fedimint/fedimint", tag = "v0.3.0-rc.1" } +fedimint-mint-client = { git = "https://github.com/fedimint/fedimint", tag = "v0.3.0-rc.1" } +fedimint-ln-client = { git = "https://github.com/fedimint/fedimint", tag = "v0.3.0-rc.1" } +fedimint-ln-common = { git = "https://github.com/fedimint/fedimint", tag = "v0.3.0-rc.1" } futures = "0.3.28" url = "2.5.0" itertools = "0.12.0" -lightning-invoice = "0.27.0" hex = "0.4.3" jwt-compact = { version = "0.8.0", features = ["es256k"] } nostr = "0.26.0" @@ -41,7 +40,7 @@ reqwest = { version = "0.11", features = ["json"] } tokio = { version = "1.12.0", features = ["full"] } tower-http = { version = "0.4.0", features = ["cors"] } lazy-regex = "3.1.0" -multimint = { git = "https://github.com/Kodylow/multimint", rev = "00df9d34f0244d0200eee4d285094b22b34cf38b" } +multimint = { git = "https://github.com/fedimint/fedimint-clientd", rev = "bb4f9c1bcc82b317329ffd32f7957ab66fc6516b" } names = "0.14.0" [dev-dependencies] diff --git a/src/invoice.rs b/src/invoice.rs index 20f6eec..312d503 100644 --- a/src/invoice.rs +++ b/src/invoice.rs @@ -1,20 +1,21 @@ use std::{collections::HashMap, str::FromStr, time::Duration}; use anyhow::{anyhow, Result}; -use fedimint_client::{oplog::UpdateStreamOrOutcome, ClientArc}; +use fedimint_client::{oplog::UpdateStreamOrOutcome, ClientHandleArc}; use fedimint_core::{config::FederationId, core::OperationId, task::spawn, Amount}; use fedimint_ln_client::{LightningClientModule, LnReceiveState}; +use fedimint_ln_common::bitcoin::hashes::Hash; use fedimint_mint_client::{MintClientModule, OOBNotes}; use futures::StreamExt; use itertools::Itertools; -use lightning_invoice::{Currency, InvoiceBuilder, PaymentSecret}; +use fedimint_ln_common::lightning_invoice::{Currency, InvoiceBuilder, PaymentSecret}; +use fedimint_ln_common::bitcoin::hashes::sha256::Hash as Sha256; +use fedimint_ln_common::bitcoin::secp256k1::{Secp256k1, SecretKey}; use log::{error, info}; -use nostr::hashes::Hash; -use nostr::key::{Secp256k1, SecretKey}; use nostr::prelude::rand::rngs::OsRng; use nostr::prelude::rand::RngCore; use nostr::secp256k1::XOnlyPublicKey; -use nostr::{bitcoin::hashes::sha256::Hash as Sha256, Keys}; +use nostr::Keys; use nostr::{Event, EventBuilder, JsonUtil}; use nostr_sdk::Client; use serde::{Deserialize, Serialize}; @@ -83,7 +84,7 @@ pub(crate) async fn handle_pending_invoices(state: &State) -> Result<()> { pub(crate) async fn spawn_invoice_subscription( state: State, i: Invoice, - client: ClientArc, + client: ClientHandleArc, userrelays: AppUser, subscription: UpdateStreamOrOutcome, ) { @@ -140,7 +141,7 @@ pub(crate) async fn spawn_invoice_subscription( } async fn notify_user( - client: ClientArc, + client: ClientHandleArc, nostr: &Client, state: &State, id: i32, @@ -149,7 +150,12 @@ async fn notify_user( ) -> Result<(), Box> { let mint = client.get_first_module::(); let (operation_id, notes) = mint - .spend_notes(Amount::from_msats(amount), Duration::from_secs(604800), ()) + .spend_notes( + Amount::from_msats(amount), + Duration::from_secs(604800), + true, + (), + ) .await?; send_nostr_dm(nostr, &app_user_relays, operation_id, amount, notes).await?; diff --git a/src/lnurlp.rs b/src/lnurlp.rs index 08e4669..f4b1aac 100644 --- a/src/lnurlp.rs +++ b/src/lnurlp.rs @@ -7,8 +7,10 @@ use crate::{ State, }; use anyhow::anyhow; -use fedimint_core::{config::FederationId, Amount}; +use fedimint_core::{config::FederationId, Amount, BitcoinHash}; use fedimint_ln_client::LightningClientModule; +use fedimint_ln_common::bitcoin::hashes::sha256; +use fedimint_ln_common::lightning_invoice::{Bolt11InvoiceDescription, Sha256}; use nostr::{Event, JsonUtil, Kind}; use crate::routes::{LnurlStatus, LnurlType, LnurlWellKnownResponse}; @@ -74,14 +76,16 @@ pub async fn lnurl_callback( let ln = client.get_first_module::(); - let (op_id, pr) = ln + let desc_hash = Sha256(sha256::Hash::all_zeros()); // todo set description hash properly + let (op_id, pr, _preimage) = ln .create_bolt11_invoice( Amount { msats: params.amount, }, - "test invoice".to_string(), // todo set description hash properly + Bolt11InvoiceDescription::Hash(&desc_hash), None, (), + None, // todo set gateway properly ) .await?; diff --git a/src/main.rs b/src/main.rs index 52b0218..04669a0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,12 +3,11 @@ use axum::http::{request::Parts, HeaderValue, Method, StatusCode, Uri}; use axum::routing::get; use axum::{extract::DefaultBodyLimit, routing::post}; use axum::{http, Extension, Router, TypedHeader}; -use bls12_381::G2Affine; use log::{error, info}; use nostr_sdk::nostr::{key::FromSkStr, Keys}; use secp256k1::{All, Secp256k1}; use std::{path::PathBuf, str::FromStr, sync::Arc}; -use tbs::AggregatePublicKey; +use tbs::{AggregatePublicKey, PubKeyPoint}; use tokio::signal::unix::{signal, SignalKind}; use tokio::sync::oneshot; use tower_http::cors::{AllowOrigin, CorsLayer}; @@ -87,7 +86,7 @@ async fn main() -> anyhow::Result<()> { let free_pk = std::env::var("FREE_PK").expect("FREE_PK must be set"); let paid_pk = std::env::var("PAID_PK").expect("PAID_PK must be set"); let free_pk: AggregatePublicKey = AggregatePublicKey( - G2Affine::from_compressed( + PubKeyPoint::from_compressed( hex::decode(&free_pk).expect("Invalid key hex")[..] .try_into() .expect("Invalid key byte key"), @@ -95,7 +94,7 @@ async fn main() -> anyhow::Result<()> { .expect("Invalid FREE_PK"), ); let paid_pk: AggregatePublicKey = AggregatePublicKey( - G2Affine::from_compressed( + PubKeyPoint::from_compressed( hex::decode(&paid_pk).expect("Invalid key hex")[..] .try_into() .expect("Invalid key byte key"), diff --git a/src/mint.rs b/src/mint.rs index 2e51d39..644bfd2 100644 --- a/src/mint.rs +++ b/src/mint.rs @@ -1,5 +1,5 @@ use async_trait::async_trait; -use fedimint_client::ClientArc; +use fedimint_client::ClientHandleArc; use fedimint_core::{api::InviteCode, config::FederationId}; use std::{path::PathBuf, sync::Arc}; use tokio::sync::RwLock; @@ -12,7 +12,7 @@ use multimint::MultiMint; #[async_trait] pub(crate) trait MultiMintWrapperTrait { async fn check_has_federation(&self, id: FederationId) -> bool; - async fn get_federation_client(&self, id: FederationId) -> Option; + async fn get_federation_client(&self, id: FederationId) -> Option; async fn register_new_federation(&self, invite_code: InviteCode) -> anyhow::Result<()>; } @@ -27,7 +27,7 @@ impl MultiMintWrapperTrait for MultiMintWrapper { self.fm.read().await.clients.lock().await.contains_key(&id) } - async fn get_federation_client(&self, id: FederationId) -> Option { + async fn get_federation_client(&self, id: FederationId) -> Option { self.fm.read().await.clients.lock().await.get(&id).cloned() } @@ -35,7 +35,7 @@ impl MultiMintWrapperTrait for MultiMintWrapper { self.fm .write() .await - .register_new(invite_code, false) + .register_new(invite_code, None) .await?; Ok(()) } diff --git a/src/register.rs b/src/register.rs index 3836f6c..78f604d 100644 --- a/src/register.rs +++ b/src/register.rs @@ -176,9 +176,7 @@ mod tests { } #[cfg(all(test, feature = "integration-tests"))] -use tbs::{ - combine_valid_shares, AggregatePublicKey, BlindedMessage, BlindedSignature, SecretKeyShare, -}; +use tbs::{AggregatePublicKey, BlindedMessage, BlindedSignature, SecretKeyShare}; #[cfg(all(test, feature = "integration-tests"))] use sha2::Digest; @@ -209,7 +207,7 @@ impl BlindSigner { pub fn blind_sign(&self, blinded_message: BlindedMessage) -> BlindedSignature { let share = tbs::sign_blinded_msg(blinded_message, self.sk); - combine_valid_shares(vec![(0, share)], 1) + BlindedSignature(share.0) } } From eb16609e62fac3b42d67a194dee697d621ee0803 Mon Sep 17 00:00:00 2001 From: benthecarman Date: Fri, 22 Mar 2024 12:47:44 -0500 Subject: [PATCH 02/10] Fix clippy issues --- src/invoice.rs | 2 +- src/lnurlp.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/invoice.rs b/src/invoice.rs index 312d503..a4c3241 100644 --- a/src/invoice.rs +++ b/src/invoice.rs @@ -63,7 +63,7 @@ pub(crate) async fn handle_pending_invoices(state: &State) -> Result<()> { let user = state .db .get_user_by_id(invoice.app_user_id)? - .map_or(Err(anyhow!("no user")), Ok)?; + .ok_or(anyhow!("no user"))?; spawn_invoice_subscription( state.clone(), invoice, diff --git a/src/lnurlp.rs b/src/lnurlp.rs index f4b1aac..de5b342 100644 --- a/src/lnurlp.rs +++ b/src/lnurlp.rs @@ -72,7 +72,7 @@ pub async fn lnurl_callback( .mm .get_federation_client(federation_id) .await - .map_or(Err(anyhow!("NotFound")), Ok)?; + .ok_or(anyhow!("NotFound"))?; let ln = client.get_first_module::(); @@ -145,12 +145,12 @@ pub async fn verify( let invoice = state .db .get_invoice_by_op_id(op_id)? - .map_or(Err(anyhow::anyhow!("NotFound")), Ok)?; + .ok_or(anyhow::anyhow!("NotFound"))?; let user = state .db .get_user_by_name(name)? - .map_or(Err(anyhow::anyhow!("NotFound")), Ok)?; + .ok_or(anyhow::anyhow!("NotFound"))?; if invoice.app_user_id != user.id { return Err(anyhow::anyhow!("NotFound")); From 4af0c2685981f5d5de36514480262c47b0620c6c Mon Sep 17 00:00:00 2001 From: benthecarman Date: Fri, 22 Mar 2024 13:07:59 -0500 Subject: [PATCH 03/10] Properly set lnurlp metadata --- src/invoice.rs | 6 +++--- src/lnurlp.rs | 16 ++++++++++++++-- src/main.rs | 9 +++++++++ 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/src/invoice.rs b/src/invoice.rs index a4c3241..84feb30 100644 --- a/src/invoice.rs +++ b/src/invoice.rs @@ -4,13 +4,13 @@ use anyhow::{anyhow, Result}; use fedimint_client::{oplog::UpdateStreamOrOutcome, ClientHandleArc}; use fedimint_core::{config::FederationId, core::OperationId, task::spawn, Amount}; use fedimint_ln_client::{LightningClientModule, LnReceiveState}; +use fedimint_ln_common::bitcoin::hashes::sha256::Hash as Sha256; use fedimint_ln_common::bitcoin::hashes::Hash; +use fedimint_ln_common::bitcoin::secp256k1::{Secp256k1, SecretKey}; +use fedimint_ln_common::lightning_invoice::{Currency, InvoiceBuilder, PaymentSecret}; use fedimint_mint_client::{MintClientModule, OOBNotes}; use futures::StreamExt; use itertools::Itertools; -use fedimint_ln_common::lightning_invoice::{Currency, InvoiceBuilder, PaymentSecret}; -use fedimint_ln_common::bitcoin::hashes::sha256::Hash as Sha256; -use fedimint_ln_common::bitcoin::secp256k1::{Secp256k1, SecretKey}; use log::{error, info}; use nostr::prelude::rand::rngs::OsRng; use nostr::prelude::rand::RngCore; diff --git a/src/lnurlp.rs b/src/lnurlp.rs index de5b342..dcbf0c7 100644 --- a/src/lnurlp.rs +++ b/src/lnurlp.rs @@ -15,6 +15,10 @@ use nostr::{Event, JsonUtil, Kind}; use crate::routes::{LnurlStatus, LnurlType, LnurlWellKnownResponse}; +fn calc_metadata(name: &str, domain: &str) -> String { + format!("[[\"text/identifier\",\"{name}@{domain}\"],[\"text/plain\",\"Sats for {name}\"]]") +} + pub async fn well_known_lnurlp( state: &State, name: String, @@ -28,7 +32,7 @@ pub async fn well_known_lnurlp( callback: format!("{}/lnurlp/{}/callback", state.domain, name).parse()?, max_sendable: Amount { msats: 100000 }, min_sendable: Amount { msats: 1000 }, - metadata: "test metadata".to_string(), // TODO what should this be? + metadata: calc_metadata(&name, &state.domain_no_http()), comment_allowed: None, tag: LnurlType::PayRequest, status: LnurlStatus::Ok, @@ -76,7 +80,15 @@ pub async fn lnurl_callback( let ln = client.get_first_module::(); - let desc_hash = Sha256(sha256::Hash::all_zeros()); // todo set description hash properly + // calculate description hash for invoice + let desc_hash = match params.nostr { + Some(ref nostr) => Sha256(sha256::Hash::hash(nostr.as_bytes())), + None => { + let metadata = calc_metadata(&name, &state.domain_no_http()); + Sha256(sha256::Hash::hash(metadata.as_bytes())) + } + }; + let (op_id, pr, _preimage) = ln .create_bolt11_invoice( Amount { diff --git a/src/main.rs b/src/main.rs index 04669a0..37df61d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -62,6 +62,15 @@ pub struct State { pub paid_pk: AggregatePublicKey, } +impl State { + pub fn domain_no_http(&self) -> String { + self.domain + .replace("http://", "") + .replace("https://", "") + .replace('/', "") + } +} + #[tokio::main] async fn main() -> anyhow::Result<()> { // Load .env file From af1444a9f731dff2505bf9460d72b2716c4a16b1 Mon Sep 17 00:00:00 2001 From: benthecarman Date: Fri, 22 Mar 2024 14:09:29 -0500 Subject: [PATCH 04/10] Better error message --- src/lnurlp.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lnurlp.rs b/src/lnurlp.rs index dcbf0c7..b6f978c 100644 --- a/src/lnurlp.rs +++ b/src/lnurlp.rs @@ -31,7 +31,7 @@ pub async fn well_known_lnurlp( let res = LnurlWellKnownResponse { callback: format!("{}/lnurlp/{}/callback", state.domain, name).parse()?, max_sendable: Amount { msats: 100000 }, - min_sendable: Amount { msats: 1000 }, + min_sendable: Amount { msats: MIN_AMOUNT }, metadata: calc_metadata(&name, &state.domain_no_http()), comment_allowed: None, tag: LnurlType::PayRequest, @@ -57,7 +57,10 @@ pub async fn lnurl_callback( let user = user.expect("just checked"); if params.amount < MIN_AMOUNT { - return Err(anyhow::anyhow!("Amount < MIN_AMOUNT")); + return Err(anyhow::anyhow!( + "Amount ({}) < MIN_AMOUNT ({MIN_AMOUNT})", + params.amount + )); } // verify nostr param is a zap request From ed75541623d80a088ffd65639aecdb6d50ab345a Mon Sep 17 00:00:00 2001 From: benthecarman Date: Fri, 22 Mar 2024 14:17:38 -0500 Subject: [PATCH 05/10] Properly return preimage for verify request --- migrations/2024-02-20-210617_user_info/up.sql | 1 + src/lnurlp.rs | 5 +++-- src/models/invoice.rs | 2 ++ src/models/schema.rs | 2 ++ 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/migrations/2024-02-20-210617_user_info/up.sql b/migrations/2024-02-20-210617_user_info/up.sql index 56f3847..e092982 100644 --- a/migrations/2024-02-20-210617_user_info/up.sql +++ b/migrations/2024-02-20-210617_user_info/up.sql @@ -14,6 +14,7 @@ CREATE TABLE invoice ( id SERIAL PRIMARY KEY, federation_id VARCHAR(64) NOT NULL, op_id VARCHAR(64) NOT NULL, + preimage VARCHAR(64) NOT NULL, app_user_id INTEGER NOT NULL references app_user(id), bolt11 VARCHAR(2048) NOT NULL, amount BIGINT NOT NULL, diff --git a/src/lnurlp.rs b/src/lnurlp.rs index b6f978c..a02418f 100644 --- a/src/lnurlp.rs +++ b/src/lnurlp.rs @@ -92,7 +92,7 @@ pub async fn lnurl_callback( } }; - let (op_id, pr, _preimage) = ln + let (op_id, pr, preimage) = ln .create_bolt11_invoice( Amount { msats: params.amount, @@ -108,6 +108,7 @@ pub async fn lnurl_callback( let new_invoice = NewInvoice { federation_id: federation_id.to_string(), op_id: op_id.to_string(), + preimage: hex::encode(preimage), app_user_id: user.id, bolt11: pr.to_string(), amount: params.amount as i64, @@ -174,7 +175,7 @@ pub async fn verify( let verify_response = LnurlVerifyResponse { status: LnurlStatus::Ok, settled: invoice.state == InvoiceState::Settled as i32, - preimage: "".to_string(), // TODO: figure out how to get the preimage from fedimint client + preimage: invoice.preimage, pr: invoice.bolt11, }; diff --git a/src/models/invoice.rs b/src/models/invoice.rs index 90b85bd..6864cf4 100644 --- a/src/models/invoice.rs +++ b/src/models/invoice.rs @@ -11,6 +11,7 @@ pub struct Invoice { pub id: i32, pub federation_id: String, pub op_id: String, + pub preimage: String, pub app_user_id: i32, pub bolt11: String, pub amount: i64, @@ -60,6 +61,7 @@ impl Invoice { pub struct NewInvoice { pub federation_id: String, pub op_id: String, + pub preimage: String, pub app_user_id: i32, pub bolt11: String, pub amount: i64, diff --git a/src/models/schema.rs b/src/models/schema.rs index 763144d..8bea622 100644 --- a/src/models/schema.rs +++ b/src/models/schema.rs @@ -23,6 +23,8 @@ diesel::table! { federation_id -> Varchar, #[max_length = 64] op_id -> Varchar, + #[max_length = 64] + preimage -> Varchar, app_user_id -> Int4, #[max_length = 2048] bolt11 -> Varchar, From 29631c45a798c081141df8c505119452608357a5 Mon Sep 17 00:00:00 2001 From: benthecarman Date: Fri, 22 Mar 2024 14:57:21 -0500 Subject: [PATCH 06/10] External receive --- migrations/2024-02-20-210617_user_info/up.sql | 4 +- src/db.rs | 6 ++ src/invoice.rs | 76 +++++-------------- src/lnurlp.rs | 17 +++-- src/models/app_user.rs | 28 +++++++ src/models/invoice.rs | 2 + src/models/schema.rs | 2 + 7 files changed, 71 insertions(+), 64 deletions(-) diff --git a/migrations/2024-02-20-210617_user_info/up.sql b/migrations/2024-02-20-210617_user_info/up.sql index e092982..3e0774d 100644 --- a/migrations/2024-02-20-210617_user_info/up.sql +++ b/migrations/2024-02-20-210617_user_info/up.sql @@ -4,7 +4,8 @@ CREATE TABLE app_user ( name VARCHAR(255) NOT NULL UNIQUE, unblinded_msg VARCHAR(255) NOT NULL UNIQUE, federation_id VARCHAR(64) NOT NULL, - federation_invite_code VARCHAR(255) NOT NULL + federation_invite_code VARCHAR(255) NOT NULL, + invoice_index INTEGER NOT NULL DEFAULT 0 ); CREATE INDEX idx_app_user_unblinded_msg ON app_user (unblinded_msg); @@ -16,6 +17,7 @@ CREATE TABLE invoice ( op_id VARCHAR(64) NOT NULL, preimage VARCHAR(64) NOT NULL, app_user_id INTEGER NOT NULL references app_user(id), + user_invoice_index INTEGER NOT NULL, bolt11 VARCHAR(2048) NOT NULL, amount BIGINT NOT NULL, state INTEGER NOT NULL DEFAULT 0 diff --git a/src/db.rs b/src/db.rs index a244d65..4ab7f7e 100644 --- a/src/db.rs +++ b/src/db.rs @@ -21,6 +21,7 @@ pub(crate) trait DBConnection { fn set_invoice_state(&self, invoice: Invoice, s: i32) -> anyhow::Result<()>; fn get_user_by_name(&self, name: String) -> anyhow::Result>; fn get_user_by_id(&self, id: i32) -> anyhow::Result>; + fn get_user_and_increment_counter(&self, name: &str) -> anyhow::Result>; fn insert_new_zap(&self, new_zap: NewZap) -> anyhow::Result; fn get_zap_by_id(&self, id: i32) -> anyhow::Result>; fn set_zap_event_id(&self, zap: Zap, event_id: String) -> anyhow::Result<()>; @@ -66,6 +67,11 @@ impl DBConnection for PostgresConnection { AppUser::get_by_id(conn, id) } + fn get_user_and_increment_counter(&self, name: &str) -> anyhow::Result> { + let conn = &mut self.db.get()?; + AppUser::get_by_name_and_increment_counter(conn, name) + } + fn insert_new_invoice(&self, new_invoice: NewInvoice) -> anyhow::Result { let conn = &mut self.db.get()?; new_invoice.insert(conn) diff --git a/src/invoice.rs b/src/invoice.rs index 84feb30..820f291 100644 --- a/src/invoice.rs +++ b/src/invoice.rs @@ -1,14 +1,13 @@ -use std::{collections::HashMap, str::FromStr, time::Duration}; +use std::{collections::HashMap, str::FromStr}; use anyhow::{anyhow, Result}; -use fedimint_client::{oplog::UpdateStreamOrOutcome, ClientHandleArc}; -use fedimint_core::{config::FederationId, core::OperationId, task::spawn, Amount}; +use fedimint_client::oplog::UpdateStreamOrOutcome; +use fedimint_core::{config::FederationId, task::spawn}; use fedimint_ln_client::{LightningClientModule, LnReceiveState}; use fedimint_ln_common::bitcoin::hashes::sha256::Hash as Sha256; use fedimint_ln_common::bitcoin::hashes::Hash; use fedimint_ln_common::bitcoin::secp256k1::{Secp256k1, SecretKey}; use fedimint_ln_common::lightning_invoice::{Currency, InvoiceBuilder, PaymentSecret}; -use fedimint_mint_client::{MintClientModule, OOBNotes}; use futures::StreamExt; use itertools::Itertools; use log::{error, info}; @@ -67,7 +66,6 @@ pub(crate) async fn handle_pending_invoices(state: &State) -> Result<()> { spawn_invoice_subscription( state.clone(), invoice, - client.clone(), user.clone(), subscription, ) @@ -84,8 +82,7 @@ pub(crate) async fn handle_pending_invoices(state: &State) -> Result<()> { pub(crate) async fn spawn_invoice_subscription( state: State, i: Invoice, - client: ClientHandleArc, - userrelays: AppUser, + user: AppUser, subscription: UpdateStreamOrOutcome, ) { spawn("waiting for invoice being paid", async move { @@ -109,16 +106,7 @@ pub(crate) async fn spawn_invoice_subscription( } LnReceiveState::Claimed => { info!("Payment claimed"); - match notify_user( - client, - &nostr, - &state, - i.id, - i.amount as u64, - userrelays.clone(), - ) - .await - { + match notify_user(&nostr, &state, &i, user).await { Ok(_) => { match state.db.set_invoice_state(i, InvoiceState::Settled as i32) { Ok(_) => (), @@ -141,29 +129,28 @@ pub(crate) async fn spawn_invoice_subscription( } async fn notify_user( - client: ClientHandleArc, nostr: &Client, state: &State, - id: i32, - amount: u64, - app_user_relays: AppUser, -) -> Result<(), Box> { - let mint = client.get_first_module::(); - let (operation_id, notes) = mint - .spend_notes( - Amount::from_msats(amount), - Duration::from_secs(604800), - true, - (), + invoice: &Invoice, + user: AppUser, +) -> Result<()> { + let dm = nostr + .send_direct_msg( + XOnlyPublicKey::from_str(&user.pubkey)?, + json!({ + "federation_id": invoice.federation_id, + "tweak_index": invoice.user_invoice_index, + "amount": invoice.amount, + }) + .to_string(), + None, ) .await?; - send_nostr_dm(nostr, &app_user_relays, operation_id, amount, notes).await?; - // Send zap if needed - if let Some(zap) = state.db.get_zap_by_id(id)? { + if let Some(zap) = state.db.get_zap_by_id(invoice.id)? { let request = Event::from_json(zap.request.clone())?; - let event = create_zap_event(request, amount, nostr.keys().await)?; + let event = create_zap_event(request, invoice.amount as u64, nostr.keys().await)?; let event_id = nostr.send_event(event).await?; info!("Broadcasted zap {event_id}!"); @@ -171,29 +158,6 @@ async fn notify_user( state.db.set_zap_event_id(zap, event_id.to_string())?; } - Ok(()) -} - -async fn send_nostr_dm( - nostr: &Client, - app_user_relays: &AppUser, - operation_id: OperationId, - amount: u64, - notes: OOBNotes, -) -> Result<()> { - let dm = nostr - .send_direct_msg( - XOnlyPublicKey::from_str(&app_user_relays.pubkey).unwrap(), - json!({ - "operationId": operation_id, - "amount": amount, - "notes": notes.to_string(), - }) - .to_string(), - None, - ) - .await?; - info!("Sent nostr dm: {dm}"); Ok(()) } diff --git a/src/lnurlp.rs b/src/lnurlp.rs index a02418f..44aff26 100644 --- a/src/lnurlp.rs +++ b/src/lnurlp.rs @@ -10,6 +10,7 @@ use anyhow::anyhow; use fedimint_core::{config::FederationId, Amount, BitcoinHash}; use fedimint_ln_client::LightningClientModule; use fedimint_ln_common::bitcoin::hashes::sha256; +use fedimint_ln_common::bitcoin::secp256k1::Parity; use fedimint_ln_common::lightning_invoice::{Bolt11InvoiceDescription, Sha256}; use nostr::{Event, JsonUtil, Kind}; @@ -50,7 +51,7 @@ pub async fn lnurl_callback( name: String, params: LnurlCallbackParams, ) -> anyhow::Result { - let user = state.db.get_user_by_name(name.clone())?; + let user = state.db.get_user_and_increment_counter(&name)?; if user.is_none() { return Err(anyhow!("NotFound")); } @@ -92,13 +93,15 @@ pub async fn lnurl_callback( } }; + let invoice_index = user.invoice_index; + let (op_id, pr, preimage) = ln - .create_bolt11_invoice( - Amount { - msats: params.amount, - }, + .create_bolt11_invoice_for_user_tweaked( + Amount::from_msats(params.amount), Bolt11InvoiceDescription::Hash(&desc_hash), - None, + Some(86_400), // 1 day expiry + user.pubkey().public_key(Parity::Odd), // todo is this parity correct / easy to work with? + invoice_index as u64, (), None, // todo set gateway properly ) @@ -110,6 +113,7 @@ pub async fn lnurl_callback( op_id: op_id.to_string(), preimage: hex::encode(preimage), app_user_id: user.id, + user_invoice_index: invoice_index, bolt11: pr.to_string(), amount: params.amount as i64, state: InvoiceState::Pending as i32, @@ -135,7 +139,6 @@ pub async fn lnurl_callback( spawn_invoice_subscription( state.clone(), created_invoice, - client, user.clone(), subscription, ) diff --git a/src/models/app_user.rs b/src/models/app_user.rs index f76b048..b5cb1f4 100644 --- a/src/models/app_user.rs +++ b/src/models/app_user.rs @@ -1,6 +1,8 @@ use crate::models::schema::app_user; use diesel::prelude::*; +use fedimint_ln_common::bitcoin::secp256k1::XOnlyPublicKey; use serde::{Deserialize, Serialize}; +use std::str::FromStr; #[derive( QueryableByName, Queryable, AsChangeset, Serialize, Deserialize, Debug, Clone, PartialEq, @@ -14,9 +16,14 @@ pub struct AppUser { pub unblinded_msg: String, pub federation_id: String, pub federation_invite_code: String, + pub invoice_index: i32, } impl AppUser { + pub fn pubkey(&self) -> XOnlyPublicKey { + XOnlyPublicKey::from_str(&self.pubkey).expect("invalid pubkey") + } + pub fn get_app_users(conn: &mut PgConnection) -> anyhow::Result> { Ok(app_user::table.load::(conn)?) } @@ -35,6 +42,27 @@ impl AppUser { .optional()?) } + pub fn get_by_name_and_increment_counter( + conn: &mut PgConnection, + name: &str, + ) -> anyhow::Result> { + conn.transaction(|conn| { + let user = app_user::table + .filter(app_user::name.eq(name)) + .first::(conn) + .optional()?; + + // if the user exists, increment their invoice index + if let Some(user) = &user { + diesel::update(app_user::table.filter(app_user::id.eq(user.id))) + .set(app_user::invoice_index.eq(app_user::invoice_index + 1)) + .execute(conn)?; + } + + Ok(user) + }) + } + pub fn check_available_name(conn: &mut PgConnection, name: String) -> anyhow::Result { Ok(app_user::table .filter(app_user::name.eq(name)) diff --git a/src/models/invoice.rs b/src/models/invoice.rs index 6864cf4..09f2550 100644 --- a/src/models/invoice.rs +++ b/src/models/invoice.rs @@ -13,6 +13,7 @@ pub struct Invoice { pub op_id: String, pub preimage: String, pub app_user_id: i32, + pub user_invoice_index: i32, pub bolt11: String, pub amount: i64, pub state: i32, @@ -63,6 +64,7 @@ pub struct NewInvoice { pub op_id: String, pub preimage: String, pub app_user_id: i32, + pub user_invoice_index: i32, pub bolt11: String, pub amount: i64, pub state: i32, diff --git a/src/models/schema.rs b/src/models/schema.rs index 8bea622..6a61296 100644 --- a/src/models/schema.rs +++ b/src/models/schema.rs @@ -13,6 +13,7 @@ diesel::table! { federation_id -> Varchar, #[max_length = 255] federation_invite_code -> Varchar, + invoice_index -> Int4, } } @@ -26,6 +27,7 @@ diesel::table! { #[max_length = 64] preimage -> Varchar, app_user_id -> Int4, + user_invoice_index -> Int4, #[max_length = 2048] bolt11 -> Varchar, amount -> Int8, From 18f3e71e991d567a036ea5d8afaaa13a69cee58f Mon Sep 17 00:00:00 2001 From: benthecarman Date: Fri, 22 Mar 2024 15:12:58 -0500 Subject: [PATCH 07/10] Properly set gateway --- src/lnurlp.rs | 16 +++++------ src/mint.rs | 77 +++++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 82 insertions(+), 11 deletions(-) diff --git a/src/lnurlp.rs b/src/lnurlp.rs index 44aff26..36300f5 100644 --- a/src/lnurlp.rs +++ b/src/lnurlp.rs @@ -95,6 +95,12 @@ pub async fn lnurl_callback( let invoice_index = user.invoice_index; + let gateway = state + .mm + .get_gateway(&federation_id) + .await + .ok_or(anyhow!("Not gateway configured for federation"))?; + let (op_id, pr, preimage) = ln .create_bolt11_invoice_for_user_tweaked( Amount::from_msats(params.amount), @@ -103,7 +109,7 @@ pub async fn lnurl_callback( user.pubkey().public_key(Parity::Odd), // todo is this parity correct / easy to work with? invoice_index as u64, (), - None, // todo set gateway properly + Some(gateway), ) .await?; @@ -136,13 +142,7 @@ pub async fn lnurl_callback( .await .expect("subscribing to a just created operation can't fail"); - spawn_invoice_subscription( - state.clone(), - created_invoice, - user.clone(), - subscription, - ) - .await; + spawn_invoice_subscription(state.clone(), created_invoice, user.clone(), subscription).await; let verify_url = format!("{}/lnurlp/{}/verify/{}", state.domain, user.name, op_id); diff --git a/src/mint.rs b/src/mint.rs index 644bfd2..dc1239f 100644 --- a/src/mint.rs +++ b/src/mint.rs @@ -1,6 +1,10 @@ use async_trait::async_trait; use fedimint_client::ClientHandleArc; use fedimint_core::{api::InviteCode, config::FederationId}; +use fedimint_ln_client::LightningClientModule; +use fedimint_ln_common::LightningGateway; +use log::error; +use std::collections::HashMap; use std::{path::PathBuf, sync::Arc}; use tokio::sync::RwLock; @@ -14,11 +18,14 @@ pub(crate) trait MultiMintWrapperTrait { async fn check_has_federation(&self, id: FederationId) -> bool; async fn get_federation_client(&self, id: FederationId) -> Option; async fn register_new_federation(&self, invite_code: InviteCode) -> anyhow::Result<()>; + async fn get_gateway(&self, id: &FederationId) -> Option; } #[derive(Clone)] struct MultiMintWrapper { fm: Arc>, + /// Our preferred lightning gateway for each federation + gateways: Arc>>, } #[async_trait] @@ -32,20 +39,84 @@ impl MultiMintWrapperTrait for MultiMintWrapper { } async fn register_new_federation(&self, invite_code: InviteCode) -> anyhow::Result<()> { - self.fm + let id = self + .fm .write() .await .register_new(invite_code, None) .await?; + + let client = self + .get_federation_client(id) + .await + .expect("just registered"); + + if let Some(gateway) = select_gateway(&client).await { + self.gateways.write().await.insert(id, gateway); + } else { + error!("No suitable gateway found for federation {id}"); + } + Ok(()) } + + async fn get_gateway(&self, id: &FederationId) -> Option { + let lock = self.gateways.read().await; + lock.get(id).cloned() + } } pub(crate) async fn setup_multimint( db_path: PathBuf, ) -> anyhow::Result> { - let fm = Arc::new(RwLock::new(MultiMint::new(db_path).await?)); - let mmw = MultiMintWrapper { fm }; + let mm = MultiMint::new(db_path).await?; + + let clients = mm.clients.lock().await; + let mut gateways = HashMap::with_capacity(clients.len()); + + // select gateway for each federation + for (id, client) in clients.iter() { + match select_gateway(client).await { + Some(gateway) => { + gateways.insert(*id, gateway); + } + None => { + error!("No suitable gateway found for federation {id}"); + } + } + } + drop(clients); + + let mmw = MultiMintWrapper { + fm: Arc::new(RwLock::new(mm)), + gateways: Arc::new(RwLock::new(HashMap::new())), + }; Ok(Arc::new(mmw)) } + +pub(crate) async fn select_gateway(client: &ClientHandleArc) -> Option { + let ln = client.get_first_module::(); + let mut gateway_id = None; + for gateway in ln.list_gateways().await { + // first try to find a vetted gateway + if gateway.vetted { + gateway_id = Some(gateway.info.gateway_id); + break; // if vetted gateway found, use it + } + + // if no vetted gateway found, try to find a gateway with reasonable fees + let fees = gateway.info.fees; + if fees.base_msat >= 1_000 && fees.proportional_millionths >= 100 { + gateway_id = Some(gateway.info.gateway_id); + } + } + + if let Some(gateway_id) = gateway_id { + if let Some(gateway) = ln.select_gateway(&gateway_id).await { + return Some(gateway); + } + } + + None +} From 6226b5eed147bd5ccc84ec4b8dd8198eeff6b223 Mon Sep 17 00:00:00 2001 From: benthecarman Date: Mon, 25 Mar 2024 14:17:54 -0500 Subject: [PATCH 08/10] Switch to even parity --- src/lnurlp.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lnurlp.rs b/src/lnurlp.rs index 36300f5..3feaf14 100644 --- a/src/lnurlp.rs +++ b/src/lnurlp.rs @@ -106,7 +106,7 @@ pub async fn lnurl_callback( Amount::from_msats(params.amount), Bolt11InvoiceDescription::Hash(&desc_hash), Some(86_400), // 1 day expiry - user.pubkey().public_key(Parity::Odd), // todo is this parity correct / easy to work with? + user.pubkey().public_key(Parity::Even), // todo is this parity correct / easy to work with? invoice_index as u64, (), Some(gateway), From e5ef1ae4295e3c591f3b9684c882e49cf5edddda Mon Sep 17 00:00:00 2001 From: benthecarman Date: Mon, 25 Mar 2024 14:41:54 -0500 Subject: [PATCH 09/10] Return zap request --- src/invoice.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/invoice.rs b/src/invoice.rs index 820f291..a98b21c 100644 --- a/src/invoice.rs +++ b/src/invoice.rs @@ -134,6 +134,8 @@ async fn notify_user( invoice: &Invoice, user: AppUser, ) -> Result<()> { + let zap = state.db.get_zap_by_id(invoice.id)?; + let dm = nostr .send_direct_msg( XOnlyPublicKey::from_str(&user.pubkey)?, @@ -141,6 +143,7 @@ async fn notify_user( "federation_id": invoice.federation_id, "tweak_index": invoice.user_invoice_index, "amount": invoice.amount, + "zap_request": zap.as_ref().map(|z| z.request.clone()), }) .to_string(), None, @@ -148,8 +151,8 @@ async fn notify_user( .await?; // Send zap if needed - if let Some(zap) = state.db.get_zap_by_id(invoice.id)? { - let request = Event::from_json(zap.request.clone())?; + if let Some(zap) = zap { + let request = Event::from_json(&zap.request)?; let event = create_zap_event(request, invoice.amount as u64, nostr.keys().await)?; let event_id = nostr.send_event(event).await?; From f5283dec2a06460c137a2815e0bead0556ae2e10 Mon Sep 17 00:00:00 2001 From: benthecarman Date: Mon, 25 Mar 2024 15:13:04 -0500 Subject: [PATCH 10/10] fedimint v0.3.0-rc2 --- Cargo.lock | 70 +++++++++++++++++++++++++++--------------------------- Cargo.toml | 16 ++++++------- 2 files changed, 43 insertions(+), 43 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3198fa6..928f338 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1089,8 +1089,8 @@ checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" [[package]] name = "fedimint-aead" -version = "0.3.0-rc.1" -source = "git+https://github.com/fedimint/fedimint?tag=v0.3.0-rc.1#c51ea0c85576008dcbf9d94e2fe994dfa34bca61" +version = "0.3.0-rc.2" +source = "git+https://github.com/fedimint/fedimint?tag=v0.3.0-rc.2#44f129b216df39a4d896f96146eb89efe264d838" dependencies = [ "anyhow", "argon2", @@ -1101,8 +1101,8 @@ dependencies = [ [[package]] name = "fedimint-bitcoind" -version = "0.3.0-rc.1" -source = "git+https://github.com/fedimint/fedimint?tag=v0.3.0-rc.1#c51ea0c85576008dcbf9d94e2fe994dfa34bca61" +version = "0.3.0-rc.2" +source = "git+https://github.com/fedimint/fedimint?tag=v0.3.0-rc.2#44f129b216df39a4d896f96146eb89efe264d838" dependencies = [ "anyhow", "async-trait", @@ -1122,16 +1122,16 @@ dependencies = [ [[package]] name = "fedimint-build" -version = "0.3.0-rc.1" -source = "git+https://github.com/fedimint/fedimint?tag=v0.3.0-rc.1#c51ea0c85576008dcbf9d94e2fe994dfa34bca61" +version = "0.3.0-rc.2" +source = "git+https://github.com/fedimint/fedimint?tag=v0.3.0-rc.2#44f129b216df39a4d896f96146eb89efe264d838" dependencies = [ "serde_json", ] [[package]] name = "fedimint-client" -version = "0.3.0-rc.1" -source = "git+https://github.com/fedimint/fedimint?tag=v0.3.0-rc.1#c51ea0c85576008dcbf9d94e2fe994dfa34bca61" +version = "0.3.0-rc.2" +source = "git+https://github.com/fedimint/fedimint?tag=v0.3.0-rc.2#44f129b216df39a4d896f96146eb89efe264d838" dependencies = [ "anyhow", "aquamarine", @@ -1161,8 +1161,8 @@ dependencies = [ [[package]] name = "fedimint-core" -version = "0.3.0-rc.1" -source = "git+https://github.com/fedimint/fedimint?tag=v0.3.0-rc.1#c51ea0c85576008dcbf9d94e2fe994dfa34bca61" +version = "0.3.0-rc.2" +source = "git+https://github.com/fedimint/fedimint?tag=v0.3.0-rc.2#44f129b216df39a4d896f96146eb89efe264d838" dependencies = [ "anyhow", "async-lock", @@ -1214,8 +1214,8 @@ dependencies = [ [[package]] name = "fedimint-derive" -version = "0.3.0-rc.1" -source = "git+https://github.com/fedimint/fedimint?tag=v0.3.0-rc.1#c51ea0c85576008dcbf9d94e2fe994dfa34bca61" +version = "0.3.0-rc.2" +source = "git+https://github.com/fedimint/fedimint?tag=v0.3.0-rc.2#44f129b216df39a4d896f96146eb89efe264d838" dependencies = [ "itertools 0.12.1", "proc-macro2", @@ -1225,8 +1225,8 @@ dependencies = [ [[package]] name = "fedimint-derive-secret" -version = "0.3.0-rc.1" -source = "git+https://github.com/fedimint/fedimint?tag=v0.3.0-rc.1#c51ea0c85576008dcbf9d94e2fe994dfa34bca61" +version = "0.3.0-rc.2" +source = "git+https://github.com/fedimint/fedimint?tag=v0.3.0-rc.2#44f129b216df39a4d896f96146eb89efe264d838" dependencies = [ "anyhow", "fedimint-core", @@ -1238,16 +1238,16 @@ dependencies = [ [[package]] name = "fedimint-hkdf" -version = "0.3.0-rc.1" -source = "git+https://github.com/fedimint/fedimint?tag=v0.3.0-rc.1#c51ea0c85576008dcbf9d94e2fe994dfa34bca61" +version = "0.3.0-rc.2" +source = "git+https://github.com/fedimint/fedimint?tag=v0.3.0-rc.2#44f129b216df39a4d896f96146eb89efe264d838" dependencies = [ "bitcoin_hashes 0.11.0", ] [[package]] name = "fedimint-ln-client" -version = "0.3.0-rc.1" -source = "git+https://github.com/fedimint/fedimint?tag=v0.3.0-rc.1#c51ea0c85576008dcbf9d94e2fe994dfa34bca61" +version = "0.3.0-rc.2" +source = "git+https://github.com/fedimint/fedimint?tag=v0.3.0-rc.2#44f129b216df39a4d896f96146eb89efe264d838" dependencies = [ "anyhow", "aquamarine", @@ -1280,8 +1280,8 @@ dependencies = [ [[package]] name = "fedimint-ln-common" -version = "0.3.0-rc.1" -source = "git+https://github.com/fedimint/fedimint?tag=v0.3.0-rc.1#c51ea0c85576008dcbf9d94e2fe994dfa34bca61" +version = "0.3.0-rc.2" +source = "git+https://github.com/fedimint/fedimint?tag=v0.3.0-rc.2#44f129b216df39a4d896f96146eb89efe264d838" dependencies = [ "anyhow", "aquamarine", @@ -1310,8 +1310,8 @@ dependencies = [ [[package]] name = "fedimint-logging" -version = "0.3.0-rc.1" -source = "git+https://github.com/fedimint/fedimint?tag=v0.3.0-rc.1#c51ea0c85576008dcbf9d94e2fe994dfa34bca61" +version = "0.3.0-rc.2" +source = "git+https://github.com/fedimint/fedimint?tag=v0.3.0-rc.2#44f129b216df39a4d896f96146eb89efe264d838" dependencies = [ "anyhow", "tracing-subscriber", @@ -1319,8 +1319,8 @@ dependencies = [ [[package]] name = "fedimint-mint-client" -version = "0.3.0-rc.1" -source = "git+https://github.com/fedimint/fedimint?tag=v0.3.0-rc.1#c51ea0c85576008dcbf9d94e2fe994dfa34bca61" +version = "0.3.0-rc.2" +source = "git+https://github.com/fedimint/fedimint?tag=v0.3.0-rc.2#44f129b216df39a4d896f96146eb89efe264d838" dependencies = [ "anyhow", "aquamarine", @@ -1354,8 +1354,8 @@ dependencies = [ [[package]] name = "fedimint-mint-common" -version = "0.3.0-rc.1" -source = "git+https://github.com/fedimint/fedimint?tag=v0.3.0-rc.1#c51ea0c85576008dcbf9d94e2fe994dfa34bca61" +version = "0.3.0-rc.2" +source = "git+https://github.com/fedimint/fedimint?tag=v0.3.0-rc.2#44f129b216df39a4d896f96146eb89efe264d838" dependencies = [ "anyhow", "async-trait", @@ -1378,8 +1378,8 @@ dependencies = [ [[package]] name = "fedimint-rocksdb" -version = "0.3.0-rc.1" -source = "git+https://github.com/fedimint/fedimint?tag=v0.3.0-rc.1#c51ea0c85576008dcbf9d94e2fe994dfa34bca61" +version = "0.3.0-rc.2" +source = "git+https://github.com/fedimint/fedimint?tag=v0.3.0-rc.2#44f129b216df39a4d896f96146eb89efe264d838" dependencies = [ "anyhow", "async-trait", @@ -1392,8 +1392,8 @@ dependencies = [ [[package]] name = "fedimint-tbs" -version = "0.3.0-rc.1" -source = "git+https://github.com/fedimint/fedimint?tag=v0.3.0-rc.1#c51ea0c85576008dcbf9d94e2fe994dfa34bca61" +version = "0.3.0-rc.2" +source = "git+https://github.com/fedimint/fedimint?tag=v0.3.0-rc.2#44f129b216df39a4d896f96146eb89efe264d838" dependencies = [ "bitcoin_hashes 0.11.0", "bls12_381", @@ -1429,8 +1429,8 @@ dependencies = [ [[package]] name = "fedimint-wallet-client" -version = "0.3.0-rc.1" -source = "git+https://github.com/fedimint/fedimint?tag=v0.3.0-rc.1#c51ea0c85576008dcbf9d94e2fe994dfa34bca61" +version = "0.3.0-rc.2" +source = "git+https://github.com/fedimint/fedimint?tag=v0.3.0-rc.2#44f129b216df39a4d896f96146eb89efe264d838" dependencies = [ "anyhow", "aquamarine", @@ -1460,8 +1460,8 @@ dependencies = [ [[package]] name = "fedimint-wallet-common" -version = "0.3.0-rc.1" -source = "git+https://github.com/fedimint/fedimint?tag=v0.3.0-rc.1#c51ea0c85576008dcbf9d94e2fe994dfa34bca61" +version = "0.3.0-rc.2" +source = "git+https://github.com/fedimint/fedimint?tag=v0.3.0-rc.2#44f129b216df39a4d896f96146eb89efe264d838" dependencies = [ "anyhow", "async-trait", @@ -2613,7 +2613,7 @@ dependencies = [ [[package]] name = "multimint" version = "0.1.12" -source = "git+https://github.com/fedimint/fedimint-clientd?rev=bb4f9c1bcc82b317329ffd32f7957ab66fc6516b#bb4f9c1bcc82b317329ffd32f7957ab66fc6516b" +source = "git+https://github.com/fedimint/fedimint-clientd?rev=16fe9dd32c745267304a55aacee9501050bb03fa#16fe9dd32c745267304a55aacee9501050bb03fa" dependencies = [ "anyhow", "fedimint-client", diff --git a/Cargo.toml b/Cargo.toml index 14e18a5..4b4db97 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,13 +16,13 @@ chrono = { version = "0.4.26", features = ["serde"] } diesel = { version = "2.1", features = ["postgres", "postgres_backend", "r2d2", "chrono", "numeric"] } dotenv = "0.15.0" async-trait = "0.1.77" -fedimint-tbs = { git = "https://github.com/fedimint/fedimint", tag = "v0.3.0-rc.1" } -fedimint-core = { git = "https://github.com/fedimint/fedimint", tag = "v0.3.0-rc.1" } -fedimint-client = { git = "https://github.com/fedimint/fedimint", tag = "v0.3.0-rc.1" } -fedimint-wallet-client = { git = "https://github.com/fedimint/fedimint", tag = "v0.3.0-rc.1" } -fedimint-mint-client = { git = "https://github.com/fedimint/fedimint", tag = "v0.3.0-rc.1" } -fedimint-ln-client = { git = "https://github.com/fedimint/fedimint", tag = "v0.3.0-rc.1" } -fedimint-ln-common = { git = "https://github.com/fedimint/fedimint", tag = "v0.3.0-rc.1" } +fedimint-tbs = { git = "https://github.com/fedimint/fedimint", tag = "v0.3.0-rc.2" } +fedimint-core = { git = "https://github.com/fedimint/fedimint", tag = "v0.3.0-rc.2" } +fedimint-client = { git = "https://github.com/fedimint/fedimint", tag = "v0.3.0-rc.2" } +fedimint-wallet-client = { git = "https://github.com/fedimint/fedimint", tag = "v0.3.0-rc.2" } +fedimint-mint-client = { git = "https://github.com/fedimint/fedimint", tag = "v0.3.0-rc.2" } +fedimint-ln-client = { git = "https://github.com/fedimint/fedimint", tag = "v0.3.0-rc.2" } +fedimint-ln-common = { git = "https://github.com/fedimint/fedimint", tag = "v0.3.0-rc.2" } futures = "0.3.28" url = "2.5.0" itertools = "0.12.0" @@ -40,7 +40,7 @@ reqwest = { version = "0.11", features = ["json"] } tokio = { version = "1.12.0", features = ["full"] } tower-http = { version = "0.4.0", features = ["cors"] } lazy-regex = "3.1.0" -multimint = { git = "https://github.com/fedimint/fedimint-clientd", rev = "bb4f9c1bcc82b317329ffd32f7957ab66fc6516b" } +multimint = { git = "https://github.com/fedimint/fedimint-clientd", rev = "16fe9dd32c745267304a55aacee9501050bb03fa" } names = "0.14.0" [dev-dependencies]