-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
- Loading branch information
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,22 @@ | ||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="This crate is used for updating structures of the [`bdk_chain`] crate with data from electrum."><meta name="keywords" content="rust, rustlang, rust-lang, bdk_electrum"><title>bdk_electrum - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceSerif4-Regular-1f7d512b176f0f72.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceSerif4-Bold-124a1ca42af929b6.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../static.files/rustdoc-64f7dca12162a801.css" id="mainThemeStyle"><link rel="stylesheet" id="themeStyle" href="../static.files/light-ebce58d0a40c3431.css"><link rel="stylesheet" disabled href="../static.files/dark-f23faae4a2daf9a6.css"><link rel="stylesheet" disabled href="../static.files/ayu-94f39d4346842c1e.css"><script id="default-settings" ></script><script src="../static.files/storage-d43fa987303ecbbb.js"></script><script defer src="../crates.js"></script><script defer src="../static.files/main-a211dbb005fb8161.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-13285aec31fa243e.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc mod crate"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../bdk_electrum/index.html"><div class="logo-container"><img class="rust-logo" src="../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></div></a><h2></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../bdk_electrum/index.html"><div class="logo-container"><img class="rust-logo" src="../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></div></a><h2 class="location"><a href="#">Crate bdk_electrum</a></h2><div class="sidebar-elems"><ul class="block"><li class="version">Version 0.4.0</li><li><a id="all-types" href="all.html">All Items</a></li></ul><section><ul class="block"><li><a href="#reexports">Re-exports</a></li><li><a href="#structs">Structs</a></li><li><a href="#traits">Traits</a></li></ul></section></div></nav><main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../static.files/wheel-5ec35bf9ca753509.svg"></a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn">Crate <a class="mod" href="#">bdk_electrum</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../static.files/clipboard-7571035ce49a181d.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="srclink" href="../src/bdk_electrum/lib.rs.html#1-30">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>−</span>]</button></span></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>This crate is used for updating structures of the <a href="../bdk_chain/index.html" title="bdk_chain"><code>bdk_chain</code></a> crate with data from electrum.</p> | ||
<p>The star of the show is the <a href="trait.ElectrumExt.html#tymethod.scan" title="ElectrumExt::scan"><code>ElectrumExt::scan</code></a> method, which scans for relevant blockchain | ||
data (via electrum) and outputs updates for <a href="../bdk_chain/index.html" title="bdk_chain"><code>bdk_chain</code></a> structures as a tuple of form:</p> | ||
<p>(<a href="../bdk_chain/local_chain/struct.Update.html" title="bdk_chain::local_chain::Update"><code>bdk_chain::local_chain::Update</code></a>, <a href="struct.RelevantTxids.html" title="RelevantTxids"><code>RelevantTxids</code></a>, <code>keychain_update</code>)</p> | ||
<p>An <a href="struct.RelevantTxids.html" title="RelevantTxids"><code>RelevantTxids</code></a> only includes <code>txid</code>s and no full transactions. The caller is | ||
responsible for obtaining full transactions before applying. This can be done with | ||
these steps:</p> | ||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="This crate is used for updating structures of [`bdk_chain`] with data from an Electrum server."><meta name="keywords" content="rust, rustlang, rust-lang, bdk_electrum"><title>bdk_electrum - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceSerif4-Regular-1f7d512b176f0f72.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceSerif4-Bold-124a1ca42af929b6.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../static.files/rustdoc-64f7dca12162a801.css" id="mainThemeStyle"><link rel="stylesheet" id="themeStyle" href="../static.files/light-ebce58d0a40c3431.css"><link rel="stylesheet" disabled href="../static.files/dark-f23faae4a2daf9a6.css"><link rel="stylesheet" disabled href="../static.files/ayu-94f39d4346842c1e.css"><script id="default-settings" ></script><script src="../static.files/storage-d43fa987303ecbbb.js"></script><script defer src="../crates.js"></script><script defer src="../static.files/main-a211dbb005fb8161.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-13285aec31fa243e.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc mod crate"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../bdk_electrum/index.html"><div class="logo-container"><img class="rust-logo" src="../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></div></a><h2></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../bdk_electrum/index.html"><div class="logo-container"><img class="rust-logo" src="../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></div></a><h2 class="location"><a href="#">Crate bdk_electrum</a></h2><div class="sidebar-elems"><ul class="block"><li class="version">Version 0.4.0</li><li><a id="all-types" href="all.html">All Items</a></li></ul><section><ul class="block"><li><a href="#reexports">Re-exports</a></li><li><a href="#structs">Structs</a></li><li><a href="#traits">Traits</a></li></ul></section></div></nav><main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../static.files/wheel-5ec35bf9ca753509.svg"></a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn">Crate <a class="mod" href="#">bdk_electrum</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../static.files/clipboard-7571035ce49a181d.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="srclink" href="../src/bdk_electrum/lib.rs.html#1-30">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>−</span>]</button></span></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>This crate is used for updating structures of <a href="../bdk_chain/index.html" title="bdk_chain"><code>bdk_chain</code></a> with data from an Electrum server.</p> | ||
<p>The two primary methods are <a href="trait.ElectrumExt.html#tymethod.sync" title="ElectrumExt::sync"><code>ElectrumExt::sync</code></a> and <a href="trait.ElectrumExt.html#tymethod.full_scan" title="ElectrumExt::full_scan"><code>ElectrumExt::full_scan</code></a>. In most cases | ||
<a href="trait.ElectrumExt.html#tymethod.sync" title="ElectrumExt::sync"><code>ElectrumExt::sync</code></a> is used to sync the transaction histories of scripts that the application | ||
cares about, for example the scripts for all the receive addresses of a Wallet’s keychain that it | ||
has shown a user. <a href="trait.ElectrumExt.html#tymethod.full_scan" title="ElectrumExt::full_scan"><code>ElectrumExt::full_scan</code></a> is meant to be used when importing or restoring a | ||
keychain where the range of possibly used scripts is not known. In this case it is necessary to | ||
scan all keychain scripts until a number (the “stop gap”) of unused scripts is discovered. For a | ||
sync or full scan the user receives relevant blockchain data and output updates for | ||
<a href="../bdk_chain/index.html" title="bdk_chain"><code>bdk_chain</code></a> including <a href="struct.RelevantTxids.html" title="RelevantTxids"><code>RelevantTxids</code></a>.</p> | ||
<p>The <a href="struct.RelevantTxids.html" title="RelevantTxids"><code>RelevantTxids</code></a> only includes <code>txid</code>s and not full transactions. The caller is responsible | ||
for obtaining full transactions before applying new data to their <a href="../bdk_chain/index.html" title="bdk_chain"><code>bdk_chain</code></a>. This can be | ||
done with these steps:</p> | ||
<ol> | ||
<li> | ||
<p>Determine which full transactions are missing. The method <a href="struct.RelevantTxids.html#method.missing_full_txs"><code>missing_full_txs</code></a> of | ||
<a href="struct.RelevantTxids.html" title="RelevantTxids"><code>RelevantTxids</code></a> can be used.</p> | ||
<p>Determine which full transactions are missing. Use <a href="struct.RelevantTxids.html#method.missing_full_txs" title="RelevantTxids::missing_full_txs"><code>RelevantTxids::missing_full_txs</code></a>.</p> | ||
</li> | ||
<li> | ||
<p>Obtaining the full transactions. To do this via electrum, the method | ||
<a href="electrum_client::ElectrumApi::batch_transaction_get"><code>batch_transaction_get</code></a> can be used.</p> | ||
<p>Obtaining the full transactions. To do this via electrum use <a href="electrum_client::ElectrumApi::batch_transaction_get"><code>ElectrumApi::batch_transaction_get</code></a>.</p> | ||
</li> | ||
</ol> | ||
<p>Refer to <a href="https://github.com/LLFourn/bdk_core_staging/tree/master/bdk_electrum_example"><code>bdk_electrum_example</code></a> for a complete example.</p> | ||
<p>Refer to <a href="https://github.com/bitcoindevkit/bdk/tree/master/example-crates/example_electrum"><code>example_electrum</code></a> for a complete example.</p> | ||
</div></details><h2 id="reexports" class="small-section-header"><a href="#reexports">Re-exports</a></h2><div class="item-table"><div class="item-row"><div class="item-left import-item" id="reexport.bdk_chain"><code>pub use <a class="mod" href="../bdk_chain/index.html" title="mod bdk_chain">bdk_chain</a>;</code></div></div><div class="item-row"><div class="item-left import-item" id="reexport.electrum_client"><code>pub use electrum_client;</code></div></div></div><h2 id="structs" class="small-section-header"><a href="#structs">Structs</a></h2><div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.ElectrumUpdate.html" title="bdk_electrum::ElectrumUpdate struct">ElectrumUpdate</a></div><div class="item-right docblock-short">Combination of chain and transactions updates from electrum</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.RelevantTxids.html" title="bdk_electrum::RelevantTxids struct">RelevantTxids</a></div><div class="item-right docblock-short">Represents updates fetched from an Electrum server, but excludes full transactions.</div></div></div><h2 id="traits" class="small-section-header"><a href="#traits">Traits</a></h2><div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="trait" href="trait.ElectrumExt.html" title="bdk_electrum::ElectrumExt trait">ElectrumExt</a></div><div class="item-right docblock-short">Trait to extend [<code>Client</code>] functionality.</div></div></div></section></div></main><div id="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="bdk_electrum" data-themes="" data-resource-suffix="" data-rustdoc-version="1.68.0-nightly (0f529f0f4 2022-12-13)" data-search-js="search-444266647c4dba98.js" data-settings-js="settings-bebeae96e00e4617.js" data-settings-css="settings-af96d9e2fc13e081.css" ></div></body></html> |