UNPKG

blockstack

Version:

The Blockstack Javascript library for authentication, identity, and storage.

802 lines 82.6 kB
<!doctype html> <html class="default no-js"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>BlockstackNetwork | blockstack.js 21.1.1 Library Reference</title> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="../assets/css/main.css"> </head> <body> <link rel="stylesheet" href="../assets/css/custom-style.css"> <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.js" 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">blockstack.js 21.1.1 Library Reference</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-only-exported" /> <label class="tsd-widget" for="tsd-filter-only-exported">Only exported</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="../globals.html">Globals</a> </li> <li> <a href="blockstacknetwork.html">BlockstackNetwork</a> </li> </ul> <h1>Class BlockstackNetwork</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>Use the methods in class to build third-party wallets or in DApps that register names.</p> </div> </div> </section> <section class="tsd-panel tsd-hierarchy"> <h3>Hierarchy</h3> <ul class="tsd-hierarchy"> <li> <span class="target">BlockstackNetwork</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="blockstacknetwork.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="blockstacknetwork.html#dust_minimum" class="tsd-kind-icon">DUST_<wbr>MINIMUM</a></li> <li class="tsd-kind-property tsd-parent-kind-class"><a href="blockstacknetwork.html#magic_bytes" class="tsd-kind-icon">MAGIC_<wbr>BYTES</a></li> <li class="tsd-kind-property tsd-parent-kind-class"><a href="blockstacknetwork.html#blockstackapiurl" class="tsd-kind-icon">blockstackAPIUrl</a></li> <li class="tsd-kind-property tsd-parent-kind-class"><a href="blockstacknetwork.html#broadcastserviceurl" class="tsd-kind-icon">broadcast<wbr>Service<wbr>Url</a></li> <li class="tsd-kind-property tsd-parent-kind-class"><a href="blockstacknetwork.html#btc" class="tsd-kind-icon">btc</a></li> <li class="tsd-kind-property tsd-parent-kind-class"><a href="blockstacknetwork.html#excludeutxoset" class="tsd-kind-icon">exclude<wbr>Utxo<wbr>Set</a></li> <li class="tsd-kind-property tsd-parent-kind-class"><a href="blockstacknetwork.html#includeutxomap" class="tsd-kind-icon">include<wbr>Utxo<wbr>Map</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 tsd-is-private"><a href="blockstacknetwork.html#broadcastnameregistration" class="tsd-kind-icon">broadcast<wbr>Name<wbr>Registration</a></li> <li class="tsd-kind-method tsd-parent-kind-class tsd-is-private"><a href="blockstacknetwork.html#broadcastservicefetchhelper" class="tsd-kind-icon">broadcast<wbr>Service<wbr>Fetch<wbr>Helper</a></li> <li class="tsd-kind-method tsd-parent-kind-class tsd-is-private"><a href="blockstacknetwork.html#broadcasttransaction" class="tsd-kind-icon">broadcast<wbr>Transaction</a></li> <li class="tsd-kind-method tsd-parent-kind-class tsd-is-private"><a href="blockstacknetwork.html#broadcastzonefile" class="tsd-kind-icon">broadcast<wbr>Zone<wbr>File</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="blockstacknetwork.html#getaccountat" class="tsd-kind-icon">get<wbr>Account<wbr>At</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="blockstacknetwork.html#getaccountbalance" class="tsd-kind-icon">get<wbr>Account<wbr>Balance</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="blockstacknetwork.html#getaccounthistorypage" class="tsd-kind-icon">get<wbr>Account<wbr>History<wbr>Page</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="blockstacknetwork.html#getaccountstatus" class="tsd-kind-icon">get<wbr>Account<wbr>Status</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="blockstacknetwork.html#getaccounttokens" class="tsd-kind-icon">get<wbr>Account<wbr>Tokens</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="blockstacknetwork.html#getdefaultburnaddress" class="tsd-kind-icon">get<wbr>Default<wbr>Burn<wbr>Address</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="blockstacknetwork.html#getgraceperiod" class="tsd-kind-icon">get<wbr>Grace<wbr>Period</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="blockstacknetwork.html#getnameinfo" class="tsd-kind-icon">get<wbr>Name<wbr>Info</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="blockstacknetwork.html#getnameprice" class="tsd-kind-icon">get<wbr>Name<wbr>Price</a></li> <li class="tsd-kind-method tsd-parent-kind-class tsd-is-private"><a href="blockstacknetwork.html#getnamepricev1" class="tsd-kind-icon">get<wbr>Name<wbr>Price<wbr>V1</a></li> <li class="tsd-kind-method tsd-parent-kind-class tsd-is-private"><a href="blockstacknetwork.html#getnamepricev2" class="tsd-kind-icon">get<wbr>Name<wbr>Price<wbr>V2</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="blockstacknetwork.html#getnamesowned" class="tsd-kind-icon">get<wbr>Names<wbr>Owned</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="blockstacknetwork.html#getnamespaceburnaddress" class="tsd-kind-icon">get<wbr>Namespace<wbr>Burn<wbr>Address</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="blockstacknetwork.html#getnamespaceinfo" class="tsd-kind-icon">get<wbr>Namespace<wbr>Info</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="blockstacknetwork.html#getnamespaceprice" class="tsd-kind-icon">get<wbr>Namespace<wbr>Price</a></li> <li class="tsd-kind-method tsd-parent-kind-class tsd-is-private"><a href="blockstacknetwork.html#getnamespacepricev1" class="tsd-kind-icon">get<wbr>Namespace<wbr>Price<wbr>V1</a></li> <li class="tsd-kind-method tsd-parent-kind-class tsd-is-private"><a href="blockstacknetwork.html#getnamespacepricev2" class="tsd-kind-icon">get<wbr>Namespace<wbr>Price<wbr>V2</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="blockstacknetwork.html#getnetworkedutxos" class="tsd-kind-icon">get<wbr>NetworkedUTXOs</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="blockstacknetwork.html#gettransactioninfo" class="tsd-kind-icon">get<wbr>Transaction<wbr>Info</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="blockstacknetwork.html#getzonefile" class="tsd-kind-icon">get<wbr>Zonefile</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>Blockstack<wbr>Network<span class="tsd-signature-symbol">(</span>apiUrl<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, broadcastServiceUrl<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, bitcoinAPI<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">BitcoinNetwork</span>, network<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">Network</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="blockstacknetwork.html" class="tsd-signature-type">BlockstackNetwork</a></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/blockstack/blockstack.js/blob/master/src/network.ts#L79">src/network.ts:79</a></li> </ul> </aside> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>apiUrl: <span class="tsd-signature-type">string</span></h5> </li> <li> <h5>broadcastServiceUrl: <span class="tsd-signature-type">string</span></h5> </li> <li> <h5>bitcoinAPI: <span class="tsd-signature-type">BitcoinNetwork</span></h5> </li> <li> <h5><span class="tsd-flag ts-flagDefault value">Default value</span> network: <span class="tsd-signature-type">Network</span><span class="tsd-signature-symbol"> =&nbsp;networks.bitcoin</span></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <a href="blockstacknetwork.html" class="tsd-signature-type">BlockstackNetwork</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="dust_minimum" class="tsd-anchor"></a> <h3>DUST_<wbr>MINIMUM</h3> <div class="tsd-signature tsd-kind-icon">DUST_<wbr>MINIMUM<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/blockstack/blockstack.js/blob/master/src/network.ts#L71">src/network.ts:71</a></li> </ul> </aside> </section> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"> <a name="magic_bytes" class="tsd-anchor"></a> <h3>MAGIC_<wbr>BYTES</h3> <div class="tsd-signature tsd-kind-icon">MAGIC_<wbr>BYTES<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/blockstack/blockstack.js/blob/master/src/network.ts#L79">src/network.ts:79</a></li> </ul> </aside> </section> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"> <a name="blockstackapiurl" class="tsd-anchor"></a> <h3>blockstackAPIUrl</h3> <div class="tsd-signature tsd-kind-icon">blockstackAPIUrl<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/blockstack/blockstack.js/blob/master/src/network.ts#L62">src/network.ts:62</a></li> </ul> </aside> </section> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"> <a name="broadcastserviceurl" class="tsd-anchor"></a> <h3>broadcast<wbr>Service<wbr>Url</h3> <div class="tsd-signature tsd-kind-icon">broadcast<wbr>Service<wbr>Url<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/blockstack/blockstack.js/blob/master/src/network.ts#L64">src/network.ts:64</a></li> </ul> </aside> </section> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"> <a name="btc" class="tsd-anchor"></a> <h3>btc</h3> <div class="tsd-signature tsd-kind-icon">btc<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">BitcoinNetwork</span></div> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/blockstack/blockstack.js/blob/master/src/network.ts#L77">src/network.ts:77</a></li> </ul> </aside> </section> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"> <a name="excludeutxoset" class="tsd-anchor"></a> <h3>exclude<wbr>Utxo<wbr>Set</h3> <div class="tsd-signature tsd-kind-icon">exclude<wbr>Utxo<wbr>Set<span class="tsd-signature-symbol">:</span> <a href="../interfaces/utxo.html" class="tsd-signature-type">UTXO</a><span class="tsd-signature-symbol">[]</span></div> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/blockstack/blockstack.js/blob/master/src/network.ts#L75">src/network.ts:75</a></li> </ul> </aside> </section> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"> <a name="includeutxomap" class="tsd-anchor"></a> <h3>include<wbr>Utxo<wbr>Map</h3> <div class="tsd-signature tsd-kind-icon">include<wbr>Utxo<wbr>Map<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">object</span></div> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/blockstack/blockstack.js/blob/master/src/network.ts#L73">src/network.ts:73</a></li> </ul> </aside> <div class="tsd-type-declaration"> <h4>Type declaration</h4> <ul class="tsd-parameters"> <li class="tsd-parameter-index-signature"> <h5><span class="tsd-signature-symbol">[</span>address: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]: </span><a href="../interfaces/utxo.html" class="tsd-signature-type">UTXO</a><span class="tsd-signature-symbol">[]</span></h5> </li> </ul> </div> </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 tsd-is-private"> <a name="broadcastnameregistration" class="tsd-anchor"></a> <h3><span class="tsd-flag ts-flagPrivate">Private</span> broadcast<wbr>Name<wbr>Registration</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-private"> <li class="tsd-signature tsd-kind-icon">broadcast<wbr>Name<wbr>Registration<span class="tsd-signature-symbol">(</span>preorderTransaction<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, registerTransaction<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, zoneFile<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">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/blockstack/blockstack.js/blob/master/src/network.ts#L815">src/network.ts:815</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Sends the preorder and registration transactions and zone file for a Blockstack name registration along with the to the transaction broadcast service.</p> </div> <p>The transaction broadcast:</p> <ul> <li>immediately broadcasts the preorder transaction</li> <li>broadcasts the register transactions after the preorder transaction has an appropriate number of confirmations</li> <li>broadcasts the zone file to the Atlas network after the register transaction has an appropriate number of confirmations</li> </ul> <p>This is intended for use in third-party wallets or in DApps that register names.</p> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>preorderTransaction: <span class="tsd-signature-type">string</span></h5> <div class="tsd-comment tsd-typography"> <p>the hex-encoded, signed preorder transaction generated using the <code>makePreorder</code> function</p> </div> </li> <li> <h5>registerTransaction: <span class="tsd-signature-type">string</span></h5> <div class="tsd-comment tsd-typography"> <p>the hex-encoded, signed register transaction generated using the <code>makeRegister</code> function</p> </div> </li> <li> <h5>zoneFile: <span class="tsd-signature-type">string</span></h5> <div class="tsd-comment tsd-typography"> <p>the zone file to be broadcast to the Atlas network</p> </div> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span></h4> <p>Returns a Promise that resolves to an object with a <code>transaction_hash</code> key containing the transaction hash of the broadcasted transaction.</p> <p>In the event of an error, it rejects with:</p> <ul> <li>a <code>RemoteServiceError</code> if there is a problem with the transaction broadcast service</li> <li><code>MissingParameterError</code> if you call the function without a required parameter</li> </ul> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-private"> <a name="broadcastservicefetchhelper" class="tsd-anchor"></a> <h3><span class="tsd-flag ts-flagPrivate">Private</span> broadcast<wbr>Service<wbr>Fetch<wbr>Helper</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-private"> <li class="tsd-signature tsd-kind-icon">broadcast<wbr>Service<wbr>Fetch<wbr>Helper<span class="tsd-signature-symbol">(</span>endpoint<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, body<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">Error</span><span class="tsd-signature-symbol">&gt;</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/blockstack/blockstack.js/blob/master/src/network.ts#L628">src/network.ts:628</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Performs a POST request to the given URL. This is intended for use in third-party wallets or in DApps that register names.</p> </div> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>endpoint: <span class="tsd-signature-type">string</span></h5> <div class="tsd-comment tsd-typography"> <p>the name of</p> </div> </li> <li> <h5>body: <span class="tsd-signature-type">any</span></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">Error</span><span class="tsd-signature-symbol">&gt;</span></h4> <p>Returns a <code>Promise</code> that resolves to the object requested. In the event of an error, it rejects with:</p> <ul> <li>a <code>RemoteServiceError</code> if there is a problem with the transaction broadcast service</li> <li><code>MissingParameterError</code> if you call the function without a required parameter</li> </ul> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-private"> <a name="broadcasttransaction" class="tsd-anchor"></a> <h3><span class="tsd-flag ts-flagPrivate">Private</span> broadcast<wbr>Transaction</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-private"> <li class="tsd-signature tsd-kind-icon">broadcast<wbr>Transaction<span class="tsd-signature-symbol">(</span>transaction<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, transactionToWatch<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span>, confirmations<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">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/blockstack/blockstack.js/blob/master/src/network.ts#L672">src/network.ts:672</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Broadcasts a signed bitcoin transaction to the network optionally waiting to broadcast the transaction until a second transaction has a certain number of confirmations.</p> </div> <p>This is intended for use in third-party wallets or in DApps that register names.</p> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>transaction: <span class="tsd-signature-type">string</span></h5> <div class="tsd-comment tsd-typography"> <p>the hex-encoded transaction to broadcast</p> </div> </li> <li> <h5><span class="tsd-flag ts-flagDefault value">Default value</span> transactionToWatch: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> =&nbsp;null</span></h5> <div class="tsd-comment tsd-typography"> <p>the hex transaction id of the transaction to watch for the specified number of confirmations before broadcasting the <code>transaction</code></p> </div> </li> <li> <h5><span class="tsd-flag ts-flagDefault value">Default value</span> confirmations: <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> =&nbsp;6</span></h5> <div class="tsd-comment tsd-typography"> <p>the number of confirmations <code>transactionToWatch</code> must have before broadcasting <code>transaction</code>.</p> </div> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span></h4> <p>Returns a Promise that resolves to an object with a <code>transaction_hash</code> key containing the transaction hash of the broadcasted transaction.</p> <p>In the event of an error, it rejects with:</p> <ul> <li>a <code>RemoteServiceError</code> if there is a problem with the transaction broadcast service</li> <li><code>MissingParameterError</code> if you call the function without a required parameter</li> </ul> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-private"> <a name="broadcastzonefile" class="tsd-anchor"></a> <h3><span class="tsd-flag ts-flagPrivate">Private</span> broadcast<wbr>Zone<wbr>File</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-private"> <li class="tsd-signature tsd-kind-icon">broadcast<wbr>Zone<wbr>File<span class="tsd-signature-symbol">(</span>zoneFile<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span>, transactionToWatch<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">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/blockstack/blockstack.js/blob/master/src/network.ts#L728">src/network.ts:728</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Broadcasts a zone file to the Atlas network via the transaction broadcast service. This is intended for use in third-party wallets or in DApps that register names.</p> </div> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5><span class="tsd-flag ts-flagOptional">Optional</span> zoneFile: <span class="tsd-signature-type">string</span></h5> <div class="tsd-comment tsd-typography"> <p>the zone file to be broadcast to the Atlas network</p> </div> </li> <li> <h5><span class="tsd-flag ts-flagDefault value">Default value</span> transactionToWatch: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> =&nbsp;null</span></h5> <div class="tsd-comment tsd-typography"> <p>the hex transaction id of the transaction to watch for confirmation before broadcasting the zone file to the Atlas network</p> </div> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span></h4> <p>Returns a Promise that resolves to an object with a <code>transaction_hash</code> key containing the transaction hash of the broadcasted transaction.</p> <p>In the event of an error, it rejects with:</p> <ul> <li>a <code>RemoteServiceError</code> if there is a problem with the transaction broadcast service</li> <li><code>MissingParameterError</code> if you call the function without a required parameter</li> </ul> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"> <a name="getaccountat" class="tsd-anchor"></a> <h3>get<wbr>Account<wbr>At</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">get<wbr>Account<wbr>At<span class="tsd-signature-symbol">(</span>address<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, blockHeight<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">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">&gt;</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/blockstack/blockstack.js/blob/master/src/network.ts#L527">src/network.ts:527</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Get the state(s) of an account at a particular block height. This includes the state of the account beginning with this block&#39;s transactions, as well as all of the states the account passed through when this block was processed (if any).</p> </div> <p>This is intended for use in third-party wallets or in DApps that register names.</p> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>address: <span class="tsd-signature-type">string</span></h5> <div class="tsd-comment tsd-typography"> <p>the account&#39;s address</p> </div> </li> <li> <h5>blockHeight: <span class="tsd-signature-type">number</span></h5> <div class="tsd-comment tsd-typography"> <p>the block to query</p> </div> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">&gt;</span></h4> <p>a promise that resolves to an Array of Objects, where each Object encodes states of the account at this block.</p> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"> <a name="getaccountbalance" class="tsd-anchor"></a> <h3>get<wbr>Account<wbr>Balance</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">get<wbr>Account<wbr>Balance<span class="tsd-signature-symbol">(</span>address<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, tokenType<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">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">BN</span><span class="tsd-signature-symbol">&gt;</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/blockstack/blockstack.js/blob/master/src/network.ts#L589">src/network.ts:589</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Get the number of tokens owned by an account. If the account does not exist or has no tokens of this type, then 0 will be returned.</p> </div> <p>This is intended for use in third-party wallets or in DApps that register names.</p> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>address: <span class="tsd-signature-type">string</span></h5> <div class="tsd-comment tsd-typography"> <p>the account&#39;s address</p> </div> </li> <li> <h5>tokenType: <span class="tsd-signature-type">string</span></h5> <div class="tsd-comment tsd-typography"> <p>the type of token to query.</p> </div> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">BN</span><span class="tsd-signature-symbol">&gt;</span></h4> <p>a promise that resolves to a BigInteger that encodes the number of tokens held by this account.</p> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"> <a name="getaccounthistorypage" class="tsd-anchor"></a> <h3>get<wbr>Account<wbr>History<wbr>Page</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">get<wbr>Account<wbr>History<wbr>Page<span class="tsd-signature-symbol">(</span>address<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, page<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">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">&gt;</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/blockstack/blockstack.js/blob/master/src/network.ts#L489">src/network.ts:489</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Get a page of an account&#39;s transaction history. This is intended for use in third-party wallets or in DApps that register names.</p> </div> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>address: <span class="tsd-signature-type">string</span></h5> <div class="tsd-comment tsd-typography"> <p>the account&#39;s address</p> </div> </li> <li> <h5>page: <span class="tsd-signature-type">number</span></h5> <div class="tsd-comment tsd-typography"> <p>the page number. Page 0 is the most recent transactions</p> </div> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">&gt;</span></h4> <p>a promise that resolves to an Array of Objects, where each Object encodes states of the account at various block heights (e.g. prior balances, txids, etc)</p> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"> <a name="getaccountstatus" class="tsd-anchor"></a> <h3>get<wbr>Account<wbr>Status</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">get<wbr>Account<wbr>Status<span class="tsd-signature-symbol">(</span>address<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, tokenType<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">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/blockstack/blockstack.js/blob/master/src/network.ts#L459">src/network.ts:459</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Get the status of an account for a particular token holding. This includes its total number of expenditures and credits, lockup times, last <code>txid</code>, and so on.</p> </div> <p>This is intended for use in third-party wallets or in DApps that register names.</p> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>address: <span class="tsd-signature-type">string</span></h5> <div class="tsd-comment tsd-typography"> <p>the account</p> </div> </li> <li> <h5>tokenType: <span class="tsd-signature-type">string</span></h5> <div class="tsd-comment tsd-typography"> <p>the token type to query</p> </div> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span></h4> <p>a promise that resolves to an object representing the state of the account for this token</p> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"> <a name="getaccounttokens" class="tsd-anchor"></a> <h3>get<wbr>Account<wbr>Tokens</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">get<wbr>Account<wbr>Tokens<span class="tsd-signature-symbol">(</span>address<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">Promise</span><span class="tsd-signature-symbol">&lt;</span><a href="../interfaces/accounttokens.html" class="tsd-signature-type">AccountTokens</a><span class="tsd-signature-symbol">&gt;</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/blockstack/blockstack.js/blob/master/src/network.ts#L560">src/network.ts:560</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Get the set of token types that this account owns. This is intended for use in third-party wallets or in DApps that register names.</p> </div> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>address: <span class="tsd-signature-type">string</span></h5> <div class="tsd-comment tsd-typography"> <p>the account&#39;s address</p> </div> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><a href="../interfaces/accounttokens.html" class="tsd-signature-type">AccountTokens</a><span class="tsd-signature-symbol">&gt;</span></h4> <p>a promise that resolves to an Array of Strings, where each item encodes the type of token this account holds (excluding the underlying blockchain&#39;s tokens)</p> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"> <a name="getdefaultburnaddress" class="tsd-anchor"></a> <h3>get<wbr>Default<wbr>Burn<wbr>Address</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">get<wbr>Default<wbr>Burn<wbr>Address<span class="tsd-signature-symbol">(</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/blockstack/blockstack.js/blob/master/src/network.ts#L118">src/network.ts:118</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>This is intended for use in third-party wallets or in DApps that register names.</p> </div> </div> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"> <a name="getgraceperiod" class="tsd-anchor"></a> <h3>get<wbr>Grace<wbr>Period</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">get<wbr>Grace<wbr>Period<span class="tsd-signature-symbol">(</span>_fullyQualifiedName<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">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">&gt;</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/blockstack/blockstack.js/blob/master/src/network.ts#L304">src/network.ts:304</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>How many blocks can pass between a name expiring and the name being able to be re-registered by a different owner. This is intended for use in third-party wallets or in DApps that register names.</p> </div> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5><span class="tsd-flag ts-flagOptional">Optional</span> _fullyQualifiedName: <span class="tsd-signature-type">string</span></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">&gt;</span></h4> <p>a promise to the number of blocks</p> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"> <a name="getnameinfo" class="tsd-anchor"></a> <h3>get<wbr>Name<wbr>Info</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">get<wbr>Name<wbr>Info<span class="tsd-signature-symbol">(</span>fullyQualifiedName<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">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/blockstack/blockstack.js/blob/master/src/network.ts#L362">src/network.ts:362</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Get WHOIS-like information for a name, including the address that owns it, the block at which it expires, and the zone file anchored to it (if available).</p> </div> <p>This is intended for use in third-party wallets or in DApps that register names.</p> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>fullyQualifiedName: <span class="tsd-signature-type">string</span></h5> <div class="tsd-comment tsd-typography"> <p>the name to query. Can be on-chain of off-chain.</p> </div> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span></h4> <p>a promise that resolves to the WHOIS-like information</p> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"> <a name="getnameprice" class="tsd-anchor"></a> <h3>get<wbr>Name<wbr>Price</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">get<wbr>Name<wbr>Price<span class="tsd-signature-symbol">(</span>fullyQualifiedName<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">Promise</span><span class="tsd-signature-symbol">&lt;</span><a href="../interfaces/priceinfo.html" class="tsd-signature-type">PriceInfo</a><span class="tsd-signature-symbol">&gt;</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/blockstack/blockstack.js/blob/master/src/network.ts#L275">src/network.ts:275</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Get the price of a name. This is intended for use in third-party wallets or in DApps that register names. This is intended for use in third-party wallets or in DApps that register names.</p> </div> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>fullyQualifiedName: <span class="tsd-signature-type">string</span></h5> <div class="tsd-comment tsd-typography"> <p>the name to query</p> </div> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><a href="../interfaces/priceinfo.html" class="tsd-signature-type">PriceInfo</a><span class="tsd-signature-symbol">&gt;</span></h4> <p>a promise to an Object with { units: String, amount: BigInteger }, where .units encodes the cryptocurrency units to pay (e.g. BTC, STACKS), and .amount encodes the number of units, in the smallest denominiated amount (e.g. if .units is BTC, .amount will be satoshis; if .units is STACKS, .amount will be microStacks)</p> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-private"> <a name="getnamepricev1" class="tsd-anchor"></a> <h3><span class="tsd-flag ts-flagPrivate">Private</span> get<wbr>Name<wbr>Price<wbr>V1</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-private"> <li class="tsd-signature tsd-kind-icon">get<wbr>Name<wbr>Price<wbr>V1<span class="tsd-signature-symbol">(</span>fullyQualifiedName<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">Promise</span><span class="tsd-signature-symbol">&lt;</span><a href="../interfaces/priceinfo.html" class="tsd-signature-type">PriceInfo</a><span class="tsd-signature-symbol">&gt;</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/blockstack/blockstack.js/blob/master/src/network.ts#L129">src/network.ts:129</a></li> </ul> </asid