@libp2p/daemon-protocol 1.0.0 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,17 @@
1
+ (function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.Libp2PDaemonProtocol = factory()}(typeof self !== 'undefined' ? self : this, function () {
2
+ var Libp2PDaemonProtocol=(()=>{var Se=Object.defineProperty;var Pt=Object.getOwnPropertyDescriptor;var Vt=Object.getOwnPropertyNames;var _t=Object.prototype.hasOwnProperty;var D=(n,e)=>{for(var t in e)Se(n,t,{get:e[t],enumerable:!0})},Mt=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Vt(e))!_t.call(n,o)&&o!==t&&Se(n,o,{get:()=>e[o],enumerable:!(r=Pt(e,o))||r.enumerable});return n};var zt=n=>Mt(Se({},"__esModule",{value:!0}),n);var qr={};D(qr,{ConnManagerRequest:()=>ye,ConnectRequest:()=>he,DHTRequest:()=>we,DHTResponse:()=>xe,DisconnectRequest:()=>Ee,ErrorResponse:()=>le,IdentifyResponse:()=>ue,PSMessage:()=>We,PSRequest:()=>Ae,PSResponse:()=>Ue,PeerInfo:()=>X,PeerstoreRequest:()=>Le,PeerstoreResponse:()=>Ie,Request:()=>Xe,Response:()=>Qe,StreamHandlerRequest:()=>me,StreamInfo:()=>be,StreamOpenRequest:()=>ge});function De(n,e){e||(e=n.reduce((o,c)=>o+c.length,0));let t=new Uint8Array(e),r=0;for(let o of n)t.set(o,r),r+=o.length;return t}var Re={};D(Re,{identity:()=>Ht});function Ft(n,e){if(n.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var o=0;o<n.length;o++){var c=n.charAt(o),i=c.charCodeAt(0);if(t[i]!==255)throw new TypeError(c+" is ambiguous");t[i]=o}var s=n.length,f=n.charAt(0),g=Math.log(s)/Math.log(256),h=Math.log(256)/Math.log(s);function x(a){if(a instanceof Uint8Array||(ArrayBuffer.isView(a)?a=new Uint8Array(a.buffer,a.byteOffset,a.byteLength):Array.isArray(a)&&(a=Uint8Array.from(a))),!(a instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(a.length===0)return"";for(var b=0,$=0,T=0,R=a.length;T!==R&&a[T]===0;)T++,b++;for(var B=(R-T)*h+1>>>0,S=new Uint8Array(B);T!==R;){for(var v=a[T],F=0,O=B-1;(v!==0||F<$)&&O!==-1;O--,F++)v+=256*S[O]>>>0,S[O]=v%s>>>0,v=v/s>>>0;if(v!==0)throw new Error("Non-zero carry");$=F,T++}for(var _=B-$;_!==B&&S[_]===0;)_++;for(var te=f.repeat(b);_<B;++_)te+=n.charAt(S[_]);return te}function l(a){if(typeof a!="string")throw new TypeError("Expected String");if(a.length===0)return new Uint8Array;var b=0;if(a[b]!==" "){for(var $=0,T=0;a[b]===f;)$++,b++;for(var R=(a.length-b)*g+1>>>0,B=new Uint8Array(R);a[b];){var S=t[a.charCodeAt(b)];if(S===255)return;for(var v=0,F=R-1;(S!==0||v<T)&&F!==-1;F--,v++)S+=s*B[F]>>>0,B[F]=S%256>>>0,S=S/256>>>0;if(S!==0)throw new Error("Non-zero carry");T=v,b++}if(a[b]!==" "){for(var O=R-T;O!==R&&B[O]===0;)O++;for(var _=new Uint8Array($+(R-O)),te=$;O!==R;)_[te++]=B[O++];return _}}}function N(a){var b=l(a);if(b)return b;throw new Error(`Non-${e} character`)}return{encode:x,decodeUnsafe:l,decode:N}}var Gt=Ft,kt=Gt,Ze=kt;var to=new Uint8Array(0);var et=(n,e)=>{if(n===e)return!0;if(n.byteLength!==e.byteLength)return!1;for(let t=0;t<n.byteLength;t++)if(n[t]!==e[t])return!1;return!0},M=n=>{if(n instanceof Uint8Array&&n.constructor.name==="Uint8Array")return n;if(n instanceof ArrayBuffer)return new Uint8Array(n);if(ArrayBuffer.isView(n))return new Uint8Array(n.buffer,n.byteOffset,n.byteLength);throw new Error("Unknown type, must be binary type")};var tt=n=>new TextEncoder().encode(n),nt=n=>new TextDecoder().decode(n);var Ce=class{constructor(e,t,r){this.name=e,this.prefix=t,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},Ne=class{constructor(e,t,r){this.name=e,this.prefix=t,this.baseDecode=r}decode(e){if(typeof e=="string")switch(e[0]){case this.prefix:return this.baseDecode(e.slice(1));default:throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`)}else throw Error("Can only multibase decode strings")}or(e){return ot(this,e)}},Te=class{constructor(e){this.decoders=e}or(e){return ot(this,e)}decode(e){let t=e[0],r=this.decoders[t];if(r)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},ot=(n,e)=>new Te({...n.decoders||{[n.prefix]:n},...e.decoders||{[e.prefix]:e}}),Oe=class{constructor(e,t,r,o){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=o,this.encoder=new Ce(e,t,r),this.decoder=new Ne(e,t,o)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}},ne=({name:n,prefix:e,encode:t,decode:r})=>new Oe(n,e,t,r),G=({prefix:n,name:e,alphabet:t})=>{let{encode:r,decode:o}=Ze(t,e);return ne({prefix:n,name:e,encode:r,decode:c=>M(o(c))})},$t=(n,e,t,r)=>{let o={};for(let h=0;h<e.length;++h)o[e[h]]=h;let c=n.length;for(;n[c-1]==="=";)--c;let i=new Uint8Array(c*t/8|0),s=0,f=0,g=0;for(let h=0;h<c;++h){let x=o[n[h]];if(x===void 0)throw new SyntaxError(`Non-${r} character`);f=f<<t|x,s+=t,s>=8&&(s-=8,i[g++]=255&f>>s)}if(s>=t||255&f<<8-s)throw new SyntaxError("Unexpected end of data");return i},jt=(n,e,t)=>{let r=e[e.length-1]==="=",o=(1<<t)-1,c="",i=0,s=0;for(let f=0;f<n.length;++f)for(s=s<<8|n[f],i+=8;i>t;)i-=t,c+=e[o&s>>i];if(i&&(c+=e[o&s<<t-i]),r)for(;c.length*t&7;)c+="=";return c},y=({name:n,prefix:e,bitsPerChar:t,alphabet:r})=>ne({prefix:e,name:n,encode(o){return jt(o,r,t)},decode(o){return $t(o,r,t,n)}});var Ht=ne({prefix:"\0",name:"identity",encode:n=>nt(n),decode:n=>tt(n)});var Be={};D(Be,{base2:()=>Yt});var Yt=y({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var ve={};D(ve,{base8:()=>Jt});var Jt=y({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Pe={};D(Pe,{base10:()=>Kt});var Kt=G({prefix:"9",name:"base10",alphabet:"0123456789"});var Ve={};D(Ve,{base16:()=>qt,base16upper:()=>Xt});var qt=y({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Xt=y({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var _e={};D(_e,{base32:()=>H,base32hex:()=>en,base32hexpad:()=>nn,base32hexpadupper:()=>rn,base32hexupper:()=>tn,base32pad:()=>Wt,base32padupper:()=>Zt,base32upper:()=>Qt,base32z:()=>on});var H=y({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Qt=y({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Wt=y({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Zt=y({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),en=y({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),tn=y({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),nn=y({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),rn=y({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),on=y({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Me={};D(Me,{base36:()=>cn,base36upper:()=>sn});var cn=G({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),sn=G({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var ze={};D(ze,{base58btc:()=>P,base58flickr:()=>an});var P=G({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),an=G({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Fe={};D(Fe,{base64:()=>dn,base64pad:()=>pn,base64url:()=>fn,base64urlpad:()=>un});var dn=y({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),pn=y({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),fn=y({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),un=y({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var je={};D(je,{sha256:()=>On,sha512:()=>Rn});var hn=st,ct=128,gn=127,mn=~gn,ln=Math.pow(2,31);function st(n,e,t){e=e||[],t=t||0;for(var r=t;n>=ln;)e[t++]=n&255|ct,n/=128;for(;n&mn;)e[t++]=n&255|ct,n>>>=7;return e[t]=n|0,st.bytes=t-r+1,e}var bn=Ge,wn=128,it=127;function Ge(n,r){var t=0,r=r||0,o=0,c=r,i,s=n.length;do{if(c>=s)throw Ge.bytes=0,new RangeError("Could not decode varint");i=n[c++],t+=o<28?(i&it)<<o:(i&it)*Math.pow(2,o),o+=7}while(i>=wn);return Ge.bytes=c-r,t}var xn=Math.pow(2,7),yn=Math.pow(2,14),En=Math.pow(2,21),An=Math.pow(2,28),Un=Math.pow(2,35),Ln=Math.pow(2,42),In=Math.pow(2,49),Sn=Math.pow(2,56),Dn=Math.pow(2,63),Cn=function(n){return n<xn?1:n<yn?2:n<En?3:n<An?4:n<Un?5:n<Ln?6:n<In?7:n<Sn?8:n<Dn?9:10},Nn={encode:hn,decode:bn,encodingLength:Cn},Tn=Nn,Q=Tn;var W=n=>[Q.decode(n),Q.decode.bytes],Y=(n,e,t=0)=>(Q.encode(n,e,t),e),J=n=>Q.encodingLength(n);var j=(n,e)=>{let t=e.byteLength,r=J(n),o=r+J(t),c=new Uint8Array(o+t);return Y(n,c,0),Y(t,c,r),c.set(e,o),new K(n,t,e,c)},at=n=>{let e=M(n),[t,r]=W(e),[o,c]=W(e.subarray(r)),i=e.subarray(r+c);if(i.byteLength!==o)throw new Error("Incorrect length");return new K(t,o,i,e)},dt=(n,e)=>n===e?!0:n.code===e.code&&n.size===e.size&&et(n.bytes,e.bytes),K=class{constructor(e,t,r,o){this.code=e,this.size=t,this.digest=r,this.bytes=o}};var $e=({name:n,code:e,encode:t})=>new ke(n,e,t),ke=class{constructor(e,t,r){this.name=e,this.code=t,this.encode=r}digest(e){if(e instanceof Uint8Array){let t=this.encode(e);return t instanceof Uint8Array?j(this.code,t):t.then(r=>j(this.code,r))}else throw Error("Unknown type, must be binary type")}};var ft=n=>async e=>new Uint8Array(await crypto.subtle.digest(n,e)),On=$e({name:"sha2-256",code:18,encode:ft("SHA-256")}),Rn=$e({name:"sha2-512",code:19,encode:ft("SHA-512")});var He={};D(He,{identity:()=>Pn});var ut=0,Bn="identity",ht=M,vn=n=>j(ut,ht(n)),Pn={code:ut,name:Bn,encode:ht,digest:vn};var Ao=new TextEncoder,Uo=new TextDecoder;var L=class{constructor(e,t,r,o){this.code=t,this.version=e,this.multihash=r,this.bytes=o,this.byteOffset=o.byteOffset,this.byteLength=o.byteLength,this.asCID=this,this._baseCache=new Map,Object.defineProperties(this,{byteOffset:ce,byteLength:ce,code:oe,version:oe,multihash:oe,bytes:oe,_baseCache:ce,asCID:ce})}toV0(){switch(this.version){case 0:return this;default:{let{code:e,multihash:t}=this;if(e!==ee)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==Gn)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return L.createV0(t)}}}toV1(){switch(this.version){case 0:{let{code:e,digest:t}=this.multihash,r=j(e,t);return L.createV1(this.code,r)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}equals(e){return e&&this.code===e.code&&this.version===e.version&&dt(this.multihash,e.multihash)}toString(e){let{bytes:t,version:r,_baseCache:o}=this;switch(r){case 0:return zn(t,o,e||P.encoder);default:return Fn(t,o,e||H.encoder)}}toJSON(){return{code:this.code,version:this.version,hash:this.multihash.bytes}}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return"CID("+this.toString()+")"}static isCID(e){return $n(/^0\.0/,jn),!!(e&&(e[mt]||e.asCID===e))}get toBaseEncodedString(){throw new Error("Deprecated, use .toString()")}get codec(){throw new Error('"codec" property is deprecated, use integer "code" property instead')}get buffer(){throw new Error("Deprecated .buffer property, use .bytes to get Uint8Array instead")}get multibaseName(){throw new Error('"multibaseName" property is deprecated')}get prefix(){throw new Error('"prefix" property is deprecated')}static asCID(e){if(e instanceof L)return e;if(e!=null&&e.asCID===e){let{version:t,code:r,multihash:o,bytes:c}=e;return new L(t,r,o,c||gt(t,r,o.bytes))}else if(e!=null&&e[mt]===!0){let{version:t,multihash:r,code:o}=e,c=at(r);return L.create(t,o,c)}else return null}static create(e,t,r){if(typeof t!="number")throw new Error("String codecs are no longer supported");switch(e){case 0:{if(t!==ee)throw new Error(`Version 0 CID must use dag-pb (code: ${ee}) block encoding`);return new L(e,t,r,r.bytes)}case 1:{let o=gt(e,t,r.bytes);return new L(e,t,r,o)}default:throw new Error("Invalid version")}}static createV0(e){return L.create(0,ee,e)}static createV1(e,t){return L.create(1,e,t)}static decode(e){let[t,r]=L.decodeFirst(e);if(r.length)throw new Error("Incorrect length");return t}static decodeFirst(e){let t=L.inspectBytes(e),r=t.size-t.multihashSize,o=M(e.subarray(r,r+t.multihashSize));if(o.byteLength!==t.multihashSize)throw new Error("Incorrect length");let c=o.subarray(t.multihashSize-t.digestSize),i=new K(t.multihashCode,t.digestSize,c,o);return[t.version===0?L.createV0(i):L.createV1(t.codec,i),e.subarray(t.size)]}static inspectBytes(e){let t=0,r=()=>{let[x,l]=W(e.subarray(t));return t+=l,x},o=r(),c=ee;if(o===18?(o=0,t=0):o===1&&(c=r()),o!==0&&o!==1)throw new RangeError(`Invalid CID version ${o}`);let i=t,s=r(),f=r(),g=t+f,h=g-i;return{version:o,codec:c,multihashCode:s,digestSize:f,multihashSize:h,size:g}}static parse(e,t){let[r,o]=Mn(e,t),c=L.decode(o);return c._baseCache.set(r,e),c}},Mn=(n,e)=>{switch(n[0]){case"Q":{let t=e||P;return[P.prefix,t.decode(`${P.prefix}${n}`)]}case P.prefix:{let t=e||P;return[P.prefix,t.decode(n)]}case H.prefix:{let t=e||H;return[H.prefix,t.decode(n)]}default:{if(e==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[n[0],e.decode(n)]}}},zn=(n,e,t)=>{let{prefix:r}=t;if(r!==P.prefix)throw Error(`Cannot string encode V0 in ${t.name} encoding`);let o=e.get(r);if(o==null){let c=t.encode(n).slice(1);return e.set(r,c),c}else return o},Fn=(n,e,t)=>{let{prefix:r}=t,o=e.get(r);if(o==null){let c=t.encode(n);return e.set(r,c),c}else return o},ee=112,Gn=18,gt=(n,e,t)=>{let r=J(n),o=r+J(e),c=new Uint8Array(o+t.byteLength);return Y(n,c,0),Y(e,c,r),c.set(t,o),c},mt=Symbol.for("@ipld/js-cid/CID"),oe={writable:!1,configurable:!1,enumerable:!0},ce={writable:!1,enumerable:!1,configurable:!1},kn="0.0.0-dev",$n=(n,e)=>{if(n.test(kn))console.warn(e);else throw new Error(e)},jn=`CID.isCID(v) is deprecated and will be removed in the next major release.
3
+ Following code pattern:
4
+
5
+ if (CID.isCID(value)) {
6
+ doSomethingWithCID(value)
7
+ }
8
+
9
+ Is replaced with:
10
+
11
+ const cid = CID.asCID(value)
12
+ if (cid) {
13
+ // Make sure to use cid instead of value
14
+ doSomethingWithCID(cid)
15
+ }
16
+ `;var Ye={...Re,...Be,...ve,...Pe,...Ve,..._e,...Me,...ze,...Fe},Oo={...je,...He};function bt(n,e,t,r){return{name:n,prefix:e,encoder:{name:n,prefix:e,encode:t},decoder:{decode:r}}}var lt=bt("utf8","u",n=>{let e=new TextDecoder("utf8");return"u"+e.decode(n)},n=>new TextEncoder().encode(n.substring(1))),Je=bt("ascii","a",n=>{let e="a";for(let t=0;t<n.length;t++)e+=String.fromCharCode(n[t]);return e},n=>{n=n.substring(1);let e=new Uint8Array(n.length);for(let t=0;t<n.length;t++)e[t]=n.charCodeAt(t);return e}),Hn={utf8:lt,"utf-8":lt,hex:Ye.base16,latin1:Je,ascii:Je,binary:Je,...Ye},ie=Hn;function se(n,e="utf8"){let t=ie[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return t.decoder.decode(`${t.prefix}${n}`)}function Ke(n,e="utf8"){let t=ie[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return t.encoder.encode(n).substring(1)}var yt=Symbol.for("@achingbrain/uint8arraylist");function wt(n,e,t){if(e==null||e<0||e>=t)throw new RangeError("index is out of bounds");let r=0;for(let o of n){let c=r+o.byteLength;if(e<c)return{buf:o,index:e-r};r=c}throw new RangeError("index is out of bounds")}function xt(n){return Boolean(n?.[yt])}var w=class{constructor(...e){Object.defineProperty(this,yt,{value:!0}),this.bufs=[],this.length=0,this.appendAll(e)}*[Symbol.iterator](){yield*this.bufs}get byteLength(){return this.length}append(...e){this.appendAll(e)}appendAll(e){let t=0;for(let r of e)if(r instanceof Uint8Array)t+=r.byteLength,this.bufs.push(r);else if(xt(r))t+=r.length,this.bufs=this.bufs.concat(r.bufs);else throw new Error("Could not append value, must be an Uint8Array or a Uint8ArrayList");this.length+=t}get(e){let t=wt(this.bufs,e,this.length);return t.buf[t.index]}set(e,t){let r=wt(this.bufs,e,this.length);r.buf[r.index]=t}write(e,t=0){if(e instanceof Uint8Array)for(let r=0;r<e.length;r++)this.set(t+r,e[r]);else if(xt(e))for(let r=0;r<e.length;r++)this.set(t+r,e.get(r));else throw new Error("Could not write value, must be an Uint8Array or a Uint8ArrayList")}consume(e){if(e=Math.trunc(e),!(Number.isNaN(e)||e<=0))for(;this.bufs.length>0;)if(e>=this.bufs[0].byteLength)e-=this.bufs[0].byteLength,this.length-=this.bufs[0].byteLength,this.bufs.shift();else{this.bufs[0]=this.bufs[0].subarray(e),this.length-=e;break}}slice(e,t){let{bufs:r,length:o}=this._subList(e,t);return De(r,o)}subarray(e,t){let{bufs:r}=this._subList(e,t),o=new w;return o.appendAll(r),o}_subList(e,t){if(e==null&&t==null)return{bufs:this.bufs,length:this.length};if(e=e??0,t=t??(this.length>0?this.length:0),e<0||t>this.length)throw new RangeError("index out of bounds");if(e===t)return{bufs:[],length:0};let r=[],o=0;for(let c of this.bufs){let i=o,s=i+c.byteLength,f=e>=i&&e<s,g=t>i&&t<=s,h=e<i&&t>=s;o=s;let x,l;if(f&&(x=e-i,l=c.byteLength),g&&(l=t-i,x==null&&(x=0)),h&&(x=0,l=c.byteLength),x!=null&&l!=null&&r.push(c.subarray(x,l)),g)break}return{bufs:r,length:t-e}}getInt8(e){let t=this.slice(e,e+1);return new DataView(t.buffer,t.byteOffset,t.byteLength).getInt8(0)}setInt8(e,t){let r=new Uint8Array(1);new DataView(r.buffer,r.byteOffset,r.byteLength).setInt8(0,t),this.write(r,e)}getInt16(e,t){let r=this.slice(e,e+2);return new DataView(r.buffer,r.byteOffset,r.byteLength).getInt16(0,t)}setInt16(e,t,r){let o=new Uint8Array(2);new DataView(o.buffer,o.byteOffset,o.byteLength).setInt16(0,t,r),this.write(o,e)}getInt32(e,t){let r=this.slice(e,e+4);return new DataView(r.buffer,r.byteOffset,r.byteLength).getInt32(0,t)}setInt32(e,t,r){let o=new Uint8Array(4);new DataView(o.buffer,o.byteOffset,o.byteLength).setInt32(0,t,r),this.write(o,e)}getBigInt64(e,t){let r=this.slice(e,e+8);return new DataView(r.buffer,r.byteOffset,r.byteLength).getBigInt64(0,t)}setBigInt64(e,t,r){let o=new Uint8Array(8);new DataView(o.buffer,o.byteOffset,o.byteLength).setBigInt64(0,t,r),this.write(o,e)}getUint8(e){let t=this.slice(e,e+1);return new DataView(t.buffer,t.byteOffset,t.byteLength).getUint8(0)}setUint8(e,t){let r=new Uint8Array(1);new DataView(r.buffer,r.byteOffset,r.byteLength).setUint8(0,t),this.write(r,e)}getUint16(e,t){let r=this.slice(e,e+2);return new DataView(r.buffer,r.byteOffset,r.byteLength).getUint16(0,t)}setUint16(e,t,r){let o=new Uint8Array(2);new DataView(o.buffer,o.byteOffset,o.byteLength).setUint16(0,t,r),this.write(o,e)}getUint32(e,t){let r=this.slice(e,e+4);return new DataView(r.buffer,r.byteOffset,r.byteLength).getUint32(0,t)}setUint32(e,t,r){let o=new Uint8Array(4);new DataView(o.buffer,o.byteOffset,o.byteLength).setUint32(0,t,r),this.write(o,e)}getBigUint64(e,t){let r=this.slice(e,e+8);return new DataView(r.buffer,r.byteOffset,r.byteLength).getBigUint64(0,t)}setBigUint64(e,t,r){let o=new Uint8Array(8);new DataView(o.buffer,o.byteOffset,o.byteLength).setBigUint64(0,t,r),this.write(o,e)}getFloat32(e,t){let r=this.slice(e,e+4);return new DataView(r.buffer,r.byteOffset,r.byteLength).getFloat32(0,t)}setFloat32(e,t,r){let o=new Uint8Array(4);new DataView(o.buffer,o.byteOffset,o.byteLength).setFloat32(0,t,r),this.write(o,e)}getFloat64(e,t){let r=this.slice(e,e+8);return new DataView(r.buffer,r.byteOffset,r.byteLength).getFloat64(0,t)}setFloat64(e,t,r){let o=new Uint8Array(8);new DataView(o.buffer,o.byteOffset,o.byteLength).setFloat64(0,t,r),this.write(o,e)}};function V(n){return n instanceof Uint8Array?{get(e){return n[e]},set(e,t){n[e]=t}}:{get(e){return n.get(e)},set(e,t){n.set(e,t)}}}var Et=4294967296,I=class{constructor(e=0,t=0){this.hi=e,this.lo=t}toBigInt(e){if(e)return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n);if(this.hi>>>31!==0){let t=~this.lo+1>>>0,r=~this.hi>>>0;return t===0&&(r=r+1>>>0),-(BigInt(t)+(BigInt(r)<<32n))}return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n)}zzDecode(){let e=-(this.lo&1),t=((this.lo>>>1|this.hi<<31)^e)>>>0,r=(this.hi>>>1^e)>>>0;return new I(r,t)}zzEncode(){let e=this.hi>>31,t=((this.hi<<1|this.lo>>>31)^e)>>>0,r=(this.lo<<1^e)>>>0;return new I(t,r)}toBytes(e,t=0){let r=V(e);for(;this.hi>0;)r.set(t++,this.lo&127|128),this.lo=(this.lo>>>7|this.hi<<25)>>>0,this.hi>>>=7;for(;this.lo>127;)r.set(t++,this.lo&127|128),this.lo=this.lo>>>7;r.set(t++,this.lo)}static fromBigInt(e){if(e===0n)return new I;let t=e<0;t&&(e=-e);let r=Number(e>>32n)|0,o=Number(e-(BigInt(r)<<32n))|0;return t&&(r=~r>>>0,o=~o>>>0,++o>Et&&(o=0,++r>Et&&(r=0))),new I(r,o)}static fromNumber(e){if(e===0)return new I;let t=e<0;t&&(e=-e);let r=e>>>0,o=(e-r)/4294967296>>>0;return t&&(o=~o>>>0,r=~r>>>0,++r>4294967295&&(r=0,++o>4294967295&&(o=0))),new I(o,r)}static fromBytes(e,t){let r=V(e),o=new I,c=0;if(e.length-t>4){for(;c<4;++c)if(o.lo=(o.lo|(r.get(t)&127)<<c*7)>>>0,r.get(t++)<128)return o;if(o.lo=(o.lo|(r.get(t)&127)<<28)>>>0,o.hi=(o.hi|(r.get(t)&127)>>4)>>>0,r.get(t++)<128)return o;c=0}else{for(;c<3;++c){if(t>=e.length)throw RangeError(`index out of range: ${t} > ${e.length}`);if(o.lo=(o.lo|(r.get(t)&127)<<c*7)>>>0,r.get(t++)<128)return o}return o.lo=(o.lo|(r.get(t++)&127)<<c*7)>>>0,o}if(e.length-t>4){for(;c<5;++c)if(o.hi=(o.hi|(r.get(t)&127)<<c*7+3)>>>0,r.get(t++)<128)return o}else for(;c<5;++c){if(t>=e.length)throw RangeError(`index out of range: ${t} > ${e.length}`);if(o.hi=(o.hi|(r.get(t)&127)<<c*7+3)>>>0,r.get(t++)<128)return o}throw Error("invalid varint encoding")}};var At=128,Yn=127,Jn=~Yn,Kn=Math.pow(2,31),qn=Math.pow(2,7),Xn=Math.pow(2,14),Qn=Math.pow(2,21),Wn=Math.pow(2,28),Zn=Math.pow(2,35),er=Math.pow(2,42),tr=Math.pow(2,49),nr=Math.pow(2,56),rr=Math.pow(2,63),d={encodingLength(n){return n<qn?1:n<Xn?2:n<Qn?3:n<Wn?4:n<Zn?5:n<er?6:n<tr?7:n<nr?8:n<rr?9:10},encode(n,e){let t=0,r=V(e);for(;n>=Kn;)r.set(t++,n&255|At),n/=128;for(;(n&Jn)>0;)r.set(t++,n&255|At),n>>>=7;r.set(t,n|0)},decode(n,e=0){let t=V(n),r=4294967295;if(r=(t.get(e)&127)>>>0,t.get(e++)<128||(r=(r|(t.get(e)&127)<<7)>>>0,t.get(e++)<128)||(r=(r|(t.get(e)&127)<<14)>>>0,t.get(e++)<128)||(r=(r|(t.get(e)&127)<<21)>>>0,t.get(e++)<128)||(r=(r|(t.get(e)&15)<<28)>>>0,t.get(e++)<128))return r;if((e+=5)>n.length)throw RangeError(`index out of range: ${e} > ${n.length}`);return r}},ae={encodingLength(n){return n<0?10:d.encodingLength(n)},encode(n,e){if(n<0){let t=0,r=V(e),o=I.fromNumber(n);for(;o.hi>0;)r.set(t++,o.lo&127|128),o.lo=(o.lo>>>7|o.hi<<25)>>>0,o.hi>>>=7;for(;o.lo>127;)r.set(t++,o.lo&127|128),o.lo=o.lo>>>7;r.set(t++,o.lo);return}d.encode(n,e)},decode(n,e=0){return d.decode(n,e)|0}},de={encodingLength(n){return n=(n<<1^n>>31)>>>0,d.encodingLength(n)},encode(n,e,t=0){return n=(n<<1^n>>31)>>>0,d.encode(n,e)},decode(n,e=0){let t=d.decode(n,e);return t>>>1^-(t&1)|0}};function E(n,e){let t=new Uint8Array(d.encodingLength(n.length));return d.encode(n.length,t),e.decode(new w(t,n),0)}function A(n,e){let t=e.encode(n),r=d.encodingLength(d.decode(t));return t.slice(r)}var p;(function(n){n[n.VARINT=0]="VARINT",n[n.BIT64=1]="BIT64",n[n.LENGTH_DELIMITED=2]="LENGTH_DELIMITED",n[n.START_GROUP=3]="START_GROUP",n[n.END_GROUP=4]="END_GROUP",n[n.BIT32=5]="BIT32"})(p||(p={}));function u(n,e,t,r,o){return{name:n,type:e,encode:t,decode:r,encodingLength:o}}var or=function(){return 1},cr=function(e){return Uint8Array.from([e?1:0])},ir=function(e,t){return e.get(t)>0},sr=u("bool",p.VARINT,cr,ir,or);var ar=function(e){let t=e.byteLength;return d.encodingLength(t)+t},dr=function(e){let t=new Uint8Array(d.encodingLength(e.byteLength));return d.encode(e.byteLength,t),new w(t,e)},pr=function(e,t){let r=d.decode(e,t);return t+=d.encodingLength(r),e.slice(t,t+r)},m=u("bytes",p.LENGTH_DELIMITED,dr,pr,ar);var Ut=function(){return 8},fr=function(e){let t=new w(new Uint8Array(Ut(e)));return t.setFloat64(0,e,!0),t},ur=function(e,t){return e.getFloat64(t,!0)},hr=u("double",p.BIT64,fr,ur,Ut);function z(n){let e=function(c){let s=Object.keys(n).indexOf(c);return d.encodingLength(s)},t=function(c){let s=Object.keys(n).indexOf(c),f=new Uint8Array(d.encodingLength(s));return d.encode(s,f),f},r=function(c,i){let s=d.decode(c,i),f=Object.keys(n);if(f[s]==null)throw new Error("Could not find enum key for value");return f[s]};return u("enum",p.VARINT,t,r,e)}var Lt=function(){return 4},gr=function(e){let t=new w(new Uint8Array(Lt(e)));return t.setInt32(0,e,!0),t},mr=function(e,t){return e.getInt32(t,!0)},lr=u("fixed32",p.BIT32,gr,mr,Lt);var It=function(e){return 8},br=function(e){let t=new w(new Uint8Array(It(e)));return t.setBigInt64(0,e,!0),t},wr=function(e,t){return e.getBigInt64(t,!0)},xr=u("fixed64",p.BIT64,br,wr,It);var St=function(){return 4},yr=function(e){let t=new w(new Uint8Array(St(1)));return t.setFloat32(0,e,!0),t},Er=function(e,t){return e.getFloat32(t,!0)},Ar=u("float",p.BIT32,yr,Er,St);var Dt=function(e){return ae.encodingLength(e)},Ur=function(e){let t=new Uint8Array(Dt(e));return ae.encode(e,t),t},Lr=function(e,t){return ae.decode(e,t)},qe=u("int32",p.VARINT,Ur,Lr,Dt);var Ct=0x7fn,k={encodingLength(n){let e=0;for(;n>=0x80n;e++)n>>=7n;return e+1},encode(n,e){let t=V(e),r=0;for(;Ct<n;)t.set(r++,Number(n&Ct)|128),n>>=7n;t.set(r,Number(n))},decode(n,e=0){return I.fromBytes(n,e).toBigInt(!0)}},pe={encodingLength(n){return n<0n?10:k.encodingLength(n)},encode(n,e,t=0){if(n<0n){I.fromBigInt(n).toBytes(e,t);return}return k.encode(n,e)},decode(n,e=0){return I.fromBytes(n,e).toBigInt(!1)}},fe={encodingLength(n){return k.encodingLength(n>=0?n*2n:n*-2n-1n)},encode(n,e,t=0){I.fromBigInt(n).zzEncode().toBytes(e,t)},decode(n,e=0){return I.fromBytes(n,e).zzDecode().toBigInt(!1)}};var Nt=function(e){return pe.encodingLength(e)},Ir=function(e){let t=new Uint8Array(Nt(e));return pe.encode(e,t),t},Sr=function(e,t){return pe.decode(e,t)|0n},q=u("int64",p.VARINT,Ir,Sr,Nt);function U(n){let e=function(c){let i=0;for(let s of Object.values(n))i+=s.codec.encodingLength(c[s.name]);return d.encodingLength(i)+i},t=function(c){let i=new w;function s(g,h,x){if(g==null){if(x.optional===!0)return;throw new Error(`Non optional field "${x.name}" was ${g===null?"null":"undefined"}`)}let l=h<<3|x.codec.type,N=new Uint8Array(d.encodingLength(l));d.encode(l,N);let a=x.codec.encode(g);i.append(N),i.append(a)}for(let[g,h]of Object.entries(n)){let x=parseInt(g);if(h.repeats===!0){if(!Array.isArray(c[h.name]))throw new Error(`Repeating field "${h.name}" was not an array`);for(let l of c[h.name])s(l,x,h)}else s(c[h.name],x,h)}let f=new Uint8Array(d.encodingLength(i.length));return d.encode(i.length,f),new w(f,i)},r=function(c,i){let s=d.decode(c,i);i+=d.encodingLength(s);let f={};for(;i<c.length;){let g=d.decode(c,i);i+=d.encodingLength(g);let h=g&7,x=g>>3,l=n[x],N=0;if(h===p.VARINT)if(l!=null){let a=l.codec.decode(c,i);N=l.codec.encodingLength(a)}else{let a=d.decode(c,i);N=d.encodingLength(a)}else if(h===p.BIT64)N=8;else if(h===p.LENGTH_DELIMITED){let a=d.decode(c,i);N=a+d.encodingLength(a)}else if(h===p.BIT32)N=4;else{if(h===p.START_GROUP)throw new Error("Unsupported wire type START_GROUP");if(h===p.END_GROUP)throw new Error("Unsupported wire type END_GROUP")}if(l!=null){let a=l.codec.decode(c,i);l.repeats===!0?(f[l.name]==null&&(f[l.name]=[]),f[l.name].push(a)):f[l.name]=a}i+=N}for(let g of Object.values(n))g.repeats===!0&&f[g.name]==null&&(f[g.name]=[]);return f};return u("message",p.LENGTH_DELIMITED,t,r,e)}var Tt=function(){return 4},Dr=function(e){let t=new w(new Uint8Array(Tt(e)));return t.setInt32(0,e,!0),t},Cr=function(e,t){return e.getInt32(t,!0)},Nr=u("sfixed32",p.BIT32,Dr,Cr,Tt);var Ot=function(){return 8},Tr=function(e){let t=new w(new Uint8Array(Ot(e)));return t.setBigInt64(0,e,!0),t},Or=function(e,t){return e.getBigInt64(t,!0)},Rr=u("sfixed64",p.BIT64,Tr,Or,Ot);var Rt=function(e){return de.encodingLength(e)},Br=function(e){let t=new Uint8Array(Rt(e));return de.encode(e,t),t},vr=function(e,t){return de.decode(e,t)},Pr=u("sint32",p.VARINT,Br,vr,Rt);var Bt=function(e){return fe.encodingLength(e)},Vr=function(e){let t=new Uint8Array(Bt(e));return fe.encode(e,t),t},_r=function(e,t){return fe.decode(e,t)},Mr=u("sint64",p.VARINT,Vr,_r,Bt);var zr=function(e){let t=se(e).byteLength;return d.encodingLength(t)+t},Fr=function(e){let t=se(e),r=new Uint8Array(d.encodingLength(t.byteLength));return d.encode(t.length,r),new w(r,t)},Gr=function(e,t){let r=d.decode(e,t);return t+=d.encodingLength(r),Ke(e.slice(t,t+r))},C=u("string",p.LENGTH_DELIMITED,Fr,Gr,zr);var vt=function(e){return d.encodingLength(e)},kr=function(e){let t=new Uint8Array(vt(e));return d.encode(e,t),t},$r=function(e,t){return d.decode(e,t)},jr=u("uint32",p.VARINT,kr,$r,vt);var Hr=function(e){return k.encodingLength(e)},Yr=function(e){let t=new Uint8Array(k.encodingLength(e));return k.encode(e,t),t},Jr=function(e,t){return k.decode(e,t)},Kr=u("uint64",p.VARINT,Yr,Jr,Hr);var Xe;(o=>{let n;(b=>(b.IDENTIFY="IDENTIFY",b.CONNECT="CONNECT",b.STREAM_OPEN="STREAM_OPEN",b.STREAM_HANDLER="STREAM_HANDLER",b.DHT="DHT",b.LIST_PEERS="LIST_PEERS",b.CONNMANAGER="CONNMANAGER",b.DISCONNECT="DISCONNECT",b.PUBSUB="PUBSUB",b.PEERSTORE="PEERSTORE"))(n=o.Type||(o.Type={})),(i=>i.codec=()=>z(i))(n=o.Type||(o.Type={})),o.codec=()=>U({1:{name:"type",codec:o.Type.codec()},2:{name:"connect",codec:he.codec(),optional:!0},3:{name:"streamOpen",codec:ge.codec(),optional:!0},4:{name:"streamHandler",codec:me.codec(),optional:!0},5:{name:"dht",codec:we.codec(),optional:!0},6:{name:"connManager",codec:ye.codec(),optional:!0},7:{name:"disconnect",codec:Ee.codec(),optional:!0},8:{name:"pubsub",codec:Ae.codec(),optional:!0},9:{name:"peerStore",codec:Le.codec(),optional:!0}}),o.encode=c=>A(c,o.codec()),o.decode=c=>E(c,o.codec())})(Xe||(Xe={}));var Qe;(o=>{let n;(s=>(s.OK="OK",s.ERROR="ERROR"))(n=o.Type||(o.Type={})),(i=>i.codec=()=>z(i))(n=o.Type||(o.Type={})),o.codec=()=>U({1:{name:"type",codec:o.Type.codec()},2:{name:"error",codec:le.codec(),optional:!0},3:{name:"streamInfo",codec:be.codec(),optional:!0},4:{name:"identify",codec:ue.codec(),optional:!0},5:{name:"dht",codec:xe.codec(),optional:!0},6:{name:"peers",codec:X.codec(),repeats:!0},7:{name:"pubsub",codec:Ue.codec(),optional:!0},8:{name:"peerStore",codec:Ie.codec(),optional:!0}}),o.encode=c=>A(c,o.codec()),o.decode=c=>E(c,o.codec())})(Qe||(Qe={}));var ue;(r=>(r.codec=()=>U({1:{name:"id",codec:m},2:{name:"addrs",codec:m,repeats:!0}}),r.encode=o=>A(o,r.codec()),r.decode=o=>E(o,r.codec())))(ue||(ue={}));var he;(r=>(r.codec=()=>U({1:{name:"peer",codec:m},2:{name:"addrs",codec:m,repeats:!0},3:{name:"timeout",codec:q,optional:!0}}),r.encode=o=>A(o,r.codec()),r.decode=o=>E(o,r.codec())))(he||(he={}));var ge;(r=>(r.codec=()=>U({1:{name:"peer",codec:m},2:{name:"proto",codec:C,repeats:!0},3:{name:"timeout",codec:q,optional:!0}}),r.encode=o=>A(o,r.codec()),r.decode=o=>E(o,r.codec())))(ge||(ge={}));var me;(r=>(r.codec=()=>U({1:{name:"addr",codec:m},2:{name:"proto",codec:C,repeats:!0}}),r.encode=o=>A(o,r.codec()),r.decode=o=>E(o,r.codec())))(me||(me={}));var le;(r=>(r.codec=()=>U({1:{name:"msg",codec:C}}),r.encode=o=>A(o,r.codec()),r.decode=o=>E(o,r.codec())))(le||(le={}));var be;(r=>(r.codec=()=>U({1:{name:"peer",codec:m},2:{name:"addr",codec:m},3:{name:"proto",codec:C}}),r.encode=o=>A(o,r.codec()),r.decode=o=>E(o,r.codec())))(be||(be={}));var we;(o=>{let n;(a=>(a.FIND_PEER="FIND_PEER",a.FIND_PEERS_CONNECTED_TO_PEER="FIND_PEERS_CONNECTED_TO_PEER",a.FIND_PROVIDERS="FIND_PROVIDERS",a.GET_CLOSEST_PEERS="GET_CLOSEST_PEERS",a.GET_PUBLIC_KEY="GET_PUBLIC_KEY",a.GET_VALUE="GET_VALUE",a.SEARCH_VALUE="SEARCH_VALUE",a.PUT_VALUE="PUT_VALUE",a.PROVIDE="PROVIDE"))(n=o.Type||(o.Type={})),(i=>i.codec=()=>z(i))(n=o.Type||(o.Type={})),o.codec=()=>U({1:{name:"type",codec:o.Type.codec()},2:{name:"peer",codec:m,optional:!0},3:{name:"cid",codec:m,optional:!0},4:{name:"key",codec:m,optional:!0},5:{name:"value",codec:m,optional:!0},6:{name:"count",codec:qe,optional:!0},7:{name:"timeout",codec:q,optional:!0}}),o.encode=c=>A(c,o.codec()),o.decode=c=>E(c,o.codec())})(we||(we={}));var xe;(o=>{let n;(f=>(f.BEGIN="BEGIN",f.VALUE="VALUE",f.END="END"))(n=o.Type||(o.Type={})),(i=>i.codec=()=>z(i))(n=o.Type||(o.Type={})),o.codec=()=>U({1:{name:"type",codec:o.Type.codec()},2:{name:"peer",codec:X.codec(),optional:!0},3:{name:"value",codec:m,optional:!0}}),o.encode=c=>A(c,o.codec()),o.decode=c=>E(c,o.codec())})(xe||(xe={}));var X;(r=>(r.codec=()=>U({1:{name:"id",codec:m},2:{name:"addrs",codec:m,repeats:!0}}),r.encode=o=>A(o,r.codec()),r.decode=o=>E(o,r.codec())))(X||(X={}));var ye;(o=>{let n;(f=>(f.TAG_PEER="TAG_PEER",f.UNTAG_PEER="UNTAG_PEER",f.TRIM="TRIM"))(n=o.Type||(o.Type={})),(i=>i.codec=()=>z(i))(n=o.Type||(o.Type={})),o.codec=()=>U({1:{name:"type",codec:o.Type.codec()},2:{name:"peer",codec:m,optional:!0},3:{name:"tag",codec:C,optional:!0},4:{name:"weight",codec:q,optional:!0}}),o.encode=c=>A(c,o.codec()),o.decode=c=>E(c,o.codec())})(ye||(ye={}));var Ee;(r=>(r.codec=()=>U({1:{name:"peer",codec:m}}),r.encode=o=>A(o,r.codec()),r.decode=o=>E(o,r.codec())))(Ee||(Ee={}));var Ae;(o=>{let n;(g=>(g.GET_TOPICS="GET_TOPICS",g.LIST_PEERS="LIST_PEERS",g.PUBLISH="PUBLISH",g.SUBSCRIBE="SUBSCRIBE"))(n=o.Type||(o.Type={})),(i=>i.codec=()=>z(i))(n=o.Type||(o.Type={})),o.codec=()=>U({1:{name:"type",codec:o.Type.codec()},2:{name:"topic",codec:C,optional:!0},3:{name:"data",codec:m,optional:!0}}),o.encode=c=>A(c,o.codec()),o.decode=c=>E(c,o.codec())})(Ae||(Ae={}));var We;(r=>(r.codec=()=>U({1:{name:"from",codec:m,optional:!0},2:{name:"data",codec:m,optional:!0},3:{name:"seqno",codec:m,optional:!0},4:{name:"topicIDs",codec:C,repeats:!0},5:{name:"signature",codec:m,optional:!0},6:{name:"key",codec:m,optional:!0}}),r.encode=o=>A(o,r.codec()),r.decode=o=>E(o,r.codec())))(We||(We={}));var Ue;(r=>(r.codec=()=>U({1:{name:"topics",codec:C,repeats:!0},2:{name:"peerIDs",codec:m,repeats:!0}}),r.encode=o=>A(o,r.codec()),r.decode=o=>E(o,r.codec())))(Ue||(Ue={}));var Le;(o=>{let n;(s=>(s.GET_PROTOCOLS="GET_PROTOCOLS",s.GET_PEER_INFO="GET_PEER_INFO"))(n=o.Type||(o.Type={})),(i=>i.codec=()=>z(i))(n=o.Type||(o.Type={})),o.codec=()=>U({1:{name:"type",codec:o.Type.codec()},2:{name:"id",codec:m,optional:!0},3:{name:"protos",codec:C,repeats:!0}}),o.encode=c=>A(c,o.codec()),o.decode=c=>E(c,o.codec())})(Le||(Le={}));var Ie;(r=>(r.codec=()=>U({1:{name:"peer",codec:X.codec(),optional:!0},2:{name:"protos",codec:C,repeats:!0}}),r.encode=o=>A(o,r.codec()),r.decode=o=>E(o,r.codec())))(Ie||(Ie={}));return zt(qr);})();
17
+ return Libp2PDaemonProtocol}));