expose broadcast documentation and clean up ordering #362

This commit is contained in:
Larry Salibra
2018-02-12 15:05:23 +02:00
parent 88996857eb
commit 0fd9de7018
5 changed files with 1771 additions and 1142 deletions

View File

@@ -124,6 +124,16 @@
</li>
<li><a
href='#verifyauthresponse'
class="">
verifyAuthResponse
</a>
</li>
<li><a
href='#profiles'
class="h5 bold black caps">
@@ -204,6 +214,16 @@
</li>
<li><a
href='#deletefile'
class="">
deleteFile
</a>
</li>
<li><a
href='#getfile'
class="">
@@ -245,9 +265,9 @@
<li><a
href='#verifyauthresponse'
class="">
verifyAuthResponse
href='#blockchain'
class="h5 bold black caps">
Blockchain
</a>
@@ -283,26 +303,6 @@
</li>
<li><a
href='#deletefile'
class="">
deleteFile
</a>
</li>
<li><a
href='#islaterversion'
class="">
isLaterVersion
</a>
</li>
</ul>
</div>
<div class='mt1 h6 quiet'>
@@ -1002,6 +1002,85 @@ protocol handler is not detected
</section>
<section class='p2 mb2 clearfix bg-white minishadow'>
<div class='clearfix'>
<h3 class='fl m0' id='verifyauthresponse'>
verifyAuthResponse
</h3>
</div>
<p>Verify the authentication response is valid</p>
<div class='pre p1 fill-light mt0'>verifyAuthResponse(token: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>, nameLookupURL: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></div>
<div class='py1 quiet mt1 prose-big'>Parameters</div>
<div class='prose'>
<div class='space-bottom0'>
<div>
<span class='code bold'>token</span> <code class='quiet'>(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>)</code>
the authentication response token
</div>
</div>
<div class='space-bottom0'>
<div>
<span class='code bold'>nameLookupURL</span> <code class='quiet'>(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>)</code>
the url use to verify owner of a username
</div>
</div>
</div>
<div class='py1 quiet mt1 prose-big'>Returns</div>
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></code>:
that resolves to true if auth response
is valid and false if it does not
</section>
@@ -1590,6 +1669,76 @@ version. These features will be rolled out in future updates.</em></p>
<section class='p2 mb2 clearfix bg-white minishadow'>
<div class='clearfix'>
<h3 class='fl m0' id='deletefile'>
deleteFile
</h3>
</div>
<p>Deletes the specified file from the app's data store.</p>
<div class='pre p1 fill-light mt0'>deleteFile(path: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></div>
<div class='py1 quiet mt1 prose-big'>Parameters</div>
<div class='prose'>
<div class='space-bottom0'>
<div>
<span class='code bold'>path</span> <code class='quiet'>(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>)</code>
the path to the file to delete
</div>
</div>
</div>
<div class='py1 quiet mt1 prose-big'>Returns</div>
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></code>:
that resolves when the file has been removed
or rejects with an error
</section>
<section class='p2 mb2 clearfix bg-white minishadow'>
@@ -2012,82 +2161,18 @@ or rejects with an error
<section class='p2 mb2 clearfix bg-white minishadow'>
<div class='clearfix'>
<h3 class='fl m0' id='verifyauthresponse'>
verifyAuthResponse
</h3>
</div>
<p>Verify the authentication response is valid</p>
<div class='pre p1 fill-light mt0'>verifyAuthResponse(token: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>, nameLookupURL: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></div>
<div class='py1 quiet mt1 prose-big'>Parameters</div>
<div class='prose'>
<div class='space-bottom0'>
<div>
<span class='code bold'>token</span> <code class='quiet'>(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>)</code>
the authentication response token
</div>
</div>
<div class='space-bottom0'>
<div>
<span class='code bold'>nameLookupURL</span> <code class='quiet'>(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>)</code>
the url use to verify owner of a username
</div>
</div>
</div>
<div class='py1 quiet mt1 prose-big'>Returns</div>
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></code>:
that resolves to true if auth response
is valid and false if it does not
<div class='keyline-top-not py2'><section class='py2 clearfix'>
<h2 id='blockchain' class='mt0'>
Blockchain
</h2>
<p>Generate and broadcast Blockstack blockchain transactions.</p>
</section>
</div>
@@ -2108,7 +2193,7 @@ is valid and false if it does not
transaction until a second transaction has a certain number of confirmations.</p>
<div class='pre p1 fill-light mt0'>broadcastTransaction(transaction: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>, transactionToWatch: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>, confirmations: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></div>
<div class='pre p1 fill-light mt0'>broadcastTransaction(transaction: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>, transactionToWatch: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>, confirmations: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a>&#x3C;(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a> | <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error">Error</a>)></div>
@@ -2167,10 +2252,18 @@ before broadcasting
<div class='py1 quiet mt1 prose-big'>Returns</div>
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></code>:
returns a Promise that resolves if the request
is accepted by the transaction broadcast service and rejects
if the service responds with an error or is unreachable
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a>&#x3C;(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a> | <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error">Error</a>)></code>:
Returns a Promise that resolves to an object with a
<code>transaction_hash</code>
key containing the transaction hash of the broadcasted transaction.
<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>
@@ -2206,7 +2299,7 @@ if the service responds with an error or is unreachable
<p>Broadcasts a zone file to the Atlas network via the transaction broadcast service.</p>
<div class='pre p1 fill-light mt0'>broadcastZoneFile(zoneFile: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>, transactionToWatch: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></div>
<div class='pre p1 fill-light mt0'>broadcastZoneFile(zoneFile: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>, transactionToWatch: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a>&#x3C;(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a> | <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error">Error</a>)></div>
@@ -2249,10 +2342,18 @@ to watch for confirmation before broadcasting the zone file to the Atlas network
<div class='py1 quiet mt1 prose-big'>Returns</div>
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></code>:
returns a Promise that resolves if the request
is accepted by the transaction broadcast service and rejects
if the service responds with an error or is unreachable
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a>&#x3C;(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a> | <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error">Error</a>)></code>:
Returns a Promise that resolves to an object with a
<code>transaction_hash</code>
key containing the transaction hash of the broadcasted transaction.
<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>
@@ -2298,7 +2399,7 @@ has an appropriate number of confirmations</li>
</ul>
<div class='pre p1 fill-light mt0'>broadcastNameRegistration(preorderTransaction: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>, registerTransaction: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>, zoneFile: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></div>
<div class='pre p1 fill-light mt0'>broadcastNameRegistration(preorderTransaction: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>, registerTransaction: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>, zoneFile: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a>&#x3C;(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a> | <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error">Error</a>)></div>
@@ -2354,158 +2455,18 @@ using the
<div class='py1 quiet mt1 prose-big'>Returns</div>
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></code>:
returns a Promise that resolves if the request
is accepted by the transaction broadcast service and rejects if the service
responds with an error or is unreachable
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a>&#x3C;(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a> | <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error">Error</a>)></code>:
Returns a Promise that resolves to an object with a
</section>
<section class='p2 mb2 clearfix bg-white minishadow'>
<div class='clearfix'>
<h3 class='fl m0' id='deletefile'>
deleteFile
</h3>
</div>
<p>Deletes the specified file from the app's data store.</p>
<div class='pre p1 fill-light mt0'>deleteFile(path: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></div>
<div class='py1 quiet mt1 prose-big'>Parameters</div>
<div class='prose'>
<div class='space-bottom0'>
<div>
<span class='code bold'>path</span> <code class='quiet'>(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>)</code>
the path to the file to delete
</div>
</div>
</div>
<div class='py1 quiet mt1 prose-big'>Returns</div>
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></code>:
that resolves when the file has been removed
or rejects with an error
</section>
<section class='p2 mb2 clearfix bg-white minishadow'>
<div class='clearfix'>
<h3 class='fl m0' id='islaterversion'>
isLaterVersion
</h3>
</div>
<p>Versioning</p>
<div class='pre p1 fill-light mt0'>isLaterVersion(v1: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>, v2: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>): bool</div>
<div class='py1 quiet mt1 prose-big'>Parameters</div>
<div class='prose'>
<div class='space-bottom0'>
<div>
<span class='code bold'>v1</span> <code class='quiet'>(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>)</code>
the left half of the version inequality
</div>
</div>
<div class='space-bottom0'>
<div>
<span class='code bold'>v2</span> <code class='quiet'>(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>)</code>
right half of the version inequality
</div>
</div>
</div>
<div class='py1 quiet mt1 prose-big'>Returns</div>
<code>bool</code>:
iff v1 >= v2
<code>transaction_hash</code>
key containing the transaction hash of the broadcasted transaction.
<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>