diff --git a/Cargo.lock b/Cargo.lock index 482f55bb..f34e91b5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -135,7 +135,7 @@ checksum = "9fb4009533e8ff8f1450a5bcbc30f4242a1d34442221f72314bea1f5dc9c7f89" dependencies = [ "clipboard-win", "core-graphics 0.23.2", - "image 0.25.2", + "image", "log", "objc2", "objc2-app-kit", @@ -169,7 +169,7 @@ dependencies = [ "nom", "num-traits", "rusticata-macros", - "thiserror", + "thiserror 1.0.63", "time", ] @@ -181,7 +181,7 @@ checksum = "965c2d33e53cb6b267e148a4cb0760bc01f4904c1cd4bb4002a085bb016d1490" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.87", "synstructure", ] @@ -193,7 +193,7 @@ checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.87", ] [[package]] @@ -331,9 +331,9 @@ checksum = "d86b93f97252c47b41663388e6d155714a9d0c398b99f1005cbc5f978b29f445" [[package]] name = "bigdecimal" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d712318a27c7150326677b321a5fa91b55f6d9034ffd67f20319e147d40cee" +checksum = "8f850665a0385e070b64c38d2354e6c104c8479c59868d1e48a0c13ee2c7a1c1" dependencies = [ "autocfg", "libm", @@ -371,7 +371,7 @@ dependencies = [ "regex", "rustc-hash 1.1.0", "shlex", - "syn 2.0.77", + "syn 2.0.87", "which", ] @@ -386,12 +386,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "bit_field" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc827186963e592360843fb5ba4b973e145841266c1357f7180c43526f2e5b61" - [[package]] name = "bitcoin_hashes" version = "0.11.0" @@ -460,9 +454,9 @@ dependencies = [ [[package]] name = "brotli" -version = "6.0.0" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74f7971dbd9326d58187408ab83117d8ac1bb9c17b085fdacd1cf2f598719b6b" +checksum = "cc97b8f16f944bba54f0433f07e30be199b6dc2bd25937444bbad560bcea29bd" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -523,7 +517,7 @@ dependencies = [ "glib", "libc", "once_cell", - "thiserror", + "thiserror 1.0.63", ] [[package]] @@ -566,7 +560,7 @@ dependencies = [ "semver", "serde", "serde_json", - "thiserror", + "thiserror 1.0.63", ] [[package]] @@ -670,7 +664,7 @@ dependencies = [ "hkdf", "lru", "sha2", - "thiserror", + "thiserror 1.0.63", ] [[package]] @@ -686,7 +680,7 @@ dependencies = [ "hkdf", "lru", "sha2", - "thiserror", + "thiserror 1.0.63", ] [[package]] @@ -698,7 +692,7 @@ dependencies = [ "chia-protocol", "chia-traits 0.15.0", "futures-util", - "thiserror", + "thiserror 1.0.63", "tokio", "tokio-tungstenite", "tungstenite", @@ -721,7 +715,7 @@ dependencies = [ "clvmr", "hex", "hex-literal", - "thiserror", + "thiserror 1.0.63", ] [[package]] @@ -759,8 +753,7 @@ dependencies = [ [[package]] name = "chia-sdk-client" version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c67bd78889331985558c3af7075b897e98d5507a5fb67945b42233dd22efe795" +source = "git+https://github.com/xch-dev/chia-wallet-sdk?rev=543743574fc15662395dc5d15b1cbf250783f802#543743574fc15662395dc5d15b1cbf250783f802" dependencies = [ "aws-lc-rs", "chia-protocol", @@ -771,7 +764,7 @@ dependencies = [ "once_cell", "rustls 0.22.4", "rustls-pemfile", - "thiserror", + "thiserror 1.0.63", "tokio", "tokio-tungstenite", "tracing", @@ -781,20 +774,19 @@ dependencies = [ [[package]] name = "chia-sdk-derive" version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a12346c930c0fb76fa6bc23e6516b42a6f05e80806df05875470d0775c072bd8" +source = "git+https://github.com/xch-dev/chia-wallet-sdk?rev=543743574fc15662395dc5d15b1cbf250783f802#543743574fc15662395dc5d15b1cbf250783f802" dependencies = [ "convert_case 0.6.0", "quote", - "syn 2.0.77", + "syn 2.0.87", ] [[package]] name = "chia-sdk-driver" version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58e79b60cf224d50468ee2c8c4fc340cdbf75185d25fffbb0dde10d6bf74917f" +source = "git+https://github.com/xch-dev/chia-wallet-sdk?rev=543743574fc15662395dc5d15b1cbf250783f802#543743574fc15662395dc5d15b1cbf250783f802" dependencies = [ + "bigdecimal", "chia-bls 0.15.0", "chia-protocol", "chia-puzzles", @@ -805,14 +797,13 @@ dependencies = [ "hex", "hex-literal", "num-bigint", - "thiserror", + "thiserror 1.0.63", ] [[package]] name = "chia-sdk-offers" version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60e1971c02703801882c1eb3d0944b7f7f734eed4cba759a8d5aa221f3fe6533" +source = "git+https://github.com/xch-dev/chia-wallet-sdk?rev=543743574fc15662395dc5d15b1cbf250783f802#543743574fc15662395dc5d15b1cbf250783f802" dependencies = [ "bech32", "chia-bls 0.15.0", @@ -827,14 +818,13 @@ dependencies = [ "flate2", "indexmap 2.5.0", "once_cell", - "thiserror", + "thiserror 1.0.63", ] [[package]] name = "chia-sdk-signer" version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ceacf2e67ab136876d93953f6eafff83741a32dffdb79db6a7423a6ef725a15b" +source = "git+https://github.com/xch-dev/chia-wallet-sdk?rev=543743574fc15662395dc5d15b1cbf250783f802#543743574fc15662395dc5d15b1cbf250783f802" dependencies = [ "chia-bls 0.15.0", "chia-consensus", @@ -842,14 +832,13 @@ dependencies = [ "chia-sdk-types", "clvm-traits", "clvmr", - "thiserror", + "thiserror 1.0.63", ] [[package]] name = "chia-sdk-test" version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8766d35aede3b78992d24c7aa5e5b5b857a08811758dc2a84a099db939e71134" +source = "git+https://github.com/xch-dev/chia-wallet-sdk?rev=543743574fc15662395dc5d15b1cbf250783f802#543743574fc15662395dc5d15b1cbf250783f802" dependencies = [ "anyhow", "bip39", @@ -867,12 +856,13 @@ dependencies = [ "fastrand", "futures-channel", "futures-util", + "hex", "indexmap 2.5.0", "itertools 0.13.0", "log", "rand 0.8.5", "rand_chacha 0.3.1", - "thiserror", + "thiserror 1.0.63", "tokio", "tokio-tungstenite", ] @@ -880,8 +870,7 @@ dependencies = [ [[package]] name = "chia-sdk-types" version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd8e649d15459fd9f47230c2620f333885b258b24d653529c7f72035c029e239" +source = "git+https://github.com/xch-dev/chia-wallet-sdk?rev=543743574fc15662395dc5d15b1cbf250783f802#543743574fc15662395dc5d15b1cbf250783f802" dependencies = [ "chia-bls 0.15.0", "chia-consensus", @@ -896,8 +885,7 @@ dependencies = [ [[package]] name = "chia-sdk-utils" version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b8f6b1e64bd47130e0b6a3e29ea0e18bcf29c347c0159abaf658e3a9cc23a5c" +source = "git+https://github.com/xch-dev/chia-wallet-sdk?rev=543743574fc15662395dc5d15b1cbf250783f802#543743574fc15662395dc5d15b1cbf250783f802" dependencies = [ "bech32", "chia-protocol", @@ -905,7 +893,7 @@ dependencies = [ "indexmap 2.5.0", "rand 0.8.5", "rand_chacha 0.3.1", - "thiserror", + "thiserror 1.0.63", ] [[package]] @@ -927,7 +915,7 @@ dependencies = [ "rand 0.8.5", "rcgen", "rsa", - "thiserror", + "thiserror 1.0.63", "time", ] @@ -939,7 +927,7 @@ checksum = "1fb786114e5c748fe0af3ba1e95840fa1910b28f7300c05184506045aff60bb6" dependencies = [ "chia_streamable_macro 0.10.0", "sha2", - "thiserror", + "thiserror 1.0.63", ] [[package]] @@ -950,14 +938,13 @@ checksum = "e57bbde886b38a9a5df185e751d90e295d14e99659bf43df7fa701d52d4da1ea" dependencies = [ "chia-sha2", "chia_streamable_macro 0.15.0", - "thiserror", + "thiserror 1.0.63", ] [[package]] name = "chia-wallet-sdk" version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "670dfb279ca9431828e526914356ce0be5bb25c44fa84d38387bdc7639be9d2c" +source = "git+https://github.com/xch-dev/chia-wallet-sdk?rev=543743574fc15662395dc5d15b1cbf250783f802#543743574fc15662395dc5d15b1cbf250783f802" dependencies = [ "chia-sdk-client", "chia-sdk-driver", @@ -977,7 +964,7 @@ dependencies = [ "proc-macro-crate 1.3.1", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.87", ] [[package]] @@ -989,7 +976,7 @@ dependencies = [ "proc-macro-crate 1.3.1", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.87", ] [[package]] @@ -1043,7 +1030,7 @@ checksum = "67bf4a5d8f6991d385c78c2371ea603de5c2dbf9aebf4e6e801d0dece0e8485d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.87", ] [[package]] @@ -1056,7 +1043,7 @@ dependencies = [ "clvm-derive", "clvmr", "num-bigint", - "thiserror", + "thiserror 1.0.63", ] [[package]] @@ -1127,12 +1114,6 @@ dependencies = [ "objc", ] -[[package]] -name = "color_quant" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" - [[package]] name = "combine" version = "4.6.7" @@ -1173,6 +1154,16 @@ dependencies = [ "unicode-segmentation", ] +[[package]] +name = "cookie" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ddef33a339a91ea89fb53151bd0a4689cfce27055c291dfa69945475d22c747" +dependencies = [ + "time", + "version_check", +] + [[package]] name = "core-foundation" version = "0.9.4" @@ -1323,12 +1314,6 @@ version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - [[package]] name = "crypto-bigint" version = "0.5.5" @@ -1376,7 +1361,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" dependencies = [ "quote", - "syn 2.0.77", + "syn 2.0.87", ] [[package]] @@ -1386,7 +1371,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" dependencies = [ "quote", - "syn 2.0.77", + "syn 2.0.87", ] [[package]] @@ -1419,7 +1404,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.77", + "syn 2.0.87", ] [[package]] @@ -1430,7 +1415,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.77", + "syn 2.0.87", ] [[package]] @@ -1484,7 +1469,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn 2.0.77", + "syn 2.0.87", ] [[package]] @@ -1534,7 +1519,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.87", ] [[package]] @@ -1557,7 +1542,7 @@ checksum = "f2b99bf03862d7f545ebc28ddd33a665b50865f4dfd84031a393823879bd4c54" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.87", ] [[package]] @@ -1728,22 +1713,6 @@ dependencies = [ "pin-project-lite", ] -[[package]] -name = "exr" -version = "1.72.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "887d93f60543e9a9362ef8a21beedd0a833c5d9610e18c67abe15a5963dcb1a4" -dependencies = [ - "bit_field", - "flume", - "half", - "lebe", - "miniz_oxide 0.7.4", - "rayon-core", - "smallvec", - "zune-inflate", -] - [[package]] name = "fastrand" version = "2.1.1" @@ -1790,15 +1759,6 @@ dependencies = [ "miniz_oxide 0.8.0", ] -[[package]] -name = "fluent-uri" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17c704e9dbe1ddd863da1e6ff3567795087b1eb201ce80d8fa81162e1516500d" -dependencies = [ - "bitflags 1.3.2", -] - [[package]] name = "flume" version = "0.11.0" @@ -1834,7 +1794,7 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.87", ] [[package]] @@ -1933,7 +1893,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.87", ] [[package]] @@ -2073,19 +2033,6 @@ dependencies = [ "x11", ] -[[package]] -name = "generator" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc16584ff22b460a382b7feec54b23d2908d858152e5739a120b949293bd74e" -dependencies = [ - "cc", - "libc", - "log", - "rustversion", - "windows 0.48.0", -] - [[package]] name = "generic-array" version = "0.14.7" @@ -2139,16 +2086,6 @@ dependencies = [ "polyval", ] -[[package]] -name = "gif" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fb2d69b19215e18bb912fa30f7ce15846e301408695e44e0ef719f1da9e19f2" -dependencies = [ - "color_quant", - "weezl", -] - [[package]] name = "gimli" version = "0.29.0" @@ -2171,7 +2108,7 @@ dependencies = [ "once_cell", "pin-project-lite", "smallvec", - "thiserror", + "thiserror 1.0.63", ] [[package]] @@ -2207,7 +2144,7 @@ dependencies = [ "memchr", "once_cell", "smallvec", - "thiserror", + "thiserror 1.0.63", ] [[package]] @@ -2221,7 +2158,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.87", ] [[package]] @@ -2311,7 +2248,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.87", ] [[package]] @@ -2333,16 +2270,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "half" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" -dependencies = [ - "cfg-if", - "crunchy", -] - [[package]] name = "hashbrown" version = "0.12.3" @@ -2586,24 +2513,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "image" -version = "0.24.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5690139d2f55868e080017335e4b94cb7414274c74f1669c84fb5feba2c9f69d" -dependencies = [ - "bytemuck", - "byteorder", - "color_quant", - "exr", - "gif", - "jpeg-decoder", - "num-traits", - "png", - "qoi", - "tiff", -] - [[package]] name = "image" version = "0.25.2" @@ -2641,9 +2550,9 @@ dependencies = [ [[package]] name = "infer" -version = "0.15.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb33622da908807a06f9513c19b3c1ad50fab3e4137d82a78107d502075aa199" +checksum = "bc150e5ce2330295b8616ce0e3f53250e53af31759a9dbedad1621ba29151847" dependencies = [ "cfb", ] @@ -2755,7 +2664,7 @@ dependencies = [ "combine", "jni-sys", "log", - "thiserror", + "thiserror 1.0.63", "walkdir", "windows-sys 0.45.0", ] @@ -2780,9 +2689,6 @@ name = "jpeg-decoder" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f5d4a7da358eff58addd2877a45865158f0d78c911d43a5784ceb7bbf52833b0" -dependencies = [ - "rayon", -] [[package]] name = "js-sys" @@ -2795,23 +2701,22 @@ dependencies = [ [[package]] name = "json-patch" -version = "2.0.0" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b1fb8864823fad91877e6caea0baca82e49e8db50f8e5c9f9a453e27d3330fc" +checksum = "863726d7afb6bc2590eeff7135d923545e5e964f004c2ccf8716c25e70a86f08" dependencies = [ "jsonptr", "serde", "serde_json", - "thiserror", + "thiserror 1.0.63", ] [[package]] name = "jsonptr" -version = "0.4.7" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c6e529149475ca0b2820835d3dce8fcc41c6b943ca608d32f35b449255e4627" +checksum = "5dea2b27dd239b2556ed7a25ba842fe47fd602e7fc7433c2a8d6106d4d9edd70" dependencies = [ - "fluent-uri", "serde", "serde_json", ] @@ -2869,12 +2774,6 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" -[[package]] -name = "lebe" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03087c2bad5e1034e8cace5926dec053fb3790248370865f5117a7d0213354c8" - [[package]] name = "libappindicator" version = "0.9.0" @@ -2922,7 +2821,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" dependencies = [ "cfg-if", - "windows-targets 0.52.6", + "windows-targets 0.48.5", ] [[package]] @@ -2987,21 +2886,6 @@ version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" -[[package]] -name = "loom" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff50ecb28bb86013e935fb6683ab1f6d3a20016f123c76fd4c27470076ac30f5" -dependencies = [ - "cfg-if", - "generator", - "scoped-tls", - "serde", - "serde_json", - "tracing", - "tracing-subscriber", -] - [[package]] name = "lru" version = "0.12.4" @@ -3131,20 +3015,21 @@ checksum = "c9be0862c1b3f26a88803c4a49de6889c10e608b3ee9344e6ef5b45fb37ad3d1" [[package]] name = "muda" -version = "0.14.1" +version = "0.15.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba8ac4080fb1e097c2c22acae467e46e4da72d941f02e82b67a87a2a89fa38b1" +checksum = "fdae9c00e61cc0579bcac625e8ad22104c60548a025bfc972dc83868a28e1484" dependencies = [ - "cocoa", "crossbeam-channel", "dpi", "gtk", "keyboard-types", - "objc", + "objc2", + "objc2-app-kit", + "objc2-foundation", "once_cell", "png", "serde", - "thiserror", + "thiserror 1.0.63", "windows-sys 0.59.0", ] @@ -3160,7 +3045,7 @@ dependencies = [ "ndk-sys", "num_enum", "raw-window-handle", - "thiserror", + "thiserror 1.0.63", ] [[package]] @@ -3301,7 +3186,7 @@ dependencies = [ "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.87", ] [[package]] @@ -3311,7 +3196,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" dependencies = [ "malloc_buf", - "objc_exception", ] [[package]] @@ -3319,6 +3203,9 @@ name = "objc-sys" version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cdb91bdd390c7ce1a8607f35f3ca7151b65afc0ff5ff3b34fa350f7d7c7e4310" +dependencies = [ + "cc", +] [[package]] name = "objc2" @@ -3346,6 +3233,30 @@ dependencies = [ "objc2-quartz-core", ] +[[package]] +name = "objc2-cloud-kit" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74dd3b56391c7a0596a295029734d3c1c5e7e510a4cb30245f8221ccea96b009" +dependencies = [ + "bitflags 2.6.0", + "block2", + "objc2", + "objc2-core-location", + "objc2-foundation", +] + +[[package]] +name = "objc2-contacts" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5ff520e9c33812fd374d8deecef01d4a840e7b41862d849513de77e44aa4889" +dependencies = [ + "block2", + "objc2", + "objc2-foundation", +] + [[package]] name = "objc2-core-data" version = "0.2.2" @@ -3370,6 +3281,18 @@ dependencies = [ "objc2-metal", ] +[[package]] +name = "objc2-core-location" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "000cfee34e683244f284252ee206a27953279d370e309649dc3ee317b37e5781" +dependencies = [ + "block2", + "objc2", + "objc2-contacts", + "objc2-foundation", +] + [[package]] name = "objc2-encode" version = "4.0.3" @@ -3389,6 +3312,18 @@ dependencies = [ "objc2", ] +[[package]] +name = "objc2-link-presentation" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1a1ae721c5e35be65f01a03b6d2ac13a54cb4fa70d8a5da293d7b0020261398" +dependencies = [ + "block2", + "objc2", + "objc2-app-kit", + "objc2-foundation", +] + [[package]] name = "objc2-metal" version = "0.2.2" @@ -3415,21 +3350,71 @@ dependencies = [ ] [[package]] -name = "objc_exception" -version = "0.1.2" +name = "objc2-symbols" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad970fb455818ad6cba4c122ad012fae53ae8b4795f86378bce65e4f6bab2ca4" +checksum = "0a684efe3dec1b305badae1a28f6555f6ddd3bb2c2267896782858d5a78404dc" dependencies = [ - "cc", + "objc2", + "objc2-foundation", ] [[package]] -name = "objc_id" -version = "0.1.1" +name = "objc2-ui-kit" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c92d4ddb4bd7b50d730c215ff871754d0da6b2178849f8a2a2ab69712d0c073b" +checksum = "b8bb46798b20cd6b91cbd113524c490f1686f4c4e8f49502431415f3512e2b6f" dependencies = [ - "objc", + "bitflags 2.6.0", + "block2", + "objc2", + "objc2-cloud-kit", + "objc2-core-data", + "objc2-core-image", + "objc2-core-location", + "objc2-foundation", + "objc2-link-presentation", + "objc2-quartz-core", + "objc2-symbols", + "objc2-uniform-type-identifiers", + "objc2-user-notifications", +] + +[[package]] +name = "objc2-uniform-type-identifiers" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44fa5f9748dbfe1ca6c0b79ad20725a11eca7c2218bceb4b005cb1be26273bfe" +dependencies = [ + "block2", + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-user-notifications" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76cfcbf642358e8689af64cee815d139339f3ed8ad05103ed5eaf73db8d84cb3" +dependencies = [ + "bitflags 2.6.0", + "block2", + "objc2", + "objc2-core-location", + "objc2-foundation", +] + +[[package]] +name = "objc2-web-kit" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68bc69301064cebefc6c4c90ce9cba69225239e4b8ff99d445a2b5563797da65" +dependencies = [ + "bitflags 2.6.0", + "block2", + "objc2", + "objc2-app-kit", + "objc2-foundation", ] [[package]] @@ -3713,7 +3698,7 @@ dependencies = [ "phf_shared 0.11.2", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.87", ] [[package]] @@ -3760,7 +3745,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.87", ] [[package]] @@ -3868,7 +3853,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "479cf940fbbb3426c32c5d5176f62ad57549a0bb84773423ba8be9d089f5faba" dependencies = [ "proc-macro2", - "syn 2.0.77", + "syn 2.0.87", ] [[package]] @@ -3947,15 +3932,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "qoi" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f6d64c71eb498fe9eae14ce4ec935c555749aef511cca85b5568910d6e48001" -dependencies = [ - "bytemuck", -] - [[package]] name = "quick-xml" version = "0.32.0" @@ -3978,7 +3954,7 @@ dependencies = [ "rustc-hash 2.0.0", "rustls 0.23.12", "socket2", - "thiserror", + "thiserror 1.0.63", "tokio", "tracing", ] @@ -3995,7 +3971,7 @@ dependencies = [ "rustc-hash 2.0.0", "rustls 0.23.12", "slab", - "thiserror", + "thiserror 1.0.63", "tinyvec", "tracing", ] @@ -4160,7 +4136,7 @@ checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ "getrandom 0.2.15", "libredox", - "thiserror", + "thiserror 1.0.63", ] [[package]] @@ -4403,12 +4379,6 @@ dependencies = [ "untrusted 0.9.0", ] -[[package]] -name = "rustversion" -version = "1.0.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" - [[package]] name = "ryu" version = "1.0.18" @@ -4446,7 +4416,7 @@ dependencies = [ "chia", "chia-wallet-sdk", "sqlx", - "thiserror", + "thiserror 1.0.63", ] [[package]] @@ -4462,7 +4432,7 @@ dependencies = [ "rand_chacha 0.3.1", "serde", "serde_with", - "thiserror", + "thiserror 1.0.63", ] [[package]] @@ -4523,7 +4493,7 @@ dependencies = [ "sage-database", "serde", "serde_json", - "thiserror", + "thiserror 1.0.63", "tokio", "tracing", ] @@ -4549,6 +4519,7 @@ dependencies = [ "serde", "serde_json", "url", + "uuid", ] [[package]] @@ -4560,15 +4531,9 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.77", + "syn 2.0.87", ] -[[package]] -name = "scoped-tls" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" - [[package]] name = "scopeguard" version = "1.2.0" @@ -4646,7 +4611,7 @@ checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.87", ] [[package]] @@ -4657,7 +4622,7 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.87", ] [[package]] @@ -4680,7 +4645,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.87", ] [[package]] @@ -4731,7 +4696,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.87", ] [[package]] @@ -4931,7 +4896,7 @@ dependencies = [ "indexmap 2.5.0", "paste", "specta-macros", - "thiserror", + "thiserror 1.0.63", ] [[package]] @@ -4943,7 +4908,7 @@ dependencies = [ "Inflector", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.87", ] [[package]] @@ -4953,7 +4918,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12260cbb21abb2e83a0375b1521867910e3aed8a7afa782206150ce552cd2e5a" dependencies = [ "specta", - "thiserror", + "thiserror 1.0.63", ] [[package]] @@ -4964,7 +4929,7 @@ checksum = "b1e4472229365ceb6395487e3a60d921ad8e21f9ad06eaecc396f098902c9adc" dependencies = [ "specta", "specta-serde", - "thiserror", + "thiserror 1.0.63", ] [[package]] @@ -5041,7 +5006,7 @@ dependencies = [ "sha2", "smallvec", "sqlformat", - "thiserror", + "thiserror 1.0.63", "tokio", "tokio-stream", "tracing", @@ -5058,7 +5023,7 @@ dependencies = [ "quote", "sqlx-core", "sqlx-macros-core", - "syn 2.0.77", + "syn 2.0.87", ] [[package]] @@ -5081,7 +5046,7 @@ dependencies = [ "sqlx-mysql", "sqlx-postgres", "sqlx-sqlite", - "syn 2.0.77", + "syn 2.0.87", "tempfile", "tokio", "url", @@ -5124,7 +5089,7 @@ dependencies = [ "smallvec", "sqlx-core", "stringprep", - "thiserror", + "thiserror 1.0.63", "tracing", "whoami", ] @@ -5162,7 +5127,7 @@ dependencies = [ "smallvec", "sqlx-core", "stringprep", - "thiserror", + "thiserror 1.0.63", "tracing", "whoami", ] @@ -5196,15 +5161,6 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" -[[package]] -name = "state" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b8c4a4445d81357df8b1a650d0d0d6fbbbfe99d064aa5e02f3e4022061476d8" -dependencies = [ - "loom", -] - [[package]] name = "string_cache" version = "0.8.7" @@ -5278,9 +5234,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.77" +version = "2.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" +checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" dependencies = [ "proc-macro2", "quote", @@ -5304,7 +5260,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.87", ] [[package]] @@ -5322,9 +5278,9 @@ dependencies = [ [[package]] name = "tao" -version = "0.29.1" +version = "0.30.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3a97abbc7d6cfd0720da3e06fcb1cf2ac87cbfdb5bbbce103a1279a211c4d81" +checksum = "0368f818393ddb38d84cf7446adbf343cca3896da7dd2c8c2311059c11cb1740" dependencies = [ "bitflags 2.6.0", "cocoa", @@ -5353,7 +5309,7 @@ dependencies = [ "tao-macros", "unicode-segmentation", "url", - "windows 0.58.0", + "windows", "windows-core 0.58.0", "windows-version", "x11-dl", @@ -5367,7 +5323,7 @@ checksum = "f4e16beb8b2ac17db28eab8bca40e62dbfbb34c0fcdc6d9826b11b7b5d047dfd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.87", ] [[package]] @@ -5378,13 +5334,12 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "tauri" -version = "2.0.0-rc.8" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8345ccc676ef16e26b61fc0f5340b4e770678b1e1f53f08c69ebdac5e56b422" +checksum = "c24f1ab82d336e09f5f1094a4d9227c99ac26cce263bfdf8136897cc6db6f1d0" dependencies = [ "anyhow", "bytes", - "cocoa", "dirs", "dunce", "embed_plist", @@ -5399,8 +5354,11 @@ dependencies = [ "log", "mime", "muda", - "objc", + "objc2", + "objc2-app-kit", + "objc2-foundation", "percent-encoding", + "plist", "raw-window-handle", "reqwest", "serde", @@ -5408,14 +5366,13 @@ dependencies = [ "serde_repr", "serialize-to-javascript", "specta", - "state", "swift-rs", "tauri-build", "tauri-macros", "tauri-runtime", "tauri-runtime-wry", "tauri-utils", - "thiserror", + "thiserror 2.0.3", "tokio", "tray-icon", "url", @@ -5423,14 +5380,14 @@ dependencies = [ "webkit2gtk", "webview2-com", "window-vibrancy", - "windows 0.58.0", + "windows", ] [[package]] name = "tauri-build" -version = "2.0.0-rc.7" +version = "2.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d5ad5fcfaf02cf79aa6727f6c5df38567d8dce172b00b62690c6bc46c08b7ce" +checksum = "7bd2a4bcfaf5fb9f4be72520eefcb61ae565038f8ccba2a497d8c28f463b8c01" dependencies = [ "anyhow", "cargo_toml", @@ -5450,9 +5407,9 @@ dependencies = [ [[package]] name = "tauri-codegen" -version = "2.0.0-rc.7" +version = "2.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "809ef6316726fc72593d296cf6f4e7461326e310c313d6a6c42b6e7f1e2671cf" +checksum = "bf79faeecf301d3e969b1fae977039edb77a4c1f25cc0a961be298b54bff97cf" dependencies = [ "base64 0.22.1", "brotli", @@ -5466,9 +5423,9 @@ dependencies = [ "serde", "serde_json", "sha2", - "syn 2.0.77", + "syn 2.0.87", "tauri-utils", - "thiserror", + "thiserror 2.0.3", "time", "url", "uuid", @@ -5477,23 +5434,23 @@ dependencies = [ [[package]] name = "tauri-macros" -version = "2.0.0-rc.6" +version = "2.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1359e8861d210d25731f8b1bfbb4d111dd06406cf73c59659366ef450364d811" +checksum = "c52027c8c5afb83166dacddc092ee8fff50772f9646d461d8c33ee887e447a03" dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.87", "tauri-codegen", "tauri-utils", ] [[package]] name = "tauri-plugin" -version = "2.0.0-rc.7" +version = "2.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7dded420c86183f592d0fe925ef9447f41e26fa79f0bdfef8d3f17bfbcdbfb7" +checksum = "e753f2a30933a9bbf0a202fa47d7cc4a3401f06e8d6dcc53b79aa62954828c79" dependencies = [ "anyhow", "glob", @@ -5508,25 +5465,24 @@ dependencies = [ [[package]] name = "tauri-plugin-clipboard-manager" -version = "2.0.0-rc.3" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a9d78deb78704d9eeedc23892fc6b25a944c7f9c59354a0ea9a4fb5ab043794" +checksum = "2a66feaa0fb7fce8e5073323d11ca381c9da7ac06f458e42b9ff77364b76a360" dependencies = [ "arboard", - "image 0.24.9", "log", "serde", "serde_json", "tauri", "tauri-plugin", - "thiserror", + "thiserror 1.0.63", ] [[package]] name = "tauri-plugin-shell" -version = "2.0.0-rc.3" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e83800ddf78b820172efb5ed7310344e8e4f97fd30cd8237a3f20c12a79eb136" +checksum = "0ad7880c5586b6b2104be451e3d7fc0f3800c84bda69e9ba81c828f87cb34267" dependencies = [ "encoding_rs", "log", @@ -5539,15 +5495,15 @@ dependencies = [ "shared_child", "tauri", "tauri-plugin", - "thiserror", + "thiserror 1.0.63", "tokio", ] [[package]] name = "tauri-runtime" -version = "2.0.0-rc.7" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75c72b844f387bfc3341c355f3e16b8cbf4161848fa4e348670effb222cd3ba5" +checksum = "cce18d43f80d4aba3aa8a0c953bbe835f3d0f2370aca75e8dbb14bd4bab27958" dependencies = [ "dpi", "gtk", @@ -5557,22 +5513,24 @@ dependencies = [ "serde", "serde_json", "tauri-utils", - "thiserror", + "thiserror 2.0.3", "url", - "windows 0.58.0", + "windows", ] [[package]] name = "tauri-runtime-wry" -version = "2.0.0-rc.7" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73accf936a7cd01d1382de7850726fdf6c1f6ab3b01ccb7a0950cb852e332596" +checksum = "9f442a38863e10129ffe2cec7bd09c2dcf8a098a3a27801a476a304d5bb991d2" dependencies = [ - "cocoa", "gtk", "http", "jni", "log", + "objc2", + "objc2-app-kit", + "objc2-foundation", "percent-encoding", "raw-window-handle", "softbuffer", @@ -5582,15 +5540,15 @@ dependencies = [ "url", "webkit2gtk", "webview2-com", - "windows 0.58.0", + "windows", "wry", ] [[package]] name = "tauri-specta" -version = "2.0.0-rc.18" +version = "2.0.0-rc.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2d58f5067f811ac923825ed15a95baa76313891ddc9ccfe28e4526e86477347" +checksum = "5d06336a2fa3ead0c8d08719e78cbc1fb73650845789605bd2ab908cbde72815" dependencies = [ "heck 0.5.0", "serde", @@ -5599,7 +5557,7 @@ dependencies = [ "specta-typescript", "tauri", "tauri-specta-macros", - "thiserror", + "thiserror 1.0.63", ] [[package]] @@ -5611,14 +5569,14 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.87", ] [[package]] name = "tauri-utils" -version = "2.0.0-rc.7" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d53d9fe87e985b273696ae22ce2b9f099a8f1b44bc8fb127467bda5fcb3e4371" +checksum = "9271a88f99b4adea0dc71d0baca4505475a0bbd139fb135f62958721aaa8fe54" dependencies = [ "brotli", "cargo_metadata", @@ -5626,6 +5584,7 @@ dependencies = [ "dunce", "glob", "html5ever", + "http", "infer", "json-patch", "kuchikiki", @@ -5642,10 +5601,11 @@ dependencies = [ "serde_json", "serde_with", "swift-rs", - "thiserror", + "thiserror 2.0.3", "toml 0.8.19", "url", "urlpattern", + "uuid", "walkdir", ] @@ -5695,7 +5655,16 @@ version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" dependencies = [ - "thiserror-impl", + "thiserror-impl 1.0.63", +] + +[[package]] +name = "thiserror" +version = "2.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c006c85c7651b3cf2ada4584faa36773bd07bac24acfb39f3c431b36d7e667aa" +dependencies = [ + "thiserror-impl 2.0.3", ] [[package]] @@ -5706,7 +5675,18 @@ checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.87", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f077553d607adc1caf65430528a576c757a71ed73944b66ebb58ef2bbd243568" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] @@ -5811,7 +5791,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.87", ] [[package]] @@ -5993,7 +5973,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3566e8ce28cc0a3fe42519fc80e6b4c943cc4c8cef275620eb8dac2d3d4e06cf" dependencies = [ "crossbeam-channel", - "thiserror", + "thiserror 1.0.63", "time", "tracing-subscriber", ] @@ -6006,7 +5986,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.87", ] [[package]] @@ -6050,9 +6030,9 @@ dependencies = [ [[package]] name = "tray-icon" -version = "0.16.0" +version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "131a65b2cef2081bc14dbcd414c906edbfa3bb5323dd7e748cc298614681196b" +checksum = "7c92af36a182b46206723bdf8a7942e20838cde1cf062e5b97854d57eb01763b" dependencies = [ "core-graphics 0.24.0", "crossbeam-channel", @@ -6065,7 +6045,7 @@ dependencies = [ "once_cell", "png", "serde", - "thiserror", + "thiserror 1.0.63", "windows-sys 0.59.0", ] @@ -6091,7 +6071,7 @@ dependencies = [ "rustls 0.22.4", "rustls-pki-types", "sha1", - "thiserror", + "thiserror 1.0.63", "url", "utf-8", ] @@ -6224,11 +6204,10 @@ dependencies = [ [[package]] name = "urlpattern" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9bd5ff03aea02fa45b13a7980151fe45009af1980ba69f651ec367121a31609" +checksum = "70acd30e3aa1450bc2eece896ce2ad0d178e9c079493819301573dae3c37ba6d" dependencies = [ - "derive_more", "regex", "serde", "unic-ucd-ident", @@ -6248,6 +6227,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" dependencies = [ "getrandom 0.2.15", + "serde", ] [[package]] @@ -6353,7 +6333,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.87", "wasm-bindgen-shared", ] @@ -6387,7 +6367,7 @@ checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.87", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -6482,7 +6462,7 @@ checksum = "6f61ff3d9d0ee4efcb461b14eb3acfda2702d10dc329f339303fc3e57215ae2c" dependencies = [ "webview2-com-macros", "webview2-com-sys", - "windows 0.58.0", + "windows", "windows-core 0.58.0", "windows-implement", "windows-interface", @@ -6496,7 +6476,7 @@ checksum = "1d228f15bba3b9d56dde8bddbee66fa24545bd17b48d5128ccf4a8742b18e431" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.87", ] [[package]] @@ -6505,8 +6485,8 @@ version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3a3e2eeb58f82361c93f9777014668eb3d07e7d174ee4c819575a9208011886" dependencies = [ - "thiserror", - "windows 0.58.0", + "thiserror 1.0.63", + "windows", "windows-core 0.58.0", ] @@ -6582,15 +6562,6 @@ dependencies = [ "windows-version", ] -[[package]] -name = "windows" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" -dependencies = [ - "windows-targets 0.48.5", -] - [[package]] name = "windows" version = "0.58.0" @@ -6631,7 +6602,7 @@ checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.87", ] [[package]] @@ -6642,7 +6613,7 @@ checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.87", ] [[package]] @@ -6928,14 +6899,13 @@ dependencies = [ [[package]] name = "wry" -version = "0.42.0" +version = "0.47.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49b8049c8f239cdbfaaea4bacb9646f6b208938ceec0acd5b3e99cd05f70903f" +checksum = "553ca1ce149982123962fac2506aa75b8b76288779a77e72b12fa2fc34938647" dependencies = [ "base64 0.22.1", - "block", - "cocoa", - "core-graphics 0.24.0", + "block2", + "cookie", "crossbeam-channel", "dpi", "dunce", @@ -6948,19 +6918,23 @@ dependencies = [ "kuchikiki", "libc", "ndk", - "objc", - "objc_id", + "objc2", + "objc2-app-kit", + "objc2-foundation", + "objc2-ui-kit", + "objc2-web-kit", "once_cell", "percent-encoding", "raw-window-handle", "sha2", "soup3", "tao-macros", - "thiserror", + "thiserror 1.0.63", + "url", "webkit2gtk", "webkit2gtk-sys", "webview2-com", - "windows 0.58.0", + "windows", "windows-core 0.58.0", "windows-version", "x11-dl", @@ -7018,7 +6992,7 @@ dependencies = [ "oid-registry", "ring", "rusticata-macros", - "thiserror", + "thiserror 1.0.63", "time", ] @@ -7049,7 +7023,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.87", ] [[package]] @@ -7069,14 +7043,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", -] - -[[package]] -name = "zune-inflate" -version = "0.2.54" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73ab332fe2f6680068f3582b16a24f90ad7096d5d39b974d1c0aff0125116f02" -dependencies = [ - "simd-adler32", + "syn 2.0.87", ] diff --git a/Cargo.toml b/Cargo.toml index d2e706d8..89c07c71 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -59,15 +59,15 @@ bigdecimal = "0.4.5" base64 = "0.22.1" # Tauri -tauri = "=2.0.0-rc.8" -tauri-plugin-clipboard-manager = "=2.0.0-rc.3" -tauri-plugin-shell = "=2.0.0-rc.3" -tauri-build = "=2.0.0-rc.7" +tauri = "2.1.0" +tauri-plugin-clipboard-manager = "2.0.2" +tauri-plugin-shell = "2.0.2" +tauri-build = "2.0.3" # Specta specta = "2.0.0-rc.20" specta-typescript = "0.0.7" -tauri-specta = "=2.0.0-rc.18" +tauri-specta = "2.0.0-rc.20" # Chia chia = "0.15.0" @@ -105,3 +105,6 @@ tracing = "0.1.40" tracing-subscriber = "0.3.18" tracing-appender = "0.2.3" log = "0.4.22" + +[patch.crates-io] +chia-wallet-sdk = { git = "https://github.com/xch-dev/chia-wallet-sdk", rev = "543743574fc15662395dc5d15b1cbf250783f802" } diff --git a/crates/sage-api/src/requests.rs b/crates/sage-api/src/requests.rs index 75ed8c58..f6a36a3d 100644 --- a/crates/sage-api/src/requests.rs +++ b/crates/sage-api/src/requests.rs @@ -2,8 +2,10 @@ mod bulk_mint_nfts; mod get_collection_nfts; mod get_nft_collections; mod get_nfts; +mod make_offer; pub use bulk_mint_nfts::*; pub use get_collection_nfts::*; pub use get_nft_collections::*; pub use get_nfts::*; +pub use make_offer::*; diff --git a/crates/sage-api/src/requests/make_offer.rs b/crates/sage-api/src/requests/make_offer.rs new file mode 100644 index 00000000..ddbd7611 --- /dev/null +++ b/crates/sage-api/src/requests/make_offer.rs @@ -0,0 +1,23 @@ +use serde::{Deserialize, Serialize}; +use specta::Type; + +use crate::Amount; + +#[derive(Debug, Clone, Serialize, Deserialize, Type)] +pub struct MakeOffer { + pub requested_assets: Assets, + pub offered_assets: Assets, +} + +#[derive(Debug, Clone, Serialize, Deserialize, Type)] +pub struct Assets { + pub xch: Amount, + pub cats: Vec, + pub nfts: Vec, +} + +#[derive(Debug, Clone, Serialize, Deserialize, Type)] +pub struct CatAmount { + pub asset_id: String, + pub amount: Amount, +} diff --git a/crates/sage-wallet/src/error.rs b/crates/sage-wallet/src/error.rs index c6cd05ec..f2aca772 100644 --- a/crates/sage-wallet/src/error.rs +++ b/crates/sage-wallet/src/error.rs @@ -77,4 +77,10 @@ pub enum WalletError { #[error("Missing NFT with id {0}")] MissingNft(Bytes32), + + #[error("Invalid trade price")] + InvalidTradePrice, + + #[error("Invalid royalty amount")] + InvalidRoyaltyAmount, } diff --git a/crates/sage-wallet/src/sync_manager/peer_discovery.rs b/crates/sage-wallet/src/sync_manager/peer_discovery.rs index a6af74e4..2e17c7ae 100644 --- a/crates/sage-wallet/src/sync_manager/peer_discovery.rs +++ b/crates/sage-wallet/src/sync_manager/peer_discovery.rs @@ -234,7 +234,7 @@ impl SyncManager { let mut state = self.state.lock().await; - for (peer, height) in state.peers_with_heights() { + for (existing_peer, height) in state.peers_with_heights() { if message.height < height.saturating_sub(3) { debug!( "Peer {} is behind by more than 3 blocks, disconnecting", @@ -243,7 +243,7 @@ impl SyncManager { return false; } else if message.height > height.saturating_add(3) { state.ban( - peer.socket_addr().ip(), + existing_peer.socket_addr().ip(), Duration::from_secs(900), "peer is behind", ); diff --git a/crates/sage-wallet/src/utils.rs b/crates/sage-wallet/src/utils.rs index 4650ade8..5b5b6cb7 100644 --- a/crates/sage-wallet/src/utils.rs +++ b/crates/sage-wallet/src/utils.rs @@ -1,7 +1,9 @@ mod fetch_nft_did; +mod fetch_nft_offer_details; mod fetch_uri; mod offchain_metadata; pub use fetch_nft_did::*; +pub use fetch_nft_offer_details::*; pub use fetch_uri::*; pub use offchain_metadata::*; diff --git a/crates/sage-wallet/src/utils/fetch_nft_offer_details.rs b/crates/sage-wallet/src/utils/fetch_nft_offer_details.rs new file mode 100644 index 00000000..b6a16dba --- /dev/null +++ b/crates/sage-wallet/src/utils/fetch_nft_offer_details.rs @@ -0,0 +1,60 @@ +use std::time::Duration; + +use chia::{ + clvm_traits::{FromClvm, ToClvm}, + protocol::{Bytes32, Program}, +}; +use chia_wallet_sdk::{HashedPtr, Nft, Puzzle}; +use clvmr::Allocator; +use tokio::time::{sleep, timeout}; + +use crate::{NftOfferDetails, WalletError, WalletPeer}; + +pub async fn fetch_nft_offer_details( + peer: &WalletPeer, + launcher_id: Bytes32, +) -> Result, WalletError> { + let mut offer_details = None::; + let mut current_id = launcher_id; + + loop { + let Some(child) = + timeout(Duration::from_secs(5), peer.try_fetch_child(current_id)).await?? + else { + break; + }; + + let spent_height = child.spent_height.ok_or(WalletError::PeerMisbehaved)?; + current_id = child.coin.coin_id(); + + let (puzzle_reveal, solution) = timeout( + Duration::from_secs(15), + peer.fetch_puzzle_solution(current_id, spent_height), + ) + .await??; + + let mut allocator = Allocator::new(); + + let puzzle_reveal = puzzle_reveal.to_clvm(&mut allocator)?; + let puzzle = Puzzle::parse(&allocator, puzzle_reveal); + let solution = solution.to_clvm(&mut allocator)?; + + if let Some(nft) = + Nft::::parse_child(&mut allocator, child.coin, puzzle, solution) + .ok() + .flatten() + { + offer_details = Some(NftOfferDetails { + metadata: Program::from_clvm(&allocator, nft.info.metadata.ptr())?, + metadata_updater_puzzle_hash: nft.info.metadata_updater_puzzle_hash, + royalty_puzzle_hash: nft.info.royalty_puzzle_hash, + royalty_ten_thousandths: nft.info.royalty_ten_thousandths, + }); + break; + } + + sleep(Duration::from_secs(1)).await; + } + + Ok(offer_details) +} diff --git a/crates/sage-wallet/src/wallet/make_offer.rs b/crates/sage-wallet/src/wallet/make_offer.rs index d610192d..d8903940 100644 --- a/crates/sage-wallet/src/wallet/make_offer.rs +++ b/crates/sage-wallet/src/wallet/make_offer.rs @@ -1,3 +1,5 @@ +use std::{collections::HashMap, mem}; + use chia::{ clvm_utils::CurriedProgram, protocol::Bytes32, @@ -7,16 +9,17 @@ use chia::{ }, }; use chia_wallet_sdk::{ - Conditions, HashedPtr, Layer, NftInfo, Offer, OfferBuilder, SpendContext, StandardLayer, + calculate_nft_royalty, calculate_nft_trace_price, Condition, Conditions, HashedPtr, Layer, + NftInfo, Offer, OfferBuilder, SpendContext, StandardLayer, TradePrice, }; use indexmap::IndexMap; use crate::{OfferRequest, OfferedCoins, WalletError}; -use super::{UnsignedOffer, Wallet}; +use super::{CatOfferSpend, NftOfferSpend, OfferSpend, UnsignedOffer, Wallet}; impl Wallet { - pub async fn create_offer( + pub async fn make_offer( &self, offered: OfferedCoins, requested: OfferRequest, @@ -59,13 +62,42 @@ impl Wallet { // Fetch coin info for the NFTs being offered. let mut nfts = Vec::new(); + let mut trade_prices = Vec::new(); + + if !offered.nfts.is_empty() { + for (asset_id, amount) in [(None, requested.xch)].into_iter().chain( + requested + .cats + .iter() + .map(|(asset_id, amount)| (Some(*asset_id), *amount)), + ) { + let trade_price = calculate_nft_trace_price(amount, offered.nfts.len()) + .ok_or(WalletError::InvalidTradePrice)?; + + let mut puzzle_hash = SETTLEMENT_PAYMENTS_PUZZLE_HASH; + + if let Some(asset_id) = asset_id { + puzzle_hash = CatArgs::curry_tree_hash(asset_id, puzzle_hash); + } + + trade_prices.push(TradePrice { + puzzle_hash: puzzle_hash.into(), + amount: trade_price, + }); + } + } + for nft_id in offered.nfts { let Some(nft) = self.db.nft(nft_id).await? else { return Err(WalletError::MissingNft(nft_id)); }; coin_ids.push(nft.coin.coin_id()); - nfts.push(nft); + + nfts.push(NftOfferSpend { + nft, + trade_prices: trade_prices.clone(), + }); } // Calculate the nonce for the offer. @@ -74,10 +106,11 @@ impl Wallet { // Create the offer builder with the nonce. let mut builder = OfferBuilder::new(nonce); let mut ctx = SpendContext::new(); + let settlement = ctx.settlement_payments_puzzle()?; let cat = ctx.cat_puzzle()?; - // Handle requested XCH payments. + // Add requested XCH payments. if requested.xch > 0 { builder = builder.request( &mut ctx, @@ -86,7 +119,45 @@ impl Wallet { )?; } - // Handle requested CAT payments. + // Add royalty payments for NFTs you are offering. + if !nfts.is_empty() { + for (asset_id, amount) in [(None, requested.xch)].into_iter().chain( + requested + .cats + .iter() + .map(|(asset_id, amount)| (Some(*asset_id), *amount)), + ) { + let trade_price = calculate_nft_trace_price(amount, nfts.len()) + .ok_or(WalletError::InvalidTradePrice)?; + + for NftOfferSpend { nft, .. } in &nfts { + let royalty = + calculate_nft_royalty(trade_price, nft.info.royalty_ten_thousandths) + .ok_or(WalletError::InvalidRoyaltyAmount)?; + + let mut puzzle = settlement; + + if let Some(asset_id) = asset_id { + puzzle = ctx.alloc(&CurriedProgram { + program: cat, + args: CatArgs::new(asset_id, puzzle), + })?; + } + + builder = builder.request( + &mut ctx, + &puzzle, + vec![Payment::with_memos( + nft.info.royalty_puzzle_hash, + royalty, + vec![nft.info.royalty_puzzle_hash.into()], + )], + )?; + } + } + } + + // Add requested CAT payments. for (asset_id, amount) in requested.cats { builder = builder.request( &mut ctx, @@ -102,7 +173,7 @@ impl Wallet { )?; } - // Handle requested NFT payments. + // Add requested NFT payments. for (nft_id, info) in requested.nfts { let info = NftInfo { launcher_id: nft_id, @@ -130,106 +201,160 @@ impl Wallet { // Finish the requested payments and get the list of announcement assertions. let (assertions, builder) = builder.finish(); - // Spend the XCH being offered. - if !p2_coins.is_empty() { - let mut conditions = Conditions::new(); + self.spend_assets( + &mut ctx, + OfferSpend { + p2_coins, + p2_amount: offered.xch, + cats: cats + .into_iter() + .map(|(asset_id, coins)| CatOfferSpend { + coins, + amount: offered.cats[&asset_id], + }) + .collect(), + nfts, + assertions, + change_puzzle_hash: p2_puzzle_hash, + }, + ) + .await?; - if offered.xch > 0 { + // Construct the final offer. + let coin_spends = ctx.take(); + + Ok(UnsignedOffer { + ctx, + coin_spends, + builder, + }) + } + + async fn spend_assets( + &self, + ctx: &mut SpendContext, + spend: OfferSpend, + ) -> Result<(), WalletError> { + let mut assertions = + Conditions::new().extend(spend.assertions.into_iter().map(Condition::from)); + + // Calculate primary coins. + let mut primary_coins = Vec::new(); + + if let Some(p2_coin) = spend.p2_coins.first() { + primary_coins.push(p2_coin.coin_id()); + } + + for CatOfferSpend { coins, .. } in &spend.cats { + if let Some(cat) = coins.first() { + primary_coins.push(cat.coin.coin_id()); + } + } + + for NftOfferSpend { nft, .. } in &spend.nfts { + primary_coins.push(nft.coin.coin_id()); + } + + // Calculate conditions for each primary coin. + let mut primary_conditions = HashMap::new(); + + if primary_coins.len() == 1 { + primary_conditions.insert(primary_coins[0], assertions); + } else { + for (i, &coin_id) in primary_coins.iter().enumerate() { + let relation = if i == 0 { + *primary_coins.last().expect("empty primary coins") + } else { + primary_coins[i - 1] + }; + + primary_conditions.insert( + coin_id, + mem::take(&mut assertions).assert_concurrent_spend(relation), + ); + } + } + + // Spend the XCH. + if !spend.p2_coins.is_empty() { + let mut conditions = primary_conditions + .remove(&spend.p2_coins[0].coin_id()) + .unwrap_or_default(); + + if spend.p2_amount > 0 { conditions = conditions.create_coin( SETTLEMENT_PAYMENTS_PUZZLE_HASH.into(), - offered.xch, + spend.p2_amount, Vec::new(), ); } - let total: u128 = p2_coins.iter().map(|coin| coin.amount as u128).sum(); - let change = total - offered.xch as u128; + let total: u128 = spend.p2_coins.iter().map(|coin| coin.amount as u128).sum(); + let change = total - spend.p2_amount as u128; if change > 0 { conditions = conditions.create_coin( - p2_puzzle_hash, + spend.change_puzzle_hash, change.try_into().expect("change overflow"), Vec::new(), ); } - for &assertion in &assertions { - conditions = conditions.with(assertion); - } - - self.spend_p2_coins(&mut ctx, p2_coins, conditions).await?; + self.spend_p2_coins(ctx, spend.p2_coins, conditions).await?; } - // Spend the CATs being offered. - for (asset_id, cat_coins) in cats { - let total: u128 = cat_coins.iter().map(|cat| cat.coin.amount as u128).sum(); - let amount = offered.cats[&asset_id]; + // Spend the CATs. + for CatOfferSpend { coins, amount } in spend.cats { + let total: u128 = coins.iter().map(|cat| cat.coin.amount as u128).sum(); let change = (total - amount as u128) .try_into() .expect("change overflow"); self.spend_cat_coins( - &mut ctx, - cat_coins.into_iter().enumerate().map(|(i, cat)| { + ctx, + coins.into_iter().enumerate().map(|(i, cat)| { if i > 0 { return (cat, Conditions::new()); } - let mut conditions = Conditions::new().create_coin( - SETTLEMENT_PAYMENTS_PUZZLE_HASH.into(), - amount, - vec![Bytes32::from(SETTLEMENT_PAYMENTS_PUZZLE_HASH).into()], - ); + let mut conditions = primary_conditions + .remove(&cat.coin.coin_id()) + .unwrap_or_default() + .create_coin( + SETTLEMENT_PAYMENTS_PUZZLE_HASH.into(), + amount, + vec![Bytes32::from(SETTLEMENT_PAYMENTS_PUZZLE_HASH).into()], + ); if change > 0 { conditions = conditions.create_coin( - p2_puzzle_hash, + spend.change_puzzle_hash, change, - vec![Bytes32::from(p2_puzzle_hash).into()], + vec![spend.change_puzzle_hash.into()], ); } - for &assertion in &assertions { - conditions = conditions.with(assertion); - } - (cat, conditions) }), ) .await?; } - // Spend the NFTs being offered. - for nft in nfts { + // Spend the NFTs. + for NftOfferSpend { nft, trade_prices } in spend.nfts { let metadata_ptr = ctx.alloc(&nft.info.metadata)?; let nft = nft.with_metadata(HashedPtr::from_ptr(&ctx.allocator, metadata_ptr)); let synthetic_key = self.db.synthetic_key(nft.info.p2_puzzle_hash).await?; let p2 = StandardLayer::new(synthetic_key); - let mut conditions = Conditions::new(); - - for &assertion in &assertions { - conditions = conditions.with(assertion); - } + let conditions = primary_conditions + .remove(&nft.coin.coin_id()) + .unwrap_or_default(); - // Add trade prices - let _ = nft.transfer_to_did( - &mut ctx, - &p2, - SETTLEMENT_PAYMENTS_PUZZLE_HASH.into(), - None, - conditions, - )?; + let _ = nft.lock_settlement(ctx, &p2, trade_prices, conditions)?; } - // Construct the final offer. - let coin_spends = ctx.take(); - - Ok(UnsignedOffer { - ctx, - coin_spends, - builder, - }) + Ok(()) } } diff --git a/crates/sage-wallet/src/wallet/offer.rs b/crates/sage-wallet/src/wallet/offer.rs index eda650f9..e6f7f5a3 100644 --- a/crates/sage-wallet/src/wallet/offer.rs +++ b/crates/sage-wallet/src/wallet/offer.rs @@ -1,6 +1,8 @@ -use chia::protocol::{Bytes32, CoinSpend, Program}; +use chia::protocol::{Bytes32, Coin, CoinSpend, Program}; -use chia_wallet_sdk::{OfferBuilder, Partial, SpendContext}; +use chia_wallet_sdk::{ + AssertPuzzleAnnouncement, Cat, Nft, OfferBuilder, Partial, SpendContext, TradePrice, +}; use indexmap::{IndexMap, IndexSet}; #[derive(Debug, Clone)] @@ -31,3 +33,25 @@ pub struct UnsignedOffer { pub coin_spends: Vec, pub builder: OfferBuilder, } + +#[derive(Debug, Clone)] +pub struct OfferSpend { + pub p2_coins: Vec, + pub p2_amount: u64, + pub cats: Vec, + pub nfts: Vec, + pub assertions: Vec, + pub change_puzzle_hash: Bytes32, +} + +#[derive(Debug, Clone)] +pub struct CatOfferSpend { + pub coins: Vec, + pub amount: u64, +} + +#[derive(Debug, Clone)] +pub struct NftOfferSpend { + pub nft: Nft, + pub trade_prices: Vec, +} diff --git a/crates/sage-wallet/src/wallet_peer.rs b/crates/sage-wallet/src/wallet_peer.rs index e41867e1..4a981448 100644 --- a/crates/sage-wallet/src/wallet_peer.rs +++ b/crates/sage-wallet/src/wallet_peer.rs @@ -81,18 +81,23 @@ impl WalletPeer { } pub async fn fetch_child(&self, coin_id: Bytes32) -> Result { - let Some(child) = self + let Some(child) = self.try_fetch_child(coin_id).await? else { + return Err(WalletError::MissingChild(coin_id)); + }; + Ok(child) + } + + pub async fn try_fetch_child( + &self, + coin_id: Bytes32, + ) -> Result, WalletError> { + Ok(self .peer .request_children(coin_id) .await? .coin_states .into_iter() - .next() - else { - return Err(WalletError::MissingChild(coin_id)); - }; - - Ok(child) + .next()) } pub async fn send_transaction( diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 1efeb126..c7a6755b 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -59,3 +59,6 @@ tauri-build = { workspace = true, features = [] } [package.metadata.cargo-machete] ignored = ["serde_json", "aws-lc-rs"] + +[patch.crates-io] +chia-wallet-sdk = { git = "https://github.com/xch-dev/chia-wallet-sdk", rev = "543743574fc15662395dc5d15b1cbf250783f802" } diff --git a/src-tauri/src/commands/transactions.rs b/src-tauri/src/commands/transactions.rs index 418739b1..8ffcaa0c 100644 --- a/src-tauri/src/commands/transactions.rs +++ b/src-tauri/src/commands/transactions.rs @@ -11,18 +11,20 @@ use chia_wallet_sdk::{ TESTNET11_CONSTANTS, }; use hex_literal::hex; +use indexmap::{IndexMap, IndexSet}; use sage_api::{ - Amount, BulkMintNfts, BulkMintNftsResponse, CoinJson, CoinSpendJson, Input, InputKind, - NftUriKind, Output, SpendBundleJson, TransactionSummary, + Amount, BulkMintNfts, BulkMintNftsResponse, CatAmount, CoinJson, CoinSpendJson, Input, + InputKind, MakeOffer, NftUriKind, Output, SpendBundleJson, TransactionSummary, }; use sage_database::{CatRow, Database}; use sage_wallet::{ - compute_nft_info, fetch_uris, insert_transaction, ChildKind, CoinKind, Data, SyncCommand, - Transaction, Wallet, WalletNftMint, + compute_nft_info, fetch_nft_offer_details, fetch_uris, insert_transaction, ChildKind, CoinKind, + Data, OfferRequest, OfferedCoins, SyncCommand, Transaction, Wallet, WalletNftMint, }; use specta::specta; use tauri::{command, State}; use tokio::sync::MutexGuard; +use tracing::warn; use crate::{ app_state::{AppState, AppStateInner}, @@ -585,6 +587,115 @@ pub async fn transfer_did( summarize(&state, &wallet, coin_spends, ConfirmationInfo::default()).await } +#[command] +#[specta] +pub async fn make_offer(state: State<'_, AppState>, request: MakeOffer) -> Result { + let state = state.lock().await; + let wallet = state.wallet()?; + + let Some(offered_xch) = request.offered_assets.xch.to_mojos(state.unit.decimals) else { + return Err(Error::invalid_amount(&request.offered_assets.xch)); + }; + + let mut offered_cats = IndexMap::new(); + + for CatAmount { asset_id, amount } in request.offered_assets.cats { + let Some(amount) = amount.to_mojos(3) else { + return Err(Error::invalid_amount(&amount)); + }; + let asset_id = hex::decode(&asset_id)?.try_into()?; + offered_cats.insert(asset_id, amount); + } + + let mut offered_nfts = IndexSet::new(); + + for nft_id in request.offered_assets.nfts { + let (launcher_id, prefix) = decode_address(&nft_id)?; + + if prefix != "nft" { + return Err(Error::invalid_prefix(&prefix)); + } + + offered_nfts.insert(launcher_id.into()); + } + + let Some(requested_xch) = request.requested_assets.xch.to_mojos(state.unit.decimals) else { + return Err(Error::invalid_amount(&request.requested_assets.xch)); + }; + + let mut requested_cats = IndexMap::new(); + + for CatAmount { asset_id, amount } in request.requested_assets.cats { + let Some(amount) = amount.to_mojos(3) else { + return Err(Error::invalid_amount(&amount)); + }; + let asset_id = hex::decode(&asset_id)?.try_into()?; + requested_cats.insert(asset_id, amount); + } + + let mut requested_nfts = IndexMap::new(); + let mut peer = None; + + for nft_id in request.requested_assets.nfts { + if peer.is_none() { + peer = state.peer_state.lock().await.acquire_peer(); + } + + let peer = peer.as_ref().ok_or(Error::no_peers())?; + + let (launcher_id, prefix) = decode_address(&nft_id)?; + + if prefix != "nft" { + return Err(Error::invalid_prefix(&prefix)); + } + + let nft_id: Bytes32 = launcher_id.into(); + let Some(offer_details) = fetch_nft_offer_details(peer, nft_id).await? else { + return Err(Error::invalid_launcher_id()); + }; + + requested_nfts.insert(nft_id, offer_details); + } + + let unsigned = wallet + .make_offer( + OfferedCoins { + xch: offered_xch, + cats: offered_cats, + nfts: offered_nfts, + }, + OfferRequest { + xch: requested_xch, + cats: requested_cats, + nfts: requested_nfts, + }, + false, + true, + ) + .await?; + + let (_mnemonic, Some(master_sk)) = state.keychain.extract_secrets(wallet.fingerprint, b"")? + else { + return Err(Error::no_secret_key()); + }; + + let offer = wallet + .sign_offer( + unsigned, + &if state.config.network.network_id == "mainnet" { + AggSigConstants::new(MAINNET_CONSTANTS.agg_sig_me_additional_data) + } else { + AggSigConstants::new(TESTNET11_CONSTANTS.agg_sig_me_additional_data) + }, + master_sk, + ) + .await?; + + warn!("Offer: {}", offer.encode()?); + + Ok(offer.encode()?) +} + #[command] #[specta] pub async fn sign_transaction( diff --git a/src-tauri/src/error.rs b/src-tauri/src/error.rs index 58f7a277..3093e536 100644 --- a/src-tauri/src/error.rs +++ b/src-tauri/src/error.rs @@ -9,7 +9,7 @@ use chia::{ clvm_traits::{FromClvmError, ToClvmError}, protocol::Bytes32, }; -use chia_wallet_sdk::{AddressError, ClientError, DriverError}; +use chia_wallet_sdk::{AddressError, ClientError, DriverError, OfferError}; use hex::FromHexError; use sage_api::Amount; use sage_database::DatabaseError; @@ -463,3 +463,12 @@ impl From for Error { } } } + +impl From for Error { + fn from(value: OfferError) -> Self { + Self { + kind: ErrorKind::TransactionFailed, + reason: value.to_string(), + } + } +} diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 0593aa1f..f875dd8b 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -76,6 +76,7 @@ pub fn run() { commands::transfer_nft, commands::transfer_did, commands::add_nft_uri, + commands::make_offer, commands::sign_transaction, commands::submit_transaction, // Peers diff --git a/src/bindings.ts b/src/bindings.ts index 094b72d6..170c5de1 100644 --- a/src/bindings.ts +++ b/src/bindings.ts @@ -413,6 +413,14 @@ async addNftUri(nftId: string, uri: string, kind: NftUriKind, fee: Amount) : Pro else return { status: "error", error: e as any }; } }, +async makeOffer(request: MakeOffer) : Promise> { + try { + return { status: "ok", data: await TAURI_INVOKE("make_offer", { request }) }; +} catch (e) { + if(e instanceof Error) throw e; + else return { status: "error", error: e as any }; +} +}, async signTransaction(coinSpends: CoinSpendJson[]) : Promise> { try { return { status: "ok", data: await TAURI_INVOKE("sign_transaction", { coinSpends }) }; @@ -471,8 +479,10 @@ syncEvent: "sync-event" /** user-defined types **/ export type Amount = string +export type Assets = { xch: Amount; cats: CatAmount[]; nfts: string[] } export type BulkMintNfts = { nft_mints: NftMint[]; did_id: string; fee: Amount } export type BulkMintNftsResponse = { nft_ids: string[]; summary: TransactionSummary } +export type CatAmount = { asset_id: string; amount: Amount } export type CatRecord = { asset_id: string; name: string | null; ticker: string | null; description: string | null; icon_url: string | null; visible: boolean; balance: Amount } export type CoinJson = { parent_coin_info: string; puzzle_hash: string; amount: number } export type CoinRecord = { coin_id: string; address: string; amount: Amount; created_height: number | null; spent_height: number | null; create_transaction_id: string | null; spend_transaction_id: string | null } @@ -484,6 +494,7 @@ export type GetCollectionNfts = { collection_id: string | null; offset: number; export type GetNftCollections = { offset: number; limit: number; include_hidden: boolean } export type GetNfts = { offset: number; limit: number; sort_mode: NftSortMode; include_hidden: boolean } export type Input = ({ type: "unknown" } | { type: "xch" } | { type: "launcher" } | { type: "cat"; asset_id: string; name: string | null; ticker: string | null; icon_url: string | null } | { type: "did"; launcher_id: string; name: string | null } | { type: "nft"; launcher_id: string; image_data: string | null; image_mime_type: string | null; name: string | null }) & { coin_id: string; amount: Amount; address: string; outputs: Output[] } +export type MakeOffer = { requested_assets: Assets; offered_assets: Assets } export type Network = { default_port: number; ticker: string; address_prefix: string; precision: number; genesis_challenge: string; agg_sig_me: string; dns_introducers: string[] } export type NetworkConfig = { network_id?: string; target_peers?: number; discover_peers?: boolean } export type NftCollectionRecord = { collection_id: string; did_id: string; metadata_collection_id: string; visible: boolean; name: string | null; icon: string | null; nfts: number; visible_nfts: number } @@ -522,7 +533,7 @@ type __EventObj__ = { once: ( cb: TAURI_API_EVENT.EventCallback, ) => ReturnType>; - emit: T extends null + emit: null extends T ? (payload?: T) => ReturnType : (payload: T) => ReturnType; }; diff --git a/src/components/Container.tsx b/src/components/Container.tsx index 2dc93189..79ef74c5 100644 --- a/src/components/Container.tsx +++ b/src/components/Container.tsx @@ -5,7 +5,7 @@ export default function Container( ) { return (
{props.children}
diff --git a/src/components/Header.tsx b/src/components/Header.tsx index 22be3f0a..a93fda56 100644 --- a/src/components/Header.tsx +++ b/src/components/Header.tsx @@ -42,7 +42,7 @@ export default function Header( const hasBackButton = props.back || location.pathname.split('/').length > 2; return ( -
+
{hasBackButton ? ( + + +
+ + setFee(e.target.value)} + /> +
@@ -33,19 +72,181 @@ export function MakeOffer() { - Requested Coins + Requested
- These coins will be received in exchange. + Add the assets you are requesting.
+ +
- + ); } + +interface AssetSelectorProps { + setAssets: (value: Assets) => void; +} + +function AssetSelector({ setAssets }: AssetSelectorProps) { + const walletState = useWalletState(); + + const [includeAmount, setIncludeAmount] = useState(false); + const [amount, setAmount] = useState(''); + const [nfts, setNfts] = useState([]); + const [cats, setCats] = useState([]); + + useEffect(() => { + setAssets({ + xch: includeAmount ? amount : '0', + nfts, + cats, + }); + }, [includeAmount, amount, nfts, cats, setAssets]); + + return ( + <> +
+ + + +
+ +
+ + setIncludeAmount(value)} + /> +
+ + {includeAmount && ( +
+ + setAmount(e.target.value)} + /> +
+ )} + + {nfts.length > 0 && ( +
+ {nfts.map((nft, i) => ( +
+ +
+ { + nfts[i] = e.target.value; + setNfts([...nfts]); + }} + /> + +
+
+ ))} +
+ )} + + {cats.length > 0 && ( +
+ {cats.map((cat, i) => ( +
+ +
+ { + cats[i].asset_id = e.target.value; + setCats([...cats]); + }} + /> + { + cats[i].amount = e.target.value; + setCats([...cats]); + }} + /> + +
+
+ ))} +
+ )} + + ); +} diff --git a/src/pages/Offers.tsx b/src/pages/Offers.tsx index 84cb57c7..6d7b2218 100644 --- a/src/pages/Offers.tsx +++ b/src/pages/Offers.tsx @@ -3,11 +3,9 @@ import Header from '@/components/Header'; import { Button } from '@/components/ui/button'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; import { HandCoins } from 'lucide-react'; -import { Link, useNavigate } from 'react-router-dom'; +import { Link } from 'react-router-dom'; export function Offers() { - const navigate = useNavigate(); - return ( <>