mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-16 02:25:47 +00:00
630 lines
34 KiB
HTML
630 lines
34 KiB
HTML
<!doctype html>
|
|
<html class="default no-js">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
<title>Wallet | ripple-lib</title>
|
|
<meta name="description" content="Documentation for ripple-lib">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<link rel="stylesheet" href="../assets/css/main.css">
|
|
<script async src="../assets/js/search.js" id="search-script"></script>
|
|
</head>
|
|
<body>
|
|
<header>
|
|
<div class="tsd-page-toolbar">
|
|
<div class="container">
|
|
<div class="table-wrap">
|
|
<div class="table-cell" id="tsd-search" data-index="../assets/js/search.json" data-base="..">
|
|
<div class="field">
|
|
<label for="tsd-search-field" class="tsd-widget search no-caption">Search</label>
|
|
<input id="tsd-search-field" type="text" />
|
|
</div>
|
|
<ul class="results">
|
|
<li class="state loading">Preparing search index...</li>
|
|
<li class="state failure">The search index is not available</li>
|
|
</ul>
|
|
<a href="../index.html" class="title">ripple-lib</a>
|
|
</div>
|
|
<div class="table-cell" id="tsd-widgets">
|
|
<div id="tsd-filter">
|
|
<a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
|
|
<div class="tsd-filter-group">
|
|
<div class="tsd-select" id="tsd-filter-visibility">
|
|
<span class="tsd-select-label">All</span>
|
|
<ul class="tsd-select-list">
|
|
<li data-value="public">Public</li>
|
|
<li data-value="protected">Public/Protected</li>
|
|
<li data-value="private" class="selected">All</li>
|
|
</ul>
|
|
</div>
|
|
<input type="checkbox" id="tsd-filter-inherited" checked />
|
|
<label class="tsd-widget" for="tsd-filter-inherited">Inherited</label>
|
|
<input type="checkbox" id="tsd-filter-externals" checked />
|
|
<label class="tsd-widget" for="tsd-filter-externals">Externals</label>
|
|
</div>
|
|
</div>
|
|
<a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="tsd-page-title">
|
|
<div class="container">
|
|
<ul class="tsd-breadcrumb">
|
|
<li>
|
|
<a href="../modules.html">ripple-lib</a>
|
|
</li>
|
|
<li>
|
|
<a href="Wallet.html">Wallet</a>
|
|
</li>
|
|
</ul>
|
|
<h1>Class Wallet</h1>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
<div class="container container-main">
|
|
<div class="row">
|
|
<div class="col-8 col-content">
|
|
<section class="tsd-panel tsd-comment">
|
|
<div class="tsd-comment tsd-typography">
|
|
<div class="lead">
|
|
<p>A utility for deriving a wallet composed of a keypair (publicKey/privateKey).
|
|
A wallet can be derived from either a seed, mnemnoic, or entropy (array of random numbers).
|
|
It provides functionality to sign/verify transactions offline.</p>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
<section class="tsd-panel tsd-hierarchy">
|
|
<h3>Hierarchy</h3>
|
|
<ul class="tsd-hierarchy">
|
|
<li>
|
|
<span class="target">Wallet</span>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
<section class="tsd-panel-group tsd-index-group">
|
|
<h2>Index</h2>
|
|
<section class="tsd-panel tsd-index-panel">
|
|
<div class="tsd-index-content">
|
|
<section class="tsd-index-section ">
|
|
<h3>Constructors</h3>
|
|
<ul class="tsd-index-list">
|
|
<li class="tsd-kind-constructor tsd-parent-kind-class"><a href="Wallet.html#constructor" class="tsd-kind-icon">constructor</a></li>
|
|
</ul>
|
|
</section>
|
|
<section class="tsd-index-section ">
|
|
<h3>Properties</h3>
|
|
<ul class="tsd-index-list">
|
|
<li class="tsd-kind-property tsd-parent-kind-class"><a href="Wallet.html#classicAddress" class="tsd-kind-icon">classic<wbr>Address</a></li>
|
|
<li class="tsd-kind-property tsd-parent-kind-class"><a href="Wallet.html#privateKey" class="tsd-kind-icon">private<wbr>Key</a></li>
|
|
<li class="tsd-kind-property tsd-parent-kind-class"><a href="Wallet.html#publicKey" class="tsd-kind-icon">public<wbr>Key</a></li>
|
|
<li class="tsd-kind-property tsd-parent-kind-class"><a href="Wallet.html#seed" class="tsd-kind-icon">seed</a></li>
|
|
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-private tsd-is-static"><a href="Wallet.html#defaultAlgorithm" class="tsd-kind-icon">default<wbr>Algorithm</a></li>
|
|
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-private tsd-is-static"><a href="Wallet.html#defaultDerivationPath" class="tsd-kind-icon">default<wbr>Derivation<wbr>Path</a></li>
|
|
</ul>
|
|
</section>
|
|
<section class="tsd-index-section ">
|
|
<h3>Methods</h3>
|
|
<ul class="tsd-index-list">
|
|
<li class="tsd-kind-method tsd-parent-kind-class"><a href="Wallet.html#getXAddress" class="tsd-kind-icon">getXAddress</a></li>
|
|
<li class="tsd-kind-method tsd-parent-kind-class"><a href="Wallet.html#signTransaction" class="tsd-kind-icon">sign<wbr>Transaction</a></li>
|
|
<li class="tsd-kind-method tsd-parent-kind-class"><a href="Wallet.html#verifyTransaction" class="tsd-kind-icon">verify<wbr>Transaction</a></li>
|
|
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-private tsd-is-static"><a href="Wallet.html#deriveWallet" class="tsd-kind-icon">derive<wbr>Wallet</a></li>
|
|
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><a href="Wallet.html#fromEntropy" class="tsd-kind-icon">from<wbr>Entropy</a></li>
|
|
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><a href="Wallet.html#fromMnemonic" class="tsd-kind-icon">from<wbr>Mnemonic</a></li>
|
|
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><a href="Wallet.html#fromSeed" class="tsd-kind-icon">from<wbr>Seed</a></li>
|
|
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><a href="Wallet.html#generate" class="tsd-kind-icon">generate</a></li>
|
|
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-private tsd-is-static"><a href="Wallet.html#hexFromBuffer" class="tsd-kind-icon">hex<wbr>From<wbr>Buffer</a></li>
|
|
</ul>
|
|
</section>
|
|
</div>
|
|
</section>
|
|
</section>
|
|
<section class="tsd-panel-group tsd-member-group ">
|
|
<h2>Constructors</h2>
|
|
<section class="tsd-panel tsd-member tsd-kind-constructor tsd-parent-kind-class">
|
|
<a name="constructor" class="tsd-anchor"></a>
|
|
<h3>constructor</h3>
|
|
<ul class="tsd-signatures tsd-kind-constructor tsd-parent-kind-class">
|
|
<li class="tsd-signature tsd-kind-icon">new <wbr>Wallet<span class="tsd-signature-symbol">(</span>publicKey<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, privateKey<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, seed<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="Wallet.html" class="tsd-signature-type" data-tsd-kind="Class">Wallet</a></li>
|
|
</ul>
|
|
<ul class="tsd-descriptions">
|
|
<li class="tsd-description">
|
|
<aside class="tsd-sources">
|
|
<ul>
|
|
<li>Defined in <a href="https://github.com/ripple/ripple-lib/blob/0c571f2e/src/wallet/index.ts#L31">src/wallet/index.ts:31</a></li>
|
|
</ul>
|
|
</aside>
|
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
<ul class="tsd-parameters">
|
|
<li>
|
|
<h5>publicKey: <span class="tsd-signature-type">string</span></h5>
|
|
</li>
|
|
<li>
|
|
<h5>privateKey: <span class="tsd-signature-type">string</span></h5>
|
|
</li>
|
|
<li>
|
|
<h5><span class="tsd-flag ts-flagOptional">Optional</span> seed: <span class="tsd-signature-type">string</span></h5>
|
|
</li>
|
|
</ul>
|
|
<h4 class="tsd-returns-title">Returns <a href="Wallet.html" class="tsd-signature-type" data-tsd-kind="Class">Wallet</a></h4>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
</section>
|
|
<section class="tsd-panel-group tsd-member-group ">
|
|
<h2>Properties</h2>
|
|
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class">
|
|
<a name="classicAddress" class="tsd-anchor"></a>
|
|
<h3><span class="tsd-flag ts-flagReadonly">Readonly</span> classic<wbr>Address</h3>
|
|
<div class="tsd-signature tsd-kind-icon">classic<wbr>Address<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
|
|
<aside class="tsd-sources">
|
|
<ul>
|
|
<li>Defined in <a href="https://github.com/ripple/ripple-lib/blob/0c571f2e/src/wallet/index.ts#L26">src/wallet/index.ts:26</a></li>
|
|
</ul>
|
|
</aside>
|
|
</section>
|
|
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class">
|
|
<a name="privateKey" class="tsd-anchor"></a>
|
|
<h3><span class="tsd-flag ts-flagReadonly">Readonly</span> private<wbr>Key</h3>
|
|
<div class="tsd-signature tsd-kind-icon">private<wbr>Key<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
|
|
<aside class="tsd-sources">
|
|
<ul>
|
|
<li>Defined in <a href="https://github.com/ripple/ripple-lib/blob/0c571f2e/src/wallet/index.ts#L25">src/wallet/index.ts:25</a></li>
|
|
</ul>
|
|
</aside>
|
|
</section>
|
|
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class">
|
|
<a name="publicKey" class="tsd-anchor"></a>
|
|
<h3><span class="tsd-flag ts-flagReadonly">Readonly</span> public<wbr>Key</h3>
|
|
<div class="tsd-signature tsd-kind-icon">public<wbr>Key<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
|
|
<aside class="tsd-sources">
|
|
<ul>
|
|
<li>Defined in <a href="https://github.com/ripple/ripple-lib/blob/0c571f2e/src/wallet/index.ts#L24">src/wallet/index.ts:24</a></li>
|
|
</ul>
|
|
</aside>
|
|
</section>
|
|
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class">
|
|
<a name="seed" class="tsd-anchor"></a>
|
|
<h3><span class="tsd-flag ts-flagOptional">Optional</span> <span class="tsd-flag ts-flagReadonly">Readonly</span> seed</h3>
|
|
<div class="tsd-signature tsd-kind-icon">seed<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
|
|
<aside class="tsd-sources">
|
|
<ul>
|
|
<li>Defined in <a href="https://github.com/ripple/ripple-lib/blob/0c571f2e/src/wallet/index.ts#L27">src/wallet/index.ts:27</a></li>
|
|
</ul>
|
|
</aside>
|
|
</section>
|
|
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-private tsd-is-static">
|
|
<a name="defaultAlgorithm" class="tsd-anchor"></a>
|
|
<h3><span class="tsd-flag ts-flagStatic">Static</span> <span class="tsd-flag ts-flagPrivate">Private</span> <span class="tsd-flag ts-flagReadonly">Readonly</span> default<wbr>Algorithm</h3>
|
|
<div class="tsd-signature tsd-kind-icon">default<wbr>Algorithm<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">ECDSA</span><span class="tsd-signature-symbol"> = ...</span></div>
|
|
<aside class="tsd-sources">
|
|
<ul>
|
|
<li>Defined in <a href="https://github.com/ripple/ripple-lib/blob/0c571f2e/src/wallet/index.ts#L28">src/wallet/index.ts:28</a></li>
|
|
</ul>
|
|
</aside>
|
|
</section>
|
|
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-private tsd-is-static">
|
|
<a name="defaultDerivationPath" class="tsd-anchor"></a>
|
|
<h3><span class="tsd-flag ts-flagStatic">Static</span> <span class="tsd-flag ts-flagPrivate">Private</span> <span class="tsd-flag ts-flagReadonly">Readonly</span> default<wbr>Derivation<wbr>Path</h3>
|
|
<div class="tsd-signature tsd-kind-icon">default<wbr>Derivation<wbr>Path<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> = "m/44'/144'/0'/0/0"</span></div>
|
|
<aside class="tsd-sources">
|
|
<ul>
|
|
<li>Defined in <a href="https://github.com/ripple/ripple-lib/blob/0c571f2e/src/wallet/index.ts#L29">src/wallet/index.ts:29</a></li>
|
|
</ul>
|
|
</aside>
|
|
</section>
|
|
</section>
|
|
<section class="tsd-panel-group tsd-member-group ">
|
|
<h2>Methods</h2>
|
|
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
|
|
<a name="getXAddress" class="tsd-anchor"></a>
|
|
<h3>getXAddress</h3>
|
|
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
|
|
<li class="tsd-signature tsd-kind-icon">getXAddress<span class="tsd-signature-symbol">(</span>tag<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, test<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li>
|
|
</ul>
|
|
<ul class="tsd-descriptions">
|
|
<li class="tsd-description">
|
|
<aside class="tsd-sources">
|
|
<ul>
|
|
<li>Defined in <a href="https://github.com/ripple/ripple-lib/blob/0c571f2e/src/wallet/index.ts#L153">src/wallet/index.ts:153</a></li>
|
|
</ul>
|
|
</aside>
|
|
<div class="tsd-comment tsd-typography">
|
|
<div class="lead">
|
|
<p>Gets an X-address in Testnet/Mainnet format.</p>
|
|
</div>
|
|
</div>
|
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
<ul class="tsd-parameters">
|
|
<li>
|
|
<h5>tag: <span class="tsd-signature-type">number</span></h5>
|
|
<div class="tsd-comment tsd-typography">
|
|
<p>A tag to be included within the X-address.</p>
|
|
</div>
|
|
</li>
|
|
<li>
|
|
<h5>test: <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> = false</span></h5>
|
|
<div class="tsd-comment tsd-typography">
|
|
<p>A boolean to indicate if X-address should be in Testnet (true) or Mainnet (false) format.</p>
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
|
|
<p>An X-address.</p>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
|
|
<a name="signTransaction" class="tsd-anchor"></a>
|
|
<h3>sign<wbr>Transaction</h3>
|
|
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
|
|
<li class="tsd-signature tsd-kind-icon">sign<wbr>Transaction<span class="tsd-signature-symbol">(</span>transaction<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span>, options<span class="tsd-signature-symbol">?: </span><a href="../interfaces/SignOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">SignOptions</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">SignedTransaction</span></li>
|
|
</ul>
|
|
<ul class="tsd-descriptions">
|
|
<li class="tsd-description">
|
|
<aside class="tsd-sources">
|
|
<ul>
|
|
<li>Defined in <a href="https://github.com/ripple/ripple-lib/blob/0c571f2e/src/wallet/index.ts#L126">src/wallet/index.ts:126</a></li>
|
|
</ul>
|
|
</aside>
|
|
<div class="tsd-comment tsd-typography">
|
|
<div class="lead">
|
|
<p>Signs a transaction offline.</p>
|
|
</div>
|
|
</div>
|
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
<ul class="tsd-parameters">
|
|
<li>
|
|
<h5>transaction: <span class="tsd-signature-type">any</span></h5>
|
|
<div class="tsd-comment tsd-typography">
|
|
<p>A transaction to be signed offline.</p>
|
|
</div>
|
|
</li>
|
|
<li>
|
|
<h5>options: <a href="../interfaces/SignOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">SignOptions</a><span class="tsd-signature-symbol"> = ...</span></h5>
|
|
<div class="tsd-comment tsd-typography">
|
|
<p>Options to include for signing.</p>
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">SignedTransaction</span></h4>
|
|
<p>A signed transaction.</p>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
|
|
<a name="verifyTransaction" class="tsd-anchor"></a>
|
|
<h3>verify<wbr>Transaction</h3>
|
|
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
|
|
<li class="tsd-signature tsd-kind-icon">verify<wbr>Transaction<span class="tsd-signature-symbol">(</span>signedTransaction<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li>
|
|
</ul>
|
|
<ul class="tsd-descriptions">
|
|
<li class="tsd-description">
|
|
<aside class="tsd-sources">
|
|
<ul>
|
|
<li>Defined in <a href="https://github.com/ripple/ripple-lib/blob/0c571f2e/src/wallet/index.ts#L139">src/wallet/index.ts:139</a></li>
|
|
</ul>
|
|
</aside>
|
|
<div class="tsd-comment tsd-typography">
|
|
<div class="lead">
|
|
<p>Verifies a signed transaction offline.</p>
|
|
</div>
|
|
</div>
|
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
<ul class="tsd-parameters">
|
|
<li>
|
|
<h5>signedTransaction: <span class="tsd-signature-type">string</span></h5>
|
|
<div class="tsd-comment tsd-typography">
|
|
<p>A signed transaction (hex string of signTransaction result) to be verified offline.</p>
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4>
|
|
<p>Returns true if a signedTransaction is valid.</p>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-private tsd-is-static">
|
|
<a name="deriveWallet" class="tsd-anchor"></a>
|
|
<h3><span class="tsd-flag ts-flagStatic">Static</span> <span class="tsd-flag ts-flagPrivate">Private</span> derive<wbr>Wallet</h3>
|
|
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-private tsd-is-static">
|
|
<li class="tsd-signature tsd-kind-icon">derive<wbr>Wallet<span class="tsd-signature-symbol">(</span>seed<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, algorithm<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">ECDSA</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="Wallet.html" class="tsd-signature-type" data-tsd-kind="Class">Wallet</a></li>
|
|
</ul>
|
|
<ul class="tsd-descriptions">
|
|
<li class="tsd-description">
|
|
<aside class="tsd-sources">
|
|
<ul>
|
|
<li>Defined in <a href="https://github.com/ripple/ripple-lib/blob/0c571f2e/src/wallet/index.ts#L111">src/wallet/index.ts:111</a></li>
|
|
</ul>
|
|
</aside>
|
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
<ul class="tsd-parameters">
|
|
<li>
|
|
<h5>seed: <span class="tsd-signature-type">string</span></h5>
|
|
</li>
|
|
<li>
|
|
<h5>algorithm: <span class="tsd-signature-type">ECDSA</span><span class="tsd-signature-symbol"> = ...</span></h5>
|
|
</li>
|
|
</ul>
|
|
<h4 class="tsd-returns-title">Returns <a href="Wallet.html" class="tsd-signature-type" data-tsd-kind="Class">Wallet</a></h4>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-static">
|
|
<a name="fromEntropy" class="tsd-anchor"></a>
|
|
<h3><span class="tsd-flag ts-flagStatic">Static</span> from<wbr>Entropy</h3>
|
|
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-static">
|
|
<li class="tsd-signature tsd-kind-icon">from<wbr>Entropy<span class="tsd-signature-symbol">(</span>entropy<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">Uint8Array</span>, algorithm<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">ECDSA</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="Wallet.html" class="tsd-signature-type" data-tsd-kind="Class">Wallet</a></li>
|
|
</ul>
|
|
<ul class="tsd-descriptions">
|
|
<li class="tsd-description">
|
|
<aside class="tsd-sources">
|
|
<ul>
|
|
<li>Defined in <a href="https://github.com/ripple/ripple-lib/blob/0c571f2e/src/wallet/index.ts#L95">src/wallet/index.ts:95</a></li>
|
|
</ul>
|
|
</aside>
|
|
<div class="tsd-comment tsd-typography">
|
|
<div class="lead">
|
|
<p>Derives a wallet from an entropy (array of random numbers).</p>
|
|
</div>
|
|
</div>
|
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
<ul class="tsd-parameters">
|
|
<li>
|
|
<h5>entropy: <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">Uint8Array</span></h5>
|
|
<div class="tsd-comment tsd-typography">
|
|
<p>An array of random numbers to generate a seed used to derive a wallet.</p>
|
|
</div>
|
|
</li>
|
|
<li>
|
|
<h5>algorithm: <span class="tsd-signature-type">ECDSA</span><span class="tsd-signature-symbol"> = ...</span></h5>
|
|
<div class="tsd-comment tsd-typography">
|
|
<p>The digital signature algorithm to generate an address for.</p>
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
<h4 class="tsd-returns-title">Returns <a href="Wallet.html" class="tsd-signature-type" data-tsd-kind="Class">Wallet</a></h4>
|
|
<p>A Wallet derived from an entropy.</p>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-static">
|
|
<a name="fromMnemonic" class="tsd-anchor"></a>
|
|
<h3><span class="tsd-flag ts-flagStatic">Static</span> from<wbr>Mnemonic</h3>
|
|
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-static">
|
|
<li class="tsd-signature tsd-kind-icon">from<wbr>Mnemonic<span class="tsd-signature-symbol">(</span>mnemonic<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, derivationPath<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="Wallet.html" class="tsd-signature-type" data-tsd-kind="Class">Wallet</a></li>
|
|
</ul>
|
|
<ul class="tsd-descriptions">
|
|
<li class="tsd-description">
|
|
<aside class="tsd-sources">
|
|
<ul>
|
|
<li>Defined in <a href="https://github.com/ripple/ripple-lib/blob/0c571f2e/src/wallet/index.ts#L70">src/wallet/index.ts:70</a></li>
|
|
</ul>
|
|
</aside>
|
|
<div class="tsd-comment tsd-typography">
|
|
<div class="lead">
|
|
<p>Derives a wallet from a mnemonic.</p>
|
|
</div>
|
|
</div>
|
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
<ul class="tsd-parameters">
|
|
<li>
|
|
<h5>mnemonic: <span class="tsd-signature-type">string</span></h5>
|
|
<div class="tsd-comment tsd-typography">
|
|
<p>A string consisting of words (whitespace delimited) used to derive a wallet.</p>
|
|
</div>
|
|
</li>
|
|
<li>
|
|
<h5>derivationPath: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> = ...</span></h5>
|
|
<div class="tsd-comment tsd-typography">
|
|
<p>The path to derive a keypair (publicKey/privateKey) from a seed (that was converted from a mnemonic).</p>
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
<h4 class="tsd-returns-title">Returns <a href="Wallet.html" class="tsd-signature-type" data-tsd-kind="Class">Wallet</a></h4>
|
|
<p>A Wallet derived from a mnemonic.</p>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-static">
|
|
<a name="fromSeed" class="tsd-anchor"></a>
|
|
<h3><span class="tsd-flag ts-flagStatic">Static</span> from<wbr>Seed</h3>
|
|
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-static">
|
|
<li class="tsd-signature tsd-kind-icon">from<wbr>Seed<span class="tsd-signature-symbol">(</span>seed<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, algorithm<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">ECDSA</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="Wallet.html" class="tsd-signature-type" data-tsd-kind="Class">Wallet</a></li>
|
|
</ul>
|
|
<ul class="tsd-descriptions">
|
|
<li class="tsd-description">
|
|
<aside class="tsd-sources">
|
|
<ul>
|
|
<li>Defined in <a href="https://github.com/ripple/ripple-lib/blob/0c571f2e/src/wallet/index.ts#L56">src/wallet/index.ts:56</a></li>
|
|
</ul>
|
|
</aside>
|
|
<div class="tsd-comment tsd-typography">
|
|
<div class="lead">
|
|
<p>Derives a wallet from a seed.</p>
|
|
</div>
|
|
</div>
|
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
<ul class="tsd-parameters">
|
|
<li>
|
|
<h5>seed: <span class="tsd-signature-type">string</span></h5>
|
|
<div class="tsd-comment tsd-typography">
|
|
<p>A string used to generate a keypair (publicKey/privateKey) to derive a wallet.</p>
|
|
</div>
|
|
</li>
|
|
<li>
|
|
<h5>algorithm: <span class="tsd-signature-type">ECDSA</span><span class="tsd-signature-symbol"> = ...</span></h5>
|
|
<div class="tsd-comment tsd-typography">
|
|
<p>The digital signature algorithm to generate an address for.</p>
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
<h4 class="tsd-returns-title">Returns <a href="Wallet.html" class="tsd-signature-type" data-tsd-kind="Class">Wallet</a></h4>
|
|
<p>A Wallet derived from a seed.</p>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-static">
|
|
<a name="generate" class="tsd-anchor"></a>
|
|
<h3><span class="tsd-flag ts-flagStatic">Static</span> generate</h3>
|
|
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-static">
|
|
<li class="tsd-signature tsd-kind-icon">generate<span class="tsd-signature-symbol">(</span>algorithm<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">ECDSA</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="Wallet.html" class="tsd-signature-type" data-tsd-kind="Class">Wallet</a></li>
|
|
</ul>
|
|
<ul class="tsd-descriptions">
|
|
<li class="tsd-description">
|
|
<aside class="tsd-sources">
|
|
<ul>
|
|
<li>Defined in <a href="https://github.com/ripple/ripple-lib/blob/0c571f2e/src/wallet/index.ts#L44">src/wallet/index.ts:44</a></li>
|
|
</ul>
|
|
</aside>
|
|
<div class="tsd-comment tsd-typography">
|
|
<div class="lead">
|
|
<p>Generates a new Wallet using a generated seed.</p>
|
|
</div>
|
|
</div>
|
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
<ul class="tsd-parameters">
|
|
<li>
|
|
<h5>algorithm: <span class="tsd-signature-type">ECDSA</span><span class="tsd-signature-symbol"> = ...</span></h5>
|
|
<div class="tsd-comment tsd-typography">
|
|
<p>The digital signature algorithm to generate an address for.</p>
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
<h4 class="tsd-returns-title">Returns <a href="Wallet.html" class="tsd-signature-type" data-tsd-kind="Class">Wallet</a></h4>
|
|
<p>A new Wallet derived from a generated seed.</p>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-private tsd-is-static">
|
|
<a name="hexFromBuffer" class="tsd-anchor"></a>
|
|
<h3><span class="tsd-flag ts-flagStatic">Static</span> <span class="tsd-flag ts-flagPrivate">Private</span> hex<wbr>From<wbr>Buffer</h3>
|
|
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-private tsd-is-static">
|
|
<li class="tsd-signature tsd-kind-icon">hex<wbr>From<wbr>Buffer<span class="tsd-signature-symbol">(</span>buffer<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Buffer</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li>
|
|
</ul>
|
|
<ul class="tsd-descriptions">
|
|
<li class="tsd-description">
|
|
<aside class="tsd-sources">
|
|
<ul>
|
|
<li>Defined in <a href="https://github.com/ripple/ripple-lib/blob/0c571f2e/src/wallet/index.ts#L107">src/wallet/index.ts:107</a></li>
|
|
</ul>
|
|
</aside>
|
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
<ul class="tsd-parameters">
|
|
<li>
|
|
<h5>buffer: <span class="tsd-signature-type">Buffer</span></h5>
|
|
</li>
|
|
</ul>
|
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
</section>
|
|
</div>
|
|
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
|
|
<nav class="tsd-navigation primary">
|
|
<ul>
|
|
<li class=" ">
|
|
<a href="../modules.html">Exports</a>
|
|
</li>
|
|
</ul>
|
|
</nav>
|
|
<nav class="tsd-navigation secondary menu-sticky">
|
|
<ul class="before-current">
|
|
</ul>
|
|
<ul class="current">
|
|
<li class="current tsd-kind-class">
|
|
<a href="Wallet.html" class="tsd-kind-icon">Wallet</a>
|
|
<ul>
|
|
<li class=" tsd-kind-constructor tsd-parent-kind-class">
|
|
<a href="Wallet.html#constructor" class="tsd-kind-icon">constructor</a>
|
|
</li>
|
|
<li class=" tsd-kind-property tsd-parent-kind-class">
|
|
<a href="Wallet.html#classicAddress" class="tsd-kind-icon">classic<wbr>Address</a>
|
|
</li>
|
|
<li class=" tsd-kind-property tsd-parent-kind-class">
|
|
<a href="Wallet.html#privateKey" class="tsd-kind-icon">private<wbr>Key</a>
|
|
</li>
|
|
<li class=" tsd-kind-property tsd-parent-kind-class">
|
|
<a href="Wallet.html#publicKey" class="tsd-kind-icon">public<wbr>Key</a>
|
|
</li>
|
|
<li class=" tsd-kind-property tsd-parent-kind-class">
|
|
<a href="Wallet.html#seed" class="tsd-kind-icon">seed</a>
|
|
</li>
|
|
<li class=" tsd-kind-property tsd-parent-kind-class tsd-is-private tsd-is-static">
|
|
<a href="Wallet.html#defaultAlgorithm" class="tsd-kind-icon">default<wbr>Algorithm</a>
|
|
</li>
|
|
<li class=" tsd-kind-property tsd-parent-kind-class tsd-is-private tsd-is-static">
|
|
<a href="Wallet.html#defaultDerivationPath" class="tsd-kind-icon">default<wbr>Derivation<wbr>Path</a>
|
|
</li>
|
|
<li class=" tsd-kind-method tsd-parent-kind-class">
|
|
<a href="Wallet.html#getXAddress" class="tsd-kind-icon">getXAddress</a>
|
|
</li>
|
|
<li class=" tsd-kind-method tsd-parent-kind-class">
|
|
<a href="Wallet.html#signTransaction" class="tsd-kind-icon">sign<wbr>Transaction</a>
|
|
</li>
|
|
<li class=" tsd-kind-method tsd-parent-kind-class">
|
|
<a href="Wallet.html#verifyTransaction" class="tsd-kind-icon">verify<wbr>Transaction</a>
|
|
</li>
|
|
<li class=" tsd-kind-method tsd-parent-kind-class tsd-is-private tsd-is-static">
|
|
<a href="Wallet.html#deriveWallet" class="tsd-kind-icon">derive<wbr>Wallet</a>
|
|
</li>
|
|
<li class=" tsd-kind-method tsd-parent-kind-class tsd-is-static">
|
|
<a href="Wallet.html#fromEntropy" class="tsd-kind-icon">from<wbr>Entropy</a>
|
|
</li>
|
|
<li class=" tsd-kind-method tsd-parent-kind-class tsd-is-static">
|
|
<a href="Wallet.html#fromMnemonic" class="tsd-kind-icon">from<wbr>Mnemonic</a>
|
|
</li>
|
|
<li class=" tsd-kind-method tsd-parent-kind-class tsd-is-static">
|
|
<a href="Wallet.html#fromSeed" class="tsd-kind-icon">from<wbr>Seed</a>
|
|
</li>
|
|
<li class=" tsd-kind-method tsd-parent-kind-class tsd-is-static">
|
|
<a href="Wallet.html#generate" class="tsd-kind-icon">generate</a>
|
|
</li>
|
|
<li class=" tsd-kind-method tsd-parent-kind-class tsd-is-private tsd-is-static">
|
|
<a href="Wallet.html#hexFromBuffer" class="tsd-kind-icon">hex<wbr>From<wbr>Buffer</a>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<ul class="after-current">
|
|
</ul>
|
|
</nav>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<footer class="with-border-bottom">
|
|
<div class="container">
|
|
<h2>Legend</h2>
|
|
<div class="tsd-legend-group">
|
|
<ul class="tsd-legend">
|
|
<li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li>
|
|
<li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li>
|
|
<li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li>
|
|
</ul>
|
|
<ul class="tsd-legend">
|
|
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited property</span></li>
|
|
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited method</span></li>
|
|
</ul>
|
|
<ul class="tsd-legend">
|
|
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private property</span></li>
|
|
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private method</span></li>
|
|
</ul>
|
|
<ul class="tsd-legend">
|
|
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static property</span></li>
|
|
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static method</span></li>
|
|
</ul>
|
|
<ul class="tsd-legend">
|
|
<li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</footer>
|
|
<div class="container tsd-generator">
|
|
<p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p>
|
|
</div>
|
|
<div class="overlay"></div>
|
|
<script src="../assets/js/main.js"></script>
|
|
</body>
|
|
</html> |