@libp2p/daemon-protocol 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3 @@
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);})();
3
+ return Libp2PDaemonProtocol}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@libp2p/daemon-protocol",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Communication protocol between libp2p daemons and clients",
5
5
  "author": "",
6
6
  "license": "Apache-2.0 OR MIT",
@@ -36,7 +36,7 @@
36
36
  },
37
37
  "files": [
38
38
  "src",
39
- "dist/src",
39
+ "dist",
40
40
  "!dist/test",
41
41
  "!**/*.tsbuildinfo"
42
42
  ],
@@ -143,17 +143,19 @@
143
143
  ]
144
144
  },
145
145
  "scripts": {
146
+ "clean": "aegir clean",
146
147
  "lint": "aegir lint",
147
- "build": "tsc && cp src/*.js src/*.d.ts dist/src",
148
+ "build": "aegir build",
149
+ "postbuild": "cp src/*.js src/*.d.ts dist/src",
148
150
  "generate": "npm run generate:proto && npm run generate:proto-types",
149
151
  "generate:proto": "pbjs -t static-module -w es6 -r libp2p-daemon --force-number --no-verify --no-delimited --no-create --no-beautify --no-defaults --lint eslint-disable -o src/protocol/index.js ./src/protocol/index.proto",
150
152
  "generate:proto-types": "pbts -o src/protocol/index.d.ts src/protocol/index.js",
151
- "release": "semantic-release"
153
+ "release": "aegir release"
152
154
  },
153
155
  "dependencies": {
154
156
  "protobufjs": "^6.10.2"
155
157
  },
156
158
  "devDependencies": {
157
- "aegir": "^36.0.0"
159
+ "aegir": "^37.0.5"
158
160
  }
159
161
  }