ZcashLightClientKit/docs/rtd/Protocols/ZcashRustBackendWelding.html

2291 lines
128 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="en">
<head>
<title>ZcashRustBackendWelding Protocol Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset='utf-8'>
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
<script src="../js/lunr.min.js" defer></script>
<script src="../js/typeahead.jquery.js" defer></script>
<script src="../js/jazzy.search.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Protocol/ZcashRustBackendWelding" class="dashAnchor"></a>
<a title="ZcashRustBackendWelding Protocol Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="../index.html">ZcashLightClientKit 0.13.0-beta.2 Docs</a> (53% documented)</p>
<div class="header-right">
<form role="search" action="../search.json">
<input type="text" placeholder="Search documentation" data-typeahead>
</form>
</div>
</div>
</header>
<div class="content-wrapper">
<p id="breadcrumbs">
<a href="../index.html">ZcashLightClientKit Reference</a>
<img id="carat" src="../img/carat.png" alt=""/>
ZcashRustBackendWelding Protocol Reference
</p>
</div>
<div class="content-wrapper">
<nav class="sidebar">
<ul class="nav-groups">
<li class="nav-group-name">
<a href="../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Classes/CompactBlockProcessor.html">CompactBlockProcessor</a>
</li>
<li class="nav-group-task">
<a href="../Classes/CompactBlockProcessor/Configuration.html"> Configuration</a>
</li>
<li class="nav-group-task">
<a href="../Classes/CompactBlockProcessor/State.html"> State</a>
</li>
<li class="nav-group-task">
<a href="../Classes/DerivationTool.html">DerivationTool</a>
</li>
<li class="nav-group-task">
<a href="../Classes/Initializer.html">Initializer</a>
</li>
<li class="nav-group-task">
<a href="../Classes/LightWalletGRPCService.html">LightWalletGRPCService</a>
</li>
<li class="nav-group-task">
<a href="../Classes/SDKSynchronizer.html">SDKSynchronizer</a>
</li>
<li class="nav-group-task">
<a href="../Classes/SDKSynchronizer/NotificationKeys.html"> NotificationKeys</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ZcashSDKMainnetConstants.html">ZcashSDKMainnetConstants</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ZcashSDKTestnetConstants.html">ZcashSDKTestnetConstants</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../Enums.html">Enumerations</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Enums/CompactBlockProcessorError.html">CompactBlockProcessorError</a>
</li>
<li class="nav-group-task">
<a href="../Enums/CompactBlockProcessorNotificationKey.html">CompactBlockProcessorNotificationKey</a>
</li>
<li class="nav-group-task">
<a href="../Enums/CompactBlockProgress.html">CompactBlockProgress</a>
</li>
<li class="nav-group-task">
<a href="../Enums/ConnectionState.html">ConnectionState</a>
</li>
<li class="nav-group-task">
<a href="../Enums/GRPCResult.html">GRPCResult</a>
</li>
<li class="nav-group-task">
<a href="../Enums/InitializerError.html">InitializerError</a>
</li>
<li class="nav-group-task">
<a href="../Enums/KeyDerivationErrors.html">KeyDerivationErrors</a>
</li>
<li class="nav-group-task">
<a href="../Enums/LightWalletServiceError.html">LightWalletServiceError</a>
</li>
<li class="nav-group-task">
<a href="../Enums/NetworkType.html">NetworkType</a>
</li>
<li class="nav-group-task">
<a href="../Enums/ResourceProviderError.html">ResourceProviderError</a>
</li>
<li class="nav-group-task">
<a href="../Enums/RewindPolicy.html">RewindPolicy</a>
</li>
<li class="nav-group-task">
<a href="../Enums/RustWeldingError.html">RustWeldingError</a>
</li>
<li class="nav-group-task">
<a href="../Enums.html#/s:19ZcashLightClientKit10SDKMetricsO">SDKMetrics</a>
</li>
<li class="nav-group-task">
<a href="../Enums/SaplingParameterDownloader.html">SaplingParameterDownloader</a>
</li>
<li class="nav-group-task">
<a href="../Enums/SaplingParameterDownloader/Errors.html"> Errors</a>
</li>
<li class="nav-group-task">
<a href="../Enums/ShieldFundsError.html">ShieldFundsError</a>
</li>
<li class="nav-group-task">
<a href="../Enums/SyncStatus.html">SyncStatus</a>
</li>
<li class="nav-group-task">
<a href="../Enums/SynchronizerError.html">SynchronizerError</a>
</li>
<li class="nav-group-task">
<a href="../Enums/TransactionEncoderError.html">TransactionEncoderError</a>
</li>
<li class="nav-group-task">
<a href="../Enums/TransactionKind.html">TransactionKind</a>
</li>
<li class="nav-group-task">
<a href="../Enums/ZcashNetworkBuilder.html">ZcashNetworkBuilder</a>
</li>
<li class="nav-group-task">
<a href="../Enums.html#/s:19ZcashLightClientKit0A27RustBackendWeldingConstantsO">ZcashRustBackendWeldingConstants</a>
</li>
<li class="nav-group-task">
<a href="../Enums/ZcashSDK.html">ZcashSDK</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../Extensions.html">Extensions</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Extensions/ConsensusBranchID.html">ConsensusBranchID</a>
</li>
<li class="nav-group-task">
<a href="../Extensions/Data.html">Data</a>
</li>
<li class="nav-group-task">
<a href="../Extensions/Notification.html">Notification</a>
</li>
<li class="nav-group-task">
<a href="../Extensions/Notification/Name.html"> Name</a>
</li>
<li class="nav-group-task">
<a href="../Extensions/ServerStreamingCall.html">ServerStreamingCall</a>
</li>
<li class="nav-group-task">
<a href="../Extensions/String.html">String</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Protocols/AbstractTransaction.html">AbstractTransaction</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/CancellableCall.html">CancellableCall</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/CompactBlockDownloading.html">CompactBlockDownloading</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/ConfirmedTransactionEntity.html">ConfirmedTransactionEntity</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/EnhancementProgress.html">EnhancementProgress</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/KeyDeriving.html">KeyDeriving</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/KeyValidation.html">KeyValidation</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/LightWalletService.html">LightWalletService</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/LightWalletServiceResponse.html">LightWalletServiceResponse</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/LightWalletdInfo.html">LightWalletdInfo</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/Logger.html">Logger</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/MinedTransactionEntity.html">MinedTransactionEntity</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/NetworkConstants.html">NetworkConstants</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/PaginatedTransactionRepository.html">PaginatedTransactionRepository</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/PendingTransactionEntity.html">PendingTransactionEntity</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/RawIdentifiable.html">RawIdentifiable</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/ResourceProvider.html">ResourceProvider</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/SignedTransactionEntity.html">SignedTransactionEntity</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/Synchronizer.html">Synchronizer</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/TransactionEntity.html">TransactionEntity</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/UnifiedAddress.html">UnifiedAddress</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/UnifiedViewingKey.html">UnifiedViewingKey</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/UnspentTransactionOutputEntity.html">UnspentTransactionOutputEntity</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/WalletBalance.html">WalletBalance</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/ZcashNetwork.html">ZcashNetwork</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/ZcashRustBackendWelding.html">ZcashRustBackendWelding</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../Structs.html">Structures</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Structs/BlockProgress.html">BlockProgress</a>
</li>
<li class="nav-group-task">
<a href="../Structs/DefaultResourceProvider.html">DefaultResourceProvider</a>
</li>
<li class="nav-group-task">
<a href="../Structs/EnhancementStreamProgress.html">EnhancementStreamProgress</a>
</li>
<li class="nav-group-task">
<a href="../Structs/LightWalletEndpoint.html">LightWalletEndpoint</a>
</li>
<li class="nav-group-task">
<a href="../Structs/WalletBirthday.html">WalletBirthday</a>
</li>
<li class="nav-group-task">
<a href="../Structs/ZcashCompactBlock.html">ZcashCompactBlock</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../Typealiases.html">Type Aliases</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Typealiases.html#/s:19ZcashLightClientKit11BlockHeighta">BlockHeight</a>
</li>
<li class="nav-group-task">
<a href="../Typealiases.html#/s:19ZcashLightClientKit7Channela">Channel</a>
</li>
<li class="nav-group-task">
<a href="../Typealiases.html#/s:19ZcashLightClientKit17CompactBlockRangea">CompactBlockRange</a>
</li>
<li class="nav-group-task">
<a href="../Typealiases.html#/s:19ZcashLightClientKit17ConsensusBranchIDa">ConsensusBranchID</a>
</li>
<li class="nav-group-task">
<a href="../Typealiases.html#/s:19ZcashLightClientKit22ExtendedFullViewingKeya">ExtendedFullViewingKey</a>
</li>
<li class="nav-group-task">
<a href="../Typealiases.html#/s:19ZcashLightClientKit17ExtendedPublicKeya">ExtendedPublicKey</a>
</li>
<li class="nav-group-task">
<a href="../Typealiases.html#/s:19ZcashLightClientKit14RefreshedUTXOsa">RefreshedUTXOs</a>
</li>
<li class="nav-group-task">
<a href="../Typealiases.html#/s:19ZcashLightClientKit22SaplingShieldedAddressa">SaplingShieldedAddress</a>
</li>
<li class="nav-group-task">
<a href="../Typealiases.html#/s:19ZcashLightClientKit18TransparentAddressa">TransparentAddress</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section>
<section class="section">
<h1>ZcashRustBackendWelding</h1>
<div class="declaration">
<div class="language">
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">protocol</span> <span class="kt">ZcashRustBackendWelding</span></code></pre>
</div>
</div>
<p>Undocumented</p>
</section>
<section class="section task-group-section">
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:19ZcashLightClientKit0A18RustBackendWeldingP9lastErrorAA0egI0OSgyFZ"></a>
<a name="//apple_ref/swift/Method/lastError()" class="dashAnchor"></a>
<a class="token" href="#/s:19ZcashLightClientKit0A18RustBackendWeldingP9lastErrorAA0egI0OSgyFZ">lastError()</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>gets the latest error if available. Clear the existing error</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">static</span> <span class="kd">func</span> <span class="nf">lastError</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="kt"><a href="../Enums/RustWeldingError.html">RustWeldingError</a></span><span class="p">?</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:19ZcashLightClientKit0A18RustBackendWeldingP12getLastErrorSSSgyFZ"></a>
<a name="//apple_ref/swift/Method/getLastError()" class="dashAnchor"></a>
<a class="token" href="#/s:19ZcashLightClientKit0A18RustBackendWeldingP12getLastErrorSSSgyFZ">getLastError()</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>gets the latest error message from librustzcash. Does not clear existing error</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">static</span> <span class="kd">func</span> <span class="nf">getLastError</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="kt">String</span><span class="p">?</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:19ZcashLightClientKit0A18RustBackendWeldingP10initDataDb02dbI011networkTypey10Foundation3URLV_AA07NetworkM0OtKFZ"></a>
<a name="//apple_ref/swift/Method/initDataDb(dbData:networkType:)" class="dashAnchor"></a>
<a class="token" href="#/s:19ZcashLightClientKit0A18RustBackendWeldingP10initDataDb02dbI011networkTypey10Foundation3URLV_AA07NetworkM0OtKFZ">initDataDb(dbData:<wbr>networkType:<wbr>)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>initializes the data db</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">static</span> <span class="kd">func</span> <span class="nf">initDataDb</span><span class="p">(</span><span class="nv">dbData</span><span class="p">:</span> <span class="kt">URL</span><span class="p">,</span> <span class="nv">networkType</span><span class="p">:</span> <span class="kt"><a href="../Enums/NetworkType.html">NetworkType</a></span><span class="p">)</span> <span class="k">throws</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>dbData</em>
</code>
</td>
<td>
<div>
<p>location of the data db sql file</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:19ZcashLightClientKit0A18RustBackendWeldingP22isValidShieldedAddress_11networkTypeSbSS_AA07NetworkM0OtKFZ"></a>
<a name="//apple_ref/swift/Method/isValidShieldedAddress(_:networkType:)" class="dashAnchor"></a>
<a class="token" href="#/s:19ZcashLightClientKit0A18RustBackendWeldingP22isValidShieldedAddress_11networkTypeSbSS_AA07NetworkM0OtKFZ">isValidShieldedAddress(_:<wbr>networkType:<wbr>)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<div class="aside aside-throws">
<p class="aside-title">Throws</p>
Error when the provided address belongs to another network
</div>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">static</span> <span class="kd">func</span> <span class="nf">isValidShieldedAddress</span><span class="p">(</span><span class="n">_</span> <span class="nv">address</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span> <span class="nv">networkType</span><span class="p">:</span> <span class="kt"><a href="../Enums/NetworkType.html">NetworkType</a></span><span class="p">)</span> <span class="k">throws</span> <span class="o">-&gt;</span> <span class="kt">Bool</span></code></pre>
</div>
</div>
<div>
<h4>Return Value</h4>
<p>true when the address is valid and shielded. Returns false in any other case</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:19ZcashLightClientKit0A18RustBackendWeldingP25isValidTransparentAddress_11networkTypeSbSS_AA07NetworkM0OtKFZ"></a>
<a name="//apple_ref/swift/Method/isValidTransparentAddress(_:networkType:)" class="dashAnchor"></a>
<a class="token" href="#/s:19ZcashLightClientKit0A18RustBackendWeldingP25isValidTransparentAddress_11networkTypeSbSS_AA07NetworkM0OtKFZ">isValidTransparentAddress(_:<wbr>networkType:<wbr>)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<div class="aside aside-throws">
<p class="aside-title">Throws</p>
Error when the provided address belongs to another network
</div>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">static</span> <span class="kd">func</span> <span class="nf">isValidTransparentAddress</span><span class="p">(</span><span class="n">_</span> <span class="nv">address</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span> <span class="nv">networkType</span><span class="p">:</span> <span class="kt"><a href="../Enums/NetworkType.html">NetworkType</a></span><span class="p">)</span> <span class="k">throws</span> <span class="o">-&gt;</span> <span class="kt">Bool</span></code></pre>
</div>
</div>
<div>
<h4>Return Value</h4>
<p>true when the address is valid and transparent. false in any other case</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:19ZcashLightClientKit0A18RustBackendWeldingP29isValidExtendedFullViewingKey_11networkTypeSbSS_AA07NetworkO0OtKFZ"></a>
<a name="//apple_ref/swift/Method/isValidExtendedFullViewingKey(_:networkType:)" class="dashAnchor"></a>
<a class="token" href="#/s:19ZcashLightClientKit0A18RustBackendWeldingP29isValidExtendedFullViewingKey_11networkTypeSbSS_AA07NetworkO0OtKFZ">isValidExtendedFullViewingKey(_:<wbr>networkType:<wbr>)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<div class="aside aside-throws">
<p class="aside-title">Throws</p>
Error when there&rsquo;s another problem not related to validity of the string in question
</div>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">static</span> <span class="kd">func</span> <span class="nf">isValidExtendedFullViewingKey</span><span class="p">(</span><span class="n">_</span> <span class="nv">key</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span> <span class="nv">networkType</span><span class="p">:</span> <span class="kt"><a href="../Enums/NetworkType.html">NetworkType</a></span><span class="p">)</span> <span class="k">throws</span> <span class="o">-&gt;</span> <span class="kt">Bool</span></code></pre>
</div>
</div>
<div>
<h4>Return Value</h4>
<p>true when the address is valid and transparent. false in any other case</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:19ZcashLightClientKit0A18RustBackendWeldingP17initAccountsTable6dbData4seed8accounts11networkTypeSaySSGSg10Foundation3URLV_Says5UInt8VGs5Int32VAA07NetworkP0OtFZ"></a>
<a name="//apple_ref/swift/Method/initAccountsTable(dbData:seed:accounts:networkType:)" class="dashAnchor"></a>
<a class="token" href="#/s:19ZcashLightClientKit0A18RustBackendWeldingP17initAccountsTable6dbData4seed8accounts11networkTypeSaySSGSg10Foundation3URLV_Says5UInt8VGs5Int32VAA07NetworkP0OtFZ">initAccountsTable(dbData:<wbr>seed:<wbr>accounts:<wbr>networkType:<wbr>)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>initialize the accounts table from a given seed and a number of accounts</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">static</span> <span class="kd">func</span> <span class="nf">initAccountsTable</span><span class="p">(</span><span class="nv">dbData</span><span class="p">:</span> <span class="kt">URL</span><span class="p">,</span> <span class="nv">seed</span><span class="p">:</span> <span class="p">[</span><span class="kt">UInt8</span><span class="p">],</span> <span class="nv">accounts</span><span class="p">:</span> <span class="kt">Int32</span><span class="p">,</span> <span class="nv">networkType</span><span class="p">:</span> <span class="kt"><a href="../Enums/NetworkType.html">NetworkType</a></span><span class="p">)</span> <span class="o">-&gt;</span> <span class="p">[</span><span class="kt">String</span><span class="p">]?</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>dbData</em>
</code>
</td>
<td>
<div>
<p>location of the data db</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>seed</em>
</code>
</td>
<td>
<div>
<p>byte array of the zip32 seed</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>accounts</em>
</code>
</td>
<td>
<div>
<p>how many accounts you want to have</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:19ZcashLightClientKit0A18RustBackendWeldingP17initAccountsTable6dbData4uvks11networkTypeSb10Foundation3URLV_SayAA17UnifiedViewingKey_pGAA07NetworkO0OtKFZ"></a>
<a name="//apple_ref/swift/Method/initAccountsTable(dbData:uvks:networkType:)" class="dashAnchor"></a>
<a class="token" href="#/s:19ZcashLightClientKit0A18RustBackendWeldingP17initAccountsTable6dbData4uvks11networkTypeSb10Foundation3URLV_SayAA17UnifiedViewingKey_pGAA07NetworkO0OtKFZ">initAccountsTable(dbData:<wbr>uvks:<wbr>networkType:<wbr>)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>initialize the accounts table from a set of unified viewing keys</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">static</span> <span class="kd">func</span> <span class="nf">initAccountsTable</span><span class="p">(</span><span class="nv">dbData</span><span class="p">:</span> <span class="kt">URL</span><span class="p">,</span> <span class="nv">uvks</span><span class="p">:</span> <span class="p">[</span><span class="kt"><a href="../Protocols/UnifiedViewingKey.html">UnifiedViewingKey</a></span><span class="p">],</span> <span class="nv">networkType</span><span class="p">:</span> <span class="kt"><a href="../Enums/NetworkType.html">NetworkType</a></span><span class="p">)</span> <span class="k">throws</span> <span class="o">-&gt;</span> <span class="kt">Bool</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>dbData</em>
</code>
</td>
<td>
<div>
<p>location of the data db</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>uvks</em>
</code>
</td>
<td>
<div>
<p>an array of UnifiedViewingKeys</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:19ZcashLightClientKit0A18RustBackendWeldingP15initBlocksTable6dbData6height4hash4time11saplingTree11networkTypey10Foundation3URLV_s5Int32VSSs6UInt32VSSAA07NetworkS0OtKFZ"></a>
<a name="//apple_ref/swift/Method/initBlocksTable(dbData:height:hash:time:saplingTree:networkType:)" class="dashAnchor"></a>
<a class="token" href="#/s:19ZcashLightClientKit0A18RustBackendWeldingP15initBlocksTable6dbData6height4hash4time11saplingTree11networkTypey10Foundation3URLV_s5Int32VSSs6UInt32VSSAA07NetworkS0OtKFZ">initBlocksTable(dbData:<wbr>height:<wbr>hash:<wbr>time:<wbr>saplingTree:<wbr>networkType:<wbr>)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Undocumented</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">static</span> <span class="kd">func</span> <span class="nf">initBlocksTable</span><span class="p">(</span>
<span class="nv">dbData</span><span class="p">:</span> <span class="kt">URL</span><span class="p">,</span>
<span class="nv">height</span><span class="p">:</span> <span class="kt">Int32</span><span class="p">,</span>
<span class="nv">hash</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span>
<span class="nv">time</span><span class="p">:</span> <span class="kt">UInt32</span><span class="p">,</span>
<span class="nv">saplingTree</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span>
<span class="nv">networkType</span><span class="p">:</span> <span class="kt"><a href="../Enums/NetworkType.html">NetworkType</a></span>
<span class="p">)</span> <span class="k">throws</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:19ZcashLightClientKit0A18RustBackendWeldingP10getAddress6dbData7account11networkTypeSSSg10Foundation3URLV_s5Int32VAA07NetworkN0OtFZ"></a>
<a name="//apple_ref/swift/Method/getAddress(dbData:account:networkType:)" class="dashAnchor"></a>
<a class="token" href="#/s:19ZcashLightClientKit0A18RustBackendWeldingP10getAddress6dbData7account11networkTypeSSSg10Foundation3URLV_s5Int32VAA07NetworkN0OtFZ">getAddress(dbData:<wbr>account:<wbr>networkType:<wbr>)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>gets the address from data db from the given account</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">static</span> <span class="kd">func</span> <span class="nf">getAddress</span><span class="p">(</span><span class="nv">dbData</span><span class="p">:</span> <span class="kt">URL</span><span class="p">,</span> <span class="nv">account</span><span class="p">:</span> <span class="kt">Int32</span><span class="p">,</span> <span class="nv">networkType</span><span class="p">:</span> <span class="kt"><a href="../Enums/NetworkType.html">NetworkType</a></span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">String</span><span class="p">?</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>dbData</em>
</code>
</td>
<td>
<div>
<p>location of the data db</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>account</em>
</code>
</td>
<td>
<div>
<p>index of the given account</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>an optional string with the address if found</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:19ZcashLightClientKit0A18RustBackendWeldingP10getBalance6dbData7account11networkTypes5Int64V10Foundation3URLV_s5Int32VAA07NetworkN0OtFZ"></a>
<a name="//apple_ref/swift/Method/getBalance(dbData:account:networkType:)" class="dashAnchor"></a>
<a class="token" href="#/s:19ZcashLightClientKit0A18RustBackendWeldingP10getBalance6dbData7account11networkTypes5Int64V10Foundation3URLV_s5Int32VAA07NetworkN0OtFZ">getBalance(dbData:<wbr>account:<wbr>networkType:<wbr>)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>get the (unverified) balance from the given account</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">static</span> <span class="kd">func</span> <span class="nf">getBalance</span><span class="p">(</span><span class="nv">dbData</span><span class="p">:</span> <span class="kt">URL</span><span class="p">,</span> <span class="nv">account</span><span class="p">:</span> <span class="kt">Int32</span><span class="p">,</span> <span class="nv">networkType</span><span class="p">:</span> <span class="kt"><a href="../Enums/NetworkType.html">NetworkType</a></span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Int64</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>dbData</em>
</code>
</td>
<td>
<div>
<p>location of the data db</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>account</em>
</code>
</td>
<td>
<div>
<p>index of the given account</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:19ZcashLightClientKit0A18RustBackendWeldingP18getVerifiedBalance6dbData7account11networkTypes5Int64V10Foundation3URLV_s5Int32VAA07NetworkO0OtFZ"></a>
<a name="//apple_ref/swift/Method/getVerifiedBalance(dbData:account:networkType:)" class="dashAnchor"></a>
<a class="token" href="#/s:19ZcashLightClientKit0A18RustBackendWeldingP18getVerifiedBalance6dbData7account11networkTypes5Int64V10Foundation3URLV_s5Int32VAA07NetworkO0OtFZ">getVerifiedBalance(dbData:<wbr>account:<wbr>networkType:<wbr>)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>get the verified balance from the given account</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">static</span> <span class="kd">func</span> <span class="nf">getVerifiedBalance</span><span class="p">(</span><span class="nv">dbData</span><span class="p">:</span> <span class="kt">URL</span><span class="p">,</span> <span class="nv">account</span><span class="p">:</span> <span class="kt">Int32</span><span class="p">,</span> <span class="nv">networkType</span><span class="p">:</span> <span class="kt"><a href="../Enums/NetworkType.html">NetworkType</a></span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Int64</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>dbData</em>
</code>
</td>
<td>
<div>
<p>location of the data db</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>account</em>
</code>
</td>
<td>
<div>
<p>index of the given account</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:19ZcashLightClientKit0A18RustBackendWeldingP29getVerifiedTransparentBalance6dbData7address11networkTypes5Int64V10Foundation3URLV_SSAA07NetworkP0OtKFZ"></a>
<a name="//apple_ref/swift/Method/getVerifiedTransparentBalance(dbData:address:networkType:)" class="dashAnchor"></a>
<a class="token" href="#/s:19ZcashLightClientKit0A18RustBackendWeldingP29getVerifiedTransparentBalance6dbData7address11networkTypes5Int64V10Foundation3URLV_SSAA07NetworkP0OtKFZ">getVerifiedTransparentBalance(dbData:<wbr>address:<wbr>networkType:<wbr>)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Get the verified cached transparent balance for the given address</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">static</span> <span class="kd">func</span> <span class="nf">getVerifiedTransparentBalance</span><span class="p">(</span><span class="nv">dbData</span><span class="p">:</span> <span class="kt">URL</span><span class="p">,</span> <span class="nv">address</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span> <span class="nv">networkType</span><span class="p">:</span> <span class="kt"><a href="../Enums/NetworkType.html">NetworkType</a></span><span class="p">)</span> <span class="k">throws</span> <span class="o">-&gt;</span> <span class="kt">Int64</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:19ZcashLightClientKit0A18RustBackendWeldingP21getTransparentBalance6dbData7address11networkTypes5Int64V10Foundation3URLV_SSAA07NetworkO0OtKFZ"></a>
<a name="//apple_ref/swift/Method/getTransparentBalance(dbData:address:networkType:)" class="dashAnchor"></a>
<a class="token" href="#/s:19ZcashLightClientKit0A18RustBackendWeldingP21getTransparentBalance6dbData7address11networkTypes5Int64V10Foundation3URLV_SSAA07NetworkO0OtKFZ">getTransparentBalance(dbData:<wbr>address:<wbr>networkType:<wbr>)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Get the verified cached transparent balance for the given address</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">static</span> <span class="kd">func</span> <span class="nf">getTransparentBalance</span><span class="p">(</span><span class="nv">dbData</span><span class="p">:</span> <span class="kt">URL</span><span class="p">,</span> <span class="nv">address</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span> <span class="nv">networkType</span><span class="p">:</span> <span class="kt"><a href="../Enums/NetworkType.html">NetworkType</a></span><span class="p">)</span> <span class="k">throws</span> <span class="o">-&gt;</span> <span class="kt">Int64</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:19ZcashLightClientKit0A18RustBackendWeldingP21getReceivedMemoAsUTF86dbData6idNote11networkTypeSSSg10Foundation3URLV_s5Int64VAA07NetworkR0OtFZ"></a>
<a name="//apple_ref/swift/Method/getReceivedMemoAsUTF8(dbData:idNote:networkType:)" class="dashAnchor"></a>
<a class="token" href="#/s:19ZcashLightClientKit0A18RustBackendWeldingP21getReceivedMemoAsUTF86dbData6idNote11networkTypeSSSg10Foundation3URLV_s5Int64VAA07NetworkR0OtFZ">getReceivedMemoAsUTF8(dbData:<wbr>idNote:<wbr>networkType:<wbr>)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>get received memo from note</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">static</span> <span class="kd">func</span> <span class="nf">getReceivedMemoAsUTF8</span><span class="p">(</span><span class="nv">dbData</span><span class="p">:</span> <span class="kt">URL</span><span class="p">,</span> <span class="nv">idNote</span><span class="p">:</span> <span class="kt">Int64</span><span class="p">,</span> <span class="nv">networkType</span><span class="p">:</span> <span class="kt"><a href="../Enums/NetworkType.html">NetworkType</a></span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">String</span><span class="p">?</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>dbData</em>
</code>
</td>
<td>
<div>
<p>location of the data db file</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>idNote</em>
</code>
</td>
<td>
<div>
<p>note_id of note where the memo is located</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:19ZcashLightClientKit0A18RustBackendWeldingP17getSentMemoAsUTF86dbData6idNote11networkTypeSSSg10Foundation3URLV_s5Int64VAA07NetworkR0OtFZ"></a>
<a name="//apple_ref/swift/Method/getSentMemoAsUTF8(dbData:idNote:networkType:)" class="dashAnchor"></a>
<a class="token" href="#/s:19ZcashLightClientKit0A18RustBackendWeldingP17getSentMemoAsUTF86dbData6idNote11networkTypeSSSg10Foundation3URLV_s5Int64VAA07NetworkR0OtFZ">getSentMemoAsUTF8(dbData:<wbr>idNote:<wbr>networkType:<wbr>)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>get sent memo from note</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">static</span> <span class="kd">func</span> <span class="nf">getSentMemoAsUTF8</span><span class="p">(</span><span class="nv">dbData</span><span class="p">:</span> <span class="kt">URL</span><span class="p">,</span> <span class="nv">idNote</span><span class="p">:</span> <span class="kt">Int64</span><span class="p">,</span> <span class="nv">networkType</span><span class="p">:</span> <span class="kt"><a href="../Enums/NetworkType.html">NetworkType</a></span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">String</span><span class="p">?</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>dbData</em>
</code>
</td>
<td>
<div>
<p>location of the data db file</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>idNote</em>
</code>
</td>
<td>
<div>
<p>note_id of note where the memo is located</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:19ZcashLightClientKit0A18RustBackendWeldingP21validateCombinedChain7dbCache0K4Data11networkTypes5Int32V10Foundation3URLV_AlA07NetworkO0OtFZ"></a>
<a name="//apple_ref/swift/Method/validateCombinedChain(dbCache:dbData:networkType:)" class="dashAnchor"></a>
<a class="token" href="#/s:19ZcashLightClientKit0A18RustBackendWeldingP21validateCombinedChain7dbCache0K4Data11networkTypes5Int32V10Foundation3URLV_AlA07NetworkO0OtFZ">validateCombinedChain(dbCache:<wbr>dbData:<wbr>networkType:<wbr>)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Checks that the scanned blocks in the data database, when combined with the recent
<code>CompactBlock</code>s in the cache database, form a valid chain.
This function is built on the core assumption that the information provided in the
cache database is more likely to be accurate than the previously-scanned information.
This follows from the design (and trust) assumption that the <code>lightwalletd</code> server
provides accurate block information as of the time it was requested.
- Returns:
* <code>-1</code> if the combined chain is valid.
* <code>upper_bound</code> if the combined chain is invalid.
* <code>upper_bound</code> is the height of the highest invalid block (on the assumption that the highest block in the cache database is correct).
* <code>0</code> if there was an error during validation unrelated to chain validity.</p>
<div class="aside aside-important">
<p class="aside-title">Important</p>
This function does not mutate either of the databases.
</div>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">static</span> <span class="kd">func</span> <span class="nf">validateCombinedChain</span><span class="p">(</span><span class="nv">dbCache</span><span class="p">:</span> <span class="kt">URL</span><span class="p">,</span> <span class="nv">dbData</span><span class="p">:</span> <span class="kt">URL</span><span class="p">,</span> <span class="nv">networkType</span><span class="p">:</span> <span class="kt"><a href="../Enums/NetworkType.html">NetworkType</a></span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Int32</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:19ZcashLightClientKit0A18RustBackendWeldingP22getNearestRewindHeight6dbData6height11networkTypes5Int32V10Foundation3URLV_AiA07NetworkP0OtFZ"></a>
<a name="//apple_ref/swift/Method/getNearestRewindHeight(dbData:height:networkType:)" class="dashAnchor"></a>
<a class="token" href="#/s:19ZcashLightClientKit0A18RustBackendWeldingP22getNearestRewindHeight6dbData6height11networkTypes5Int32V10Foundation3URLV_AiA07NetworkP0OtFZ">getNearestRewindHeight(dbData:<wbr>height:<wbr>networkType:<wbr>)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Returns the nearest height where a rewind is possible. Currently prunning gets rid of sapling witnesses older
than 100 blocks. So in order to reconstruct the witness tree that allows to spend notes from the given wallet
the rewind can&rsquo;t be more than 100 block or back to the oldest unspent note that this wallet contains.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">static</span> <span class="kd">func</span> <span class="nf">getNearestRewindHeight</span><span class="p">(</span><span class="nv">dbData</span><span class="p">:</span> <span class="kt">URL</span><span class="p">,</span> <span class="nv">height</span><span class="p">:</span> <span class="kt">Int32</span><span class="p">,</span> <span class="nv">networkType</span><span class="p">:</span> <span class="kt"><a href="../Enums/NetworkType.html">NetworkType</a></span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Int32</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>dbData</em>
</code>
</td>
<td>
<div>
<p>location of the data db file</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>height</em>
</code>
</td>
<td>
<div>
<p>height you would like to rewind to.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:19ZcashLightClientKit0A18RustBackendWeldingP14rewindToHeight6dbData6height11networkTypeSb10Foundation3URLV_s5Int32VAA07NetworkO0OtFZ"></a>
<a name="//apple_ref/swift/Method/rewindToHeight(dbData:height:networkType:)" class="dashAnchor"></a>
<a class="token" href="#/s:19ZcashLightClientKit0A18RustBackendWeldingP14rewindToHeight6dbData6height11networkTypeSb10Foundation3URLV_s5Int32VAA07NetworkO0OtFZ">rewindToHeight(dbData:<wbr>height:<wbr>networkType:<wbr>)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>rewinds the compact block storage to the given height. clears up all derived data as well</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">static</span> <span class="kd">func</span> <span class="nf">rewindToHeight</span><span class="p">(</span><span class="nv">dbData</span><span class="p">:</span> <span class="kt">URL</span><span class="p">,</span> <span class="nv">height</span><span class="p">:</span> <span class="kt">Int32</span><span class="p">,</span> <span class="nv">networkType</span><span class="p">:</span> <span class="kt"><a href="../Enums/NetworkType.html">NetworkType</a></span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Bool</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>dbData</em>
</code>
</td>
<td>
<div>
<p>location of the data db file</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>height</em>
</code>
</td>
<td>
<div>
<p>height to rewind to. DON&rsquo;T PASS ARBITRARY HEIGHT. Use getNearestRewindHeight when unsure</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:19ZcashLightClientKit0A18RustBackendWeldingP10scanBlocks7dbCache0J4Data5limit11networkTypeSb10Foundation3URLV_AKs6UInt32VAA07NetworkO0OtFZ"></a>
<a name="//apple_ref/swift/Method/scanBlocks(dbCache:dbData:limit:networkType:)" class="dashAnchor"></a>
<a class="token" href="#/s:19ZcashLightClientKit0A18RustBackendWeldingP10scanBlocks7dbCache0J4Data5limit11networkTypeSb10Foundation3URLV_AKs6UInt32VAA07NetworkO0OtFZ">scanBlocks(dbCache:<wbr>dbData:<wbr>limit:<wbr>networkType:<wbr>)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Scans new blocks added to the cache for any transactions received by the tracked
accounts.
This function pays attention only to cached blocks with heights greater than the
highest scanned block in <code>db_data</code>. Cached blocks with lower heights are not verified
against previously-scanned blocks. In particular, this function <strong>assumes</strong> that the
caller is handling rollbacks.
For brand-new light client databases, this function starts scanning from the Sapling
activation height. This height can be fast-forwarded to a more recent block by calling
[<code>zcashlc_init_blocks_table</code>] before this function.
Scanned blocks are required to be height-sequential. If a block is missing from the
cache, an error will be signalled.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">static</span> <span class="kd">func</span> <span class="nf">scanBlocks</span><span class="p">(</span><span class="nv">dbCache</span><span class="p">:</span> <span class="kt">URL</span><span class="p">,</span> <span class="nv">dbData</span><span class="p">:</span> <span class="kt">URL</span><span class="p">,</span> <span class="nv">limit</span><span class="p">:</span> <span class="kt">UInt32</span><span class="p">,</span> <span class="nv">networkType</span><span class="p">:</span> <span class="kt"><a href="../Enums/NetworkType.html">NetworkType</a></span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Bool</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>dbCache</em>
</code>
</td>
<td>
<div>
<p>location of the compact block cache db</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>dbData</em>
</code>
</td>
<td>
<div>
<p>location of the data db file</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>limit</em>
</code>
</td>
<td>
<div>
<p>scan up to limit blocks. pass 0 to set no limit.
returns false if fails to scan.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:19ZcashLightClientKit0A18RustBackendWeldingP27putUnspentTransparentOutput6dbData7address4txid5index6script5value6height11networkTypeSb10Foundation3URLV_SSSays5UInt8VGSiARs5Int64VSiAA07NetworkU0OtKFZ"></a>
<a name="//apple_ref/swift/Method/putUnspentTransparentOutput(dbData:address:txid:index:script:value:height:networkType:)" class="dashAnchor"></a>
<a class="token" href="#/s:19ZcashLightClientKit0A18RustBackendWeldingP27putUnspentTransparentOutput6dbData7address4txid5index6script5value6height11networkTypeSb10Foundation3URLV_SSSays5UInt8VGSiARs5Int64VSiAA07NetworkU0OtKFZ">putUnspentTransparentOutput(dbData:<wbr>address:<wbr>txid:<wbr>index:<wbr>script:<wbr>value:<wbr>height:<wbr>networkType:<wbr>)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>puts a UTXO into the data db database</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">static</span> <span class="kd">func</span> <span class="nf">putUnspentTransparentOutput</span><span class="p">(</span>
<span class="nv">dbData</span><span class="p">:</span> <span class="kt">URL</span><span class="p">,</span>
<span class="nv">address</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span>
<span class="nv">txid</span><span class="p">:</span> <span class="p">[</span><span class="kt">UInt8</span><span class="p">],</span>
<span class="nv">index</span><span class="p">:</span> <span class="kt">Int</span><span class="p">,</span>
<span class="nv">script</span><span class="p">:</span> <span class="p">[</span><span class="kt">UInt8</span><span class="p">],</span>
<span class="nv">value</span><span class="p">:</span> <span class="kt">Int64</span><span class="p">,</span>
<span class="nv">height</span><span class="p">:</span> <span class="kt"><a href="../Typealiases.html#/s:19ZcashLightClientKit11BlockHeighta">BlockHeight</a></span><span class="p">,</span>
<span class="nv">networkType</span><span class="p">:</span> <span class="kt"><a href="../Enums/NetworkType.html">NetworkType</a></span>
<span class="p">)</span> <span class="k">throws</span> <span class="o">-&gt;</span> <span class="kt">Bool</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>dbData</em>
</code>
</td>
<td>
<div>
<p>location of the data db file</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>address</em>
</code>
</td>
<td>
<div>
<p>the address of the UTXO</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>txid</em>
</code>
</td>
<td>
<div>
<p>the txid bytes for the UTXO</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>index</em>
</code>
</td>
<td>
<div>
<p>the index of the UTXO</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>value</em>
</code>
</td>
<td>
<div>
<p>the value of the UTXO</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>height</em>
</code>
</td>
<td>
<div>
<p>the mined height for the UTXO</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>true if the operation succeeded or false otherwise</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:19ZcashLightClientKit0A18RustBackendWeldingP10clearUtxos6dbData7address11sinceHeight11networkTypes5Int32V10Foundation3URLV_SSSiAA07NetworkP0OtKFZ"></a>
<a name="//apple_ref/swift/Method/clearUtxos(dbData:address:sinceHeight:networkType:)" class="dashAnchor"></a>
<a class="token" href="#/s:19ZcashLightClientKit0A18RustBackendWeldingP10clearUtxos6dbData7address11sinceHeight11networkTypes5Int32V10Foundation3URLV_SSSiAA07NetworkP0OtKFZ">clearUtxos(dbData:<wbr>address:<wbr>sinceHeight:<wbr>networkType:<wbr>)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>clears the cached utxos for the given address from the specified height on</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">static</span> <span class="kd">func</span> <span class="nf">clearUtxos</span><span class="p">(</span><span class="nv">dbData</span><span class="p">:</span> <span class="kt">URL</span><span class="p">,</span> <span class="nv">address</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span> <span class="nv">sinceHeight</span><span class="p">:</span> <span class="kt"><a href="../Typealiases.html#/s:19ZcashLightClientKit11BlockHeighta">BlockHeight</a></span><span class="p">,</span> <span class="nv">networkType</span><span class="p">:</span> <span class="kt"><a href="../Enums/NetworkType.html">NetworkType</a></span><span class="p">)</span> <span class="k">throws</span> <span class="o">-&gt;</span> <span class="kt">Int32</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>dbData</em>
</code>
</td>
<td>
<div>
<p>location of the data db file</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>address</em>
</code>
</td>
<td>
<div>
<p>the address of the UTXO</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>sinceheight</em>
</code>
</td>
<td>
<div>
<p>clear the UXTOs from that address on</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>the amount of UTXOs cleared or -1 on error</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:19ZcashLightClientKit0A18RustBackendWeldingP21downloadedUtxoBalance6dbData7address11networkTypeAA06WalletJ0_p10Foundation3URLV_SSAA07NetworkO0OtKFZ"></a>
<a name="//apple_ref/swift/Method/downloadedUtxoBalance(dbData:address:networkType:)" class="dashAnchor"></a>
<a class="token" href="#/s:19ZcashLightClientKit0A18RustBackendWeldingP21downloadedUtxoBalance6dbData7address11networkTypeAA06WalletJ0_p10Foundation3URLV_SSAA07NetworkO0OtKFZ">downloadedUtxoBalance(dbData:<wbr>address:<wbr>networkType:<wbr>)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Gets the balance of the previously downloaded UTXOs</p>
<div class="aside aside-throws">
<p class="aside-title">Throws</p>
Rustwelding Error if something fails
</div>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">static</span> <span class="kd">func</span> <span class="nf">downloadedUtxoBalance</span><span class="p">(</span><span class="nv">dbData</span><span class="p">:</span> <span class="kt">URL</span><span class="p">,</span> <span class="nv">address</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span> <span class="nv">networkType</span><span class="p">:</span> <span class="kt"><a href="../Enums/NetworkType.html">NetworkType</a></span><span class="p">)</span> <span class="k">throws</span> <span class="o">-&gt;</span> <span class="kt"><a href="../Protocols/WalletBalance.html">WalletBalance</a></span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>dbData</em>
</code>
</td>
<td>
<div>
<p>location of the data db file</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>address</em>
</code>
</td>
<td>
<div>
<p>the address of the UTXO</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>the wallet balance containing verified and total balance.</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:19ZcashLightClientKit0A18RustBackendWeldingP26decryptAndStoreTransaction6dbData7txBytes11minedHeight11networkTypeSb10Foundation3URLV_Says5UInt8VGs5Int32VAA07NetworkS0OtFZ"></a>
<a name="//apple_ref/swift/Method/decryptAndStoreTransaction(dbData:txBytes:minedHeight:networkType:)" class="dashAnchor"></a>
<a class="token" href="#/s:19ZcashLightClientKit0A18RustBackendWeldingP26decryptAndStoreTransaction6dbData7txBytes11minedHeight11networkTypeSb10Foundation3URLV_Says5UInt8VGs5Int32VAA07NetworkS0OtFZ">decryptAndStoreTransaction(dbData:<wbr>txBytes:<wbr>minedHeight:<wbr>networkType:<wbr>)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Scans a transaction for any information that can be decrypted by the accounts in the
wallet, and saves it to the wallet.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">static</span> <span class="kd">func</span> <span class="nf">decryptAndStoreTransaction</span><span class="p">(</span>
<span class="nv">dbData</span><span class="p">:</span> <span class="kt">URL</span><span class="p">,</span>
<span class="nv">txBytes</span><span class="p">:</span> <span class="p">[</span><span class="kt">UInt8</span><span class="p">],</span>
<span class="nv">minedHeight</span><span class="p">:</span> <span class="kt">Int32</span><span class="p">,</span>
<span class="nv">networkType</span><span class="p">:</span> <span class="kt"><a href="../Enums/NetworkType.html">NetworkType</a></span>
<span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Bool</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>dbData</em>
</code>
</td>
<td>
<div>
<p>location of the data db file</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>tx</em>
</code>
</td>
<td>
<div>
<p>the transaction to decrypt</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>minedHeight</em>
</code>
</td>
<td>
<div>
<p>height on which this transaction was mined. this is used to fetch the consensus branch ID.
returns false if fails to decrypt.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:19ZcashLightClientKit0A18RustBackendWeldingP15createToAddress6dbData7account5extsk2to5value4memo15spendParamsPath06outputsT011networkTypes5Int64V10Foundation3URLV_s5Int32VS2SAOSSSgS2SAA07NetworkW0OtFZ"></a>
<a name="//apple_ref/swift/Method/createToAddress(dbData:account:extsk:to:value:memo:spendParamsPath:outputParamsPath:networkType:)" class="dashAnchor"></a>
<a class="token" href="#/s:19ZcashLightClientKit0A18RustBackendWeldingP15createToAddress6dbData7account5extsk2to5value4memo15spendParamsPath06outputsT011networkTypes5Int64V10Foundation3URLV_s5Int32VS2SAOSSSgS2SAA07NetworkW0OtFZ">createToAddress(dbData:<wbr>account:<wbr>extsk:<wbr>to:<wbr>value:<wbr>memo:<wbr>spendParamsPath:<wbr>outputParamsPath:<wbr>networkType:<wbr>)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Undocumented</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">static</span> <span class="kd">func</span> <span class="nf">createToAddress</span><span class="p">(</span>
<span class="nv">dbData</span><span class="p">:</span> <span class="kt">URL</span><span class="p">,</span>
<span class="nv">account</span><span class="p">:</span> <span class="kt">Int32</span><span class="p">,</span>
<span class="nv">extsk</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span>
<span class="n">to</span> <span class="nv">address</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span>
<span class="nv">value</span><span class="p">:</span> <span class="kt">Int64</span><span class="p">,</span>
<span class="nv">memo</span><span class="p">:</span> <span class="kt">String</span><span class="p">?,</span>
<span class="nv">spendParamsPath</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span>
<span class="nv">outputParamsPath</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span>
<span class="nv">networkType</span><span class="p">:</span> <span class="kt"><a href="../Enums/NetworkType.html">NetworkType</a></span>
<span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Int64</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:19ZcashLightClientKit0A18RustBackendWeldingP11shieldFunds7dbCache0J4Data7account3tsk5extsk4memo15spendParamsPath06outputrS011networkTypes5Int64V10Foundation3URLV_ARs5Int32VS3SSgS2SAA07NetworkV0OtFZ"></a>
<a name="//apple_ref/swift/Method/shieldFunds(dbCache:dbData:account:tsk:extsk:memo:spendParamsPath:outputParamsPath:networkType:)" class="dashAnchor"></a>
<a class="token" href="#/s:19ZcashLightClientKit0A18RustBackendWeldingP11shieldFunds7dbCache0J4Data7account3tsk5extsk4memo15spendParamsPath06outputrS011networkTypes5Int64V10Foundation3URLV_ARs5Int32VS3SSgS2SAA07NetworkV0OtFZ">shieldFunds(dbCache:<wbr>dbData:<wbr>account:<wbr>tsk:<wbr>extsk:<wbr>memo:<wbr>spendParamsPath:<wbr>outputParamsPath:<wbr>networkType:<wbr>)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Undocumented</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">static</span> <span class="kd">func</span> <span class="nf">shieldFunds</span><span class="p">(</span>
<span class="nv">dbCache</span><span class="p">:</span> <span class="kt">URL</span><span class="p">,</span>
<span class="nv">dbData</span><span class="p">:</span> <span class="kt">URL</span><span class="p">,</span>
<span class="nv">account</span><span class="p">:</span> <span class="kt">Int32</span><span class="p">,</span>
<span class="nv">tsk</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span>
<span class="nv">extsk</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span>
<span class="nv">memo</span><span class="p">:</span> <span class="kt">String</span><span class="p">?,</span>
<span class="nv">spendParamsPath</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span>
<span class="nv">outputParamsPath</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span>
<span class="nv">networkType</span><span class="p">:</span> <span class="kt"><a href="../Enums/NetworkType.html">NetworkType</a></span>
<span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Int64</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:19ZcashLightClientKit0A18RustBackendWeldingP28deriveExtendedFullViewingKey_11networkTypeSSSgSS_AA07NetworkN0OtKFZ"></a>
<a name="//apple_ref/swift/Method/deriveExtendedFullViewingKey(_:networkType:)" class="dashAnchor"></a>
<a class="token" href="#/s:19ZcashLightClientKit0A18RustBackendWeldingP28deriveExtendedFullViewingKey_11networkTypeSSSgSS_AA07NetworkN0OtKFZ">deriveExtendedFullViewingKey(_:<wbr>networkType:<wbr>)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Derives a full viewing key from a seed</p>
<div class="aside aside-throws">
<p class="aside-title">Throws</p>
RustBackendError if fatal error occurs
</div>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">static</span> <span class="kd">func</span> <span class="nf">deriveExtendedFullViewingKey</span><span class="p">(</span><span class="n">_</span> <span class="nv">spendingKey</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span> <span class="nv">networkType</span><span class="p">:</span> <span class="kt"><a href="../Enums/NetworkType.html">NetworkType</a></span><span class="p">)</span> <span class="k">throws</span> <span class="o">-&gt;</span> <span class="kt">String</span><span class="p">?</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>spendingKey</em>
</code>
</td>
<td>
<div>
<p>a string containing the spending key</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>the derived key</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:19ZcashLightClientKit0A18RustBackendWeldingP29deriveExtendedFullViewingKeys4seed8accounts11networkTypeSaySSGSgSays5UInt8VG_s5Int32VAA07NetworkP0OtKFZ"></a>
<a name="//apple_ref/swift/Method/deriveExtendedFullViewingKeys(seed:accounts:networkType:)" class="dashAnchor"></a>
<a class="token" href="#/s:19ZcashLightClientKit0A18RustBackendWeldingP29deriveExtendedFullViewingKeys4seed8accounts11networkTypeSaySSGSgSays5UInt8VG_s5Int32VAA07NetworkP0OtKFZ">deriveExtendedFullViewingKeys(seed:<wbr>accounts:<wbr>networkType:<wbr>)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Derives a set of full viewing keys from a seed</p>
<div class="aside aside-throws">
<p class="aside-title">Throws</p>
RustBackendError if fatal error occurs
</div>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">static</span> <span class="kd">func</span> <span class="nf">deriveExtendedFullViewingKeys</span><span class="p">(</span><span class="nv">seed</span><span class="p">:</span> <span class="p">[</span><span class="kt">UInt8</span><span class="p">],</span> <span class="nv">accounts</span><span class="p">:</span> <span class="kt">Int32</span><span class="p">,</span> <span class="nv">networkType</span><span class="p">:</span> <span class="kt"><a href="../Enums/NetworkType.html">NetworkType</a></span><span class="p">)</span> <span class="k">throws</span> <span class="o">-&gt;</span> <span class="p">[</span><span class="kt">String</span><span class="p">]?</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>spendingKey</em>
</code>
</td>
<td>
<div>
<p>a string containing the spending key</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>accounts</em>
</code>
</td>
<td>
<div>
<p>the number of accounts you want to derive from this seed</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>an array containing the derived keys</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:19ZcashLightClientKit0A18RustBackendWeldingP26deriveExtendedSpendingKeys4seed8accounts11networkTypeSaySSGSgSays5UInt8VG_s5Int32VAA07NetworkO0OtKFZ"></a>
<a name="//apple_ref/swift/Method/deriveExtendedSpendingKeys(seed:accounts:networkType:)" class="dashAnchor"></a>
<a class="token" href="#/s:19ZcashLightClientKit0A18RustBackendWeldingP26deriveExtendedSpendingKeys4seed8accounts11networkTypeSaySSGSgSays5UInt8VG_s5Int32VAA07NetworkO0OtKFZ">deriveExtendedSpendingKeys(seed:<wbr>accounts:<wbr>networkType:<wbr>)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Derives a set of full viewing keys from a seed</p>
<div class="aside aside-throws">
<p class="aside-title">Throws</p>
RustBackendError if fatal error occurs
</div>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">static</span> <span class="kd">func</span> <span class="nf">deriveExtendedSpendingKeys</span><span class="p">(</span><span class="nv">seed</span><span class="p">:</span> <span class="p">[</span><span class="kt">UInt8</span><span class="p">],</span> <span class="nv">accounts</span><span class="p">:</span> <span class="kt">Int32</span><span class="p">,</span> <span class="nv">networkType</span><span class="p">:</span> <span class="kt"><a href="../Enums/NetworkType.html">NetworkType</a></span><span class="p">)</span> <span class="k">throws</span> <span class="o">-&gt;</span> <span class="p">[</span><span class="kt">String</span><span class="p">]?</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>seed</em>
</code>
</td>
<td>
<div>
<p>a string containing the seed</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>accounts</em>
</code>
</td>
<td>
<div>
<p>the number of accounts you want to derive from this seed</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>an array containing the spending keys</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:19ZcashLightClientKit0A18RustBackendWeldingP29deriveShieldedAddressFromSeed4seed12accountIndex11networkTypeSSSgSays5UInt8VG_s5Int32VAA07NetworkQ0OtKFZ"></a>
<a name="//apple_ref/swift/Method/deriveShieldedAddressFromSeed(seed:accountIndex:networkType:)" class="dashAnchor"></a>
<a class="token" href="#/s:19ZcashLightClientKit0A18RustBackendWeldingP29deriveShieldedAddressFromSeed4seed12accountIndex11networkTypeSSSgSays5UInt8VG_s5Int32VAA07NetworkQ0OtKFZ">deriveShieldedAddressFromSeed(seed:<wbr>accountIndex:<wbr>networkType:<wbr>)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Derives a shielded address from a seed</p>
<div class="aside aside-throws">
<p class="aside-title">Throws</p>
RustBackendError if fatal error occurs
</div>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">static</span> <span class="kd">func</span> <span class="nf">deriveShieldedAddressFromSeed</span><span class="p">(</span><span class="nv">seed</span><span class="p">:</span> <span class="p">[</span><span class="kt">UInt8</span><span class="p">],</span> <span class="nv">accountIndex</span><span class="p">:</span> <span class="kt">Int32</span><span class="p">,</span> <span class="nv">networkType</span><span class="p">:</span> <span class="kt"><a href="../Enums/NetworkType.html">NetworkType</a></span><span class="p">)</span> <span class="k">throws</span> <span class="o">-&gt;</span> <span class="kt">String</span><span class="p">?</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>seed</em>
</code>
</td>
<td>
<div>
<p>an array of bytes of the seed</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>accountIndex</em>
</code>
</td>
<td>
<div>
<p>the index of the account you want the address for</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>an optional String containing the Shielded address</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:19ZcashLightClientKit0A18RustBackendWeldingP35deriveShieldedAddressFromViewingKey_11networkTypeSSSgSS_AA07NetworkO0OtKFZ"></a>
<a name="//apple_ref/swift/Method/deriveShieldedAddressFromViewingKey(_:networkType:)" class="dashAnchor"></a>
<a class="token" href="#/s:19ZcashLightClientKit0A18RustBackendWeldingP35deriveShieldedAddressFromViewingKey_11networkTypeSSSgSS_AA07NetworkO0OtKFZ">deriveShieldedAddressFromViewingKey(_:<wbr>networkType:<wbr>)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Derives a shielded address from an Extended Full Viewing Key</p>
<div class="aside aside-throws">
<p class="aside-title">Throws</p>
RustBackendError if fatal error occurs
</div>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">static</span> <span class="kd">func</span> <span class="nf">deriveShieldedAddressFromViewingKey</span><span class="p">(</span><span class="n">_</span> <span class="nv">extfvk</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span> <span class="nv">networkType</span><span class="p">:</span> <span class="kt"><a href="../Enums/NetworkType.html">NetworkType</a></span><span class="p">)</span> <span class="k">throws</span> <span class="o">-&gt;</span> <span class="kt">String</span><span class="p">?</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>extfvk</em>
</code>
</td>
<td>
<div>
<p>a string containing the extended full viewing key</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>an optional String containing the Shielded address</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:19ZcashLightClientKit0A18RustBackendWeldingP32deriveTransparentAddressFromSeed4seed7account5index11networkTypeSSSgSays5UInt8VG_S2iAA07NetworkQ0OtKFZ"></a>
<a name="//apple_ref/swift/Method/deriveTransparentAddressFromSeed(seed:account:index:networkType:)" class="dashAnchor"></a>
<a class="token" href="#/s:19ZcashLightClientKit0A18RustBackendWeldingP32deriveTransparentAddressFromSeed4seed7account5index11networkTypeSSSgSays5UInt8VG_S2iAA07NetworkQ0OtKFZ">deriveTransparentAddressFromSeed(seed:<wbr>account:<wbr>index:<wbr>networkType:<wbr>)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Derives a shielded address from an Extended Full Viewing Key</p>
<div class="aside aside-throws">
<p class="aside-title">Throws</p>
RustBackendError if fatal error occurs
</div>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">static</span> <span class="kd">func</span> <span class="nf">deriveTransparentAddressFromSeed</span><span class="p">(</span><span class="nv">seed</span><span class="p">:</span> <span class="p">[</span><span class="kt">UInt8</span><span class="p">],</span> <span class="nv">account</span><span class="p">:</span> <span class="kt">Int</span><span class="p">,</span> <span class="nv">index</span><span class="p">:</span> <span class="kt">Int</span><span class="p">,</span> <span class="nv">networkType</span><span class="p">:</span> <span class="kt"><a href="../Enums/NetworkType.html">NetworkType</a></span><span class="p">)</span> <span class="k">throws</span> <span class="o">-&gt;</span> <span class="kt">String</span><span class="p">?</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>seed</em>
</code>
</td>
<td>
<div>
<p>an array of bytes of the seed</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>an optional String containing the transparent address</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:19ZcashLightClientKit0A18RustBackendWeldingP35deriveTransparentPrivateKeyFromSeed4seed7account5index11networkTypeSSSgSays5UInt8VG_S2iAA07NetworkR0OtKFZ"></a>
<a name="//apple_ref/swift/Method/deriveTransparentPrivateKeyFromSeed(seed:account:index:networkType:)" class="dashAnchor"></a>
<a class="token" href="#/s:19ZcashLightClientKit0A18RustBackendWeldingP35deriveTransparentPrivateKeyFromSeed4seed7account5index11networkTypeSSSgSays5UInt8VG_S2iAA07NetworkR0OtKFZ">deriveTransparentPrivateKeyFromSeed(seed:<wbr>account:<wbr>index:<wbr>networkType:<wbr>)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Derives a transparent secret key from Seed</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">static</span> <span class="kd">func</span> <span class="nf">deriveTransparentPrivateKeyFromSeed</span><span class="p">(</span><span class="nv">seed</span><span class="p">:</span> <span class="p">[</span><span class="kt">UInt8</span><span class="p">],</span> <span class="nv">account</span><span class="p">:</span> <span class="kt">Int</span><span class="p">,</span> <span class="nv">index</span><span class="p">:</span> <span class="kt">Int</span><span class="p">,</span> <span class="nv">networkType</span><span class="p">:</span> <span class="kt"><a href="../Enums/NetworkType.html">NetworkType</a></span><span class="p">)</span> <span class="k">throws</span> <span class="o">-&gt;</span> <span class="kt">String</span><span class="p">?</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>seed</em>
</code>
</td>
<td>
<div>
<p>an array of bytes containing the seed</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>an optional String containing the transparent secret (private) key</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:19ZcashLightClientKit0A18RustBackendWeldingP37deriveTransparentAddressFromSecretKey_11networkTypeSSSgSS_AA07NetworkO0OtKFZ"></a>
<a name="//apple_ref/swift/Method/deriveTransparentAddressFromSecretKey(_:networkType:)" class="dashAnchor"></a>
<a class="token" href="#/s:19ZcashLightClientKit0A18RustBackendWeldingP37deriveTransparentAddressFromSecretKey_11networkTypeSSSgSS_AA07NetworkO0OtKFZ">deriveTransparentAddressFromSecretKey(_:<wbr>networkType:<wbr>)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Derives a transparent address from a secret key</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">static</span> <span class="kd">func</span> <span class="nf">deriveTransparentAddressFromSecretKey</span><span class="p">(</span><span class="n">_</span> <span class="nv">tsk</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span> <span class="nv">networkType</span><span class="p">:</span> <span class="kt"><a href="../Enums/NetworkType.html">NetworkType</a></span><span class="p">)</span> <span class="k">throws</span> <span class="o">-&gt;</span> <span class="kt">String</span><span class="p">?</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>tsk</em>
</code>
</td>
<td>
<div>
<p>a hex string containing the Secret Key</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>an optional String containing the transparent address.</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:19ZcashLightClientKit0A18RustBackendWeldingP38derivedTransparentAddressFromPublicKey_11networkTypeS2S_AA07NetworkO0OtKFZ"></a>
<a name="//apple_ref/swift/Method/derivedTransparentAddressFromPublicKey(_:networkType:)" class="dashAnchor"></a>
<a class="token" href="#/s:19ZcashLightClientKit0A18RustBackendWeldingP38derivedTransparentAddressFromPublicKey_11networkTypeS2S_AA07NetworkO0OtKFZ">derivedTransparentAddressFromPublicKey(_:<wbr>networkType:<wbr>)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Derives a transparent address from a public key</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">static</span> <span class="kd">func</span> <span class="nf">derivedTransparentAddressFromPublicKey</span><span class="p">(</span><span class="n">_</span> <span class="nv">pubkey</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span> <span class="nv">networkType</span><span class="p">:</span> <span class="kt"><a href="../Enums/NetworkType.html">NetworkType</a></span><span class="p">)</span> <span class="k">throws</span> <span class="o">-&gt;</span> <span class="kt">String</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>pubkey</em>
</code>
</td>
<td>
<div>
<p>public key represented as a string</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:19ZcashLightClientKit0A18RustBackendWeldingP31deriveUnifiedViewingKeyFromSeed_16numberOfAccounts11networkTypeSayAA0ijK0_pGSays5UInt8VG_SiAA07NetworkR0OtKFZ"></a>
<a name="//apple_ref/swift/Method/deriveUnifiedViewingKeyFromSeed(_:numberOfAccounts:networkType:)" class="dashAnchor"></a>
<a class="token" href="#/s:19ZcashLightClientKit0A18RustBackendWeldingP31deriveUnifiedViewingKeyFromSeed_16numberOfAccounts11networkTypeSayAA0ijK0_pGSays5UInt8VG_SiAA07NetworkR0OtKFZ">deriveUnifiedViewingKeyFromSeed(_:<wbr>numberOfAccounts:<wbr>networkType:<wbr>)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Undocumented</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">static</span> <span class="kd">func</span> <span class="nf">deriveUnifiedViewingKeyFromSeed</span><span class="p">(</span><span class="n">_</span> <span class="nv">seed</span><span class="p">:</span> <span class="p">[</span><span class="kt">UInt8</span><span class="p">],</span> <span class="nv">numberOfAccounts</span><span class="p">:</span> <span class="kt">Int</span><span class="p">,</span> <span class="nv">networkType</span><span class="p">:</span> <span class="kt"><a href="../Enums/NetworkType.html">NetworkType</a></span><span class="p">)</span> <span class="k">throws</span> <span class="o">-&gt;</span> <span class="p">[</span><span class="kt"><a href="../Protocols/UnifiedViewingKey.html">UnifiedViewingKey</a></span><span class="p">]</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:19ZcashLightClientKit0A18RustBackendWeldingP20consensusBranchIdFor6height11networkTypes5Int32VAH_AA07NetworkN0OtKFZ"></a>
<a name="//apple_ref/swift/Method/consensusBranchIdFor(height:networkType:)" class="dashAnchor"></a>
<a class="token" href="#/s:19ZcashLightClientKit0A18RustBackendWeldingP20consensusBranchIdFor6height11networkTypes5Int32VAH_AA07NetworkN0OtKFZ">consensusBranchIdFor(height:<wbr>networkType:<wbr>)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Gets the consensus branch id for the given height</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">static</span> <span class="kd">func</span> <span class="nf">consensusBranchIdFor</span><span class="p">(</span><span class="nv">height</span><span class="p">:</span> <span class="kt">Int32</span><span class="p">,</span> <span class="nv">networkType</span><span class="p">:</span> <span class="kt"><a href="../Enums/NetworkType.html">NetworkType</a></span><span class="p">)</span> <span class="k">throws</span> <span class="o">-&gt;</span> <span class="kt">Int32</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>height</em>
</code>
</td>
<td>
<div>
<p>the height you what to know the branch id for</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</section>
</div>
</li>
</ul>
</div>
</section>
</section>
<section id="footer">
<p>&copy; 2022 <a class="link" href="https://github.com/zcash/ZcashLightClientKit" target="_blank" rel="external noopener">Francisco Gindre and Jack Grigg</a>. All rights reserved. (Last updated: 2022-04-07)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external noopener">jazzy ♪♫ v0.14.2</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external noopener">Realm</a> project.</p>
</section>
</article>
</div>
</body>
</html>