From 62b55cf0ed0c8c341a653fbd7b64195b380b4cd5 Mon Sep 17 00:00:00 2001 From: benthecarman Date: Sat, 23 Mar 2024 15:16:59 -0500 Subject: [PATCH] Update fedimint, use correct invite code --- Cargo.lock | 395 ++++++++++++++++++++++++++++++------------ waila-wasm/src/lib.rs | 4 +- waila/Cargo.toml | 4 +- waila/src/lib.rs | 31 ++-- 4 files changed, 301 insertions(+), 133 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7854ed9..617f560 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -44,6 +44,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" @@ -53,6 +65,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 = "aluvm" version = "0.10.6" @@ -141,22 +159,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]] @@ -191,11 +209,13 @@ checksum = "d92bec98840b8f03a5ff5413de5293bfcd8bf96467cf5452609f939ec6f5de16" [[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]] @@ -293,6 +313,12 @@ version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +[[package]] +name = "base64" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9475866fec1451be56a3c2400fd081ff546538961565ccb5b7142cbd22bc7a51" + [[package]] name = "base64ct" version = "1.6.0" @@ -396,9 +422,9 @@ checksum = "73290177011694f38ec25e165d0387ab7ea749a4b81cd4c80dae5988229f7a57" name = "bitcoin-waila" version = "0.4.1" dependencies = [ - "bech32", "bip21", "bitcoin 0.30.2", + "fedimint-core", "fedimint-mint-client", "itertools 0.12.1", "lightning 0.0.121", @@ -447,6 +473,12 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[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" @@ -708,6 +740,15 @@ dependencies = [ "strict_types", ] +[[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 = "constant_time_eq" version = "0.3.0" @@ -738,6 +779,12 @@ dependencies = [ "libc", ] +[[package]] +name = "crossbeam-utils" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" + [[package]] name = "crunchy" version = "0.2.2" @@ -843,23 +890,39 @@ 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", ] [[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 = "event-listener-strategy" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" +dependencies = [ + "event-listener", + "pin-project-lite", +] [[package]] name = "fedimint-aead" -version = "0.2.2" -source = "git+https://github.com/fedimint/fedimint?rev=5ade2536015a12a7e003a42b159ccc4a431e1a32#5ade2536015a12a7e003a42b159ccc4a431e1a32" +version = "0.3.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147f8bf9c0e72cd84b06f4d724e7c583b27c39d65d08de5e604d0e9d3bdc3bd8" dependencies = [ "anyhow", "argon2", @@ -870,16 +933,18 @@ dependencies = [ [[package]] name = "fedimint-build" -version = "0.2.2" -source = "git+https://github.com/fedimint/fedimint?rev=5ade2536015a12a7e003a42b159ccc4a431e1a32#5ade2536015a12a7e003a42b159ccc4a431e1a32" +version = "0.3.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "245ffdc81b7ed2ed1b84c18d1ea1b44e32b156d35f7cb49ace001cdbd1137576" dependencies = [ "serde_json", ] [[package]] name = "fedimint-client" -version = "0.2.2" -source = "git+https://github.com/fedimint/fedimint?rev=5ade2536015a12a7e003a42b159ccc4a431e1a32#5ade2536015a12a7e003a42b159ccc4a431e1a32" +version = "0.3.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99f62c41f39ca2a7dda378784cab2dc1932a1bb277177838f898fa4b785ab205" dependencies = [ "anyhow", "aquamarine", @@ -893,7 +958,7 @@ dependencies = [ "fedimint-derive-secret", "fedimint-logging", "futures", - "itertools 0.10.5", + "itertools 0.12.1", "rand", "ring 0.17.8", "secp256k1-zkp 0.7.0", @@ -903,13 +968,15 @@ dependencies = [ "strum_macros", "thiserror", "tokio", + "tokio-stream", "tracing", ] [[package]] name = "fedimint-core" -version = "0.2.2" -source = "git+https://github.com/fedimint/fedimint?rev=5ade2536015a12a7e003a42b159ccc4a431e1a32#5ade2536015a12a7e003a42b159ccc4a431e1a32" +version = "0.3.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b39277ac8b1b5244ca758047b0a807d0ce5d48b828259db47ad220b9decd517" dependencies = [ "anyhow", "async-lock", @@ -929,9 +996,10 @@ 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", @@ -939,6 +1007,7 @@ dependencies = [ "jsonrpsee-ws-client", "lightning 0.0.118", "lightning-invoice 0.26.0", + "lru", "macro_rules_attribute", "miniscript", "parity-scale-codec", @@ -959,19 +1028,21 @@ dependencies = [ [[package]] name = "fedimint-derive" -version = "0.2.2" -source = "git+https://github.com/fedimint/fedimint?rev=5ade2536015a12a7e003a42b159ccc4a431e1a32#5ade2536015a12a7e003a42b159ccc4a431e1a32" +version = "0.3.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d00bf17d4499e74abe422d98e56878f68125c647fd05b2f384a9f3db5d25ae0" 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 = "git+https://github.com/fedimint/fedimint?rev=5ade2536015a12a7e003a42b159ccc4a431e1a32#5ade2536015a12a7e003a42b159ccc4a431e1a32" +version = "0.3.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "306ba3d83ef05dc74c8f74ba8d90d577faa4cf7e4e5abc18ebe3cd12623613c3" dependencies = [ "anyhow", "fedimint-core", @@ -983,16 +1054,18 @@ dependencies = [ [[package]] name = "fedimint-hkdf" -version = "0.2.2" -source = "git+https://github.com/fedimint/fedimint?rev=5ade2536015a12a7e003a42b159ccc4a431e1a32#5ade2536015a12a7e003a42b159ccc4a431e1a32" +version = "0.3.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b28afd502557bdfa4ff8d5efd15ff2d42c924d13a7b0e249f8010a7a09263619" dependencies = [ "bitcoin_hashes 0.11.0", ] [[package]] name = "fedimint-logging" -version = "0.2.2" -source = "git+https://github.com/fedimint/fedimint?rev=5ade2536015a12a7e003a42b159ccc4a431e1a32#5ade2536015a12a7e003a42b159ccc4a431e1a32" +version = "0.3.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15bab5a868d9f912c8a036a97ef41b9067f63f47ca0bdc2e3b31f45ec01f9e7" dependencies = [ "anyhow", "tracing-subscriber", @@ -1000,14 +1073,15 @@ dependencies = [ [[package]] name = "fedimint-mint-client" -version = "0.2.2" -source = "git+https://github.com/fedimint/fedimint?rev=5ade2536015a12a7e003a42b159ccc4a431e1a32#5ade2536015a12a7e003a42b159ccc4a431e1a32" +version = "0.3.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4f42be2e31b12d40b81587bb67ae15abafe01922f29f444c455ef56f882ec86" dependencies = [ "anyhow", "aquamarine", "async-stream", "async-trait", - "base64 0.21.7", + "base64 0.22.0", "bincode", "bitcoin_hashes 0.11.0", "erased-serde", @@ -1019,7 +1093,7 @@ dependencies = [ "fedimint-tbs", "fedimint-threshold-crypto", "futures", - "itertools 0.10.5", + "itertools 0.12.1", "rand", "secp256k1 0.24.3", "secp256k1-zkp 0.7.0", @@ -1035,8 +1109,9 @@ dependencies = [ [[package]] name = "fedimint-mint-common" -version = "0.2.2" -source = "git+https://github.com/fedimint/fedimint?rev=5ade2536015a12a7e003a42b159ccc4a431e1a32#5ade2536015a12a7e003a42b159ccc4a431e1a32" +version = "0.3.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb45236edbb40d1a4e9c25184b7518ff4ca332a86838cd6e1b876e00575770dd" dependencies = [ "anyhow", "async-trait", @@ -1046,7 +1121,7 @@ dependencies = [ "fedimint-tbs", "fedimint-threshold-crypto", "futures", - "itertools 0.10.5", + "itertools 0.12.1", "rand", "secp256k1 0.24.3", "secp256k1-zkp 0.7.0", @@ -1059,8 +1134,9 @@ dependencies = [ [[package]] name = "fedimint-tbs" -version = "0.2.2" -source = "git+https://github.com/fedimint/fedimint?rev=5ade2536015a12a7e003a42b159ccc4a431e1a32#5ade2536015a12a7e003a42b159ccc4a431e1a32" +version = "0.3.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e126b5e9a8fa9ede422fe683b922d2de228f9632b682ae97053dd1130d849937" dependencies = [ "bitcoin_hashes 0.11.0", "bls12_381", @@ -1212,7 +1288,7 @@ version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" dependencies = [ - "gloo-timers", + "gloo-timers 0.2.6", "send_wrapper", ] @@ -1246,9 +1322,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" dependencies = [ "cfg-if", "js-sys", @@ -1265,9 +1341,9 @@ checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[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", @@ -1296,6 +1372,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" @@ -1335,7 +1423,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e91b62f79061a0bc2e046024cb7ba44b08419ed238ecbd9adbd787434b9e8c25" dependencies = [ - "ahash", + "ahash 0.3.8", "autocfg", ] @@ -1350,6 +1438,10 @@ name = "hashbrown" version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" +dependencies = [ + "ahash 0.8.11", + "allocator-api2", +] [[package]] name = "heck" @@ -1455,6 +1547,28 @@ dependencies = [ "unicode-normalization", ] +[[package]] +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 = "144006fb58ed787dcae3f54575ff4349755b00ccc99f4b4873860b654be1ed63" +dependencies = [ + "bitmaps", +] + [[package]] name = "impl-trait-for-tuples" version = "0.2.2" @@ -1538,15 +1652,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" @@ -1564,18 +1669,18 @@ checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "js-sys" -version = "0.3.65" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54c0c35952f67de54bb584e9fd912b3023117cbafc0a77d8f3dee1fb5f572fe8" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ "wasm-bindgen", ] [[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", @@ -1583,10 +1688,11 @@ 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", @@ -1595,9 +1701,9 @@ dependencies = [ [[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", @@ -1606,34 +1712,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", @@ -1642,9 +1749,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", @@ -1764,11 +1871,20 @@ 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.2", +] + [[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", @@ -1776,9 +1892,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" @@ -1803,11 +1919,12 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "miniscript" -version = "9.0.2" +version = "10.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5b106477a0709e2da253e5559ba4ab20a272f8577f1eefff72f3a905b5d35f5" +checksum = "1eb102b66b2127a872dbcc73095b7b47aeb9d92f7b03c2b2298253ffc82c7594" dependencies = [ - "bitcoin 0.29.2", + "bitcoin 0.30.2", + "bitcoin-private", "serde", ] @@ -1993,6 +2110,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" @@ -2198,6 +2321,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 = "redox_syscall" version = "0.4.1" @@ -2378,23 +2510,32 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.10" +version = "0.22.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" +checksum = "e87c9956bd9807afa1f77e0f7594af32566e830e088a5576d27c5b6f30f49d41" dependencies = [ "log", "ring 0.17.8", + "rustls-pki-types", "rustls-webpki", - "sct", + "subtle", + "zeroize", ] +[[package]] +name = "rustls-pki-types" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "868e20fada228fefaf6b652e00cc73623d54f8171e7352c18bb281571f2d92da" + [[package]] name = "rustls-webpki" -version = "0.101.7" +version = "0.102.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" +checksum = "faaa0a62740bedb9b2ef5afa303da42764c012f743917351dc9a237ea1663610" dependencies = [ "ring 0.17.8", + "rustls-pki-types", "untrusted 0.9.0", ] @@ -2790,21 +2931,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]] @@ -2843,18 +2984,18 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[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", @@ -2970,14 +3111,27 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.24.1" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" dependencies = [ - "rustls 0.21.10", + "rustls 0.22.2", + "rustls-pki-types", "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-util" version = "0.7.10" @@ -3208,9 +3362,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.88" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7daec296f25a1bae309c0cd5c29c4b260e510e6d813c286b19eaadf409d40fce" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -3218,9 +3372,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.88" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e397f4664c0e4e428e8313a469aaa58310d302159845980fd23b0f22a847f217" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", "log", @@ -3233,9 +3387,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.38" +version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9afec9963e3d0994cac82455b2b3502b81a7f40f9a0d32181f7528d9f4b43e02" +checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" dependencies = [ "cfg-if", "js-sys", @@ -3245,9 +3399,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.88" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5961017b3b08ad5f3fe39f1e79877f8ee7c23c5e5fd5eb80de95abc41f1f16b2" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3255,9 +3409,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.88" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5353b8dab669f5e10f5bd76df26a9360c748f054f862ff5f3f8aae0c7fb3907" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", @@ -3268,9 +3422,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.88" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d046c5d029ba91a1ed14da14dca44b68bf2f124cfbaf741c54151fdb3e0750b" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "web-sys" @@ -3294,9 +3448,12 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.25.4" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" +checksum = "b3de34ae270483955a94f4b21bdaaeb83d508bb84a01435f393818edb0012009" +dependencies = [ + "rustls-pki-types", +] [[package]] name = "winapi" @@ -3479,6 +3636,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/waila-wasm/src/lib.rs b/waila-wasm/src/lib.rs index 89f033d..7fc9262 100644 --- a/waila-wasm/src/lib.rs +++ b/waila-wasm/src/lib.rs @@ -98,7 +98,9 @@ impl PaymentParams { #[wasm_bindgen(getter)] pub fn fedimint_invite_code(&self) -> Option { - self.params.fedimint_invite_code() + self.params + .fedimint_invite_code() + .map(|code| code.to_string()) } #[wasm_bindgen(getter)] diff --git a/waila/Cargo.toml b/waila/Cargo.toml index 4984e47..34045c7 100644 --- a/waila/Cargo.toml +++ b/waila/Cargo.toml @@ -15,7 +15,6 @@ keywords = ["lightning", "bitcoin", "bip21", "lnurl", "nostr"] crate-type = ["cdylib", "rlib"] [dependencies] -bech32 = { version = "0.9.1" } bitcoin = { version = "0.30.2", default-features = false, features = ["serde"] } bip21 = { version = "0.3.1" } itertools = { version = "0.12.1" } @@ -28,7 +27,8 @@ rgb-wallet = { version = "0.10.9", optional = true } url = { version = "2.4.1" } moksha-core = { git = "https://github.com/ngutech21/moksha", rev = "18d99977965662d46ccec29fecdb0ce493745917" } -fedimint-mint-client = { git = "https://github.com/fedimint/fedimint", rev = "5ade2536015a12a7e003a42b159ccc4a431e1a32" } +fedimint-core = "0.3.0-rc.1" +fedimint-mint-client = "0.3.0-rc.1" [features] default = ["std"] diff --git a/waila/src/lib.rs b/waila/src/lib.rs index c8e3f8c..78878da 100644 --- a/waila/src/lib.rs +++ b/waila/src/lib.rs @@ -1,4 +1,4 @@ -use bech32::Variant; +use fedimint_core::api::InviteCode; use fedimint_mint_client::OOBNotes; use std::convert::{TryFrom, TryInto}; use std::str::FromStr; @@ -38,7 +38,7 @@ pub enum PaymentParams<'a> { LnUrl(LnUrl), LightningAddress(LightningAddress), Nostr(nostr::PublicKey), - FedimintInvite(String), + FedimintInvite(InviteCode), NostrWalletAuth(NIP49URI), CashuToken(TokenV3), FedimintOOBNotes(OOBNotes), @@ -326,7 +326,7 @@ impl PaymentParams<'_> { } } - pub fn fedimint_invite_code(&self) -> Option { + pub fn fedimint_invite_code(&self) -> Option { match self { PaymentParams::OnChain(_) => None, PaymentParams::Bip21(_) => None, @@ -427,19 +427,6 @@ impl PaymentParams<'_> { } } -// just checks if it has correct HRP and variant -fn parse_fedi_invite_code(str: &str) -> Result { - bech32::decode(str) - .map_err(|_| ()) - .and_then(|(hrp, _, variant)| { - if hrp == "fed1" && variant == Variant::Bech32m { - Ok(str.to_string()) - } else { - Err(()) - } - }) -} - impl FromStr for PaymentParams<'_> { type Err = (); @@ -477,7 +464,9 @@ impl FromStr for PaymentParams<'_> { .map_err(|_| ()); } else if lower.starts_with("fedimint:") { let str = lower.strip_prefix("fedimint:").unwrap(); - return parse_fedi_invite_code(str).map(PaymentParams::FedimintInvite); + return InviteCode::from_str(str) + .map(PaymentParams::FedimintInvite) + .map_err(|_| ()); } #[cfg(feature = "rgb")] @@ -502,7 +491,7 @@ impl FromStr for PaymentParams<'_> { .or_else(|_| Refund::from_str(str).map(PaymentParams::Bolt12Refund)) .or_else(|_| NIP49URI::from_str(str).map(PaymentParams::NostrWalletAuth)) .or_else(|_| PublicKey::from_str(str).map(PaymentParams::NodePubkey)) - .or_else(|_| parse_fedi_invite_code(str).map(PaymentParams::FedimintInvite)) + .or_else(|_| InviteCode::from_str(str).map(PaymentParams::FedimintInvite)) .or_else(|_| TokenV3::try_from(str.to_string()).map(PaymentParams::CashuToken)) .or_else(|_| OOBNotes::from_str(str).map(PaymentParams::FedimintOOBNotes)) .map_err(|_| ()) @@ -525,7 +514,7 @@ mod tests { const SAMPLE_BIP21_WITH_INVOICE: &str = "bitcoin:BC1QYLH3U67J673H6Y6ALV70M0PL2YZ53TZHVXGG7U?amount=0.00001&label=sbddesign%3A%20For%20lunch%20Tuesday&message=For%20lunch%20Tuesday&lightning=LNBC10U1P3PJ257PP5YZTKWJCZ5FTL5LAXKAV23ZMZEKAW37ZK6KMV80PK4XAEV5QHTZ7QDPDWD3XGER9WD5KWM36YPRX7U3QD36KUCMGYP282ETNV3SHJCQZPGXQYZ5VQSP5USYC4LK9CHSFP53KVCNVQ456GANH60D89REYKDNGSMTJ6YW3NHVQ9QYYSSQJCEWM5CJWZ4A6RFJX77C490YCED6PEMK0UPKXHY89CMM7SCT66K8GNEANWYKZGDRWRFJE69H9U5U0W57RRCSYSAS7GADWMZXC8C6T0SPJAZUP6"; const SAMPLE_BIP21_WITH_INVOICE_AND_LABEL: &str = "bitcoin:tb1p0vztr8q25czuka5u4ta5pqu0h8dxkf72mam89cpg4tg40fm8wgmqp3gv99?amount=0.000001&label=yooo&lightning=lntbs1u1pjrww6fdq809hk7mcnp4qvwggxr0fsueyrcer4x075walsv93vqvn3vlg9etesx287x6ddy4xpp5a3drwdx2fmkkgmuenpvmynnl7uf09jmgvtlg86ckkvgn99ajqgtssp5gr3aghgjxlwshnqwqn39c2cz5hw4cnsnzxdjn7kywl40rru4mjdq9qyysgqcqpcxqrpwurzjqfgtsj42x8an5zujpxvfhp9ngwm7u5lu8lvzfucjhex4pq8ysj5q2qqqqyqqv9cqqsqqqqlgqqqqqqqqfqzgl9zq04nzpxyvdr8vj3h98gvnj3luanj2cxcra0q2th4xjsxmtj8k3582l67xq9ffz5586f3nm5ax58xaqjg6rjcj2vzvx2q39v9eqpn0wx54"; const SAMPLE_LNURL: &str = "LNURL1DP68GURN8GHJ7UM9WFMXJCM99E3K7MF0V9CXJ0M385EKVCENXC6R2C35XVUKXEFCV5MKVV34X5EKZD3EV56NYD3HXQURZEPEXEJXXEPNXSCRVWFNV9NXZCN9XQ6XYEFHVGCXXCMYXYMNSERXFQ5FNS"; - const SAMPLE_FEDI_INVITE_CODE: &str = "fed11jpr3lgm8tuhcky2r3g287tgk9du7dd7kr95fptdsmkca7cwcvyu0lyqeh0e6rgp4u0shxsfaxycpwqpfwaehxw309askcurgvyhx6at5d9h8jmn9wsknqvfwv3jhvtnxv4jxjcn5vvhxxmmd9udpnpn49yg9w98dejw9u76hmm9"; + const SAMPLE_FEDI_INVITE_CODE: &str = "fed11qgqzc2nhwden5te0vejkg6tdd9h8gepwvejkg6tdd9h8garhduhx6at5d9h8jmn9wshxxmmd9uqqzgxg6s3evnr6m9zdxr6hxkdkukexpcs3mn7mj3g5pc5dfh63l4tj6g9zk4er"; const SAMPLE_NWA: &str = "nostr+walletauth://b889ff5b1513b641e2a139f661a661364979c5beee91842f8f0ef42ab558e9d4?relay=wss%3A%2F%2Frelay.damus.io&secret=b8a30fafa48d4795b6c0eec169a383de&required_commands=pay_invoice&optional_commands=get_balance&budget=10000%2Fdaily"; const SAMPLE_CASHU_TOKEN: &str = "cashuAeyJ0b2tlbiI6W3sibWludCI6Imh0dHBzOi8vODMzMy5zcGFjZTozMzM4IiwicHJvb2ZzIjpbeyJhbW91bnQiOjIsImlkIjoiMDA5YTFmMjkzMjUzZTQxZSIsInNlY3JldCI6IjQwNzkxNWJjMjEyYmU2MWE3N2UzZTZkMmFlYjRjNzI3OTgwYmRhNTFjZDA2YTZhZmMyOWUyODYxNzY4YTc4MzciLCJDIjoiMDJiYzkwOTc5OTdkODFhZmIyY2M3MzQ2YjVlNDM0NWE5MzQ2YmQyYTUwNmViNzk1ODU5OGE3MmYwY2Y4NTE2M2VhIn0seyJhbW91bnQiOjgsImlkIjoiMDA5YTFmMjkzMjUzZTQxZSIsInNlY3JldCI6ImZlMTUxMDkzMTRlNjFkNzc1NmIwZjhlZTBmMjNhNjI0YWNhYTNmNGUwNDJmNjE0MzNjNzI4YzcwNTdiOTMxYmUiLCJDIjoiMDI5ZThlNTA1MGI4OTBhN2Q2YzA5NjhkYjE2YmMxZDVkNWZhMDQwZWExZGUyODRmNmVjNjlkNjEyOTlmNjcxMDU5In1dfV0sInVuaXQiOiJzYXQiLCJtZW1vIjoiVGhhbmsgeW91LiJ9"; const SAMPLE_FEDIMINT_OOB_NOTES: &str = "AgEEyNQjlgD9AaMFEAGPoosRshrR37QwoMzyQtjRqIOw+zqlqJUlMP4tY8PmLkQwDzZxOIqvBRwdWLR7ZR4hCh5CH4pgBDDxJoKh9FSHFuVfaicAF4a2xc8QNYlwtv0BAAGxQ4CfvfXB6XAaMPyVlWjt7a2Z1bvh18bKx9i0NX0KmC/KAwzo7nzxe5aISrcKYw2qheA65rSoOA6oAYs1YegPWIAcKWl4YfPaROIdlv8zfP0CAAGzD8GzMknXfXv102IzMADaL/ZGs9351HPbZMkOxrdB4WeyhEy5bnOFI0YIBUHs/ESKeDVm1Yv9j19y7mDIyXDmvFIwtCXDjFqWE4i0qzrdzv0EAAGsB8LTXGGZyW7KZDE3CtMbWXTgIuBa3A/nll/foeD5VOACUraOkeRMeNIiZvTellBa9CHtIRpWXlt46hKSFWjpQRh4Jk/ga+t0WlJ//Mxihv0gAAGSm+bQkczA4F1lvg9Vh2yJmgGTtElL4U3uhW+xuP5lsxz+kPwR3qUMX0KJfOE4oN5XpwYDQVoPRroiXAcnakM9thPeMyycDMENeNSKQ1LBmA=="; @@ -901,7 +890,7 @@ mod tests { assert_eq!(parsed.invoice(), None); assert_eq!(parsed.node_pubkey(), None); assert_eq!( - parsed.fedimint_invite_code(), + parsed.fedimint_invite_code().map(|c| c.to_string()), Some(SAMPLE_FEDI_INVITE_CODE.to_string()) ); } @@ -918,7 +907,7 @@ mod tests { assert_eq!(parsed.invoice(), None); assert_eq!(parsed.node_pubkey(), None); assert_eq!( - parsed.fedimint_invite_code(), + parsed.fedimint_invite_code().map(|c| c.to_string()), Some(SAMPLE_FEDI_INVITE_CODE.to_string()) ); }