js-waku/functions/_waku_proto.WakuMessage.enc...

149 lines
18 KiB
HTML

<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>encode | @waku/root</title><meta name="description" content="Documentation for @waku/root"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"</script><header class="tsd-page-toolbar">
<div class="tsd-toolbar-contents container">
<div class="table-cell" id="tsd-search" data-base="..">
<div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M15.7824 13.833L12.6666 10.7177C12.5259 10.5771 12.3353 10.499 12.1353 10.499H11.6259C12.4884 9.39596 13.001 8.00859 13.001 6.49937C13.001 2.90909 10.0914 0 6.50048 0C2.90959 0 0 2.90909 0 6.49937C0 10.0896 2.90959 12.9987 6.50048 12.9987C8.00996 12.9987 9.39756 12.4863 10.5008 11.6239V12.1332C10.5008 12.3332 10.5789 12.5238 10.7195 12.6644L13.8354 15.7797C14.1292 16.0734 14.6042 16.0734 14.8948 15.7797L15.7793 14.8954C16.0731 14.6017 16.0731 14.1267 15.7824 13.833ZM6.50048 10.499C4.29094 10.499 2.50018 8.71165 2.50018 6.49937C2.50018 4.29021 4.28781 2.49976 6.50048 2.49976C8.71001 2.49976 10.5008 4.28708 10.5008 6.49937C10.5008 8.70852 8.71314 10.499 6.50048 10.499Z" fill="var(--color-text)"></path></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div>
<div class="field">
<div id="tsd-toolbar-links"></div></div>
<ul class="results">
<li class="state loading">Preparing search index...</li>
<li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@waku/root</a></div>
<div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><rect x="1" y="3" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="7" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="11" width="14" height="2" fill="var(--color-text)"></rect></svg></a></div></div></header>
<div class="container container-main">
<div class="col-8 col-content">
<div class="tsd-page-title">
<ul class="tsd-breadcrumb">
<li><a href="../modules.html">@waku/root</a></li>
<li><a href="../modules/_waku_proto.html">@waku/proto</a></li>
<li><a href="../modules/_waku_proto.WakuMessage.html">WakuMessage</a></li>
<li><a href="_waku_proto.WakuMessage.encode.html">encode</a></li></ul>
<h1>Function encode</h1></div>
<section class="tsd-panel">
<ul class="tsd-signatures tsd-kind-function tsd-parent-kind-namespace">
<li class="tsd-signature tsd-anchor-link" id="encode">encode<span class="tsd-signature-symbol">(</span>obj<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Partial</span><span class="tsd-signature-symbol">&lt;</span><a href="../interfaces/_waku_proto.WakuMessage-1.html" class="tsd-signature-type" data-tsd-kind="Interface">WakuMessage</a><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array" class="tsd-signature-type external" target="_blank">Uint8Array</a><a href="#encode" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none" id="icon-anchor-a"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5" id="icon-anchor-b"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5" id="icon-anchor-c"></path></svg></a></li>
<li class="tsd-description">
<div class="tsd-parameters">
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameter-list">
<li>
<h5>obj: <span class="tsd-signature-type">Partial</span><span class="tsd-signature-symbol">&lt;</span><a href="../interfaces/_waku_proto.WakuMessage-1.html" class="tsd-signature-type" data-tsd-kind="Interface">WakuMessage</a><span class="tsd-signature-symbol">&gt;</span></h5></li></ul></div>
<h4 class="tsd-returns-title">Returns <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array" class="tsd-signature-type external" target="_blank">Uint8Array</a></h4><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/waku-org/js-waku/blob/437f72fa/packages/proto/src/lib/filter.ts#L538">packages/proto/src/lib/filter.ts:538</a></li></ul></aside></li></ul></section></div>
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
<div class="tsd-navigation settings">
<details class="tsd-index-accordion"><summary class="tsd-accordion-summary">
<h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><path d="M4.93896 8.531L12 15.591L19.061 8.531L16.939 6.409L12 11.349L7.06098 6.409L4.93896 8.531Z" fill="var(--color-text)"></path></svg> Settings</h3></summary>
<div class="tsd-accordion-details">
<div class="tsd-filter-visibility">
<h4 class="uppercase">Member Visibility</h4><form>
<ul id="tsd-filter-options">
<li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li>
<li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-private" name="private"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Private</span></label></li>
<li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></form></div>
<div class="tsd-theme-toggle">
<h4 class="uppercase">Theme</h4><select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div>
<nav class="tsd-navigation primary">
<details class="tsd-index-accordion" open><summary class="tsd-accordion-summary">
<h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><path d="M4.93896 8.531L12 15.591L19.061 8.531L16.939 6.409L12 11.349L7.06098 6.409L4.93896 8.531Z" fill="var(--color-text)"></path></svg> Modules</h3></summary>
<div class="tsd-accordion-details">
<ul>
<li class="current"><a href="../modules.html">@waku/root</a>
<ul>
<li class="tsd-kind-module"><a href="../modules/_waku_core.html">@waku/core</a>
<ul>
<li class="tsd-kind-module tsd-parent-kind-module"><a href="../modules/_waku_core._internal_.html">&lt;internal&gt;</a>
<ul>
<li class="tsd-kind-namespace tsd-parent-kind-module"><a href="../modules/_waku_core._internal_.TopicOnlyMessage.html">Topic<wbr/>Only<wbr/>Message</a></li></ul></li>
<li class="tsd-kind-namespace tsd-parent-kind-module"><a href="../modules/_waku_core.message.html">message</a>
<ul>
<li class="tsd-kind-namespace tsd-parent-kind-namespace"><a href="../modules/_waku_core.message.topic_only_message.html">topic_<wbr/>only_<wbr/>message</a></li>
<li class="tsd-kind-namespace tsd-parent-kind-namespace"><a href="../modules/_waku_core.message.version_0.html">version_<wbr/>0</a>
<ul>
<li class="tsd-kind-namespace tsd-parent-kind-namespace"><a href="../modules/_waku_core.message.version_0.proto.html">proto</a>
<ul>
<li class="tsd-kind-namespace tsd-parent-kind-namespace"><a href="../modules/_waku_core.message.version_0.proto.RateLimitProof.html">Rate<wbr/>Limit<wbr/>Proof</a></li>
<li class="tsd-kind-namespace tsd-parent-kind-namespace"><a href="../modules/_waku_core.message.version_0.proto.WakuMessage.html">Waku<wbr/>Message</a></li></ul></li></ul></li></ul></li>
<li class="tsd-kind-namespace tsd-parent-kind-module"><a href="../modules/_waku_core.waku.html">waku</a></li>
<li class="tsd-kind-namespace tsd-parent-kind-module"><a href="../modules/_waku_core.waku_filter.html">waku_<wbr/>filter</a></li>
<li class="tsd-kind-namespace tsd-parent-kind-module"><a href="../modules/_waku_core.waku_light_push.html">waku_<wbr/>light_<wbr/>push</a>
<ul>
<li class="tsd-kind-namespace tsd-parent-kind-namespace"><a href="../modules/_waku_core.waku_light_push.PushResponse.html">Push<wbr/>Response</a></li></ul></li>
<li class="tsd-kind-namespace tsd-parent-kind-module"><a href="../modules/_waku_core.waku_relay.html">waku_<wbr/>relay</a></li>
<li class="tsd-kind-namespace tsd-parent-kind-module"><a href="../modules/_waku_core.waku_store.html">waku_<wbr/>store</a></li></ul></li>
<li class="tsd-kind-module"><a href="../modules/_waku_create.html">@waku/create</a>
<ul>
<li class="tsd-kind-module tsd-parent-kind-module"><a href="../modules/_waku_create._internal_.html">&lt;internal&gt;</a></li></ul></li>
<li class="tsd-kind-module"><a href="../modules/_waku_dns_discovery.html">@waku/dns-<wbr/>discovery</a>
<ul>
<li class="tsd-kind-module tsd-parent-kind-module"><a href="../modules/_waku_dns_discovery._internal_.html">&lt;internal&gt;</a></li></ul></li>
<li class="tsd-kind-module"><a href="../modules/_waku_enr.html">@waku/enr</a>
<ul>
<li class="tsd-kind-module tsd-parent-kind-module"><a href="../modules/_waku_enr._internal_.html">&lt;internal&gt;</a></li></ul></li>
<li class="tsd-kind-module"><a href="../modules/_waku_interfaces.html">@waku/interfaces</a>
<ul>
<li class="tsd-kind-module tsd-parent-kind-module"><a href="../modules/_waku_interfaces._internal_.html">&lt;internal&gt;</a></li></ul></li>
<li class="tsd-kind-module"><a href="../modules/_waku_message_encryption.html">@waku/message-<wbr/>encryption</a>
<ul>
<li class="tsd-kind-module tsd-parent-kind-module"><a href="../modules/_waku_message_encryption._internal_.html">&lt;internal&gt;</a>
<ul>
<li class="tsd-kind-namespace tsd-parent-kind-module"><a href="../modules/_waku_message_encryption._internal_.RateLimitProof.html">Rate<wbr/>Limit<wbr/>Proof</a></li>
<li class="tsd-kind-namespace tsd-parent-kind-module"><a href="../modules/_waku_message_encryption._internal_.WakuMessage.html">Waku<wbr/>Message</a></li></ul></li>
<li class="tsd-kind-namespace tsd-parent-kind-module"><a href="../modules/_waku_message_encryption.ecies.html">ecies</a></li>
<li class="tsd-kind-namespace tsd-parent-kind-module"><a href="../modules/_waku_message_encryption.symmetric.html">symmetric</a></li></ul></li>
<li class="tsd-kind-module"><a href="../modules/_waku_peer_exchange.html">@waku/peer-<wbr/>exchange</a>
<ul>
<li class="tsd-kind-module tsd-parent-kind-module"><a href="../modules/_waku_peer_exchange._internal_.html">&lt;internal&gt;</a></li></ul></li>
<li class="current tsd-kind-module"><a href="../modules/_waku_proto.html">@waku/proto</a>
<ul>
<li class="current tsd-kind-namespace tsd-parent-kind-module"><a href="../modules/_waku_proto.WakuMessage.html">Waku<wbr/>Message</a></li>
<li class="tsd-kind-namespace tsd-parent-kind-module"><a href="../modules/_waku_proto.proto_filter.html">proto_<wbr/>filter</a>
<ul>
<li class="tsd-kind-namespace tsd-parent-kind-namespace"><a href="../modules/_waku_proto.proto_filter.FilterRequest.html">Filter<wbr/>Request</a>
<ul>
<li class="tsd-kind-namespace tsd-parent-kind-namespace"><a href="../modules/_waku_proto.proto_filter.FilterRequest.ContentFilter.html">Content<wbr/>Filter</a></li></ul></li>
<li class="tsd-kind-namespace tsd-parent-kind-namespace"><a href="../modules/_waku_proto.proto_filter.FilterRpc.html">Filter<wbr/>Rpc</a></li>
<li class="tsd-kind-namespace tsd-parent-kind-namespace"><a href="../modules/_waku_proto.proto_filter.MessagePush.html">Message<wbr/>Push</a></li>
<li class="tsd-kind-namespace tsd-parent-kind-namespace"><a href="../modules/_waku_proto.proto_filter.RateLimitProof.html">Rate<wbr/>Limit<wbr/>Proof</a></li></ul></li>
<li class="tsd-kind-namespace tsd-parent-kind-module"><a href="../modules/_waku_proto.proto_lightpush.html">proto_<wbr/>lightpush</a>
<ul>
<li class="tsd-kind-namespace tsd-parent-kind-namespace"><a href="../modules/_waku_proto.proto_lightpush.PushRequest.html">Push<wbr/>Request</a></li>
<li class="tsd-kind-namespace tsd-parent-kind-namespace"><a href="../modules/_waku_proto.proto_lightpush.PushResponse.html">Push<wbr/>Response</a></li>
<li class="tsd-kind-namespace tsd-parent-kind-namespace"><a href="../modules/_waku_proto.proto_lightpush.PushRpc.html">Push<wbr/>Rpc</a></li>
<li class="tsd-kind-namespace tsd-parent-kind-namespace"><a href="../modules/_waku_proto.proto_lightpush.RateLimitProof.html">Rate<wbr/>Limit<wbr/>Proof</a></li>
<li class="tsd-kind-namespace tsd-parent-kind-namespace"><a href="../modules/_waku_proto.proto_lightpush.WakuMessage.html">Waku<wbr/>Message</a></li></ul></li>
<li class="tsd-kind-namespace tsd-parent-kind-module"><a href="../modules/_waku_proto.proto_message.html">proto_<wbr/>message</a>
<ul>
<li class="tsd-kind-namespace tsd-parent-kind-namespace"><a href="../modules/_waku_proto.proto_message.RateLimitProof.html">Rate<wbr/>Limit<wbr/>Proof</a></li>
<li class="tsd-kind-namespace tsd-parent-kind-namespace"><a href="../modules/_waku_proto.proto_message.WakuMessage.html">Waku<wbr/>Message</a></li></ul></li>
<li class="tsd-kind-namespace tsd-parent-kind-module"><a href="../modules/_waku_proto.proto_peer_exchange.html">proto_<wbr/>peer_<wbr/>exchange</a>
<ul>
<li class="tsd-kind-namespace tsd-parent-kind-namespace"><a href="../modules/_waku_proto.proto_peer_exchange.PeerExchangeQuery.html">Peer<wbr/>Exchange<wbr/>Query</a></li>
<li class="tsd-kind-namespace tsd-parent-kind-namespace"><a href="../modules/_waku_proto.proto_peer_exchange.PeerExchangeRPC.html">Peer<wbr/>ExchangeRPC</a></li>
<li class="tsd-kind-namespace tsd-parent-kind-namespace"><a href="../modules/_waku_proto.proto_peer_exchange.PeerExchangeResponse.html">Peer<wbr/>Exchange<wbr/>Response</a></li>
<li class="tsd-kind-namespace tsd-parent-kind-namespace"><a href="../modules/_waku_proto.proto_peer_exchange.PeerInfo.html">Peer<wbr/>Info</a></li></ul></li>
<li class="tsd-kind-namespace tsd-parent-kind-module"><a href="../modules/_waku_proto.proto_store.html">proto_<wbr/>store</a>
<ul>
<li class="tsd-kind-namespace tsd-parent-kind-namespace"><a href="../modules/_waku_proto.proto_store.ContentFilter.html">Content<wbr/>Filter</a></li>
<li class="tsd-kind-namespace tsd-parent-kind-namespace"><a href="../modules/_waku_proto.proto_store.HistoryQuery.html">History<wbr/>Query</a></li>
<li class="tsd-kind-namespace tsd-parent-kind-namespace"><a href="../modules/_waku_proto.proto_store.HistoryResponse.html">History<wbr/>Response</a>
<ul>
<li class="tsd-kind-namespace tsd-parent-kind-namespace"><a href="../modules/_waku_proto.proto_store.HistoryResponse.HistoryError.html">History<wbr/>Error</a></li></ul></li>
<li class="tsd-kind-namespace tsd-parent-kind-namespace"><a href="../modules/_waku_proto.proto_store.HistoryRpc.html">History<wbr/>Rpc</a></li>
<li class="tsd-kind-namespace tsd-parent-kind-namespace"><a href="../modules/_waku_proto.proto_store.Index.html">Index</a></li>
<li class="tsd-kind-namespace tsd-parent-kind-namespace"><a href="../modules/_waku_proto.proto_store.PagingInfo.html">Paging<wbr/>Info</a>
<ul>
<li class="tsd-kind-namespace tsd-parent-kind-namespace"><a href="../modules/_waku_proto.proto_store.PagingInfo.Direction.html">Direction</a></li></ul></li>
<li class="tsd-kind-namespace tsd-parent-kind-namespace"><a href="../modules/_waku_proto.proto_store.RateLimitProof.html">Rate<wbr/>Limit<wbr/>Proof</a></li>
<li class="tsd-kind-namespace tsd-parent-kind-namespace"><a href="../modules/_waku_proto.proto_store.WakuMessage.html">Waku<wbr/>Message</a></li></ul></li>
<li class="tsd-kind-namespace tsd-parent-kind-module"><a href="../modules/_waku_proto.proto_topic_only_message.html">proto_<wbr/>topic_<wbr/>only_<wbr/>message</a>
<ul>
<li class="tsd-kind-namespace tsd-parent-kind-namespace"><a href="../modules/_waku_proto.proto_topic_only_message.TopicOnlyMessage.html">Topic<wbr/>Only<wbr/>Message</a></li></ul></li></ul></li>
<li class="tsd-kind-module"><a href="../modules/_waku_utils.html">@waku/utils</a></li></ul></li></ul></div></details></nav>
<nav class="tsd-navigation secondary menu-sticky">
<ul>
<li class="tsd-kind-function tsd-parent-kind-namespace"><a href="_waku_proto.WakuMessage.codec.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-function)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6" id="icon-64-path"></rect><path d="M9.39 16V7.24H14.55V8.224H10.446V11.128H14.238V12.112H10.47V16H9.39Z" fill="var(--color-text)" id="icon-64-text"></path></svg>codec</a></li>
<li class="tsd-kind-function tsd-parent-kind-namespace"><a href="_waku_proto.WakuMessage.decode.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-64-path"></use><use href="#icon-64-text"></use></svg>decode</a></li>
<li class="current tsd-kind-function tsd-parent-kind-namespace"><a href="_waku_proto.WakuMessage.encode.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-64-path"></use><use href="#icon-64-text"></use></svg>encode</a></li></ul></nav></div></div>
<div class="container tsd-generator">
<p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div>
<div class="overlay"></div><script src="../assets/main.js"></script></body></html>