chore: bump bdk version to alpha 9
This commit is contained in:
parent
cacb78f4dc
commit
f1744d192f
444
bdk-ffi/Cargo.lock
generated
444
bdk-ffi/Cargo.lock
generated
@ -2,12 +2,6 @@
|
||||
# It is not intended for manual editing.
|
||||
version = 3
|
||||
|
||||
[[package]]
|
||||
name = "adler"
|
||||
version = "1.0.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
|
||||
|
||||
[[package]]
|
||||
name = "anstream"
|
||||
version = "0.6.11"
|
||||
@ -43,7 +37,7 @@ version = "1.0.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648"
|
||||
dependencies = [
|
||||
"windows-sys 0.52.0",
|
||||
"windows-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -53,7 +47,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7"
|
||||
dependencies = [
|
||||
"anstyle",
|
||||
"windows-sys 0.52.0",
|
||||
"windows-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -62,6 +56,12 @@ version = "1.0.79"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca"
|
||||
|
||||
[[package]]
|
||||
name = "arrayvec"
|
||||
version = "0.7.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711"
|
||||
|
||||
[[package]]
|
||||
name = "askama"
|
||||
version = "0.12.1"
|
||||
@ -117,9 +117,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
|
||||
|
||||
[[package]]
|
||||
name = "base64"
|
||||
version = "0.13.1"
|
||||
version = "0.12.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8"
|
||||
checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff"
|
||||
|
||||
[[package]]
|
||||
name = "base64"
|
||||
@ -138,9 +138,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "bdk"
|
||||
version = "1.0.0-alpha.8"
|
||||
version = "1.0.0-alpha.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "06494244111d4f934f40f2a46883bcec3ea5d573fe30d310623e08a27adac849"
|
||||
checksum = "8ffe2761cc729d09bcaf88fe6e283ff5b5af0398c0eee855469295b59d6c6a9d"
|
||||
dependencies = [
|
||||
"bdk_chain",
|
||||
"bip39",
|
||||
@ -155,22 +155,22 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "bdk-ffi"
|
||||
version = "1.0.0-alpha.8"
|
||||
version = "1.0.0-alpha.9"
|
||||
dependencies = [
|
||||
"assert_matches",
|
||||
"bdk",
|
||||
"bdk_esplora",
|
||||
"bdk_file_store",
|
||||
"bitcoin-internals 0.2.0",
|
||||
"bitcoin-internals",
|
||||
"thiserror",
|
||||
"uniffi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bdk_chain"
|
||||
version = "0.11.0"
|
||||
version = "0.12.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "671bc4c278604f704987f649c20bd95b0c9bddf1880c75b2f9f12ad14979cd02"
|
||||
checksum = "4cd4e915470c6bb196a4c2515c6db3190dcdec482255d8f1022068646641cc8f"
|
||||
dependencies = [
|
||||
"bitcoin",
|
||||
"miniscript",
|
||||
@ -179,9 +179,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "bdk_esplora"
|
||||
version = "0.10.0"
|
||||
version = "0.11.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9abd2ce171d0a10c44b847c0e4aaf2e6eb81d7b3f5ac8bde4e0e0b77edfc313f"
|
||||
checksum = "d7b5358eb90cbf99f7725ec5b1786e25a869cacba555f74f70cc4bf453921c34"
|
||||
dependencies = [
|
||||
"bdk_chain",
|
||||
"esplora-client",
|
||||
@ -189,9 +189,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "bdk_file_store"
|
||||
version = "0.8.0"
|
||||
version = "0.9.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "403e8a1b6671585d1d5466cd5414e51d9f38c9079137ab79d4b83b56b21b03ac"
|
||||
checksum = "0c19806b6b4e898e351e0bc2d8bd4cb96f7d8e2730c8b277e9e889c72dfb32de"
|
||||
dependencies = [
|
||||
"bdk_chain",
|
||||
"bincode",
|
||||
@ -200,9 +200,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "bech32"
|
||||
version = "0.9.1"
|
||||
version = "0.10.0-beta"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d86b93f97252c47b41663388e6d155714a9d0c398b99f1005cbc5f978b29f445"
|
||||
checksum = "98f7eed2b2781a6f0b5c903471d48e15f56fb4e1165df8a9a2337fd1a59d45ea"
|
||||
|
||||
[[package]]
|
||||
name = "bincode"
|
||||
@ -226,36 +226,28 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "bitcoin"
|
||||
version = "0.30.2"
|
||||
version = "0.31.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1945a5048598e4189e239d3f809b19bdad4845c4b2ba400d304d2dcf26d2c462"
|
||||
checksum = "6c85783c2fe40083ea54a33aa2f0ba58831d90fcd190f5bdc47e74e84d2a96ae"
|
||||
dependencies = [
|
||||
"base64 0.13.1",
|
||||
"base64 0.21.7",
|
||||
"bech32",
|
||||
"bitcoin-private",
|
||||
"bitcoin_hashes 0.12.0",
|
||||
"bitcoin-internals",
|
||||
"bitcoin_hashes 0.13.0",
|
||||
"hex-conservative 0.1.1",
|
||||
"hex_lit",
|
||||
"secp256k1",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bitcoin-internals"
|
||||
version = "0.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1f9997f8650dd818369931b5672a18dbef95324d0513aa99aae758de8ce86e5b"
|
||||
|
||||
[[package]]
|
||||
name = "bitcoin-internals"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9425c3bf7089c983facbae04de54513cce73b41c7f9ff8c845b54e7bc64ebbfb"
|
||||
|
||||
[[package]]
|
||||
name = "bitcoin-private"
|
||||
version = "0.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "73290177011694f38ec25e165d0387ab7ea749a4b81cd4c80dae5988229f7a57"
|
||||
dependencies = [
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bitcoin_hashes"
|
||||
@ -265,11 +257,12 @@ checksum = "90064b8dee6815a6470d60bad07bbbaee885c0e12d04177138fa3291a01b7bc4"
|
||||
|
||||
[[package]]
|
||||
name = "bitcoin_hashes"
|
||||
version = "0.12.0"
|
||||
version = "0.13.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5d7066118b13d4b20b23645932dfb3a81ce7e29f95726c2036fa33cd7b092501"
|
||||
checksum = "1930a4dabfebb8d7d9992db18ebe3ae2876f0a305fab206fd168df931ede293b"
|
||||
dependencies = [
|
||||
"bitcoin-private",
|
||||
"bitcoin-internals",
|
||||
"hex-conservative 0.1.1",
|
||||
"serde",
|
||||
]
|
||||
|
||||
@ -279,12 +272,6 @@ version = "3.14.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec"
|
||||
|
||||
[[package]]
|
||||
name = "byteorder"
|
||||
version = "1.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
|
||||
|
||||
[[package]]
|
||||
name = "bytes"
|
||||
version = "1.5.0"
|
||||
@ -384,51 +371,17 @@ version = "1.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7"
|
||||
|
||||
[[package]]
|
||||
name = "crc32fast"
|
||||
version = "1.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "esplora-client"
|
||||
version = "0.6.0"
|
||||
version = "0.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0cb1f7f2489cce83bc3bd92784f9ba5271eeb6e729b975895fc541f78cbfcdca"
|
||||
checksum = "a73e879128c5fcb38abaf0ec53e3310947c6e7b61ce0f1b4cd7a0b8ea1ab0389"
|
||||
dependencies = [
|
||||
"bitcoin",
|
||||
"bitcoin-internals 0.1.0",
|
||||
"hex-conservative 0.2.0",
|
||||
"log",
|
||||
"minreq",
|
||||
"serde",
|
||||
"ureq",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fastrand"
|
||||
version = "2.0.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5"
|
||||
|
||||
[[package]]
|
||||
name = "flate2"
|
||||
version = "1.0.28"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e"
|
||||
dependencies = [
|
||||
"crc32fast",
|
||||
"miniz_oxide",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "form_urlencoded"
|
||||
version = "1.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456"
|
||||
dependencies = [
|
||||
"percent-encoding",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -474,51 +427,27 @@ version = "0.4.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8"
|
||||
|
||||
[[package]]
|
||||
name = "hex-conservative"
|
||||
version = "0.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "30ed443af458ccb6d81c1e7e661545f94d3176752fb1df2f543b902a1e0f51e2"
|
||||
|
||||
[[package]]
|
||||
name = "hex-conservative"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e1aa273bf451e37ed35ced41c71a5e2a4e29064afb104158f2514bcd71c2c986"
|
||||
dependencies = [
|
||||
"arrayvec",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "hex_lit"
|
||||
version = "0.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3011d1213f159867b13cfd6ac92d2cd5f1345762c63be3554e84092d85a50bbd"
|
||||
|
||||
[[package]]
|
||||
name = "hoot"
|
||||
version = "0.1.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "df22a4d90f1b0e65fe3e0d6ee6a4608cc4d81f4b2eb3e670f44bb6bde711e452"
|
||||
dependencies = [
|
||||
"httparse",
|
||||
"log",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "hootbin"
|
||||
version = "0.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "354e60868e49ea1a39c44b9562ad207c4259dc6eabf9863bf3b0f058c55cfdb2"
|
||||
dependencies = [
|
||||
"fastrand",
|
||||
"hoot",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"thiserror",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "httparse"
|
||||
version = "1.8.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904"
|
||||
|
||||
[[package]]
|
||||
name = "idna"
|
||||
version = "0.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6"
|
||||
dependencies = [
|
||||
"unicode-bidi",
|
||||
"unicode-normalization",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "itoa"
|
||||
version = "1.0.10"
|
||||
@ -576,22 +505,26 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
|
||||
|
||||
[[package]]
|
||||
name = "miniscript"
|
||||
version = "10.0.0"
|
||||
version = "11.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1eb102b66b2127a872dbcc73095b7b47aeb9d92f7b03c2b2298253ffc82c7594"
|
||||
checksum = "86a23dd3ad145a980e231185d114399f25a0a307d2cd918010ddda6334323df9"
|
||||
dependencies = [
|
||||
"bech32",
|
||||
"bitcoin",
|
||||
"bitcoin-private",
|
||||
"bitcoin-internals",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "miniz_oxide"
|
||||
version = "0.7.1"
|
||||
name = "minreq"
|
||||
version = "2.11.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7"
|
||||
checksum = "00a000cf8bbbfb123a9bdc66b61c2885a4bb038df4f2629884caafabeb76b0f9"
|
||||
dependencies = [
|
||||
"adler",
|
||||
"base64 0.12.3",
|
||||
"log",
|
||||
"serde",
|
||||
"serde_json",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -622,12 +555,6 @@ version = "1.0.14"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c"
|
||||
|
||||
[[package]]
|
||||
name = "percent-encoding"
|
||||
version = "2.3.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e"
|
||||
|
||||
[[package]]
|
||||
name = "plain"
|
||||
version = "0.2.3"
|
||||
@ -688,51 +615,6 @@ dependencies = [
|
||||
"getrandom",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ring"
|
||||
version = "0.17.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74"
|
||||
dependencies = [
|
||||
"cc",
|
||||
"getrandom",
|
||||
"libc",
|
||||
"spin",
|
||||
"untrusted",
|
||||
"windows-sys 0.48.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustls"
|
||||
version = "0.22.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e87c9956bd9807afa1f77e0f7594af32566e830e088a5576d27c5b6f30f49d41"
|
||||
dependencies = [
|
||||
"log",
|
||||
"ring",
|
||||
"rustls-pki-types",
|
||||
"rustls-webpki",
|
||||
"subtle",
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustls-pki-types"
|
||||
version = "1.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9e9d979b3ce68192e42760c7810125eb6cf2ea10efae545a156063e61f314e2a"
|
||||
|
||||
[[package]]
|
||||
name = "rustls-webpki"
|
||||
version = "0.102.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ef4ca26037c909dedb327b48c3327d0ba91d3dd3c4e05dad328f210ffb68e95b"
|
||||
dependencies = [
|
||||
"ring",
|
||||
"rustls-pki-types",
|
||||
"untrusted",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ryu"
|
||||
version = "1.0.16"
|
||||
@ -761,11 +643,11 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "secp256k1"
|
||||
version = "0.27.0"
|
||||
version = "0.28.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "25996b82292a7a57ed3508f052cfff8640d38d32018784acd714758b43da9c8f"
|
||||
checksum = "d24b59d129cdadea20aea4fb2352fa053712e5d713eee47d700cd4b2bc002f10"
|
||||
dependencies = [
|
||||
"bitcoin_hashes 0.12.0",
|
||||
"bitcoin_hashes 0.13.0",
|
||||
"rand",
|
||||
"secp256k1-sys",
|
||||
"serde",
|
||||
@ -773,9 +655,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "secp256k1-sys"
|
||||
version = "0.8.1"
|
||||
version = "0.9.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "70a129b9e9efbfb223753b9163c4ab3b13cff7fd9c7f010fbac25ab4099fa07e"
|
||||
checksum = "e5d1746aae42c19d583c3c1a8c646bfad910498e2051c551a7f2e3c0c9fbb7eb"
|
||||
dependencies = [
|
||||
"cc",
|
||||
]
|
||||
@ -832,23 +714,6 @@ version = "0.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c"
|
||||
|
||||
[[package]]
|
||||
name = "socks"
|
||||
version = "0.3.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f0c3dbbd9ae980613c6dd8e28a9407b50509d3803b57624d5dfe8315218cd58b"
|
||||
dependencies = [
|
||||
"byteorder",
|
||||
"libc",
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "spin"
|
||||
version = "0.9.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67"
|
||||
|
||||
[[package]]
|
||||
name = "static_assertions"
|
||||
version = "1.1.0"
|
||||
@ -861,12 +726,6 @@ version = "0.10.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"
|
||||
|
||||
[[package]]
|
||||
name = "subtle"
|
||||
version = "2.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc"
|
||||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "2.0.48"
|
||||
@ -942,12 +801,6 @@ dependencies = [
|
||||
"version_check",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "unicode-bidi"
|
||||
version = "0.3.15"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75"
|
||||
|
||||
[[package]]
|
||||
name = "unicode-ident"
|
||||
version = "1.0.12"
|
||||
@ -1109,44 +962,6 @@ dependencies = [
|
||||
"weedle2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "untrusted"
|
||||
version = "0.9.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1"
|
||||
|
||||
[[package]]
|
||||
name = "ureq"
|
||||
version = "2.9.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "399dd89e2af196ae4f83a47bb37a1455e664fe2fed97b3ae68a1c4a3f8216e76"
|
||||
dependencies = [
|
||||
"base64 0.21.7",
|
||||
"flate2",
|
||||
"hootbin",
|
||||
"log",
|
||||
"once_cell",
|
||||
"rustls",
|
||||
"rustls-pki-types",
|
||||
"rustls-webpki",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"socks",
|
||||
"url",
|
||||
"webpki-roots",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "url"
|
||||
version = "2.3.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643"
|
||||
dependencies = [
|
||||
"form_urlencoded",
|
||||
"idna",
|
||||
"percent-encoding",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "utf8parse"
|
||||
version = "0.2.1"
|
||||
@ -1219,15 +1034,6 @@ version = "0.2.90"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b"
|
||||
|
||||
[[package]]
|
||||
name = "webpki-roots"
|
||||
version = "0.26.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0de2cfda980f21be5a7ed2eadb3e6fe074d56022bea2cdeb1a62eb220fc04188"
|
||||
dependencies = [
|
||||
"rustls-pki-types",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "weedle2"
|
||||
version = "5.0.0"
|
||||
@ -1237,59 +1043,13 @@ dependencies = [
|
||||
"nom",
|
||||
]
|
||||
|
||||
[[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-x86_64-pc-windows-gnu"
|
||||
version = "0.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
|
||||
|
||||
[[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.0",
|
||||
]
|
||||
|
||||
[[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]]
|
||||
@ -1298,101 +1058,53 @@ version = "0.52.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd"
|
||||
dependencies = [
|
||||
"windows_aarch64_gnullvm 0.52.0",
|
||||
"windows_aarch64_msvc 0.52.0",
|
||||
"windows_i686_gnu 0.52.0",
|
||||
"windows_i686_msvc 0.52.0",
|
||||
"windows_x86_64_gnu 0.52.0",
|
||||
"windows_x86_64_gnullvm 0.52.0",
|
||||
"windows_x86_64_msvc 0.52.0",
|
||||
"windows_aarch64_gnullvm",
|
||||
"windows_aarch64_msvc",
|
||||
"windows_i686_gnu",
|
||||
"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.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea"
|
||||
|
||||
[[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.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef"
|
||||
|
||||
[[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.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313"
|
||||
|
||||
[[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.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a"
|
||||
|
||||
[[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.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd"
|
||||
|
||||
[[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.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e"
|
||||
|
||||
[[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.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04"
|
||||
|
||||
[[package]]
|
||||
name = "zeroize"
|
||||
version = "1.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "bdk-ffi"
|
||||
version = "1.0.0-alpha.8"
|
||||
version = "1.0.0-alpha.9"
|
||||
homepage = "https://bitcoindevkit.org"
|
||||
repository = "https://github.com/bitcoindevkit/bdk"
|
||||
edition = "2018"
|
||||
@ -18,10 +18,10 @@ path = "uniffi-bindgen.rs"
|
||||
default = ["uniffi/cli"]
|
||||
|
||||
[dependencies]
|
||||
bdk = { version = "1.0.0-alpha.8", features = ["all-keys", "keys-bip39"] }
|
||||
bdk_esplora = { version = "0.10.0", default-features = false, features = ["std", "blocking"] }
|
||||
bdk = { version = "1.0.0-alpha.9", features = ["all-keys", "keys-bip39"] }
|
||||
bdk_esplora = { version = "0.11.0", default-features = false, features = ["std", "blocking"] }
|
||||
# bdk_esplora = { version = "0.10.0", default-features = false, features = ["std", "blocking", "async-https-rustls"] }
|
||||
bdk_file_store = { version = "0.8.0" }
|
||||
bdk_file_store = { version = "0.9.0" }
|
||||
|
||||
uniffi = { version = "=0.26.1" }
|
||||
bitcoin-internals = { version = "0.2.0", features = ["alloc"] }
|
||||
|
@ -34,17 +34,18 @@ interface PersistenceError {
|
||||
|
||||
[Error]
|
||||
interface EsploraError {
|
||||
Ureq(string error_message);
|
||||
UreqTransport(string error_message);
|
||||
Http(u16 status_code);
|
||||
Io(string error_message);
|
||||
NoHeader();
|
||||
Minreq(string error_message);
|
||||
HttpResponse(u16 status, string message);
|
||||
Parsing(string error_message);
|
||||
StatusCode(string error_message);
|
||||
BitcoinEncoding(string error_message);
|
||||
Hex(string error_message);
|
||||
HexToArray(string error_message);
|
||||
HexToBytes(string error_message);
|
||||
TransactionNotFound();
|
||||
HeaderHeightNotFound(u32 height);
|
||||
HeaderHashNotFound();
|
||||
InvalidHttpHeaderName(string name);
|
||||
InvalidHttpHeaderValue(string value);
|
||||
};
|
||||
|
||||
[Error]
|
||||
@ -56,17 +57,11 @@ enum FeeRateError {
|
||||
interface AddressError {
|
||||
Base58();
|
||||
Bech32();
|
||||
EmptyBech32Payload();
|
||||
InvalidBech32Variant();
|
||||
InvalidWitnessVersion(u8 version);
|
||||
UnparsableWitnessVersion();
|
||||
MalformedWitnessVersion();
|
||||
InvalidWitnessProgramLength(u64 length);
|
||||
InvalidSegwitV0ProgramLength(u64 length);
|
||||
WitnessVersion(string error_message);
|
||||
WitnessProgram(string error_message);
|
||||
UncompressedPubkey();
|
||||
ExcessiveScriptSize();
|
||||
UnrecognizedScript();
|
||||
UnknownAddressType(string s);
|
||||
NetworkValidation(Network required, Network found, string address);
|
||||
OtherAddressError();
|
||||
};
|
||||
@ -109,6 +104,14 @@ interface TxidParseError {
|
||||
InvalidTxid(string txid);
|
||||
};
|
||||
|
||||
[Error]
|
||||
interface ExtractTxError {
|
||||
AbsurdFeeRate(u64 fee_rate);
|
||||
MissingInputValue();
|
||||
SendingTooMuch();
|
||||
OtherExtractTransactionError();
|
||||
};
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// bdk crate - types module
|
||||
// ------------------------------------------------------------------------
|
||||
@ -211,7 +214,7 @@ interface Wallet {
|
||||
boolean is_mine([ByRef] Script script);
|
||||
|
||||
[Throws=Alpha3Error]
|
||||
boolean sign(PartiallySignedTransaction psbt);
|
||||
boolean sign(Psbt psbt);
|
||||
|
||||
SentAndReceivedValues sent_and_received([ByRef] Transaction tx);
|
||||
|
||||
@ -267,7 +270,7 @@ interface TxBuilder {
|
||||
TxBuilder enable_rbf_with_sequence(u32 nsequence);
|
||||
|
||||
[Throws=Alpha3Error]
|
||||
PartiallySignedTransaction finish([ByRef] Wallet wallet);
|
||||
Psbt finish([ByRef] Wallet wallet);
|
||||
};
|
||||
|
||||
interface BumpFeeTxBuilder {
|
||||
@ -280,7 +283,7 @@ interface BumpFeeTxBuilder {
|
||||
BumpFeeTxBuilder enable_rbf_with_sequence(u32 nsequence);
|
||||
|
||||
[Throws=Alpha3Error]
|
||||
PartiallySignedTransaction finish([ByRef] Wallet wallet);
|
||||
Psbt finish([ByRef] Wallet wallet);
|
||||
};
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
@ -444,11 +447,11 @@ interface Transaction {
|
||||
|
||||
string txid();
|
||||
|
||||
u64 size();
|
||||
u64 total_size();
|
||||
|
||||
u64 vsize();
|
||||
|
||||
boolean is_coin_base();
|
||||
boolean is_coinbase();
|
||||
|
||||
boolean is_explicitly_rbf();
|
||||
|
||||
@ -457,12 +460,13 @@ interface Transaction {
|
||||
i32 version();
|
||||
};
|
||||
|
||||
interface PartiallySignedTransaction {
|
||||
interface Psbt {
|
||||
[Throws=PsbtParseError]
|
||||
constructor(string psbt_base64);
|
||||
|
||||
string serialize();
|
||||
|
||||
[Throws=ExtractTxError]
|
||||
Transaction extract_tx();
|
||||
};
|
||||
|
||||
|
@ -4,13 +4,14 @@ use bdk::bitcoin::address::{NetworkChecked, NetworkUnchecked};
|
||||
use bdk::bitcoin::blockdata::script::ScriptBuf as BdkScriptBuf;
|
||||
use bdk::bitcoin::blockdata::transaction::TxOut as BdkTxOut;
|
||||
use bdk::bitcoin::consensus::Decodable;
|
||||
use bdk::bitcoin::psbt::PartiallySignedTransaction as BdkPartiallySignedTransaction;
|
||||
use bdk::bitcoin::Address as BdkAddress;
|
||||
use bdk::bitcoin::Network;
|
||||
use bdk::bitcoin::OutPoint as BdkOutPoint;
|
||||
use bdk::bitcoin::Psbt as BdkPsbt;
|
||||
use bdk::bitcoin::Transaction as BdkTransaction;
|
||||
use bdk::bitcoin::Txid;
|
||||
|
||||
use bdk::bitcoin::psbt::ExtractTxError;
|
||||
use std::io::Cursor;
|
||||
use std::str::FromStr;
|
||||
use std::sync::{Arc, Mutex};
|
||||
@ -73,7 +74,7 @@ impl Address {
|
||||
// }
|
||||
|
||||
pub fn network(&self) -> Network {
|
||||
self.inner.network
|
||||
*self.inner.network()
|
||||
}
|
||||
|
||||
pub fn script_pubkey(&self) -> Arc<Script> {
|
||||
@ -130,8 +131,8 @@ impl Transaction {
|
||||
// self.inner.weight() as u64
|
||||
// }
|
||||
|
||||
pub fn size(&self) -> u64 {
|
||||
self.inner.size() as u64
|
||||
pub fn total_size(&self) -> u64 {
|
||||
self.inner.total_size() as u64
|
||||
}
|
||||
|
||||
pub fn vsize(&self) -> u64 {
|
||||
@ -142,8 +143,8 @@ impl Transaction {
|
||||
// self.inner.serialize()
|
||||
// }
|
||||
|
||||
pub fn is_coin_base(&self) -> bool {
|
||||
self.inner.is_coin_base()
|
||||
pub fn is_coinbase(&self) -> bool {
|
||||
self.inner.is_coinbase()
|
||||
}
|
||||
|
||||
pub fn is_explicitly_rbf(&self) -> bool {
|
||||
@ -155,7 +156,7 @@ impl Transaction {
|
||||
}
|
||||
|
||||
pub fn version(&self) -> i32 {
|
||||
self.inner.version
|
||||
self.inner.version.0
|
||||
}
|
||||
|
||||
// fn lock_time(&self) -> u32 {
|
||||
@ -189,16 +190,14 @@ impl From<&Transaction> for BdkTransaction {
|
||||
}
|
||||
}
|
||||
|
||||
pub struct PartiallySignedTransaction {
|
||||
pub(crate) inner: Mutex<BdkPartiallySignedTransaction>,
|
||||
pub struct Psbt {
|
||||
pub(crate) inner: Mutex<BdkPsbt>,
|
||||
}
|
||||
|
||||
impl PartiallySignedTransaction {
|
||||
impl Psbt {
|
||||
pub(crate) fn new(psbt_base64: String) -> Result<Self, PsbtParseError> {
|
||||
let psbt: BdkPartiallySignedTransaction =
|
||||
BdkPartiallySignedTransaction::from_str(&psbt_base64)?;
|
||||
|
||||
Ok(PartiallySignedTransaction {
|
||||
let psbt: BdkPsbt = BdkPsbt::from_str(&psbt_base64)?;
|
||||
Ok(Psbt {
|
||||
inner: Mutex::new(psbt),
|
||||
})
|
||||
}
|
||||
@ -214,9 +213,10 @@ impl PartiallySignedTransaction {
|
||||
// txid.to_hex()
|
||||
// }
|
||||
|
||||
pub(crate) fn extract_tx(&self) -> Arc<Transaction> {
|
||||
let tx = self.inner.lock().unwrap().clone().extract_tx();
|
||||
Arc::new(tx.into())
|
||||
pub(crate) fn extract_tx(&self) -> Result<Arc<Transaction>, ExtractTxError> {
|
||||
let tx: BdkTransaction = self.inner.lock().unwrap().clone().extract_tx()?;
|
||||
let transaction: Transaction = tx.into();
|
||||
Ok(Arc::new(transaction))
|
||||
}
|
||||
|
||||
// /// Combines this PartiallySignedTransaction with other PSBT as described by BIP 174.
|
||||
@ -256,9 +256,9 @@ impl PartiallySignedTransaction {
|
||||
// }
|
||||
}
|
||||
|
||||
impl From<BdkPartiallySignedTransaction> for PartiallySignedTransaction {
|
||||
fn from(psbt: BdkPartiallySignedTransaction) -> Self {
|
||||
PartiallySignedTransaction {
|
||||
impl From<BdkPsbt> for Psbt {
|
||||
fn from(psbt: BdkPsbt) -> Self {
|
||||
Psbt {
|
||||
inner: Mutex::new(psbt),
|
||||
}
|
||||
}
|
||||
@ -297,7 +297,7 @@ pub struct TxOut {
|
||||
impl From<&BdkTxOut> for TxOut {
|
||||
fn from(tx_out: &BdkTxOut) -> Self {
|
||||
TxOut {
|
||||
value: tx_out.value,
|
||||
value: tx_out.value.to_sat(),
|
||||
script_pubkey: Arc::new(Script(tx_out.script_pubkey.clone())),
|
||||
}
|
||||
}
|
||||
|
@ -7,11 +7,12 @@ use bdk::descriptor::DescriptorError as BdkDescriptorError;
|
||||
use bdk::wallet::error::{BuildFeeBumpError, CreateTxError};
|
||||
use bdk::wallet::tx_builder::{AddUtxoError, AllowShrinkingError};
|
||||
use bdk::wallet::{NewError, NewOrLoadError};
|
||||
use bdk_esplora::esplora_client::Error as BdkEsploraError;
|
||||
use bdk_esplora::esplora_client::{Error as BdkEsploraError, Error};
|
||||
use bdk_file_store::FileError as BdkFileError;
|
||||
use bdk_file_store::IterError;
|
||||
use bitcoin_internals::hex::display::DisplayHex;
|
||||
|
||||
use bdk::bitcoin::address::ParseError;
|
||||
use std::convert::Infallible;
|
||||
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
@ -69,29 +70,26 @@ pub enum PersistenceError {
|
||||
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
pub enum EsploraError {
|
||||
#[error("ureq error: {error_message}")]
|
||||
Ureq { error_message: String },
|
||||
#[error("minreq error: {error_message}")]
|
||||
Minreq { error_message: String },
|
||||
|
||||
#[error("ureq transport error: {error_message}")]
|
||||
UreqTransport { error_message: String },
|
||||
|
||||
#[error("http error with status code: {status_code}")]
|
||||
Http { status_code: u16 },
|
||||
|
||||
#[error("io error: {error_message}")]
|
||||
Io { error_message: String },
|
||||
|
||||
#[error("no header found in the response")]
|
||||
NoHeader,
|
||||
#[error("http error with status code {status} and message {message}")]
|
||||
HttpResponse { status: u16, message: String },
|
||||
|
||||
#[error("parsing error: {error_message}")]
|
||||
Parsing { error_message: String },
|
||||
|
||||
#[error("Invalid status code, unable to convert to u16: {error_message}")]
|
||||
StatusCode { error_message: String },
|
||||
|
||||
#[error("bitcoin encoding error: {error_message}")]
|
||||
BitcoinEncoding { error_message: String },
|
||||
|
||||
#[error("hex decoding error: {error_message}")]
|
||||
Hex { error_message: String },
|
||||
#[error("invalid hex data returned: {error_message}")]
|
||||
HexToArray { error_message: String },
|
||||
|
||||
#[error("invalid hex data returned: {error_message}")]
|
||||
HexToBytes { error_message: String },
|
||||
|
||||
#[error("transaction not found")]
|
||||
TransactionNotFound,
|
||||
@ -101,6 +99,12 @@ pub enum EsploraError {
|
||||
|
||||
#[error("header hash not found")]
|
||||
HeaderHashNotFound,
|
||||
|
||||
#[error("invalid HTTP header name: {name}")]
|
||||
InvalidHttpHeaderName { name: String },
|
||||
|
||||
#[error("invalid HTTP header value: {value}")]
|
||||
InvalidHttpHeaderValue { value: String },
|
||||
}
|
||||
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
@ -117,34 +121,19 @@ pub enum TxidParseError {
|
||||
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
pub enum AddressError {
|
||||
// Errors coming from the ParseError enum
|
||||
#[error("base58 address encoding error")]
|
||||
Base58,
|
||||
|
||||
#[error("bech32 address encoding error")]
|
||||
Bech32,
|
||||
|
||||
#[error("the bech32 payload was empty")]
|
||||
EmptyBech32Payload,
|
||||
// Errors coming from the bitcoin::address::Error enum
|
||||
#[error("witness version conversion/parsing error: {error_message}")]
|
||||
WitnessVersion { error_message: String },
|
||||
|
||||
#[error("invalid bech32 checksum variant found")]
|
||||
InvalidBech32Variant,
|
||||
|
||||
#[error("invalid witness script version: {version}")]
|
||||
InvalidWitnessVersion { version: u8 },
|
||||
|
||||
#[error("incorrect format of a witness version byte")]
|
||||
UnparsableWitnessVersion,
|
||||
|
||||
#[error(
|
||||
"bitcoin script opcode does not match any known witness version, the script is malformed"
|
||||
)]
|
||||
MalformedWitnessVersion,
|
||||
|
||||
#[error("the witness program must be between 2 and 40 bytes in length: length={length}")]
|
||||
InvalidWitnessProgramLength { length: u64 },
|
||||
|
||||
#[error("a v0 witness program must be either of length 20 or 32 bytes: length={length}")]
|
||||
InvalidSegwitV0ProgramLength { length: u64 },
|
||||
#[error("witness program error: {error_message}")]
|
||||
WitnessProgram { error_message: String },
|
||||
|
||||
#[error("an uncompressed pubkey was used where it is not allowed")]
|
||||
UncompressedPubkey,
|
||||
@ -155,12 +144,7 @@ pub enum AddressError {
|
||||
#[error("script is not p2pkh, p2sh, or witness program")]
|
||||
UnrecognizedScript,
|
||||
|
||||
#[error("unknown address type: '{s}' is either invalid or not supported")]
|
||||
UnknownAddressType { s: String },
|
||||
|
||||
#[error(
|
||||
"address {address} belongs to network {found} which is different from required {required}"
|
||||
)]
|
||||
#[error("address {address} is not valid on {required}")]
|
||||
NetworkValidation {
|
||||
/// Network that was required.
|
||||
required: Network,
|
||||
@ -249,6 +233,23 @@ pub enum DescriptorError {
|
||||
Hex { e: String },
|
||||
}
|
||||
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
pub enum ExtractTxError {
|
||||
#[error("an absurdly high fee rate of {fee_rate} sat/vbyte")]
|
||||
AbsurdFeeRate { fee_rate: u64 },
|
||||
|
||||
#[error("one of the inputs lacked value information (witness_utxo or non_witness_utxo)")]
|
||||
MissingInputValue,
|
||||
|
||||
#[error("transaction would be invalid due to output value being greater than input value")]
|
||||
SendingTooMuch,
|
||||
|
||||
#[error(
|
||||
"this error is required because the bdk::bitcoin::psbt::ExtractTxError is non-exhaustive"
|
||||
)]
|
||||
OtherExtractTransactionError,
|
||||
}
|
||||
|
||||
impl From<BdkDescriptorError> for DescriptorError {
|
||||
fn from(error: BdkDescriptorError) -> Self {
|
||||
match error {
|
||||
@ -380,24 +381,25 @@ impl From<BdkCalculateFeeError> for CalculateFeeError {
|
||||
impl From<BdkEsploraError> for EsploraError {
|
||||
fn from(error: BdkEsploraError) -> Self {
|
||||
match error {
|
||||
BdkEsploraError::Ureq(e) => EsploraError::Ureq {
|
||||
BdkEsploraError::Minreq(e) => EsploraError::Minreq {
|
||||
error_message: e.to_string(),
|
||||
},
|
||||
BdkEsploraError::UreqTransport(e) => EsploraError::UreqTransport {
|
||||
error_message: e.to_string(),
|
||||
},
|
||||
BdkEsploraError::HttpResponse(code) => EsploraError::Http { status_code: code },
|
||||
BdkEsploraError::Io(e) => EsploraError::Io {
|
||||
error_message: e.to_string(),
|
||||
},
|
||||
BdkEsploraError::NoHeader => EsploraError::NoHeader,
|
||||
BdkEsploraError::HttpResponse { status, message } => {
|
||||
EsploraError::HttpResponse { status, message }
|
||||
}
|
||||
BdkEsploraError::Parsing(e) => EsploraError::Parsing {
|
||||
error_message: e.to_string(),
|
||||
},
|
||||
Error::StatusCode(e) => EsploraError::StatusCode {
|
||||
error_message: e.to_string(),
|
||||
},
|
||||
BdkEsploraError::BitcoinEncoding(e) => EsploraError::BitcoinEncoding {
|
||||
error_message: e.to_string(),
|
||||
},
|
||||
BdkEsploraError::Hex(e) => EsploraError::Hex {
|
||||
BdkEsploraError::HexToArray(e) => EsploraError::HexToArray {
|
||||
error_message: e.to_string(),
|
||||
},
|
||||
BdkEsploraError::HexToBytes(e) => EsploraError::HexToBytes {
|
||||
error_message: e.to_string(),
|
||||
},
|
||||
BdkEsploraError::TransactionNotFound(_) => EsploraError::TransactionNotFound,
|
||||
@ -405,6 +407,10 @@ impl From<BdkEsploraError> for EsploraError {
|
||||
EsploraError::HeaderHeightNotFound { height }
|
||||
}
|
||||
BdkEsploraError::HeaderHashNotFound(_) => EsploraError::HeaderHashNotFound,
|
||||
Error::InvalidHttpHeaderName(name) => EsploraError::InvalidHttpHeaderName { name },
|
||||
BdkEsploraError::InvalidHttpHeaderValue(value) => {
|
||||
EsploraError::InvalidHttpHeaderValue { value }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -412,37 +418,17 @@ impl From<BdkEsploraError> for EsploraError {
|
||||
impl From<bdk::bitcoin::address::Error> for AddressError {
|
||||
fn from(error: bdk::bitcoin::address::Error) -> Self {
|
||||
match error {
|
||||
bdk::bitcoin::address::Error::Base58(_) => AddressError::Base58,
|
||||
bdk::bitcoin::address::Error::Bech32(_) => AddressError::Bech32,
|
||||
bdk::bitcoin::address::Error::EmptyBech32Payload => AddressError::EmptyBech32Payload,
|
||||
bdk::bitcoin::address::Error::InvalidBech32Variant { .. } => {
|
||||
AddressError::InvalidBech32Variant
|
||||
}
|
||||
bdk::bitcoin::address::Error::InvalidWitnessVersion(version) => {
|
||||
AddressError::InvalidWitnessVersion { version }
|
||||
}
|
||||
bdk::bitcoin::address::Error::UnparsableWitnessVersion(_) => {
|
||||
AddressError::UnparsableWitnessVersion
|
||||
}
|
||||
bdk::bitcoin::address::Error::MalformedWitnessVersion => {
|
||||
AddressError::MalformedWitnessVersion
|
||||
}
|
||||
bdk::bitcoin::address::Error::InvalidWitnessProgramLength(length) => {
|
||||
AddressError::InvalidWitnessProgramLength {
|
||||
length: length as u64,
|
||||
}
|
||||
}
|
||||
bdk::bitcoin::address::Error::InvalidSegwitV0ProgramLength(length) => {
|
||||
AddressError::InvalidSegwitV0ProgramLength {
|
||||
length: length as u64,
|
||||
bdk::bitcoin::address::Error::WitnessVersion(error_message) => {
|
||||
AddressError::WitnessVersion {
|
||||
error_message: error_message.to_string(),
|
||||
}
|
||||
}
|
||||
bdk::bitcoin::address::Error::WitnessProgram(e) => AddressError::WitnessProgram {
|
||||
error_message: e.to_string(),
|
||||
},
|
||||
bdk::bitcoin::address::Error::UncompressedPubkey => AddressError::UncompressedPubkey,
|
||||
bdk::bitcoin::address::Error::ExcessiveScriptSize => AddressError::ExcessiveScriptSize,
|
||||
bdk::bitcoin::address::Error::UnrecognizedScript => AddressError::UnrecognizedScript,
|
||||
bdk::bitcoin::address::Error::UnknownAddressType(s) => {
|
||||
AddressError::UnknownAddressType { s }
|
||||
}
|
||||
bdk::bitcoin::address::Error::NetworkValidation {
|
||||
required,
|
||||
found,
|
||||
@ -457,6 +443,22 @@ impl From<bdk::bitcoin::address::Error> for AddressError {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<ParseError> for AddressError {
|
||||
fn from(error: ParseError) -> Self {
|
||||
match error {
|
||||
ParseError::Base58(_) => AddressError::Base58,
|
||||
ParseError::Bech32(_) => AddressError::Bech32,
|
||||
ParseError::WitnessVersion(e) => AddressError::WitnessVersion {
|
||||
error_message: e.to_string(),
|
||||
},
|
||||
ParseError::WitnessProgram(e) => AddressError::WitnessProgram {
|
||||
error_message: e.to_string(),
|
||||
},
|
||||
_ => AddressError::OtherAddressError,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<bdk::bitcoin::consensus::encode::Error> for TransactionError {
|
||||
fn from(error: bdk::bitcoin::consensus::encode::Error) -> Self {
|
||||
match error {
|
||||
@ -482,6 +484,25 @@ impl From<bdk::bitcoin::consensus::encode::Error> for TransactionError {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<bdk::bitcoin::psbt::ExtractTxError> for ExtractTxError {
|
||||
fn from(error: bdk::bitcoin::psbt::ExtractTxError) -> Self {
|
||||
match error {
|
||||
bdk::bitcoin::psbt::ExtractTxError::AbsurdFeeRate { fee_rate, .. } => {
|
||||
let sat_per_vbyte = fee_rate.to_sat_per_vb_ceil();
|
||||
ExtractTxError::AbsurdFeeRate {
|
||||
fee_rate: sat_per_vbyte,
|
||||
}
|
||||
}
|
||||
bdk::bitcoin::psbt::ExtractTxError::MissingInputValue { .. } => {
|
||||
ExtractTxError::MissingInputValue
|
||||
}
|
||||
bdk::bitcoin::psbt::ExtractTxError::SendingTooMuch { .. } => {
|
||||
ExtractTxError::SendingTooMuch
|
||||
}
|
||||
_ => ExtractTxError::OtherExtractTransactionError,
|
||||
}
|
||||
}
|
||||
}
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use crate::error::{EsploraError, PersistenceError, WalletCreationError};
|
||||
@ -534,28 +555,24 @@ mod test {
|
||||
fn test_esplora_errors() {
|
||||
let cases = vec![
|
||||
(
|
||||
EsploraError::Ureq {
|
||||
EsploraError::Minreq {
|
||||
error_message: "Network error".to_string(),
|
||||
},
|
||||
"ureq error: Network error",
|
||||
"minreq error: Network error",
|
||||
),
|
||||
(
|
||||
EsploraError::UreqTransport {
|
||||
error_message: "Timeout occurred".to_string(),
|
||||
EsploraError::HttpResponse {
|
||||
status: 404,
|
||||
message: "Not found".to_string(),
|
||||
},
|
||||
"ureq transport error: Timeout occurred",
|
||||
"http error with status code 404 and message Not found",
|
||||
),
|
||||
(
|
||||
EsploraError::Http { status_code: 404 },
|
||||
"http error with status code: 404",
|
||||
),
|
||||
(
|
||||
EsploraError::Io {
|
||||
error_message: "File not found".to_string(),
|
||||
EsploraError::StatusCode {
|
||||
error_message: "code 1234567".to_string(),
|
||||
},
|
||||
"io error: File not found",
|
||||
"Invalid status code, unable to convert to u16: code 1234567",
|
||||
),
|
||||
(EsploraError::NoHeader, "no header found in the response"),
|
||||
(
|
||||
EsploraError::Parsing {
|
||||
error_message: "Invalid JSON".to_string(),
|
||||
@ -569,10 +586,16 @@ mod test {
|
||||
"bitcoin encoding error: Bad format",
|
||||
),
|
||||
(
|
||||
EsploraError::Hex {
|
||||
EsploraError::HexToArray {
|
||||
error_message: "Invalid hex".to_string(),
|
||||
},
|
||||
"hex decoding error: Invalid hex",
|
||||
"invalid hex data returned: Invalid hex",
|
||||
),
|
||||
(
|
||||
EsploraError::HexToBytes {
|
||||
error_message: "Invalid hex".to_string(),
|
||||
},
|
||||
"invalid hex data returned: Invalid hex",
|
||||
),
|
||||
(EsploraError::TransactionNotFound, "transaction not found"),
|
||||
(
|
||||
|
@ -13,7 +13,7 @@ pub struct EsploraClient(BlockingClient);
|
||||
|
||||
impl EsploraClient {
|
||||
pub fn new(url: String) -> Self {
|
||||
let client = Builder::new(url.as_str()).build_blocking().unwrap();
|
||||
let client = Builder::new(url.as_str()).build_blocking();
|
||||
Self(client)
|
||||
}
|
||||
|
||||
|
@ -8,7 +8,7 @@ mod wallet;
|
||||
|
||||
use crate::bitcoin::Address;
|
||||
use crate::bitcoin::OutPoint;
|
||||
use crate::bitcoin::PartiallySignedTransaction;
|
||||
use crate::bitcoin::Psbt;
|
||||
use crate::bitcoin::Script;
|
||||
use crate::bitcoin::Transaction;
|
||||
use crate::bitcoin::TxOut;
|
||||
@ -18,6 +18,7 @@ use crate::error::Alpha3Error;
|
||||
use crate::error::CalculateFeeError;
|
||||
use crate::error::DescriptorError;
|
||||
use crate::error::EsploraError;
|
||||
use crate::error::ExtractTxError;
|
||||
use crate::error::FeeRateError;
|
||||
use crate::error::PersistenceError;
|
||||
use crate::error::PsbtParseError;
|
||||
|
@ -3,7 +3,6 @@ use crate::error::FeeRateError;
|
||||
use crate::bitcoin::{Address, OutPoint, Script, Transaction, TxOut};
|
||||
|
||||
use bdk::bitcoin::FeeRate as BdkFeeRate;
|
||||
use bdk::bitcoin::Transaction as BdkTransaction;
|
||||
use bdk::chain::tx_graph::CanonicalTx as BdkCanonicalTx;
|
||||
use bdk::chain::{ChainPosition as BdkChainPosition, ConfirmationTimeHeightAnchor};
|
||||
use bdk::wallet::AddressIndex as BdkAddressIndex;
|
||||
@ -25,8 +24,12 @@ pub struct CanonicalTx {
|
||||
pub chain_position: ChainPosition,
|
||||
}
|
||||
|
||||
impl From<BdkCanonicalTx<'_, BdkTransaction, ConfirmationTimeHeightAnchor>> for CanonicalTx {
|
||||
fn from(tx: BdkCanonicalTx<'_, BdkTransaction, ConfirmationTimeHeightAnchor>) -> Self {
|
||||
impl From<BdkCanonicalTx<'_, Arc<bdk::bitcoin::Transaction>, ConfirmationTimeHeightAnchor>>
|
||||
for CanonicalTx
|
||||
{
|
||||
fn from(
|
||||
tx: BdkCanonicalTx<'_, Arc<bdk::bitcoin::Transaction>, ConfirmationTimeHeightAnchor>,
|
||||
) -> Self {
|
||||
let chain_position = match tx.chain_position {
|
||||
BdkChainPosition::Confirmed(anchor) => ChainPosition::Confirmed {
|
||||
height: anchor.confirmation_height,
|
||||
@ -36,12 +39,29 @@ impl From<BdkCanonicalTx<'_, BdkTransaction, ConfirmationTimeHeightAnchor>> for
|
||||
};
|
||||
|
||||
CanonicalTx {
|
||||
transaction: Arc::new(Transaction::from(tx.tx_node.tx)),
|
||||
transaction: Arc::new(Transaction::from(tx.tx_node.tx.as_ref().clone())),
|
||||
chain_position,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// impl From<BdkCanonicalTx<'_, BdkTransaction, ConfirmationTimeHeightAnchor>> for CanonicalTx {
|
||||
// fn from(tx: BdkCanonicalTx<'_, BdkTransaction, ConfirmationTimeHeightAnchor>) -> Self {
|
||||
// let chain_position = match tx.chain_position {
|
||||
// BdkChainPosition::Confirmed(anchor) => ChainPosition::Confirmed {
|
||||
// height: anchor.confirmation_height,
|
||||
// timestamp: anchor.confirmation_time,
|
||||
// },
|
||||
// BdkChainPosition::Unconfirmed(timestamp) => ChainPosition::Unconfirmed { timestamp },
|
||||
// };
|
||||
//
|
||||
// CanonicalTx {
|
||||
// transaction: Arc::new(Transaction::from(tx.tx_node.tx)),
|
||||
// chain_position,
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct FeeRate(pub BdkFeeRate);
|
||||
|
||||
@ -176,7 +196,7 @@ impl From<BdkLocalOutput> for LocalOutput {
|
||||
vout: local_utxo.outpoint.vout,
|
||||
},
|
||||
txout: TxOut {
|
||||
value: local_utxo.txout.value,
|
||||
value: local_utxo.txout.value.to_sat(),
|
||||
script_pubkey: Arc::new(Script(local_utxo.txout.script_pubkey)),
|
||||
},
|
||||
keychain: local_utxo.keychain,
|
||||
|
@ -1,4 +1,4 @@
|
||||
use crate::bitcoin::{OutPoint, PartiallySignedTransaction, Script, Transaction};
|
||||
use crate::bitcoin::{OutPoint, Psbt, Script, Transaction};
|
||||
use crate::descriptor::Descriptor;
|
||||
use crate::error::{
|
||||
Alpha3Error, CalculateFeeError, PersistenceError, TxidParseError, WalletCreationError,
|
||||
@ -8,8 +8,8 @@ use crate::types::{
|
||||
};
|
||||
|
||||
use bdk::bitcoin::blockdata::script::ScriptBuf as BdkScriptBuf;
|
||||
use bdk::bitcoin::psbt::PartiallySignedTransaction as BdkPartiallySignedTransaction;
|
||||
use bdk::bitcoin::Network;
|
||||
use bdk::bitcoin::Psbt as BdkPsbt;
|
||||
use bdk::bitcoin::{OutPoint as BdkOutPoint, Sequence, Txid};
|
||||
use bdk::wallet::tx_builder::ChangeSpendPolicy;
|
||||
use bdk::wallet::{ChangeSet, Update as BdkUpdate};
|
||||
@ -91,7 +91,7 @@ impl Wallet {
|
||||
|
||||
pub(crate) fn sign(
|
||||
&self,
|
||||
psbt: Arc<PartiallySignedTransaction>,
|
||||
psbt: Arc<Psbt>,
|
||||
// sign_options: Option<SignOptions>,
|
||||
) -> Result<bool, Alpha3Error> {
|
||||
let mut psbt = psbt.inner.lock().unwrap();
|
||||
@ -488,10 +488,7 @@ impl TxBuilder {
|
||||
// })
|
||||
// }
|
||||
|
||||
pub(crate) fn finish(
|
||||
&self,
|
||||
wallet: &Arc<Wallet>,
|
||||
) -> Result<Arc<PartiallySignedTransaction>, Alpha3Error> {
|
||||
pub(crate) fn finish(&self, wallet: &Arc<Wallet>) -> Result<Arc<Psbt>, Alpha3Error> {
|
||||
// TODO: I had to change the wallet here to be mutable. Why is that now required with the 1.0 API?
|
||||
let mut wallet = wallet.get_wallet();
|
||||
let mut tx_builder = wallet.build_tx();
|
||||
@ -583,10 +580,7 @@ impl BumpFeeTxBuilder {
|
||||
})
|
||||
}
|
||||
|
||||
pub(crate) fn finish(
|
||||
&self,
|
||||
wallet: &Wallet,
|
||||
) -> Result<Arc<PartiallySignedTransaction>, Alpha3Error> {
|
||||
pub(crate) fn finish(&self, wallet: &Wallet) -> Result<Arc<Psbt>, Alpha3Error> {
|
||||
let txid = Txid::from_str(self.txid.as_str()).map_err(|_| Alpha3Error::Generic)?;
|
||||
let mut wallet = wallet.get_wallet();
|
||||
let mut tx_builder = wallet.build_fee_bump(txid)?;
|
||||
@ -604,8 +598,7 @@ impl BumpFeeTxBuilder {
|
||||
}
|
||||
}
|
||||
}
|
||||
let psbt: BdkPartiallySignedTransaction =
|
||||
tx_builder.finish().map_err(|_| Alpha3Error::Generic)?;
|
||||
let psbt: BdkPsbt = tx_builder.finish().map_err(|_| Alpha3Error::Generic)?;
|
||||
|
||||
Ok(Arc::new(psbt.into()))
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user