You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

@multiformats/multiaddr-to-uri

Package Overview
Dependencies
Maintainers
10
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@multiformats/multiaddr-to-uri - npm Package Compare versions

Comparing version
11.0.2
to
12.0.0
+1
-1
dist/index.min.js
(function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.MultiformatsMultiaddrToUri = factory()}(typeof self !== 'undefined' ? self : this, function () {
"use strict";var MultiformatsMultiaddrToUri=(()=>{var Ee=Object.defineProperty;var rr=Object.getOwnPropertyDescriptor;var nr=Object.getOwnPropertyNames;var or=Object.prototype.hasOwnProperty;var g=(r,e)=>{for(var t in e)Ee(r,t,{get:e[t],enumerable:!0})},ir=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of nr(e))!or.call(r,o)&&o!==t&&Ee(r,o,{get:()=>e[o],enumerable:!(n=rr(e,o))||n.enumerable});return r};var sr=r=>ir(Ee({},"__esModule",{value:!0}),r);var mo={};g(mo,{multiaddrToUri:()=>ho});var Ie={};g(Ie,{base10:()=>fr});var wo=new Uint8Array(0);function lt(r,e){if(r===e)return!0;if(r.byteLength!==e.byteLength)return!1;for(let t=0;t<r.byteLength;t++)if(r[t]!==e[t])return!1;return!0}function _(r){if(r instanceof Uint8Array&&r.constructor.name==="Uint8Array")return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength);throw new Error("Unknown type, must be binary type")}function pt(r){return new TextEncoder().encode(r)}function ut(r){return new TextDecoder().decode(r)}function ar(r,e){if(r.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),n=0;n<t.length;n++)t[n]=255;for(var o=0;o<r.length;o++){var i=r.charAt(o),s=i.charCodeAt(0);if(t[s]!==255)throw new TypeError(i+" is ambiguous");t[s]=o}var a=r.length,c=r.charAt(0),d=Math.log(a)/Math.log(256),f=Math.log(256)/Math.log(a);function O(l){if(l instanceof Uint8Array||(ArrayBuffer.isView(l)?l=new Uint8Array(l.buffer,l.byteOffset,l.byteLength):Array.isArray(l)&&(l=Uint8Array.from(l))),!(l instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(l.length===0)return"";for(var w=0,L=0,v=0,I=l.length;v!==I&&l[v]===0;)v++,w++;for(var T=(I-v)*f+1>>>0,y=new Uint8Array(T);v!==I;){for(var P=l[v],N=0,D=T-1;(P!==0||N<L)&&D!==-1;D--,N++)P+=256*y[D]>>>0,y[D]=P%a>>>0,P=P/a>>>0;if(P!==0)throw new Error("Non-zero carry");L=N,v++}for(var A=T-L;A!==T&&y[A]===0;)A++;for(var pe=c.repeat(w);A<T;++A)pe+=r.charAt(y[A]);return pe}function R(l){if(typeof l!="string")throw new TypeError("Expected String");if(l.length===0)return new Uint8Array;var w=0;if(l[w]!==" "){for(var L=0,v=0;l[w]===c;)L++,w++;for(var I=(l.length-w)*d+1>>>0,T=new Uint8Array(I);l[w];){var y=t[l.charCodeAt(w)];if(y===255)return;for(var P=0,N=I-1;(y!==0||P<v)&&N!==-1;N--,P++)y+=a*T[N]>>>0,T[N]=y%256>>>0,y=y/256>>>0;if(y!==0)throw new Error("Non-zero carry");v=P,w++}if(l[w]!==" "){for(var D=I-v;D!==I&&T[D]===0;)D++;for(var A=new Uint8Array(L+(I-D)),pe=L;D!==I;)A[pe++]=T[D++];return A}}}function tr(l){var w=R(l);if(w)return w;throw new Error(`Non-${e} character`)}return{encode:O,decodeUnsafe:R,decode:tr}}var cr=ar,dr=cr,ht=dr;var Ce=class{name;prefix;baseEncode;constructor(e,t,n){this.name=e,this.prefix=t,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},ve=class{name;prefix;baseDecode;prefixCodePoint;constructor(e,t,n){this.name=e,this.prefix=t;let o=t.codePointAt(0);if(o===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=o,this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return mt(this,e)}},De=class{decoders;constructor(e){this.decoders=e}or(e){return mt(this,e)}decode(e){let t=e[0],n=this.decoders[t];if(n!=null)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function mt(r,e){return new De({...r.decoders??{[r.prefix]:r},...e.decoders??{[e.prefix]:e}})}var Se=class{name;prefix;baseEncode;baseDecode;encoder;decoder;constructor(e,t,n,o){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=o,this.encoder=new Ce(e,t,n),this.decoder=new ve(e,t,o)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};function W({name:r,prefix:e,encode:t,decode:n}){return new Se(r,e,t,n)}function B({name:r,prefix:e,alphabet:t}){let{encode:n,decode:o}=ht(t,r);return W({prefix:e,name:r,encode:n,decode:i=>_(o(i))})}function lr(r,e,t,n){let o=r.length;for(;r[o-1]==="=";)--o;let i=new Uint8Array(o*t/8|0),s=0,a=0,c=0;for(let d=0;d<o;++d){let f=e[r[d]];if(f===void 0)throw new SyntaxError(`Non-${n} character`);a=a<<t|f,s+=t,s>=8&&(s-=8,i[c++]=255&a>>s)}if(s>=t||(255&a<<8-s)!==0)throw new SyntaxError("Unexpected end of data");return i}function pr(r,e,t){let n=e[e.length-1]==="=",o=(1<<t)-1,i="",s=0,a=0;for(let c=0;c<r.length;++c)for(a=a<<8|r[c],s+=8;s>t;)s-=t,i+=e[o&a>>s];if(s!==0&&(i+=e[o&a<<t-s]),n)for(;(i.length*t&7)!==0;)i+="=";return i}function ur(r){let e={};for(let t=0;t<r.length;++t)e[r[t]]=t;return e}function u({name:r,prefix:e,bitsPerChar:t,alphabet:n}){let o=ur(n);return W({prefix:e,name:r,encode(i){return pr(i,n,t)},decode(i){return lr(i,o,t,r)}})}var fr=B({prefix:"9",name:"base10",alphabet:"0123456789"});var Te={};g(Te,{base16:()=>hr,base16upper:()=>mr});var hr=u({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),mr=u({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Pe={};g(Pe,{base2:()=>xr});var xr=u({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Oe={};g(Oe,{base256emoji:()=>Er});var xt=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),wr=xt.reduce((r,e,t)=>(r[t]=e,r),[]),gr=xt.reduce((r,e,t)=>{let n=e.codePointAt(0);if(n==null)throw new Error(`Invalid character: ${e}`);return r[n]=t,r},[]);function br(r){return r.reduce((e,t)=>(e+=wr[t],e),"")}function yr(r){let e=[];for(let t of r){let n=t.codePointAt(0);if(n==null)throw new Error(`Invalid character: ${t}`);let o=gr[n];if(o==null)throw new Error(`Non-base256emoji character: ${t}`);e.push(o)}return new Uint8Array(e)}var Er=W({prefix:"\u{1F680}",name:"base256emoji",encode:br,decode:yr});var Ae={};g(Ae,{base32:()=>z,base32hex:()=>Sr,base32hexpad:()=>Tr,base32hexpadupper:()=>Pr,base32hexupper:()=>Ir,base32pad:()=>vr,base32padupper:()=>Dr,base32upper:()=>Cr,base32z:()=>Or});var z=u({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Cr=u({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),vr=u({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Dr=u({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Sr=u({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Ir=u({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Tr=u({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Pr=u({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Or=u({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var _e={};g(_e,{base36:()=>K,base36upper:()=>Ar});var K=B({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Ar=B({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var Ue={};g(Ue,{base58btc:()=>E,base58flickr:()=>_r});var E=B({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),_r=B({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Be={};g(Be,{base64:()=>Ur,base64pad:()=>Nr,base64url:()=>Ne,base64urlpad:()=>Br});var Ur=u({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Nr=u({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Ne=u({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Br=u({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var ze={};g(ze,{base8:()=>zr});var zr=u({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var $e={};g($e,{identity:()=>$r});var $r=W({prefix:"\0",name:"identity",encode:r=>ut(r),decode:r=>pt(r)});var No=new TextEncoder,Bo=new TextDecoder;var Re={};g(Re,{identity:()=>sn});var Lr=bt,wt=128,Vr=127,Mr=~Vr,kr=Math.pow(2,31);function bt(r,e,t){e=e||[],t=t||0;for(var n=t;r>=kr;)e[t++]=r&255|wt,r/=128;for(;r&Mr;)e[t++]=r&255|wt,r>>>=7;return e[t]=r|0,bt.bytes=t-n+1,e}var Wr=Fe,jr=128,gt=127;function Fe(r,n){var t=0,n=n||0,o=0,i=n,s,a=r.length;do{if(i>=a)throw Fe.bytes=0,new RangeError("Could not decode varint");s=r[i++],t+=o<28?(s&gt)<<o:(s&gt)*Math.pow(2,o),o+=7}while(s>=jr);return Fe.bytes=i-n,t}var qr=Math.pow(2,7),Hr=Math.pow(2,14),Gr=Math.pow(2,21),Xr=Math.pow(2,28),Jr=Math.pow(2,35),Qr=Math.pow(2,42),Kr=Math.pow(2,49),Zr=Math.pow(2,56),Yr=Math.pow(2,63),en=function(r){return r<qr?1:r<Hr?2:r<Gr?3:r<Xr?4:r<Jr?5:r<Qr?6:r<Kr?7:r<Zr?8:r<Yr?9:10},tn={encode:Lr,decode:Wr,encodingLength:en},rn=tn,Z=rn;function Y(r,e=0){return[Z.decode(r,e),Z.decode.bytes]}function j(r,e,t=0){return Z.encode(r,e,t),e}function q(r){return Z.encodingLength(r)}function V(r,e){let t=e.byteLength,n=q(r),o=n+q(t),i=new Uint8Array(o+t);return j(r,i,0),j(t,i,n),i.set(e,o),new H(r,t,e,i)}function yt(r){let e=_(r),[t,n]=Y(e),[o,i]=Y(e.subarray(n)),s=e.subarray(n+i);if(s.byteLength!==o)throw new Error("Incorrect length");return new H(t,o,s,e)}function Et(r,e){if(r===e)return!0;{let t=e;return r.code===t.code&&r.size===t.size&&t.bytes instanceof Uint8Array&&lt(r.bytes,t.bytes)}}var H=class{code;size;digest;bytes;constructor(e,t,n,o){this.code=e,this.size=t,this.digest=n,this.bytes=o}};var Ct=0,nn="identity",vt=_;function on(r){return V(Ct,vt(r))}var sn={code:Ct,name:nn,encode:vt,digest:on};var Me={};g(Me,{sha256:()=>an,sha512:()=>cn});function Ve({name:r,code:e,encode:t}){return new Le(r,e,t)}var Le=class{name;code;encode;constructor(e,t,n){this.name=e,this.code=t,this.encode=n}digest(e){if(e instanceof Uint8Array){let t=this.encode(e);return t instanceof Uint8Array?V(this.code,t):t.then(n=>V(this.code,n))}else throw Error("Unknown type, must be binary type")}};function St(r){return async e=>new Uint8Array(await crypto.subtle.digest(r,e))}var an=Ve({name:"sha2-256",code:18,encode:St("SHA-256")}),cn=Ve({name:"sha2-512",code:19,encode:St("SHA-512")});function It(r,e){let{bytes:t,version:n}=r;switch(n){case 0:return ln(t,ke(r),e??E.encoder);default:return pn(t,ke(r),e??z.encoder)}}var Tt=new WeakMap;function ke(r){let e=Tt.get(r);if(e==null){let t=new Map;return Tt.set(r,t),t}return e}var $=class r{code;version;multihash;bytes;"/";constructor(e,t,n,o){this.code=t,this.version=e,this.multihash=n,this.bytes=o,this["/"]=o}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:e,multihash:t}=this;if(e!==te)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==un)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return r.createV0(t)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:e,digest:t}=this.multihash,n=V(e,t);return r.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(e){return r.equals(this,e)}static equals(e,t){let n=t;return n!=null&&e.code===n.code&&e.version===n.version&&Et(e.multihash,n.multihash)}toString(e){return It(this,e)}toJSON(){return{"/":It(this)}}link(){return this}[Symbol.toStringTag]="CID";[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(e){if(e==null)return null;let t=e;if(t instanceof r)return t;if(t["/"]!=null&&t["/"]===t.bytes||t.asCID===t){let{version:n,code:o,multihash:i,bytes:s}=t;return new r(n,o,i,s??Pt(n,o,i.bytes))}else if(t[fn]===!0){let{version:n,multihash:o,code:i}=t,s=yt(o);return r.create(n,i,s)}else return null}static create(e,t,n){if(typeof t!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(e){case 0:{if(t!==te)throw new Error(`Version 0 CID must use dag-pb (code: ${te}) block encoding`);return new r(e,t,n,n.bytes)}case 1:{let o=Pt(e,t,n.bytes);return new r(e,t,n,o)}default:throw new Error("Invalid version")}}static createV0(e){return r.create(0,te,e)}static createV1(e,t){return r.create(1,e,t)}static decode(e){let[t,n]=r.decodeFirst(e);if(n.length!==0)throw new Error("Incorrect length");return t}static decodeFirst(e){let t=r.inspectBytes(e),n=t.size-t.multihashSize,o=_(e.subarray(n,n+t.multihashSize));if(o.byteLength!==t.multihashSize)throw new Error("Incorrect length");let i=o.subarray(t.multihashSize-t.digestSize),s=new H(t.multihashCode,t.digestSize,i,o);return[t.version===0?r.createV0(s):r.createV1(t.codec,s),e.subarray(t.size)]}static inspectBytes(e){let t=0,n=()=>{let[O,R]=Y(e.subarray(t));return t+=R,O},o=n(),i=te;if(o===18?(o=0,t=0):i=n(),o!==0&&o!==1)throw new RangeError(`Invalid CID version ${o}`);let s=t,a=n(),c=n(),d=t+c,f=d-s;return{version:o,codec:i,multihashCode:a,digestSize:c,multihashSize:f,size:d}}static parse(e,t){let[n,o]=dn(e,t),i=r.decode(o);if(i.version===0&&e[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return ke(i).set(n,e),i}};function dn(r,e){switch(r[0]){case"Q":{let t=e??E;return[E.prefix,t.decode(`${E.prefix}${r}`)]}case E.prefix:{let t=e??E;return[E.prefix,t.decode(r)]}case z.prefix:{let t=e??z;return[z.prefix,t.decode(r)]}case K.prefix:{let t=e??K;return[K.prefix,t.decode(r)]}default:{if(e==null)throw Error("To parse non base32, base36 or base58btc encoded CID multibase decoder must be provided");return[r[0],e.decode(r)]}}}function ln(r,e,t){let{prefix:n}=t;if(n!==E.prefix)throw Error(`Cannot string encode V0 in ${t.name} encoding`);let o=e.get(n);if(o==null){let i=t.encode(r).slice(1);return e.set(n,i),i}else return o}function pn(r,e,t){let{prefix:n}=t,o=e.get(n);if(o==null){let i=t.encode(r);return e.set(n,i),i}else return o}var te=112,un=18;function Pt(r,e,t){let n=q(r),o=n+q(e),i=new Uint8Array(o+t.byteLength);return j(r,i,0),j(e,i,n),i.set(t,o),i}var fn=Symbol.for("@ipld/js-cid/CID");var re={...$e,...Pe,...ze,...Ie,...Te,...Ae,..._e,...Ue,...Be,...Oe},ri={...Me,...Re};function ne(r=0){return new Uint8Array(r)}function At(r,e,t,n){return{name:r,prefix:e,encoder:{name:r,prefix:e,encode:t},decoder:{decode:n}}}var Ot=At("utf8","u",r=>"u"+new TextDecoder("utf8").decode(r),r=>new TextEncoder().encode(r.substring(1))),We=At("ascii","a",r=>{let e="a";for(let t=0;t<r.length;t++)e+=String.fromCharCode(r[t]);return e},r=>{r=r.substring(1);let e=ne(r.length);for(let t=0;t<r.length;t++)e[t]=r.charCodeAt(t);return e}),hn={utf8:Ot,"utf-8":Ot,hex:re.base16,latin1:We,ascii:We,binary:We,...re},fe=hn;function C(r,e="utf8"){let t=fe[e];if(t==null)throw new Error(`Unsupported encoding "${e}"`);return t.encoder.encode(r).substring(1)}var m=class extends Error{static name="InvalidMultiaddrError";name="InvalidMultiaddrError"},U=class extends Error{static name="ValidationError";name="ValidationError"},oe=class extends Error{static name="InvalidParametersError";name="InvalidParametersError"},he=class extends Error{static name="UnknownProtocolError";name="UnknownProtocolError"};function _t(r,e){if(r===e)return!0;if(r.byteLength!==e.byteLength)return!1;for(let t=0;t<r.byteLength;t++)if(r[t]!==e[t])return!1;return!0}function F(r,e="utf8"){let t=fe[e];if(t==null)throw new Error(`Unsupported encoding "${e}"`);return t.decoder.decode(`${t.prefix}${r}`)}var mn=Math.pow(2,7),xn=Math.pow(2,14),wn=Math.pow(2,21),je=Math.pow(2,28),qe=Math.pow(2,35),He=Math.pow(2,42),Ge=Math.pow(2,49),p=128,x=127;function G(r){if(r<mn)return 1;if(r<xn)return 2;if(r<wn)return 3;if(r<je)return 4;if(r<qe)return 5;if(r<He)return 6;if(r<Ge)return 7;if(Number.MAX_SAFE_INTEGER!=null&&r>Number.MAX_SAFE_INTEGER)throw new RangeError("Could not encode varint");return 8}function Xe(r,e,t=0){switch(G(r)){case 8:e[t++]=r&255|p,r/=128;case 7:e[t++]=r&255|p,r/=128;case 6:e[t++]=r&255|p,r/=128;case 5:e[t++]=r&255|p,r/=128;case 4:e[t++]=r&255|p,r>>>=7;case 3:e[t++]=r&255|p,r>>>=7;case 2:e[t++]=r&255|p,r>>>=7;case 1:{e[t++]=r&255,r>>>=7;break}default:throw new Error("unreachable")}return e}function gn(r,e){let t=r[e],n=0;if(n+=t&x,t<p||(t=r[e+1],n+=(t&x)<<7,t<p)||(t=r[e+2],n+=(t&x)<<14,t<p)||(t=r[e+3],n+=(t&x)<<21,t<p)||(t=r[e+4],n+=(t&x)*je,t<p)||(t=r[e+5],n+=(t&x)*qe,t<p)||(t=r[e+6],n+=(t&x)*He,t<p)||(t=r[e+7],n+=(t&x)*Ge,t<p))return n;throw new RangeError("Could not decode varint")}function bn(r,e){let t=r.get(e),n=0;if(n+=t&x,t<p||(t=r.get(e+1),n+=(t&x)<<7,t<p)||(t=r.get(e+2),n+=(t&x)<<14,t<p)||(t=r.get(e+3),n+=(t&x)<<21,t<p)||(t=r.get(e+4),n+=(t&x)*je,t<p)||(t=r.get(e+5),n+=(t&x)*qe,t<p)||(t=r.get(e+6),n+=(t&x)*He,t<p)||(t=r.get(e+7),n+=(t&x)*Ge,t<p))return n;throw new RangeError("Could not decode varint")}function Je(r,e=0){return r instanceof Uint8Array?gn(r,e):bn(r,e)}function ie(r,e){e==null&&(e=r.reduce((o,i)=>o+i.length,0));let t=ne(e),n=0;for(let o of r)t.set(o,n),n+=o.length;return t}var me=class{index=0;input="";new(e){return this.index=0,this.input=e,this}readAtomically(e){let t=this.index,n=e();return n===void 0&&(this.index=t),n}parseWith(e){let t=e();if(this.index===this.input.length)return t}peekChar(){if(!(this.index>=this.input.length))return this.input[this.index]}readChar(){if(!(this.index>=this.input.length))return this.input[this.index++]}readGivenChar(e){return this.readAtomically(()=>{let t=this.readChar();if(t===e)return t})}readSeparator(e,t,n){return this.readAtomically(()=>{if(!(t>0&&this.readGivenChar(e)===void 0))return n()})}readNumber(e,t,n,o){return this.readAtomically(()=>{let i=0,s=0,a=this.peekChar();if(a===void 0)return;let c=a==="0",d=2**(8*o)-1;for(;;){let f=this.readAtomically(()=>{let O=this.readChar();if(O===void 0)return;let R=Number.parseInt(O,e);if(!Number.isNaN(R))return R});if(f===void 0)break;if(i*=e,i+=f,i>d||(s+=1,t!==void 0&&s>t))return}if(s!==0)return!n&&c&&s>1?void 0:i})}readIPv4Addr(){return this.readAtomically(()=>{let e=new Uint8Array(4);for(let t=0;t<e.length;t++){let n=this.readSeparator(".",t,()=>this.readNumber(10,3,!1,1));if(n===void 0)return;e[t]=n}return e})}readIPv6Addr(){let e=t=>{for(let n=0;n<t.length/2;n++){let o=n*2;if(n<t.length-3){let s=this.readSeparator(":",n,()=>this.readIPv4Addr());if(s!==void 0)return t[o]=s[0],t[o+1]=s[1],t[o+2]=s[2],t[o+3]=s[3],[o+4,!0]}let i=this.readSeparator(":",n,()=>this.readNumber(16,4,!0,2));if(i===void 0)return[o,!1];t[o]=i>>8,t[o+1]=i&255}return[t.length,!1]};return this.readAtomically(()=>{let t=new Uint8Array(16),[n,o]=e(t);if(n===16)return t;if(o||this.readGivenChar(":")===void 0||this.readGivenChar(":")===void 0)return;let i=new Uint8Array(14),s=16-(n+2),[a]=e(i.subarray(0,s));return t.set(i.subarray(0,a),16-a),t})}readIPAddr(){return this.readIPv4Addr()??this.readIPv6Addr()}};var En=45,Cn=15,xe=new me;function Qe(r){if(!(r.length>Cn))return xe.new(r).parseWith(()=>xe.readIPv4Addr())}function Ke(r){if(r.includes("%")&&(r=r.split("%")[0]),!(r.length>En))return xe.new(r).parseWith(()=>xe.readIPv6Addr())}function we(r){return!!Qe(r)}function Nt(r){return!!Ke(r)}function Ye(r){return e=>C(e,r)}function et(r){return e=>F(e,r)}function X(r){return new DataView(r.buffer).getUint16(r.byteOffset).toString()}function M(r){let e=new ArrayBuffer(2);return new DataView(e).setUint16(0,typeof r=="string"?parseInt(r):r),new Uint8Array(e)}function Bt(r){let e=r.split(":");if(e.length!==2)throw new Error(`failed to parse onion addr: ["'${e.join('", "')}'"]' does not contain a port number`);if(e[0].length!==16)throw new Error(`failed to parse onion addr: ${e[0]} not a Tor onion address.`);let t=F(e[0],"base32"),n=parseInt(e[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");let o=M(n);return ie([t,o],t.length+o.length)}function zt(r){let e=r.split(":");if(e.length!==2)throw new Error(`failed to parse onion addr: ["'${e.join('", "')}'"]' does not contain a port number`);if(e[0].length!==56)throw new Error(`failed to parse onion addr: ${e[0]} not a Tor onion3 address.`);let t=z.decode(`b${e[0]}`),n=parseInt(e[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");let o=M(n);return ie([t,o],t.length+o.length)}function tt(r){let e=r.subarray(0,r.length-2),t=r.subarray(r.length-2),n=C(e,"base32"),o=X(t);return`${n}:${o}`}var rt=function(r){r=r.toString().trim();let e=new Uint8Array(4);return r.split(/\./g).forEach((t,n)=>{let o=parseInt(t,10);if(isNaN(o)||o<0||o>255)throw new m("Invalid byte value in IP address");e[n]=o}),e},$t=function(r){let e=0;r=r.toString().trim();let t=r.split(":",8),n;for(n=0;n<t.length;n++){let i=we(t[n]),s;i&&(s=rt(t[n]),t[n]=C(s.subarray(0,2),"base16")),s!=null&&++n<8&&t.splice(n,0,C(s.subarray(2,4),"base16"))}if(t[0]==="")for(;t.length<8;)t.unshift("0");else if(t[t.length-1]==="")for(;t.length<8;)t.push("0");else if(t.length<8){for(n=0;n<t.length&&t[n]!=="";n++);let i=[n,1];for(n=9-t.length;n>0;n--)i.push("0");t.splice.apply(t,i)}let o=new Uint8Array(e+16);for(n=0;n<t.length;n++){t[n]===""&&(t[n]="0");let i=parseInt(t[n],16);if(isNaN(i)||i<0||i>65535)throw new m("Invalid byte value in IP address");o[e++]=i>>8&255,o[e++]=i&255}return o},Ft=function(r){if(r.byteLength!==4)throw new m("IPv4 address was incorrect length");let e=[];for(let t=0;t<r.byteLength;t++)e.push(r[t]);return e.join(".")},Rt=function(r){if(r.byteLength!==16)throw new m("IPv6 address was incorrect length");let e=[];for(let n=0;n<r.byteLength;n+=2){let o=r[n],i=r[n+1],s=`${o.toString(16).padStart(2,"0")}${i.toString(16).padStart(2,"0")}`;e.push(s)}let t=e.join(":");try{let n=new URL(`http://[${t}]`);return n.hostname.substring(1,n.hostname.length-1)}catch{throw new m(`Invalid IPv6 address "${t}"`)}};function Lt(r){try{let e=new URL(`http://[${r}]`);return e.hostname.substring(1,e.hostname.length-1)}catch{throw new m(`Invalid IPv6 address "${r}"`)}}var Ze=Object.values(re).map(r=>r.decoder),vn=function(){let r=Ze[0].or(Ze[1]);return Ze.slice(2).forEach(e=>r=r.or(e)),r}();function Vt(r){return vn.decode(r)}function Mt(r){return e=>r.encoder.encode(e)}function Dn(r){if(parseInt(r).toString()!==r)throw new U("Value must be an integer")}function Sn(r){if(r<0)throw new U("Value must be a positive integer, or zero")}function In(r){return e=>{if(e>r)throw new U(`Value must be smaller than or equal to ${r}`)}}function Tn(...r){return e=>{for(let t of r)t(e)}}var se=Tn(Dn,Sn,In(65535));var h=-1,nt=class{protocolsByCode=new Map;protocolsByName=new Map;getProtocol(e){let t;if(typeof e=="string"?t=this.protocolsByName.get(e):t=this.protocolsByCode.get(e),t==null)throw new he(`Protocol ${e} was unknown`);return t}addProtocol(e){this.protocolsByCode.set(e.code,e),this.protocolsByName.set(e.name,e),e.aliases?.forEach(t=>{this.protocolsByName.set(t,e)})}removeProtocol(e){let t=this.protocolsByCode.get(e);t!=null&&(this.protocolsByCode.delete(t.code),this.protocolsByName.delete(t.name),t.aliases?.forEach(n=>{this.protocolsByName.delete(n)}))}},b=new nt,ro=[{code:4,name:"ip4",size:32,valueToBytes:rt,bytesToValue:Ft,validate:r=>{if(!we(r))throw new U(`Invalid IPv4 address "${r}"`)}},{code:6,name:"tcp",size:16,valueToBytes:M,bytesToValue:X,validate:se},{code:273,name:"udp",size:16,valueToBytes:M,bytesToValue:X,validate:se},{code:33,name:"dccp",size:16,valueToBytes:M,bytesToValue:X,validate:se},{code:41,name:"ip6",size:128,valueToBytes:$t,bytesToValue:Rt,stringToValue:Lt,validate:r=>{if(!Nt(r))throw new U(`Invalid IPv6 address "${r}"`)}},{code:42,name:"ip6zone",size:h},{code:43,name:"ipcidr",size:8,bytesToValue:Ye("base10"),valueToBytes:et("base10")},{code:53,name:"dns",size:h,resolvable:!0},{code:54,name:"dns4",size:h,resolvable:!0},{code:55,name:"dns6",size:h,resolvable:!0},{code:56,name:"dnsaddr",size:h,resolvable:!0},{code:132,name:"sctp",size:16,valueToBytes:M,bytesToValue:X,validate:se},{code:301,name:"udt"},{code:302,name:"utp"},{code:400,name:"unix",size:h,path:!0,stringToValue:r=>decodeURIComponent(r),valueToString:r=>encodeURIComponent(r)},{code:421,name:"p2p",aliases:["ipfs"],size:h,bytesToValue:Ye("base58btc"),valueToBytes:r=>r.startsWith("Q")||r.startsWith("1")?et("base58btc")(r):$.parse(r).multihash.bytes},{code:444,name:"onion",size:96,bytesToValue:tt,valueToBytes:Bt},{code:445,name:"onion3",size:296,bytesToValue:tt,valueToBytes:zt},{code:446,name:"garlic64",size:h},{code:447,name:"garlic32",size:h},{code:448,name:"tls"},{code:449,name:"sni",size:h},{code:454,name:"noise"},{code:460,name:"quic"},{code:461,name:"quic-v1"},{code:465,name:"webtransport"},{code:466,name:"certhash",size:h,bytesToValue:Mt(Ne),valueToBytes:Vt},{code:480,name:"http"},{code:481,name:"http-path",size:h,stringToValue:r=>`/${decodeURIComponent(r)}`,valueToString:r=>encodeURIComponent(r.substring(1))},{code:443,name:"https"},{code:477,name:"ws"},{code:478,name:"wss"},{code:479,name:"p2p-websocket-star"},{code:277,name:"p2p-stardust"},{code:275,name:"p2p-webrtc-star"},{code:276,name:"p2p-webrtc-direct"},{code:280,name:"webrtc-direct"},{code:281,name:"webrtc"},{code:290,name:"p2p-circuit"},{code:777,name:"memory",size:h}];ro.forEach(r=>{b.addProtocol(r)});function kt(r){let e=[],t=0;for(;t<r.length;){let n=Je(r,t),o=b.getProtocol(n),i=G(n),s=no(o,r,t+i),a=0;s>0&&o.size===h&&(a=G(s));let c=i+a+s,d={code:n,name:o.name,bytes:r.subarray(t,t+c)};if(s>0){let f=t+i+a,O=r.subarray(f,f+s);d.value=o.bytesToValue?.(O)??C(O)}e.push(d),t+=c}return e}function Wt(r){let e=0,t=[];for(let n of r){if(n.bytes==null){let o=b.getProtocol(n.code),i=G(n.code),s,a=0,c=0;n.value!=null&&(s=o.valueToBytes?.(n.value)??F(n.value),a=s.byteLength,o.size===h&&(c=G(a)));let d=new Uint8Array(i+c+a),f=0;Xe(n.code,d,f),f+=i,s!=null&&(o.size===h&&(Xe(a,d,f),f+=c),d.set(s,f)),n.bytes=d}t.push(n.bytes),e+=n.bytes.byteLength}return ie(t,e)}function jt(r){if(r.charAt(0)!=="/")throw new m('String multiaddr must start with "/"');let e=[],t="protocol",n="",o="";for(let i=1;i<r.length;i++){let s=r.charAt(i);s!=="/"&&(t==="protocol"?o+=r.charAt(i):n+=r.charAt(i));let a=i===r.length-1;if(s==="/"||a){let c=b.getProtocol(o);if(t==="protocol"){if(c.size==null||c.size===0){e.push({code:c.code,name:c.name}),n="",o="",t="protocol";continue}else if(a)throw new m(`Component ${o} was missing value`);t="value"}else if(t==="value"){let d={code:c.code,name:c.name};if(c.size!=null&&c.size!==0){if(n==="")throw new m(`Component ${o} was missing value`);d.value=c.stringToValue?.(n)??n}e.push(d),n="",o="",t="protocol"}}}if(o!==""&&n!=="")throw new m("Incomplete multiaddr");return e}function qt(r){return`/${r.flatMap(e=>{if(e.value==null)return e.name;let t=b.getProtocol(e.code);if(t==null)throw new m(`Unknown protocol code ${e.code}`);return[e.name,t.valueToString?.(e.value)??e.value]}).join("/")}`}function no(r,e,t){return r.size==null||r.size===0?0:r.size>0?r.size/8:Je(e,t)}var oo=Symbol.for("nodejs.util.inspect.custom"),dt=Symbol.for("@multiformats/multiaddr"),io=[53,54,55,56],ct=class extends Error{constructor(e="No available resolver"){super(e),this.name="NoAvailableResolverError"}};function so(r){if(r==null&&(r="/"),Gt(r))return r.getComponents();if(r instanceof Uint8Array)return kt(r);if(typeof r=="string")return r=r.replace(/\/(\/)+/,"/").replace(/(\/)+$/,""),r===""&&(r="/"),jt(r);if(Array.isArray(r))return r;throw new m("Must be a string, Uint8Array, Component[], or another Multiaddr")}var ye=class r{[dt]=!0;#e;#t;#r;constructor(e="/",t={}){this.#e=so(e),t.validate!==!1&&ao(this)}get bytes(){return this.#r==null&&(this.#r=Wt(this.#e)),this.#r}toString(){return this.#t==null&&(this.#t=qt(this.#e)),this.#t}toJSON(){return this.toString()}toOptions(){let e,t,n,o,i="";for(let{code:a,name:c,value:d}of this.#e)a===42&&(i=`%${d??""}`),io.includes(a)&&(t="tcp",o=443,n=`${d??""}${i}`,e=a===55?6:4),(a===6||a===273)&&(t=c==="tcp"?"tcp":"udp",o=parseInt(d??"")),(a===4||a===41)&&(t="tcp",n=`${d??""}${i}`,e=a===41?6:4);if(e==null||t==null||n==null||o==null)throw new Error('multiaddr must have a valid format: "/{ip4, ip6, dns4, dns6, dnsaddr}/{address}/{tcp, udp}/{port}".');return{family:e,host:n,transport:t,port:o}}getComponents(){return[...this.#e]}protos(){return this.#e.map(({code:e,value:t})=>{let n=b.getProtocol(e);return{code:e,size:n.size??0,name:n.name,resolvable:!!n.resolvable,path:!!n.path}})}protoCodes(){return this.#e.map(({code:e})=>e)}protoNames(){return this.#e.map(({name:e})=>e)}tuples(){return this.#e.map(({code:e,value:t})=>{if(t==null)return[e];let n=b.getProtocol(e),o=[e];return t!=null&&o.push(n.valueToBytes?.(t)??F(t)),o})}stringTuples(){return this.#e.map(({code:e,value:t})=>t==null?[e]:[e,t])}encapsulate(e){let t=new r(e);return new r([...this.#e,...t.getComponents()],{validate:!1})}decapsulate(e){let t=e.toString(),n=this.toString(),o=n.lastIndexOf(t);if(o<0)throw new oe(`Address ${this.toString()} does not contain subaddress: ${e.toString()}`);return new r(n.slice(0,o),{validate:!1})}decapsulateCode(e){let t;for(let n=this.#e.length-1;n>-1;n--)if(this.#e[n].code===e){t=n;break}return new r(this.#e.slice(0,t),{validate:!1})}getPeerId(){try{let e=[];this.#e.forEach(({code:n,value:o})=>{n===421&&e.push([n,o]),n===290&&(e=[])});let t=e.pop();if(t?.[1]!=null){let n=t[1];return n[0]==="Q"||n[0]==="1"?C(E.decode(`z${n}`),"base58btc"):C($.parse(n).multihash.bytes,"base58btc")}return null}catch{return null}}getPath(){for(let e of this.#e)if(b.getProtocol(e.code).path)return e.value??null;return null}equals(e){return _t(this.bytes,e.bytes)}async resolve(e){let t=this.protos().find(i=>i.resolvable);if(t==null)return[this];let n=Ht.get(t.name);if(n==null)throw new ct(`no available resolver for ${t.name}`);return(await n(this,e)).map(i=>le(i))}nodeAddress(){let e=this.toOptions();if(e.transport!=="tcp"&&e.transport!=="udp")throw new Error(`multiaddr must have a valid format - no protocol with name: "${e.transport}". Must have a valid transport protocol: "{tcp, udp}"`);return{family:e.family,address:e.host,port:e.port}}isThinWaistAddress(){return!(this.#e.length!==2||this.#e[0].code!==4&&this.#e[0].code!==41||this.#e[1].code!==6&&this.#e[1].code!==273)}[oo](){return`Multiaddr(${this.toString()})`}};function ao(r){r.getComponents().forEach(e=>{let t=b.getProtocol(e.code);e.value!=null&&t.validate?.(e.value)})}var fs=parseInt("0xFFFF",16),hs=new Uint8Array([0,0,0,0,0,0,0,0,0,0,255,255]);var Ht=new Map;function Gt(r){return!!r?.[dt]}function le(r){return new ye(r)}var fo=[6,53,56,54,55];function Qt(r){return Yt("sni",r)?.value}function Kt(r){let e=Yt("tcp",r)?.value;return e==null?"":`:${e}`}function Yt(r,e){return e.find(t=>t.name===r)}function Zt(r){return r.some(({code:e})=>e===448)}function S(r,e){let t=er[r.name];if(t==null)throw new Error(`Can't interpret protocol ${r.name}`);let n=t(r,e);return r.code===41?`[${n}]`:n}var er={ip4:(r,e)=>r.value,ip6:(r,e)=>e.length===0?r.value:`[${r.value}]`,tcp:(r,e)=>{let t=e.pop();if(t==null)throw new Error("Unexpected end of multiaddr");return`tcp://${S(t,e)}:${r.value}`},udp:(r,e)=>{let t=e.pop();if(t==null)throw new Error("Unexpected end of multiaddr");return`udp://${S(t,e)}:${r.value}`},dnsaddr:(r,e)=>r.value,dns4:(r,e)=>r.value,dns6:(r,e)=>r.value,dns:(r,e)=>r.value,ipfs:(r,e)=>{let t=e.pop();if(t==null)throw new Error("Unexpected end of multiaddr");return`${S(t,e)}`},p2p:(r,e)=>{let t=e.pop();if(t==null)throw new Error("Unexpected end of multiaddr");return`${S(t,e)}`},http:(r,e)=>{let t=Zt(e),n=Qt(e),o=Kt(e);if(t&&n!=null)return`https://${n}${o}`;let i=t?"https://":"http://",s=e.pop();if(s==null)throw new Error("Unexpected end of multiaddr");let a=S(s,e);return a=a?.replace("tcp://",""),`${i}${a}`},"http-path":(r,e)=>{let t=e.pop();if(t==null)throw new Error("Unexpected end of multiaddr");let n=S(t,e),o=decodeURIComponent(r.value??"");return`${n}${o}`},tls:(r,e)=>{let t=e.pop();if(t==null)throw new Error("Unexpected end of multiaddr");return S(t,e)},sni:(r,e)=>{let t=e.pop();if(t==null)throw new Error("Unexpected end of multiaddr");return S(t,e)},https:(r,e)=>{let t=e.pop();if(t==null)throw new Error("Unexpected end of multiaddr");let n=S(t,e);return n=n?.replace("tcp://",""),`https://${n}`},ws:(r,e)=>{let t=Zt(e),n=Qt(e),o=Kt(e);if(t&&n!=null)return`wss://${n}${o}`;let i=t?"wss://":"ws://",s=e.pop();if(s==null)throw new Error("Unexpected end of multiaddr");let a=S(s,e);return a=a?.replace("tcp://",""),`${i}${a}`},wss:(r,e)=>{let t=e.pop();if(t==null)throw new Error("Unexpected end of multiaddr");let n=S(t,e);return n=n?.replace("tcp://",""),`wss://${n}`}};function ho(r,e){let n=le(r).getComponents(),o=n.pop();if(o==null)throw new Error("Unexpected end of multiaddr");let i=er[o.name];if(i==null)throw new Error(`No interpreter found for ${o.name}`);let s=i(o,n)??"";return e?.assumeHttp!==!1&&fo.includes(o.code)&&(s=s.replace(/^.*:\/\//,""),o.value==="443"?s=`https://${s}`:s=`http://${s}`),(s.startsWith("http://")||s.startsWith("https://")||s.startsWith("ws://")||s.startsWith("wss://"))&&(s=new URL(s).toString(),s.endsWith("/")&&(s=s.substring(0,s.length-1))),s}return sr(mo);})();
"use strict";var MultiformatsMultiaddrToUri=(()=>{var le=Object.defineProperty;var Gt=Object.getOwnPropertyDescriptor;var Xt=Object.getOwnPropertyNames;var Jt=Object.prototype.hasOwnProperty;var g=(e,r)=>{for(var t in r)le(e,t,{get:r[t],enumerable:!0})},Qt=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of Xt(r))!Jt.call(e,o)&&o!==t&&le(e,o,{get:()=>r[o],enumerable:!(n=Gt(r,o))||n.enumerable});return e};var Kt=e=>Qt(le({},"__esModule",{value:!0}),e);var so={};g(so,{multiaddrToUri:()=>io});function tt(e,r){if(e===r)return!0;if(e.byteLength!==r.byteLength)return!1;for(let t=0;t<e.byteLength;t++)if(e[t]!==r[t])return!1;return!0}function G(e=0){return new Uint8Array(e)}var Zt=Math.pow(2,7),Yt=Math.pow(2,14),er=Math.pow(2,21),fe=Math.pow(2,28),he=Math.pow(2,35),me=Math.pow(2,42),xe=Math.pow(2,49),u=128,x=127;function R(e){if(e<Zt)return 1;if(e<Yt)return 2;if(e<er)return 3;if(e<fe)return 4;if(e<he)return 5;if(e<me)return 6;if(e<xe)return 7;if(Number.MAX_SAFE_INTEGER!=null&&e>Number.MAX_SAFE_INTEGER)throw new RangeError("Could not encode varint");return 8}function we(e,r,t=0){switch(R(e)){case 8:r[t++]=e&255|u,e/=128;case 7:r[t++]=e&255|u,e/=128;case 6:r[t++]=e&255|u,e/=128;case 5:r[t++]=e&255|u,e/=128;case 4:r[t++]=e&255|u,e>>>=7;case 3:r[t++]=e&255|u,e>>>=7;case 2:r[t++]=e&255|u,e>>>=7;case 1:{r[t++]=e&255,e>>>=7;break}default:throw new Error("unreachable")}return r}function tr(e,r){let t=e[r],n=0;if(n+=t&x,t<u||(t=e[r+1],n+=(t&x)<<7,t<u)||(t=e[r+2],n+=(t&x)<<14,t<u)||(t=e[r+3],n+=(t&x)<<21,t<u)||(t=e[r+4],n+=(t&x)*fe,t<u)||(t=e[r+5],n+=(t&x)*he,t<u)||(t=e[r+6],n+=(t&x)*me,t<u)||(t=e[r+7],n+=(t&x)*xe,t<u))return n;throw new RangeError("Could not decode varint")}function rr(e,r){let t=e.get(r),n=0;if(n+=t&x,t<u||(t=e.get(r+1),n+=(t&x)<<7,t<u)||(t=e.get(r+2),n+=(t&x)<<14,t<u)||(t=e.get(r+3),n+=(t&x)<<21,t<u)||(t=e.get(r+4),n+=(t&x)*fe,t<u)||(t=e.get(r+5),n+=(t&x)*he,t<u)||(t=e.get(r+6),n+=(t&x)*me,t<u)||(t=e.get(r+7),n+=(t&x)*xe,t<u))return n;throw new RangeError("Could not decode varint")}function ge(e,r=0){return e instanceof Uint8Array?tr(e,r):rr(e,r)}function X(e,r){r==null&&(r=e.reduce((o,i)=>o+i.length,0));let t=G(r),n=0;for(let o of e)t.set(o,n),n+=o.length;return t}var ve={};g(ve,{base10:()=>ur});var wo=new Uint8Array(0);function rt(e,r){if(e===r)return!0;if(e.byteLength!==r.byteLength)return!1;for(let t=0;t<e.byteLength;t++)if(e[t]!==r[t])return!1;return!0}function O(e){if(e instanceof Uint8Array&&e.constructor.name==="Uint8Array")return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")}function nt(e){return new TextEncoder().encode(e)}function ot(e){return new TextDecoder().decode(e)}function or(e,r){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),n=0;n<t.length;n++)t[n]=255;for(var o=0;o<e.length;o++){var i=e.charAt(o),s=i.charCodeAt(0);if(t[s]!==255)throw new TypeError(i+" is ambiguous");t[s]=o}var a=e.length,c=e.charAt(0),l=Math.log(a)/Math.log(256),f=Math.log(256)/Math.log(a);function I(d){if(d instanceof Uint8Array||(ArrayBuffer.isView(d)?d=new Uint8Array(d.buffer,d.byteOffset,d.byteLength):Array.isArray(d)&&(d=Uint8Array.from(d))),!(d instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(d.length===0)return"";for(var w=0,z=0,y=0,v=d.length;y!==v&&d[y]===0;)y++,w++;for(var D=(v-y)*f+1>>>0,b=new Uint8Array(D);y!==v;){for(var S=d[y],_=0,E=D-1;(S!==0||_<z)&&E!==-1;E--,_++)S+=256*b[E]>>>0,b[E]=S%a>>>0,S=S/a>>>0;if(S!==0)throw new Error("Non-zero carry");z=_,y++}for(var A=D-z;A!==D&&b[A]===0;)A++;for(var ne=c.repeat(w);A<D;++A)ne+=e.charAt(b[A]);return ne}function L(d){if(typeof d!="string")throw new TypeError("Expected String");if(d.length===0)return new Uint8Array;var w=0;if(d[w]!==" "){for(var z=0,y=0;d[w]===c;)z++,w++;for(var v=(d.length-w)*l+1>>>0,D=new Uint8Array(v);d[w];){var b=t[d.charCodeAt(w)];if(b===255)return;for(var S=0,_=v-1;(b!==0||S<y)&&_!==-1;_--,S++)b+=a*D[_]>>>0,D[_]=b%256>>>0,b=b/256>>>0;if(b!==0)throw new Error("Non-zero carry");y=S,w++}if(d[w]!==" "){for(var E=v-y;E!==v&&D[E]===0;)E++;for(var A=new Uint8Array(z+(v-E)),ne=z;E!==v;)A[ne++]=D[E++];return A}}}function jt(d){var w=L(d);if(w)return w;throw new Error(`Non-${r} character`)}return{encode:I,decodeUnsafe:L,decode:jt}}var ir=or,sr=ir,st=sr;var be=class{name;prefix;baseEncode;constructor(r,t,n){this.name=r,this.prefix=t,this.baseEncode=n}encode(r){if(r instanceof Uint8Array)return`${this.prefix}${this.baseEncode(r)}`;throw Error("Unknown type, must be binary type")}},ye=class{name;prefix;baseDecode;prefixCodePoint;constructor(r,t,n){this.name=r,this.prefix=t;let o=t.codePointAt(0);if(o===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=o,this.baseDecode=n}decode(r){if(typeof r=="string"){if(r.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(r)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(r.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(r){return at(this,r)}},Ee=class{decoders;constructor(r){this.decoders=r}or(r){return at(this,r)}decode(r){let t=r[0],n=this.decoders[t];if(n!=null)return n.decode(r);throw RangeError(`Unable to decode multibase string ${JSON.stringify(r)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function at(e,r){return new Ee({...e.decoders??{[e.prefix]:e},...r.decoders??{[r.prefix]:r}})}var Ce=class{name;prefix;baseEncode;baseDecode;encoder;decoder;constructor(r,t,n,o){this.name=r,this.prefix=t,this.baseEncode=n,this.baseDecode=o,this.encoder=new be(r,t,n),this.decoder=new ye(r,t,o)}encode(r){return this.encoder.encode(r)}decode(r){return this.decoder.decode(r)}};function M({name:e,prefix:r,encode:t,decode:n}){return new Ce(e,r,t,n)}function N({name:e,prefix:r,alphabet:t}){let{encode:n,decode:o}=st(t,e);return M({prefix:r,name:e,encode:n,decode:i=>O(o(i))})}function ar(e,r,t,n){let o=e.length;for(;e[o-1]==="=";)--o;let i=new Uint8Array(o*t/8|0),s=0,a=0,c=0;for(let l=0;l<o;++l){let f=r[e[l]];if(f===void 0)throw new SyntaxError(`Non-${n} character`);a=a<<t|f,s+=t,s>=8&&(s-=8,i[c++]=255&a>>s)}if(s>=t||(255&a<<8-s)!==0)throw new SyntaxError("Unexpected end of data");return i}function cr(e,r,t){let n=r[r.length-1]==="=",o=(1<<t)-1,i="",s=0,a=0;for(let c=0;c<e.length;++c)for(a=a<<8|e[c],s+=8;s>t;)s-=t,i+=r[o&a>>s];if(s!==0&&(i+=r[o&a<<t-s]),n)for(;(i.length*t&7)!==0;)i+="=";return i}function dr(e){let r={};for(let t=0;t<e.length;++t)r[e[t]]=t;return r}function p({name:e,prefix:r,bitsPerChar:t,alphabet:n}){let o=dr(n);return M({prefix:r,name:e,encode(i){return cr(i,n,t)},decode(i){return ar(i,o,t,e)}})}var ur=N({prefix:"9",name:"base10",alphabet:"0123456789"});var De={};g(De,{base16:()=>pr,base16upper:()=>lr});var pr=p({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),lr=p({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Se={};g(Se,{base2:()=>fr});var fr=p({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Te={};g(Te,{base256emoji:()=>gr});var ct=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),hr=ct.reduce((e,r,t)=>(e[t]=r,e),[]),mr=ct.reduce((e,r,t)=>{let n=r.codePointAt(0);if(n==null)throw new Error(`Invalid character: ${r}`);return e[n]=t,e},[]);function xr(e){return e.reduce((r,t)=>(r+=hr[t],r),"")}function wr(e){let r=[];for(let t of e){let n=t.codePointAt(0);if(n==null)throw new Error(`Invalid character: ${t}`);let o=mr[n];if(o==null)throw new Error(`Non-base256emoji character: ${t}`);r.push(o)}return new Uint8Array(r)}var gr=M({prefix:"\u{1F680}",name:"base256emoji",encode:xr,decode:wr});var Ie={};g(Ie,{base32:()=>B,base32hex:()=>Cr,base32hexpad:()=>Dr,base32hexpadupper:()=>Sr,base32hexupper:()=>vr,base32pad:()=>yr,base32padupper:()=>Er,base32upper:()=>br,base32z:()=>Tr});var B=p({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),br=p({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),yr=p({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Er=p({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Cr=p({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),vr=p({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Dr=p({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Sr=p({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Tr=p({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Ae={};g(Ae,{base36:()=>J,base36upper:()=>Ir});var J=N({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Ir=N({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var Oe={};g(Oe,{base58btc:()=>T,base58flickr:()=>Ar});var T=N({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Ar=N({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Ue={};g(Ue,{base64:()=>Or,base64pad:()=>Pr,base64url:()=>Pe,base64urlpad:()=>Ur});var Or=p({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Pr=p({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Pe=p({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Ur=p({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var _e={};g(_e,{base8:()=>_r});var _r=p({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Ne={};g(Ne,{identity:()=>Nr});var Nr=M({prefix:"\0",name:"identity",encode:e=>ot(e),decode:e=>nt(e)});var No=new TextEncoder,Bo=new TextDecoder;var Le={};g(Le,{identity:()=>rn});var zr=pt,dt=128,$r=127,Vr=~$r,Rr=Math.pow(2,31);function pt(e,r,t){r=r||[],t=t||0;for(var n=t;e>=Rr;)r[t++]=e&255|dt,e/=128;for(;e&Vr;)r[t++]=e&255|dt,e>>>=7;return r[t]=e|0,pt.bytes=t-n+1,r}var Mr=Be,Fr=128,ut=127;function Be(e,n){var t=0,n=n||0,o=0,i=n,s,a=e.length;do{if(i>=a)throw Be.bytes=0,new RangeError("Could not decode varint");s=e[i++],t+=o<28?(s&ut)<<o:(s&ut)*Math.pow(2,o),o+=7}while(s>=Fr);return Be.bytes=i-n,t}var Wr=Math.pow(2,7),qr=Math.pow(2,14),kr=Math.pow(2,21),Hr=Math.pow(2,28),jr=Math.pow(2,35),Gr=Math.pow(2,42),Xr=Math.pow(2,49),Jr=Math.pow(2,56),Qr=Math.pow(2,63),Kr=function(e){return e<Wr?1:e<qr?2:e<kr?3:e<Hr?4:e<jr?5:e<Gr?6:e<Xr?7:e<Jr?8:e<Qr?9:10},Zr={encode:zr,decode:Mr,encodingLength:Kr},Yr=Zr,Q=Yr;function K(e,r=0){return[Q.decode(e,r),Q.decode.bytes]}function F(e,r,t=0){return Q.encode(e,r,t),r}function W(e){return Q.encodingLength(e)}function k(e,r){let t=r.byteLength,n=W(e),o=n+W(t),i=new Uint8Array(o+t);return F(e,i,0),F(t,i,n),i.set(r,o),new q(e,t,r,i)}function lt(e){let r=O(e),[t,n]=K(r),[o,i]=K(r.subarray(n)),s=r.subarray(n+i);if(s.byteLength!==o)throw new Error("Incorrect length");return new q(t,o,s,r)}function ft(e,r){if(e===r)return!0;{let t=r;return e.code===t.code&&e.size===t.size&&t.bytes instanceof Uint8Array&&rt(e.bytes,t.bytes)}}var q=class{code;size;digest;bytes;constructor(r,t,n,o){this.code=r,this.size=t,this.digest=n,this.bytes=o}};var ht=0,en="identity",mt=O;function tn(e,r){if(r?.truncate!=null&&r.truncate!==e.byteLength){if(r.truncate<0||r.truncate>e.byteLength)throw new Error(`Invalid truncate option, must be less than or equal to ${e.byteLength}`);e=e.subarray(0,r.truncate)}return k(ht,mt(e))}var rn={code:ht,name:en,encode:mt,digest:tn};var Ve={};g(Ve,{sha256:()=>on,sha512:()=>sn});var nn=20;function $e({name:e,code:r,encode:t,minDigestLength:n,maxDigestLength:o}){return new ze(e,r,t,n,o)}var ze=class{name;code;encode;minDigestLength;maxDigestLength;constructor(r,t,n,o,i){this.name=r,this.code=t,this.encode=n,this.minDigestLength=o??nn,this.maxDigestLength=i}digest(r,t){if(t?.truncate!=null){if(t.truncate<this.minDigestLength)throw new Error(`Invalid truncate option, must be greater than or equal to ${this.minDigestLength}`);if(this.maxDigestLength!=null&&t.truncate>this.maxDigestLength)throw new Error(`Invalid truncate option, must be less than or equal to ${this.maxDigestLength}`)}if(r instanceof Uint8Array){let n=this.encode(r);return n instanceof Uint8Array?xt(n,this.code,t?.truncate):n.then(o=>xt(o,this.code,t?.truncate))}else throw Error("Unknown type, must be binary type")}};function xt(e,r,t){if(t!=null&&t!==e.byteLength){if(t>e.byteLength)throw new Error(`Invalid truncate option, must be less than or equal to ${e.byteLength}`);e=e.subarray(0,t)}return k(r,e)}function gt(e){return async r=>new Uint8Array(await crypto.subtle.digest(e,r))}var on=$e({name:"sha2-256",code:18,encode:gt("SHA-256")}),sn=$e({name:"sha2-512",code:19,encode:gt("SHA-512")});function bt(e,r){let{bytes:t,version:n}=e;switch(n){case 0:return cn(t,Re(e),r??T.encoder);default:return dn(t,Re(e),r??B.encoder)}}var yt=new WeakMap;function Re(e){let r=yt.get(e);if(r==null){let t=new Map;return yt.set(e,t),t}return r}var H=class e{code;version;multihash;bytes;"/";constructor(r,t,n,o){this.code=t,this.version=r,this.multihash=n,this.bytes=o,this["/"]=o}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:r,multihash:t}=this;if(r!==Y)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==un)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return e.createV0(t)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:r,digest:t}=this.multihash,n=k(r,t);return e.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(r){return e.equals(this,r)}static equals(r,t){let n=t;return n!=null&&r.code===n.code&&r.version===n.version&&ft(r.multihash,n.multihash)}toString(r){return bt(this,r)}toJSON(){return{"/":bt(this)}}link(){return this}[Symbol.toStringTag]="CID";[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(r){if(r==null)return null;let t=r;if(t instanceof e)return t;if(t["/"]!=null&&t["/"]===t.bytes||t.asCID===t){let{version:n,code:o,multihash:i,bytes:s}=t;return new e(n,o,i,s??Et(n,o,i.bytes))}else if(t[pn]===!0){let{version:n,multihash:o,code:i}=t,s=lt(o);return e.create(n,i,s)}else return null}static create(r,t,n){if(typeof t!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(r){case 0:{if(t!==Y)throw new Error(`Version 0 CID must use dag-pb (code: ${Y}) block encoding`);return new e(r,t,n,n.bytes)}case 1:{let o=Et(r,t,n.bytes);return new e(r,t,n,o)}default:throw new Error("Invalid version")}}static createV0(r){return e.create(0,Y,r)}static createV1(r,t){return e.create(1,r,t)}static decode(r){let[t,n]=e.decodeFirst(r);if(n.length!==0)throw new Error("Incorrect length");return t}static decodeFirst(r){let t=e.inspectBytes(r),n=t.size-t.multihashSize,o=O(r.subarray(n,n+t.multihashSize));if(o.byteLength!==t.multihashSize)throw new Error("Incorrect length");let i=o.subarray(t.multihashSize-t.digestSize),s=new q(t.multihashCode,t.digestSize,i,o);return[t.version===0?e.createV0(s):e.createV1(t.codec,s),r.subarray(t.size)]}static inspectBytes(r){let t=0,n=()=>{let[I,L]=K(r.subarray(t));return t+=L,I},o=n(),i=Y;if(o===18?(o=0,t=0):i=n(),o!==0&&o!==1)throw new RangeError(`Invalid CID version ${o}`);let s=t,a=n(),c=n(),l=t+c,f=l-s;return{version:o,codec:i,multihashCode:a,digestSize:c,multihashSize:f,size:l}}static parse(r,t){let[n,o]=an(r,t),i=e.decode(o);if(i.version===0&&r[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return Re(i).set(n,r),i}};function an(e,r){switch(e[0]){case"Q":{let t=r??T;return[T.prefix,t.decode(`${T.prefix}${e}`)]}case T.prefix:{let t=r??T;return[T.prefix,t.decode(e)]}case B.prefix:{let t=r??B;return[B.prefix,t.decode(e)]}case J.prefix:{let t=r??J;return[J.prefix,t.decode(e)]}default:{if(r==null)throw Error("To parse non base32, base36 or base58btc encoded CID multibase decoder must be provided");return[e[0],r.decode(e)]}}}function cn(e,r,t){let{prefix:n}=t;if(n!==T.prefix)throw Error(`Cannot string encode V0 in ${t.name} encoding`);let o=r.get(n);if(o==null){let i=t.encode(e).slice(1);return r.set(n,i),i}else return o}function dn(e,r,t){let{prefix:n}=t,o=r.get(n);if(o==null){let i=t.encode(e);return r.set(n,i),i}else return o}var Y=112,un=18;function Et(e,r,t){let n=W(e),o=n+W(r),i=new Uint8Array(o+t.byteLength);return F(e,i,0),F(r,i,n),i.set(t,o),i}var pn=Symbol.for("@ipld/js-cid/CID");var ee={...Ne,...Se,..._e,...ve,...De,...Ie,...Ae,...Oe,...Ue,...Te},ri={...Ve,...Le};function vt(e,r,t,n){return{name:e,prefix:r,encoder:{name:e,prefix:r,encode:t},decoder:{decode:n}}}var Ct=vt("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),Me=vt("ascii","a",e=>{let r="a";for(let t=0;t<e.length;t++)r+=String.fromCharCode(e[t]);return r},e=>{e=e.substring(1);let r=G(e.length);for(let t=0;t<e.length;t++)r[t]=e.charCodeAt(t);return r}),ln={utf8:Ct,"utf-8":Ct,hex:ee.base16,latin1:Me,ascii:Me,binary:Me,...ee},ie=ln;function te(e,r="utf8"){let t=ie[r];if(t==null)throw new Error(`Unsupported encoding "${r}"`);return t.decoder.decode(`${t.prefix}${e}`)}function $(e,r="utf8"){let t=ie[r];if(t==null)throw new Error(`Unsupported encoding "${r}"`);return t.encoder.encode(e).substring(1)}var m=class extends Error{static name="InvalidMultiaddrError";name="InvalidMultiaddrError"},P=class extends Error{static name="ValidationError";name="ValidationError"},se=class extends Error{static name="InvalidParametersError";name="InvalidParametersError"},ae=class extends Error{static name="UnknownProtocolError";name="UnknownProtocolError"};var ce=class{index=0;input="";new(r){return this.index=0,this.input=r,this}readAtomically(r){let t=this.index,n=r();return n===void 0&&(this.index=t),n}parseWith(r){let t=r();if(this.index===this.input.length)return t}peekChar(){if(!(this.index>=this.input.length))return this.input[this.index]}readChar(){if(!(this.index>=this.input.length))return this.input[this.index++]}readGivenChar(r){return this.readAtomically(()=>{let t=this.readChar();if(t===r)return t})}readSeparator(r,t,n){return this.readAtomically(()=>{if(!(t>0&&this.readGivenChar(r)===void 0))return n()})}readNumber(r,t,n,o){return this.readAtomically(()=>{let i=0,s=0,a=this.peekChar();if(a===void 0)return;let c=a==="0",l=2**(8*o)-1;for(;;){let f=this.readAtomically(()=>{let I=this.readChar();if(I===void 0)return;let L=Number.parseInt(I,r);if(!Number.isNaN(L))return L});if(f===void 0)break;if(i*=r,i+=f,i>l||(s+=1,t!==void 0&&s>t))return}if(s!==0)return!n&&c&&s>1?void 0:i})}readIPv4Addr(){return this.readAtomically(()=>{let r=new Uint8Array(4);for(let t=0;t<r.length;t++){let n=this.readSeparator(".",t,()=>this.readNumber(10,3,!1,1));if(n===void 0)return;r[t]=n}return r})}readIPv6Addr(){let r=t=>{for(let n=0;n<t.length/2;n++){let o=n*2;if(n<t.length-3){let s=this.readSeparator(":",n,()=>this.readIPv4Addr());if(s!==void 0)return t[o]=s[0],t[o+1]=s[1],t[o+2]=s[2],t[o+3]=s[3],[o+4,!0]}let i=this.readSeparator(":",n,()=>this.readNumber(16,4,!0,2));if(i===void 0)return[o,!1];t[o]=i>>8,t[o+1]=i&255}return[t.length,!1]};return this.readAtomically(()=>{let t=new Uint8Array(16),[n,o]=r(t);if(n===16)return t;if(o||this.readGivenChar(":")===void 0||this.readGivenChar(":")===void 0)return;let i=new Uint8Array(14),s=16-(n+2),[a]=r(i.subarray(0,s));return t.set(i.subarray(0,a),16-a),t})}readIPAddr(){return this.readIPv4Addr()??this.readIPv6Addr()}};var fn=45,hn=15,de=new ce;function Dt(e){if(!(e.length>hn))return de.new(e).parseWith(()=>de.readIPv4Addr())}function St(e){if(e.includes("%")&&(e=e.split("%")[0]),!(e.length>fn))return de.new(e).parseWith(()=>de.readIPv6Addr())}function ue(e){return!!Dt(e)}function Tt(e){return!!St(e)}function We(e){return r=>$(r,e)}function qe(e){return r=>te(r,e)}function j(e){return new DataView(e.buffer).getUint16(e.byteOffset).toString()}function V(e){let r=new ArrayBuffer(2);return new DataView(r).setUint16(0,typeof e=="string"?parseInt(e):e),new Uint8Array(r)}function It(e){let r=e.split(":");if(r.length!==2)throw new Error(`failed to parse onion addr: ["'${r.join('", "')}'"]' does not contain a port number`);if(r[0].length!==16)throw new Error(`failed to parse onion addr: ${r[0]} not a Tor onion address.`);let t=te(r[0],"base32"),n=parseInt(r[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");let o=V(n);return X([t,o],t.length+o.length)}function At(e){let r=e.split(":");if(r.length!==2)throw new Error(`failed to parse onion addr: ["'${r.join('", "')}'"]' does not contain a port number`);if(r[0].length!==56)throw new Error(`failed to parse onion addr: ${r[0]} not a Tor onion3 address.`);let t=B.decode(`b${r[0]}`),n=parseInt(r[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");let o=V(n);return X([t,o],t.length+o.length)}function ke(e){let r=e.subarray(0,e.length-2),t=e.subarray(e.length-2),n=$(r,"base32"),o=j(t);return`${n}:${o}`}var He=function(e){e=e.toString().trim();let r=new Uint8Array(4);return e.split(/\./g).forEach((t,n)=>{let o=parseInt(t,10);if(isNaN(o)||o<0||o>255)throw new m("Invalid byte value in IP address");r[n]=o}),r},Ot=function(e){let r=0;e=e.toString().trim();let t=e.split(":",8),n;for(n=0;n<t.length;n++){let i=ue(t[n]),s;i&&(s=He(t[n]),t[n]=$(s.subarray(0,2),"base16")),s!=null&&++n<8&&t.splice(n,0,$(s.subarray(2,4),"base16"))}if(t[0]==="")for(;t.length<8;)t.unshift("0");else if(t[t.length-1]==="")for(;t.length<8;)t.push("0");else if(t.length<8){for(n=0;n<t.length&&t[n]!=="";n++);let i=[n,1];for(n=9-t.length;n>0;n--)i.push("0");t.splice.apply(t,i)}let o=new Uint8Array(r+16);for(n=0;n<t.length;n++){t[n]===""&&(t[n]="0");let i=parseInt(t[n],16);if(isNaN(i)||i<0||i>65535)throw new m("Invalid byte value in IP address");o[r++]=i>>8&255,o[r++]=i&255}return o},Pt=function(e){if(e.byteLength!==4)throw new m("IPv4 address was incorrect length");let r=[];for(let t=0;t<e.byteLength;t++)r.push(e[t]);return r.join(".")},Ut=function(e){if(e.byteLength!==16)throw new m("IPv6 address was incorrect length");let r=[];for(let n=0;n<e.byteLength;n+=2){let o=e[n],i=e[n+1],s=`${o.toString(16).padStart(2,"0")}${i.toString(16).padStart(2,"0")}`;r.push(s)}let t=r.join(":");try{let n=new URL(`http://[${t}]`);return n.hostname.substring(1,n.hostname.length-1)}catch{throw new m(`Invalid IPv6 address "${t}"`)}};function _t(e){try{let r=new URL(`http://[${e}]`);return r.hostname.substring(1,r.hostname.length-1)}catch{throw new m(`Invalid IPv6 address "${e}"`)}}var Fe=Object.values(ee).map(e=>e.decoder),mn=(function(){let e=Fe[0].or(Fe[1]);return Fe.slice(2).forEach(r=>e=e.or(r)),e})();function Nt(e){return mn.decode(e)}function Bt(e){return r=>e.encoder.encode(r)}function xn(e){if(parseInt(e).toString()!==e)throw new P("Value must be an integer")}function wn(e){if(e<0)throw new P("Value must be a positive integer, or zero")}function gn(e){return r=>{if(r>e)throw new P(`Value must be smaller than or equal to ${e}`)}}function bn(...e){return r=>{for(let t of e)t(r)}}var re=bn(xn,wn,gn(65535));var h=-1,je=class{protocolsByCode=new Map;protocolsByName=new Map;getProtocol(r){let t;if(typeof r=="string"?t=this.protocolsByName.get(r):t=this.protocolsByCode.get(r),t==null)throw new ae(`Protocol ${r} was unknown`);return t}addProtocol(r){this.protocolsByCode.set(r.code,r),this.protocolsByName.set(r.name,r),r.aliases?.forEach(t=>{this.protocolsByName.set(t,r)})}removeProtocol(r){let t=this.protocolsByCode.get(r);t!=null&&(this.protocolsByCode.delete(t.code),this.protocolsByName.delete(t.name),t.aliases?.forEach(n=>{this.protocolsByName.delete(n)}))}},U=new je,Yn=[{code:4,name:"ip4",size:32,valueToBytes:He,bytesToValue:Pt,validate:e=>{if(!ue(e))throw new P(`Invalid IPv4 address "${e}"`)}},{code:6,name:"tcp",size:16,valueToBytes:V,bytesToValue:j,validate:re},{code:273,name:"udp",size:16,valueToBytes:V,bytesToValue:j,validate:re},{code:33,name:"dccp",size:16,valueToBytes:V,bytesToValue:j,validate:re},{code:41,name:"ip6",size:128,valueToBytes:Ot,bytesToValue:Ut,stringToValue:_t,validate:e=>{if(!Tt(e))throw new P(`Invalid IPv6 address "${e}"`)}},{code:42,name:"ip6zone",size:h},{code:43,name:"ipcidr",size:8,bytesToValue:We("base10"),valueToBytes:qe("base10")},{code:53,name:"dns",size:h},{code:54,name:"dns4",size:h},{code:55,name:"dns6",size:h},{code:56,name:"dnsaddr",size:h},{code:132,name:"sctp",size:16,valueToBytes:V,bytesToValue:j,validate:re},{code:301,name:"udt"},{code:302,name:"utp"},{code:400,name:"unix",size:h,stringToValue:e=>decodeURIComponent(e),valueToString:e=>encodeURIComponent(e)},{code:421,name:"p2p",aliases:["ipfs"],size:h,bytesToValue:We("base58btc"),valueToBytes:e=>e.startsWith("Q")||e.startsWith("1")?qe("base58btc")(e):H.parse(e).multihash.bytes},{code:444,name:"onion",size:96,bytesToValue:ke,valueToBytes:It},{code:445,name:"onion3",size:296,bytesToValue:ke,valueToBytes:At},{code:446,name:"garlic64",size:h},{code:447,name:"garlic32",size:h},{code:448,name:"tls"},{code:449,name:"sni",size:h},{code:454,name:"noise"},{code:460,name:"quic"},{code:461,name:"quic-v1"},{code:465,name:"webtransport"},{code:466,name:"certhash",size:h,bytesToValue:Bt(Pe),valueToBytes:Nt},{code:480,name:"http"},{code:481,name:"http-path",size:h,stringToValue:e=>`/${decodeURIComponent(e)}`,valueToString:e=>encodeURIComponent(e.substring(1))},{code:443,name:"https"},{code:477,name:"ws"},{code:478,name:"wss"},{code:479,name:"p2p-websocket-star"},{code:277,name:"p2p-stardust"},{code:275,name:"p2p-webrtc-star"},{code:276,name:"p2p-webrtc-direct"},{code:280,name:"webrtc-direct"},{code:281,name:"webrtc"},{code:290,name:"p2p-circuit"},{code:777,name:"memory",size:h}];Yn.forEach(e=>{U.addProtocol(e)});function Lt(e){let r=[],t=0;for(;t<e.length;){let n=ge(e,t),o=U.getProtocol(n),i=R(n),s=eo(o,e,t+i),a=0;s>0&&o.size===h&&(a=R(s));let c=i+a+s,l={code:n,name:o.name,bytes:e.subarray(t,t+c)};if(s>0){let f=t+i+a,I=e.subarray(f,f+s);l.value=o.bytesToValue?.(I)??$(I)}r.push(l),t+=c}return r}function zt(e){let r=0,t=[];for(let n of e){if(n.bytes==null){let o=U.getProtocol(n.code),i=R(n.code),s,a=0,c=0;n.value!=null&&(s=o.valueToBytes?.(n.value)??te(n.value),a=s.byteLength,o.size===h&&(c=R(a)));let l=new Uint8Array(i+c+a),f=0;we(n.code,l,f),f+=i,s!=null&&(o.size===h&&(we(a,l,f),f+=c),l.set(s,f)),n.bytes=l}t.push(n.bytes),r+=n.bytes.byteLength}return X(t,r)}function $t(e){if(e.charAt(0)!=="/")throw new m('String multiaddr must start with "/"');let r=[],t="protocol",n="",o="";for(let i=1;i<e.length;i++){let s=e.charAt(i);s!=="/"&&(t==="protocol"?o+=e.charAt(i):n+=e.charAt(i));let a=i===e.length-1;if(s==="/"||a){let c=U.getProtocol(o);if(t==="protocol"){if(c.size==null||c.size===0){r.push({code:c.code,name:c.name}),n="",o="",t="protocol";continue}else if(a)throw new m(`Component ${o} was missing value`);t="value"}else if(t==="value"){let l={code:c.code,name:c.name};if(c.size!=null&&c.size!==0){if(n==="")throw new m(`Component ${o} was missing value`);l.value=c.stringToValue?.(n)??n}r.push(l),n="",o="",t="protocol"}}}if(o!==""&&n!=="")throw new m("Incomplete multiaddr");return r}function Vt(e){return`/${e.flatMap(r=>{if(r.value==null)return r.name;let t=U.getProtocol(r.code);if(t==null)throw new m(`Unknown protocol code ${r.code}`);return[r.name,t.valueToString?.(r.value)??r.value]}).join("/")}`}function eo(e,r,t){return e.size==null||e.size===0?0:e.size>0?e.size/8:ge(r,t)}var to=Symbol.for("nodejs.util.inspect.custom"),et=Symbol.for("@multiformats/multiaddr");function ro(e){if(e==null&&(e="/"),Rt(e))return e.getComponents();if(e instanceof Uint8Array)return Lt(e);if(typeof e=="string")return e=e.replace(/\/(\/)+/,"/").replace(/(\/)+$/,""),e===""&&(e="/"),$t(e);if(Array.isArray(e))return e;throw new m("Must be a string, Uint8Array, Component[], or another Multiaddr")}var pe=class e{[et]=!0;#e;#t;#r;constructor(r="/",t={}){this.#e=ro(r),t.validate!==!1&&no(this)}get bytes(){return this.#r==null&&(this.#r=zt(this.#e)),this.#r}toString(){return this.#t==null&&(this.#t=Vt(this.#e)),this.#t}toJSON(){return this.toString()}getComponents(){return[...this.#e]}encapsulate(r){let t=new e(r);return new e([...this.#e,...t.getComponents()],{validate:!1})}decapsulate(r){let t=r.toString(),n=this.toString(),o=n.lastIndexOf(t);if(o<0)throw new se(`Address ${this.toString()} does not contain subaddress: ${t}`);return new e(n.slice(0,o),{validate:!1})}decapsulateCode(r){let t;for(let n=this.#e.length-1;n>-1;n--)if(this.#e[n].code===r){t=n;break}return new e(this.#e.slice(0,t),{validate:!1})}equals(r){return tt(this.bytes,r.bytes)}[to](){return`Multiaddr(${this.toString()})`}};function no(e){e.getComponents().forEach(r=>{let t=U.getProtocol(r.code);r.value!=null&&t.validate?.(r.value)})}function Rt(e){return!!e?.[et]}function Mt(e){return new pe(e)}var oo=[6,53,56,54,55];function Ft(e){return kt("sni",e)?.value}function Wt(e){let r=kt("tcp",e)?.value;return r==null?"":`:${r}`}function kt(e,r){return r.find(t=>t.name===e)}function qt(e){return e.some(({code:r})=>r===448)}function C(e,r){let t=Ht[e.name];if(t==null)throw new Error(`Can't interpret protocol ${e.name}`);let n=t(e,r);return e.code===41?`[${n}]`:n}var Ht={ip4:(e,r)=>e.value,ip6:(e,r)=>r.length===0?e.value:`[${e.value}]`,tcp:(e,r)=>{let t=r.pop();if(t==null)throw new Error("Unexpected end of multiaddr");return`tcp://${C(t,r)}:${e.value}`},udp:(e,r)=>{let t=r.pop();if(t==null)throw new Error("Unexpected end of multiaddr");return`udp://${C(t,r)}:${e.value}`},dnsaddr:(e,r)=>e.value,dns4:(e,r)=>e.value,dns6:(e,r)=>e.value,dns:(e,r)=>e.value,ipfs:(e,r)=>{let t=r.pop();if(t==null)throw new Error("Unexpected end of multiaddr");return`${C(t,r)}`},p2p:(e,r)=>{let t=r.pop();if(t==null)throw new Error("Unexpected end of multiaddr");return`${C(t,r)}`},http:(e,r)=>{let t=qt(r),n=Ft(r),o=Wt(r);if(t&&n!=null)return`https://${n}${o}`;let i=t?"https://":"http://",s=r.pop();if(s==null)throw new Error("Unexpected end of multiaddr");let a=C(s,r);return a=a?.replace("tcp://",""),`${i}${a}`},"http-path":(e,r)=>{let t=r.pop();if(t==null)throw new Error("Unexpected end of multiaddr");let n=C(t,r),o=decodeURIComponent(e.value??"");return`${n}${o}`},tls:(e,r)=>{let t=r.pop();if(t==null)throw new Error("Unexpected end of multiaddr");return C(t,r)},sni:(e,r)=>{let t=r.pop();if(t==null)throw new Error("Unexpected end of multiaddr");return C(t,r)},https:(e,r)=>{let t=r.pop();if(t==null)throw new Error("Unexpected end of multiaddr");let n=C(t,r);return n=n?.replace("tcp://",""),`https://${n}`},ws:(e,r)=>{let t=qt(r),n=Ft(r),o=Wt(r);if(t&&n!=null)return`wss://${n}${o}`;let i=t?"wss://":"ws://",s=r.pop();if(s==null)throw new Error("Unexpected end of multiaddr");let a=C(s,r);return a=a?.replace("tcp://",""),`${i}${a}`},wss:(e,r)=>{let t=r.pop();if(t==null)throw new Error("Unexpected end of multiaddr");let n=C(t,r);return n=n?.replace("tcp://",""),`wss://${n}`}};function io(e,r){let n=Mt(e).getComponents(),o=n.pop();if(o==null)throw new Error("Unexpected end of multiaddr");let i=Ht[o.name];if(i==null)throw new Error(`No interpreter found for ${o.name}`);let s=i(o,n)??"";return r?.assumeHttp!==!1&&oo.includes(o.code)&&(s=s.replace(/^.*:\/\//,""),o.value==="443"?s=`https://${s}`:s=`http://${s}`),(s.startsWith("http://")||s.startsWith("https://")||s.startsWith("ws://")||s.startsWith("wss://"))&&(s=new URL(s).toString(),s.endsWith("/")&&(s=s.substring(0,s.length-1))),s}return Kt(so);})();
return MultiformatsMultiaddrToUri}));
//# sourceMappingURL=index.min.js.map
{
"name": "@multiformats/multiaddr-to-uri",
"version": "11.0.2",
"version": "12.0.0",
"description": "Convert a Multiaddr to a URI",

@@ -148,3 +148,3 @@ "author": "Alan Shaw",

"dependencies": {
"@multiformats/multiaddr": "^12.3.0"
"@multiformats/multiaddr": "^13.0.0"
},

@@ -151,0 +151,0 @@ "devDependencies": {

@@ -11,2 +11,17 @@ # @multiformats/multiaddr-to-uri

<!--
!IMPORTANT!
Everything in this README between "# About" and "# Install" is automatically
generated and will be overwritten the next time the doc generator is run.
To make changes to this section, please update the @packageDocumentation section
of src/index.js or src/index.ts
To experiment with formatting, please run "npm run docs" from the root of this
repo and examine the changes made.
-->
This module allows easy conversion of Multiaddrs to string URIs.

@@ -13,0 +28,0 @@

Sorry, the diff of this file is too big to display