Test including docs produced by slate

This commit is contained in:
thephez 2018-06-20 11:11:28 -04:00
parent d835cd69f4
commit 526b45692d
No known key found for this signature in database
GPG key ID: BBC8A06DBE236099
18 changed files with 6270 additions and 0 deletions

Binary file not shown.

View file

@ -0,0 +1,14 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>Generated by IcoMoon</metadata>
<defs>
<font id="slate" horiz-adv-x="1024">
<font-face units-per-em="1024" ascent="960" descent="-64" />
<missing-glyph horiz-adv-x="1024" />
<glyph unicode="&#x20;" d="" horiz-adv-x="512" />
<glyph unicode="&#xe600;" d="M438.857 877.714q119.429 0 220.286-58.857t159.714-159.714 58.857-220.286-58.857-220.286-159.714-159.714-220.286-58.857-220.286 58.857-159.714 159.714-58.857 220.286 58.857 220.286 159.714 159.714 220.286 58.857zM512 165.143v108.571q0 8-5.143 13.429t-12.571 5.429h-109.714q-7.429 0-13.143-5.714t-5.714-13.143v-108.571q0-7.429 5.714-13.143t13.143-5.714h109.714q7.429 0 12.571 5.429t5.143 13.429zM510.857 361.714l10.286 354.857q0 6.857-5.714 10.286-5.714 4.571-13.714 4.571h-125.714q-8 0-13.714-4.571-5.714-3.429-5.714-10.286l9.714-354.857q0-5.714 5.714-10t13.714-4.286h105.714q8 0 13.429 4.286t6 10z" />
<glyph unicode="&#xe602;" d="M585.143 164.571v91.429q0 8-5.143 13.143t-13.143 5.143h-54.857v292.571q0 8-5.143 13.143t-13.143 5.143h-182.857q-8 0-13.143-5.143t-5.143-13.143v-91.429q0-8 5.143-13.143t13.143-5.143h54.857v-182.857h-54.857q-8 0-13.143-5.143t-5.143-13.143v-91.429q0-8 5.143-13.143t13.143-5.143h256q8 0 13.143 5.143t5.143 13.143zM512 676.571v91.429q0 8-5.143 13.143t-13.143 5.143h-109.714q-8 0-13.143-5.143t-5.143-13.143v-91.429q0-8 5.143-13.143t13.143-5.143h109.714q8 0 13.143 5.143t5.143 13.143zM877.714 438.857q0-119.429-58.857-220.286t-159.714-159.714-220.286-58.857-220.286 58.857-159.714 159.714-58.857 220.286 58.857 220.286 159.714 159.714 220.286 58.857 220.286-58.857 159.714-159.714 58.857-220.286z" />
<glyph unicode="&#xe606;" d="M733.714 531.428q0 16-10.286 26.286l-52 51.429q-10.857 10.857-25.714 10.857t-25.714-10.857l-233.143-232.571-129.143 129.143q-10.857 10.857-25.714 10.857t-25.714-10.857l-52-51.429q-10.286-10.286-10.286-26.286 0-15.429 10.286-25.714l206.857-206.857q10.857-10.857 25.714-10.857 15.429 0 26.286 10.857l310.286 310.286q10.286 10.286 10.286 25.714zM877.714 438.857q0-119.429-58.857-220.286t-159.714-159.714-220.286-58.857-220.286 58.857-159.714 159.714-58.857 220.286 58.857 220.286 159.714 159.714 220.286 58.857 220.286-58.857 159.714-159.714 58.857-220.286z" />
<glyph unicode="&#xe607;" d="M658.286 475.428q0 105.714-75.143 180.857t-180.857 75.143-180.857-75.143-75.143-180.857 75.143-180.857 180.857-75.143 180.857 75.143 75.143 180.857zM950.857 0q0-29.714-21.714-51.429t-51.429-21.714q-30.857 0-51.429 21.714l-196 195.429q-102.286-70.857-228-70.857-81.714 0-156.286 31.714t-128.571 85.714-85.714 128.571-31.714 156.286 31.714 156.286 85.714 128.571 128.571 85.714 156.286 31.714 156.286-31.714 128.571-85.714 85.714-128.571 31.714-156.286q0-125.714-70.857-228l196-196q21.143-21.143 21.143-51.429z" horiz-adv-x="951" />
</font></defs></svg>

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 B

View file

@ -0,0 +1,55 @@
<h2 id='abandontransaction'>AbandonTransaction</h2>
<p><em>Added in Bitcoin Core 0.12.0</em></p>
<p>The <code>abandontransaction</code> RPC marks an in-wallet transaction and all its in-wallet descendants as abandoned. This allows their inputs to be respent.</p>
<p><em>Parameter #1---a transaction identifier (TXID)</em></p>
<blockquote>
<p>Abandons the transaction on your node.</p>
</blockquote>
<pre class="highlight plaintext"><code>dash-cli abandontransaction fa3970c341c9f5de6ab13f128cbfec58d732e736a505fe32137ad551c799ecc4
</code></pre>
<table><thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Required</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>TXID</td>
<td>string (hex)</td>
<td>Required<br>(exactly 1)</td>
<td>The TXID of the transaction that you want to abandon. The TXID must be encoded as hex in RPC byte order</td>
</tr>
</tbody></table>
<p><em>Result---<code>null</code> on success</em></p>
<blockquote>
<p>Result (no output from <code>dash-cli</code> because result is set to <code>null</code>).</p>
</blockquote>
<table><thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Required</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td><code>result</code></td>
<td>null</td>
<td>Required<br>(exactly 1)</td>
<td>JSON <code>null</code> when the transaction and all descendants were abandoned</td>
</tr>
</tbody></table>
<p><em>See also</em></p>
<ul>
<li><a href="#getblock">Some other RPC</a>: Link to somewhere</li>
</ul>

View file

@ -0,0 +1,215 @@
<h2 id='getblock'>GetBlock</h2>
<p>The <code>getblock</code> RPC gets a block with a particular header hash from the local block database either as a JSON object or as a serialized block.</p>
<blockquote>
<p>Get a block in raw hex:</p>
</blockquote>
<pre class="highlight plaintext"><code>dash-cli -testnet getblock \
0000000037955fcc39af8b1ae75914ffb422313c0fca7eba96a1ac99c2e57f84 \
false
0100002011f5719a0a0c4881ff98b4a68c1c828dc3b10f5b51033f5f93d48dbf\
000000004b8e38f197d6ee878e160d2bae3ce05ab898a6252458ec67ce770140\
260397c4dd2ed659a1dd001d00636b5601010000000100000000000000000000\
00000000000000000000000000000000000000000000ffffffff4b02041204dd\
2ed65908fabe6d6d7445746d63506b62572d2d35584853467a765a6748696972\
30657a3a6f6d656e010000000000000017fffff9020000000d2f6e6f64655374\
726174756d2f00000000058028bb13010000001976a914bad55652dffb1af943\
41015c94feea79793442fd88ac40e553b1020000001976a9142b7856de53d4c1\
823090c98f8ad79862842c09b588ac4094dd89000000001976a914c2c29ebc78\
7954ef99d01c5f79115abf7012fb8e88ac4094dd89000000001976a914d7b47d\
4b40a23c389f5a17754d7f60f511c7d0ec88ac4094dd89000000001976a914dc\
3e0793134b081145ec0c67a9c72a7b297df27c88ac00000000
</code></pre>
<p><em>Parameter #1---header hash</em></p>
<table><thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Required</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>Header Hash</td>
<td>string (hex)</td>
<td>Required<br>(exactly 1)</td>
<td>The hash of the header of the block to get, encoded as hex in RPC byte order</td>
</tr>
</tbody></table>
<p><em>Parameter #2---whether to get JSON or hex output</em></p>
<table><thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Required</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>Format</td>
<td>boolean</td>
<td>Optional<br>(true or false)</td>
<td>Set to <code>false</code> to get the block in serialized block format; set to <code>true</code> (the default) to get the decoded block as a JSON object</td>
</tr>
</tbody></table>
<p><em>Result (if format was <code>false</code>)---a serialized block</em></p>
<table><thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Required</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td><code>result</code></td>
<td>string (hex)/null</td>
<td>Required<br>(exactly 1</td>
<td>&quot;The requested block as a serialized block, encoded as hex, or JSON <code>null</code> if an error occurred</td>
</tr>
</tbody></table>
<blockquote>
<p>Get the same block in JSON:</p>
</blockquote>
<pre class="highlight plaintext"><code>dash-cli -testnet getblock \
0000000037955fcc39af8b1ae75914ffb422313c0fca7eba96a1ac99c2e57f84
</code></pre><pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
</span><span class="s2">"hash"</span><span class="p">:</span><span class="w"> </span><span class="s2">"0000000037955fcc39af8b1ae75914ffb422313c0fca7eba96a1ac99c2e57f84"</span><span class="p">,</span><span class="w">
</span><span class="s2">"confirmations"</span><span class="p">:</span><span class="w"> </span><span class="mi">3</span><span class="p">,</span><span class="w">
</span><span class="s2">"size"</span><span class="p">:</span><span class="w"> </span><span class="mi">377</span><span class="p">,</span><span class="w">
</span><span class="s2">"height"</span><span class="p">:</span><span class="w"> </span><span class="mi">4612</span><span class="p">,</span><span class="w">
</span><span class="s2">"version"</span><span class="p">:</span><span class="w"> </span><span class="mi">536870913</span><span class="p">,</span><span class="w">
</span><span class="s2">"merkleroot"</span><span class="p">:</span><span class="w"> </span><span class="s2">"c4970326400177ce67ec582425a698b85ae03cae2b0d168e87eed697f1388e4b"</span><span class="p">,</span><span class="w">
</span><span class="s2">"tx"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
</span><span class="s2">"c4970326400177ce67ec582425a698b85ae03cae2b0d168e87eed697f1388e4b"</span><span class="w">
</span><span class="p">],</span><span class="w">
</span><span class="s2">"time"</span><span class="p">:</span><span class="w"> </span><span class="mi">1507208925</span><span class="p">,</span><span class="w">
</span><span class="s2">"mediantime"</span><span class="p">:</span><span class="w"> </span><span class="mi">1507208645</span><span class="p">,</span><span class="w">
</span><span class="s2">"nonce"</span><span class="p">:</span><span class="w"> </span><span class="mi">1449878272</span><span class="p">,</span><span class="w">
</span><span class="s2">"bits"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1d00dda1"</span><span class="p">,</span><span class="w">
</span><span class="s2">"difficulty"</span><span class="p">:</span><span class="w"> </span><span class="mf">1.155066358813473</span><span class="p">,</span><span class="w">
</span><span class="s2">"chainwork"</span><span class="p">:</span><span class="w"> </span><span class="s2">"000000000000000000000000000000000000000000000000000001c3e86f0f04"</span><span class="p">,</span><span class="w">
</span><span class="s2">"previousblockhash"</span><span class="p">:</span><span class="w"> </span><span class="s2">"00000000bf8dd4935f3f03515b0fb1c38d821c8ca6b498ff81480c0a9a71f511"</span><span class="p">,</span><span class="w">
</span><span class="s2">"nextblockhash"</span><span class="p">:</span><span class="w"> </span><span class="s2">"0000000028817c7fce55d802f3647640600535a983d00e16076f284ec6cb001b"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre>
<p><em>Result (if format was <code>true</code> or omitted)---a JSON block</em></p>
<table><thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Required</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td><code>result</code></td>
<td>object/null</td>
<td>Required<br>(exactly 1)</td>
<td>An object containing the requested block, or JSON <code>null</code> if an error occurred</td>
</tr>
<tr>
<td>→<br><code>hash</code></td>
<td>string (hex)</td>
<td>Required<br>(exactly 1)</td>
<td>The hash of this block&#39;s block header encoded as hex in RPC byte order. This is the same as the hash provided in parameter #1</td>
</tr>
<tr>
<td>→<br><code>confirmations</code></td>
<td>number (int)</td>
<td>Required<br>(exactly 1)</td>
<td>The number of confirmations the transactions in this block have, starting at 1 when this block is at the tip of the best block chain. This score will be -1 if the the block is not part of the best block chain&quot;</td>
</tr>
<tr>
<td>→<br><code>size</code></td>
<td>number (int)</td>
<td>Required<br>(exactly 1)</td>
<td>The size of this block in serialized block format, counted in bytes&quot;</td>
</tr>
<tr>
<td>→<br><code>height</code></td>
<td>number (int)</td>
<td>Required<br>(exactly 1)</td>
<td>The height of this block on its block chain&quot;</td>
</tr>
<tr>
<td>→<br><code>version</code></td>
<td>number (int)</td>
<td>Required<br>(exactly 1)</td>
<td>This block&#39;s version number. See [block version numbers][section block versions]&quot;</td>
</tr>
<tr>
<td>→<br><code>merkleroot</code></td>
<td>string (hex)</td>
<td>Required<br>(exactly 1)</td>
<td>The merkle root for this block, encoded as hex in RPC byte order&quot;</td>
</tr>
<tr>
<td>→<br><code>tx</code></td>
<td>array</td>
<td>Required<br>(exactly 1)</td>
<td>An array containing the TXIDs of all transactions in this block. The transactions appear in the array in the same order they appear in the serialized block&quot;</td>
</tr>
<tr>
<td>→ →<br>TXID</td>
<td>string (hex)</td>
<td>Required<br>(1 or more)</td>
<td>The TXID of a transaction in this block, encoded as hex in RPC byte order&quot;</td>
</tr>
<tr>
<td>→<br><code>time</code></td>
<td>number (int)</td>
<td>Required<br>(exactly 1)</td>
<td>The value of the <em>time</em> field in the block header, indicating approximately when the block was created&quot;</td>
</tr>
<tr>
<td>→<br><code>mediantime</code></td>
<td>number (int)</td>
<td>Required<br>(exactly 1)</td>
<td><em>Added in Bitcoin Core 0.12.0</em><br><br>The median block time in Unix epoch time&quot;</td>
</tr>
<tr>
<td>→<br><code>nonce</code></td>
<td>number (int)</td>
<td>Required<br>(exactly 1)</td>
<td>The nonce which was successful at turning this particular block into one that could be added to the best block chain&quot;</td>
</tr>
<tr>
<td>→<br><code>bits</code></td>
<td>string (hex)</td>
<td>Required<br>(exactly 1)</td>
<td>The value of the <em>nBits</em> field in the block header, indicating the target threshold this block&#39;s header had to pass&quot;</td>
</tr>
<tr>
<td>→<br><code>difficulty</code></td>
<td>number (real)</td>
<td>Required<br>(exactly 1)</td>
<td>The estimated amount of work done to find this block relative to the estimated amount of work done to find block 0&quot;</td>
</tr>
<tr>
<td>→<br><code>chainwork</code></td>
<td>string (hex)</td>
<td>Required<br>(exactly 1)</td>
<td>The estimated number of block header hashes miners had to check from the genesis block to this block, encoded as big-endian hex&quot;</td>
</tr>
<tr>
<td>→<br><code>previousblockhash</code></td>
<td>string (hex)</td>
<td>Optional<br>(0 or 1)</td>
<td>The hash of the header of the previous block, encoded as hex in RPC byte order. Not returned for genesis block&quot;</td>
</tr>
<tr>
<td>→<br><code>nextblockhash</code></td>
<td>string (hex)</td>
<td>Optional<br>(0 or 1)</td>
<td>The hash of the next block on the best block chain, if known, encoded as hex in RPC byte order&quot;</td>
</tr>
</tbody></table>

View file

@ -0,0 +1,179 @@
<h1 id='introduction'>Introduction</h1>
<p>Welcome to the Kittn API! You can use our API to access Kittn API endpoints, which can get information on various cats, kittens, and breeds in our database.</p>
<p>We have language bindings in Shell, Ruby, and Python! You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right.</p>
<p>This example API documentation page was created with <a href="https://github.com/lord/slate">Slate</a>. Feel free to edit it and use it as a base for your own API&#39;s documentation.</p>
<h1 id='authentication'>Authentication</h1>
<blockquote>
<p>To authorize, use this code:</p>
</blockquote>
<pre class="highlight ruby tab-ruby"><code><span class="nb">require</span> <span class="s1">'kittn'</span>
<span class="n">api</span> <span class="o">=</span> <span class="no">Kittn</span><span class="o">::</span><span class="no">APIClient</span><span class="p">.</span><span class="nf">authorize!</span><span class="p">(</span><span class="s1">'meowmeowmeow'</span><span class="p">)</span>
</code></pre><pre class="highlight python tab-python"><code><span class="kn">import</span> <span class="nn">kittn</span>
<span class="n">api</span> <span class="o">=</span> <span class="n">kittn</span><span class="o">.</span><span class="n">authorize</span><span class="p">(</span><span class="s">'meowmeowmeow'</span><span class="p">)</span>
</code></pre><pre class="highlight shell tab-shell"><code><span class="c"># With shell, you can just pass the correct header with each request</span>
curl <span class="s2">"api_endpoint_here"</span>
-H <span class="s2">"Authorization: meowmeowmeow"</span>
</code></pre><pre class="highlight javascript tab-javascript"><code><span class="kr">const</span> <span class="nx">kittn</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">'kittn'</span><span class="p">);</span>
<span class="kd">let</span> <span class="nx">api</span> <span class="o">=</span> <span class="nx">kittn</span><span class="p">.</span><span class="nx">authorize</span><span class="p">(</span><span class="s1">'meowmeowmeow'</span><span class="p">);</span>
</code></pre>
<blockquote>
<p>Make sure to replace <code>meowmeowmeow</code> with your API key.</p>
</blockquote>
<p>Kittn uses API keys to allow access to the API. You can register a new Kittn API key at our <a href="http://example.com/developers">developer portal</a>.</p>
<p>Kittn expects for the API key to be included in all API requests to the server in a header that looks like the following:</p>
<p><code>Authorization: meowmeowmeow</code></p>
<aside class="notice">
You must replace <code>meowmeowmeow</code> with your personal API key.
</aside>
<h1 id='kittens'>Kittens</h1><h2 id='get-all-kittens'>Get All Kittens</h2><pre class="highlight ruby tab-ruby"><code><span class="nb">require</span> <span class="s1">'kittn'</span>
<span class="n">api</span> <span class="o">=</span> <span class="no">Kittn</span><span class="o">::</span><span class="no">APIClient</span><span class="p">.</span><span class="nf">authorize!</span><span class="p">(</span><span class="s1">'meowmeowmeow'</span><span class="p">)</span>
<span class="n">api</span><span class="p">.</span><span class="nf">kittens</span><span class="p">.</span><span class="nf">get</span>
</code></pre><pre class="highlight python tab-python"><code><span class="kn">import</span> <span class="nn">kittn</span>
<span class="n">api</span> <span class="o">=</span> <span class="n">kittn</span><span class="o">.</span><span class="n">authorize</span><span class="p">(</span><span class="s">'meowmeowmeow'</span><span class="p">)</span>
<span class="n">api</span><span class="o">.</span><span class="n">kittens</span><span class="o">.</span><span class="n">get</span><span class="p">()</span>
</code></pre><pre class="highlight shell tab-shell"><code>curl <span class="s2">"http://example.com/api/kittens"</span>
-H <span class="s2">"Authorization: meowmeowmeow"</span>
</code></pre><pre class="highlight javascript tab-javascript"><code><span class="kr">const</span> <span class="nx">kittn</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">'kittn'</span><span class="p">);</span>
<span class="kd">let</span> <span class="nx">api</span> <span class="o">=</span> <span class="nx">kittn</span><span class="p">.</span><span class="nx">authorize</span><span class="p">(</span><span class="s1">'meowmeowmeow'</span><span class="p">);</span>
<span class="kd">let</span> <span class="nx">kittens</span> <span class="o">=</span> <span class="nx">api</span><span class="p">.</span><span class="nx">kittens</span><span class="p">.</span><span class="nx">get</span><span class="p">();</span>
</code></pre>
<blockquote>
<p>The above command returns JSON structured like this:</p>
</blockquote>
<pre class="highlight json tab-json"><code><span class="p">[</span><span class="w">
</span><span class="p">{</span><span class="w">
</span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w">
</span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Fluffums"</span><span class="p">,</span><span class="w">
</span><span class="s2">"breed"</span><span class="p">:</span><span class="w"> </span><span class="s2">"calico"</span><span class="p">,</span><span class="w">
</span><span class="s2">"fluffiness"</span><span class="p">:</span><span class="w"> </span><span class="mi">6</span><span class="p">,</span><span class="w">
</span><span class="s2">"cuteness"</span><span class="p">:</span><span class="w"> </span><span class="mi">7</span><span class="w">
</span><span class="p">},</span><span class="w">
</span><span class="p">{</span><span class="w">
</span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
</span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Max"</span><span class="p">,</span><span class="w">
</span><span class="s2">"breed"</span><span class="p">:</span><span class="w"> </span><span class="s2">"unknown"</span><span class="p">,</span><span class="w">
</span><span class="s2">"fluffiness"</span><span class="p">:</span><span class="w"> </span><span class="mi">5</span><span class="p">,</span><span class="w">
</span><span class="s2">"cuteness"</span><span class="p">:</span><span class="w"> </span><span class="mi">10</span><span class="w">
</span><span class="p">}</span><span class="w">
</span><span class="p">]</span><span class="w">
</span></code></pre>
<p>This endpoint retrieves all kittens.</p>
<h3 id='http-request'>HTTP Request</h3>
<p><code>GET http://example.com/api/kittens</code></p>
<h3 id='query-parameters'>Query Parameters</h3>
<table><thead>
<tr>
<th>Parameter</th>
<th>Default</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>include_cats</td>
<td>false</td>
<td>If set to true, the result will also include cats.</td>
</tr>
<tr>
<td>available</td>
<td>true</td>
<td>If set to false, the result will include kittens that have already been adopted.</td>
</tr>
</tbody></table>
<aside class="success">
Remember — a happy kitten is an authenticated kitten!
</aside>
<h2 id='get-a-specific-kitten'>Get a Specific Kitten</h2><pre class="highlight ruby tab-ruby"><code><span class="nb">require</span> <span class="s1">'kittn'</span>
<span class="n">api</span> <span class="o">=</span> <span class="no">Kittn</span><span class="o">::</span><span class="no">APIClient</span><span class="p">.</span><span class="nf">authorize!</span><span class="p">(</span><span class="s1">'meowmeowmeow'</span><span class="p">)</span>
<span class="n">api</span><span class="p">.</span><span class="nf">kittens</span><span class="p">.</span><span class="nf">get</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
</code></pre><pre class="highlight python tab-python"><code><span class="kn">import</span> <span class="nn">kittn</span>
<span class="n">api</span> <span class="o">=</span> <span class="n">kittn</span><span class="o">.</span><span class="n">authorize</span><span class="p">(</span><span class="s">'meowmeowmeow'</span><span class="p">)</span>
<span class="n">api</span><span class="o">.</span><span class="n">kittens</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
</code></pre><pre class="highlight shell tab-shell"><code>curl <span class="s2">"http://example.com/api/kittens/2"</span>
-H <span class="s2">"Authorization: meowmeowmeow"</span>
</code></pre><pre class="highlight javascript tab-javascript"><code><span class="kr">const</span> <span class="nx">kittn</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">'kittn'</span><span class="p">);</span>
<span class="kd">let</span> <span class="nx">api</span> <span class="o">=</span> <span class="nx">kittn</span><span class="p">.</span><span class="nx">authorize</span><span class="p">(</span><span class="s1">'meowmeowmeow'</span><span class="p">);</span>
<span class="kd">let</span> <span class="nx">max</span> <span class="o">=</span> <span class="nx">api</span><span class="p">.</span><span class="nx">kittens</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="mi">2</span><span class="p">);</span>
</code></pre>
<blockquote>
<p>The above command returns JSON structured like this:</p>
</blockquote>
<pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
</span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
</span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Max"</span><span class="p">,</span><span class="w">
</span><span class="s2">"breed"</span><span class="p">:</span><span class="w"> </span><span class="s2">"unknown"</span><span class="p">,</span><span class="w">
</span><span class="s2">"fluffiness"</span><span class="p">:</span><span class="w"> </span><span class="mi">5</span><span class="p">,</span><span class="w">
</span><span class="s2">"cuteness"</span><span class="p">:</span><span class="w"> </span><span class="mi">10</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre>
<p>This endpoint retrieves a specific kitten.</p>
<aside class="warning">Inside HTML code blocks like this one, you can't use Markdown, so use <code>&lt;code&gt;</code> blocks to denote code.</aside>
<h3 id='http-request-2'>HTTP Request</h3>
<p><code>GET http://example.com/kittens/&lt;ID&gt;</code></p>
<h3 id='url-parameters'>URL Parameters</h3>
<table><thead>
<tr>
<th>Parameter</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>ID</td>
<td>The ID of the kitten to retrieve</td>
</tr>
</tbody></table>
<h2 id='delete-a-specific-kitten'>Delete a Specific Kitten</h2><pre class="highlight ruby tab-ruby"><code><span class="nb">require</span> <span class="s1">'kittn'</span>
<span class="n">api</span> <span class="o">=</span> <span class="no">Kittn</span><span class="o">::</span><span class="no">APIClient</span><span class="p">.</span><span class="nf">authorize!</span><span class="p">(</span><span class="s1">'meowmeowmeow'</span><span class="p">)</span>
<span class="n">api</span><span class="p">.</span><span class="nf">kittens</span><span class="p">.</span><span class="nf">delete</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
</code></pre><pre class="highlight python tab-python"><code><span class="kn">import</span> <span class="nn">kittn</span>
<span class="n">api</span> <span class="o">=</span> <span class="n">kittn</span><span class="o">.</span><span class="n">authorize</span><span class="p">(</span><span class="s">'meowmeowmeow'</span><span class="p">)</span>
<span class="n">api</span><span class="o">.</span><span class="n">kittens</span><span class="o">.</span><span class="n">delete</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
</code></pre><pre class="highlight shell tab-shell"><code>curl <span class="s2">"http://example.com/api/kittens/2"</span>
-X DELETE
-H <span class="s2">"Authorization: meowmeowmeow"</span>
</code></pre><pre class="highlight javascript tab-javascript"><code><span class="kr">const</span> <span class="nx">kittn</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">'kittn'</span><span class="p">);</span>
<span class="kd">let</span> <span class="nx">api</span> <span class="o">=</span> <span class="nx">kittn</span><span class="p">.</span><span class="nx">authorize</span><span class="p">(</span><span class="s1">'meowmeowmeow'</span><span class="p">);</span>
<span class="kd">let</span> <span class="nx">max</span> <span class="o">=</span> <span class="nx">api</span><span class="p">.</span><span class="nx">kittens</span><span class="p">.</span><span class="k">delete</span><span class="p">(</span><span class="mi">2</span><span class="p">);</span>
</code></pre>
<blockquote>
<p>The above command returns JSON structured like this:</p>
</blockquote>
<pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
</span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
</span><span class="s2">"deleted"</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="s2">":("</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre>
<p>This endpoint deletes a specific kitten.</p>
<h3 id='http-request-3'>HTTP Request</h3>
<p><code>DELETE http://example.com/kittens/&lt;ID&gt;</code></p>
<h3 id='url-parameters-2'>URL Parameters</h3>
<table><thead>
<tr>
<th>Parameter</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>ID</td>
<td>The ID of the kitten to delete</td>
</tr>
</tbody></table>

View file

@ -0,0 +1,252 @@
<h1 id='rpc-quick-reference'>RPC Quick Reference</h1>
<p>{% comment %}
Styling notes: use highly-visible style for upcoming changes (not yet
released) and changes made in the last 6 months. Use less-visible
style for changes made up to two years ago. Don&#39;t point out
changes made more than two years ago.</p>
<p>Use v0.n.n in abbreviation title to prevent autocrossrefing.
{% endcomment %}</p>
<!-- Dash - Not Implemented -->
<p>{% assign DASH_NOT_IMPLEMENTED=&#39;<strong><abbr title="Not Implemented in Dash">Not Implemented</abbr></strong>&#39; %}</p>
<!-- Dash Core 0.12.3.0 Spring 2018? -->
<p>{% assign DASH_NEW0_12_3=&#39;<strong><abbr title="New in Dash Core v0.12.3">New in Dash Core 0.12.3</abbr></strong>&#39; %}
{% assign DASH_UPDATED0_12_3=&#39;<strong><abbr title="Updated in Dash Core v0.12.3">Updated in Dash Core 0.12.3</abbr></strong>&#39; %}</p>
<!-- Dash Core 0.12.2.0 Nov 2017 -->
<p>{% assign DASH_NEW0_12_2=&#39;<strong><abbr title="New in Dash Core v0.12.2">New in Dash Core 0.12.2</abbr></strong>&#39; %}
{% assign DASH_UPDATED0_12_2=&#39;<strong><abbr title="Updated in Dash Core v0.12.2">Updated in Dash Core 0.12.2</abbr></strong>&#39; %}</p>
<!-- Dash Core 0.12.1.0 Feb 2017 -->
<p>{% assign DASH_NEW0_12_1=&#39;<em><abbr title="New in Dash Core v0.12.1">New in Dash Core 0.12.1</abbr></em>&#39; %}
{% assign DASH_UPDATED0_12_1=&#39;<em><abbr title="Updated in Dash Core v0.12.1">Updated in Dash Core 0.12.1</abbr></em>&#39; %}</p>
<!-- Darkcoin Core 0.11.0 Jan 2015 -->
<p>{% assign DARKCOIN_NEW0_11_0=&#39;<em><abbr title="New in Darkcoin Core v0.11.0">New in Darkcoin Core 0.11.0</abbr></em>&#39; %}
{% assign DARKCOIN_UPDATED0_11_0=&#39;<em><abbr title="Updated in Dash Core v0.11.0">Updated in Darkcoin Core 0.11.0</abbr></em>&#39; %}</p>
<!-- Deprecated -->
<p>{% assign DEPRECATED=&#39;<strong><abbr title="Deprecated; will be removed in a future version of Bitcoin Core">Deprecated</abbr></strong>&#39; %}</p>
<!-- Bitcoin Core 0.14.1 April 2017 -->
<p>{% assign UPDATED0_14_0=&#39;<strong><abbr title="Updated in Bitcoin Core v0.14.1">Updated in Bitcoin Core 0.14.1</abbr></strong>&#39; %}</p>
<!-- Bitcoin Core 0.14.0 March 2017 -->
<p>{% assign NEW0_14_0=&#39;<strong><abbr title="New in Bitcoin Core v0.14.0">New in Bitcoin Core 0.14.0</abbr></strong>&#39; %}
{% assign UPDATED0_14_0=&#39;<strong><abbr title="Updated in Bitcoin Core v0.14.0">Updated in Bitcoin Core 0.14.0</abbr></strong>&#39; %}</p>
<!-- Bitcoin Core 0.13.1 September 2016 -->
<p>{% assign UPDATED0_13_1=&#39;<em><abbr title="Updated in Bitcoin Core v0.13.1">Updated in Bitcoin Core 0.13.1</abbr></em>&#39; %}</p>
<!-- Bitcoin Core 0.13.0 August 2016 -->
<p>{% assign NEW0_13_0=&#39;<em><abbr title="New in Bitcoin Core v0.13.0">New in Bitcoin Core 0.13.0</abbr></em>&#39; %}
{% assign UPDATED0_13_0=&#39;<em><abbr title="Updated in Bitcoin Core v0.13.0">Updated in Bitcoin Core 0.13.0</abbr></em>&#39; %}</p>
<!-- Bitcoin Core 0.12.1 April 2016 -->
<p>{% assign UPDATED0_12_1=&#39;<em><abbr title="Updated in Bitcoin Core v0.12.1">Updated in Bitcoin Core 0.12.1</abbr></em>&#39; %}</p>
<!-- Bitcoin Core 0.12.0 February 2016 -->
<p>{% assign NEW0_12_0=&#39;<em><abbr title="New in Bitcoin Core v0.12.0">New in Bitcoin Core 0.12.0</abbr></em>&#39; %}
{% assign UPDATED0_12_0=&#39;<em><abbr title="Updated in Bitcoin Core v0.12.0">Updated in Bitcoin Core 0.12.0</abbr></em>&#39; %}</p>
<!-- Bitcoin Core 0.11.0 July 2015 -->
<p>{% assign NEW0_11_0=&#39;<em><abbr title="New in Bitcoin Core v0.11.0">New in Bitcoin Core 0.11.0</abbr></em>&#39; %}</p>
<!-- the summaries used below are defined in the files for the
particular RPC and aggregated into this helper file by the makefile
function manual-update-summaries-file. For example, to edit the
summary for GetBestBlockHash, edit
_includes/rpc/getbestblockhash.md and run `make manual-update-summaries`. -->
<p>{% include helpers/summaries.md %}</p>
<h2 id='rpc-summary-table'>RPC Summary Table</h2>
<p>{% include layout/base/rpc-table.html %}</p>
<h2 id='addressindex-rpcs'>Addressindex RPCs</h2>
<p>These RPCs are all Dash-specific and not found in Bitcoin Core</p>
<ul>
<li>[GetAddressBalance][rpc getaddressbalance]: {{summary_getAddressBalance}}</li>
<li>[GetAddressDeltas][rpc getaddressdeltas]: {{summary_getAddressDeltas}}</li>
<li>[GetAddressMempool][rpc getaddressmempool]: {{summary_getAddressMempool}}</li>
<li>[GetAddressTxids][rpc getaddresstxids]: {{summary_getAddressTxids}}</li>
<li>[GetAddressUtxos][rpc getaddressutxos]: {{summary_getAddressUtxos}}</li>
</ul>
<h2 id='block-chain-rpcs'>Block Chain RPCs</h2>
<ul>
<li>[GetBestBlockHash][rpc getbestblockhash]: {{summary_getBestBlockHash}}</li>
<li>[GetBlock][rpc getblock]: {{summary_getBlock}} {{UPDATED0_13_0}}</li>
<li>[GetBlockChainInfo][rpc getblockchaininfo]: {{summary_getBlockChainInfo}} {{DASH_UPDATED0_12_3}} {{UPDATED0_12_1}}</li>
<li>[GetBlockCount][rpc getblockcount]: {{summary_getBlockCount}}</li>
<li>[GetBlockHash][rpc getblockhash]: {{summary_getBlockHash}}</li>
<li>[GetBlockHashes][rpc getblockhashes]: {{summary_getBlockHashes}} {{DASH_NEW0_12_1}}</li>
<li>[GetBlockHeader][rpc getblockheader]: {{summary_getBlockHeader}} {{NEW0_12_0}}</li>
<li>[GetBlockHeaders][rpc getblockheaders]: {{summary_getBlockHeaders}} {{DASH_NEW0_12_1}}</li>
<li>[GetChainTips][rpc getchaintips]: {{summary_getChainTips}} {{DASH_UPDATED0_12_3}}</li>
<li>[GetDifficulty][rpc getdifficulty]: {{summary_getDifficulty}}</li>
<li>[GetMemPoolAncestors][rpc getmempoolancestors]: {{summary_getMemPoolAncestors}} {{DASH_NEW0_12_3}} {{NEW0_13_0}}</li>
<li>[GetMemPoolDescendants][rpc getmempooldescendants]: {{summary_getMemPoolDescendants}} {{DASH_NEW0_12_3}} {{NEW0_13_0}}</li>
<li>[GetMemPoolEntry][rpc getmempoolentry]: {{summary_getMemPoolEntry}} {{DASH_NEW0_12_3}} {{NEW0_13_0}}</li>
<li>[GetMemPoolInfo][rpc getmempoolinfo]: {{summary_getMemPoolInfo}} {{UPDATED0_12_0}}</li>
<li>[GetRawMemPool][rpc getrawmempool]: {{summary_getRawMemPool}} {{DASH_UPDATED0_12_3}} {{UPDATED0_13_0}}</li>
<li>[GetSpentInfo][rpc getspentinfo]: {{summary_getSpentInfo}} {{DASH_NEW0_12_1}}</li>
<li>[GetTxOut][rpc gettxout]: {{summary_getTxOut}}</li>
<li>[GetTxOutProof][rpc gettxoutproof]: {{summary_getTxOutProof}} {{NEW0_11_0}}</li>
<li>[GetTxOutSetInfo][rpc gettxoutsetinfo]: {{summary_getTxOutSetInfo}}</li>
<li>[PreciousBlock][rpc preciousblock]: {{summary_preciousBlock}} {{DASH_NEW0_12_3}} {{NEW0_14_0}}</li>
<li>[PruneBlockChain][rpc pruneblockchain]: {{summary_pruneBlockChain}} {{DASH_NEW0_12_3}} {{NEW0_14_0}}</li>
<li>[VerifyChain][rpc verifychain]: {{summary_verifyChain}}</li>
<li>[VerifyTxOutProof][rpc verifytxoutproof]: {{summary_verifyTxOutProof}} {{NEW0_11_0}}</li>
</ul>
<h2 id='control-rpcs'>Control RPCs</h2>
<ul>
<li>[Debug][rpc debug]: {{summary_debug}} {{DASH_UPDATED0_12_3}}</li>
<li>[GetInfo][rpc getinfo]: {{summary_getInfo}} {{DEPRECATED}}</li>
<li>[GetMemoryInfo][rpc getmemoryinfo]: {{summary_getMemoryInfo}} {{DASH_NEW0_12_3}} {{NEW_14_0}}</li>
<li>[Help][rpc help]: {{summary_help}}</li>
<li>[Stop][rpc stop]: {{summary_stop}}</li>
</ul>
<h2 id='dash-rpcs'>Dash RPCs</h2>
<ul>
<li>[GetGovernanceInfo][rpc getgovernanceinfo]: {{summary_getGovernanceInfo}} {{DASH_UPDATED0_12_3}}</li>
<li>[GetPoolInfo][rpc getpoolinfo]: {{summary_getPoolInfo}}</li>
<li>[GetSuperblockBudget][rpc getsuperblockbudget]: {{summary_getSuperblockBudget}}</li>
<li>[GObject][rpc gobject]: {{summary_gObject}} {{DASH_UPDATED0_12_3}}</li>
<li>[Masternode][rpc masternode]: {{summary_masternode}} {{DASH_UPDATED0_12_3}}</li>
<li>[MasternodeBroadcast][rpc masternodebroadcast]: {{summary_masternodeBroadcast}}</li>
<li>[MasternodeList][rpc masternodelist]: {{summary_masternodeList}} {{DASH_UPDATED0_12_3}}</li>
<li>[MnSync][rpc mnsync]: {{summary_mnSync}}</li>
<li>[PrivateSend][rpc privatesend]: {{summary_privateSend}} {{DASH_UPDATED0_12_3}}</li>
<li>[SentinelPing][rpc sentinelping]: {{summary_sentinelPing}}</li>
<li>[Spork][rpc spork]: {{summary_spork-rpc}}</li>
<li>[VoteRaw][rpc voteraw]: {{summary_voteRaw}}</li>
</ul>
<h2 id='generating-rpcs'>Generating RPCs</h2>
<ul>
<li>[Generate][rpc generate]: {{summary_generate}} {{DASH_UPDATED0_12_3}} {{UPDATED0_13_0}}</li>
<li>[GenerateToAddress][rpc generatetoaddress]: {{summary_generateToAddress}} {{DASH_NEW0_12_3}} {{NEW0_13_0}}</li>
</ul>
<h2 id='mining-rpcs'>Mining RPCs</h2>
<ul>
<li>[GetBlockTemplate][rpc getblocktemplate]: {{summary_getBlockTemplate}} {{DASH_UPDATED0_12_3}}</li>
<li>[GetMiningInfo][rpc getmininginfo]: {{summary_getMiningInfo}} {{UPDATED0_14_0}}</li>
<li>[GetNetworkHashPS][rpc getnetworkhashps]: {{summary_getNetworkHashPS}}</li>
<li>[PrioritiseTransaction][rpc prioritisetransaction]: {{summary_prioritiseTransaction}}</li>
<li>[SubmitBlock][rpc submitblock]: {{summary_submitBlock}}</li>
</ul>
<h2 id='network-rpcs'>Network RPCs</h2>
<ul>
<li>[AddNode][rpc addnode]: {{summary_addNode}} {{UPDATED0_14_0}}</li>
<li>[ClearBanned][rpc clearbanned]: {{summary_clearBanned}} {{NEW0_12_0}}</li>
<li>[DisconnectNode][rpc disconnectnode]: {{summary_disconnectNode}} {{NEW0_12_0}} {{UPDATED0_14_1}}</li>
<li>[GetAddedNodeInfo][rpc getaddednodeinfo]: {{summary_getAddedNodeInfo}} {{DASH_UPDATED0_12_3}} {{UPDATED0_14_0}}</li>
<li>[GetConnectionCount][rpc getconnectioncount]: {{summary_getConnectionCount}}</li>
<li>[GetNetTotals][rpc getnettotals]: {{summary_getNetTotals}} {{UPDATED0_12_0}}</li>
<li>[GetNetworkInfo][rpc getnetworkinfo]: {{summary_getNetworkInfo}} {{DASH_UPDATED0_12_3}} {{UPDATED0_13_0}}</li>
<li>[GetPeerInfo][rpc getpeerinfo]: {{summary_getPeerInfo}} {{UPDATED0_13_0}}</li>
<li>[ListBanned][rpc listbanned]: {{summary_listBanned}} {{NEW0_12_0}}</li>
<li>[Ping][rpc ping]: {{summary_ping-rpc}}</li>
<li>[SetBan][rpc setban]: {{summary_setBan}} {{NEW0_12_0}}</li>
<li>[SetNetworkActive][rpc setnetworkactive]: {{summary_setNetworkActive}} {{NEW0_14_0}}</li>
</ul>
<h2 id='raw-transaction-rpcs'>Raw Transaction RPCs</h2>
<ul>
<li>[CreateRawTransaction][rpc createrawtransaction]: {{summary_createRawTransaction}} {{DASH_UPDATED0_12_3}} {{UPDATED0_14_1}}</li>
<li>[DecodeRawTransaction][rpc decoderawtransaction]: {{summary_decodeRawTransaction}} {{UPDATED0_13_0}}</li>
<li>[DecodeScript][rpc decodescript]: {{summary_decodeScript}}</li>
<li>[FundRawTransaction][rpc fundrawtransaction]: {{summary_fundRawTransaction}} {{DASH_UPDATED0_12_3}} {{UPDATED0_14_0}}</li>
<li>[GetRawTransaction][rpc getrawtransaction]: {{summary_getRawTransaction}} {{DASH_UPDATED0_12_3}} {{UPDATED0_14_0}}</li>
<li>[SendRawTransaction][rpc sendrawtransaction]: {{summary_sendRawTransaction}}</li>
<li>[SignRawTransaction][rpc signrawtransaction]: {{summary_signRawTransaction}}</li>
</ul>
<h2 id='utility-rpcs'>Utility RPCs</h2>
<ul>
<li>[CreateMultiSig][rpc createmultisig]: {{summary_createMultiSig}}</li>
<li>[EstimateFee][rpc estimatefee]: {{summary_estimateFee}}</li>
<li>[EstimatePriority][rpc estimatepriority]: {{summary_estimatePriority}} {{DEPRECATED}}</li>
<li>[EstimateSmartFee][rpc estimatesmartfee]: {{summary_estimateSmartFee}} {{DEPRECATED}}</li>
<li>[EstimateSmartPriority][rpc estimatesmartpriority]: {{summary_estimateSmartPriority}} {{DEPRECATED}}</li>
<li>[SetBIP69Enabled][rpc setbip69enabled]: {{summary_setBIP69Enabled}} {{DASH_NEW0_12_3}}</li>
<li>[SignMessageWithPrivKey][rpc signmessagewithprivkey]: {{summary_signMessageWithPrivKey}} {{DASH_NEW0_12_3}} {{NEW0_13_0}}</li>
<li>[ValidateAddress][rpc validateaddress]: {{summary_validateAddress}} {{DASH_UPDATED0_12_3}} {{UPDATED0_13_0}}</li>
<li>[VerifyMessage][rpc verifymessage]: {{summary_verifyMessage}}</li>
</ul>
<h2 id='wallet-rpcs'>Wallet RPCs</h2>
<p><strong>Note:</strong> the wallet RPCs are only available if Dash Core was built
with [wallet support][]{:#term-wallet-support}{:.term}, which is the
default.</p>
<ul>
<li>[AbandonTransaction][rpc abandontransaction]: {{summary_abandonTransaction}} {{NEW0_12_0}}</li>
<li>[AddMultiSigAddress][rpc addmultisigaddress]: {{summary_addMultiSigAddress}}</li>
<li>[BackupWallet][rpc backupwallet]: {{summary_backupWallet}}</li>
<li>[DumpHDInfo][rpc dumphdinfo]: {{summary_dumpHDInfo}} {{DASH_NEW0_12_2}}</li>
<li>[DumpPrivKey][rpc dumpprivkey]: {{summary_dumpPrivKey}}</li>
<li>[DumpWallet][rpc dumpwallet]: {{summary_dumpWallet}}</li>
<li>[EncryptWallet][rpc encryptwallet]: {{summary_encryptWallet}}</li>
<li>[GetAccount][rpc getaccount]: {{summary_getAccount}} {{DEPRECATED}}</li>
<li>[GetAccountAddress][rpc getaccountaddress]: {{summary_getAccountAddress}} {{DEPRECATED}}</li>
<li>[GetAddressesByAccount][rpc getaddressesbyaccount]: {{summary_getAddressesByAccount}} {{DEPRECATED}}</li>
<li>[GetBalance][rpc getbalance]: {{summary_getBalance}}</li>
<li>[GetNewAddress][rpc getnewaddress]: {{summary_getNewAddress}}</li>
<li>[GetRawChangeAddress][rpc getrawchangeaddress]: {{summary_getRawChangeAddress}}</li>
<li>[GetReceivedByAccount][rpc getreceivedbyaccount]: {{summary_getReceivedByAccount}} {{DEPRECATED}}</li>
<li>[GetReceivedByAddress][rpc getreceivedbyaddress]: {{summary_getReceivedByAddress}}</li>
<li>[GetTransaction][rpc gettransaction]: {{summary_getTransaction}} {{UPDATED0_12_0}}</li>
<li>[GetUnconfirmedBalance][rpc getunconfirmedbalance]: {{summary_getUnconfirmedBalance}}</li>
<li>[GetWalletInfo][rpc getwalletinfo]: {{summary_getWalletInfo}} {{DASH_UPDATED0_12_3}}</li>
<li>[ImportAddress][rpc importaddress]: {{summary_importAddress}}</li>
<li>[ImportElectrumWallet][rpc importelectrumwallet]: {{summary_importElectrumWallet}} {{DASH_NEW0_12_1}}</li>
<li>[ImportMulti][rpc importmulti]: {{summary_importMulti}} {{DASH_NEW0_12_3}} {{NEW0_14_0}}</li>
<li>[ImportPrivKey][rpc importprivkey]: {{summary_importPrivKey}}</li>
<li>[ImportPrunedFunds][rpc importprunedfunds]: {{summary_importPrunedFunds}} {{DASH_NEW0_12_3}} {{NEW0_13_0}}</li>
<li>[ImportPubKey][rpc importpubkey]: {{summary_importPubKey}}</li>
<li>[ImportWallet][rpc importwallet]: {{summary_importWallet}}</li>
<li>[InstantSendToAddress][rpc instantsendtoaddress]: {{summary_instantSendToAddress}}</li>
<li>[KeePass][rpc keepass]: {{summary_keepass}} {{DARKCOIN_NEW0_11_0}}</li>
<li>[KeyPoolRefill][rpc keypoolrefill]: {{summary_keyPoolRefill}}</li>
<li>[ListAccounts][rpc listaccounts]: {{summary_listAccounts}} {{DEPRECATED}}</li>
<li>[ListAddressBalances][rpc listaddressbalances]: {{summary_listAddressBalances}} {{DASH_NEW0_12_3}}</li>
<li>[ListAddressGroupings][rpc listaddressgroupings]: {{summary_listAddressGroupings}}</li>
<li>[ListLockUnspent][rpc listlockunspent]: {{summary_listLockUnspent}}</li>
<li>[ListReceivedByAccount][rpc listreceivedbyaccount]: {{summary_listReceivedByAccount}} {{DEPRECATED}}</li>
<li>[ListReceivedByAddress][rpc listreceivedbyaddress]: {{summary_listReceivedByAddress}}</li>
<li>[ListSinceBlock][rpc listsinceblock]: {{summary_listSinceBlock}}</li>
<li>[ListTransactions][rpc listtransactions]: {{summary_listTransactions}} {{UPDATED0_12_1}}</li>
<li>[ListUnspent][rpc listunspent]: {{summary_listUnspent}} {{DASH_UPDATED0_12_3}} {{UPDATED0_13_0}}</li>
<li>[LockUnspent][rpc lockunspent]: {{summary_lockUnspent}}</li>
<li>[Move][rpc move]: {{summary_move}} {{DEPRECATED}}</li>
<li>[RemovePrunedFunds][rpc removeprunedfunds]: {{summary_removePrunedFunds}} {{DASH_NEW0_12_3}} {{NEW0_13_0}}</li>
<li>[SendFrom][rpc sendfrom]: {{summary_sendFrom}} {{DEPRECATED}}</li>
<li>[SendMany][rpc sendmany]: {{summary_sendMany}}</li>
<li>[SendToAddress][rpc sendtoaddress]: {{summary_sendToAddress}}</li>
<li>[SetAccount][rpc setaccount]: {{summary_setAccount}} {{DEPRECATED}}</li>
<li>[SetTxFee][rpc settxfee]: {{summary_setTxFee}}</li>
<li>[SignMessage][rpc signmessage]: {{summary_signMessage}}</li>
<li>[WalletLock][rpc walletlock]: {{summary_walletLock}}</li>
<li>[WalletPassphrase][rpc walletpassphrase]: {{summary_walletPassphrase}}</li>
<li><p>[WalletPassphraseChange][rpc walletpassphrasechange]: {{summary_walletPassphraseChange}}</p></li>
<li><p>{{DASH_NOT_IMPLEMENTED}} [AddWitnessAddress][rpc addwitnessaddress]: {{summary_addWitnessAddress}} {{NEW0_13_0}}</p></li>
<li><p>{{DASH_NOT_IMPLEMENTED}} [BumpFee][rpc bumpfee]: {{summary_bumpFee}} {{NEW0_14_0}}</p></li>
</ul>
<h2 id='removed-rpcs'>Removed RPCs</h2>
<ul>
<li>[GetHashesPerSec][rpc gethashespersec]: {{summary_getHashesPerSec}}</li>
<li>[GetWork][rpc getwork]: {{summary_getWork}}</li>
<li>[GetGenerate][rpc getgenerate]: {{summary_getGenerate}}</li>
<li>[SetGenerate][rpc setgenerate]: {{summary_setGenerate}}</li>
</ul>

File diff suppressed because it is too large Load diff

763
en/slate-example/index.html Normal file
View file

@ -0,0 +1,763 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>API Reference</title>
<style>
.highlight table td { padding: 5px; }
.highlight table pre { margin: 0; }
.highlight .gh {
color: #999999;
}
.highlight .sr {
color: #f6aa11;
}
.highlight .go {
color: #888888;
}
.highlight .gp {
color: #555555;
}
.highlight .gs {
}
.highlight .gu {
color: #aaaaaa;
}
.highlight .nb {
color: #f6aa11;
}
.highlight .cm {
color: #75715e;
}
.highlight .cp {
color: #75715e;
}
.highlight .c1 {
color: #75715e;
}
.highlight .cs {
color: #75715e;
}
.highlight .c, .highlight .cd {
color: #75715e;
}
.highlight .err {
color: #960050;
}
.highlight .gr {
color: #960050;
}
.highlight .gt {
color: #960050;
}
.highlight .gd {
color: #49483e;
}
.highlight .gi {
color: #49483e;
}
.highlight .ge {
color: #49483e;
}
.highlight .kc {
color: #66d9ef;
}
.highlight .kd {
color: #66d9ef;
}
.highlight .kr {
color: #66d9ef;
}
.highlight .no {
color: #66d9ef;
}
.highlight .kt {
color: #66d9ef;
}
.highlight .mf {
color: #ae81ff;
}
.highlight .mh {
color: #ae81ff;
}
.highlight .il {
color: #ae81ff;
}
.highlight .mi {
color: #ae81ff;
}
.highlight .mo {
color: #ae81ff;
}
.highlight .m, .highlight .mb, .highlight .mx {
color: #ae81ff;
}
.highlight .sc {
color: #ae81ff;
}
.highlight .se {
color: #ae81ff;
}
.highlight .ss {
color: #ae81ff;
}
.highlight .sd {
color: #e6db74;
}
.highlight .s2 {
color: #e6db74;
}
.highlight .sb {
color: #e6db74;
}
.highlight .sh {
color: #e6db74;
}
.highlight .si {
color: #e6db74;
}
.highlight .sx {
color: #e6db74;
}
.highlight .s1 {
color: #e6db74;
}
.highlight .s {
color: #e6db74;
}
.highlight .na {
color: #a6e22e;
}
.highlight .nc {
color: #a6e22e;
}
.highlight .nd {
color: #a6e22e;
}
.highlight .ne {
color: #a6e22e;
}
.highlight .nf {
color: #a6e22e;
}
.highlight .vc {
color: #ffffff;
}
.highlight .nn {
color: #ffffff;
}
.highlight .nl {
color: #ffffff;
}
.highlight .ni {
color: #ffffff;
}
.highlight .bp {
color: #ffffff;
}
.highlight .vg {
color: #ffffff;
}
.highlight .vi {
color: #ffffff;
}
.highlight .nv {
color: #ffffff;
}
.highlight .w {
color: #ffffff;
}
.highlight {
color: #ffffff;
}
.highlight .n, .highlight .py, .highlight .nx {
color: #ffffff;
}
.highlight .ow {
color: #f92672;
}
.highlight .nt {
color: #f92672;
}
.highlight .k, .highlight .kv {
color: #f92672;
}
.highlight .kn {
color: #f92672;
}
.highlight .kp {
color: #f92672;
}
.highlight .o {
color: #f92672;
}
</style>
<link href="stylesheets/screen.css" rel="stylesheet" media="screen" />
<link href="stylesheets/print.css" rel="stylesheet" media="print" />
<script src="javascripts/all.js"></script>
</head>
<body class="index" data-languages="[&quot;cli&quot;]">
<a href="#" id="nav-button">
<span>
NAV
<img src="images/navbar.png" alt="Navbar" />
</span>
</a>
<div class="toc-wrapper">
<img src="images/logo.png" class="logo" alt="Logo" />
<div class="lang-selector">
<a href="#" data-language-name="cli">cli</a>
</div>
<div class="search">
<input type="text" class="search" id="input-search" placeholder="Search">
</div>
<ul class="search-results"></ul>
<div id="toc" class="toc-list-h1">
<li>
<a href="#dash-core-rpcs" class="toc-h1 toc-link" data-title="dash-core-rpcs">Dash Core RPCs</a>
<ul class="toc-list-h2">
<li>
<a href="#abandontransaction" class="toc-h2 toc-link" data-title="abandontransaction">AbandonTransaction</a>
</li>
<li>
<a href="#getblock" class="toc-h2 toc-link" data-title="getblock">GetBlock</a>
</li>
</ul>
</li>
<li>
<a href="#introduction" class="toc-h1 toc-link" data-title="introduction">Introduction</a>
</li>
<li>
<a href="#authentication" class="toc-h1 toc-link" data-title="authentication">Authentication</a>
</li>
<li>
<a href="#kittens" class="toc-h1 toc-link" data-title="kittens">Kittens</a>
<ul class="toc-list-h2">
<li>
<a href="#get-all-kittens" class="toc-h2 toc-link" data-title="get-all-kittens">Get All Kittens</a>
<ul class="toc-list-h3">
<li>
<a href="#http-request" class="toc-h3 toc-link" data-title="HTTP Request">HTTP Request</a>
</li>
<li>
<a href="#query-parameters" class="toc-h3 toc-link" data-title="Query Parameters">Query Parameters</a>
</li>
</ul>
</li>
<li>
<a href="#get-a-specific-kitten" class="toc-h2 toc-link" data-title="get-a-specific-kitten">Get a Specific Kitten</a>
<ul class="toc-list-h3">
<li>
<a href="#http-request-2" class="toc-h3 toc-link" data-title="HTTP Request">HTTP Request</a>
</li>
<li>
<a href="#url-parameters" class="toc-h3 toc-link" data-title="URL Parameters">URL Parameters</a>
</li>
</ul>
</li>
<li>
<a href="#delete-a-specific-kitten" class="toc-h2 toc-link" data-title="delete-a-specific-kitten">Delete a Specific Kitten</a>
<ul class="toc-list-h3">
<li>
<a href="#http-request-3" class="toc-h3 toc-link" data-title="HTTP Request">HTTP Request</a>
</li>
<li>
<a href="#url-parameters-2" class="toc-h3 toc-link" data-title="URL Parameters">URL Parameters</a>
</li>
</ul>
</li>
</ul>
</li>
</div>
<ul class="toc-footer">
<li><a href='#'>Sign Up for a Developer Key</a></li>
<li><a href='https://github.com/lord/slate'>Documentation Powered by Slate</a></li>
</ul>
</div>
<div class="page-wrapper">
<div class="dark-box"></div>
<div class="content">
<h1 id='dash-core-rpcs'>Dash Core RPCs</h1><h2 id='abandontransaction'>AbandonTransaction</h2>
<p><em>Added in Bitcoin Core 0.12.0</em></p>
<p>The <code>abandontransaction</code> RPC marks an in-wallet transaction and all its in-wallet descendants as abandoned. This allows their inputs to be respent.</p>
<p><em>Parameter #1---a transaction identifier (TXID)</em></p>
<blockquote>
<p>Abandons the transaction on your node.</p>
</blockquote>
<pre class="highlight plaintext"><code>dash-cli abandontransaction fa3970c341c9f5de6ab13f128cbfec58d732e736a505fe32137ad551c799ecc4
</code></pre>
<table><thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Required</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>TXID</td>
<td>string (hex)</td>
<td>Required<br>(exactly 1)</td>
<td>The TXID of the transaction that you want to abandon. The TXID must be encoded as hex in RPC byte order</td>
</tr>
</tbody></table>
<p><em>Result---<code>null</code> on success</em></p>
<blockquote>
<p>Result (no output from <code>dash-cli</code> because result is set to <code>null</code>).</p>
</blockquote>
<table><thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Required</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td><code>result</code></td>
<td>null</td>
<td>Required<br>(exactly 1)</td>
<td>JSON <code>null</code> when the transaction and all descendants were abandoned</td>
</tr>
</tbody></table>
<p><em>See also</em></p>
<ul>
<li><a href="#getblock">Some other RPC</a>: Link to somewhere</li>
</ul>
<h2 id='getblock'>GetBlock</h2>
<p>The <code>getblock</code> RPC gets a block with a particular header hash from the local block database either as a JSON object or as a serialized block.</p>
<blockquote>
<p>Get a block in raw hex:</p>
</blockquote>
<pre class="highlight plaintext"><code>dash-cli -testnet getblock \
0000000037955fcc39af8b1ae75914ffb422313c0fca7eba96a1ac99c2e57f84 \
false
0100002011f5719a0a0c4881ff98b4a68c1c828dc3b10f5b51033f5f93d48dbf\
000000004b8e38f197d6ee878e160d2bae3ce05ab898a6252458ec67ce770140\
260397c4dd2ed659a1dd001d00636b5601010000000100000000000000000000\
00000000000000000000000000000000000000000000ffffffff4b02041204dd\
2ed65908fabe6d6d7445746d63506b62572d2d35584853467a765a6748696972\
30657a3a6f6d656e010000000000000017fffff9020000000d2f6e6f64655374\
726174756d2f00000000058028bb13010000001976a914bad55652dffb1af943\
41015c94feea79793442fd88ac40e553b1020000001976a9142b7856de53d4c1\
823090c98f8ad79862842c09b588ac4094dd89000000001976a914c2c29ebc78\
7954ef99d01c5f79115abf7012fb8e88ac4094dd89000000001976a914d7b47d\
4b40a23c389f5a17754d7f60f511c7d0ec88ac4094dd89000000001976a914dc\
3e0793134b081145ec0c67a9c72a7b297df27c88ac00000000
</code></pre>
<p><em>Parameter #1---header hash</em></p>
<table><thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Required</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>Header Hash</td>
<td>string (hex)</td>
<td>Required<br>(exactly 1)</td>
<td>The hash of the header of the block to get, encoded as hex in RPC byte order</td>
</tr>
</tbody></table>
<p><em>Parameter #2---whether to get JSON or hex output</em></p>
<table><thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Required</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>Format</td>
<td>boolean</td>
<td>Optional<br>(true or false)</td>
<td>Set to <code>false</code> to get the block in serialized block format; set to <code>true</code> (the default) to get the decoded block as a JSON object</td>
</tr>
</tbody></table>
<p><em>Result (if format was <code>false</code>)---a serialized block</em></p>
<table><thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Required</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td><code>result</code></td>
<td>string (hex)/null</td>
<td>Required<br>(exactly 1</td>
<td>&quot;The requested block as a serialized block, encoded as hex, or JSON <code>null</code> if an error occurred</td>
</tr>
</tbody></table>
<blockquote>
<p>Get the same block in JSON:</p>
</blockquote>
<pre class="highlight plaintext"><code>dash-cli -testnet getblock \
0000000037955fcc39af8b1ae75914ffb422313c0fca7eba96a1ac99c2e57f84
</code></pre><pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
</span><span class="s2">"hash"</span><span class="p">:</span><span class="w"> </span><span class="s2">"0000000037955fcc39af8b1ae75914ffb422313c0fca7eba96a1ac99c2e57f84"</span><span class="p">,</span><span class="w">
</span><span class="s2">"confirmations"</span><span class="p">:</span><span class="w"> </span><span class="mi">3</span><span class="p">,</span><span class="w">
</span><span class="s2">"size"</span><span class="p">:</span><span class="w"> </span><span class="mi">377</span><span class="p">,</span><span class="w">
</span><span class="s2">"height"</span><span class="p">:</span><span class="w"> </span><span class="mi">4612</span><span class="p">,</span><span class="w">
</span><span class="s2">"version"</span><span class="p">:</span><span class="w"> </span><span class="mi">536870913</span><span class="p">,</span><span class="w">
</span><span class="s2">"merkleroot"</span><span class="p">:</span><span class="w"> </span><span class="s2">"c4970326400177ce67ec582425a698b85ae03cae2b0d168e87eed697f1388e4b"</span><span class="p">,</span><span class="w">
</span><span class="s2">"tx"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
</span><span class="s2">"c4970326400177ce67ec582425a698b85ae03cae2b0d168e87eed697f1388e4b"</span><span class="w">
</span><span class="p">],</span><span class="w">
</span><span class="s2">"time"</span><span class="p">:</span><span class="w"> </span><span class="mi">1507208925</span><span class="p">,</span><span class="w">
</span><span class="s2">"mediantime"</span><span class="p">:</span><span class="w"> </span><span class="mi">1507208645</span><span class="p">,</span><span class="w">
</span><span class="s2">"nonce"</span><span class="p">:</span><span class="w"> </span><span class="mi">1449878272</span><span class="p">,</span><span class="w">
</span><span class="s2">"bits"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1d00dda1"</span><span class="p">,</span><span class="w">
</span><span class="s2">"difficulty"</span><span class="p">:</span><span class="w"> </span><span class="mf">1.155066358813473</span><span class="p">,</span><span class="w">
</span><span class="s2">"chainwork"</span><span class="p">:</span><span class="w"> </span><span class="s2">"000000000000000000000000000000000000000000000000000001c3e86f0f04"</span><span class="p">,</span><span class="w">
</span><span class="s2">"previousblockhash"</span><span class="p">:</span><span class="w"> </span><span class="s2">"00000000bf8dd4935f3f03515b0fb1c38d821c8ca6b498ff81480c0a9a71f511"</span><span class="p">,</span><span class="w">
</span><span class="s2">"nextblockhash"</span><span class="p">:</span><span class="w"> </span><span class="s2">"0000000028817c7fce55d802f3647640600535a983d00e16076f284ec6cb001b"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre>
<p><em>Result (if format was <code>true</code> or omitted)---a JSON block</em></p>
<table><thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Required</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td><code>result</code></td>
<td>object/null</td>
<td>Required<br>(exactly 1)</td>
<td>An object containing the requested block, or JSON <code>null</code> if an error occurred</td>
</tr>
<tr>
<td><br><code>hash</code></td>
<td>string (hex)</td>
<td>Required<br>(exactly 1)</td>
<td>The hash of this block&#39;s block header encoded as hex in RPC byte order. This is the same as the hash provided in parameter #1</td>
</tr>
<tr>
<td><br><code>confirmations</code></td>
<td>number (int)</td>
<td>Required<br>(exactly 1)</td>
<td>The number of confirmations the transactions in this block have, starting at 1 when this block is at the tip of the best block chain. This score will be -1 if the the block is not part of the best block chain&quot;</td>
</tr>
<tr>
<td><br><code>size</code></td>
<td>number (int)</td>
<td>Required<br>(exactly 1)</td>
<td>The size of this block in serialized block format, counted in bytes&quot;</td>
</tr>
<tr>
<td><br><code>height</code></td>
<td>number (int)</td>
<td>Required<br>(exactly 1)</td>
<td>The height of this block on its block chain&quot;</td>
</tr>
<tr>
<td><br><code>version</code></td>
<td>number (int)</td>
<td>Required<br>(exactly 1)</td>
<td>This block&#39;s version number. See [block version numbers][section block versions]&quot;</td>
</tr>
<tr>
<td><br><code>merkleroot</code></td>
<td>string (hex)</td>
<td>Required<br>(exactly 1)</td>
<td>The merkle root for this block, encoded as hex in RPC byte order&quot;</td>
</tr>
<tr>
<td><br><code>tx</code></td>
<td>array</td>
<td>Required<br>(exactly 1)</td>
<td>An array containing the TXIDs of all transactions in this block. The transactions appear in the array in the same order they appear in the serialized block&quot;</td>
</tr>
<tr>
<td>→ →<br>TXID</td>
<td>string (hex)</td>
<td>Required<br>(1 or more)</td>
<td>The TXID of a transaction in this block, encoded as hex in RPC byte order&quot;</td>
</tr>
<tr>
<td><br><code>time</code></td>
<td>number (int)</td>
<td>Required<br>(exactly 1)</td>
<td>The value of the <em>time</em> field in the block header, indicating approximately when the block was created&quot;</td>
</tr>
<tr>
<td><br><code>mediantime</code></td>
<td>number (int)</td>
<td>Required<br>(exactly 1)</td>
<td><em>Added in Bitcoin Core 0.12.0</em><br><br>The median block time in Unix epoch time&quot;</td>
</tr>
<tr>
<td><br><code>nonce</code></td>
<td>number (int)</td>
<td>Required<br>(exactly 1)</td>
<td>The nonce which was successful at turning this particular block into one that could be added to the best block chain&quot;</td>
</tr>
<tr>
<td><br><code>bits</code></td>
<td>string (hex)</td>
<td>Required<br>(exactly 1)</td>
<td>The value of the <em>nBits</em> field in the block header, indicating the target threshold this block&#39;s header had to pass&quot;</td>
</tr>
<tr>
<td><br><code>difficulty</code></td>
<td>number (real)</td>
<td>Required<br>(exactly 1)</td>
<td>The estimated amount of work done to find this block relative to the estimated amount of work done to find block 0&quot;</td>
</tr>
<tr>
<td><br><code>chainwork</code></td>
<td>string (hex)</td>
<td>Required<br>(exactly 1)</td>
<td>The estimated number of block header hashes miners had to check from the genesis block to this block, encoded as big-endian hex&quot;</td>
</tr>
<tr>
<td><br><code>previousblockhash</code></td>
<td>string (hex)</td>
<td>Optional<br>(0 or 1)</td>
<td>The hash of the header of the previous block, encoded as hex in RPC byte order. Not returned for genesis block&quot;</td>
</tr>
<tr>
<td><br><code>nextblockhash</code></td>
<td>string (hex)</td>
<td>Optional<br>(0 or 1)</td>
<td>The hash of the next block on the best block chain, if known, encoded as hex in RPC byte order&quot;</td>
</tr>
</tbody></table>
<h1 id='introduction'>Introduction</h1>
<p>Welcome to the Kittn API! You can use our API to access Kittn API endpoints, which can get information on various cats, kittens, and breeds in our database.</p>
<p>We have language bindings in Shell, Ruby, and Python! You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right.</p>
<p>This example API documentation page was created with <a href="https://github.com/lord/slate">Slate</a>. Feel free to edit it and use it as a base for your own API&#39;s documentation.</p>
<h1 id='authentication'>Authentication</h1>
<blockquote>
<p>To authorize, use this code:</p>
</blockquote>
<pre class="highlight ruby tab-ruby"><code><span class="nb">require</span> <span class="s1">'kittn'</span>
<span class="n">api</span> <span class="o">=</span> <span class="no">Kittn</span><span class="o">::</span><span class="no">APIClient</span><span class="p">.</span><span class="nf">authorize!</span><span class="p">(</span><span class="s1">'meowmeowmeow'</span><span class="p">)</span>
</code></pre><pre class="highlight python tab-python"><code><span class="kn">import</span> <span class="nn">kittn</span>
<span class="n">api</span> <span class="o">=</span> <span class="n">kittn</span><span class="o">.</span><span class="n">authorize</span><span class="p">(</span><span class="s">'meowmeowmeow'</span><span class="p">)</span>
</code></pre><pre class="highlight shell tab-shell"><code><span class="c"># With shell, you can just pass the correct header with each request</span>
curl <span class="s2">"api_endpoint_here"</span>
-H <span class="s2">"Authorization: meowmeowmeow"</span>
</code></pre><pre class="highlight javascript tab-javascript"><code><span class="kr">const</span> <span class="nx">kittn</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">'kittn'</span><span class="p">);</span>
<span class="kd">let</span> <span class="nx">api</span> <span class="o">=</span> <span class="nx">kittn</span><span class="p">.</span><span class="nx">authorize</span><span class="p">(</span><span class="s1">'meowmeowmeow'</span><span class="p">);</span>
</code></pre>
<blockquote>
<p>Make sure to replace <code>meowmeowmeow</code> with your API key.</p>
</blockquote>
<p>Kittn uses API keys to allow access to the API. You can register a new Kittn API key at our <a href="http://example.com/developers">developer portal</a>.</p>
<p>Kittn expects for the API key to be included in all API requests to the server in a header that looks like the following:</p>
<p><code>Authorization: meowmeowmeow</code></p>
<aside class="notice">
You must replace <code>meowmeowmeow</code> with your personal API key.
</aside>
<h1 id='kittens'>Kittens</h1><h2 id='get-all-kittens'>Get All Kittens</h2><pre class="highlight ruby tab-ruby"><code><span class="nb">require</span> <span class="s1">'kittn'</span>
<span class="n">api</span> <span class="o">=</span> <span class="no">Kittn</span><span class="o">::</span><span class="no">APIClient</span><span class="p">.</span><span class="nf">authorize!</span><span class="p">(</span><span class="s1">'meowmeowmeow'</span><span class="p">)</span>
<span class="n">api</span><span class="p">.</span><span class="nf">kittens</span><span class="p">.</span><span class="nf">get</span>
</code></pre><pre class="highlight python tab-python"><code><span class="kn">import</span> <span class="nn">kittn</span>
<span class="n">api</span> <span class="o">=</span> <span class="n">kittn</span><span class="o">.</span><span class="n">authorize</span><span class="p">(</span><span class="s">'meowmeowmeow'</span><span class="p">)</span>
<span class="n">api</span><span class="o">.</span><span class="n">kittens</span><span class="o">.</span><span class="n">get</span><span class="p">()</span>
</code></pre><pre class="highlight shell tab-shell"><code>curl <span class="s2">"http://example.com/api/kittens"</span>
-H <span class="s2">"Authorization: meowmeowmeow"</span>
</code></pre><pre class="highlight javascript tab-javascript"><code><span class="kr">const</span> <span class="nx">kittn</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">'kittn'</span><span class="p">);</span>
<span class="kd">let</span> <span class="nx">api</span> <span class="o">=</span> <span class="nx">kittn</span><span class="p">.</span><span class="nx">authorize</span><span class="p">(</span><span class="s1">'meowmeowmeow'</span><span class="p">);</span>
<span class="kd">let</span> <span class="nx">kittens</span> <span class="o">=</span> <span class="nx">api</span><span class="p">.</span><span class="nx">kittens</span><span class="p">.</span><span class="nx">get</span><span class="p">();</span>
</code></pre>
<blockquote>
<p>The above command returns JSON structured like this:</p>
</blockquote>
<pre class="highlight json tab-json"><code><span class="p">[</span><span class="w">
</span><span class="p">{</span><span class="w">
</span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w">
</span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Fluffums"</span><span class="p">,</span><span class="w">
</span><span class="s2">"breed"</span><span class="p">:</span><span class="w"> </span><span class="s2">"calico"</span><span class="p">,</span><span class="w">
</span><span class="s2">"fluffiness"</span><span class="p">:</span><span class="w"> </span><span class="mi">6</span><span class="p">,</span><span class="w">
</span><span class="s2">"cuteness"</span><span class="p">:</span><span class="w"> </span><span class="mi">7</span><span class="w">
</span><span class="p">},</span><span class="w">
</span><span class="p">{</span><span class="w">
</span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
</span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Max"</span><span class="p">,</span><span class="w">
</span><span class="s2">"breed"</span><span class="p">:</span><span class="w"> </span><span class="s2">"unknown"</span><span class="p">,</span><span class="w">
</span><span class="s2">"fluffiness"</span><span class="p">:</span><span class="w"> </span><span class="mi">5</span><span class="p">,</span><span class="w">
</span><span class="s2">"cuteness"</span><span class="p">:</span><span class="w"> </span><span class="mi">10</span><span class="w">
</span><span class="p">}</span><span class="w">
</span><span class="p">]</span><span class="w">
</span></code></pre>
<p>This endpoint retrieves all kittens.</p>
<h3 id='http-request'>HTTP Request</h3>
<p><code>GET http://example.com/api/kittens</code></p>
<h3 id='query-parameters'>Query Parameters</h3>
<table><thead>
<tr>
<th>Parameter</th>
<th>Default</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>include_cats</td>
<td>false</td>
<td>If set to true, the result will also include cats.</td>
</tr>
<tr>
<td>available</td>
<td>true</td>
<td>If set to false, the result will include kittens that have already been adopted.</td>
</tr>
</tbody></table>
<aside class="success">
Remember — a happy kitten is an authenticated kitten!
</aside>
<h2 id='get-a-specific-kitten'>Get a Specific Kitten</h2><pre class="highlight ruby tab-ruby"><code><span class="nb">require</span> <span class="s1">'kittn'</span>
<span class="n">api</span> <span class="o">=</span> <span class="no">Kittn</span><span class="o">::</span><span class="no">APIClient</span><span class="p">.</span><span class="nf">authorize!</span><span class="p">(</span><span class="s1">'meowmeowmeow'</span><span class="p">)</span>
<span class="n">api</span><span class="p">.</span><span class="nf">kittens</span><span class="p">.</span><span class="nf">get</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
</code></pre><pre class="highlight python tab-python"><code><span class="kn">import</span> <span class="nn">kittn</span>
<span class="n">api</span> <span class="o">=</span> <span class="n">kittn</span><span class="o">.</span><span class="n">authorize</span><span class="p">(</span><span class="s">'meowmeowmeow'</span><span class="p">)</span>
<span class="n">api</span><span class="o">.</span><span class="n">kittens</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
</code></pre><pre class="highlight shell tab-shell"><code>curl <span class="s2">"http://example.com/api/kittens/2"</span>
-H <span class="s2">"Authorization: meowmeowmeow"</span>
</code></pre><pre class="highlight javascript tab-javascript"><code><span class="kr">const</span> <span class="nx">kittn</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">'kittn'</span><span class="p">);</span>
<span class="kd">let</span> <span class="nx">api</span> <span class="o">=</span> <span class="nx">kittn</span><span class="p">.</span><span class="nx">authorize</span><span class="p">(</span><span class="s1">'meowmeowmeow'</span><span class="p">);</span>
<span class="kd">let</span> <span class="nx">max</span> <span class="o">=</span> <span class="nx">api</span><span class="p">.</span><span class="nx">kittens</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="mi">2</span><span class="p">);</span>
</code></pre>
<blockquote>
<p>The above command returns JSON structured like this:</p>
</blockquote>
<pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
</span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
</span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Max"</span><span class="p">,</span><span class="w">
</span><span class="s2">"breed"</span><span class="p">:</span><span class="w"> </span><span class="s2">"unknown"</span><span class="p">,</span><span class="w">
</span><span class="s2">"fluffiness"</span><span class="p">:</span><span class="w"> </span><span class="mi">5</span><span class="p">,</span><span class="w">
</span><span class="s2">"cuteness"</span><span class="p">:</span><span class="w"> </span><span class="mi">10</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre>
<p>This endpoint retrieves a specific kitten.</p>
<aside class="warning">Inside HTML code blocks like this one, you can't use Markdown, so use <code>&lt;code&gt;</code> blocks to denote code.</aside>
<h3 id='http-request-2'>HTTP Request</h3>
<p><code>GET http://example.com/kittens/&lt;ID&gt;</code></p>
<h3 id='url-parameters'>URL Parameters</h3>
<table><thead>
<tr>
<th>Parameter</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>ID</td>
<td>The ID of the kitten to retrieve</td>
</tr>
</tbody></table>
<h2 id='delete-a-specific-kitten'>Delete a Specific Kitten</h2><pre class="highlight ruby tab-ruby"><code><span class="nb">require</span> <span class="s1">'kittn'</span>
<span class="n">api</span> <span class="o">=</span> <span class="no">Kittn</span><span class="o">::</span><span class="no">APIClient</span><span class="p">.</span><span class="nf">authorize!</span><span class="p">(</span><span class="s1">'meowmeowmeow'</span><span class="p">)</span>
<span class="n">api</span><span class="p">.</span><span class="nf">kittens</span><span class="p">.</span><span class="nf">delete</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
</code></pre><pre class="highlight python tab-python"><code><span class="kn">import</span> <span class="nn">kittn</span>
<span class="n">api</span> <span class="o">=</span> <span class="n">kittn</span><span class="o">.</span><span class="n">authorize</span><span class="p">(</span><span class="s">'meowmeowmeow'</span><span class="p">)</span>
<span class="n">api</span><span class="o">.</span><span class="n">kittens</span><span class="o">.</span><span class="n">delete</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
</code></pre><pre class="highlight shell tab-shell"><code>curl <span class="s2">"http://example.com/api/kittens/2"</span>
-X DELETE
-H <span class="s2">"Authorization: meowmeowmeow"</span>
</code></pre><pre class="highlight javascript tab-javascript"><code><span class="kr">const</span> <span class="nx">kittn</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">'kittn'</span><span class="p">);</span>
<span class="kd">let</span> <span class="nx">api</span> <span class="o">=</span> <span class="nx">kittn</span><span class="p">.</span><span class="nx">authorize</span><span class="p">(</span><span class="s1">'meowmeowmeow'</span><span class="p">);</span>
<span class="kd">let</span> <span class="nx">max</span> <span class="o">=</span> <span class="nx">api</span><span class="p">.</span><span class="nx">kittens</span><span class="p">.</span><span class="k">delete</span><span class="p">(</span><span class="mi">2</span><span class="p">);</span>
</code></pre>
<blockquote>
<p>The above command returns JSON structured like this:</p>
</blockquote>
<pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
</span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
</span><span class="s2">"deleted"</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="s2">":("</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre>
<p>This endpoint deletes a specific kitten.</p>
<h3 id='http-request-3'>HTTP Request</h3>
<p><code>DELETE http://example.com/kittens/&lt;ID&gt;</code></p>
<h3 id='url-parameters-2'>URL Parameters</h3>
<table><thead>
<tr>
<th>Parameter</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>ID</td>
<td>The ID of the kitten to delete</td>
</tr>
</tbody></table>
</div>
<div class="dark-box">
<div class="lang-selector">
<a href="#" data-language-name="cli">cli</a>
</div>
</div>
</div>
</body>
</html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1 @@
/*! normalize.css v3.0.2 | MIT License | git.io/normalize */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:0.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace, monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]{-webkit-appearance:textfield;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}.content h1,.content h2,.content h3,.content h4,body{font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";font-size:14px}.content h1,.content h2,.content h3,.content h4{font-weight:bold}.content pre,.content code{font-family:Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, serif;font-size:12px;line-height:1.5}.content pre,.content code{word-break:break-all;-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto}@font-face{font-family:'slate';src:url(../fonts/slate.eot?-syv14m);src:url(../fonts/slate.eot?#iefix-syv14m) format("embedded-opentype"),url(../fonts/slate.woff2?-syv14m) format("woff2"),url(../fonts/slate.woff?-syv14m) format("woff"),url(../fonts/slate.ttf?-syv14m) format("truetype"),url(../fonts/slate.svg?-syv14m#slate) format("svg");font-weight:normal;font-style:normal}.content aside.warning:before,.content aside.notice:before,.content aside.success:before{font-family:'slate';speak:none;font-style:normal;font-weight:normal;font-variant:normal;text-transform:none;line-height:1}.content aside.warning:before{content:"\e600"}.content aside.notice:before{content:"\e602"}.content aside.success:before{content:"\e606"}.tocify,.toc-footer,.lang-selector,.search,#nav-button{display:none}.tocify-wrapper>img{margin:0 auto;display:block}.content{font-size:12px}.content pre,.content code{border:1px solid #999;border-radius:5px;font-size:0.8em}.content pre code{border:0}.content pre{padding:1.3em}.content code{padding:0.2em}.content table{border:1px solid #999}.content table tr{border-bottom:1px solid #999}.content table td,.content table th{padding:0.7em}.content p{line-height:1.5}.content a{text-decoration:none;color:#000}.content h1{font-size:2.5em;padding-top:0.5em;padding-bottom:0.5em;margin-top:1em;margin-bottom:21px;border:2px solid #ccc;border-width:2px 0;text-align:center}.content h2{font-size:1.8em;margin-top:2em;border-top:2px solid #ccc;padding-top:0.8em}.content h1+h2,.content h1+div+h2{border-top:none;padding-top:0;margin-top:0}.content h3,.content h4{font-size:0.8em;margin-top:1.5em;margin-bottom:0.8em;text-transform:uppercase}.content h5,.content h6{text-transform:uppercase}.content aside{padding:1em;border:1px solid #ccc;border-radius:5px;margin-top:1.5em;margin-bottom:1.5em;line-height:1.6}.content aside:before{vertical-align:middle;padding-right:0.5em;font-size:14px}

File diff suppressed because one or more lines are too long