2015-01-31 13:02:04 +01:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="en">
|
|
|
|
<head>
|
|
|
|
<meta charset="utf-8">
|
|
|
|
<title>JSDoc: Namespace: object</title>
|
|
|
|
|
|
|
|
<script src="scripts/prettify/prettify.js"> </script>
|
|
|
|
<script src="scripts/prettify/lang-css.js"> </script>
|
|
|
|
<!--[if lt IE 9]>
|
|
|
|
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
|
|
|
<![endif]-->
|
|
|
|
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
|
|
|
|
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
|
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
|
|
|
|
|
|
|
<div id="main">
|
|
|
|
|
|
|
|
<h1 class="page-title">Namespace: object</h1>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<section>
|
|
|
|
|
|
|
|
<header>
|
|
|
|
|
|
|
|
<h2>
|
|
|
|
<span class="ancestors"><a href="module-bitmessage_structs.html">bitmessage/structs</a>.</span>
|
|
|
|
|
|
|
|
object
|
|
|
|
</h2>
|
|
|
|
|
|
|
|
|
|
|
|
</header>
|
|
|
|
|
|
|
|
<article>
|
|
|
|
<div class="container-overview">
|
|
|
|
|
|
|
|
|
|
|
|
<div class="description"><p>An <code>object</code> is a message which is shared throughout a stream. It is
|
|
|
|
the only message which propagates; all others are only between two
|
|
|
|
nodes.</p></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<dl class="details">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<dt class="tag-source">Source:</dt>
|
|
|
|
<dd class="tag-source"><ul class="dummy"><li>
|
2015-02-12 11:44:15 +01:00
|
|
|
<a href="structs.js.html">structs.js</a>, <a href="structs.js.html#line278">line 278</a>
|
2015-01-31 13:02:04 +01:00
|
|
|
</li></ul></dd>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<dt class="tag-see">See:</dt>
|
|
|
|
<dd class="tag-see">
|
|
|
|
<ul>
|
|
|
|
<li><a href="https://bitmessage.org/wiki/Protocol_specification#object">https://bitmessage.org/wiki/Protocol_specification#object</a></li>
|
|
|
|
</ul>
|
|
|
|
</dd>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
<h3 class="subsection-title">Members</h3>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h4 class="name" id=".BROADCAST"><span class="type-signature">(static, constant) </span>BROADCAST<span class="type-signature"> :number</span></h4>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="description">
|
|
|
|
<p><a href="module-bitmessage_objects.broadcast.html">broadcast</a> object type.</p>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h5>Type:</h5>
|
|
|
|
<ul>
|
|
|
|
<li>
|
|
|
|
|
|
|
|
<span class="param-type">number</span>
|
|
|
|
|
|
|
|
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<dl class="details">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<dt class="tag-source">Source:</dt>
|
|
|
|
<dd class="tag-source"><ul class="dummy"><li>
|
|
|
|
<a href="structs.js.html">structs.js</a>, <a href="structs.js.html#line298">line 298</a>
|
|
|
|
</li></ul></dd>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h4 class="name" id=".GETPUBKEY"><span class="type-signature">(static, constant) </span>GETPUBKEY<span class="type-signature"> :number</span></h4>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="description">
|
|
|
|
<p><a href="module-bitmessage_objects.getpubkey.html">getpubkey</a> object type.</p>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h5>Type:</h5>
|
|
|
|
<ul>
|
|
|
|
<li>
|
|
|
|
|
|
|
|
<span class="param-type">number</span>
|
|
|
|
|
|
|
|
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<dl class="details">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<dt class="tag-source">Source:</dt>
|
|
|
|
<dd class="tag-source"><ul class="dummy"><li>
|
|
|
|
<a href="structs.js.html">structs.js</a>, <a href="structs.js.html#line283">line 283</a>
|
|
|
|
</li></ul></dd>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h4 class="name" id=".MSG"><span class="type-signature">(static, constant) </span>MSG<span class="type-signature"> :number</span></h4>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="description">
|
|
|
|
<p><a href="module-bitmessage_objects.msg.html">msg</a> object type.</p>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h5>Type:</h5>
|
|
|
|
<ul>
|
|
|
|
<li>
|
|
|
|
|
|
|
|
<span class="param-type">number</span>
|
|
|
|
|
|
|
|
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<dl class="details">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<dt class="tag-source">Source:</dt>
|
|
|
|
<dd class="tag-source"><ul class="dummy"><li>
|
|
|
|
<a href="structs.js.html">structs.js</a>, <a href="structs.js.html#line293">line 293</a>
|
|
|
|
</li></ul></dd>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h4 class="name" id=".PUBKEY"><span class="type-signature">(static, constant) </span>PUBKEY<span class="type-signature"> :number</span></h4>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="description">
|
|
|
|
<p><a href="module-bitmessage_objects.pubkey.html">pubkey</a> object type.</p>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h5>Type:</h5>
|
|
|
|
<ul>
|
|
|
|
<li>
|
|
|
|
|
|
|
|
<span class="param-type">number</span>
|
|
|
|
|
|
|
|
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<dl class="details">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<dt class="tag-source">Source:</dt>
|
|
|
|
<dd class="tag-source"><ul class="dummy"><li>
|
|
|
|
<a href="structs.js.html">structs.js</a>, <a href="structs.js.html#line288">line 288</a>
|
|
|
|
</li></ul></dd>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-31 13:02:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
<h3 class="subsection-title">Methods</h3>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
<h4 class="name" id=".decode"><span class="type-signature">(static) </span>decode<span class="signature">(buf, opts<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {DecodeResult}</span></h4>
|
2015-01-31 13:02:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="description">
|
|
|
|
<p>Decode <code>object</code> message.<br>NOTE: <code>nonce</code> and <code>objectPayload</code> are copied.</p>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h5>Parameters:</h5>
|
|
|
|
|
|
|
|
|
|
|
|
<table class="params">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
|
|
|
|
<th>Name</th>
|
|
|
|
|
|
|
|
|
|
|
|
<th>Type</th>
|
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
|
|
|
|
<th>Attributes</th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<th class="last">Description</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
|
|
|
<td class="name"><code>buf</code></td>
|
|
|
|
|
|
|
|
|
|
|
|
<td class="type">
|
|
|
|
|
|
|
|
|
|
|
|
<span class="param-type">Buffer</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
|
|
<td class="attributes">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<td class="description last"><p>Message</p></td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
|
|
|
<td class="name"><code>opts</code></td>
|
|
|
|
|
|
|
|
|
|
|
|
<td class="type">
|
|
|
|
|
|
|
|
|
|
|
|
<span class="param-type">Object</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
|
|
<td class="attributes">
|
|
|
|
|
|
|
|
<optional><br>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<td class="description last"><p>Decoding options</p>
|
|
|
|
<h6>Properties</h6>
|
|
|
|
|
|
|
|
|
|
|
|
<table class="params">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
|
|
|
|
<th>Name</th>
|
|
|
|
|
|
|
|
|
|
|
|
<th>Type</th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<th class="last">Description</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
|
|
|
<td class="name"><code>allowExpired</code></td>
|
|
|
|
|
|
|
|
|
|
|
|
<td class="type">
|
|
|
|
|
|
|
|
|
|
|
|
<span class="param-type">boolean</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<td class="description last"><p>Allow expired objects</p></td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
|
|
|
<td class="name"><code>skipPow</code></td>
|
|
|
|
|
|
|
|
|
|
|
|
<td class="type">
|
|
|
|
|
|
|
|
|
|
|
|
<span class="param-type">boolean</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<td class="description last"><p>Do not validate object POW</p></td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<dl class="details">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<dt class="tag-source">Source:</dt>
|
|
|
|
<dd class="tag-source"><ul class="dummy"><li>
|
2015-02-24 18:23:55 +01:00
|
|
|
<a href="structs.js.html">structs.js</a>, <a href="structs.js.html#line323">line 323</a>
|
2015-02-12 11:44:15 +01:00
|
|
|
</li></ul></dd>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-24 18:23:55 +01:00
|
|
|
<h5>Throws:</h5>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<dl>
|
|
|
|
<dt>
|
|
|
|
<div class="param-desc">
|
|
|
|
<p>Invalid object</p>
|
|
|
|
</div>
|
|
|
|
</dt>
|
|
|
|
<dd></dd>
|
|
|
|
<dt>
|
|
|
|
<dl>
|
|
|
|
<dt>
|
|
|
|
Type
|
|
|
|
</dt>
|
|
|
|
<dd>
|
|
|
|
|
|
|
|
<span class="param-type">Error</span>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
|
|
</dl>
|
|
|
|
</dt>
|
|
|
|
<dd></dd>
|
|
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
|
|
|
|
|
|
|
|
<h5>Returns:</h5>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="param-desc">
|
|
|
|
<p><a href="module-bitmessage_structs.object.html#.DecodeResult">Decoded <code>object</code> structure.</a></p>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<dl>
|
|
|
|
<dt>
|
|
|
|
Type
|
|
|
|
</dt>
|
|
|
|
<dd>
|
|
|
|
|
|
|
|
<span class="param-type">DecodeResult</span>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h4 class="name" id=".decodePayload"><span class="type-signature">(static) </span>decodePayload<span class="signature">()</span><span class="type-signature"></span></h4>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="description">
|
|
|
|
<p>Decode <code>object</code> message payload.
|
|
|
|
The same as <a href="module-bitmessage_structs.object.html#.decode">decode</a>.</p>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<dl class="details">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<dt class="tag-source">Source:</dt>
|
|
|
|
<dd class="tag-source"><ul class="dummy"><li>
|
2015-02-24 18:23:55 +01:00
|
|
|
<a href="structs.js.html">structs.js</a>, <a href="structs.js.html#line333">line 333</a>
|
2015-02-12 11:44:15 +01:00
|
|
|
</li></ul></dd>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h4 class="name" id=".encode"><span class="type-signature">(static) </span>encode<span class="signature">(opts)</span><span class="type-signature"> → {Buffer}</span></h4>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="description">
|
|
|
|
<p>Encode <code>object</code> message.</p>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h5>Parameters:</h5>
|
|
|
|
|
|
|
|
|
|
|
|
<table class="params">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
|
|
|
|
<th>Name</th>
|
|
|
|
|
|
|
|
|
|
|
|
<th>Type</th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<th class="last">Description</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
|
|
|
<td class="name"><code>opts</code></td>
|
|
|
|
|
|
|
|
|
|
|
|
<td class="type">
|
|
|
|
|
|
|
|
|
|
|
|
<span class="param-type">Object</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<td class="description last"><p>Object options</p>
|
|
|
|
<h6>Properties</h6>
|
|
|
|
|
|
|
|
|
|
|
|
<table class="params">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
|
|
|
|
<th>Name</th>
|
|
|
|
|
|
|
|
|
|
|
|
<th>Type</th>
|
|
|
|
|
|
|
|
|
|
|
|
<th>Attributes</th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<th class="last">Description</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
|
|
|
<td class="name"><code>nonce</code></td>
|
|
|
|
|
|
|
|
|
|
|
|
<td class="type">
|
|
|
|
|
|
|
|
|
|
|
|
<span class="param-type">Object</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
|
|
<td class="attributes">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<td class="description last"><p>A 8-byte object nonce</p></td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
|
|
|
<td class="name"><code>ttl</code></td>
|
|
|
|
|
|
|
|
|
|
|
|
<td class="type">
|
|
|
|
|
|
|
|
|
|
|
|
<span class="param-type">number</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
|
|
<td class="attributes">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<td class="description last"><p>Time to live in seconds</p></td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
|
|
|
<td class="name"><code>type</code></td>
|
|
|
|
|
|
|
|
|
|
|
|
<td class="type">
|
|
|
|
|
|
|
|
|
|
|
|
<span class="param-type">number</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
|
|
<td class="attributes">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<td class="description last"><p>Object type</p></td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
|
|
|
<td class="name"><code>version</code></td>
|
|
|
|
|
|
|
|
|
|
|
|
<td class="type">
|
|
|
|
|
|
|
|
|
|
|
|
<span class="param-type">number</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
|
|
<td class="attributes">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</td>
|
|
|
|
|
2015-01-31 13:02:04 +01:00
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
|
2015-01-31 13:02:04 +01:00
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
<td class="description last"><p>Object version</p></td>
|
|
|
|
</tr>
|
2015-01-31 13:02:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
<td class="name"><code>stream</code></td>
|
2015-01-31 13:02:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
<td class="type">
|
|
|
|
|
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
<span class="param-type">number</span>
|
2015-01-31 13:02:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
|
|
<td class="attributes">
|
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
<optional><br>
|
|
|
|
|
2015-01-31 13:02:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
<td class="description last"><p>Object stream (1 by default)</p></td>
|
2015-01-31 13:02:04 +01:00
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
<td class="name"><code>objectPayload</code></td>
|
2015-01-31 13:02:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
<td class="type">
|
|
|
|
|
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
<span class="param-type">Buffer</span>
|
2015-01-31 13:02:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
|
|
<td class="attributes">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
<td class="description last"><p>Object payload</p></td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
</td>
|
2015-01-31 13:02:04 +01:00
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<dl class="details">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<dt class="tag-source">Source:</dt>
|
|
|
|
<dd class="tag-source"><ul class="dummy"><li>
|
2015-02-24 18:23:55 +01:00
|
|
|
<a href="structs.js.html">structs.js</a>, <a href="structs.js.html#line429">line 429</a>
|
2015-01-31 13:02:04 +01:00
|
|
|
</li></ul></dd>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h5>Returns:</h5>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="param-desc">
|
2015-02-12 11:44:15 +01:00
|
|
|
<p>Encoded message.</p>
|
2015-01-31 13:02:04 +01:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<dl>
|
|
|
|
<dt>
|
|
|
|
Type
|
|
|
|
</dt>
|
|
|
|
<dd>
|
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
<span class="param-type">Buffer</span>
|
2015-01-31 13:02:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
<h4 class="name" id=".encodePayload"><span class="type-signature">(static) </span>encodePayload<span class="signature">()</span><span class="type-signature"></span></h4>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="description">
|
|
|
|
<p>Encode <code>object</code> message payload.
|
|
|
|
The same as <a href="module-bitmessage_structs.object.html#.encode">encode</a>.</p>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<dl class="details">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<dt class="tag-source">Source:</dt>
|
|
|
|
<dd class="tag-source"><ul class="dummy"><li>
|
2015-02-24 18:23:55 +01:00
|
|
|
<a href="structs.js.html">structs.js</a>, <a href="structs.js.html#line438">line 438</a>
|
2015-02-12 11:44:15 +01:00
|
|
|
</li></ul></dd>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h4 class="name" id=".encodePayloadWithoutNonce"><span class="type-signature">(static) </span>encodePayloadWithoutNonce<span class="signature">(opts)</span><span class="type-signature"> → {Buffer}</span></h4>
|
2015-01-31 13:02:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="description">
|
2015-02-12 11:44:15 +01:00
|
|
|
<p>Encode <code>object</code> message payload without leading nonce field (may be
|
|
|
|
useful if you are going to calculate it later).</p>
|
2015-01-31 13:02:04 +01:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h5>Parameters:</h5>
|
|
|
|
|
|
|
|
|
|
|
|
<table class="params">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
|
|
|
|
<th>Name</th>
|
|
|
|
|
|
|
|
|
|
|
|
<th>Type</th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<th class="last">Description</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
<td class="name"><code>opts</code></td>
|
2015-01-31 13:02:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
<td class="type">
|
|
|
|
|
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
<span class="param-type">Object</span>
|
2015-01-31 13:02:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
|
2015-01-31 13:02:04 +01:00
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
<td class="description last"><p>Object options</p>
|
|
|
|
<h6>Properties</h6>
|
2015-01-31 13:02:04 +01:00
|
|
|
|
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
<table class="params">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
|
|
|
|
<th>Name</th>
|
|
|
|
|
2015-01-31 13:02:04 +01:00
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
<th>Type</th>
|
|
|
|
|
|
|
|
|
|
|
|
<th>Attributes</th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<th class="last">Description</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
2015-01-31 13:02:04 +01:00
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
<tbody>
|
2015-01-31 13:02:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
<td class="name"><code>ttl</code></td>
|
2015-01-31 13:02:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
<td class="type">
|
|
|
|
|
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
<span class="param-type">number</span>
|
2015-01-31 13:02:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
|
|
<td class="attributes">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
<td class="description last"><p>Time to live in seconds</p></td>
|
2015-01-31 13:02:04 +01:00
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
<tr>
|
|
|
|
|
|
|
|
<td class="name"><code>type</code></td>
|
|
|
|
|
2015-01-31 13:02:04 +01:00
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
<td class="type">
|
|
|
|
|
|
|
|
|
|
|
|
<span class="param-type">number</span>
|
2015-01-31 13:02:04 +01:00
|
|
|
|
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
|
|
|
|
</td>
|
2015-01-31 13:02:04 +01:00
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
|
|
|
|
<td class="attributes">
|
|
|
|
|
2015-01-31 13:02:04 +01:00
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
|
2015-01-31 13:02:04 +01:00
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
|
|
|
|
</td>
|
|
|
|
|
2015-01-31 13:02:04 +01:00
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
|
2015-01-31 13:02:04 +01:00
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
<td class="description last"><p>Object type</p></td>
|
|
|
|
</tr>
|
2015-01-31 13:02:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
<tr>
|
|
|
|
|
|
|
|
<td class="name"><code>version</code></td>
|
2015-01-31 13:02:04 +01:00
|
|
|
|
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
<td class="type">
|
|
|
|
|
|
|
|
|
|
|
|
<span class="param-type">number</span>
|
2015-01-31 13:02:04 +01:00
|
|
|
|
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
|
|
|
|
</td>
|
2015-01-31 13:02:04 +01:00
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
|
|
|
|
<td class="attributes">
|
|
|
|
|
2015-01-31 13:02:04 +01:00
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
|
2015-01-31 13:02:04 +01:00
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
|
|
|
|
</td>
|
|
|
|
|
2015-01-31 13:02:04 +01:00
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
|
2015-01-31 13:02:04 +01:00
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
<td class="description last"><p>Object version</p></td>
|
|
|
|
</tr>
|
2015-01-31 13:02:04 +01:00
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
|
2015-01-31 13:02:04 +01:00
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
<tr>
|
|
|
|
|
|
|
|
<td class="name"><code>stream</code></td>
|
|
|
|
|
2015-01-31 13:02:04 +01:00
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
<td class="type">
|
|
|
|
|
|
|
|
|
|
|
|
<span class="param-type">number</span>
|
2015-01-31 13:02:04 +01:00
|
|
|
|
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
|
|
|
|
</td>
|
2015-01-31 13:02:04 +01:00
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
|
|
|
|
<td class="attributes">
|
|
|
|
|
|
|
|
<optional><br>
|
|
|
|
|
2015-01-31 13:02:04 +01:00
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
|
2015-01-31 13:02:04 +01:00
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
|
|
|
|
</td>
|
|
|
|
|
2015-01-31 13:02:04 +01:00
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
|
2015-01-31 13:02:04 +01:00
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
<td class="description last"><p>Object stream (1 by default)</p></td>
|
|
|
|
</tr>
|
2015-01-31 13:02:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
<td class="name"><code>objectPayload</code></td>
|
2015-01-31 13:02:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
<td class="type">
|
|
|
|
|
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
<span class="param-type">Buffer</span>
|
2015-01-31 13:02:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
<td class="attributes">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</td>
|
|
|
|
|
2015-01-31 13:02:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
<td class="description last"><p>Object payload</p></td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
</td>
|
2015-01-31 13:02:04 +01:00
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<dl class="details">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<dt class="tag-source">Source:</dt>
|
|
|
|
<dd class="tag-source"><ul class="dummy"><li>
|
2015-02-24 18:23:55 +01:00
|
|
|
<a href="structs.js.html">structs.js</a>, <a href="structs.js.html#line467">line 467</a>
|
2015-01-31 13:02:04 +01:00
|
|
|
</li></ul></dd>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h5>Returns:</h5>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="param-desc">
|
2015-02-12 11:44:15 +01:00
|
|
|
<p>Encoded payload.</p>
|
2015-01-31 13:02:04 +01:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<dl>
|
|
|
|
<dt>
|
|
|
|
Type
|
|
|
|
</dt>
|
|
|
|
<dd>
|
|
|
|
|
|
|
|
<span class="param-type">Buffer</span>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-24 18:23:55 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h4 class="name" id=".validate"><span class="type-signature">(static) </span>validate<span class="signature">(buf, opts<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → (nullable) {Error}</span></h4>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="description">
|
|
|
|
<p>Check whether given <code>object</code> message is valid.</p>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h5>Parameters:</h5>
|
|
|
|
|
|
|
|
|
|
|
|
<table class="params">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
|
|
|
|
<th>Name</th>
|
|
|
|
|
|
|
|
|
|
|
|
<th>Type</th>
|
|
|
|
|
|
|
|
|
|
|
|
<th>Attributes</th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<th class="last">Description</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
|
|
|
<td class="name"><code>buf</code></td>
|
|
|
|
|
|
|
|
|
|
|
|
<td class="type">
|
|
|
|
|
|
|
|
|
|
|
|
<span class="param-type">Buffer</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
|
|
<td class="attributes">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<td class="description last"><p>Message</p></td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
|
|
|
<td class="name"><code>opts</code></td>
|
|
|
|
|
|
|
|
|
|
|
|
<td class="type">
|
|
|
|
|
|
|
|
|
|
|
|
<span class="param-type">Object</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
|
|
<td class="attributes">
|
|
|
|
|
|
|
|
<optional><br>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<td class="description last"><p>Any of <a href="module-bitmessage_structs.object.html#.decode">object.decode</a> options</p></td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<dl class="details">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<dt class="tag-source">Source:</dt>
|
|
|
|
<dd class="tag-source"><ul class="dummy"><li>
|
|
|
|
<a href="structs.js.html">structs.js</a>, <a href="structs.js.html#line391">line 391</a>
|
|
|
|
</li></ul></dd>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h5>Returns:</h5>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="param-desc">
|
|
|
|
<p>Return an error with description if object is
|
|
|
|
invalid.</p>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<dl>
|
|
|
|
<dt>
|
|
|
|
Type
|
|
|
|
</dt>
|
|
|
|
<dd>
|
|
|
|
|
|
|
|
<span class="param-type">Error</span>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h4 class="name" id=".validatePayload"><span class="type-signature">(static) </span>validatePayload<span class="signature">()</span><span class="type-signature"></span></h4>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="description">
|
|
|
|
<p>Check whether <code>object</code> message payload is valid.
|
|
|
|
The same as <a href="module-bitmessage_structs.object.html#.validate">validate</a>.</p>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<dl class="details">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<dt class="tag-source">Source:</dt>
|
|
|
|
<dd class="tag-source"><ul class="dummy"><li>
|
|
|
|
<a href="structs.js.html">structs.js</a>, <a href="structs.js.html#line409">line 409</a>
|
|
|
|
</li></ul></dd>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
|
2015-01-31 13:02:04 +01:00
|
|
|
|
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
<h3 class="subsection-title">Type Definitions</h3>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h4 class="name" id=".DecodeResult">DecodeResult</h4>
|
2015-01-31 13:02:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
<h5>Type:</h5>
|
|
|
|
<ul>
|
|
|
|
<li>
|
|
|
|
|
|
|
|
<span class="param-type">Object</span>
|
2015-01-31 13:02:04 +01:00
|
|
|
|
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
</li>
|
|
|
|
</ul>
|
2015-01-31 13:02:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
<h5 class="subsection-title">Properties:</h5>
|
2015-01-31 13:02:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
<table class="props">
|
2015-01-31 13:02:04 +01:00
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
|
|
|
|
<th>Name</th>
|
|
|
|
|
|
|
|
|
|
|
|
<th>Type</th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<th class="last">Description</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
<td class="name"><code>nonce</code></td>
|
2015-01-31 13:02:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
<td class="type">
|
|
|
|
|
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
<span class="param-type">Buffer</span>
|
2015-01-31 13:02:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
<td class="description last"><p>A 8-byte object nonce</p></td>
|
2015-01-31 13:02:04 +01:00
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
<tr>
|
|
|
|
|
|
|
|
<td class="name"><code>ttl</code></td>
|
|
|
|
|
2015-01-31 13:02:04 +01:00
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
<td class="type">
|
|
|
|
|
|
|
|
|
|
|
|
<span class="param-type">number</span>
|
2015-01-31 13:02:04 +01:00
|
|
|
|
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
|
|
|
|
</td>
|
2015-01-31 13:02:04 +01:00
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
|
2015-01-31 13:02:04 +01:00
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
|
2015-01-31 13:02:04 +01:00
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
<td class="description last"><p>Time to live in seconds</p></td>
|
|
|
|
</tr>
|
2015-01-31 13:02:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
<tr>
|
|
|
|
|
|
|
|
<td class="name"><code>type</code></td>
|
|
|
|
|
2015-01-31 13:02:04 +01:00
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
<td class="type">
|
|
|
|
|
|
|
|
|
|
|
|
<span class="param-type">number</span>
|
2015-01-31 13:02:04 +01:00
|
|
|
|
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
|
|
|
|
</td>
|
2015-01-31 13:02:04 +01:00
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
|
2015-01-31 13:02:04 +01:00
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
|
2015-01-31 13:02:04 +01:00
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
<td class="description last"><p>Object type</p></td>
|
|
|
|
</tr>
|
2015-01-31 13:02:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
<tr>
|
|
|
|
|
|
|
|
<td class="name"><code>version</code></td>
|
|
|
|
|
2015-01-31 13:02:04 +01:00
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
<td class="type">
|
|
|
|
|
|
|
|
|
|
|
|
<span class="param-type">number</span>
|
2015-01-31 13:02:04 +01:00
|
|
|
|
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
|
|
|
|
</td>
|
2015-01-31 13:02:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
|
2015-01-31 13:02:04 +01:00
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
<td class="description last"><p>Object version</p></td>
|
|
|
|
</tr>
|
2015-01-31 13:02:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
<tr>
|
|
|
|
|
|
|
|
<td class="name"><code>stream</code></td>
|
|
|
|
|
2015-01-31 13:02:04 +01:00
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
<td class="type">
|
|
|
|
|
|
|
|
|
|
|
|
<span class="param-type">number</span>
|
2015-01-31 13:02:04 +01:00
|
|
|
|
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
|
|
|
|
</td>
|
2015-01-31 13:02:04 +01:00
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
|
2015-01-31 13:02:04 +01:00
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
|
2015-01-31 13:02:04 +01:00
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
<td class="description last"><p>Object stream</p></td>
|
|
|
|
</tr>
|
2015-01-31 13:02:04 +01:00
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
|
2015-01-31 13:02:04 +01:00
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
<tr>
|
|
|
|
|
|
|
|
<td class="name"><code>headerLength</code></td>
|
|
|
|
|
2015-01-31 13:02:04 +01:00
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
<td class="type">
|
|
|
|
|
|
|
|
|
|
|
|
<span class="param-type">number</span>
|
2015-01-31 13:02:04 +01:00
|
|
|
|
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
|
|
|
|
</td>
|
2015-01-31 13:02:04 +01:00
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
|
2015-01-31 13:02:04 +01:00
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
|
2015-01-31 13:02:04 +01:00
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
<td class="description last"><p>Length of the object header</p></td>
|
|
|
|
</tr>
|
2015-01-31 13:02:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
<td class="name"><code>objectPayload</code></td>
|
2015-01-31 13:02:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
<td class="type">
|
|
|
|
|
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
<span class="param-type">Buffer</span>
|
2015-01-31 13:02:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
<td class="description last"><p>Object payload</p></td>
|
2015-01-31 13:02:04 +01:00
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<dl class="details">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<dt class="tag-source">Source:</dt>
|
|
|
|
<dd class="tag-source"><ul class="dummy"><li>
|
2015-02-12 11:44:15 +01:00
|
|
|
<a href="structs.js.html">structs.js</a>, <a href="structs.js.html#line300">line 300</a>
|
2015-01-31 13:02:04 +01:00
|
|
|
</li></ul></dd>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-12 11:44:15 +01:00
|
|
|
|
2015-01-31 13:02:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</article>
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<nav>
|
2015-02-14 12:00:58 +01:00
|
|
|
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-bitmessage.html">bitmessage</a></li><li><a href="module-bitmessage_address.html">bitmessage/address</a></li><li><a href="module-bitmessage_crypto.html">bitmessage/crypto</a></li><li><a href="module-bitmessage_messages.html">bitmessage/messages</a></li><li><a href="module-bitmessage_net_base.html">bitmessage/net/base</a></li><li><a href="module-bitmessage_net_tcp.html">bitmessage/net/tcp</a></li><li><a href="module-bitmessage_net_ws.html">bitmessage/net/ws</a></li><li><a href="module-bitmessage_objects.html">bitmessage/objects</a></li><li><a href="module-bitmessage_pow.html">bitmessage/pow</a></li><li><a href="module-bitmessage_structs.html">bitmessage/structs</a></li><li><a href="module-bitmessage_user-agent.html">bitmessage/user-agent</a></li><li><a href="module-bitmessage_wif.html">bitmessage/wif</a></li></ul><h3>Classes</h3><ul><li><a href="module-bitmessage_address.Address.html">Address</a></li><li><a href="module-bitmessage_net_base.BaseTransport.html">BaseTransport</a></li><li><a href="module-bitmessage_net_tcp.TcpTransport.html">TcpTransport</a></li><li><a href="module-bitmessage_net_ws.WsTransport.html">WsTransport</a></li><li><a href="module-bitmessage_structs.PubkeyBitfield.html">PubkeyBitfield</a></li><li><a href="module-bitmessage_structs.ServicesBitfield.html">ServicesBitfield</a></li></ul><h3>Namespaces</h3><ul><li><a href="module-bitmessage_messages.addr.html">addr</a></li><li><a href="module-bitmessage_messages.error.html">error</a></li><li><a href="module-bitmessage_messages.getdata.html">getdata</a></li><li><a href="module-bitmessage_messages.inv.html">inv</a></li><li><a href="module-bitmessage_messages.version.html">version</a></li><li><a href="module-bitmessage_objects.broadcast.html">broadcast</a></li><li><a href="module-bitmessage_objects.getpubkey.html">getpubkey</a></li><li><a href="module-bitmessage_objects.msg.html">msg</a></li><li><a href="module-bitmessage_objects.pubkey.html">pubkey</a></li><li><a href="module-bitmessage_structs.encrypted.html">encrypted</a></li><li><a href="module-bitmessage_structs.inv_vect.html">inv_vect</a></li><li><a href="module-bitmessage_structs.message.html">message</a></li><li><a href="module-bitmessage_structs.net_addr.html">net_addr</a></li><li><a href="module-bitmessage_structs.object.html">object</a></li><li><a href="module-bitmessage_structs.var_int.html">var_int</a></li><li><a href="module-bitmessage_structs.var_int_list.html">var_int_list</a></li><li><a href="module-bitmessage_structs.var_str.html">var_str</a></li></ul>
|
2015-01-31 13:02:04 +01:00
|
|
|
</nav>
|
|
|
|
|
|
|
|
<br class="clear">
|
|
|
|
|
|
|
|
<footer>
|
2015-02-24 18:23:55 +01:00
|
|
|
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.0-dev</a> on Tue Feb 24 2015 20:23:34 GMT+0300 (MSK)
|
2015-01-31 13:02:04 +01:00
|
|
|
</footer>
|
|
|
|
|
|
|
|
<script> prettyPrint(); </script>
|
|
|
|
<script src="scripts/linenumber.js"> </script>
|
|
|
|
</body>
|
|
|
|
</html>
|