@libp2p/daemon-protocol 1.0.1 → 1.0.2

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.
package/dist/index.min.js CHANGED
@@ -1,3 +1,17 @@
1
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 et=Object.create;var H=Object.defineProperty;var tt=Object.getOwnPropertyDescriptor;var rt=Object.getOwnPropertyNames;var nt=Object.getPrototypeOf,ot=Object.prototype.hasOwnProperty;var O=(o,n)=>()=>(n||o((n={exports:{}}).exports,n),n.exports),it=(o,n)=>{for(var r in n)H(o,r,{get:n[r],enumerable:!0})},re=(o,n,r,e)=>{if(n&&typeof n=="object"||typeof n=="function")for(let t of rt(n))!ot.call(o,t)&&t!==r&&H(o,t,{get:()=>n[t],enumerable:!(e=tt(n,t))||e.enumerable});return o};var st=(o,n,r)=>(r=o!=null?et(nt(o)):{},re(n||!o||!o.__esModule?H(r,"default",{value:o,enumerable:!0}):r,o)),at=o=>re(H({},"__esModule",{value:!0}),o);var oe=O((Ct,ne)=>{"use strict";ne.exports=ft;function ft(o,n){for(var r=new Array(arguments.length-1),e=0,t=2,i=!0;t<arguments.length;)r[e++]=arguments[t++];return new Promise(function(c,u){r[e]=function(y){if(i)if(i=!1,y)u(y);else{for(var _=new Array(arguments.length-1),B=0;B<_.length;)_[B++]=arguments[B];c.apply(null,_)}};try{o.apply(n||null,r)}catch(p){i&&(i=!1,u(p))}})}});var fe=O(ae=>{"use strict";var M=ae;M.length=function(n){var r=n.length;if(!r)return 0;for(var e=0;--r%4>1&&n.charAt(r)==="=";)++e;return Math.ceil(n.length*3)/4-e};var N=new Array(64),se=new Array(123);for(R=0;R<64;)se[N[R]=R<26?R+65:R<52?R+71:R<62?R-4:R-59|43]=R++;var R;M.encode=function(n,r,e){for(var t=null,i=[],s=0,c=0,u;r<e;){var p=n[r++];switch(c){case 0:i[s++]=N[p>>2],u=(p&3)<<4,c=1;break;case 1:i[s++]=N[u|p>>4],u=(p&15)<<2,c=2;break;case 2:i[s++]=N[u|p>>6],i[s++]=N[p&63],c=0;break}s>8191&&((t||(t=[])).push(String.fromCharCode.apply(String,i)),s=0)}return c&&(i[s++]=N[u],i[s++]=61,c===1&&(i[s++]=61)),t?(s&&t.push(String.fromCharCode.apply(String,i.slice(0,s))),t.join("")):String.fromCharCode.apply(String,i.slice(0,s))};var ie="invalid encoding";M.decode=function(n,r,e){for(var t=e,i=0,s,c=0;c<n.length;){var u=n.charCodeAt(c++);if(u===61&&i>1)break;if((u=se[u])===void 0)throw Error(ie);switch(i){case 0:s=u,i=1;break;case 1:r[e++]=s<<2|(u&48)>>4,s=u,i=2;break;case 2:r[e++]=(s&15)<<4|(u&60)>>2,s=u,i=3;break;case 3:r[e++]=(s&3)<<6|u,i=0;break}}if(i===1)throw Error(ie);return e-t};M.test=function(n){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(n)}});var ce=O((Mt,ue)=>{"use strict";ue.exports=G;function G(){this._listeners={}}G.prototype.on=function(n,r,e){return(this._listeners[n]||(this._listeners[n]=[])).push({fn:r,ctx:e||this}),this};G.prototype.off=function(n,r){if(n===void 0)this._listeners={};else if(r===void 0)this._listeners[n]=[];else for(var e=this._listeners[n],t=0;t<e.length;)e[t].fn===r?e.splice(t,1):++t;return this};G.prototype.emit=function(n){var r=this._listeners[n];if(r){for(var e=[],t=1;t<arguments.length;)e.push(arguments[t++]);for(t=0;t<r.length;)r[t].fn.apply(r[t++].ctx,e)}return this}});var ge=O((Gt,be)=>{"use strict";be.exports=pe(pe);function pe(o){return typeof Float32Array<"u"?function(){var n=new Float32Array([-0]),r=new Uint8Array(n.buffer),e=r[3]===128;function t(u,p,y){n[0]=u,p[y]=r[0],p[y+1]=r[1],p[y+2]=r[2],p[y+3]=r[3]}function i(u,p,y){n[0]=u,p[y]=r[3],p[y+1]=r[2],p[y+2]=r[1],p[y+3]=r[0]}o.writeFloatLE=e?t:i,o.writeFloatBE=e?i:t;function s(u,p){return r[0]=u[p],r[1]=u[p+1],r[2]=u[p+2],r[3]=u[p+3],n[0]}function c(u,p){return r[3]=u[p],r[2]=u[p+1],r[1]=u[p+2],r[0]=u[p+3],n[0]}o.readFloatLE=e?s:c,o.readFloatBE=e?c:s}():function(){function n(e,t,i,s){var c=t<0?1:0;if(c&&(t=-t),t===0)e(1/t>0?0:2147483648,i,s);else if(isNaN(t))e(2143289344,i,s);else if(t>34028234663852886e22)e((c<<31|2139095040)>>>0,i,s);else if(t<11754943508222875e-54)e((c<<31|Math.round(t/1401298464324817e-60))>>>0,i,s);else{var u=Math.floor(Math.log(t)/Math.LN2),p=Math.round(t*Math.pow(2,-u)*8388608)&8388607;e((c<<31|u+127<<23|p)>>>0,i,s)}}o.writeFloatLE=n.bind(null,le),o.writeFloatBE=n.bind(null,ye);function r(e,t,i){var s=e(t,i),c=(s>>31)*2+1,u=s>>>23&255,p=s&8388607;return u===255?p?NaN:c*(1/0):u===0?c*1401298464324817e-60*p:c*Math.pow(2,u-150)*(p+8388608)}o.readFloatLE=r.bind(null,he),o.readFloatBE=r.bind(null,de)}(),typeof Float64Array<"u"?function(){var n=new Float64Array([-0]),r=new Uint8Array(n.buffer),e=r[7]===128;function t(u,p,y){n[0]=u,p[y]=r[0],p[y+1]=r[1],p[y+2]=r[2],p[y+3]=r[3],p[y+4]=r[4],p[y+5]=r[5],p[y+6]=r[6],p[y+7]=r[7]}function i(u,p,y){n[0]=u,p[y]=r[7],p[y+1]=r[6],p[y+2]=r[5],p[y+3]=r[4],p[y+4]=r[3],p[y+5]=r[2],p[y+6]=r[1],p[y+7]=r[0]}o.writeDoubleLE=e?t:i,o.writeDoubleBE=e?i:t;function s(u,p){return r[0]=u[p],r[1]=u[p+1],r[2]=u[p+2],r[3]=u[p+3],r[4]=u[p+4],r[5]=u[p+5],r[6]=u[p+6],r[7]=u[p+7],n[0]}function c(u,p){return r[7]=u[p],r[6]=u[p+1],r[5]=u[p+2],r[4]=u[p+3],r[3]=u[p+4],r[2]=u[p+5],r[1]=u[p+6],r[0]=u[p+7],n[0]}o.readDoubleLE=e?s:c,o.readDoubleBE=e?c:s}():function(){function n(e,t,i,s,c,u){var p=s<0?1:0;if(p&&(s=-s),s===0)e(0,c,u+t),e(1/s>0?0:2147483648,c,u+i);else if(isNaN(s))e(0,c,u+t),e(2146959360,c,u+i);else if(s>17976931348623157e292)e(0,c,u+t),e((p<<31|2146435072)>>>0,c,u+i);else{var y;if(s<22250738585072014e-324)y=s/5e-324,e(y>>>0,c,u+t),e((p<<31|y/4294967296)>>>0,c,u+i);else{var _=Math.floor(Math.log(s)/Math.LN2);_===1024&&(_=1023),y=s*Math.pow(2,-_),e(y*4503599627370496>>>0,c,u+t),e((p<<31|_+1023<<20|y*1048576&1048575)>>>0,c,u+i)}}}o.writeDoubleLE=n.bind(null,le,0,4),o.writeDoubleBE=n.bind(null,ye,4,0);function r(e,t,i,s,c){var u=e(s,c+t),p=e(s,c+i),y=(p>>31)*2+1,_=p>>>20&2047,B=4294967296*(p&1048575)+u;return _===2047?B?NaN:y*(1/0):_===0?y*5e-324*B:y*Math.pow(2,_-1075)*(B+4503599627370496)}o.readDoubleLE=r.bind(null,he,0,4),o.readDoubleBE=r.bind(null,de,4,0)}(),o}function le(o,n,r){n[r]=o&255,n[r+1]=o>>>8&255,n[r+2]=o>>>16&255,n[r+3]=o>>>24}function ye(o,n,r){n[r]=o>>>24,n[r+1]=o>>>16&255,n[r+2]=o>>>8&255,n[r+3]=o&255}function he(o,n){return(o[n]|o[n+1]<<8|o[n+2]<<16|o[n+3]<<24)>>>0}function de(o,n){return(o[n]<<24|o[n+1]<<16|o[n+2]<<8|o[n+3])>>>0}});var Oe=O((exports,module)=>{"use strict";module.exports=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(o){}return null}});var we=O(Se=>{"use strict";var J=Se;J.length=function(n){for(var r=0,e=0,t=0;t<n.length;++t)e=n.charCodeAt(t),e<128?r+=1:e<2048?r+=2:(e&64512)===55296&&(n.charCodeAt(t+1)&64512)===56320?(++t,r+=4):r+=3;return r};J.read=function(n,r,e){var t=e-r;if(t<1)return"";for(var i=null,s=[],c=0,u;r<e;)u=n[r++],u<128?s[c++]=u:u>191&&u<224?s[c++]=(u&31)<<6|n[r++]&63:u>239&&u<365?(u=((u&7)<<18|(n[r++]&63)<<12|(n[r++]&63)<<6|n[r++]&63)-65536,s[c++]=55296+(u>>10),s[c++]=56320+(u&1023)):s[c++]=(u&15)<<12|(n[r++]&63)<<6|n[r++]&63,c>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,s)),c=0);return i?(c&&i.push(String.fromCharCode.apply(String,s.slice(0,c))),i.join("")):String.fromCharCode.apply(String,s.slice(0,c))};J.write=function(n,r,e){for(var t=e,i,s,c=0;c<n.length;++c)i=n.charCodeAt(c),i<128?r[e++]=i:i<2048?(r[e++]=i>>6|192,r[e++]=i&63|128):(i&64512)===55296&&((s=n.charCodeAt(c+1))&64512)===56320?(i=65536+((i&1023)<<10)+(s&1023),++c,r[e++]=i>>18|240,r[e++]=i>>12&63|128,r[e++]=i>>6&63|128,r[e++]=i&63|128):(r[e++]=i>>12|224,r[e++]=i>>6&63|128,r[e++]=i&63|128);return e-t}});var _e=O((Ft,Pe)=>{"use strict";Pe.exports=ut;function ut(o,n,r){var e=r||8192,t=e>>>1,i=null,s=e;return function(u){if(u<1||u>t)return o(u);s+u>e&&(i=o(e),s=0);var p=n.call(i,s,s+=u);return s&7&&(s=(s|7)+1),p}}});var Re=O((Jt,je)=>{"use strict";je.exports=S;var x=q();function S(o,n){this.lo=o>>>0,this.hi=n>>>0}var D=S.zero=new S(0,0);D.toNumber=function(){return 0};D.zzEncode=D.zzDecode=function(){return this};D.length=function(){return 1};var ct=S.zeroHash="\0\0\0\0\0\0\0\0";S.fromNumber=function(n){if(n===0)return D;var r=n<0;r&&(n=-n);var e=n>>>0,t=(n-e)/4294967296>>>0;return r&&(t=~t>>>0,e=~e>>>0,++e>4294967295&&(e=0,++t>4294967295&&(t=0))),new S(e,t)};S.from=function(n){if(typeof n=="number")return S.fromNumber(n);if(x.isString(n))if(x.Long)n=x.Long.fromString(n);else return S.fromNumber(parseInt(n,10));return n.low||n.high?new S(n.low>>>0,n.high>>>0):D};S.prototype.toNumber=function(n){if(!n&&this.hi>>>31){var r=~this.lo+1>>>0,e=~this.hi>>>0;return r||(e=e+1>>>0),-(r+e*4294967296)}return this.lo+this.hi*4294967296};S.prototype.toLong=function(n){return x.Long?new x.Long(this.lo|0,this.hi|0,Boolean(n)):{low:this.lo|0,high:this.hi|0,unsigned:Boolean(n)}};var I=String.prototype.charCodeAt;S.fromHash=function(n){return n===ct?D:new S((I.call(n,0)|I.call(n,1)<<8|I.call(n,2)<<16|I.call(n,3)<<24)>>>0,(I.call(n,4)|I.call(n,5)<<8|I.call(n,6)<<16|I.call(n,7)<<24)>>>0)};S.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)};S.prototype.zzEncode=function(){var n=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^n)>>>0,this.lo=(this.lo<<1^n)>>>0,this};S.prototype.zzDecode=function(){var n=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^n)>>>0,this.hi=(this.hi>>>1^n)>>>0,this};S.prototype.length=function(){var n=this.lo,r=(this.lo>>>28|this.hi<<4)>>>0,e=this.hi>>>24;return e===0?r===0?n<16384?n<128?1:2:n<2097152?3:4:r<16384?r<128?5:6:r<2097152?7:8:e<128?9:10}});var q=O(U=>{"use strict";var l=U;l.asPromise=oe();l.base64=fe();l.EventEmitter=ce();l.float=ge();l.inquire=Oe();l.utf8=we();l.pool=_e();l.LongBits=Re();l.isNode=Boolean(typeof globalThis<"u"&&globalThis&&globalThis.process&&globalThis.process.versions&&globalThis.process.versions.node);l.global=l.isNode&&globalThis||typeof window<"u"&&window||typeof self<"u"&&self||U;l.emptyArray=Object.freeze?Object.freeze([]):[];l.emptyObject=Object.freeze?Object.freeze({}):{};l.isInteger=Number.isInteger||function(n){return typeof n=="number"&&isFinite(n)&&Math.floor(n)===n};l.isString=function(n){return typeof n=="string"||n instanceof String};l.isObject=function(n){return n&&typeof n=="object"};l.isset=l.isSet=function(n,r){var e=n[r];return e!=null&&n.hasOwnProperty(r)?typeof e!="object"||(Array.isArray(e)?e.length:Object.keys(e).length)>0:!1};l.Buffer=function(){try{var o=l.inquire("buffer").Buffer;return o.prototype.utf8Write?o:null}catch{return null}}();l._Buffer_from=null;l._Buffer_allocUnsafe=null;l.newBuffer=function(n){return typeof n=="number"?l.Buffer?l._Buffer_allocUnsafe(n):new l.Array(n):l.Buffer?l._Buffer_from(n):typeof Uint8Array>"u"?n:new Uint8Array(n)};l.Array=typeof Uint8Array<"u"?Uint8Array:Array;l.Long=l.global.dcodeIO&&l.global.dcodeIO.Long||l.global.Long||l.inquire("long");l.key2Re=/^true|false|0|1$/;l.key32Re=/^-?(?:0|[1-9][0-9]*)$/;l.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;l.longToHash=function(n){return n?l.LongBits.from(n).toHash():l.LongBits.zeroHash};l.longFromHash=function(n,r){var e=l.LongBits.fromHash(n);return l.Long?l.Long.fromBits(e.lo,e.hi,r):e.toNumber(Boolean(r))};function ve(o,n,r){for(var e=Object.keys(n),t=0;t<e.length;++t)(o[e[t]]===void 0||!r)&&(o[e[t]]=n[e[t]]);return o}l.merge=ve;l.lcFirst=function(n){return n.charAt(0).toLowerCase()+n.substring(1)};function Ee(o){function n(r,e){if(!(this instanceof n))return new n(r,e);Object.defineProperty(this,"message",{get:function(){return r}}),Error.captureStackTrace?Error.captureStackTrace(this,n):Object.defineProperty(this,"stack",{value:new Error().stack||""}),e&&ve(this,e)}return(n.prototype=Object.create(Error.prototype)).constructor=n,Object.defineProperty(n.prototype,"name",{get:function(){return o}}),n.prototype.toString=function(){return this.name+": "+this.message},n}l.newError=Ee;l.ProtocolError=Ee("ProtocolError");l.oneOfGetter=function(n){for(var r={},e=0;e<n.length;++e)r[n[e]]=1;return function(){for(var t=Object.keys(this),i=t.length-1;i>-1;--i)if(r[t[i]]===1&&this[t[i]]!==void 0&&this[t[i]]!==null)return t[i]}};l.oneOfSetter=function(n){return function(r){for(var e=0;e<n.length;++e)n[e]!==r&&delete this[n[e]]}};l.toJSONOptions={longs:String,enums:String,bytes:String,json:!0};l._configure=function(){var o=l.Buffer;if(!o){l._Buffer_from=l._Buffer_allocUnsafe=null;return}l._Buffer_from=o.from!==Uint8Array.from&&o.from||function(r,e){return new o(r,e)},l._Buffer_allocUnsafe=o.allocUnsafe||function(r){return new o(r)}}});var Z=O((Vt,Ae)=>{"use strict";Ae.exports=d;var j=q(),V,m=j.LongBits,ke=j.base64,Ie=j.utf8;function L(o,n,r){this.fn=o,this.len=n,this.next=void 0,this.val=r}function z(){}function pt(o){this.head=o.head,this.tail=o.tail,this.len=o.len,this.next=o.states}function d(){this.len=0,this.head=new L(z,0,0),this.tail=this.head,this.states=null}var qe=function(){return j.Buffer?function(){return(d.create=function(){return new V})()}:function(){return new d}};d.create=qe();d.alloc=function(n){return new j.Array(n)};j.Array!==Array&&(d.alloc=j.pool(d.alloc,j.Array.prototype.subarray));d.prototype._push=function(n,r,e){return this.tail=this.tail.next=new L(n,r,e),this.len+=r,this};function W(o,n,r){n[r]=o&255}function lt(o,n,r){for(;o>127;)n[r++]=o&127|128,o>>>=7;n[r]=o}function K(o,n){this.len=o,this.next=void 0,this.val=n}K.prototype=Object.create(L.prototype);K.prototype.fn=lt;d.prototype.uint32=function(n){return this.len+=(this.tail=this.tail.next=new K((n=n>>>0)<128?1:n<16384?2:n<2097152?3:n<268435456?4:5,n)).len,this};d.prototype.int32=function(n){return n<0?this._push(Y,10,m.fromNumber(n)):this.uint32(n)};d.prototype.sint32=function(n){return this.uint32((n<<1^n>>31)>>>0)};function Y(o,n,r){for(;o.hi;)n[r++]=o.lo&127|128,o.lo=(o.lo>>>7|o.hi<<25)>>>0,o.hi>>>=7;for(;o.lo>127;)n[r++]=o.lo&127|128,o.lo=o.lo>>>7;n[r++]=o.lo}d.prototype.uint64=function(n){var r=m.from(n);return this._push(Y,r.length(),r)};d.prototype.int64=d.prototype.uint64;d.prototype.sint64=function(n){var r=m.from(n).zzEncode();return this._push(Y,r.length(),r)};d.prototype.bool=function(n){return this._push(W,1,n?1:0)};function $(o,n,r){n[r]=o&255,n[r+1]=o>>>8&255,n[r+2]=o>>>16&255,n[r+3]=o>>>24}d.prototype.fixed32=function(n){return this._push($,4,n>>>0)};d.prototype.sfixed32=d.prototype.fixed32;d.prototype.fixed64=function(n){var r=m.from(n);return this._push($,4,r.lo)._push($,4,r.hi)};d.prototype.sfixed64=d.prototype.fixed64;d.prototype.float=function(n){return this._push(j.float.writeFloatLE,4,n)};d.prototype.double=function(n){return this._push(j.float.writeDoubleLE,8,n)};var yt=j.Array.prototype.set?function(n,r,e){r.set(n,e)}:function(n,r,e){for(var t=0;t<n.length;++t)r[e+t]=n[t]};d.prototype.bytes=function(n){var r=n.length>>>0;if(!r)return this._push(W,1,0);if(j.isString(n)){var e=d.alloc(r=ke.length(n));ke.decode(n,e,0),n=e}return this.uint32(r)._push(yt,r,n)};d.prototype.string=function(n){var r=Ie.length(n);return r?this.uint32(r)._push(Ie.write,r,n):this._push(W,1,0)};d.prototype.fork=function(){return this.states=new pt(this),this.head=this.tail=new L(z,0,0),this.len=0,this};d.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new L(z,0,0),this.len=0),this};d.prototype.ldelim=function(){var n=this.head,r=this.tail,e=this.len;return this.reset().uint32(e),e&&(this.tail.next=n.next,this.tail=r,this.len+=e),this};d.prototype.finish=function(){for(var n=this.head.next,r=this.constructor.alloc(this.len),e=0;n;)n.fn(n.val,r,e),e+=n.len,n=n.next;return r};d._configure=function(o){V=o,d.create=qe(),V._configure()}});var Te=O(($t,De)=>{"use strict";De.exports=E;var Be=Z();(E.prototype=Object.create(Be.prototype)).constructor=E;var A=q();function E(){Be.call(this)}E._configure=function(){E.alloc=A._Buffer_allocUnsafe,E.writeBytesBuffer=A.Buffer&&A.Buffer.prototype instanceof Uint8Array&&A.Buffer.prototype.set.name==="set"?function(n,r,e){r.set(n,e)}:function(n,r,e){if(n.copy)n.copy(r,e,0,n.length);else for(var t=0;t<n.length;)r[e++]=n[t++]}};E.prototype.bytes=function(n){A.isString(n)&&(n=A._Buffer_from(n,"base64"));var r=n.length>>>0;return this.uint32(r),r&&this._push(E.writeBytesBuffer,r,n),this};function ht(o,n,r){o.length<40?A.utf8.write(o,n,r):n.utf8Write?n.utf8Write(o,r):n.write(o,r)}E.prototype.string=function(n){var r=A.Buffer.byteLength(n);return this.uint32(r),r&&this._push(ht,r,n),this};E._configure()});var ee=O((zt,He)=>{"use strict";He.exports=g;var k=q(),Q,Le=k.LongBits,dt=k.utf8;function v(o,n){return RangeError("index out of range: "+o.pos+" + "+(n||1)+" > "+o.len)}function g(o){this.buf=o,this.pos=0,this.len=o.length}var Ne=typeof Uint8Array<"u"?function(n){if(n instanceof Uint8Array||Array.isArray(n))return new g(n);throw Error("illegal buffer")}:function(n){if(Array.isArray(n))return new g(n);throw Error("illegal buffer")},Ce=function(){return k.Buffer?function(r){return(g.create=function(t){return k.Buffer.isBuffer(t)?new Q(t):Ne(t)})(r)}:Ne};g.create=Ce();g.prototype._slice=k.Array.prototype.subarray||k.Array.prototype.slice;g.prototype.uint32=function(){var n=4294967295;return function(){if(n=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(n=(n|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(n=(n|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(n=(n|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(n=(n|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return n;if((this.pos+=5)>this.len)throw this.pos=this.len,v(this,10);return n}}();g.prototype.int32=function(){return this.uint32()|0};g.prototype.sint32=function(){var n=this.uint32();return n>>>1^-(n&1)|0};function X(){var o=new Le(0,0),n=0;if(this.len-this.pos>4){for(;n<4;++n)if(o.lo=(o.lo|(this.buf[this.pos]&127)<<n*7)>>>0,this.buf[this.pos++]<128)return o;if(o.lo=(o.lo|(this.buf[this.pos]&127)<<28)>>>0,o.hi=(o.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return o;n=0}else{for(;n<3;++n){if(this.pos>=this.len)throw v(this);if(o.lo=(o.lo|(this.buf[this.pos]&127)<<n*7)>>>0,this.buf[this.pos++]<128)return o}return o.lo=(o.lo|(this.buf[this.pos++]&127)<<n*7)>>>0,o}if(this.len-this.pos>4){for(;n<5;++n)if(o.hi=(o.hi|(this.buf[this.pos]&127)<<n*7+3)>>>0,this.buf[this.pos++]<128)return o}else for(;n<5;++n){if(this.pos>=this.len)throw v(this);if(o.hi=(o.hi|(this.buf[this.pos]&127)<<n*7+3)>>>0,this.buf[this.pos++]<128)return o}throw Error("invalid varint encoding")}g.prototype.bool=function(){return this.uint32()!==0};function F(o,n){return(o[n-4]|o[n-3]<<8|o[n-2]<<16|o[n-1]<<24)>>>0}g.prototype.fixed32=function(){if(this.pos+4>this.len)throw v(this,4);return F(this.buf,this.pos+=4)};g.prototype.sfixed32=function(){if(this.pos+4>this.len)throw v(this,4);return F(this.buf,this.pos+=4)|0};function xe(){if(this.pos+8>this.len)throw v(this,8);return new Le(F(this.buf,this.pos+=4),F(this.buf,this.pos+=4))}g.prototype.float=function(){if(this.pos+4>this.len)throw v(this,4);var n=k.float.readFloatLE(this.buf,this.pos);return this.pos+=4,n};g.prototype.double=function(){if(this.pos+8>this.len)throw v(this,4);var n=k.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,n};g.prototype.bytes=function(){var n=this.uint32(),r=this.pos,e=this.pos+n;if(e>this.len)throw v(this,n);return this.pos+=n,Array.isArray(this.buf)?this.buf.slice(r,e):r===e?new this.buf.constructor(0):this._slice.call(this.buf,r,e)};g.prototype.string=function(){var n=this.bytes();return dt.read(n,0,n.length)};g.prototype.skip=function(n){if(typeof n=="number"){if(this.pos+n>this.len)throw v(this,n);this.pos+=n}else do if(this.pos>=this.len)throw v(this);while(this.buf[this.pos++]&128);return this};g.prototype.skipType=function(o){switch(o){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(o=this.uint32()&7)!==4;)this.skipType(o);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+o+" at offset "+this.pos)}return this};g._configure=function(o){Q=o,g.create=Ce(),Q._configure();var n=k.Long?"toLong":"toNumber";k.merge(g.prototype,{int64:function(){return X.call(this)[n](!1)},uint64:function(){return X.call(this)[n](!0)},sint64:function(){return X.call(this).zzDecode()[n](!1)},fixed64:function(){return xe.call(this)[n](!0)},sfixed64:function(){return xe.call(this)[n](!1)}})}});var Fe=O((Wt,me)=>{"use strict";me.exports=T;var Ge=ee();(T.prototype=Object.create(Ge.prototype)).constructor=T;var Me=q();function T(o){Ge.call(this,o)}T._configure=function(){Me.Buffer&&(T.prototype._slice=Me.Buffer.prototype.slice)};T.prototype.string=function(){var n=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+n,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+n,this.len))};T._configure()});var Ue=O((Kt,Je)=>{"use strict";Je.exports=C;var te=q();(C.prototype=Object.create(te.EventEmitter.prototype)).constructor=C;function C(o,n,r){if(typeof o!="function")throw TypeError("rpcImpl must be a function");te.EventEmitter.call(this),this.rpcImpl=o,this.requestDelimited=Boolean(n),this.responseDelimited=Boolean(r)}C.prototype.rpcCall=function o(n,r,e,t,i){if(!t)throw TypeError("request must be specified");var s=this;if(!i)return te.asPromise(o,s,n,r,e,t);if(!s.rpcImpl){setTimeout(function(){i(Error("already ended"))},0);return}try{return s.rpcImpl(n,r[s.requestDelimited?"encodeDelimited":"encode"](t).finish(),function(u,p){if(u)return s.emit("error",u,n),i(u);if(p===null){s.end(!0);return}if(!(p instanceof e))try{p=e[s.responseDelimited?"decodeDelimited":"decode"](p)}catch(y){return s.emit("error",y,n),i(y)}return s.emit("data",p,n),i(null,p)})}catch(c){s.emit("error",c,n),setTimeout(function(){i(c)},0);return}};C.prototype.end=function(n){return this.rpcImpl&&(n||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}});var $e=O(Ve=>{"use strict";var bt=Ve;bt.Service=Ue()});var We=O((Zt,ze)=>{"use strict";ze.exports={}});var Ze=O(Ye=>{"use strict";var P=Ye;P.build="minimal";P.Writer=Z();P.BufferWriter=Te();P.Reader=ee();P.BufferReader=Fe();P.util=q();P.rpc=$e();P.roots=We();P.configure=Ke;function Ke(){P.util._configure(),P.Writer._configure(P.BufferWriter),P.Reader._configure(P.BufferReader)}Ke()});var Qe=O((Qt,Xe)=>{"use strict";Xe.exports=Ze()});var xt={};it(xt,{ConnManagerRequest:()=>It,ConnectRequest:()=>wt,DHTRequest:()=>vt,DHTResponse:()=>Et,DisconnectRequest:()=>qt,ErrorResponse:()=>jt,IdentifyResponse:()=>St,PSMessage:()=>Bt,PSRequest:()=>At,PSResponse:()=>Dt,PeerInfo:()=>kt,PeerstoreRequest:()=>Tt,PeerstoreResponse:()=>Nt,Request:()=>gt,Response:()=>Ot,StreamHandlerRequest:()=>_t,StreamInfo:()=>Rt,StreamOpenRequest:()=>Pt,default:()=>f});var b=st(Qe(),1),h=b.default.Reader,w=b.default.Writer,a=b.default.util,f=b.default.roots["libp2p-daemon"]||(b.default.roots["libp2p-daemon"]={}),gt=f.Request=(()=>{function o(r){if(r)for(var e=Object.keys(r),t=0;t<e.length;++t)r[e[t]]!=null&&(this[e[t]]=r[e[t]])}o.prototype.type=0,o.prototype.connect=null,o.prototype.streamOpen=null,o.prototype.streamHandler=null,o.prototype.dht=null,o.prototype.connManager=null,o.prototype.disconnect=null,o.prototype.pubsub=null,o.prototype.peerStore=null;let n;return Object.defineProperty(o.prototype,"_connect",{get:a.oneOfGetter(n=["connect"]),set:a.oneOfSetter(n)}),Object.defineProperty(o.prototype,"_streamOpen",{get:a.oneOfGetter(n=["streamOpen"]),set:a.oneOfSetter(n)}),Object.defineProperty(o.prototype,"_streamHandler",{get:a.oneOfGetter(n=["streamHandler"]),set:a.oneOfSetter(n)}),Object.defineProperty(o.prototype,"_dht",{get:a.oneOfGetter(n=["dht"]),set:a.oneOfSetter(n)}),Object.defineProperty(o.prototype,"_connManager",{get:a.oneOfGetter(n=["connManager"]),set:a.oneOfSetter(n)}),Object.defineProperty(o.prototype,"_disconnect",{get:a.oneOfGetter(n=["disconnect"]),set:a.oneOfSetter(n)}),Object.defineProperty(o.prototype,"_pubsub",{get:a.oneOfGetter(n=["pubsub"]),set:a.oneOfSetter(n)}),Object.defineProperty(o.prototype,"_peerStore",{get:a.oneOfGetter(n=["peerStore"]),set:a.oneOfSetter(n)}),o.encode=function(e,t){return t||(t=w.create()),t.uint32(8).int32(e.type),e.connect!=null&&Object.hasOwnProperty.call(e,"connect")&&f.ConnectRequest.encode(e.connect,t.uint32(18).fork()).ldelim(),e.streamOpen!=null&&Object.hasOwnProperty.call(e,"streamOpen")&&f.StreamOpenRequest.encode(e.streamOpen,t.uint32(26).fork()).ldelim(),e.streamHandler!=null&&Object.hasOwnProperty.call(e,"streamHandler")&&f.StreamHandlerRequest.encode(e.streamHandler,t.uint32(34).fork()).ldelim(),e.dht!=null&&Object.hasOwnProperty.call(e,"dht")&&f.DHTRequest.encode(e.dht,t.uint32(42).fork()).ldelim(),e.connManager!=null&&Object.hasOwnProperty.call(e,"connManager")&&f.ConnManagerRequest.encode(e.connManager,t.uint32(50).fork()).ldelim(),e.disconnect!=null&&Object.hasOwnProperty.call(e,"disconnect")&&f.DisconnectRequest.encode(e.disconnect,t.uint32(58).fork()).ldelim(),e.pubsub!=null&&Object.hasOwnProperty.call(e,"pubsub")&&f.PSRequest.encode(e.pubsub,t.uint32(66).fork()).ldelim(),e.peerStore!=null&&Object.hasOwnProperty.call(e,"peerStore")&&f.PeerstoreRequest.encode(e.peerStore,t.uint32(74).fork()).ldelim(),t},o.decode=function(e,t){e instanceof h||(e=h.create(e));for(var i=t===void 0?e.len:e.pos+t,s=new f.Request;e.pos<i;){var c=e.uint32();switch(c>>>3){case 1:s.type=e.int32();break;case 2:s.connect=f.ConnectRequest.decode(e,e.uint32());break;case 3:s.streamOpen=f.StreamOpenRequest.decode(e,e.uint32());break;case 4:s.streamHandler=f.StreamHandlerRequest.decode(e,e.uint32());break;case 5:s.dht=f.DHTRequest.decode(e,e.uint32());break;case 6:s.connManager=f.ConnManagerRequest.decode(e,e.uint32());break;case 7:s.disconnect=f.DisconnectRequest.decode(e,e.uint32());break;case 8:s.pubsub=f.PSRequest.decode(e,e.uint32());break;case 9:s.peerStore=f.PeerstoreRequest.decode(e,e.uint32());break;default:e.skipType(c&7);break}}if(!s.hasOwnProperty("type"))throw a.ProtocolError("missing required 'type'",{instance:s});return s},o.fromObject=function(e){if(e instanceof f.Request)return e;var t=new f.Request;switch(e.type){case"IDENTIFY":case 0:t.type=0;break;case"CONNECT":case 1:t.type=1;break;case"STREAM_OPEN":case 2:t.type=2;break;case"STREAM_HANDLER":case 3:t.type=3;break;case"DHT":case 4:t.type=4;break;case"LIST_PEERS":case 5:t.type=5;break;case"CONNMANAGER":case 6:t.type=6;break;case"DISCONNECT":case 7:t.type=7;break;case"PUBSUB":case 8:t.type=8;break;case"PEERSTORE":case 9:t.type=9;break}if(e.connect!=null){if(typeof e.connect!="object")throw TypeError(".Request.connect: object expected");t.connect=f.ConnectRequest.fromObject(e.connect)}if(e.streamOpen!=null){if(typeof e.streamOpen!="object")throw TypeError(".Request.streamOpen: object expected");t.streamOpen=f.StreamOpenRequest.fromObject(e.streamOpen)}if(e.streamHandler!=null){if(typeof e.streamHandler!="object")throw TypeError(".Request.streamHandler: object expected");t.streamHandler=f.StreamHandlerRequest.fromObject(e.streamHandler)}if(e.dht!=null){if(typeof e.dht!="object")throw TypeError(".Request.dht: object expected");t.dht=f.DHTRequest.fromObject(e.dht)}if(e.connManager!=null){if(typeof e.connManager!="object")throw TypeError(".Request.connManager: object expected");t.connManager=f.ConnManagerRequest.fromObject(e.connManager)}if(e.disconnect!=null){if(typeof e.disconnect!="object")throw TypeError(".Request.disconnect: object expected");t.disconnect=f.DisconnectRequest.fromObject(e.disconnect)}if(e.pubsub!=null){if(typeof e.pubsub!="object")throw TypeError(".Request.pubsub: object expected");t.pubsub=f.PSRequest.fromObject(e.pubsub)}if(e.peerStore!=null){if(typeof e.peerStore!="object")throw TypeError(".Request.peerStore: object expected");t.peerStore=f.PeerstoreRequest.fromObject(e.peerStore)}return t},o.toObject=function(e,t){t||(t={});var i={};return t.defaults&&(i.type=t.enums===String?"IDENTIFY":0),e.type!=null&&e.hasOwnProperty("type")&&(i.type=t.enums===String?f.Request.Type[e.type]:e.type),e.connect!=null&&e.hasOwnProperty("connect")&&(i.connect=f.ConnectRequest.toObject(e.connect,t),t.oneofs&&(i._connect="connect")),e.streamOpen!=null&&e.hasOwnProperty("streamOpen")&&(i.streamOpen=f.StreamOpenRequest.toObject(e.streamOpen,t),t.oneofs&&(i._streamOpen="streamOpen")),e.streamHandler!=null&&e.hasOwnProperty("streamHandler")&&(i.streamHandler=f.StreamHandlerRequest.toObject(e.streamHandler,t),t.oneofs&&(i._streamHandler="streamHandler")),e.dht!=null&&e.hasOwnProperty("dht")&&(i.dht=f.DHTRequest.toObject(e.dht,t),t.oneofs&&(i._dht="dht")),e.connManager!=null&&e.hasOwnProperty("connManager")&&(i.connManager=f.ConnManagerRequest.toObject(e.connManager,t),t.oneofs&&(i._connManager="connManager")),e.disconnect!=null&&e.hasOwnProperty("disconnect")&&(i.disconnect=f.DisconnectRequest.toObject(e.disconnect,t),t.oneofs&&(i._disconnect="disconnect")),e.pubsub!=null&&e.hasOwnProperty("pubsub")&&(i.pubsub=f.PSRequest.toObject(e.pubsub,t),t.oneofs&&(i._pubsub="pubsub")),e.peerStore!=null&&e.hasOwnProperty("peerStore")&&(i.peerStore=f.PeerstoreRequest.toObject(e.peerStore,t),t.oneofs&&(i._peerStore="peerStore")),i},o.prototype.toJSON=function(){return this.constructor.toObject(this,b.default.util.toJSONOptions)},o.Type=function(){let r={},e=Object.create(r);return e[r[0]="IDENTIFY"]=0,e[r[1]="CONNECT"]=1,e[r[2]="STREAM_OPEN"]=2,e[r[3]="STREAM_HANDLER"]=3,e[r[4]="DHT"]=4,e[r[5]="LIST_PEERS"]=5,e[r[6]="CONNMANAGER"]=6,e[r[7]="DISCONNECT"]=7,e[r[8]="PUBSUB"]=8,e[r[9]="PEERSTORE"]=9,e}(),o})(),Ot=f.Response=(()=>{function o(r){if(this.peers=[],r)for(var e=Object.keys(r),t=0;t<e.length;++t)r[e[t]]!=null&&(this[e[t]]=r[e[t]])}o.prototype.type=0,o.prototype.error=null,o.prototype.streamInfo=null,o.prototype.identify=null,o.prototype.dht=null,o.prototype.peers=a.emptyArray,o.prototype.pubsub=null,o.prototype.peerStore=null;let n;return Object.defineProperty(o.prototype,"_error",{get:a.oneOfGetter(n=["error"]),set:a.oneOfSetter(n)}),Object.defineProperty(o.prototype,"_streamInfo",{get:a.oneOfGetter(n=["streamInfo"]),set:a.oneOfSetter(n)}),Object.defineProperty(o.prototype,"_identify",{get:a.oneOfGetter(n=["identify"]),set:a.oneOfSetter(n)}),Object.defineProperty(o.prototype,"_dht",{get:a.oneOfGetter(n=["dht"]),set:a.oneOfSetter(n)}),Object.defineProperty(o.prototype,"_pubsub",{get:a.oneOfGetter(n=["pubsub"]),set:a.oneOfSetter(n)}),Object.defineProperty(o.prototype,"_peerStore",{get:a.oneOfGetter(n=["peerStore"]),set:a.oneOfSetter(n)}),o.encode=function(e,t){if(t||(t=w.create()),t.uint32(8).int32(e.type),e.error!=null&&Object.hasOwnProperty.call(e,"error")&&f.ErrorResponse.encode(e.error,t.uint32(18).fork()).ldelim(),e.streamInfo!=null&&Object.hasOwnProperty.call(e,"streamInfo")&&f.StreamInfo.encode(e.streamInfo,t.uint32(26).fork()).ldelim(),e.identify!=null&&Object.hasOwnProperty.call(e,"identify")&&f.IdentifyResponse.encode(e.identify,t.uint32(34).fork()).ldelim(),e.dht!=null&&Object.hasOwnProperty.call(e,"dht")&&f.DHTResponse.encode(e.dht,t.uint32(42).fork()).ldelim(),e.peers!=null&&e.peers.length)for(var i=0;i<e.peers.length;++i)f.PeerInfo.encode(e.peers[i],t.uint32(50).fork()).ldelim();return e.pubsub!=null&&Object.hasOwnProperty.call(e,"pubsub")&&f.PSResponse.encode(e.pubsub,t.uint32(58).fork()).ldelim(),e.peerStore!=null&&Object.hasOwnProperty.call(e,"peerStore")&&f.PeerstoreResponse.encode(e.peerStore,t.uint32(66).fork()).ldelim(),t},o.decode=function(e,t){e instanceof h||(e=h.create(e));for(var i=t===void 0?e.len:e.pos+t,s=new f.Response;e.pos<i;){var c=e.uint32();switch(c>>>3){case 1:s.type=e.int32();break;case 2:s.error=f.ErrorResponse.decode(e,e.uint32());break;case 3:s.streamInfo=f.StreamInfo.decode(e,e.uint32());break;case 4:s.identify=f.IdentifyResponse.decode(e,e.uint32());break;case 5:s.dht=f.DHTResponse.decode(e,e.uint32());break;case 6:s.peers&&s.peers.length||(s.peers=[]),s.peers.push(f.PeerInfo.decode(e,e.uint32()));break;case 7:s.pubsub=f.PSResponse.decode(e,e.uint32());break;case 8:s.peerStore=f.PeerstoreResponse.decode(e,e.uint32());break;default:e.skipType(c&7);break}}if(!s.hasOwnProperty("type"))throw a.ProtocolError("missing required 'type'",{instance:s});return s},o.fromObject=function(e){if(e instanceof f.Response)return e;var t=new f.Response;switch(e.type){case"OK":case 0:t.type=0;break;case"ERROR":case 1:t.type=1;break}if(e.error!=null){if(typeof e.error!="object")throw TypeError(".Response.error: object expected");t.error=f.ErrorResponse.fromObject(e.error)}if(e.streamInfo!=null){if(typeof e.streamInfo!="object")throw TypeError(".Response.streamInfo: object expected");t.streamInfo=f.StreamInfo.fromObject(e.streamInfo)}if(e.identify!=null){if(typeof e.identify!="object")throw TypeError(".Response.identify: object expected");t.identify=f.IdentifyResponse.fromObject(e.identify)}if(e.dht!=null){if(typeof e.dht!="object")throw TypeError(".Response.dht: object expected");t.dht=f.DHTResponse.fromObject(e.dht)}if(e.peers){if(!Array.isArray(e.peers))throw TypeError(".Response.peers: array expected");t.peers=[];for(var i=0;i<e.peers.length;++i){if(typeof e.peers[i]!="object")throw TypeError(".Response.peers: object expected");t.peers[i]=f.PeerInfo.fromObject(e.peers[i])}}if(e.pubsub!=null){if(typeof e.pubsub!="object")throw TypeError(".Response.pubsub: object expected");t.pubsub=f.PSResponse.fromObject(e.pubsub)}if(e.peerStore!=null){if(typeof e.peerStore!="object")throw TypeError(".Response.peerStore: object expected");t.peerStore=f.PeerstoreResponse.fromObject(e.peerStore)}return t},o.toObject=function(e,t){t||(t={});var i={};if((t.arrays||t.defaults)&&(i.peers=[]),t.defaults&&(i.type=t.enums===String?"OK":0),e.type!=null&&e.hasOwnProperty("type")&&(i.type=t.enums===String?f.Response.Type[e.type]:e.type),e.error!=null&&e.hasOwnProperty("error")&&(i.error=f.ErrorResponse.toObject(e.error,t),t.oneofs&&(i._error="error")),e.streamInfo!=null&&e.hasOwnProperty("streamInfo")&&(i.streamInfo=f.StreamInfo.toObject(e.streamInfo,t),t.oneofs&&(i._streamInfo="streamInfo")),e.identify!=null&&e.hasOwnProperty("identify")&&(i.identify=f.IdentifyResponse.toObject(e.identify,t),t.oneofs&&(i._identify="identify")),e.dht!=null&&e.hasOwnProperty("dht")&&(i.dht=f.DHTResponse.toObject(e.dht,t),t.oneofs&&(i._dht="dht")),e.peers&&e.peers.length){i.peers=[];for(var s=0;s<e.peers.length;++s)i.peers[s]=f.PeerInfo.toObject(e.peers[s],t)}return e.pubsub!=null&&e.hasOwnProperty("pubsub")&&(i.pubsub=f.PSResponse.toObject(e.pubsub,t),t.oneofs&&(i._pubsub="pubsub")),e.peerStore!=null&&e.hasOwnProperty("peerStore")&&(i.peerStore=f.PeerstoreResponse.toObject(e.peerStore,t),t.oneofs&&(i._peerStore="peerStore")),i},o.prototype.toJSON=function(){return this.constructor.toObject(this,b.default.util.toJSONOptions)},o.Type=function(){let r={},e=Object.create(r);return e[r[0]="OK"]=0,e[r[1]="ERROR"]=1,e}(),o})(),St=f.IdentifyResponse=(()=>{function o(n){if(this.addrs=[],n)for(var r=Object.keys(n),e=0;e<r.length;++e)n[r[e]]!=null&&(this[r[e]]=n[r[e]])}return o.prototype.id=a.newBuffer([]),o.prototype.addrs=a.emptyArray,o.encode=function(r,e){if(e||(e=w.create()),e.uint32(10).bytes(r.id),r.addrs!=null&&r.addrs.length)for(var t=0;t<r.addrs.length;++t)e.uint32(18).bytes(r.addrs[t]);return e},o.decode=function(r,e){r instanceof h||(r=h.create(r));for(var t=e===void 0?r.len:r.pos+e,i=new f.IdentifyResponse;r.pos<t;){var s=r.uint32();switch(s>>>3){case 1:i.id=r.bytes();break;case 2:i.addrs&&i.addrs.length||(i.addrs=[]),i.addrs.push(r.bytes());break;default:r.skipType(s&7);break}}if(!i.hasOwnProperty("id"))throw a.ProtocolError("missing required 'id'",{instance:i});return i},o.fromObject=function(r){if(r instanceof f.IdentifyResponse)return r;var e=new f.IdentifyResponse;if(r.id!=null&&(typeof r.id=="string"?a.base64.decode(r.id,e.id=a.newBuffer(a.base64.length(r.id)),0):r.id.length&&(e.id=r.id)),r.addrs){if(!Array.isArray(r.addrs))throw TypeError(".IdentifyResponse.addrs: array expected");e.addrs=[];for(var t=0;t<r.addrs.length;++t)typeof r.addrs[t]=="string"?a.base64.decode(r.addrs[t],e.addrs[t]=a.newBuffer(a.base64.length(r.addrs[t])),0):r.addrs[t].length&&(e.addrs[t]=r.addrs[t])}return e},o.toObject=function(r,e){e||(e={});var t={};if((e.arrays||e.defaults)&&(t.addrs=[]),e.defaults&&(e.bytes===String?t.id="":(t.id=[],e.bytes!==Array&&(t.id=a.newBuffer(t.id)))),r.id!=null&&r.hasOwnProperty("id")&&(t.id=e.bytes===String?a.base64.encode(r.id,0,r.id.length):e.bytes===Array?Array.prototype.slice.call(r.id):r.id),r.addrs&&r.addrs.length){t.addrs=[];for(var i=0;i<r.addrs.length;++i)t.addrs[i]=e.bytes===String?a.base64.encode(r.addrs[i],0,r.addrs[i].length):e.bytes===Array?Array.prototype.slice.call(r.addrs[i]):r.addrs[i]}return t},o.prototype.toJSON=function(){return this.constructor.toObject(this,b.default.util.toJSONOptions)},o})(),wt=f.ConnectRequest=(()=>{function o(r){if(this.addrs=[],r)for(var e=Object.keys(r),t=0;t<e.length;++t)r[e[t]]!=null&&(this[e[t]]=r[e[t]])}o.prototype.peer=a.newBuffer([]),o.prototype.addrs=a.emptyArray,o.prototype.timeout=null;let n;return Object.defineProperty(o.prototype,"_timeout",{get:a.oneOfGetter(n=["timeout"]),set:a.oneOfSetter(n)}),o.encode=function(e,t){if(t||(t=w.create()),t.uint32(10).bytes(e.peer),e.addrs!=null&&e.addrs.length)for(var i=0;i<e.addrs.length;++i)t.uint32(18).bytes(e.addrs[i]);return e.timeout!=null&&Object.hasOwnProperty.call(e,"timeout")&&t.uint32(24).int64(e.timeout),t},o.decode=function(e,t){e instanceof h||(e=h.create(e));for(var i=t===void 0?e.len:e.pos+t,s=new f.ConnectRequest;e.pos<i;){var c=e.uint32();switch(c>>>3){case 1:s.peer=e.bytes();break;case 2:s.addrs&&s.addrs.length||(s.addrs=[]),s.addrs.push(e.bytes());break;case 3:s.timeout=e.int64();break;default:e.skipType(c&7);break}}if(!s.hasOwnProperty("peer"))throw a.ProtocolError("missing required 'peer'",{instance:s});return s},o.fromObject=function(e){if(e instanceof f.ConnectRequest)return e;var t=new f.ConnectRequest;if(e.peer!=null&&(typeof e.peer=="string"?a.base64.decode(e.peer,t.peer=a.newBuffer(a.base64.length(e.peer)),0):e.peer.length&&(t.peer=e.peer)),e.addrs){if(!Array.isArray(e.addrs))throw TypeError(".ConnectRequest.addrs: array expected");t.addrs=[];for(var i=0;i<e.addrs.length;++i)typeof e.addrs[i]=="string"?a.base64.decode(e.addrs[i],t.addrs[i]=a.newBuffer(a.base64.length(e.addrs[i])),0):e.addrs[i].length&&(t.addrs[i]=e.addrs[i])}return e.timeout!=null&&(a.Long?(t.timeout=a.Long.fromValue(e.timeout)).unsigned=!1:typeof e.timeout=="string"?t.timeout=parseInt(e.timeout,10):typeof e.timeout=="number"?t.timeout=e.timeout:typeof e.timeout=="object"&&(t.timeout=new a.LongBits(e.timeout.low>>>0,e.timeout.high>>>0).toNumber())),t},o.toObject=function(e,t){t||(t={});var i={};if((t.arrays||t.defaults)&&(i.addrs=[]),t.defaults&&(t.bytes===String?i.peer="":(i.peer=[],t.bytes!==Array&&(i.peer=a.newBuffer(i.peer)))),e.peer!=null&&e.hasOwnProperty("peer")&&(i.peer=t.bytes===String?a.base64.encode(e.peer,0,e.peer.length):t.bytes===Array?Array.prototype.slice.call(e.peer):e.peer),e.addrs&&e.addrs.length){i.addrs=[];for(var s=0;s<e.addrs.length;++s)i.addrs[s]=t.bytes===String?a.base64.encode(e.addrs[s],0,e.addrs[s].length):t.bytes===Array?Array.prototype.slice.call(e.addrs[s]):e.addrs[s]}return e.timeout!=null&&e.hasOwnProperty("timeout")&&(typeof e.timeout=="number"?i.timeout=t.longs===String?String(e.timeout):e.timeout:i.timeout=t.longs===String?a.Long.prototype.toString.call(e.timeout):t.longs===Number?new a.LongBits(e.timeout.low>>>0,e.timeout.high>>>0).toNumber():e.timeout,t.oneofs&&(i._timeout="timeout")),i},o.prototype.toJSON=function(){return this.constructor.toObject(this,b.default.util.toJSONOptions)},o})(),Pt=f.StreamOpenRequest=(()=>{function o(r){if(this.proto=[],r)for(var e=Object.keys(r),t=0;t<e.length;++t)r[e[t]]!=null&&(this[e[t]]=r[e[t]])}o.prototype.peer=a.newBuffer([]),o.prototype.proto=a.emptyArray,o.prototype.timeout=null;let n;return Object.defineProperty(o.prototype,"_timeout",{get:a.oneOfGetter(n=["timeout"]),set:a.oneOfSetter(n)}),o.encode=function(e,t){if(t||(t=w.create()),t.uint32(10).bytes(e.peer),e.proto!=null&&e.proto.length)for(var i=0;i<e.proto.length;++i)t.uint32(18).string(e.proto[i]);return e.timeout!=null&&Object.hasOwnProperty.call(e,"timeout")&&t.uint32(24).int64(e.timeout),t},o.decode=function(e,t){e instanceof h||(e=h.create(e));for(var i=t===void 0?e.len:e.pos+t,s=new f.StreamOpenRequest;e.pos<i;){var c=e.uint32();switch(c>>>3){case 1:s.peer=e.bytes();break;case 2:s.proto&&s.proto.length||(s.proto=[]),s.proto.push(e.string());break;case 3:s.timeout=e.int64();break;default:e.skipType(c&7);break}}if(!s.hasOwnProperty("peer"))throw a.ProtocolError("missing required 'peer'",{instance:s});return s},o.fromObject=function(e){if(e instanceof f.StreamOpenRequest)return e;var t=new f.StreamOpenRequest;if(e.peer!=null&&(typeof e.peer=="string"?a.base64.decode(e.peer,t.peer=a.newBuffer(a.base64.length(e.peer)),0):e.peer.length&&(t.peer=e.peer)),e.proto){if(!Array.isArray(e.proto))throw TypeError(".StreamOpenRequest.proto: array expected");t.proto=[];for(var i=0;i<e.proto.length;++i)t.proto[i]=String(e.proto[i])}return e.timeout!=null&&(a.Long?(t.timeout=a.Long.fromValue(e.timeout)).unsigned=!1:typeof e.timeout=="string"?t.timeout=parseInt(e.timeout,10):typeof e.timeout=="number"?t.timeout=e.timeout:typeof e.timeout=="object"&&(t.timeout=new a.LongBits(e.timeout.low>>>0,e.timeout.high>>>0).toNumber())),t},o.toObject=function(e,t){t||(t={});var i={};if((t.arrays||t.defaults)&&(i.proto=[]),t.defaults&&(t.bytes===String?i.peer="":(i.peer=[],t.bytes!==Array&&(i.peer=a.newBuffer(i.peer)))),e.peer!=null&&e.hasOwnProperty("peer")&&(i.peer=t.bytes===String?a.base64.encode(e.peer,0,e.peer.length):t.bytes===Array?Array.prototype.slice.call(e.peer):e.peer),e.proto&&e.proto.length){i.proto=[];for(var s=0;s<e.proto.length;++s)i.proto[s]=e.proto[s]}return e.timeout!=null&&e.hasOwnProperty("timeout")&&(typeof e.timeout=="number"?i.timeout=t.longs===String?String(e.timeout):e.timeout:i.timeout=t.longs===String?a.Long.prototype.toString.call(e.timeout):t.longs===Number?new a.LongBits(e.timeout.low>>>0,e.timeout.high>>>0).toNumber():e.timeout,t.oneofs&&(i._timeout="timeout")),i},o.prototype.toJSON=function(){return this.constructor.toObject(this,b.default.util.toJSONOptions)},o})(),_t=f.StreamHandlerRequest=(()=>{function o(n){if(this.proto=[],n)for(var r=Object.keys(n),e=0;e<r.length;++e)n[r[e]]!=null&&(this[r[e]]=n[r[e]])}return o.prototype.addr=a.newBuffer([]),o.prototype.proto=a.emptyArray,o.encode=function(r,e){if(e||(e=w.create()),e.uint32(10).bytes(r.addr),r.proto!=null&&r.proto.length)for(var t=0;t<r.proto.length;++t)e.uint32(18).string(r.proto[t]);return e},o.decode=function(r,e){r instanceof h||(r=h.create(r));for(var t=e===void 0?r.len:r.pos+e,i=new f.StreamHandlerRequest;r.pos<t;){var s=r.uint32();switch(s>>>3){case 1:i.addr=r.bytes();break;case 2:i.proto&&i.proto.length||(i.proto=[]),i.proto.push(r.string());break;default:r.skipType(s&7);break}}if(!i.hasOwnProperty("addr"))throw a.ProtocolError("missing required 'addr'",{instance:i});return i},o.fromObject=function(r){if(r instanceof f.StreamHandlerRequest)return r;var e=new f.StreamHandlerRequest;if(r.addr!=null&&(typeof r.addr=="string"?a.base64.decode(r.addr,e.addr=a.newBuffer(a.base64.length(r.addr)),0):r.addr.length&&(e.addr=r.addr)),r.proto){if(!Array.isArray(r.proto))throw TypeError(".StreamHandlerRequest.proto: array expected");e.proto=[];for(var t=0;t<r.proto.length;++t)e.proto[t]=String(r.proto[t])}return e},o.toObject=function(r,e){e||(e={});var t={};if((e.arrays||e.defaults)&&(t.proto=[]),e.defaults&&(e.bytes===String?t.addr="":(t.addr=[],e.bytes!==Array&&(t.addr=a.newBuffer(t.addr)))),r.addr!=null&&r.hasOwnProperty("addr")&&(t.addr=e.bytes===String?a.base64.encode(r.addr,0,r.addr.length):e.bytes===Array?Array.prototype.slice.call(r.addr):r.addr),r.proto&&r.proto.length){t.proto=[];for(var i=0;i<r.proto.length;++i)t.proto[i]=r.proto[i]}return t},o.prototype.toJSON=function(){return this.constructor.toObject(this,b.default.util.toJSONOptions)},o})(),jt=f.ErrorResponse=(()=>{function o(n){if(n)for(var r=Object.keys(n),e=0;e<r.length;++e)n[r[e]]!=null&&(this[r[e]]=n[r[e]])}return o.prototype.msg="",o.encode=function(r,e){return e||(e=w.create()),e.uint32(10).string(r.msg),e},o.decode=function(r,e){r instanceof h||(r=h.create(r));for(var t=e===void 0?r.len:r.pos+e,i=new f.ErrorResponse;r.pos<t;){var s=r.uint32();switch(s>>>3){case 1:i.msg=r.string();break;default:r.skipType(s&7);break}}if(!i.hasOwnProperty("msg"))throw a.ProtocolError("missing required 'msg'",{instance:i});return i},o.fromObject=function(r){if(r instanceof f.ErrorResponse)return r;var e=new f.ErrorResponse;return r.msg!=null&&(e.msg=String(r.msg)),e},o.toObject=function(r,e){e||(e={});var t={};return e.defaults&&(t.msg=""),r.msg!=null&&r.hasOwnProperty("msg")&&(t.msg=r.msg),t},o.prototype.toJSON=function(){return this.constructor.toObject(this,b.default.util.toJSONOptions)},o})(),Rt=f.StreamInfo=(()=>{function o(n){if(n)for(var r=Object.keys(n),e=0;e<r.length;++e)n[r[e]]!=null&&(this[r[e]]=n[r[e]])}return o.prototype.peer=a.newBuffer([]),o.prototype.addr=a.newBuffer([]),o.prototype.proto="",o.encode=function(r,e){return e||(e=w.create()),e.uint32(10).bytes(r.peer),e.uint32(18).bytes(r.addr),e.uint32(26).string(r.proto),e},o.decode=function(r,e){r instanceof h||(r=h.create(r));for(var t=e===void 0?r.len:r.pos+e,i=new f.StreamInfo;r.pos<t;){var s=r.uint32();switch(s>>>3){case 1:i.peer=r.bytes();break;case 2:i.addr=r.bytes();break;case 3:i.proto=r.string();break;default:r.skipType(s&7);break}}if(!i.hasOwnProperty("peer"))throw a.ProtocolError("missing required 'peer'",{instance:i});if(!i.hasOwnProperty("addr"))throw a.ProtocolError("missing required 'addr'",{instance:i});if(!i.hasOwnProperty("proto"))throw a.ProtocolError("missing required 'proto'",{instance:i});return i},o.fromObject=function(r){if(r instanceof f.StreamInfo)return r;var e=new f.StreamInfo;return r.peer!=null&&(typeof r.peer=="string"?a.base64.decode(r.peer,e.peer=a.newBuffer(a.base64.length(r.peer)),0):r.peer.length&&(e.peer=r.peer)),r.addr!=null&&(typeof r.addr=="string"?a.base64.decode(r.addr,e.addr=a.newBuffer(a.base64.length(r.addr)),0):r.addr.length&&(e.addr=r.addr)),r.proto!=null&&(e.proto=String(r.proto)),e},o.toObject=function(r,e){e||(e={});var t={};return e.defaults&&(e.bytes===String?t.peer="":(t.peer=[],e.bytes!==Array&&(t.peer=a.newBuffer(t.peer))),e.bytes===String?t.addr="":(t.addr=[],e.bytes!==Array&&(t.addr=a.newBuffer(t.addr))),t.proto=""),r.peer!=null&&r.hasOwnProperty("peer")&&(t.peer=e.bytes===String?a.base64.encode(r.peer,0,r.peer.length):e.bytes===Array?Array.prototype.slice.call(r.peer):r.peer),r.addr!=null&&r.hasOwnProperty("addr")&&(t.addr=e.bytes===String?a.base64.encode(r.addr,0,r.addr.length):e.bytes===Array?Array.prototype.slice.call(r.addr):r.addr),r.proto!=null&&r.hasOwnProperty("proto")&&(t.proto=r.proto),t},o.prototype.toJSON=function(){return this.constructor.toObject(this,b.default.util.toJSONOptions)},o})(),vt=f.DHTRequest=(()=>{function o(r){if(r)for(var e=Object.keys(r),t=0;t<e.length;++t)r[e[t]]!=null&&(this[e[t]]=r[e[t]])}o.prototype.type=0,o.prototype.peer=null,o.prototype.cid=null,o.prototype.key=null,o.prototype.value=null,o.prototype.count=null,o.prototype.timeout=null;let n;return Object.defineProperty(o.prototype,"_peer",{get:a.oneOfGetter(n=["peer"]),set:a.oneOfSetter(n)}),Object.defineProperty(o.prototype,"_cid",{get:a.oneOfGetter(n=["cid"]),set:a.oneOfSetter(n)}),Object.defineProperty(o.prototype,"_key",{get:a.oneOfGetter(n=["key"]),set:a.oneOfSetter(n)}),Object.defineProperty(o.prototype,"_value",{get:a.oneOfGetter(n=["value"]),set:a.oneOfSetter(n)}),Object.defineProperty(o.prototype,"_count",{get:a.oneOfGetter(n=["count"]),set:a.oneOfSetter(n)}),Object.defineProperty(o.prototype,"_timeout",{get:a.oneOfGetter(n=["timeout"]),set:a.oneOfSetter(n)}),o.encode=function(e,t){return t||(t=w.create()),t.uint32(8).int32(e.type),e.peer!=null&&Object.hasOwnProperty.call(e,"peer")&&t.uint32(18).bytes(e.peer),e.cid!=null&&Object.hasOwnProperty.call(e,"cid")&&t.uint32(26).bytes(e.cid),e.key!=null&&Object.hasOwnProperty.call(e,"key")&&t.uint32(34).bytes(e.key),e.value!=null&&Object.hasOwnProperty.call(e,"value")&&t.uint32(42).bytes(e.value),e.count!=null&&Object.hasOwnProperty.call(e,"count")&&t.uint32(48).int32(e.count),e.timeout!=null&&Object.hasOwnProperty.call(e,"timeout")&&t.uint32(56).int64(e.timeout),t},o.decode=function(e,t){e instanceof h||(e=h.create(e));for(var i=t===void 0?e.len:e.pos+t,s=new f.DHTRequest;e.pos<i;){var c=e.uint32();switch(c>>>3){case 1:s.type=e.int32();break;case 2:s.peer=e.bytes();break;case 3:s.cid=e.bytes();break;case 4:s.key=e.bytes();break;case 5:s.value=e.bytes();break;case 6:s.count=e.int32();break;case 7:s.timeout=e.int64();break;default:e.skipType(c&7);break}}if(!s.hasOwnProperty("type"))throw a.ProtocolError("missing required 'type'",{instance:s});return s},o.fromObject=function(e){if(e instanceof f.DHTRequest)return e;var t=new f.DHTRequest;switch(e.type){case"FIND_PEER":case 0:t.type=0;break;case"FIND_PEERS_CONNECTED_TO_PEER":case 1:t.type=1;break;case"FIND_PROVIDERS":case 2:t.type=2;break;case"GET_CLOSEST_PEERS":case 3:t.type=3;break;case"GET_PUBLIC_KEY":case 4:t.type=4;break;case"GET_VALUE":case 5:t.type=5;break;case"SEARCH_VALUE":case 6:t.type=6;break;case"PUT_VALUE":case 7:t.type=7;break;case"PROVIDE":case 8:t.type=8;break}return e.peer!=null&&(typeof e.peer=="string"?a.base64.decode(e.peer,t.peer=a.newBuffer(a.base64.length(e.peer)),0):e.peer.length&&(t.peer=e.peer)),e.cid!=null&&(typeof e.cid=="string"?a.base64.decode(e.cid,t.cid=a.newBuffer(a.base64.length(e.cid)),0):e.cid.length&&(t.cid=e.cid)),e.key!=null&&(typeof e.key=="string"?a.base64.decode(e.key,t.key=a.newBuffer(a.base64.length(e.key)),0):e.key.length&&(t.key=e.key)),e.value!=null&&(typeof e.value=="string"?a.base64.decode(e.value,t.value=a.newBuffer(a.base64.length(e.value)),0):e.value.length&&(t.value=e.value)),e.count!=null&&(t.count=e.count|0),e.timeout!=null&&(a.Long?(t.timeout=a.Long.fromValue(e.timeout)).unsigned=!1:typeof e.timeout=="string"?t.timeout=parseInt(e.timeout,10):typeof e.timeout=="number"?t.timeout=e.timeout:typeof e.timeout=="object"&&(t.timeout=new a.LongBits(e.timeout.low>>>0,e.timeout.high>>>0).toNumber())),t},o.toObject=function(e,t){t||(t={});var i={};return t.defaults&&(i.type=t.enums===String?"FIND_PEER":0),e.type!=null&&e.hasOwnProperty("type")&&(i.type=t.enums===String?f.DHTRequest.Type[e.type]:e.type),e.peer!=null&&e.hasOwnProperty("peer")&&(i.peer=t.bytes===String?a.base64.encode(e.peer,0,e.peer.length):t.bytes===Array?Array.prototype.slice.call(e.peer):e.peer,t.oneofs&&(i._peer="peer")),e.cid!=null&&e.hasOwnProperty("cid")&&(i.cid=t.bytes===String?a.base64.encode(e.cid,0,e.cid.length):t.bytes===Array?Array.prototype.slice.call(e.cid):e.cid,t.oneofs&&(i._cid="cid")),e.key!=null&&e.hasOwnProperty("key")&&(i.key=t.bytes===String?a.base64.encode(e.key,0,e.key.length):t.bytes===Array?Array.prototype.slice.call(e.key):e.key,t.oneofs&&(i._key="key")),e.value!=null&&e.hasOwnProperty("value")&&(i.value=t.bytes===String?a.base64.encode(e.value,0,e.value.length):t.bytes===Array?Array.prototype.slice.call(e.value):e.value,t.oneofs&&(i._value="value")),e.count!=null&&e.hasOwnProperty("count")&&(i.count=e.count,t.oneofs&&(i._count="count")),e.timeout!=null&&e.hasOwnProperty("timeout")&&(typeof e.timeout=="number"?i.timeout=t.longs===String?String(e.timeout):e.timeout:i.timeout=t.longs===String?a.Long.prototype.toString.call(e.timeout):t.longs===Number?new a.LongBits(e.timeout.low>>>0,e.timeout.high>>>0).toNumber():e.timeout,t.oneofs&&(i._timeout="timeout")),i},o.prototype.toJSON=function(){return this.constructor.toObject(this,b.default.util.toJSONOptions)},o.Type=function(){let r={},e=Object.create(r);return e[r[0]="FIND_PEER"]=0,e[r[1]="FIND_PEERS_CONNECTED_TO_PEER"]=1,e[r[2]="FIND_PROVIDERS"]=2,e[r[3]="GET_CLOSEST_PEERS"]=3,e[r[4]="GET_PUBLIC_KEY"]=4,e[r[5]="GET_VALUE"]=5,e[r[6]="SEARCH_VALUE"]=6,e[r[7]="PUT_VALUE"]=7,e[r[8]="PROVIDE"]=8,e}(),o})(),Et=f.DHTResponse=(()=>{function o(r){if(r)for(var e=Object.keys(r),t=0;t<e.length;++t)r[e[t]]!=null&&(this[e[t]]=r[e[t]])}o.prototype.type=0,o.prototype.peer=null,o.prototype.value=null;let n;return Object.defineProperty(o.prototype,"_peer",{get:a.oneOfGetter(n=["peer"]),set:a.oneOfSetter(n)}),Object.defineProperty(o.prototype,"_value",{get:a.oneOfGetter(n=["value"]),set:a.oneOfSetter(n)}),o.encode=function(e,t){return t||(t=w.create()),t.uint32(8).int32(e.type),e.peer!=null&&Object.hasOwnProperty.call(e,"peer")&&f.PeerInfo.encode(e.peer,t.uint32(18).fork()).ldelim(),e.value!=null&&Object.hasOwnProperty.call(e,"value")&&t.uint32(26).bytes(e.value),t},o.decode=function(e,t){e instanceof h||(e=h.create(e));for(var i=t===void 0?e.len:e.pos+t,s=new f.DHTResponse;e.pos<i;){var c=e.uint32();switch(c>>>3){case 1:s.type=e.int32();break;case 2:s.peer=f.PeerInfo.decode(e,e.uint32());break;case 3:s.value=e.bytes();break;default:e.skipType(c&7);break}}if(!s.hasOwnProperty("type"))throw a.ProtocolError("missing required 'type'",{instance:s});return s},o.fromObject=function(e){if(e instanceof f.DHTResponse)return e;var t=new f.DHTResponse;switch(e.type){case"BEGIN":case 0:t.type=0;break;case"VALUE":case 1:t.type=1;break;case"END":case 2:t.type=2;break}if(e.peer!=null){if(typeof e.peer!="object")throw TypeError(".DHTResponse.peer: object expected");t.peer=f.PeerInfo.fromObject(e.peer)}return e.value!=null&&(typeof e.value=="string"?a.base64.decode(e.value,t.value=a.newBuffer(a.base64.length(e.value)),0):e.value.length&&(t.value=e.value)),t},o.toObject=function(e,t){t||(t={});var i={};return t.defaults&&(i.type=t.enums===String?"BEGIN":0),e.type!=null&&e.hasOwnProperty("type")&&(i.type=t.enums===String?f.DHTResponse.Type[e.type]:e.type),e.peer!=null&&e.hasOwnProperty("peer")&&(i.peer=f.PeerInfo.toObject(e.peer,t),t.oneofs&&(i._peer="peer")),e.value!=null&&e.hasOwnProperty("value")&&(i.value=t.bytes===String?a.base64.encode(e.value,0,e.value.length):t.bytes===Array?Array.prototype.slice.call(e.value):e.value,t.oneofs&&(i._value="value")),i},o.prototype.toJSON=function(){return this.constructor.toObject(this,b.default.util.toJSONOptions)},o.Type=function(){let r={},e=Object.create(r);return e[r[0]="BEGIN"]=0,e[r[1]="VALUE"]=1,e[r[2]="END"]=2,e}(),o})(),kt=f.PeerInfo=(()=>{function o(n){if(this.addrs=[],n)for(var r=Object.keys(n),e=0;e<r.length;++e)n[r[e]]!=null&&(this[r[e]]=n[r[e]])}return o.prototype.id=a.newBuffer([]),o.prototype.addrs=a.emptyArray,o.encode=function(r,e){if(e||(e=w.create()),e.uint32(10).bytes(r.id),r.addrs!=null&&r.addrs.length)for(var t=0;t<r.addrs.length;++t)e.uint32(18).bytes(r.addrs[t]);return e},o.decode=function(r,e){r instanceof h||(r=h.create(r));for(var t=e===void 0?r.len:r.pos+e,i=new f.PeerInfo;r.pos<t;){var s=r.uint32();switch(s>>>3){case 1:i.id=r.bytes();break;case 2:i.addrs&&i.addrs.length||(i.addrs=[]),i.addrs.push(r.bytes());break;default:r.skipType(s&7);break}}if(!i.hasOwnProperty("id"))throw a.ProtocolError("missing required 'id'",{instance:i});return i},o.fromObject=function(r){if(r instanceof f.PeerInfo)return r;var e=new f.PeerInfo;if(r.id!=null&&(typeof r.id=="string"?a.base64.decode(r.id,e.id=a.newBuffer(a.base64.length(r.id)),0):r.id.length&&(e.id=r.id)),r.addrs){if(!Array.isArray(r.addrs))throw TypeError(".PeerInfo.addrs: array expected");e.addrs=[];for(var t=0;t<r.addrs.length;++t)typeof r.addrs[t]=="string"?a.base64.decode(r.addrs[t],e.addrs[t]=a.newBuffer(a.base64.length(r.addrs[t])),0):r.addrs[t].length&&(e.addrs[t]=r.addrs[t])}return e},o.toObject=function(r,e){e||(e={});var t={};if((e.arrays||e.defaults)&&(t.addrs=[]),e.defaults&&(e.bytes===String?t.id="":(t.id=[],e.bytes!==Array&&(t.id=a.newBuffer(t.id)))),r.id!=null&&r.hasOwnProperty("id")&&(t.id=e.bytes===String?a.base64.encode(r.id,0,r.id.length):e.bytes===Array?Array.prototype.slice.call(r.id):r.id),r.addrs&&r.addrs.length){t.addrs=[];for(var i=0;i<r.addrs.length;++i)t.addrs[i]=e.bytes===String?a.base64.encode(r.addrs[i],0,r.addrs[i].length):e.bytes===Array?Array.prototype.slice.call(r.addrs[i]):r.addrs[i]}return t},o.prototype.toJSON=function(){return this.constructor.toObject(this,b.default.util.toJSONOptions)},o})(),It=f.ConnManagerRequest=(()=>{function o(r){if(r)for(var e=Object.keys(r),t=0;t<e.length;++t)r[e[t]]!=null&&(this[e[t]]=r[e[t]])}o.prototype.type=0,o.prototype.peer=null,o.prototype.tag=null,o.prototype.weight=null;let n;return Object.defineProperty(o.prototype,"_peer",{get:a.oneOfGetter(n=["peer"]),set:a.oneOfSetter(n)}),Object.defineProperty(o.prototype,"_tag",{get:a.oneOfGetter(n=["tag"]),set:a.oneOfSetter(n)}),Object.defineProperty(o.prototype,"_weight",{get:a.oneOfGetter(n=["weight"]),set:a.oneOfSetter(n)}),o.encode=function(e,t){return t||(t=w.create()),t.uint32(8).int32(e.type),e.peer!=null&&Object.hasOwnProperty.call(e,"peer")&&t.uint32(18).bytes(e.peer),e.tag!=null&&Object.hasOwnProperty.call(e,"tag")&&t.uint32(26).string(e.tag),e.weight!=null&&Object.hasOwnProperty.call(e,"weight")&&t.uint32(32).int64(e.weight),t},o.decode=function(e,t){e instanceof h||(e=h.create(e));for(var i=t===void 0?e.len:e.pos+t,s=new f.ConnManagerRequest;e.pos<i;){var c=e.uint32();switch(c>>>3){case 1:s.type=e.int32();break;case 2:s.peer=e.bytes();break;case 3:s.tag=e.string();break;case 4:s.weight=e.int64();break;default:e.skipType(c&7);break}}if(!s.hasOwnProperty("type"))throw a.ProtocolError("missing required 'type'",{instance:s});return s},o.fromObject=function(e){if(e instanceof f.ConnManagerRequest)return e;var t=new f.ConnManagerRequest;switch(e.type){case"TAG_PEER":case 0:t.type=0;break;case"UNTAG_PEER":case 1:t.type=1;break;case"TRIM":case 2:t.type=2;break}return e.peer!=null&&(typeof e.peer=="string"?a.base64.decode(e.peer,t.peer=a.newBuffer(a.base64.length(e.peer)),0):e.peer.length&&(t.peer=e.peer)),e.tag!=null&&(t.tag=String(e.tag)),e.weight!=null&&(a.Long?(t.weight=a.Long.fromValue(e.weight)).unsigned=!1:typeof e.weight=="string"?t.weight=parseInt(e.weight,10):typeof e.weight=="number"?t.weight=e.weight:typeof e.weight=="object"&&(t.weight=new a.LongBits(e.weight.low>>>0,e.weight.high>>>0).toNumber())),t},o.toObject=function(e,t){t||(t={});var i={};return t.defaults&&(i.type=t.enums===String?"TAG_PEER":0),e.type!=null&&e.hasOwnProperty("type")&&(i.type=t.enums===String?f.ConnManagerRequest.Type[e.type]:e.type),e.peer!=null&&e.hasOwnProperty("peer")&&(i.peer=t.bytes===String?a.base64.encode(e.peer,0,e.peer.length):t.bytes===Array?Array.prototype.slice.call(e.peer):e.peer,t.oneofs&&(i._peer="peer")),e.tag!=null&&e.hasOwnProperty("tag")&&(i.tag=e.tag,t.oneofs&&(i._tag="tag")),e.weight!=null&&e.hasOwnProperty("weight")&&(typeof e.weight=="number"?i.weight=t.longs===String?String(e.weight):e.weight:i.weight=t.longs===String?a.Long.prototype.toString.call(e.weight):t.longs===Number?new a.LongBits(e.weight.low>>>0,e.weight.high>>>0).toNumber():e.weight,t.oneofs&&(i._weight="weight")),i},o.prototype.toJSON=function(){return this.constructor.toObject(this,b.default.util.toJSONOptions)},o.Type=function(){let r={},e=Object.create(r);return e[r[0]="TAG_PEER"]=0,e[r[1]="UNTAG_PEER"]=1,e[r[2]="TRIM"]=2,e}(),o})(),qt=f.DisconnectRequest=(()=>{function o(n){if(n)for(var r=Object.keys(n),e=0;e<r.length;++e)n[r[e]]!=null&&(this[r[e]]=n[r[e]])}return o.prototype.peer=a.newBuffer([]),o.encode=function(r,e){return e||(e=w.create()),e.uint32(10).bytes(r.peer),e},o.decode=function(r,e){r instanceof h||(r=h.create(r));for(var t=e===void 0?r.len:r.pos+e,i=new f.DisconnectRequest;r.pos<t;){var s=r.uint32();switch(s>>>3){case 1:i.peer=r.bytes();break;default:r.skipType(s&7);break}}if(!i.hasOwnProperty("peer"))throw a.ProtocolError("missing required 'peer'",{instance:i});return i},o.fromObject=function(r){if(r instanceof f.DisconnectRequest)return r;var e=new f.DisconnectRequest;return r.peer!=null&&(typeof r.peer=="string"?a.base64.decode(r.peer,e.peer=a.newBuffer(a.base64.length(r.peer)),0):r.peer.length&&(e.peer=r.peer)),e},o.toObject=function(r,e){e||(e={});var t={};return e.defaults&&(e.bytes===String?t.peer="":(t.peer=[],e.bytes!==Array&&(t.peer=a.newBuffer(t.peer)))),r.peer!=null&&r.hasOwnProperty("peer")&&(t.peer=e.bytes===String?a.base64.encode(r.peer,0,r.peer.length):e.bytes===Array?Array.prototype.slice.call(r.peer):r.peer),t},o.prototype.toJSON=function(){return this.constructor.toObject(this,b.default.util.toJSONOptions)},o})(),At=f.PSRequest=(()=>{function o(r){if(r)for(var e=Object.keys(r),t=0;t<e.length;++t)r[e[t]]!=null&&(this[e[t]]=r[e[t]])}o.prototype.type=0,o.prototype.topic=null,o.prototype.data=null;let n;return Object.defineProperty(o.prototype,"_topic",{get:a.oneOfGetter(n=["topic"]),set:a.oneOfSetter(n)}),Object.defineProperty(o.prototype,"_data",{get:a.oneOfGetter(n=["data"]),set:a.oneOfSetter(n)}),o.encode=function(e,t){return t||(t=w.create()),t.uint32(8).int32(e.type),e.topic!=null&&Object.hasOwnProperty.call(e,"topic")&&t.uint32(18).string(e.topic),e.data!=null&&Object.hasOwnProperty.call(e,"data")&&t.uint32(26).bytes(e.data),t},o.decode=function(e,t){e instanceof h||(e=h.create(e));for(var i=t===void 0?e.len:e.pos+t,s=new f.PSRequest;e.pos<i;){var c=e.uint32();switch(c>>>3){case 1:s.type=e.int32();break;case 2:s.topic=e.string();break;case 3:s.data=e.bytes();break;default:e.skipType(c&7);break}}if(!s.hasOwnProperty("type"))throw a.ProtocolError("missing required 'type'",{instance:s});return s},o.fromObject=function(e){if(e instanceof f.PSRequest)return e;var t=new f.PSRequest;switch(e.type){case"GET_TOPICS":case 0:t.type=0;break;case"LIST_PEERS":case 1:t.type=1;break;case"PUBLISH":case 2:t.type=2;break;case"SUBSCRIBE":case 3:t.type=3;break}return e.topic!=null&&(t.topic=String(e.topic)),e.data!=null&&(typeof e.data=="string"?a.base64.decode(e.data,t.data=a.newBuffer(a.base64.length(e.data)),0):e.data.length&&(t.data=e.data)),t},o.toObject=function(e,t){t||(t={});var i={};return t.defaults&&(i.type=t.enums===String?"GET_TOPICS":0),e.type!=null&&e.hasOwnProperty("type")&&(i.type=t.enums===String?f.PSRequest.Type[e.type]:e.type),e.topic!=null&&e.hasOwnProperty("topic")&&(i.topic=e.topic,t.oneofs&&(i._topic="topic")),e.data!=null&&e.hasOwnProperty("data")&&(i.data=t.bytes===String?a.base64.encode(e.data,0,e.data.length):t.bytes===Array?Array.prototype.slice.call(e.data):e.data,t.oneofs&&(i._data="data")),i},o.prototype.toJSON=function(){return this.constructor.toObject(this,b.default.util.toJSONOptions)},o.Type=function(){let r={},e=Object.create(r);return e[r[0]="GET_TOPICS"]=0,e[r[1]="LIST_PEERS"]=1,e[r[2]="PUBLISH"]=2,e[r[3]="SUBSCRIBE"]=3,e}(),o})(),Bt=f.PSMessage=(()=>{function o(r){if(this.topicIDs=[],r)for(var e=Object.keys(r),t=0;t<e.length;++t)r[e[t]]!=null&&(this[e[t]]=r[e[t]])}o.prototype.from=null,o.prototype.data=null,o.prototype.seqno=null,o.prototype.topicIDs=a.emptyArray,o.prototype.signature=null,o.prototype.key=null;let n;return Object.defineProperty(o.prototype,"_from",{get:a.oneOfGetter(n=["from"]),set:a.oneOfSetter(n)}),Object.defineProperty(o.prototype,"_data",{get:a.oneOfGetter(n=["data"]),set:a.oneOfSetter(n)}),Object.defineProperty(o.prototype,"_seqno",{get:a.oneOfGetter(n=["seqno"]),set:a.oneOfSetter(n)}),Object.defineProperty(o.prototype,"_signature",{get:a.oneOfGetter(n=["signature"]),set:a.oneOfSetter(n)}),Object.defineProperty(o.prototype,"_key",{get:a.oneOfGetter(n=["key"]),set:a.oneOfSetter(n)}),o.encode=function(e,t){if(t||(t=w.create()),e.from!=null&&Object.hasOwnProperty.call(e,"from")&&t.uint32(10).bytes(e.from),e.data!=null&&Object.hasOwnProperty.call(e,"data")&&t.uint32(18).bytes(e.data),e.seqno!=null&&Object.hasOwnProperty.call(e,"seqno")&&t.uint32(26).bytes(e.seqno),e.topicIDs!=null&&e.topicIDs.length)for(var i=0;i<e.topicIDs.length;++i)t.uint32(34).string(e.topicIDs[i]);return e.signature!=null&&Object.hasOwnProperty.call(e,"signature")&&t.uint32(42).bytes(e.signature),e.key!=null&&Object.hasOwnProperty.call(e,"key")&&t.uint32(50).bytes(e.key),t},o.decode=function(e,t){e instanceof h||(e=h.create(e));for(var i=t===void 0?e.len:e.pos+t,s=new f.PSMessage;e.pos<i;){var c=e.uint32();switch(c>>>3){case 1:s.from=e.bytes();break;case 2:s.data=e.bytes();break;case 3:s.seqno=e.bytes();break;case 4:s.topicIDs&&s.topicIDs.length||(s.topicIDs=[]),s.topicIDs.push(e.string());break;case 5:s.signature=e.bytes();break;case 6:s.key=e.bytes();break;default:e.skipType(c&7);break}}return s},o.fromObject=function(e){if(e instanceof f.PSMessage)return e;var t=new f.PSMessage;if(e.from!=null&&(typeof e.from=="string"?a.base64.decode(e.from,t.from=a.newBuffer(a.base64.length(e.from)),0):e.from.length&&(t.from=e.from)),e.data!=null&&(typeof e.data=="string"?a.base64.decode(e.data,t.data=a.newBuffer(a.base64.length(e.data)),0):e.data.length&&(t.data=e.data)),e.seqno!=null&&(typeof e.seqno=="string"?a.base64.decode(e.seqno,t.seqno=a.newBuffer(a.base64.length(e.seqno)),0):e.seqno.length&&(t.seqno=e.seqno)),e.topicIDs){if(!Array.isArray(e.topicIDs))throw TypeError(".PSMessage.topicIDs: array expected");t.topicIDs=[];for(var i=0;i<e.topicIDs.length;++i)t.topicIDs[i]=String(e.topicIDs[i])}return e.signature!=null&&(typeof e.signature=="string"?a.base64.decode(e.signature,t.signature=a.newBuffer(a.base64.length(e.signature)),0):e.signature.length&&(t.signature=e.signature)),e.key!=null&&(typeof e.key=="string"?a.base64.decode(e.key,t.key=a.newBuffer(a.base64.length(e.key)),0):e.key.length&&(t.key=e.key)),t},o.toObject=function(e,t){t||(t={});var i={};if((t.arrays||t.defaults)&&(i.topicIDs=[]),e.from!=null&&e.hasOwnProperty("from")&&(i.from=t.bytes===String?a.base64.encode(e.from,0,e.from.length):t.bytes===Array?Array.prototype.slice.call(e.from):e.from,t.oneofs&&(i._from="from")),e.data!=null&&e.hasOwnProperty("data")&&(i.data=t.bytes===String?a.base64.encode(e.data,0,e.data.length):t.bytes===Array?Array.prototype.slice.call(e.data):e.data,t.oneofs&&(i._data="data")),e.seqno!=null&&e.hasOwnProperty("seqno")&&(i.seqno=t.bytes===String?a.base64.encode(e.seqno,0,e.seqno.length):t.bytes===Array?Array.prototype.slice.call(e.seqno):e.seqno,t.oneofs&&(i._seqno="seqno")),e.topicIDs&&e.topicIDs.length){i.topicIDs=[];for(var s=0;s<e.topicIDs.length;++s)i.topicIDs[s]=e.topicIDs[s]}return e.signature!=null&&e.hasOwnProperty("signature")&&(i.signature=t.bytes===String?a.base64.encode(e.signature,0,e.signature.length):t.bytes===Array?Array.prototype.slice.call(e.signature):e.signature,t.oneofs&&(i._signature="signature")),e.key!=null&&e.hasOwnProperty("key")&&(i.key=t.bytes===String?a.base64.encode(e.key,0,e.key.length):t.bytes===Array?Array.prototype.slice.call(e.key):e.key,t.oneofs&&(i._key="key")),i},o.prototype.toJSON=function(){return this.constructor.toObject(this,b.default.util.toJSONOptions)},o})(),Dt=f.PSResponse=(()=>{function o(n){if(this.topics=[],this.peerIDs=[],n)for(var r=Object.keys(n),e=0;e<r.length;++e)n[r[e]]!=null&&(this[r[e]]=n[r[e]])}return o.prototype.topics=a.emptyArray,o.prototype.peerIDs=a.emptyArray,o.encode=function(r,e){if(e||(e=w.create()),r.topics!=null&&r.topics.length)for(var t=0;t<r.topics.length;++t)e.uint32(10).string(r.topics[t]);if(r.peerIDs!=null&&r.peerIDs.length)for(var t=0;t<r.peerIDs.length;++t)e.uint32(18).bytes(r.peerIDs[t]);return e},o.decode=function(r,e){r instanceof h||(r=h.create(r));for(var t=e===void 0?r.len:r.pos+e,i=new f.PSResponse;r.pos<t;){var s=r.uint32();switch(s>>>3){case 1:i.topics&&i.topics.length||(i.topics=[]),i.topics.push(r.string());break;case 2:i.peerIDs&&i.peerIDs.length||(i.peerIDs=[]),i.peerIDs.push(r.bytes());break;default:r.skipType(s&7);break}}return i},o.fromObject=function(r){if(r instanceof f.PSResponse)return r;var e=new f.PSResponse;if(r.topics){if(!Array.isArray(r.topics))throw TypeError(".PSResponse.topics: array expected");e.topics=[];for(var t=0;t<r.topics.length;++t)e.topics[t]=String(r.topics[t])}if(r.peerIDs){if(!Array.isArray(r.peerIDs))throw TypeError(".PSResponse.peerIDs: array expected");e.peerIDs=[];for(var t=0;t<r.peerIDs.length;++t)typeof r.peerIDs[t]=="string"?a.base64.decode(r.peerIDs[t],e.peerIDs[t]=a.newBuffer(a.base64.length(r.peerIDs[t])),0):r.peerIDs[t].length&&(e.peerIDs[t]=r.peerIDs[t])}return e},o.toObject=function(r,e){e||(e={});var t={};if((e.arrays||e.defaults)&&(t.topics=[],t.peerIDs=[]),r.topics&&r.topics.length){t.topics=[];for(var i=0;i<r.topics.length;++i)t.topics[i]=r.topics[i]}if(r.peerIDs&&r.peerIDs.length){t.peerIDs=[];for(var i=0;i<r.peerIDs.length;++i)t.peerIDs[i]=e.bytes===String?a.base64.encode(r.peerIDs[i],0,r.peerIDs[i].length):e.bytes===Array?Array.prototype.slice.call(r.peerIDs[i]):r.peerIDs[i]}return t},o.prototype.toJSON=function(){return this.constructor.toObject(this,b.default.util.toJSONOptions)},o})(),Tt=f.PeerstoreRequest=(()=>{function o(r){if(this.protos=[],r)for(var e=Object.keys(r),t=0;t<e.length;++t)r[e[t]]!=null&&(this[e[t]]=r[e[t]])}o.prototype.type=1,o.prototype.id=null,o.prototype.protos=a.emptyArray;let n;return Object.defineProperty(o.prototype,"_id",{get:a.oneOfGetter(n=["id"]),set:a.oneOfSetter(n)}),o.encode=function(e,t){if(t||(t=w.create()),t.uint32(8).int32(e.type),e.id!=null&&Object.hasOwnProperty.call(e,"id")&&t.uint32(18).bytes(e.id),e.protos!=null&&e.protos.length)for(var i=0;i<e.protos.length;++i)t.uint32(26).string(e.protos[i]);return t},o.decode=function(e,t){e instanceof h||(e=h.create(e));for(var i=t===void 0?e.len:e.pos+t,s=new f.PeerstoreRequest;e.pos<i;){var c=e.uint32();switch(c>>>3){case 1:s.type=e.int32();break;case 2:s.id=e.bytes();break;case 3:s.protos&&s.protos.length||(s.protos=[]),s.protos.push(e.string());break;default:e.skipType(c&7);break}}if(!s.hasOwnProperty("type"))throw a.ProtocolError("missing required 'type'",{instance:s});return s},o.fromObject=function(e){if(e instanceof f.PeerstoreRequest)return e;var t=new f.PeerstoreRequest;switch(e.type){case"GET_PROTOCOLS":case 1:t.type=1;break;case"GET_PEER_INFO":case 2:t.type=2;break}if(e.id!=null&&(typeof e.id=="string"?a.base64.decode(e.id,t.id=a.newBuffer(a.base64.length(e.id)),0):e.id.length&&(t.id=e.id)),e.protos){if(!Array.isArray(e.protos))throw TypeError(".PeerstoreRequest.protos: array expected");t.protos=[];for(var i=0;i<e.protos.length;++i)t.protos[i]=String(e.protos[i])}return t},o.toObject=function(e,t){t||(t={});var i={};if((t.arrays||t.defaults)&&(i.protos=[]),t.defaults&&(i.type=t.enums===String?"GET_PROTOCOLS":1),e.type!=null&&e.hasOwnProperty("type")&&(i.type=t.enums===String?f.PeerstoreRequest.Type[e.type]:e.type),e.id!=null&&e.hasOwnProperty("id")&&(i.id=t.bytes===String?a.base64.encode(e.id,0,e.id.length):t.bytes===Array?Array.prototype.slice.call(e.id):e.id,t.oneofs&&(i._id="id")),e.protos&&e.protos.length){i.protos=[];for(var s=0;s<e.protos.length;++s)i.protos[s]=e.protos[s]}return i},o.prototype.toJSON=function(){return this.constructor.toObject(this,b.default.util.toJSONOptions)},o.Type=function(){let r={},e=Object.create(r);return e[r[1]="GET_PROTOCOLS"]=1,e[r[2]="GET_PEER_INFO"]=2,e}(),o})(),Nt=f.PeerstoreResponse=(()=>{function o(r){if(this.protos=[],r)for(var e=Object.keys(r),t=0;t<e.length;++t)r[e[t]]!=null&&(this[e[t]]=r[e[t]])}o.prototype.peer=null,o.prototype.protos=a.emptyArray;let n;return Object.defineProperty(o.prototype,"_peer",{get:a.oneOfGetter(n=["peer"]),set:a.oneOfSetter(n)}),o.encode=function(e,t){if(t||(t=w.create()),e.peer!=null&&Object.hasOwnProperty.call(e,"peer")&&f.PeerInfo.encode(e.peer,t.uint32(10).fork()).ldelim(),e.protos!=null&&e.protos.length)for(var i=0;i<e.protos.length;++i)t.uint32(18).string(e.protos[i]);return t},o.decode=function(e,t){e instanceof h||(e=h.create(e));for(var i=t===void 0?e.len:e.pos+t,s=new f.PeerstoreResponse;e.pos<i;){var c=e.uint32();switch(c>>>3){case 1:s.peer=f.PeerInfo.decode(e,e.uint32());break;case 2:s.protos&&s.protos.length||(s.protos=[]),s.protos.push(e.string());break;default:e.skipType(c&7);break}}return s},o.fromObject=function(e){if(e instanceof f.PeerstoreResponse)return e;var t=new f.PeerstoreResponse;if(e.peer!=null){if(typeof e.peer!="object")throw TypeError(".PeerstoreResponse.peer: object expected");t.peer=f.PeerInfo.fromObject(e.peer)}if(e.protos){if(!Array.isArray(e.protos))throw TypeError(".PeerstoreResponse.protos: array expected");t.protos=[];for(var i=0;i<e.protos.length;++i)t.protos[i]=String(e.protos[i])}return t},o.toObject=function(e,t){t||(t={});var i={};if((t.arrays||t.defaults)&&(i.protos=[]),e.peer!=null&&e.hasOwnProperty("peer")&&(i.peer=f.PeerInfo.toObject(e.peer,t),t.oneofs&&(i._peer="peer")),e.protos&&e.protos.length){i.protos=[];for(var s=0;s<e.protos.length;++s)i.protos[s]=e.protos[s]}return i},o.prototype.toJSON=function(){return this.constructor.toObject(this,b.default.util.toJSONOptions)},o})();return at(xt);})();
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:()=>Xe,PSRequest:()=>Ae,PSResponse:()=>Ue,PeerInfo:()=>X,PeerstoreRequest:()=>Le,PeerstoreResponse:()=>Ie,Request:()=>Qe,Response:()=>We,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 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 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 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 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 Xe;(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)))(Xe||(Xe={}));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={}));var Qe;(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)})(Qe||(Qe={}));var We;(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)})(We||(We={}));return zt(qr);})();
3
17
  return Libp2PDaemonProtocol}));
@@ -0,0 +1,259 @@
1
+ export interface IdentifyResponse {
2
+ id: Uint8Array;
3
+ addrs: Uint8Array[];
4
+ }
5
+ export declare namespace IdentifyResponse {
6
+ const codec: import("protons-runtime/dist/src/codecs/codec").Codec<IdentifyResponse>;
7
+ const encode: (obj: IdentifyResponse) => Uint8Array;
8
+ const decode: (buf: Uint8Array) => IdentifyResponse;
9
+ }
10
+ export interface ConnectRequest {
11
+ peer: Uint8Array;
12
+ addrs: Uint8Array[];
13
+ timeout?: bigint;
14
+ }
15
+ export declare namespace ConnectRequest {
16
+ const codec: import("protons-runtime/dist/src/codecs/codec").Codec<ConnectRequest>;
17
+ const encode: (obj: ConnectRequest) => Uint8Array;
18
+ const decode: (buf: Uint8Array) => ConnectRequest;
19
+ }
20
+ export interface StreamOpenRequest {
21
+ peer: Uint8Array;
22
+ proto: string[];
23
+ timeout?: bigint;
24
+ }
25
+ export declare namespace StreamOpenRequest {
26
+ const codec: import("protons-runtime/dist/src/codecs/codec").Codec<StreamOpenRequest>;
27
+ const encode: (obj: StreamOpenRequest) => Uint8Array;
28
+ const decode: (buf: Uint8Array) => StreamOpenRequest;
29
+ }
30
+ export interface StreamHandlerRequest {
31
+ addr: Uint8Array;
32
+ proto: string[];
33
+ }
34
+ export declare namespace StreamHandlerRequest {
35
+ const codec: import("protons-runtime/dist/src/codecs/codec").Codec<StreamHandlerRequest>;
36
+ const encode: (obj: StreamHandlerRequest) => Uint8Array;
37
+ const decode: (buf: Uint8Array) => StreamHandlerRequest;
38
+ }
39
+ export interface ErrorResponse {
40
+ msg: string;
41
+ }
42
+ export declare namespace ErrorResponse {
43
+ const codec: import("protons-runtime/dist/src/codecs/codec").Codec<ErrorResponse>;
44
+ const encode: (obj: ErrorResponse) => Uint8Array;
45
+ const decode: (buf: Uint8Array) => ErrorResponse;
46
+ }
47
+ export interface StreamInfo {
48
+ peer: Uint8Array;
49
+ addr: Uint8Array;
50
+ proto: string;
51
+ }
52
+ export declare namespace StreamInfo {
53
+ const codec: import("protons-runtime/dist/src/codecs/codec").Codec<StreamInfo>;
54
+ const encode: (obj: StreamInfo) => Uint8Array;
55
+ const decode: (buf: Uint8Array) => StreamInfo;
56
+ }
57
+ export interface DHTRequest {
58
+ type: DHTRequest.Type;
59
+ peer?: Uint8Array;
60
+ cid?: Uint8Array;
61
+ key?: Uint8Array;
62
+ value?: Uint8Array;
63
+ count?: number;
64
+ timeout?: bigint;
65
+ }
66
+ export declare namespace DHTRequest {
67
+ enum Type {
68
+ FIND_PEER = "FIND_PEER",
69
+ FIND_PEERS_CONNECTED_TO_PEER = "FIND_PEERS_CONNECTED_TO_PEER",
70
+ FIND_PROVIDERS = "FIND_PROVIDERS",
71
+ GET_CLOSEST_PEERS = "GET_CLOSEST_PEERS",
72
+ GET_PUBLIC_KEY = "GET_PUBLIC_KEY",
73
+ GET_VALUE = "GET_VALUE",
74
+ SEARCH_VALUE = "SEARCH_VALUE",
75
+ PUT_VALUE = "PUT_VALUE",
76
+ PROVIDE = "PROVIDE"
77
+ }
78
+ namespace Type {
79
+ const codec: import("protons-runtime/dist/src/codecs/codec").Codec<typeof Type>;
80
+ }
81
+ const codec: import("protons-runtime/dist/src/codecs/codec").Codec<DHTRequest>;
82
+ const encode: (obj: DHTRequest) => Uint8Array;
83
+ const decode: (buf: Uint8Array) => DHTRequest;
84
+ }
85
+ export interface PeerInfo {
86
+ id: Uint8Array;
87
+ addrs: Uint8Array[];
88
+ }
89
+ export declare namespace PeerInfo {
90
+ const codec: import("protons-runtime/dist/src/codecs/codec").Codec<PeerInfo>;
91
+ const encode: (obj: PeerInfo) => Uint8Array;
92
+ const decode: (buf: Uint8Array) => PeerInfo;
93
+ }
94
+ export interface DHTResponse {
95
+ type: DHTResponse.Type;
96
+ peer?: PeerInfo;
97
+ value?: Uint8Array;
98
+ }
99
+ export declare namespace DHTResponse {
100
+ enum Type {
101
+ BEGIN = "BEGIN",
102
+ VALUE = "VALUE",
103
+ END = "END"
104
+ }
105
+ namespace Type {
106
+ const codec: import("protons-runtime/dist/src/codecs/codec").Codec<typeof Type>;
107
+ }
108
+ const codec: import("protons-runtime/dist/src/codecs/codec").Codec<DHTResponse>;
109
+ const encode: (obj: DHTResponse) => Uint8Array;
110
+ const decode: (buf: Uint8Array) => DHTResponse;
111
+ }
112
+ export interface ConnManagerRequest {
113
+ type: ConnManagerRequest.Type;
114
+ peer?: Uint8Array;
115
+ tag?: string;
116
+ weight?: bigint;
117
+ }
118
+ export declare namespace ConnManagerRequest {
119
+ enum Type {
120
+ TAG_PEER = "TAG_PEER",
121
+ UNTAG_PEER = "UNTAG_PEER",
122
+ TRIM = "TRIM"
123
+ }
124
+ namespace Type {
125
+ const codec: import("protons-runtime/dist/src/codecs/codec").Codec<typeof Type>;
126
+ }
127
+ const codec: import("protons-runtime/dist/src/codecs/codec").Codec<ConnManagerRequest>;
128
+ const encode: (obj: ConnManagerRequest) => Uint8Array;
129
+ const decode: (buf: Uint8Array) => ConnManagerRequest;
130
+ }
131
+ export interface DisconnectRequest {
132
+ peer: Uint8Array;
133
+ }
134
+ export declare namespace DisconnectRequest {
135
+ const codec: import("protons-runtime/dist/src/codecs/codec").Codec<DisconnectRequest>;
136
+ const encode: (obj: DisconnectRequest) => Uint8Array;
137
+ const decode: (buf: Uint8Array) => DisconnectRequest;
138
+ }
139
+ export interface PSRequest {
140
+ type: PSRequest.Type;
141
+ topic?: string;
142
+ data?: Uint8Array;
143
+ }
144
+ export declare namespace PSRequest {
145
+ enum Type {
146
+ GET_TOPICS = "GET_TOPICS",
147
+ LIST_PEERS = "LIST_PEERS",
148
+ PUBLISH = "PUBLISH",
149
+ SUBSCRIBE = "SUBSCRIBE"
150
+ }
151
+ namespace Type {
152
+ const codec: import("protons-runtime/dist/src/codecs/codec").Codec<typeof Type>;
153
+ }
154
+ const codec: import("protons-runtime/dist/src/codecs/codec").Codec<PSRequest>;
155
+ const encode: (obj: PSRequest) => Uint8Array;
156
+ const decode: (buf: Uint8Array) => PSRequest;
157
+ }
158
+ export interface PSMessage {
159
+ from?: Uint8Array;
160
+ data?: Uint8Array;
161
+ seqno?: Uint8Array;
162
+ topicIDs: string[];
163
+ signature?: Uint8Array;
164
+ key?: Uint8Array;
165
+ }
166
+ export declare namespace PSMessage {
167
+ const codec: import("protons-runtime/dist/src/codecs/codec").Codec<PSMessage>;
168
+ const encode: (obj: PSMessage) => Uint8Array;
169
+ const decode: (buf: Uint8Array) => PSMessage;
170
+ }
171
+ export interface PSResponse {
172
+ topics: string[];
173
+ peerIDs: Uint8Array[];
174
+ }
175
+ export declare namespace PSResponse {
176
+ const codec: import("protons-runtime/dist/src/codecs/codec").Codec<PSResponse>;
177
+ const encode: (obj: PSResponse) => Uint8Array;
178
+ const decode: (buf: Uint8Array) => PSResponse;
179
+ }
180
+ export interface PeerstoreRequest {
181
+ type: PeerstoreRequest.Type;
182
+ id?: Uint8Array;
183
+ protos: string[];
184
+ }
185
+ export declare namespace PeerstoreRequest {
186
+ enum Type {
187
+ GET_PROTOCOLS = "GET_PROTOCOLS",
188
+ GET_PEER_INFO = "GET_PEER_INFO"
189
+ }
190
+ namespace Type {
191
+ const codec: import("protons-runtime/dist/src/codecs/codec").Codec<typeof Type>;
192
+ }
193
+ const codec: import("protons-runtime/dist/src/codecs/codec").Codec<PeerstoreRequest>;
194
+ const encode: (obj: PeerstoreRequest) => Uint8Array;
195
+ const decode: (buf: Uint8Array) => PeerstoreRequest;
196
+ }
197
+ export interface PeerstoreResponse {
198
+ peer?: PeerInfo;
199
+ protos: string[];
200
+ }
201
+ export declare namespace PeerstoreResponse {
202
+ const codec: import("protons-runtime/dist/src/codecs/codec").Codec<PeerstoreResponse>;
203
+ const encode: (obj: PeerstoreResponse) => Uint8Array;
204
+ const decode: (buf: Uint8Array) => PeerstoreResponse;
205
+ }
206
+ export interface Request {
207
+ type: Request.Type;
208
+ connect?: ConnectRequest;
209
+ streamOpen?: StreamOpenRequest;
210
+ streamHandler?: StreamHandlerRequest;
211
+ dht?: DHTRequest;
212
+ connManager?: ConnManagerRequest;
213
+ disconnect?: DisconnectRequest;
214
+ pubsub?: PSRequest;
215
+ peerStore?: PeerstoreRequest;
216
+ }
217
+ export declare namespace Request {
218
+ enum Type {
219
+ IDENTIFY = "IDENTIFY",
220
+ CONNECT = "CONNECT",
221
+ STREAM_OPEN = "STREAM_OPEN",
222
+ STREAM_HANDLER = "STREAM_HANDLER",
223
+ DHT = "DHT",
224
+ LIST_PEERS = "LIST_PEERS",
225
+ CONNMANAGER = "CONNMANAGER",
226
+ DISCONNECT = "DISCONNECT",
227
+ PUBSUB = "PUBSUB",
228
+ PEERSTORE = "PEERSTORE"
229
+ }
230
+ namespace Type {
231
+ const codec: import("protons-runtime/dist/src/codecs/codec").Codec<typeof Type>;
232
+ }
233
+ const codec: import("protons-runtime/dist/src/codecs/codec").Codec<Request>;
234
+ const encode: (obj: Request) => Uint8Array;
235
+ const decode: (buf: Uint8Array) => Request;
236
+ }
237
+ export interface Response {
238
+ type: Response.Type;
239
+ error?: ErrorResponse;
240
+ streamInfo?: StreamInfo;
241
+ identify?: IdentifyResponse;
242
+ dht?: DHTResponse;
243
+ peers: PeerInfo[];
244
+ pubsub?: PSResponse;
245
+ peerStore?: PeerstoreResponse;
246
+ }
247
+ export declare namespace Response {
248
+ enum Type {
249
+ OK = "OK",
250
+ ERROR = "ERROR"
251
+ }
252
+ namespace Type {
253
+ const codec: import("protons-runtime/dist/src/codecs/codec").Codec<typeof Type>;
254
+ }
255
+ const codec: import("protons-runtime/dist/src/codecs/codec").Codec<Response>;
256
+ const encode: (obj: Response) => Uint8Array;
257
+ const decode: (buf: Uint8Array) => Response;
258
+ }
259
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"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"}