diff --git a/Cargo.lock b/Cargo.lock index 2ae7c66..51592e2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,21 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "addr2line" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5fb1d8e4442bd405fdfd1dacb42792696b0cf9cb15882e5d097b742a676d375" -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" @@ -29,15 +14,6 @@ dependencies = [ "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" @@ -59,54 +35,6 @@ version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247" -[[package]] -name = "async-stream" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" -dependencies = [ - "async-stream-impl", - "futures-core", - "pin-project-lite", -] - -[[package]] -name = "async-stream-impl" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "async-trait" -version = "0.1.82" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a27b8a3a6e1a44fa4c8baf1f653e4172e81486d4941f2237e20dc2d0cf4ddff1" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "atomic" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59bdb34bc650a32731b31bd8f0829cc15d24a708ee31559e0bb34f2bc320cba" - -[[package]] -name = "atomic" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d818003e740b63afc82337e3160717f4f63078720a810b7b903e70a5d1d2994" -dependencies = [ - "bytemuck", -] - [[package]] name = "autocfg" version = "1.3.0" @@ -114,71 +42,36 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] -name = "axum" -version = "0.6.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf" -dependencies = [ - "async-trait", - "axum-core", - "bitflags 1.3.2", - "bytes", - "futures-util", - "http 0.2.12", - "http-body", - "hyper", - "itoa", - "matchit", - "memchr", - "mime", - "percent-encoding", - "pin-project-lite", - "rustversion", - "serde", - "sync_wrapper", - "tower", - "tower-layer", - "tower-service", -] +name = "balius" +version = "0.1.0" [[package]] -name = "axum-core" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "759fa577a247914fd3f7f76d62972792636412fbfd634cd452f6a385a74d2d2c" +name = "balius-macros" +version = "0.1.0" dependencies = [ - "async-trait", - "bytes", - "futures-util", - "http 0.2.12", - "http-body", - "mime", - "rustversion", - "tower-layer", - "tower-service", + "quote", + "syn 2.0.79", ] [[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 0.52.6", -] +name = "balius-runtime" +version = "0.1.0" [[package]] -name = "balius" +name = "balius-sdk" version = "0.1.0" dependencies = [ + "balius-macros", + "hex", + "pallas-addresses 0.30.2 (git+https://github.com/txpipe/pallas.git)", + "pallas-codec 0.30.2 (git+https://github.com/txpipe/pallas.git)", + "pallas-crypto 0.30.2 (git+https://github.com/txpipe/pallas.git)", + "pallas-primitives 0.30.2 (git+https://github.com/txpipe/pallas.git)", + "pallas-traverse 0.30.2 (git+https://github.com/txpipe/pallas.git)", "serde", "serde_json", + "serde_with", + "thiserror", "wit-bindgen", ] @@ -188,18 +81,6 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6107fe1be6682a68940da878d9e9f5e90ca5745b3dec9fd1bb393c8777d4f581" -[[package]] -name = "base64" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" - -[[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" @@ -212,18 +93,6 @@ version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d86b93f97252c47b41663388e6d155714a9d0c398b99f1005cbc5f978b29f445" -[[package]] -name = "binascii" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "383d29d513d8764dcdc42ea295d979eb99c3c9f00607b3692cf68a431f7dca72" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - [[package]] name = "bitflags" version = "2.5.0" @@ -232,9 +101,9 @@ checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" [[package]] name = "block-buffer" -version = "0.10.4" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" dependencies = [ "generic-array", ] @@ -245,24 +114,12 @@ version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" -[[package]] -name = "bytemuck" -version = "1.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94bbb0ad554ad961ddc5da507a12a29b14e4ae5bda06b19f575a3e6079d2e2ae" - [[package]] name = "byteorder" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" -[[package]] -name = "bytes" -version = "1.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" - [[package]] name = "cc" version = "1.1.20" @@ -288,18 +145,7 @@ dependencies = [ "iana-time-zone", "num-traits", "serde", - "windows-targets 0.52.6", -] - -[[package]] -name = "cookie" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ddef33a339a91ea89fb53151bd0a4689cfce27055c291dfa69945475d22c747" -dependencies = [ - "percent-encoding", - "time", - "version_check", + "windows-targets", ] [[package]] @@ -333,35 +179,35 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" [[package]] -name = "crossbeam-channel" -version = "0.5.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.20" +name = "cryptoxide" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" +checksum = "382ce8820a5bb815055d3553a610e8cb542b2d767bbacea99038afda96cd760d" [[package]] -name = "crypto-common" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +name = "curve25519-dalek" +version = "3.2.0" +source = "git+https://github.com/txpipe/curve25519-dalek?branch=ietf03_vrf_compat_ell2#70a36f41cfc3fbb7357ec3062201b911787decba" dependencies = [ - "generic-array", - "typenum", + "byteorder", + "digest", + "rand_core 0.5.1", + "subtle", + "zeroize", ] [[package]] -name = "cryptoxide" -version = "0.4.4" +name = "curve25519-dalek" +version = "3.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "382ce8820a5bb815055d3553a610e8cb542b2d767bbacea99038afda96cd760d" +checksum = "90f9d052967f590a76e62eb387bd0bbb1b000182c3cefe5364db6b7211651bc0" +dependencies = [ + "byteorder", + "digest", + "rand_core 0.5.1", + "subtle", + "zeroize", +] [[package]] name = "darling" @@ -384,7 +230,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.72", + "syn 2.0.79", ] [[package]] @@ -395,7 +241,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.72", + "syn 2.0.79", ] [[package]] @@ -408,47 +254,13 @@ dependencies = [ "serde", ] -[[package]] -name = "devise" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1d90b0c4c777a2cad215e3c7be59ac7c15adf45cf76317009b7d096d46f651d" -dependencies = [ - "devise_codegen", - "devise_core", -] - -[[package]] -name = "devise_codegen" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71b28680d8be17a570a2334922518be6adc3f58ecc880cbb404eaeb8624fd867" -dependencies = [ - "devise_core", - "quote", -] - -[[package]] -name = "devise_core" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b035a542cf7abf01f2e3c4d5a7acbaebfefe120ae4efc7bde3df98186e4b8af7" -dependencies = [ - "bitflags 2.5.0", - "proc-macro2", - "proc-macro2-diagnostics", - "quote", - "syn 2.0.72", -] - [[package]] name = "digest" -version = "0.10.7" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" dependencies = [ - "block-buffer", - "crypto-common", + "generic-array", ] [[package]] @@ -457,15 +269,6 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" -[[package]] -name = "encoding_rs" -version = "0.8.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" -dependencies = [ - "cfg-if", -] - [[package]] name = "equivalent" version = "1.0.1" @@ -473,2333 +276,673 @@ 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.1.1" +name = "fnv" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] -name = "figment" -version = "0.10.19" +name = "generic-array" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cb01cd46b0cf372153850f4c6c272d9cbea2da513e07538405148f95bd789f3" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ - "atomic 0.6.0", - "pear", - "serde", - "toml", - "uncased", + "typenum", "version_check", ] [[package]] -name = "filetime" -version = "0.2.25" +name = "getrandom" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" dependencies = [ "cfg-if", "libc", - "libredox", - "windows-sys 0.59.0", + "wasi", ] [[package]] -name = "fixedbitset" -version = "0.4.2" +name = "half" +version = "1.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" +checksum = "1b43ede17f21864e81be2fa654110bf1e793774238d86ef8555c37e6519c0403" [[package]] -name = "fnv" -version = "1.0.7" +name = "hashbrown" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] -name = "fsevent-sys" -version = "4.1.0" +name = "hashbrown" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76ee7a02da4d231650c7cea31349b889be2f45ddb3ef3032d2ec8185f6313fd2" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ - "libc", + "ahash", ] [[package]] -name = "futures" -version = "0.3.30" +name = "heck" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" -dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] -name = "futures-channel" -version = "0.3.30" +name = "hex" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" -dependencies = [ - "futures-core", - "futures-sink", -] +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] -name = "futures-core" -version = "0.3.30" +name = "iana-time-zone" +version = "0.1.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core", +] [[package]] -name = "futures-io" -version = "0.3.30" +name = "iana-time-zone-haiku" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] [[package]] -name = "futures-sink" -version = "0.3.30" +name = "id-arena" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" +checksum = "25a2bc672d1148e28034f176e01fffebb08b35768468cc954630da77a1449005" [[package]] -name = "futures-task" -version = "0.3.30" +name = "ident_case" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] -name = "futures-util" -version = "0.3.30" +name = "indexmap" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-sink", - "futures-task", - "memchr", - "pin-project-lite", - "pin-utils", - "slab", + "autocfg", + "hashbrown 0.12.3", + "serde", ] [[package]] -name = "generator" -version = "0.7.5" +name = "indexmap" +version = "2.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc16584ff22b460a382b7feec54b23d2908d858152e5739a120b949293bd74e" +checksum = "824b2ae422412366ba479e8111fd301f7b5faece8149317bb81925979a53f520" dependencies = [ - "cc", - "libc", - "log", - "rustversion", - "windows", + "equivalent", + "hashbrown 0.14.3", + "serde", ] [[package]] -name = "generic-array" -version = "0.14.7" +name = "itertools" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" dependencies = [ - "typenum", - "version_check", + "either", ] [[package]] -name = "getrandom" -version = "0.2.15" +name = "itoa" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" + +[[package]] +name = "js-sys" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" dependencies = [ - "cfg-if", - "libc", - "wasi", + "wasm-bindgen", ] [[package]] -name = "gimli" -version = "0.31.0" +name = "leb128" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32085ea23f3234fc7846555e85283ba4de91e21016dc0455a16286d87a292d64" +checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" [[package]] -name = "glob" -version = "0.3.1" +name = "libc" +version = "0.2.158" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" +checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" [[package]] -name = "h2" -version = "0.3.26" +name = "log" +version = "0.4.20" 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.2.2", - "slab", - "tokio", - "tokio-util", - "tracing", -] +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] -name = "half" -version = "1.8.3" +name = "memchr" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b43ede17f21864e81be2fa654110bf1e793774238d86ef8555c37e6519c0403" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] -name = "handlebars" -version = "4.5.0" +name = "minicbor" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faa67bab9ff362228eb3d00bd024a4965d8231bbb7921167f0cfa66c6626b225" +checksum = "9d15f4203d71fdf90903c2696e55426ac97a363c67b218488a73b534ce7aca10" dependencies = [ - "log", - "pest", - "pest_derive", - "serde", - "serde_json", - "thiserror", + "half", + "minicbor-derive", ] [[package]] -name = "hashbrown" -version = "0.12.3" +name = "minicbor-derive" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +checksum = "1154809406efdb7982841adb6311b3d095b46f78342dd646736122fe6b19e267" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] [[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +name = "minter" +version = "0.1.0" dependencies = [ - "ahash", + "balius-sdk", + "hex", + "pallas-codec 0.30.2 (registry+https://github.com/rust-lang/crates.io-index)", + "pallas-primitives 0.30.2 (registry+https://github.com/rust-lang/crates.io-index)", + "pallas-traverse 0.30.2", + "serde", + "serde_json", + "serde_with", ] [[package]] -name = "heck" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +name = "my-bod" +version = "0.1.0" +dependencies = [ + "balius-sdk", + "pallas-primitives 0.30.2 (registry+https://github.com/rust-lang/crates.io-index)", + "serde", +] [[package]] -name = "heck" -version = "0.5.0" +name = "num-conv" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" [[package]] -name = "hermit-abi" -version = "0.3.9" +name = "num-traits" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] [[package]] -name = "hermit-abi" -version = "0.4.0" +name = "once_cell" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] -name = "hex" -version = "0.4.3" +name = "opaque-debug" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" [[package]] -name = "home" -version = "0.5.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +name = "pallas-addresses" +version = "0.30.2" dependencies = [ - "windows-sys 0.52.0", + "base58", + "bech32", + "crc", + "cryptoxide", + "hex", + "pallas-codec 0.30.2", + "pallas-crypto 0.30.2", + "thiserror", ] [[package]] -name = "http" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" +name = "pallas-addresses" +version = "0.30.2" +source = "git+https://github.com/txpipe/pallas.git#de88df1986dc1487452075dd29cec0996a46e3c3" dependencies = [ - "bytes", - "fnv", - "itoa", + "base58", + "bech32", + "crc", + "cryptoxide", + "hex", + "pallas-codec 0.30.2 (git+https://github.com/txpipe/pallas.git)", + "pallas-crypto 0.30.2 (git+https://github.com/txpipe/pallas.git)", + "thiserror", ] [[package]] -name = "http" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" +name = "pallas-codec" +version = "0.30.2" dependencies = [ - "bytes", - "fnv", - "itoa", + "hex", + "minicbor", + "serde", + "thiserror", ] [[package]] -name = "http-body" -version = "0.4.6" +name = "pallas-codec" +version = "0.30.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +checksum = "747279d1bc612986035619a3eaded8f9f4ceae29668aa7a5feae83681a0e93f4" dependencies = [ - "bytes", - "http 0.2.12", - "pin-project-lite", + "hex", + "minicbor", + "serde", + "thiserror", ] [[package]] -name = "httparse" -version = "1.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" - -[[package]] -name = "httpdate" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" +name = "pallas-codec" +version = "0.30.2" +source = "git+https://github.com/txpipe/pallas.git#de88df1986dc1487452075dd29cec0996a46e3c3" +dependencies = [ + "hex", + "minicbor", + "serde", + "thiserror", +] [[package]] -name = "hyper" -version = "0.14.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" +name = "pallas-crypto" +version = "0.30.2" dependencies = [ - "bytes", - "futures-channel", - "futures-core", - "futures-util", - "h2", - "http 0.2.12", - "http-body", - "httparse", - "httpdate", - "itoa", - "pin-project-lite", - "socket2", - "tokio", - "tower-service", - "tracing", - "want", + "cryptoxide", + "hex", + "pallas-codec 0.30.2", + "rand_core 0.6.4", + "serde", + "thiserror", + "vrf_dalek", ] [[package]] -name = "hyper-timeout" -version = "0.4.1" +name = "pallas-crypto" +version = "0.30.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" +checksum = "1b6f8b08e32c7dbb50302222701ae15ef9ac1a7cc39225ce29c253f6ddab2aa7" dependencies = [ - "hyper", - "pin-project-lite", - "tokio", - "tokio-io-timeout", + "cryptoxide", + "hex", + "pallas-codec 0.30.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.6.4", + "serde", + "thiserror", ] [[package]] -name = "iana-time-zone" -version = "0.1.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" +name = "pallas-crypto" +version = "0.30.2" +source = "git+https://github.com/txpipe/pallas.git#de88df1986dc1487452075dd29cec0996a46e3c3" dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "windows-core", + "cryptoxide", + "hex", + "pallas-codec 0.30.2 (git+https://github.com/txpipe/pallas.git)", + "rand_core 0.6.4", + "serde", + "thiserror", + "vrf_dalek", ] [[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +name = "pallas-primitives" +version = "0.30.2" dependencies = [ - "cc", + "base58", + "bech32", + "hex", + "log", + "pallas-codec 0.30.2", + "pallas-crypto 0.30.2", + "serde", + "serde_json", ] [[package]] -name = "id-arena" -version = "2.2.1" +name = "pallas-primitives" +version = "0.30.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25a2bc672d1148e28034f176e01fffebb08b35768468cc954630da77a1449005" +checksum = "24929d461308626183d5bf15290e6315f4cc67fa38a1a66469425919683cceb2" +dependencies = [ + "base58", + "bech32", + "hex", + "log", + "pallas-codec 0.30.2 (registry+https://github.com/rust-lang/crates.io-index)", + "pallas-crypto 0.30.2 (registry+https://github.com/rust-lang/crates.io-index)", + "serde", + "serde_json", +] [[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" +name = "pallas-primitives" +version = "0.30.2" +source = "git+https://github.com/txpipe/pallas.git#de88df1986dc1487452075dd29cec0996a46e3c3" +dependencies = [ + "base58", + "bech32", + "hex", + "log", + "pallas-codec 0.30.2 (git+https://github.com/txpipe/pallas.git)", + "pallas-crypto 0.30.2 (git+https://github.com/txpipe/pallas.git)", + "serde", + "serde_json", +] [[package]] -name = "indexmap" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +name = "pallas-traverse" +version = "0.30.2" dependencies = [ - "autocfg", - "hashbrown 0.12.3", + "hex", + "itertools", + "pallas-addresses 0.30.2", + "pallas-codec 0.30.2", + "pallas-crypto 0.30.2", + "pallas-primitives 0.30.2", + "paste", "serde", + "thiserror", ] [[package]] -name = "indexmap" -version = "2.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "824b2ae422412366ba479e8111fd301f7b5faece8149317bb81925979a53f520" +name = "pallas-traverse" +version = "0.30.2" +source = "git+https://github.com/txpipe/pallas.git#de88df1986dc1487452075dd29cec0996a46e3c3" dependencies = [ - "equivalent", - "hashbrown 0.14.3", + "hex", + "itertools", + "pallas-addresses 0.30.2 (git+https://github.com/txpipe/pallas.git)", + "pallas-codec 0.30.2 (git+https://github.com/txpipe/pallas.git)", + "pallas-crypto 0.30.2 (git+https://github.com/txpipe/pallas.git)", + "pallas-primitives 0.30.2 (git+https://github.com/txpipe/pallas.git)", + "paste", "serde", + "thiserror", ] [[package]] -name = "inlinable_string" -version = "0.1.15" +name = "paste" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8fae54786f62fb2918dcfae3d568594e50eb9b5c25bf04371af6fe7516452fb" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] -name = "inotify" -version = "0.9.6" +name = "powerfmt" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8069d3ec154eb856955c1c0fbffefbf5f3c40a104ec912d4797314c1801abff" -dependencies = [ - "bitflags 1.3.2", - "inotify-sys", - "libc", -] +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] -name = "inotify-sys" -version = "0.1.5" +name = "prettyplease" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e05c02b5e89bff3b946cedeca278abc628fe811e604f027c45a8aa3cf793d0eb" +checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" dependencies = [ - "libc", + "proc-macro2", + "syn 2.0.79", ] [[package]] -name = "is-terminal" -version = "0.4.13" +name = "proc-macro2" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "261f68e344040fbd0edea105bef17c66edf46f984ddb1115b775ce31be948f4b" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ - "hermit-abi 0.4.0", - "libc", - "windows-sys 0.52.0", + "unicode-ident", ] [[package]] -name = "itertools" -version = "0.10.5" +name = "quote" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ - "either", + "proc-macro2", ] [[package]] -name = "itertools" -version = "0.12.1" +name = "rand_core" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" dependencies = [ - "either", + "getrandom", ] [[package]] -name = "itertools" -version = "0.13.0" +name = "rand_core" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" -dependencies = [ - "either", -] - -[[package]] -name = "itoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" - -[[package]] -name = "js-sys" -version = "0.3.70" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "keccak" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" -dependencies = [ - "cpufeatures", -] - -[[package]] -name = "kqueue" -version = "1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7447f1ca1b7b563588a205fe93dea8df60fd981423a768bc1c0ded35ed147d0c" -dependencies = [ - "kqueue-sys", - "libc", -] - -[[package]] -name = "kqueue-sys" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed9625ffda8729b85e45cf04090035ac368927b8cebc34898e7c120f52e4838b" -dependencies = [ - "bitflags 1.3.2", - "libc", -] - -[[package]] -name = "lazy_static" -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.158" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" - -[[package]] -name = "libredox" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" -dependencies = [ - "bitflags 2.5.0", - "libc", - "redox_syscall", -] - -[[package]] -name = "linux-raw-sys" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" - -[[package]] -name = "loom" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff50ecb28bb86013e935fb6683ab1f6d3a20016f123c76fd4c27470076ac30f5" -dependencies = [ - "cfg-if", - "generator", - "scoped-tls", - "serde", - "serde_json", - "tracing", - "tracing-subscriber", -] - -[[package]] -name = "matchers" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" -dependencies = [ - "regex-automata 0.1.10", -] - -[[package]] -name = "matchit" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" - -[[package]] -name = "memchr" -version = "2.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" - -[[package]] -name = "mime" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" - -[[package]] -name = "minicbor" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d15f4203d71fdf90903c2696e55426ac97a363c67b218488a73b534ce7aca10" -dependencies = [ - "half", - "minicbor-derive", -] - -[[package]] -name = "minicbor-derive" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1154809406efdb7982841adb6311b3d095b46f78342dd646736122fe6b19e267" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "miniz_oxide" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" -dependencies = [ - "adler2", -] - -[[package]] -name = "minter" -version = "0.1.0" -dependencies = [ - "balius", - "hex", - "pallas-primitives 0.30.2", - "pallas-txbuilder", - "serde", - "serde_json", - "serde_with", -] - -[[package]] -name = "mio" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" -dependencies = [ - "libc", - "log", - "wasi", - "windows-sys 0.48.0", -] - -[[package]] -name = "mio" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" -dependencies = [ - "hermit-abi 0.3.9", - "libc", - "wasi", - "windows-sys 0.52.0", -] - -[[package]] -name = "multer" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83e87776546dc87511aa5ee218730c92b666d7264ab6ed41f9d215af9cd5224b" -dependencies = [ - "bytes", - "encoding_rs", - "futures-util", - "http 1.1.0", - "httparse", - "memchr", - "mime", - "spin", - "tokio", - "tokio-util", - "version_check", -] - -[[package]] -name = "multimap" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" - -[[package]] -name = "my-bod" -version = "0.1.0" -dependencies = [ - "balius", - "pallas-primitives 0.30.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde", -] - -[[package]] -name = "normpath" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8911957c4b1549ac0dc74e30db9c8b0e66ddcd6d7acc33098f4c63a64a6d7ed" -dependencies = [ - "windows-sys 0.59.0", -] - -[[package]] -name = "notify" -version = "6.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6205bd8bb1e454ad2e27422015fb5e4f2bcc7e08fa8f27058670d208324a4d2d" -dependencies = [ - "bitflags 2.5.0", - "crossbeam-channel", - "filetime", - "fsevent-sys", - "inotify", - "kqueue", - "libc", - "log", - "mio 0.8.11", - "walkdir", - "windows-sys 0.48.0", -] - -[[package]] -name = "nu-ansi-term" -version = "0.46.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" -dependencies = [ - "overload", - "winapi", -] - -[[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 = "num_cpus" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi 0.3.9", - "libc", -] - -[[package]] -name = "object" -version = "0.36.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "084f1a5821ac4c651660a94a7153d27ac9d8a53736203f58b31945ded098070a" -dependencies = [ - "memchr", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "overload" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" - -[[package]] -name = "pallas" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d414da3cb1cdddd5a11ae11ddbdbd0be42917619e18ea8ddfc942ce564177207" -dependencies = [ - "pallas-addresses 0.22.0", - "pallas-applying 0.22.0", - "pallas-codec 0.22.0", - "pallas-configs 0.22.0", - "pallas-crypto 0.22.0", - "pallas-network 0.22.0", - "pallas-primitives 0.22.0", - "pallas-traverse 0.22.0", - "pallas-utxorpc 0.22.0", -] - -[[package]] -name = "pallas" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99b6f0578e5802e219f26833516ac5f24c9f50986af7c03aea141fab8f05d5d2" -dependencies = [ - "pallas-addresses 0.23.0", - "pallas-applying 0.23.0", - "pallas-codec 0.23.0", - "pallas-configs 0.23.0", - "pallas-crypto 0.23.0", - "pallas-network 0.23.0", - "pallas-primitives 0.23.0", - "pallas-traverse 0.23.0", - "pallas-utxorpc 0.23.0", -] - -[[package]] -name = "pallas-addresses" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a186bac65200a9b720326082b2bd64fe2f0f9284e8709c70fa16d9f9aeed89e6" -dependencies = [ - "base58", - "bech32", - "crc", - "hex", - "pallas-codec 0.22.0", - "pallas-crypto 0.22.0", - "sha3", - "thiserror", -] - -[[package]] -name = "pallas-addresses" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7015bf4b1770b7e2ce8c9742d7c798db540914562e67e22953eff4b6d53aab90" -dependencies = [ - "base58", - "bech32", - "crc", - "hex", - "pallas-codec 0.23.0", - "pallas-crypto 0.23.0", - "sha3", - "thiserror", -] - -[[package]] -name = "pallas-addresses" -version = "0.30.2" -dependencies = [ - "base58", - "bech32", - "crc", - "cryptoxide", - "hex", - "pallas-codec 0.30.2", - "pallas-crypto 0.30.2", - "thiserror", -] - -[[package]] -name = "pallas-applying" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0bda8d2f978d1482470484d3efcd1a029d9a1f560bb75e32a7a67539e68c58" -dependencies = [ - "hex", - "pallas-addresses 0.22.0", - "pallas-codec 0.22.0", - "pallas-crypto 0.22.0", - "pallas-primitives 0.22.0", - "pallas-traverse 0.22.0", - "rand", -] - -[[package]] -name = "pallas-applying" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f762f9cad2ba788fb7e8205442db54b6d45b65a7b0386853e7995002f23524f4" -dependencies = [ - "hex", - "pallas-addresses 0.23.0", - "pallas-codec 0.23.0", - "pallas-crypto 0.23.0", - "pallas-primitives 0.23.0", - "pallas-traverse 0.23.0", - "rand", -] - -[[package]] -name = "pallas-codec" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4530d1a558070d6b46bfd68cfd77f3a7b2cff3b4426b32ad9f02ff270387b248" -dependencies = [ - "hex", - "minicbor", - "serde", - "thiserror", -] - -[[package]] -name = "pallas-codec" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9f8d41f17000f9a6bab7c26c99b19038a12de5cf004e901e1d0f5fa993e3d7d" -dependencies = [ - "hex", - "minicbor", - "serde", - "thiserror", -] - -[[package]] -name = "pallas-codec" -version = "0.30.2" -dependencies = [ - "hex", - "minicbor", - "serde", - "thiserror", -] - -[[package]] -name = "pallas-codec" -version = "0.30.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "747279d1bc612986035619a3eaded8f9f4ceae29668aa7a5feae83681a0e93f4" -dependencies = [ - "hex", - "minicbor", - "serde", - "thiserror", -] - -[[package]] -name = "pallas-configs" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e6aa7902aefb3fd30f04a345be664df3a36af8a5be38efc55027ef8e2536e69" -dependencies = [ - "base64 0.21.7", - "hex", - "pallas-addresses 0.22.0", - "pallas-codec 0.22.0", - "pallas-crypto 0.22.0", - "serde", - "serde_json", -] - -[[package]] -name = "pallas-configs" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b204f901fc5aacd603444eedb790f6162628f7853010b18d25a3acfc08c8b18d" -dependencies = [ - "base64 0.21.7", - "hex", - "pallas-addresses 0.23.0", - "pallas-codec 0.23.0", - "pallas-crypto 0.23.0", - "serde", - "serde_json", -] - -[[package]] -name = "pallas-crypto" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12dd0ccf9909e47c1273000eb11945b3d909356c0f0fd2a380f49ced849d2c77" -dependencies = [ - "cryptoxide", - "hex", - "pallas-codec 0.22.0", - "rand_core", - "serde", - "thiserror", -] - -[[package]] -name = "pallas-crypto" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6610d24e42fe2d8408022bda788ba4bf6d125debe3da404e2499848e108788a1" -dependencies = [ - "cryptoxide", - "hex", - "pallas-codec 0.23.0", - "rand_core", - "serde", - "thiserror", -] - -[[package]] -name = "pallas-crypto" -version = "0.30.2" -dependencies = [ - "cryptoxide", - "hex", - "pallas-codec 0.30.2", - "rand_core", - "serde", - "thiserror", -] - -[[package]] -name = "pallas-crypto" -version = "0.30.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b6f8b08e32c7dbb50302222701ae15ef9ac1a7cc39225ce29c253f6ddab2aa7" -dependencies = [ - "cryptoxide", - "hex", - "pallas-codec 0.30.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_core", - "serde", - "thiserror", -] - -[[package]] -name = "pallas-network" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc07ddecbb424ebf1e23ad5202442a7ae7c3cb909eb375c65a57f9acc521665a" -dependencies = [ - "byteorder", - "hex", - "itertools 0.10.5", - "pallas-codec 0.22.0", - "pallas-crypto 0.22.0", - "rand", - "socket2", - "thiserror", - "tokio", - "tracing", -] - -[[package]] -name = "pallas-network" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e581074044a45f6d65445b3796dd283fa513f13cf95412784a884da7bab4524e" -dependencies = [ - "byteorder", - "hex", - "itertools 0.12.1", - "pallas-codec 0.23.0", - "pallas-crypto 0.23.0", - "rand", - "socket2", - "thiserror", - "tokio", - "tracing", -] - -[[package]] -name = "pallas-primitives" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb19819e37c14cafa0a5bba51cd2966b07b72399a8096910f48e34d49c05adf1" -dependencies = [ - "base58", - "bech32", - "hex", - "log", - "pallas-codec 0.22.0", - "pallas-crypto 0.22.0", - "serde", - "serde_json", -] - -[[package]] -name = "pallas-primitives" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73c1d8c016d49522e0de0b6839abeb0dbd2eb7de5353931d785ddc2cfe189d8a" -dependencies = [ - "base58", - "bech32", - "hex", - "log", - "pallas-codec 0.23.0", - "pallas-crypto 0.23.0", - "serde", - "serde_json", -] - -[[package]] -name = "pallas-primitives" -version = "0.30.2" -dependencies = [ - "base58", - "bech32", - "hex", - "log", - "pallas-codec 0.30.2", - "pallas-crypto 0.30.2", - "serde", - "serde_json", -] - -[[package]] -name = "pallas-primitives" -version = "0.30.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24929d461308626183d5bf15290e6315f4cc67fa38a1a66469425919683cceb2" -dependencies = [ - "base58", - "bech32", - "hex", - "log", - "pallas-codec 0.30.2 (registry+https://github.com/rust-lang/crates.io-index)", - "pallas-crypto 0.30.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde", - "serde_json", -] - -[[package]] -name = "pallas-traverse" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebf62cdadb4d9d15b390fd540fc639fcbeaf3875a6bee490c104d305426cb262" -dependencies = [ - "hex", - "pallas-addresses 0.22.0", - "pallas-codec 0.22.0", - "pallas-crypto 0.22.0", - "pallas-primitives 0.22.0", - "paste", - "serde", - "thiserror", -] - -[[package]] -name = "pallas-traverse" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a92e50d84b029e069c9d6e36b38b1da2b5fe427c75a066697c8636e30dc9163" -dependencies = [ - "hex", - "pallas-addresses 0.23.0", - "pallas-codec 0.23.0", - "pallas-crypto 0.23.0", - "pallas-primitives 0.23.0", - "paste", - "serde", - "thiserror", -] - -[[package]] -name = "pallas-traverse" -version = "0.30.2" -dependencies = [ - "hex", - "itertools 0.13.0", - "pallas-addresses 0.30.2", - "pallas-codec 0.30.2", - "pallas-crypto 0.30.2", - "pallas-primitives 0.30.2", - "paste", - "serde", - "thiserror", -] - -[[package]] -name = "pallas-txbuilder" -version = "0.30.2" -dependencies = [ - "hex", - "pallas-addresses 0.30.2", - "pallas-codec 0.30.2", - "pallas-crypto 0.30.2", - "pallas-primitives 0.30.2", - "pallas-traverse 0.30.2", - "serde", - "serde_json", - "serde_with", - "thiserror", -] - -[[package]] -name = "pallas-utxorpc" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9547f8ada5e3d89894e89a1a372e75b61c526b7081ca1962f39ea264180d2778" -dependencies = [ - "pallas-codec 0.22.0", - "pallas-primitives 0.22.0", - "pallas-traverse 0.22.0", - "utxorpc", -] - -[[package]] -name = "pallas-utxorpc" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8ce48285a80d6a013fe5212c243a66e74f21c4f34dfc8f8f2be6687606a0e2" -dependencies = [ - "pallas-codec 0.23.0", - "pallas-primitives 0.23.0", - "pallas-traverse 0.23.0", - "utxorpc-spec", -] - -[[package]] -name = "parking_lot" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" -dependencies = [ - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall", - "smallvec", - "windows-targets 0.52.6", -] - -[[package]] -name = "paste" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" - -[[package]] -name = "pbjson" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "048f9ac93c1eab514f9470c4bc8d97ca2a0a236b84f45cc19d69a59fc11467f6" -dependencies = [ - "base64 0.13.1", - "serde", -] - -[[package]] -name = "pbjson-build" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdbb7b706f2afc610f3853550cdbbf6372fd324824a087806bd4480ea4996e24" -dependencies = [ - "heck 0.4.1", - "itertools 0.10.5", - "prost", - "prost-types", -] - -[[package]] -name = "pbjson-types" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a88c8d87f99a4ac14325e7a4c24af190fca261956e3b82dd7ed67e77e6c7043" -dependencies = [ - "bytes", - "chrono", - "pbjson", - "pbjson-build", - "prost", - "prost-build", - "serde", -] - -[[package]] -name = "pear" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdeeaa00ce488657faba8ebf44ab9361f9365a97bd39ffb8a60663f57ff4b467" -dependencies = [ - "inlinable_string", - "pear_codegen", - "yansi", -] - -[[package]] -name = "pear_codegen" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bab5b985dc082b345f812b7df84e1bef27e7207b39e448439ba8bd69c93f147" -dependencies = [ - "proc-macro2", - "proc-macro2-diagnostics", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "percent-encoding" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" - -[[package]] -name = "pest" -version = "2.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c73c26c01b8c87956cea613c907c9d6ecffd8d18a2a5908e5de0adfaa185cea" -dependencies = [ - "memchr", - "thiserror", - "ucd-trie", -] - -[[package]] -name = "pest_derive" -version = "2.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "664d22978e2815783adbdd2c588b455b1bd625299ce36b2a99881ac9627e6d8d" -dependencies = [ - "pest", - "pest_generator", -] - -[[package]] -name = "pest_generator" -version = "2.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2d5487022d5d33f4c30d91c22afa240ce2a644e87fe08caad974d4eab6badbe" -dependencies = [ - "pest", - "pest_meta", - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "pest_meta" -version = "2.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0091754bbd0ea592c4deb3a122ce8ecbb0753b738aa82bc055fcc2eccc8d8174" -dependencies = [ - "once_cell", - "pest", - "sha2", -] - -[[package]] -name = "petgraph" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" -dependencies = [ - "fixedbitset", - "indexmap 2.2.2", -] - -[[package]] -name = "pin-project" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" - -[[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 = "ppv-lite86" -version = "0.2.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" -dependencies = [ - "zerocopy", -] - -[[package]] -name = "prettyplease" -version = "0.1.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8646e95016a7a6c4adea95bafa8a16baab64b583356217f2c85db4a39d9a86" -dependencies = [ - "proc-macro2", - "syn 1.0.109", -] - -[[package]] -name = "prettyplease" -version = "0.2.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" -dependencies = [ - "proc-macro2", - "syn 2.0.72", -] - -[[package]] -name = "proc-macro2" -version = "1.0.86" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "proc-macro2-diagnostics" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af066a9c399a26e020ada66a034357a868728e72cd426f3adcd35f80d88d88c8" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", - "version_check", - "yansi", -] - -[[package]] -name = "prost" -version = "0.11.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" -dependencies = [ - "bytes", - "prost-derive", -] - -[[package]] -name = "prost-build" -version = "0.11.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "119533552c9a7ffacc21e099c24a0ac8bb19c2a2a3f363de84cd9b844feab270" -dependencies = [ - "bytes", - "heck 0.4.1", - "itertools 0.10.5", - "lazy_static", - "log", - "multimap", - "petgraph", - "prettyplease 0.1.25", - "prost", - "prost-types", - "regex", - "syn 1.0.109", - "tempfile", - "which", -] - -[[package]] -name = "prost-derive" -version = "0.11.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" -dependencies = [ - "anyhow", - "itertools 0.10.5", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "prost-types" -version = "0.11.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "213622a1460818959ac1181aaeb2dc9c7f63df720db7d788b3e24eacd1983e13" -dependencies = [ - "prost", -] - -[[package]] -name = "quote" -version = "1.0.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha", - "rand_core", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom", -] - -[[package]] -name = "redox_syscall" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0884ad60e090bf1345b93da0a5de8923c93884cd03f40dfcfddd3b4bee661853" -dependencies = [ - "bitflags 2.5.0", -] - -[[package]] -name = "ref-cast" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccf0a6f84d5f1d581da8b41b47ec8600871962f2a528115b542b362d4b744931" -dependencies = [ - "ref-cast-impl", -] - -[[package]] -name = "ref-cast-impl" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "regex" -version = "1.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata 0.4.7", - "regex-syntax 0.8.4", -] - -[[package]] -name = "regex-automata" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" -dependencies = [ - "regex-syntax 0.6.29", -] - -[[package]] -name = "regex-automata" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax 0.8.4", -] - -[[package]] -name = "regex-syntax" -version = "0.6.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" - -[[package]] -name = "regex-syntax" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" - -[[package]] -name = "rocket" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a516907296a31df7dc04310e7043b61d71954d703b603cc6867a026d7e72d73f" -dependencies = [ - "async-stream", - "async-trait", - "atomic 0.5.3", - "binascii", - "bytes", - "either", - "figment", - "futures", - "indexmap 2.2.2", - "log", - "memchr", - "multer", - "num_cpus", - "parking_lot", - "pin-project-lite", - "rand", - "ref-cast", - "rocket_codegen", - "rocket_http", - "serde", - "state", - "tempfile", - "time", - "tokio", - "tokio-stream", - "tokio-util", - "ubyte", - "version_check", - "yansi", -] - -[[package]] -name = "rocket_codegen" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "575d32d7ec1a9770108c879fc7c47815a80073f96ca07ff9525a94fcede1dd46" -dependencies = [ - "devise", - "glob", - "indexmap 2.2.2", - "proc-macro2", - "quote", - "rocket_http", - "syn 2.0.72", - "unicode-xid", - "version_check", -] - -[[package]] -name = "rocket_dyn_templates" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04bfc006e547e4f72b760ab861f5943b688aed8a82c4977b5500c98f5d17dbfa" -dependencies = [ - "handlebars", - "normpath", - "notify", - "rocket", - "walkdir", -] - -[[package]] -name = "rocket_http" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e274915a20ee3065f611c044bd63c40757396b6dbc057d6046aec27f14f882b9" -dependencies = [ - "cookie", - "either", - "futures", - "http 0.2.12", - "hyper", - "indexmap 2.2.2", - "log", - "memchr", - "pear", - "percent-encoding", - "pin-project-lite", - "ref-cast", - "serde", - "smallvec", - "stable-pattern", - "state", - "time", - "tokio", - "uncased", -] - -[[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.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" -dependencies = [ - "bitflags 2.5.0", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] - -[[package]] -name = "rustversion" -version = "1.0.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" - -[[package]] -name = "ryu" -version = "1.0.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[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 = "semver" -version = "1.0.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" - -[[package]] -name = "serde" -version = "1.0.204" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.204" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "serde_json" -version = "1.0.128" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" -dependencies = [ - "itoa", - "memchr", - "ryu", - "serde", -] - -[[package]] -name = "serde_spanned" -version = "0.6.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d" -dependencies = [ - "serde", -] - -[[package]] -name = "serde_with" -version = "3.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cecfa94848272156ea67b2b1a53f20fc7bc638c4a46d2f8abde08f05f4b857" -dependencies = [ - "base64 0.22.1", - "chrono", - "hex", - "indexmap 1.9.3", - "indexmap 2.2.2", - "serde", - "serde_derive", - "serde_json", - "serde_with_macros", - "time", -] - -[[package]] -name = "serde_with_macros" -version = "3.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8fee4991ef4f274617a51ad4af30519438dacb2f56ac773b08a1922ff743350" -dependencies = [ - "darling", - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "sha2" -version = "0.10.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - -[[package]] -name = "sha3" -version = "0.10.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" -dependencies = [ - "digest", - "keccak", -] - -[[package]] -name = "sharded-slab" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" -dependencies = [ - "lazy_static", -] - -[[package]] -name = "shlex" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" - -[[package]] -name = "signal-hook-registry" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" -dependencies = [ - "libc", -] - -[[package]] -name = "slab" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" -dependencies = [ - "autocfg", -] - -[[package]] -name = "smallvec" -version = "1.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" - -[[package]] -name = "socket2" -version = "0.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "spdx" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47317bbaf63785b53861e1ae2d11b80d6b624211d42cb20efcd210ee6f8a14bc" -dependencies = [ - "smallvec", -] - -[[package]] -name = "spin" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" - -[[package]] -name = "stable-pattern" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4564168c00635f88eaed410d5efa8131afa8d8699a612c80c455a0ba05c21045" -dependencies = [ - "memchr", -] - -[[package]] -name = "state" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b8c4a4445d81357df8b1a650d0d0d6fbbbfe99d064aa5e02f3e4022061476d8" -dependencies = [ - "loom", -] - -[[package]] -name = "strsim" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" - -[[package]] -name = "sundae-stop-loss-strategy" -version = "0.1.0" -dependencies = [ - "hex", - "pallas 0.23.0", - "rocket", - "rocket_dyn_templates", -] - -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.72" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "sync_wrapper" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" - -[[package]] -name = "tempfile" -version = "3.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" -dependencies = [ - "cfg-if", - "fastrand", - "once_cell", - "rustix", - "windows-sys 0.59.0", -] - -[[package]] -name = "thiserror" -version = "1.0.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "thread_local" -version = "1.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" -dependencies = [ - "cfg-if", - "once_cell", -] - -[[package]] -name = "ticket-vending-machine" -version = "0.1.0" -dependencies = [ - "hex", - "pallas 0.22.0", - "rocket", - "rocket_dyn_templates", -] - -[[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" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -[[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 = "ryu" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" [[package]] -name = "tokio" -version = "1.40.0" +name = "semver" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" -dependencies = [ - "backtrace", - "bytes", - "libc", - "mio 1.0.2", - "pin-project-lite", - "signal-hook-registry", - "socket2", - "tokio-macros", - "windows-sys 0.52.0", -] +checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" [[package]] -name = "tokio-io-timeout" -version = "1.2.0" +name = "serde" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30b74022ada614a1b4834de765f9bb43877f910cc8ce4be40e89042c9223a8bf" +checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" dependencies = [ - "pin-project-lite", - "tokio", + "serde_derive", ] [[package]] -name = "tokio-macros" -version = "2.4.0" +name = "serde_derive" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" +checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.79", ] [[package]] -name = "tokio-stream" -version = "0.1.16" +name = "serde_json" +version = "1.0.128" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f4e6ce100d0eb49a2734f8c0812bcd324cf357d21810932c5df6b96ef2b86f1" +checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" dependencies = [ - "futures-core", - "pin-project-lite", - "tokio", + "itoa", + "memchr", + "ryu", + "serde", ] [[package]] -name = "tokio-util" -version = "0.7.12" +name = "serde_with" +version = "3.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" +checksum = "69cecfa94848272156ea67b2b1a53f20fc7bc638c4a46d2f8abde08f05f4b857" dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", + "base64", + "chrono", + "hex", + "indexmap 1.9.3", + "indexmap 2.2.2", + "serde", + "serde_derive", + "serde_json", + "serde_with_macros", + "time", ] [[package]] -name = "toml" -version = "0.8.19" +name = "serde_with_macros" +version = "3.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" +checksum = "a8fee4991ef4f274617a51ad4af30519438dacb2f56ac773b08a1922ff743350" dependencies = [ - "serde", - "serde_spanned", - "toml_datetime", - "toml_edit", + "darling", + "proc-macro2", + "quote", + "syn 2.0.79", ] [[package]] -name = "toml_datetime" -version = "0.6.8" +name = "sha2" +version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" +checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" dependencies = [ - "serde", + "block-buffer", + "cfg-if", + "cpufeatures", + "digest", + "opaque-debug", ] [[package]] -name = "toml_edit" -version = "0.22.20" +name = "shlex" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" -dependencies = [ - "indexmap 2.2.2", - "serde", - "serde_spanned", - "toml_datetime", - "winnow", -] +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] -name = "tonic" -version = "0.9.2" +name = "smallvec" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3082666a3a6433f7f511c7192923fa1fe07c69332d3c6a2e6bb040b569199d5a" -dependencies = [ - "async-trait", - "axum", - "base64 0.21.7", - "bytes", - "futures-core", - "futures-util", - "h2", - "http 0.2.12", - "http-body", - "hyper", - "hyper-timeout", - "percent-encoding", - "pin-project", - "prost", - "tokio", - "tokio-stream", - "tower", - "tower-layer", - "tower-service", - "tracing", -] +checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" [[package]] -name = "tower" -version = "0.4.13" +name = "spdx" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +checksum = "47317bbaf63785b53861e1ae2d11b80d6b624211d42cb20efcd210ee6f8a14bc" dependencies = [ - "futures-core", - "futures-util", - "indexmap 1.9.3", - "pin-project", - "pin-project-lite", - "rand", - "slab", - "tokio", - "tokio-util", - "tower-layer", - "tower-service", - "tracing", + "smallvec", ] [[package]] -name = "tower-layer" -version = "0.3.3" +name = "strsim" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] -name = "tower-service" -version = "0.3.3" +name = "subtle" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] -name = "tracing" -version = "0.1.40" +name = "syn" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ - "pin-project-lite", - "tracing-attributes", - "tracing-core", + "proc-macro2", + "quote", + "unicode-ident", ] [[package]] -name = "tracing-attributes" -version = "0.1.27" +name = "syn" +version = "2.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "unicode-ident", ] [[package]] -name = "tracing-core" -version = "0.1.32" +name = "thiserror" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" dependencies = [ - "once_cell", - "valuable", + "thiserror-impl", ] [[package]] -name = "tracing-log" -version = "0.2.0" +name = "thiserror-impl" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" dependencies = [ - "log", - "once_cell", - "tracing-core", + "proc-macro2", + "quote", + "syn 2.0.79", ] [[package]] -name = "tracing-subscriber" -version = "0.3.18" +name = "time" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ - "matchers", - "nu-ansi-term", - "once_cell", - "regex", - "sharded-slab", - "smallvec", - "thread_local", - "tracing", - "tracing-core", - "tracing-log", + "deranged", + "itoa", + "num-conv", + "powerfmt", + "serde", + "time-core", + "time-macros", ] [[package]] -name = "try-lock" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" - -[[package]] -name = "typenum" -version = "1.17.0" +name = "time-core" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] -name = "ubyte" -version = "0.10.4" +name = "time-macros" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f720def6ce1ee2fc44d40ac9ed6d3a59c361c80a75a7aa8e75bb9baed31cf2ea" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" dependencies = [ - "serde", + "num-conv", + "time-core", ] [[package]] -name = "ucd-trie" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" - -[[package]] -name = "uncased" -version = "0.9.10" +name = "typenum" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1b88fcfe09e89d3866a5c11019378088af2d24c3fbd4f0543f96b479ec90697" -dependencies = [ - "serde", - "version_check", -] +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "unicode-ident" @@ -2813,64 +956,6 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" -[[package]] -name = "utxorpc" -version = "1.0.0-alpha.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad1841467f5ca405d4e878be56e1a8c8ae1f6f62b50984988027f6b4859d36c0" -dependencies = [ - "utxorpc-spec-cardano", - "utxorpc-spec-sync", -] - -[[package]] -name = "utxorpc-spec" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88f80e24bfe310d0972406d15c0892ff09b6c81ded2cdefc0183aac35cf0514f" -dependencies = [ - "bytes", - "pbjson", - "pbjson-types", - "prost", - "serde", - "tonic", -] - -[[package]] -name = "utxorpc-spec-cardano" -version = "1.0.0-alpha.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb1a8c03aef60aa154ae04fe871c9a6fab18c99f468f0ddc096e45c21c5b6814" -dependencies = [ - "bytes", - "pbjson", - "pbjson-types", - "prost", - "serde", -] - -[[package]] -name = "utxorpc-spec-sync" -version = "1.0.0-alpha.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32f7ab73d37f96892e16a5c89f9aa430b9efdcaa5f2a0259a87f99a2eb732ea0" -dependencies = [ - "bytes", - "pbjson", - "pbjson-types", - "prost", - "serde", - "tonic", - "utxorpc-spec-cardano", -] - -[[package]] -name = "valuable" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" - [[package]] name = "version_check" version = "0.9.4" @@ -2878,29 +963,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] -name = "walkdir" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" -dependencies = [ - "same-file", - "winapi-util", -] - -[[package]] -name = "want" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +name = "vrf_dalek" +version = "0.1.0" +source = "git+https://github.com/txpipe/vrf?rev=044b45a1a919ba9d9c2471fc5c4d441f13086676#044b45a1a919ba9d9c2471fc5c4d441f13086676" dependencies = [ - "try-lock", + "curve25519-dalek 3.2.0", + "curve25519-dalek 3.2.1", + "rand_core 0.5.1", + "sha2", + "thiserror", ] [[package]] name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" +version = "0.9.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" [[package]] name = "wasm-bindgen" @@ -2924,7 +1002,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.79", "wasm-bindgen-shared", ] @@ -2946,7 +1024,7 @@ checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.79", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -2959,9 +1037,9 @@ checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" [[package]] name = "wasm-encoder" -version = "0.215.0" +version = "0.218.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb56df3e06b8e6b77e37d2969a50ba51281029a9aeb3855e76b7f49b6418847" +checksum = "22b896fa8ceb71091ace9bcb81e853f54043183a1c9667cf93422c40252ffa0a" dependencies = [ "leb128", "wasmparser", @@ -2969,9 +1047,9 @@ dependencies = [ [[package]] name = "wasm-metadata" -version = "0.215.0" +version = "0.218.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c6bb07c5576b608f7a2a9baa2294c1a3584a249965d695a9814a496cb6d232f" +checksum = "aa5eeb071abe8a2132fdd5565dabffee70775ee8c24fc7e300ac43f51f4a8a91" dependencies = [ "anyhow", "indexmap 2.2.2", @@ -2985,118 +1063,24 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.215.0" +version = "0.218.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fbde0881f24199b81cf49b6ff8f9c145ac8eb1b7fc439adb5c099734f7d90e" +checksum = "b09e46c7fceceaa72b2dd1a8a137ea7fd8f93dfaa69806010a709918e496c5dc" dependencies = [ "ahash", - "bitflags 2.5.0", + "bitflags", "hashbrown 0.14.3", "indexmap 2.2.2", "semver", ] -[[package]] -name = "which" -version = "4.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" -dependencies = [ - "either", - "home", - "once_cell", - "rustix", -] - -[[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 = "windows" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" -dependencies = [ - "windows-targets 0.48.5", -] - [[package]] name = "windows-core" version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", + "windows-targets", ] [[package]] @@ -3105,46 +1089,28 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.6", - "windows_aarch64_msvc 0.52.6", - "windows_i686_gnu 0.52.6", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", "windows_i686_gnullvm", - "windows_i686_msvc 0.52.6", - "windows_x86_64_gnu 0.52.6", - "windows_x86_64_gnullvm 0.52.6", - "windows_x86_64_msvc 0.52.6", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", ] -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - [[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.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - [[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.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - [[package]] name = "windows_i686_gnu" version = "0.52.6" @@ -3157,68 +1123,35 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - [[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.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - [[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.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - [[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.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - [[package]] name = "windows_x86_64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" -[[package]] -name = "winnow" -version = "0.6.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" -dependencies = [ - "memchr", -] - [[package]] name = "wit-bindgen" -version = "0.29.0" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6878f363ff82b1fce56d448380b56458a85d282aa08c2be80afe4f4cd9051070" +checksum = "8fcf26778671a2327bd237a32c6f2d1d9bb0ec077e482b0839552b00d4566544" dependencies = [ "wit-bindgen-rt", "wit-bindgen-rust-macro", @@ -3226,35 +1159,35 @@ dependencies = [ [[package]] name = "wit-bindgen-core" -version = "0.29.0" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66f98ab0edef3218244a87b125f4f7047f0af104f2e4718255226c0367688d1c" +checksum = "4b885a00e1c428fd12b7b7c4bccc4bad8b2a3ca0abe8eaf1e0f90adabb4c7ac7" dependencies = [ "anyhow", - "heck 0.5.0", + "heck", "wit-parser", ] [[package]] name = "wit-bindgen-rt" -version = "0.29.0" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b18e27825442721d23ed98591a80f55220cfe0bf883d92b1ead6c9be237bb34" +checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c" dependencies = [ - "bitflags 2.5.0", + "bitflags", ] [[package]] name = "wit-bindgen-rust" -version = "0.29.0" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44f91ca4e1f0d6d2522a7cbbbea6410992d92eb48e686623eb94e2278839b95" +checksum = "542608877814a54f6bea6b24dcbe249a2e293d67d709f4f8ec578d06b1c00730" dependencies = [ "anyhow", - "heck 0.5.0", + "heck", "indexmap 2.2.2", - "prettyplease 0.2.20", - "syn 2.0.72", + "prettyplease", + "syn 2.0.79", "wasm-metadata", "wit-bindgen-core", "wit-component", @@ -3262,27 +1195,27 @@ dependencies = [ [[package]] name = "wit-bindgen-rust-macro" -version = "0.29.0" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "826e65d7f2eb5e52795c125a2d40f1acdc3bee7a8cb15bfdc6d1078f02ac4f49" +checksum = "30d462025f670fff96606ddbfe62500255b4fe3de7298cd9cbabb2de3d567183" dependencies = [ "anyhow", - "prettyplease 0.2.20", + "prettyplease", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.79", "wit-bindgen-core", "wit-bindgen-rust", ] [[package]] name = "wit-component" -version = "0.215.0" +version = "0.218.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f725e3885fc5890648be5c5cbc1353b755dc932aa5f1aa7de968b912a3280743" +checksum = "aa53aa7e6bf2b3e8ccaffbcc963fbdb672a603dc0af393a481b6cec24c266406" dependencies = [ "anyhow", - "bitflags 2.5.0", + "bitflags", "indexmap 2.2.2", "log", "serde", @@ -3296,9 +1229,9 @@ dependencies = [ [[package]] name = "wit-parser" -version = "0.215.0" +version = "0.218.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "935a97eaffd57c3b413aa510f8f0b550a4a9fe7d59e79cd8b89a83dcb860321f" +checksum = "0d3d1066ab761b115f97fef2b191090faabcb0f37b555b758d3caf42d4ed9e55" dependencies = [ "anyhow", "id-arena", @@ -3312,22 +1245,12 @@ dependencies = [ "wasmparser", ] -[[package]] -name = "yansi" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" -dependencies = [ - "is-terminal", -] - [[package]] name = "zerocopy" version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" dependencies = [ - "byteorder", "zerocopy-derive", ] @@ -3339,5 +1262,11 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.79", ] + +[[package]] +name = "zeroize" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4756f7db3f7b5574938c3eb1c117038b8e07f95ee6718c0efad4ac21508f1efd" diff --git a/Cargo.toml b/Cargo.toml index 1de50c8..d0971c9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,10 @@ resolver = "2" members = [ "balius", "examples/basic", - "examples/sundae-stop-loss-strategy", - "examples/ticket-vending-machine", + # "examples/sundae-stop-loss-strategy", + # "examples/ticket-vending-machine", "examples/minter/offchain", + "balius-sdk", + "balius-runtime", + "balius-macros", ] diff --git a/balius-macros/Cargo.toml b/balius-macros/Cargo.toml new file mode 100644 index 0000000..6906d7b --- /dev/null +++ b/balius-macros/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "balius-macros" +version = "0.1.0" +edition = "2021" + +[lib] +proc-macro = true + +[dependencies] +quote = "1.0.37" +syn = { version = "2.0.79", features = ["full"] } diff --git a/balius-macros/src/lib.rs b/balius-macros/src/lib.rs new file mode 100644 index 0000000..a4f6bed --- /dev/null +++ b/balius-macros/src/lib.rs @@ -0,0 +1,38 @@ +use proc_macro::TokenStream; +use quote::quote; +use syn::{parse_macro_input, ItemFn}; + +#[proc_macro_attribute] +pub fn main(_attr: TokenStream, item: TokenStream) -> TokenStream { + // Parse the function + let input = parse_macro_input!(item as ItemFn); + let func_name = &input.sig.ident; + let func_body = &input.block; + + // Generate the new function with timing + let output = quote! { + fn #func_name() -> balius_sdk::Worker { + #func_body + } + + struct _Main; + + impl balius_sdk::wit::Guest for _Main { + fn init(env: balius_sdk::wit::Env) { + let worker = #func_name(); + balius_sdk::_internal::global_init_worker(env, worker); + } + + fn handle( + id: u32, + evt: balius_sdk::wit::Event, + ) -> std::result::Result { + balius_sdk::_internal::global_handle_request(id, evt) + } + } + + balius_sdk::wit::export!(_Main); + }; + + output.into() +} diff --git a/balius-runtime/Cargo.toml b/balius-runtime/Cargo.toml new file mode 100644 index 0000000..f728329 --- /dev/null +++ b/balius-runtime/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "balius-runtime" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/balius-runtime/src/lib.rs b/balius-runtime/src/lib.rs new file mode 100644 index 0000000..b93cf3f --- /dev/null +++ b/balius-runtime/src/lib.rs @@ -0,0 +1,14 @@ +pub fn add(left: u64, right: u64) -> u64 { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_works() { + let result = add(2, 2); + assert_eq!(result, 4); + } +} diff --git a/balius-sdk/Cargo.toml b/balius-sdk/Cargo.toml new file mode 100644 index 0000000..cce843c --- /dev/null +++ b/balius-sdk/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "balius-sdk" +version = "0.1.0" +edition = "2021" + +[dependencies] +balius-macros = { version = "0.1.0", path = "../balius-macros" } +hex = "0.4.3" +pallas-addresses = { version = "0.30.2", git = "https://github.com/txpipe/pallas.git" } +pallas-codec = { version = "0.30.2", git = "https://github.com/txpipe/pallas.git" } +pallas-crypto = { version = "0.30.2", git = "https://github.com/txpipe/pallas.git" } +pallas-primitives = { version = "0.30.2", git = "https://github.com/txpipe/pallas.git" } +pallas-traverse = { version = "0.30.2", git = "https://github.com/txpipe/pallas.git" } +serde = { version = "1.0.210", features = ["derive"] } +serde_json = "1.0.128" +serde_with = "3.9.0" +thiserror = "1.0.64" +wit-bindgen = "0.33.0" diff --git a/balius-sdk/examples/basic.rs b/balius-sdk/examples/basic.rs new file mode 100644 index 0000000..478886d --- /dev/null +++ b/balius-sdk/examples/basic.rs @@ -0,0 +1,28 @@ +use balius_sdk::*; +use serde::{Deserialize, Serialize}; + +#[derive(Debug, Serialize, Deserialize)] +struct FaucetConfig { + validator: String, +} + +#[derive(Debug, Serialize, Deserialize)] +struct FaucetRequest { + token: String, + quantity: u64, + recipient: String, + fuel: String, +} + +fn on_request(config: Config, params: Params) -> WorkerResult { + todo!() +} + +#[balius_sdk::main] +fn balius_main() -> Worker { + Worker::new().with_request_handler("faucet", FnHandler::from(on_request)) +} + +fn main() { + panic!("not meant to be run directly"); +} diff --git a/balius-sdk/src/_internal.rs b/balius-sdk/src/_internal.rs new file mode 100644 index 0000000..7526dc5 --- /dev/null +++ b/balius-sdk/src/_internal.rs @@ -0,0 +1,53 @@ +use std::{ + collections::HashMap, + sync::{LazyLock, RwLock}, +}; + +use crate::wit; + +type ChannelId = u32; + +pub trait Handler: Send + Sync + 'static { + fn handle( + &self, + config: wit::Env, + event: wit::Event, + ) -> Result; +} + +pub(crate) struct Channel { + pub(crate) handler: Box, + pub(crate) pattern: wit::balius::app::driver::EventPattern, +} + +type ChannelRegistry = HashMap; + +#[derive(Default)] +pub struct Worker { + pub(crate) channels: ChannelRegistry, + pub(crate) env: Option, +} + +static WORKER: LazyLock> = LazyLock::new(|| RwLock::new(Worker::default())); + +pub fn global_init_worker(env: wit::Env, mut worker: Worker) { + worker.init(env); + + for (id, handler) in worker.channels.iter() { + wit::balius::app::driver::register_channel(*id, &handler.pattern); + } + + let mut singelton = WORKER.write().unwrap(); + *singelton = worker; +} + +pub fn global_handle_request(id: u32, evt: wit::Event) -> Result { + let worker = WORKER.read().unwrap(); + let channel = worker.channels.get(&id).ok_or(1u32)?; + let env = match &worker.env { + Some(e) => e.clone(), + None => return Err(0), + }; + + channel.handler.handle(env, evt) +} diff --git a/balius-sdk/src/lib.rs b/balius-sdk/src/lib.rs new file mode 100644 index 0000000..8498dd1 --- /dev/null +++ b/balius-sdk/src/lib.rs @@ -0,0 +1,26 @@ +pub mod wit { + wit_bindgen::generate!({ + pub_export_macro: true, + default_bindings_module: "balius_sdk::wit", + path: "../wit", + additional_derives: [PartialEq, Eq, Hash, Clone, serde::Serialize,serde::Deserialize] + }); +} + +/// Re-export of the macros crate +pub use balius_macros as macros; + +/// Macro to mark the main function for the worker +pub use balius_macros::main; + +/// Transaction builder artifacts +pub mod txbuilder; + +/// Internal functions to be used by the generated code +pub mod _internal; + +/// Quality of life features to make the SDK more ergonomic +mod qol; + +pub use _internal::Worker; +pub use qol::*; diff --git a/balius-sdk/src/qol.rs b/balius-sdk/src/qol.rs new file mode 100644 index 0000000..222e80b --- /dev/null +++ b/balius-sdk/src/qol.rs @@ -0,0 +1,198 @@ +use std::marker::PhantomData; + +use crate::_internal::Handler; +use crate::wit; + +#[derive(Debug)] +pub enum Error { + Internal(String), + Ledger(wit::balius::app::ledger::LedgerError), +} + +impl From for wit::HandleError { + fn from(error: Error) -> Self { + match error { + Error::Internal(_) => 0, + Error::Ledger(e) => e.into(), + } + } +} + +impl From for Error { + fn from(error: wit::balius::app::ledger::LedgerError) -> Self { + Error::Ledger(error) + } +} + +pub type WorkerResult = std::result::Result; + +pub struct FnHandler +where + F: Fn(C, E) -> WorkerResult + 'static, + C: From, + E: From, + R: Into, +{ + func: F, + phantom: PhantomData<(C, E)>, +} + +impl Handler for FnHandler +where + C: From + Send + Sync + 'static, + E: From + Send + Sync + 'static, + R: Into + Send + Sync + 'static, + F: Fn(C, E) -> WorkerResult + Send + Sync + 'static, +{ + fn handle( + &self, + config: wit::Env, + event: wit::Event, + ) -> Result { + let config: C = config.into(); + let event: E = event.into(); + let response = (self.func)(config, event)?; + Ok(response.into()) + } +} + +impl From for FnHandler +where + C: From + Send + Sync + 'static, + E: From + Send + Sync + 'static, + R: Into + Send + Sync + 'static, + F: Fn(C, E) -> WorkerResult + Send + Sync + 'static, +{ + fn from(func: F) -> Self { + FnHandler { + func, + phantom: PhantomData, + } + } +} + +pub struct Config(pub T); + +impl From for Config +where + T: serde::de::DeserializeOwned, +{ + fn from(env: wit::Env) -> Self { + let t = serde_json::from_slice(env.as_slice()).unwrap(); + Config(t) + } +} + +impl std::ops::Deref for Config { + type Target = T; + + fn deref(&self) -> &Self::Target { + &self.0 + } +} + +pub struct Params(pub T); + +impl From for Params +where + T: serde::de::DeserializeOwned, +{ + fn from(value: wit::Event) -> Self { + let bytes = match value { + wit::Event::Request(x) => x, + _ => todo!(), + }; + + let t = serde_json::from_slice(bytes.as_slice()).unwrap(); + Params(t) + } +} + +impl From> for wit::Response +where + T: serde::Serialize, +{ + fn from(value: Params) -> Self { + Self::Json(serde_json::to_vec(&value.0).unwrap()) + } +} + +impl std::ops::Deref for Params { + type Target = T; + + fn deref(&self) -> &Self::Target { + &self.0 + } +} + +pub struct Json(pub T); + +impl From> for wit::Response +where + T: serde::Serialize, +{ + fn from(value: Json) -> Self { + Self::Json(serde_json::to_vec(&value.0).unwrap()) + } +} + +impl std::ops::Deref for Json { + type Target = T; + + fn deref(&self) -> &Self::Target { + &self.0 + } +} + +pub struct NewTx(pub Box); + +impl crate::txbuilder::TxExpr for NewTx { + fn eval_body( + &self, + ctx: &crate::txbuilder::BuildContext, + ) -> Result { + self.0.eval_body(ctx) + } + + fn eval_witness_set( + &self, + ctx: &crate::txbuilder::BuildContext, + ) -> Result { + self.0.eval_witness_set(ctx) + } +} + +impl Into for NewTx { + fn into(self) -> wit::Response { + // TODO: create a build context from the Balius world interface and evaluate the + // tx. + + todo!() + } +} + +impl crate::_internal::Worker { + pub fn new() -> Self { + Self::default() + } + + pub(crate) fn init(&mut self, env: wit::Env) { + self.env = Some(env); + } + + pub fn with_request_handler( + mut self, + method: &str, + handler: impl Handler + Send + Sync + 'static, + ) -> Self { + self.channels.insert( + self.channels.len() as u32, + crate::_internal::Channel { + handler: Box::new(handler), + pattern: wit::balius::app::driver::EventPattern::Request(method.to_owned()), + }, + ); + + self + } +} diff --git a/balius-sdk/src/txbuilder/asset_math.rs b/balius-sdk/src/txbuilder/asset_math.rs new file mode 100644 index 0000000..60a8da1 --- /dev/null +++ b/balius-sdk/src/txbuilder/asset_math.rs @@ -0,0 +1,162 @@ +use pallas_codec::utils::KeyValuePairs; +use pallas_crypto::hash::Hash; +use pallas_primitives::babbage::{self, Value}; +use std::collections::HashMap; + +pub fn fold_assets( + acc: &mut HashMap, + item: KeyValuePairs, +) where + T: std::ops::AddAssign + Copy, +{ + for (key, value) in item.to_vec() { + acc.entry(key).and_modify(|e| *e += value).or_insert(value); + } +} + +pub fn fold_multiassets( + acc: &mut HashMap, HashMap>, + item: KeyValuePairs, KeyValuePairs>, +) where + T: std::ops::AddAssign + Copy, +{ + for (key, value) in item.to_vec() { + let mut map = acc.remove(&key).unwrap_or_default(); + fold_assets(&mut map, value); + acc.insert(key, map); + } +} + +pub fn aggregate_assets( + items: impl IntoIterator>, +) -> babbage::Multiasset +where + T: std::ops::AddAssign + Copy, +{ + let mut total_assets = HashMap::new(); + + for assets in items { + fold_multiassets(&mut total_assets, assets); + } + + total_assets + .into_iter() + .map(|(policy_id, assets)| (policy_id, assets.into())) + .collect() +} + +pub fn aggregate_values(items: impl IntoIterator) -> Value { + let mut total_coin = 0; + let mut total_assets = KeyValuePairs::Def(vec![]); + + for value in items { + let (coin, assets) = match value { + Value::Coin(x) => (x, KeyValuePairs::Def(vec![])), + Value::Multiasset(x, y) => (x, y), + }; + + total_coin += coin; + total_assets = aggregate_assets(vec![total_assets, assets]); + } + + if total_assets.is_empty() { + Value::Coin(total_coin) + } else { + Value::Multiasset(total_coin, total_assets) + } +} + +pub fn multiasset_coin_to_mint(assets: babbage::Multiasset) -> babbage::Mint { + assets + .to_vec() + .into_iter() + .map(|(policy, assets)| { + let assets: KeyValuePairs<_, _> = assets + .to_vec() + .into_iter() + .map(|(name, quantity)| (name, quantity as i64)) + .collect(); + + (policy, KeyValuePairs::from(assets)) + }) + .collect() +} + +pub fn multiasset_coin_to_burn(assets: babbage::Multiasset) -> babbage::Mint { + assets + .to_vec() + .into_iter() + .map(|(policy, assets)| { + let assets: KeyValuePairs<_, _> = assets + .to_vec() + .into_iter() + .map(|(name, quantity)| (name, -(quantity as i64))) + .collect(); + + (policy, KeyValuePairs::from(assets)) + }) + .collect() +} + +pub fn value_saturating_add_coin(value: Value, coin: i64) -> Value { + match value { + Value::Coin(x) => Value::Coin(x.saturating_add_signed(coin)), + Value::Multiasset(x, assets) => Value::Multiasset(x.saturating_add_signed(coin), assets), + } +} + +#[cfg(test)] +mod tests { + use std::str::FromStr as _; + + use super::*; + use pallas_primitives::alonzo::Value; + + #[test] + fn test_add_values_coin_only() { + let value_a = Value::Coin(100); + let value_b = Value::Coin(200); + + let result = aggregate_values(vec![value_a, value_b]); + + assert_eq!(result, Value::Coin(300)); + } + + #[test] + fn test_add_values_same_asset() { + let policy_id = Hash::<28>::from_str( + "1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef", + ) + .unwrap(); + + let asset_name = "pepe".as_bytes().to_vec(); + + let value_a = Value::Multiasset( + 100, + KeyValuePairs::Def(vec![( + policy_id, + KeyValuePairs::Def(vec![(asset_name.clone().into(), 50)]), + )]), + ); + let value_b = Value::Multiasset( + 200, + KeyValuePairs::Def(vec![( + policy_id, + KeyValuePairs::Def(vec![(asset_name.clone().into(), 30)]), + )]), + ); + + let result = aggregate_values(vec![value_a, value_b]); + + assert_eq!( + result, + Value::Multiasset( + 300, + KeyValuePairs::Def(vec![( + policy_id, + KeyValuePairs::Def(vec![(asset_name.clone().into(), 80)]), + )]), + ) + ); + } +} diff --git a/balius-sdk/src/txbuilder/build.rs b/balius-sdk/src/txbuilder/build.rs new file mode 100644 index 0000000..b82fc7e --- /dev/null +++ b/balius-sdk/src/txbuilder/build.rs @@ -0,0 +1,36 @@ +use pallas_primitives::babbage; + +use super::{BuildContext, BuildError, Ledger, PParams, TxExpr}; + +pub fn build(tx: T, ledger: L) -> Result +where + T: TxExpr, + L: Ledger + 'static, +{ + let mut ctx = BuildContext { + network: babbage::NetworkId::One, + pparams: PParams { + min_fee_a: 4, + min_fee_b: 3, + min_utxo_value: 2, + }, + estimated_fee: 1, + ledger: Box::new(ledger), + tx_body: None, + }; + + let body = tx.eval_body(&ctx)?; + + ctx.tx_body = Some(body); + + let wit = tx.eval_witness_set(&ctx).unwrap(); + + let tx = babbage::Tx { + transaction_body: ctx.tx_body.take().unwrap(), + transaction_witness_set: wit, + auxiliary_data: pallas_codec::utils::Nullable::Null, + success: true, + }; + + Ok(tx) +} diff --git a/balius-sdk/src/txbuilder/dsl.rs b/balius-sdk/src/txbuilder/dsl.rs new file mode 100644 index 0000000..bc4a622 --- /dev/null +++ b/balius-sdk/src/txbuilder/dsl.rs @@ -0,0 +1,802 @@ +use pallas_primitives::babbage; +use pallas_traverse::MultiEraOutput; +use serde::{Deserialize, Serialize}; +use serde_with::{serde_as, DisplayFromStr}; +use std::collections::{HashMap, HashSet}; + +use super::*; + +pub type Hash = pallas_crypto::hash::Hash; +pub type Address = pallas_addresses::Address; +pub type Value = pallas_primitives::babbage::Value; +pub type Bytes = pallas_codec::utils::Bytes; +pub type KeyValuePairs = pallas_codec::utils::KeyValuePairs; + +pub struct PParams { + pub min_fee_a: u64, + pub min_fee_b: u64, + pub min_utxo_value: u64, +} + +pub trait Ledger { + fn read_utxos(&self, refs: &[TxoRef]) -> Result; + fn search_utxos(&self, pattern: &UtxoPattern) -> Result; +} + +pub type Cbor = Vec; + +#[derive(Debug, Clone, Default)] +pub struct UtxoSet(HashMap); + +impl UtxoSet { + pub fn is_empty(&self) -> bool { + self.0.is_empty() + } + + pub fn refs(&self) -> impl Iterator { + self.0.keys() + } + + pub fn txos(&self) -> impl Iterator> { + self.0 + .values() + .map(|v| MultiEraOutput::decode(pallas_traverse::Era::Babbage, v).unwrap()) + } +} + +impl From> for UtxoSet { + fn from(value: HashMap) -> Self { + UtxoSet(value) + } +} + +impl Ledger for UtxoSet { + fn read_utxos(&self, refs: &[TxoRef]) -> Result { + let out: HashMap<_, _> = refs + .iter() + .filter_map(|r| self.0.get(r).map(|v| (r.clone(), v.clone()))) + .collect(); + + Ok(UtxoSet(out)) + } + + fn search_utxos(&self, _pattern: &UtxoPattern) -> Result { + todo!() + } +} + +#[derive(Clone, Serialize, Deserialize)] +pub struct UtxoPattern; + +pub struct BuildContext { + pub network: babbage::NetworkId, + pub pparams: PParams, + pub estimated_fee: u64, + pub ledger: Box, + + pub tx_body: Option, +} + +impl BuildContext { + pub fn mint_redeemer_index(&self, policy: Hash<28>) -> Result { + if let Some(tx_body) = &self.tx_body { + let mut out: Vec<_> = tx_body + .mint + .iter() + .flat_map(|x| x.iter()) + .map(|(p, _)| *p) + .collect(); + + out.sort(); + out.dedup(); + + if let Some(index) = out.iter().position(|p| *p == policy) { + return Ok(index as u32); + } + } + + Err(BuildError::RedeemerTargetMissing) + } + + pub fn eval_ex_units( + &self, + _script: Hash<28>, + _data: &babbage::PlutusData, + ) -> babbage::ExUnits { + // TODO + babbage::ExUnits { mem: 8, steps: 8 } + } +} + +pub trait InputExpr: 'static + Send + Sync { + fn eval(&self, ctx: &BuildContext) -> Result, BuildError>; +} + +#[derive(Clone, Serialize, Deserialize)] +pub enum UtxoSource { + Refs(Vec), + Search(UtxoPattern), +} + +impl UtxoSource { + pub fn resolve(&self, ctx: &BuildContext) -> Result { + match self { + Self::Refs(refs) => ctx.ledger.read_utxos(refs), + Self::Search(utxo_pattern) => ctx.ledger.search_utxos(utxo_pattern), + } + } +} + +#[serde_as] +#[derive(Serialize, Deserialize, PartialEq, Eq, Debug, Clone)] +pub struct ReferenceScript { + pub ref_txo: babbage::TransactionInput, + pub hash: Hash<28>, + #[serde_as(as = "DisplayFromStr")] + pub address: Address, +} + +impl InputExpr for ReferenceScript { + fn eval(&self, _: &dsl::BuildContext) -> Result, BuildError> { + Ok(vec![self.ref_txo.clone()]) + } +} + +#[derive(PartialEq, Eq, Debug, Clone, Hash, Serialize, Deserialize)] +pub struct AssetPolicyId(Hash<28>); + +impl AssetPolicyId { + pub fn new(hash: Hash<28>) -> Self { + Self(hash) + } +} + +impl From> for AssetPolicyId { + fn from(value: Hash<28>) -> Self { + Self(value) + } +} + +impl Into> for AssetPolicyId { + fn into(self) -> Hash<28> { + self.0 + } +} + +impl TryFrom<&str> for AssetPolicyId { + type Error = BuildError; + + fn try_from(value: &str) -> Result { + let hash = as std::str::FromStr>::from_str(value) + .map_err(|_| BuildError::MalformedAssetPolicyIdHex)?; + Ok(AssetPolicyId(hash)) + } +} + +impl std::ops::Deref for AssetPolicyId { + type Target = Hash<28>; + + fn deref(&self) -> &Self::Target { + &self.0 + } +} + +impl std::fmt::Display for AssetPolicyId { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{}", hex::encode(self.0)) + } +} + +#[derive(PartialEq, Eq, Debug, Clone, Hash, Serialize, Deserialize)] +pub struct AssetName(Bytes); + +impl AssetName { + pub fn new(name: Bytes) -> Result { + if name.len() > 32 { + panic!("Asset name too long"); + } + + Ok(Self(name)) + } +} + +impl TryFrom> for AssetName { + type Error = BuildError; + + fn try_from(value: Vec) -> Result { + Self::new(value.into()) + } +} + +impl TryFrom<&str> for AssetName { + type Error = BuildError; + + fn try_from(value: &str) -> Result { + Self::new(value.as_bytes().to_vec().into()) + } +} + +impl From for Bytes { + fn from(value: AssetName) -> Self { + value.0 + } +} + +impl std::ops::Deref for AssetName { + type Target = Bytes; + + fn deref(&self) -> &Self::Target { + &self.0 + } +} + +// TODO: Don't want our wrapper types in fields public +#[derive(Serialize, Deserialize, PartialEq, Eq, Debug, Hash, Clone)] +pub struct TxoRef { + pub hash: Hash<32>, + pub index: u64, +} + +impl std::str::FromStr for TxoRef { + type Err = BuildError; + + fn from_str(s: &str) -> Result { + let (hash, index) = s.split_once("#").ok_or(BuildError::MalformedTxoRef)?; + let hash = Hash::from_str(hash).map_err(|_| BuildError::MalformedTxoRef)?; + let index = index.parse().map_err(|_| BuildError::MalformedTxoRef)?; + Ok(TxoRef::new(hash, index)) + } +} + +impl TxoRef { + pub fn new(hash: Hash<32>, index: u64) -> Self { + Self { hash, index } + } +} + +impl dsl::InputExpr for TxoRef { + fn eval(&self, _: &BuildContext) -> Result, BuildError> { + Ok(vec![self.into()]) + } +} + +impl Into for &TxoRef { + fn into(self) -> babbage::TransactionInput { + babbage::TransactionInput { + transaction_id: self.hash.into(), + index: self.index, + } + } +} + +impl InputExpr for UtxoSource { + fn eval(&self, ctx: &BuildContext) -> Result, BuildError> { + let out = self.resolve(ctx)?.refs().map(|i| i.into()).collect(); + + Ok(out) + } +} + +pub trait ValueExpr: 'static + Send + Sync { + fn eval(&self, ctx: &BuildContext) -> Result; + + fn eval_as_mint(&self, ctx: &BuildContext) -> Result { + let value = self.eval(ctx)?; + + match value { + babbage::Value::Multiasset(_, assets) => { + Ok(asset_math::multiasset_coin_to_mint(assets)) + } + babbage::Value::Coin(_) => Err(BuildError::Conflicting), + } + } + + fn eval_as_burn(&self, ctx: &BuildContext) -> Result { + let value = self.eval(ctx)?; + + match value { + babbage::Value::Multiasset(_, assets) => { + Ok(asset_math::multiasset_coin_to_burn(assets)) + } + babbage::Value::Coin(_) => Err(BuildError::Conflicting), + } + } +} + +impl ValueExpr for u64 { + fn eval(&self, _ctx: &BuildContext) -> Result { + Ok(babbage::Value::Coin(*self)) + } +} + +impl ValueExpr for F +where + F: Fn(&BuildContext) -> Result + 'static + Send + Sync, +{ + fn eval(&self, ctx: &BuildContext) -> Result { + self(ctx) + } +} + +impl ValueExpr for Option { + fn eval(&self, ctx: &BuildContext) -> Result { + match self { + Some(v) => v.eval(ctx), + None => Err(BuildError::Incomplete), + } + } +} + +pub struct MinUtxoLovelace; + +impl ValueExpr for MinUtxoLovelace { + fn eval(&self, ctx: &BuildContext) -> Result { + Ok(babbage::Value::Coin(ctx.pparams.min_utxo_value)) + } +} + +impl ValueExpr for Box { + fn eval(&self, ctx: &BuildContext) -> Result { + (**self).eval(ctx) + } +} + +impl ValueExpr for Vec { + fn eval(&self, ctx: &BuildContext) -> Result { + let values = self + .iter() + .map(|v| v.eval(ctx)) + .collect::, _>>()?; + + Ok(asset_math::aggregate_values(values)) + } +} + +pub trait AddressExpr: 'static + Send + Sync { + fn eval(&self, ctx: &BuildContext) -> Result; +} + +impl AddressExpr for Address { + fn eval(&self, _ctx: &BuildContext) -> Result { + Ok(self.clone()) + } +} + +impl AddressExpr for Box { + fn eval(&self, ctx: &BuildContext) -> Result { + (**self).eval(ctx) + } +} + +impl AddressExpr for Option { + fn eval(&self, ctx: &BuildContext) -> Result { + match self { + Some(v) => v.eval(ctx), + None => Err(BuildError::Incomplete), + } + } +} + +impl AddressExpr for F +where + F: Fn(&BuildContext) -> Result + 'static + Send + Sync, +{ + fn eval(&self, ctx: &BuildContext) -> Result { + self(ctx) + } +} + +pub trait OutputExpr: 'static + Send + Sync { + fn eval(&self, ctx: &BuildContext) -> Result; +} + +pub struct ChangeAddress(pub UtxoSource); + +impl AddressExpr for ChangeAddress { + fn eval(&self, ctx: &BuildContext) -> Result { + let utxo_set = &self.0.resolve(ctx)?; + + if utxo_set.is_empty() { + return Err(BuildError::EmptyUtxoSet); + } + + let addresses: HashSet<_> = utxo_set + .txos() + .map(|x| x.address()) + .collect::, _>>() + .map_err(|_| BuildError::UtxoDecode)?; + + if addresses.len() > 1 { + return Err(BuildError::Conflicting); + } + + Ok(addresses.into_iter().next().unwrap()) + } +} + +pub struct TotalLovelaceMinusFee(pub UtxoSource); + +impl ValueExpr for TotalLovelaceMinusFee { + fn eval(&self, ctx: &BuildContext) -> Result { + let utxo_set = &self.0.resolve(ctx)?; + let values = utxo_set.txos().map(|o| o.value().into_alonzo()); + let total = asset_math::aggregate_values(values); + + let fee = ctx.estimated_fee; + let diff = asset_math::value_saturating_add_coin(total, -(fee as i64)); + + Ok(diff) + } +} + +pub struct FeeChangeReturn(pub UtxoSource); + +impl OutputExpr for FeeChangeReturn { + fn eval(&self, ctx: &BuildContext) -> Result { + OutputBuilder::new() + .address(ChangeAddress(self.0.clone())) + .with_value(TotalLovelaceMinusFee(self.0.clone())) + .eval(ctx) + } +} + +pub trait PlutusDataExpr: 'static + Send + Sync { + fn eval(&self, ctx: &BuildContext) -> Result; +} + +impl PlutusDataExpr for babbage::PlutusData { + fn eval(&self, _ctx: &BuildContext) -> Result { + Ok(self.clone()) + } +} + +impl PlutusDataExpr for F +where + F: Fn(&BuildContext) -> Result + 'static + Send + Sync, +{ + fn eval(&self, ctx: &BuildContext) -> Result { + self(ctx) + } +} + +impl PlutusDataExpr for Box { + fn eval(&self, ctx: &BuildContext) -> Result { + (**self).eval(ctx) + } +} + +impl PlutusDataExpr for () { + fn eval(&self, _ctx: &BuildContext) -> Result { + Ok(babbage::PlutusData::Constr(babbage::Constr { + tag: 121, + any_constructor: None, + fields: vec![], + })) + } +} + +pub trait MintExpr: 'static + Send + Sync { + fn eval(&self, ctx: &BuildContext) -> Result; + fn eval_redeemer(&self, ctx: &BuildContext) -> Result; +} + +#[derive(Default)] +pub struct MintBuilder { + pub assets: Vec>, + pub burn: Vec>, + pub redeemer: Option>, +} + +impl MintBuilder { + pub fn new() -> Self { + Self::default() + } + + pub fn with_asset(mut self, asset: impl ValueExpr) -> Self { + self.assets.push(Box::new(asset)); + self + } + + pub fn with_burn(mut self, burn: impl ValueExpr) -> Self { + self.burn.push(Box::new(burn)); + self + } + + pub fn using_redeemer(mut self, redeemer: impl PlutusDataExpr) -> Self { + self.redeemer = Some(Box::new(redeemer)); + self + } +} + +impl MintExpr for MintBuilder { + fn eval(&self, ctx: &BuildContext) -> Result { + let out = HashMap::new(); + + let out = self.assets.iter().try_fold(out, |mut acc, v| { + let v = v.eval_as_mint(ctx)?; + asset_math::fold_multiassets(&mut acc, v); + Ok(acc) + })?; + + let out = self.burn.iter().try_fold(out, |mut acc, v| { + let v = v.eval_as_burn(ctx)?; + asset_math::fold_multiassets(&mut acc, v); + Ok(acc) + })?; + + let mint: HashMap<_, _> = out + .into_iter() + .map(|(policy, assets)| (policy, KeyValuePairs::from(assets))) + .collect(); + + Ok(KeyValuePairs::from(mint)) + } + + fn eval_redeemer(&self, ctx: &BuildContext) -> Result { + let mint = self.eval(ctx)?; + + if mint.is_empty() { + return Err(BuildError::Incomplete); + } + + if mint.len() > 1 { + return Err(BuildError::Conflicting); + } + + let (policy, _) = mint.iter().next().unwrap(); + + let data = self + .redeemer + .as_ref() + .ok_or(BuildError::Incomplete)? + .eval(ctx)?; + + let out = babbage::Redeemer { + tag: babbage::RedeemerTag::Mint, + index: ctx.mint_redeemer_index(*policy)?, + ex_units: ctx.eval_ex_units(*policy, &data), + data, + }; + + Ok(out) + } +} + +#[derive(Default)] +pub struct OutputBuilder { + pub address: Option>, + pub values: Vec>, + // TODO: inline / hash datum + // TODO: script +} + +impl OutputBuilder { + pub fn new() -> Self { + Self::default() + } + + pub fn address(mut self, address: impl AddressExpr + 'static) -> Self { + self.address = Some(Box::new(address)); + self + } + + pub fn with_value(mut self, value: impl ValueExpr + 'static) -> Self { + self.values.push(Box::new(value)); + self + } +} + +impl OutputExpr for OutputBuilder { + fn eval(&self, ctx: &BuildContext) -> Result { + Ok(babbage::TransactionOutput::PostAlonzo( + babbage::PostAlonzoTransactionOutput { + address: self.address.eval(ctx)?.to_vec().into(), + value: self.values.eval(ctx)?, + datum_option: None, // TODO + script_ref: None, // TODO + }, + )) + } +} + +pub trait TxExpr: 'static + Send + Sync { + fn eval_body(&self, ctx: &BuildContext) -> Result; + fn eval_witness_set(&self, ctx: &BuildContext) -> Result; +} + +impl TxExpr for &'static T { + fn eval_body(&self, ctx: &BuildContext) -> Result { + (**self).eval_body(ctx) + } + + fn eval_witness_set(&self, ctx: &BuildContext) -> Result { + (**self).eval_witness_set(ctx) + } +} + +impl TxExpr for Box { + fn eval_body(&self, ctx: &BuildContext) -> Result { + (**self).eval_body(ctx) + } + + fn eval_witness_set(&self, ctx: &BuildContext) -> Result { + (**self).eval_witness_set(ctx) + } +} + +#[derive(Default)] +pub struct TxBuilder { + pub reference_inputs: Vec>, + pub inputs: Vec>, + pub outputs: Vec>, + // pub outputs: Option>, + // pub fee: Option, + pub mint: Vec>, + // pub valid_from_slot: Option, + // pub invalid_from_slot: Option, + // pub network_id: Option, + // pub collateral_inputs: Option>, + // pub collateral_output: Option, + // pub disclosed_signers: Option>, + // pub scripts: Option>, + // pub datums: Option>, + // pub redeemers: Option, + // pub script_data_hash: Option, + // pub signature_amount_override: Option, + // #[serde_as(as = "Option")] + // pub change_address: Option
, + // pub certificates: TODO + // pub withdrawals: TODO + // pub updates: TODO + // pub auxiliary_data: TODO + // pub phase_2_valid: TODO +} + +impl TxBuilder { + pub fn new() -> Self { + Self::default() + } + + pub fn with_reference_input(mut self, input: impl InputExpr) -> Self { + self.reference_inputs.push(Box::new(input)); + self + } + + pub fn with_input(mut self, input: impl InputExpr) -> Self { + self.inputs.push(Box::new(input)); + self + } + + pub fn with_output(mut self, output: impl OutputExpr) -> Self { + self.outputs.push(Box::new(output)); + self + } + + pub fn with_mint(mut self, mint: impl MintExpr) -> Self { + self.mint.push(Box::new(mint)); + self + } +} + +impl TxExpr for TxBuilder { + fn eval_body(&self, ctx: &BuildContext) -> Result { + let out = babbage::TransactionBody { + inputs: self + .inputs + .iter() + .map(|i| i.eval(ctx)) + .collect::, _>>()? + .into_iter() + .flatten() + .collect(), + outputs: self + .outputs + .iter() + .map(|o| o.eval(ctx)) + .collect::, _>>()?, + fee: ctx.estimated_fee, + ttl: None, + validity_interval_start: None, + certificates: None, + withdrawals: None, + update: None, + auxiliary_data_hash: None, + mint: { + let mints = self + .mint + .iter() + .map(|m| m.eval(ctx)) + .collect::, _>>()?; + + if mints.is_empty() { + None + } else { + Some(asset_math::aggregate_assets(mints)) + } + }, + script_data_hash: None, + collateral: None, + required_signers: None, + network_id: None, + collateral_return: None, + total_collateral: None, + reference_inputs: { + let refs: Vec<_> = self + .reference_inputs + .iter() + .map(|i| i.eval(ctx)) + .collect::, _>>()? + .into_iter() + .flatten() + .collect(); + + if refs.is_empty() { + None + } else { + Some(refs) + } + }, + }; + + Ok(out) + } + + fn eval_witness_set(&self, ctx: &BuildContext) -> Result { + let out = babbage::WitnessSet { + redeemer: { + let redeemers = self + .mint + .iter() + .map(|m| m.eval_redeemer(ctx)) + .collect::, _>>()?; + + if redeemers.is_empty() { + None + } else { + Some(redeemers) + } + }, + vkeywitness: None, + native_script: None, + bootstrap_witness: None, + plutus_v1_script: None, + plutus_data: None, + plutus_v2_script: None, + }; + + Ok(out) + } +} + +#[macro_export] +macro_rules! define_asset_class { + ($struct_name:ident, $policy:expr) => { + #[derive(Debug, Clone, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize)] + pub struct $struct_name($crate::txbuilder::Bytes, i64); + + impl $struct_name { + pub fn value(name: $crate::txbuilder::AssetName, quantity: u64) -> Self { + Self(name.into(), quantity as i64) + } + } + + impl $crate::txbuilder::ValueExpr for $struct_name { + fn eval( + &self, + _: &$crate::txbuilder::BuildContext, + ) -> std::result::Result<$crate::txbuilder::Value, $crate::txbuilder::BuildError> { + let policy = $crate::txbuilder::Hash::from(*$policy); + let name = $crate::txbuilder::Bytes::from(self.0.clone()); + let asset = $crate::txbuilder::KeyValuePairs::from(vec![(name, self.1 as u64)]); + let val = $crate::txbuilder::Value::Multiasset( + 0, + $crate::txbuilder::KeyValuePairs::from(vec![(policy, asset)]), + ); + + Ok(val) + } + } + }; +} + +define_asset_class!(MyAssetClass, b"abcabcababcabcababcabcababca"); diff --git a/balius-sdk/src/txbuilder/mod.rs b/balius-sdk/src/txbuilder/mod.rs new file mode 100644 index 0000000..4103308 --- /dev/null +++ b/balius-sdk/src/txbuilder/mod.rs @@ -0,0 +1,42 @@ +pub(crate) mod asset_math; + +#[derive(Debug, thiserror::Error)] +pub enum BuildError { + #[error("Builder is incomplete")] + Incomplete, + #[error("Conflicting requirement")] + Conflicting, + #[error("UTxO decoding failed")] + UtxoDecode, + #[error("UTxO set is empty")] + EmptyUtxoSet, + #[error("Transaction has no inputs")] + MalformedScript, + #[error("Could not decode datum bytes")] + MalformedDatum, + #[error("Invalid bytes length for datum hash")] + MalformedDatumHash, + #[error("Input/policy pointed to by redeemer not found in tx")] + RedeemerTargetMissing, + #[error("Invalid network ID")] + InvalidNetworkId, + #[error("Corrupted transaction bytes in built transaction")] + CorruptedTxBytes, + #[error("Public key for private key is malformed")] + MalformedKey, + #[error("Asset name must be 32 bytes or less")] + AssetNameTooLong, + #[error("Invalid asset policy id hex")] + MalformedAssetPolicyIdHex, + #[error("Malformed TxoRef")] + MalformedTxoRef, +} + +pub use pallas_codec as codec; +pub use pallas_primitives::babbage as primitives; + +mod build; +mod dsl; + +pub use build::*; +pub use dsl::*; diff --git a/balius/Cargo.toml b/balius/Cargo.toml index 9e80e24..7751cbf 100644 --- a/balius/Cargo.toml +++ b/balius/Cargo.toml @@ -5,7 +5,7 @@ edition = "2021" description = "SDK for building Headless dApps on UTxO-based blockchains" authors = ["TxPipe "] -license = "MIT OR Apache-2.0" +license = "Apache-2.0" repository = "https://github.com/txpipe/balius" documentation = "https://docs.rs/balius" readme = "README.md" @@ -14,6 +14,3 @@ keywords = ["blockchain", "dapp", "sdk", "utxo", "cardano"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -serde = "1.0.204" -serde_json = "1.0.122" -wit-bindgen = "0.29.0" diff --git a/balius/src/lib.rs b/balius/src/lib.rs index 7f46a54..8b13789 100644 --- a/balius/src/lib.rs +++ b/balius/src/lib.rs @@ -1,204 +1 @@ -pub mod bindings { - wit_bindgen::generate!({ - pub_export_macro: true, - default_bindings_module: "balius::bindings", - }); -} -//mod macros; -mod qol; - -pub use qol::*; - -use bindings::balius::odk; -use serde::Serialize; -use std::{ - collections::HashMap, - ops::Deref, - sync::{LazyLock, RwLock}, -}; - -pub trait Handler: Send + Sync { - fn handle( - &self, - config: odk::driver::Cbor, - evt: odk::driver::Event, - ) -> std::result::Result; -} - -// Add the IntoHandler trait definition -pub trait IntoHandler { - fn into_handler(self) -> Box; -} - -macro_rules! define_fn_handler { - ($id:ident, $($P:ident),*) => { - pub struct $id { - f: F, - _phantom: std::marker::PhantomData<(C, $($P,)* O)>, - } - - impl $id { - pub fn new(f: F) -> Self { - Self { - f, - _phantom: std::marker::PhantomData, - } - } - } - - impl Handler for $id - where - F: Fn(C, $($P,)*) -> Result + Send + Sync, - C: From + Send + Sync, - $($P: From + Send + Sync,)* - O: Into + Send + Sync, - { - fn handle( - &self, - env: bindings::Env, - evt: odk::driver::Event, - ) -> std::result::Result { - #[allow(unused_parens)] - let output = (self.f)(C::from(env), $($P::from(evt.clone()),)*)?; - Ok(output.into()) - } - } - - - }; -} - -// Use the macro to define FnHandler for different arities -define_fn_handler!(FnHandler, P1); -define_fn_handler!(FnHandler2, P1, P2); -define_fn_handler!(FnHandler3, P1, P2, P3); -define_fn_handler!(FnHandler4, P1, P2, P3, P4); - -pub struct Json(pub T); - -impl Deref for Json { - type Target = T; - - fn deref(&self) -> &Self::Target { - &self.0 - } -} - -impl From for Json -where - T: serde::de::DeserializeOwned, -{ - fn from(value: odk::driver::Event) -> Self { - let bytes = match value { - odk::driver::Event::Request(x) => x, - _ => todo!(), - }; - - let t = serde_json::from_slice(bytes.as_slice()).unwrap(); - Json(t) - } -} - -impl From> for odk::driver::Response -where - T: Serialize, -{ - fn from(value: Json) -> Self { - Self::Json(serde_json::to_vec(&value.0).unwrap()) - } -} - -struct Channel { - handler: Box, - pattern: odk::driver::EventPattern, -} - -type ChannelId = u32; -type ChannelRegistry = HashMap; - -static WORKER: LazyLock> = LazyLock::new(|| RwLock::new(Worker::new())); - -#[derive(Default)] -pub struct Worker { - channels: ChannelRegistry, - env: Option, -} - -impl Worker { - pub fn new() -> Self { - Self::default() - } - - pub(crate) fn init(mut self, env: bindings::Env) -> Self { - self.env = Some(env); - - self - } - - pub fn handle_request(mut self, method: &str, handler: F) -> Self - where - F: Fn(Env, P) -> qol::Result + Send + Sync + 'static, - Env: From + Send + Sync + 'static, - P: From + Send + Sync + 'static, - O: Into + Send + Sync + 'static, - { - let handler = FnHandler::new(handler); - - self.channels.insert( - self.channels.len() as u32, - Channel { - handler: Box::new(handler), - pattern: odk::driver::EventPattern::Request(method.to_owned()), - }, - ); - - self - } -} - -pub trait Main { - fn main() -> Worker; -} - -impl self::bindings::Guest for T { - fn handle( - id: u32, - evt: odk::driver::Event, - ) -> std::result::Result { - let worker = WORKER.read().unwrap(); - let channel = worker.channels.get(&id).ok_or(1u32)?; - let env = match &worker.env { - Some(e) => e.clone(), - None => return Err(0), - }; - - channel.handler.handle(env, evt) - } - - fn init(env: bindings::Env) { - let worker = Self::main().init(env); - - let mut singelton = WORKER.write().unwrap(); - *singelton = worker; - - for (id, handler) in singelton.channels.iter() { - odk::driver::register_channel(*id, &handler.pattern); - } - } -} - -#[macro_export] -macro_rules! entrypoint { - ($main:ident) => { - struct _Main; - - impl balius::Main for _Main { - fn main() -> balius::Worker { - $main() - } - } - - balius::bindings::export!(_Main); - }; -} diff --git a/balius/src/macros.rs b/balius/src/macros.rs deleted file mode 100644 index 9443910..0000000 --- a/balius/src/macros.rs +++ /dev/null @@ -1,35 +0,0 @@ -pub trait Handler: Send + Sync { - fn handle( - &self, - evt: crate::balius::odk::driver::Event, - ) -> Result; -} - -struct State {} - -impl From for State { - fn from(evt: crate::balius::odk::driver::Event) -> Self { - State {} - } -} - -use paste::paste; - -#[macro_export] -macro_rules! handler_wrapper { - ($func:ident) => { - paste! { - struct [<$func Handler>]; - - impl Handler for [<$func Handler>] { - fn handle( - &self, - evt: crate::balius::odk::driver::Event, - ) -> Result { - let state = State::from(evt); - $func(state).map(|result_state| crate::balius::odk::driver::Response::from(result_state)) - } - } - } - }; -} diff --git a/balius/src/qol.rs b/balius/src/qol.rs deleted file mode 100644 index a3facb7..0000000 --- a/balius/src/qol.rs +++ /dev/null @@ -1,49 +0,0 @@ -use std::ops::Deref; - -use serde::{de::DeserializeOwned, Deserialize, Serialize}; - -#[derive(Serialize, Deserialize)] -pub struct UtxoSource; - -#[derive(Serialize, Deserialize)] -pub struct UnsignedTx(pub Vec); - -impl Into for UnsignedTx { - fn into(self) -> crate::bindings::Response { - crate::bindings::Response::PartialTx(self.0) - } -} - -#[derive(Debug)] -pub enum Error { - Internal(String), -} - -impl From for crate::bindings::balius::odk::driver::HandleError { - fn from(error: Error) -> Self { - match error { - Error::Internal(_) => 0, - } - } -} - -pub type Result = std::result::Result; - -pub struct Env(pub T); - -impl Deref for Env { - type Target = T; - - fn deref(&self) -> &Self::Target { - &self.0 - } -} - -impl From for Env -where - T: DeserializeOwned, -{ - fn from(value: crate::bindings::Env) -> Self { - Env(serde_json::from_slice(&value).unwrap()) - } -} diff --git a/examples/basic/Cargo.toml b/examples/basic/Cargo.toml index fe8600c..badbfd0 100644 --- a/examples/basic/Cargo.toml +++ b/examples/basic/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -balius = { path = "../../balius" } +balius-sdk = { path = "../../balius-sdk" } pallas-primitives = "0.30.0" serde = { version = "1.0.204", features = ["derive"] } diff --git a/examples/basic/src/lib.rs b/examples/basic/src/lib.rs index 3277f09..d392fbf 100644 --- a/examples/basic/src/lib.rs +++ b/examples/basic/src/lib.rs @@ -1,30 +1,14 @@ -// fn track_utxo(utxo: Utxo) -> Result<()> { -// bindings::balius::odk::kv::set_value("balance", -// &handler.as_bytes().to_vec()).unwrap(); - -// Ok(()) -// } - -// fn clear_utxo(utxo: Utxo, state: Saved) -> Result<()> { -// let state = state.get_mut(); - -// state.lovelace_balance -= utxo.value.lovelace; - -// Ok(()) -// } - -// fn read_state(state: Saved) -> Result { -// let state = state.get(); - -// Ok(state) -// } - -use balius::{bindings::balius::odk::driver::Event, Env, Json, Result}; +use balius_sdk::{Config, FnHandler, Json, Params, WorkerResult}; use serde::{Deserialize, Serialize}; #[derive(Serialize, Deserialize)] -struct Param { +struct MyConfig { + address: String, +} + +#[derive(Serialize, Deserialize)] +struct Request { my_name: String, } @@ -33,13 +17,13 @@ struct Reply { message: String, } -fn say_hello(_: Env<()>, param: Json) -> Result> { +fn say_hello(_: Config, request: Params) -> WorkerResult> { Ok(Json(Reply { - message: format!("Hello, {}!", param.0.my_name), + message: format!("Hello, {}!", request.0.my_name), })) } -fn read_state(_: Env<()>, _: Event) -> Result> { +fn read_state(_: Config, _: Params<()>) -> WorkerResult> { Ok(Json(State { lovelace_balance: 3, })) @@ -50,19 +34,12 @@ struct State { lovelace_balance: u64, } -#[derive(Default)] -struct Config { - address: String, -} - -//#[balius::main] -fn main() -> balius::Worker { - balius::Worker::new() +#[balius_sdk::main] +fn main() -> balius_sdk::Worker { + balius_sdk::Worker::new() //.watch_utxo(with_address(config.address), track_utxo) //.watch_utxo_spent(with_address(config.address), clear_utxo) //.watch_utxo_undo(with_address(config.address), clear_utxo) - .handle_request("read-state", read_state) - .handle_request("say-hello", say_hello) + .with_request_handler("read-state", FnHandler::from(read_state)) + .with_request_handler("say-hello", FnHandler::from(say_hello)) } - -balius::entrypoint!(main); diff --git a/examples/minter/offchain/Cargo.toml b/examples/minter/offchain/Cargo.toml index d184c34..d1bd3f4 100644 --- a/examples/minter/offchain/Cargo.toml +++ b/examples/minter/offchain/Cargo.toml @@ -4,9 +4,7 @@ version = "0.1.0" edition = "2021" [dependencies] -balius = { path = "../../../balius" } -pallas-primitives = { path = "../../../../pallas/pallas-primitives" } -pallas-txbuilder = { path = "../../../../pallas/pallas-txbuilder" } +balius-sdk = { path = "../../../balius-sdk" } serde = { version = "1.0.204", features = ["derive"] } serde_with = "3.9.0" @@ -16,3 +14,6 @@ crate-type = ["cdylib"] [dev-dependencies] hex = "0.4.3" serde_json = "1.0.128" +pallas-traverse = { path = "../../../../pallas/pallas-traverse" } +pallas-codec = "0.30.2" +pallas-primitives = "0.30.2" diff --git a/examples/minter/offchain/src/lib.rs b/examples/minter/offchain/src/lib.rs index b0ab3e0..ddd8cdb 100644 --- a/examples/minter/offchain/src/lib.rs +++ b/examples/minter/offchain/src/lib.rs @@ -1,77 +1,87 @@ -use balius::*; -use pallas_primitives::conway::{Constr, PlutusData}; -use pallas_txbuilder::{Address, AssetName, BuildBabbage, ExUnits, ReferenceScript}; +use balius_sdk::{txbuilder::{ + Address, AssetName, FeeChangeReturn, MinUtxoLovelace, MintBuilder, OutputBuilder, ReferenceScript, TxBuilder, UtxoSource +}, NewTx, WorkerResult}; +use balius_sdk::{FnHandler, Worker, Config, Params}; use serde::{Deserialize, Serialize}; use serde_with::{serde_as, DisplayFromStr}; + #[derive(Serialize, Deserialize, Clone)] -struct Config { - free_validator: ReferenceScript, +struct FaucetConfig { + validator: ReferenceScript, } #[serde_as] #[derive(Serialize, Deserialize)] -struct FreeMintRequest { +struct ClaimRequest { token: AssetName, quantity: u64, #[serde_as(as = "DisplayFromStr")] recipient: Address, - //fuel: UtxoSource, + fuel: UtxoSource, } -fn free_mint(config: Env, params: Json) -> Result { - let tx = pallas_txbuilder::StagingTransaction::new() - .reference_input(config.free_validator.clone()) - .mint_asset( - config.free_validator.clone(), - params.token.clone(), - params.quantity as i64, +balius_sdk::define_asset_class!(FaucetAsset, b"abcabcababcabcababcabcababca"); + +fn claim(config: Config, params: Params) -> WorkerResult { + let new_asset = FaucetAsset::value(params.token.clone(), params.quantity); + + let tx = TxBuilder::new() + .with_reference_input(config.validator.clone()) + .with_input(params.fuel.clone()) + .with_mint( + MintBuilder::new() + .with_asset(new_asset.clone()) + .using_redeemer(()), ) - .output( - pallas_txbuilder::OutputBuilder::new() - .to_address(params.recipient.clone()) - .with_asset( - config.free_validator.clone(), - params.token.clone(), - params.quantity, - ) - .with_min_lovelace() - .build() - .unwrap(), + .with_output( + OutputBuilder::new() + .address(params.recipient.clone()) + .with_value(MinUtxoLovelace) + .with_value(new_asset.clone()), ) - .add_mint_redeemer( - config.free_validator.clone(), - (), - Some(ExUnits { mem: 0, steps: 0 }), - ); + .with_output(FeeChangeReturn(params.fuel.clone())); - let tx = tx.build_babbage_raw().unwrap(); - - Ok(UnsignedTx(tx.tx_bytes.as_ref().to_vec())) + Ok(NewTx(Box::new(tx))) } -//#[balius::main] -fn main() -> balius::Worker { - balius::Worker::new().handle_request("free-mint", free_mint) +#[balius_sdk::main] +fn main() -> Worker { + Worker::new().with_request_handler("claim", FnHandler::from(claim)) } -balius::entrypoint!(main); - #[cfg(test)] mod tests { use super::*; - use pallas_txbuilder::{Address, Hash, TxoRef}; - use std::str::FromStr as _; + + use balius_sdk::txbuilder::{Address, Hash, UtxoSet, primitives}; + + use std::{collections::HashMap, str::FromStr as _}; #[test] fn test_free_mint() { - let config = Config { - free_validator: ReferenceScript { + let output = primitives::MintedTransactionOutput::PostAlonzo(primitives::MintedPostAlonzoTransactionOutput { + address: Address::from_bech32("addr1qx2fxv2umyhttkxyxp8x0dlpdt3k6cwng5pxj3jhsydzer3n0d3vllmyqwsx5wktcd8cc3sq835lu7drv2xwl2wywfgse35a3x").unwrap().to_vec().into(), + value: primitives::Value::Coin(5_000_000), + datum_option: None, + script_ref: None, + }); + + let cbor = pallas_codec::minicbor::to_vec(&output).unwrap(); + + let test_utxos: HashMap<_, _> = vec![ + ("f7d3837715680f3a170e99cd202b726842d97f82c05af8fcd18053c64e33ec4f#0".parse().unwrap(), cbor), + ].into_iter().collect(); + + let ledger = UtxoSet::from(test_utxos); + + let config = FaucetConfig { + validator: ReferenceScript { hash: Hash::from_str("ef7a1cebb2dc7de884ddf82f8fcbc91fe9750dcd8c12ec7643a99bbe").unwrap(), address: Address::from_bech32("addr1qx2fxv2umyhttkxyxp8x0dlpdt3k6cwng5pxj3jhsydzer3n0d3vllmyqwsx5wktcd8cc3sq835lu7drv2xwl2wywfgse35a3x").unwrap(), - ref_txo: TxoRef { - hash: Hash::from_str( + ref_txo: primitives::TransactionInput { + transaction_id: Hash::from_str( "f7d3837715680f3a170e99cd202b726842d97f82c05af8fcd18053c64e33ec4f", ) .unwrap(), @@ -80,12 +90,18 @@ mod tests { }, }; - let request = FreeMintRequest { - token: AssetName::new("TEST".as_bytes().to_vec()).unwrap(), + let request = ClaimRequest { + token: AssetName::new(b"TEST".to_vec().into()).unwrap(), quantity: 1, recipient: Address::from_bech32("addr1qx2fxv2umyhttkxyxp8x0dlpdt3k6cwng5pxj3jhsydzer3n0d3vllmyqwsx5wktcd8cc3sq835lu7drv2xwl2wywfgse35a3x").unwrap(), + fuel: UtxoSource::Refs(vec!["f7d3837715680f3a170e99cd202b726842d97f82c05af8fcd18053c64e33ec4f#0".parse().unwrap()]), }; - free_mint(Env(config), Json(request)).unwrap(); + let tx = claim(Config(config), Params(request)).unwrap(); + + let tx = balius_sdk::txbuilder::build(tx, ledger).unwrap(); + + dbg!(&tx); + dbg!(hex::encode(pallas_codec::minicbor::to_vec(&tx).unwrap())); } } diff --git a/balius/wit/balius.wit b/wit/balius.wit similarity index 98% rename from balius/wit/balius.wit rename to wit/balius.wit index f274cf2..bd1d812 100644 --- a/balius/wit/balius.wit +++ b/wit/balius.wit @@ -1,4 +1,4 @@ -package balius:odk; +package balius:app@0.1.0; interface kv { type payload = list;