forked from janek/mostr
1
0
Fork 0

feat: update to nostr sdk 0.36

This commit is contained in:
xeruf 2024-11-14 18:53:52 +01:00
parent 9a9c30dbb7
commit 43f8a3ebca
8 changed files with 147 additions and 136 deletions

245
Cargo.lock generated
View File

@ -141,6 +141,12 @@ version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b"
[[package]]
name = "arrayvec"
version = "0.7.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50"
[[package]] [[package]]
name = "async-broadcast" name = "async-broadcast"
version = "0.7.1" version = "0.7.1"
@ -274,9 +280,9 @@ dependencies = [
[[package]] [[package]]
name = "async-wsocket" name = "async-wsocket"
version = "0.7.1" version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1eee6fcc818b89848df37050215603de0e2e072734e4730c03060feb2d0abebb" checksum = "a107e3bdbe61e8e1e1341c57241b4b2d50501127b44bd2eff13b4635ab42d35a"
dependencies = [ dependencies = [
"async-utility", "async-utility",
"futures", "futures",
@ -328,18 +334,22 @@ dependencies = [
"rustc-demangle", "rustc-demangle",
] ]
[[package]]
name = "base58ck"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2c8d66485a3a2ea485c1913c4572ce0256067a5377ac8c75c4960e1cda98605f"
dependencies = [
"bitcoin-internals 0.3.0",
"bitcoin_hashes 0.14.0",
]
[[package]] [[package]]
name = "base64" name = "base64"
version = "0.13.1" version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8"
[[package]]
name = "base64"
version = "0.21.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567"
[[package]] [[package]]
name = "base64" name = "base64"
version = "0.22.1" version = "0.22.1"
@ -354,9 +364,9 @@ checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b"
[[package]] [[package]]
name = "bech32" name = "bech32"
version = "0.10.0-beta" version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "98f7eed2b2781a6f0b5c903471d48e15f56fb4e1165df8a9a2337fd1a59d45ea" checksum = "d965446196e3b7decd44aa7ee49e31d630118f90ef12f97900f262eb915c951d"
[[package]] [[package]]
name = "beef" name = "beef"
@ -377,14 +387,17 @@ dependencies = [
[[package]] [[package]]
name = "bitcoin" name = "bitcoin"
version = "0.31.2" version = "0.32.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6c85783c2fe40083ea54a33aa2f0ba58831d90fcd190f5bdc47e74e84d2a96ae" checksum = "788902099d47c8682efe6a7afb01c8d58b9794ba66c06affd81c3d6b560743eb"
dependencies = [ dependencies = [
"base58ck",
"bech32", "bech32",
"bitcoin-internals", "bitcoin-internals 0.3.0",
"bitcoin_hashes 0.13.0", "bitcoin-io",
"hex-conservative", "bitcoin-units",
"bitcoin_hashes 0.14.0",
"hex-conservative 0.2.1",
"hex_lit", "hex_lit",
"secp256k1", "secp256k1",
"serde", "serde",
@ -395,10 +408,32 @@ name = "bitcoin-internals"
version = "0.2.0" version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9425c3bf7089c983facbae04de54513cce73b41c7f9ff8c845b54e7bc64ebbfb" checksum = "9425c3bf7089c983facbae04de54513cce73b41c7f9ff8c845b54e7bc64ebbfb"
[[package]]
name = "bitcoin-internals"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "30bdbe14aa07b06e6cfeffc529a1f099e5fbe249524f8125358604df99a4bed2"
dependencies = [ dependencies = [
"serde", "serde",
] ]
[[package]]
name = "bitcoin-io"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b47c4ab7a93edb0c7198c5535ed9b52b63095f4e9b45279c6736cec4b856baf"
[[package]]
name = "bitcoin-units"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5285c8bcaa25876d07f37e3d30c303f2609179716e11d688f51e8f1fe70063e2"
dependencies = [
"bitcoin-internals 0.3.0",
"serde",
]
[[package]] [[package]]
name = "bitcoin_hashes" name = "bitcoin_hashes"
version = "0.11.0" version = "0.11.0"
@ -411,8 +446,18 @@ version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1930a4dabfebb8d7d9992db18ebe3ae2876f0a305fab206fd168df931ede293b" checksum = "1930a4dabfebb8d7d9992db18ebe3ae2876f0a305fab206fd168df931ede293b"
dependencies = [ dependencies = [
"bitcoin-internals", "bitcoin-internals 0.2.0",
"hex-conservative", "hex-conservative 0.1.2",
]
[[package]]
name = "bitcoin_hashes"
version = "0.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bb18c03d0db0247e147a21a6faafd5a7eb851c743db062de72018b6b7e8e4d16"
dependencies = [
"bitcoin-io",
"hex-conservative 0.2.1",
"serde", "serde",
] ]
@ -435,7 +480,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "afa748e348ad3be8263be728124b24a24f268266f6f5d58af9d75f6a40b5c587" checksum = "afa748e348ad3be8263be728124b24a24f268266f6f5d58af9d75f6a40b5c587"
dependencies = [ dependencies = [
"arrayref", "arrayref",
"arrayvec", "arrayvec 0.5.2",
"constant_time_eq", "constant_time_eq",
] ]
@ -1091,6 +1136,15 @@ version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "212ab92002354b4819390025006c897e8140934349e8635c9b077f47b4dcbd20" checksum = "212ab92002354b4819390025006c897e8140934349e8635c9b077f47b4dcbd20"
[[package]]
name = "hex-conservative"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5313b072ce3c597065a808dbf612c4c8e8590bdbf8b579508bf7a762c5eae6cd"
dependencies = [
"arrayvec 0.7.6",
]
[[package]] [[package]]
name = "hex_lit" name = "hex_lit"
version = "0.1.1" version = "0.1.1"
@ -1172,9 +1226,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4"
[[package]] [[package]]
name = "hyper" name = "hyper"
version = "1.4.1" version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" checksum = "bbbff0a806a4728c99295b254c8838933b5b082d75e3cb70c8dab21fdfbcfa9a"
dependencies = [ dependencies = [
"bytes", "bytes",
"futures-channel", "futures-channel",
@ -1191,9 +1245,9 @@ dependencies = [
[[package]] [[package]]
name = "hyper-rustls" name = "hyper-rustls"
version = "0.27.2" version = "0.27.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333"
dependencies = [ dependencies = [
"futures-util", "futures-util",
"http", "http",
@ -1209,9 +1263,9 @@ dependencies = [
[[package]] [[package]]
name = "hyper-util" name = "hyper-util"
version = "0.1.7" version = "0.1.10"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cde7055719c54e36e95e8719f95883f22072a48ede39db7fc17a4e1d5281e9b9" checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4"
dependencies = [ dependencies = [
"bytes", "bytes",
"futures-channel", "futures-channel",
@ -1222,7 +1276,6 @@ dependencies = [
"pin-project-lite", "pin-project-lite",
"socket2", "socket2",
"tokio", "tokio",
"tower",
"tower-service", "tower-service",
"tracing", "tracing",
] ]
@ -1304,9 +1357,9 @@ dependencies = [
[[package]] [[package]]
name = "ipnet" name = "ipnet"
version = "2.9.0" version = "2.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708"
[[package]] [[package]]
name = "is_terminal_polyfill" name = "is_terminal_polyfill"
@ -1414,9 +1467,9 @@ checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89"
[[package]] [[package]]
name = "lnurl-pay" name = "lnurl-pay"
version = "0.5.0" version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "02c042191c2e3f27147decfad8182eea2c7dd1c6c1733562e25d3d401369669d" checksum = "536e7c782167a2d48346ca0b2677fad19eaef20f19a4ab868e4d5b96ca879def"
dependencies = [ dependencies = [
"bech32", "bech32",
"reqwest", "reqwest",
@ -1564,6 +1617,12 @@ version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e664971378a3987224f7a0e10059782035e89899ae403718ee07de85bec42afe" checksum = "e664971378a3987224f7a0e10059782035e89899ae403718ee07de85bec42afe"
[[package]]
name = "negentropy"
version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "43a88da9dd148bbcdce323dd6ac47d369b4769d4a3b78c6c52389b9269f77932"
[[package]] [[package]]
name = "nibble_vec" name = "nibble_vec"
version = "0.1.0" version = "0.1.0"
@ -1609,12 +1668,14 @@ dependencies = [
[[package]] [[package]]
name = "nostr" name = "nostr"
version = "0.34.1" version = "0.36.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a1c3c32439eef3ea4d9079b2a8f557992d27259c26527e43d4228dd321e43a77" checksum = "14ad56c1d9a59f4edc46b17bc64a217b38b99baefddc0080f85ad98a0855336d"
dependencies = [ dependencies = [
"aes", "aes",
"base64 0.21.7", "async-trait",
"base64 0.22.1",
"bech32",
"bip39", "bip39",
"bitcoin", "bitcoin",
"cbc", "cbc",
@ -1623,13 +1684,13 @@ dependencies = [
"getrandom 0.2.15", "getrandom 0.2.15",
"instant", "instant",
"js-sys", "js-sys",
"negentropy", "negentropy 0.3.1",
"negentropy 0.4.3",
"once_cell", "once_cell",
"reqwest", "reqwest",
"scrypt", "scrypt",
"serde", "serde",
"serde_json", "serde_json",
"tracing",
"unicode-normalization", "unicode-normalization",
"url", "url",
"wasm-bindgen", "wasm-bindgen",
@ -1639,9 +1700,9 @@ dependencies = [
[[package]] [[package]]
name = "nostr-database" name = "nostr-database"
version = "0.34.0" version = "0.36.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1926ef55392f3eea1bbe4a1358b64bbf12dd6eb554f40f483941a102c6263fc6" checksum = "1859abebf78d7d9e945b20c8faaf710c9db905adeb148035b803ae45792dbebe"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"lru", "lru",
@ -1653,13 +1714,15 @@ dependencies = [
[[package]] [[package]]
name = "nostr-relay-pool" name = "nostr-relay-pool"
version = "0.34.1" version = "0.36.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d0e37c5ea991802a91728d4c09d5a7276938104ead8bf140a63a60acabc5c756" checksum = "e39cfcb30cab86b30ca9acba89f5ccb25a4142a5dc5fcfbf3edf34b204ddd7c7"
dependencies = [ dependencies = [
"async-utility", "async-utility",
"async-wsocket", "async-wsocket",
"atomic-destructor", "atomic-destructor",
"negentropy 0.3.1",
"negentropy 0.4.3",
"nostr", "nostr",
"nostr-database", "nostr-database",
"thiserror", "thiserror",
@ -1670,9 +1733,9 @@ dependencies = [
[[package]] [[package]]
name = "nostr-sdk" name = "nostr-sdk"
version = "0.34.0" version = "0.36.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ca0c0c5f8ddbdfc064ea71883191ec53de6ed52b5dca10ab07f0810b99e91acc" checksum = "e4739ed15ff81a0e474d79b38c3eb481ff5f968c1865f38ba46852daf6f6495e"
dependencies = [ dependencies = [
"async-utility", "async-utility",
"atomic-destructor", "atomic-destructor",
@ -1680,7 +1743,6 @@ dependencies = [
"nostr", "nostr",
"nostr-database", "nostr-database",
"nostr-relay-pool", "nostr-relay-pool",
"nostr-signer",
"nostr-zapper", "nostr-zapper",
"nwc", "nwc",
"thiserror", "thiserror",
@ -1688,25 +1750,11 @@ dependencies = [
"tracing", "tracing",
] ]
[[package]]
name = "nostr-signer"
version = "0.34.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c30294a7be7d9d5ac777954812f5c7b4ae2a1e583a62e33537f87d98ab23729"
dependencies = [
"async-utility",
"nostr",
"nostr-relay-pool",
"thiserror",
"tokio",
"tracing",
]
[[package]] [[package]]
name = "nostr-zapper" name = "nostr-zapper"
version = "0.34.0" version = "0.36.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dcf3ba30e807145e9cb924faf8fb0719e460f613088e99c753b67c2a9929c5b7" checksum = "9d9709ecf8050bbe4ecf0e5efda2f25b690bb1761fc504e05654621ba9e568a8"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"nostr", "nostr",
@ -1788,10 +1836,11 @@ dependencies = [
[[package]] [[package]]
name = "nwc" name = "nwc"
version = "0.34.1" version = "0.36.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9a16ac06bc273fcd4ead47c0c5a58b6cc7db2247fc7a64dd9bc11cf18e3efeb4" checksum = "1b5f98bcaf232b3ec48e018792ca7bc2b90e7520d001a07b8218a9e76a03fda2"
dependencies = [ dependencies = [
"async-trait",
"async-utility", "async-utility",
"nostr", "nostr",
"nostr-relay-pool", "nostr-relay-pool",
@ -1811,9 +1860,9 @@ dependencies = [
[[package]] [[package]]
name = "once_cell" name = "once_cell"
version = "1.19.0" version = "1.20.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775"
[[package]] [[package]]
name = "opaque-debug" name = "opaque-debug"
@ -1918,26 +1967,6 @@ dependencies = [
"siphasher", "siphasher",
] ]
[[package]]
name = "pin-project"
version = "1.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3"
dependencies = [
"pin-project-internal",
]
[[package]]
name = "pin-project-internal"
version = "1.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]] [[package]]
name = "pin-project-lite" name = "pin-project-lite"
version = "0.2.14" version = "0.2.14"
@ -2022,9 +2051,9 @@ dependencies = [
[[package]] [[package]]
name = "quinn" name = "quinn"
version = "0.11.4" version = "0.11.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a2d2fb862b7ba45e615c1429def928f2e15f815bdf933b27a2d3824e224c1f46" checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684"
dependencies = [ dependencies = [
"bytes", "bytes",
"pin-project-lite", "pin-project-lite",
@ -2040,9 +2069,9 @@ dependencies = [
[[package]] [[package]]
name = "quinn-proto" name = "quinn-proto"
version = "0.11.7" version = "0.11.8"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ea0a9b3a42929fad8a7c3de7f86ce0814cfa893328157672680e9fb1145549c5" checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6"
dependencies = [ dependencies = [
"bytes", "bytes",
"rand", "rand",
@ -2057,10 +2086,11 @@ dependencies = [
[[package]] [[package]]
name = "quinn-udp" name = "quinn-udp"
version = "0.5.4" version = "0.5.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" checksum = "7d5a626c6807713b15cac82a6acaccd6043c9a5408c24baae07611fec3f243da"
dependencies = [ dependencies = [
"cfg_aliases",
"libc", "libc",
"once_cell", "once_cell",
"socket2", "socket2",
@ -2176,9 +2206,9 @@ checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b"
[[package]] [[package]]
name = "reqwest" name = "reqwest"
version = "0.12.7" version = "0.12.9"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f8f4955649ef5c38cc7f9e8aa41761d48fb9677197daea9984dc54f56aad5e63" checksum = "a77c62af46e79de0a562e1a9849205ffcb7fc1238876e9bd743357570e04046f"
dependencies = [ dependencies = [
"base64 0.22.1", "base64 0.22.1",
"bytes", "bytes",
@ -2366,9 +2396,9 @@ dependencies = [
[[package]] [[package]]
name = "secp256k1" name = "secp256k1"
version = "0.28.2" version = "0.29.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d24b59d129cdadea20aea4fb2352fa053712e5d713eee47d700cd4b2bc002f10" checksum = "9465315bc9d4566e1724f0fffcbcc446268cb522e60f9a27bcded6b19c108113"
dependencies = [ dependencies = [
"bitcoin_hashes 0.13.0", "bitcoin_hashes 0.13.0",
"rand", "rand",
@ -2378,9 +2408,9 @@ dependencies = [
[[package]] [[package]]
name = "secp256k1-sys" name = "secp256k1-sys"
version = "0.9.2" version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e5d1746aae42c19d583c3c1a8c646bfad910498e2051c551a7f2e3c0c9fbb7eb" checksum = "d4387882333d3aa8cb20530a17c69a3752e97837832f34f6dccc760e715001d9"
dependencies = [ dependencies = [
"cc", "cc",
] ]
@ -2735,9 +2765,9 @@ dependencies = [
[[package]] [[package]]
name = "tokio-tungstenite" name = "tokio-tungstenite"
version = "0.23.1" version = "0.24.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c6989540ced10490aaf14e6bad2e3d33728a2813310a0c71d1574304c49631cd" checksum = "edc5f74e248dc973e0dbb7b74c7e0d6fcc301c694ff50049504004ef4d0cdcd9"
dependencies = [ dependencies = [
"futures-util", "futures-util",
"log", "log",
@ -2766,27 +2796,6 @@ dependencies = [
"winnow", "winnow",
] ]
[[package]]
name = "tower"
version = "0.4.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c"
dependencies = [
"futures-core",
"futures-util",
"pin-project",
"pin-project-lite",
"tokio",
"tower-layer",
"tower-service",
]
[[package]]
name = "tower-layer"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e"
[[package]] [[package]]
name = "tower-service" name = "tower-service"
version = "0.3.3" version = "0.3.3"
@ -2832,9 +2841,9 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
[[package]] [[package]]
name = "tungstenite" name = "tungstenite"
version = "0.23.0" version = "0.24.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6e2e2ce1e47ed2994fd43b04c8f618008d4cabdd5ee34027cf14f9d918edd9c8" checksum = "18e5b8366ee7a95b16d32197d0b2604b43a0be89dc5fac9f8e96ccafbaedda8a"
dependencies = [ dependencies = [
"byteorder", "byteorder",
"bytes", "bytes",

View File

@ -30,8 +30,9 @@ itertools = "0.12"
chrono = "0.4" chrono = "0.4"
parse_datetime = "0.5.0" parse_datetime = "0.5.0"
interim = { version = "0.1", features = ["chrono"] } interim = { version = "0.1", features = ["chrono"] }
nostr-sdk = "0.34" # { git = "https://github.com/rust-nostr/nostr" } nostr-sdk = "0.36" # { git = "https://github.com/xeruf/rust-nostr-sdk", rev = "7b556e1e" }
[dev-dependencies] [dev-dependencies]
tokio = { version = "1.41", features = ["rt", "rt-multi-thread", "macros", "io-std"] }
chrono-english = "0.1" chrono-english = "0.1"
linefeed = "0.6" linefeed = "0.6"

View File

@ -53,7 +53,7 @@ impl EventSender {
} }
} }
let mut queue = self.queue.borrow_mut(); let mut queue = self.queue.borrow_mut();
Ok(event_builder.to_event(&self.keys).inspect(|event| { Ok(event_builder.sign_with_keys(&self.keys).inspect(|event| {
if event.kind == TRACKING_KIND if event.kind == TRACKING_KIND
&& event.created_at > min && event.created_at > min
&& event.created_at < tasks::now() && event.created_at < tasks::now()

View File

@ -120,7 +120,7 @@ where
{ {
match Local.timestamp_opt(stamp.as_u64() as i64 + 1, 0) { match Local.timestamp_opt(stamp.as_u64() as i64 + 1, 0) {
Single(time) => formatter(time), Single(time) => formatter(time),
_ => stamp.to_human_datetime(), _ => stamp.to_human_datetime().to_string(),
} }
} }

View File

@ -131,7 +131,7 @@ fn format_tag(tag: &Tag) -> String {
}) => format!("Key{}: {:.8}", public_key, alias.as_ref().map(|s| format!(" {s}")).unwrap_or_default()), }) => format!("Key{}: {:.8}", public_key, alias.as_ref().map(|s| format!(" {s}")).unwrap_or_default()),
Some(TagStandard::Hashtag(content)) => Some(TagStandard::Hashtag(content)) =>
format!("#{content}"), format!("#{content}"),
_ => tag.as_vec().join(" ") _ => tag.as_slice().join(" ")
} }
} }

View File

@ -64,7 +64,7 @@ fn read_keys(readline: &mut DefaultEditor) -> Result<Keys> {
let keys_entry = Entry::new("mostr", "keys")?; let keys_entry = Entry::new("mostr", "keys")?;
if let Ok(pass) = keys_entry.get_secret() { if let Ok(pass) = keys_entry.get_secret() {
return Ok(SecretKey::from_slice(&pass).map(|s| Keys::new(s)) return Ok(SecretKey::from_slice(&pass).map(|s| Keys::new(s))
.inspect_err(|e| eprintln!("Invalid key in keychain: {e}"))?) .inspect_err(|e| eprintln!("Invalid key in keychain: {e}"))?);
} }
let line = readline.readline("Secret key? (leave blank to generate and save a new keypair) ")?; let line = readline.readline("Secret key? (leave blank to generate and save a new keypair) ")?;
let keys = if line.is_empty() { let keys = if line.is_empty() {
@ -74,7 +74,7 @@ fn read_keys(readline: &mut DefaultEditor) -> Result<Keys> {
Keys::from_str(&line) Keys::from_str(&line)
.inspect_err(|e| eprintln!("Invalid key provided: {e}"))? .inspect_err(|e| eprintln!("Invalid key provided: {e}"))?
}; };
or_warn!(keys_entry.set_secret(keys.secret_key()?.as_secret_bytes()), or_warn!(keys_entry.set_secret(keys.secret_key().as_secret_bytes()),
"Could not persist keys"); "Could not persist keys");
Ok(keys) Ok(keys)
} }
@ -126,7 +126,7 @@ async fn main() -> Result<()> {
if let Ok(Some(keys)) = fs::read_to_string(key_file.as_path()).map(|s| or_warn!(Keys::from_str(&s.trim()))) { if let Ok(Some(keys)) = fs::read_to_string(key_file.as_path()).map(|s| or_warn!(Keys::from_str(&s.trim()))) {
info!("Migrating private key from plaintext file {}", key_file.to_string_lossy()); info!("Migrating private key from plaintext file {}", key_file.to_string_lossy());
or_warn!(Entry::new("mostr", "keys") or_warn!(Entry::new("mostr", "keys")
.and_then(|e| e.set_secret(keys.secret_key().unwrap().as_secret_bytes())) .and_then(|e| e.set_secret(keys.secret_key().as_secret_bytes()))
.inspect(|_| { or_warn!(fs::remove_file(key_file)); })); .inspect(|_| { or_warn!(fs::remove_file(key_file)); }));
} }
@ -136,8 +136,9 @@ async fn main() -> Result<()> {
let client = ClientBuilder::new() let client = ClientBuilder::new()
.opts(Options::new() .opts(Options::new()
.automatic_authentication(true) .automatic_authentication(true)
.pool(RelayPoolOptions::new().notification_channel_size(8192))) //.notification_channel_size(8192)
.signer(&keys) )
.signer(keys.clone())
.build(); .build();
info!("My public key: {}", keys.public_key()); info!("My public key: {}", keys.public_key());
@ -232,7 +233,7 @@ async fn main() -> Result<()> {
queue = Some((queue_url, queue_events)); queue = Some((queue_url, queue_events));
} else { } else {
info!("Sending {} events to {queue_url} due to relay change", queue_events.len()); info!("Sending {} events to {queue_url} due to relay change", queue_events.len());
client.batch_event_to(vec![queue_url], queue_events, RelaySendOptions::new()).await; client.batch_event_to(vec![queue_url], queue_events).await;
queue = None; queue = None;
} }
} }
@ -244,7 +245,7 @@ async fn main() -> Result<()> {
Ok(Some(MostrMessage::Flush)) | Err(Elapsed { .. }) => if let Some((url, events)) = queue { Ok(Some(MostrMessage::Flush)) | Err(Elapsed { .. }) => if let Some((url, events)) = queue {
info!("Sending {} events to {url} due to {}", events.len(), info!("Sending {} events to {url} due to {}", events.len(),
result_received.map_or("inactivity", |_| "flush message")); result_received.map_or("inactivity", |_| "flush message"));
client.batch_event_to(vec![url], events, RelaySendOptions::new()).await; client.batch_event_to(vec![url], events).await;
queue = None; queue = None;
} }
Ok(None) => { Ok(None) => {
@ -255,7 +256,7 @@ async fn main() -> Result<()> {
} }
if let Some((url, events)) = queue { if let Some((url, events)) = queue {
info!("Sending {} events to {url} before exiting", events.len()); info!("Sending {} events to {url} before exiting", events.len());
client.batch_event_to(vec![url], events, RelaySendOptions::new()).await; client.batch_event_to(vec![url], events).await;
} }
info!("Shutting down nostr communication thread"); info!("Shutting down nostr communication thread");
}); });
@ -296,7 +297,7 @@ async fn main() -> Result<()> {
{ {
debug!( debug!(
"At {} found {} kind {} content \"{}\" tags {:?}", "At {} found {} kind {} content \"{}\" tags {:?}",
event.created_at, event.id, event.kind, event.content, event.tags.iter().map(|tag| tag.as_vec()).collect_vec() event.created_at, event.id, event.kind, event.content, event.tags.iter().map(|tag| tag.as_slice()).collect_vec()
); );
match relays.get_mut(&Some(relay_url.clone())) { match relays.get_mut(&Some(relay_url.clone())) {
Some(tasks) => tasks.add(*event), Some(tasks) => tasks.add(*event),

View File

@ -354,23 +354,23 @@ mod tasks_test {
let keys = Keys::generate(); let keys = Keys::generate();
let mut task = Task::new( let mut task = Task::new(
EventBuilder::new(TASK_KIND, "task", [Tag::hashtag("tag1")]) EventBuilder::new(TASK_KIND, "task", [Tag::hashtag("tag1")])
.to_event(&keys).unwrap()); .sign_with_keys(&keys).unwrap());
assert_eq!(task.pure_state(), State::Open); assert_eq!(task.pure_state(), State::Open);
assert_eq!(task.get_hashtags().count(), 1); assert_eq!(task.get_hashtags().count(), 1);
task.props.insert( task.props.insert(
EventBuilder::new(State::Done.into(), "", []) EventBuilder::new(State::Done.into(), "", [])
.to_event(&keys).unwrap()); .sign_with_keys(&keys).unwrap());
assert_eq!(task.pure_state(), State::Done); assert_eq!(task.pure_state(), State::Done);
task.props.insert( task.props.insert(
EventBuilder::new(State::Open.into(), "", [Tag::hashtag("tag2")]) EventBuilder::new(State::Open.into(), "", [Tag::hashtag("tag2")])
.custom_created_at(Timestamp::from(Timestamp::now() - 2)) .custom_created_at(Timestamp::from(Timestamp::now() - 2))
.to_event(&keys).unwrap()); .sign_with_keys(&keys).unwrap());
assert_eq!(task.pure_state(), State::Done); assert_eq!(task.pure_state(), State::Done);
assert_eq!(task.get_hashtags().count(), 2); assert_eq!(task.get_hashtags().count(), 2);
task.props.insert( task.props.insert(
EventBuilder::new(State::Closed.into(), "", []) EventBuilder::new(State::Closed.into(), "", [])
.custom_created_at(Timestamp::from(Timestamp::now() + 1)) .custom_created_at(Timestamp::from(Timestamp::now() + 1))
.to_event(&keys).unwrap()); .sign_with_keys(&keys).unwrap());
assert_eq!(task.pure_state(), State::Closed); assert_eq!(task.pure_state(), State::Closed);
} }
} }

View File

@ -978,7 +978,7 @@ impl TasksRelay {
match event.kind { match event.kind {
Kind::GitIssue => self.add_task(event), Kind::GitIssue => self.add_task(event),
Kind::Metadata => Kind::Metadata =>
match Metadata::from_json(event.content()) { match Metadata::from_json(event.content.as_str()) {
Ok(metadata) => { self.users.insert(event.pubkey, metadata); } Ok(metadata) => { self.users.insert(event.pubkey, metadata); }
Err(e) => warn!("Cannot parse metadata: {} from {:?}", e, event) Err(e) => warn!("Cannot parse metadata: {} from {:?}", e, event)
} }