@libp2p/daemon-protocol 1.0.3 → 1.0.4
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 +2 -2
- package/dist/src/index.d.ts +25 -25
- package/dist/src/index.d.ts.map +1 -1
- package/package.json +4 -4
package/dist/index.min.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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 Se=Object.defineProperty;var Pt=Object.getOwnPropertyDescriptor;var Vt=Object.getOwnPropertyNames;var _t=Object.prototype.hasOwnProperty;var D=(n,e)=>{for(var t in e)Se(n,t,{get:e[t],enumerable:!0})},Mt=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Vt(e))!_t.call(n,o)&&o!==t&&Se(n,o,{get:()=>e[o],enumerable:!(r=Pt(e,o))||r.enumerable});return n};var zt=n=>Mt(Se({},"__esModule",{value:!0}),n);var qr={};D(qr,{ConnManagerRequest:()=>ye,ConnectRequest:()=>he,DHTRequest:()=>we,DHTResponse:()=>xe,DisconnectRequest:()=>Ee,ErrorResponse:()=>le,IdentifyResponse:()=>ue,PSMessage:()=>We,PSRequest:()=>Ae,PSResponse:()=>Ue,PeerInfo:()=>X,PeerstoreRequest:()=>Le,PeerstoreResponse:()=>Ie,Request:()=>Xe,Response:()=>Qe,StreamHandlerRequest:()=>me,StreamInfo:()=>be,StreamOpenRequest:()=>ge});function De(n,e){e||(e=n.reduce((o,c)=>o+c.length,0));let t=new Uint8Array(e),r=0;for(let o of n)t.set(o,r),r+=o.length;return t}var Re={};D(Re,{identity:()=>Ht});function Ft(n,e){if(n.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var o=0;o<n.length;o++){var c=n.charAt(o),i=c.charCodeAt(0);if(t[i]!==255)throw new TypeError(c+" is ambiguous");t[i]=o}var s=n.length,f=n.charAt(0),g=Math.log(s)/Math.log(256),h=Math.log(256)/Math.log(s);function x(a){if(a instanceof Uint8Array||(ArrayBuffer.isView(a)?a=new Uint8Array(a.buffer,a.byteOffset,a.byteLength):Array.isArray(a)&&(a=Uint8Array.from(a))),!(a instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(a.length===0)return"";for(var b=0,$=0,T=0,R=a.length;T!==R&&a[T]===0;)T++,b++;for(var B=(R-T)*h+1>>>0,S=new Uint8Array(B);T!==R;){for(var v=a[T],F=0,O=B-1;(v!==0||F<$)&&O!==-1;O--,F++)v+=256*S[O]>>>0,S[O]=v%s>>>0,v=v/s>>>0;if(v!==0)throw new Error("Non-zero carry");$=F,T++}for(var _=B-$;_!==B&&S[_]===0;)_++;for(var te=f.repeat(b);_<B;++_)te+=n.charAt(S[_]);return te}function l(a){if(typeof a!="string")throw new TypeError("Expected String");if(a.length===0)return new Uint8Array;var b=0;if(a[b]!==" "){for(var $=0,T=0;a[b]===f;)$++,b++;for(var R=(a.length-b)*g+1>>>0,B=new Uint8Array(R);a[b];){var S=t[a.charCodeAt(b)];if(S===255)return;for(var v=0,F=R-1;(S!==0||v<T)&&F!==-1;F--,v++)S+=s*B[F]>>>0,B[F]=S%256>>>0,S=S/256>>>0;if(S!==0)throw new Error("Non-zero carry");T=v,b++}if(a[b]!==" "){for(var O=R-T;O!==R&&B[O]===0;)O++;for(var _=new Uint8Array($+(R-O)),te=$;O!==R;)_[te++]=B[O++];return _}}}function N(a){var b=l(a);if(b)return b;throw new Error(`Non-${e} character`)}return{encode:x,decodeUnsafe:l,decode:N}}var Gt=Ft,kt=Gt,Ze=kt;var to=new Uint8Array(0);var et=(n,e)=>{if(n===e)return!0;if(n.byteLength!==e.byteLength)return!1;for(let t=0;t<n.byteLength;t++)if(n[t]!==e[t])return!1;return!0},M=n=>{if(n instanceof Uint8Array&&n.constructor.name==="Uint8Array")return n;if(n instanceof ArrayBuffer)return new Uint8Array(n);if(ArrayBuffer.isView(n))return new Uint8Array(n.buffer,n.byteOffset,n.byteLength);throw new Error("Unknown type, must be binary type")};var tt=n=>new TextEncoder().encode(n),nt=n=>new TextDecoder().decode(n);var Ce=class{constructor(e,t,r){this.name=e,this.prefix=t,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},Ne=class{constructor(e,t,r){this.name=e,this.prefix=t,this.baseDecode=r}decode(e){if(typeof e=="string")switch(e[0]){case this.prefix:return this.baseDecode(e.slice(1));default:throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`)}else throw Error("Can only multibase decode strings")}or(e){return ot(this,e)}},Te=class{constructor(e){this.decoders=e}or(e){return ot(this,e)}decode(e){let t=e[0],r=this.decoders[t];if(r)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},ot=(n,e)=>new Te({...n.decoders||{[n.prefix]:n},...e.decoders||{[e.prefix]:e}}),Oe=class{constructor(e,t,r,o){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=o,this.encoder=new Ce(e,t,r),this.decoder=new Ne(e,t,o)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}},ne=({name:n,prefix:e,encode:t,decode:r})=>new Oe(n,e,t,r),G=({prefix:n,name:e,alphabet:t})=>{let{encode:r,decode:o}=Ze(t,e);return ne({prefix:n,name:e,encode:r,decode:c=>M(o(c))})},$t=(n,e,t,r)=>{let o={};for(let h=0;h<e.length;++h)o[e[h]]=h;let c=n.length;for(;n[c-1]==="=";)--c;let i=new Uint8Array(c*t/8|0),s=0,f=0,g=0;for(let h=0;h<c;++h){let x=o[n[h]];if(x===void 0)throw new SyntaxError(`Non-${r} character`);f=f<<t|x,s+=t,s>=8&&(s-=8,i[g++]=255&f>>s)}if(s>=t||255&f<<8-s)throw new SyntaxError("Unexpected end of data");return i},jt=(n,e,t)=>{let r=e[e.length-1]==="=",o=(1<<t)-1,c="",i=0,s=0;for(let f=0;f<n.length;++f)for(s=s<<8|n[f],i+=8;i>t;)i-=t,c+=e[o&s>>i];if(i&&(c+=e[o&s<<t-i]),r)for(;c.length*t&7;)c+="=";return c},y=({name:n,prefix:e,bitsPerChar:t,alphabet:r})=>ne({prefix:e,name:n,encode(o){return jt(o,r,t)},decode(o){return $t(o,r,t,n)}});var Ht=ne({prefix:"\0",name:"identity",encode:n=>nt(n),decode:n=>tt(n)});var Be={};D(Be,{base2:()=>Yt});var Yt=y({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var ve={};D(ve,{base8:()=>Jt});var Jt=y({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Pe={};D(Pe,{base10:()=>Kt});var Kt=G({prefix:"9",name:"base10",alphabet:"0123456789"});var Ve={};D(Ve,{base16:()=>qt,base16upper:()=>Xt});var qt=y({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Xt=y({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var _e={};D(_e,{base32:()=>H,base32hex:()=>en,base32hexpad:()=>nn,base32hexpadupper:()=>rn,base32hexupper:()=>tn,base32pad:()=>Wt,base32padupper:()=>Zt,base32upper:()=>Qt,base32z:()=>on});var H=y({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Qt=y({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Wt=y({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Zt=y({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),en=y({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),tn=y({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),nn=y({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),rn=y({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),on=y({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Me={};D(Me,{base36:()=>cn,base36upper:()=>sn});var cn=G({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),sn=G({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var ze={};D(ze,{base58btc:()=>P,base58flickr:()=>an});var P=G({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),an=G({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Fe={};D(Fe,{base64:()=>dn,base64pad:()=>pn,base64url:()=>fn,base64urlpad:()=>un});var dn=y({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),pn=y({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),fn=y({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),un=y({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var je={};D(je,{sha256:()=>On,sha512:()=>Rn});var hn=st,ct=128,gn=127,mn=~gn,ln=Math.pow(2,31);function st(n,e,t){e=e||[],t=t||0;for(var r=t;n>=ln;)e[t++]=n&255|ct,n/=128;for(;n&mn;)e[t++]=n&255|ct,n>>>=7;return e[t]=n|0,st.bytes=t-r+1,e}var bn=Ge,wn=128,it=127;function Ge(n,r){var t=0,r=r||0,o=0,c=r,i,s=n.length;do{if(c>=s)throw Ge.bytes=0,new RangeError("Could not decode varint");i=n[c++],t+=o<28?(i&it)<<o:(i&it)*Math.pow(2,o),o+=7}while(i>=wn);return Ge.bytes=c-r,t}var xn=Math.pow(2,7),yn=Math.pow(2,14),En=Math.pow(2,21),An=Math.pow(2,28),Un=Math.pow(2,35),Ln=Math.pow(2,42),In=Math.pow(2,49),Sn=Math.pow(2,56),Dn=Math.pow(2,63),Cn=function(n){return n<xn?1:n<yn?2:n<En?3:n<An?4:n<Un?5:n<Ln?6:n<In?7:n<Sn?8:n<Dn?9:10},Nn={encode:hn,decode:bn,encodingLength:Cn},Tn=Nn,Q=Tn;var W=n=>[Q.decode(n),Q.decode.bytes],Y=(n,e,t=0)=>(Q.encode(n,e,t),e),J=n=>Q.encodingLength(n);var j=(n,e)=>{let t=e.byteLength,r=J(n),o=r+J(t),c=new Uint8Array(o+t);return Y(n,c,0),Y(t,c,r),c.set(e,o),new K(n,t,e,c)},at=n=>{let e=M(n),[t,r]=W(e),[o,c]=W(e.subarray(r)),i=e.subarray(r+c);if(i.byteLength!==o)throw new Error("Incorrect length");return new K(t,o,i,e)},dt=(n,e)=>n===e?!0:n.code===e.code&&n.size===e.size&&et(n.bytes,e.bytes),K=class{constructor(e,t,r,o){this.code=e,this.size=t,this.digest=r,this.bytes=o}};var $e=({name:n,code:e,encode:t})=>new ke(n,e,t),ke=class{constructor(e,t,r){this.name=e,this.code=t,this.encode=r}digest(e){if(e instanceof Uint8Array){let t=this.encode(e);return t instanceof Uint8Array?j(this.code,t):t.then(r=>j(this.code,r))}else throw Error("Unknown type, must be binary type")}};var ft=n=>async e=>new Uint8Array(await crypto.subtle.digest(n,e)),On=$e({name:"sha2-256",code:18,encode:ft("SHA-256")}),Rn=$e({name:"sha2-512",code:19,encode:ft("SHA-512")});var He={};D(He,{identity:()=>Pn});var ut=0,Bn="identity",ht=M,vn=n=>j(ut,ht(n)),Pn={code:ut,name:Bn,encode:ht,digest:vn};var Ao=new TextEncoder,Uo=new TextDecoder;var L=class{constructor(e,t,r,o){this.code=t,this.version=e,this.multihash=r,this.bytes=o,this.byteOffset=o.byteOffset,this.byteLength=o.byteLength,this.asCID=this,this._baseCache=new Map,Object.defineProperties(this,{byteOffset:ce,byteLength:ce,code:oe,version:oe,multihash:oe,bytes:oe,_baseCache:ce,asCID:ce})}toV0(){switch(this.version){case 0:return this;default:{let{code:e,multihash:t}=this;if(e!==ee)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==Gn)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return L.createV0(t)}}}toV1(){switch(this.version){case 0:{let{code:e,digest:t}=this.multihash,r=j(e,t);return L.createV1(this.code,r)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}equals(e){return e&&this.code===e.code&&this.version===e.version&&dt(this.multihash,e.multihash)}toString(e){let{bytes:t,version:r,_baseCache:o}=this;switch(r){case 0:return zn(t,o,e||P.encoder);default:return Fn(t,o,e||H.encoder)}}toJSON(){return{code:this.code,version:this.version,hash:this.multihash.bytes}}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return"CID("+this.toString()+")"}static isCID(e){return $n(/^0\.0/,jn),!!(e&&(e[mt]||e.asCID===e))}get toBaseEncodedString(){throw new Error("Deprecated, use .toString()")}get codec(){throw new Error('"codec" property is deprecated, use integer "code" property instead')}get buffer(){throw new Error("Deprecated .buffer property, use .bytes to get Uint8Array instead")}get multibaseName(){throw new Error('"multibaseName" property is deprecated')}get prefix(){throw new Error('"prefix" property is deprecated')}static asCID(e){if(e instanceof L)return e;if(e!=null&&e.asCID===e){let{version:t,code:r,multihash:o,bytes:c}=e;return new L(t,r,o,c||gt(t,r,o.bytes))}else if(e!=null&&e[mt]===!0){let{version:t,multihash:r,code:o}=e,c=at(r);return L.create(t,o,c)}else return null}static create(e,t,r){if(typeof t!="number")throw new Error("String codecs are no longer supported");switch(e){case 0:{if(t!==ee)throw new Error(`Version 0 CID must use dag-pb (code: ${ee}) block encoding`);return new L(e,t,r,r.bytes)}case 1:{let o=gt(e,t,r.bytes);return new L(e,t,r,o)}default:throw new Error("Invalid version")}}static createV0(e){return L.create(0,ee,e)}static createV1(e,t){return L.create(1,e,t)}static decode(e){let[t,r]=L.decodeFirst(e);if(r.length)throw new Error("Incorrect length");return t}static decodeFirst(e){let t=L.inspectBytes(e),r=t.size-t.multihashSize,o=M(e.subarray(r,r+t.multihashSize));if(o.byteLength!==t.multihashSize)throw new Error("Incorrect length");let c=o.subarray(t.multihashSize-t.digestSize),i=new K(t.multihashCode,t.digestSize,c,o);return[t.version===0?L.createV0(i):L.createV1(t.codec,i),e.subarray(t.size)]}static inspectBytes(e){let t=0,r=()=>{let[x,l]=W(e.subarray(t));return t+=l,x},o=r(),c=ee;if(o===18?(o=0,t=0):o===1&&(c=r()),o!==0&&o!==1)throw new RangeError(`Invalid CID version ${o}`);let i=t,s=r(),f=r(),g=t+f,h=g-i;return{version:o,codec:c,multihashCode:s,digestSize:f,multihashSize:h,size:g}}static parse(e,t){let[r,o]=Mn(e,t),c=L.decode(o);return c._baseCache.set(r,e),c}},Mn=(n,e)=>{switch(n[0]){case"Q":{let t=e||P;return[P.prefix,t.decode(`${P.prefix}${n}`)]}case P.prefix:{let t=e||P;return[P.prefix,t.decode(n)]}case H.prefix:{let t=e||H;return[H.prefix,t.decode(n)]}default:{if(e==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[n[0],e.decode(n)]}}},zn=(n,e,t)=>{let{prefix:r}=t;if(r!==P.prefix)throw Error(`Cannot string encode V0 in ${t.name} encoding`);let o=e.get(r);if(o==null){let c=t.encode(n).slice(1);return e.set(r,c),c}else return o},Fn=(n,e,t)=>{let{prefix:r}=t,o=e.get(r);if(o==null){let c=t.encode(n);return e.set(r,c),c}else return o},ee=112,Gn=18,gt=(n,e,t)=>{let r=J(n),o=r+J(e),c=new Uint8Array(o+t.byteLength);return Y(n,c,0),Y(e,c,r),c.set(t,o),c},mt=Symbol.for("@ipld/js-cid/CID"),oe={writable:!1,configurable:!1,enumerable:!0},ce={writable:!1,enumerable:!1,configurable:!1},kn="0.0.0-dev",$n=(n,e)=>{if(n.test(kn))console.warn(e);else throw new Error(e)},jn=`CID.isCID(v) is deprecated and will be removed in the next major release.
|
|
2
|
+
var Libp2PDaemonProtocol=(()=>{var Te=Object.defineProperty;var _t=Object.getOwnPropertyDescriptor;var Mt=Object.getOwnPropertyNames;var zt=Object.prototype.hasOwnProperty;var D=(n,e)=>{for(var t in e)Te(n,t,{get:e[t],enumerable:!0})},Ft=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Mt(e))!zt.call(n,o)&&o!==t&&Te(n,o,{get:()=>e[o],enumerable:!(r=_t(e,o))||r.enumerable});return n};var Gt=n=>Ft(Te({},"__esModule",{value:!0}),n);var Qr={};D(Qr,{ConnManagerRequest:()=>xe,ConnectRequest:()=>pe,DHTRequest:()=>we,DHTResponse:()=>ye,DisconnectRequest:()=>Ee,ErrorResponse:()=>le,IdentifyResponse:()=>he,PSMessage:()=>He,PSRequest:()=>Le,PSResponse:()=>Ae,PeerInfo:()=>W,PeerstoreRequest:()=>Ue,PeerstoreResponse:()=>Ie,Request:()=>We,Response:()=>Ze,StreamHandlerRequest:()=>me,StreamInfo:()=>be,StreamOpenRequest:()=>ge});function Ne(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 ve={};D(ve,{identity:()=>Yt});function Pt(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 d=n.length,g=n.charAt(0),w=Math.log(d)/Math.log(256),h=Math.log(256)/Math.log(d);function p(f){if(f instanceof Uint8Array||(ArrayBuffer.isView(f)?f=new Uint8Array(f.buffer,f.byteOffset,f.byteLength):Array.isArray(f)&&(f=Uint8Array.from(f))),!(f instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(f.length===0)return"";for(var b=0,j=0,C=0,v=f.length;C!==v&&f[C]===0;)C++,b++;for(var B=(v-C)*h+1>>>0,N=new Uint8Array(B);C!==v;){for(var V=f[C],P=0,O=B-1;(V!==0||P<j)&&O!==-1;O--,P++)V+=256*N[O]>>>0,N[O]=V%d>>>0,V=V/d>>>0;if(V!==0)throw new Error("Non-zero carry");j=P,C++}for(var z=B-j;z!==B&&N[z]===0;)z++;for(var te=g.repeat(b);z<B;++z)te+=n.charAt(N[z]);return te}function I(f){if(typeof f!="string")throw new TypeError("Expected String");if(f.length===0)return new Uint8Array;var b=0;if(f[b]!==" "){for(var j=0,C=0;f[b]===g;)j++,b++;for(var v=(f.length-b)*w+1>>>0,B=new Uint8Array(v);f[b];){var N=t[f.charCodeAt(b)];if(N===255)return;for(var V=0,P=v-1;(N!==0||V<C)&&P!==-1;P--,V++)N+=d*B[P]>>>0,B[P]=N%256>>>0,N=N/256>>>0;if(N!==0)throw new Error("Non-zero carry");C=V,b++}if(f[b]!==" "){for(var O=v-C;O!==v&&B[O]===0;)O++;for(var z=new Uint8Array(j+(v-O)),te=j;O!==v;)z[te++]=B[O++];return z}}}function T(f){var b=I(f);if(b)return b;throw new Error(`Non-${e} character`)}return{encode:p,decodeUnsafe:I,decode:T}}var kt=Pt,$t=kt,qe=$t;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},F=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 De=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")}},Se=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)}},Ce=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 Ce({...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 De(e,t,r),this.decoder=new Se(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),k=({prefix:n,name:e,alphabet:t})=>{let{encode:r,decode:o}=qe(t,e);return ne({prefix:n,name:e,encode:r,decode:c=>F(o(c))})},jt=(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),d=0,g=0,w=0;for(let h=0;h<c;++h){let p=o[n[h]];if(p===void 0)throw new SyntaxError(`Non-${r} character`);g=g<<t|p,d+=t,d>=8&&(d-=8,i[w++]=255&g>>d)}if(d>=t||255&g<<8-d)throw new SyntaxError("Unexpected end of data");return i},Rt=(n,e,t)=>{let r=e[e.length-1]==="=",o=(1<<t)-1,c="",i=0,d=0;for(let g=0;g<n.length;++g)for(d=d<<8|n[g],i+=8;i>t;)i-=t,c+=e[o&d>>i];if(i&&(c+=e[o&d<<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 Rt(o,r,t)},decode(o){return jt(o,r,t,n)}});var Yt=ne({prefix:"\0",name:"identity",encode:n=>nt(n),decode:n=>tt(n)});var Be={};D(Be,{base2:()=>Jt});var Jt=y({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Ve={};D(Ve,{base8:()=>Kt});var Kt=y({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var _e={};D(_e,{base10:()=>Xt});var Xt=k({prefix:"9",name:"base10",alphabet:"0123456789"});var Me={};D(Me,{base16:()=>Qt,base16upper:()=>Wt});var Qt=y({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Wt=y({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var ze={};D(ze,{base32:()=>Y,base32hex:()=>en,base32hexpad:()=>nn,base32hexpadupper:()=>rn,base32hexupper:()=>tn,base32pad:()=>Ht,base32padupper:()=>qt,base32upper:()=>Zt,base32z:()=>on});var Y=y({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Zt=y({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Ht=y({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),qt=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 Fe={};D(Fe,{base36:()=>cn,base36upper:()=>sn});var cn=k({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),sn=k({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var Ge={};D(Ge,{base58btc:()=>_,base58flickr:()=>dn});var _=k({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),dn=k({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Pe={};D(Pe,{base64:()=>an,base64pad:()=>fn,base64url:()=>un,base64urlpad:()=>hn});var an=y({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),fn=y({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),un=y({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),hn=y({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var Re={};D(Re,{sha256:()=>On,sha512:()=>vn});var pn=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=ke,wn=128,it=127;function ke(n,r){var t=0,r=r||0,o=0,c=r,i,d=n.length;do{if(c>=d)throw ke.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 ke.bytes=c-r,t}var yn=Math.pow(2,7),xn=Math.pow(2,14),En=Math.pow(2,21),Ln=Math.pow(2,28),An=Math.pow(2,35),Un=Math.pow(2,42),In=Math.pow(2,49),Tn=Math.pow(2,56),Nn=Math.pow(2,63),Dn=function(n){return n<yn?1:n<xn?2:n<En?3:n<Ln?4:n<An?5:n<Un?6:n<In?7:n<Tn?8:n<Nn?9:10},Sn={encode:pn,decode:bn,encodingLength:Dn},Cn=Sn,Z=Cn;var H=n=>[Z.decode(n),Z.decode.bytes],J=(n,e,t=0)=>(Z.encode(n,e,t),e),K=n=>Z.encodingLength(n);var R=(n,e)=>{let t=e.byteLength,r=K(n),o=r+K(t),c=new Uint8Array(o+t);return J(n,c,0),J(t,c,r),c.set(e,o),new X(n,t,e,c)},dt=n=>{let e=F(n),[t,r]=H(e),[o,c]=H(e.subarray(r)),i=e.subarray(r+c);if(i.byteLength!==o)throw new Error("Incorrect length");return new X(t,o,i,e)},at=(n,e)=>n===e?!0:n.code===e.code&&n.size===e.size&&et(n.bytes,e.bytes),X=class{constructor(e,t,r,o){this.code=e,this.size=t,this.digest=r,this.bytes=o}};var je=({name:n,code:e,encode:t})=>new $e(n,e,t),$e=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?R(this.code,t):t.then(r=>R(this.code,r))}else throw Error("Unknown type, must be binary type")}};var ut=n=>async e=>new Uint8Array(await crypto.subtle.digest(n,e)),On=je({name:"sha2-256",code:18,encode:ut("SHA-256")}),vn=je({name:"sha2-512",code:19,encode:ut("SHA-512")});var Ye={};D(Ye,{identity:()=>_n});var ht=0,Bn="identity",pt=F,Vn=n=>R(ht,pt(n)),_n={code:ht,name:Bn,encode:pt,digest:Vn};var Lo=new TextEncoder,Ao=new TextDecoder;var A=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!==kn)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return A.createV0(t)}}}toV1(){switch(this.version){case 0:{let{code:e,digest:t}=this.multihash,r=R(e,t);return A.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&&at(this.multihash,e.multihash)}toString(e){let{bytes:t,version:r,_baseCache:o}=this;switch(r){case 0:return Gn(t,o,e||_.encoder);default:return Pn(t,o,e||Y.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 jn(/^0\.0/,Rn),!!(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 A)return e;if(e!=null&&e.asCID===e){let{version:t,code:r,multihash:o,bytes:c}=e;return new A(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=dt(r);return A.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 A(e,t,r,r.bytes)}case 1:{let o=gt(e,t,r.bytes);return new A(e,t,r,o)}default:throw new Error("Invalid version")}}static createV0(e){return A.create(0,ee,e)}static createV1(e,t){return A.create(1,e,t)}static decode(e){let[t,r]=A.decodeFirst(e);if(r.length)throw new Error("Incorrect length");return t}static decodeFirst(e){let t=A.inspectBytes(e),r=t.size-t.multihashSize,o=F(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 X(t.multihashCode,t.digestSize,c,o);return[t.version===0?A.createV0(i):A.createV1(t.codec,i),e.subarray(t.size)]}static inspectBytes(e){let t=0,r=()=>{let[p,I]=H(e.subarray(t));return t+=I,p},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,d=r(),g=r(),w=t+g,h=w-i;return{version:o,codec:c,multihashCode:d,digestSize:g,multihashSize:h,size:w}}static parse(e,t){let[r,o]=Fn(e,t),c=A.decode(o);return c._baseCache.set(r,e),c}},Fn=(n,e)=>{switch(n[0]){case"Q":{let t=e||_;return[_.prefix,t.decode(`${_.prefix}${n}`)]}case _.prefix:{let t=e||_;return[_.prefix,t.decode(n)]}case Y.prefix:{let t=e||Y;return[Y.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)]}}},Gn=(n,e,t)=>{let{prefix:r}=t;if(r!==_.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},Pn=(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,kn=18,gt=(n,e,t)=>{let r=K(n),o=r+K(e),c=new Uint8Array(o+t.byteLength);return J(n,c,0),J(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},$n="0.0.0-dev",jn=(n,e)=>{if(n.test($n))console.warn(e);else throw new Error(e)},Rn=`CID.isCID(v) is deprecated and will be removed in the next major release.
|
|
3
3
|
Following code pattern:
|
|
4
4
|
|
|
5
5
|
if (CID.isCID(value)) {
|
|
@@ -13,5 +13,5 @@ if (cid) {
|
|
|
13
13
|
// Make sure to use cid instead of value
|
|
14
14
|
doSomethingWithCID(cid)
|
|
15
15
|
}
|
|
16
|
-
`;var Ye={...Re,...Be,...ve,...Pe,...Ve,..._e,...Me,...ze,...Fe},Oo={...je,...He};function bt(n,e,t,r){return{name:n,prefix:e,encoder:{name:n,prefix:e,encode:t},decoder:{decode:r}}}var lt=bt("utf8","u",n=>{let e=new TextDecoder("utf8");return"u"+e.decode(n)},n=>new TextEncoder().encode(n.substring(1))),Je=bt("ascii","a",n=>{let e="a";for(let t=0;t<n.length;t++)e+=String.fromCharCode(n[t]);return e},n=>{n=n.substring(1);let e=new Uint8Array(n.length);for(let t=0;t<n.length;t++)e[t]=n.charCodeAt(t);return e}),Hn={utf8:lt,"utf-8":lt,hex:Ye.base16,latin1:Je,ascii:Je,binary:Je,...Ye},ie=Hn;function se(n,e="utf8"){let t=ie[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return t.decoder.decode(`${t.prefix}${n}`)}function Ke(n,e="utf8"){let t=ie[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return t.encoder.encode(n).substring(1)}var yt=Symbol.for("@achingbrain/uint8arraylist");function wt(n,e,t){if(e==null||e<0||e>=t)throw new RangeError("index is out of bounds");let r=0;for(let o of n){let c=r+o.byteLength;if(e<c)return{buf:o,index:e-r};r=c}throw new RangeError("index is out of bounds")}function xt(n){return Boolean(n?.[yt])}var w=class{constructor(...e){Object.defineProperty(this,yt,{value:!0}),this.bufs=[],this.length=0,this.appendAll(e)}*[Symbol.iterator](){yield*this.bufs}get byteLength(){return this.length}append(...e){this.appendAll(e)}appendAll(e){let t=0;for(let r of e)if(r instanceof Uint8Array)t+=r.byteLength,this.bufs.push(r);else if(xt(r))t+=r.length,this.bufs=this.bufs.concat(r.bufs);else throw new Error("Could not append value, must be an Uint8Array or a Uint8ArrayList");this.length+=t}get(e){let t=wt(this.bufs,e,this.length);return t.buf[t.index]}set(e,t){let r=wt(this.bufs,e,this.length);r.buf[r.index]=t}write(e,t=0){if(e instanceof Uint8Array)for(let r=0;r<e.length;r++)this.set(t+r,e[r]);else if(xt(e))for(let r=0;r<e.length;r++)this.set(t+r,e.get(r));else throw new Error("Could not write value, must be an Uint8Array or a Uint8ArrayList")}consume(e){if(e=Math.trunc(e),!(Number.isNaN(e)||e<=0))for(;this.bufs.length>0;)if(e>=this.bufs[0].byteLength)e-=this.bufs[0].byteLength,this.length-=this.bufs[0].byteLength,this.bufs.shift();else{this.bufs[0]=this.bufs[0].subarray(e),this.length-=e;break}}slice(e,t){let{bufs:r,length:o}=this._subList(e,t);return De(r,o)}subarray(e,t){let{bufs:r}=this._subList(e,t),o=new w;return o.appendAll(r),o}_subList(e,t){if(e==null&&t==null)return{bufs:this.bufs,length:this.length};if(e=e??0,t=t??(this.length>0?this.length:0),e<0||t>this.length)throw new RangeError("index out of bounds");if(e===t)return{bufs:[],length:0};let r=[],o=0;for(let c of this.bufs){let i=o,s=i+c.byteLength,f=e>=i&&e<s,g=t>i&&t<=s,h=e<i&&t>=s;o=s;let x,l;if(f&&(x=e-i,l=c.byteLength),g&&(l=t-i,x==null&&(x=0)),h&&(x=0,l=c.byteLength),x!=null&&l!=null&&r.push(c.subarray(x,l)),g)break}return{bufs:r,length:t-e}}getInt8(e){let t=this.slice(e,e+1);return new DataView(t.buffer,t.byteOffset,t.byteLength).getInt8(0)}setInt8(e,t){let r=new Uint8Array(1);new DataView(r.buffer,r.byteOffset,r.byteLength).setInt8(0,t),this.write(r,e)}getInt16(e,t){let r=this.slice(e,e+2);return new DataView(r.buffer,r.byteOffset,r.byteLength).getInt16(0,t)}setInt16(e,t,r){let o=new Uint8Array(2);new DataView(o.buffer,o.byteOffset,o.byteLength).setInt16(0,t,r),this.write(o,e)}getInt32(e,t){let r=this.slice(e,e+4);return new DataView(r.buffer,r.byteOffset,r.byteLength).getInt32(0,t)}setInt32(e,t,r){let o=new Uint8Array(4);new DataView(o.buffer,o.byteOffset,o.byteLength).setInt32(0,t,r),this.write(o,e)}getBigInt64(e,t){let r=this.slice(e,e+8);return new DataView(r.buffer,r.byteOffset,r.byteLength).getBigInt64(0,t)}setBigInt64(e,t,r){let o=new Uint8Array(8);new DataView(o.buffer,o.byteOffset,o.byteLength).setBigInt64(0,t,r),this.write(o,e)}getUint8(e){let t=this.slice(e,e+1);return new DataView(t.buffer,t.byteOffset,t.byteLength).getUint8(0)}setUint8(e,t){let r=new Uint8Array(1);new DataView(r.buffer,r.byteOffset,r.byteLength).setUint8(0,t),this.write(r,e)}getUint16(e,t){let r=this.slice(e,e+2);return new DataView(r.buffer,r.byteOffset,r.byteLength).getUint16(0,t)}setUint16(e,t,r){let o=new Uint8Array(2);new DataView(o.buffer,o.byteOffset,o.byteLength).setUint16(0,t,r),this.write(o,e)}getUint32(e,t){let r=this.slice(e,e+4);return new DataView(r.buffer,r.byteOffset,r.byteLength).getUint32(0,t)}setUint32(e,t,r){let o=new Uint8Array(4);new DataView(o.buffer,o.byteOffset,o.byteLength).setUint32(0,t,r),this.write(o,e)}getBigUint64(e,t){let r=this.slice(e,e+8);return new DataView(r.buffer,r.byteOffset,r.byteLength).getBigUint64(0,t)}setBigUint64(e,t,r){let o=new Uint8Array(8);new DataView(o.buffer,o.byteOffset,o.byteLength).setBigUint64(0,t,r),this.write(o,e)}getFloat32(e,t){let r=this.slice(e,e+4);return new DataView(r.buffer,r.byteOffset,r.byteLength).getFloat32(0,t)}setFloat32(e,t,r){let o=new Uint8Array(4);new DataView(o.buffer,o.byteOffset,o.byteLength).setFloat32(0,t,r),this.write(o,e)}getFloat64(e,t){let r=this.slice(e,e+8);return new DataView(r.buffer,r.byteOffset,r.byteLength).getFloat64(0,t)}setFloat64(e,t,r){let o=new Uint8Array(8);new DataView(o.buffer,o.byteOffset,o.byteLength).setFloat64(0,t,r),this.write(o,e)}};function V(n){return n instanceof Uint8Array?{get(e){return n[e]},set(e,t){n[e]=t}}:{get(e){return n.get(e)},set(e,t){n.set(e,t)}}}var Et=4294967296,I=class{constructor(e=0,t=0){this.hi=e,this.lo=t}toBigInt(e){if(e)return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n);if(this.hi>>>31!==0){let t=~this.lo+1>>>0,r=~this.hi>>>0;return t===0&&(r=r+1>>>0),-(BigInt(t)+(BigInt(r)<<32n))}return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n)}zzDecode(){let e=-(this.lo&1),t=((this.lo>>>1|this.hi<<31)^e)>>>0,r=(this.hi>>>1^e)>>>0;return new I(r,t)}zzEncode(){let e=this.hi>>31,t=((this.hi<<1|this.lo>>>31)^e)>>>0,r=(this.lo<<1^e)>>>0;return new I(t,r)}toBytes(e,t=0){let r=V(e);for(;this.hi>0;)r.set(t++,this.lo&127|128),this.lo=(this.lo>>>7|this.hi<<25)>>>0,this.hi>>>=7;for(;this.lo>127;)r.set(t++,this.lo&127|128),this.lo=this.lo>>>7;r.set(t++,this.lo)}static fromBigInt(e){if(e===0n)return new I;let t=e<0;t&&(e=-e);let r=Number(e>>32n)|0,o=Number(e-(BigInt(r)<<32n))|0;return t&&(r=~r>>>0,o=~o>>>0,++o>Et&&(o=0,++r>Et&&(r=0))),new I(r,o)}static fromNumber(e){if(e===0)return new I;let t=e<0;t&&(e=-e);let r=e>>>0,o=(e-r)/4294967296>>>0;return t&&(o=~o>>>0,r=~r>>>0,++r>4294967295&&(r=0,++o>4294967295&&(o=0))),new I(o,r)}static fromBytes(e,t){let r=V(e),o=new I,c=0;if(e.length-t>4){for(;c<4;++c)if(o.lo=(o.lo|(r.get(t)&127)<<c*7)>>>0,r.get(t++)<128)return o;if(o.lo=(o.lo|(r.get(t)&127)<<28)>>>0,o.hi=(o.hi|(r.get(t)&127)>>4)>>>0,r.get(t++)<128)return o;c=0}else{for(;c<3;++c){if(t>=e.length)throw RangeError(`index out of range: ${t} > ${e.length}`);if(o.lo=(o.lo|(r.get(t)&127)<<c*7)>>>0,r.get(t++)<128)return o}return o.lo=(o.lo|(r.get(t++)&127)<<c*7)>>>0,o}if(e.length-t>4){for(;c<5;++c)if(o.hi=(o.hi|(r.get(t)&127)<<c*7+3)>>>0,r.get(t++)<128)return o}else for(;c<5;++c){if(t>=e.length)throw RangeError(`index out of range: ${t} > ${e.length}`);if(o.hi=(o.hi|(r.get(t)&127)<<c*7+3)>>>0,r.get(t++)<128)return o}throw Error("invalid varint encoding")}};var At=128,Yn=127,Jn=~Yn,Kn=Math.pow(2,31),qn=Math.pow(2,7),Xn=Math.pow(2,14),Qn=Math.pow(2,21),Wn=Math.pow(2,28),Zn=Math.pow(2,35),er=Math.pow(2,42),tr=Math.pow(2,49),nr=Math.pow(2,56),rr=Math.pow(2,63),d={encodingLength(n){return n<qn?1:n<Xn?2:n<Qn?3:n<Wn?4:n<Zn?5:n<er?6:n<tr?7:n<nr?8:n<rr?9:10},encode(n,e){let t=0,r=V(e);for(;n>=Kn;)r.set(t++,n&255|At),n/=128;for(;(n&Jn)>0;)r.set(t++,n&255|At),n>>>=7;r.set(t,n|0)},decode(n,e=0){let t=V(n),r=4294967295;if(r=(t.get(e)&127)>>>0,t.get(e++)<128||(r=(r|(t.get(e)&127)<<7)>>>0,t.get(e++)<128)||(r=(r|(t.get(e)&127)<<14)>>>0,t.get(e++)<128)||(r=(r|(t.get(e)&127)<<21)>>>0,t.get(e++)<128)||(r=(r|(t.get(e)&15)<<28)>>>0,t.get(e++)<128))return r;if((e+=5)>n.length)throw RangeError(`index out of range: ${e} > ${n.length}`);return r}},ae={encodingLength(n){return n<0?10:d.encodingLength(n)},encode(n,e){if(n<0){let t=0,r=V(e),o=I.fromNumber(n);for(;o.hi>0;)r.set(t++,o.lo&127|128),o.lo=(o.lo>>>7|o.hi<<25)>>>0,o.hi>>>=7;for(;o.lo>127;)r.set(t++,o.lo&127|128),o.lo=o.lo>>>7;r.set(t++,o.lo);return}d.encode(n,e)},decode(n,e=0){return d.decode(n,e)|0}},de={encodingLength(n){return n=(n<<1^n>>31)>>>0,d.encodingLength(n)},encode(n,e,t=0){return n=(n<<1^n>>31)>>>0,d.encode(n,e)},decode(n,e=0){let t=d.decode(n,e);return t>>>1^-(t&1)|0}};function E(n,e){let t=new Uint8Array(d.encodingLength(n.length));return d.encode(n.length,t),e.decode(new w(t,n),0)}function A(n,e){let t=e.encode(n),r=d.encodingLength(d.decode(t));return t.slice(r)}var p;(function(n){n[n.VARINT=0]="VARINT",n[n.BIT64=1]="BIT64",n[n.LENGTH_DELIMITED=2]="LENGTH_DELIMITED",n[n.START_GROUP=3]="START_GROUP",n[n.END_GROUP=4]="END_GROUP",n[n.BIT32=5]="BIT32"})(p||(p={}));function u(n,e,t,r,o){return{name:n,type:e,encode:t,decode:r,encodingLength:o}}var or=function(){return 1},cr=function(e){return Uint8Array.from([e?1:0])},ir=function(e,t){return e.get(t)>0},sr=u("bool",p.VARINT,cr,ir,or);var ar=function(e){let t=e.byteLength;return d.encodingLength(t)+t},dr=function(e){let t=new Uint8Array(d.encodingLength(e.byteLength));return d.encode(e.byteLength,t),new w(t,e)},pr=function(e,t){let r=d.decode(e,t);return t+=d.encodingLength(r),e.slice(t,t+r)},m=u("bytes",p.LENGTH_DELIMITED,dr,pr,ar);var Ut=function(){return 8},fr=function(e){let t=new w(new Uint8Array(Ut(e)));return t.setFloat64(0,e,!0),t},ur=function(e,t){return e.getFloat64(t,!0)},hr=u("double",p.BIT64,fr,ur,Ut);function z(n){let e=function(c){let s=Object.keys(n).indexOf(c);return d.encodingLength(s)},t=function(c){let s=Object.keys(n).indexOf(c),f=new Uint8Array(d.encodingLength(s));return d.encode(s,f),f},r=function(c,i){let s=d.decode(c,i),f=Object.keys(n);if(f[s]==null)throw new Error("Could not find enum key for value");return f[s]};return u("enum",p.VARINT,t,r,e)}var Lt=function(){return 4},gr=function(e){let t=new w(new Uint8Array(Lt(e)));return t.setInt32(0,e,!0),t},mr=function(e,t){return e.getInt32(t,!0)},lr=u("fixed32",p.BIT32,gr,mr,Lt);var It=function(e){return 8},br=function(e){let t=new w(new Uint8Array(It(e)));return t.setBigInt64(0,e,!0),t},wr=function(e,t){return e.getBigInt64(t,!0)},xr=u("fixed64",p.BIT64,br,wr,It);var St=function(){return 4},yr=function(e){let t=new w(new Uint8Array(St(1)));return t.setFloat32(0,e,!0),t},Er=function(e,t){return e.getFloat32(t,!0)},Ar=u("float",p.BIT32,yr,Er,St);var Dt=function(e){return ae.encodingLength(e)},Ur=function(e){let t=new Uint8Array(Dt(e));return ae.encode(e,t),t},Lr=function(e,t){return ae.decode(e,t)},qe=u("int32",p.VARINT,Ur,Lr,Dt);var Ct=0x7fn,k={encodingLength(n){let e=0;for(;n>=0x80n;e++)n>>=7n;return e+1},encode(n,e){let t=V(e),r=0;for(;Ct<n;)t.set(r++,Number(n&Ct)|128),n>>=7n;t.set(r,Number(n))},decode(n,e=0){return I.fromBytes(n,e).toBigInt(!0)}},pe={encodingLength(n){return n<0n?10:k.encodingLength(n)},encode(n,e,t=0){if(n<0n){I.fromBigInt(n).toBytes(e,t);return}return k.encode(n,e)},decode(n,e=0){return I.fromBytes(n,e).toBigInt(!1)}},fe={encodingLength(n){return k.encodingLength(n>=0?n*2n:n*-2n-1n)},encode(n,e,t=0){I.fromBigInt(n).zzEncode().toBytes(e,t)},decode(n,e=0){return I.fromBytes(n,e).zzDecode().toBigInt(!1)}};var Nt=function(e){return pe.encodingLength(e)},Ir=function(e){let t=new Uint8Array(Nt(e));return pe.encode(e,t),t},Sr=function(e,t){return pe.decode(e,t)|0n},q=u("int64",p.VARINT,Ir,Sr,Nt);function U(n){let e=function(c){let i=0;for(let s of Object.values(n))i+=s.codec.encodingLength(c[s.name]);return d.encodingLength(i)+i},t=function(c){let i=new w;function s(g,h,x){if(g==null){if(x.optional===!0)return;throw new Error(`Non optional field "${x.name}" was ${g===null?"null":"undefined"}`)}let l=h<<3|x.codec.type,N=new Uint8Array(d.encodingLength(l));d.encode(l,N);let a=x.codec.encode(g);i.append(N),i.append(a)}for(let[g,h]of Object.entries(n)){let x=parseInt(g);if(h.repeats===!0){if(!Array.isArray(c[h.name]))throw new Error(`Repeating field "${h.name}" was not an array`);for(let l of c[h.name])s(l,x,h)}else s(c[h.name],x,h)}let f=new Uint8Array(d.encodingLength(i.length));return d.encode(i.length,f),new w(f,i)},r=function(c,i){let s=d.decode(c,i);i+=d.encodingLength(s);let f={};for(;i<c.length;){let g=d.decode(c,i);i+=d.encodingLength(g);let h=g&7,x=g>>3,l=n[x],N=0;if(h===p.VARINT)if(l!=null){let a=l.codec.decode(c,i);N=l.codec.encodingLength(a)}else{let a=d.decode(c,i);N=d.encodingLength(a)}else if(h===p.BIT64)N=8;else if(h===p.LENGTH_DELIMITED){let a=d.decode(c,i);N=a+d.encodingLength(a)}else if(h===p.BIT32)N=4;else{if(h===p.START_GROUP)throw new Error("Unsupported wire type START_GROUP");if(h===p.END_GROUP)throw new Error("Unsupported wire type END_GROUP")}if(l!=null){let a=l.codec.decode(c,i);l.repeats===!0?(f[l.name]==null&&(f[l.name]=[]),f[l.name].push(a)):f[l.name]=a}i+=N}for(let g of Object.values(n))g.repeats===!0&&f[g.name]==null&&(f[g.name]=[]);return f};return u("message",p.LENGTH_DELIMITED,t,r,e)}var Tt=function(){return 4},Dr=function(e){let t=new w(new Uint8Array(Tt(e)));return t.setInt32(0,e,!0),t},Cr=function(e,t){return e.getInt32(t,!0)},Nr=u("sfixed32",p.BIT32,Dr,Cr,Tt);var Ot=function(){return 8},Tr=function(e){let t=new w(new Uint8Array(Ot(e)));return t.setBigInt64(0,e,!0),t},Or=function(e,t){return e.getBigInt64(t,!0)},Rr=u("sfixed64",p.BIT64,Tr,Or,Ot);var Rt=function(e){return de.encodingLength(e)},Br=function(e){let t=new Uint8Array(Rt(e));return de.encode(e,t),t},vr=function(e,t){return de.decode(e,t)},Pr=u("sint32",p.VARINT,Br,vr,Rt);var Bt=function(e){return fe.encodingLength(e)},Vr=function(e){let t=new Uint8Array(Bt(e));return fe.encode(e,t),t},_r=function(e,t){return fe.decode(e,t)},Mr=u("sint64",p.VARINT,Vr,_r,Bt);var zr=function(e){let t=se(e).byteLength;return d.encodingLength(t)+t},Fr=function(e){let t=se(e),r=new Uint8Array(d.encodingLength(t.byteLength));return d.encode(t.length,r),new w(r,t)},Gr=function(e,t){let r=d.decode(e,t);return t+=d.encodingLength(r),Ke(e.slice(t,t+r))},C=u("string",p.LENGTH_DELIMITED,Fr,Gr,zr);var vt=function(e){return d.encodingLength(e)},kr=function(e){let t=new Uint8Array(vt(e));return d.encode(e,t),t},$r=function(e,t){return d.decode(e,t)},jr=u("uint32",p.VARINT,kr,$r,vt);var Hr=function(e){return k.encodingLength(e)},Yr=function(e){let t=new Uint8Array(k.encodingLength(e));return k.encode(e,t),t},Jr=function(e,t){return k.decode(e,t)},Kr=u("uint64",p.VARINT,Yr,Jr,Hr);var Xe;(o=>{let n;(b=>(b.IDENTIFY="IDENTIFY",b.CONNECT="CONNECT",b.STREAM_OPEN="STREAM_OPEN",b.STREAM_HANDLER="STREAM_HANDLER",b.DHT="DHT",b.LIST_PEERS="LIST_PEERS",b.CONNMANAGER="CONNMANAGER",b.DISCONNECT="DISCONNECT",b.PUBSUB="PUBSUB",b.PEERSTORE="PEERSTORE"))(n=o.Type||(o.Type={})),(i=>i.codec=()=>z(i))(n=o.Type||(o.Type={})),o.codec=()=>U({1:{name:"type",codec:o.Type.codec()},2:{name:"connect",codec:he.codec(),optional:!0},3:{name:"streamOpen",codec:ge.codec(),optional:!0},4:{name:"streamHandler",codec:me.codec(),optional:!0},5:{name:"dht",codec:we.codec(),optional:!0},6:{name:"connManager",codec:ye.codec(),optional:!0},7:{name:"disconnect",codec:Ee.codec(),optional:!0},8:{name:"pubsub",codec:Ae.codec(),optional:!0},9:{name:"peerStore",codec:Le.codec(),optional:!0}}),o.encode=c=>A(c,o.codec()),o.decode=c=>E(c,o.codec())})(Xe||(Xe={}));var Qe;(o=>{let n;(s=>(s.OK="OK",s.ERROR="ERROR"))(n=o.Type||(o.Type={})),(i=>i.codec=()=>z(i))(n=o.Type||(o.Type={})),o.codec=()=>U({1:{name:"type",codec:o.Type.codec()},2:{name:"error",codec:le.codec(),optional:!0},3:{name:"streamInfo",codec:be.codec(),optional:!0},4:{name:"identify",codec:ue.codec(),optional:!0},5:{name:"dht",codec:xe.codec(),optional:!0},6:{name:"peers",codec:X.codec(),repeats:!0},7:{name:"pubsub",codec:Ue.codec(),optional:!0},8:{name:"peerStore",codec:Ie.codec(),optional:!0}}),o.encode=c=>A(c,o.codec()),o.decode=c=>E(c,o.codec())})(Qe||(Qe={}));var ue;(r=>(r.codec=()=>U({1:{name:"id",codec:m},2:{name:"addrs",codec:m,repeats:!0}}),r.encode=o=>A(o,r.codec()),r.decode=o=>E(o,r.codec())))(ue||(ue={}));var he;(r=>(r.codec=()=>U({1:{name:"peer",codec:m},2:{name:"addrs",codec:m,repeats:!0},3:{name:"timeout",codec:q,optional:!0}}),r.encode=o=>A(o,r.codec()),r.decode=o=>E(o,r.codec())))(he||(he={}));var ge;(r=>(r.codec=()=>U({1:{name:"peer",codec:m},2:{name:"proto",codec:C,repeats:!0},3:{name:"timeout",codec:q,optional:!0}}),r.encode=o=>A(o,r.codec()),r.decode=o=>E(o,r.codec())))(ge||(ge={}));var me;(r=>(r.codec=()=>U({1:{name:"addr",codec:m},2:{name:"proto",codec:C,repeats:!0}}),r.encode=o=>A(o,r.codec()),r.decode=o=>E(o,r.codec())))(me||(me={}));var le;(r=>(r.codec=()=>U({1:{name:"msg",codec:C}}),r.encode=o=>A(o,r.codec()),r.decode=o=>E(o,r.codec())))(le||(le={}));var be;(r=>(r.codec=()=>U({1:{name:"peer",codec:m},2:{name:"addr",codec:m},3:{name:"proto",codec:C}}),r.encode=o=>A(o,r.codec()),r.decode=o=>E(o,r.codec())))(be||(be={}));var we;(o=>{let n;(a=>(a.FIND_PEER="FIND_PEER",a.FIND_PEERS_CONNECTED_TO_PEER="FIND_PEERS_CONNECTED_TO_PEER",a.FIND_PROVIDERS="FIND_PROVIDERS",a.GET_CLOSEST_PEERS="GET_CLOSEST_PEERS",a.GET_PUBLIC_KEY="GET_PUBLIC_KEY",a.GET_VALUE="GET_VALUE",a.SEARCH_VALUE="SEARCH_VALUE",a.PUT_VALUE="PUT_VALUE",a.PROVIDE="PROVIDE"))(n=o.Type||(o.Type={})),(i=>i.codec=()=>z(i))(n=o.Type||(o.Type={})),o.codec=()=>U({1:{name:"type",codec:o.Type.codec()},2:{name:"peer",codec:m,optional:!0},3:{name:"cid",codec:m,optional:!0},4:{name:"key",codec:m,optional:!0},5:{name:"value",codec:m,optional:!0},6:{name:"count",codec:qe,optional:!0},7:{name:"timeout",codec:q,optional:!0}}),o.encode=c=>A(c,o.codec()),o.decode=c=>E(c,o.codec())})(we||(we={}));var xe;(o=>{let n;(f=>(f.BEGIN="BEGIN",f.VALUE="VALUE",f.END="END"))(n=o.Type||(o.Type={})),(i=>i.codec=()=>z(i))(n=o.Type||(o.Type={})),o.codec=()=>U({1:{name:"type",codec:o.Type.codec()},2:{name:"peer",codec:X.codec(),optional:!0},3:{name:"value",codec:m,optional:!0}}),o.encode=c=>A(c,o.codec()),o.decode=c=>E(c,o.codec())})(xe||(xe={}));var X;(r=>(r.codec=()=>U({1:{name:"id",codec:m},2:{name:"addrs",codec:m,repeats:!0}}),r.encode=o=>A(o,r.codec()),r.decode=o=>E(o,r.codec())))(X||(X={}));var ye;(o=>{let n;(f=>(f.TAG_PEER="TAG_PEER",f.UNTAG_PEER="UNTAG_PEER",f.TRIM="TRIM"))(n=o.Type||(o.Type={})),(i=>i.codec=()=>z(i))(n=o.Type||(o.Type={})),o.codec=()=>U({1:{name:"type",codec:o.Type.codec()},2:{name:"peer",codec:m,optional:!0},3:{name:"tag",codec:C,optional:!0},4:{name:"weight",codec:q,optional:!0}}),o.encode=c=>A(c,o.codec()),o.decode=c=>E(c,o.codec())})(ye||(ye={}));var Ee;(r=>(r.codec=()=>U({1:{name:"peer",codec:m}}),r.encode=o=>A(o,r.codec()),r.decode=o=>E(o,r.codec())))(Ee||(Ee={}));var Ae;(o=>{let n;(g=>(g.GET_TOPICS="GET_TOPICS",g.LIST_PEERS="LIST_PEERS",g.PUBLISH="PUBLISH",g.SUBSCRIBE="SUBSCRIBE"))(n=o.Type||(o.Type={})),(i=>i.codec=()=>z(i))(n=o.Type||(o.Type={})),o.codec=()=>U({1:{name:"type",codec:o.Type.codec()},2:{name:"topic",codec:C,optional:!0},3:{name:"data",codec:m,optional:!0}}),o.encode=c=>A(c,o.codec()),o.decode=c=>E(c,o.codec())})(Ae||(Ae={}));var We;(r=>(r.codec=()=>U({1:{name:"from",codec:m,optional:!0},2:{name:"data",codec:m,optional:!0},3:{name:"seqno",codec:m,optional:!0},4:{name:"topicIDs",codec:C,repeats:!0},5:{name:"signature",codec:m,optional:!0},6:{name:"key",codec:m,optional:!0}}),r.encode=o=>A(o,r.codec()),r.decode=o=>E(o,r.codec())))(We||(We={}));var Ue;(r=>(r.codec=()=>U({1:{name:"topics",codec:C,repeats:!0},2:{name:"peerIDs",codec:m,repeats:!0}}),r.encode=o=>A(o,r.codec()),r.decode=o=>E(o,r.codec())))(Ue||(Ue={}));var Le;(o=>{let n;(s=>(s.GET_PROTOCOLS="GET_PROTOCOLS",s.GET_PEER_INFO="GET_PEER_INFO"))(n=o.Type||(o.Type={})),(i=>i.codec=()=>z(i))(n=o.Type||(o.Type={})),o.codec=()=>U({1:{name:"type",codec:o.Type.codec()},2:{name:"id",codec:m,optional:!0},3:{name:"protos",codec:C,repeats:!0}}),o.encode=c=>A(c,o.codec()),o.decode=c=>E(c,o.codec())})(Le||(Le={}));var Ie;(r=>(r.codec=()=>U({1:{name:"peer",codec:X.codec(),optional:!0},2:{name:"protos",codec:C,repeats:!0}}),r.encode=o=>A(o,r.codec()),r.decode=o=>E(o,r.codec())))(Ie||(Ie={}));return zt(qr);})();
|
|
16
|
+
`;var Je={...ve,...Be,...Ve,..._e,...Me,...ze,...Fe,...Ge,...Pe},Oo={...Re,...Ye};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))),Ke=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}),Yn={utf8:lt,"utf-8":lt,hex:Je.base16,latin1:Ke,ascii:Ke,binary:Ke,...Je},ie=Yn;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 Xe(n,e="utf8"){let t=ie[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return t.encoder.encode(n).substring(1)}var xt=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 yt(n){return Boolean(n?.[xt])}var l=class{constructor(...e){Object.defineProperty(this,xt,{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(yt(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(yt(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 Ne(r,o)}subarray(e,t){let{bufs:r}=this._subList(e,t),o=new l;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,d=i+c.byteLength,g=e>=i&&e<d,w=t>i&&t<=d,h=e<i&&t>=d;o=d;let p,I;if(g&&(p=e-i,I=c.byteLength),w&&(I=t-i,p==null&&(p=0)),h&&(p=0,I=c.byteLength),p!=null&&I!=null&&r.push(c.subarray(p,I)),w)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 M(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,U=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 U(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 U(t,r)}toBytes(e,t=0){let r=M(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 U;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 U(r,o)}static fromNumber(e){if(e===0)return new U;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 U(o,r)}static fromBytes(e,t){let r=M(e),o=new U,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 Lt=128,Jn=127,Kn=~Jn,Xn=Math.pow(2,31),Qn=Math.pow(2,7),Wn=Math.pow(2,14),Zn=Math.pow(2,21),Hn=Math.pow(2,28),qn=Math.pow(2,35),er=Math.pow(2,42),tr=Math.pow(2,49),nr=Math.pow(2,56),rr=Math.pow(2,63),s={encodingLength(n){return n<Qn?1:n<Wn?2:n<Zn?3:n<Hn?4:n<qn?5:n<er?6:n<tr?7:n<nr?8:n<rr?9:10},encode(n,e){let t=0,r=M(e);for(;n>=Xn;)r.set(t++,n&255|Lt),n/=128;for(;(n&Kn)>0;)r.set(t++,n&255|Lt),n>>>=7;r.set(t,n|0)},decode(n,e=0){let t=M(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}},de={encodingLength(n){return n<0?10:s.encodingLength(n)},encode(n,e){if(n<0){let t=0,r=M(e),o=U.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}s.encode(n,e)},decode(n,e=0){return s.decode(n,e)|0}},ae={encodingLength(n){return n=(n<<1^n>>31)>>>0,s.encodingLength(n)},encode(n,e,t=0){return n=(n<<1^n>>31)>>>0,s.encode(n,e)},decode(n,e=0){let t=s.decode(n,e);return t>>>1^-(t&1)|0}};function x(n,e){let t=new Uint8Array(s.encodingLength(n.length));return s.encode(n.length,t),e.decode(new l(t,n),0)}function E(n,e){let t=e.encode(n),r=s.encodingLength(s.decode(t));return t.slice(r)}var a;(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"})(a||(a={}));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",a.VARINT,cr,ir,or);var dr=function(e){let t=e.byteLength;return s.encodingLength(t)+t},ar=function(e){let t=new Uint8Array(s.encodingLength(e.byteLength));return s.encode(e.byteLength,t),new l(t,e)},fr=function(e,t){let r=s.decode(e,t);return t+=s.encodingLength(r),e.slice(t,t+r)},m=u("bytes",a.LENGTH_DELIMITED,ar,fr,dr);var At=function(){return 8},ur=function(e){let t=new l(new Uint8Array(At(e)));return t.setFloat64(0,e,!0),t},hr=function(e,t){return e.getFloat64(t,!0)},pr=u("double",a.BIT64,ur,hr,At);function G(n){let e=function(c){let d=Object.keys(n).indexOf(c);return s.encodingLength(d)},t=function(c){let d=Object.keys(n).indexOf(c),g=new Uint8Array(s.encodingLength(d));return s.encode(d,g),g},r=function(c,i){let d=s.decode(c,i),g=Object.keys(n);if(g[d]==null)throw new Error("Could not find enum key for value");return g[d]};return u("enum",a.VARINT,t,r,e)}var Ut=function(){return 4},gr=function(e){let t=new l(new Uint8Array(Ut(e)));return t.setInt32(0,e,!0),t},mr=function(e,t){return e.getInt32(t,!0)},lr=u("fixed32",a.BIT32,gr,mr,Ut);var It=function(e){return 8},br=function(e){let t=new l(new Uint8Array(It(e)));return t.setBigInt64(0,e,!0),t},wr=function(e,t){return e.getBigInt64(t,!0)},yr=u("fixed64",a.BIT64,br,wr,It);var Tt=function(){return 4},xr=function(e){let t=new l(new Uint8Array(Tt(1)));return t.setFloat32(0,e,!0),t},Er=function(e,t){return e.getFloat32(t,!0)},Lr=u("float",a.BIT32,xr,Er,Tt);var Nt=function(e){return de.encodingLength(e)},Ar=function(e){let t=new Uint8Array(Nt(e));return de.encode(e,t),t},Ur=function(e,t){return de.decode(e,t)},Qe=u("int32",a.VARINT,Ar,Ur,Nt);var Dt=0x7fn,$={encodingLength(n){let e=0;for(;n>=0x80n;e++)n>>=7n;return e+1},encode(n,e){let t=M(e),r=0;for(;Dt<n;)t.set(r++,Number(n&Dt)|128),n>>=7n;t.set(r,Number(n))},decode(n,e=0){return U.fromBytes(n,e).toBigInt(!0)}},fe={encodingLength(n){return n<0n?10:$.encodingLength(n)},encode(n,e,t=0){if(n<0n){U.fromBigInt(n).toBytes(e,t);return}return $.encode(n,e)},decode(n,e=0){return U.fromBytes(n,e).toBigInt(!1)}},ue={encodingLength(n){return $.encodingLength(n>=0?n*2n:n*-2n-1n)},encode(n,e,t=0){U.fromBigInt(n).zzEncode().toBytes(e,t)},decode(n,e=0){return U.fromBytes(n,e).zzDecode().toBigInt(!1)}};var St=function(e){return fe.encodingLength(e)},Ir=function(e){let t=new Uint8Array(St(e));return fe.encode(e,t),t},Tr=function(e,t){return fe.decode(e,t)|0n},Q=u("int64",a.VARINT,Ir,Tr,St);function L(n){let e=function(c){let i=0;for(let d of Object.values(n))i+=d.codec.encodingLength(c[d.name]);return s.encodingLength(i)+i},t=function(c){let i=new l;function d(w,h,p){if(w==null){if(p.optional===!0)return;throw new Error(`Non optional field "${p.name}" was ${w===null?"null":"undefined"}`)}let I=h<<3|p.codec.type,T=new Uint8Array(s.encodingLength(I));s.encode(I,T);let f=p.codec.encode(w);i.append(T),i.append(f)}for(let[w,h]of Object.entries(n)){let p=parseInt(w);if(h.repeats===!0){if(!Array.isArray(c[h.name]))throw new Error(`Repeating field "${h.name}" was not an array`);for(let I of c[h.name])d(I,p,h)}else d(c[h.name],p,h)}let g=new Uint8Array(s.encodingLength(i.length));return s.encode(i.length,g),new l(g,i)},r=function(c,i){let d=s.decode(c,i);i+=s.encodingLength(d);let g=i+d,w={};for(;i<g;){let h=s.decode(c,i);i+=s.encodingLength(h);let p=h&7,I=h>>3,T=n[I],f=0;if(p===a.VARINT)if(T!=null){let b=T.codec.decode(c,i);f=T.codec.encodingLength(b)}else{let b=s.decode(c,i);f=s.encodingLength(b)}else if(p===a.BIT64)f=8;else if(p===a.LENGTH_DELIMITED){let b=s.decode(c,i);f=b+s.encodingLength(b)}else if(p===a.BIT32)f=4;else{if(p===a.START_GROUP)throw new Error("Unsupported wire type START_GROUP");if(p===a.END_GROUP)throw new Error("Unsupported wire type END_GROUP")}if(T!=null){let b=T.codec.decode(c,i);T.repeats===!0?(w[T.name]==null&&(w[T.name]=[]),w[T.name].push(b)):w[T.name]=b}i+=f}for(let h of Object.values(n))h.repeats===!0&&w[h.name]==null&&(w[h.name]=[]);return w};return u("message",a.LENGTH_DELIMITED,t,r,e)}var Ct=function(){return 4},Nr=function(e){let t=new l(new Uint8Array(Ct(e)));return t.setInt32(0,e,!0),t},Dr=function(e,t){return e.getInt32(t,!0)},Sr=u("sfixed32",a.BIT32,Nr,Dr,Ct);var Ot=function(){return 8},Cr=function(e){let t=new l(new Uint8Array(Ot(e)));return t.setBigInt64(0,e,!0),t},Or=function(e,t){return e.getBigInt64(t,!0)},vr=u("sfixed64",a.BIT64,Cr,Or,Ot);var vt=function(e){return ae.encodingLength(e)},Br=function(e){let t=new Uint8Array(vt(e));return ae.encode(e,t),t},Vr=function(e,t){return ae.decode(e,t)},_r=u("sint32",a.VARINT,Br,Vr,vt);var Bt=function(e){return ue.encodingLength(e)},Mr=function(e){let t=new Uint8Array(Bt(e));return ue.encode(e,t),t},zr=function(e,t){return ue.decode(e,t)},Fr=u("sint64",a.VARINT,Mr,zr,Bt);var Gr=function(e){let t=se(e).byteLength;return s.encodingLength(t)+t},Pr=function(e){let t=se(e),r=new Uint8Array(s.encodingLength(t.byteLength));return s.encode(t.length,r),new l(r,t)},kr=function(e,t){let r=s.decode(e,t);return t+=s.encodingLength(r),Xe(e.slice(t,t+r))},S=u("string",a.LENGTH_DELIMITED,Pr,kr,Gr);var Vt=function(e){return s.encodingLength(e)},$r=function(e){let t=new Uint8Array(Vt(e));return s.encode(e,t),t},jr=function(e,t){return s.decode(e,t)},Rr=u("uint32",a.VARINT,$r,jr,Vt);var Yr=function(e){return $.encodingLength(e)},Jr=function(e){let t=new Uint8Array($.encodingLength(e));return $.encode(e,t),t},Kr=function(e,t){return $.decode(e,t)},Xr=u("uint64",a.VARINT,Jr,Kr,Yr);var We;(function(n){let e;(function(t){t.IDENTIFY="IDENTIFY",t.CONNECT="CONNECT",t.STREAM_OPEN="STREAM_OPEN",t.STREAM_HANDLER="STREAM_HANDLER",t.DHT="DHT",t.LIST_PEERS="LIST_PEERS",t.CONNMANAGER="CONNMANAGER",t.DISCONNECT="DISCONNECT",t.PUBSUB="PUBSUB",t.PEERSTORE="PEERSTORE"})(e=n.Type||(n.Type={})),function(t){t.codec=()=>G(t)}(e=n.Type||(n.Type={})),n.codec=()=>L({1:{name:"type",codec:n.Type.codec()},2:{name:"connect",codec:pe.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:xe.codec(),optional:!0},7:{name:"disconnect",codec:Ee.codec(),optional:!0},8:{name:"pubsub",codec:Le.codec(),optional:!0},9:{name:"peerStore",codec:Ue.codec(),optional:!0}}),n.encode=t=>E(t,n.codec()),n.decode=t=>x(t,n.codec())})(We||(We={}));var Ze;(function(n){let e;(function(t){t.OK="OK",t.ERROR="ERROR"})(e=n.Type||(n.Type={})),function(t){t.codec=()=>G(t)}(e=n.Type||(n.Type={})),n.codec=()=>L({1:{name:"type",codec:n.Type.codec()},2:{name:"error",codec:le.codec(),optional:!0},3:{name:"streamInfo",codec:be.codec(),optional:!0},4:{name:"identify",codec:he.codec(),optional:!0},5:{name:"dht",codec:ye.codec(),optional:!0},6:{name:"peers",codec:W.codec(),repeats:!0},7:{name:"pubsub",codec:Ae.codec(),optional:!0},8:{name:"peerStore",codec:Ie.codec(),optional:!0}}),n.encode=t=>E(t,n.codec()),n.decode=t=>x(t,n.codec())})(Ze||(Ze={}));var he;(function(n){n.codec=()=>L({1:{name:"id",codec:m},2:{name:"addrs",codec:m,repeats:!0}}),n.encode=e=>E(e,n.codec()),n.decode=e=>x(e,n.codec())})(he||(he={}));var pe;(function(n){n.codec=()=>L({1:{name:"peer",codec:m},2:{name:"addrs",codec:m,repeats:!0},3:{name:"timeout",codec:Q,optional:!0}}),n.encode=e=>E(e,n.codec()),n.decode=e=>x(e,n.codec())})(pe||(pe={}));var ge;(function(n){n.codec=()=>L({1:{name:"peer",codec:m},2:{name:"proto",codec:S,repeats:!0},3:{name:"timeout",codec:Q,optional:!0}}),n.encode=e=>E(e,n.codec()),n.decode=e=>x(e,n.codec())})(ge||(ge={}));var me;(function(n){n.codec=()=>L({1:{name:"addr",codec:m},2:{name:"proto",codec:S,repeats:!0}}),n.encode=e=>E(e,n.codec()),n.decode=e=>x(e,n.codec())})(me||(me={}));var le;(function(n){n.codec=()=>L({1:{name:"msg",codec:S}}),n.encode=e=>E(e,n.codec()),n.decode=e=>x(e,n.codec())})(le||(le={}));var be;(function(n){n.codec=()=>L({1:{name:"peer",codec:m},2:{name:"addr",codec:m},3:{name:"proto",codec:S}}),n.encode=e=>E(e,n.codec()),n.decode=e=>x(e,n.codec())})(be||(be={}));var we;(function(n){let e;(function(t){t.FIND_PEER="FIND_PEER",t.FIND_PEERS_CONNECTED_TO_PEER="FIND_PEERS_CONNECTED_TO_PEER",t.FIND_PROVIDERS="FIND_PROVIDERS",t.GET_CLOSEST_PEERS="GET_CLOSEST_PEERS",t.GET_PUBLIC_KEY="GET_PUBLIC_KEY",t.GET_VALUE="GET_VALUE",t.SEARCH_VALUE="SEARCH_VALUE",t.PUT_VALUE="PUT_VALUE",t.PROVIDE="PROVIDE"})(e=n.Type||(n.Type={})),function(t){t.codec=()=>G(t)}(e=n.Type||(n.Type={})),n.codec=()=>L({1:{name:"type",codec:n.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}}),n.encode=t=>E(t,n.codec()),n.decode=t=>x(t,n.codec())})(we||(we={}));var ye;(function(n){let e;(function(t){t.BEGIN="BEGIN",t.VALUE="VALUE",t.END="END"})(e=n.Type||(n.Type={})),function(t){t.codec=()=>G(t)}(e=n.Type||(n.Type={})),n.codec=()=>L({1:{name:"type",codec:n.Type.codec()},2:{name:"peer",codec:W.codec(),optional:!0},3:{name:"value",codec:m,optional:!0}}),n.encode=t=>E(t,n.codec()),n.decode=t=>x(t,n.codec())})(ye||(ye={}));var W;(function(n){n.codec=()=>L({1:{name:"id",codec:m},2:{name:"addrs",codec:m,repeats:!0}}),n.encode=e=>E(e,n.codec()),n.decode=e=>x(e,n.codec())})(W||(W={}));var xe;(function(n){let e;(function(t){t.TAG_PEER="TAG_PEER",t.UNTAG_PEER="UNTAG_PEER",t.TRIM="TRIM"})(e=n.Type||(n.Type={})),function(t){t.codec=()=>G(t)}(e=n.Type||(n.Type={})),n.codec=()=>L({1:{name:"type",codec:n.Type.codec()},2:{name:"peer",codec:m,optional:!0},3:{name:"tag",codec:S,optional:!0},4:{name:"weight",codec:Q,optional:!0}}),n.encode=t=>E(t,n.codec()),n.decode=t=>x(t,n.codec())})(xe||(xe={}));var Ee;(function(n){n.codec=()=>L({1:{name:"peer",codec:m}}),n.encode=e=>E(e,n.codec()),n.decode=e=>x(e,n.codec())})(Ee||(Ee={}));var Le;(function(n){let e;(function(t){t.GET_TOPICS="GET_TOPICS",t.LIST_PEERS="LIST_PEERS",t.PUBLISH="PUBLISH",t.SUBSCRIBE="SUBSCRIBE"})(e=n.Type||(n.Type={})),function(t){t.codec=()=>G(t)}(e=n.Type||(n.Type={})),n.codec=()=>L({1:{name:"type",codec:n.Type.codec()},2:{name:"topic",codec:S,optional:!0},3:{name:"data",codec:m,optional:!0}}),n.encode=t=>E(t,n.codec()),n.decode=t=>x(t,n.codec())})(Le||(Le={}));var He;(function(n){n.codec=()=>L({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:S,repeats:!0},5:{name:"signature",codec:m,optional:!0},6:{name:"key",codec:m,optional:!0}}),n.encode=e=>E(e,n.codec()),n.decode=e=>x(e,n.codec())})(He||(He={}));var Ae;(function(n){n.codec=()=>L({1:{name:"topics",codec:S,repeats:!0},2:{name:"peerIDs",codec:m,repeats:!0}}),n.encode=e=>E(e,n.codec()),n.decode=e=>x(e,n.codec())})(Ae||(Ae={}));var Ue;(function(n){let e;(function(t){t.GET_PROTOCOLS="GET_PROTOCOLS",t.GET_PEER_INFO="GET_PEER_INFO"})(e=n.Type||(n.Type={})),function(t){t.codec=()=>G(t)}(e=n.Type||(n.Type={})),n.codec=()=>L({1:{name:"type",codec:n.Type.codec()},2:{name:"id",codec:m,optional:!0},3:{name:"protos",codec:S,repeats:!0}}),n.encode=t=>E(t,n.codec()),n.decode=t=>x(t,n.codec())})(Ue||(Ue={}));var Ie;(function(n){n.codec=()=>L({1:{name:"peer",codec:W.codec(),optional:!0},2:{name:"protos",codec:S,repeats:!0}}),n.encode=e=>E(e,n.codec()),n.decode=e=>x(e,n.codec())})(Ie||(Ie={}));return Gt(Qr);})();
|
|
17
17
|
return Libp2PDaemonProtocol}));
|
package/dist/src/index.d.ts
CHANGED
|
@@ -23,9 +23,9 @@ export declare namespace Request {
|
|
|
23
23
|
PEERSTORE = "PEERSTORE"
|
|
24
24
|
}
|
|
25
25
|
namespace Type {
|
|
26
|
-
const codec: () => import("protons-runtime
|
|
26
|
+
const codec: () => import("protons-runtime").Codec<typeof Type>;
|
|
27
27
|
}
|
|
28
|
-
const codec: () => import("protons-runtime
|
|
28
|
+
const codec: () => import("protons-runtime").Codec<Request>;
|
|
29
29
|
const encode: (obj: Request) => Uint8Array;
|
|
30
30
|
const decode: (buf: Uint8Array) => Request;
|
|
31
31
|
}
|
|
@@ -45,9 +45,9 @@ export declare namespace Response {
|
|
|
45
45
|
ERROR = "ERROR"
|
|
46
46
|
}
|
|
47
47
|
namespace Type {
|
|
48
|
-
const codec: () => import("protons-runtime
|
|
48
|
+
const codec: () => import("protons-runtime").Codec<typeof Type>;
|
|
49
49
|
}
|
|
50
|
-
const codec: () => import("protons-runtime
|
|
50
|
+
const codec: () => import("protons-runtime").Codec<Response>;
|
|
51
51
|
const encode: (obj: Response) => Uint8Array;
|
|
52
52
|
const decode: (buf: Uint8Array) => Response;
|
|
53
53
|
}
|
|
@@ -56,7 +56,7 @@ export interface IdentifyResponse {
|
|
|
56
56
|
addrs: Uint8Array[];
|
|
57
57
|
}
|
|
58
58
|
export declare namespace IdentifyResponse {
|
|
59
|
-
const codec: () => import("protons-runtime
|
|
59
|
+
const codec: () => import("protons-runtime").Codec<IdentifyResponse>;
|
|
60
60
|
const encode: (obj: IdentifyResponse) => Uint8Array;
|
|
61
61
|
const decode: (buf: Uint8Array) => IdentifyResponse;
|
|
62
62
|
}
|
|
@@ -66,7 +66,7 @@ export interface ConnectRequest {
|
|
|
66
66
|
timeout?: bigint;
|
|
67
67
|
}
|
|
68
68
|
export declare namespace ConnectRequest {
|
|
69
|
-
const codec: () => import("protons-runtime
|
|
69
|
+
const codec: () => import("protons-runtime").Codec<ConnectRequest>;
|
|
70
70
|
const encode: (obj: ConnectRequest) => Uint8Array;
|
|
71
71
|
const decode: (buf: Uint8Array) => ConnectRequest;
|
|
72
72
|
}
|
|
@@ -76,7 +76,7 @@ export interface StreamOpenRequest {
|
|
|
76
76
|
timeout?: bigint;
|
|
77
77
|
}
|
|
78
78
|
export declare namespace StreamOpenRequest {
|
|
79
|
-
const codec: () => import("protons-runtime
|
|
79
|
+
const codec: () => import("protons-runtime").Codec<StreamOpenRequest>;
|
|
80
80
|
const encode: (obj: StreamOpenRequest) => Uint8Array;
|
|
81
81
|
const decode: (buf: Uint8Array) => StreamOpenRequest;
|
|
82
82
|
}
|
|
@@ -85,7 +85,7 @@ export interface StreamHandlerRequest {
|
|
|
85
85
|
proto: string[];
|
|
86
86
|
}
|
|
87
87
|
export declare namespace StreamHandlerRequest {
|
|
88
|
-
const codec: () => import("protons-runtime
|
|
88
|
+
const codec: () => import("protons-runtime").Codec<StreamHandlerRequest>;
|
|
89
89
|
const encode: (obj: StreamHandlerRequest) => Uint8Array;
|
|
90
90
|
const decode: (buf: Uint8Array) => StreamHandlerRequest;
|
|
91
91
|
}
|
|
@@ -93,7 +93,7 @@ export interface ErrorResponse {
|
|
|
93
93
|
msg: string;
|
|
94
94
|
}
|
|
95
95
|
export declare namespace ErrorResponse {
|
|
96
|
-
const codec: () => import("protons-runtime
|
|
96
|
+
const codec: () => import("protons-runtime").Codec<ErrorResponse>;
|
|
97
97
|
const encode: (obj: ErrorResponse) => Uint8Array;
|
|
98
98
|
const decode: (buf: Uint8Array) => ErrorResponse;
|
|
99
99
|
}
|
|
@@ -103,7 +103,7 @@ export interface StreamInfo {
|
|
|
103
103
|
proto: string;
|
|
104
104
|
}
|
|
105
105
|
export declare namespace StreamInfo {
|
|
106
|
-
const codec: () => import("protons-runtime
|
|
106
|
+
const codec: () => import("protons-runtime").Codec<StreamInfo>;
|
|
107
107
|
const encode: (obj: StreamInfo) => Uint8Array;
|
|
108
108
|
const decode: (buf: Uint8Array) => StreamInfo;
|
|
109
109
|
}
|
|
@@ -129,9 +129,9 @@ export declare namespace DHTRequest {
|
|
|
129
129
|
PROVIDE = "PROVIDE"
|
|
130
130
|
}
|
|
131
131
|
namespace Type {
|
|
132
|
-
const codec: () => import("protons-runtime
|
|
132
|
+
const codec: () => import("protons-runtime").Codec<typeof Type>;
|
|
133
133
|
}
|
|
134
|
-
const codec: () => import("protons-runtime
|
|
134
|
+
const codec: () => import("protons-runtime").Codec<DHTRequest>;
|
|
135
135
|
const encode: (obj: DHTRequest) => Uint8Array;
|
|
136
136
|
const decode: (buf: Uint8Array) => DHTRequest;
|
|
137
137
|
}
|
|
@@ -147,9 +147,9 @@ export declare namespace DHTResponse {
|
|
|
147
147
|
END = "END"
|
|
148
148
|
}
|
|
149
149
|
namespace Type {
|
|
150
|
-
const codec: () => import("protons-runtime
|
|
150
|
+
const codec: () => import("protons-runtime").Codec<typeof Type>;
|
|
151
151
|
}
|
|
152
|
-
const codec: () => import("protons-runtime
|
|
152
|
+
const codec: () => import("protons-runtime").Codec<DHTResponse>;
|
|
153
153
|
const encode: (obj: DHTResponse) => Uint8Array;
|
|
154
154
|
const decode: (buf: Uint8Array) => DHTResponse;
|
|
155
155
|
}
|
|
@@ -158,7 +158,7 @@ export interface PeerInfo {
|
|
|
158
158
|
addrs: Uint8Array[];
|
|
159
159
|
}
|
|
160
160
|
export declare namespace PeerInfo {
|
|
161
|
-
const codec: () => import("protons-runtime
|
|
161
|
+
const codec: () => import("protons-runtime").Codec<PeerInfo>;
|
|
162
162
|
const encode: (obj: PeerInfo) => Uint8Array;
|
|
163
163
|
const decode: (buf: Uint8Array) => PeerInfo;
|
|
164
164
|
}
|
|
@@ -175,9 +175,9 @@ export declare namespace ConnManagerRequest {
|
|
|
175
175
|
TRIM = "TRIM"
|
|
176
176
|
}
|
|
177
177
|
namespace Type {
|
|
178
|
-
const codec: () => import("protons-runtime
|
|
178
|
+
const codec: () => import("protons-runtime").Codec<typeof Type>;
|
|
179
179
|
}
|
|
180
|
-
const codec: () => import("protons-runtime
|
|
180
|
+
const codec: () => import("protons-runtime").Codec<ConnManagerRequest>;
|
|
181
181
|
const encode: (obj: ConnManagerRequest) => Uint8Array;
|
|
182
182
|
const decode: (buf: Uint8Array) => ConnManagerRequest;
|
|
183
183
|
}
|
|
@@ -185,7 +185,7 @@ export interface DisconnectRequest {
|
|
|
185
185
|
peer: Uint8Array;
|
|
186
186
|
}
|
|
187
187
|
export declare namespace DisconnectRequest {
|
|
188
|
-
const codec: () => import("protons-runtime
|
|
188
|
+
const codec: () => import("protons-runtime").Codec<DisconnectRequest>;
|
|
189
189
|
const encode: (obj: DisconnectRequest) => Uint8Array;
|
|
190
190
|
const decode: (buf: Uint8Array) => DisconnectRequest;
|
|
191
191
|
}
|
|
@@ -202,9 +202,9 @@ export declare namespace PSRequest {
|
|
|
202
202
|
SUBSCRIBE = "SUBSCRIBE"
|
|
203
203
|
}
|
|
204
204
|
namespace Type {
|
|
205
|
-
const codec: () => import("protons-runtime
|
|
205
|
+
const codec: () => import("protons-runtime").Codec<typeof Type>;
|
|
206
206
|
}
|
|
207
|
-
const codec: () => import("protons-runtime
|
|
207
|
+
const codec: () => import("protons-runtime").Codec<PSRequest>;
|
|
208
208
|
const encode: (obj: PSRequest) => Uint8Array;
|
|
209
209
|
const decode: (buf: Uint8Array) => PSRequest;
|
|
210
210
|
}
|
|
@@ -217,7 +217,7 @@ export interface PSMessage {
|
|
|
217
217
|
key?: Uint8Array;
|
|
218
218
|
}
|
|
219
219
|
export declare namespace PSMessage {
|
|
220
|
-
const codec: () => import("protons-runtime
|
|
220
|
+
const codec: () => import("protons-runtime").Codec<PSMessage>;
|
|
221
221
|
const encode: (obj: PSMessage) => Uint8Array;
|
|
222
222
|
const decode: (buf: Uint8Array) => PSMessage;
|
|
223
223
|
}
|
|
@@ -226,7 +226,7 @@ export interface PSResponse {
|
|
|
226
226
|
peerIDs: Uint8Array[];
|
|
227
227
|
}
|
|
228
228
|
export declare namespace PSResponse {
|
|
229
|
-
const codec: () => import("protons-runtime
|
|
229
|
+
const codec: () => import("protons-runtime").Codec<PSResponse>;
|
|
230
230
|
const encode: (obj: PSResponse) => Uint8Array;
|
|
231
231
|
const decode: (buf: Uint8Array) => PSResponse;
|
|
232
232
|
}
|
|
@@ -241,9 +241,9 @@ export declare namespace PeerstoreRequest {
|
|
|
241
241
|
GET_PEER_INFO = "GET_PEER_INFO"
|
|
242
242
|
}
|
|
243
243
|
namespace Type {
|
|
244
|
-
const codec: () => import("protons-runtime
|
|
244
|
+
const codec: () => import("protons-runtime").Codec<typeof Type>;
|
|
245
245
|
}
|
|
246
|
-
const codec: () => import("protons-runtime
|
|
246
|
+
const codec: () => import("protons-runtime").Codec<PeerstoreRequest>;
|
|
247
247
|
const encode: (obj: PeerstoreRequest) => Uint8Array;
|
|
248
248
|
const decode: (buf: Uint8Array) => PeerstoreRequest;
|
|
249
249
|
}
|
|
@@ -252,7 +252,7 @@ export interface PeerstoreResponse {
|
|
|
252
252
|
protos: string[];
|
|
253
253
|
}
|
|
254
254
|
export declare namespace PeerstoreResponse {
|
|
255
|
-
const codec: () => import("protons-runtime
|
|
255
|
+
const codec: () => import("protons-runtime").Codec<PeerstoreResponse>;
|
|
256
256
|
const encode: (obj: PeerstoreResponse) => Uint8Array;
|
|
257
257
|
const decode: (buf: Uint8Array) => PeerstoreResponse;
|
|
258
258
|
}
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,OAAO,CAAC,IAAI,CAAA;IAClB,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB,UAAU,CAAC,EAAE,iBAAiB,CAAA;IAC9B,aAAa,CAAC,EAAE,oBAAoB,CAAA;IACpC,GAAG,CAAC,EAAE,UAAU,CAAA;IAChB,WAAW,CAAC,EAAE,kBAAkB,CAAA;IAChC,UAAU,CAAC,EAAE,iBAAiB,CAAA;IAC9B,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,SAAS,CAAC,EAAE,gBAAgB,CAAA;CAC7B;AAED,yBAAiB,OAAO,CAAC;IACvB,KAAY,IAAI;QACd,QAAQ,aAAa;QACrB,OAAO,YAAY;QACnB,WAAW,gBAAgB;QAC3B,cAAc,mBAAmB;QACjC,GAAG,QAAQ;QACX,UAAU,eAAe;QACzB,WAAW,gBAAgB;QAC3B,UAAU,eAAe;QACzB,MAAM,WAAW;QACjB,SAAS,cAAc;KACxB;IAED,UAAiB,IAAI,CAAC;QACb,MAAM,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,OAAO,CAAC,IAAI,CAAA;IAClB,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB,UAAU,CAAC,EAAE,iBAAiB,CAAA;IAC9B,aAAa,CAAC,EAAE,oBAAoB,CAAA;IACpC,GAAG,CAAC,EAAE,UAAU,CAAA;IAChB,WAAW,CAAC,EAAE,kBAAkB,CAAA;IAChC,UAAU,CAAC,EAAE,iBAAiB,CAAA;IAC9B,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,SAAS,CAAC,EAAE,gBAAgB,CAAA;CAC7B;AAED,yBAAiB,OAAO,CAAC;IACvB,KAAY,IAAI;QACd,QAAQ,aAAa;QACrB,OAAO,YAAY;QACnB,WAAW,gBAAgB;QAC3B,cAAc,mBAAmB;QACjC,GAAG,QAAQ;QACX,UAAU,eAAe;QACzB,WAAW,gBAAgB;QAC3B,UAAU,eAAe;QACzB,MAAM,WAAW;QACjB,SAAS,cAAc;KACxB;IAED,UAAiB,IAAI,CAAC;QACb,MAAM,KAAK,oDAEjB,CAAA;KACF;IAEM,MAAM,KAAK,gDAYjB,CAAA;IAEM,MAAM,MAAM,QAAS,OAAO,KAAG,UAErC,CAAA;IAEM,MAAM,MAAM,QAAS,UAAU,KAAG,OAExC,CAAA;CACF;AAED,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAA;IACnB,KAAK,CAAC,EAAE,aAAa,CAAA;IACrB,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,QAAQ,CAAC,EAAE,gBAAgB,CAAA;IAC3B,GAAG,CAAC,EAAE,WAAW,CAAA;IACjB,KAAK,EAAE,QAAQ,EAAE,CAAA;IACjB,MAAM,CAAC,EAAE,UAAU,CAAA;IACnB,SAAS,CAAC,EAAE,iBAAiB,CAAA;CAC9B;AAED,yBAAiB,QAAQ,CAAC;IACxB,KAAY,IAAI;QACd,EAAE,OAAO;QACT,KAAK,UAAU;KAChB;IAED,UAAiB,IAAI,CAAC;QACb,MAAM,KAAK,oDAEjB,CAAA;KACF;IAEM,MAAM,KAAK,iDAWjB,CAAA;IAEM,MAAM,MAAM,QAAS,QAAQ,KAAG,UAEtC,CAAA;IAEM,MAAM,MAAM,QAAS,UAAU,KAAG,QAExC,CAAA;CACF;AAED,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,UAAU,CAAA;IACd,KAAK,EAAE,UAAU,EAAE,CAAA;CACpB;AAED,yBAAiB,gBAAgB,CAAC;IACzB,MAAM,KAAK,yDAKjB,CAAA;IAEM,MAAM,MAAM,QAAS,gBAAgB,KAAG,UAE9C,CAAA;IAEM,MAAM,MAAM,QAAS,UAAU,KAAG,gBAExC,CAAA;CACF;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,UAAU,CAAA;IAChB,KAAK,EAAE,UAAU,EAAE,CAAA;IACnB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,yBAAiB,cAAc,CAAC;IACvB,MAAM,KAAK,uDAMjB,CAAA;IAEM,MAAM,MAAM,QAAS,cAAc,KAAG,UAE5C,CAAA;IAEM,MAAM,MAAM,QAAS,UAAU,KAAG,cAExC,CAAA;CACF;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,UAAU,CAAA;IAChB,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,yBAAiB,iBAAiB,CAAC;IAC1B,MAAM,KAAK,0DAMjB,CAAA;IAEM,MAAM,MAAM,QAAS,iBAAiB,KAAG,UAE/C,CAAA;IAEM,MAAM,MAAM,QAAS,UAAU,KAAG,iBAExC,CAAA;CACF;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,UAAU,CAAA;IAChB,KAAK,EAAE,MAAM,EAAE,CAAA;CAChB;AAED,yBAAiB,oBAAoB,CAAC;IAC7B,MAAM,KAAK,6DAKjB,CAAA;IAEM,MAAM,MAAM,QAAS,oBAAoB,KAAG,UAElD,CAAA;IAEM,MAAM,MAAM,QAAS,UAAU,KAAG,oBAExC,CAAA;CACF;AAED,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAA;CACZ;AAED,yBAAiB,aAAa,CAAC;IACtB,MAAM,KAAK,sDAIjB,CAAA;IAEM,MAAM,MAAM,QAAS,aAAa,KAAG,UAE3C,CAAA;IAEM,MAAM,MAAM,QAAS,UAAU,KAAG,aAExC,CAAA;CACF;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,UAAU,CAAA;IAChB,IAAI,EAAE,UAAU,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;CACd;AAED,yBAAiB,UAAU,CAAC;IACnB,MAAM,KAAK,mDAMjB,CAAA;IAEM,MAAM,MAAM,QAAS,UAAU,KAAG,UAExC,CAAA;IAEM,MAAM,MAAM,QAAS,UAAU,KAAG,UAExC,CAAA;CACF;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,UAAU,CAAC,IAAI,CAAA;IACrB,IAAI,CAAC,EAAE,UAAU,CAAA;IACjB,GAAG,CAAC,EAAE,UAAU,CAAA;IAChB,GAAG,CAAC,EAAE,UAAU,CAAA;IAChB,KAAK,CAAC,EAAE,UAAU,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,yBAAiB,UAAU,CAAC;IAC1B,KAAY,IAAI;QACd,SAAS,cAAc;QACvB,4BAA4B,iCAAiC;QAC7D,cAAc,mBAAmB;QACjC,iBAAiB,sBAAsB;QACvC,cAAc,mBAAmB;QACjC,SAAS,cAAc;QACvB,YAAY,iBAAiB;QAC7B,SAAS,cAAc;QACvB,OAAO,YAAY;KACpB;IAED,UAAiB,IAAI,CAAC;QACb,MAAM,KAAK,oDAEjB,CAAA;KACF;IAEM,MAAM,KAAK,mDAUjB,CAAA;IAEM,MAAM,MAAM,QAAS,UAAU,KAAG,UAExC,CAAA;IAEM,MAAM,MAAM,QAAS,UAAU,KAAG,UAExC,CAAA;CACF;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,WAAW,CAAC,IAAI,CAAA;IACtB,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf,KAAK,CAAC,EAAE,UAAU,CAAA;CACnB;AAED,yBAAiB,WAAW,CAAC;IAC3B,KAAY,IAAI;QACd,KAAK,UAAU;QACf,KAAK,UAAU;QACf,GAAG,QAAQ;KACZ;IAED,UAAiB,IAAI,CAAC;QACb,MAAM,KAAK,oDAEjB,CAAA;KACF;IAEM,MAAM,KAAK,oDAMjB,CAAA;IAEM,MAAM,MAAM,QAAS,WAAW,KAAG,UAEzC,CAAA;IAEM,MAAM,MAAM,QAAS,UAAU,KAAG,WAExC,CAAA;CACF;AAED,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,UAAU,CAAA;IACd,KAAK,EAAE,UAAU,EAAE,CAAA;CACpB;AAED,yBAAiB,QAAQ,CAAC;IACjB,MAAM,KAAK,iDAKjB,CAAA;IAEM,MAAM,MAAM,QAAS,QAAQ,KAAG,UAEtC,CAAA;IAEM,MAAM,MAAM,QAAS,UAAU,KAAG,QAExC,CAAA;CACF;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,kBAAkB,CAAC,IAAI,CAAA;IAC7B,IAAI,CAAC,EAAE,UAAU,CAAA;IACjB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,yBAAiB,kBAAkB,CAAC;IAClC,KAAY,IAAI;QACd,QAAQ,aAAa;QACrB,UAAU,eAAe;QACzB,IAAI,SAAS;KACd;IAED,UAAiB,IAAI,CAAC;QACb,MAAM,KAAK,oDAEjB,CAAA;KACF;IAEM,MAAM,KAAK,2DAOjB,CAAA;IAEM,MAAM,MAAM,QAAS,kBAAkB,KAAG,UAEhD,CAAA;IAEM,MAAM,MAAM,QAAS,UAAU,KAAG,kBAExC,CAAA;CACF;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,UAAU,CAAA;CACjB;AAED,yBAAiB,iBAAiB,CAAC;IAC1B,MAAM,KAAK,0DAIjB,CAAA;IAEM,MAAM,MAAM,QAAS,iBAAiB,KAAG,UAE/C,CAAA;IAEM,MAAM,MAAM,QAAS,UAAU,KAAG,iBAExC,CAAA;CACF;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,SAAS,CAAC,IAAI,CAAA;IACpB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,UAAU,CAAA;CAClB;AAED,yBAAiB,SAAS,CAAC;IACzB,KAAY,IAAI;QACd,UAAU,eAAe;QACzB,UAAU,eAAe;QACzB,OAAO,YAAY;QACnB,SAAS,cAAc;KACxB;IAED,UAAiB,IAAI,CAAC;QACb,MAAM,KAAK,oDAEjB,CAAA;KACF;IAEM,MAAM,KAAK,kDAMjB,CAAA;IAEM,MAAM,MAAM,QAAS,SAAS,KAAG,UAEvC,CAAA;IAEM,MAAM,MAAM,QAAS,UAAU,KAAG,SAExC,CAAA;CACF;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,CAAC,EAAE,UAAU,CAAA;IACjB,IAAI,CAAC,EAAE,UAAU,CAAA;IACjB,KAAK,CAAC,EAAE,UAAU,CAAA;IAClB,QAAQ,EAAE,MAAM,EAAE,CAAA;IAClB,SAAS,CAAC,EAAE,UAAU,CAAA;IACtB,GAAG,CAAC,EAAE,UAAU,CAAA;CACjB;AAED,yBAAiB,SAAS,CAAC;IAClB,MAAM,KAAK,kDASjB,CAAA;IAEM,MAAM,MAAM,QAAS,SAAS,KAAG,UAEvC,CAAA;IAEM,MAAM,MAAM,QAAS,UAAU,KAAG,SAExC,CAAA;CACF;AAED,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,EAAE,CAAA;IAChB,OAAO,EAAE,UAAU,EAAE,CAAA;CACtB;AAED,yBAAiB,UAAU,CAAC;IACnB,MAAM,KAAK,mDAKjB,CAAA;IAEM,MAAM,MAAM,QAAS,UAAU,KAAG,UAExC,CAAA;IAEM,MAAM,MAAM,QAAS,UAAU,KAAG,UAExC,CAAA;CACF;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,gBAAgB,CAAC,IAAI,CAAA;IAC3B,EAAE,CAAC,EAAE,UAAU,CAAA;IACf,MAAM,EAAE,MAAM,EAAE,CAAA;CACjB;AAED,yBAAiB,gBAAgB,CAAC;IAChC,KAAY,IAAI;QACd,aAAa,kBAAkB;QAC/B,aAAa,kBAAkB;KAChC;IAED,UAAiB,IAAI,CAAC;QACb,MAAM,KAAK,oDAEjB,CAAA;KACF;IAEM,MAAM,KAAK,yDAMjB,CAAA;IAEM,MAAM,MAAM,QAAS,gBAAgB,KAAG,UAE9C,CAAA;IAEM,MAAM,MAAM,QAAS,UAAU,KAAG,gBAExC,CAAA;CACF;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf,MAAM,EAAE,MAAM,EAAE,CAAA;CACjB;AAED,yBAAiB,iBAAiB,CAAC;IAC1B,MAAM,KAAK,0DAKjB,CAAA;IAEM,MAAM,MAAM,QAAS,iBAAiB,KAAG,UAE/C,CAAA;IAEM,MAAM,MAAM,QAAS,UAAU,KAAG,iBAExC,CAAA;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@libp2p/daemon-protocol",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "Communication protocol between libp2p daemons and clients",
|
|
5
5
|
"author": "",
|
|
6
6
|
"license": "Apache-2.0 OR MIT",
|
|
@@ -149,10 +149,10 @@
|
|
|
149
149
|
"release": "aegir release"
|
|
150
150
|
},
|
|
151
151
|
"dependencies": {
|
|
152
|
-
"protons-runtime": "^1.0.
|
|
152
|
+
"protons-runtime": "^1.0.3"
|
|
153
153
|
},
|
|
154
154
|
"devDependencies": {
|
|
155
|
-
"aegir": "^37.0.
|
|
156
|
-
"protons": "^3.0.
|
|
155
|
+
"aegir": "^37.0.14",
|
|
156
|
+
"protons": "^3.0.3"
|
|
157
157
|
}
|
|
158
158
|
}
|