diff --git a/.gitignore b/.gitignore index 42bcc94..f4d2a7b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,8 @@ .direnv result* /target +/wasm/**/target .envrc.local infra/wallet +.vscode/* +!.vscode/*.default diff --git a/.vscode/settings.json.default b/.vscode/settings.json.default new file mode 100644 index 0000000..4f407bb --- /dev/null +++ b/.vscode/settings.json.default @@ -0,0 +1,6 @@ +{ + "rust-analyzer.linkedProjects": [ + "Cargo.toml", + "wasm/simple-tx/Cargo.toml" + ] +} \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 1b47c3e..1361a79 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,13 +2,22 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "addr2line" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +dependencies = [ + "gimli 0.28.1", +] + [[package]] name = "addr2line" version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ - "gimli", + "gimli 0.31.1", ] [[package]] @@ -47,13 +56,13 @@ dependencies = [ "axum", "bytes", "cfg-if", - "http", + "http 1.1.0", "indexmap 2.6.0", "schemars", "serde", "serde_json", "serde_qs", - "thiserror", + "thiserror 1.0.69", "tower-layer", "tower-service", "tracing", @@ -76,9 +85,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.17" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23a1e53f0f5d86382dafe1cf314783b2044280f406e7e1506368220ad11b1338" +checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" dependencies = [ "anstyle", "anstyle-parse", @@ -91,9 +100,9 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8365de52b16c035ff4fcafe0092ba9390540e3e352870ac09933bebcaa2c8c56" +checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" [[package]] name = "anstyle-parse" @@ -125,15 +134,15 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.91" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c042108f3ed77fd83760a5fd79b53be043192bb3b9dba91d8c574c0ada7850c8" +checksum = "4c95c10ba0b00a02636238b814946408b1322d5ac4760326e6fb8ec956d85775" [[package]] name = "arbitrary" -version = "1.3.2" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" +checksum = "dde20b3d026af13f561bdd0f15edf01fc734f0dafcedbaf42bba506a9517f223" dependencies = [ "derive_arbitrary", ] @@ -144,6 +153,28 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" +[[package]] +name = "async-stream" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b5a71a6f37880a80d1d7f19efd781e4b5de42c88f0722cc13bcb6cc2cfe8476" +dependencies = [ + "async-stream-impl", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-stream-impl" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "async-trait" version = "0.1.83" @@ -165,7 +196,7 @@ dependencies = [ "futures-util", "log", "pin-project-lite", - "tungstenite", + "tungstenite 0.24.0", ] [[package]] @@ -191,20 +222,20 @@ checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "axum" -version = "0.7.7" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "504e3947307ac8326a5437504c517c4b56716c9d98fac0028c2acc7ca47d70ae" +checksum = "edca88bc138befd0323b20752846e6587272d3b03b0343c8ea28a6f819e6e71f" dependencies = [ "async-trait", "axum-core", "axum-macros", - "base64", + "base64 0.22.1", "bytes", "futures-util", - "http", - "http-body", + "http 1.1.0", + "http-body 1.0.1", "http-body-util", - "hyper", + "hyper 1.5.1", "hyper-util", "itoa", "matchit", @@ -218,10 +249,10 @@ dependencies = [ "serde_path_to_error", "serde_urlencoded", "sha1", - "sync_wrapper 1.0.1", + "sync_wrapper 1.0.2", "tokio", - "tokio-tungstenite", - "tower", + "tokio-tungstenite 0.24.0", + "tower 0.5.1", "tower-layer", "tower-service", "tracing", @@ -236,13 +267,13 @@ dependencies = [ "async-trait", "bytes", "futures-util", - "http", - "http-body", + "http 1.1.0", + "http-body 1.0.1", "http-body-util", "mime", "pin-project-lite", "rustversion", - "sync_wrapper 1.0.1", + "sync_wrapper 1.0.2", "tower-layer", "tower-service", "tracing", @@ -265,7 +296,7 @@ version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ - "addr2line", + "addr2line 0.24.2", "cfg-if", "libc", "miniz_oxide", @@ -274,12 +305,42 @@ dependencies = [ "windows-targets", ] +[[package]] +name = "balius-runtime" +version = "0.1.0" +source = "git+https://github.com/SupernaviX/balius.git?rev=3a899f9#3a899f9f1ed839a10719a441469a433f243520f4" +dependencies = [ + "async-trait", + "flate2", + "hex", + "itertools 0.13.0", + "pallas", + "prost", + "redb", + "serde", + "serde_json", + "tar", + "thiserror 1.0.69", + "tokio", + "tokio-util", + "tracing", + "utxorpc", + "warp", + "wasmtime", +] + [[package]] name = "base58" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6107fe1be6682a68940da878d9e9f5e90ca5745b3dec9fd1bb393c8777d4f581" +[[package]] +name = "base64" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + [[package]] name = "base64" version = "0.22.1" @@ -343,16 +404,18 @@ dependencies = [ [[package]] name = "blockfrost" -version = "1.0.3" -source = "git+https://github.com/blockfrost/blockfrost-rust.git?rev=14e22b5#14e22b5f25ac5f004a2f2aed056d73b18f925447" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "931760137cf1728d24314bc1e667dcbec13737fdd6f89642e906f5844b7b557f" dependencies = [ "blockfrost-openapi", "futures", + "futures-timer", "paste", "reqwest", "serde", "serde_json", - "thiserror", + "thiserror 2.0.3", "toml", "url", ] @@ -377,9 +440,9 @@ checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "bytemuck" -version = "1.19.0" +version = "1.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8334215b81e418a0a7bdb8ef0849474f40bb10c8b71f1c4ed315cff49f32494d" +checksum = "8b37c88a63ffd85d15b406896cc343916d7cf57838a847b3a6f2ca5d39a5695a" [[package]] name = "byteorder" @@ -395,10 +458,12 @@ checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" [[package]] name = "cc" -version = "1.1.31" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2e7962b54006dcfcc61cb72735f4d89bb97061dd6a7ed882ec6b8ee53714c6f" +checksum = "fd9de9f2205d5ef3fd67e685b0df337994ddd4495e2a28d185500d0e1edfea47" dependencies = [ + "jobserver", + "libc", "shlex", ] @@ -431,9 +496,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.20" +version = "4.5.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97f376d85a664d5837dbae44bf546e6477a679ff6610010f17276f686d867e8" +checksum = "fb3b4b9e5a7c7514dfa52869339ee98b3156b0bfb4e8a77c4ff4babb64b1604f" dependencies = [ "clap_builder", "clap_derive", @@ -441,9 +506,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.20" +version = "4.5.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19bc80abd44e4bed93ca373a0704ccbd1b710dc5749406201bb018272808dc54" +checksum = "b17a95aa67cc7b5ebd32aa5370189aa0d79069ef1c64ce893bd30fb24bff20ec" dependencies = [ "anstream", "anstyle", @@ -465,9 +530,15 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.7.2" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afb84c814227b90d6895e01398aee0d8033c00e7466aca416fb6a8e0eb19d8a7" + +[[package]] +name = "cobs" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" +checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15" [[package]] name = "colorchoice" @@ -494,19 +565,160 @@ dependencies = [ "libc", ] +[[package]] +name = "core-foundation" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b55271e5c8c478ad3f38ad24ef34923091e0548492a266d19b3c0b4d82574c63" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "core-foundation-sys" version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" +[[package]] +name = "cpp_demangle" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96e58d342ad113c2b878f16d5d034c03be492ae460cdbc02b7f0f2284d310c7d" +dependencies = [ + "cfg-if", +] + [[package]] name = "cpufeatures" -version = "0.2.14" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16b80225097f2e5ae4e7179dd2266824648f3e2f49d9134d584b76389d31c4c3" +dependencies = [ + "libc", +] + +[[package]] +name = "cranelift-bforest" +version = "0.110.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a41b85213deedf877555a7878ca9fb680ccba8183611c4bb8030ed281b2ad83" +dependencies = [ + "cranelift-entity", +] + +[[package]] +name = "cranelift-bitset" +version = "0.110.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "690d8ae6c73748e5ce3d8fe59034dceadb8823e6c8994ba324141c5eae909b0e" +dependencies = [ + "serde", + "serde_derive", +] + +[[package]] +name = "cranelift-codegen" +version = "0.110.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce027a7b16f8b86f60ff6819615273635186d607a0c225ee6ac340d7d18f978" +dependencies = [ + "bumpalo", + "cranelift-bforest", + "cranelift-bitset", + "cranelift-codegen-meta", + "cranelift-codegen-shared", + "cranelift-control", + "cranelift-entity", + "cranelift-isle", + "gimli 0.28.1", + "hashbrown 0.14.5", + "log", + "regalloc2", + "rustc-hash 1.1.0", + "smallvec", + "target-lexicon", +] + +[[package]] +name = "cranelift-codegen-meta" +version = "0.110.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0a2d2ab65e6cbf91f81781d8da65ec2005510f18300eff21a99526ed6785863" +dependencies = [ + "cranelift-codegen-shared", +] + +[[package]] +name = "cranelift-codegen-shared" +version = "0.110.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efcff860573cf3db9ae98fbd949240d78b319df686cc306872e7fab60e9c84d7" + +[[package]] +name = "cranelift-control" +version = "0.110.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" +checksum = "69d70e5b75c2d5541ef80a99966ccd97aaa54d2a6af19ea31759a28538e1685a" dependencies = [ + "arbitrary", +] + +[[package]] +name = "cranelift-entity" +version = "0.110.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d21d3089714278920030321829090d9482c91e5ff2339f2f697f8425bffdcba3" +dependencies = [ + "cranelift-bitset", + "serde", + "serde_derive", +] + +[[package]] +name = "cranelift-frontend" +version = "0.110.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7308482930f2a2fad4fe25a06054f6f9a4ee1ab97264308c661b037cb60001a3" +dependencies = [ + "cranelift-codegen", + "log", + "smallvec", + "target-lexicon", +] + +[[package]] +name = "cranelift-isle" +version = "0.110.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab4c59e259dab0e6958dabcc536b30845574f027ba6e5000498cdaf7e7ed2d30" + +[[package]] +name = "cranelift-native" +version = "0.110.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d77ac3dfb61ef3159998105116acdfeaec75e4296c43ee2dcc4ea39838c0080e" +dependencies = [ + "cranelift-codegen", "libc", + "target-lexicon", +] + +[[package]] +name = "cranelift-wasm" +version = "0.110.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d883f1b8d3d1dab4797407117bc8a1824f4a1fe86654aee2ee3205613f77d3e" +dependencies = [ + "cranelift-codegen", + "cranelift-entity", + "cranelift-frontend", + "itertools 0.12.1", + "log", + "smallvec", + "wasmparser 0.212.0", + "wasmtime-types", ] [[package]] @@ -542,6 +754,25 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "crossbeam-deque" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + [[package]] name = "crossbeam-utils" version = "0.8.20" @@ -625,6 +856,15 @@ version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" +[[package]] +name = "debugid" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef552e6f588e446098f6ba40d89ac146c8c7b64aade83c051ee00bb5d2bc18d" +dependencies = [ + "uuid", +] + [[package]] name = "deranged" version = "0.3.11" @@ -637,9 +877,9 @@ dependencies = [ [[package]] name = "derive_arbitrary" -version = "1.3.2" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" +checksum = "30542c1ad912e0e3d22a1935c290e12e8a29d704a420177a31faad4a601a0800" dependencies = [ "proc-macro2", "quote", @@ -656,6 +896,27 @@ dependencies = [ "crypto-common", ] +[[package]] +name = "directories-next" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "339ee130d97a610ea5a5872d2bbb130fdf68884ff09d3028b81bec8a1ac23bbc" +dependencies = [ + "cfg-if", + "dirs-sys-next", +] + +[[package]] +name = "dirs-sys-next" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + [[package]] name = "displaydoc" version = "0.2.5" @@ -676,7 +937,7 @@ dependencies = [ "chrono", "rust_decimal", "serde", - "thiserror", + "thiserror 1.0.69", "time", "winnow", ] @@ -702,6 +963,18 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +[[package]] +name = "embedded-io" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef1a6892d9eef45c8fa6b9e0086428a2cca8491aca8f787c534a3d6d0bcb3ced" + +[[package]] +name = "embedded-io" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" + [[package]] name = "encoding_rs" version = "0.8.35" @@ -717,6 +990,16 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +[[package]] +name = "errno" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + [[package]] name = "fallible-iterator" version = "0.3.0" @@ -729,6 +1012,12 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a" +[[package]] +name = "fastrand" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "486f806e73c5707928240ddc295403b1b93c96a02038563881c4a2fd84b81ac4" + [[package]] name = "figment" version = "0.10.19" @@ -743,6 +1032,18 @@ dependencies = [ "version_check", ] +[[package]] +name = "filetime" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" +dependencies = [ + "cfg-if", + "libc", + "libredox", + "windows-sys 0.59.0", +] + [[package]] name = "firefly-cardano-demo" version = "0.1.0" @@ -755,6 +1056,22 @@ dependencies = [ "serde", "serde_json", "tokio", + "uuid", +] + +[[package]] +name = "firefly-cardano-deploy-contract" +version = "0.1.0" +dependencies = [ + "anyhow", + "clap", + "hex", + "reqwest", + "serde", + "tokio", + "uuid", + "wat", + "wit-component", ] [[package]] @@ -765,6 +1082,7 @@ dependencies = [ "anyhow", "async-trait", "axum", + "balius-runtime", "blockfrost", "blockfrost-openapi", "chrono", @@ -774,6 +1092,7 @@ dependencies = [ "futures", "hex", "minicbor", + "pallas-addresses", "pallas-codec", "pallas-crypto", "pallas-network", @@ -828,7 +1147,7 @@ dependencies = [ "duration-str", "figment", "home", - "itertools", + "itertools 0.13.0", "reqwest", "schemars", "serde", @@ -840,11 +1159,17 @@ dependencies = [ "utoipa-swagger-ui", ] +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + [[package]] name = "flate2" -version = "1.0.34" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1b589b4dc103969ad3cf85c950899926ec64300a1a46d76c03a6072957036f0" +checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" dependencies = [ "crc32fast", "miniz_oxide", @@ -856,6 +1181,12 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foldhash" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f81ec6369c545a7d40e4589b5597581fa1c441fe1cce96dd1de43159910a36a2" + [[package]] name = "form_urlencoded" version = "1.2.1" @@ -936,6 +1267,12 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" +[[package]] +name = "futures-timer" +version = "3.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" + [[package]] name = "futures-util" version = "0.3.31" @@ -954,6 +1291,28 @@ dependencies = [ "slab", ] +[[package]] +name = "fxhash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" +dependencies = [ + "byteorder", +] + +[[package]] +name = "fxprof-processed-profile" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27d12c0aed7f1e24276a241aadc4cb8ea9f83000f34bc062b7cc2d51e3b0fabd" +dependencies = [ + "bitflags", + "debugid", + "fxhash", + "serde", + "serde_json", +] + [[package]] name = "generic-array" version = "0.14.7" @@ -977,6 +1336,17 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "gimli" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +dependencies = [ + "fallible-iterator", + "indexmap 2.6.0", + "stable_deref_trait", +] + [[package]] name = "gimli" version = "0.31.1" @@ -985,16 +1355,35 @@ checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "h2" -version = "0.4.6" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http 0.2.12", + "indexmap 2.6.0", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "h2" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" +checksum = "ccae279728d634d083c00f6099cb58f01cc99c145b84b8be2f6c74618d79922e" dependencies = [ "atomic-waker", "bytes", "fnv", "futures-core", "futures-sink", - "http", + "http 1.1.0", "indexmap 2.6.0", "slab", "tokio", @@ -1020,18 +1409,31 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "hashbrown" -version = "0.14.5" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" dependencies = [ "ahash", ] [[package]] name = "hashbrown" -version = "0.15.0" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash", + "serde", +] + +[[package]] +name = "hashbrown" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +dependencies = [ + "foldhash", +] [[package]] name = "hashlink" @@ -1042,6 +1444,30 @@ dependencies = [ "hashbrown 0.14.5", ] +[[package]] +name = "headers" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06683b93020a07e3dbcf5f8c0f6d40080d725bea7936fc01ad345c01b97dc270" +dependencies = [ + "base64 0.21.7", + "bytes", + "headers-core", + "http 0.2.12", + "httpdate", + "mime", + "sha1", +] + +[[package]] +name = "headers-core" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7f66481bfee273957b1f20485a4ff3362987f85b2c236580d81b4eb7a326429" +dependencies = [ + "http 0.2.12", +] + [[package]] name = "heck" version = "0.4.1" @@ -1081,6 +1507,17 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "http" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + [[package]] name = "http" version = "1.1.0" @@ -1092,6 +1529,17 @@ dependencies = [ "itoa", ] +[[package]] +name = "http-body" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +dependencies = [ + "bytes", + "http 0.2.12", + "pin-project-lite", +] + [[package]] name = "http-body" version = "1.0.1" @@ -1099,7 +1547,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ "bytes", - "http", + "http 1.1.0", ] [[package]] @@ -1110,8 +1558,8 @@ checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" dependencies = [ "bytes", "futures-util", - "http", - "http-body", + "http 1.1.0", + "http-body 1.0.1", "pin-project-lite", ] @@ -1129,16 +1577,40 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" -version = "1.5.0" +version = "0.14.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c08302e8fa335b151b788c775ff56e7a03ae64ff85c548ee820fecb70356e85" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2 0.3.26", + "http 0.2.12", + "http-body 0.4.6", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbbff0a806a4728c99295b254c8838933b5b082d75e3cb70c8dab21fdfbcfa9a" +checksum = "97818827ef4f364230e16705d4706e2897df2bb60617d6ca15d598025a3c481f" dependencies = [ "bytes", "futures-channel", "futures-util", - "h2", - "http", - "http-body", + "h2 0.4.7", + "http 1.1.0", + "http-body 1.0.1", "httparse", "httpdate", "itoa", @@ -1155,8 +1627,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" dependencies = [ "futures-util", - "http", - "hyper", + "http 1.1.0", + "hyper 1.5.1", "hyper-util", "rustls", "rustls-pki-types", @@ -1166,6 +1638,19 @@ dependencies = [ "webpki-roots", ] +[[package]] +name = "hyper-timeout" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b90d566bffbce6a75bd8b09a05aa8c2cb1fabb6cb348f8840c9e4c90a0d83b0" +dependencies = [ + "hyper 1.5.1", + "hyper-util", + "pin-project-lite", + "tokio", + "tower-service", +] + [[package]] name = "hyper-util" version = "0.1.10" @@ -1175,9 +1660,9 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "http", - "http-body", - "hyper", + "http 1.1.0", + "http-body 1.0.1", + "hyper 1.5.1", "pin-project-lite", "socket2", "tokio", @@ -1208,6 +1693,130 @@ dependencies = [ "cc", ] +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "id-arena" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25a2bc672d1148e28034f176e01fffebb08b35768468cc954630da77a1449005" + [[package]] name = "ident_case" version = "1.0.1" @@ -1216,12 +1825,23 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "0.5.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +dependencies = [ + "icu_normalizer", + "icu_properties", ] [[package]] @@ -1242,7 +1862,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ "equivalent", - "hashbrown 0.15.0", + "hashbrown 0.15.2", "serde", ] @@ -1264,6 +1884,15 @@ version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" +[[package]] +name = "itertools" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] + [[package]] name = "itertools" version = "0.13.0" @@ -1275,9 +1904,38 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.11" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" + +[[package]] +name = "ittapi" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b996fe614c41395cdaedf3cf408a9534851090959d90d54a535f675550b64b1" +dependencies = [ + "anyhow", + "ittapi-sys", + "log", +] + +[[package]] +name = "ittapi-sys" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52f5385394064fa2c886205dba02598013ce83d3e92d33dbdc0c52fe0e7bf4fc" +dependencies = [ + "cc", +] + +[[package]] +name = "jobserver" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" +dependencies = [ + "libc", +] [[package]] name = "js-sys" @@ -1294,11 +1952,34 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +[[package]] +name = "leb128" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" + [[package]] name = "libc" -version = "0.2.161" +version = "0.2.166" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1" +checksum = "c2ccc108bbc0b1331bd061864e7cd823c0cab660bbe6970e66e2c0614decde36" + +[[package]] +name = "libm" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" + +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags", + "libc", + "redox_syscall", +] [[package]] name = "libsqlite3-sys" @@ -1311,6 +1992,18 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "linux-raw-sys" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" + +[[package]] +name = "litemap" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" + [[package]] name = "lock_api" version = "0.4.12" @@ -1333,6 +2026,15 @@ version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +[[package]] +name = "mach2" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b955cdeb2a02b9117f121ce63aa52d08ade45de53e48fe6a38b39c10f6f709" +dependencies = [ + "libc", +] + [[package]] name = "matchit" version = "0.7.3" @@ -1345,6 +2047,15 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +[[package]] +name = "memfd" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" +dependencies = [ + "rustix", +] + [[package]] name = "mime" version = "0.3.17" @@ -1403,6 +2114,30 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "multer" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01acbdc23469fd8fe07ab135923371d5f5a422fbf9c522158677c8eb15bc51c2" +dependencies = [ + "bytes", + "encoding_rs", + "futures-util", + "http 0.2.12", + "httparse", + "log", + "memchr", + "mime", + "spin", + "version_check", +] + +[[package]] +name = "multimap" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defc4c55412d89136f966bbb339008b474350e5e6e78d2714439c386b3137a03" + [[package]] name = "nu-ansi-term" version = "0.46.0" @@ -1413,12 +2148,42 @@ dependencies = [ "winapi", ] +[[package]] +name = "num-bigint" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +dependencies = [ + "num-integer", + "num-traits", +] + [[package]] name = "num-conv" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" +dependencies = [ + "num-bigint", + "num-integer", + "num-traits", +] + [[package]] name = "num-traits" version = "0.2.19" @@ -1434,6 +2199,9 @@ version = "0.36.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" dependencies = [ + "crc32fast", + "hashbrown 0.15.2", + "indexmap 2.6.0", "memchr", ] @@ -1444,11 +2212,34 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] -name = "overload" +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "overload" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" +[[package]] +name = "pallas" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acf49f6ccfaebd82bebd93f3d050eda2c0dfba6d8265e25528e96f083ee066be" +dependencies = [ + "pallas-addresses", + "pallas-codec", + "pallas-configs", + "pallas-crypto", + "pallas-network", + "pallas-primitives", + "pallas-traverse", + "pallas-txbuilder", + "pallas-utxorpc", +] + [[package]] name = "pallas-addresses" version = "0.31.0" @@ -1462,7 +2253,22 @@ dependencies = [ "hex", "pallas-codec", "pallas-crypto", - "thiserror", + "thiserror 1.0.69", +] + +[[package]] +name = "pallas-applying" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66756768a0d37bcb23be9c9bcf4b1f1b53d2692981bdb720e689a38da954989e" +dependencies = [ + "hex", + "pallas-addresses", + "pallas-codec", + "pallas-crypto", + "pallas-primitives", + "pallas-traverse", + "rand", ] [[package]] @@ -1474,7 +2280,25 @@ dependencies = [ "hex", "minicbor", "serde", - "thiserror", + "thiserror 1.0.69", +] + +[[package]] +name = "pallas-configs" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78e964ec9c2cd1f21dbe93176ea3ca43d3da16ef13e653fcc5004a55adc5f926" +dependencies = [ + "base64 0.22.1", + "hex", + "num-rational", + "pallas-addresses", + "pallas-codec", + "pallas-crypto", + "pallas-primitives", + "serde", + "serde_json", + "serde_with", ] [[package]] @@ -1488,7 +2312,7 @@ dependencies = [ "pallas-codec", "rand_core", "serde", - "thiserror", + "thiserror 1.0.69", "zeroize", ] @@ -1500,12 +2324,12 @@ checksum = "e6536d3afc8eef5651705c6f046e0900277ff6392491670d995e613335436bd0" dependencies = [ "byteorder", "hex", - "itertools", + "itertools 0.13.0", "pallas-codec", "pallas-crypto", "rand", "socket2", - "thiserror", + "thiserror 1.0.69", "tokio", "tracing", ] @@ -1533,14 +2357,47 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d04fc75a2144eb257c68b4604cdde647e07404ea185b791c0005826960dfb35" dependencies = [ "hex", - "itertools", + "itertools 0.13.0", "pallas-addresses", "pallas-codec", "pallas-crypto", "pallas-primitives", "paste", "serde", - "thiserror", + "thiserror 1.0.69", +] + +[[package]] +name = "pallas-txbuilder" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d6454a6439726ff2645a5c8e981c0cd4a6fc0338f7ef1a216e9e9be751dc4db" +dependencies = [ + "hex", + "pallas-addresses", + "pallas-codec", + "pallas-crypto", + "pallas-primitives", + "pallas-traverse", + "pallas-wallet", + "serde", + "serde_json", + "thiserror 1.0.69", +] + +[[package]] +name = "pallas-utxorpc" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdc07262343b18927a86dee4838f2ded8e1e586bab81eb5f0e865fe091ca7dc6" +dependencies = [ + "pallas-applying", + "pallas-codec", + "pallas-crypto", + "pallas-primitives", + "pallas-traverse", + "prost-types", + "utxorpc-spec 0.11.0", ] [[package]] @@ -1555,7 +2412,7 @@ dependencies = [ "ed25519-bip32", "pallas-crypto", "rand", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -1587,6 +2444,43 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +[[package]] +name = "pbjson" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7e6349fa080353f4a597daffd05cb81572a9c031a6d4fff7e504947496fcc68" +dependencies = [ + "base64 0.21.7", + "serde", +] + +[[package]] +name = "pbjson-build" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eea3058763d6e656105d1403cb04e0a41b7bbac6362d413e7c33be0c32279c9" +dependencies = [ + "heck 0.5.0", + "itertools 0.13.0", + "prost", + "prost-types", +] + +[[package]] +name = "pbjson-types" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e54e5e7bfb1652f95bc361d76f3c780d8e526b134b85417e774166ee941f0887" +dependencies = [ + "bytes", + "chrono", + "pbjson", + "pbjson-build", + "prost", + "prost-build", + "serde", +] + [[package]] name = "pear" version = "0.2.9" @@ -1616,6 +2510,36 @@ version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" +[[package]] +name = "petgraph" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" +dependencies = [ + "fixedbitset", + "indexmap 2.6.0", +] + +[[package]] +name = "pin-project" +version = "1.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be57f64e946e500c8ee36ef6331845d40a93055567ec57e8fae13efd33759b95" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "pin-project-lite" version = "0.2.15" @@ -1634,6 +2558,18 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" +[[package]] +name = "postcard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f63d01def49fc815900a83e7a4a5083d2abc81b7ddd569a3fa0477778ae9b3ec" +dependencies = [ + "cobs", + "embedded-io 0.4.0", + "embedded-io 0.6.1", + "serde", +] + [[package]] name = "powerfmt" version = "0.2.0" @@ -1649,11 +2585,21 @@ dependencies = [ "zerocopy", ] +[[package]] +name = "prettyplease" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" +dependencies = [ + "proc-macro2", + "syn", +] + [[package]] name = "proc-macro2" -version = "1.0.89" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" +checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" dependencies = [ "unicode-ident", ] @@ -1671,46 +2617,111 @@ dependencies = [ "yansi", ] +[[package]] +name = "prost" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b0487d90e047de87f984913713b85c601c05609aad5b0df4b4573fbf69aa13f" +dependencies = [ + "bytes", + "prost-derive", +] + +[[package]] +name = "prost-build" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c1318b19085f08681016926435853bbf7858f9c082d0999b80550ff5d9abe15" +dependencies = [ + "bytes", + "heck 0.5.0", + "itertools 0.13.0", + "log", + "multimap", + "once_cell", + "petgraph", + "prettyplease", + "prost", + "prost-types", + "regex", + "syn", + "tempfile", +] + +[[package]] +name = "prost-derive" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9552f850d5f0964a4e4d0bf306459ac29323ddfbae05e35a7c0d35cb0803cc5" +dependencies = [ + "anyhow", + "itertools 0.13.0", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "prost-types" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4759aa0d3a6232fb8dbdb97b61de2c20047c68aca932c7ed76da9d788508d670" +dependencies = [ + "prost", +] + +[[package]] +name = "psm" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "200b9ff220857e53e184257720a14553b2f4aa02577d2ed9842d45d4b9654810" +dependencies = [ + "cc", +] + [[package]] name = "quinn" -version = "0.11.5" +version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +checksum = "62e96808277ec6f97351a2380e6c25114bc9e67037775464979f3037c92d05ef" dependencies = [ "bytes", "pin-project-lite", "quinn-proto", "quinn-udp", - "rustc-hash", + "rustc-hash 2.0.0", "rustls", "socket2", - "thiserror", + "thiserror 2.0.3", "tokio", "tracing", ] [[package]] name = "quinn-proto" -version = "0.11.8" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +checksum = "a2fe5ef3495d7d2e377ff17b1a8ce2ee2ec2a18cde8b6ad6619d65d0701c135d" dependencies = [ "bytes", + "getrandom", "rand", "ring", - "rustc-hash", + "rustc-hash 2.0.0", "rustls", + "rustls-pki-types", "slab", - "thiserror", + "thiserror 2.0.3", "tinyvec", "tracing", + "web-time", ] [[package]] name = "quinn-udp" -version = "0.5.6" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e346e016eacfff12233c243718197ca12f148c84e1e84268a896699b41c71780" +checksum = "7d5a626c6807713b15cac82a6acaccd6043c9a5408c24baae07611fec3f243da" dependencies = [ "cfg_aliases", "libc", @@ -1759,6 +2770,35 @@ dependencies = [ "getrandom", ] +[[package]] +name = "rayon" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "redb" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84b1de48a7cf7ba193e81e078d17ee2b786236eed1d3f7c60f8a09545efc4925" +dependencies = [ + "libc", +] + [[package]] name = "redox_syscall" version = "0.5.7" @@ -1768,6 +2808,17 @@ dependencies = [ "bitflags", ] +[[package]] +name = "redox_users" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" +dependencies = [ + "getrandom", + "libredox", + "thiserror 1.0.69", +] + [[package]] name = "refinery" version = "0.8.14" @@ -1791,7 +2842,7 @@ dependencies = [ "rusqlite", "serde", "siphasher", - "thiserror", + "thiserror 1.0.69", "time", "toml", "url", @@ -1812,6 +2863,19 @@ dependencies = [ "syn", ] +[[package]] +name = "regalloc2" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad156d539c879b7a24a363a2016d77961786e71f48f2e2fc8302a92abd2429a6" +dependencies = [ + "hashbrown 0.13.2", + "log", + "rustc-hash 1.1.0", + "slice-group-by", + "smallvec", +] + [[package]] name = "regex" version = "1.11.1" @@ -1826,9 +2890,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", @@ -1847,16 +2911,16 @@ version = "0.12.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a77c62af46e79de0a562e1a9849205ffcb7fc1238876e9bd743357570e04046f" dependencies = [ - "base64", + "base64 0.22.1", "bytes", "encoding_rs", "futures-core", "futures-util", - "h2", - "http", - "http-body", + "h2 0.4.7", + "http 1.1.0", + "http-body 1.0.1", "http-body-util", - "hyper", + "hyper 1.5.1", "hyper-rustls", "hyper-util", "ipnet", @@ -1874,7 +2938,7 @@ dependencies = [ "serde", "serde_json", "serde_urlencoded", - "sync_wrapper 1.0.1", + "sync_wrapper 1.0.2", "system-configuration", "tokio", "tokio-rustls", @@ -1896,11 +2960,11 @@ dependencies = [ "async-tungstenite", "futures-util", "reqwest", - "thiserror", + "thiserror 1.0.69", "tokio", "tokio-util", "tracing", - "tungstenite", + "tungstenite 0.24.0", "web-sys", ] @@ -1983,18 +3047,38 @@ version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + [[package]] name = "rustc-hash" version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" +[[package]] +name = "rustix" +version = "0.38.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7f649912bc1495e167a6edee79151c84b1bad49748cb4f1f1167f459f6224f6" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.52.0", +] + [[package]] name = "rustls" -version = "0.23.16" +version = "0.23.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eee87ff5d9b36712a58574e12e9f0ea80f915a5b0ac518d322b24a465617925e" +checksum = "934b404430bb06b3fae2cba809eb45a1ab1aecd64491213d7c3301b88393f8d1" dependencies = [ + "log", "once_cell", "ring", "rustls-pki-types", @@ -2003,6 +3087,18 @@ dependencies = [ "zeroize", ] +[[package]] +name = "rustls-native-certs" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fcff2dd52b58a8d98a70243663a0d234c4e2b79235637849d15913394a247d3" +dependencies = [ + "openssl-probe", + "rustls-pki-types", + "schannel", + "security-framework", +] + [[package]] name = "rustls-pemfile" version = "2.2.0" @@ -2017,6 +3113,9 @@ name = "rustls-pki-types" version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b" +dependencies = [ + "web-time", +] [[package]] name = "rustls-webpki" @@ -2050,6 +3149,15 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "schannel" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" +dependencies = [ + "windows-sys 0.59.0", +] + [[package]] name = "schemars" version = "0.8.21" @@ -2075,26 +3183,64 @@ dependencies = [ "syn", ] +[[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" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "security-framework" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1415a607e92bec364ea2cf9264646dcce0f91e6d65281bd6f2819cca3bf39c8" +dependencies = [ + "bitflags", + "core-foundation 0.10.0", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa39c7303dc58b5543c94d22c1766b0d31f2ee58306363ea622b10bbc075eaa2" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "semver" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" +dependencies = [ + "serde", +] + [[package]] name = "serde" -version = "1.0.214" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f55c3193aca71c12ad7890f1785d2b73e1b9f63a0bbc353c08ef26fe03fc56b5" +checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.214" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de523f781f095e28fa605cdce0f8307e451cc0fd14e2eb4cd2e98a355b147766" +checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" dependencies = [ "proc-macro2", "quote", @@ -2114,9 +3260,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.132" +version = "1.0.133" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" +checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" dependencies = [ "itoa", "memchr", @@ -2144,7 +3290,7 @@ dependencies = [ "futures", "percent-encoding", "serde", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -2174,7 +3320,7 @@ version = "3.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e28bdad6db2b8340e449f7108f020b3b092e8583a9e3fb82713e1d4e71fe817" dependencies = [ - "base64", + "base64 0.22.1", "chrono", "hex", "indexmap 1.9.3", @@ -2279,10 +3425,19 @@ dependencies = [ ] [[package]] -name = "smallvec" +name = "slice-group-by" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" + +[[package]] +name = "smallvec" version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +dependencies = [ + "serde", +] [[package]] name = "socket2" @@ -2294,12 +3449,33 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "spdx" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bae30cc7bfe3656d60ee99bf6836f472b0c53dddcbf335e253329abb16e535a2" +dependencies = [ + "smallvec", +] + [[package]] name = "spin" version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +[[package]] +name = "sptr" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b9b39299b249ad65f3b7e96443bad61c02ca5cd3589f46cb6d610a0fd6c0d6a" + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + [[package]] name = "strsim" version = "0.11.1" @@ -2314,9 +3490,9 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" -version = "2.0.85" +version = "2.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5023162dfcd14ef8f32034d8bcd4cc5ddc61ef7a247c024a33e24e1f24d21b56" +checksum = "44d46482f1c1c87acd84dea20c1bf5ebff4c757009ed6bf19cfd36fb10e92c4e" dependencies = [ "proc-macro2", "quote", @@ -2331,13 +3507,24 @@ checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" [[package]] name = "sync_wrapper" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" dependencies = [ "futures-core", ] +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "system-configuration" version = "0.6.1" @@ -2345,7 +3532,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" dependencies = [ "bitflags", - "core-foundation", + "core-foundation 0.9.4", "system-configuration-sys", ] @@ -2359,20 +3546,79 @@ dependencies = [ "libc", ] +[[package]] +name = "tar" +version = "0.4.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c65998313f8e17d0d553d28f91a0df93e4dbbbf770279c7bc21ca0f09ea1a1f6" +dependencies = [ + "filetime", + "libc", + "xattr", +] + +[[package]] +name = "target-lexicon" +version = "0.12.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" + +[[package]] +name = "tempfile" +version = "3.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" +dependencies = [ + "cfg-if", + "fastrand", + "once_cell", + "rustix", + "windows-sys 0.59.0", +] + +[[package]] +name = "termcolor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + [[package]] name = "thiserror" -version = "1.0.65" +version = "2.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c006c85c7651b3cf2ada4584faa36773bd07bac24acfb39f3c431b36d7e667aa" +dependencies = [ + "thiserror-impl 2.0.3", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ - "thiserror-impl", + "proc-macro2", + "quote", + "syn", ] [[package]] name = "thiserror-impl" -version = "1.0.65" +version = "2.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" +checksum = "f077553d607adc1caf65430528a576c757a71ed73944b66ebb58ef2bbd243568" dependencies = [ "proc-macro2", "quote", @@ -2420,6 +3666,16 @@ dependencies = [ "time-core", ] +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -2437,9 +3693,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.41.0" +version = "1.41.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "145f3413504347a2be84393cc8a7d2fb4d863b375909ea59f2158261aa258bbb" +checksum = "22cfb5bee7a6a52939ca9224d6ac897bb669134078daa8735560897f69de4d33" dependencies = [ "backtrace", "bytes", @@ -2486,6 +3742,29 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio-stream" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f4e6ce100d0eb49a2734f8c0812bcd324cf357d21810932c5df6b96ef2b86f1" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tokio-tungstenite" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c83b561d025642014097b66e6c1bb422783339e0909e4429cde4749d1990bc38" +dependencies = [ + "futures-util", + "log", + "tokio", + "tungstenite 0.21.0", +] + [[package]] name = "tokio-tungstenite" version = "0.24.0" @@ -2495,7 +3774,7 @@ dependencies = [ "futures-util", "log", "tokio", - "tungstenite", + "tungstenite 0.24.0", ] [[package]] @@ -2546,6 +3825,59 @@ dependencies = [ "winnow", ] +[[package]] +name = "tonic" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877c5b330756d856ffcc4553ab34a5684481ade925ecc54bcd1bf02b1d0d4d52" +dependencies = [ + "async-stream", + "async-trait", + "axum", + "base64 0.22.1", + "bytes", + "h2 0.4.7", + "http 1.1.0", + "http-body 1.0.1", + "http-body-util", + "hyper 1.5.1", + "hyper-timeout", + "hyper-util", + "percent-encoding", + "pin-project", + "prost", + "rustls-native-certs", + "rustls-pemfile", + "socket2", + "tokio", + "tokio-rustls", + "tokio-stream", + "tower 0.4.13", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +dependencies = [ + "futures-core", + "futures-util", + "indexmap 1.9.3", + "pin-project", + "pin-project-lite", + "rand", + "slab", + "tokio", + "tokio-util", + "tower-layer", + "tower-service", + "tracing", +] + [[package]] name = "tower" version = "0.5.1" @@ -2564,14 +3896,14 @@ dependencies = [ [[package]] name = "tower-http" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8437150ab6bbc8c5f0f519e3d5ed4aa883a83dd4cdd3d1b21f9482936046cb97" +checksum = "403fa3b783d4b626a8ad51d766ab03cb6d2dbfc46b1c5d4448395e6628dc9697" dependencies = [ "bitflags", "bytes", - "http", - "http-body", + "http 1.1.0", + "http-body 1.0.1", "pin-project-lite", "tower-layer", "tower-service", @@ -2592,9 +3924,9 @@ checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" -version = "0.1.40" +version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" dependencies = [ "log", "pin-project-lite", @@ -2604,9 +3936,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.27" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", @@ -2615,9 +3947,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.32" +version = "0.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" dependencies = [ "once_cell", "valuable", @@ -2654,6 +3986,25 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" +[[package]] +name = "tungstenite" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ef1a641ea34f399a848dea702823bbecfb4c486f911735368f1f137cb8257e1" +dependencies = [ + "byteorder", + "bytes", + "data-encoding", + "http 1.1.0", + "httparse", + "log", + "rand", + "sha1", + "thiserror 1.0.69", + "url", + "utf-8", +] + [[package]] name = "tungstenite" version = "0.24.0" @@ -2663,12 +4014,12 @@ dependencies = [ "byteorder", "bytes", "data-encoding", - "http", + "http 1.1.0", "httparse", "log", "rand", "sha1", - "thiserror", + "thiserror 1.0.69", "utf-8", ] @@ -2704,17 +4055,11 @@ version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7e51b68083f157f853b6379db119d1c1be0e6e4dec98101079dec41f6f5cf6df" -[[package]] -name = "unicode-bidi" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893" - [[package]] name = "unicode-ident" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" [[package]] name = "unicode-normalization" @@ -2731,6 +4076,18 @@ version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" +[[package]] +name = "unicode-width" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" + +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + [[package]] name = "unsafe-libyaml" version = "0.2.11" @@ -2745,9 +4102,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.2" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ "form_urlencoded", "idna", @@ -2760,6 +4117,18 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "utf8parse" version = "0.2.2" @@ -2768,9 +4137,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "utoipa" -version = "5.1.3" +version = "5.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d9ba0ade4e2f024cd1842dfbaf9dbc540639fc082299acf7649d71bd14eaca3" +checksum = "514a48569e4e21c86d0b84b5612b5e73c0b2cf09db63260134ba426d4e8ea714" dependencies = [ "indexmap 2.6.0", "serde", @@ -2780,9 +4149,9 @@ dependencies = [ [[package]] name = "utoipa-gen" -version = "5.1.3" +version = "5.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cf390d6503c9c9eac988447c38ba934a707b0b768b14511a493b4fc0e8ecb00" +checksum = "5629efe65599d0ccd5d493688cbf6e03aa7c1da07fe59ff97cf5977ed0637f66" dependencies = [ "proc-macro2", "quote", @@ -2806,6 +4175,51 @@ dependencies = [ "zip", ] +[[package]] +name = "utxorpc" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1b94946745af6df920d4dc6e14f2cc73417520c9a7823133e5436660ee3fac9" +dependencies = [ + "bytes", + "thiserror 1.0.69", + "tokio", + "tonic", + "utxorpc-spec 0.12.0", +] + +[[package]] +name = "utxorpc-spec" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd510ca9b5937fe5e62be72924f0a9a217c35fdcd10f0959be60319f4cac639b" +dependencies = [ + "bytes", + "futures-core", + "pbjson", + "pbjson-types", + "prost", + "prost-types", + "serde", + "tonic", +] + +[[package]] +name = "utxorpc-spec" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f5bb265be0e071adf7675ac8003a1c94772516a7a62d4fb1005f61ee288f3d3" +dependencies = [ + "bytes", + "futures-core", + "pbjson", + "pbjson-types", + "prost", + "prost-types", + "serde", + "tonic", +] + [[package]] name = "uuid" version = "1.11.0" @@ -2853,6 +4267,35 @@ dependencies = [ "try-lock", ] +[[package]] +name = "warp" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4378d202ff965b011c64817db11d5829506d3404edeadb61f190d111da3f231c" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "headers", + "http 0.2.12", + "hyper 0.14.31", + "log", + "mime", + "mime_guess", + "multer", + "percent-encoding", + "pin-project", + "scoped-tls", + "serde", + "serde_json", + "serde_urlencoded", + "tokio", + "tokio-tungstenite 0.21.0", + "tokio-util", + "tower-service", + "tracing", +] + [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -2927,66 +4370,433 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" [[package]] -name = "web-sys" -version = "0.3.72" +name = "wasm-encoder" +version = "0.212.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6488b90108c040df0fe62fa815cbdee25124641df01814dd7282749234c6112" +checksum = "501940df4418b8929eb6d52f1aade1fdd15a5b86c92453cb696e3c906bd3fc33" dependencies = [ - "js-sys", - "wasm-bindgen", + "leb128", ] [[package]] -name = "web-time" -version = "1.1.0" +name = "wasm-encoder" +version = "0.221.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" +checksum = "de35b6c3ef1f53ac7a31b5e69bc00f1542ea337e7e7162dc34c68b537ff82690" dependencies = [ - "js-sys", - "wasm-bindgen", + "leb128", + "wasmparser 0.221.0", ] [[package]] -name = "webpki-roots" -version = "0.26.6" +name = "wasm-metadata" +version = "0.221.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" +checksum = "9fca0d366d1be722f23e9e918e3b926945b21343424bb7a56e845beed82377bf" dependencies = [ - "rustls-pki-types", + "anyhow", + "indexmap 2.6.0", + "serde", + "serde_derive", + "serde_json", + "spdx", + "wasm-encoder 0.221.0", + "wasmparser 0.221.0", ] [[package]] -name = "winapi" -version = "0.3.9" +name = "wasmparser" +version = "0.212.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +checksum = "8d28bc49ba1e5c5b61ffa7a2eace10820443c4b7d1c0b144109261d14570fdf8" dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", + "ahash", + "bitflags", + "hashbrown 0.14.5", + "indexmap 2.6.0", + "semver", + "serde", ] [[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" +name = "wasmparser" +version = "0.221.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +checksum = "8659e755615170cfe20da468865c989da78c5da16d8652e69a75acda02406a92" +dependencies = [ + "bitflags", + "hashbrown 0.15.2", + "indexmap 2.6.0", + "semver", +] [[package]] -name = "winapi-util" -version = "0.1.9" +name = "wasmprinter" +version = "0.212.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" +checksum = "dfac65326cc561112af88c3028f6dfdb140acff67ede33a8e86be2dc6b8956f7" dependencies = [ - "windows-sys 0.59.0", + "anyhow", + "termcolor", + "wasmparser 0.212.0", ] [[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" +name = "wasmtime" +version = "23.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] +checksum = "fe501caefeb9f7b15360bdd7e47ad96e20223846f1c7db485ae5820ba5acc3d2" +dependencies = [ + "addr2line 0.21.0", + "anyhow", + "async-trait", + "bitflags", + "bumpalo", + "cc", + "cfg-if", + "encoding_rs", + "fxprof-processed-profile", + "gimli 0.28.1", + "hashbrown 0.14.5", + "indexmap 2.6.0", + "ittapi", + "libc", + "libm", + "log", + "mach2", + "memfd", + "object", + "once_cell", + "paste", + "postcard", + "psm", + "rayon", + "rustix", + "semver", + "serde", + "serde_derive", + "serde_json", + "smallvec", + "sptr", + "target-lexicon", + "wasm-encoder 0.212.0", + "wasmparser 0.212.0", + "wasmtime-asm-macros", + "wasmtime-cache", + "wasmtime-component-macro", + "wasmtime-component-util", + "wasmtime-cranelift", + "wasmtime-environ", + "wasmtime-fiber", + "wasmtime-jit-debug", + "wasmtime-jit-icache-coherence", + "wasmtime-slab", + "wasmtime-versioned-export-macros", + "wasmtime-winch", + "wat", + "windows-sys 0.52.0", +] + +[[package]] +name = "wasmtime-asm-macros" +version = "23.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c904a057d74bfa0ad9369a3fd99231d81ba0345f059d03c9148c3bb2abbf310f" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "wasmtime-cache" +version = "23.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8dff4d467d6b5bd0d137f5426f45178222e40b59e49ab3a7361420262b9f00df" +dependencies = [ + "anyhow", + "base64 0.21.7", + "directories-next", + "log", + "postcard", + "rustix", + "serde", + "serde_derive", + "sha2", + "toml", + "windows-sys 0.52.0", + "zstd", +] + +[[package]] +name = "wasmtime-component-macro" +version = "23.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a96185dab1c14ffb986ff2b3a2185d15acf2b801ca7895aa35ee80328e2ce38" +dependencies = [ + "anyhow", + "proc-macro2", + "quote", + "syn", + "wasmtime-component-util", + "wasmtime-wit-bindgen", + "wit-parser 0.212.0", +] + +[[package]] +name = "wasmtime-component-util" +version = "23.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71a40200d42a8985edadb4007a0ed320756cbe28065b83e0027e39524c1b1b22" + +[[package]] +name = "wasmtime-cranelift" +version = "23.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b099ef9b7808fa8d18cad32243e78e9c07a4a8aacfa913d88dc08704b1643c49" +dependencies = [ + "anyhow", + "cfg-if", + "cranelift-codegen", + "cranelift-control", + "cranelift-entity", + "cranelift-frontend", + "cranelift-native", + "cranelift-wasm", + "gimli 0.28.1", + "log", + "object", + "target-lexicon", + "thiserror 1.0.69", + "wasmparser 0.212.0", + "wasmtime-environ", + "wasmtime-versioned-export-macros", +] + +[[package]] +name = "wasmtime-environ" +version = "23.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2f1765f6ca1a166927bee13ad4aed7bf18269f34c0cd7d6d523889a0b52e6ee" +dependencies = [ + "anyhow", + "cpp_demangle", + "cranelift-bitset", + "cranelift-entity", + "gimli 0.28.1", + "indexmap 2.6.0", + "log", + "object", + "postcard", + "rustc-demangle", + "semver", + "serde", + "serde_derive", + "target-lexicon", + "wasm-encoder 0.212.0", + "wasmparser 0.212.0", + "wasmprinter", + "wasmtime-component-util", + "wasmtime-types", +] + +[[package]] +name = "wasmtime-fiber" +version = "23.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "047be22a9ebe0343e583edf52b89b60a87e37bec1bc71dc127d3c7fb287c4471" +dependencies = [ + "anyhow", + "cc", + "cfg-if", + "rustix", + "wasmtime-asm-macros", + "wasmtime-versioned-export-macros", + "windows-sys 0.52.0", +] + +[[package]] +name = "wasmtime-jit-debug" +version = "23.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2383b29fd973222293b5ff562f81a67c7e558b669685ca13f8cb80d04ea24b2d" +dependencies = [ + "object", + "once_cell", + "rustix", + "wasmtime-versioned-export-macros", +] + +[[package]] +name = "wasmtime-jit-icache-coherence" +version = "23.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e1a826e4ccd0803b2f7463289cad104f40d09d06bc8acf1a614230a47b4d96f" +dependencies = [ + "anyhow", + "cfg-if", + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "wasmtime-slab" +version = "23.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f92a137c17c992eb5eaacfa0f0590353471e49dbb4bdbdf9cf7536d66109e63a" + +[[package]] +name = "wasmtime-types" +version = "23.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6072ac3267866d99ca726b6a4f157df9b733aac8082e902d527368f07c303ba" +dependencies = [ + "anyhow", + "cranelift-entity", + "serde", + "serde_derive", + "smallvec", + "wasmparser 0.212.0", +] + +[[package]] +name = "wasmtime-versioned-export-macros" +version = "23.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2bde986038b819bc43a21fef0610aeb47aabfe3ea09ca3533a7b81023b84ec6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "wasmtime-winch" +version = "23.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "beb1abdc26ddf1d7c819ea0fcbfccb0808410549d28bb3154c9bdb7d11fbcc58" +dependencies = [ + "anyhow", + "cranelift-codegen", + "gimli 0.28.1", + "object", + "target-lexicon", + "wasmparser 0.212.0", + "wasmtime-cranelift", + "wasmtime-environ", + "winch-codegen", +] + +[[package]] +name = "wasmtime-wit-bindgen" +version = "23.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f88e49a9b81746ec0cede5505e40a4012c92cb5054cd7ef4300dc57c36f26b1" +dependencies = [ + "anyhow", + "heck 0.4.1", + "indexmap 2.6.0", + "wit-parser 0.212.0", +] + +[[package]] +name = "wast" +version = "221.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d8eb1933d493dd07484a255c3f52236123333f5befaa3be36182a50d393ec54" +dependencies = [ + "bumpalo", + "leb128", + "memchr", + "unicode-width", + "wasm-encoder 0.221.0", +] + +[[package]] +name = "wat" +version = "1.221.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c813fd4e5b2b97242830b56e7b7dc5479bc17aaa8730109be35e61909af83993" +dependencies = [ + "wast", +] + +[[package]] +name = "web-sys" +version = "0.3.72" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6488b90108c040df0fe62fa815cbdee25124641df01814dd7282749234c6112" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "web-time" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki-roots" +version = "0.26.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d642ff16b7e79272ae451b7322067cdc17cadf68c23264be9d94a32319efe7e" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" +dependencies = [ + "windows-sys 0.59.0", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "winch-codegen" +version = "0.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a666bf2cdb838e68b9b8370d7ebf8806b87ccc0d89a634bfc9ed8ffca1f19591" +dependencies = [ + "anyhow", + "cranelift-codegen", + "gimli 0.28.1", + "regalloc2", + "smallvec", + "target-lexicon", + "wasmparser 0.212.0", + "wasmtime-cranelift", + "wasmtime-environ", +] + +[[package]] name = "windows-core" version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -3116,12 +4926,114 @@ dependencies = [ "memchr", ] +[[package]] +name = "wit-component" +version = "0.221.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d6af482af5d64ecae38fe2cbd973c2fda25c4ce6d1cc2abc71c2f3ea81838ed" +dependencies = [ + "anyhow", + "bitflags", + "indexmap 2.6.0", + "log", + "serde", + "serde_derive", + "serde_json", + "wasm-encoder 0.221.0", + "wasm-metadata", + "wasmparser 0.221.0", + "wit-parser 0.221.0", +] + +[[package]] +name = "wit-parser" +version = "0.212.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ceeb0424aa8679f3fcf2d6e3cfa381f3d6fa6179976a2c05a6249dd2bb426716" +dependencies = [ + "anyhow", + "id-arena", + "indexmap 2.6.0", + "log", + "semver", + "serde", + "serde_derive", + "serde_json", + "unicode-xid", + "wasmparser 0.212.0", +] + +[[package]] +name = "wit-parser" +version = "0.221.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61f5b0a971faff0855a827ef06b25528263a718907bed4056992382316f1e68e" +dependencies = [ + "anyhow", + "id-arena", + "indexmap 2.6.0", + "log", + "semver", + "serde", + "serde_derive", + "serde_json", + "unicode-xid", + "wasmparser 0.221.0", +] + +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + +[[package]] +name = "xattr" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8da84f1a25939b27f6820d92aed108f83ff920fdf11a7b19366c27c4cda81d4f" +dependencies = [ + "libc", + "linux-raw-sys", + "rustix", +] + [[package]] name = "yansi" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" +[[package]] +name = "yoke" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + [[package]] name = "zerocopy" version = "0.7.35" @@ -3143,17 +5055,60 @@ dependencies = [ "syn", ] +[[package]] +name = "zerofrom" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + [[package]] name = "zeroize" version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "zip" -version = "2.2.0" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc5e4288ea4057ae23afc69a4472434a87a2495cafce6632fd1c4ec9f5cf3494" +checksum = "99d52293fc86ea7cf13971b3bb81eb21683636e7ae24c729cdaf1b7c4157a352" dependencies = [ "arbitrary", "crc32fast", @@ -3162,7 +5117,7 @@ dependencies = [ "flate2", "indexmap 2.6.0", "memchr", - "thiserror", + "thiserror 2.0.3", "zopfli", ] @@ -3179,3 +5134,31 @@ dependencies = [ "once_cell", "simd-adler32", ] + +[[package]] +name = "zstd" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcf2b778a664581e31e389454a7072dab1647606d44f7feea22cd5abb9c9f3f9" +dependencies = [ + "zstd-safe", +] + +[[package]] +name = "zstd-safe" +version = "7.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54a3ab4db68cea366acc5c897c7b4d4d1b8994a9cd6e6f841f8964566a419059" +dependencies = [ + "zstd-sys", +] + +[[package]] +name = "zstd-sys" +version = "2.0.13+zstd.1.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38ff0f21cfee8f97d94cef41359e0c89aa6113028ab0291aa8ca0038995a95aa" +dependencies = [ + "cc", + "pkg-config", +] diff --git a/Cargo.toml b/Cargo.toml index 20d4e6b..4972fc7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,6 +5,9 @@ members = [ "firefly-cardanosigner", "firefly-server", "scripts/demo", + "scripts/deploy-contract", ] +exclude = ["wasm"] + resolver = "2" diff --git a/firefly-cardanoconnect/Cargo.toml b/firefly-cardanoconnect/Cargo.toml index 7366712..e7b7e35 100644 --- a/firefly-cardanoconnect/Cargo.toml +++ b/firefly-cardanoconnect/Cargo.toml @@ -9,12 +9,14 @@ aide = { version = "0.13", features = ["axum"] } anyhow = "1" async-trait = "0.1" axum = { version = "0.7", features = ["macros", "ws"] } -blockfrost = { git = "https://github.com/blockfrost/blockfrost-rust.git", rev = "14e22b5", default-features = false, features = ["rustls-tls"] } +balius-runtime = { git = "https://github.com/SupernaviX/balius.git", rev = "3a899f9" } +blockfrost = { version = "1", default-features = false, features = ["rustls-tls"] } blockfrost-openapi = "0.1.69" clap = { version = "4", features = ["derive"] } chrono = "0.4" dashmap = "6" futures = "0.3" +pallas-addresses = "0.31" pallas-codec = "0.31" pallas-crypto = "0.31" pallas-primitives = "0.31" diff --git a/firefly-cardanoconnect/db/migrations/sqlite/V000005__create_operations_table.sql b/firefly-cardanoconnect/db/migrations/sqlite/V000005__create_operations_table.sql new file mode 100644 index 0000000..bedca65 --- /dev/null +++ b/firefly-cardanoconnect/db/migrations/sqlite/V000005__create_operations_table.sql @@ -0,0 +1,6 @@ +CREATE TABLE "operations" ( + "id" TEXT NOT NULL PRIMARY KEY, + "status" TEXT NOT NULL, + "error_message" TEXT NULL, + "tx_id" TEXT NULL +) \ No newline at end of file diff --git a/firefly-cardanoconnect/db/migrations/sqlite/V000006__add_block_record_transactions.sql b/firefly-cardanoconnect/db/migrations/sqlite/V000006__add_block_record_transactions.sql new file mode 100644 index 0000000..7b321e6 --- /dev/null +++ b/firefly-cardanoconnect/db/migrations/sqlite/V000006__add_block_record_transactions.sql @@ -0,0 +1,3 @@ +ALTER TABLE "block_records" +ADD COLUMN "transactions" BLOB NOT NULL +DEFAULT x'80' \ No newline at end of file diff --git a/firefly-cardanoconnect/src/blockchain/blockfrost.rs b/firefly-cardanoconnect/src/blockchain/blockfrost.rs index c578e69..6466a3c 100644 --- a/firefly-cardanoconnect/src/blockchain/blockfrost.rs +++ b/firefly-cardanoconnect/src/blockchain/blockfrost.rs @@ -1,11 +1,12 @@ use std::{collections::VecDeque, time::Duration}; -use anyhow::{bail, Result}; +use anyhow::{bail, Context as _, Result}; use async_trait::async_trait; use blockfrost::{ BlockFrostSettings, BlockfrostAPI, BlockfrostError, BlockfrostResult, Pagination, }; use blockfrost_openapi::models::BlockContent; +use futures::future::try_join_all; use pallas_primitives::conway::Tx; use tokio::time; @@ -272,12 +273,16 @@ async fn parse_block(api: &BlockfrostAPI, block: BlockContent) -> Result BlockfrostResultExt for BlockfrostResult { } } } + +async fn fetch_tx(blockfrost: &BlockfrostAPI, hash: &str) -> Result> { + let tx_body = blockfrost + .transactions_cbor(hash) + .await + .context("could not fetch tx body")?; + let bytes = hex::decode(&tx_body.cbor)?; + Ok(bytes) +} diff --git a/firefly-cardanoconnect/src/blockchain/mocks.rs b/firefly-cardanoconnect/src/blockchain/mocks.rs index 8e06afa..6825fac 100644 --- a/firefly-cardanoconnect/src/blockchain/mocks.rs +++ b/firefly-cardanoconnect/src/blockchain/mocks.rs @@ -193,6 +193,7 @@ impl MockChain { block_hash: Self::generate_hash(rng), parent_hash, transaction_hashes, + transactions: vec![], }; indexes.insert(block.block_hash.clone(), chain.len()); chain.push(block); diff --git a/firefly-cardanoconnect/src/blockchain/n2c.rs b/firefly-cardanoconnect/src/blockchain/n2c.rs index 89995aa..85be165 100644 --- a/firefly-cardanoconnect/src/blockchain/n2c.rs +++ b/firefly-cardanoconnect/src/blockchain/n2c.rs @@ -233,6 +233,12 @@ impl N2cChainSync { let block_hash = hex::encode(block.hash()); let parent_hash = block.header().previous_hash().map(hex::encode); + let mut transaction_hashes = vec![]; + let mut transactions = vec![]; + for tx in block.txs() { + transaction_hashes.push(hex::encode(tx.hash())); + transactions.push(tx.encode()); + } let transaction_hashes = block .txs() .iter() @@ -244,6 +250,7 @@ impl N2cChainSync { block_hash, parent_hash, transaction_hashes, + transactions, }) } } diff --git a/firefly-cardanoconnect/src/config.rs b/firefly-cardanoconnect/src/config.rs index 5428604..afe0d90 100644 --- a/firefly-cardanoconnect/src/config.rs +++ b/firefly-cardanoconnect/src/config.rs @@ -6,7 +6,9 @@ use firefly_server::{ }; use serde::Deserialize; -use crate::{blockchain::BlockchainConfig, persistence::PersistenceConfig}; +use crate::{ + blockchain::BlockchainConfig, contracts::ContractsConfig, persistence::PersistenceConfig, +}; #[derive(Debug, Deserialize)] #[serde(rename_all = "camelCase")] @@ -18,6 +20,7 @@ pub struct CardanoConnectConfig { pub log: LogConfig, #[serde(default)] pub persistence: PersistenceConfig, + pub contracts: Option, } #[derive(Debug, Deserialize)] diff --git a/firefly-cardanoconnect/src/contracts.rs b/firefly-cardanoconnect/src/contracts.rs new file mode 100644 index 0000000..23d9d75 --- /dev/null +++ b/firefly-cardanoconnect/src/contracts.rs @@ -0,0 +1,101 @@ +use std::{path::PathBuf, sync::Arc}; + +use anyhow::{bail, Result}; +use balius_runtime::{ledgers::Ledger, Response, Runtime, Store}; +use ledger::BlockfrostLedger; +use serde::Deserialize; +use serde_json::{json, Value}; +use tokio::{ + fs, + sync::{Mutex, RwLock}, +}; + +mod ledger; + +#[derive(Debug, Deserialize, Clone)] +#[serde(rename_all = "camelCase")] +pub struct ContractsConfig { + pub components_path: PathBuf, + pub store_path: PathBuf, + pub cache_size: Option, +} + +pub struct ContractManager { + components_path: Option, + runtime: Option>, +} + +impl ContractManager { + pub async fn new(config: &ContractsConfig, blockfrost_key: Option<&str>) -> Result { + fs::create_dir_all(&config.components_path).await?; + let runtime = Self::new_runtime(config, blockfrost_key).await?; + Ok(Self { + components_path: Some(config.components_path.clone()), + runtime: Some(RwLock::new(runtime)), + }) + } + + pub fn none() -> Self { + Self { + components_path: None, + runtime: None, + } + } + + pub async fn deploy(&self, id: &str, contract: &[u8]) -> Result<()> { + let Some(components_path) = self.components_path.as_deref() else { + bail!("No contract directory configured"); + }; + let path = components_path.join(format!("{id}.wasm")); + fs::write(&path, contract).await?; + if let Some(rt_lock) = &self.runtime { + let mut runtime = rt_lock.write().await; + runtime.register_worker(id, path, json!(null)).await?; + } + Ok(()) + } + + pub async fn invoke( + &self, + contract: &str, + method: &str, + params: Value, + ) -> Result>> { + let params = serde_json::to_vec(¶ms)?; + let Some(rt_lock) = &self.runtime else { + bail!("Contract manager not configured"); + }; + + let runtime = rt_lock.read().await; + let response = runtime.handle_request(contract, method, params).await?; + match response { + Response::PartialTx(bytes) => Ok(Some(bytes)), + _ => Ok(None), + } + } + + async fn new_runtime( + config: &ContractsConfig, + blockfrost_key: Option<&str>, + ) -> Result { + let store = Store::open(&config.store_path, config.cache_size)?; + let mut runtime_builder = Runtime::builder(store); + if let Some(key) = blockfrost_key { + let ledger = BlockfrostLedger::new(key); + runtime_builder = + runtime_builder.with_ledger(Ledger::Custom(Arc::new(Mutex::new(ledger)))) + } + let mut runtime = runtime_builder.build()?; + let mut entries = fs::read_dir(&config.components_path).await?; + while let Some(entry) = entries.next_entry().await? { + let extless = entry.path().with_extension(""); + let Some(id) = extless.file_name().and_then(|s| s.to_str()) else { + bail!("invalid file name {:?}", entry.file_name().into_string()); + }; + let wasm_path = entry.path(); + + runtime.register_worker(id, wasm_path, json!(null)).await?; + } + Ok(runtime) + } +} diff --git a/firefly-cardanoconnect/src/contracts/ledger.rs b/firefly-cardanoconnect/src/contracts/ledger.rs new file mode 100644 index 0000000..86f5cae --- /dev/null +++ b/firefly-cardanoconnect/src/contracts/ledger.rs @@ -0,0 +1,134 @@ +use std::collections::{hash_map::Entry, HashMap}; + +use async_trait::async_trait; +use balius_runtime::ledgers::{CustomLedger, LedgerError, TxoRef, Utxo, UtxoPage, UtxoPattern}; +use blockfrost::{BlockFrostSettings, BlockfrostAPI, Pagination}; +use pallas_traverse::MultiEraTx; + +pub struct BlockfrostLedger { + client: BlockfrostAPI, +} + +impl BlockfrostLedger { + pub fn new(key: &str) -> Self { + Self { + client: BlockfrostAPI::new(key, BlockFrostSettings::new()), + } + } +} + +#[async_trait] +impl CustomLedger for BlockfrostLedger { + async fn read_utxos(&mut self, refs: Vec) -> Result, LedgerError> { + let mut txs = TxDict::new(&mut self.client); + let mut result = vec![]; + for ref_ in &refs { + let tx_bytes = txs.get_bytes(hex::encode(&ref_.tx_hash)).await?; + let tx = TxDict::decode_tx(tx_bytes)?; + let Some(txo) = tx.output_at(ref_.tx_index as usize) else { + return Err(LedgerError::NotFound(ref_.clone())); + }; + result.push(Utxo { + ref_: ref_.clone(), + body: txo.encode(), + }); + } + Ok(result) + } + + async fn search_utxos( + &mut self, + pattern: UtxoPattern, + start: Option, + max_items: u32, + ) -> Result { + if pattern.asset.is_some() { + return Err(LedgerError::Internal( + "querying by asset is not implemented".into(), + )); + } + let Some(address) = pattern.address else { + return Err(LedgerError::Internal("address is required".into())); + }; + let address = pallas_addresses::Address::from_bytes(&address.exact_address) + .and_then(|a| a.to_bech32()) + .map_err(|err| LedgerError::Internal(err.to_string()))?; + let page = match start { + Some(s) => s + .parse::() + .map_err(|e| LedgerError::Internal(e.to_string()))?, + None => 1, + }; + + let pagination = Pagination::new(blockfrost::Order::Asc, page, max_items as usize); + let query = self + .client + .addresses_utxos(&address, pagination) + .await + .map_err(|err| LedgerError::Upstream(err.to_string()))?; + + let mut utxos = vec![]; + let mut txs = TxDict::new(&mut self.client); + for utxo in query { + let raw_tx_hash = + hex::decode(&utxo.tx_hash).map_err(|e| LedgerError::Upstream(e.to_string()))?; + let ref_ = TxoRef { + tx_hash: raw_tx_hash, + tx_index: utxo.tx_index as u32, + }; + + let tx_bytes = txs.get_bytes(utxo.tx_hash.clone()).await?; + let tx = TxDict::decode_tx(tx_bytes)?; + let Some(txo) = tx.output_at(utxo.tx_index as usize) else { + return Err(LedgerError::NotFound(ref_)); + }; + + utxos.push(Utxo { + ref_, + body: txo.encode(), + }); + } + + let next_token = if utxos.len() == max_items as usize { + Some((page + 1).to_string()) + } else { + None + }; + + Ok(UtxoPage { utxos, next_token }) + } +} + +struct TxDict<'a> { + client: &'a mut BlockfrostAPI, + txs: HashMap>, +} +impl<'a> TxDict<'a> { + fn new(client: &'a mut BlockfrostAPI) -> Self { + Self { + client, + txs: HashMap::new(), + } + } + + async fn get_bytes(&mut self, hash: String) -> Result<&Vec, LedgerError> { + match self.txs.entry(hash) { + Entry::Occupied(tx) => Ok(tx.into_mut()), + Entry::Vacant(entry) => { + let tx = self + .client + .transactions_cbor(entry.key()) + .await + .map_err(|e| LedgerError::Upstream(e.to_string()))?; + let bytes = + hex::decode(&tx.cbor).map_err(|e| LedgerError::Internal(e.to_string()))?; + + Ok(entry.insert(bytes)) + } + } + } + + fn decode_tx(bytes: &[u8]) -> Result, LedgerError> { + MultiEraTx::decode(bytes).map_err(|e| LedgerError::Internal(e.to_string())) + } +} diff --git a/firefly-cardanoconnect/src/main.rs b/firefly-cardanoconnect/src/main.rs index 669f1d8..31ebc97 100644 --- a/firefly-cardanoconnect/src/main.rs +++ b/firefly-cardanoconnect/src/main.rs @@ -8,10 +8,13 @@ use anyhow::Result; use blockchain::BlockchainClient; use clap::Parser; use config::{load_config, CardanoConnectConfig}; +use contracts::ContractManager; use firefly_server::instrumentation; +use operations::OperationsManager; use routes::{ chain::get_chain_tip, health::health, + operations::{deploy_contract, get_operation_status, invoke_contract}, streams::{ create_listener, create_stream, delete_listener, delete_stream, get_listener, get_stream, list_listeners, list_streams, update_stream, @@ -25,6 +28,8 @@ use tracing::instrument; mod blockchain; mod config; +mod contracts; +mod operations; mod persistence; mod routes; mod signer; @@ -43,6 +48,7 @@ struct Args { #[derive(Clone)] struct AppState { pub blockchain: Arc, + pub operations: Arc, pub signer: Arc, pub stream_manager: Arc, } @@ -50,15 +56,34 @@ struct AppState { #[instrument(err(Debug))] async fn init_state(config: &CardanoConnectConfig, mock_data: bool) -> Result { let persistence = persistence::init(&config.persistence).await?; + let signer = Arc::new(CardanoSigner::new(config)?); let blockchain = if mock_data { Arc::new(BlockchainClient::mock().await) } else { Arc::new(BlockchainClient::new(config).await?) }; + let contracts = if let Some(contracts) = &config.contracts { + let blockfrost_key = config + .connector + .blockchain + .blockfrost_key + .as_ref() + .map(|k| k.0.as_str()); + Arc::new(ContractManager::new(contracts, blockfrost_key).await?) + } else { + Arc::new(ContractManager::none()) + }; + let operations = Arc::new(OperationsManager::new( + blockchain.clone(), + contracts, + persistence.clone(), + signer.clone(), + )); let state = AppState { blockchain: blockchain.clone(), - signer: Arc::new(CardanoSigner::new(config)?), + operations, + signer, stream_manager: Arc::new(StreamManager::new(persistence, blockchain).await?), }; @@ -77,7 +102,10 @@ async fn main() -> Result<()> { let router = ApiRouter::new() .api_route("/health", get(health)) + .api_route("/contracts/deploy", post(deploy_contract)) + .api_route("/contracts/invoke", post(invoke_contract)) .api_route("/transactions", post(submit_transaction)) + .api_route("/transactions/:id", get(get_operation_status)) .api_route("/eventstreams", post(create_stream).get(list_streams)) .api_route( "/eventstreams/:streamId", diff --git a/firefly-cardanoconnect/src/operations.rs b/firefly-cardanoconnect/src/operations.rs new file mode 100644 index 0000000..97d2fd9 --- /dev/null +++ b/firefly-cardanoconnect/src/operations.rs @@ -0,0 +1,5 @@ +mod manager; +mod types; + +pub use manager::OperationsManager; +pub use types::*; diff --git a/firefly-cardanoconnect/src/operations/manager.rs b/firefly-cardanoconnect/src/operations/manager.rs new file mode 100644 index 0000000..fefe968 --- /dev/null +++ b/firefly-cardanoconnect/src/operations/manager.rs @@ -0,0 +1,110 @@ +use std::sync::Arc; + +use anyhow::Context; +use firefly_server::apitypes::{ApiError, ApiResult}; +use pallas_primitives::conway::Tx; +use serde_json::Value; + +use crate::{ + blockchain::BlockchainClient, contracts::ContractManager, persistence::Persistence, + signer::CardanoSigner, +}; + +use super::{Operation, OperationId, OperationStatus}; + +pub struct OperationsManager { + blockchain: Arc, + contracts: Arc, + persistence: Arc, + signer: Arc, +} + +impl OperationsManager { + pub fn new( + blockchain: Arc, + contracts: Arc, + persistence: Arc, + signer: Arc, + ) -> Self { + Self { + blockchain, + contracts, + persistence, + signer, + } + } + + pub async fn deploy(&self, id: OperationId, name: &str, contract: &[u8]) -> ApiResult<()> { + let mut op = Operation { + id, + status: OperationStatus::Pending, + tx_id: None, + }; + self.persistence.write_operation(&op).await?; + match self.contracts.deploy(name, contract).await { + Ok(()) => { + op.status = OperationStatus::Succeeded; + self.persistence.write_operation(&op).await?; + Ok(()) + } + Err(err) => { + op.status = OperationStatus::Failed(err.to_string()); + self.persistence.write_operation(&op).await?; + Err(err.into()) + } + } + } + + pub async fn invoke( + &self, + id: OperationId, + from: &str, + contract: &str, + method: &str, + params: Value, + ) -> ApiResult<()> { + let mut op = Operation { + id, + status: OperationStatus::Pending, + tx_id: None, + }; + self.persistence.write_operation(&op).await?; + let result = self.contracts.invoke(contract, method, params).await; + let value = match result { + Ok(v) => v, + Err(err) => { + op.status = OperationStatus::Failed(err.to_string()); + self.persistence.write_operation(&op).await?; + return Err(err.into()); + } + }; + if let Some(tx) = value { + op.tx_id = Some(self.submit_transaction(from, tx).await?); + } + + op.status = OperationStatus::Succeeded; + self.persistence.write_operation(&op).await?; + + Ok(()) + } + + pub async fn get_operation(&self, id: &OperationId) -> ApiResult { + let Some(op) = self.persistence.read_operation(id).await? else { + return Err(ApiError::not_found("No operation found with that id")); + }; + Ok(op) + } + + async fn submit_transaction(&self, address: &str, tx: Vec) -> ApiResult { + let mut transaction: Tx = minicbor::decode(&tx)?; + self.signer + .sign(address.to_string(), &mut transaction) + .await?; + let tx_id = self + .blockchain + .submit(transaction) + .await + .context("could not submit transaction")?; + Ok(tx_id) + } +} diff --git a/firefly-cardanoconnect/src/operations/types.rs b/firefly-cardanoconnect/src/operations/types.rs new file mode 100644 index 0000000..1d52641 --- /dev/null +++ b/firefly-cardanoconnect/src/operations/types.rs @@ -0,0 +1,35 @@ +use serde::{Deserialize, Serialize}; + +use crate::strong_id; + +strong_id!(OperationId, String); + +#[derive(Clone, Debug, Serialize, Deserialize)] +pub struct Operation { + pub id: OperationId, + pub status: OperationStatus, + pub tx_id: Option, +} + +#[derive(Clone, Debug, Serialize, Deserialize)] +pub enum OperationStatus { + Succeeded, + Pending, + Failed(String), +} +impl OperationStatus { + pub fn name(&self) -> &'static str { + match self { + Self::Succeeded => "Succeeded", + Self::Pending => "Pending", + Self::Failed(_) => "Failed", + } + } + pub fn error_message(&self) -> Option<&str> { + if let Self::Failed(msg) = self { + Some(msg) + } else { + None + } + } +} diff --git a/firefly-cardanoconnect/src/persistence.rs b/firefly-cardanoconnect/src/persistence.rs index e23a98d..e1bc4bb 100644 --- a/firefly-cardanoconnect/src/persistence.rs +++ b/firefly-cardanoconnect/src/persistence.rs @@ -7,7 +7,10 @@ use mocks::MockPersistence; use serde::Deserialize; use sqlite::{SqliteConfig, SqlitePersistence}; -use crate::streams::{BlockRecord, Listener, ListenerId, Stream, StreamCheckpoint, StreamId}; +use crate::{ + operations::{Operation, OperationId}, + streams::{BlockRecord, Listener, ListenerId, Stream, StreamCheckpoint, StreamId}, +}; mod mocks; mod sqlite; @@ -58,6 +61,9 @@ pub trait Persistence: Sync + Send { listener: &ListenerId, new_records: Vec, ) -> Result<()>; + + async fn write_operation(&self, op: &Operation) -> ApiResult<()>; + async fn read_operation(&self, id: &OperationId) -> ApiResult>; } pub async fn init(config: &PersistenceConfig) -> Result> { diff --git a/firefly-cardanoconnect/src/persistence/mocks.rs b/firefly-cardanoconnect/src/persistence/mocks.rs index e1d4f86..6aae2c0 100644 --- a/firefly-cardanoconnect/src/persistence/mocks.rs +++ b/firefly-cardanoconnect/src/persistence/mocks.rs @@ -6,7 +6,10 @@ use dashmap::DashMap; use firefly_server::apitypes::{ApiError, ApiResult}; use tokio::sync::Mutex; -use crate::streams::{BlockRecord, Listener, ListenerId, Stream, StreamCheckpoint, StreamId}; +use crate::{ + operations::{Operation, OperationId}, + streams::{BlockRecord, Listener, ListenerId, Stream, StreamCheckpoint, StreamId}, +}; use super::Persistence; @@ -16,6 +19,7 @@ pub struct MockPersistence { all_listeners: DashMap>, all_checkpoints: DashMap, all_blocks: DashMap>, + all_operations: DashMap, } #[async_trait] @@ -164,4 +168,14 @@ impl Persistence for MockPersistence { } Ok(()) } + + async fn write_operation(&self, op: &Operation) -> ApiResult<()> { + self.all_operations.insert(op.id.clone(), op.clone()); + Ok(()) + } + + async fn read_operation(&self, id: &OperationId) -> ApiResult> { + let operation = self.all_operations.get(id).map(|op| op.clone()); + Ok(operation) + } } diff --git a/firefly-cardanoconnect/src/persistence/sqlite.rs b/firefly-cardanoconnect/src/persistence/sqlite.rs index 4fb6a0f..7d9b601 100644 --- a/firefly-cardanoconnect/src/persistence/sqlite.rs +++ b/firefly-cardanoconnect/src/persistence/sqlite.rs @@ -1,14 +1,15 @@ use std::{path::PathBuf, time::Duration}; -use anyhow::Result; +use anyhow::{bail, Result}; use async_trait::async_trait; use firefly_server::apitypes::{ApiError, ApiResult}; use rusqlite::{params, types::FromSql, Row, ToSql}; use serde::Deserialize; use tokio_rusqlite::Connection; -use crate::streams::{ - BlockInfo, BlockRecord, Listener, ListenerId, Stream, StreamCheckpoint, StreamId, +use crate::{ + operations::{Operation, OperationId, OperationStatus}, + streams::{BlockInfo, BlockRecord, Listener, ListenerId, Stream, StreamCheckpoint, StreamId}, }; use super::Persistence; @@ -262,7 +263,7 @@ impl Persistence for SqlitePersistence { self.conn .call_unwrap(move |c| { c.prepare_cached( - "SELECT block_height, block_slot, block_hash, parent_hash, transaction_hashes, rolled_back + "SELECT block_height, block_slot, block_hash, parent_hash, transaction_hashes, transactions, rolled_back FROM block_records WHERE listener_id = ?1 ORDER BY id", @@ -285,8 +286,8 @@ impl Persistence for SqlitePersistence { self.conn.call_unwrap(move |c| { let tx = c.transaction()?; let mut insert = tx.prepare_cached( - "INSERT INTO block_records (listener_id, block_height, block_slot, block_hash, parent_hash, transaction_hashes, rolled_back) - VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7)", + "INSERT INTO block_records (listener_id, block_height, block_slot, block_hash, parent_hash, transaction_hashes, transactions, rolled_back) + VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8)", )?; for record in new_records { @@ -295,9 +296,14 @@ impl Persistence for SqlitePersistence { let block_hash = record.block.block_hash.clone(); let parent_hash = record.block.parent_hash.clone(); let transaction_hashes = serde_json::to_string(&record.block.transaction_hashes)?; + let transactions = { + let mut bytes = vec![]; + minicbor::encode(&record.block.transactions, &mut bytes).expect("infallible"); + bytes + }; let rolled_back = record.rolled_back; - insert.execute(params![listener_id, block_height, block_slot, block_hash, parent_hash, transaction_hashes, rolled_back])?; + insert.execute(params![listener_id, block_height, block_slot, block_hash, parent_hash, transaction_hashes, transactions, rolled_back])?; } drop(insert); @@ -305,6 +311,51 @@ impl Persistence for SqlitePersistence { Ok(()) }).await } + + async fn write_operation(&self, op: &Operation) -> ApiResult<()> { + let op = op.clone(); + self.conn + .call_unwrap(move |c| { + let status = op.status.name(); + let error_message = op.status.error_message(); + c.prepare_cached( + "INSERT INTO operations (id, status, error_message, tx_id) + VALUES (?1, ?2, ?3, ?4) + ON CONFLICT(id) DO UPDATE SET + status=excluded.status, + error_message=excluded.error_message, + tx_id=excluded.tx_id", + )? + .execute(params![ + op.id.to_string(), + status, + error_message, + op.tx_id, + ])?; + Ok(()) + }) + .await + } + + async fn read_operation(&self, id: &OperationId) -> ApiResult> { + let id = id.clone(); + self.conn + .call_unwrap(move |c| { + let Some(op) = c + .prepare_cached( + "SELECT id, status, error_message, tx_id + FROM operations + WHERE id = ?1", + )? + .query_and_then([id.to_string()], parse_operation)? + .next() + else { + return Ok(None); + }; + Ok(Some(op?)) + }) + .await + } } fn parse_stream(row: &Row) -> Result { @@ -349,7 +400,14 @@ fn parse_block_record(row: &Row) -> Result { let block_slot: Option = row.get("block_slot")?; let block_hash: String = row.get("block_hash")?; let parent_hash: Option = row.get("parent_hash")?; - let transaction_hashes: String = row.get("transaction_hashes")?; + let transaction_hashes = { + let raw: String = row.get("transaction_hashes")?; + serde_json::from_str(&raw)? + }; + let transactions = { + let raw: Vec = row.get("transactions")?; + minicbor::decode(&raw)? + }; let rolled_back: bool = row.get("rolled_back")?; Ok(BlockRecord { block: BlockInfo { @@ -357,12 +415,33 @@ fn parse_block_record(row: &Row) -> Result { block_slot, block_hash, parent_hash, - transaction_hashes: serde_json::from_str(&transaction_hashes)?, + transaction_hashes, + transactions, }, rolled_back, }) } +fn parse_operation(row: &Row) -> Result { + let id: String = row.get("id")?; + let error_message: Option = row.get("error_message")?; + let status = match error_message { + Some(error) => OperationStatus::Failed(error), + None => match row.get::<&str, String>("status")?.as_str() { + "Succeeded" => OperationStatus::Succeeded, + "Pending" => OperationStatus::Pending, + "Failed" => OperationStatus::Failed("".into()), + other => bail!("unrecognized status {other}"), + }, + }; + let tx_id: Option = row.get("tx_id")?; + Ok(Operation { + id: id.into(), + status, + tx_id, + }) +} + struct SqliteDuration(Duration); impl ToSql for SqliteDuration { diff --git a/firefly-cardanoconnect/src/routes.rs b/firefly-cardanoconnect/src/routes.rs index c1e4151..a37cc45 100644 --- a/firefly-cardanoconnect/src/routes.rs +++ b/firefly-cardanoconnect/src/routes.rs @@ -1,5 +1,6 @@ pub mod chain; pub mod health; +pub mod operations; pub mod streams; pub mod transaction; pub mod ws; diff --git a/firefly-cardanoconnect/src/routes/operations.rs b/firefly-cardanoconnect/src/routes/operations.rs new file mode 100644 index 0000000..ac0f34f --- /dev/null +++ b/firefly-cardanoconnect/src/routes/operations.rs @@ -0,0 +1,129 @@ +use axum::{ + extract::{Path, State}, + Json, +}; +use firefly_server::apitypes::{ApiResult, NoContent}; +use schemars::JsonSchema; +use serde::{Deserialize, Serialize}; +use serde_json::Value; + +use crate::{operations::Operation, AppState}; + +#[derive(Deserialize, JsonSchema)] +pub struct InvokeRequest { + /// The FireFly operation ID of this request. + pub id: String, + /// The address which should be signing any transactions. + pub from: String, + /// The name of the contract getting invoked. + pub address: String, + /// A description of the method getting invoked. + pub method: ABIMethod, + /// Any parameters needed to invoke the method. + pub params: Vec, +} + +#[derive(Deserialize, JsonSchema)] +pub struct DeployRequest { + /// The FireFly operation ID of this request. + pub id: String, + /// A hex-encoded WASM component. + pub contract: String, + /// A description of the schema for this contract. + pub definition: ABIContract, +} + +#[derive(Deserialize, JsonSchema)] +pub struct ABIContract { + pub name: String, +} + +#[derive(Deserialize, JsonSchema)] +#[serde(rename_all = "camelCase")] +pub struct ABIMethod { + pub name: String, + pub params: Vec, +} + +#[derive(Deserialize, JsonSchema)] +#[serde(rename_all = "camelCase")] +pub struct ABIParameter { + pub name: String, +} + +#[derive(Deserialize, JsonSchema)] +#[serde(rename_all = "camelCase")] +pub struct OperationPathParameters { + pub id: String, +} + +#[derive(Serialize, JsonSchema)] +#[serde(rename_all = "camelCase")] +pub struct GetOperationStatusResponse { + pub id: String, + pub status: String, + pub transaction_hash: Option, + pub error_message: Option, + pub receipt: OperationReceipt, +} + +impl From for GetOperationStatusResponse { + fn from(value: Operation) -> Self { + Self { + id: value.id.into(), + status: value.status.name().into(), + transaction_hash: value.tx_id, + error_message: value.status.error_message().map(|s| s.to_string()), + receipt: OperationReceipt { protocol_id: None }, + } + } +} + +#[derive(Serialize, JsonSchema)] +#[serde(rename_all = "camelCase")] +pub struct OperationReceipt { + pub protocol_id: Option, +} + +pub async fn deploy_contract( + State(AppState { operations, .. }): State, + Json(req): Json, +) -> ApiResult { + let id = req.id.into(); + let name = &req.definition.name; + let contract = hex::decode(req.contract)?; + match operations.deploy(id, name, &contract).await { + Ok(()) => Ok(NoContent), + Err(error) => Err(error.with_field("submissionRejected", true)), + } +} + +pub async fn invoke_contract( + State(AppState { operations, .. }): State, + Json(req): Json, +) -> ApiResult { + let id = req.id.into(); + let from = &req.from; + let contract = &req.address; + let method = &req.method.name; + let mut params = serde_json::Map::new(); + for (schema, value) in req.method.params.iter().zip(req.params.into_iter()) { + params.insert(schema.name.to_string(), value); + } + match operations + .invoke(id, from, contract, method, params.into()) + .await + { + Ok(()) => Ok(NoContent), + Err(error) => Err(error.with_field("submissionRejected", true)), + } +} + +pub async fn get_operation_status( + State(AppState { operations, .. }): State, + Path(OperationPathParameters { id }): Path, +) -> ApiResult> { + let id = id.into(); + let op = operations.get_operation(&id).await?; + Ok(Json(op.into())) +} diff --git a/firefly-cardanoconnect/src/routes/ws.rs b/firefly-cardanoconnect/src/routes/ws.rs index 7461503..4beacd9 100644 --- a/firefly-cardanoconnect/src/routes/ws.rs +++ b/firefly-cardanoconnect/src/routes/ws.rs @@ -36,14 +36,14 @@ async fn handle_socket( .iter() .map(|e| Event { listener_id: Some(e.id.listener_id.clone().into()), - signature: e.signature(), + signature: e.id.signature.clone(), block_number: e.id.block_number, block_hash: e.id.block_hash.clone(), transaction_hash: e.id.transaction_hash.clone(), transaction_index: e.id.transaction_index, log_index: e.id.log_index, timestamp: e.id.timestamp.map(systemtime_to_rfc3339), - data: serde_json::Value::Object(serde_json::Map::new()), + data: e.data.clone(), }) .collect(), }; diff --git a/firefly-cardanoconnect/src/streams/mux.rs b/firefly-cardanoconnect/src/streams/mux.rs index b8a9ee5..47be1d3 100644 --- a/firefly-cardanoconnect/src/streams/mux.rs +++ b/firefly-cardanoconnect/src/streams/mux.rs @@ -8,6 +8,7 @@ use std::{ use anyhow::{bail, Context, Result}; use dashmap::{DashMap, Entry}; use firefly_server::apitypes::ToAnyhow; +use serde_json::json; use tokio::{ select, sync::{mpsc, oneshot}, @@ -18,7 +19,7 @@ use tracing::warn; use crate::{ blockchain::BlockchainClient, persistence::Persistence, - streams::{blockchain::ListenerEvent, EventData, EventId}, + streams::{blockchain::ListenerEvent, EventId}, }; use super::{ @@ -344,6 +345,7 @@ impl StreamDispatcherWorker { !self.listeners.is_empty(), "no listeners to produce events!" ); + // TODO: gotta pull events from the balius runtime loop { // find the next event to process let mut sync_events = vec![]; @@ -530,6 +532,7 @@ impl StreamDispatcherWorker { if Self::matches_filter(tx_hash, filter) { let id = EventId { listener_id: listener.id.clone(), + signature: "TransactionAccepted(string,string,string)".into(), block_hash: block.block_hash.clone(), block_number: block.block_height, transaction_hash: tx_hash.clone(), @@ -539,7 +542,7 @@ impl StreamDispatcherWorker { }; events.push(Event { id, - data: EventData::TransactionAccepted, + data: json!({}), }) } } diff --git a/firefly-cardanoconnect/src/streams/types.rs b/firefly-cardanoconnect/src/streams/types.rs index 354abf7..8032917 100644 --- a/firefly-cardanoconnect/src/streams/types.rs +++ b/firefly-cardanoconnect/src/streams/types.rs @@ -102,6 +102,7 @@ pub struct BlockInfo { pub block_hash: String, pub parent_hash: Option, pub transaction_hashes: Vec, + pub transactions: Vec>, } impl BlockInfo { pub fn as_reference(&self) -> BlockReference { @@ -118,6 +119,7 @@ pub struct BlockRecord { #[derive(Clone, Debug)] pub struct EventId { pub listener_id: ListenerId, + pub signature: String, pub block_hash: String, pub block_number: Option, pub transaction_hash: String, @@ -126,31 +128,18 @@ pub struct EventId { pub timestamp: Option, } -#[derive(Clone, Debug)] -pub enum EventData { - TransactionAccepted, - TransactionRolledBack, -} - #[derive(Clone, Debug)] pub struct Event { pub id: EventId, - pub data: EventData, + pub data: serde_json::Value, } impl Event { - pub fn signature(&self) -> String { - match self.data { - EventData::TransactionAccepted => "TransactionAccepted(string,string,string)".into(), - EventData::TransactionRolledBack => { - "TransactionRolledBack(string,string,string)".into() - } + pub fn into_rollback(mut self) -> Self { + if self.id.signature == "TransactionAccepted(string,string,string)" { + self.id.signature = "TransactionRolledBack(string,string,string)".into(); + } else if self.id.signature == "TransactionRolledBack(string,string,string)" { + self.id.signature = "TransactionAccepted(string,string,string)".into(); } - } - pub fn into_rollback(self) -> Self { - let data = match self.data { - EventData::TransactionAccepted => EventData::TransactionRolledBack, - EventData::TransactionRolledBack => EventData::TransactionAccepted, - }; - Self { id: self.id, data } + self } } diff --git a/firefly-server/src/apitypes/error.rs b/firefly-server/src/apitypes/error.rs index 8c11bd6..800bc04 100644 --- a/firefly-server/src/apitypes/error.rs +++ b/firefly-server/src/apitypes/error.rs @@ -6,12 +6,12 @@ use axum::{ Json, }; use reqwest::StatusCode; -use serde::Serialize; #[derive(Debug)] pub struct ApiError { status: StatusCode, message: String, + fields: serde_json::Map, } impl ApiError { @@ -19,6 +19,7 @@ impl ApiError { Self { status: status.into(), message: message.into(), + fields: serde_json::Map::new(), } } pub fn from_reqwest(err: reqwest::Error) -> Self { @@ -39,6 +40,11 @@ impl ApiError { pub fn not_implemented(message: impl Into) -> Self { Self::new(StatusCode::NOT_IMPLEMENTED, message) } + pub fn with_field(self, name: &str, value: impl Into) -> Self { + let mut fields = self.fields; + fields.insert(name.into(), value.into()); + Self { fields, ..self } + } } impl Display for ApiError { @@ -47,16 +53,12 @@ impl Display for ApiError { } } -#[derive(Serialize)] -struct SerializableApiError { - message: String, -} impl IntoResponse for ApiError { fn into_response(self) -> Response { - let body = SerializableApiError { - message: self.message, - }; - (self.status, Json(body)).into_response() + let mut fields = self.fields; + fields.insert("error".into(), self.message.into()); + let value = serde_json::Value::Object(fields); + (self.status, Json(value)).into_response() } } @@ -68,6 +70,7 @@ where Self { status: StatusCode::INTERNAL_SERVER_ERROR, message: format!("{:#}", value.into()), + fields: serde_json::Map::new(), } } } diff --git a/infra/connect.yaml b/infra/connect.yaml index 2a8e3d3..1f1a2ce 100644 --- a/infra/connect.yaml +++ b/infra/connect.yaml @@ -3,8 +3,10 @@ log: connector: signerUrl: http://firefly-cardanosigner:8555 blockchain: - socket: /ipc/node.socket network: preview +contracts: + componentsPath: /contracts/components + storePath: /contracts/store.redb persistence: type: sqlite path: /db/db.sqlite3 diff --git a/infra/docker-compose.yaml b/infra/docker-compose.yaml index 9561fc1..ff74c3f 100644 --- a/infra/docker-compose.yaml +++ b/infra/docker-compose.yaml @@ -10,6 +10,7 @@ services: - 5018:5018 volumes: - ./ipc:/ipc + - connect-contracts:/contracts - connect-db:/db - ./connect.yaml:/app/config.yaml @@ -25,4 +26,5 @@ services: - ./signer.yaml:/app/config.yaml volumes: + connect-contracts: connect-db: diff --git a/justfile b/justfile index 5bc88fe..1273c88 100644 --- a/justfile +++ b/justfile @@ -1,4 +1,5 @@ - -demo: - cargo run -p firefly-cardano-demo -- --testnet-magic 2 --socket-path $PRJ_ROOT/infra/ipc/node.socket --addr-from $ADDR_FROM --addr-to $ADDR_TO --amount 849070 +deploy-contract: + cargo run -p firefly-cardano-deploy-contract -- --contract-path ./wasm/simple-tx +demo: deploy-contract + cargo run -p firefly-cardano-demo -- --addr-from $ADDR_FROM --addr-to $ADDR_TO --amount 1000000 diff --git a/scripts/demo/Cargo.toml b/scripts/demo/Cargo.toml index 2ce9cc3..3cdb5e3 100644 --- a/scripts/demo/Cargo.toml +++ b/scripts/demo/Cargo.toml @@ -12,3 +12,4 @@ reqwest-websocket = "0.4" serde = { version = "1", features = ["derive"] } serde_json = "1" tokio = { version = "1", features = ["full"] } +uuid = { version = "1", features = ["v4"] } diff --git a/scripts/demo/README.md b/scripts/demo/README.md index c587954..278e694 100644 --- a/scripts/demo/README.md +++ b/scripts/demo/README.md @@ -3,8 +3,10 @@ Demo application to showcase Cardano Firefly connector Example usage: -``` -cargo run -- --testnet-magic 2 --socket-path $PRJ_ROOT/infra/ipc/node.socket --addr-from $ADDR_FROM --addr-to $ADDR_TO --amount 849070 +```sh +# from project root +cargo run --bin firefly-cardano-deploy-contract -- --contract-path ./wasm/simple-tx +cargo run --bin firefly-cardano-demo -- --addr-from $ADDR_FROM --addr-to $ADDR_TO --amount 849070 # Or just... just demo ``` diff --git a/scripts/demo/src/build_tx.rs b/scripts/demo/src/build_tx.rs deleted file mode 100644 index 3ad7649..0000000 --- a/scripts/demo/src/build_tx.rs +++ /dev/null @@ -1,133 +0,0 @@ -use std::{ffi::OsString, fs, process::Command}; - -use anyhow::{bail, Result}; -use serde::Deserialize; - -use crate::Args; - -pub fn build_transaction(args: &Args) -> Result { - let utxos = list_utxos(args)?; - println!( - "balance: {} lovelace", - utxos.iter().map(|u| u.amount_lovelace).sum::() - ); - - let utxos_to_spend = choose_utxos_to_spend(utxos, args.amount)?; - build_tx(utxos_to_spend, args) -} - -fn exec_cardano_cli<'a, IC, IA>(program: &String, command: IC, args: IA) -> Result -where - IC: IntoIterator, - IA: IntoIterator, -{ - let mut base = Command::new(program); - let mut command = base.args(command); - for (key, value) in args { - command = command.arg(key).arg(value); - } - let output = command.output()?; - if !output.stderr.is_empty() { - eprintln!("{}", String::from_utf8(output.stderr)?); - } - if !output.status.success() { - bail!("request failed") - } - - Ok(String::from_utf8(output.stdout)?) -} - -#[derive(Debug)] -struct Utxo { - tx_hash: String, - tx_ix: usize, - amount_lovelace: u64, -} - -fn parse_utxo(line: &str) -> Result { - let mut iter = line.split_whitespace(); - let Some(hash) = iter.next() else { - bail!("missing hash: {line}"); - }; - let Some(ix) = iter.next() else { - bail!("missing ix: {line}"); - }; - let Some(amount) = iter.next() else { - bail!("missing lovelace: {line}") - }; - if !matches!(iter.next(), Some("lovelace")) { - bail!("unexpected format: {line}"); - } - Ok(Utxo { - tx_hash: hash.to_string(), - tx_ix: ix.parse()?, - amount_lovelace: amount.parse()?, - }) -} - -fn list_utxos(args: &Args) -> Result> { - let text = exec_cardano_cli( - &args.cardano_cli, - ["query", "utxo"], - [ - ("--address", (&args.addr_from).into()), - ("--testnet-magic", args.testnet_magic.to_string().into()), - ("--socket-path", (&args.socket_path).into()), - ], - )?; - let mut utxos = vec![]; - for line in text.lines().skip(2) { - match parse_utxo(line) { - Ok(utxo) => utxos.push(utxo), - Err(err) => println!("{err}"), - } - } - Ok(utxos) -} - -fn choose_utxos_to_spend(utxos: Vec, amount: u64) -> Result> { - if amount == 0 { - bail!("spend somethin, will ya?"); - } - let mut seen_so_far = 0; - let mut to_spend = vec![]; - for utxo in utxos { - seen_so_far += utxo.amount_lovelace; - to_spend.push(utxo); - if seen_so_far >= amount { - return Ok(to_spend); - } - } - bail!("Not enough funds (have {seen_so_far}, need {amount})"); -} - -#[derive(Deserialize)] -#[serde(rename_all = "camelCase")] -struct CborHexWrapper { - cbor_hex: String, -} -fn build_tx(utxos: Vec, args: &Args) -> Result { - let mut cmd_args = vec![ - ("--testnet-magic", args.testnet_magic.to_string().into()), - ("--socket-path", (&args.socket_path).into()), - ]; - for utxo in utxos { - cmd_args.push(("--tx-in", format!("{}#{}", utxo.tx_hash, utxo.tx_ix).into())); - } - cmd_args.push(( - "--tx-out", - format!("{}+{}", args.addr_to, args.amount).into(), - )); - cmd_args.push(("--change-address", (&args.addr_from).into())); - cmd_args.push(("--out-file", "temp.json".into())); - - exec_cardano_cli( - &args.cardano_cli, - ["conway", "transaction", "build"], - cmd_args, - )?; - let text = fs::read_to_string("temp.json")?; - fs::remove_file("temp.json")?; - let wrapper: CborHexWrapper = serde_json::de::from_str(&text)?; - Ok(wrapper.cbor_hex) -} diff --git a/scripts/demo/src/firefly.rs b/scripts/demo/src/firefly.rs index 1c837ce..fc522a0 100644 --- a/scripts/demo/src/firefly.rs +++ b/scripts/demo/src/firefly.rs @@ -2,6 +2,7 @@ use anyhow::{bail, Result}; use reqwest::{Client, Response}; use reqwest_websocket::{Message, RequestBuilderExt, WebSocket}; use serde::{Deserialize, Serialize}; +use serde_json::Value; pub struct FireflyCardanoClient { client: Client, @@ -24,16 +25,44 @@ impl FireflyCardanoClient { Ok(body) } - pub async fn submit_transaction(&self, address: &str, transaction: &str) -> Result { - let url = format!("{}/transactions", self.base_url); - let req = SubmitTransactionRequest { + pub async fn invoke_contract( + &self, + from: &str, + address: &str, + method: &str, + params: impl IntoIterator, + ) -> Result> { + let url = format!("{}/contracts/invoke", self.base_url); + let op_id = uuid::Uuid::new_v4().to_string(); + let mut req = InvokeContractRequest { address: address.to_string(), - transaction: transaction.to_string(), + from: from.to_string(), + id: op_id.clone(), + method: ABIMethod { + name: method.to_string(), + params: vec![], + }, + params: vec![], }; + for (name, value) in params.into_iter() { + req.method.params.push(ABIParameter { name: name.into() }); + req.params.push(value); + } let res = self.client.post(url).json(&req).send().await?; + Self::extract_error(res).await?; + + // contracts are synchronous, so the result is already available + let url = format!("{}/transactions/{op_id}", self.base_url); + let res = self.client.get(url).send().await?; let res = Self::extract_error(res).await?; - let body: SubmitTransactionResponse = res.json().await?; - Ok(body.txid) + let body: OperationStatus = res.json().await?; + match body.status.as_str() { + "Succeeded" => Ok(body.transaction_hash), + other => bail!( + "Unexpected status {other}: {}", + body.error_message.unwrap_or_default() + ), + } } pub async fn create_stream(&self, settings: &StreamSettings) -> Result { @@ -140,14 +169,31 @@ pub struct FireflyWebSocketEvent { } #[derive(Serialize)] -struct SubmitTransactionRequest { +struct InvokeContractRequest { address: String, - transaction: String, + from: String, + id: String, + method: ABIMethod, + params: Vec, +} + +#[derive(Serialize)] +struct ABIMethod { + name: String, + params: Vec, +} + +#[derive(Serialize)] +struct ABIParameter { + name: String, } #[derive(Deserialize)] -struct SubmitTransactionResponse { - txid: String, +#[serde(rename_all = "camelCase")] +struct OperationStatus { + status: String, + transaction_hash: Option, + error_message: Option, } #[derive(Debug, Deserialize)] diff --git a/scripts/demo/src/main.rs b/scripts/demo/src/main.rs index 758c883..8b0725b 100644 --- a/scripts/demo/src/main.rs +++ b/scripts/demo/src/main.rs @@ -1,7 +1,4 @@ -use std::path::PathBuf; - use anyhow::{bail, Result}; -use build_tx::build_transaction; use clap::Parser; use firefly::{ FireflyCardanoClient, FireflyWebSocketEventBatch, FireflyWebSocketRequest, ListenerFilter, @@ -9,23 +6,16 @@ use firefly::{ }; use futures::{SinkExt, StreamExt}; -mod build_tx; mod firefly; #[derive(Parser)] struct Args { - #[arg(long)] - testnet_magic: u16, - #[arg(long)] - socket_path: PathBuf, #[arg(long)] addr_from: String, #[arg(long)] addr_to: String, #[arg(long)] amount: u64, - #[arg(long, default_value = "cardano-cli")] - cardano_cli: String, #[arg(long, default_value = "http://localhost:5018")] firefly_cardano_url: String, #[arg(long, default_value = "4")] @@ -81,17 +71,26 @@ async fn main() -> Result<()> { let firefly = FireflyCardanoClient::new(&args.firefly_cardano_url); - let transaction = build_transaction(&args)?; - println!("transaction: {transaction}"); - // Before we submit our transaction, find the latest block. // If a transaction is submitted, it'll be included in a _later_ block, // so this lets us skip history let tip = firefly.get_chain_tip().await?; - let txid = firefly - .submit_transaction(&args.addr_from, &transaction) - .await?; + let Some(txid) = firefly + .invoke_contract( + &args.addr_from, + "simple-tx", + "send_ada", + [ + ("fromAddress", args.addr_from.clone().into()), + ("toAddress", args.addr_to.clone().into()), + ("amount", args.amount.into()), + ], + ) + .await? + else { + bail!("contract did not return transaction") + }; println!("submitted transaction {txid}"); let stream_topic = "firefly-cardano-demo"; diff --git a/scripts/deploy-contract/Cargo.toml b/scripts/deploy-contract/Cargo.toml new file mode 100644 index 0000000..4d361e6 --- /dev/null +++ b/scripts/deploy-contract/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "firefly-cardano-deploy-contract" +version = "0.1.0" +edition = "2021" + +[dependencies] +anyhow = "1" +clap = { version = "4", features = ["derive"] } +hex = "0.4" +reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls"] } +serde = { version = "1", features = ["derive"] } +tokio = { version = "1", features = ["full"] } +uuid = { version = "1", features = ["v4"] } +wat = "1" +wit-component = "0.221" diff --git a/scripts/deploy-contract/README.md b/scripts/deploy-contract/README.md new file mode 100644 index 0000000..ab9d385 --- /dev/null +++ b/scripts/deploy-contract/README.md @@ -0,0 +1,12 @@ +# Firefly Deploy Contract + +Script to deploy smart contract to a running firefly cardano connector + +Example usage: +```sh +# from project root +cargo run --bin firefly-cardano-deploy-contract -- --contract-path ./wasm/simple-tx +# Or just... +just deploy-contract +``` + diff --git a/scripts/deploy-contract/src/firefly.rs b/scripts/deploy-contract/src/firefly.rs new file mode 100644 index 0000000..e6ded45 --- /dev/null +++ b/scripts/deploy-contract/src/firefly.rs @@ -0,0 +1,53 @@ +use anyhow::{bail, Result}; +use reqwest::{Client, Response}; +use serde::Serialize; +use uuid::Uuid; + +pub struct FireflyCardanoClient { + client: Client, + base_url: String, +} + +impl FireflyCardanoClient { + pub fn new(base_url: &str) -> Self { + Self { + client: Client::new(), + base_url: base_url.to_string(), + } + } + + pub async fn deploy_contract(&self, name: &str, contract: &str) -> Result<()> { + let url = format!("{}/contracts/deploy", self.base_url); + let req = DeployContractRequest { + id: Uuid::new_v4().to_string(), + contract: contract.to_string(), + definition: ABIContract { + name: name.to_string(), + }, + }; + let res = self.client.post(url).json(&req).send().await?; + Self::extract_error(res).await?; + Ok(()) + } + + async fn extract_error(res: Response) -> Result { + if !res.status().is_success() { + let default_msg = res.status().to_string(); + let message = res.text().await.unwrap_or(default_msg); + bail!("request failed: {}", message); + } + Ok(res) + } +} + +#[derive(Serialize)] +struct DeployContractRequest { + pub id: String, + pub contract: String, + pub definition: ABIContract, +} + +#[derive(Serialize)] +struct ABIContract { + pub name: String, +} diff --git a/scripts/deploy-contract/src/main.rs b/scripts/deploy-contract/src/main.rs new file mode 100644 index 0000000..d7e4f89 --- /dev/null +++ b/scripts/deploy-contract/src/main.rs @@ -0,0 +1,83 @@ +use std::{path::PathBuf, process::Command}; + +use anyhow::{bail, Result}; +use clap::Parser; +use firefly::FireflyCardanoClient; +use wit_component::ComponentEncoder; + +mod firefly; + +#[derive(Parser)] +struct Args { + #[arg(long)] + contract_path: PathBuf, + #[arg(long, default_value = "http://localhost:5018")] + firefly_cardano_url: String, + #[arg(long)] + firefly_url: Option, +} + +#[tokio::main] +async fn main() -> Result<()> { + let args = Args::parse(); + + let Some(name) = args.contract_path.file_name() else { + bail!("couldn't find contract name"); + }; + let Some(name) = name.to_str() else { + bail!("invalid contract name"); + }; + + println!("Compiling {name}..."); + + Command::new("cargo") + .arg("build") + .arg("--target") + .arg("wasm32-unknown-unknown") + .arg("--release") + .current_dir(&args.contract_path) + .exec()?; + + let filename = format!("{}.wasm", name.replace("-", "_")); + let path = args + .contract_path + .join("target") + .join("wasm32-unknown-unknown") + .join("release") + .join(filename); + + println!("Bundling {name} as WASM component..."); + let module = wat::Parser::new().parse_file(path)?; + let component = ComponentEncoder::default() + .validate(true) + .module(&module)? + .encode()?; + let contract = hex::encode(&component); + + println!("Deploying {name} to FireFly..."); + let base_url = args + .firefly_url + .map(|u| format!("{u}/api/v1")) + .unwrap_or(args.firefly_cardano_url); + let firefly = FireflyCardanoClient::new(&base_url); + firefly.deploy_contract(name, &contract).await?; + + Ok(()) +} + +trait CommandExt { + fn exec(&mut self) -> Result<()>; +} + +impl CommandExt for Command { + fn exec(&mut self) -> Result<()> { + let output = self.output()?; + if !output.stderr.is_empty() { + eprintln!("{}", String::from_utf8(output.stderr)?); + } + if !output.status.success() { + bail!("command failed: {}", output.status); + } + Ok(()) + } +} diff --git a/wasm/.cargo/config.toml b/wasm/.cargo/config.toml new file mode 100644 index 0000000..435ed75 --- /dev/null +++ b/wasm/.cargo/config.toml @@ -0,0 +1,2 @@ +[build] +target = "wasm32-unknown-unknown" \ No newline at end of file diff --git a/wasm/simple-tx/Cargo.lock b/wasm/simple-tx/Cargo.lock new file mode 100644 index 0000000..4e54322 --- /dev/null +++ b/wasm/simple-tx/Cargo.lock @@ -0,0 +1,1516 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "addr2line" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + +[[package]] +name = "ahash" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "anyhow" +version = "1.0.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c95c10ba0b00a02636238b814946408b1322d5ac4760326e6fb8ec956d85775" + +[[package]] +name = "async-trait" +version = "0.1.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "autocfg" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" + +[[package]] +name = "backtrace" +version = "0.3.74" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" +dependencies = [ + "addr2line", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", + "windows-targets", +] + +[[package]] +name = "balius-macros" +version = "0.1.0" +source = "git+https://github.com/SupernaviX/balius.git?rev=3a899f9#3a899f9f1ed839a10719a441469a433f243520f4" +dependencies = [ + "quote", + "syn", +] + +[[package]] +name = "balius-sdk" +version = "0.1.0" +source = "git+https://github.com/SupernaviX/balius.git?rev=3a899f9#3a899f9f1ed839a10719a441469a433f243520f4" +dependencies = [ + "balius-macros", + "hex", + "pallas-addresses", + "pallas-codec", + "pallas-crypto", + "pallas-primitives", + "pallas-traverse", + "prost", + "serde", + "serde_json", + "serde_with", + "thiserror", + "utxorpc-spec", + "wit-bindgen", +] + +[[package]] +name = "base58" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6107fe1be6682a68940da878d9e9f5e90ca5745b3dec9fd1bb393c8777d4f581" + +[[package]] +name = "base64" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "bech32" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d86b93f97252c47b41663388e6d155714a9d0c398b99f1005cbc5f978b29f445" + +[[package]] +name = "bitflags" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" + +[[package]] +name = "bumpalo" +version = "3.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" + +[[package]] +name = "bytes" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" + +[[package]] +name = "cc" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd9de9f2205d5ef3fd67e685b0df337994ddd4495e2a28d185500d0e1edfea47" +dependencies = [ + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chrono" +version = "0.4.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "num-traits", + "serde", + "windows-targets", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "crc" +version = "3.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69e6e4d7b33a94f0991c26729976b10ebde1d34c3ee82408fb536164fa10d636" +dependencies = [ + "crc-catalog", +] + +[[package]] +name = "crc-catalog" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" + +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + +[[package]] +name = "cryptoxide" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "382ce8820a5bb815055d3553a610e8cb542b2d767bbacea99038afda96cd760d" + +[[package]] +name = "darling" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +dependencies = [ + "darling_core", + "quote", + "syn", +] + +[[package]] +name = "deranged" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", + "serde", +] + +[[package]] +name = "either" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "fastrand" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "486f806e73c5707928240ddc295403b1b93c96a02038563881c4a2fd84b81ac4" + +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "futures-core" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" + +[[package]] +name = "futures-task" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" + +[[package]] +name = "futures-util" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" +dependencies = [ + "futures-core", + "futures-task", + "pin-project-lite", + "pin-utils", +] + +[[package]] +name = "gimli" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" + +[[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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash", +] + +[[package]] +name = "hashbrown" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "http" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes", + "http", +] + +[[package]] +name = "http-body-util" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" +dependencies = [ + "bytes", + "futures-util", + "http", + "http-body", + "pin-project-lite", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "id-arena" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25a2bc672d1148e28034f176e01fffebb08b35768468cc954630da77a1449005" + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", + "serde", +] + +[[package]] +name = "indexmap" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" +dependencies = [ + "equivalent", + "hashbrown 0.15.2", + "serde", +] + +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" + +[[package]] +name = "js-sys" +version = "0.3.72" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "leb128" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" + +[[package]] +name = "libc" +version = "0.2.166" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2ccc108bbc0b1331bd061864e7cd823c0cab660bbe6970e66e2c0614decde36" + +[[package]] +name = "linux-raw-sys" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" + +[[package]] +name = "log" +version = "0.4.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "minicbor" +version = "0.25.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0452a60c1863c1f50b5f77cd295e8d2786849f35883f0b9e18e7e6e1b5691b0" +dependencies = [ + "half", + "minicbor-derive", +] + +[[package]] +name = "minicbor-derive" +version = "0.15.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd2209fff77f705b00c737016a48e73733d7fbccb8b007194db148f03561fb70" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "miniz_oxide" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" +dependencies = [ + "adler2", +] + +[[package]] +name = "multimap" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defc4c55412d89136f966bbb339008b474350e5e6e78d2714439c386b3137a03" + +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "object" +version = "0.36.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" + +[[package]] +name = "pallas-addresses" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d47110e25338f995c1f29858292c016b974d23fa3a1ce97fff542047b6c2142" +dependencies = [ + "base58", + "bech32", + "crc", + "cryptoxide", + "hex", + "pallas-codec", + "pallas-crypto", + "thiserror", +] + +[[package]] +name = "pallas-codec" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1389b47a97864a7cb167e2392b44332930af90f6aaaac45eb2f369ccab95f4c7" +dependencies = [ + "hex", + "minicbor", + "serde", + "thiserror", +] + +[[package]] +name = "pallas-crypto" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5d84346a1f0da5240b2aa16fde96998b84cdcc466cb7c04ba24bb1e1630e0d3" +dependencies = [ + "cryptoxide", + "hex", + "pallas-codec", + "rand_core", + "serde", + "thiserror", + "zeroize", +] + +[[package]] +name = "pallas-primitives" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5627a5cd6512eaa3900b93d8b6e604d495a31d4439c9f34d9f88ec38383c0ddc" +dependencies = [ + "base58", + "bech32", + "hex", + "log", + "pallas-codec", + "pallas-crypto", + "serde", + "serde_json", +] + +[[package]] +name = "pallas-traverse" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d04fc75a2144eb257c68b4604cdde647e07404ea185b791c0005826960dfb35" +dependencies = [ + "hex", + "itertools", + "pallas-addresses", + "pallas-codec", + "pallas-crypto", + "pallas-primitives", + "paste", + "serde", + "thiserror", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "pbjson" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7e6349fa080353f4a597daffd05cb81572a9c031a6d4fff7e504947496fcc68" +dependencies = [ + "base64 0.21.7", + "serde", +] + +[[package]] +name = "pbjson-build" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eea3058763d6e656105d1403cb04e0a41b7bbac6362d413e7c33be0c32279c9" +dependencies = [ + "heck", + "itertools", + "prost", + "prost-types", +] + +[[package]] +name = "pbjson-types" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e54e5e7bfb1652f95bc361d76f3c780d8e526b134b85417e774166ee941f0887" +dependencies = [ + "bytes", + "chrono", + "pbjson", + "pbjson-build", + "prost", + "prost-build", + "serde", +] + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "petgraph" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" +dependencies = [ + "fixedbitset", + "indexmap 2.6.0", +] + +[[package]] +name = "pin-project" +version = "1.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be57f64e946e500c8ee36ef6331845d40a93055567ec57e8fae13efd33759b95" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "prettyplease" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" +dependencies = [ + "proc-macro2", + "syn", +] + +[[package]] +name = "proc-macro2" +version = "1.0.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "prost" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b0487d90e047de87f984913713b85c601c05609aad5b0df4b4573fbf69aa13f" +dependencies = [ + "bytes", + "prost-derive", +] + +[[package]] +name = "prost-build" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c1318b19085f08681016926435853bbf7858f9c082d0999b80550ff5d9abe15" +dependencies = [ + "bytes", + "heck", + "itertools", + "log", + "multimap", + "once_cell", + "petgraph", + "prettyplease", + "prost", + "prost-types", + "regex", + "syn", + "tempfile", +] + +[[package]] +name = "prost-derive" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9552f850d5f0964a4e4d0bf306459ac29323ddfbae05e35a7c0d35cb0803cc5" +dependencies = [ + "anyhow", + "itertools", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "prost-types" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4759aa0d3a6232fb8dbdb97b61de2c20047c68aca932c7ed76da9d788508d670" +dependencies = [ + "prost", +] + +[[package]] +name = "quote" +version = "1.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" + +[[package]] +name = "regex" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" + +[[package]] +name = "rustc-demangle" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" + +[[package]] +name = "rustix" +version = "0.38.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7f649912bc1495e167a6edee79151c84b1bad49748cb4f1f1167f459f6224f6" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.52.0", +] + +[[package]] +name = "ryu" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" + +[[package]] +name = "semver" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" + +[[package]] +name = "serde" +version = "1.0.215" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.215" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.133" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "serde_with" +version = "3.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e28bdad6db2b8340e449f7108f020b3b092e8583a9e3fb82713e1d4e71fe817" +dependencies = [ + "base64 0.22.1", + "chrono", + "hex", + "indexmap 1.9.3", + "indexmap 2.6.0", + "serde", + "serde_derive", + "serde_json", + "serde_with_macros", + "time", +] + +[[package]] +name = "serde_with_macros" +version = "3.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d846214a9854ef724f3da161b426242d8de7c1fc7de2f89bb1efcb154dca79d" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "simple-tx" +version = "0.1.0" +dependencies = [ + "balius-sdk", + "pallas-addresses", + "pallas-traverse", + "serde", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "spdx" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bae30cc7bfe3656d60ee99bf6836f472b0c53dddcbf335e253329abb16e535a2" +dependencies = [ + "smallvec", +] + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "syn" +version = "2.0.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d46482f1c1c87acd84dea20c1bf5ebff4c757009ed6bf19cfd36fb10e92c4e" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tempfile" +version = "3.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" +dependencies = [ + "cfg-if", + "fastrand", + "once_cell", + "rustix", + "windows-sys 0.59.0", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "time" +version = "0.3.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" +dependencies = [ + "deranged", + "itoa", + "num-conv", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" + +[[package]] +name = "time-macros" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "tokio" +version = "1.41.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22cfb5bee7a6a52939ca9224d6ac897bb669134078daa8735560897f69de4d33" +dependencies = [ + "backtrace", + "pin-project-lite", +] + +[[package]] +name = "tokio-stream" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f4e6ce100d0eb49a2734f8c0812bcd324cf357d21810932c5df6b96ef2b86f1" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tonic" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877c5b330756d856ffcc4553ab34a5684481ade925ecc54bcd1bf02b1d0d4d52" +dependencies = [ + "async-trait", + "base64 0.22.1", + "bytes", + "http", + "http-body", + "http-body-util", + "percent-encoding", + "pin-project", + "prost", + "tokio-stream", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + +[[package]] +name = "tower-service" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" + +[[package]] +name = "tracing" +version = "0.1.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tracing-core" +version = "0.1.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" +dependencies = [ + "once_cell", +] + +[[package]] +name = "unicode-ident" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" + +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + +[[package]] +name = "utxorpc-spec" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f5bb265be0e071adf7675ac8003a1c94772516a7a62d4fb1005f61ee288f3d3" +dependencies = [ + "bytes", + "futures-core", + "pbjson", + "pbjson-types", + "prost", + "prost-types", + "serde", + "tonic", +] + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "wasm-bindgen" +version = "0.2.95" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" +dependencies = [ + "cfg-if", + "once_cell", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.95" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.95" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.95" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.95" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" + +[[package]] +name = "wasm-encoder" +version = "0.218.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22b896fa8ceb71091ace9bcb81e853f54043183a1c9667cf93422c40252ffa0a" +dependencies = [ + "leb128", + "wasmparser", +] + +[[package]] +name = "wasm-metadata" +version = "0.218.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa5eeb071abe8a2132fdd5565dabffee70775ee8c24fc7e300ac43f51f4a8a91" +dependencies = [ + "anyhow", + "indexmap 2.6.0", + "serde", + "serde_derive", + "serde_json", + "spdx", + "wasm-encoder", + "wasmparser", +] + +[[package]] +name = "wasmparser" +version = "0.218.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b09e46c7fceceaa72b2dd1a8a137ea7fd8f93dfaa69806010a709918e496c5dc" +dependencies = [ + "ahash", + "bitflags", + "hashbrown 0.14.5", + "indexmap 2.6.0", + "semver", +] + +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "wit-bindgen" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fcf26778671a2327bd237a32c6f2d1d9bb0ec077e482b0839552b00d4566544" +dependencies = [ + "wit-bindgen-rt", + "wit-bindgen-rust-macro", +] + +[[package]] +name = "wit-bindgen-core" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b885a00e1c428fd12b7b7c4bccc4bad8b2a3ca0abe8eaf1e0f90adabb4c7ac7" +dependencies = [ + "anyhow", + "heck", + "wit-parser", +] + +[[package]] +name = "wit-bindgen-rt" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c" +dependencies = [ + "bitflags", +] + +[[package]] +name = "wit-bindgen-rust" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "542608877814a54f6bea6b24dcbe249a2e293d67d709f4f8ec578d06b1c00730" +dependencies = [ + "anyhow", + "heck", + "indexmap 2.6.0", + "prettyplease", + "syn", + "wasm-metadata", + "wit-bindgen-core", + "wit-component", +] + +[[package]] +name = "wit-bindgen-rust-macro" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30d462025f670fff96606ddbfe62500255b4fe3de7298cd9cbabb2de3d567183" +dependencies = [ + "anyhow", + "prettyplease", + "proc-macro2", + "quote", + "syn", + "wit-bindgen-core", + "wit-bindgen-rust", +] + +[[package]] +name = "wit-component" +version = "0.218.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa53aa7e6bf2b3e8ccaffbcc963fbdb672a603dc0af393a481b6cec24c266406" +dependencies = [ + "anyhow", + "bitflags", + "indexmap 2.6.0", + "log", + "serde", + "serde_derive", + "serde_json", + "wasm-encoder", + "wasm-metadata", + "wasmparser", + "wit-parser", +] + +[[package]] +name = "wit-parser" +version = "0.218.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d3d1066ab761b115f97fef2b191090faabcb0f37b555b758d3caf42d4ed9e55" +dependencies = [ + "anyhow", + "id-arena", + "indexmap 2.6.0", + "log", + "semver", + "serde", + "serde_derive", + "serde_json", + "unicode-xid", + "wasmparser", +] + +[[package]] +name = "zerocopy" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/wasm/simple-tx/Cargo.toml b/wasm/simple-tx/Cargo.toml new file mode 100644 index 0000000..9ff257c --- /dev/null +++ b/wasm/simple-tx/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "simple-tx" +version = "0.1.0" +edition = "2021" +repository = "https://github.com/SundaeSwap-finance/firefly-cardano" + +[dependencies] +balius-sdk = { git = "https://github.com/SupernaviX/balius.git", rev = "3a899f9" } +pallas-addresses = "0.31.0" +pallas-traverse = "0.31.0" +serde = { version = "1", features = ["derive"] } + +[lib] +crate-type = ["cdylib"] \ No newline at end of file diff --git a/wasm/simple-tx/src/lib.rs b/wasm/simple-tx/src/lib.rs new file mode 100644 index 0000000..8a38a53 --- /dev/null +++ b/wasm/simple-tx/src/lib.rs @@ -0,0 +1,88 @@ +use balius_sdk::{ + txbuilder::{ + primitives::TransactionInput, AddressPattern, BuildContext, BuildError, FeeChangeReturn, + InputExpr, OutputBuilder, TxBuilder, UtxoPattern, UtxoSource, + }, + Config, FnHandler, NewTx, Params, Worker, WorkerResult, +}; +use pallas_addresses::Address; +use serde::Deserialize; + +#[derive(Deserialize)] +#[serde(rename_all = "camelCase")] +struct TransferRequest { + pub from_address: String, + pub to_address: String, + pub amount: u64, +} + +struct CoinSelectionInput(UtxoSource, u64); + +// TODO: this is a naive approach to coin selection, +// balius can probably help with a better one +impl InputExpr for CoinSelectionInput { + fn eval(&self, ctx: &BuildContext) -> Result, BuildError> { + let utxos = self.0.resolve(ctx)?; + // If we know the fee, add it to the target amount. + // If not, overestimate the fee so we pick at least as many TXOs as needed. + let target_lovelace = self.1 + + if ctx.estimated_fee == 0 { + 2_000_000 + } else { + ctx.estimated_fee + }; + + let mut inputs = vec![]; + let mut lovelace_so_far = 0; + for (ref_, txo) in utxos.refs().zip(utxos.txos()) { + let coin = txo.value().coin(); + if coin == 0 { + continue; + } + inputs.push(TransactionInput { + transaction_id: ref_.hash, + index: ref_.index, + }); + lovelace_so_far += coin; + if lovelace_so_far >= target_lovelace { + break; + } + } + if lovelace_so_far >= target_lovelace { + Ok(inputs) + } else { + Err(BuildError::OutputsTooHigh) + } + } +} + +fn send_ada(_: Config<()>, req: Params) -> WorkerResult { + let mut tx = TxBuilder::new(); + + // TODO: return an error if this address is invalid + let from_address = Address::from_bech32(&req.from_address).unwrap(); + let to_address = Address::from_bech32(&req.to_address).unwrap(); + + let address_source = UtxoSource::Search(UtxoPattern { + address: Some(AddressPattern { + exact_address: from_address.to_vec(), + }), + ..UtxoPattern::default() + }); + + tx = tx + .with_input(CoinSelectionInput(address_source.clone(), req.amount)) + .with_output( + OutputBuilder::new() + .address(to_address) + .with_value(req.amount), + ) + .with_output(FeeChangeReturn(address_source)); + + Ok(NewTx(Box::new(tx))) +} + +#[balius_sdk::main] +fn main() -> Worker { + Worker::new().with_request_handler("send_ada", FnHandler::from(send_ada)) +}