30 lines
11 KiB
HTML
30 lines
11 KiB
HTML
<!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="Functions for creating Zcash transactions that spend funds belonging to the wallet"><title>zcash_client_backend::data_api::wallet - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-20739d33.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="zcash_client_backend" data-themes="" data-resource-suffix="" data-rustdoc-version="1.88.0-nightly (74509131e 2025-04-29)" data-channel="nightly" data-search-js="search-f7877310.js" data-settings-js="settings-5514c975.js" ><script src="../../../static.files/storage-4e99c027.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../static.files/main-7ef8a74a.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[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" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../zcash_client_backend/index.html">zcash_<wbr>client_<wbr>backend</a><span class="version">0.18.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module wallet</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#functions-for-creating-zcash-transactions-that-spend-funds-belonging-to-the-wallet" title="Functions for creating Zcash transactions that spend funds belonging to the wallet">Functions for creating Zcash transactions that spend funds belonging to the wallet</a></li></ul><h3><a href="#modules">Module Items</a></h3><ul class="block"><li><a href="#modules" title="Modules">Modules</a></li><li><a href="#functions" title="Functions">Functions</a></li><li><a href="#types" title="Type Aliases">Type Aliases</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In zcash_<wbr>client_<wbr>backend::<wbr>data_<wbr>api</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../index.html">zcash_client_backend</a>::<wbr><a href="../index.html">data_api</a></div><h1>Module <span>wallet</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../src/zcash_client_backend/data_api/wallet.rs.html#1-2164">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><h2 id="functions-for-creating-zcash-transactions-that-spend-funds-belonging-to-the-wallet"><a class="doc-anchor" href="#functions-for-creating-zcash-transactions-that-spend-funds-belonging-to-the-wallet">§</a>Functions for creating Zcash transactions that spend funds belonging to the wallet</h2>
|
||
<p>This module contains several different ways of creating Zcash transactions. This module is
|
||
designed around the idea that a Zcash wallet holds its funds in notes in either the Orchard
|
||
or Sapling shielded pool. In order to better preserve users’ privacy, it does not provide any
|
||
functionality that allows users to directly spend transparent funds except by sending them to a
|
||
shielded internal address belonging to their wallet.</p>
|
||
<p>The important high-level operations provided by this module are <a href="fn.propose_transfer.html" title="fn zcash_client_backend::data_api::wallet::propose_transfer"><code>propose_transfer</code></a>,
|
||
and <a href="fn.create_proposed_transactions.html" title="fn zcash_client_backend::data_api::wallet::create_proposed_transactions"><code>create_proposed_transactions</code></a>.</p>
|
||
<p><a href="fn.propose_transfer.html" title="fn zcash_client_backend::data_api::wallet::propose_transfer"><code>propose_transfer</code></a> takes a <a href="../../zip321/struct.TransactionRequest.html" title="struct zcash_client_backend::zip321::TransactionRequest"><code>TransactionRequest</code></a> object, selects inputs notes and
|
||
computes the fees required to satisfy that request, and returns a <a href="../../proposal/struct.Proposal.html" title="struct zcash_client_backend::proposal::Proposal"><code>Proposal</code></a> object that
|
||
describes the transaction to be made.</p>
|
||
<p><a href="fn.create_proposed_transactions.html" title="fn zcash_client_backend::data_api::wallet::create_proposed_transactions"><code>create_proposed_transactions</code></a> constructs one or more Zcash [<code>Transaction</code>]s based upon a
|
||
provided <a href="../../proposal/struct.Proposal.html" title="struct zcash_client_backend::proposal::Proposal"><code>Proposal</code></a>, stores them to the wallet database, and returns the [<code>TxId</code>] for each
|
||
constructed transaction to the caller. The caller can then use the
|
||
<a href="../trait.WalletRead.html#tymethod.get_transaction" title="method zcash_client_backend::data_api::WalletRead::get_transaction"><code>WalletRead::get_transaction</code></a> method to retrieve the newly constructed transactions. It is
|
||
the responsibility of the caller to retrieve and serialize the transactions and submit them for
|
||
inclusion into the Zcash blockchain.</p>
|
||
<p>Another important high-level operation provided by this module is <a href="fn.propose_shielding.html" title="fn zcash_client_backend::data_api::wallet::propose_shielding"><code>propose_shielding</code></a>, which
|
||
takes a set of transparent source addresses, and constructs a <a href="../../proposal/struct.Proposal.html" title="struct zcash_client_backend::proposal::Proposal"><code>Proposal</code></a> to send those funds
|
||
to a wallet-internal shielded address, as described in <a href="https://zips.z.cash/zip-0316">ZIP 316</a>.</p>
|
||
</div></details><h2 id="modules" class="section-header">Modules<a href="#modules" class="anchor">§</a></h2><dl class="item-table"><dt><a class="mod" href="input_selection/index.html" title="mod zcash_client_backend::data_api::wallet::input_selection">input_<wbr>selection</a></dt><dd>Types related to the process of selecting inputs to be spent given a transaction request.</dd></dl><h2 id="functions" class="section-header">Functions<a href="#functions" class="anchor">§</a></h2><dl class="item-table"><dt><a class="fn" href="fn.create_proposed_transactions.html" title="fn zcash_client_backend::data_api::wallet::create_proposed_transactions">create_<wbr>proposed_<wbr>transactions</a></dt><dd>Construct, prove, and sign a transaction or series of transactions using the inputs supplied by
|
||
the given proposal, and persist it to the wallet database.</dd><dt><a class="fn" href="fn.decrypt_and_store_transaction.html" title="fn zcash_client_backend::data_api::wallet::decrypt_and_store_transaction">decrypt_<wbr>and_<wbr>store_<wbr>transaction</a></dt><dd>Scans a [<code>Transaction</code>] for any information that can be decrypted by the accounts in
|
||
the wallet, and saves it to the wallet.</dd><dt><a class="fn" href="fn.propose_shielding.html" title="fn zcash_client_backend::data_api::wallet::propose_shielding">propose_<wbr>shielding</a><wbr><span class="stab portability" title="Available on crate feature `transparent-inputs` only"><code>transparent-inputs</code></span></dt><dd>Constructs a proposal to shield all of the funds belonging to the provided set of
|
||
addresses.</dd><dt><a class="fn" href="fn.propose_standard_transfer_to_address.html" title="fn zcash_client_backend::data_api::wallet::propose_standard_transfer_to_address">propose_<wbr>standard_<wbr>transfer_<wbr>to_<wbr>address</a></dt><dd>Proposes making a payment to the specified address from the given account.</dd><dt><a class="fn" href="fn.propose_transfer.html" title="fn zcash_client_backend::data_api::wallet::propose_transfer">propose_<wbr>transfer</a></dt><dd>Select transaction inputs, compute fees, and construct a proposal for a transaction or series
|
||
of transactions that can then be authorized and made ready for submission to the network with
|
||
<a href="fn.create_proposed_transactions.html" title="fn zcash_client_backend::data_api::wallet::create_proposed_transactions"><code>create_proposed_transactions</code></a>.</dd><dt><a class="fn" href="fn.shield_transparent_funds.html" title="fn zcash_client_backend::data_api::wallet::shield_transparent_funds">shield_<wbr>transparent_<wbr>funds</a><wbr><span class="stab portability" title="Available on crate feature `transparent-inputs` only"><code>transparent-inputs</code></span></dt><dd>Constructs a transaction that consumes available transparent UTXOs belonging to the specified
|
||
secret key, and sends them to the most-preferred receiver of the default internal address for
|
||
the provided Unified Spending Key.</dd></dl><h2 id="types" class="section-header">Type Aliases<a href="#types" class="anchor">§</a></h2><dl class="item-table"><dt><a class="type" href="type.CreateErrT.html" title="type zcash_client_backend::data_api::wallet::CreateErrT">Create<wbr>ErrT</a></dt><dd>Errors that may be generated in combined creation and execution of transaction proposals.</dd><dt><a class="type" href="type.ProposeShieldingErrT.html" title="type zcash_client_backend::data_api::wallet::ProposeShieldingErrT">Propose<wbr>Shielding<wbr>ErrT</a><wbr><span class="stab portability" title="Available on crate feature `transparent-inputs` only"><code>transparent-inputs</code></span></dt><dd>Errors that may be generated in construction of proposals for transparent->shielded
|
||
wallet-internal transfers.</dd><dt><a class="type" href="type.ProposeTransferErrT.html" title="type zcash_client_backend::data_api::wallet::ProposeTransferErrT">Propose<wbr>Transfer<wbr>ErrT</a></dt><dd>Errors that may be generated in construction of proposals for shielded->shielded or
|
||
shielded->transparent transfers.</dd><dt><a class="type" href="type.ShieldErrT.html" title="type zcash_client_backend::data_api::wallet::ShieldErrT">Shield<wbr>ErrT</a><wbr><span class="stab portability" title="Available on crate feature `transparent-inputs` only"><code>transparent-inputs</code></span></dt><dd>Errors that may be generated in the execution of shielding proposals.</dd><dt><a class="type" href="type.TransferErrT.html" title="type zcash_client_backend::data_api::wallet::TransferErrT">Transfer<wbr>ErrT</a></dt><dd>Errors that may be generated in the execution of proposals that may send shielded inputs.</dd></dl></section></div></main></body></html> |