@wormhole-foundation/wormhole-connect 1.0.0-beta.4-development → 1.0.0-beta.5-development
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/assets/{ccip-Dn5z57Cx.js → ccip-B-OK94pJ.js} +1 -1
- package/dist/assets/{evm-Ci-t-8ei.js → evm-CPj7oFVL.js} +4 -4
- package/dist/assets/{index-DlyJ6Tua.js → index-BWMdho2w.js} +2 -2
- package/dist/assets/{index-Da59NFoY.js → index-DGFWhjyA.js} +1 -1
- package/dist/assets/{index-yInQCZK6.js → index-Ddso83Ti.js} +1 -1
- package/dist/assets/{index.es-DUffrgf3.js → index.es-VchQxXD4.js} +2 -2
- package/dist/main.js +41 -41
- package/dist/src/views/v2/Bridge/AmountInput/index.d.ts.map +1 -1
- package/lib/{algorand-BZfir-Gt.js → algorand-DFJZIdnH.js} +1 -1
- package/lib/{algorand-B9ai7AKk.mjs → algorand-qEY4HHOc.mjs} +3 -3
- package/lib/{aptos-ZpPdNMHJ.mjs → aptos-BCuZuiBG.mjs} +1 -1
- package/lib/{aptos-CX7jOv1y.js → aptos-BHw0JlTE.js} +1 -1
- package/lib/{aptos-D_w5IEUK.js → aptos-D-S8DXGs.js} +2 -2
- package/lib/{aptos-BiWZASIH.mjs → aptos-DoqExVYR.mjs} +3 -3
- package/lib/{ccip-CLMQ2RsP.js → ccip-CXJ3nCk_.js} +1 -1
- package/lib/{ccip-lVzudYcQ.mjs → ccip-_0LmpQds.mjs} +1 -1
- package/lib/{cosmos-B3YMB-qs.mjs → cosmos-0un-E2-0.mjs} +6 -6
- package/lib/{cosmos-6rjmrhY_.js → cosmos-DCgWSBll.js} +1 -1
- package/lib/{cosmwasm-DMVssDjU.js → cosmwasm-BsEhYnuw.js} +2 -2
- package/lib/{cosmwasm-SnVdtN68.mjs → cosmwasm-DvwgrLe6.mjs} +7 -7
- package/lib/{events-pgsgrP1S.mjs → events-BL2eUG60.mjs} +1 -1
- package/lib/{events-t6i_QSEn.js → events-wpqGOay9.js} +1 -1
- package/lib/{evm-DFJuxSg1.js → evm-B46tP5Ah.js} +1 -1
- package/lib/{evm-D7GRIPdg.js → evm-BOrFw20j.js} +4 -4
- package/lib/{evm-Bd3DzKCY.mjs → evm-CkxKsuQ-.mjs} +7 -7
- package/lib/{evm-DiQodX72.mjs → evm-kynWl8-i.mjs} +5 -5
- package/lib/{index-C_JBf5AE.js → index-6gwCyfQU.js} +1 -1
- package/lib/{index-DG5KwGj7.mjs → index-BHOu1oLq.mjs} +3 -3
- package/lib/{index-CcKxlhe-.js → index-BNWJG0G4.js} +1 -1
- package/lib/{index-hiGmsL0b.mjs → index-BOppeFAI.mjs} +1 -1
- package/lib/{index-B64jLBfI.mjs → index-BTBmklHJ.mjs} +2 -2
- package/lib/{index-EPcXyhD3.js → index-BVz1aMw3.js} +1 -1
- package/lib/{index-BjpzXqrL.js → index-BWNh4wvK.js} +1 -1
- package/lib/{index-DllSkb9h.js → index-BwCIDEBK.js} +1 -1
- package/lib/{index-D4-zCm-j.js → index-C4ri6eMC.js} +1 -1
- package/lib/{index-CvRFH7pa.js → index-C7amSMG9.js} +1 -1
- package/lib/{index-CE4mRmPN.js → index-CAkX47d8.js} +1 -1
- package/lib/{index-BZ7LatAr.js → index-CDGktAjP.js} +3 -3
- package/lib/{index-BAqClXT6.js → index-CFVm1KSi.js} +1 -1
- package/lib/{index-DJgWkkqj.mjs → index-CLH7U4rp.mjs} +2 -2
- package/lib/{index-B_FxM4qi.js → index-CNIDBiCc.js} +1 -1
- package/lib/{index-DLXjX60f.js → index-CPgdgK8L.js} +1 -1
- package/lib/{index-0YCaekiF.mjs → index-CTwzW64I.mjs} +2 -2
- package/lib/{index-B5TmFc4M.js → index-CUInBQd6.js} +1 -1
- package/lib/{index-mAuqp4GD.js → index-CaFGZvKm.js} +1 -1
- package/lib/{index-DZbeM9gY.mjs → index-Cb47usqO.mjs} +2 -2
- package/lib/{index-EhUlCH18.mjs → index-CjwA7HmM.mjs} +23 -33
- package/lib/{index-BT7_dDgl.mjs → index-CkPaHAgJ.mjs} +3 -3
- package/lib/{index-B2aC_g_3.js → index-ClLbfY74.js} +1 -1
- package/lib/{index-CFVJznfe.js → index-ClRkhvNK.js} +1 -1
- package/lib/{index-C4NKqUWK.mjs → index-Cm3iq-IJ.mjs} +1 -1
- package/lib/{index-DWmEAYa2.js → index-CtJdy4GW.js} +1 -1
- package/lib/{index-CkyGUP8I.mjs → index-D0W1ZmqN.mjs} +2 -2
- package/lib/{index-0QJFchou.mjs → index-D5SPCl8N.mjs} +2 -2
- package/lib/{index-CpM8O4af.mjs → index-D6Sqxs9J.mjs} +4 -4
- package/lib/{index-fD6yeQDw.mjs → index-DC65dQZI.mjs} +7 -7
- package/lib/{index-BkyCouQJ.js → index-DICIR39L.js} +1 -1
- package/lib/{index-DVnPDtFx.mjs → index-DIddLRbN.mjs} +1 -1
- package/lib/{index-bpVbPzFG.mjs → index-DSSXLwpv.mjs} +1 -1
- package/lib/{index-Cl110Yt1.js → index-DVKptZW_.js} +1 -1
- package/lib/{index-Dk2OkATw.js → index-DcbhKZoU.js} +1 -1
- package/lib/{index-DPq8nS1b.mjs → index-DojwGTf0.mjs} +1 -1
- package/lib/{index-C9xfXphF.mjs → index-DrQrqu4U.mjs} +2 -2
- package/lib/{index-Bd6ExIDW.mjs → index-DvQkOUhD.mjs} +4 -4
- package/lib/{index-fPs98C_X.mjs → index-Dw4gUoPq.mjs} +2 -2
- package/lib/{index-DUn9bDrk.mjs → index-IypSUdxl.mjs} +2 -2
- package/lib/{index-2LZtNZ5P.js → index-QfqpopxL.js} +1 -1
- package/lib/{index-BhrO8yNx.mjs → index-SiA6wvOM.mjs} +2 -2
- package/lib/{index-VI9qDjx0.js → index-dZuWNqUJ.js} +1 -1
- package/lib/{index-BYv5Tbwe.mjs → index-fzN-meRd.mjs} +1 -1
- package/lib/{index-QqzqKjF9.js → index-hWgZ0Dfs.js} +1 -1
- package/lib/{index-048e7Uvl.js → index-tKKMDrTV.js} +1 -1
- package/lib/{index-BcbPoWss.mjs → index-tKooq_Tx.mjs} +3 -3
- package/lib/{index-CdFX-OBR.mjs → index-yd8RiLQo.mjs} +4 -4
- package/lib/{index.es-WCp4WrVw.js → index.es-BfpZO8dT.js} +2 -2
- package/lib/{index.es-B4wQLKJO.mjs → index.es-P5wvRtJq.mjs} +5 -5
- package/lib/index.js +1 -1
- package/lib/index.mjs +1 -1
- package/lib/{libsodium-wrappers-DnY3rBzj.mjs → libsodium-wrappers-BB6-Iffd.mjs} +1 -1
- package/lib/{libsodium-wrappers-BdZeVEOK.js → libsodium-wrappers-BvMpC4vD.js} +1 -1
- package/lib/{pako.esm-doGHPq3v.mjs → pako.esm-C7QrkxRd.mjs} +3 -3
- package/lib/{pako.esm-CpOVp0Fg.js → pako.esm-DlDLS2rv.js} +1 -1
- package/lib/{pbkdf2-CR1mMO6P.mjs → pbkdf2-DMV4l9Li.mjs} +1 -1
- package/lib/{pbkdf2-DRrUaAek.js → pbkdf2-Di1EjoiV.js} +1 -1
- package/lib/{sei-ReMraEM4.mjs → sei-CnR3Aw9g.mjs} +4 -4
- package/lib/{sei-BHskcl2R.js → sei-RTyi_UJs.js} +1 -1
- package/lib/{signer-BwkEV8NR.mjs → signer-BAztlcE7.mjs} +1 -1
- package/lib/{signer-C5udfQih.js → signer-CbhSUdvo.js} +1 -1
- package/lib/solana-Bkh_veaR.mjs +16 -0
- package/lib/solana-CKipdoh2.js +1 -0
- package/lib/{solana-kr2Et-_M.mjs → solana-CP3uz3z9.mjs} +4 -4
- package/lib/{solana-BWRzXH9-.js → solana-Cglhypga.js} +1 -1
- package/lib/{solanaEmbed.esm-8hegnauD.js → solanaEmbed.esm-8VvaQIYa.js} +1 -1
- package/lib/{solanaEmbed.esm-HLygiesN.mjs → solanaEmbed.esm-DfSXcnar.mjs} +4 -4
- package/lib/src/views/v2/Bridge/AmountInput/index.d.ts.map +1 -1
- package/lib/{sui-BWRqoTdl.js → sui-BLA0P5P1.js} +2 -2
- package/lib/{sui-BocrppL0.js → sui-BMLSVXBy.js} +1 -1
- package/lib/{sui-B6XCpe1d.mjs → sui-C73zQuHR.mjs} +1 -1
- package/lib/{sui-BuZPAcI0.mjs → sui-WPdV6u03.mjs} +4 -4
- package/lib/{unsignedTransaction-oXk8lD5s.mjs → unsignedTransaction-BWLDqwPd.mjs} +2 -2
- package/lib/{unsignedTransaction-DSuqsGgb.js → unsignedTransaction-Cl0WbHFW.js} +1 -1
- package/lib/{utils-SML27G4C.js → utils-CA5brb9u.js} +1 -1
- package/lib/{utils-fI-uXUZk.mjs → utils-Cd5O9nI7.mjs} +2 -2
- package/package.json +1 -1
- package/lib/solana-ci1dqiv5.mjs +0 -16
- package/lib/solana-gFEm46ZS.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const N=require("./index-BZ7LatAr.js"),ze=require("./index-DWmEAYa2.js"),Qn=require("./events-t6i_QSEn.js");function Wr(e=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(e):new Uint8Array(e)}function Hr(e,r){r||(r=e.reduce((s,d)=>s+d.length,0));const n=Wr(r);let a=0;for(const s of e)n.set(s,a),a+=s.length;return n}const vr={...ze.identityBase,...ze.base2,...ze.base8,...ze.base10,...ze.base16,...ze.base32,...ze.base36,...ze.base58,...ze.base64,...ze.base256emoji};function $r(e,r,n,a){return{name:e,prefix:r,encoder:{name:e,prefix:r,encode:n},decoder:{decode:a}}}const xr=$r("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),Yt=$r("ascii","a",e=>{let r="a";for(let n=0;n<e.length;n++)r+=String.fromCharCode(e[n]);return r},e=>{e=e.substring(1);const r=Wr(e.length);for(let n=0;n<e.length;n++)r[n]=e.charCodeAt(n);return r}),Gr={utf8:xr,"utf-8":xr,hex:vr.base16,latin1:Yt,ascii:Yt,binary:Yt,...vr};function Ft(e,r="utf8"){const n=Gr[r];if(!n)throw new Error(`Unsupported encoding "${r}"`);return(r==="utf8"||r==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(e,"utf8"):n.decoder.decode(`${n.prefix}${e}`)}function Jt(e,r="utf8"){const n=Gr[r];if(!n)throw new Error(`Unsupported encoding "${r}"`);return(r==="utf8"||r==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8"):n.encoder.encode(e).substring(1)}var Er=function(e,r,n){if(n||arguments.length===2)for(var a=0,s=r.length,d;a<s;a++)(d||!(a in r))&&(d||(d=Array.prototype.slice.call(r,0,a)),d[a]=r[a]);return e.concat(d||Array.prototype.slice.call(r))},ei=function(){function e(r,n,a){this.name=r,this.version=n,this.os=a,this.type="browser"}return e}(),ti=function(){function e(r){this.version=r,this.type="node",this.name="node",this.os=N.dist.process.platform}return e}(),ri=function(){function e(r,n,a,s){this.name=r,this.version=n,this.os=a,this.bot=s,this.type="bot-device"}return e}(),ni=function(){function e(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return e}(),ii=function(){function e(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return e}(),si=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,oi=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,Sr=3,ai=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",si]],Ir=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function fi(e){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new ii:typeof navigator<"u"?ui(navigator.userAgent):di()}function ci(e){return e!==""&&ai.reduce(function(r,n){var a=n[0],s=n[1];if(r)return r;var d=s.exec(e);return!!d&&[a,d]},!1)}function ui(e){var r=ci(e);if(!r)return null;var n=r[0],a=r[1];if(n==="searchbot")return new ni;var s=a[1]&&a[1].split(".").join("_").split("_").slice(0,3);s?s.length<Sr&&(s=Er(Er([],s,!0),hi(Sr-s.length),!0)):s=[];var d=s.join("."),E=li(e),v=oi.exec(e);return v&&v[1]?new ri(n,d,E,v[1]):new ei(n,d,E)}function li(e){for(var r=0,n=Ir.length;r<n;r++){var a=Ir[r],s=a[0],d=a[1],E=d.exec(e);if(E)return s}return null}function di(){var e=typeof N.dist.process<"u"&&N.dist.process.version;return e?new ti(N.dist.process.version.slice(1)):null}function hi(e){for(var r=[],n=0;n<e;n++)r.push("0");return r}const bi={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe",batchFetchMessages:"waku_batchFetchMessages"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe",batchFetchMessages:"irn_batchFetchMessages"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe",batchFetchMessages:"iridium_batchFetchMessages"}},gi=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,yi=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,pi=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function _i(e,r){if(e==="__proto__"||e==="constructor"&&r&&typeof r=="object"&&"prototype"in r){mi(e);return}return r}function mi(e){console.warn(`[destr] Dropping "${e}" key to prevent prototype pollution.`)}function zt(e,r={}){if(typeof e!="string")return e;const n=e.trim();if(e[0]==='"'&&e.endsWith('"')&&!e.includes("\\"))return n.slice(1,-1);if(n.length<=9){const a=n.toLowerCase();if(a==="true")return!0;if(a==="false")return!1;if(a==="undefined")return;if(a==="null")return null;if(a==="nan")return Number.NaN;if(a==="infinity")return Number.POSITIVE_INFINITY;if(a==="-infinity")return Number.NEGATIVE_INFINITY}if(!pi.test(e)){if(r.strict)throw new SyntaxError("[destr] Invalid JSON");return e}try{if(gi.test(e)||yi.test(e)){if(r.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(e,_i)}return JSON.parse(e)}catch(a){if(r.strict)throw a;return e}}function wi(e){return!e||typeof e.then!="function"?Promise.resolve(e):e}function Te(e,...r){try{return wi(e(...r))}catch(n){return Promise.reject(n)}}function vi(e){const r=typeof e;return e===null||r!=="object"&&r!=="function"}function xi(e){const r=Object.getPrototypeOf(e);return!r||r.isPrototypeOf(Object)}function Ut(e){if(vi(e))return String(e);if(xi(e)||Array.isArray(e))return JSON.stringify(e);if(typeof e.toJSON=="function")return Ut(e.toJSON());throw new Error("[unstorage] Cannot stringify value!")}function kr(){if(typeof N.dist.Buffer===void 0)throw new TypeError("[unstorage] Buffer is not supported!")}const tr="base64:";function Ei(e){if(typeof e=="string")return e;kr();const r=N.dist.Buffer.from(e).toString("base64");return tr+r}function Si(e){return typeof e!="string"||!e.startsWith(tr)?e:(kr(),N.dist.Buffer.from(e.slice(tr.length),"base64"))}function Ue(e){return e?e.split("?")[0].replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""):""}function Ii(...e){return Ue(e.join(":"))}function Dt(e){return e=Ue(e),e?e+":":""}const Oi="memory",Ti=()=>{const e=new Map;return{name:Oi,options:{},hasItem(r){return e.has(r)},getItem(r){return e.get(r)??null},getItemRaw(r){return e.get(r)??null},setItem(r,n){e.set(r,n)},setItemRaw(r,n){e.set(r,n)},removeItem(r){e.delete(r)},getKeys(){return Array.from(e.keys())},clear(){e.clear()},dispose(){e.clear()}}};function Ai(e={}){const r={mounts:{"":e.driver||Ti()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},n=o=>{for(const l of r.mountpoints)if(o.startsWith(l))return{base:l,relativeKey:o.slice(l.length),driver:r.mounts[l]};return{base:"",relativeKey:o,driver:r.mounts[""]}},a=(o,l)=>r.mountpoints.filter(y=>y.startsWith(o)||l&&o.startsWith(y)).map(y=>({relativeBase:o.length>y.length?o.slice(y.length):void 0,mountpoint:y,driver:r.mounts[y]})),s=(o,l)=>{if(r.watching){l=Ue(l);for(const y of r.watchListeners)y(o,l)}},d=async()=>{if(!r.watching){r.watching=!0;for(const o in r.mounts)r.unwatch[o]=await Or(r.mounts[o],s,o)}},E=async()=>{if(r.watching){for(const o in r.unwatch)await r.unwatch[o]();r.unwatch={},r.watching=!1}},v=(o,l,y)=>{const S=new Map,x=w=>{let j=S.get(w.base);return j||(j={driver:w.driver,base:w.base,items:[]},S.set(w.base,j)),j};for(const w of o){const j=typeof w=="string",J=Ue(j?w:w.key),q=j?void 0:w.value,B=j||!w.options?l:{...l,...w.options},Ae=n(J);x(Ae).items.push({key:J,value:q,relativeKey:Ae.relativeKey,options:B})}return Promise.all([...S.values()].map(w=>y(w))).then(w=>w.flat())},g={hasItem(o,l={}){o=Ue(o);const{relativeKey:y,driver:S}=n(o);return Te(S.hasItem,y,l)},getItem(o,l={}){o=Ue(o);const{relativeKey:y,driver:S}=n(o);return Te(S.getItem,y,l).then(x=>zt(x))},getItems(o,l){return v(o,l,y=>y.driver.getItems?Te(y.driver.getItems,y.items.map(S=>({key:S.relativeKey,options:S.options})),l).then(S=>S.map(x=>({key:Ii(y.base,x.key),value:zt(x.value)}))):Promise.all(y.items.map(S=>Te(y.driver.getItem,S.relativeKey,S.options).then(x=>({key:S.key,value:zt(x)})))))},getItemRaw(o,l={}){o=Ue(o);const{relativeKey:y,driver:S}=n(o);return S.getItemRaw?Te(S.getItemRaw,y,l):Te(S.getItem,y,l).then(x=>Si(x))},async setItem(o,l,y={}){if(l===void 0)return g.removeItem(o);o=Ue(o);const{relativeKey:S,driver:x}=n(o);x.setItem&&(await Te(x.setItem,S,Ut(l),y),x.watch||s("update",o))},async setItems(o,l){await v(o,l,async y=>{if(y.driver.setItems)return Te(y.driver.setItems,y.items.map(S=>({key:S.relativeKey,value:Ut(S.value),options:S.options})),l);y.driver.setItem&&await Promise.all(y.items.map(S=>Te(y.driver.setItem,S.relativeKey,Ut(S.value),S.options)))})},async setItemRaw(o,l,y={}){if(l===void 0)return g.removeItem(o,y);o=Ue(o);const{relativeKey:S,driver:x}=n(o);if(x.setItemRaw)await Te(x.setItemRaw,S,l,y);else if(x.setItem)await Te(x.setItem,S,Ei(l),y);else return;x.watch||s("update",o)},async removeItem(o,l={}){typeof l=="boolean"&&(l={removeMeta:l}),o=Ue(o);const{relativeKey:y,driver:S}=n(o);S.removeItem&&(await Te(S.removeItem,y,l),(l.removeMeta||l.removeMata)&&await Te(S.removeItem,y+"$",l),S.watch||s("remove",o))},async getMeta(o,l={}){typeof l=="boolean"&&(l={nativeOnly:l}),o=Ue(o);const{relativeKey:y,driver:S}=n(o),x=Object.create(null);if(S.getMeta&&Object.assign(x,await Te(S.getMeta,y,l)),!l.nativeOnly){const w=await Te(S.getItem,y+"$",l).then(j=>zt(j));w&&typeof w=="object"&&(typeof w.atime=="string"&&(w.atime=new Date(w.atime)),typeof w.mtime=="string"&&(w.mtime=new Date(w.mtime)),Object.assign(x,w))}return x},setMeta(o,l,y={}){return this.setItem(o+"$",l,y)},removeMeta(o,l={}){return this.removeItem(o+"$",l)},async getKeys(o,l={}){o=Dt(o);const y=a(o,!0);let S=[];const x=[];for(const w of y){const J=(await Te(w.driver.getKeys,w.relativeBase,l)).map(q=>w.mountpoint+Ue(q)).filter(q=>!S.some(B=>q.startsWith(B)));x.push(...J),S=[w.mountpoint,...S.filter(q=>!q.startsWith(w.mountpoint))]}return o?x.filter(w=>w.startsWith(o)&&!w.endsWith("$")):x.filter(w=>!w.endsWith("$"))},async clear(o,l={}){o=Dt(o),await Promise.all(a(o,!1).map(async y=>{if(y.driver.clear)return Te(y.driver.clear,y.relativeBase,l);if(y.driver.removeItem){const S=await y.driver.getKeys(y.relativeBase||"",l);return Promise.all(S.map(x=>y.driver.removeItem(x,l)))}}))},async dispose(){await Promise.all(Object.values(r.mounts).map(o=>Tr(o)))},async watch(o){return await d(),r.watchListeners.push(o),async()=>{r.watchListeners=r.watchListeners.filter(l=>l!==o),r.watchListeners.length===0&&await E()}},async unwatch(){r.watchListeners=[],await E()},mount(o,l){if(o=Dt(o),o&&r.mounts[o])throw new Error(`already mounted at ${o}`);return o&&(r.mountpoints.push(o),r.mountpoints.sort((y,S)=>S.length-y.length)),r.mounts[o]=l,r.watching&&Promise.resolve(Or(l,s,o)).then(y=>{r.unwatch[o]=y}).catch(console.error),g},async unmount(o,l=!0){o=Dt(o),!(!o||!r.mounts[o])&&(r.watching&&o in r.unwatch&&(r.unwatch[o](),delete r.unwatch[o]),l&&await Tr(r.mounts[o]),r.mountpoints=r.mountpoints.filter(y=>y!==o),delete r.mounts[o])},getMount(o=""){o=Ue(o)+":";const l=n(o);return{driver:l.driver,base:l.base}},getMounts(o="",l={}){return o=Ue(o),a(o,l.parents).map(S=>({driver:S.driver,base:S.mountpoint}))}};return g}function Or(e,r,n){return e.watch?e.watch((a,s)=>r(a,n+s)):()=>{}}async function Tr(e){typeof e.dispose=="function"&&await Te(e.dispose)}function bt(e){return new Promise((r,n)=>{e.oncomplete=e.onsuccess=()=>r(e.result),e.onabort=e.onerror=()=>n(e.error)})}function Fr(e,r){const n=indexedDB.open(e);n.onupgradeneeded=()=>n.result.createObjectStore(r);const a=bt(n);return(s,d)=>a.then(E=>d(E.transaction(r,s).objectStore(r)))}let Zt;function At(){return Zt||(Zt=Fr("keyval-store","keyval")),Zt}function Ar(e,r=At()){return r("readonly",n=>bt(n.get(e)))}function Li(e,r,n=At()){return n("readwrite",a=>(a.put(r,e),bt(a.transaction)))}function Ri(e,r=At()){return r("readwrite",n=>(n.delete(e),bt(n.transaction)))}function Pi(e=At()){return e("readwrite",r=>(r.clear(),bt(r.transaction)))}function Ci(e,r){return e.openCursor().onsuccess=function(){this.result&&(r(this.result),this.result.continue())},bt(e.transaction)}function Mi(e=At()){return e("readonly",r=>{if(r.getAllKeys)return bt(r.getAllKeys());const n=[];return Ci(r,a=>n.push(a.key)).then(()=>n)})}const ji=e=>JSON.stringify(e,(r,n)=>typeof n=="bigint"?n.toString()+"n":n),Ni=e=>{const r=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,n=e.replace(r,'$1"$2n"$3');return JSON.parse(n,(a,s)=>typeof s=="string"&&s.match(/^\d+n$/)?BigInt(s.substring(0,s.length-1)):s)};function Vt(e){if(typeof e!="string")throw new Error(`Cannot safe json parse value of type ${typeof e}`);try{return Ni(e)}catch{return e}}function ht(e){return typeof e=="string"?e:ji(e)||""}const Bi="idb-keyval";var zi=(e={})=>{const r=e.base&&e.base.length>0?`${e.base}:`:"",n=s=>r+s;let a;return e.dbName&&e.storeName&&(a=Fr(e.dbName,e.storeName)),{name:Bi,options:e,async hasItem(s){return!(typeof await Ar(n(s),a)>"u")},async getItem(s){return await Ar(n(s),a)??null},setItem(s,d){return Li(n(s),d,a)},removeItem(s){return Ri(n(s),a)},getKeys(){return Mi(a)},clear(){return Pi(a)}}};const Di="WALLET_CONNECT_V2_INDEXED_DB",Ki="keyvaluestorage";let Ui=class{constructor(){this.indexedDb=Ai({driver:zi({dbName:Di,storeName:Ki})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(r=>[r.key,r.value])}async getItem(r){const n=await this.indexedDb.getItem(r);if(n!==null)return n}async setItem(r,n){await this.indexedDb.setItem(r,ht(n))}async removeItem(r){await this.indexedDb.removeItem(r)}};var Qt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof N.dist.global<"u"?N.dist.global:typeof self<"u"?self:{},Wt={exports:{}};(function(){let e;function r(){}e=r,e.prototype.getItem=function(n){return this.hasOwnProperty(n)?String(this[n]):null},e.prototype.setItem=function(n,a){this[n]=String(a)},e.prototype.removeItem=function(n){delete this[n]},e.prototype.clear=function(){const n=this;Object.keys(n).forEach(function(a){n[a]=void 0,delete n[a]})},e.prototype.key=function(n){return n=n||0,Object.keys(this)[n]},e.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof Qt<"u"&&Qt.localStorage?Wt.exports=Qt.localStorage:typeof window<"u"&&window.localStorage?Wt.exports=window.localStorage:Wt.exports=new r})();function Wi(e){var r;return[e[0],Vt((r=e[1])!=null?r:"")]}class Hi{constructor(){this.localStorage=Wt.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(Wi)}async getItem(r){const n=this.localStorage.getItem(r);if(n!==null)return Vt(n)}async setItem(r,n){this.localStorage.setItem(r,ht(n))}async removeItem(r){this.localStorage.removeItem(r)}}const $i="wc_storage_version",Lr=1,Gi=async(e,r,n)=>{const a=$i,s=await r.getItem(a);if(s&&s>=Lr){n(r);return}const d=await e.getKeys();if(!d.length){n(r);return}const E=[];for(;d.length;){const v=d.shift();if(!v)continue;const g=v.toLowerCase();if(g.includes("wc@")||g.includes("walletconnect")||g.includes("wc_")||g.includes("wallet_connect")){const o=await e.getItem(v);await r.setItem(v,o),E.push(v)}}await r.setItem(a,Lr),n(r),ki(e,E)},ki=async(e,r)=>{r.length&&r.forEach(async n=>{await e.removeItem(n)})};let Fi=class{constructor(){this.initialized=!1,this.setInitialized=n=>{this.storage=n,this.initialized=!0};const r=new Hi;this.storage=r;try{const n=new Ui;Gi(r,n,this.setInitialized)}catch{this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(r){return await this.initialize(),this.storage.getItem(r)}async setItem(r,n){return await this.initialize(),this.storage.setItem(r,n)}async removeItem(r){return await this.initialize(),this.storage.removeItem(r)}async initialize(){this.initialized||await new Promise(r=>{const n=setInterval(()=>{this.initialized&&(clearInterval(n),r())},20)})}};class Ji{}function Vi(e){try{return JSON.stringify(e)}catch{return'"[Circular]"'}}var Xi=qi;function qi(e,r,n){var a=n&&n.stringify||Vi,s=1;if(typeof e=="object"&&e!==null){var d=r.length+s;if(d===1)return e;var E=new Array(d);E[0]=a(e);for(var v=1;v<d;v++)E[v]=a(r[v]);return E.join(" ")}if(typeof e!="string")return e;var g=r.length;if(g===0)return e;for(var o="",l=1-s,y=-1,S=e&&e.length||0,x=0;x<S;){if(e.charCodeAt(x)===37&&x+1<S){switch(y=y>-1?y:0,e.charCodeAt(x+1)){case 100:case 102:if(l>=g||r[l]==null)break;y<x&&(o+=e.slice(y,x)),o+=Number(r[l]),y=x+2,x++;break;case 105:if(l>=g||r[l]==null)break;y<x&&(o+=e.slice(y,x)),o+=Math.floor(Number(r[l])),y=x+2,x++;break;case 79:case 111:case 106:if(l>=g||r[l]===void 0)break;y<x&&(o+=e.slice(y,x));var w=typeof r[l];if(w==="string"){o+="'"+r[l]+"'",y=x+2,x++;break}if(w==="function"){o+=r[l].name||"<anonymous>",y=x+2,x++;break}o+=a(r[l]),y=x+2,x++;break;case 115:if(l>=g)break;y<x&&(o+=e.slice(y,x)),o+=String(r[l]),y=x+2,x++;break;case 37:y<x&&(o+=e.slice(y,x)),o+="%",y=x+2,x++,l--;break}++l}++x}return y===-1?e:(y<S&&(o+=e.slice(y)),o)}const Rr=Xi;var mt=Qe;const It=os().console||{},Yi={mapHttpRequest:Kt,mapHttpResponse:Kt,wrapRequestSerializer:er,wrapResponseSerializer:er,wrapErrorSerializer:er,req:Kt,res:Kt,err:rs};function Zi(e,r){return Array.isArray(e)?e.filter(function(a){return a!=="!stdSerializers.err"}):e===!0?Object.keys(r):!1}function Qe(e){e=e||{},e.browser=e.browser||{};const r=e.browser.transmit;if(r&&typeof r.send!="function")throw Error("pino: transmit option must have a send function");const n=e.browser.write||It;e.browser.write&&(e.browser.asObject=!0);const a=e.serializers||{},s=Zi(e.browser.serialize,a);let d=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(d=!1);const E=["error","fatal","warn","info","debug","trace"];typeof n=="function"&&(n.error=n.fatal=n.warn=n.info=n.debug=n.trace=n),e.enabled===!1&&(e.level="silent");const v=e.level||"info",g=Object.create(n);g.log||(g.log=Ot),Object.defineProperty(g,"levelVal",{get:l}),Object.defineProperty(g,"level",{get:y,set:S});const o={transmit:r,serialize:s,asObject:e.browser.asObject,levels:E,timestamp:ns(e)};g.levels=Qe.levels,g.level=v,g.setMaxListeners=g.getMaxListeners=g.emit=g.addListener=g.on=g.prependListener=g.once=g.prependOnceListener=g.removeListener=g.removeAllListeners=g.listeners=g.listenerCount=g.eventNames=g.write=g.flush=Ot,g.serializers=a,g._serialize=s,g._stdErrSerialize=d,g.child=x,r&&(g._logEvent=rr());function l(){return this.level==="silent"?1/0:this.levels.values[this.level]}function y(){return this._level}function S(w){if(w!=="silent"&&!this.levels.values[w])throw Error("unknown level "+w);this._level=w,pt(o,g,"error","log"),pt(o,g,"fatal","error"),pt(o,g,"warn","error"),pt(o,g,"info","log"),pt(o,g,"debug","log"),pt(o,g,"trace","log")}function x(w,j){if(!w)throw new Error("missing bindings for child Pino");j=j||{},s&&w.serializers&&(j.serializers=w.serializers);const J=j.serializers;if(s&&J){var q=Object.assign({},a,J),B=e.browser.serialize===!0?Object.keys(q):s;delete w.serializers,Xt([w],B,q,this._stdErrSerialize)}function Ae(ge){this._childLevel=(ge._childLevel|0)+1,this.error=_t(ge,w,"error"),this.fatal=_t(ge,w,"fatal"),this.warn=_t(ge,w,"warn"),this.info=_t(ge,w,"info"),this.debug=_t(ge,w,"debug"),this.trace=_t(ge,w,"trace"),q&&(this.serializers=q,this._serialize=B),r&&(this._logEvent=rr([].concat(ge._logEvent.bindings,w)))}return Ae.prototype=this,new Ae(this)}return g}Qe.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}};Qe.stdSerializers=Yi;Qe.stdTimeFunctions=Object.assign({},{nullTime:Jr,epochTime:Vr,unixTime:is,isoTime:ss});function pt(e,r,n,a){const s=Object.getPrototypeOf(r);r[n]=r.levelVal>r.levels.values[n]?Ot:s[n]?s[n]:It[n]||It[a]||Ot,Qi(e,r,n)}function Qi(e,r,n){!e.transmit&&r[n]===Ot||(r[n]=function(a){return function(){const d=e.timestamp(),E=new Array(arguments.length),v=Object.getPrototypeOf&&Object.getPrototypeOf(this)===It?It:this;for(var g=0;g<E.length;g++)E[g]=arguments[g];if(e.serialize&&!e.asObject&&Xt(E,this._serialize,this.serializers,this._stdErrSerialize),e.asObject?a.call(v,es(this,n,E,d)):a.apply(v,E),e.transmit){const o=e.transmit.level||r.level,l=Qe.levels.values[o],y=Qe.levels.values[n];if(y<l)return;ts(this,{ts:d,methodLevel:n,methodValue:y,transmitLevel:o,transmitValue:Qe.levels.values[e.transmit.level||r.level],send:e.transmit.send,val:r.levelVal},E)}}}(r[n]))}function es(e,r,n,a){e._serialize&&Xt(n,e._serialize,e.serializers,e._stdErrSerialize);const s=n.slice();let d=s[0];const E={};a&&(E.time=a),E.level=Qe.levels.values[r];let v=(e._childLevel|0)+1;if(v<1&&(v=1),d!==null&&typeof d=="object"){for(;v--&&typeof s[0]=="object";)Object.assign(E,s.shift());d=s.length?Rr(s.shift(),s):void 0}else typeof d=="string"&&(d=Rr(s.shift(),s));return d!==void 0&&(E.msg=d),E}function Xt(e,r,n,a){for(const s in e)if(a&&e[s]instanceof Error)e[s]=Qe.stdSerializers.err(e[s]);else if(typeof e[s]=="object"&&!Array.isArray(e[s]))for(const d in e[s])r&&r.indexOf(d)>-1&&d in n&&(e[s][d]=n[d](e[s][d]))}function _t(e,r,n){return function(){const a=new Array(1+arguments.length);a[0]=r;for(var s=1;s<a.length;s++)a[s]=arguments[s-1];return e[n].apply(this,a)}}function ts(e,r,n){const a=r.send,s=r.ts,d=r.methodLevel,E=r.methodValue,v=r.val,g=e._logEvent.bindings;Xt(n,e._serialize||Object.keys(e.serializers),e.serializers,e._stdErrSerialize===void 0?!0:e._stdErrSerialize),e._logEvent.ts=s,e._logEvent.messages=n.filter(function(o){return g.indexOf(o)===-1}),e._logEvent.level.label=d,e._logEvent.level.value=E,a(d,e._logEvent,v),e._logEvent=rr(g)}function rr(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function rs(e){const r={type:e.constructor.name,msg:e.message,stack:e.stack};for(const n in e)r[n]===void 0&&(r[n]=e[n]);return r}function ns(e){return typeof e.timestamp=="function"?e.timestamp:e.timestamp===!1?Jr:Vr}function Kt(){return{}}function er(e){return e}function Ot(){}function Jr(){return!1}function Vr(){return Date.now()}function is(){return Math.round(Date.now()/1e3)}function ss(){return new Date(Date.now()).toISOString()}function os(){function e(r){return typeof r<"u"&&r}try{return typeof globalThis<"u"||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch{return e(self)||e(window)||e(this)||{}}}const or=N.getDefaultExportFromCjs(mt),as={level:"info"},Lt="custom_context",ar=1e3*1024;class fs{constructor(r){this.nodeValue=r,this.sizeInBytes=new TextEncoder().encode(this.nodeValue).length,this.next=null}get value(){return this.nodeValue}get size(){return this.sizeInBytes}}class Pr{constructor(r){this.head=null,this.tail=null,this.lengthInNodes=0,this.maxSizeInBytes=r,this.sizeInBytes=0}append(r){const n=new fs(r);if(n.size>this.maxSizeInBytes)throw new Error(`[LinkedList] Value too big to insert into list: ${r} with size ${n.size}`);for(;this.size+n.size>this.maxSizeInBytes;)this.shift();this.head?(this.tail&&(this.tail.next=n),this.tail=n):(this.head=n,this.tail=n),this.lengthInNodes++,this.sizeInBytes+=n.size}shift(){if(!this.head)return;const r=this.head;this.head=this.head.next,this.head||(this.tail=null),this.lengthInNodes--,this.sizeInBytes-=r.size}toArray(){const r=[];let n=this.head;for(;n!==null;)r.push(n.value),n=n.next;return r}get length(){return this.lengthInNodes}get size(){return this.sizeInBytes}toOrderedArray(){return Array.from(this)}[Symbol.iterator](){let r=this.head;return{next:()=>{if(!r)return{done:!0,value:null};const n=r.value;return r=r.next,{done:!1,value:n}}}}}class Xr{constructor(r,n=ar){this.level=r??"error",this.levelValue=mt.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=n,this.logs=new Pr(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(r,n){n===mt.levels.values.error?console.error(r):n===mt.levels.values.warn?console.warn(r):n===mt.levels.values.debug?console.debug(r):n===mt.levels.values.trace?console.trace(r):console.log(r)}appendToLogs(r){this.logs.append(ht({timestamp:new Date().toISOString(),log:r}));const n=typeof r=="string"?JSON.parse(r).level:r.level;n>=this.levelValue&&this.forwardToConsole(r,n)}getLogs(){return this.logs}clearLogs(){this.logs=new Pr(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(r){const n=this.getLogArray();return n.push(ht({extraMetadata:r})),new Blob(n,{type:"application/json"})}}class cs{constructor(r,n=ar){this.baseChunkLogger=new Xr(r,n)}write(r){this.baseChunkLogger.appendToLogs(r)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(r){return this.baseChunkLogger.logsToBlob(r)}downloadLogsBlobInBrowser(r){const n=URL.createObjectURL(this.logsToBlob(r)),a=document.createElement("a");a.href=n,a.download=`walletconnect-logs-${new Date().toISOString()}.txt`,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(n)}}class us{constructor(r,n=ar){this.baseChunkLogger=new Xr(r,n)}write(r){this.baseChunkLogger.appendToLogs(r)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(r){return this.baseChunkLogger.logsToBlob(r)}}var ls=Object.defineProperty,ds=Object.defineProperties,hs=Object.getOwnPropertyDescriptors,Cr=Object.getOwnPropertySymbols,bs=Object.prototype.hasOwnProperty,gs=Object.prototype.propertyIsEnumerable,Mr=(e,r,n)=>r in e?ls(e,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[r]=n,Ht=(e,r)=>{for(var n in r||(r={}))bs.call(r,n)&&Mr(e,n,r[n]);if(Cr)for(var n of Cr(r))gs.call(r,n)&&Mr(e,n,r[n]);return e},$t=(e,r)=>ds(e,hs(r));function ys(e){return $t(Ht({},e),{level:(e==null?void 0:e.level)||as.level})}function ps(e,r=Lt){return e[r]||""}function _s(e,r,n=Lt){return e[n]=r,e}function qr(e,r=Lt){let n="";return typeof e.bindings>"u"?n=ps(e,r):n=e.bindings().context||"",n}function ms(e,r,n=Lt){const a=qr(e,n);return a.trim()?`${a}/${r}`:r}function ws(e,r,n=Lt){const a=ms(e,r,n),s=e.child({context:a});return _s(s,a,n)}function vs(e){var r,n;const a=new cs((r=e.opts)==null?void 0:r.level,e.maxSizeInBytes);return{logger:or($t(Ht({},e.opts),{level:"trace",browser:$t(Ht({},(n=e.opts)==null?void 0:n.browser),{write:s=>a.write(s)})})),chunkLoggerController:a}}function xs(e){var r;const n=new us((r=e.opts)==null?void 0:r.level,e.maxSizeInBytes);return{logger:or($t(Ht({},e.opts),{level:"trace"}),n),chunkLoggerController:n}}function Es(e){return typeof e.loggerOverride<"u"&&typeof e.loggerOverride!="string"?{logger:e.loggerOverride,chunkLoggerController:null}:typeof window<"u"?vs(e):xs(e)}var fr={},Yr={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});var r=ze.binary,n=ze.wipe;e.DIGEST_LENGTH=64,e.BLOCK_SIZE=128;var a=function(){function v(){this.digestLength=e.DIGEST_LENGTH,this.blockSize=e.BLOCK_SIZE,this._stateHi=new Int32Array(8),this._stateLo=new Int32Array(8),this._tempHi=new Int32Array(16),this._tempLo=new Int32Array(16),this._buffer=new Uint8Array(256),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return v.prototype._initState=function(){this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209},v.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},v.prototype.clean=function(){n.wipe(this._buffer),n.wipe(this._tempHi),n.wipe(this._tempLo),this.reset()},v.prototype.update=function(g,o){if(o===void 0&&(o=g.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var l=0;if(this._bytesHashed+=o,this._bufferLength>0){for(;this._bufferLength<e.BLOCK_SIZE&&o>0;)this._buffer[this._bufferLength++]=g[l++],o--;this._bufferLength===this.blockSize&&(d(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(o>=this.blockSize&&(l=d(this._tempHi,this._tempLo,this._stateHi,this._stateLo,g,l,o),o%=this.blockSize);o>0;)this._buffer[this._bufferLength++]=g[l++],o--;return this},v.prototype.finish=function(g){if(!this._finished){var o=this._bytesHashed,l=this._bufferLength,y=o/536870912|0,S=o<<3,x=o%128<112?128:256;this._buffer[l]=128;for(var w=l+1;w<x-8;w++)this._buffer[w]=0;r.writeUint32BE(y,this._buffer,x-8),r.writeUint32BE(S,this._buffer,x-4),d(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,x),this._finished=!0}for(var w=0;w<this.digestLength/8;w++)r.writeUint32BE(this._stateHi[w],g,w*8),r.writeUint32BE(this._stateLo[w],g,w*8+4);return this},v.prototype.digest=function(){var g=new Uint8Array(this.digestLength);return this.finish(g),g},v.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{stateHi:new Int32Array(this._stateHi),stateLo:new Int32Array(this._stateLo),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},v.prototype.restoreState=function(g){return this._stateHi.set(g.stateHi),this._stateLo.set(g.stateLo),this._bufferLength=g.bufferLength,g.buffer&&this._buffer.set(g.buffer),this._bytesHashed=g.bytesHashed,this._finished=!1,this},v.prototype.cleanSavedState=function(g){n.wipe(g.stateHi),n.wipe(g.stateLo),g.buffer&&n.wipe(g.buffer),g.bufferLength=0,g.bytesHashed=0},v}();e.SHA512=a;var s=new Int32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]);function d(v,g,o,l,y,S,x){for(var w=o[0],j=o[1],J=o[2],q=o[3],B=o[4],Ae=o[5],ge=o[6],Me=o[7],$=l[0],M=l[1],je=l[2],et=l[3],ye=l[4],Fe=l[5],We=l[6],Xe=l[7],m,_,Y,le,L,I,O,A;x>=128;){for(var Le=0;Le<16;Le++){var ne=8*Le+S;v[Le]=r.readUint32BE(y,ne),g[Le]=r.readUint32BE(y,ne+4)}for(var Le=0;Le<80;Le++){var wt=w,z=j,gt=J,b=q,h=B,u=Ae,t=ge,f=Me,R=$,P=M,K=je,U=et,D=ye,W=Fe,Re=We,de=Xe;if(m=Me,_=Xe,L=_&65535,I=_>>>16,O=m&65535,A=m>>>16,m=(B>>>14|ye<<18)^(B>>>18|ye<<14)^(ye>>>9|B<<23),_=(ye>>>14|B<<18)^(ye>>>18|B<<14)^(B>>>9|ye<<23),L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,m=B&Ae^~B&ge,_=ye&Fe^~ye&We,L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,m=s[Le*2],_=s[Le*2+1],L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,m=v[Le%16],_=g[Le%16],L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,I+=L>>>16,O+=I>>>16,A+=O>>>16,Y=O&65535|A<<16,le=L&65535|I<<16,m=Y,_=le,L=_&65535,I=_>>>16,O=m&65535,A=m>>>16,m=(w>>>28|$<<4)^($>>>2|w<<30)^($>>>7|w<<25),_=($>>>28|w<<4)^(w>>>2|$<<30)^(w>>>7|$<<25),L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,m=w&j^w&J^j&J,_=$&M^$&je^M&je,L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,I+=L>>>16,O+=I>>>16,A+=O>>>16,f=O&65535|A<<16,de=L&65535|I<<16,m=b,_=U,L=_&65535,I=_>>>16,O=m&65535,A=m>>>16,m=Y,_=le,L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,I+=L>>>16,O+=I>>>16,A+=O>>>16,b=O&65535|A<<16,U=L&65535|I<<16,j=wt,J=z,q=gt,B=b,Ae=h,ge=u,Me=t,w=f,M=R,je=P,et=K,ye=U,Fe=D,We=W,Xe=Re,$=de,Le%16===15)for(var ne=0;ne<16;ne++)m=v[ne],_=g[ne],L=_&65535,I=_>>>16,O=m&65535,A=m>>>16,m=v[(ne+9)%16],_=g[(ne+9)%16],L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,Y=v[(ne+1)%16],le=g[(ne+1)%16],m=(Y>>>1|le<<31)^(Y>>>8|le<<24)^Y>>>7,_=(le>>>1|Y<<31)^(le>>>8|Y<<24)^(le>>>7|Y<<25),L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,Y=v[(ne+14)%16],le=g[(ne+14)%16],m=(Y>>>19|le<<13)^(le>>>29|Y<<3)^Y>>>6,_=(le>>>19|Y<<13)^(Y>>>29|le<<3)^(le>>>6|Y<<26),L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,I+=L>>>16,O+=I>>>16,A+=O>>>16,v[ne]=O&65535|A<<16,g[ne]=L&65535|I<<16}m=w,_=$,L=_&65535,I=_>>>16,O=m&65535,A=m>>>16,m=o[0],_=l[0],L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,I+=L>>>16,O+=I>>>16,A+=O>>>16,o[0]=w=O&65535|A<<16,l[0]=$=L&65535|I<<16,m=j,_=M,L=_&65535,I=_>>>16,O=m&65535,A=m>>>16,m=o[1],_=l[1],L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,I+=L>>>16,O+=I>>>16,A+=O>>>16,o[1]=j=O&65535|A<<16,l[1]=M=L&65535|I<<16,m=J,_=je,L=_&65535,I=_>>>16,O=m&65535,A=m>>>16,m=o[2],_=l[2],L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,I+=L>>>16,O+=I>>>16,A+=O>>>16,o[2]=J=O&65535|A<<16,l[2]=je=L&65535|I<<16,m=q,_=et,L=_&65535,I=_>>>16,O=m&65535,A=m>>>16,m=o[3],_=l[3],L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,I+=L>>>16,O+=I>>>16,A+=O>>>16,o[3]=q=O&65535|A<<16,l[3]=et=L&65535|I<<16,m=B,_=ye,L=_&65535,I=_>>>16,O=m&65535,A=m>>>16,m=o[4],_=l[4],L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,I+=L>>>16,O+=I>>>16,A+=O>>>16,o[4]=B=O&65535|A<<16,l[4]=ye=L&65535|I<<16,m=Ae,_=Fe,L=_&65535,I=_>>>16,O=m&65535,A=m>>>16,m=o[5],_=l[5],L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,I+=L>>>16,O+=I>>>16,A+=O>>>16,o[5]=Ae=O&65535|A<<16,l[5]=Fe=L&65535|I<<16,m=ge,_=We,L=_&65535,I=_>>>16,O=m&65535,A=m>>>16,m=o[6],_=l[6],L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,I+=L>>>16,O+=I>>>16,A+=O>>>16,o[6]=ge=O&65535|A<<16,l[6]=We=L&65535|I<<16,m=Me,_=Xe,L=_&65535,I=_>>>16,O=m&65535,A=m>>>16,m=o[7],_=l[7],L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,I+=L>>>16,O+=I>>>16,A+=O>>>16,o[7]=Me=O&65535|A<<16,l[7]=Xe=L&65535|I<<16,S+=128,x-=128}return S}function E(v){var g=new a;g.update(v);var o=g.digest();return g.clean(),o}e.hash=E})(Yr);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.convertSecretKeyToX25519=e.convertPublicKeyToX25519=e.verify=e.sign=e.extractPublicKeyFromSecretKey=e.generateKeyPair=e.generateKeyPairFromSeed=e.SEED_LENGTH=e.SECRET_KEY_LENGTH=e.PUBLIC_KEY_LENGTH=e.SIGNATURE_LENGTH=void 0;const r=ze.random,n=Yr,a=ze.wipe;e.SIGNATURE_LENGTH=64,e.PUBLIC_KEY_LENGTH=32,e.SECRET_KEY_LENGTH=64,e.SEED_LENGTH=32;function s(b){const h=new Float64Array(16);if(b)for(let u=0;u<b.length;u++)h[u]=b[u];return h}const d=new Uint8Array(32);d[0]=9;const E=s(),v=s([1]),g=s([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),o=s([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),l=s([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),y=s([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),S=s([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function x(b,h){for(let u=0;u<16;u++)b[u]=h[u]|0}function w(b){let h=1;for(let u=0;u<16;u++){let t=b[u]+h+65535;h=Math.floor(t/65536),b[u]=t-h*65536}b[0]+=h-1+37*(h-1)}function j(b,h,u){const t=~(u-1);for(let f=0;f<16;f++){const R=t&(b[f]^h[f]);b[f]^=R,h[f]^=R}}function J(b,h){const u=s(),t=s();for(let f=0;f<16;f++)t[f]=h[f];w(t),w(t),w(t);for(let f=0;f<2;f++){u[0]=t[0]-65517;for(let P=1;P<15;P++)u[P]=t[P]-65535-(u[P-1]>>16&1),u[P-1]&=65535;u[15]=t[15]-32767-(u[14]>>16&1);const R=u[15]>>16&1;u[14]&=65535,j(t,u,1-R)}for(let f=0;f<16;f++)b[2*f]=t[f]&255,b[2*f+1]=t[f]>>8}function q(b,h){let u=0;for(let t=0;t<32;t++)u|=b[t]^h[t];return(1&u-1>>>8)-1}function B(b,h){const u=new Uint8Array(32),t=new Uint8Array(32);return J(u,b),J(t,h),q(u,t)}function Ae(b){const h=new Uint8Array(32);return J(h,b),h[0]&1}function ge(b,h){for(let u=0;u<16;u++)b[u]=h[2*u]+(h[2*u+1]<<8);b[15]&=32767}function Me(b,h,u){for(let t=0;t<16;t++)b[t]=h[t]+u[t]}function $(b,h,u){for(let t=0;t<16;t++)b[t]=h[t]-u[t]}function M(b,h,u){let t,f,R=0,P=0,K=0,U=0,D=0,W=0,Re=0,de=0,Pe=0,pe=0,he=0,ie=0,re=0,Z=0,V=0,H=0,se=0,_e=0,G=0,Ne=0,De=0,He=0,$e=0,Ke=0,qe=0,Ze=0,st=0,Ge=0,ct=0,vt=0,Rt=0,oe=u[0],Q=u[1],ae=u[2],fe=u[3],ce=u[4],ee=u[5],me=u[6],we=u[7],ve=u[8],xe=u[9],Ee=u[10],be=u[11],ue=u[12],F=u[13],Se=u[14],Ie=u[15];t=h[0],R+=t*oe,P+=t*Q,K+=t*ae,U+=t*fe,D+=t*ce,W+=t*ee,Re+=t*me,de+=t*we,Pe+=t*ve,pe+=t*xe,he+=t*Ee,ie+=t*be,re+=t*ue,Z+=t*F,V+=t*Se,H+=t*Ie,t=h[1],P+=t*oe,K+=t*Q,U+=t*ae,D+=t*fe,W+=t*ce,Re+=t*ee,de+=t*me,Pe+=t*we,pe+=t*ve,he+=t*xe,ie+=t*Ee,re+=t*be,Z+=t*ue,V+=t*F,H+=t*Se,se+=t*Ie,t=h[2],K+=t*oe,U+=t*Q,D+=t*ae,W+=t*fe,Re+=t*ce,de+=t*ee,Pe+=t*me,pe+=t*we,he+=t*ve,ie+=t*xe,re+=t*Ee,Z+=t*be,V+=t*ue,H+=t*F,se+=t*Se,_e+=t*Ie,t=h[3],U+=t*oe,D+=t*Q,W+=t*ae,Re+=t*fe,de+=t*ce,Pe+=t*ee,pe+=t*me,he+=t*we,ie+=t*ve,re+=t*xe,Z+=t*Ee,V+=t*be,H+=t*ue,se+=t*F,_e+=t*Se,G+=t*Ie,t=h[4],D+=t*oe,W+=t*Q,Re+=t*ae,de+=t*fe,Pe+=t*ce,pe+=t*ee,he+=t*me,ie+=t*we,re+=t*ve,Z+=t*xe,V+=t*Ee,H+=t*be,se+=t*ue,_e+=t*F,G+=t*Se,Ne+=t*Ie,t=h[5],W+=t*oe,Re+=t*Q,de+=t*ae,Pe+=t*fe,pe+=t*ce,he+=t*ee,ie+=t*me,re+=t*we,Z+=t*ve,V+=t*xe,H+=t*Ee,se+=t*be,_e+=t*ue,G+=t*F,Ne+=t*Se,De+=t*Ie,t=h[6],Re+=t*oe,de+=t*Q,Pe+=t*ae,pe+=t*fe,he+=t*ce,ie+=t*ee,re+=t*me,Z+=t*we,V+=t*ve,H+=t*xe,se+=t*Ee,_e+=t*be,G+=t*ue,Ne+=t*F,De+=t*Se,He+=t*Ie,t=h[7],de+=t*oe,Pe+=t*Q,pe+=t*ae,he+=t*fe,ie+=t*ce,re+=t*ee,Z+=t*me,V+=t*we,H+=t*ve,se+=t*xe,_e+=t*Ee,G+=t*be,Ne+=t*ue,De+=t*F,He+=t*Se,$e+=t*Ie,t=h[8],Pe+=t*oe,pe+=t*Q,he+=t*ae,ie+=t*fe,re+=t*ce,Z+=t*ee,V+=t*me,H+=t*we,se+=t*ve,_e+=t*xe,G+=t*Ee,Ne+=t*be,De+=t*ue,He+=t*F,$e+=t*Se,Ke+=t*Ie,t=h[9],pe+=t*oe,he+=t*Q,ie+=t*ae,re+=t*fe,Z+=t*ce,V+=t*ee,H+=t*me,se+=t*we,_e+=t*ve,G+=t*xe,Ne+=t*Ee,De+=t*be,He+=t*ue,$e+=t*F,Ke+=t*Se,qe+=t*Ie,t=h[10],he+=t*oe,ie+=t*Q,re+=t*ae,Z+=t*fe,V+=t*ce,H+=t*ee,se+=t*me,_e+=t*we,G+=t*ve,Ne+=t*xe,De+=t*Ee,He+=t*be,$e+=t*ue,Ke+=t*F,qe+=t*Se,Ze+=t*Ie,t=h[11],ie+=t*oe,re+=t*Q,Z+=t*ae,V+=t*fe,H+=t*ce,se+=t*ee,_e+=t*me,G+=t*we,Ne+=t*ve,De+=t*xe,He+=t*Ee,$e+=t*be,Ke+=t*ue,qe+=t*F,Ze+=t*Se,st+=t*Ie,t=h[12],re+=t*oe,Z+=t*Q,V+=t*ae,H+=t*fe,se+=t*ce,_e+=t*ee,G+=t*me,Ne+=t*we,De+=t*ve,He+=t*xe,$e+=t*Ee,Ke+=t*be,qe+=t*ue,Ze+=t*F,st+=t*Se,Ge+=t*Ie,t=h[13],Z+=t*oe,V+=t*Q,H+=t*ae,se+=t*fe,_e+=t*ce,G+=t*ee,Ne+=t*me,De+=t*we,He+=t*ve,$e+=t*xe,Ke+=t*Ee,qe+=t*be,Ze+=t*ue,st+=t*F,Ge+=t*Se,ct+=t*Ie,t=h[14],V+=t*oe,H+=t*Q,se+=t*ae,_e+=t*fe,G+=t*ce,Ne+=t*ee,De+=t*me,He+=t*we,$e+=t*ve,Ke+=t*xe,qe+=t*Ee,Ze+=t*be,st+=t*ue,Ge+=t*F,ct+=t*Se,vt+=t*Ie,t=h[15],H+=t*oe,se+=t*Q,_e+=t*ae,G+=t*fe,Ne+=t*ce,De+=t*ee,He+=t*me,$e+=t*we,Ke+=t*ve,qe+=t*xe,Ze+=t*Ee,st+=t*be,Ge+=t*ue,ct+=t*F,vt+=t*Se,Rt+=t*Ie,R+=38*se,P+=38*_e,K+=38*G,U+=38*Ne,D+=38*De,W+=38*He,Re+=38*$e,de+=38*Ke,Pe+=38*qe,pe+=38*Ze,he+=38*st,ie+=38*Ge,re+=38*ct,Z+=38*vt,V+=38*Rt,f=1,t=R+f+65535,f=Math.floor(t/65536),R=t-f*65536,t=P+f+65535,f=Math.floor(t/65536),P=t-f*65536,t=K+f+65535,f=Math.floor(t/65536),K=t-f*65536,t=U+f+65535,f=Math.floor(t/65536),U=t-f*65536,t=D+f+65535,f=Math.floor(t/65536),D=t-f*65536,t=W+f+65535,f=Math.floor(t/65536),W=t-f*65536,t=Re+f+65535,f=Math.floor(t/65536),Re=t-f*65536,t=de+f+65535,f=Math.floor(t/65536),de=t-f*65536,t=Pe+f+65535,f=Math.floor(t/65536),Pe=t-f*65536,t=pe+f+65535,f=Math.floor(t/65536),pe=t-f*65536,t=he+f+65535,f=Math.floor(t/65536),he=t-f*65536,t=ie+f+65535,f=Math.floor(t/65536),ie=t-f*65536,t=re+f+65535,f=Math.floor(t/65536),re=t-f*65536,t=Z+f+65535,f=Math.floor(t/65536),Z=t-f*65536,t=V+f+65535,f=Math.floor(t/65536),V=t-f*65536,t=H+f+65535,f=Math.floor(t/65536),H=t-f*65536,R+=f-1+37*(f-1),f=1,t=R+f+65535,f=Math.floor(t/65536),R=t-f*65536,t=P+f+65535,f=Math.floor(t/65536),P=t-f*65536,t=K+f+65535,f=Math.floor(t/65536),K=t-f*65536,t=U+f+65535,f=Math.floor(t/65536),U=t-f*65536,t=D+f+65535,f=Math.floor(t/65536),D=t-f*65536,t=W+f+65535,f=Math.floor(t/65536),W=t-f*65536,t=Re+f+65535,f=Math.floor(t/65536),Re=t-f*65536,t=de+f+65535,f=Math.floor(t/65536),de=t-f*65536,t=Pe+f+65535,f=Math.floor(t/65536),Pe=t-f*65536,t=pe+f+65535,f=Math.floor(t/65536),pe=t-f*65536,t=he+f+65535,f=Math.floor(t/65536),he=t-f*65536,t=ie+f+65535,f=Math.floor(t/65536),ie=t-f*65536,t=re+f+65535,f=Math.floor(t/65536),re=t-f*65536,t=Z+f+65535,f=Math.floor(t/65536),Z=t-f*65536,t=V+f+65535,f=Math.floor(t/65536),V=t-f*65536,t=H+f+65535,f=Math.floor(t/65536),H=t-f*65536,R+=f-1+37*(f-1),b[0]=R,b[1]=P,b[2]=K,b[3]=U,b[4]=D,b[5]=W,b[6]=Re,b[7]=de,b[8]=Pe,b[9]=pe,b[10]=he,b[11]=ie,b[12]=re,b[13]=Z,b[14]=V,b[15]=H}function je(b,h){M(b,h,h)}function et(b,h){const u=s();let t;for(t=0;t<16;t++)u[t]=h[t];for(t=253;t>=0;t--)je(u,u),t!==2&&t!==4&&M(u,u,h);for(t=0;t<16;t++)b[t]=u[t]}function ye(b,h){const u=s();let t;for(t=0;t<16;t++)u[t]=h[t];for(t=250;t>=0;t--)je(u,u),t!==1&&M(u,u,h);for(t=0;t<16;t++)b[t]=u[t]}function Fe(b,h){const u=s(),t=s(),f=s(),R=s(),P=s(),K=s(),U=s(),D=s(),W=s();$(u,b[1],b[0]),$(W,h[1],h[0]),M(u,u,W),Me(t,b[0],b[1]),Me(W,h[0],h[1]),M(t,t,W),M(f,b[3],h[3]),M(f,f,o),M(R,b[2],h[2]),Me(R,R,R),$(P,t,u),$(K,R,f),Me(U,R,f),Me(D,t,u),M(b[0],P,K),M(b[1],D,U),M(b[2],U,K),M(b[3],P,D)}function We(b,h,u){for(let t=0;t<4;t++)j(b[t],h[t],u)}function Xe(b,h){const u=s(),t=s(),f=s();et(f,h[2]),M(u,h[0],f),M(t,h[1],f),J(b,t),b[31]^=Ae(u)<<7}function m(b,h,u){x(b[0],E),x(b[1],v),x(b[2],v),x(b[3],E);for(let t=255;t>=0;--t){const f=u[t/8|0]>>(t&7)&1;We(b,h,f),Fe(h,b),Fe(b,b),We(b,h,f)}}function _(b,h){const u=[s(),s(),s(),s()];x(u[0],l),x(u[1],y),x(u[2],v),M(u[3],l,y),m(b,u,h)}function Y(b){if(b.length!==e.SEED_LENGTH)throw new Error(`ed25519: seed must be ${e.SEED_LENGTH} bytes`);const h=(0,n.hash)(b);h[0]&=248,h[31]&=127,h[31]|=64;const u=new Uint8Array(32),t=[s(),s(),s(),s()];_(t,h),Xe(u,t);const f=new Uint8Array(64);return f.set(b),f.set(u,32),{publicKey:u,secretKey:f}}e.generateKeyPairFromSeed=Y;function le(b){const h=(0,r.randomBytes)(32,b),u=Y(h);return(0,a.wipe)(h),u}e.generateKeyPair=le;function L(b){if(b.length!==e.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${e.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(b.subarray(32))}e.extractPublicKeyFromSecretKey=L;const I=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function O(b,h){let u,t,f,R;for(t=63;t>=32;--t){for(u=0,f=t-32,R=t-12;f<R;++f)h[f]+=u-16*h[t]*I[f-(t-32)],u=Math.floor((h[f]+128)/256),h[f]-=u*256;h[f]+=u,h[t]=0}for(u=0,f=0;f<32;f++)h[f]+=u-(h[31]>>4)*I[f],u=h[f]>>8,h[f]&=255;for(f=0;f<32;f++)h[f]-=u*I[f];for(t=0;t<32;t++)h[t+1]+=h[t]>>8,b[t]=h[t]&255}function A(b){const h=new Float64Array(64);for(let u=0;u<64;u++)h[u]=b[u];for(let u=0;u<64;u++)b[u]=0;O(b,h)}function Le(b,h){const u=new Float64Array(64),t=[s(),s(),s(),s()],f=(0,n.hash)(b.subarray(0,32));f[0]&=248,f[31]&=127,f[31]|=64;const R=new Uint8Array(64);R.set(f.subarray(32),32);const P=new n.SHA512;P.update(R.subarray(32)),P.update(h);const K=P.digest();P.clean(),A(K),_(t,K),Xe(R,t),P.reset(),P.update(R.subarray(0,32)),P.update(b.subarray(32)),P.update(h);const U=P.digest();A(U);for(let D=0;D<32;D++)u[D]=K[D];for(let D=0;D<32;D++)for(let W=0;W<32;W++)u[D+W]+=U[D]*f[W];return O(R.subarray(32),u),R}e.sign=Le;function ne(b,h){const u=s(),t=s(),f=s(),R=s(),P=s(),K=s(),U=s();return x(b[2],v),ge(b[1],h),je(f,b[1]),M(R,f,g),$(f,f,b[2]),Me(R,b[2],R),je(P,R),je(K,P),M(U,K,P),M(u,U,f),M(u,u,R),ye(u,u),M(u,u,f),M(u,u,R),M(u,u,R),M(b[0],u,R),je(t,b[0]),M(t,t,R),B(t,f)&&M(b[0],b[0],S),je(t,b[0]),M(t,t,R),B(t,f)?-1:(Ae(b[0])===h[31]>>7&&$(b[0],E,b[0]),M(b[3],b[0],b[1]),0)}function wt(b,h,u){const t=new Uint8Array(32),f=[s(),s(),s(),s()],R=[s(),s(),s(),s()];if(u.length!==e.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${e.SIGNATURE_LENGTH} bytes`);if(ne(R,b))return!1;const P=new n.SHA512;P.update(u.subarray(0,32)),P.update(b),P.update(h);const K=P.digest();return A(K),m(f,R,K),_(R,u.subarray(32)),Fe(f,R),Xe(t,f),!q(u,t)}e.verify=wt;function z(b){let h=[s(),s(),s(),s()];if(ne(h,b))throw new Error("Ed25519: invalid public key");let u=s(),t=s(),f=h[1];Me(u,v,f),$(t,v,f),et(t,t),M(u,u,t);let R=new Uint8Array(32);return J(R,u),R}e.convertPublicKeyToX25519=z;function gt(b){const h=(0,n.hash)(b.subarray(0,32));h[0]&=248,h[31]&=127,h[31]|=64;const u=new Uint8Array(h.subarray(0,32));return(0,a.wipe)(h),u}e.convertSecretKeyToX25519=gt})(fr);const Ss="EdDSA",Is="JWT",Zr=".",Qr="base64url",Os="utf8",Ts="utf8",As=":",Ls="did",Rs="key",jr="base58btc",Ps="z",Cs="K36",Ms=32;function Gt(e){return Jt(Ft(ht(e),Os),Qr)}function en(e){const r=Ft(Cs,jr),n=Ps+Jt(Hr([r,e]),jr);return[Ls,Rs,n].join(As)}function js(e){return Jt(e,Qr)}function Ns(e){return Ft([Gt(e.header),Gt(e.payload)].join(Zr),Ts)}function Bs(e){return[Gt(e.header),Gt(e.payload),js(e.signature)].join(Zr)}function zs(e=ze.random.randomBytes(Ms)){return fr.generateKeyPairFromSeed(e)}async function Ds(e,r,n,a,s=ze.cjs.fromMiliseconds(Date.now())){const d={alg:Ss,typ:Is},E=en(a.publicKey),v=s+n,g={iss:E,sub:e,aud:r,iat:s,exp:v},o=Ns({header:d,payload:g}),l=fr.sign(a.secretKey,o);return Bs({header:d,payload:g,signature:l})}const Ks="PARSE_ERROR",Us="INVALID_REQUEST",Ws="METHOD_NOT_FOUND",Hs="INVALID_PARAMS",tn="INTERNAL_ERROR",cr="SERVER_ERROR",$s=[-32700,-32600,-32601,-32602,-32603],St={[Ks]:{code:-32700,message:"Parse error"},[Us]:{code:-32600,message:"Invalid Request"},[Ws]:{code:-32601,message:"Method not found"},[Hs]:{code:-32602,message:"Invalid params"},[tn]:{code:-32603,message:"Internal error"},[cr]:{code:-32e3,message:"Server error"}},rn=cr;function Gs(e){return $s.includes(e)}function Nr(e){return Object.keys(St).includes(e)?St[e]:St[rn]}function ks(e){const r=Object.values(St).find(n=>n.code===e);return r||St[rn]}function nn(e,r,n){return e.message.includes("getaddrinfo ENOTFOUND")||e.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${n} RPC url at ${r}`):e}var sn={};/*! *****************************************************************************
|
|
1
|
+
"use strict";const N=require("./index-CDGktAjP.js"),ze=require("./index-CtJdy4GW.js"),Qn=require("./events-wpqGOay9.js");function Wr(e=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(e):new Uint8Array(e)}function Hr(e,r){r||(r=e.reduce((s,d)=>s+d.length,0));const n=Wr(r);let a=0;for(const s of e)n.set(s,a),a+=s.length;return n}const vr={...ze.identityBase,...ze.base2,...ze.base8,...ze.base10,...ze.base16,...ze.base32,...ze.base36,...ze.base58,...ze.base64,...ze.base256emoji};function $r(e,r,n,a){return{name:e,prefix:r,encoder:{name:e,prefix:r,encode:n},decoder:{decode:a}}}const xr=$r("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),Yt=$r("ascii","a",e=>{let r="a";for(let n=0;n<e.length;n++)r+=String.fromCharCode(e[n]);return r},e=>{e=e.substring(1);const r=Wr(e.length);for(let n=0;n<e.length;n++)r[n]=e.charCodeAt(n);return r}),Gr={utf8:xr,"utf-8":xr,hex:vr.base16,latin1:Yt,ascii:Yt,binary:Yt,...vr};function Ft(e,r="utf8"){const n=Gr[r];if(!n)throw new Error(`Unsupported encoding "${r}"`);return(r==="utf8"||r==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(e,"utf8"):n.decoder.decode(`${n.prefix}${e}`)}function Jt(e,r="utf8"){const n=Gr[r];if(!n)throw new Error(`Unsupported encoding "${r}"`);return(r==="utf8"||r==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8"):n.encoder.encode(e).substring(1)}var Er=function(e,r,n){if(n||arguments.length===2)for(var a=0,s=r.length,d;a<s;a++)(d||!(a in r))&&(d||(d=Array.prototype.slice.call(r,0,a)),d[a]=r[a]);return e.concat(d||Array.prototype.slice.call(r))},ei=function(){function e(r,n,a){this.name=r,this.version=n,this.os=a,this.type="browser"}return e}(),ti=function(){function e(r){this.version=r,this.type="node",this.name="node",this.os=N.dist.process.platform}return e}(),ri=function(){function e(r,n,a,s){this.name=r,this.version=n,this.os=a,this.bot=s,this.type="bot-device"}return e}(),ni=function(){function e(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return e}(),ii=function(){function e(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return e}(),si=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,oi=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,Sr=3,ai=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",si]],Ir=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function fi(e){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new ii:typeof navigator<"u"?ui(navigator.userAgent):di()}function ci(e){return e!==""&&ai.reduce(function(r,n){var a=n[0],s=n[1];if(r)return r;var d=s.exec(e);return!!d&&[a,d]},!1)}function ui(e){var r=ci(e);if(!r)return null;var n=r[0],a=r[1];if(n==="searchbot")return new ni;var s=a[1]&&a[1].split(".").join("_").split("_").slice(0,3);s?s.length<Sr&&(s=Er(Er([],s,!0),hi(Sr-s.length),!0)):s=[];var d=s.join("."),E=li(e),v=oi.exec(e);return v&&v[1]?new ri(n,d,E,v[1]):new ei(n,d,E)}function li(e){for(var r=0,n=Ir.length;r<n;r++){var a=Ir[r],s=a[0],d=a[1],E=d.exec(e);if(E)return s}return null}function di(){var e=typeof N.dist.process<"u"&&N.dist.process.version;return e?new ti(N.dist.process.version.slice(1)):null}function hi(e){for(var r=[],n=0;n<e;n++)r.push("0");return r}const bi={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe",batchFetchMessages:"waku_batchFetchMessages"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe",batchFetchMessages:"irn_batchFetchMessages"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe",batchFetchMessages:"iridium_batchFetchMessages"}},gi=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,yi=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,pi=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function _i(e,r){if(e==="__proto__"||e==="constructor"&&r&&typeof r=="object"&&"prototype"in r){mi(e);return}return r}function mi(e){console.warn(`[destr] Dropping "${e}" key to prevent prototype pollution.`)}function zt(e,r={}){if(typeof e!="string")return e;const n=e.trim();if(e[0]==='"'&&e.endsWith('"')&&!e.includes("\\"))return n.slice(1,-1);if(n.length<=9){const a=n.toLowerCase();if(a==="true")return!0;if(a==="false")return!1;if(a==="undefined")return;if(a==="null")return null;if(a==="nan")return Number.NaN;if(a==="infinity")return Number.POSITIVE_INFINITY;if(a==="-infinity")return Number.NEGATIVE_INFINITY}if(!pi.test(e)){if(r.strict)throw new SyntaxError("[destr] Invalid JSON");return e}try{if(gi.test(e)||yi.test(e)){if(r.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(e,_i)}return JSON.parse(e)}catch(a){if(r.strict)throw a;return e}}function wi(e){return!e||typeof e.then!="function"?Promise.resolve(e):e}function Te(e,...r){try{return wi(e(...r))}catch(n){return Promise.reject(n)}}function vi(e){const r=typeof e;return e===null||r!=="object"&&r!=="function"}function xi(e){const r=Object.getPrototypeOf(e);return!r||r.isPrototypeOf(Object)}function Ut(e){if(vi(e))return String(e);if(xi(e)||Array.isArray(e))return JSON.stringify(e);if(typeof e.toJSON=="function")return Ut(e.toJSON());throw new Error("[unstorage] Cannot stringify value!")}function kr(){if(typeof N.dist.Buffer===void 0)throw new TypeError("[unstorage] Buffer is not supported!")}const tr="base64:";function Ei(e){if(typeof e=="string")return e;kr();const r=N.dist.Buffer.from(e).toString("base64");return tr+r}function Si(e){return typeof e!="string"||!e.startsWith(tr)?e:(kr(),N.dist.Buffer.from(e.slice(tr.length),"base64"))}function Ue(e){return e?e.split("?")[0].replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""):""}function Ii(...e){return Ue(e.join(":"))}function Dt(e){return e=Ue(e),e?e+":":""}const Oi="memory",Ti=()=>{const e=new Map;return{name:Oi,options:{},hasItem(r){return e.has(r)},getItem(r){return e.get(r)??null},getItemRaw(r){return e.get(r)??null},setItem(r,n){e.set(r,n)},setItemRaw(r,n){e.set(r,n)},removeItem(r){e.delete(r)},getKeys(){return Array.from(e.keys())},clear(){e.clear()},dispose(){e.clear()}}};function Ai(e={}){const r={mounts:{"":e.driver||Ti()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},n=o=>{for(const l of r.mountpoints)if(o.startsWith(l))return{base:l,relativeKey:o.slice(l.length),driver:r.mounts[l]};return{base:"",relativeKey:o,driver:r.mounts[""]}},a=(o,l)=>r.mountpoints.filter(y=>y.startsWith(o)||l&&o.startsWith(y)).map(y=>({relativeBase:o.length>y.length?o.slice(y.length):void 0,mountpoint:y,driver:r.mounts[y]})),s=(o,l)=>{if(r.watching){l=Ue(l);for(const y of r.watchListeners)y(o,l)}},d=async()=>{if(!r.watching){r.watching=!0;for(const o in r.mounts)r.unwatch[o]=await Or(r.mounts[o],s,o)}},E=async()=>{if(r.watching){for(const o in r.unwatch)await r.unwatch[o]();r.unwatch={},r.watching=!1}},v=(o,l,y)=>{const S=new Map,x=w=>{let j=S.get(w.base);return j||(j={driver:w.driver,base:w.base,items:[]},S.set(w.base,j)),j};for(const w of o){const j=typeof w=="string",J=Ue(j?w:w.key),q=j?void 0:w.value,B=j||!w.options?l:{...l,...w.options},Ae=n(J);x(Ae).items.push({key:J,value:q,relativeKey:Ae.relativeKey,options:B})}return Promise.all([...S.values()].map(w=>y(w))).then(w=>w.flat())},g={hasItem(o,l={}){o=Ue(o);const{relativeKey:y,driver:S}=n(o);return Te(S.hasItem,y,l)},getItem(o,l={}){o=Ue(o);const{relativeKey:y,driver:S}=n(o);return Te(S.getItem,y,l).then(x=>zt(x))},getItems(o,l){return v(o,l,y=>y.driver.getItems?Te(y.driver.getItems,y.items.map(S=>({key:S.relativeKey,options:S.options})),l).then(S=>S.map(x=>({key:Ii(y.base,x.key),value:zt(x.value)}))):Promise.all(y.items.map(S=>Te(y.driver.getItem,S.relativeKey,S.options).then(x=>({key:S.key,value:zt(x)})))))},getItemRaw(o,l={}){o=Ue(o);const{relativeKey:y,driver:S}=n(o);return S.getItemRaw?Te(S.getItemRaw,y,l):Te(S.getItem,y,l).then(x=>Si(x))},async setItem(o,l,y={}){if(l===void 0)return g.removeItem(o);o=Ue(o);const{relativeKey:S,driver:x}=n(o);x.setItem&&(await Te(x.setItem,S,Ut(l),y),x.watch||s("update",o))},async setItems(o,l){await v(o,l,async y=>{if(y.driver.setItems)return Te(y.driver.setItems,y.items.map(S=>({key:S.relativeKey,value:Ut(S.value),options:S.options})),l);y.driver.setItem&&await Promise.all(y.items.map(S=>Te(y.driver.setItem,S.relativeKey,Ut(S.value),S.options)))})},async setItemRaw(o,l,y={}){if(l===void 0)return g.removeItem(o,y);o=Ue(o);const{relativeKey:S,driver:x}=n(o);if(x.setItemRaw)await Te(x.setItemRaw,S,l,y);else if(x.setItem)await Te(x.setItem,S,Ei(l),y);else return;x.watch||s("update",o)},async removeItem(o,l={}){typeof l=="boolean"&&(l={removeMeta:l}),o=Ue(o);const{relativeKey:y,driver:S}=n(o);S.removeItem&&(await Te(S.removeItem,y,l),(l.removeMeta||l.removeMata)&&await Te(S.removeItem,y+"$",l),S.watch||s("remove",o))},async getMeta(o,l={}){typeof l=="boolean"&&(l={nativeOnly:l}),o=Ue(o);const{relativeKey:y,driver:S}=n(o),x=Object.create(null);if(S.getMeta&&Object.assign(x,await Te(S.getMeta,y,l)),!l.nativeOnly){const w=await Te(S.getItem,y+"$",l).then(j=>zt(j));w&&typeof w=="object"&&(typeof w.atime=="string"&&(w.atime=new Date(w.atime)),typeof w.mtime=="string"&&(w.mtime=new Date(w.mtime)),Object.assign(x,w))}return x},setMeta(o,l,y={}){return this.setItem(o+"$",l,y)},removeMeta(o,l={}){return this.removeItem(o+"$",l)},async getKeys(o,l={}){o=Dt(o);const y=a(o,!0);let S=[];const x=[];for(const w of y){const J=(await Te(w.driver.getKeys,w.relativeBase,l)).map(q=>w.mountpoint+Ue(q)).filter(q=>!S.some(B=>q.startsWith(B)));x.push(...J),S=[w.mountpoint,...S.filter(q=>!q.startsWith(w.mountpoint))]}return o?x.filter(w=>w.startsWith(o)&&!w.endsWith("$")):x.filter(w=>!w.endsWith("$"))},async clear(o,l={}){o=Dt(o),await Promise.all(a(o,!1).map(async y=>{if(y.driver.clear)return Te(y.driver.clear,y.relativeBase,l);if(y.driver.removeItem){const S=await y.driver.getKeys(y.relativeBase||"",l);return Promise.all(S.map(x=>y.driver.removeItem(x,l)))}}))},async dispose(){await Promise.all(Object.values(r.mounts).map(o=>Tr(o)))},async watch(o){return await d(),r.watchListeners.push(o),async()=>{r.watchListeners=r.watchListeners.filter(l=>l!==o),r.watchListeners.length===0&&await E()}},async unwatch(){r.watchListeners=[],await E()},mount(o,l){if(o=Dt(o),o&&r.mounts[o])throw new Error(`already mounted at ${o}`);return o&&(r.mountpoints.push(o),r.mountpoints.sort((y,S)=>S.length-y.length)),r.mounts[o]=l,r.watching&&Promise.resolve(Or(l,s,o)).then(y=>{r.unwatch[o]=y}).catch(console.error),g},async unmount(o,l=!0){o=Dt(o),!(!o||!r.mounts[o])&&(r.watching&&o in r.unwatch&&(r.unwatch[o](),delete r.unwatch[o]),l&&await Tr(r.mounts[o]),r.mountpoints=r.mountpoints.filter(y=>y!==o),delete r.mounts[o])},getMount(o=""){o=Ue(o)+":";const l=n(o);return{driver:l.driver,base:l.base}},getMounts(o="",l={}){return o=Ue(o),a(o,l.parents).map(S=>({driver:S.driver,base:S.mountpoint}))}};return g}function Or(e,r,n){return e.watch?e.watch((a,s)=>r(a,n+s)):()=>{}}async function Tr(e){typeof e.dispose=="function"&&await Te(e.dispose)}function bt(e){return new Promise((r,n)=>{e.oncomplete=e.onsuccess=()=>r(e.result),e.onabort=e.onerror=()=>n(e.error)})}function Fr(e,r){const n=indexedDB.open(e);n.onupgradeneeded=()=>n.result.createObjectStore(r);const a=bt(n);return(s,d)=>a.then(E=>d(E.transaction(r,s).objectStore(r)))}let Zt;function At(){return Zt||(Zt=Fr("keyval-store","keyval")),Zt}function Ar(e,r=At()){return r("readonly",n=>bt(n.get(e)))}function Li(e,r,n=At()){return n("readwrite",a=>(a.put(r,e),bt(a.transaction)))}function Ri(e,r=At()){return r("readwrite",n=>(n.delete(e),bt(n.transaction)))}function Pi(e=At()){return e("readwrite",r=>(r.clear(),bt(r.transaction)))}function Ci(e,r){return e.openCursor().onsuccess=function(){this.result&&(r(this.result),this.result.continue())},bt(e.transaction)}function Mi(e=At()){return e("readonly",r=>{if(r.getAllKeys)return bt(r.getAllKeys());const n=[];return Ci(r,a=>n.push(a.key)).then(()=>n)})}const ji=e=>JSON.stringify(e,(r,n)=>typeof n=="bigint"?n.toString()+"n":n),Ni=e=>{const r=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,n=e.replace(r,'$1"$2n"$3');return JSON.parse(n,(a,s)=>typeof s=="string"&&s.match(/^\d+n$/)?BigInt(s.substring(0,s.length-1)):s)};function Vt(e){if(typeof e!="string")throw new Error(`Cannot safe json parse value of type ${typeof e}`);try{return Ni(e)}catch{return e}}function ht(e){return typeof e=="string"?e:ji(e)||""}const Bi="idb-keyval";var zi=(e={})=>{const r=e.base&&e.base.length>0?`${e.base}:`:"",n=s=>r+s;let a;return e.dbName&&e.storeName&&(a=Fr(e.dbName,e.storeName)),{name:Bi,options:e,async hasItem(s){return!(typeof await Ar(n(s),a)>"u")},async getItem(s){return await Ar(n(s),a)??null},setItem(s,d){return Li(n(s),d,a)},removeItem(s){return Ri(n(s),a)},getKeys(){return Mi(a)},clear(){return Pi(a)}}};const Di="WALLET_CONNECT_V2_INDEXED_DB",Ki="keyvaluestorage";let Ui=class{constructor(){this.indexedDb=Ai({driver:zi({dbName:Di,storeName:Ki})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(r=>[r.key,r.value])}async getItem(r){const n=await this.indexedDb.getItem(r);if(n!==null)return n}async setItem(r,n){await this.indexedDb.setItem(r,ht(n))}async removeItem(r){await this.indexedDb.removeItem(r)}};var Qt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof N.dist.global<"u"?N.dist.global:typeof self<"u"?self:{},Wt={exports:{}};(function(){let e;function r(){}e=r,e.prototype.getItem=function(n){return this.hasOwnProperty(n)?String(this[n]):null},e.prototype.setItem=function(n,a){this[n]=String(a)},e.prototype.removeItem=function(n){delete this[n]},e.prototype.clear=function(){const n=this;Object.keys(n).forEach(function(a){n[a]=void 0,delete n[a]})},e.prototype.key=function(n){return n=n||0,Object.keys(this)[n]},e.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof Qt<"u"&&Qt.localStorage?Wt.exports=Qt.localStorage:typeof window<"u"&&window.localStorage?Wt.exports=window.localStorage:Wt.exports=new r})();function Wi(e){var r;return[e[0],Vt((r=e[1])!=null?r:"")]}class Hi{constructor(){this.localStorage=Wt.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(Wi)}async getItem(r){const n=this.localStorage.getItem(r);if(n!==null)return Vt(n)}async setItem(r,n){this.localStorage.setItem(r,ht(n))}async removeItem(r){this.localStorage.removeItem(r)}}const $i="wc_storage_version",Lr=1,Gi=async(e,r,n)=>{const a=$i,s=await r.getItem(a);if(s&&s>=Lr){n(r);return}const d=await e.getKeys();if(!d.length){n(r);return}const E=[];for(;d.length;){const v=d.shift();if(!v)continue;const g=v.toLowerCase();if(g.includes("wc@")||g.includes("walletconnect")||g.includes("wc_")||g.includes("wallet_connect")){const o=await e.getItem(v);await r.setItem(v,o),E.push(v)}}await r.setItem(a,Lr),n(r),ki(e,E)},ki=async(e,r)=>{r.length&&r.forEach(async n=>{await e.removeItem(n)})};let Fi=class{constructor(){this.initialized=!1,this.setInitialized=n=>{this.storage=n,this.initialized=!0};const r=new Hi;this.storage=r;try{const n=new Ui;Gi(r,n,this.setInitialized)}catch{this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(r){return await this.initialize(),this.storage.getItem(r)}async setItem(r,n){return await this.initialize(),this.storage.setItem(r,n)}async removeItem(r){return await this.initialize(),this.storage.removeItem(r)}async initialize(){this.initialized||await new Promise(r=>{const n=setInterval(()=>{this.initialized&&(clearInterval(n),r())},20)})}};class Ji{}function Vi(e){try{return JSON.stringify(e)}catch{return'"[Circular]"'}}var Xi=qi;function qi(e,r,n){var a=n&&n.stringify||Vi,s=1;if(typeof e=="object"&&e!==null){var d=r.length+s;if(d===1)return e;var E=new Array(d);E[0]=a(e);for(var v=1;v<d;v++)E[v]=a(r[v]);return E.join(" ")}if(typeof e!="string")return e;var g=r.length;if(g===0)return e;for(var o="",l=1-s,y=-1,S=e&&e.length||0,x=0;x<S;){if(e.charCodeAt(x)===37&&x+1<S){switch(y=y>-1?y:0,e.charCodeAt(x+1)){case 100:case 102:if(l>=g||r[l]==null)break;y<x&&(o+=e.slice(y,x)),o+=Number(r[l]),y=x+2,x++;break;case 105:if(l>=g||r[l]==null)break;y<x&&(o+=e.slice(y,x)),o+=Math.floor(Number(r[l])),y=x+2,x++;break;case 79:case 111:case 106:if(l>=g||r[l]===void 0)break;y<x&&(o+=e.slice(y,x));var w=typeof r[l];if(w==="string"){o+="'"+r[l]+"'",y=x+2,x++;break}if(w==="function"){o+=r[l].name||"<anonymous>",y=x+2,x++;break}o+=a(r[l]),y=x+2,x++;break;case 115:if(l>=g)break;y<x&&(o+=e.slice(y,x)),o+=String(r[l]),y=x+2,x++;break;case 37:y<x&&(o+=e.slice(y,x)),o+="%",y=x+2,x++,l--;break}++l}++x}return y===-1?e:(y<S&&(o+=e.slice(y)),o)}const Rr=Xi;var mt=Qe;const It=os().console||{},Yi={mapHttpRequest:Kt,mapHttpResponse:Kt,wrapRequestSerializer:er,wrapResponseSerializer:er,wrapErrorSerializer:er,req:Kt,res:Kt,err:rs};function Zi(e,r){return Array.isArray(e)?e.filter(function(a){return a!=="!stdSerializers.err"}):e===!0?Object.keys(r):!1}function Qe(e){e=e||{},e.browser=e.browser||{};const r=e.browser.transmit;if(r&&typeof r.send!="function")throw Error("pino: transmit option must have a send function");const n=e.browser.write||It;e.browser.write&&(e.browser.asObject=!0);const a=e.serializers||{},s=Zi(e.browser.serialize,a);let d=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(d=!1);const E=["error","fatal","warn","info","debug","trace"];typeof n=="function"&&(n.error=n.fatal=n.warn=n.info=n.debug=n.trace=n),e.enabled===!1&&(e.level="silent");const v=e.level||"info",g=Object.create(n);g.log||(g.log=Ot),Object.defineProperty(g,"levelVal",{get:l}),Object.defineProperty(g,"level",{get:y,set:S});const o={transmit:r,serialize:s,asObject:e.browser.asObject,levels:E,timestamp:ns(e)};g.levels=Qe.levels,g.level=v,g.setMaxListeners=g.getMaxListeners=g.emit=g.addListener=g.on=g.prependListener=g.once=g.prependOnceListener=g.removeListener=g.removeAllListeners=g.listeners=g.listenerCount=g.eventNames=g.write=g.flush=Ot,g.serializers=a,g._serialize=s,g._stdErrSerialize=d,g.child=x,r&&(g._logEvent=rr());function l(){return this.level==="silent"?1/0:this.levels.values[this.level]}function y(){return this._level}function S(w){if(w!=="silent"&&!this.levels.values[w])throw Error("unknown level "+w);this._level=w,pt(o,g,"error","log"),pt(o,g,"fatal","error"),pt(o,g,"warn","error"),pt(o,g,"info","log"),pt(o,g,"debug","log"),pt(o,g,"trace","log")}function x(w,j){if(!w)throw new Error("missing bindings for child Pino");j=j||{},s&&w.serializers&&(j.serializers=w.serializers);const J=j.serializers;if(s&&J){var q=Object.assign({},a,J),B=e.browser.serialize===!0?Object.keys(q):s;delete w.serializers,Xt([w],B,q,this._stdErrSerialize)}function Ae(ge){this._childLevel=(ge._childLevel|0)+1,this.error=_t(ge,w,"error"),this.fatal=_t(ge,w,"fatal"),this.warn=_t(ge,w,"warn"),this.info=_t(ge,w,"info"),this.debug=_t(ge,w,"debug"),this.trace=_t(ge,w,"trace"),q&&(this.serializers=q,this._serialize=B),r&&(this._logEvent=rr([].concat(ge._logEvent.bindings,w)))}return Ae.prototype=this,new Ae(this)}return g}Qe.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}};Qe.stdSerializers=Yi;Qe.stdTimeFunctions=Object.assign({},{nullTime:Jr,epochTime:Vr,unixTime:is,isoTime:ss});function pt(e,r,n,a){const s=Object.getPrototypeOf(r);r[n]=r.levelVal>r.levels.values[n]?Ot:s[n]?s[n]:It[n]||It[a]||Ot,Qi(e,r,n)}function Qi(e,r,n){!e.transmit&&r[n]===Ot||(r[n]=function(a){return function(){const d=e.timestamp(),E=new Array(arguments.length),v=Object.getPrototypeOf&&Object.getPrototypeOf(this)===It?It:this;for(var g=0;g<E.length;g++)E[g]=arguments[g];if(e.serialize&&!e.asObject&&Xt(E,this._serialize,this.serializers,this._stdErrSerialize),e.asObject?a.call(v,es(this,n,E,d)):a.apply(v,E),e.transmit){const o=e.transmit.level||r.level,l=Qe.levels.values[o],y=Qe.levels.values[n];if(y<l)return;ts(this,{ts:d,methodLevel:n,methodValue:y,transmitLevel:o,transmitValue:Qe.levels.values[e.transmit.level||r.level],send:e.transmit.send,val:r.levelVal},E)}}}(r[n]))}function es(e,r,n,a){e._serialize&&Xt(n,e._serialize,e.serializers,e._stdErrSerialize);const s=n.slice();let d=s[0];const E={};a&&(E.time=a),E.level=Qe.levels.values[r];let v=(e._childLevel|0)+1;if(v<1&&(v=1),d!==null&&typeof d=="object"){for(;v--&&typeof s[0]=="object";)Object.assign(E,s.shift());d=s.length?Rr(s.shift(),s):void 0}else typeof d=="string"&&(d=Rr(s.shift(),s));return d!==void 0&&(E.msg=d),E}function Xt(e,r,n,a){for(const s in e)if(a&&e[s]instanceof Error)e[s]=Qe.stdSerializers.err(e[s]);else if(typeof e[s]=="object"&&!Array.isArray(e[s]))for(const d in e[s])r&&r.indexOf(d)>-1&&d in n&&(e[s][d]=n[d](e[s][d]))}function _t(e,r,n){return function(){const a=new Array(1+arguments.length);a[0]=r;for(var s=1;s<a.length;s++)a[s]=arguments[s-1];return e[n].apply(this,a)}}function ts(e,r,n){const a=r.send,s=r.ts,d=r.methodLevel,E=r.methodValue,v=r.val,g=e._logEvent.bindings;Xt(n,e._serialize||Object.keys(e.serializers),e.serializers,e._stdErrSerialize===void 0?!0:e._stdErrSerialize),e._logEvent.ts=s,e._logEvent.messages=n.filter(function(o){return g.indexOf(o)===-1}),e._logEvent.level.label=d,e._logEvent.level.value=E,a(d,e._logEvent,v),e._logEvent=rr(g)}function rr(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function rs(e){const r={type:e.constructor.name,msg:e.message,stack:e.stack};for(const n in e)r[n]===void 0&&(r[n]=e[n]);return r}function ns(e){return typeof e.timestamp=="function"?e.timestamp:e.timestamp===!1?Jr:Vr}function Kt(){return{}}function er(e){return e}function Ot(){}function Jr(){return!1}function Vr(){return Date.now()}function is(){return Math.round(Date.now()/1e3)}function ss(){return new Date(Date.now()).toISOString()}function os(){function e(r){return typeof r<"u"&&r}try{return typeof globalThis<"u"||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch{return e(self)||e(window)||e(this)||{}}}const or=N.getDefaultExportFromCjs(mt),as={level:"info"},Lt="custom_context",ar=1e3*1024;class fs{constructor(r){this.nodeValue=r,this.sizeInBytes=new TextEncoder().encode(this.nodeValue).length,this.next=null}get value(){return this.nodeValue}get size(){return this.sizeInBytes}}class Pr{constructor(r){this.head=null,this.tail=null,this.lengthInNodes=0,this.maxSizeInBytes=r,this.sizeInBytes=0}append(r){const n=new fs(r);if(n.size>this.maxSizeInBytes)throw new Error(`[LinkedList] Value too big to insert into list: ${r} with size ${n.size}`);for(;this.size+n.size>this.maxSizeInBytes;)this.shift();this.head?(this.tail&&(this.tail.next=n),this.tail=n):(this.head=n,this.tail=n),this.lengthInNodes++,this.sizeInBytes+=n.size}shift(){if(!this.head)return;const r=this.head;this.head=this.head.next,this.head||(this.tail=null),this.lengthInNodes--,this.sizeInBytes-=r.size}toArray(){const r=[];let n=this.head;for(;n!==null;)r.push(n.value),n=n.next;return r}get length(){return this.lengthInNodes}get size(){return this.sizeInBytes}toOrderedArray(){return Array.from(this)}[Symbol.iterator](){let r=this.head;return{next:()=>{if(!r)return{done:!0,value:null};const n=r.value;return r=r.next,{done:!1,value:n}}}}}class Xr{constructor(r,n=ar){this.level=r??"error",this.levelValue=mt.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=n,this.logs=new Pr(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(r,n){n===mt.levels.values.error?console.error(r):n===mt.levels.values.warn?console.warn(r):n===mt.levels.values.debug?console.debug(r):n===mt.levels.values.trace?console.trace(r):console.log(r)}appendToLogs(r){this.logs.append(ht({timestamp:new Date().toISOString(),log:r}));const n=typeof r=="string"?JSON.parse(r).level:r.level;n>=this.levelValue&&this.forwardToConsole(r,n)}getLogs(){return this.logs}clearLogs(){this.logs=new Pr(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(r){const n=this.getLogArray();return n.push(ht({extraMetadata:r})),new Blob(n,{type:"application/json"})}}class cs{constructor(r,n=ar){this.baseChunkLogger=new Xr(r,n)}write(r){this.baseChunkLogger.appendToLogs(r)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(r){return this.baseChunkLogger.logsToBlob(r)}downloadLogsBlobInBrowser(r){const n=URL.createObjectURL(this.logsToBlob(r)),a=document.createElement("a");a.href=n,a.download=`walletconnect-logs-${new Date().toISOString()}.txt`,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(n)}}class us{constructor(r,n=ar){this.baseChunkLogger=new Xr(r,n)}write(r){this.baseChunkLogger.appendToLogs(r)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(r){return this.baseChunkLogger.logsToBlob(r)}}var ls=Object.defineProperty,ds=Object.defineProperties,hs=Object.getOwnPropertyDescriptors,Cr=Object.getOwnPropertySymbols,bs=Object.prototype.hasOwnProperty,gs=Object.prototype.propertyIsEnumerable,Mr=(e,r,n)=>r in e?ls(e,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[r]=n,Ht=(e,r)=>{for(var n in r||(r={}))bs.call(r,n)&&Mr(e,n,r[n]);if(Cr)for(var n of Cr(r))gs.call(r,n)&&Mr(e,n,r[n]);return e},$t=(e,r)=>ds(e,hs(r));function ys(e){return $t(Ht({},e),{level:(e==null?void 0:e.level)||as.level})}function ps(e,r=Lt){return e[r]||""}function _s(e,r,n=Lt){return e[n]=r,e}function qr(e,r=Lt){let n="";return typeof e.bindings>"u"?n=ps(e,r):n=e.bindings().context||"",n}function ms(e,r,n=Lt){const a=qr(e,n);return a.trim()?`${a}/${r}`:r}function ws(e,r,n=Lt){const a=ms(e,r,n),s=e.child({context:a});return _s(s,a,n)}function vs(e){var r,n;const a=new cs((r=e.opts)==null?void 0:r.level,e.maxSizeInBytes);return{logger:or($t(Ht({},e.opts),{level:"trace",browser:$t(Ht({},(n=e.opts)==null?void 0:n.browser),{write:s=>a.write(s)})})),chunkLoggerController:a}}function xs(e){var r;const n=new us((r=e.opts)==null?void 0:r.level,e.maxSizeInBytes);return{logger:or($t(Ht({},e.opts),{level:"trace"}),n),chunkLoggerController:n}}function Es(e){return typeof e.loggerOverride<"u"&&typeof e.loggerOverride!="string"?{logger:e.loggerOverride,chunkLoggerController:null}:typeof window<"u"?vs(e):xs(e)}var fr={},Yr={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});var r=ze.binary,n=ze.wipe;e.DIGEST_LENGTH=64,e.BLOCK_SIZE=128;var a=function(){function v(){this.digestLength=e.DIGEST_LENGTH,this.blockSize=e.BLOCK_SIZE,this._stateHi=new Int32Array(8),this._stateLo=new Int32Array(8),this._tempHi=new Int32Array(16),this._tempLo=new Int32Array(16),this._buffer=new Uint8Array(256),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return v.prototype._initState=function(){this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209},v.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},v.prototype.clean=function(){n.wipe(this._buffer),n.wipe(this._tempHi),n.wipe(this._tempLo),this.reset()},v.prototype.update=function(g,o){if(o===void 0&&(o=g.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var l=0;if(this._bytesHashed+=o,this._bufferLength>0){for(;this._bufferLength<e.BLOCK_SIZE&&o>0;)this._buffer[this._bufferLength++]=g[l++],o--;this._bufferLength===this.blockSize&&(d(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(o>=this.blockSize&&(l=d(this._tempHi,this._tempLo,this._stateHi,this._stateLo,g,l,o),o%=this.blockSize);o>0;)this._buffer[this._bufferLength++]=g[l++],o--;return this},v.prototype.finish=function(g){if(!this._finished){var o=this._bytesHashed,l=this._bufferLength,y=o/536870912|0,S=o<<3,x=o%128<112?128:256;this._buffer[l]=128;for(var w=l+1;w<x-8;w++)this._buffer[w]=0;r.writeUint32BE(y,this._buffer,x-8),r.writeUint32BE(S,this._buffer,x-4),d(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,x),this._finished=!0}for(var w=0;w<this.digestLength/8;w++)r.writeUint32BE(this._stateHi[w],g,w*8),r.writeUint32BE(this._stateLo[w],g,w*8+4);return this},v.prototype.digest=function(){var g=new Uint8Array(this.digestLength);return this.finish(g),g},v.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{stateHi:new Int32Array(this._stateHi),stateLo:new Int32Array(this._stateLo),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},v.prototype.restoreState=function(g){return this._stateHi.set(g.stateHi),this._stateLo.set(g.stateLo),this._bufferLength=g.bufferLength,g.buffer&&this._buffer.set(g.buffer),this._bytesHashed=g.bytesHashed,this._finished=!1,this},v.prototype.cleanSavedState=function(g){n.wipe(g.stateHi),n.wipe(g.stateLo),g.buffer&&n.wipe(g.buffer),g.bufferLength=0,g.bytesHashed=0},v}();e.SHA512=a;var s=new Int32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]);function d(v,g,o,l,y,S,x){for(var w=o[0],j=o[1],J=o[2],q=o[3],B=o[4],Ae=o[5],ge=o[6],Me=o[7],$=l[0],M=l[1],je=l[2],et=l[3],ye=l[4],Fe=l[5],We=l[6],Xe=l[7],m,_,Y,le,L,I,O,A;x>=128;){for(var Le=0;Le<16;Le++){var ne=8*Le+S;v[Le]=r.readUint32BE(y,ne),g[Le]=r.readUint32BE(y,ne+4)}for(var Le=0;Le<80;Le++){var wt=w,z=j,gt=J,b=q,h=B,u=Ae,t=ge,f=Me,R=$,P=M,K=je,U=et,D=ye,W=Fe,Re=We,de=Xe;if(m=Me,_=Xe,L=_&65535,I=_>>>16,O=m&65535,A=m>>>16,m=(B>>>14|ye<<18)^(B>>>18|ye<<14)^(ye>>>9|B<<23),_=(ye>>>14|B<<18)^(ye>>>18|B<<14)^(B>>>9|ye<<23),L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,m=B&Ae^~B&ge,_=ye&Fe^~ye&We,L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,m=s[Le*2],_=s[Le*2+1],L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,m=v[Le%16],_=g[Le%16],L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,I+=L>>>16,O+=I>>>16,A+=O>>>16,Y=O&65535|A<<16,le=L&65535|I<<16,m=Y,_=le,L=_&65535,I=_>>>16,O=m&65535,A=m>>>16,m=(w>>>28|$<<4)^($>>>2|w<<30)^($>>>7|w<<25),_=($>>>28|w<<4)^(w>>>2|$<<30)^(w>>>7|$<<25),L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,m=w&j^w&J^j&J,_=$&M^$&je^M&je,L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,I+=L>>>16,O+=I>>>16,A+=O>>>16,f=O&65535|A<<16,de=L&65535|I<<16,m=b,_=U,L=_&65535,I=_>>>16,O=m&65535,A=m>>>16,m=Y,_=le,L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,I+=L>>>16,O+=I>>>16,A+=O>>>16,b=O&65535|A<<16,U=L&65535|I<<16,j=wt,J=z,q=gt,B=b,Ae=h,ge=u,Me=t,w=f,M=R,je=P,et=K,ye=U,Fe=D,We=W,Xe=Re,$=de,Le%16===15)for(var ne=0;ne<16;ne++)m=v[ne],_=g[ne],L=_&65535,I=_>>>16,O=m&65535,A=m>>>16,m=v[(ne+9)%16],_=g[(ne+9)%16],L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,Y=v[(ne+1)%16],le=g[(ne+1)%16],m=(Y>>>1|le<<31)^(Y>>>8|le<<24)^Y>>>7,_=(le>>>1|Y<<31)^(le>>>8|Y<<24)^(le>>>7|Y<<25),L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,Y=v[(ne+14)%16],le=g[(ne+14)%16],m=(Y>>>19|le<<13)^(le>>>29|Y<<3)^Y>>>6,_=(le>>>19|Y<<13)^(Y>>>29|le<<3)^(le>>>6|Y<<26),L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,I+=L>>>16,O+=I>>>16,A+=O>>>16,v[ne]=O&65535|A<<16,g[ne]=L&65535|I<<16}m=w,_=$,L=_&65535,I=_>>>16,O=m&65535,A=m>>>16,m=o[0],_=l[0],L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,I+=L>>>16,O+=I>>>16,A+=O>>>16,o[0]=w=O&65535|A<<16,l[0]=$=L&65535|I<<16,m=j,_=M,L=_&65535,I=_>>>16,O=m&65535,A=m>>>16,m=o[1],_=l[1],L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,I+=L>>>16,O+=I>>>16,A+=O>>>16,o[1]=j=O&65535|A<<16,l[1]=M=L&65535|I<<16,m=J,_=je,L=_&65535,I=_>>>16,O=m&65535,A=m>>>16,m=o[2],_=l[2],L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,I+=L>>>16,O+=I>>>16,A+=O>>>16,o[2]=J=O&65535|A<<16,l[2]=je=L&65535|I<<16,m=q,_=et,L=_&65535,I=_>>>16,O=m&65535,A=m>>>16,m=o[3],_=l[3],L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,I+=L>>>16,O+=I>>>16,A+=O>>>16,o[3]=q=O&65535|A<<16,l[3]=et=L&65535|I<<16,m=B,_=ye,L=_&65535,I=_>>>16,O=m&65535,A=m>>>16,m=o[4],_=l[4],L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,I+=L>>>16,O+=I>>>16,A+=O>>>16,o[4]=B=O&65535|A<<16,l[4]=ye=L&65535|I<<16,m=Ae,_=Fe,L=_&65535,I=_>>>16,O=m&65535,A=m>>>16,m=o[5],_=l[5],L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,I+=L>>>16,O+=I>>>16,A+=O>>>16,o[5]=Ae=O&65535|A<<16,l[5]=Fe=L&65535|I<<16,m=ge,_=We,L=_&65535,I=_>>>16,O=m&65535,A=m>>>16,m=o[6],_=l[6],L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,I+=L>>>16,O+=I>>>16,A+=O>>>16,o[6]=ge=O&65535|A<<16,l[6]=We=L&65535|I<<16,m=Me,_=Xe,L=_&65535,I=_>>>16,O=m&65535,A=m>>>16,m=o[7],_=l[7],L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,I+=L>>>16,O+=I>>>16,A+=O>>>16,o[7]=Me=O&65535|A<<16,l[7]=Xe=L&65535|I<<16,S+=128,x-=128}return S}function E(v){var g=new a;g.update(v);var o=g.digest();return g.clean(),o}e.hash=E})(Yr);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.convertSecretKeyToX25519=e.convertPublicKeyToX25519=e.verify=e.sign=e.extractPublicKeyFromSecretKey=e.generateKeyPair=e.generateKeyPairFromSeed=e.SEED_LENGTH=e.SECRET_KEY_LENGTH=e.PUBLIC_KEY_LENGTH=e.SIGNATURE_LENGTH=void 0;const r=ze.random,n=Yr,a=ze.wipe;e.SIGNATURE_LENGTH=64,e.PUBLIC_KEY_LENGTH=32,e.SECRET_KEY_LENGTH=64,e.SEED_LENGTH=32;function s(b){const h=new Float64Array(16);if(b)for(let u=0;u<b.length;u++)h[u]=b[u];return h}const d=new Uint8Array(32);d[0]=9;const E=s(),v=s([1]),g=s([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),o=s([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),l=s([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),y=s([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),S=s([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function x(b,h){for(let u=0;u<16;u++)b[u]=h[u]|0}function w(b){let h=1;for(let u=0;u<16;u++){let t=b[u]+h+65535;h=Math.floor(t/65536),b[u]=t-h*65536}b[0]+=h-1+37*(h-1)}function j(b,h,u){const t=~(u-1);for(let f=0;f<16;f++){const R=t&(b[f]^h[f]);b[f]^=R,h[f]^=R}}function J(b,h){const u=s(),t=s();for(let f=0;f<16;f++)t[f]=h[f];w(t),w(t),w(t);for(let f=0;f<2;f++){u[0]=t[0]-65517;for(let P=1;P<15;P++)u[P]=t[P]-65535-(u[P-1]>>16&1),u[P-1]&=65535;u[15]=t[15]-32767-(u[14]>>16&1);const R=u[15]>>16&1;u[14]&=65535,j(t,u,1-R)}for(let f=0;f<16;f++)b[2*f]=t[f]&255,b[2*f+1]=t[f]>>8}function q(b,h){let u=0;for(let t=0;t<32;t++)u|=b[t]^h[t];return(1&u-1>>>8)-1}function B(b,h){const u=new Uint8Array(32),t=new Uint8Array(32);return J(u,b),J(t,h),q(u,t)}function Ae(b){const h=new Uint8Array(32);return J(h,b),h[0]&1}function ge(b,h){for(let u=0;u<16;u++)b[u]=h[2*u]+(h[2*u+1]<<8);b[15]&=32767}function Me(b,h,u){for(let t=0;t<16;t++)b[t]=h[t]+u[t]}function $(b,h,u){for(let t=0;t<16;t++)b[t]=h[t]-u[t]}function M(b,h,u){let t,f,R=0,P=0,K=0,U=0,D=0,W=0,Re=0,de=0,Pe=0,pe=0,he=0,ie=0,re=0,Z=0,V=0,H=0,se=0,_e=0,G=0,Ne=0,De=0,He=0,$e=0,Ke=0,qe=0,Ze=0,st=0,Ge=0,ct=0,vt=0,Rt=0,oe=u[0],Q=u[1],ae=u[2],fe=u[3],ce=u[4],ee=u[5],me=u[6],we=u[7],ve=u[8],xe=u[9],Ee=u[10],be=u[11],ue=u[12],F=u[13],Se=u[14],Ie=u[15];t=h[0],R+=t*oe,P+=t*Q,K+=t*ae,U+=t*fe,D+=t*ce,W+=t*ee,Re+=t*me,de+=t*we,Pe+=t*ve,pe+=t*xe,he+=t*Ee,ie+=t*be,re+=t*ue,Z+=t*F,V+=t*Se,H+=t*Ie,t=h[1],P+=t*oe,K+=t*Q,U+=t*ae,D+=t*fe,W+=t*ce,Re+=t*ee,de+=t*me,Pe+=t*we,pe+=t*ve,he+=t*xe,ie+=t*Ee,re+=t*be,Z+=t*ue,V+=t*F,H+=t*Se,se+=t*Ie,t=h[2],K+=t*oe,U+=t*Q,D+=t*ae,W+=t*fe,Re+=t*ce,de+=t*ee,Pe+=t*me,pe+=t*we,he+=t*ve,ie+=t*xe,re+=t*Ee,Z+=t*be,V+=t*ue,H+=t*F,se+=t*Se,_e+=t*Ie,t=h[3],U+=t*oe,D+=t*Q,W+=t*ae,Re+=t*fe,de+=t*ce,Pe+=t*ee,pe+=t*me,he+=t*we,ie+=t*ve,re+=t*xe,Z+=t*Ee,V+=t*be,H+=t*ue,se+=t*F,_e+=t*Se,G+=t*Ie,t=h[4],D+=t*oe,W+=t*Q,Re+=t*ae,de+=t*fe,Pe+=t*ce,pe+=t*ee,he+=t*me,ie+=t*we,re+=t*ve,Z+=t*xe,V+=t*Ee,H+=t*be,se+=t*ue,_e+=t*F,G+=t*Se,Ne+=t*Ie,t=h[5],W+=t*oe,Re+=t*Q,de+=t*ae,Pe+=t*fe,pe+=t*ce,he+=t*ee,ie+=t*me,re+=t*we,Z+=t*ve,V+=t*xe,H+=t*Ee,se+=t*be,_e+=t*ue,G+=t*F,Ne+=t*Se,De+=t*Ie,t=h[6],Re+=t*oe,de+=t*Q,Pe+=t*ae,pe+=t*fe,he+=t*ce,ie+=t*ee,re+=t*me,Z+=t*we,V+=t*ve,H+=t*xe,se+=t*Ee,_e+=t*be,G+=t*ue,Ne+=t*F,De+=t*Se,He+=t*Ie,t=h[7],de+=t*oe,Pe+=t*Q,pe+=t*ae,he+=t*fe,ie+=t*ce,re+=t*ee,Z+=t*me,V+=t*we,H+=t*ve,se+=t*xe,_e+=t*Ee,G+=t*be,Ne+=t*ue,De+=t*F,He+=t*Se,$e+=t*Ie,t=h[8],Pe+=t*oe,pe+=t*Q,he+=t*ae,ie+=t*fe,re+=t*ce,Z+=t*ee,V+=t*me,H+=t*we,se+=t*ve,_e+=t*xe,G+=t*Ee,Ne+=t*be,De+=t*ue,He+=t*F,$e+=t*Se,Ke+=t*Ie,t=h[9],pe+=t*oe,he+=t*Q,ie+=t*ae,re+=t*fe,Z+=t*ce,V+=t*ee,H+=t*me,se+=t*we,_e+=t*ve,G+=t*xe,Ne+=t*Ee,De+=t*be,He+=t*ue,$e+=t*F,Ke+=t*Se,qe+=t*Ie,t=h[10],he+=t*oe,ie+=t*Q,re+=t*ae,Z+=t*fe,V+=t*ce,H+=t*ee,se+=t*me,_e+=t*we,G+=t*ve,Ne+=t*xe,De+=t*Ee,He+=t*be,$e+=t*ue,Ke+=t*F,qe+=t*Se,Ze+=t*Ie,t=h[11],ie+=t*oe,re+=t*Q,Z+=t*ae,V+=t*fe,H+=t*ce,se+=t*ee,_e+=t*me,G+=t*we,Ne+=t*ve,De+=t*xe,He+=t*Ee,$e+=t*be,Ke+=t*ue,qe+=t*F,Ze+=t*Se,st+=t*Ie,t=h[12],re+=t*oe,Z+=t*Q,V+=t*ae,H+=t*fe,se+=t*ce,_e+=t*ee,G+=t*me,Ne+=t*we,De+=t*ve,He+=t*xe,$e+=t*Ee,Ke+=t*be,qe+=t*ue,Ze+=t*F,st+=t*Se,Ge+=t*Ie,t=h[13],Z+=t*oe,V+=t*Q,H+=t*ae,se+=t*fe,_e+=t*ce,G+=t*ee,Ne+=t*me,De+=t*we,He+=t*ve,$e+=t*xe,Ke+=t*Ee,qe+=t*be,Ze+=t*ue,st+=t*F,Ge+=t*Se,ct+=t*Ie,t=h[14],V+=t*oe,H+=t*Q,se+=t*ae,_e+=t*fe,G+=t*ce,Ne+=t*ee,De+=t*me,He+=t*we,$e+=t*ve,Ke+=t*xe,qe+=t*Ee,Ze+=t*be,st+=t*ue,Ge+=t*F,ct+=t*Se,vt+=t*Ie,t=h[15],H+=t*oe,se+=t*Q,_e+=t*ae,G+=t*fe,Ne+=t*ce,De+=t*ee,He+=t*me,$e+=t*we,Ke+=t*ve,qe+=t*xe,Ze+=t*Ee,st+=t*be,Ge+=t*ue,ct+=t*F,vt+=t*Se,Rt+=t*Ie,R+=38*se,P+=38*_e,K+=38*G,U+=38*Ne,D+=38*De,W+=38*He,Re+=38*$e,de+=38*Ke,Pe+=38*qe,pe+=38*Ze,he+=38*st,ie+=38*Ge,re+=38*ct,Z+=38*vt,V+=38*Rt,f=1,t=R+f+65535,f=Math.floor(t/65536),R=t-f*65536,t=P+f+65535,f=Math.floor(t/65536),P=t-f*65536,t=K+f+65535,f=Math.floor(t/65536),K=t-f*65536,t=U+f+65535,f=Math.floor(t/65536),U=t-f*65536,t=D+f+65535,f=Math.floor(t/65536),D=t-f*65536,t=W+f+65535,f=Math.floor(t/65536),W=t-f*65536,t=Re+f+65535,f=Math.floor(t/65536),Re=t-f*65536,t=de+f+65535,f=Math.floor(t/65536),de=t-f*65536,t=Pe+f+65535,f=Math.floor(t/65536),Pe=t-f*65536,t=pe+f+65535,f=Math.floor(t/65536),pe=t-f*65536,t=he+f+65535,f=Math.floor(t/65536),he=t-f*65536,t=ie+f+65535,f=Math.floor(t/65536),ie=t-f*65536,t=re+f+65535,f=Math.floor(t/65536),re=t-f*65536,t=Z+f+65535,f=Math.floor(t/65536),Z=t-f*65536,t=V+f+65535,f=Math.floor(t/65536),V=t-f*65536,t=H+f+65535,f=Math.floor(t/65536),H=t-f*65536,R+=f-1+37*(f-1),f=1,t=R+f+65535,f=Math.floor(t/65536),R=t-f*65536,t=P+f+65535,f=Math.floor(t/65536),P=t-f*65536,t=K+f+65535,f=Math.floor(t/65536),K=t-f*65536,t=U+f+65535,f=Math.floor(t/65536),U=t-f*65536,t=D+f+65535,f=Math.floor(t/65536),D=t-f*65536,t=W+f+65535,f=Math.floor(t/65536),W=t-f*65536,t=Re+f+65535,f=Math.floor(t/65536),Re=t-f*65536,t=de+f+65535,f=Math.floor(t/65536),de=t-f*65536,t=Pe+f+65535,f=Math.floor(t/65536),Pe=t-f*65536,t=pe+f+65535,f=Math.floor(t/65536),pe=t-f*65536,t=he+f+65535,f=Math.floor(t/65536),he=t-f*65536,t=ie+f+65535,f=Math.floor(t/65536),ie=t-f*65536,t=re+f+65535,f=Math.floor(t/65536),re=t-f*65536,t=Z+f+65535,f=Math.floor(t/65536),Z=t-f*65536,t=V+f+65535,f=Math.floor(t/65536),V=t-f*65536,t=H+f+65535,f=Math.floor(t/65536),H=t-f*65536,R+=f-1+37*(f-1),b[0]=R,b[1]=P,b[2]=K,b[3]=U,b[4]=D,b[5]=W,b[6]=Re,b[7]=de,b[8]=Pe,b[9]=pe,b[10]=he,b[11]=ie,b[12]=re,b[13]=Z,b[14]=V,b[15]=H}function je(b,h){M(b,h,h)}function et(b,h){const u=s();let t;for(t=0;t<16;t++)u[t]=h[t];for(t=253;t>=0;t--)je(u,u),t!==2&&t!==4&&M(u,u,h);for(t=0;t<16;t++)b[t]=u[t]}function ye(b,h){const u=s();let t;for(t=0;t<16;t++)u[t]=h[t];for(t=250;t>=0;t--)je(u,u),t!==1&&M(u,u,h);for(t=0;t<16;t++)b[t]=u[t]}function Fe(b,h){const u=s(),t=s(),f=s(),R=s(),P=s(),K=s(),U=s(),D=s(),W=s();$(u,b[1],b[0]),$(W,h[1],h[0]),M(u,u,W),Me(t,b[0],b[1]),Me(W,h[0],h[1]),M(t,t,W),M(f,b[3],h[3]),M(f,f,o),M(R,b[2],h[2]),Me(R,R,R),$(P,t,u),$(K,R,f),Me(U,R,f),Me(D,t,u),M(b[0],P,K),M(b[1],D,U),M(b[2],U,K),M(b[3],P,D)}function We(b,h,u){for(let t=0;t<4;t++)j(b[t],h[t],u)}function Xe(b,h){const u=s(),t=s(),f=s();et(f,h[2]),M(u,h[0],f),M(t,h[1],f),J(b,t),b[31]^=Ae(u)<<7}function m(b,h,u){x(b[0],E),x(b[1],v),x(b[2],v),x(b[3],E);for(let t=255;t>=0;--t){const f=u[t/8|0]>>(t&7)&1;We(b,h,f),Fe(h,b),Fe(b,b),We(b,h,f)}}function _(b,h){const u=[s(),s(),s(),s()];x(u[0],l),x(u[1],y),x(u[2],v),M(u[3],l,y),m(b,u,h)}function Y(b){if(b.length!==e.SEED_LENGTH)throw new Error(`ed25519: seed must be ${e.SEED_LENGTH} bytes`);const h=(0,n.hash)(b);h[0]&=248,h[31]&=127,h[31]|=64;const u=new Uint8Array(32),t=[s(),s(),s(),s()];_(t,h),Xe(u,t);const f=new Uint8Array(64);return f.set(b),f.set(u,32),{publicKey:u,secretKey:f}}e.generateKeyPairFromSeed=Y;function le(b){const h=(0,r.randomBytes)(32,b),u=Y(h);return(0,a.wipe)(h),u}e.generateKeyPair=le;function L(b){if(b.length!==e.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${e.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(b.subarray(32))}e.extractPublicKeyFromSecretKey=L;const I=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function O(b,h){let u,t,f,R;for(t=63;t>=32;--t){for(u=0,f=t-32,R=t-12;f<R;++f)h[f]+=u-16*h[t]*I[f-(t-32)],u=Math.floor((h[f]+128)/256),h[f]-=u*256;h[f]+=u,h[t]=0}for(u=0,f=0;f<32;f++)h[f]+=u-(h[31]>>4)*I[f],u=h[f]>>8,h[f]&=255;for(f=0;f<32;f++)h[f]-=u*I[f];for(t=0;t<32;t++)h[t+1]+=h[t]>>8,b[t]=h[t]&255}function A(b){const h=new Float64Array(64);for(let u=0;u<64;u++)h[u]=b[u];for(let u=0;u<64;u++)b[u]=0;O(b,h)}function Le(b,h){const u=new Float64Array(64),t=[s(),s(),s(),s()],f=(0,n.hash)(b.subarray(0,32));f[0]&=248,f[31]&=127,f[31]|=64;const R=new Uint8Array(64);R.set(f.subarray(32),32);const P=new n.SHA512;P.update(R.subarray(32)),P.update(h);const K=P.digest();P.clean(),A(K),_(t,K),Xe(R,t),P.reset(),P.update(R.subarray(0,32)),P.update(b.subarray(32)),P.update(h);const U=P.digest();A(U);for(let D=0;D<32;D++)u[D]=K[D];for(let D=0;D<32;D++)for(let W=0;W<32;W++)u[D+W]+=U[D]*f[W];return O(R.subarray(32),u),R}e.sign=Le;function ne(b,h){const u=s(),t=s(),f=s(),R=s(),P=s(),K=s(),U=s();return x(b[2],v),ge(b[1],h),je(f,b[1]),M(R,f,g),$(f,f,b[2]),Me(R,b[2],R),je(P,R),je(K,P),M(U,K,P),M(u,U,f),M(u,u,R),ye(u,u),M(u,u,f),M(u,u,R),M(u,u,R),M(b[0],u,R),je(t,b[0]),M(t,t,R),B(t,f)&&M(b[0],b[0],S),je(t,b[0]),M(t,t,R),B(t,f)?-1:(Ae(b[0])===h[31]>>7&&$(b[0],E,b[0]),M(b[3],b[0],b[1]),0)}function wt(b,h,u){const t=new Uint8Array(32),f=[s(),s(),s(),s()],R=[s(),s(),s(),s()];if(u.length!==e.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${e.SIGNATURE_LENGTH} bytes`);if(ne(R,b))return!1;const P=new n.SHA512;P.update(u.subarray(0,32)),P.update(b),P.update(h);const K=P.digest();return A(K),m(f,R,K),_(R,u.subarray(32)),Fe(f,R),Xe(t,f),!q(u,t)}e.verify=wt;function z(b){let h=[s(),s(),s(),s()];if(ne(h,b))throw new Error("Ed25519: invalid public key");let u=s(),t=s(),f=h[1];Me(u,v,f),$(t,v,f),et(t,t),M(u,u,t);let R=new Uint8Array(32);return J(R,u),R}e.convertPublicKeyToX25519=z;function gt(b){const h=(0,n.hash)(b.subarray(0,32));h[0]&=248,h[31]&=127,h[31]|=64;const u=new Uint8Array(h.subarray(0,32));return(0,a.wipe)(h),u}e.convertSecretKeyToX25519=gt})(fr);const Ss="EdDSA",Is="JWT",Zr=".",Qr="base64url",Os="utf8",Ts="utf8",As=":",Ls="did",Rs="key",jr="base58btc",Ps="z",Cs="K36",Ms=32;function Gt(e){return Jt(Ft(ht(e),Os),Qr)}function en(e){const r=Ft(Cs,jr),n=Ps+Jt(Hr([r,e]),jr);return[Ls,Rs,n].join(As)}function js(e){return Jt(e,Qr)}function Ns(e){return Ft([Gt(e.header),Gt(e.payload)].join(Zr),Ts)}function Bs(e){return[Gt(e.header),Gt(e.payload),js(e.signature)].join(Zr)}function zs(e=ze.random.randomBytes(Ms)){return fr.generateKeyPairFromSeed(e)}async function Ds(e,r,n,a,s=ze.cjs.fromMiliseconds(Date.now())){const d={alg:Ss,typ:Is},E=en(a.publicKey),v=s+n,g={iss:E,sub:e,aud:r,iat:s,exp:v},o=Ns({header:d,payload:g}),l=fr.sign(a.secretKey,o);return Bs({header:d,payload:g,signature:l})}const Ks="PARSE_ERROR",Us="INVALID_REQUEST",Ws="METHOD_NOT_FOUND",Hs="INVALID_PARAMS",tn="INTERNAL_ERROR",cr="SERVER_ERROR",$s=[-32700,-32600,-32601,-32602,-32603],St={[Ks]:{code:-32700,message:"Parse error"},[Us]:{code:-32600,message:"Invalid Request"},[Ws]:{code:-32601,message:"Method not found"},[Hs]:{code:-32602,message:"Invalid params"},[tn]:{code:-32603,message:"Internal error"},[cr]:{code:-32e3,message:"Server error"}},rn=cr;function Gs(e){return $s.includes(e)}function Nr(e){return Object.keys(St).includes(e)?St[e]:St[rn]}function ks(e){const r=Object.values(St).find(n=>n.code===e);return r||St[rn]}function nn(e,r,n){return e.message.includes("getaddrinfo ENOTFOUND")||e.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${n} RPC url at ${r}`):e}var sn={};/*! *****************************************************************************
|
|
2
2
|
Copyright (c) Microsoft Corporation.
|
|
3
3
|
|
|
4
4
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var xr=Object.defineProperty;var Br=(t,e,r)=>e in t?xr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var U=(t,e,r)=>Br(t,typeof e!="symbol"?e+"":e,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("./index-BZ7LatAr.js"),b=require("./sui-BWRqoTdl.js");require("./index-B5TmFc4M.js");class qt{constructor(e,r,n,i,s=!1){U(this,"transaction");U(this,"network");U(this,"chain");U(this,"description");U(this,"parallelizable");this.transaction=e,this.network=r,this.chain=n,this.description=i,this.parallelizable=s}}class Cr extends TypeError{constructor(e,r){let n;const{message:i,explanation:s,...c}=e,{path:a}=e,o=a.length===0?i:`At path: ${a.join(".")} -- ${i}`;super(s??o),s!=null&&(this.cause=o),Object.assign(this,c),this.name=this.constructor.name,this.failures=()=>n??(n=[e,...r()])}}function $r(t){return K(t)&&typeof t[Symbol.iterator]=="function"}function K(t){return typeof t=="object"&&t!=null}function J(t){return typeof t=="symbol"?t.toString():typeof t=="string"?JSON.stringify(t):`${t}`}function Ur(t){const{done:e,value:r}=t.next();return e?void 0:r}function Pr(t,e,r,n){if(t===!0)return;t===!1?t={}:typeof t=="string"&&(t={message:t});const{path:i,branch:s}=e,{type:c}=r,{refinement:a,message:o=`Expected a value of type \`${c}\`${a?` with refinement \`${a}\``:""}, but received: \`${J(n)}\``}=t;return{value:n,type:c,refinement:a,key:i[i.length-1],path:i,branch:s,...t,message:o}}function*Lt(t,e,r,n){$r(t)||(t=[t]);for(const i of t){const s=Pr(i,e,r,n);s&&(yield s)}}function*lt(t,e,r={}){const{path:n=[],branch:i=[t],coerce:s=!1,mask:c=!1}=r,a={path:n,branch:i};if(s&&(t=e.coercer(t,a),c&&e.type!=="type"&&K(e.schema)&&K(t)&&!Array.isArray(t)))for(const d in t)e.schema[d]===void 0&&delete t[d];let o="valid";for(const d of e.validator(t,a))d.explanation=r.message,o="not_valid",yield[d,void 0];for(let[d,u,g]of e.entries(t,a)){const m=lt(u,g,{path:d===void 0?n:[...n,d],branch:d===void 0?i:[...i,u],coerce:s,mask:c,message:r.message});for(const y of m)y[0]?(o=y[0].refinement!=null?"not_refined":"not_valid",yield[y[0],void 0]):s&&(u=y[1],d===void 0?t=u:t instanceof Map?t.set(d,u):t instanceof Set?t.add(u):K(t)&&(u!==void 0||d in t)&&(t[d]=u))}if(o!=="not_valid")for(const d of e.refiner(t,a))d.explanation=r.message,o="not_refined",yield[d,void 0];o==="valid"&&(yield[void 0,t])}class te{constructor(e){const{type:r,schema:n,validator:i,refiner:s,coercer:c=o=>o,entries:a=function*(){}}=e;this.type=r,this.schema=n,this.entries=a,this.coercer=c,i?this.validator=(o,d)=>{const u=i(o,d);return Lt(u,d,this,o)}:this.validator=()=>[],s?this.refiner=(o,d)=>{const u=s(o,d);return Lt(u,d,this,o)}:this.refiner=()=>[]}assert(e,r){return nt(e,this,r)}create(e,r){return Xt(e,this,r)}is(e){return L(e,this)}mask(e,r){return Zt(e,this,r)}validate(e,r={}){return _e(e,this,r)}}function nt(t,e,r){const n=_e(t,e,{message:r});if(n[0])throw n[0]}function Xt(t,e,r){const n=_e(t,e,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function Zt(t,e,r){const n=_e(t,e,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function L(t,e){return!_e(t,e)[0]}function _e(t,e,r={}){const n=lt(t,e,r),i=Ur(n);return i[0]?[new Cr(i[0],function*(){for(const c of n)c[0]&&(yield c[0])}),void 0]:[void 0,i[1]]}function je(...t){const e=t[0].type==="type",r=t.map(i=>i.schema),n=Object.assign({},...r);return e?Rr(n):p(n)}function W(t,e){return new te({type:t,schema:null,validator:e})}function it(){return W("any",()=>!0)}function E(t){return new te({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(const[r,n]of e.entries())yield[r,n,t]},coercer(e){return Array.isArray(e)?e.slice():e},validator(e){return Array.isArray(e)||`Expected an array value, but received: ${J(e)}`}})}function Mr(){return W("bigint",t=>typeof t=="bigint")}function z(){return W("boolean",t=>typeof t=="boolean")}function ee(){return W("integer",t=>typeof t=="number"&&!isNaN(t)&&Number.isInteger(t)||`Expected an integer, but received: ${J(t)}`)}function k(t){const e=J(t),r=typeof t;return new te({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?t:null,validator(n){return n===t||`Expected the literal \`${e}\`, but received: ${J(n)}`}})}function Yt(){return W("never",()=>!1)}function $(t){return new te({...t,validator:(e,r)=>e===null||t.validator(e,r),refiner:(e,r)=>e===null||t.refiner(e,r)})}function he(){return W("number",t=>typeof t=="number"&&!isNaN(t)||`Expected a number, but received: ${J(t)}`)}function p(t){const e=t?Object.keys(t):[],r=Yt();return new te({type:"object",schema:t||null,*entries(n){if(t&&K(n)){const i=new Set(Object.keys(n));for(const s of e)i.delete(s),yield[s,n[s],t[s]];for(const s of i)yield[s,n[s],r]}},validator(n){return K(n)||`Expected an object, but received: ${J(n)}`},coercer(n){return K(n)?{...n}:n}})}function v(t){return new te({...t,validator:(e,r)=>e===void 0||t.validator(e,r),refiner:(e,r)=>e===void 0||t.refiner(e,r)})}function Q(t,e){return new te({type:"record",schema:null,*entries(r){if(K(r))for(const n in r){const i=r[n];yield[n,n,t],yield[n,i,e]}},validator(r){return K(r)||`Expected an object, but received: ${J(r)}`}})}function h(){return W("string",t=>typeof t=="string"||`Expected a string, but received: ${J(t)}`)}function Qt(t){const e=Yt();return new te({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(t.length,r.length);for(let i=0;i<n;i++)yield[i,r[i],t[i]||e]}},validator(r){return Array.isArray(r)||`Expected an array, but received: ${J(r)}`}})}function Rr(t){const e=Object.keys(t);return new te({type:"type",schema:t,*entries(r){if(K(r))for(const n of e)yield[n,r[n],t[n]]},validator(r){return K(r)||`Expected an object, but received: ${J(r)}`},coercer(r){return K(r)?{...r}:r}})}function P(t){const e=t.map(r=>r.type).join(" | ");return new te({type:"union",schema:null,coercer(r){for(const n of t){const[i,s]=n.validate(r,{coerce:!0});if(!i)return s}return r},validator(r,n){const i=[];for(const s of t){const[...c]=lt(r,s,n),[a]=c;if(a[0])for(const[o]of c)o&&i.push(o);else return[]}return[`Expected the value to satisfy a union of \`${e}\`, but received: ${J(r)}`,...i]}})}function er(){return W("unknown",()=>!0)}const ft=P([p({AddressOwner:h()}),p({ObjectOwner:h()}),p({Shared:p({initial_shared_version:$(h())})}),k("Immutable")]);W("SuiJsonValue",()=>!0);const Nr=P([p({u32:h()}),p({u64:h()}),p({f64:h()})]);p({attributes:Q(h(),$(Nr)),featureFlags:Q(h(),z()),maxSupportedProtocolVersion:h(),minSupportedProtocolVersion:h(),protocolVersion:h()});P([h(),k("package")]);const ce=p({digest:h(),objectId:h(),version:P([he(),h(),Mr()])});p({owner:ft,reference:ce});p({objectId:h(),sequenceNumber:h()});p({payment:E(ce),owner:h(),price:h(),budget:h()});const Dr=je(ce,p({type:h(),owner:ft,previousTransaction:h()})),Vr=Q(h(),it()),zr=Q(h(),er()),Fr=p({type:h(),fields:Vr,hasPublicTransfer:z()}),Gr=p({disassembled:zr}),Lr=P([je(Fr,p({dataType:k("moveObject")})),je(Gr,p({dataType:k("package")}))]),Wr=p({type:h(),hasPublicTransfer:z(),version:h(),bcsBytes:h()}),Kr=p({id:h(),moduleMap:Q(h(),h())}),Jr=P([je(Wr,p({dataType:k("moveObject")})),je(Kr,p({dataType:k("package")}))]);BigInt(1e9);const tr=p({code:h(),error:v(h()),object_id:v(h()),parent_object_id:v(h()),version:v(h()),digest:v(h())}),Hr=p({data:$(v(Q(h(),h()))),error:$(v(tr))}),qr=P([Hr,v(Q(h(),h()))]),rr=p({objectId:h(),version:h(),digest:h(),type:$(v(h())),content:$(v(Lr)),bcs:$(v(Jr)),owner:$(v(ft)),previousTransaction:$(v(h())),storageRebate:$(v(h())),display:$(v(qr))});p({showType:$(v(z())),showContent:$(v(z())),showBcs:$(v(z())),showOwner:$(v(z())),showPreviousTransaction:$(v(z())),showStorageRebate:$(v(z())),showDisplay:$(v(z()))});P([k("Exists"),k("notExists"),k("Deleted")]);E(Dr);const Xr=p({data:$(v(rr)),error:$(v(tr))});function Zr(t){return t.data}function Yr(t){if(t.error&&"object_id"in t.error&&"version"in t.error&&"digest"in t.error){const e=t.error;return{objectId:e.object_id,version:e.version,digest:e.digest}}}function Wt(t){if("reference"in t)return t.reference;const e=Zr(t);return e?{objectId:e.objectId,version:e.version,digest:e.digest}:Yr(t)}p({objectId:h(),atCheckpoint:v(he())});p({data:E(Xr),nextCursor:v($(h())),hasNextPage:z()});P([p({details:rr,status:k("VersionFound")}),p({details:h(),status:k("ObjectNotExists")}),p({details:ce,status:k("ObjectDeleted")}),p({details:Qt([h(),he()]),status:k("VersionNotFound")}),p({details:p({asked_version:he(),latest_version:he(),object_id:h()}),status:k("VersionTooHigh")})]);const Qr=P([h(),p({Object:h()})]);E(Qr);const en=p({address:h(),name:h()}),tn=P([k("Private"),k("Public"),k("Friend")]),ht=p({abilities:E(h())}),rn=p({constraints:ht,isPhantom:z()}),nn=p({TypeParameter:he()}),Xe=Qt([p({module:h(),package:h(),function:h()}),h()]);p({rank3Days:E(Xe),rank7Days:E(Xe),rank30Days:E(Xe)});function nr(t){if(!t)return!1;if(typeof t=="string"||L(t,nn)||ir(t))return!0;if(typeof t!="object")return!1;const e=t;return!!(L(e.Reference,me)||L(e.MutableReference,me)||L(e.Vector,me))}const me=W("SuiMoveNormalizedType",nr);function ir(t){if(!t||typeof t!="object")return!1;const e=t;if(!e.Struct||typeof e.Struct!="object")return!1;const r=e.Struct;return!(typeof r.address!="string"||typeof r.module!="string"||typeof r.name!="string"||!Array.isArray(r.typeArguments)||!r.typeArguments.every(n=>nr(n)))}W("SuiMoveNormalizedStructType",ir);const sn=p({visibility:tn,isEntry:z(),typeParameters:E(ht),parameters:E(me),return:E(me)}),an=p({name:h(),type:me}),on=p({abilities:ht,typeParameters:E(rn),fields:E(an)}),cn=p({fileFormatVersion:he(),address:h(),name:h(),friends:E(en),structs:Q(h(),on),exposedFunctions:Q(h(),sn)});Q(h(),cn);function st(t){return typeof t=="object"&&"MutableReference"in t?t.MutableReference:void 0}function sr(t){return typeof t=="object"&&"Reference"in t?t.Reference:void 0}function gt(t){if(typeof t=="object"&&"Struct"in t)return t;const e=sr(t),r=st(t);if(typeof e=="object"&&"Struct"in e)return e;if(typeof r=="object"&&"Struct"in r)return r}function un(t){if(t.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),r=0;r<e.length;r++)e[r]=255;for(var n=0;n<t.length;n++){var i=t.charAt(n),s=i.charCodeAt(0);if(e[s]!==255)throw new TypeError(i+" is ambiguous");e[s]=n}var c=t.length,a=t.charAt(0),o=Math.log(c)/Math.log(256),d=Math.log(256)/Math.log(c);function u(y){if(y instanceof Uint8Array||(ArrayBuffer.isView(y)?y=new Uint8Array(y.buffer,y.byteOffset,y.byteLength):Array.isArray(y)&&(y=Uint8Array.from(y))),!(y instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(y.length===0)return"";for(var S=0,T=0,f=0,O=y.length;f!==O&&y[f]===0;)f++,S++;for(var B=(O-f)*d+1>>>0,M=new Uint8Array(B);f!==O;){for(var A=y[f],j=0,R=B-1;(A!==0||j<T)&&R!==-1;R--,j++)A+=256*M[R]>>>0,M[R]=A%c>>>0,A=A/c>>>0;if(A!==0)throw new Error("Non-zero carry");T=j,f++}for(var H=B-T;H!==B&&M[H]===0;)H++;for(var pe=a.repeat(S);H<B;++H)pe+=t.charAt(M[H]);return pe}function g(y){if(typeof y!="string")throw new TypeError("Expected String");if(y.length===0)return new Uint8Array;for(var S=0,T=0,f=0;y[S]===a;)T++,S++;for(var O=(y.length-S)*o+1>>>0,B=new Uint8Array(O);y[S];){var M=e[y.charCodeAt(S)];if(M===255)return;for(var A=0,j=O-1;(M!==0||A<f)&&j!==-1;j--,A++)M+=c*B[j]>>>0,B[j]=M%256>>>0,M=M/256>>>0;if(M!==0)throw new Error("Non-zero carry");f=A,S++}for(var R=O-f;R!==O&&B[R]===0;)R++;for(var H=new Uint8Array(T+(O-R)),pe=T;R!==O;)H[pe++]=B[R++];return H}function m(y){var S=g(y);if(S)return S;throw new Error("Non-base"+c+" character")}return{encode:u,decodeUnsafe:g,decode:m}}var dn=un;const ln=dn,fn="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";var hn=ln(fn);const ar=w.getDefaultExportFromCjs(hn),xe=t=>ar.encode(t),pt=t=>ar.decode(t);function ue(t){return Uint8Array.from(atob(t),e=>e.charCodeAt(0))}const Ze=8192;function Be(t){if(t.length<Ze)return btoa(String.fromCharCode(...t));let e="";for(var r=0;r<t.length;r+=Ze){const n=t.slice(r,r+Ze);e+=String.fromCharCode(...n)}return btoa(e)}function Je(t){var i;const e=t.startsWith("0x")?t.slice(2):t,n=((i=(e.length%2===0?e:`0${e}}`).match(/.{2}/g))==null?void 0:i.map(s=>parseInt(s,16)))??[];return Uint8Array.from(n)}function Ce(t){return t.reduce((e,r)=>e+r.toString(16).padStart(2,"0"),"")}function yt(t){let e=[],r=0;if(t===0)return[0];for(;t>0;)e[r]=t&127,(t>>=7)&&(e[r]|=128),r+=1;return e}function gn(t){let e=0,r=0,n=0;for(;;){let i=t[n];if(n+=1,e|=(i&127)<<r,!(i&128))break;r+=7}return{value:e,length:n}}class or{constructor(e){this.bytePosition=0,this.dataView=new DataView(e.buffer)}shift(e){return this.bytePosition+=e,this}read8(){let e=this.dataView.getUint8(this.bytePosition);return this.shift(1),e}read16(){let e=this.dataView.getUint16(this.bytePosition,!0);return this.shift(2),e}read32(){let e=this.dataView.getUint32(this.bytePosition,!0);return this.shift(4),e}read64(){let e=this.read32(),n=this.read32().toString(16)+e.toString(16).padStart(8,"0");return BigInt("0x"+n).toString(10)}read128(){let e=BigInt(this.read64()),n=BigInt(this.read64()).toString(16)+e.toString(16).padStart(16,"0");return BigInt("0x"+n).toString(10)}read256(){let e=BigInt(this.read128()),n=BigInt(this.read128()).toString(16)+e.toString(16).padStart(32,"0");return BigInt("0x"+n).toString(10)}readBytes(e){let r=this.bytePosition+this.dataView.byteOffset,n=new Uint8Array(this.dataView.buffer,r,e);return this.shift(e),n}readULEB(){let e=this.bytePosition+this.dataView.byteOffset,r=new Uint8Array(this.dataView.buffer,e),{value:n,length:i}=gn(r);return this.shift(i),n}readVec(e){let r=this.readULEB(),n=[];for(let i=0;i<r;i++)n.push(e(this,i,r));return n}}function pn(t,e){switch(e){case"base58":return xe(t);case"base64":return Be(t);case"hex":return Ce(t);default:throw new Error("Unsupported encoding, supported values are: base64, hex")}}function yn(t,e){switch(e){case"base58":return pt(t);case"base64":return ue(t);case"hex":return Je(t);default:throw new Error("Unsupported encoding, supported values are: base64, hex")}}function mt(t,e=["<",">"]){const[r,n]=e,i=[];let s="",c=0;for(let a=0;a<t.length;a++){const o=t[a];if(o===r&&c++,o===n&&c--,c===0&&o===","){i.push(s.trim()),s="";continue}s+=o}return i.push(s.trim()),i}class cr{constructor({size:e=1024,maxSize:r,allocateSize:n=1024}={}){this.bytePosition=0,this.size=e,this.maxSize=r||e,this.allocateSize=n,this.dataView=new DataView(new ArrayBuffer(e))}ensureSizeOrGrow(e){const r=this.bytePosition+e;if(r>this.size){const n=Math.min(this.maxSize,this.size+this.allocateSize);if(r>n)throw new Error(`Attempting to serialize to BCS, but buffer does not have enough size. Allocated size: ${this.size}, Max size: ${this.maxSize}, Required size: ${r}`);this.size=n;const i=new ArrayBuffer(this.size);new Uint8Array(i).set(new Uint8Array(this.dataView.buffer)),this.dataView=new DataView(i)}}shift(e){return this.bytePosition+=e,this}write8(e){return this.ensureSizeOrGrow(1),this.dataView.setUint8(this.bytePosition,Number(e)),this.shift(1)}write16(e){return this.ensureSizeOrGrow(2),this.dataView.setUint16(this.bytePosition,Number(e),!0),this.shift(2)}write32(e){return this.ensureSizeOrGrow(4),this.dataView.setUint32(this.bytePosition,Number(e),!0),this.shift(4)}write64(e){return Ye(BigInt(e),8).forEach(r=>this.write8(r)),this}write128(e){return Ye(BigInt(e),16).forEach(r=>this.write8(r)),this}write256(e){return Ye(BigInt(e),32).forEach(r=>this.write8(r)),this}writeULEB(e){return yt(e).forEach(r=>this.write8(r)),this}writeVec(e,r){return this.writeULEB(e.length),Array.from(e).forEach((n,i)=>r(this,n,i,e.length)),this}*[Symbol.iterator](){for(let e=0;e<this.bytePosition;e++)yield this.dataView.getUint8(e);return this.toBytes()}toBytes(){return new Uint8Array(this.dataView.buffer.slice(0,this.bytePosition))}toString(e){return pn(this.toBytes(),e)}}function Ye(t,e){let r=new Uint8Array(e),n=0;for(;t>0;)r[n]=Number(t%BigInt(256)),t=t/BigInt(256),n+=1;return r}var ur=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)},X=(t,e,r)=>(ur(t,e,"read from private field"),r?r.call(t):e.get(t)),ze=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},Fe=(t,e,r,n)=>(ur(t,e,"write to private field"),e.set(t,r),r),ye,Se,Me,ae;const dr=class{constructor(t){ze(this,ye,void 0),ze(this,Se,void 0),this.name=t.name,this.read=t.read,this.serializedSize=t.serializedSize??(()=>null),Fe(this,ye,t.write),Fe(this,Se,t.serialize??((e,r)=>{const n=new cr({size:this.serializedSize(e)??void 0,...r});return X(this,ye).call(this,e,n),n.toBytes()})),this.validate=t.validate??(()=>{})}write(t,e){this.validate(t),X(this,ye).call(this,t,e)}serialize(t,e){return this.validate(t),new mn(this,X(this,Se).call(this,t,e))}parse(t){const e=new or(t);return this.read(e)}transform({name:t,input:e,output:r}){return new dr({name:t??this.name,read:n=>r(this.read(n)),write:(n,i)=>X(this,ye).call(this,e(n),i),serializedSize:n=>this.serializedSize(e(n)),serialize:(n,i)=>X(this,Se).call(this,e(n),i),validate:n=>this.validate(e(n))})}};let Z=dr;ye=new WeakMap;Se=new WeakMap;const lr=Symbol.for("@mysten/serialized-bcs");function wt(t){return!!t&&typeof t=="object"&&t[lr]===!0}class mn{constructor(e,r){ze(this,Me,void 0),ze(this,ae,void 0),Fe(this,Me,e),Fe(this,ae,r)}get[lr](){return!0}toBytes(){return X(this,ae)}toHex(){return Ce(X(this,ae))}toBase64(){return Be(X(this,ae))}toBase58(){return xe(X(this,ae))}parse(){return X(this,Me).parse(X(this,ae))}}Me=new WeakMap;ae=new WeakMap;function Ge({size:t,...e}){return new Z({...e,serializedSize:()=>t})}function Qe({readMethod:t,writeMethod:e,...r}){return Ge({...r,read:n=>n[t](),write:(n,i)=>i[e](n),validate:n=>{var i;if(n<0||n>r.maxValue)throw new TypeError(`Invalid ${r.name} value: ${n}. Expected value in range 0-${r.maxValue}`);(i=r.validate)==null||i.call(r,n)}})}function et({readMethod:t,writeMethod:e,...r}){return Ge({...r,read:n=>n[t](),write:(n,i)=>i[e](BigInt(n)),validate:n=>{var s;const i=BigInt(n);if(i<0||i>r.maxValue)throw new TypeError(`Invalid ${r.name} value: ${i}. Expected value in range 0-${r.maxValue}`);(s=r.validate)==null||s.call(r,i)}})}function wn({serialize:t,...e}){const r=new Z({...e,serialize:t,write:(n,i)=>{for(const s of r.serialize(n).toBytes())i.write8(s)}});return r}function bn({toBytes:t,fromBytes:e,...r}){return new Z({...r,read:n=>{const i=n.readULEB(),s=n.readBytes(i);return e(s)},write:(n,i)=>{const s=t(n);i.writeULEB(s.length);for(let c=0;c<s.length;c++)i.write8(s[c])},serialize:n=>{const i=t(n),s=yt(i.length),c=new Uint8Array(s.length+i.length);return c.set(s,0),c.set(i,s.length),c},validate:n=>{var i;if(typeof n!="string")throw new TypeError(`Invalid ${r.name} value: ${n}. Expected string`);(i=r.validate)==null||i.call(r,n)}})}function Sn(t){let e=null;function r(){return e||(e=t()),e}return new Z({name:"lazy",read:n=>r().read(n),serializedSize:n=>r().serializedSize(n),write:(n,i)=>r().write(n,i),serialize:(n,i)=>r().serialize(n,i).toBytes()})}const l={u8(t){return Qe({name:"u8",readMethod:"read8",writeMethod:"write8",size:1,maxValue:2**8-1,...t})},u16(t){return Qe({name:"u16",readMethod:"read16",writeMethod:"write16",size:2,maxValue:2**16-1,...t})},u32(t){return Qe({name:"u32",readMethod:"read32",writeMethod:"write32",size:4,maxValue:2**32-1,...t})},u64(t){return et({name:"u64",readMethod:"read64",writeMethod:"write64",size:8,maxValue:2n**64n-1n,...t})},u128(t){return et({name:"u128",readMethod:"read128",writeMethod:"write128",size:16,maxValue:2n**128n-1n,...t})},u256(t){return et({name:"u256",readMethod:"read256",writeMethod:"write256",size:32,maxValue:2n**256n-1n,...t})},bool(t){return Ge({name:"bool",size:1,read:e=>e.read8()===1,write:(e,r)=>r.write8(e?1:0),...t,validate:e=>{var r;if((r=t==null?void 0:t.validate)==null||r.call(t,e),typeof e!="boolean")throw new TypeError(`Expected boolean, found ${typeof e}`)}})},uleb128(t){return wn({name:"uleb128",read:e=>e.readULEB(),serialize:e=>Uint8Array.from(yt(e)),...t})},bytes(t,e){return Ge({name:`bytes[${t}]`,size:t,read:r=>r.readBytes(t),write:(r,n)=>{for(let i=0;i<t;i++)n.write8(r[i]??0)},...e,validate:r=>{var n;if((n=e==null?void 0:e.validate)==null||n.call(e,r),!("length"in r))throw new TypeError(`Expected array, found ${typeof r}`);if(r.length!==t)throw new TypeError(`Expected array of length ${t}, found ${r.length}`)}})},string(t){return bn({name:"string",toBytes:e=>new TextEncoder().encode(e),fromBytes:e=>new TextDecoder().decode(e),...t})},fixedArray(t,e,r){return new Z({name:`${e.name}[${t}]`,read:n=>{const i=new Array(t);for(let s=0;s<t;s++)i[s]=e.read(n);return i},write:(n,i)=>{for(const s of n)e.write(s,i)},...r,validate:n=>{var i;if((i=r==null?void 0:r.validate)==null||i.call(r,n),!("length"in n))throw new TypeError(`Expected array, found ${typeof n}`);if(n.length!==t)throw new TypeError(`Expected array of length ${t}, found ${n.length}`)}})},option(t){return l.enum(`Option<${t.name}>`,{None:null,Some:t}).transform({input:e=>e==null?{None:!0}:{Some:e},output:e=>"Some"in e?e.Some:null})},vector(t,e){return new Z({name:`vector<${t.name}>`,read:r=>{const n=r.readULEB(),i=new Array(n);for(let s=0;s<n;s++)i[s]=t.read(r);return i},write:(r,n)=>{n.writeULEB(r.length);for(const i of r)t.write(i,n)},...e,validate:r=>{var n;if((n=e==null?void 0:e.validate)==null||n.call(e,r),!("length"in r))throw new TypeError(`Expected array, found ${typeof r}`)}})},tuple(t,e){return new Z({name:`(${t.map(r=>r.name).join(", ")})`,serializedSize:r=>{let n=0;for(let i=0;i<t.length;i++){const s=t[i].serializedSize(r[i]);if(s==null)return null;n+=s}return n},read:r=>{const n=[];for(const i of t)n.push(i.read(r));return n},write:(r,n)=>{for(let i=0;i<t.length;i++)t[i].write(r[i],n)},...e,validate:r=>{var n;if((n=e==null?void 0:e.validate)==null||n.call(e,r),!Array.isArray(r))throw new TypeError(`Expected array, found ${typeof r}`);if(r.length!==t.length)throw new TypeError(`Expected array of length ${t.length}, found ${r.length}`)}})},struct(t,e,r){const n=Object.entries(e);return new Z({name:t,serializedSize:i=>{let s=0;for(const[c,a]of n){const o=a.serializedSize(i[c]);if(o==null)return null;s+=o}return s},read:i=>{const s={};for(const[c,a]of n)s[c]=a.read(i);return s},write:(i,s)=>{for(const[c,a]of n)a.write(i[c],s)},...r,validate:i=>{var s;if((s=r==null?void 0:r.validate)==null||s.call(r,i),typeof i!="object"||i==null)throw new TypeError(`Expected object, found ${typeof i}`)}})},enum(t,e,r){const n=Object.entries(e);return new Z({name:t,read:i=>{const s=i.readULEB(),[c,a]=n[s];return{[c]:(a==null?void 0:a.read(i))??!0}},write:(i,s)=>{const[c,a]=Object.entries(i)[0];for(let o=0;o<n.length;o++){const[d,u]=n[o];if(d===c){s.writeULEB(o),u==null||u.write(a,s);return}}},...r,validate:i=>{var a;if((a=r==null?void 0:r.validate)==null||a.call(r,i),typeof i!="object"||i==null)throw new TypeError(`Expected object, found ${typeof i}`);const s=Object.keys(i);if(s.length!==1)throw new TypeError(`Expected object with one key, found ${s.length}`);const[c]=s;if(!Object.hasOwn(e,c))throw new TypeError(`Invalid enum variant ${c}`)}})},map(t,e){return l.vector(l.tuple([t,e])).transform({name:`Map<${t.name}, ${e.name}>`,input:r=>[...r.entries()],output:r=>{const n=new Map;for(const[i,s]of r)n.set(i,s);return n}})},generic(t,e){return(...r)=>e(...r).transform({name:`${e.name}<${r.map(n=>n.name).join(", ")}>`,input:n=>n,output:n=>n})},lazy(t){return Sn(t)}},Tn=32,Te=class{constructor(t){if(this.types=new Map,this.counter=0,t instanceof Te){this.schema=t.schema,this.types=new Map(t.types);return}if(this.schema=t,this.registerAddressType(Te.ADDRESS,t.addressLength,t.addressEncoding),this.registerVectorType(t.vectorType),t.types&&t.types.structs)for(let e of Object.keys(t.types.structs))this.registerStructType(e,t.types.structs[e]);if(t.types&&t.types.enums)for(let e of Object.keys(t.types.enums))this.registerEnumType(e,t.types.enums[e]);if(t.types&&t.types.aliases)for(let e of Object.keys(t.types.aliases))this.registerAlias(e,t.types.aliases[e]);t.withPrimitives!==!1&&vn(this)}tempKey(){return`bcs-struct-${++this.counter}`}ser(t,e,r){if(typeof t=="string"||Array.isArray(t)){const{name:n,params:i}=this.parseTypeName(t);return this.getTypeInterface(n).encode(this,e,r,i)}if(typeof t=="object"){const n=this.tempKey();return new Te(this).registerStructType(n,t).ser(n,e,r)}throw new Error(`Incorrect type passed into the '.ser()' function.
|
|
1
|
+
"use strict";var xr=Object.defineProperty;var Br=(t,e,r)=>e in t?xr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var U=(t,e,r)=>Br(t,typeof e!="symbol"?e+"":e,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("./index-CDGktAjP.js"),b=require("./sui-BLA0P5P1.js");require("./index-CUInBQd6.js");class qt{constructor(e,r,n,i,s=!1){U(this,"transaction");U(this,"network");U(this,"chain");U(this,"description");U(this,"parallelizable");this.transaction=e,this.network=r,this.chain=n,this.description=i,this.parallelizable=s}}class Cr extends TypeError{constructor(e,r){let n;const{message:i,explanation:s,...c}=e,{path:a}=e,o=a.length===0?i:`At path: ${a.join(".")} -- ${i}`;super(s??o),s!=null&&(this.cause=o),Object.assign(this,c),this.name=this.constructor.name,this.failures=()=>n??(n=[e,...r()])}}function $r(t){return K(t)&&typeof t[Symbol.iterator]=="function"}function K(t){return typeof t=="object"&&t!=null}function J(t){return typeof t=="symbol"?t.toString():typeof t=="string"?JSON.stringify(t):`${t}`}function Ur(t){const{done:e,value:r}=t.next();return e?void 0:r}function Pr(t,e,r,n){if(t===!0)return;t===!1?t={}:typeof t=="string"&&(t={message:t});const{path:i,branch:s}=e,{type:c}=r,{refinement:a,message:o=`Expected a value of type \`${c}\`${a?` with refinement \`${a}\``:""}, but received: \`${J(n)}\``}=t;return{value:n,type:c,refinement:a,key:i[i.length-1],path:i,branch:s,...t,message:o}}function*Lt(t,e,r,n){$r(t)||(t=[t]);for(const i of t){const s=Pr(i,e,r,n);s&&(yield s)}}function*lt(t,e,r={}){const{path:n=[],branch:i=[t],coerce:s=!1,mask:c=!1}=r,a={path:n,branch:i};if(s&&(t=e.coercer(t,a),c&&e.type!=="type"&&K(e.schema)&&K(t)&&!Array.isArray(t)))for(const d in t)e.schema[d]===void 0&&delete t[d];let o="valid";for(const d of e.validator(t,a))d.explanation=r.message,o="not_valid",yield[d,void 0];for(let[d,u,g]of e.entries(t,a)){const m=lt(u,g,{path:d===void 0?n:[...n,d],branch:d===void 0?i:[...i,u],coerce:s,mask:c,message:r.message});for(const y of m)y[0]?(o=y[0].refinement!=null?"not_refined":"not_valid",yield[y[0],void 0]):s&&(u=y[1],d===void 0?t=u:t instanceof Map?t.set(d,u):t instanceof Set?t.add(u):K(t)&&(u!==void 0||d in t)&&(t[d]=u))}if(o!=="not_valid")for(const d of e.refiner(t,a))d.explanation=r.message,o="not_refined",yield[d,void 0];o==="valid"&&(yield[void 0,t])}class te{constructor(e){const{type:r,schema:n,validator:i,refiner:s,coercer:c=o=>o,entries:a=function*(){}}=e;this.type=r,this.schema=n,this.entries=a,this.coercer=c,i?this.validator=(o,d)=>{const u=i(o,d);return Lt(u,d,this,o)}:this.validator=()=>[],s?this.refiner=(o,d)=>{const u=s(o,d);return Lt(u,d,this,o)}:this.refiner=()=>[]}assert(e,r){return nt(e,this,r)}create(e,r){return Xt(e,this,r)}is(e){return L(e,this)}mask(e,r){return Zt(e,this,r)}validate(e,r={}){return _e(e,this,r)}}function nt(t,e,r){const n=_e(t,e,{message:r});if(n[0])throw n[0]}function Xt(t,e,r){const n=_e(t,e,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function Zt(t,e,r){const n=_e(t,e,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function L(t,e){return!_e(t,e)[0]}function _e(t,e,r={}){const n=lt(t,e,r),i=Ur(n);return i[0]?[new Cr(i[0],function*(){for(const c of n)c[0]&&(yield c[0])}),void 0]:[void 0,i[1]]}function je(...t){const e=t[0].type==="type",r=t.map(i=>i.schema),n=Object.assign({},...r);return e?Rr(n):p(n)}function W(t,e){return new te({type:t,schema:null,validator:e})}function it(){return W("any",()=>!0)}function E(t){return new te({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(const[r,n]of e.entries())yield[r,n,t]},coercer(e){return Array.isArray(e)?e.slice():e},validator(e){return Array.isArray(e)||`Expected an array value, but received: ${J(e)}`}})}function Mr(){return W("bigint",t=>typeof t=="bigint")}function z(){return W("boolean",t=>typeof t=="boolean")}function ee(){return W("integer",t=>typeof t=="number"&&!isNaN(t)&&Number.isInteger(t)||`Expected an integer, but received: ${J(t)}`)}function k(t){const e=J(t),r=typeof t;return new te({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?t:null,validator(n){return n===t||`Expected the literal \`${e}\`, but received: ${J(n)}`}})}function Yt(){return W("never",()=>!1)}function $(t){return new te({...t,validator:(e,r)=>e===null||t.validator(e,r),refiner:(e,r)=>e===null||t.refiner(e,r)})}function he(){return W("number",t=>typeof t=="number"&&!isNaN(t)||`Expected a number, but received: ${J(t)}`)}function p(t){const e=t?Object.keys(t):[],r=Yt();return new te({type:"object",schema:t||null,*entries(n){if(t&&K(n)){const i=new Set(Object.keys(n));for(const s of e)i.delete(s),yield[s,n[s],t[s]];for(const s of i)yield[s,n[s],r]}},validator(n){return K(n)||`Expected an object, but received: ${J(n)}`},coercer(n){return K(n)?{...n}:n}})}function v(t){return new te({...t,validator:(e,r)=>e===void 0||t.validator(e,r),refiner:(e,r)=>e===void 0||t.refiner(e,r)})}function Q(t,e){return new te({type:"record",schema:null,*entries(r){if(K(r))for(const n in r){const i=r[n];yield[n,n,t],yield[n,i,e]}},validator(r){return K(r)||`Expected an object, but received: ${J(r)}`}})}function h(){return W("string",t=>typeof t=="string"||`Expected a string, but received: ${J(t)}`)}function Qt(t){const e=Yt();return new te({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(t.length,r.length);for(let i=0;i<n;i++)yield[i,r[i],t[i]||e]}},validator(r){return Array.isArray(r)||`Expected an array, but received: ${J(r)}`}})}function Rr(t){const e=Object.keys(t);return new te({type:"type",schema:t,*entries(r){if(K(r))for(const n of e)yield[n,r[n],t[n]]},validator(r){return K(r)||`Expected an object, but received: ${J(r)}`},coercer(r){return K(r)?{...r}:r}})}function P(t){const e=t.map(r=>r.type).join(" | ");return new te({type:"union",schema:null,coercer(r){for(const n of t){const[i,s]=n.validate(r,{coerce:!0});if(!i)return s}return r},validator(r,n){const i=[];for(const s of t){const[...c]=lt(r,s,n),[a]=c;if(a[0])for(const[o]of c)o&&i.push(o);else return[]}return[`Expected the value to satisfy a union of \`${e}\`, but received: ${J(r)}`,...i]}})}function er(){return W("unknown",()=>!0)}const ft=P([p({AddressOwner:h()}),p({ObjectOwner:h()}),p({Shared:p({initial_shared_version:$(h())})}),k("Immutable")]);W("SuiJsonValue",()=>!0);const Nr=P([p({u32:h()}),p({u64:h()}),p({f64:h()})]);p({attributes:Q(h(),$(Nr)),featureFlags:Q(h(),z()),maxSupportedProtocolVersion:h(),minSupportedProtocolVersion:h(),protocolVersion:h()});P([h(),k("package")]);const ce=p({digest:h(),objectId:h(),version:P([he(),h(),Mr()])});p({owner:ft,reference:ce});p({objectId:h(),sequenceNumber:h()});p({payment:E(ce),owner:h(),price:h(),budget:h()});const Dr=je(ce,p({type:h(),owner:ft,previousTransaction:h()})),Vr=Q(h(),it()),zr=Q(h(),er()),Fr=p({type:h(),fields:Vr,hasPublicTransfer:z()}),Gr=p({disassembled:zr}),Lr=P([je(Fr,p({dataType:k("moveObject")})),je(Gr,p({dataType:k("package")}))]),Wr=p({type:h(),hasPublicTransfer:z(),version:h(),bcsBytes:h()}),Kr=p({id:h(),moduleMap:Q(h(),h())}),Jr=P([je(Wr,p({dataType:k("moveObject")})),je(Kr,p({dataType:k("package")}))]);BigInt(1e9);const tr=p({code:h(),error:v(h()),object_id:v(h()),parent_object_id:v(h()),version:v(h()),digest:v(h())}),Hr=p({data:$(v(Q(h(),h()))),error:$(v(tr))}),qr=P([Hr,v(Q(h(),h()))]),rr=p({objectId:h(),version:h(),digest:h(),type:$(v(h())),content:$(v(Lr)),bcs:$(v(Jr)),owner:$(v(ft)),previousTransaction:$(v(h())),storageRebate:$(v(h())),display:$(v(qr))});p({showType:$(v(z())),showContent:$(v(z())),showBcs:$(v(z())),showOwner:$(v(z())),showPreviousTransaction:$(v(z())),showStorageRebate:$(v(z())),showDisplay:$(v(z()))});P([k("Exists"),k("notExists"),k("Deleted")]);E(Dr);const Xr=p({data:$(v(rr)),error:$(v(tr))});function Zr(t){return t.data}function Yr(t){if(t.error&&"object_id"in t.error&&"version"in t.error&&"digest"in t.error){const e=t.error;return{objectId:e.object_id,version:e.version,digest:e.digest}}}function Wt(t){if("reference"in t)return t.reference;const e=Zr(t);return e?{objectId:e.objectId,version:e.version,digest:e.digest}:Yr(t)}p({objectId:h(),atCheckpoint:v(he())});p({data:E(Xr),nextCursor:v($(h())),hasNextPage:z()});P([p({details:rr,status:k("VersionFound")}),p({details:h(),status:k("ObjectNotExists")}),p({details:ce,status:k("ObjectDeleted")}),p({details:Qt([h(),he()]),status:k("VersionNotFound")}),p({details:p({asked_version:he(),latest_version:he(),object_id:h()}),status:k("VersionTooHigh")})]);const Qr=P([h(),p({Object:h()})]);E(Qr);const en=p({address:h(),name:h()}),tn=P([k("Private"),k("Public"),k("Friend")]),ht=p({abilities:E(h())}),rn=p({constraints:ht,isPhantom:z()}),nn=p({TypeParameter:he()}),Xe=Qt([p({module:h(),package:h(),function:h()}),h()]);p({rank3Days:E(Xe),rank7Days:E(Xe),rank30Days:E(Xe)});function nr(t){if(!t)return!1;if(typeof t=="string"||L(t,nn)||ir(t))return!0;if(typeof t!="object")return!1;const e=t;return!!(L(e.Reference,me)||L(e.MutableReference,me)||L(e.Vector,me))}const me=W("SuiMoveNormalizedType",nr);function ir(t){if(!t||typeof t!="object")return!1;const e=t;if(!e.Struct||typeof e.Struct!="object")return!1;const r=e.Struct;return!(typeof r.address!="string"||typeof r.module!="string"||typeof r.name!="string"||!Array.isArray(r.typeArguments)||!r.typeArguments.every(n=>nr(n)))}W("SuiMoveNormalizedStructType",ir);const sn=p({visibility:tn,isEntry:z(),typeParameters:E(ht),parameters:E(me),return:E(me)}),an=p({name:h(),type:me}),on=p({abilities:ht,typeParameters:E(rn),fields:E(an)}),cn=p({fileFormatVersion:he(),address:h(),name:h(),friends:E(en),structs:Q(h(),on),exposedFunctions:Q(h(),sn)});Q(h(),cn);function st(t){return typeof t=="object"&&"MutableReference"in t?t.MutableReference:void 0}function sr(t){return typeof t=="object"&&"Reference"in t?t.Reference:void 0}function gt(t){if(typeof t=="object"&&"Struct"in t)return t;const e=sr(t),r=st(t);if(typeof e=="object"&&"Struct"in e)return e;if(typeof r=="object"&&"Struct"in r)return r}function un(t){if(t.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),r=0;r<e.length;r++)e[r]=255;for(var n=0;n<t.length;n++){var i=t.charAt(n),s=i.charCodeAt(0);if(e[s]!==255)throw new TypeError(i+" is ambiguous");e[s]=n}var c=t.length,a=t.charAt(0),o=Math.log(c)/Math.log(256),d=Math.log(256)/Math.log(c);function u(y){if(y instanceof Uint8Array||(ArrayBuffer.isView(y)?y=new Uint8Array(y.buffer,y.byteOffset,y.byteLength):Array.isArray(y)&&(y=Uint8Array.from(y))),!(y instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(y.length===0)return"";for(var S=0,T=0,f=0,O=y.length;f!==O&&y[f]===0;)f++,S++;for(var B=(O-f)*d+1>>>0,M=new Uint8Array(B);f!==O;){for(var A=y[f],j=0,R=B-1;(A!==0||j<T)&&R!==-1;R--,j++)A+=256*M[R]>>>0,M[R]=A%c>>>0,A=A/c>>>0;if(A!==0)throw new Error("Non-zero carry");T=j,f++}for(var H=B-T;H!==B&&M[H]===0;)H++;for(var pe=a.repeat(S);H<B;++H)pe+=t.charAt(M[H]);return pe}function g(y){if(typeof y!="string")throw new TypeError("Expected String");if(y.length===0)return new Uint8Array;for(var S=0,T=0,f=0;y[S]===a;)T++,S++;for(var O=(y.length-S)*o+1>>>0,B=new Uint8Array(O);y[S];){var M=e[y.charCodeAt(S)];if(M===255)return;for(var A=0,j=O-1;(M!==0||A<f)&&j!==-1;j--,A++)M+=c*B[j]>>>0,B[j]=M%256>>>0,M=M/256>>>0;if(M!==0)throw new Error("Non-zero carry");f=A,S++}for(var R=O-f;R!==O&&B[R]===0;)R++;for(var H=new Uint8Array(T+(O-R)),pe=T;R!==O;)H[pe++]=B[R++];return H}function m(y){var S=g(y);if(S)return S;throw new Error("Non-base"+c+" character")}return{encode:u,decodeUnsafe:g,decode:m}}var dn=un;const ln=dn,fn="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";var hn=ln(fn);const ar=w.getDefaultExportFromCjs(hn),xe=t=>ar.encode(t),pt=t=>ar.decode(t);function ue(t){return Uint8Array.from(atob(t),e=>e.charCodeAt(0))}const Ze=8192;function Be(t){if(t.length<Ze)return btoa(String.fromCharCode(...t));let e="";for(var r=0;r<t.length;r+=Ze){const n=t.slice(r,r+Ze);e+=String.fromCharCode(...n)}return btoa(e)}function Je(t){var i;const e=t.startsWith("0x")?t.slice(2):t,n=((i=(e.length%2===0?e:`0${e}}`).match(/.{2}/g))==null?void 0:i.map(s=>parseInt(s,16)))??[];return Uint8Array.from(n)}function Ce(t){return t.reduce((e,r)=>e+r.toString(16).padStart(2,"0"),"")}function yt(t){let e=[],r=0;if(t===0)return[0];for(;t>0;)e[r]=t&127,(t>>=7)&&(e[r]|=128),r+=1;return e}function gn(t){let e=0,r=0,n=0;for(;;){let i=t[n];if(n+=1,e|=(i&127)<<r,!(i&128))break;r+=7}return{value:e,length:n}}class or{constructor(e){this.bytePosition=0,this.dataView=new DataView(e.buffer)}shift(e){return this.bytePosition+=e,this}read8(){let e=this.dataView.getUint8(this.bytePosition);return this.shift(1),e}read16(){let e=this.dataView.getUint16(this.bytePosition,!0);return this.shift(2),e}read32(){let e=this.dataView.getUint32(this.bytePosition,!0);return this.shift(4),e}read64(){let e=this.read32(),n=this.read32().toString(16)+e.toString(16).padStart(8,"0");return BigInt("0x"+n).toString(10)}read128(){let e=BigInt(this.read64()),n=BigInt(this.read64()).toString(16)+e.toString(16).padStart(16,"0");return BigInt("0x"+n).toString(10)}read256(){let e=BigInt(this.read128()),n=BigInt(this.read128()).toString(16)+e.toString(16).padStart(32,"0");return BigInt("0x"+n).toString(10)}readBytes(e){let r=this.bytePosition+this.dataView.byteOffset,n=new Uint8Array(this.dataView.buffer,r,e);return this.shift(e),n}readULEB(){let e=this.bytePosition+this.dataView.byteOffset,r=new Uint8Array(this.dataView.buffer,e),{value:n,length:i}=gn(r);return this.shift(i),n}readVec(e){let r=this.readULEB(),n=[];for(let i=0;i<r;i++)n.push(e(this,i,r));return n}}function pn(t,e){switch(e){case"base58":return xe(t);case"base64":return Be(t);case"hex":return Ce(t);default:throw new Error("Unsupported encoding, supported values are: base64, hex")}}function yn(t,e){switch(e){case"base58":return pt(t);case"base64":return ue(t);case"hex":return Je(t);default:throw new Error("Unsupported encoding, supported values are: base64, hex")}}function mt(t,e=["<",">"]){const[r,n]=e,i=[];let s="",c=0;for(let a=0;a<t.length;a++){const o=t[a];if(o===r&&c++,o===n&&c--,c===0&&o===","){i.push(s.trim()),s="";continue}s+=o}return i.push(s.trim()),i}class cr{constructor({size:e=1024,maxSize:r,allocateSize:n=1024}={}){this.bytePosition=0,this.size=e,this.maxSize=r||e,this.allocateSize=n,this.dataView=new DataView(new ArrayBuffer(e))}ensureSizeOrGrow(e){const r=this.bytePosition+e;if(r>this.size){const n=Math.min(this.maxSize,this.size+this.allocateSize);if(r>n)throw new Error(`Attempting to serialize to BCS, but buffer does not have enough size. Allocated size: ${this.size}, Max size: ${this.maxSize}, Required size: ${r}`);this.size=n;const i=new ArrayBuffer(this.size);new Uint8Array(i).set(new Uint8Array(this.dataView.buffer)),this.dataView=new DataView(i)}}shift(e){return this.bytePosition+=e,this}write8(e){return this.ensureSizeOrGrow(1),this.dataView.setUint8(this.bytePosition,Number(e)),this.shift(1)}write16(e){return this.ensureSizeOrGrow(2),this.dataView.setUint16(this.bytePosition,Number(e),!0),this.shift(2)}write32(e){return this.ensureSizeOrGrow(4),this.dataView.setUint32(this.bytePosition,Number(e),!0),this.shift(4)}write64(e){return Ye(BigInt(e),8).forEach(r=>this.write8(r)),this}write128(e){return Ye(BigInt(e),16).forEach(r=>this.write8(r)),this}write256(e){return Ye(BigInt(e),32).forEach(r=>this.write8(r)),this}writeULEB(e){return yt(e).forEach(r=>this.write8(r)),this}writeVec(e,r){return this.writeULEB(e.length),Array.from(e).forEach((n,i)=>r(this,n,i,e.length)),this}*[Symbol.iterator](){for(let e=0;e<this.bytePosition;e++)yield this.dataView.getUint8(e);return this.toBytes()}toBytes(){return new Uint8Array(this.dataView.buffer.slice(0,this.bytePosition))}toString(e){return pn(this.toBytes(),e)}}function Ye(t,e){let r=new Uint8Array(e),n=0;for(;t>0;)r[n]=Number(t%BigInt(256)),t=t/BigInt(256),n+=1;return r}var ur=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)},X=(t,e,r)=>(ur(t,e,"read from private field"),r?r.call(t):e.get(t)),ze=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},Fe=(t,e,r,n)=>(ur(t,e,"write to private field"),e.set(t,r),r),ye,Se,Me,ae;const dr=class{constructor(t){ze(this,ye,void 0),ze(this,Se,void 0),this.name=t.name,this.read=t.read,this.serializedSize=t.serializedSize??(()=>null),Fe(this,ye,t.write),Fe(this,Se,t.serialize??((e,r)=>{const n=new cr({size:this.serializedSize(e)??void 0,...r});return X(this,ye).call(this,e,n),n.toBytes()})),this.validate=t.validate??(()=>{})}write(t,e){this.validate(t),X(this,ye).call(this,t,e)}serialize(t,e){return this.validate(t),new mn(this,X(this,Se).call(this,t,e))}parse(t){const e=new or(t);return this.read(e)}transform({name:t,input:e,output:r}){return new dr({name:t??this.name,read:n=>r(this.read(n)),write:(n,i)=>X(this,ye).call(this,e(n),i),serializedSize:n=>this.serializedSize(e(n)),serialize:(n,i)=>X(this,Se).call(this,e(n),i),validate:n=>this.validate(e(n))})}};let Z=dr;ye=new WeakMap;Se=new WeakMap;const lr=Symbol.for("@mysten/serialized-bcs");function wt(t){return!!t&&typeof t=="object"&&t[lr]===!0}class mn{constructor(e,r){ze(this,Me,void 0),ze(this,ae,void 0),Fe(this,Me,e),Fe(this,ae,r)}get[lr](){return!0}toBytes(){return X(this,ae)}toHex(){return Ce(X(this,ae))}toBase64(){return Be(X(this,ae))}toBase58(){return xe(X(this,ae))}parse(){return X(this,Me).parse(X(this,ae))}}Me=new WeakMap;ae=new WeakMap;function Ge({size:t,...e}){return new Z({...e,serializedSize:()=>t})}function Qe({readMethod:t,writeMethod:e,...r}){return Ge({...r,read:n=>n[t](),write:(n,i)=>i[e](n),validate:n=>{var i;if(n<0||n>r.maxValue)throw new TypeError(`Invalid ${r.name} value: ${n}. Expected value in range 0-${r.maxValue}`);(i=r.validate)==null||i.call(r,n)}})}function et({readMethod:t,writeMethod:e,...r}){return Ge({...r,read:n=>n[t](),write:(n,i)=>i[e](BigInt(n)),validate:n=>{var s;const i=BigInt(n);if(i<0||i>r.maxValue)throw new TypeError(`Invalid ${r.name} value: ${i}. Expected value in range 0-${r.maxValue}`);(s=r.validate)==null||s.call(r,i)}})}function wn({serialize:t,...e}){const r=new Z({...e,serialize:t,write:(n,i)=>{for(const s of r.serialize(n).toBytes())i.write8(s)}});return r}function bn({toBytes:t,fromBytes:e,...r}){return new Z({...r,read:n=>{const i=n.readULEB(),s=n.readBytes(i);return e(s)},write:(n,i)=>{const s=t(n);i.writeULEB(s.length);for(let c=0;c<s.length;c++)i.write8(s[c])},serialize:n=>{const i=t(n),s=yt(i.length),c=new Uint8Array(s.length+i.length);return c.set(s,0),c.set(i,s.length),c},validate:n=>{var i;if(typeof n!="string")throw new TypeError(`Invalid ${r.name} value: ${n}. Expected string`);(i=r.validate)==null||i.call(r,n)}})}function Sn(t){let e=null;function r(){return e||(e=t()),e}return new Z({name:"lazy",read:n=>r().read(n),serializedSize:n=>r().serializedSize(n),write:(n,i)=>r().write(n,i),serialize:(n,i)=>r().serialize(n,i).toBytes()})}const l={u8(t){return Qe({name:"u8",readMethod:"read8",writeMethod:"write8",size:1,maxValue:2**8-1,...t})},u16(t){return Qe({name:"u16",readMethod:"read16",writeMethod:"write16",size:2,maxValue:2**16-1,...t})},u32(t){return Qe({name:"u32",readMethod:"read32",writeMethod:"write32",size:4,maxValue:2**32-1,...t})},u64(t){return et({name:"u64",readMethod:"read64",writeMethod:"write64",size:8,maxValue:2n**64n-1n,...t})},u128(t){return et({name:"u128",readMethod:"read128",writeMethod:"write128",size:16,maxValue:2n**128n-1n,...t})},u256(t){return et({name:"u256",readMethod:"read256",writeMethod:"write256",size:32,maxValue:2n**256n-1n,...t})},bool(t){return Ge({name:"bool",size:1,read:e=>e.read8()===1,write:(e,r)=>r.write8(e?1:0),...t,validate:e=>{var r;if((r=t==null?void 0:t.validate)==null||r.call(t,e),typeof e!="boolean")throw new TypeError(`Expected boolean, found ${typeof e}`)}})},uleb128(t){return wn({name:"uleb128",read:e=>e.readULEB(),serialize:e=>Uint8Array.from(yt(e)),...t})},bytes(t,e){return Ge({name:`bytes[${t}]`,size:t,read:r=>r.readBytes(t),write:(r,n)=>{for(let i=0;i<t;i++)n.write8(r[i]??0)},...e,validate:r=>{var n;if((n=e==null?void 0:e.validate)==null||n.call(e,r),!("length"in r))throw new TypeError(`Expected array, found ${typeof r}`);if(r.length!==t)throw new TypeError(`Expected array of length ${t}, found ${r.length}`)}})},string(t){return bn({name:"string",toBytes:e=>new TextEncoder().encode(e),fromBytes:e=>new TextDecoder().decode(e),...t})},fixedArray(t,e,r){return new Z({name:`${e.name}[${t}]`,read:n=>{const i=new Array(t);for(let s=0;s<t;s++)i[s]=e.read(n);return i},write:(n,i)=>{for(const s of n)e.write(s,i)},...r,validate:n=>{var i;if((i=r==null?void 0:r.validate)==null||i.call(r,n),!("length"in n))throw new TypeError(`Expected array, found ${typeof n}`);if(n.length!==t)throw new TypeError(`Expected array of length ${t}, found ${n.length}`)}})},option(t){return l.enum(`Option<${t.name}>`,{None:null,Some:t}).transform({input:e=>e==null?{None:!0}:{Some:e},output:e=>"Some"in e?e.Some:null})},vector(t,e){return new Z({name:`vector<${t.name}>`,read:r=>{const n=r.readULEB(),i=new Array(n);for(let s=0;s<n;s++)i[s]=t.read(r);return i},write:(r,n)=>{n.writeULEB(r.length);for(const i of r)t.write(i,n)},...e,validate:r=>{var n;if((n=e==null?void 0:e.validate)==null||n.call(e,r),!("length"in r))throw new TypeError(`Expected array, found ${typeof r}`)}})},tuple(t,e){return new Z({name:`(${t.map(r=>r.name).join(", ")})`,serializedSize:r=>{let n=0;for(let i=0;i<t.length;i++){const s=t[i].serializedSize(r[i]);if(s==null)return null;n+=s}return n},read:r=>{const n=[];for(const i of t)n.push(i.read(r));return n},write:(r,n)=>{for(let i=0;i<t.length;i++)t[i].write(r[i],n)},...e,validate:r=>{var n;if((n=e==null?void 0:e.validate)==null||n.call(e,r),!Array.isArray(r))throw new TypeError(`Expected array, found ${typeof r}`);if(r.length!==t.length)throw new TypeError(`Expected array of length ${t.length}, found ${r.length}`)}})},struct(t,e,r){const n=Object.entries(e);return new Z({name:t,serializedSize:i=>{let s=0;for(const[c,a]of n){const o=a.serializedSize(i[c]);if(o==null)return null;s+=o}return s},read:i=>{const s={};for(const[c,a]of n)s[c]=a.read(i);return s},write:(i,s)=>{for(const[c,a]of n)a.write(i[c],s)},...r,validate:i=>{var s;if((s=r==null?void 0:r.validate)==null||s.call(r,i),typeof i!="object"||i==null)throw new TypeError(`Expected object, found ${typeof i}`)}})},enum(t,e,r){const n=Object.entries(e);return new Z({name:t,read:i=>{const s=i.readULEB(),[c,a]=n[s];return{[c]:(a==null?void 0:a.read(i))??!0}},write:(i,s)=>{const[c,a]=Object.entries(i)[0];for(let o=0;o<n.length;o++){const[d,u]=n[o];if(d===c){s.writeULEB(o),u==null||u.write(a,s);return}}},...r,validate:i=>{var a;if((a=r==null?void 0:r.validate)==null||a.call(r,i),typeof i!="object"||i==null)throw new TypeError(`Expected object, found ${typeof i}`);const s=Object.keys(i);if(s.length!==1)throw new TypeError(`Expected object with one key, found ${s.length}`);const[c]=s;if(!Object.hasOwn(e,c))throw new TypeError(`Invalid enum variant ${c}`)}})},map(t,e){return l.vector(l.tuple([t,e])).transform({name:`Map<${t.name}, ${e.name}>`,input:r=>[...r.entries()],output:r=>{const n=new Map;for(const[i,s]of r)n.set(i,s);return n}})},generic(t,e){return(...r)=>e(...r).transform({name:`${e.name}<${r.map(n=>n.name).join(", ")}>`,input:n=>n,output:n=>n})},lazy(t){return Sn(t)}},Tn=32,Te=class{constructor(t){if(this.types=new Map,this.counter=0,t instanceof Te){this.schema=t.schema,this.types=new Map(t.types);return}if(this.schema=t,this.registerAddressType(Te.ADDRESS,t.addressLength,t.addressEncoding),this.registerVectorType(t.vectorType),t.types&&t.types.structs)for(let e of Object.keys(t.types.structs))this.registerStructType(e,t.types.structs[e]);if(t.types&&t.types.enums)for(let e of Object.keys(t.types.enums))this.registerEnumType(e,t.types.enums[e]);if(t.types&&t.types.aliases)for(let e of Object.keys(t.types.aliases))this.registerAlias(e,t.types.aliases[e]);t.withPrimitives!==!1&&vn(this)}tempKey(){return`bcs-struct-${++this.counter}`}ser(t,e,r){if(typeof t=="string"||Array.isArray(t)){const{name:n,params:i}=this.parseTypeName(t);return this.getTypeInterface(n).encode(this,e,r,i)}if(typeof t=="object"){const n=this.tempKey();return new Te(this).registerStructType(n,t).ser(n,e,r)}throw new Error(`Incorrect type passed into the '.ser()' function.
|
|
2
2
|
${JSON.stringify(t)}`)}de(t,e,r){if(typeof e=="string")if(r)e=yn(e,r);else throw new Error("To pass a string to `bcs.de`, specify encoding");if(typeof t=="string"||Array.isArray(t)){const{name:n,params:i}=this.parseTypeName(t);return this.getTypeInterface(n).decode(this,e,i)}if(typeof t=="object"){const n=new Te(this),i=this.tempKey();return n.registerStructType(i,t).de(i,e,r)}throw new Error(`Incorrect type passed into the '.de()' function.
|
|
3
3
|
${JSON.stringify(t)}`)}hasType(t){return this.types.has(t)}registerAlias(t,e){return this.types.set(t,e),this}registerType(t,e,r,n=()=>!0){const{name:i,params:s}=this.parseTypeName(t);return this.types.set(i,{encode(c,a,o,d){const u=s.reduce((g,m,y)=>Object.assign(g,{[m]:d[y]}),{});return this._encodeRaw.call(c,new cr(o),a,d,u)},decode(c,a,o){const d=s.reduce((u,g,m)=>Object.assign(u,{[g]:o[m]}),{});return this._decodeRaw.call(c,new or(a),o,d)},_encodeRaw(c,a,o,d){if(n(a))return e.call(this,c,a,o,d);throw new Error(`Validation failed for type ${i}, data: ${a}`)},_decodeRaw(c,a,o){return r.call(this,c,a,o)}}),this}registerBcsType(t,e){return this.registerType(t,(r,n,i)=>{const s=i.map(c=>new Z({name:String(c),write:(a,o)=>{const{name:d,params:u}=this.parseTypeName(c),g=this.getTypeInterface(d),m=u.reduce((y,S,T)=>Object.assign(y,{[S]:i[T]}),{});return g._encodeRaw.call(this,o,a,u,m)},read:()=>{throw new Error("Not implemented")}}));return e(...s).write(n,r),r},(r,n)=>{const i=n.map(s=>new Z({name:String(s),write:(c,a)=>{throw new Error("Not implemented")},read:c=>{const{name:a,params:o}=this.parseTypeName(s),d=this.getTypeInterface(a),u=o.reduce((g,m,y)=>Object.assign(g,{[m]:n[y]}),{});return d._decodeRaw.call(this,c,o,u)}}));return e(...i).read(r)}),this}registerAddressType(t,e,r="hex"){switch(r){case"base64":return this.registerType(t,function(i,s){return ue(s).reduce((c,a)=>c.write8(a),i)},function(i){return Be(i.readBytes(e))});case"hex":return this.registerType(t,function(i,s){return Je(s).reduce((c,a)=>c.write8(a),i)},function(i){return Ce(i.readBytes(e))});default:throw new Error("Unsupported encoding! Use either hex or base64")}}registerVectorType(t){let{name:e,params:r}=this.parseTypeName(t);if(r.length>1)throw new Error("Vector can have only one type parameter; got "+e);return this.registerType(t,function(i,s,c,a){return i.writeVec(s,(o,d)=>{let u=c[0];if(!u)throw new Error(`Incorrect number of type parameters passed a to vector '${t}'`);let{name:g,params:m}=this.parseTypeName(u);if(this.hasType(g))return this.getTypeInterface(g)._encodeRaw.call(this,o,d,m,a);if(!(g in a))throw new Error(`Unable to find a matching type definition for ${g} in vector; make sure you passed a generic`);let{name:y,params:S}=this.parseTypeName(a[g]);return this.getTypeInterface(y)._encodeRaw.call(this,o,d,S,a)})},function(i,s,c){return i.readVec(a=>{let o=s[0];if(!o)throw new Error(`Incorrect number of type parameters passed to a vector '${t}'`);let{name:d,params:u}=this.parseTypeName(o);if(this.hasType(d))return this.getTypeInterface(d)._decodeRaw.call(this,a,u,c);if(!(d in c))throw new Error(`Unable to find a matching type definition for ${d} in vector; make sure you passed a generic`);let{name:g,params:m}=this.parseTypeName(c[d]);return this.getTypeInterface(g)._decodeRaw.call(this,a,m,c)})})}registerStructType(t,e){for(let c in e){let a=this.tempKey(),o=e[c];!Array.isArray(o)&&typeof o!="string"&&(e[c]=a,this.registerStructType(a,o))}let r=Object.freeze(e),n=Object.keys(r),{name:i,params:s}=this.parseTypeName(t);return this.registerType(t,function(a,o,d,u){if(!o||o.constructor!==Object)throw new Error(`Expected ${i} to be an Object, got: ${o}`);if(d.length!==s.length)throw new Error(`Incorrect number of generic parameters passed; expected: ${s.length}, got: ${d.length}`);for(let g of n){if(!(g in o))throw new Error(`Struct ${i} requires field ${g}:${r[g]}`);const{name:m,params:y}=this.parseTypeName(r[g]);if(!s.includes(m))this.getTypeInterface(m)._encodeRaw.call(this,a,o[g],y,u);else{const S=s.indexOf(m);let{name:T,params:f}=this.parseTypeName(d[S]);if(this.hasType(T)){this.getTypeInterface(T)._encodeRaw.call(this,a,o[g],f,u);continue}if(!(T in u))throw new Error(`Unable to find a matching type definition for ${T} in ${i}; make sure you passed a generic`);let{name:O,params:B}=this.parseTypeName(u[T]);this.getTypeInterface(O)._encodeRaw.call(this,a,o[g],B,u)}}return a},function(a,o,d){if(o.length!==s.length)throw new Error(`Incorrect number of generic parameters passed; expected: ${s.length}, got: ${o.length}`);let u={};for(let g of n){const{name:m,params:y}=this.parseTypeName(r[g]);if(!s.includes(m))u[g]=this.getTypeInterface(m)._decodeRaw.call(this,a,y,d);else{const S=s.indexOf(m);let{name:T,params:f}=this.parseTypeName(o[S]);if(this.hasType(T)){u[g]=this.getTypeInterface(T)._decodeRaw.call(this,a,f,d);continue}if(!(T in d))throw new Error(`Unable to find a matching type definition for ${T} in ${i}; make sure you passed a generic`);let{name:O,params:B}=this.parseTypeName(d[T]);u[g]=this.getTypeInterface(O)._decodeRaw.call(this,a,B,d)}}return u})}registerEnumType(t,e){for(let c in e){let a=this.tempKey(),o=e[c];o!==null&&!Array.isArray(o)&&typeof o!="string"&&(e[c]=a,this.registerStructType(a,o))}let r=Object.freeze(e),n=Object.keys(r),{name:i,params:s}=this.parseTypeName(t);return this.registerType(t,function(a,o,d,u){if(!o)throw new Error(`Unable to write enum "${i}", missing data.
|
|
4
4
|
Received: "${o}"`);if(typeof o!="object")throw new Error(`Incorrect data passed into enum "${i}", expected object with properties: "${n.join(" | ")}".
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { bw as f, bx as s, by as t, bz as c, bA as d, bB as A, aX as o, bC as O, bD as b } from "./index-
|
|
1
|
+
import { bw as f, bx as s, by as t, bz as c, bA as d, bB as A, aX as o, bC as O, bD as b } from "./index-CjwA7HmM.mjs";
|
|
2
2
|
class p extends Error {
|
|
3
3
|
constructor(r) {
|
|
4
4
|
super(r);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var J = Object.defineProperty;
|
|
2
2
|
var K = (n, f, e) => f in n ? J(n, f, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[f] = e;
|
|
3
3
|
var d = (n, f, e) => K(n, typeof f != "symbol" ? f + "" : f, e);
|
|
4
|
-
import { ar as y, bS as f0, bT as z, bU as p, bV as e0, bW as a0, bX as t0, bY as _, bZ as b0, b_ as n0, b$ as d0, aj as L, c0 as O, E as v, a as C, c1 as D, u as U, bL as u, c2 as H, c3 as c0, c4 as N, bP as q, bQ as j, a8 as s0, c5 as i0, c6 as I, bE as S, aA as $, bR as V, _ as Q } from "./index-
|
|
5
|
-
import "./index-
|
|
4
|
+
import { ar as y, bS as f0, bT as z, bU as p, bV as e0, bW as a0, bX as t0, bY as _, bZ as b0, b_ as n0, b$ as d0, aj as L, c0 as O, E as v, a as C, c1 as D, u as U, bL as u, c2 as H, c3 as c0, c4 as N, bP as q, bQ as j, a8 as s0, c5 as i0, c6 as I, bE as S, aA as $, bR as V, _ as Q } from "./index-CjwA7HmM.mjs";
|
|
5
|
+
import "./index-DIddLRbN.mjs";
|
|
6
6
|
const r0 = new RegExp("^bytes([0-9]+)$"), p0 = new RegExp("^(u?int)([0-9]*)$"), y0 = new RegExp("^(.*)\\[([0-9]*)\\]$");
|
|
7
7
|
function X(n, f, e) {
|
|
8
8
|
switch (n) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
var b = Object.defineProperty;
|
|
2
2
|
var W = (h, t, e) => t in h ? b(h, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : h[t] = e;
|
|
3
3
|
var c = (h, t, e) => W(h, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
-
import "./index-
|
|
5
|
-
import { C as p, G as v } from "./cosmwasm-
|
|
6
|
-
import { b as o, c as g, C as x } from "./unsignedTransaction-
|
|
7
|
-
import { p as u, N as d, a8 as B, ce as S, a3 as a, c8 as E, c9 as q, bM as y, bR as I, a9 as D } from "./index-
|
|
4
|
+
import "./index-CTwzW64I.mjs";
|
|
5
|
+
import { C as p, G as v } from "./cosmwasm-DvwgrLe6.mjs";
|
|
6
|
+
import { b as o, c as g, C as x } from "./unsignedTransaction-BWLDqwPd.mjs";
|
|
7
|
+
import { p as u, N as d, a8 as B, ce as S, a3 as a, c8 as E, c9 as q, bM as y, bR as I, a9 as D } from "./index-CjwA7HmM.mjs";
|
|
8
8
|
class k {
|
|
9
9
|
constructor(t, e, r, s) {
|
|
10
10
|
c(this, "network");
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var se = Object.defineProperty;
|
|
2
2
|
var oe = (s, e, t) => e in s ? se(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
|
|
3
3
|
var d = (s, e, t) => oe(s, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import { de as l, dh as T, da as y, cp as _, a8 as C, a5 as f, p as re, u as M, dl as Q, dm as ae, N as S, dc as ce, Z as ie, an as X, dd as N, df as P, dn as de, dp as $, cL as pe, dg as ge, dq as ue, dr as J, cb as fe, bM as le, bR as he } from "./index-
|
|
5
|
-
import { A as Ae } from "./algorand-
|
|
4
|
+
import { de as l, dh as T, da as y, cp as _, a8 as C, a5 as f, p as re, u as M, dl as Q, dm as ae, N as S, dc as ce, Z as ie, an as X, dd as N, df as P, dn as de, dp as $, cL as pe, dg as ge, dq as ue, dr as J, cb as fe, bM as le, bR as he } from "./index-CjwA7HmM.mjs";
|
|
5
|
+
import { A as Ae } from "./algorand-qEY4HHOc.mjs";
|
|
6
6
|
class ye {
|
|
7
7
|
constructor(e, t, o, n, r = !1) {
|
|
8
8
|
d(this, "transaction");
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var h = Object.defineProperty;
|
|
2
2
|
var m = (i, e, t) => e in i ? h(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
|
|
3
3
|
var o = (i, e, t) => m(i, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import { a8 as w, c9 as g, cL as p, u, bR as l } from "./index-
|
|
5
|
-
import { A as f } from "./aptos-
|
|
4
|
+
import { a8 as w, c9 as g, cL as p, u, bR as l } from "./index-CjwA7HmM.mjs";
|
|
5
|
+
import { A as f } from "./aptos-DoqExVYR.mjs";
|
|
6
6
|
class c {
|
|
7
7
|
constructor(e, t, r, s) {
|
|
8
8
|
o(this, "network");
|