@libp2p/daemon-protocol 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.min.js +2 -2
- package/dist/src/index.d.ts +82 -82
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +236 -186
- package/dist/src/index.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +272 -222
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:()=>Xe,PSRequest:()=>Ae,PSResponse:()=>Ue,PeerInfo:()=>X,PeerstoreRequest:()=>Le,PeerstoreResponse:()=>Ie,Request:()=>Qe,Response:()=>We,StreamHandlerRequest:()=>me,StreamInfo:()=>be,StreamOpenRequest:()=>ge});function De(n,e){e||(e=n.reduce((o,c)=>o+c.length,0));let t=new Uint8Array(e),r=0;for(let o of n)t.set(o,r),r+=o.length;return t}var Re={};D(Re,{identity:()=>Ht});function Ft(n,e){if(n.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var o=0;o<n.length;o++){var c=n.charAt(o),i=c.charCodeAt(0);if(t[i]!==255)throw new TypeError(c+" is ambiguous");t[i]=o}var s=n.length,f=n.charAt(0),g=Math.log(s)/Math.log(256),h=Math.log(256)/Math.log(s);function x(a){if(a instanceof Uint8Array||(ArrayBuffer.isView(a)?a=new Uint8Array(a.buffer,a.byteOffset,a.byteLength):Array.isArray(a)&&(a=Uint8Array.from(a))),!(a instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(a.length===0)return"";for(var b=0,$=0,T=0,R=a.length;T!==R&&a[T]===0;)T++,b++;for(var B=(R-T)*h+1>>>0,S=new Uint8Array(B);T!==R;){for(var v=a[T],F=0,O=B-1;(v!==0||F<$)&&O!==-1;O--,F++)v+=256*S[O]>>>0,S[O]=v%s>>>0,v=v/s>>>0;if(v!==0)throw new Error("Non-zero carry");$=F,T++}for(var _=B-$;_!==B&&S[_]===0;)_++;for(var te=f.repeat(b);_<B;++_)te+=n.charAt(S[_]);return te}function l(a){if(typeof a!="string")throw new TypeError("Expected String");if(a.length===0)return new Uint8Array;var b=0;if(a[b]!==" "){for(var $=0,T=0;a[b]===f;)$++,b++;for(var R=(a.length-b)*g+1>>>0,B=new Uint8Array(R);a[b];){var S=t[a.charCodeAt(b)];if(S===255)return;for(var v=0,F=R-1;(S!==0||v<T)&&F!==-1;F--,v++)S+=s*B[F]>>>0,B[F]=S%256>>>0,S=S/256>>>0;if(S!==0)throw new Error("Non-zero carry");T=v,b++}if(a[b]!==" "){for(var O=R-T;O!==R&&B[O]===0;)O++;for(var _=new Uint8Array($+(R-O)),te=$;O!==R;)_[te++]=B[O++];return _}}}function N(a){var b=l(a);if(b)return b;throw new Error(`Non-${e} character`)}return{encode:x,decodeUnsafe:l,decode:N}}var Gt=Ft,kt=Gt,Ze=kt;var to=new Uint8Array(0);var et=(n,e)=>{if(n===e)return!0;if(n.byteLength!==e.byteLength)return!1;for(let t=0;t<n.byteLength;t++)if(n[t]!==e[t])return!1;return!0},M=n=>{if(n instanceof Uint8Array&&n.constructor.name==="Uint8Array")return n;if(n instanceof ArrayBuffer)return new Uint8Array(n);if(ArrayBuffer.isView(n))return new Uint8Array(n.buffer,n.byteOffset,n.byteLength);throw new Error("Unknown type, must be binary type")};var tt=n=>new TextEncoder().encode(n),nt=n=>new TextDecoder().decode(n);var Ce=class{constructor(e,t,r){this.name=e,this.prefix=t,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},Ne=class{constructor(e,t,r){this.name=e,this.prefix=t,this.baseDecode=r}decode(e){if(typeof e=="string")switch(e[0]){case this.prefix:return this.baseDecode(e.slice(1));default:throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`)}else throw Error("Can only multibase decode strings")}or(e){return ot(this,e)}},Te=class{constructor(e){this.decoders=e}or(e){return ot(this,e)}decode(e){let t=e[0],r=this.decoders[t];if(r)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},ot=(n,e)=>new Te({...n.decoders||{[n.prefix]:n},...e.decoders||{[e.prefix]:e}}),Oe=class{constructor(e,t,r,o){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=o,this.encoder=new Ce(e,t,r),this.decoder=new Ne(e,t,o)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}},ne=({name:n,prefix:e,encode:t,decode:r})=>new Oe(n,e,t,r),G=({prefix:n,name:e,alphabet:t})=>{let{encode:r,decode:o}=Ze(t,e);return ne({prefix:n,name:e,encode:r,decode:c=>M(o(c))})},$t=(n,e,t,r)=>{let o={};for(let h=0;h<e.length;++h)o[e[h]]=h;let c=n.length;for(;n[c-1]==="=";)--c;let i=new Uint8Array(c*t/8|0),s=0,f=0,g=0;for(let h=0;h<c;++h){let x=o[n[h]];if(x===void 0)throw new SyntaxError(`Non-${r} character`);f=f<<t|x,s+=t,s>=8&&(s-=8,i[g++]=255&f>>s)}if(s>=t||255&f<<8-s)throw new SyntaxError("Unexpected end of data");return i},jt=(n,e,t)=>{let r=e[e.length-1]==="=",o=(1<<t)-1,c="",i=0,s=0;for(let f=0;f<n.length;++f)for(s=s<<8|n[f],i+=8;i>t;)i-=t,c+=e[o&s>>i];if(i&&(c+=e[o&s<<t-i]),r)for(;c.length*t&7;)c+="=";return c},y=({name:n,prefix:e,bitsPerChar:t,alphabet:r})=>ne({prefix:e,name:n,encode(o){return jt(o,r,t)},decode(o){return $t(o,r,t,n)}});var Ht=ne({prefix:"\0",name:"identity",encode:n=>nt(n),decode:n=>tt(n)});var Be={};D(Be,{base2:()=>Yt});var Yt=y({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var ve={};D(ve,{base8:()=>Jt});var Jt=y({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Pe={};D(Pe,{base10:()=>Kt});var Kt=G({prefix:"9",name:"base10",alphabet:"0123456789"});var Ve={};D(Ve,{base16:()=>qt,base16upper:()=>Xt});var qt=y({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Xt=y({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var _e={};D(_e,{base32:()=>H,base32hex:()=>en,base32hexpad:()=>nn,base32hexpadupper:()=>rn,base32hexupper:()=>tn,base32pad:()=>Wt,base32padupper:()=>Zt,base32upper:()=>Qt,base32z:()=>on});var H=y({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Qt=y({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Wt=y({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Zt=y({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),en=y({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),tn=y({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),nn=y({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),rn=y({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),on=y({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Me={};D(Me,{base36:()=>cn,base36upper:()=>sn});var cn=G({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),sn=G({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var ze={};D(ze,{base58btc:()=>P,base58flickr:()=>an});var P=G({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),an=G({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Fe={};D(Fe,{base64:()=>dn,base64pad:()=>pn,base64url:()=>fn,base64urlpad:()=>un});var dn=y({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),pn=y({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),fn=y({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),un=y({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var je={};D(je,{sha256:()=>On,sha512:()=>Rn});var hn=st,ct=128,gn=127,mn=~gn,ln=Math.pow(2,31);function st(n,e,t){e=e||[],t=t||0;for(var r=t;n>=ln;)e[t++]=n&255|ct,n/=128;for(;n&mn;)e[t++]=n&255|ct,n>>>=7;return e[t]=n|0,st.bytes=t-r+1,e}var bn=Ge,wn=128,it=127;function Ge(n,r){var t=0,r=r||0,o=0,c=r,i,s=n.length;do{if(c>=s)throw Ge.bytes=0,new RangeError("Could not decode varint");i=n[c++],t+=o<28?(i&it)<<o:(i&it)*Math.pow(2,o),o+=7}while(i>=wn);return Ge.bytes=c-r,t}var xn=Math.pow(2,7),yn=Math.pow(2,14),En=Math.pow(2,21),An=Math.pow(2,28),Un=Math.pow(2,35),Ln=Math.pow(2,42),In=Math.pow(2,49),Sn=Math.pow(2,56),Dn=Math.pow(2,63),Cn=function(n){return n<xn?1:n<yn?2:n<En?3:n<An?4:n<Un?5:n<Ln?6:n<In?7:n<Sn?8:n<Dn?9:10},Nn={encode:hn,decode:bn,encodingLength:Cn},Tn=Nn,Q=Tn;var W=n=>[Q.decode(n),Q.decode.bytes],Y=(n,e,t=0)=>(Q.encode(n,e,t),e),J=n=>Q.encodingLength(n);var j=(n,e)=>{let t=e.byteLength,r=J(n),o=r+J(t),c=new Uint8Array(o+t);return Y(n,c,0),Y(t,c,r),c.set(e,o),new K(n,t,e,c)},at=n=>{let e=M(n),[t,r]=W(e),[o,c]=W(e.subarray(r)),i=e.subarray(r+c);if(i.byteLength!==o)throw new Error("Incorrect length");return new K(t,o,i,e)},dt=(n,e)=>n===e?!0:n.code===e.code&&n.size===e.size&&et(n.bytes,e.bytes),K=class{constructor(e,t,r,o){this.code=e,this.size=t,this.digest=r,this.bytes=o}};var $e=({name:n,code:e,encode:t})=>new ke(n,e,t),ke=class{constructor(e,t,r){this.name=e,this.code=t,this.encode=r}digest(e){if(e instanceof Uint8Array){let t=this.encode(e);return t instanceof Uint8Array?j(this.code,t):t.then(r=>j(this.code,r))}else throw Error("Unknown type, must be binary type")}};var ft=n=>async e=>new Uint8Array(await crypto.subtle.digest(n,e)),On=$e({name:"sha2-256",code:18,encode:ft("SHA-256")}),Rn=$e({name:"sha2-512",code:19,encode:ft("SHA-512")});var He={};D(He,{identity:()=>Pn});var ut=0,Bn="identity",ht=M,vn=n=>j(ut,ht(n)),Pn={code:ut,name:Bn,encode:ht,digest:vn};var Ao=new TextEncoder,Uo=new TextDecoder;var L=class{constructor(e,t,r,o){this.code=t,this.version=e,this.multihash=r,this.bytes=o,this.byteOffset=o.byteOffset,this.byteLength=o.byteLength,this.asCID=this,this._baseCache=new Map,Object.defineProperties(this,{byteOffset:ce,byteLength:ce,code:oe,version:oe,multihash:oe,bytes:oe,_baseCache:ce,asCID:ce})}toV0(){switch(this.version){case 0:return this;default:{let{code:e,multihash:t}=this;if(e!==ee)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==Gn)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return L.createV0(t)}}}toV1(){switch(this.version){case 0:{let{code:e,digest:t}=this.multihash,r=j(e,t);return L.createV1(this.code,r)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}equals(e){return e&&this.code===e.code&&this.version===e.version&&dt(this.multihash,e.multihash)}toString(e){let{bytes:t,version:r,_baseCache:o}=this;switch(r){case 0:return zn(t,o,e||P.encoder);default:return Fn(t,o,e||H.encoder)}}toJSON(){return{code:this.code,version:this.version,hash:this.multihash.bytes}}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return"CID("+this.toString()+")"}static isCID(e){return $n(/^0\.0/,jn),!!(e&&(e[mt]||e.asCID===e))}get toBaseEncodedString(){throw new Error("Deprecated, use .toString()")}get codec(){throw new Error('"codec" property is deprecated, use integer "code" property instead')}get buffer(){throw new Error("Deprecated .buffer property, use .bytes to get Uint8Array instead")}get multibaseName(){throw new Error('"multibaseName" property is deprecated')}get prefix(){throw new Error('"prefix" property is deprecated')}static asCID(e){if(e instanceof L)return e;if(e!=null&&e.asCID===e){let{version:t,code:r,multihash:o,bytes:c}=e;return new L(t,r,o,c||gt(t,r,o.bytes))}else if(e!=null&&e[mt]===!0){let{version:t,multihash:r,code:o}=e,c=at(r);return L.create(t,o,c)}else return null}static create(e,t,r){if(typeof t!="number")throw new Error("String codecs are no longer supported");switch(e){case 0:{if(t!==ee)throw new Error(`Version 0 CID must use dag-pb (code: ${ee}) block encoding`);return new L(e,t,r,r.bytes)}case 1:{let o=gt(e,t,r.bytes);return new L(e,t,r,o)}default:throw new Error("Invalid version")}}static createV0(e){return L.create(0,ee,e)}static createV1(e,t){return L.create(1,e,t)}static decode(e){let[t,r]=L.decodeFirst(e);if(r.length)throw new Error("Incorrect length");return t}static decodeFirst(e){let t=L.inspectBytes(e),r=t.size-t.multihashSize,o=M(e.subarray(r,r+t.multihashSize));if(o.byteLength!==t.multihashSize)throw new Error("Incorrect length");let c=o.subarray(t.multihashSize-t.digestSize),i=new K(t.multihashCode,t.digestSize,c,o);return[t.version===0?L.createV0(i):L.createV1(t.codec,i),e.subarray(t.size)]}static inspectBytes(e){let t=0,r=()=>{let[x,l]=W(e.subarray(t));return t+=l,x},o=r(),c=ee;if(o===18?(o=0,t=0):o===1&&(c=r()),o!==0&&o!==1)throw new RangeError(`Invalid CID version ${o}`);let i=t,s=r(),f=r(),g=t+f,h=g-i;return{version:o,codec:c,multihashCode:s,digestSize:f,multihashSize:h,size:g}}static parse(e,t){let[r,o]=Mn(e,t),c=L.decode(o);return c._baseCache.set(r,e),c}},Mn=(n,e)=>{switch(n[0]){case"Q":{let t=e||P;return[P.prefix,t.decode(`${P.prefix}${n}`)]}case P.prefix:{let t=e||P;return[P.prefix,t.decode(n)]}case H.prefix:{let t=e||H;return[H.prefix,t.decode(n)]}default:{if(e==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[n[0],e.decode(n)]}}},zn=(n,e,t)=>{let{prefix:r}=t;if(r!==P.prefix)throw Error(`Cannot string encode V0 in ${t.name} encoding`);let o=e.get(r);if(o==null){let c=t.encode(n).slice(1);return e.set(r,c),c}else return o},Fn=(n,e,t)=>{let{prefix:r}=t,o=e.get(r);if(o==null){let c=t.encode(n);return e.set(r,c),c}else return o},ee=112,Gn=18,gt=(n,e,t)=>{let r=J(n),o=r+J(e),c=new Uint8Array(o+t.byteLength);return Y(n,c,0),Y(e,c,r),c.set(t,o),c},mt=Symbol.for("@ipld/js-cid/CID"),oe={writable:!1,configurable:!1,enumerable:!0},ce={writable:!1,enumerable:!1,configurable:!1},kn="0.0.0-dev",$n=(n,e)=>{if(n.test(kn))console.warn(e);else throw new Error(e)},jn=`CID.isCID(v) is deprecated and will be removed in the next major release.
|
|
2
|
+
var Libp2PDaemonProtocol=(()=>{var Se=Object.defineProperty;var Pt=Object.getOwnPropertyDescriptor;var Vt=Object.getOwnPropertyNames;var _t=Object.prototype.hasOwnProperty;var D=(n,e)=>{for(var t in e)Se(n,t,{get:e[t],enumerable:!0})},Mt=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Vt(e))!_t.call(n,o)&&o!==t&&Se(n,o,{get:()=>e[o],enumerable:!(r=Pt(e,o))||r.enumerable});return n};var zt=n=>Mt(Se({},"__esModule",{value:!0}),n);var qr={};D(qr,{ConnManagerRequest:()=>ye,ConnectRequest:()=>he,DHTRequest:()=>we,DHTResponse:()=>xe,DisconnectRequest:()=>Ee,ErrorResponse:()=>le,IdentifyResponse:()=>ue,PSMessage:()=>We,PSRequest:()=>Ae,PSResponse:()=>Ue,PeerInfo:()=>X,PeerstoreRequest:()=>Le,PeerstoreResponse:()=>Ie,Request:()=>Xe,Response:()=>Qe,StreamHandlerRequest:()=>me,StreamInfo:()=>be,StreamOpenRequest:()=>ge});function De(n,e){e||(e=n.reduce((o,c)=>o+c.length,0));let t=new Uint8Array(e),r=0;for(let o of n)t.set(o,r),r+=o.length;return t}var Re={};D(Re,{identity:()=>Ht});function Ft(n,e){if(n.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var o=0;o<n.length;o++){var c=n.charAt(o),i=c.charCodeAt(0);if(t[i]!==255)throw new TypeError(c+" is ambiguous");t[i]=o}var s=n.length,f=n.charAt(0),g=Math.log(s)/Math.log(256),h=Math.log(256)/Math.log(s);function x(a){if(a instanceof Uint8Array||(ArrayBuffer.isView(a)?a=new Uint8Array(a.buffer,a.byteOffset,a.byteLength):Array.isArray(a)&&(a=Uint8Array.from(a))),!(a instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(a.length===0)return"";for(var b=0,$=0,T=0,R=a.length;T!==R&&a[T]===0;)T++,b++;for(var B=(R-T)*h+1>>>0,S=new Uint8Array(B);T!==R;){for(var v=a[T],F=0,O=B-1;(v!==0||F<$)&&O!==-1;O--,F++)v+=256*S[O]>>>0,S[O]=v%s>>>0,v=v/s>>>0;if(v!==0)throw new Error("Non-zero carry");$=F,T++}for(var _=B-$;_!==B&&S[_]===0;)_++;for(var te=f.repeat(b);_<B;++_)te+=n.charAt(S[_]);return te}function l(a){if(typeof a!="string")throw new TypeError("Expected String");if(a.length===0)return new Uint8Array;var b=0;if(a[b]!==" "){for(var $=0,T=0;a[b]===f;)$++,b++;for(var R=(a.length-b)*g+1>>>0,B=new Uint8Array(R);a[b];){var S=t[a.charCodeAt(b)];if(S===255)return;for(var v=0,F=R-1;(S!==0||v<T)&&F!==-1;F--,v++)S+=s*B[F]>>>0,B[F]=S%256>>>0,S=S/256>>>0;if(S!==0)throw new Error("Non-zero carry");T=v,b++}if(a[b]!==" "){for(var O=R-T;O!==R&&B[O]===0;)O++;for(var _=new Uint8Array($+(R-O)),te=$;O!==R;)_[te++]=B[O++];return _}}}function N(a){var b=l(a);if(b)return b;throw new Error(`Non-${e} character`)}return{encode:x,decodeUnsafe:l,decode:N}}var Gt=Ft,kt=Gt,Ze=kt;var to=new Uint8Array(0);var et=(n,e)=>{if(n===e)return!0;if(n.byteLength!==e.byteLength)return!1;for(let t=0;t<n.byteLength;t++)if(n[t]!==e[t])return!1;return!0},M=n=>{if(n instanceof Uint8Array&&n.constructor.name==="Uint8Array")return n;if(n instanceof ArrayBuffer)return new Uint8Array(n);if(ArrayBuffer.isView(n))return new Uint8Array(n.buffer,n.byteOffset,n.byteLength);throw new Error("Unknown type, must be binary type")};var tt=n=>new TextEncoder().encode(n),nt=n=>new TextDecoder().decode(n);var Ce=class{constructor(e,t,r){this.name=e,this.prefix=t,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},Ne=class{constructor(e,t,r){this.name=e,this.prefix=t,this.baseDecode=r}decode(e){if(typeof e=="string")switch(e[0]){case this.prefix:return this.baseDecode(e.slice(1));default:throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`)}else throw Error("Can only multibase decode strings")}or(e){return ot(this,e)}},Te=class{constructor(e){this.decoders=e}or(e){return ot(this,e)}decode(e){let t=e[0],r=this.decoders[t];if(r)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},ot=(n,e)=>new Te({...n.decoders||{[n.prefix]:n},...e.decoders||{[e.prefix]:e}}),Oe=class{constructor(e,t,r,o){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=o,this.encoder=new Ce(e,t,r),this.decoder=new Ne(e,t,o)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}},ne=({name:n,prefix:e,encode:t,decode:r})=>new Oe(n,e,t,r),G=({prefix:n,name:e,alphabet:t})=>{let{encode:r,decode:o}=Ze(t,e);return ne({prefix:n,name:e,encode:r,decode:c=>M(o(c))})},$t=(n,e,t,r)=>{let o={};for(let h=0;h<e.length;++h)o[e[h]]=h;let c=n.length;for(;n[c-1]==="=";)--c;let i=new Uint8Array(c*t/8|0),s=0,f=0,g=0;for(let h=0;h<c;++h){let x=o[n[h]];if(x===void 0)throw new SyntaxError(`Non-${r} character`);f=f<<t|x,s+=t,s>=8&&(s-=8,i[g++]=255&f>>s)}if(s>=t||255&f<<8-s)throw new SyntaxError("Unexpected end of data");return i},jt=(n,e,t)=>{let r=e[e.length-1]==="=",o=(1<<t)-1,c="",i=0,s=0;for(let f=0;f<n.length;++f)for(s=s<<8|n[f],i+=8;i>t;)i-=t,c+=e[o&s>>i];if(i&&(c+=e[o&s<<t-i]),r)for(;c.length*t&7;)c+="=";return c},y=({name:n,prefix:e,bitsPerChar:t,alphabet:r})=>ne({prefix:e,name:n,encode(o){return jt(o,r,t)},decode(o){return $t(o,r,t,n)}});var Ht=ne({prefix:"\0",name:"identity",encode:n=>nt(n),decode:n=>tt(n)});var Be={};D(Be,{base2:()=>Yt});var Yt=y({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var ve={};D(ve,{base8:()=>Jt});var Jt=y({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Pe={};D(Pe,{base10:()=>Kt});var Kt=G({prefix:"9",name:"base10",alphabet:"0123456789"});var Ve={};D(Ve,{base16:()=>qt,base16upper:()=>Xt});var qt=y({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Xt=y({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var _e={};D(_e,{base32:()=>H,base32hex:()=>en,base32hexpad:()=>nn,base32hexpadupper:()=>rn,base32hexupper:()=>tn,base32pad:()=>Wt,base32padupper:()=>Zt,base32upper:()=>Qt,base32z:()=>on});var H=y({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Qt=y({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Wt=y({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Zt=y({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),en=y({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),tn=y({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),nn=y({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),rn=y({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),on=y({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Me={};D(Me,{base36:()=>cn,base36upper:()=>sn});var cn=G({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),sn=G({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var ze={};D(ze,{base58btc:()=>P,base58flickr:()=>an});var P=G({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),an=G({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Fe={};D(Fe,{base64:()=>dn,base64pad:()=>pn,base64url:()=>fn,base64urlpad:()=>un});var dn=y({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),pn=y({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),fn=y({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),un=y({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var je={};D(je,{sha256:()=>On,sha512:()=>Rn});var hn=st,ct=128,gn=127,mn=~gn,ln=Math.pow(2,31);function st(n,e,t){e=e||[],t=t||0;for(var r=t;n>=ln;)e[t++]=n&255|ct,n/=128;for(;n&mn;)e[t++]=n&255|ct,n>>>=7;return e[t]=n|0,st.bytes=t-r+1,e}var bn=Ge,wn=128,it=127;function Ge(n,r){var t=0,r=r||0,o=0,c=r,i,s=n.length;do{if(c>=s)throw Ge.bytes=0,new RangeError("Could not decode varint");i=n[c++],t+=o<28?(i&it)<<o:(i&it)*Math.pow(2,o),o+=7}while(i>=wn);return Ge.bytes=c-r,t}var xn=Math.pow(2,7),yn=Math.pow(2,14),En=Math.pow(2,21),An=Math.pow(2,28),Un=Math.pow(2,35),Ln=Math.pow(2,42),In=Math.pow(2,49),Sn=Math.pow(2,56),Dn=Math.pow(2,63),Cn=function(n){return n<xn?1:n<yn?2:n<En?3:n<An?4:n<Un?5:n<Ln?6:n<In?7:n<Sn?8:n<Dn?9:10},Nn={encode:hn,decode:bn,encodingLength:Cn},Tn=Nn,Q=Tn;var W=n=>[Q.decode(n),Q.decode.bytes],Y=(n,e,t=0)=>(Q.encode(n,e,t),e),J=n=>Q.encodingLength(n);var j=(n,e)=>{let t=e.byteLength,r=J(n),o=r+J(t),c=new Uint8Array(o+t);return Y(n,c,0),Y(t,c,r),c.set(e,o),new K(n,t,e,c)},at=n=>{let e=M(n),[t,r]=W(e),[o,c]=W(e.subarray(r)),i=e.subarray(r+c);if(i.byteLength!==o)throw new Error("Incorrect length");return new K(t,o,i,e)},dt=(n,e)=>n===e?!0:n.code===e.code&&n.size===e.size&&et(n.bytes,e.bytes),K=class{constructor(e,t,r,o){this.code=e,this.size=t,this.digest=r,this.bytes=o}};var $e=({name:n,code:e,encode:t})=>new ke(n,e,t),ke=class{constructor(e,t,r){this.name=e,this.code=t,this.encode=r}digest(e){if(e instanceof Uint8Array){let t=this.encode(e);return t instanceof Uint8Array?j(this.code,t):t.then(r=>j(this.code,r))}else throw Error("Unknown type, must be binary type")}};var ft=n=>async e=>new Uint8Array(await crypto.subtle.digest(n,e)),On=$e({name:"sha2-256",code:18,encode:ft("SHA-256")}),Rn=$e({name:"sha2-512",code:19,encode:ft("SHA-512")});var He={};D(He,{identity:()=>Pn});var ut=0,Bn="identity",ht=M,vn=n=>j(ut,ht(n)),Pn={code:ut,name:Bn,encode:ht,digest:vn};var Ao=new TextEncoder,Uo=new TextDecoder;var L=class{constructor(e,t,r,o){this.code=t,this.version=e,this.multihash=r,this.bytes=o,this.byteOffset=o.byteOffset,this.byteLength=o.byteLength,this.asCID=this,this._baseCache=new Map,Object.defineProperties(this,{byteOffset:ce,byteLength:ce,code:oe,version:oe,multihash:oe,bytes:oe,_baseCache:ce,asCID:ce})}toV0(){switch(this.version){case 0:return this;default:{let{code:e,multihash:t}=this;if(e!==ee)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==Gn)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return L.createV0(t)}}}toV1(){switch(this.version){case 0:{let{code:e,digest:t}=this.multihash,r=j(e,t);return L.createV1(this.code,r)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}equals(e){return e&&this.code===e.code&&this.version===e.version&&dt(this.multihash,e.multihash)}toString(e){let{bytes:t,version:r,_baseCache:o}=this;switch(r){case 0:return zn(t,o,e||P.encoder);default:return Fn(t,o,e||H.encoder)}}toJSON(){return{code:this.code,version:this.version,hash:this.multihash.bytes}}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return"CID("+this.toString()+")"}static isCID(e){return $n(/^0\.0/,jn),!!(e&&(e[mt]||e.asCID===e))}get toBaseEncodedString(){throw new Error("Deprecated, use .toString()")}get codec(){throw new Error('"codec" property is deprecated, use integer "code" property instead')}get buffer(){throw new Error("Deprecated .buffer property, use .bytes to get Uint8Array instead")}get multibaseName(){throw new Error('"multibaseName" property is deprecated')}get prefix(){throw new Error('"prefix" property is deprecated')}static asCID(e){if(e instanceof L)return e;if(e!=null&&e.asCID===e){let{version:t,code:r,multihash:o,bytes:c}=e;return new L(t,r,o,c||gt(t,r,o.bytes))}else if(e!=null&&e[mt]===!0){let{version:t,multihash:r,code:o}=e,c=at(r);return L.create(t,o,c)}else return null}static create(e,t,r){if(typeof t!="number")throw new Error("String codecs are no longer supported");switch(e){case 0:{if(t!==ee)throw new Error(`Version 0 CID must use dag-pb (code: ${ee}) block encoding`);return new L(e,t,r,r.bytes)}case 1:{let o=gt(e,t,r.bytes);return new L(e,t,r,o)}default:throw new Error("Invalid version")}}static createV0(e){return L.create(0,ee,e)}static createV1(e,t){return L.create(1,e,t)}static decode(e){let[t,r]=L.decodeFirst(e);if(r.length)throw new Error("Incorrect length");return t}static decodeFirst(e){let t=L.inspectBytes(e),r=t.size-t.multihashSize,o=M(e.subarray(r,r+t.multihashSize));if(o.byteLength!==t.multihashSize)throw new Error("Incorrect length");let c=o.subarray(t.multihashSize-t.digestSize),i=new K(t.multihashCode,t.digestSize,c,o);return[t.version===0?L.createV0(i):L.createV1(t.codec,i),e.subarray(t.size)]}static inspectBytes(e){let t=0,r=()=>{let[x,l]=W(e.subarray(t));return t+=l,x},o=r(),c=ee;if(o===18?(o=0,t=0):o===1&&(c=r()),o!==0&&o!==1)throw new RangeError(`Invalid CID version ${o}`);let i=t,s=r(),f=r(),g=t+f,h=g-i;return{version:o,codec:c,multihashCode:s,digestSize:f,multihashSize:h,size:g}}static parse(e,t){let[r,o]=Mn(e,t),c=L.decode(o);return c._baseCache.set(r,e),c}},Mn=(n,e)=>{switch(n[0]){case"Q":{let t=e||P;return[P.prefix,t.decode(`${P.prefix}${n}`)]}case P.prefix:{let t=e||P;return[P.prefix,t.decode(n)]}case H.prefix:{let t=e||H;return[H.prefix,t.decode(n)]}default:{if(e==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[n[0],e.decode(n)]}}},zn=(n,e,t)=>{let{prefix:r}=t;if(r!==P.prefix)throw Error(`Cannot string encode V0 in ${t.name} encoding`);let o=e.get(r);if(o==null){let c=t.encode(n).slice(1);return e.set(r,c),c}else return o},Fn=(n,e,t)=>{let{prefix:r}=t,o=e.get(r);if(o==null){let c=t.encode(n);return e.set(r,c),c}else return o},ee=112,Gn=18,gt=(n,e,t)=>{let r=J(n),o=r+J(e),c=new Uint8Array(o+t.byteLength);return Y(n,c,0),Y(e,c,r),c.set(t,o),c},mt=Symbol.for("@ipld/js-cid/CID"),oe={writable:!1,configurable:!1,enumerable:!0},ce={writable:!1,enumerable:!1,configurable:!1},kn="0.0.0-dev",$n=(n,e)=>{if(n.test(kn))console.warn(e);else throw new Error(e)},jn=`CID.isCID(v) is deprecated and will be removed in the next major release.
|
|
3
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 ue;(r=>(r.codec=U({1:{name:"id",codec:m},2:{name:"addrs",codec:m,repeats:!0}}),r.encode=o=>A(o,r.codec),r.decode=o=>E(o,r.codec)))(ue||(ue={}));var he;(r=>(r.codec=U({1:{name:"peer",codec:m},2:{name:"addrs",codec:m,repeats:!0},3:{name:"timeout",codec:q,optional:!0}}),r.encode=o=>A(o,r.codec),r.decode=o=>E(o,r.codec)))(he||(he={}));var ge;(r=>(r.codec=U({1:{name:"peer",codec:m},2:{name:"proto",codec:C,repeats:!0},3:{name:"timeout",codec:q,optional:!0}}),r.encode=o=>A(o,r.codec),r.decode=o=>E(o,r.codec)))(ge||(ge={}));var me;(r=>(r.codec=U({1:{name:"addr",codec:m},2:{name:"proto",codec:C,repeats:!0}}),r.encode=o=>A(o,r.codec),r.decode=o=>E(o,r.codec)))(me||(me={}));var le;(r=>(r.codec=U({1:{name:"msg",codec:C}}),r.encode=o=>A(o,r.codec),r.decode=o=>E(o,r.codec)))(le||(le={}));var be;(r=>(r.codec=U({1:{name:"peer",codec:m},2:{name:"addr",codec:m},3:{name:"proto",codec:C}}),r.encode=o=>A(o,r.codec),r.decode=o=>E(o,r.codec)))(be||(be={}));var we;(o=>{let n;(a=>(a.FIND_PEER="FIND_PEER",a.FIND_PEERS_CONNECTED_TO_PEER="FIND_PEERS_CONNECTED_TO_PEER",a.FIND_PROVIDERS="FIND_PROVIDERS",a.GET_CLOSEST_PEERS="GET_CLOSEST_PEERS",a.GET_PUBLIC_KEY="GET_PUBLIC_KEY",a.GET_VALUE="GET_VALUE",a.SEARCH_VALUE="SEARCH_VALUE",a.PUT_VALUE="PUT_VALUE",a.PROVIDE="PROVIDE"))(n=o.Type||(o.Type={})),(i=>i.codec=z(i))(n=o.Type||(o.Type={})),o.codec=U({1:{name:"type",codec:o.Type.codec},2:{name:"peer",codec:m,optional:!0},3:{name:"cid",codec:m,optional:!0},4:{name:"key",codec:m,optional:!0},5:{name:"value",codec:m,optional:!0},6:{name:"count",codec:qe,optional:!0},7:{name:"timeout",codec:q,optional:!0}}),o.encode=c=>A(c,o.codec),o.decode=c=>E(c,o.codec)})(we||(we={}));var X;(r=>(r.codec=U({1:{name:"id",codec:m},2:{name:"addrs",codec:m,repeats:!0}}),r.encode=o=>A(o,r.codec),r.decode=o=>E(o,r.codec)))(X||(X={}));var xe;(o=>{let n;(f=>(f.BEGIN="BEGIN",f.VALUE="VALUE",f.END="END"))(n=o.Type||(o.Type={})),(i=>i.codec=z(i))(n=o.Type||(o.Type={})),o.codec=U({1:{name:"type",codec:o.Type.codec},2:{name:"peer",codec:X.codec,optional:!0},3:{name:"value",codec:m,optional:!0}}),o.encode=c=>A(c,o.codec),o.decode=c=>E(c,o.codec)})(xe||(xe={}));var ye;(o=>{let n;(f=>(f.TAG_PEER="TAG_PEER",f.UNTAG_PEER="UNTAG_PEER",f.TRIM="TRIM"))(n=o.Type||(o.Type={})),(i=>i.codec=z(i))(n=o.Type||(o.Type={})),o.codec=U({1:{name:"type",codec:o.Type.codec},2:{name:"peer",codec:m,optional:!0},3:{name:"tag",codec:C,optional:!0},4:{name:"weight",codec:q,optional:!0}}),o.encode=c=>A(c,o.codec),o.decode=c=>E(c,o.codec)})(ye||(ye={}));var Ee;(r=>(r.codec=U({1:{name:"peer",codec:m}}),r.encode=o=>A(o,r.codec),r.decode=o=>E(o,r.codec)))(Ee||(Ee={}));var Ae;(o=>{let n;(g=>(g.GET_TOPICS="GET_TOPICS",g.LIST_PEERS="LIST_PEERS",g.PUBLISH="PUBLISH",g.SUBSCRIBE="SUBSCRIBE"))(n=o.Type||(o.Type={})),(i=>i.codec=z(i))(n=o.Type||(o.Type={})),o.codec=U({1:{name:"type",codec:o.Type.codec},2:{name:"topic",codec:C,optional:!0},3:{name:"data",codec:m,optional:!0}}),o.encode=c=>A(c,o.codec),o.decode=c=>E(c,o.codec)})(Ae||(Ae={}));var Xe;(r=>(r.codec=U({1:{name:"from",codec:m,optional:!0},2:{name:"data",codec:m,optional:!0},3:{name:"seqno",codec:m,optional:!0},4:{name:"topicIDs",codec:C,repeats:!0},5:{name:"signature",codec:m,optional:!0},6:{name:"key",codec:m,optional:!0}}),r.encode=o=>A(o,r.codec),r.decode=o=>E(o,r.codec)))(Xe||(Xe={}));var Ue;(r=>(r.codec=U({1:{name:"topics",codec:C,repeats:!0},2:{name:"peerIDs",codec:m,repeats:!0}}),r.encode=o=>A(o,r.codec),r.decode=o=>E(o,r.codec)))(Ue||(Ue={}));var Le;(o=>{let n;(s=>(s.GET_PROTOCOLS="GET_PROTOCOLS",s.GET_PEER_INFO="GET_PEER_INFO"))(n=o.Type||(o.Type={})),(i=>i.codec=z(i))(n=o.Type||(o.Type={})),o.codec=U({1:{name:"type",codec:o.Type.codec},2:{name:"id",codec:m,optional:!0},3:{name:"protos",codec:C,repeats:!0}}),o.encode=c=>A(c,o.codec),o.decode=c=>E(c,o.codec)})(Le||(Le={}));var Ie;(r=>(r.codec=U({1:{name:"peer",codec:X.codec,optional:!0},2:{name:"protos",codec:C,repeats:!0}}),r.encode=o=>A(o,r.codec),r.decode=o=>E(o,r.codec)))(Ie||(Ie={}));var Qe;(o=>{let n;(b=>(b.IDENTIFY="IDENTIFY",b.CONNECT="CONNECT",b.STREAM_OPEN="STREAM_OPEN",b.STREAM_HANDLER="STREAM_HANDLER",b.DHT="DHT",b.LIST_PEERS="LIST_PEERS",b.CONNMANAGER="CONNMANAGER",b.DISCONNECT="DISCONNECT",b.PUBSUB="PUBSUB",b.PEERSTORE="PEERSTORE"))(n=o.Type||(o.Type={})),(i=>i.codec=z(i))(n=o.Type||(o.Type={})),o.codec=U({1:{name:"type",codec:o.Type.codec},2:{name:"connect",codec:he.codec,optional:!0},3:{name:"streamOpen",codec:ge.codec,optional:!0},4:{name:"streamHandler",codec:me.codec,optional:!0},5:{name:"dht",codec:we.codec,optional:!0},6:{name:"connManager",codec:ye.codec,optional:!0},7:{name:"disconnect",codec:Ee.codec,optional:!0},8:{name:"pubsub",codec:Ae.codec,optional:!0},9:{name:"peerStore",codec:Le.codec,optional:!0}}),o.encode=c=>A(c,o.codec),o.decode=c=>E(c,o.codec)})(Qe||(Qe={}));var We;(o=>{let n;(s=>(s.OK="OK",s.ERROR="ERROR"))(n=o.Type||(o.Type={})),(i=>i.codec=z(i))(n=o.Type||(o.Type={})),o.codec=U({1:{name:"type",codec:o.Type.codec},2:{name:"error",codec:le.codec,optional:!0},3:{name:"streamInfo",codec:be.codec,optional:!0},4:{name:"identify",codec:ue.codec,optional:!0},5:{name:"dht",codec:xe.codec,optional:!0},6:{name:"peers",codec:X.codec,repeats:!0},7:{name:"pubsub",codec:Ue.codec,optional:!0},8:{name:"peerStore",codec:Ie.codec,optional:!0}}),o.encode=c=>A(c,o.codec),o.decode=c=>E(c,o.codec)})(We||(We={}));return zt(qr);})();
|
|
16
|
+
`;var Ye={...Re,...Be,...ve,...Pe,...Ve,..._e,...Me,...ze,...Fe},Oo={...je,...He};function bt(n,e,t,r){return{name:n,prefix:e,encoder:{name:n,prefix:e,encode:t},decoder:{decode:r}}}var lt=bt("utf8","u",n=>{let e=new TextDecoder("utf8");return"u"+e.decode(n)},n=>new TextEncoder().encode(n.substring(1))),Je=bt("ascii","a",n=>{let e="a";for(let t=0;t<n.length;t++)e+=String.fromCharCode(n[t]);return e},n=>{n=n.substring(1);let e=new Uint8Array(n.length);for(let t=0;t<n.length;t++)e[t]=n.charCodeAt(t);return e}),Hn={utf8:lt,"utf-8":lt,hex:Ye.base16,latin1:Je,ascii:Je,binary:Je,...Ye},ie=Hn;function se(n,e="utf8"){let t=ie[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return t.decoder.decode(`${t.prefix}${n}`)}function Ke(n,e="utf8"){let t=ie[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return t.encoder.encode(n).substring(1)}var yt=Symbol.for("@achingbrain/uint8arraylist");function wt(n,e,t){if(e==null||e<0||e>=t)throw new RangeError("index is out of bounds");let r=0;for(let o of n){let c=r+o.byteLength;if(e<c)return{buf:o,index:e-r};r=c}throw new RangeError("index is out of bounds")}function xt(n){return Boolean(n?.[yt])}var w=class{constructor(...e){Object.defineProperty(this,yt,{value:!0}),this.bufs=[],this.length=0,this.appendAll(e)}*[Symbol.iterator](){yield*this.bufs}get byteLength(){return this.length}append(...e){this.appendAll(e)}appendAll(e){let t=0;for(let r of e)if(r instanceof Uint8Array)t+=r.byteLength,this.bufs.push(r);else if(xt(r))t+=r.length,this.bufs=this.bufs.concat(r.bufs);else throw new Error("Could not append value, must be an Uint8Array or a Uint8ArrayList");this.length+=t}get(e){let t=wt(this.bufs,e,this.length);return t.buf[t.index]}set(e,t){let r=wt(this.bufs,e,this.length);r.buf[r.index]=t}write(e,t=0){if(e instanceof Uint8Array)for(let r=0;r<e.length;r++)this.set(t+r,e[r]);else if(xt(e))for(let r=0;r<e.length;r++)this.set(t+r,e.get(r));else throw new Error("Could not write value, must be an Uint8Array or a Uint8ArrayList")}consume(e){if(e=Math.trunc(e),!(Number.isNaN(e)||e<=0))for(;this.bufs.length>0;)if(e>=this.bufs[0].byteLength)e-=this.bufs[0].byteLength,this.length-=this.bufs[0].byteLength,this.bufs.shift();else{this.bufs[0]=this.bufs[0].subarray(e),this.length-=e;break}}slice(e,t){let{bufs:r,length:o}=this._subList(e,t);return De(r,o)}subarray(e,t){let{bufs:r}=this._subList(e,t),o=new w;return o.appendAll(r),o}_subList(e,t){if(e==null&&t==null)return{bufs:this.bufs,length:this.length};if(e=e??0,t=t??(this.length>0?this.length:0),e<0||t>this.length)throw new RangeError("index out of bounds");if(e===t)return{bufs:[],length:0};let r=[],o=0;for(let c of this.bufs){let i=o,s=i+c.byteLength,f=e>=i&&e<s,g=t>i&&t<=s,h=e<i&&t>=s;o=s;let x,l;if(f&&(x=e-i,l=c.byteLength),g&&(l=t-i,x==null&&(x=0)),h&&(x=0,l=c.byteLength),x!=null&&l!=null&&r.push(c.subarray(x,l)),g)break}return{bufs:r,length:t-e}}getInt8(e){let t=this.slice(e,e+1);return new DataView(t.buffer,t.byteOffset,t.byteLength).getInt8(0)}setInt8(e,t){let r=new Uint8Array(1);new DataView(r.buffer,r.byteOffset,r.byteLength).setInt8(0,t),this.write(r,e)}getInt16(e,t){let r=this.slice(e,e+2);return new DataView(r.buffer,r.byteOffset,r.byteLength).getInt16(0,t)}setInt16(e,t,r){let o=new Uint8Array(2);new DataView(o.buffer,o.byteOffset,o.byteLength).setInt16(0,t,r),this.write(o,e)}getInt32(e,t){let r=this.slice(e,e+4);return new DataView(r.buffer,r.byteOffset,r.byteLength).getInt32(0,t)}setInt32(e,t,r){let o=new Uint8Array(4);new DataView(o.buffer,o.byteOffset,o.byteLength).setInt32(0,t,r),this.write(o,e)}getBigInt64(e,t){let r=this.slice(e,e+8);return new DataView(r.buffer,r.byteOffset,r.byteLength).getBigInt64(0,t)}setBigInt64(e,t,r){let o=new Uint8Array(8);new DataView(o.buffer,o.byteOffset,o.byteLength).setBigInt64(0,t,r),this.write(o,e)}getUint8(e){let t=this.slice(e,e+1);return new DataView(t.buffer,t.byteOffset,t.byteLength).getUint8(0)}setUint8(e,t){let r=new Uint8Array(1);new DataView(r.buffer,r.byteOffset,r.byteLength).setUint8(0,t),this.write(r,e)}getUint16(e,t){let r=this.slice(e,e+2);return new DataView(r.buffer,r.byteOffset,r.byteLength).getUint16(0,t)}setUint16(e,t,r){let o=new Uint8Array(2);new DataView(o.buffer,o.byteOffset,o.byteLength).setUint16(0,t,r),this.write(o,e)}getUint32(e,t){let r=this.slice(e,e+4);return new DataView(r.buffer,r.byteOffset,r.byteLength).getUint32(0,t)}setUint32(e,t,r){let o=new Uint8Array(4);new DataView(o.buffer,o.byteOffset,o.byteLength).setUint32(0,t,r),this.write(o,e)}getBigUint64(e,t){let r=this.slice(e,e+8);return new DataView(r.buffer,r.byteOffset,r.byteLength).getBigUint64(0,t)}setBigUint64(e,t,r){let o=new Uint8Array(8);new DataView(o.buffer,o.byteOffset,o.byteLength).setBigUint64(0,t,r),this.write(o,e)}getFloat32(e,t){let r=this.slice(e,e+4);return new DataView(r.buffer,r.byteOffset,r.byteLength).getFloat32(0,t)}setFloat32(e,t,r){let o=new Uint8Array(4);new DataView(o.buffer,o.byteOffset,o.byteLength).setFloat32(0,t,r),this.write(o,e)}getFloat64(e,t){let r=this.slice(e,e+8);return new DataView(r.buffer,r.byteOffset,r.byteLength).getFloat64(0,t)}setFloat64(e,t,r){let o=new Uint8Array(8);new DataView(o.buffer,o.byteOffset,o.byteLength).setFloat64(0,t,r),this.write(o,e)}};function V(n){return n instanceof Uint8Array?{get(e){return n[e]},set(e,t){n[e]=t}}:{get(e){return n.get(e)},set(e,t){n.set(e,t)}}}var Et=4294967296,I=class{constructor(e=0,t=0){this.hi=e,this.lo=t}toBigInt(e){if(e)return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n);if(this.hi>>>31!==0){let t=~this.lo+1>>>0,r=~this.hi>>>0;return t===0&&(r=r+1>>>0),-(BigInt(t)+(BigInt(r)<<32n))}return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n)}zzDecode(){let e=-(this.lo&1),t=((this.lo>>>1|this.hi<<31)^e)>>>0,r=(this.hi>>>1^e)>>>0;return new I(r,t)}zzEncode(){let e=this.hi>>31,t=((this.hi<<1|this.lo>>>31)^e)>>>0,r=(this.lo<<1^e)>>>0;return new I(t,r)}toBytes(e,t=0){let r=V(e);for(;this.hi>0;)r.set(t++,this.lo&127|128),this.lo=(this.lo>>>7|this.hi<<25)>>>0,this.hi>>>=7;for(;this.lo>127;)r.set(t++,this.lo&127|128),this.lo=this.lo>>>7;r.set(t++,this.lo)}static fromBigInt(e){if(e===0n)return new I;let t=e<0;t&&(e=-e);let r=Number(e>>32n)|0,o=Number(e-(BigInt(r)<<32n))|0;return t&&(r=~r>>>0,o=~o>>>0,++o>Et&&(o=0,++r>Et&&(r=0))),new I(r,o)}static fromNumber(e){if(e===0)return new I;let t=e<0;t&&(e=-e);let r=e>>>0,o=(e-r)/4294967296>>>0;return t&&(o=~o>>>0,r=~r>>>0,++r>4294967295&&(r=0,++o>4294967295&&(o=0))),new I(o,r)}static fromBytes(e,t){let r=V(e),o=new I,c=0;if(e.length-t>4){for(;c<4;++c)if(o.lo=(o.lo|(r.get(t)&127)<<c*7)>>>0,r.get(t++)<128)return o;if(o.lo=(o.lo|(r.get(t)&127)<<28)>>>0,o.hi=(o.hi|(r.get(t)&127)>>4)>>>0,r.get(t++)<128)return o;c=0}else{for(;c<3;++c){if(t>=e.length)throw RangeError(`index out of range: ${t} > ${e.length}`);if(o.lo=(o.lo|(r.get(t)&127)<<c*7)>>>0,r.get(t++)<128)return o}return o.lo=(o.lo|(r.get(t++)&127)<<c*7)>>>0,o}if(e.length-t>4){for(;c<5;++c)if(o.hi=(o.hi|(r.get(t)&127)<<c*7+3)>>>0,r.get(t++)<128)return o}else for(;c<5;++c){if(t>=e.length)throw RangeError(`index out of range: ${t} > ${e.length}`);if(o.hi=(o.hi|(r.get(t)&127)<<c*7+3)>>>0,r.get(t++)<128)return o}throw Error("invalid varint encoding")}};var At=128,Yn=127,Jn=~Yn,Kn=Math.pow(2,31),qn=Math.pow(2,7),Xn=Math.pow(2,14),Qn=Math.pow(2,21),Wn=Math.pow(2,28),Zn=Math.pow(2,35),er=Math.pow(2,42),tr=Math.pow(2,49),nr=Math.pow(2,56),rr=Math.pow(2,63),d={encodingLength(n){return n<qn?1:n<Xn?2:n<Qn?3:n<Wn?4:n<Zn?5:n<er?6:n<tr?7:n<nr?8:n<rr?9:10},encode(n,e){let t=0,r=V(e);for(;n>=Kn;)r.set(t++,n&255|At),n/=128;for(;(n&Jn)>0;)r.set(t++,n&255|At),n>>>=7;r.set(t,n|0)},decode(n,e=0){let t=V(n),r=4294967295;if(r=(t.get(e)&127)>>>0,t.get(e++)<128||(r=(r|(t.get(e)&127)<<7)>>>0,t.get(e++)<128)||(r=(r|(t.get(e)&127)<<14)>>>0,t.get(e++)<128)||(r=(r|(t.get(e)&127)<<21)>>>0,t.get(e++)<128)||(r=(r|(t.get(e)&15)<<28)>>>0,t.get(e++)<128))return r;if((e+=5)>n.length)throw RangeError(`index out of range: ${e} > ${n.length}`);return r}},ae={encodingLength(n){return n<0?10:d.encodingLength(n)},encode(n,e){if(n<0){let t=0,r=V(e),o=I.fromNumber(n);for(;o.hi>0;)r.set(t++,o.lo&127|128),o.lo=(o.lo>>>7|o.hi<<25)>>>0,o.hi>>>=7;for(;o.lo>127;)r.set(t++,o.lo&127|128),o.lo=o.lo>>>7;r.set(t++,o.lo);return}d.encode(n,e)},decode(n,e=0){return d.decode(n,e)|0}},de={encodingLength(n){return n=(n<<1^n>>31)>>>0,d.encodingLength(n)},encode(n,e,t=0){return n=(n<<1^n>>31)>>>0,d.encode(n,e)},decode(n,e=0){let t=d.decode(n,e);return t>>>1^-(t&1)|0}};function E(n,e){let t=new Uint8Array(d.encodingLength(n.length));return d.encode(n.length,t),e.decode(new w(t,n),0)}function A(n,e){let t=e.encode(n),r=d.encodingLength(d.decode(t));return t.slice(r)}var p;(function(n){n[n.VARINT=0]="VARINT",n[n.BIT64=1]="BIT64",n[n.LENGTH_DELIMITED=2]="LENGTH_DELIMITED",n[n.START_GROUP=3]="START_GROUP",n[n.END_GROUP=4]="END_GROUP",n[n.BIT32=5]="BIT32"})(p||(p={}));function u(n,e,t,r,o){return{name:n,type:e,encode:t,decode:r,encodingLength:o}}var or=function(){return 1},cr=function(e){return Uint8Array.from([e?1:0])},ir=function(e,t){return e.get(t)>0},sr=u("bool",p.VARINT,cr,ir,or);var ar=function(e){let t=e.byteLength;return d.encodingLength(t)+t},dr=function(e){let t=new Uint8Array(d.encodingLength(e.byteLength));return d.encode(e.byteLength,t),new w(t,e)},pr=function(e,t){let r=d.decode(e,t);return t+=d.encodingLength(r),e.slice(t,t+r)},m=u("bytes",p.LENGTH_DELIMITED,dr,pr,ar);var Ut=function(){return 8},fr=function(e){let t=new w(new Uint8Array(Ut(e)));return t.setFloat64(0,e,!0),t},ur=function(e,t){return e.getFloat64(t,!0)},hr=u("double",p.BIT64,fr,ur,Ut);function z(n){let e=function(c){let s=Object.keys(n).indexOf(c);return d.encodingLength(s)},t=function(c){let s=Object.keys(n).indexOf(c),f=new Uint8Array(d.encodingLength(s));return d.encode(s,f),f},r=function(c,i){let s=d.decode(c,i),f=Object.keys(n);if(f[s]==null)throw new Error("Could not find enum key for value");return f[s]};return u("enum",p.VARINT,t,r,e)}var Lt=function(){return 4},gr=function(e){let t=new w(new Uint8Array(Lt(e)));return t.setInt32(0,e,!0),t},mr=function(e,t){return e.getInt32(t,!0)},lr=u("fixed32",p.BIT32,gr,mr,Lt);var It=function(e){return 8},br=function(e){let t=new w(new Uint8Array(It(e)));return t.setBigInt64(0,e,!0),t},wr=function(e,t){return e.getBigInt64(t,!0)},xr=u("fixed64",p.BIT64,br,wr,It);var St=function(){return 4},yr=function(e){let t=new w(new Uint8Array(St(1)));return t.setFloat32(0,e,!0),t},Er=function(e,t){return e.getFloat32(t,!0)},Ar=u("float",p.BIT32,yr,Er,St);var Dt=function(e){return ae.encodingLength(e)},Ur=function(e){let t=new Uint8Array(Dt(e));return ae.encode(e,t),t},Lr=function(e,t){return ae.decode(e,t)},qe=u("int32",p.VARINT,Ur,Lr,Dt);var Ct=0x7fn,k={encodingLength(n){let e=0;for(;n>=0x80n;e++)n>>=7n;return e+1},encode(n,e){let t=V(e),r=0;for(;Ct<n;)t.set(r++,Number(n&Ct)|128),n>>=7n;t.set(r,Number(n))},decode(n,e=0){return I.fromBytes(n,e).toBigInt(!0)}},pe={encodingLength(n){return n<0n?10:k.encodingLength(n)},encode(n,e,t=0){if(n<0n){I.fromBigInt(n).toBytes(e,t);return}return k.encode(n,e)},decode(n,e=0){return I.fromBytes(n,e).toBigInt(!1)}},fe={encodingLength(n){return k.encodingLength(n>=0?n*2n:n*-2n-1n)},encode(n,e,t=0){I.fromBigInt(n).zzEncode().toBytes(e,t)},decode(n,e=0){return I.fromBytes(n,e).zzDecode().toBigInt(!1)}};var Nt=function(e){return pe.encodingLength(e)},Ir=function(e){let t=new Uint8Array(Nt(e));return pe.encode(e,t),t},Sr=function(e,t){return pe.decode(e,t)|0n},q=u("int64",p.VARINT,Ir,Sr,Nt);function U(n){let e=function(c){let i=0;for(let s of Object.values(n))i+=s.codec.encodingLength(c[s.name]);return d.encodingLength(i)+i},t=function(c){let i=new w;function s(g,h,x){if(g==null){if(x.optional===!0)return;throw new Error(`Non optional field "${x.name}" was ${g===null?"null":"undefined"}`)}let l=h<<3|x.codec.type,N=new Uint8Array(d.encodingLength(l));d.encode(l,N);let a=x.codec.encode(g);i.append(N),i.append(a)}for(let[g,h]of Object.entries(n)){let x=parseInt(g);if(h.repeats===!0){if(!Array.isArray(c[h.name]))throw new Error(`Repeating field "${h.name}" was not an array`);for(let l of c[h.name])s(l,x,h)}else s(c[h.name],x,h)}let f=new Uint8Array(d.encodingLength(i.length));return d.encode(i.length,f),new w(f,i)},r=function(c,i){let s=d.decode(c,i);i+=d.encodingLength(s);let f={};for(;i<c.length;){let g=d.decode(c,i);i+=d.encodingLength(g);let h=g&7,x=g>>3,l=n[x],N=0;if(h===p.VARINT)if(l!=null){let a=l.codec.decode(c,i);N=l.codec.encodingLength(a)}else{let a=d.decode(c,i);N=d.encodingLength(a)}else if(h===p.BIT64)N=8;else if(h===p.LENGTH_DELIMITED){let a=d.decode(c,i);N=a+d.encodingLength(a)}else if(h===p.BIT32)N=4;else{if(h===p.START_GROUP)throw new Error("Unsupported wire type START_GROUP");if(h===p.END_GROUP)throw new Error("Unsupported wire type END_GROUP")}if(l!=null){let a=l.codec.decode(c,i);l.repeats===!0?(f[l.name]==null&&(f[l.name]=[]),f[l.name].push(a)):f[l.name]=a}i+=N}for(let g of Object.values(n))g.repeats===!0&&f[g.name]==null&&(f[g.name]=[]);return f};return u("message",p.LENGTH_DELIMITED,t,r,e)}var Tt=function(){return 4},Dr=function(e){let t=new w(new Uint8Array(Tt(e)));return t.setInt32(0,e,!0),t},Cr=function(e,t){return e.getInt32(t,!0)},Nr=u("sfixed32",p.BIT32,Dr,Cr,Tt);var Ot=function(){return 8},Tr=function(e){let t=new w(new Uint8Array(Ot(e)));return t.setBigInt64(0,e,!0),t},Or=function(e,t){return e.getBigInt64(t,!0)},Rr=u("sfixed64",p.BIT64,Tr,Or,Ot);var Rt=function(e){return de.encodingLength(e)},Br=function(e){let t=new Uint8Array(Rt(e));return de.encode(e,t),t},vr=function(e,t){return de.decode(e,t)},Pr=u("sint32",p.VARINT,Br,vr,Rt);var Bt=function(e){return fe.encodingLength(e)},Vr=function(e){let t=new Uint8Array(Bt(e));return fe.encode(e,t),t},_r=function(e,t){return fe.decode(e,t)},Mr=u("sint64",p.VARINT,Vr,_r,Bt);var zr=function(e){let t=se(e).byteLength;return d.encodingLength(t)+t},Fr=function(e){let t=se(e),r=new Uint8Array(d.encodingLength(t.byteLength));return d.encode(t.length,r),new w(r,t)},Gr=function(e,t){let r=d.decode(e,t);return t+=d.encodingLength(r),Ke(e.slice(t,t+r))},C=u("string",p.LENGTH_DELIMITED,Fr,Gr,zr);var vt=function(e){return d.encodingLength(e)},kr=function(e){let t=new Uint8Array(vt(e));return d.encode(e,t),t},$r=function(e,t){return d.decode(e,t)},jr=u("uint32",p.VARINT,kr,$r,vt);var Hr=function(e){return k.encodingLength(e)},Yr=function(e){let t=new Uint8Array(k.encodingLength(e));return k.encode(e,t),t},Jr=function(e,t){return k.decode(e,t)},Kr=u("uint64",p.VARINT,Yr,Jr,Hr);var Xe;(o=>{let n;(b=>(b.IDENTIFY="IDENTIFY",b.CONNECT="CONNECT",b.STREAM_OPEN="STREAM_OPEN",b.STREAM_HANDLER="STREAM_HANDLER",b.DHT="DHT",b.LIST_PEERS="LIST_PEERS",b.CONNMANAGER="CONNMANAGER",b.DISCONNECT="DISCONNECT",b.PUBSUB="PUBSUB",b.PEERSTORE="PEERSTORE"))(n=o.Type||(o.Type={})),(i=>i.codec=()=>z(i))(n=o.Type||(o.Type={})),o.codec=()=>U({1:{name:"type",codec:o.Type.codec()},2:{name:"connect",codec:he.codec(),optional:!0},3:{name:"streamOpen",codec:ge.codec(),optional:!0},4:{name:"streamHandler",codec:me.codec(),optional:!0},5:{name:"dht",codec:we.codec(),optional:!0},6:{name:"connManager",codec:ye.codec(),optional:!0},7:{name:"disconnect",codec:Ee.codec(),optional:!0},8:{name:"pubsub",codec:Ae.codec(),optional:!0},9:{name:"peerStore",codec:Le.codec(),optional:!0}}),o.encode=c=>A(c,o.codec()),o.decode=c=>E(c,o.codec())})(Xe||(Xe={}));var Qe;(o=>{let n;(s=>(s.OK="OK",s.ERROR="ERROR"))(n=o.Type||(o.Type={})),(i=>i.codec=()=>z(i))(n=o.Type||(o.Type={})),o.codec=()=>U({1:{name:"type",codec:o.Type.codec()},2:{name:"error",codec:le.codec(),optional:!0},3:{name:"streamInfo",codec:be.codec(),optional:!0},4:{name:"identify",codec:ue.codec(),optional:!0},5:{name:"dht",codec:xe.codec(),optional:!0},6:{name:"peers",codec:X.codec(),repeats:!0},7:{name:"pubsub",codec:Ue.codec(),optional:!0},8:{name:"peerStore",codec:Ie.codec(),optional:!0}}),o.encode=c=>A(c,o.codec()),o.decode=c=>E(c,o.codec())})(Qe||(Qe={}));var ue;(r=>(r.codec=()=>U({1:{name:"id",codec:m},2:{name:"addrs",codec:m,repeats:!0}}),r.encode=o=>A(o,r.codec()),r.decode=o=>E(o,r.codec())))(ue||(ue={}));var he;(r=>(r.codec=()=>U({1:{name:"peer",codec:m},2:{name:"addrs",codec:m,repeats:!0},3:{name:"timeout",codec:q,optional:!0}}),r.encode=o=>A(o,r.codec()),r.decode=o=>E(o,r.codec())))(he||(he={}));var ge;(r=>(r.codec=()=>U({1:{name:"peer",codec:m},2:{name:"proto",codec:C,repeats:!0},3:{name:"timeout",codec:q,optional:!0}}),r.encode=o=>A(o,r.codec()),r.decode=o=>E(o,r.codec())))(ge||(ge={}));var me;(r=>(r.codec=()=>U({1:{name:"addr",codec:m},2:{name:"proto",codec:C,repeats:!0}}),r.encode=o=>A(o,r.codec()),r.decode=o=>E(o,r.codec())))(me||(me={}));var le;(r=>(r.codec=()=>U({1:{name:"msg",codec:C}}),r.encode=o=>A(o,r.codec()),r.decode=o=>E(o,r.codec())))(le||(le={}));var be;(r=>(r.codec=()=>U({1:{name:"peer",codec:m},2:{name:"addr",codec:m},3:{name:"proto",codec:C}}),r.encode=o=>A(o,r.codec()),r.decode=o=>E(o,r.codec())))(be||(be={}));var we;(o=>{let n;(a=>(a.FIND_PEER="FIND_PEER",a.FIND_PEERS_CONNECTED_TO_PEER="FIND_PEERS_CONNECTED_TO_PEER",a.FIND_PROVIDERS="FIND_PROVIDERS",a.GET_CLOSEST_PEERS="GET_CLOSEST_PEERS",a.GET_PUBLIC_KEY="GET_PUBLIC_KEY",a.GET_VALUE="GET_VALUE",a.SEARCH_VALUE="SEARCH_VALUE",a.PUT_VALUE="PUT_VALUE",a.PROVIDE="PROVIDE"))(n=o.Type||(o.Type={})),(i=>i.codec=()=>z(i))(n=o.Type||(o.Type={})),o.codec=()=>U({1:{name:"type",codec:o.Type.codec()},2:{name:"peer",codec:m,optional:!0},3:{name:"cid",codec:m,optional:!0},4:{name:"key",codec:m,optional:!0},5:{name:"value",codec:m,optional:!0},6:{name:"count",codec:qe,optional:!0},7:{name:"timeout",codec:q,optional:!0}}),o.encode=c=>A(c,o.codec()),o.decode=c=>E(c,o.codec())})(we||(we={}));var xe;(o=>{let n;(f=>(f.BEGIN="BEGIN",f.VALUE="VALUE",f.END="END"))(n=o.Type||(o.Type={})),(i=>i.codec=()=>z(i))(n=o.Type||(o.Type={})),o.codec=()=>U({1:{name:"type",codec:o.Type.codec()},2:{name:"peer",codec:X.codec(),optional:!0},3:{name:"value",codec:m,optional:!0}}),o.encode=c=>A(c,o.codec()),o.decode=c=>E(c,o.codec())})(xe||(xe={}));var X;(r=>(r.codec=()=>U({1:{name:"id",codec:m},2:{name:"addrs",codec:m,repeats:!0}}),r.encode=o=>A(o,r.codec()),r.decode=o=>E(o,r.codec())))(X||(X={}));var ye;(o=>{let n;(f=>(f.TAG_PEER="TAG_PEER",f.UNTAG_PEER="UNTAG_PEER",f.TRIM="TRIM"))(n=o.Type||(o.Type={})),(i=>i.codec=()=>z(i))(n=o.Type||(o.Type={})),o.codec=()=>U({1:{name:"type",codec:o.Type.codec()},2:{name:"peer",codec:m,optional:!0},3:{name:"tag",codec:C,optional:!0},4:{name:"weight",codec:q,optional:!0}}),o.encode=c=>A(c,o.codec()),o.decode=c=>E(c,o.codec())})(ye||(ye={}));var Ee;(r=>(r.codec=()=>U({1:{name:"peer",codec:m}}),r.encode=o=>A(o,r.codec()),r.decode=o=>E(o,r.codec())))(Ee||(Ee={}));var Ae;(o=>{let n;(g=>(g.GET_TOPICS="GET_TOPICS",g.LIST_PEERS="LIST_PEERS",g.PUBLISH="PUBLISH",g.SUBSCRIBE="SUBSCRIBE"))(n=o.Type||(o.Type={})),(i=>i.codec=()=>z(i))(n=o.Type||(o.Type={})),o.codec=()=>U({1:{name:"type",codec:o.Type.codec()},2:{name:"topic",codec:C,optional:!0},3:{name:"data",codec:m,optional:!0}}),o.encode=c=>A(c,o.codec()),o.decode=c=>E(c,o.codec())})(Ae||(Ae={}));var We;(r=>(r.codec=()=>U({1:{name:"from",codec:m,optional:!0},2:{name:"data",codec:m,optional:!0},3:{name:"seqno",codec:m,optional:!0},4:{name:"topicIDs",codec:C,repeats:!0},5:{name:"signature",codec:m,optional:!0},6:{name:"key",codec:m,optional:!0}}),r.encode=o=>A(o,r.codec()),r.decode=o=>E(o,r.codec())))(We||(We={}));var Ue;(r=>(r.codec=()=>U({1:{name:"topics",codec:C,repeats:!0},2:{name:"peerIDs",codec:m,repeats:!0}}),r.encode=o=>A(o,r.codec()),r.decode=o=>E(o,r.codec())))(Ue||(Ue={}));var Le;(o=>{let n;(s=>(s.GET_PROTOCOLS="GET_PROTOCOLS",s.GET_PEER_INFO="GET_PEER_INFO"))(n=o.Type||(o.Type={})),(i=>i.codec=()=>z(i))(n=o.Type||(o.Type={})),o.codec=()=>U({1:{name:"type",codec:o.Type.codec()},2:{name:"id",codec:m,optional:!0},3:{name:"protos",codec:C,repeats:!0}}),o.encode=c=>A(c,o.codec()),o.decode=c=>E(c,o.codec())})(Le||(Le={}));var Ie;(r=>(r.codec=()=>U({1:{name:"peer",codec:X.codec(),optional:!0},2:{name:"protos",codec:C,repeats:!0}}),r.encode=o=>A(o,r.codec()),r.decode=o=>E(o,r.codec())))(Ie||(Ie={}));return zt(qr);})();
|
|
17
17
|
return Libp2PDaemonProtocol}));
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,9 +1,62 @@
|
|
|
1
|
+
export interface Request {
|
|
2
|
+
type: Request.Type;
|
|
3
|
+
connect?: ConnectRequest;
|
|
4
|
+
streamOpen?: StreamOpenRequest;
|
|
5
|
+
streamHandler?: StreamHandlerRequest;
|
|
6
|
+
dht?: DHTRequest;
|
|
7
|
+
connManager?: ConnManagerRequest;
|
|
8
|
+
disconnect?: DisconnectRequest;
|
|
9
|
+
pubsub?: PSRequest;
|
|
10
|
+
peerStore?: PeerstoreRequest;
|
|
11
|
+
}
|
|
12
|
+
export declare namespace Request {
|
|
13
|
+
enum Type {
|
|
14
|
+
IDENTIFY = "IDENTIFY",
|
|
15
|
+
CONNECT = "CONNECT",
|
|
16
|
+
STREAM_OPEN = "STREAM_OPEN",
|
|
17
|
+
STREAM_HANDLER = "STREAM_HANDLER",
|
|
18
|
+
DHT = "DHT",
|
|
19
|
+
LIST_PEERS = "LIST_PEERS",
|
|
20
|
+
CONNMANAGER = "CONNMANAGER",
|
|
21
|
+
DISCONNECT = "DISCONNECT",
|
|
22
|
+
PUBSUB = "PUBSUB",
|
|
23
|
+
PEERSTORE = "PEERSTORE"
|
|
24
|
+
}
|
|
25
|
+
namespace Type {
|
|
26
|
+
const codec: () => import("protons-runtime/dist/src/codecs/codec").Codec<typeof Type>;
|
|
27
|
+
}
|
|
28
|
+
const codec: () => import("protons-runtime/dist/src/codecs/codec").Codec<Request>;
|
|
29
|
+
const encode: (obj: Request) => Uint8Array;
|
|
30
|
+
const decode: (buf: Uint8Array) => Request;
|
|
31
|
+
}
|
|
32
|
+
export interface Response {
|
|
33
|
+
type: Response.Type;
|
|
34
|
+
error?: ErrorResponse;
|
|
35
|
+
streamInfo?: StreamInfo;
|
|
36
|
+
identify?: IdentifyResponse;
|
|
37
|
+
dht?: DHTResponse;
|
|
38
|
+
peers: PeerInfo[];
|
|
39
|
+
pubsub?: PSResponse;
|
|
40
|
+
peerStore?: PeerstoreResponse;
|
|
41
|
+
}
|
|
42
|
+
export declare namespace Response {
|
|
43
|
+
enum Type {
|
|
44
|
+
OK = "OK",
|
|
45
|
+
ERROR = "ERROR"
|
|
46
|
+
}
|
|
47
|
+
namespace Type {
|
|
48
|
+
const codec: () => import("protons-runtime/dist/src/codecs/codec").Codec<typeof Type>;
|
|
49
|
+
}
|
|
50
|
+
const codec: () => import("protons-runtime/dist/src/codecs/codec").Codec<Response>;
|
|
51
|
+
const encode: (obj: Response) => Uint8Array;
|
|
52
|
+
const decode: (buf: Uint8Array) => Response;
|
|
53
|
+
}
|
|
1
54
|
export interface IdentifyResponse {
|
|
2
55
|
id: Uint8Array;
|
|
3
56
|
addrs: Uint8Array[];
|
|
4
57
|
}
|
|
5
58
|
export declare namespace IdentifyResponse {
|
|
6
|
-
const codec: import("protons-runtime/dist/src/codecs/codec").Codec<IdentifyResponse>;
|
|
59
|
+
const codec: () => import("protons-runtime/dist/src/codecs/codec").Codec<IdentifyResponse>;
|
|
7
60
|
const encode: (obj: IdentifyResponse) => Uint8Array;
|
|
8
61
|
const decode: (buf: Uint8Array) => IdentifyResponse;
|
|
9
62
|
}
|
|
@@ -13,7 +66,7 @@ export interface ConnectRequest {
|
|
|
13
66
|
timeout?: bigint;
|
|
14
67
|
}
|
|
15
68
|
export declare namespace ConnectRequest {
|
|
16
|
-
const codec: import("protons-runtime/dist/src/codecs/codec").Codec<ConnectRequest>;
|
|
69
|
+
const codec: () => import("protons-runtime/dist/src/codecs/codec").Codec<ConnectRequest>;
|
|
17
70
|
const encode: (obj: ConnectRequest) => Uint8Array;
|
|
18
71
|
const decode: (buf: Uint8Array) => ConnectRequest;
|
|
19
72
|
}
|
|
@@ -23,7 +76,7 @@ export interface StreamOpenRequest {
|
|
|
23
76
|
timeout?: bigint;
|
|
24
77
|
}
|
|
25
78
|
export declare namespace StreamOpenRequest {
|
|
26
|
-
const codec: import("protons-runtime/dist/src/codecs/codec").Codec<StreamOpenRequest>;
|
|
79
|
+
const codec: () => import("protons-runtime/dist/src/codecs/codec").Codec<StreamOpenRequest>;
|
|
27
80
|
const encode: (obj: StreamOpenRequest) => Uint8Array;
|
|
28
81
|
const decode: (buf: Uint8Array) => StreamOpenRequest;
|
|
29
82
|
}
|
|
@@ -32,7 +85,7 @@ export interface StreamHandlerRequest {
|
|
|
32
85
|
proto: string[];
|
|
33
86
|
}
|
|
34
87
|
export declare namespace StreamHandlerRequest {
|
|
35
|
-
const codec: import("protons-runtime/dist/src/codecs/codec").Codec<StreamHandlerRequest>;
|
|
88
|
+
const codec: () => import("protons-runtime/dist/src/codecs/codec").Codec<StreamHandlerRequest>;
|
|
36
89
|
const encode: (obj: StreamHandlerRequest) => Uint8Array;
|
|
37
90
|
const decode: (buf: Uint8Array) => StreamHandlerRequest;
|
|
38
91
|
}
|
|
@@ -40,7 +93,7 @@ export interface ErrorResponse {
|
|
|
40
93
|
msg: string;
|
|
41
94
|
}
|
|
42
95
|
export declare namespace ErrorResponse {
|
|
43
|
-
const codec: import("protons-runtime/dist/src/codecs/codec").Codec<ErrorResponse>;
|
|
96
|
+
const codec: () => import("protons-runtime/dist/src/codecs/codec").Codec<ErrorResponse>;
|
|
44
97
|
const encode: (obj: ErrorResponse) => Uint8Array;
|
|
45
98
|
const decode: (buf: Uint8Array) => ErrorResponse;
|
|
46
99
|
}
|
|
@@ -50,7 +103,7 @@ export interface StreamInfo {
|
|
|
50
103
|
proto: string;
|
|
51
104
|
}
|
|
52
105
|
export declare namespace StreamInfo {
|
|
53
|
-
const codec: import("protons-runtime/dist/src/codecs/codec").Codec<StreamInfo>;
|
|
106
|
+
const codec: () => import("protons-runtime/dist/src/codecs/codec").Codec<StreamInfo>;
|
|
54
107
|
const encode: (obj: StreamInfo) => Uint8Array;
|
|
55
108
|
const decode: (buf: Uint8Array) => StreamInfo;
|
|
56
109
|
}
|
|
@@ -76,21 +129,12 @@ export declare namespace DHTRequest {
|
|
|
76
129
|
PROVIDE = "PROVIDE"
|
|
77
130
|
}
|
|
78
131
|
namespace Type {
|
|
79
|
-
const codec: import("protons-runtime/dist/src/codecs/codec").Codec<typeof Type>;
|
|
132
|
+
const codec: () => import("protons-runtime/dist/src/codecs/codec").Codec<typeof Type>;
|
|
80
133
|
}
|
|
81
|
-
const codec: import("protons-runtime/dist/src/codecs/codec").Codec<DHTRequest>;
|
|
134
|
+
const codec: () => import("protons-runtime/dist/src/codecs/codec").Codec<DHTRequest>;
|
|
82
135
|
const encode: (obj: DHTRequest) => Uint8Array;
|
|
83
136
|
const decode: (buf: Uint8Array) => DHTRequest;
|
|
84
137
|
}
|
|
85
|
-
export interface PeerInfo {
|
|
86
|
-
id: Uint8Array;
|
|
87
|
-
addrs: Uint8Array[];
|
|
88
|
-
}
|
|
89
|
-
export declare namespace PeerInfo {
|
|
90
|
-
const codec: import("protons-runtime/dist/src/codecs/codec").Codec<PeerInfo>;
|
|
91
|
-
const encode: (obj: PeerInfo) => Uint8Array;
|
|
92
|
-
const decode: (buf: Uint8Array) => PeerInfo;
|
|
93
|
-
}
|
|
94
138
|
export interface DHTResponse {
|
|
95
139
|
type: DHTResponse.Type;
|
|
96
140
|
peer?: PeerInfo;
|
|
@@ -103,12 +147,21 @@ export declare namespace DHTResponse {
|
|
|
103
147
|
END = "END"
|
|
104
148
|
}
|
|
105
149
|
namespace Type {
|
|
106
|
-
const codec: import("protons-runtime/dist/src/codecs/codec").Codec<typeof Type>;
|
|
150
|
+
const codec: () => import("protons-runtime/dist/src/codecs/codec").Codec<typeof Type>;
|
|
107
151
|
}
|
|
108
|
-
const codec: import("protons-runtime/dist/src/codecs/codec").Codec<DHTResponse>;
|
|
152
|
+
const codec: () => import("protons-runtime/dist/src/codecs/codec").Codec<DHTResponse>;
|
|
109
153
|
const encode: (obj: DHTResponse) => Uint8Array;
|
|
110
154
|
const decode: (buf: Uint8Array) => DHTResponse;
|
|
111
155
|
}
|
|
156
|
+
export interface PeerInfo {
|
|
157
|
+
id: Uint8Array;
|
|
158
|
+
addrs: Uint8Array[];
|
|
159
|
+
}
|
|
160
|
+
export declare namespace PeerInfo {
|
|
161
|
+
const codec: () => import("protons-runtime/dist/src/codecs/codec").Codec<PeerInfo>;
|
|
162
|
+
const encode: (obj: PeerInfo) => Uint8Array;
|
|
163
|
+
const decode: (buf: Uint8Array) => PeerInfo;
|
|
164
|
+
}
|
|
112
165
|
export interface ConnManagerRequest {
|
|
113
166
|
type: ConnManagerRequest.Type;
|
|
114
167
|
peer?: Uint8Array;
|
|
@@ -122,9 +175,9 @@ export declare namespace ConnManagerRequest {
|
|
|
122
175
|
TRIM = "TRIM"
|
|
123
176
|
}
|
|
124
177
|
namespace Type {
|
|
125
|
-
const codec: import("protons-runtime/dist/src/codecs/codec").Codec<typeof Type>;
|
|
178
|
+
const codec: () => import("protons-runtime/dist/src/codecs/codec").Codec<typeof Type>;
|
|
126
179
|
}
|
|
127
|
-
const codec: import("protons-runtime/dist/src/codecs/codec").Codec<ConnManagerRequest>;
|
|
180
|
+
const codec: () => import("protons-runtime/dist/src/codecs/codec").Codec<ConnManagerRequest>;
|
|
128
181
|
const encode: (obj: ConnManagerRequest) => Uint8Array;
|
|
129
182
|
const decode: (buf: Uint8Array) => ConnManagerRequest;
|
|
130
183
|
}
|
|
@@ -132,7 +185,7 @@ export interface DisconnectRequest {
|
|
|
132
185
|
peer: Uint8Array;
|
|
133
186
|
}
|
|
134
187
|
export declare namespace DisconnectRequest {
|
|
135
|
-
const codec: import("protons-runtime/dist/src/codecs/codec").Codec<DisconnectRequest>;
|
|
188
|
+
const codec: () => import("protons-runtime/dist/src/codecs/codec").Codec<DisconnectRequest>;
|
|
136
189
|
const encode: (obj: DisconnectRequest) => Uint8Array;
|
|
137
190
|
const decode: (buf: Uint8Array) => DisconnectRequest;
|
|
138
191
|
}
|
|
@@ -149,9 +202,9 @@ export declare namespace PSRequest {
|
|
|
149
202
|
SUBSCRIBE = "SUBSCRIBE"
|
|
150
203
|
}
|
|
151
204
|
namespace Type {
|
|
152
|
-
const codec: import("protons-runtime/dist/src/codecs/codec").Codec<typeof Type>;
|
|
205
|
+
const codec: () => import("protons-runtime/dist/src/codecs/codec").Codec<typeof Type>;
|
|
153
206
|
}
|
|
154
|
-
const codec: import("protons-runtime/dist/src/codecs/codec").Codec<PSRequest>;
|
|
207
|
+
const codec: () => import("protons-runtime/dist/src/codecs/codec").Codec<PSRequest>;
|
|
155
208
|
const encode: (obj: PSRequest) => Uint8Array;
|
|
156
209
|
const decode: (buf: Uint8Array) => PSRequest;
|
|
157
210
|
}
|
|
@@ -164,7 +217,7 @@ export interface PSMessage {
|
|
|
164
217
|
key?: Uint8Array;
|
|
165
218
|
}
|
|
166
219
|
export declare namespace PSMessage {
|
|
167
|
-
const codec: import("protons-runtime/dist/src/codecs/codec").Codec<PSMessage>;
|
|
220
|
+
const codec: () => import("protons-runtime/dist/src/codecs/codec").Codec<PSMessage>;
|
|
168
221
|
const encode: (obj: PSMessage) => Uint8Array;
|
|
169
222
|
const decode: (buf: Uint8Array) => PSMessage;
|
|
170
223
|
}
|
|
@@ -173,7 +226,7 @@ export interface PSResponse {
|
|
|
173
226
|
peerIDs: Uint8Array[];
|
|
174
227
|
}
|
|
175
228
|
export declare namespace PSResponse {
|
|
176
|
-
const codec: import("protons-runtime/dist/src/codecs/codec").Codec<PSResponse>;
|
|
229
|
+
const codec: () => import("protons-runtime/dist/src/codecs/codec").Codec<PSResponse>;
|
|
177
230
|
const encode: (obj: PSResponse) => Uint8Array;
|
|
178
231
|
const decode: (buf: Uint8Array) => PSResponse;
|
|
179
232
|
}
|
|
@@ -188,9 +241,9 @@ export declare namespace PeerstoreRequest {
|
|
|
188
241
|
GET_PEER_INFO = "GET_PEER_INFO"
|
|
189
242
|
}
|
|
190
243
|
namespace Type {
|
|
191
|
-
const codec: import("protons-runtime/dist/src/codecs/codec").Codec<typeof Type>;
|
|
244
|
+
const codec: () => import("protons-runtime/dist/src/codecs/codec").Codec<typeof Type>;
|
|
192
245
|
}
|
|
193
|
-
const codec: import("protons-runtime/dist/src/codecs/codec").Codec<PeerstoreRequest>;
|
|
246
|
+
const codec: () => import("protons-runtime/dist/src/codecs/codec").Codec<PeerstoreRequest>;
|
|
194
247
|
const encode: (obj: PeerstoreRequest) => Uint8Array;
|
|
195
248
|
const decode: (buf: Uint8Array) => PeerstoreRequest;
|
|
196
249
|
}
|
|
@@ -199,61 +252,8 @@ export interface PeerstoreResponse {
|
|
|
199
252
|
protos: string[];
|
|
200
253
|
}
|
|
201
254
|
export declare namespace PeerstoreResponse {
|
|
202
|
-
const codec: import("protons-runtime/dist/src/codecs/codec").Codec<PeerstoreResponse>;
|
|
255
|
+
const codec: () => import("protons-runtime/dist/src/codecs/codec").Codec<PeerstoreResponse>;
|
|
203
256
|
const encode: (obj: PeerstoreResponse) => Uint8Array;
|
|
204
257
|
const decode: (buf: Uint8Array) => PeerstoreResponse;
|
|
205
258
|
}
|
|
206
|
-
export interface Request {
|
|
207
|
-
type: Request.Type;
|
|
208
|
-
connect?: ConnectRequest;
|
|
209
|
-
streamOpen?: StreamOpenRequest;
|
|
210
|
-
streamHandler?: StreamHandlerRequest;
|
|
211
|
-
dht?: DHTRequest;
|
|
212
|
-
connManager?: ConnManagerRequest;
|
|
213
|
-
disconnect?: DisconnectRequest;
|
|
214
|
-
pubsub?: PSRequest;
|
|
215
|
-
peerStore?: PeerstoreRequest;
|
|
216
|
-
}
|
|
217
|
-
export declare namespace Request {
|
|
218
|
-
enum Type {
|
|
219
|
-
IDENTIFY = "IDENTIFY",
|
|
220
|
-
CONNECT = "CONNECT",
|
|
221
|
-
STREAM_OPEN = "STREAM_OPEN",
|
|
222
|
-
STREAM_HANDLER = "STREAM_HANDLER",
|
|
223
|
-
DHT = "DHT",
|
|
224
|
-
LIST_PEERS = "LIST_PEERS",
|
|
225
|
-
CONNMANAGER = "CONNMANAGER",
|
|
226
|
-
DISCONNECT = "DISCONNECT",
|
|
227
|
-
PUBSUB = "PUBSUB",
|
|
228
|
-
PEERSTORE = "PEERSTORE"
|
|
229
|
-
}
|
|
230
|
-
namespace Type {
|
|
231
|
-
const codec: import("protons-runtime/dist/src/codecs/codec").Codec<typeof Type>;
|
|
232
|
-
}
|
|
233
|
-
const codec: import("protons-runtime/dist/src/codecs/codec").Codec<Request>;
|
|
234
|
-
const encode: (obj: Request) => Uint8Array;
|
|
235
|
-
const decode: (buf: Uint8Array) => Request;
|
|
236
|
-
}
|
|
237
|
-
export interface Response {
|
|
238
|
-
type: Response.Type;
|
|
239
|
-
error?: ErrorResponse;
|
|
240
|
-
streamInfo?: StreamInfo;
|
|
241
|
-
identify?: IdentifyResponse;
|
|
242
|
-
dht?: DHTResponse;
|
|
243
|
-
peers: PeerInfo[];
|
|
244
|
-
pubsub?: PSResponse;
|
|
245
|
-
peerStore?: PeerstoreResponse;
|
|
246
|
-
}
|
|
247
|
-
export declare namespace Response {
|
|
248
|
-
enum Type {
|
|
249
|
-
OK = "OK",
|
|
250
|
-
ERROR = "ERROR"
|
|
251
|
-
}
|
|
252
|
-
namespace Type {
|
|
253
|
-
const codec: import("protons-runtime/dist/src/codecs/codec").Codec<typeof Type>;
|
|
254
|
-
}
|
|
255
|
-
const codec: import("protons-runtime/dist/src/codecs/codec").Codec<Response>;
|
|
256
|
-
const encode: (obj: Response) => Uint8Array;
|
|
257
|
-
const decode: (buf: Uint8Array) => Response;
|
|
258
|
-
}
|
|
259
259
|
//# sourceMappingURL=index.d.ts.map
|
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,W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