UNPKG

xecaddrjs

Version:

eCash general purpose address translation.

3,066 lines 30.1 kB
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>JSDoc: Module: xecaddr</title>

    <script src="scripts/prettify/prettify.js"> </script>
    <script src="scripts/prettify/lang-css.js"> </script>
    <!--[if lt IE 9]>
      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>

<body>

<div id="main">

    <h1 class="page-title">Module: xecaddr</h1>

    




<section>

<header>
    
        
            
        
    
</header>

<article>
    <div class="container-overview">
    
        
            <div class="description">General purpose Bitcoin Cash address detection and translation.<br />
Supports all major Bitcoin Cash address formats.<br />
Currently:
<ul>
   <li> Legacy format </li>
   <li> Bitpay format </li>
   <li> Cashaddr format </li>
</ul></div>
        

        
            















<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="xecaddr.js.html">xecaddr.js</a>, <a href="xecaddr.js.html#line13">line 13</a>
    </li></ul></dd>
    

    

    

    
</dl>




















        
    
    </div>

    

    

    
        <h3 class="subsection-title">Classes</h3>

        <dl>
            <dt><a href="module-xecaddr-InvalidAddressError.html">InvalidAddressError</a></dt>
            <dd></dd>
        </dl>
    

    

    

    

    
        <h3 class="subsection-title">Members</h3>

        
            
<h4 class="name" id=".Format"><span class="type-signature">(static, constant) </span>Format<span class="type-signature"></span></h4>










<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="xecaddr.js.html">xecaddr.js</a>, <a href="xecaddr.js.html#line29">line 29</a>
    </li></ul></dd>
    

    

    

    
</dl>






        
            
<h4 class="name" id=".Network"><span class="type-signature">(static, constant) </span>Network<span class="type-signature"></span></h4>










<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="xecaddr.js.html">xecaddr.js</a>, <a href="xecaddr.js.html#line39">line 39</a>
    </li></ul></dd>
    

    

    

    
</dl>






        
            
<h4 class="name" id=".Type"><span class="type-signature">(static, constant) </span>Type<span class="type-signature"></span></h4>










<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="xecaddr.js.html">xecaddr.js</a>, <a href="xecaddr.js.html#line47">line 47</a>
    </li></ul></dd>
    

    

    

    
</dl>






        
    

    
        <h3 class="subsection-title">Methods</h3>

        
            

    

    
    <h4 class="name" id=".detectAddressFormat"><span class="type-signature">(static) </span>detectAddressFormat<span class="signature">(address)</span><span class="type-signature"> &rarr; {string}</span></h4>
    

    



<div class="description">
    Detects what is the given address' format.
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>address</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            

            

            <td class="description last">A valid Bitcoin Cash address in any format.</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="xecaddr.js.html">xecaddr.js</a>, <a href="xecaddr.js.html#line73">line 73</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Throws:</h5>

        

    <div class="param-desc">
    
        
<span class="param-type">InvalidAddressError</span>


    
    </div>


    


<h5>Returns:</h5>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">string</span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id=".detectAddressNetwork"><span class="type-signature">(static) </span>detectAddressNetwork<span class="signature">(address)</span><span class="type-signature"> &rarr; {string}</span></h4>
    

    



<div class="description">
    Detects what is the given address' network.
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>address</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            

            

            <td class="description last">A valid Bitcoin Cash address in any format.</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="xecaddr.js.html">xecaddr.js</a>, <a href="xecaddr.js.html#line84">line 84</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Throws:</h5>

        

    <div class="param-desc">
    
        
<span class="param-type">InvalidAddressError</span>


    
    </div>


    


<h5>Returns:</h5>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">string</span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id=".detectAddressType"><span class="type-signature">(static) </span>detectAddressType<span class="signature">(address)</span><span class="type-signature"> &rarr; {string}</span></h4>
    

    



<div class="description">
    Detects what is the given address' type.
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>address</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            

            

            <td class="description last">A valid Bitcoin Cash address in any format.</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="xecaddr.js.html">xecaddr.js</a>, <a href="xecaddr.js.html#line95">line 95</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Throws:</h5>

        

    <div class="param-desc">
    
        
<span class="param-type">InvalidAddressError</span>


    
    </div>


    


<h5>Returns:</h5>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">string</span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id=".isBitpayAddress"><span class="type-signature">(static) </span>isBitpayAddress<span class="signature">(address)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
    

    



<div class="description">
    Returns a boolean indicating whether the address is in bitpay format.
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>address</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            

            

            <td class="description last">A valid Bitcoin Cash address in any format.</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="xecaddr.js.html">xecaddr.js</a>, <a href="xecaddr.js.html#line458">line 458</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Throws:</h5>

        

    <div class="param-desc">
    
        
<span class="param-type">InvalidAddressError</span>


    
    </div>


    


<h5>Returns:</h5>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">boolean</span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id=".isCashAddress"><span class="type-signature">(static) </span>isCashAddress<span class="signature">(address)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
    

    



<div class="description">
    Returns a boolean indicating whether the address is in cashaddr format.
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>address</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            

            

            <td class="description last">A valid Bitcoin Cash address in any format.</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="xecaddr.js.html">xecaddr.js</a>, <a href="xecaddr.js.html#line469">line 469</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Throws:</h5>

        

    <div class="param-desc">
    
        
<span class="param-type">InvalidAddressError</span>


    
    </div>


    


<h5>Returns:</h5>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">boolean</span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id=".isLegacyAddress"><span class="type-signature">(static) </span>isLegacyAddress<span class="signature">(address)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
    

    



<div class="description">
    Returns a boolean indicating whether the address is in legacy format.
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>address</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            

            

            <td class="description last">A valid Bitcoin Cash address in any format.</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="xecaddr.js.html">xecaddr.js</a>, <a href="xecaddr.js.html#line447">line 447</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Throws:</h5>

        

    <div class="param-desc">
    
        
<span class="param-type">InvalidAddressError</span>


    
    </div>


    


<h5>Returns:</h5>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">boolean</span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id=".isMainnetAddress"><span class="type-signature">(static) </span>isMainnetAddress<span class="signature">(address)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
    

    



<div class="description">
    Returns a boolean indicating whether the address is a mainnet address.
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>address</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            

            

            <td class="description last">A valid Bitcoin Cash address in any format.</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="xecaddr.js.html">xecaddr.js</a>, <a href="xecaddr.js.html#line491">line 491</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Throws:</h5>

        

    <div class="param-desc">
    
        
<span class="param-type">InvalidAddressError</span>


    
    </div>


    


<h5>Returns:</h5>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">boolean</span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id=".isP2PKHAddress"><span class="type-signature">(static) </span>isP2PKHAddress<span class="signature">(address)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
    

    



<div class="description">
    Returns a boolean indicating whether the address is a p2pkh address.
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>address</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            

            

            <td class="description last">A valid Bitcoin Cash address in any format.</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="xecaddr.js.html">xecaddr.js</a>, <a href="xecaddr.js.html#line513">line 513</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Throws:</h5>

        

    <div class="param-desc">
    
        
<span class="param-type">InvalidAddressError</span>


    
    </div>


    


<h5>Returns:</h5>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">boolean</span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id=".isP2SHAddress"><span class="type-signature">(static) </span>isP2SHAddress<span class="signature">(address)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
    

    



<div class="description">
    Returns a boolean indicating whether the address is a p2sh address.
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>address</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            

            

            <td class="description last">A valid Bitcoin Cash address in any format.</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="xecaddr.js.html">xecaddr.js</a>, <a href="xecaddr.js.html#line524">line 524</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Throws:</h5>

        

    <div class="param-desc">
    
        
<span class="param-type">InvalidAddressError</span>


    
    </div>


    


<h5>Returns:</h5>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">boolean</span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id=".isTestnetAddress"><span class="type-signature">(static) </span>isTestnetAddress<span class="signature">(address)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
    

    



<div class="description">
    Returns a boolean indicating whether the address is a testnet address.
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>address</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            

            

            <td class="description last">A valid Bitcoin Cash address in any format.</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="xecaddr.js.html">xecaddr.js</a>, <a href="xecaddr.js.html#line502">line 502</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Throws:</h5>

        

    <div class="param-desc">
    
        
<span class="param-type">InvalidAddressError</span>


    
    </div>


    


<h5>Returns:</h5>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">boolean</span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id=".isValidAddress"><span class="type-signature">(static) </span>isValidAddress<span class="signature">(input)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
    

    



<div class="description">
    Returns a boolean indicating whether the given input is a valid Bitcoin Cash address.
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>input</code></td>
            

            <td class="type">
            
                
<span class="param-type">*</span>


            
            </td>

            

            

            <td class="description last">Any input to check for validity.</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="xecaddr.js.html">xecaddr.js</a>, <a href="xecaddr.js.html#line57">line 57</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">boolean</span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id=".isXecAddress"><span class="type-signature">(static) </span>isXecAddress<span class="signature">(address)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
    

    



<div class="description">
    Returns a boolean indicating whether the address is in xecaddr format.
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>address</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            

            

            <td class="description last">A valid XEC address in any format.</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="xecaddr.js.html">xecaddr.js</a>, <a href="xecaddr.js.html#line480">line 480</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Throws:</h5>

        

    <div class="param-desc">
    
        
<span class="param-type">InvalidAddressError</span>


    
    </div>


    


<h5>Returns:</h5>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">boolean</span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id=".toBitpayAddress"><span class="type-signature">(static) </span>toBitpayAddress<span class="signature">(address)</span><span class="type-signature"> &rarr; {string}</span></h4>
    

    



<div class="description">
    Translates the given address into bitpay format.
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>address</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            

            

            <td class="description last">A valid Bitcoin Cash address in any format.</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="xecaddr.js.html">xecaddr.js</a>, <a href="xecaddr.js.html#line121">line 121</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Throws:</h5>

        

    <div class="param-desc">
    
        
<span class="param-type">InvalidAddressError</span>


    
    </div>


    


<h5>Returns:</h5>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">string</span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id=".toCashAddress"><span class="type-signature">(static) </span>toCashAddress<span class="signature">(address)</span><span class="type-signature"> &rarr; {string}</span></h4>
    

    



<div class="description">
    Translates the given address into cashaddr format.
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>address</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            

            

            <td class="description last">A valid Bitcoin Cash address in any format.</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="xecaddr.js.html">xecaddr.js</a>, <a href="xecaddr.js.html#line136">line 136</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Throws:</h5>

        

    <div class="param-desc">
    
        
<span class="param-type">InvalidAddressError</span>


    
    </div>


    


<h5>Returns:</h5>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">string</span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id=".toLegacyAddress"><span class="type-signature">(static) </span>toLegacyAddress<span class="signature">(address)</span><span class="type-signature"> &rarr; {string}</span></h4>
    

    



<div class="description">
    Translates the given address into legacy format.
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>address</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            

            

            <td class="description last">A valid Bitcoin Cash address in any format.</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="xecaddr.js.html">xecaddr.js</a>, <a href="xecaddr.js.html#line106">line 106</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Throws:</h5>

        

    <div class="param-desc">
    
        
<span class="param-type">InvalidAddressError</span>


    
    </div>


    


<h5>Returns:</h5>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">string</span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id=".toXecAddress"><span class="type-signature">(static) </span>toXecAddress<span class="signature">(address)</span><span class="type-signature"> &rarr; {string}</span></h4>
    

    



<div class="description">
    Translates the given address into xecaddr format.
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>address</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            

            

            <td class="description last">A valid Bitcoin Cash address in any format.</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="xecaddr.js.html">xecaddr.js</a>, <a href="xecaddr.js.html#line148">line 148</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Throws:</h5>

        

    <div class="param-desc">
    
        
<span class="param-type">InvalidAddressError</span>


    
    </div>


    


<h5>Returns:</h5>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">string</span>


    </dd>
</dl>

    





        
    

    

    
</article>

</section>




</div>

<nav>
    <h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-xecaddr.html">xecaddr</a></li></ul><h3>Classes</h3><ul><li><a href="module-xecaddr-InvalidAddressError.html">InvalidAddressError</a></li></ul>
</nav>

<br class="clear">

<footer>
    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a> on Wed Feb 23 2022 10:57:36 GMT-0800 (Pacific Standard Time)
</footer>

<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>