@wormhole-foundation/wormhole-connect 0.3.14-beta.1-development → 0.3.14
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-Df1X-Jsr.js → ccip-BJTvJhI5.js} +1 -1
- package/dist/assets/cosmos-mS8jzs-K.js +37 -0
- package/dist/assets/{cosmwasm-C3cFK7BC.js → cosmwasm-DGW772Mb.js} +3 -3
- package/dist/assets/{ens-validation.es6-gsmLKNwB.js → ens-validation.es6-QG6c_Puy.js} +1 -1
- package/dist/assets/{evm-BgK0PbdF.js → evm-DibVYhcH.js} +4 -4
- package/dist/assets/{index-BjIxvQFV.js → index-C1x31Jxk.js} +1 -1
- package/dist/assets/index-CP2t4FxN.js +3 -0
- package/dist/assets/{index-ByeOkyS8.js → index-CRnaWQgW.js} +1 -1
- package/dist/assets/{index-D93OVsl5.js → index-DIf-mzq7.js} +1 -1
- package/dist/assets/{index-CV4pfIw7.js → index-KMQj8MBB.js} +1 -1
- package/dist/assets/index-eblkOnb_.js +2 -0
- package/dist/assets/{index.es-B_34Y1D2.js → index.es-COHpKTWN.js} +2 -2
- package/dist/assets/{solana-Dn94-G2V.js → solana-BZCNALCU.js} +2 -2
- package/dist/assets/{solanaEmbed.esm-rqFDr9AX.js → solanaEmbed.esm-D0yWLEo-.js} +1 -1
- package/dist/assets/{unsignedTransaction-B08fN_UW.js → unsignedTransaction-D7VEWy8m.js} +1 -1
- package/dist/main.js +9 -9
- package/lib/{algorand-B_zsKIUB.js → algorand-CVFKJ49n.js} +1 -1
- package/lib/{algorand--METRir0.mjs → algorand-DlXOCG7s.mjs} +4 -4
- package/lib/{aptos-B6T-33BH.mjs → aptos-C0Pa8tPM.mjs} +1 -1
- package/lib/{aptos-DzrqvZYi.mjs → aptos-DNWaXEMs.mjs} +4 -4
- package/lib/{aptos-DUNhi8qI.js → aptos-DfMox9Nu.js} +2 -2
- package/lib/{aptos-QtEtA7ZW.js → aptos-JDPRMCdh.js} +1 -1
- package/lib/{browser-Bscopnix.js → browser-5NnkopSy.js} +1 -1
- package/lib/{browser-B85hfsEU.mjs → browser-ByPSU-Sm.mjs} +2 -2
- package/lib/{ccip-DZqWqGGu.mjs → ccip-DeNVdlP1.mjs} +1 -1
- package/lib/{ccip-B55tByf5.js → ccip-vhUwnCjN.js} +1 -1
- package/lib/{chain-DIeeymNu.mjs → chain-BqdQffpz.mjs} +1 -1
- package/lib/{chain-B6MIHCrl.js → chain-C453VbjW.js} +1 -1
- package/lib/{cosmos-COOa_hP3.mjs → cosmos-BnB7dpcl.mjs} +3 -3
- package/lib/{cosmos-xRQL5PyI.js → cosmos-Cvu7IxgR.js} +1 -1
- package/lib/{cosmwasm-BVs1dHVN.js → cosmwasm-CDJf683T.js} +2 -2
- package/lib/{cosmwasm-Bh_CxuU0.mjs → cosmwasm-CZWC0Vwt.mjs} +6 -6
- package/lib/{create-b6djXgrD.js → create-D65JDX7A.js} +1 -1
- package/lib/{create-CKAYk8Hy.mjs → create-D79R5wNC.mjs} +1 -1
- package/lib/{ens-validation.es6-BAjtkzn9.js → ens-validation.es6-CxdMEulM.js} +1 -1
- package/lib/{ens-validation.es6-D0ElLoC0.mjs → ens-validation.es6-HV5K8ymg.mjs} +2 -2
- package/lib/{evm-Dr1-QGmD.js → evm-Ab2vMhYN.js} +2 -2
- package/lib/{evm-C8LxJqN_.mjs → evm-BlTqB4gw.mjs} +6 -6
- package/lib/{evm-EvdBe0my.mjs → evm-Ct13feWV.mjs} +6 -6
- package/lib/{evm-5D2VwgNW.js → evm-Dq5MPtI4.js} +4 -4
- package/lib/{index-DbN-ha-V.mjs → index-26eawinA.mjs} +4 -4
- package/lib/{index-DG_qcbL3.mjs → index-4VRk-Zbs.mjs} +3 -3
- package/lib/{index-BXPXS8lw.mjs → index-B1lU9xI5.mjs} +4 -4
- package/lib/{index-DGMGnQ6C.js → index-B583w9fN.js} +1 -1
- package/lib/{index-CPREkxnM.js → index-BC1OqHuv.js} +1 -1
- package/lib/{index-CLNtNgN1.mjs → index-BGvHdvdt.mjs} +4 -4
- package/lib/{index-DXQ-8YfL.mjs → index-BTUOVer-.mjs} +1 -1
- package/lib/{index-glcRZoGf.js → index-BYykran7.js} +1 -1
- package/lib/{index-Cweb_Lro.js → index-Bge7ijdZ.js} +1 -1
- package/lib/{index-DBZxhVWH.mjs → index-BtSWBcda.mjs} +4 -4
- package/lib/{index-G5_KoOmK.mjs → index-BugYV_4o.mjs} +4 -4
- package/lib/{index-D64qU2ma.js → index-C2_AHiqv.js} +3 -3
- package/lib/{index-CpVPNCn9.mjs → index-CM0b-J8y.mjs} +4 -4
- package/lib/{index--POK_Qlp.js → index-CSAHzLNT.js} +1 -1
- package/lib/{index-__A2GcY6.mjs → index-CSkBcw-D.mjs} +4 -4
- package/lib/{index-Du-vQDoz.mjs → index-CTpAZ9nb.mjs} +4 -4
- package/lib/{index-BuQEehXi.mjs → index-CWl-BFJn.mjs} +5 -5
- package/lib/{index-rvGu6Fys.mjs → index-CY3avmpk.mjs} +1 -1
- package/lib/{index-BE9arVSK.mjs → index-CZytaOh1.mjs} +2 -2
- package/lib/index-Cb1Z6J_2.js +1 -0
- package/lib/{index-gYdFT0lD.mjs → index-CfUmBL7v.mjs} +4 -4
- package/lib/{index-4znO_pHu.mjs → index-CnCIIPXr.mjs} +4 -4
- package/lib/{index-DGdaLbCV.js → index-CyAgjXwe.js} +1 -1
- package/lib/{index-DYRRAKVv.js → index-D--mHvwl.js} +1 -1
- package/lib/{index-j3EW_9_6.mjs → index-D7fGdFWj.mjs} +2 -2
- package/lib/{index-C6ISUObD.js → index-DIllMluL.js} +1 -1
- package/lib/{index-DecMzlzN.js → index-DPjEn-UC.js} +1 -1
- package/lib/{index-CEtYJbRu.js → index-DUSDkJk5.js} +1 -1
- package/lib/{index-D1PGmOov.mjs → index-DXycTbzg.mjs} +22 -22
- package/lib/{index-EEtERwdP.mjs → index-DZikb8Np.mjs} +3 -3
- package/lib/{index-BGJMKya9.js → index-Dchl8cgJ.js} +1 -1
- package/lib/{index-is9YtL7L.js → index-De2z-VSE.js} +1 -1
- package/lib/{index-DAmhPblM.js → index-Dewf_228.js} +1 -1
- package/lib/{index-DC79se3K.js → index-DikhQw8s.js} +1 -1
- package/lib/{index-zpoXhgRJ.js → index-DkuY3vFZ.js} +1 -1
- package/lib/{index-Cp3rpTDm.mjs → index-Drto8TLk.mjs} +5 -5
- package/lib/{index-B5zmUJA4.js → index-DyTV2laN.js} +1 -1
- package/lib/{index-Bj7FiPmv.js → index-LNQRx_kM.js} +1 -1
- package/lib/{index-iUdRJ6rW.js → index-U-9k85Xq.js} +1 -1
- package/lib/{index-C1pDiBzJ.mjs → index-YfADnRfR.mjs} +2 -2
- package/lib/{index-SFmnxTYX.mjs → index-ZSB5WVTS.mjs} +5 -5
- package/lib/{index-bFnCEjGK.mjs → index-eYxUR3kF.mjs} +3 -3
- package/lib/{index-Bb9ALioa.js → index-l-pmNV8r.js} +1 -1
- package/lib/{index-BeJpXXCe.js → index-tlEJpVxO.js} +1 -1
- package/lib/{index-BaMCNLcV.mjs → index-xhF6pq52.mjs} +6 -6
- package/lib/{index-CoirRBt5.js → index-yqQlFROv.js} +1 -1
- package/lib/{index.es-ChbHiiWR.mjs → index.es-BhcayXFz.mjs} +4 -4
- package/lib/{index.es-B8LoJfDQ.js → index.es-lcQybjxw.js} +2 -2
- package/lib/index.js +1 -1
- package/lib/index.mjs +1 -1
- package/lib/{libsodium-wrappers-Cb8uXs_p.mjs → libsodium-wrappers-BMyPhbfe.mjs} +1 -1
- package/lib/{libsodium-wrappers-CYhY_wpO.js → libsodium-wrappers-DiSaiZbZ.js} +1 -1
- package/lib/{sei-CmKJM62D.mjs → sei-De5wMBer.mjs} +2 -2
- package/lib/{sei-BJyT_MkO.js → sei-g10VEo2p.js} +1 -1
- package/lib/{solana-BqtzN83d.js → solana-6KbHNP3L.js} +1 -1
- package/lib/{solana-pegPJXF6.mjs → solana-DHrthY4V.mjs} +6 -6
- package/lib/{solana-B_4vzBx9.mjs → solana-DeE1Kc4R.mjs} +3 -3
- package/lib/{solana-CP2Ro3b6.js → solana-g2ChLShs.js} +2 -2
- package/lib/{solanaEmbed.esm-p2Maj0Kc.mjs → solanaEmbed.esm-BKfqpMHE.mjs} +2 -2
- package/lib/{solanaEmbed.esm-BZQhHixI.js → solanaEmbed.esm-CB-PWWDN.js} +1 -1
- package/lib/{sui-DEJMwoei.mjs → sui-AMfu49c6.mjs} +4 -4
- package/lib/{sui-DyMCY4Wo.js → sui-CqbULR3p.js} +1 -1
- package/lib/{sui-CnF64P2s.mjs → sui-DisgucwN.mjs} +1 -1
- package/lib/{sui-BE2FECKH.js → sui-iNn-cH44.js} +2 -2
- package/lib/{unsignedTransaction-cUSYQRUJ.mjs → unsignedTransaction-B7ANn3fF.mjs} +2 -2
- package/lib/{unsignedTransaction-ByICgBQh.js → unsignedTransaction-CXi-AC5w.js} +1 -1
- package/package.json +1 -1
- package/dist/assets/cosmos-O8tTKeuk.js +0 -37
- package/dist/assets/index-BoaPGnUb.js +0 -2
- package/dist/assets/index-Dqsfl0un.js +0 -3
- package/lib/index-C7oQpHNB.js +0 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";const g=require("./index-D64qU2ma.js");var Ne={},Ze={exports:{}},He={};(function(o){o.fetch=n(g.commonjsGlobal.fetch)&&n(g.commonjsGlobal.ReadableStream),o.writableStream=n(g.commonjsGlobal.WritableStream),o.abortController=n(g.commonjsGlobal.AbortController);var r;function h(){if(r!==void 0)return r;if(g.commonjsGlobal.XMLHttpRequest){r=new g.commonjsGlobal.XMLHttpRequest;try{r.open("GET",g.commonjsGlobal.XDomainRequest?"/":"https://example.com")}catch{r=null}}else r=null;return r}function f(b){var u=h();if(!u)return!1;try{return u.responseType=b,u.responseType===b}catch{}return!1}o.arraybuffer=o.fetch||f("arraybuffer"),o.msstream=!o.fetch&&f("ms-stream"),o.mozchunkedarraybuffer=!o.fetch&&f("moz-chunked-arraybuffer"),o.overrideMimeType=o.fetch||(h()?n(h().overrideMimeType):!1);function n(b){return typeof b=="function"}r=null})(He);var xe={},Ve=He,st=g.inherits_browserExports,Je=g.readableBrowserExports,Ce=xe.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},Ge=xe.IncomingMessage=function(o,r,h,f){var n=this;if(Je.Readable.call(n),n._mode=h,n.headers={},n.rawHeaders=[],n.trailers={},n.rawTrailers=[],n.on("end",function(){g.dist.process.nextTick(function(){n.emit("close")})}),h==="fetch"){let A=function(){u.read().then(function(d){if(!n._destroyed){if(f(d.done),d.done){n.push(null);return}n.push(g.dist.Buffer.from(d.value)),A()}}).catch(function(d){f(!0),n._destroyed||n.emit("error",d)})};if(n._fetchResponse=r,n.url=r.url,n.statusCode=r.status,n.statusMessage=r.statusText,r.headers.forEach(function(d,x){n.headers[x.toLowerCase()]=d,n.rawHeaders.push(x,d)}),Ve.writableStream){var b=new WritableStream({write:function(d){return f(!1),new Promise(function(x,ee){n._destroyed?ee():n.push(g.dist.Buffer.from(d))?x():n._resumeFetch=x})},close:function(){f(!0),n._destroyed||n.push(null)},abort:function(d){f(!0),n._destroyed||n.emit("error",d)}});try{r.body.pipeTo(b).catch(function(d){f(!0),n._destroyed||n.emit("error",d)});return}catch{}}var u=r.body.getReader();A()}else{n._xhr=o,n._pos=0,n.url=o.responseURL,n.statusCode=o.status,n.statusMessage=o.statusText;var a=o.getAllResponseHeaders().split(/\r?\n/);if(a.forEach(function(A){var d=A.match(/^([^:]+):\s*(.*)/);if(d){var x=d[1].toLowerCase();x==="set-cookie"?(n.headers[x]===void 0&&(n.headers[x]=[]),n.headers[x].push(d[2])):n.headers[x]!==void 0?n.headers[x]+=", "+d[2]:n.headers[x]=d[2],n.rawHeaders.push(d[1],d[2])}}),n._charset="x-user-defined",!Ve.overrideMimeType){var v=n.rawHeaders["mime-type"];if(v){var w=v.match(/;\s*charset=([^;])(;|$)/);w&&(n._charset=w[1].toLowerCase())}n._charset||(n._charset="utf-8")}}};st(Ge,Je.Readable);Ge.prototype._read=function(){var o=this,r=o._resumeFetch;r&&(o._resumeFetch=null,r())};Ge.prototype._onXHRProgress=function(o){var r=this,h=r._xhr,f=null;switch(r._mode){case"text":if(f=h.responseText,f.length>r._pos){var n=f.substr(r._pos);if(r._charset==="x-user-defined"){for(var b=g.dist.Buffer.alloc(n.length),u=0;u<n.length;u++)b[u]=n.charCodeAt(u)&255;r.push(b)}else r.push(n,r._charset);r._pos=f.length}break;case"arraybuffer":if(h.readyState!==Ce.DONE||!h.response)break;f=h.response,r.push(g.dist.Buffer.from(new Uint8Array(f)));break;case"moz-chunked-arraybuffer":if(f=h.response,h.readyState!==Ce.LOADING||!f)break;r.push(g.dist.Buffer.from(new Uint8Array(f)));break;case"ms-stream":if(f=h.response,h.readyState!==Ce.LOADING)break;var a=new g.commonjsGlobal.MSStreamReader;a.onprogress=function(){a.result.byteLength>r._pos&&(r.push(g.dist.Buffer.from(new Uint8Array(a.result.slice(r._pos)))),r._pos=a.result.byteLength)},a.onload=function(){o(!0),r.push(null)},a.readAsArrayBuffer(f);break}r._xhr.readyState===Ce.DONE&&r._mode!=="ms-stream"&&(o(!0),r.push(null))};var fe=He,at=g.inherits_browserExports,Qe=xe,ke=g.readableBrowserExports,it=Qe.IncomingMessage,Ye=Qe.readyStates;function ft(o,r){return fe.fetch&&r?"fetch":fe.mozchunkedarraybuffer?"moz-chunked-arraybuffer":fe.msstream?"ms-stream":fe.arraybuffer&&o?"arraybuffer":"text"}var S=Ze.exports=function(o){var r=this;ke.Writable.call(r),r._opts=o,r._body=[],r._headers={},o.auth&&r.setHeader("Authorization","Basic "+g.dist.Buffer.from(o.auth).toString("base64")),Object.keys(o.headers).forEach(function(n){r.setHeader(n,o.headers[n])});var h,f=!0;if(o.mode==="disable-fetch"||"requestTimeout"in o&&!fe.abortController)f=!1,h=!0;else if(o.mode==="prefer-streaming")h=!1;else if(o.mode==="allow-wrong-content-type")h=!fe.overrideMimeType;else if(!o.mode||o.mode==="default"||o.mode==="prefer-fast")h=!0;else throw new Error("Invalid value for opts.mode");r._mode=ft(h,f),r._fetchTimer=null,r._socketTimeout=null,r._socketTimer=null,r.on("finish",function(){r._onFinish()})};at(S,ke.Writable);S.prototype.setHeader=function(o,r){var h=this,f=o.toLowerCase();ut.indexOf(f)===-1&&(h._headers[f]={name:o,value:r})};S.prototype.getHeader=function(o){var r=this._headers[o.toLowerCase()];return r?r.value:null};S.prototype.removeHeader=function(o){var r=this;delete r._headers[o.toLowerCase()]};S.prototype._onFinish=function(){var o=this;if(!o._destroyed){var r=o._opts;"timeout"in r&&r.timeout!==0&&o.setTimeout(r.timeout);var h=o._headers,f=null;r.method!=="GET"&&r.method!=="HEAD"&&(f=new Blob(o._body,{type:(h["content-type"]||{}).value||""}));var n=[];if(Object.keys(h).forEach(function(v){var w=h[v].name,A=h[v].value;Array.isArray(A)?A.forEach(function(d){n.push([w,d])}):n.push([w,A])}),o._mode==="fetch"){var b=null;if(fe.abortController){var u=new AbortController;b=u.signal,o._fetchAbortController=u,"requestTimeout"in r&&r.requestTimeout!==0&&(o._fetchTimer=g.commonjsGlobal.setTimeout(function(){o.emit("requestTimeout"),o._fetchAbortController&&o._fetchAbortController.abort()},r.requestTimeout))}g.commonjsGlobal.fetch(o._opts.url,{method:o._opts.method,headers:n,body:f||void 0,mode:"cors",credentials:r.withCredentials?"include":"same-origin",signal:b}).then(function(v){o._fetchResponse=v,o._resetTimers(!1),o._connect()},function(v){o._resetTimers(!0),o._destroyed||o.emit("error",v)})}else{var a=o._xhr=new g.commonjsGlobal.XMLHttpRequest;try{a.open(o._opts.method,o._opts.url,!0)}catch(v){g.dist.process.nextTick(function(){o.emit("error",v)});return}"responseType"in a&&(a.responseType=o._mode),"withCredentials"in a&&(a.withCredentials=!!r.withCredentials),o._mode==="text"&&"overrideMimeType"in a&&a.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in r&&(a.timeout=r.requestTimeout,a.ontimeout=function(){o.emit("requestTimeout")}),n.forEach(function(v){a.setRequestHeader(v[0],v[1])}),o._response=null,a.onreadystatechange=function(){switch(a.readyState){case Ye.LOADING:case Ye.DONE:o._onXHRProgress();break}},o._mode==="moz-chunked-arraybuffer"&&(a.onprogress=function(){o._onXHRProgress()}),a.onerror=function(){o._destroyed||(o._resetTimers(!0),o.emit("error",new Error("XHR error")))};try{a.send(f)}catch(v){g.dist.process.nextTick(function(){o.emit("error",v)});return}}}};function ht(o){try{var r=o.status;return r!==null&&r!==0}catch{return!1}}S.prototype._onXHRProgress=function(){var o=this;o._resetTimers(!1),!(!ht(o._xhr)||o._destroyed)&&(o._response||o._connect(),o._response._onXHRProgress(o._resetTimers.bind(o)))};S.prototype._connect=function(){var o=this;o._destroyed||(o._response=new it(o._xhr,o._fetchResponse,o._mode,o._resetTimers.bind(o)),o._response.on("error",function(r){o.emit("error",r)}),o.emit("response",o._response))};S.prototype._write=function(o,r,h){var f=this;f._body.push(o),h()};S.prototype._resetTimers=function(o){var r=this;g.commonjsGlobal.clearTimeout(r._socketTimer),r._socketTimer=null,o?(g.commonjsGlobal.clearTimeout(r._fetchTimer),r._fetchTimer=null):r._socketTimeout&&(r._socketTimer=g.commonjsGlobal.setTimeout(function(){r.emit("timeout")},r._socketTimeout))};S.prototype.abort=S.prototype.destroy=function(o){var r=this;r._destroyed=!0,r._resetTimers(!0),r._response&&(r._response._destroyed=!0),r._xhr?r._xhr.abort():r._fetchAbortController&&r._fetchAbortController.abort(),o&&r.emit("error",o)};S.prototype.end=function(o,r,h){var f=this;typeof o=="function"&&(h=o,o=void 0),ke.Writable.prototype.end.call(f,o,r,h)};S.prototype.setTimeout=function(o,r){var h=this;r&&h.once("timeout",r),h._socketTimeout=o,h._resetTimers(!1)};S.prototype.flushHeaders=function(){};S.prototype.setNoDelay=function(){};S.prototype.setSocketKeepAlive=function(){};var ut=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"],lt=Ze.exports,ct=mt,pt=Object.prototype.hasOwnProperty;function mt(){for(var o={},r=0;r<arguments.length;r++){var h=arguments[r];for(var f in h)pt.call(h,f)&&(o[f]=h[f])}return o}var dt={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"},Me={exports:{}},Ae={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */Ae.exports;(function(o,r){(function(h){var f=r&&!r.nodeType&&r,n=o&&!o.nodeType&&o,b=typeof g.commonjsGlobal=="object"&&g.commonjsGlobal;(b.global===b||b.window===b||b.self===b)&&(h=b);var u,a=2147483647,v=36,w=1,A=26,d=38,x=700,ee=72,se=128,I="-",Ee=/^xn--/,qe=/[^\x20-\x7E]/,Oe=/[\x2E\u3002\uFF0E\uFF61]/g,Ue={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},ce=v-w,F=Math.floor,te=String.fromCharCode,ae;function Z(i){throw new RangeError(Ue[i])}function pe(i,p){for(var y=i.length,T=[];y--;)T[y]=p(i[y]);return T}function be(i,p){var y=i.split("@"),T="";y.length>1&&(T=y[0]+"@",i=y[1]),i=i.replace(Oe,".");var R=i.split("."),L=pe(R,p).join(".");return T+L}function _e(i){for(var p=[],y=0,T=i.length,R,L;y<T;)R=i.charCodeAt(y++),R>=55296&&R<=56319&&y<T?(L=i.charCodeAt(y++),(L&64512)==56320?p.push(((R&1023)<<10)+(L&1023)+65536):(p.push(R),y--)):p.push(R);return p}function he(i){return pe(i,function(p){var y="";return p>65535&&(p-=65536,y+=te(p>>>10&1023|55296),p=56320|p&1023),y+=te(p),y}).join("")}function re(i){return i-48<10?i-22:i-65<26?i-65:i-97<26?i-97:v}function ue(i,p){return i+22+75*(i<26)-((p!=0)<<5)}function oe(i,p,y){var T=0;for(i=y?F(i/x):i>>1,i+=F(i/p);i>ce*A>>1;T+=v)i=F(i/ce);return F(T+(ce+1)*i/(i+d))}function Te(i){var p=[],y=i.length,T,R=0,L=se,E=ee,C,M,$,B,P,N,k,W,J;for(C=i.lastIndexOf(I),C<0&&(C=0),M=0;M<C;++M)i.charCodeAt(M)>=128&&Z("not-basic"),p.push(i.charCodeAt(M));for($=C>0?C+1:0;$<y;){for(B=R,P=1,N=v;$>=y&&Z("invalid-input"),k=re(i.charCodeAt($++)),(k>=v||k>F((a-R)/P))&&Z("overflow"),R+=k*P,W=N<=E?w:N>=E+A?A:N-E,!(k<W);N+=v)J=v-W,P>F(a/J)&&Z("overflow"),P*=J;T=p.length+1,E=oe(R-B,T,B==0),F(R/T)>a-L&&Z("overflow"),L+=F(R/T),R%=T,p.splice(R++,0,L)}return he(p)}function we(i){var p,y,T,R,L,E,C,M,$,B,P,N=[],k,W,J,me;for(i=_e(i),k=i.length,p=se,y=0,L=ee,E=0;E<k;++E)P=i[E],P<128&&N.push(te(P));for(T=R=N.length,R&&N.push(I);T<k;){for(C=a,E=0;E<k;++E)P=i[E],P>=p&&P<C&&(C=P);for(W=T+1,C-p>F((a-y)/W)&&Z("overflow"),y+=(C-p)*W,p=C,E=0;E<k;++E)if(P=i[E],P<p&&++y>a&&Z("overflow"),P==p){for(M=y,$=v;B=$<=L?w:$>=L+A?A:$-L,!(M<B);$+=v)me=M-B,J=v-B,N.push(te(ue(B+me%J,0))),M=F(me/J);N.push(te(ue(M,0))),L=oe(y,W,T==R),y=0,++T}++y,++p}return N.join("")}function Le(i){return be(i,function(p){return Ee.test(p)?Te(p.slice(4).toLowerCase()):p})}function Pe(i){return be(i,function(p){return qe.test(p)?"xn--"+we(p):p})}if(u={version:"1.4.1",ucs2:{decode:_e,encode:he},decode:Te,encode:we,toASCII:Pe,toUnicode:Le},f&&n)if(o.exports==f)n.exports=u;else for(ae in u)u.hasOwnProperty(ae)&&(f[ae]=u[ae]);else h.punycode=u})(g.commonjsGlobal)})(Ae,Ae.exports);var et=Ae.exports;(function(o,r){Object.defineProperty(r,"__esModule",{value:!0});var h=et,f=g.require$$2;function n(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var b=n(h),u=n(f),a={isString:function(e){return typeof e=="string"},isObject:function(e){return typeof e=="object"&&e!==null},isNull:function(e){return e===null},isNullOrUndefined:function(e){return e==null}},v=b.default,w=a,A=oe,d=we,x=Le,ee=Te,se=I;function I(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var Ee=/^([a-z0-9.+-]+:)/i,qe=/:[0-9]*$/,Oe=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Ue=["<",">",'"',"`"," ","\r",`
|
|
1
|
+
"use strict";const g=require("./index-C2_AHiqv.js");var Ne={},Ze={exports:{}},He={};(function(o){o.fetch=n(g.commonjsGlobal.fetch)&&n(g.commonjsGlobal.ReadableStream),o.writableStream=n(g.commonjsGlobal.WritableStream),o.abortController=n(g.commonjsGlobal.AbortController);var r;function h(){if(r!==void 0)return r;if(g.commonjsGlobal.XMLHttpRequest){r=new g.commonjsGlobal.XMLHttpRequest;try{r.open("GET",g.commonjsGlobal.XDomainRequest?"/":"https://example.com")}catch{r=null}}else r=null;return r}function f(b){var u=h();if(!u)return!1;try{return u.responseType=b,u.responseType===b}catch{}return!1}o.arraybuffer=o.fetch||f("arraybuffer"),o.msstream=!o.fetch&&f("ms-stream"),o.mozchunkedarraybuffer=!o.fetch&&f("moz-chunked-arraybuffer"),o.overrideMimeType=o.fetch||(h()?n(h().overrideMimeType):!1);function n(b){return typeof b=="function"}r=null})(He);var xe={},Ve=He,st=g.inherits_browserExports,Je=g.readableBrowserExports,Ce=xe.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},Ge=xe.IncomingMessage=function(o,r,h,f){var n=this;if(Je.Readable.call(n),n._mode=h,n.headers={},n.rawHeaders=[],n.trailers={},n.rawTrailers=[],n.on("end",function(){g.dist.process.nextTick(function(){n.emit("close")})}),h==="fetch"){let A=function(){u.read().then(function(d){if(!n._destroyed){if(f(d.done),d.done){n.push(null);return}n.push(g.dist.Buffer.from(d.value)),A()}}).catch(function(d){f(!0),n._destroyed||n.emit("error",d)})};if(n._fetchResponse=r,n.url=r.url,n.statusCode=r.status,n.statusMessage=r.statusText,r.headers.forEach(function(d,x){n.headers[x.toLowerCase()]=d,n.rawHeaders.push(x,d)}),Ve.writableStream){var b=new WritableStream({write:function(d){return f(!1),new Promise(function(x,ee){n._destroyed?ee():n.push(g.dist.Buffer.from(d))?x():n._resumeFetch=x})},close:function(){f(!0),n._destroyed||n.push(null)},abort:function(d){f(!0),n._destroyed||n.emit("error",d)}});try{r.body.pipeTo(b).catch(function(d){f(!0),n._destroyed||n.emit("error",d)});return}catch{}}var u=r.body.getReader();A()}else{n._xhr=o,n._pos=0,n.url=o.responseURL,n.statusCode=o.status,n.statusMessage=o.statusText;var a=o.getAllResponseHeaders().split(/\r?\n/);if(a.forEach(function(A){var d=A.match(/^([^:]+):\s*(.*)/);if(d){var x=d[1].toLowerCase();x==="set-cookie"?(n.headers[x]===void 0&&(n.headers[x]=[]),n.headers[x].push(d[2])):n.headers[x]!==void 0?n.headers[x]+=", "+d[2]:n.headers[x]=d[2],n.rawHeaders.push(d[1],d[2])}}),n._charset="x-user-defined",!Ve.overrideMimeType){var v=n.rawHeaders["mime-type"];if(v){var w=v.match(/;\s*charset=([^;])(;|$)/);w&&(n._charset=w[1].toLowerCase())}n._charset||(n._charset="utf-8")}}};st(Ge,Je.Readable);Ge.prototype._read=function(){var o=this,r=o._resumeFetch;r&&(o._resumeFetch=null,r())};Ge.prototype._onXHRProgress=function(o){var r=this,h=r._xhr,f=null;switch(r._mode){case"text":if(f=h.responseText,f.length>r._pos){var n=f.substr(r._pos);if(r._charset==="x-user-defined"){for(var b=g.dist.Buffer.alloc(n.length),u=0;u<n.length;u++)b[u]=n.charCodeAt(u)&255;r.push(b)}else r.push(n,r._charset);r._pos=f.length}break;case"arraybuffer":if(h.readyState!==Ce.DONE||!h.response)break;f=h.response,r.push(g.dist.Buffer.from(new Uint8Array(f)));break;case"moz-chunked-arraybuffer":if(f=h.response,h.readyState!==Ce.LOADING||!f)break;r.push(g.dist.Buffer.from(new Uint8Array(f)));break;case"ms-stream":if(f=h.response,h.readyState!==Ce.LOADING)break;var a=new g.commonjsGlobal.MSStreamReader;a.onprogress=function(){a.result.byteLength>r._pos&&(r.push(g.dist.Buffer.from(new Uint8Array(a.result.slice(r._pos)))),r._pos=a.result.byteLength)},a.onload=function(){o(!0),r.push(null)},a.readAsArrayBuffer(f);break}r._xhr.readyState===Ce.DONE&&r._mode!=="ms-stream"&&(o(!0),r.push(null))};var fe=He,at=g.inherits_browserExports,Qe=xe,ke=g.readableBrowserExports,it=Qe.IncomingMessage,Ye=Qe.readyStates;function ft(o,r){return fe.fetch&&r?"fetch":fe.mozchunkedarraybuffer?"moz-chunked-arraybuffer":fe.msstream?"ms-stream":fe.arraybuffer&&o?"arraybuffer":"text"}var S=Ze.exports=function(o){var r=this;ke.Writable.call(r),r._opts=o,r._body=[],r._headers={},o.auth&&r.setHeader("Authorization","Basic "+g.dist.Buffer.from(o.auth).toString("base64")),Object.keys(o.headers).forEach(function(n){r.setHeader(n,o.headers[n])});var h,f=!0;if(o.mode==="disable-fetch"||"requestTimeout"in o&&!fe.abortController)f=!1,h=!0;else if(o.mode==="prefer-streaming")h=!1;else if(o.mode==="allow-wrong-content-type")h=!fe.overrideMimeType;else if(!o.mode||o.mode==="default"||o.mode==="prefer-fast")h=!0;else throw new Error("Invalid value for opts.mode");r._mode=ft(h,f),r._fetchTimer=null,r._socketTimeout=null,r._socketTimer=null,r.on("finish",function(){r._onFinish()})};at(S,ke.Writable);S.prototype.setHeader=function(o,r){var h=this,f=o.toLowerCase();ut.indexOf(f)===-1&&(h._headers[f]={name:o,value:r})};S.prototype.getHeader=function(o){var r=this._headers[o.toLowerCase()];return r?r.value:null};S.prototype.removeHeader=function(o){var r=this;delete r._headers[o.toLowerCase()]};S.prototype._onFinish=function(){var o=this;if(!o._destroyed){var r=o._opts;"timeout"in r&&r.timeout!==0&&o.setTimeout(r.timeout);var h=o._headers,f=null;r.method!=="GET"&&r.method!=="HEAD"&&(f=new Blob(o._body,{type:(h["content-type"]||{}).value||""}));var n=[];if(Object.keys(h).forEach(function(v){var w=h[v].name,A=h[v].value;Array.isArray(A)?A.forEach(function(d){n.push([w,d])}):n.push([w,A])}),o._mode==="fetch"){var b=null;if(fe.abortController){var u=new AbortController;b=u.signal,o._fetchAbortController=u,"requestTimeout"in r&&r.requestTimeout!==0&&(o._fetchTimer=g.commonjsGlobal.setTimeout(function(){o.emit("requestTimeout"),o._fetchAbortController&&o._fetchAbortController.abort()},r.requestTimeout))}g.commonjsGlobal.fetch(o._opts.url,{method:o._opts.method,headers:n,body:f||void 0,mode:"cors",credentials:r.withCredentials?"include":"same-origin",signal:b}).then(function(v){o._fetchResponse=v,o._resetTimers(!1),o._connect()},function(v){o._resetTimers(!0),o._destroyed||o.emit("error",v)})}else{var a=o._xhr=new g.commonjsGlobal.XMLHttpRequest;try{a.open(o._opts.method,o._opts.url,!0)}catch(v){g.dist.process.nextTick(function(){o.emit("error",v)});return}"responseType"in a&&(a.responseType=o._mode),"withCredentials"in a&&(a.withCredentials=!!r.withCredentials),o._mode==="text"&&"overrideMimeType"in a&&a.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in r&&(a.timeout=r.requestTimeout,a.ontimeout=function(){o.emit("requestTimeout")}),n.forEach(function(v){a.setRequestHeader(v[0],v[1])}),o._response=null,a.onreadystatechange=function(){switch(a.readyState){case Ye.LOADING:case Ye.DONE:o._onXHRProgress();break}},o._mode==="moz-chunked-arraybuffer"&&(a.onprogress=function(){o._onXHRProgress()}),a.onerror=function(){o._destroyed||(o._resetTimers(!0),o.emit("error",new Error("XHR error")))};try{a.send(f)}catch(v){g.dist.process.nextTick(function(){o.emit("error",v)});return}}}};function ht(o){try{var r=o.status;return r!==null&&r!==0}catch{return!1}}S.prototype._onXHRProgress=function(){var o=this;o._resetTimers(!1),!(!ht(o._xhr)||o._destroyed)&&(o._response||o._connect(),o._response._onXHRProgress(o._resetTimers.bind(o)))};S.prototype._connect=function(){var o=this;o._destroyed||(o._response=new it(o._xhr,o._fetchResponse,o._mode,o._resetTimers.bind(o)),o._response.on("error",function(r){o.emit("error",r)}),o.emit("response",o._response))};S.prototype._write=function(o,r,h){var f=this;f._body.push(o),h()};S.prototype._resetTimers=function(o){var r=this;g.commonjsGlobal.clearTimeout(r._socketTimer),r._socketTimer=null,o?(g.commonjsGlobal.clearTimeout(r._fetchTimer),r._fetchTimer=null):r._socketTimeout&&(r._socketTimer=g.commonjsGlobal.setTimeout(function(){r.emit("timeout")},r._socketTimeout))};S.prototype.abort=S.prototype.destroy=function(o){var r=this;r._destroyed=!0,r._resetTimers(!0),r._response&&(r._response._destroyed=!0),r._xhr?r._xhr.abort():r._fetchAbortController&&r._fetchAbortController.abort(),o&&r.emit("error",o)};S.prototype.end=function(o,r,h){var f=this;typeof o=="function"&&(h=o,o=void 0),ke.Writable.prototype.end.call(f,o,r,h)};S.prototype.setTimeout=function(o,r){var h=this;r&&h.once("timeout",r),h._socketTimeout=o,h._resetTimers(!1)};S.prototype.flushHeaders=function(){};S.prototype.setNoDelay=function(){};S.prototype.setSocketKeepAlive=function(){};var ut=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"],lt=Ze.exports,ct=mt,pt=Object.prototype.hasOwnProperty;function mt(){for(var o={},r=0;r<arguments.length;r++){var h=arguments[r];for(var f in h)pt.call(h,f)&&(o[f]=h[f])}return o}var dt={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"},Me={exports:{}},Ae={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */Ae.exports;(function(o,r){(function(h){var f=r&&!r.nodeType&&r,n=o&&!o.nodeType&&o,b=typeof g.commonjsGlobal=="object"&&g.commonjsGlobal;(b.global===b||b.window===b||b.self===b)&&(h=b);var u,a=2147483647,v=36,w=1,A=26,d=38,x=700,ee=72,se=128,I="-",Ee=/^xn--/,qe=/[^\x20-\x7E]/,Oe=/[\x2E\u3002\uFF0E\uFF61]/g,Ue={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},ce=v-w,F=Math.floor,te=String.fromCharCode,ae;function Z(i){throw new RangeError(Ue[i])}function pe(i,p){for(var y=i.length,T=[];y--;)T[y]=p(i[y]);return T}function be(i,p){var y=i.split("@"),T="";y.length>1&&(T=y[0]+"@",i=y[1]),i=i.replace(Oe,".");var R=i.split("."),L=pe(R,p).join(".");return T+L}function _e(i){for(var p=[],y=0,T=i.length,R,L;y<T;)R=i.charCodeAt(y++),R>=55296&&R<=56319&&y<T?(L=i.charCodeAt(y++),(L&64512)==56320?p.push(((R&1023)<<10)+(L&1023)+65536):(p.push(R),y--)):p.push(R);return p}function he(i){return pe(i,function(p){var y="";return p>65535&&(p-=65536,y+=te(p>>>10&1023|55296),p=56320|p&1023),y+=te(p),y}).join("")}function re(i){return i-48<10?i-22:i-65<26?i-65:i-97<26?i-97:v}function ue(i,p){return i+22+75*(i<26)-((p!=0)<<5)}function oe(i,p,y){var T=0;for(i=y?F(i/x):i>>1,i+=F(i/p);i>ce*A>>1;T+=v)i=F(i/ce);return F(T+(ce+1)*i/(i+d))}function Te(i){var p=[],y=i.length,T,R=0,L=se,E=ee,C,M,$,B,P,N,k,W,J;for(C=i.lastIndexOf(I),C<0&&(C=0),M=0;M<C;++M)i.charCodeAt(M)>=128&&Z("not-basic"),p.push(i.charCodeAt(M));for($=C>0?C+1:0;$<y;){for(B=R,P=1,N=v;$>=y&&Z("invalid-input"),k=re(i.charCodeAt($++)),(k>=v||k>F((a-R)/P))&&Z("overflow"),R+=k*P,W=N<=E?w:N>=E+A?A:N-E,!(k<W);N+=v)J=v-W,P>F(a/J)&&Z("overflow"),P*=J;T=p.length+1,E=oe(R-B,T,B==0),F(R/T)>a-L&&Z("overflow"),L+=F(R/T),R%=T,p.splice(R++,0,L)}return he(p)}function we(i){var p,y,T,R,L,E,C,M,$,B,P,N=[],k,W,J,me;for(i=_e(i),k=i.length,p=se,y=0,L=ee,E=0;E<k;++E)P=i[E],P<128&&N.push(te(P));for(T=R=N.length,R&&N.push(I);T<k;){for(C=a,E=0;E<k;++E)P=i[E],P>=p&&P<C&&(C=P);for(W=T+1,C-p>F((a-y)/W)&&Z("overflow"),y+=(C-p)*W,p=C,E=0;E<k;++E)if(P=i[E],P<p&&++y>a&&Z("overflow"),P==p){for(M=y,$=v;B=$<=L?w:$>=L+A?A:$-L,!(M<B);$+=v)me=M-B,J=v-B,N.push(te(ue(B+me%J,0))),M=F(me/J);N.push(te(ue(M,0))),L=oe(y,W,T==R),y=0,++T}++y,++p}return N.join("")}function Le(i){return be(i,function(p){return Ee.test(p)?Te(p.slice(4).toLowerCase()):p})}function Pe(i){return be(i,function(p){return qe.test(p)?"xn--"+we(p):p})}if(u={version:"1.4.1",ucs2:{decode:_e,encode:he},decode:Te,encode:we,toASCII:Pe,toUnicode:Le},f&&n)if(o.exports==f)n.exports=u;else for(ae in u)u.hasOwnProperty(ae)&&(f[ae]=u[ae]);else h.punycode=u})(g.commonjsGlobal)})(Ae,Ae.exports);var et=Ae.exports;(function(o,r){Object.defineProperty(r,"__esModule",{value:!0});var h=et,f=g.require$$2;function n(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var b=n(h),u=n(f),a={isString:function(e){return typeof e=="string"},isObject:function(e){return typeof e=="object"&&e!==null},isNull:function(e){return e===null},isNullOrUndefined:function(e){return e==null}},v=b.default,w=a,A=oe,d=we,x=Le,ee=Te,se=I;function I(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var Ee=/^([a-z0-9.+-]+:)/i,qe=/:[0-9]*$/,Oe=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Ue=["<",">",'"',"`"," ","\r",`
|
|
2
2
|
`," "],ce=["{","}","|","\\","^","`"].concat(Ue),F=["'"].concat(ce),te=["%","/","?",";","#"].concat(F),ae=["/","?","#"],Z=255,pe=/^[+a-z0-9A-Z_-]{0,63}$/,be=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,_e={javascript:!0,"javascript:":!0},he={javascript:!0,"javascript:":!0},re={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},ue=u.default;function oe(e,s,t){if(e&&w.isObject(e)&&e instanceof I)return e;var c=new I;return c.parse(e,s,t),c}I.prototype.parse=function(e,s,t){if(!w.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var c=e.indexOf("?"),_=c!==-1&&c<e.indexOf("#")?"?":"#",D=e.split(_),H=/\\/g;D[0]=D[0].replace(H,"/"),e=D.join(_);var l=e;if(l=l.trim(),!t&&e.split("#").length===1){var K=Oe.exec(l);if(K)return this.path=l,this.href=l,this.pathname=K[1],K[2]?(this.search=K[2],s?this.query=ue.parse(this.search.substr(1)):this.query=this.search.substr(1)):s&&(this.search="",this.query={}),this}var q=Ee.exec(l);if(q){q=q[0];var ie=q.toLowerCase();this.protocol=ie,l=l.substr(q.length)}if(t||q||l.match(/^\/\/[^@\/]+@[^@\/]+/)){var de=l.substr(0,2)==="//";de&&!(q&&he[q])&&(l=l.substr(2),this.slashes=!0)}if(!he[q]&&(de||q&&!re[q])){for(var j=-1,O=0;O<ae.length;O++){var Q=l.indexOf(ae[O]);Q!==-1&&(j===-1||Q<j)&&(j=Q)}var ve,G;j===-1?G=l.lastIndexOf("@"):G=l.lastIndexOf("@",j),G!==-1&&(ve=l.slice(0,G),l=l.slice(G+1),this.auth=decodeURIComponent(ve)),j=-1;for(var O=0;O<te.length;O++){var Q=l.indexOf(te[O]);Q!==-1&&(j===-1||Q<j)&&(j=Q)}j===-1&&(j=l.length),this.host=l.slice(0,j),l=l.slice(j),this.parseHost(),this.hostname=this.hostname||"";var ye=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!ye)for(var m=this.hostname.split(/\./),O=0,U=m.length;O<U;O++){var V=m[O];if(V&&!V.match(pe)){for(var z="",X=0,Se=V.length;X<Se;X++)V.charCodeAt(X)>127?z+="x":z+=V[X];if(!z.match(pe)){var ne=m.slice(0,O),Y=m.slice(O+1),le=V.match(be);le&&(ne.push(le[1]),Y.unshift(le[2])),Y.length&&(l="/"+Y.join(".")+l),this.hostname=ne.join(".");break}}}this.hostname.length>Z?this.hostname="":this.hostname=this.hostname.toLowerCase(),ye||(this.hostname=v.toASCII(this.hostname));var Ie=this.port?":"+this.port:"",ot=this.hostname||"";this.host=ot+Ie,this.href+=this.host,ye&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),l[0]!=="/"&&(l="/"+l))}if(!_e[ie])for(var O=0,U=F.length;O<U;O++){var ge=F[O];if(l.indexOf(ge)!==-1){var je=encodeURIComponent(ge);je===ge&&(je=escape(ge)),l=l.split(ge).join(je)}}var Fe=l.indexOf("#");Fe!==-1&&(this.hash=l.substr(Fe),l=l.slice(0,Fe));var Re=l.indexOf("?");if(Re!==-1?(this.search=l.substr(Re),this.query=l.substr(Re+1),s&&(this.query=ue.parse(this.query)),l=l.slice(0,Re)):s&&(this.search="",this.query={}),l&&(this.pathname=l),re[ie]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var Ie=this.pathname||"",nt=this.search||"";this.path=Ie+nt}return this.href=this.format(),this};function Te(e){return w.isString(e)&&(e=oe(e)),e instanceof I?e.format():I.prototype.format.call(e)}I.prototype.format=function(){var e=this.auth||"";e&&(e=encodeURIComponent(e),e=e.replace(/%3A/i,":"),e+="@");var s=this.protocol||"",t=this.pathname||"",c=this.hash||"",_=!1,D="";this.host?_=e+this.host:this.hostname&&(_=e+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(_+=":"+this.port)),this.query&&w.isObject(this.query)&&Object.keys(this.query).length&&(D=ue.stringify(this.query));var H=this.search||D&&"?"+D||"";return s&&s.substr(-1)!==":"&&(s+=":"),this.slashes||(!s||re[s])&&_!==!1?(_="//"+(_||""),t&&t.charAt(0)!=="/"&&(t="/"+t)):_||(_=""),c&&c.charAt(0)!=="#"&&(c="#"+c),H&&H.charAt(0)!=="?"&&(H="?"+H),t=t.replace(/[?#]/g,function(l){return encodeURIComponent(l)}),H=H.replace("#","%23"),s+_+t+H+c};function we(e,s){return oe(e,!1,!0).resolve(s)}I.prototype.resolve=function(e){return this.resolveObject(oe(e,!1,!0)).format()};function Le(e,s){return e?oe(e,!1,!0).resolveObject(s):s}I.prototype.resolveObject=function(e){if(w.isString(e)){var s=new I;s.parse(e,!1,!0),e=s}for(var t=new I,c=Object.keys(this),_=0;_<c.length;_++){var D=c[_];t[D]=this[D]}if(t.hash=e.hash,e.href==="")return t.href=t.format(),t;if(e.slashes&&!e.protocol){for(var H=Object.keys(e),l=0;l<H.length;l++){var K=H[l];K!=="protocol"&&(t[K]=e[K])}return re[t.protocol]&&t.hostname&&!t.pathname&&(t.path=t.pathname="/"),t.href=t.format(),t}if(e.protocol&&e.protocol!==t.protocol){if(!re[e.protocol]){for(var q=Object.keys(e),ie=0;ie<q.length;ie++){var de=q[ie];t[de]=e[de]}return t.href=t.format(),t}if(t.protocol=e.protocol,!e.host&&!he[e.protocol]){for(var U=(e.pathname||"").split("/");U.length&&!(e.host=U.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),U[0]!==""&&U.unshift(""),U.length<2&&U.unshift(""),t.pathname=U.join("/")}else t.pathname=e.pathname;if(t.search=e.search,t.query=e.query,t.host=e.host||"",t.auth=e.auth,t.hostname=e.hostname||e.host,t.port=e.port,t.pathname||t.search){var j=t.pathname||"",O=t.search||"";t.path=j+O}return t.slashes=t.slashes||e.slashes,t.href=t.format(),t}var Q=t.pathname&&t.pathname.charAt(0)==="/",ve=e.host||e.pathname&&e.pathname.charAt(0)==="/",G=ve||Q||t.host&&e.pathname,ye=G,m=t.pathname&&t.pathname.split("/")||[],U=e.pathname&&e.pathname.split("/")||[],V=t.protocol&&!re[t.protocol];if(V&&(t.hostname="",t.port=null,t.host&&(m[0]===""?m[0]=t.host:m.unshift(t.host)),t.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(U[0]===""?U[0]=e.host:U.unshift(e.host)),e.host=null),G=G&&(U[0]===""||m[0]==="")),ve)t.host=e.host||e.host===""?e.host:t.host,t.hostname=e.hostname||e.hostname===""?e.hostname:t.hostname,t.search=e.search,t.query=e.query,m=U;else if(U.length)m||(m=[]),m.pop(),m=m.concat(U),t.search=e.search,t.query=e.query;else if(!w.isNullOrUndefined(e.search)){if(V){t.hostname=t.host=m.shift();var z=t.host&&t.host.indexOf("@")>0?t.host.split("@"):!1;z&&(t.auth=z.shift(),t.host=t.hostname=z.shift())}return t.search=e.search,t.query=e.query,(!w.isNull(t.pathname)||!w.isNull(t.search))&&(t.path=(t.pathname?t.pathname:"")+(t.search?t.search:"")),t.href=t.format(),t}if(!m.length)return t.pathname=null,t.search?t.path="/"+t.search:t.path=null,t.href=t.format(),t;for(var X=m.slice(-1)[0],Se=(t.host||e.host||m.length>1)&&(X==="."||X==="..")||X==="",ne=0,Y=m.length;Y>=0;Y--)X=m[Y],X==="."?m.splice(Y,1):X===".."?(m.splice(Y,1),ne++):ne&&(m.splice(Y,1),ne--);if(!G&&!ye)for(;ne--;ne)m.unshift("..");G&&m[0]!==""&&(!m[0]||m[0].charAt(0)!=="/")&&m.unshift(""),Se&&m.join("/").substr(-1)!=="/"&&m.push("");var le=m[0]===""||m[0]&&m[0].charAt(0)==="/";if(V){t.hostname=t.host=le?"":m.length?m.shift():"";var z=t.host&&t.host.indexOf("@")>0?t.host.split("@"):!1;z&&(t.auth=z.shift(),t.host=t.hostname=z.shift())}return G=G||t.host&&m.length,G&&!le&&m.unshift(""),m.length?t.pathname=m.join("/"):(t.pathname=null,t.path=null),(!w.isNull(t.pathname)||!w.isNull(t.search))&&(t.path=(t.pathname?t.pathname:"")+(t.search?t.search:"")),t.auth=e.auth||t.auth,t.slashes=t.slashes||e.slashes,t.href=t.format(),t},I.prototype.parseHost=function(){var e=this.host,s=qe.exec(e);s&&(s=s[0],s!==":"&&(this.port=s.substr(1)),e=e.substr(0,e.length-s.length)),e&&(this.hostname=e)};function Pe(e,s){for(var t=0,c=e.length-1;c>=0;c--){var _=e[c];_==="."?e.splice(c,1):_===".."?(e.splice(c,1),t++):t&&(e.splice(c,1),t--)}if(s)for(;t--;t)e.unshift("..");return e}function i(){for(var e="",s=!1,t=arguments.length-1;t>=-1&&!s;t--){var c=t>=0?arguments[t]:"/";if(typeof c!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!c)continue;e=c+"/"+e,s=c.charAt(0)==="/"}return e=Pe(p(e.split("/"),function(_){return!!_}),!s).join("/"),(s?"/":"")+e||"."}function p(e,s){if(e.filter)return e.filter(s);for(var t=[],c=0;c<e.length;c++)s(e[c],c,e)&&t.push(e[c]);return t}var y=function(e){function s(){var c=this||self;return delete e.prototype.__magic__,c}if(typeof globalThis=="object")return globalThis;if(this)return s();e.defineProperty(e.prototype,"__magic__",{configurable:!0,get:s});var t=__magic__;return t}(Object),T=ee,R=A,L=d,E=se,C=y.URL,M=y.URLSearchParams,$=/%/g,B=/\\/g,P=/\n/g,N=/\r/g,k=/\t/g,W=47;function J(e){var s=e??null;return!!(s!==null&&(s!=null&&s.href)&&(s!=null&&s.origin))}function me(e){if(e.hostname!=="")throw new TypeError('File URL host must be "localhost" or empty on browser');for(var s=e.pathname,t=0;t<s.length;t++)if(s[t]==="%"){var c=s.codePointAt(t+2)|32;if(s[t+1]==="2"&&c===102)throw new TypeError("File URL path must not include encoded / characters")}return decodeURIComponent(s)}function rt(e){return e.includes("%")&&(e=e.replace($,"%25")),e.includes("\\")&&(e=e.replace(B,"%5C")),e.includes(`
|
|
3
3
|
`)&&(e=e.replace(P,"%0A")),e.includes("\r")&&(e=e.replace(N,"%0D")),e.includes(" ")&&(e=e.replace(k,"%09")),e}var $e=function(s){if(typeof s>"u")throw new TypeError('The "domain" argument must be specified');return new C("http://"+s).hostname},Be=function(s){if(typeof s>"u")throw new TypeError('The "domain" argument must be specified');return new C("http://"+s).hostname},ze=function(s){var t=new C("file://"),c=i(s),_=s.charCodeAt(s.length-1);return _===W&&c[c.length-1]!=="/"&&(c+="/"),t.pathname=rt(c),t},Xe=function(s){if(!J(s)&&typeof s!="string")throw new TypeError('The "path" argument must be of type string or an instance of URL. Received type '+typeof s+" ("+s+")");var t=new C(s);if(t.protocol!=="file:")throw new TypeError("The URL must be of scheme file");return me(t)},We=function(s,t){var c,_,D;if(t===void 0&&(t={}),!(s instanceof C))return T(s);if(typeof t!="object"||t===null)throw new TypeError('The "options" argument must be of type object.');var H=(c=t.auth)!=null?c:!0,l=(_=t.fragment)!=null?_:!0,K=(D=t.search)!=null?D:!0,q=new C(s.toString());return H||(q.username="",q.password=""),l||(q.hash=""),K||(q.search=""),q.toString()},Ke={format:We,parse:R,resolve:L,resolveObject:x,Url:E,URL:C,URLSearchParams:M,domainToASCII:$e,domainToUnicode:Be,pathToFileURL:ze,fileURLToPath:Xe};r.URL=C,r.URLSearchParams=M,r.Url=E,r.default=Ke,r.domainToASCII=$e,r.domainToUnicode=Be,r.fileURLToPath=Xe,r.format=We,r.parse=R,r.pathToFileURL=ze,r.resolve=L,r.resolveObject=x,r=o.exports=Ke})(Me,Me.exports);var De=Me.exports;(function(o){var r=lt,h=xe,f=ct,n=dt,b=De,u=o;u.request=function(a,v){typeof a=="string"?a=b.parse(a):a=f(a);var w=g.commonjsGlobal.location.protocol.search(/^https?:$/)===-1?"http:":"",A=a.protocol||w,d=a.hostname||a.host,x=a.port,ee=a.path||"/";d&&d.indexOf(":")!==-1&&(d="["+d+"]"),a.url=(d?A+"//"+d:"")+(x?":"+x:"")+ee,a.method=(a.method||"GET").toUpperCase(),a.headers=a.headers||{};var se=new r(a);return v&&se.on("response",v),se},u.get=function(v,w){var A=u.request(v,w);return A.end(),A},u.ClientRequest=r,u.IncomingMessage=h.IncomingMessage,u.Agent=function(){},u.Agent.defaultMaxSockets=4,u.globalAgent=new u.Agent,u.STATUS_CODES=n,u.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]})(Ne);var tt={exports:{}};(function(o){var r=Ne,h=De,f=o.exports;for(var n in r)r.hasOwnProperty(n)&&(f[n]=r[n]);f.request=function(u,a){return u=b(u),r.request.call(this,u,a)},f.get=function(u,a){return u=b(u),r.get.call(this,u,a)};function b(u){if(typeof u=="string"&&(u=h.parse(u)),u.protocol||(u.protocol="https:"),u.protocol!=="https:")throw new Error('Protocol "'+u.protocol+'" not supported. Expected "https:"');return u}})(tt);var vt=tt.exports;exports.httpsBrowserifyExports=vt;exports.punycodeExports=et;exports.streamHttp=Ne;exports.urlExports=De;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var m=Object.defineProperty;var u=(i,e,t)=>e in i?m(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var s=(i,e,t)=>(u(i,typeof e!="symbol"?e+"":e,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./index-
|
|
1
|
+
"use strict";var m=Object.defineProperty;var u=(i,e,t)=>e in i?m(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var s=(i,e,t)=>(u(i,typeof e!="symbol"?e+"":e,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./index-C2_AHiqv.js"),w=require("./aptos-DfMox9Nu.js"),g=require("./create-D65JDX7A.js"),p=require("./chain-C453VbjW.js");class c{constructor(e,t,r,o){s(this,"network");s(this,"chain");s(this,"connection");s(this,"contracts");s(this,"chainId");s(this,"coreBridge");this.network=e,this.chain=t,this.connection=r,this.contracts=o,this.chainId=d.toChainId(t);const n=o.coreBridge;if(!n)throw new Error(`CoreBridge contract Address for chain ${t} not found`);this.coreBridge=n}getGuardianSet(e){throw new Error("Method not implemented.")}getGuardianSetIndex(){throw new Error("Method not implemented.")}getMessageFee(){throw new Error("Method not implemented.")}static async fromRpc(e,t){const[r,o]=await w.AptosPlatform.chainFromRpc(e),n=t[o];if(n.network!==r)throw new Error(`Network mismatch: ${n.network} !== ${r}`);return new c(r,o,e,n.contracts)}async*publishMessage(e,t){throw new Error("Method not implemented.")}async*verifyMessage(e,t){throw new Error("Not implemented.")}async parseTransaction(e){return(await this.parseMessages(e)).map(r=>({chain:r.emitterChain,emitter:r.emitterAddress,sequence:r.sequence}))}async parseMessages(e){const t=await this.connection.getTransactionByHash(e);if(t.type!=="user_transaction")throw new Error(`${e} is not a user_transaction`);const o=t.events.filter(n=>n.type.endsWith("WormholeMessage"));if(!o||o.length===0)throw new Error(`WormholeMessage not found for ${e}`);return o.map(n=>{const a=n.data,h=new d.UniversalAddress(BigInt(a.sender).toString(16).padStart(64,"0"));return g.createVAA("Uint8Array",{guardianSet:0,emitterChain:this.chain,emitterAddress:h,sequence:BigInt(a.sequence),timestamp:Number(a.timestamp),consistencyLevel:a.consistency_level,nonce:Number(a.nonce),signatures:[],payload:d.hex.decode(a.payload)})})}}p.registerProtocol("Aptos","WormholeCore",c);exports.AptosWormholeCore=c;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as e, T as f, A as c } from "./solana-
|
|
2
|
-
import { aI as d, aJ as s, cb as o, c9 as A, aL as O, ca as p } from "./index-
|
|
1
|
+
import { P as e, T as f, A as c } from "./solana-DHrthY4V.mjs";
|
|
2
|
+
import { aI as d, aJ as s, cb as o, c9 as A, aL as O, ca as p } from "./index-DXycTbzg.mjs";
|
|
3
3
|
class m extends Error {
|
|
4
4
|
constructor(r) {
|
|
5
5
|
super(r);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
var N = Object.defineProperty;
|
|
2
2
|
var W = (h, t, e) => t in h ? N(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), e);
|
|
4
|
-
import "./index-
|
|
5
|
-
import { C as p, a as i, G as v, _ as x } from "./cosmwasm-
|
|
6
|
-
import { b as o, c as g, C as E } from "./unsignedTransaction-
|
|
7
|
-
import { az as u, b4 as d, bp as B, bO as S, c6 as q, au as I, b_ as y } from "./index-
|
|
8
|
-
import { r as D } from "./chain-
|
|
4
|
+
import "./index-CSkBcw-D.mjs";
|
|
5
|
+
import { C as p, a as i, G as v, _ as x } from "./cosmwasm-CZWC0Vwt.mjs";
|
|
6
|
+
import { b as o, c as g, C as E } from "./unsignedTransaction-B7ANn3fF.mjs";
|
|
7
|
+
import { az as u, b4 as d, bp as B, bO as S, c6 as q, au as I, b_ as y } from "./index-DXycTbzg.mjs";
|
|
8
|
+
import { r as D } from "./chain-BqdQffpz.mjs";
|
|
9
9
|
class k {
|
|
10
10
|
constructor(t, e, r, s) {
|
|
11
11
|
c(this, "network");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { y as er, d as Y, ab as qc, n as Tu, g as Lc, bP as Uc, a1 as Ou, a5 as Bu } from "./index-
|
|
1
|
+
import { y as er, d as Y, ab as qc, n as Tu, g as Lc, bP as Uc, a1 as Ou, a5 as Bu } from "./index-DXycTbzg.mjs";
|
|
2
2
|
import { d as ku } from "./dijkstra-BZM-8g-B.mjs";
|
|
3
|
-
import { r as Fu, h as ei, i as Dr, j as Ct, l as Nn, c as Du, a as qu, g as $o, s as Lu, d as Uu, k as $u, b as zu, I as zr, f as Tt, t as It, e as zo, C as Ku, G as ju, E as ft, y as yt, m as Zs, F as Vu, n as Ko, p as Hu, q as Wu, o as $c, u as Qu, v as eo, w as to, x as zc, z as Qt, Y as Gu, A as Qr } from "./browser-
|
|
4
|
-
import { c as K, s as ro, x as Kc, r as jc, H as Yu, a as Vc, q as dn } from "./index-
|
|
3
|
+
import { r as Fu, h as ei, i as Dr, j as Ct, l as Nn, c as Du, a as qu, g as $o, s as Lu, d as Uu, k as $u, b as zu, I as zr, f as Tt, t as It, e as zo, C as Ku, G as ju, E as ft, y as yt, m as Zs, F as Vu, n as Ko, p as Hu, q as Wu, o as $c, u as Qu, v as eo, w as to, x as zc, z as Qt, Y as Gu, A as Qr } from "./browser-ByPSU-Sm.mjs";
|
|
4
|
+
import { c as K, s as ro, x as Kc, r as jc, H as Yu, a as Vc, q as dn } from "./index-CY3avmpk.mjs";
|
|
5
5
|
let Ju = class extends Fu {
|
|
6
6
|
constructor(e) {
|
|
7
7
|
super(e), this.events = new er.EventEmitter(), this.hasRegisteredEventListeners = !1, this.connection = this.setConnection(e), this.connection.connected && this.registerEventListeners();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var D=Object.defineProperty;var H=(o,e,t)=>e in o?D(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var p=(o,e,t)=>(H(o,typeof e!="symbol"?e+"":e,t),t);const n=require("./index-D64qU2ma.js"),l=require("./algorand-B_zsKIUB.js"),z=require("./create-b6djXgrD.js"),$=require("./chain-B6MIHCrl.js");class K{constructor(e,t,r,s,i=!1){p(this,"transaction");p(this,"network");p(this,"chain");p(this,"description");p(this,"parallelizable");this.transaction=e,this.network=t,this.chain=r,this.description=s,this.parallelizable=i}}const V=1002e3,U=15,L=127,C=8,N=L*C,F=L*U,O=C*F,y={_limit:127,encodingLength:o=>{let e=0;for(;o>=128;e++)o>>=7;return e+1},encode:(o,e,t)=>{if(typeof o=="bigint"&&(o=l.safeBigIntToNumber(o)),o<0)throw new RangeError("value must be unsigned");const r=y.encodingLength(o);if(e=e||new ArrayBuffer(r),t=t||0,e.byteLength<t+r)throw new RangeError("the buffer is too small to encode the number at the offset");const s=new Uint8Array(e,t);let i=0;for(;y._limit<o;)s[i++]=o&y._limit|128,o>>=7;return s[i]=Number(o),s},decode:(o,e=0)=>{let t=0,r=0,s;do{if(s=o[e+r],s===void 0)throw new RangeError("offset out of range");t+=(s&y._limit)<<r*7,r++}while(128<=s);return t}},u={forMessageId:(o,e)=>{const t=n.decodeAddress(n.getApplicationAddress(o)).publicKey,r=e.emitter.toUniversalAddress().toUint8Array(),s=n.bignum.toBytes(BigInt(n.toChainId(e.chain)),2),i=n.bytes.concat(s,r);return u.fromData({appId:o,appAddress:t,idx:e.sequence/BigInt(O),address:i})},forWrappedAsset:(o,e)=>{if(n.isNative(e.address))throw new Error("native asset cannot be a wrapped asset");const t=n.decodeAddress(n.getApplicationAddress(o)).publicKey;return u.fromData({appId:o,appAddress:t,idx:BigInt(n.toChainId(e.chain)),address:e.address.toUniversalAddress().toUint8Array()})},forNativeAsset:(o,e)=>{const t=n.decodeAddress(n.getApplicationAddress(o)).publicKey;return u.fromData({appId:o,appAddress:t,idx:e,address:n.bytes.encode("native")})},forGuardianSet:(o,e)=>{const t=n.decodeAddress(n.getApplicationAddress(o)).publicKey;return u.fromData({appId:o,appAddress:t,idx:BigInt(e),address:n.bytes.encode("guardian")})},forEmitter:(o,e)=>{const t=n.decodeAddress(n.getApplicationAddress(o)).publicKey;return u.fromData({appId:o,appAddress:t,idx:0n,address:e})},_encode:o=>typeof o=="bigint"?[n.hex.encode(y.encode(o))]:[n.hex.encode(y.encode(o.length)),n.hex.encode(o)],fromData:o=>{const e=["0620010181",...u._encode(o.idx),"4880",...u._encode(o.address),"483110810612443119221244311881",...u._encode(o.appId),"1244312080",...u._encode(o.appAddress),"124431018100124431093203124431153203124422"],t=n.hex.decode(e.join(""));return new n.LogicSigAccount(t)},decodeLocalState:async(o,e,t)=>{let r;try{const a=await o.accountApplicationInformation(t,l.safeBigIntToNumber(e)).do();r=n.AccountApplicationResponse.from_obj_for_encoding(a).appLocalState}catch{return new Uint8Array}const s=n.b64.encode("meta");let i=new Map;for(const a of r.keyValue){if(a.key===s)continue;const g=n.b64.decode(a.key)[0],A=n.b64.decode(a.value.bytes);i.set(g,A)}const d=[];for(let a=0;a<U;a++)i.has(a)&&d.push(i.get(a));return n.bytes.concat(...d)},checkBitsSet:async(o,e,t,r)=>{let s=!1,i;const d=await o.accountInformation(t).do(),g=n.Account.from_obj_for_encoding(d).appsLocalState;if(g&&g.forEach(m=>{BigInt(m.id)===e&&(i=m.keyValue)}),(i==null?void 0:i.length)===0)return s;const A=BigInt(O),h=BigInt(8),b=r/A*A,x=l.safeBigIntToNumber(r-b),w=Math.floor(x/N),I=Math.floor((x-w*N)/8),_=n.b64.encode(n.bignum.toBytes(w,1));return i==null||i.forEach(m=>{if(m.key===_){const k=n.dist.Buffer.from(m.value.bytes,"base64"),S=1<<l.safeBigIntToNumber(r%h);s=(k[I]&S)!=0;return}}),s},storageAccountExists:async(o,e,t)=>{try{const r=await o.accountApplicationInformation(e,l.safeBigIntToNumber(t)).do();return Object.keys(r).length>0}catch{}return!1}},c=class c{constructor(e,t,r,s){p(this,"network");p(this,"chain");p(this,"connection");p(this,"contracts");p(this,"chainId");p(this,"coreAppId");p(this,"coreAppAddress");p(this,"tokenBridgeAppId");p(this,"tokenBridgeAppAddress");if(this.network=e,this.chain=t,this.connection=r,this.contracts=s,this.chainId=n.toChainId(t),!s.coreBridge)throw new Error(`Core contract address for chain ${t} not found`);const i=BigInt(s.coreBridge);if(this.coreAppId=i,this.coreAppAddress=n.getApplicationAddress(i),!s.tokenBridge)throw new Error(`TokenBridge contract address for chain ${t} not found`);const d=BigInt(s.tokenBridge);this.tokenBridgeAppId=d,this.tokenBridgeAppAddress=n.getApplicationAddress(d)}getGuardianSet(e){throw new Error("Method not implemented.")}async*verifyMessage(e,t,r){const s=new l.AlgorandAddress(e).toString(),i=await c.submitVAAHeader(this.connection,this.coreAppId,r??this.coreAppId,t,s);for(const d of i.txs)yield this.createUnsignedTx(d,"Core.verifyMessage")}static async fromRpc(e,t){const[r,s]=await l.AlgorandPlatform.chainFromRpc(e),i=t[s];if(i.network!==r)throw new Error(`Network mismatch: ${i.network} !== ${r}`);return new c(r,s,e,i.contracts)}async*publishMessage(e,t){const r=new l.AlgorandAddress(e),s=r.toString(),i=await this.connection.getTransactionParams().do(),d=u.forEmitter(this.coreAppId,r.toUint8Array()),{accounts:a,txs:g}=await c.maybeCreateStorageTx(this.connection,s,this.coreAppId,d,i);for(const h of g)yield this.createUnsignedTx(h,"Core.publishMessage",!0);const A=n.makeApplicationCallTxnFromObject({from:s,appIndex:l.safeBigIntToNumber(this.coreAppId),appArgs:[c.publishMessage,t,n.bignum.toBytes(0n,8)],accounts:a,onComplete:n.OnApplicationComplete.NoOpOC,suggestedParams:i});yield this.createUnsignedTx({tx:A},"Core.publishMessage",!0)}async getMessageFee(){var s;const e=await this.connection.getApplicationByID(l.safeBigIntToNumber(this.coreAppId)).do(),r=(s=n.Application.from_obj_for_encoding(e).params.globalState)==null?void 0:s.find(i=>i.key===c.feeKey);return r?BigInt(r.value.uint):0n}async getGuardianSetIndex(){throw new Error("Not implemented")}async parseTransaction(e){const t=await this.connection.pendingTransactionInformation(e).do(),r=n.PendingTransactionResponse.from_obj_for_encoding(t);return this.parseTx(r).map(s=>({chain:s.emitterChain,emitter:s.emitterAddress,sequence:s.sequence}))}async parseMessages(e){const t=await this.connection.pendingTransactionInformation(e).do(),r=n.PendingTransactionResponse.from_obj_for_encoding(t);return this.parseTx(r)}parseTx(e){const t=[];if(e.innerTxns&&e.innerTxns.length>0&&t.push(...e.innerTxns.flatMap(g=>this.parseTx(g))),BigInt(e.txn.txn.apid??0)!==this.coreAppId||!e.logs||e.logs.length===0)return t;const r=e.txn.txn.apaa??[];if(r.length!==3||!n.bytes.equals(new Uint8Array(r[0]),c.publishMessage))return t;const s=n.bignum.decode(e.logs[0]),i=new l.AlgorandAddress(e.txn.txn.snd).toUniversalAddress(),d=new Uint8Array(r[1]),a=n.bignum.decode(r[2]);return t.push(z.createVAA("Uint8Array",{emitterChain:this.chain,emitterAddress:i,sequence:s,guardianSet:0,timestamp:0,consistencyLevel:0,nonce:Number(a),payload:d,signatures:[]})),t}static async maybeCreateStorageTx(e,t,r,s,i){const d=n.getApplicationAddress(r),a=s.address(),g=[];if(await u.storageAccountExists(e,a,r))return{accounts:[a],txs:g};i=i??await e.getTransactionParams().do();const A=n.makePaymentTxnWithSuggestedParamsFromObject({from:t,to:a,amount:V,suggestedParams:i});A.fee=A.fee*2,g.push({tx:A});const h=n.makeApplicationOptInTxnFromObject({from:a,appIndex:l.safeBigIntToNumber(r),rekeyTo:d,suggestedParams:i});return h.fee=0,g.push({tx:h,signer:{address:s.address(),signTxn:b=>Promise.resolve(n.signLogicSigTransaction(b,s).blob)}}),{accounts:[a],txs:g}}static async submitVAAHeader(e,t,r,s,i,d){d=d??await e.getTransactionParams().do();let a=[];const g=u.forMessageId(r,{chain:s.emitterChain,sequence:s.sequence,emitter:s.emitterAddress}),{accounts:A,txs:h}=await c.maybeCreateStorageTx(e,i,r,g,d);a.push(...h);const b=u.forGuardianSet(t,s.guardianSet),{accounts:[x],txs:w}=await c.maybeCreateStorageTx(e,i,t,b,d);a.push(...w);let I=[...A,x];const _=await u.decodeLocalState(e,t,x),m=n.keccak_256(s.hash),k=s.signatures.length,S=Math.ceil(k/c.MAX_SIGS_PER_TXN),E=20,v=new n.LogicSigAccount(c.ALGO_VERIFY);for(let R=0;R<S;R++){const G=R*c.MAX_SIGS_PER_TXN,B=s.signatures.slice(G,G+c.MAX_SIGS_PER_TXN),Y=B.length*E,X=new Uint8Array(Y);for(let f=0;f<B.length;f++){const j=B[f],q=_.slice(j.guardianIndex*E+1,(j.guardianIndex+1)*E+1);X.set(q,f*20)}const P=n.makeApplicationCallTxnFromObject({appArgs:[c.verifySigs,n.bytes.concat(...B.map(f=>n.bytes.concat(new Uint8Array([f.guardianIndex]),f.signature.encode()))),X,m],accounts:I,appIndex:l.safeBigIntToNumber(t),from:c.ALGO_VERIFY_HASH,onComplete:n.OnApplicationComplete.NoOpOC,suggestedParams:d});P.fee=0,a.push({tx:P,signer:{address:v.address(),signTxn:f=>Promise.resolve(n.signLogicSigTransaction(f,v).blob)}})}const M=n.makeApplicationCallTxnFromObject({appArgs:[c.verifyVaa,n.serialize(s)],accounts:I,appIndex:l.safeBigIntToNumber(t),from:i,onComplete:n.OnApplicationComplete.NoOpOC,suggestedParams:d});return M.fee=M.fee*(2+S),a.push({tx:M}),{accounts:I,txs:a}}createUnsignedTx(e,t,r=!0){return new K(e,this.network,this.chain,t,r)}};p(c,"MAX_SIGS_PER_TXN",6),p(c,"ALGO_VERIFY_HASH","EZATROXX2HISIRZDRGXW4LRQ46Z6IUJYYIHU3PJGP7P5IQDPKVX42N767A"),p(c,"ALGO_VERIFY",new Uint8Array([6,32,4,1,0,32,20,38,1,0,49,32,50,3,18,68,49,1,35,18,68,49,16,129,6,18,68,54,26,1,54,26,3,54,26,2,136,0,3,68,34,67,53,2,53,1,53,0,40,53,240,40,53,241,52,0,21,53,5,35,53,3,35,53,4,52,3,52,5,12,65,0,68,52,1,52,0,52,3,129,65,8,34,88,23,52,0,52,3,34,8,36,88,52,0,52,3,129,33,8,36,88,7,0,53,241,53,240,52,2,52,4,37,88,52,240,52,241,80,2,87,12,20,18,68,52,3,129,66,8,53,3,52,4,37,8,53,4,66,255,180,34,137])),p(c,"feeKey",n.b64.encode("MessageFee")),p(c,"verifyVaa",n.bytes.encode("verifyVAA")),p(c,"verifySigs",n.bytes.encode("verifySigs")),p(c,"publishMessage",n.bytes.encode("publishMessage"));let T=c;$.registerProtocol("Algorand","WormholeCore",T);const Z=Object.freeze(Object.defineProperty({__proto__:null,AlgorandWormholeCore:T,BITS_PER_BYTE:C,BITS_PER_KEY:N,MAX_BITS:O,MAX_BYTES:F,MAX_BYTES_PER_KEY:L,MAX_KEYS:U,SEED_AMT:V,StorageLogicSig:u,varint:y},Symbol.toStringTag,{value:"Module"}));exports.AlgorandUnsignedTransaction=K;exports.AlgorandWormholeCore=T;exports.StorageLogicSig=u;exports.index=Z;
|
|
1
|
+
"use strict";var D=Object.defineProperty;var H=(o,e,t)=>e in o?D(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var p=(o,e,t)=>(H(o,typeof e!="symbol"?e+"":e,t),t);const n=require("./index-C2_AHiqv.js"),l=require("./algorand-CVFKJ49n.js"),z=require("./create-D65JDX7A.js"),$=require("./chain-C453VbjW.js");class K{constructor(e,t,r,s,i=!1){p(this,"transaction");p(this,"network");p(this,"chain");p(this,"description");p(this,"parallelizable");this.transaction=e,this.network=t,this.chain=r,this.description=s,this.parallelizable=i}}const V=1002e3,U=15,L=127,C=8,N=L*C,F=L*U,O=C*F,y={_limit:127,encodingLength:o=>{let e=0;for(;o>=128;e++)o>>=7;return e+1},encode:(o,e,t)=>{if(typeof o=="bigint"&&(o=l.safeBigIntToNumber(o)),o<0)throw new RangeError("value must be unsigned");const r=y.encodingLength(o);if(e=e||new ArrayBuffer(r),t=t||0,e.byteLength<t+r)throw new RangeError("the buffer is too small to encode the number at the offset");const s=new Uint8Array(e,t);let i=0;for(;y._limit<o;)s[i++]=o&y._limit|128,o>>=7;return s[i]=Number(o),s},decode:(o,e=0)=>{let t=0,r=0,s;do{if(s=o[e+r],s===void 0)throw new RangeError("offset out of range");t+=(s&y._limit)<<r*7,r++}while(128<=s);return t}},u={forMessageId:(o,e)=>{const t=n.decodeAddress(n.getApplicationAddress(o)).publicKey,r=e.emitter.toUniversalAddress().toUint8Array(),s=n.bignum.toBytes(BigInt(n.toChainId(e.chain)),2),i=n.bytes.concat(s,r);return u.fromData({appId:o,appAddress:t,idx:e.sequence/BigInt(O),address:i})},forWrappedAsset:(o,e)=>{if(n.isNative(e.address))throw new Error("native asset cannot be a wrapped asset");const t=n.decodeAddress(n.getApplicationAddress(o)).publicKey;return u.fromData({appId:o,appAddress:t,idx:BigInt(n.toChainId(e.chain)),address:e.address.toUniversalAddress().toUint8Array()})},forNativeAsset:(o,e)=>{const t=n.decodeAddress(n.getApplicationAddress(o)).publicKey;return u.fromData({appId:o,appAddress:t,idx:e,address:n.bytes.encode("native")})},forGuardianSet:(o,e)=>{const t=n.decodeAddress(n.getApplicationAddress(o)).publicKey;return u.fromData({appId:o,appAddress:t,idx:BigInt(e),address:n.bytes.encode("guardian")})},forEmitter:(o,e)=>{const t=n.decodeAddress(n.getApplicationAddress(o)).publicKey;return u.fromData({appId:o,appAddress:t,idx:0n,address:e})},_encode:o=>typeof o=="bigint"?[n.hex.encode(y.encode(o))]:[n.hex.encode(y.encode(o.length)),n.hex.encode(o)],fromData:o=>{const e=["0620010181",...u._encode(o.idx),"4880",...u._encode(o.address),"483110810612443119221244311881",...u._encode(o.appId),"1244312080",...u._encode(o.appAddress),"124431018100124431093203124431153203124422"],t=n.hex.decode(e.join(""));return new n.LogicSigAccount(t)},decodeLocalState:async(o,e,t)=>{let r;try{const a=await o.accountApplicationInformation(t,l.safeBigIntToNumber(e)).do();r=n.AccountApplicationResponse.from_obj_for_encoding(a).appLocalState}catch{return new Uint8Array}const s=n.b64.encode("meta");let i=new Map;for(const a of r.keyValue){if(a.key===s)continue;const g=n.b64.decode(a.key)[0],A=n.b64.decode(a.value.bytes);i.set(g,A)}const d=[];for(let a=0;a<U;a++)i.has(a)&&d.push(i.get(a));return n.bytes.concat(...d)},checkBitsSet:async(o,e,t,r)=>{let s=!1,i;const d=await o.accountInformation(t).do(),g=n.Account.from_obj_for_encoding(d).appsLocalState;if(g&&g.forEach(m=>{BigInt(m.id)===e&&(i=m.keyValue)}),(i==null?void 0:i.length)===0)return s;const A=BigInt(O),h=BigInt(8),b=r/A*A,x=l.safeBigIntToNumber(r-b),w=Math.floor(x/N),I=Math.floor((x-w*N)/8),_=n.b64.encode(n.bignum.toBytes(w,1));return i==null||i.forEach(m=>{if(m.key===_){const k=n.dist.Buffer.from(m.value.bytes,"base64"),S=1<<l.safeBigIntToNumber(r%h);s=(k[I]&S)!=0;return}}),s},storageAccountExists:async(o,e,t)=>{try{const r=await o.accountApplicationInformation(e,l.safeBigIntToNumber(t)).do();return Object.keys(r).length>0}catch{}return!1}},c=class c{constructor(e,t,r,s){p(this,"network");p(this,"chain");p(this,"connection");p(this,"contracts");p(this,"chainId");p(this,"coreAppId");p(this,"coreAppAddress");p(this,"tokenBridgeAppId");p(this,"tokenBridgeAppAddress");if(this.network=e,this.chain=t,this.connection=r,this.contracts=s,this.chainId=n.toChainId(t),!s.coreBridge)throw new Error(`Core contract address for chain ${t} not found`);const i=BigInt(s.coreBridge);if(this.coreAppId=i,this.coreAppAddress=n.getApplicationAddress(i),!s.tokenBridge)throw new Error(`TokenBridge contract address for chain ${t} not found`);const d=BigInt(s.tokenBridge);this.tokenBridgeAppId=d,this.tokenBridgeAppAddress=n.getApplicationAddress(d)}getGuardianSet(e){throw new Error("Method not implemented.")}async*verifyMessage(e,t,r){const s=new l.AlgorandAddress(e).toString(),i=await c.submitVAAHeader(this.connection,this.coreAppId,r??this.coreAppId,t,s);for(const d of i.txs)yield this.createUnsignedTx(d,"Core.verifyMessage")}static async fromRpc(e,t){const[r,s]=await l.AlgorandPlatform.chainFromRpc(e),i=t[s];if(i.network!==r)throw new Error(`Network mismatch: ${i.network} !== ${r}`);return new c(r,s,e,i.contracts)}async*publishMessage(e,t){const r=new l.AlgorandAddress(e),s=r.toString(),i=await this.connection.getTransactionParams().do(),d=u.forEmitter(this.coreAppId,r.toUint8Array()),{accounts:a,txs:g}=await c.maybeCreateStorageTx(this.connection,s,this.coreAppId,d,i);for(const h of g)yield this.createUnsignedTx(h,"Core.publishMessage",!0);const A=n.makeApplicationCallTxnFromObject({from:s,appIndex:l.safeBigIntToNumber(this.coreAppId),appArgs:[c.publishMessage,t,n.bignum.toBytes(0n,8)],accounts:a,onComplete:n.OnApplicationComplete.NoOpOC,suggestedParams:i});yield this.createUnsignedTx({tx:A},"Core.publishMessage",!0)}async getMessageFee(){var s;const e=await this.connection.getApplicationByID(l.safeBigIntToNumber(this.coreAppId)).do(),r=(s=n.Application.from_obj_for_encoding(e).params.globalState)==null?void 0:s.find(i=>i.key===c.feeKey);return r?BigInt(r.value.uint):0n}async getGuardianSetIndex(){throw new Error("Not implemented")}async parseTransaction(e){const t=await this.connection.pendingTransactionInformation(e).do(),r=n.PendingTransactionResponse.from_obj_for_encoding(t);return this.parseTx(r).map(s=>({chain:s.emitterChain,emitter:s.emitterAddress,sequence:s.sequence}))}async parseMessages(e){const t=await this.connection.pendingTransactionInformation(e).do(),r=n.PendingTransactionResponse.from_obj_for_encoding(t);return this.parseTx(r)}parseTx(e){const t=[];if(e.innerTxns&&e.innerTxns.length>0&&t.push(...e.innerTxns.flatMap(g=>this.parseTx(g))),BigInt(e.txn.txn.apid??0)!==this.coreAppId||!e.logs||e.logs.length===0)return t;const r=e.txn.txn.apaa??[];if(r.length!==3||!n.bytes.equals(new Uint8Array(r[0]),c.publishMessage))return t;const s=n.bignum.decode(e.logs[0]),i=new l.AlgorandAddress(e.txn.txn.snd).toUniversalAddress(),d=new Uint8Array(r[1]),a=n.bignum.decode(r[2]);return t.push(z.createVAA("Uint8Array",{emitterChain:this.chain,emitterAddress:i,sequence:s,guardianSet:0,timestamp:0,consistencyLevel:0,nonce:Number(a),payload:d,signatures:[]})),t}static async maybeCreateStorageTx(e,t,r,s,i){const d=n.getApplicationAddress(r),a=s.address(),g=[];if(await u.storageAccountExists(e,a,r))return{accounts:[a],txs:g};i=i??await e.getTransactionParams().do();const A=n.makePaymentTxnWithSuggestedParamsFromObject({from:t,to:a,amount:V,suggestedParams:i});A.fee=A.fee*2,g.push({tx:A});const h=n.makeApplicationOptInTxnFromObject({from:a,appIndex:l.safeBigIntToNumber(r),rekeyTo:d,suggestedParams:i});return h.fee=0,g.push({tx:h,signer:{address:s.address(),signTxn:b=>Promise.resolve(n.signLogicSigTransaction(b,s).blob)}}),{accounts:[a],txs:g}}static async submitVAAHeader(e,t,r,s,i,d){d=d??await e.getTransactionParams().do();let a=[];const g=u.forMessageId(r,{chain:s.emitterChain,sequence:s.sequence,emitter:s.emitterAddress}),{accounts:A,txs:h}=await c.maybeCreateStorageTx(e,i,r,g,d);a.push(...h);const b=u.forGuardianSet(t,s.guardianSet),{accounts:[x],txs:w}=await c.maybeCreateStorageTx(e,i,t,b,d);a.push(...w);let I=[...A,x];const _=await u.decodeLocalState(e,t,x),m=n.keccak_256(s.hash),k=s.signatures.length,S=Math.ceil(k/c.MAX_SIGS_PER_TXN),E=20,v=new n.LogicSigAccount(c.ALGO_VERIFY);for(let R=0;R<S;R++){const G=R*c.MAX_SIGS_PER_TXN,B=s.signatures.slice(G,G+c.MAX_SIGS_PER_TXN),Y=B.length*E,X=new Uint8Array(Y);for(let f=0;f<B.length;f++){const j=B[f],q=_.slice(j.guardianIndex*E+1,(j.guardianIndex+1)*E+1);X.set(q,f*20)}const P=n.makeApplicationCallTxnFromObject({appArgs:[c.verifySigs,n.bytes.concat(...B.map(f=>n.bytes.concat(new Uint8Array([f.guardianIndex]),f.signature.encode()))),X,m],accounts:I,appIndex:l.safeBigIntToNumber(t),from:c.ALGO_VERIFY_HASH,onComplete:n.OnApplicationComplete.NoOpOC,suggestedParams:d});P.fee=0,a.push({tx:P,signer:{address:v.address(),signTxn:f=>Promise.resolve(n.signLogicSigTransaction(f,v).blob)}})}const M=n.makeApplicationCallTxnFromObject({appArgs:[c.verifyVaa,n.serialize(s)],accounts:I,appIndex:l.safeBigIntToNumber(t),from:i,onComplete:n.OnApplicationComplete.NoOpOC,suggestedParams:d});return M.fee=M.fee*(2+S),a.push({tx:M}),{accounts:I,txs:a}}createUnsignedTx(e,t,r=!0){return new K(e,this.network,this.chain,t,r)}};p(c,"MAX_SIGS_PER_TXN",6),p(c,"ALGO_VERIFY_HASH","EZATROXX2HISIRZDRGXW4LRQ46Z6IUJYYIHU3PJGP7P5IQDPKVX42N767A"),p(c,"ALGO_VERIFY",new Uint8Array([6,32,4,1,0,32,20,38,1,0,49,32,50,3,18,68,49,1,35,18,68,49,16,129,6,18,68,54,26,1,54,26,3,54,26,2,136,0,3,68,34,67,53,2,53,1,53,0,40,53,240,40,53,241,52,0,21,53,5,35,53,3,35,53,4,52,3,52,5,12,65,0,68,52,1,52,0,52,3,129,65,8,34,88,23,52,0,52,3,34,8,36,88,52,0,52,3,129,33,8,36,88,7,0,53,241,53,240,52,2,52,4,37,88,52,240,52,241,80,2,87,12,20,18,68,52,3,129,66,8,53,3,52,4,37,8,53,4,66,255,180,34,137])),p(c,"feeKey",n.b64.encode("MessageFee")),p(c,"verifyVaa",n.bytes.encode("verifyVAA")),p(c,"verifySigs",n.bytes.encode("verifySigs")),p(c,"publishMessage",n.bytes.encode("publishMessage"));let T=c;$.registerProtocol("Algorand","WormholeCore",T);const Z=Object.freeze(Object.defineProperty({__proto__:null,AlgorandWormholeCore:T,BITS_PER_BYTE:C,BITS_PER_KEY:N,MAX_BITS:O,MAX_BYTES:F,MAX_BYTES_PER_KEY:L,MAX_KEYS:U,SEED_AMT:V,StorageLogicSig:u,varint:y},Symbol.toStringTag,{value:"Module"}));exports.AlgorandUnsignedTransaction=K;exports.AlgorandWormholeCore=T;exports.StorageLogicSig=u;exports.index=Z;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var h=Object.defineProperty;var m=(a,e,r)=>e in a?h(a,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[e]=r;var o=(a,e,r)=>(m(a,typeof e!="symbol"?e+"":e,r),r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./sui-
|
|
1
|
+
"use strict";var h=Object.defineProperty;var m=(a,e,r)=>e in a?h(a,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[e]=r;var o=(a,e,r)=>(m(a,typeof e!="symbol"?e+"":e,r),r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./sui-iNn-cH44.js"),u=require("./index-C2_AHiqv.js"),w=require("./create-D65JDX7A.js"),g=require("./chain-C453VbjW.js");class c{constructor(e,r,t,n){o(this,"network");o(this,"chain");o(this,"provider");o(this,"contracts");o(this,"chainId");o(this,"coreBridgePackageId");this.network=e,this.chain=r,this.provider=t,this.contracts=n,this.chainId=u.toChainId(r);const s=n.coreBridge;if(!s)throw new Error(`CoreBridge contract Address for chain ${r} not found`);this.coreBridgePackageId=s}getGuardianSet(e){throw new Error("Method not implemented.")}getMessageFee(){throw new Error("Method not implemented.")}static async fromRpc(e,r){const[t,n]=await d.SuiPlatform.chainFromRpc(e),s=r[n];if(s.network!==t)throw new Error(`Network mismatch: ${s.network} !== ${t}`);return new c(t,n,e,s.contracts)}async*verifyMessage(e,r){throw new Error("Method not implemented.")}async*publishMessage(e,r){throw new Error("Method not implemented.")}async parseTransaction(e){return(await this.parseMessages(e)).map(t=>({emitter:t.emitterAddress,sequence:t.sequence,chain:this.chain}))}async getGuardianSetIndex(){throw new Error("Method not implemented.")}async parseMessages(e){var n;const t=(n=(await this.provider.getTransactionBlock({digest:e,options:{showEvents:!0,showEffects:!0,showInput:!0}})).events)==null?void 0:n.filter(s=>s.type.endsWith("WormholeMessage"));if(!t||t.length==0)throw new Error("WormholeMessage not found");return t.map(s=>{const i=s.parsedJson;return w.createVAA("Uint8Array",{emitterChain:this.chain,emitterAddress:new d.SuiAddress(i.sender).toUniversalAddress(),sequence:BigInt(i.sequence),guardianSet:0,timestamp:Number(i.timestamp),consistencyLevel:i.consistency_level,nonce:i.nonce,signatures:[],payload:new Uint8Array(i.payload)})})}}g.registerProtocol(d._platform,"WormholeCore",c);exports.SuiWormholeCore=c;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
var yu = Object.defineProperty;
|
|
2
2
|
var bu = (e, t, n) => t in e ? yu(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
3
|
var at = (e, t, n) => (bu(e, typeof t != "symbol" ? t + "" : t, n), n);
|
|
4
|
-
import { o as h, $ as Vr, T as vu, d as et, w as ma, U as wu, V as fa, X as ku, Y as _u, be as Su, Z as Pu, r as ha, bh as Us, bi as pa, aj as jt, ak as Au, bk as Fr, al as Tu, b4 as vi, ay as Eu, bp as wi, az as Cu, cn as Mu } from "./index-
|
|
5
|
-
import { t as Bt, c as Wr, m as Ou } from "./ens-validation.es6-
|
|
6
|
-
import { k as ju, b as Bu, c as Ru, t as ga, d as Iu, v as $u, p as Nu, q as xu, e as Du, f as Uu, g as qu, h as ya, i as Hu, j as Vu, l as Fu, m as Wu, n as Ju, o as Gu, r as Lu, s as zu, u as Ku, w as Qu, x as Zu, y as Xu, z as Yu, A as ed, B as td, D as nd, E as rd, F as od, H as sd, I as ba, J as id, K as ad, L as cd, M as ud, N as dd, O as ki, G as Nt, C as es, a as _i, P as ld, Q as Si, R as ts, S as Pi, T as Ai, U as Ti, V as Ei, W as Ci, X as Mi, Y as md, Z as fd, _ as hd } from "./cosmwasm-
|
|
7
|
-
import { CosmwasmWormholeCore as pd } from "./index-
|
|
8
|
-
import { c as gd, C as yd } from "./unsignedTransaction-
|
|
9
|
-
import { r as bd } from "./chain-
|
|
4
|
+
import { o as h, $ as Vr, T as vu, d as et, w as ma, U as wu, V as fa, X as ku, Y as _u, be as Su, Z as Pu, r as ha, bh as Us, bi as pa, aj as jt, ak as Au, bk as Fr, al as Tu, b4 as vi, ay as Eu, bp as wi, az as Cu, cn as Mu } from "./index-DXycTbzg.mjs";
|
|
5
|
+
import { t as Bt, c as Wr, m as Ou } from "./ens-validation.es6-HV5K8ymg.mjs";
|
|
6
|
+
import { k as ju, b as Bu, c as Ru, t as ga, d as Iu, v as $u, p as Nu, q as xu, e as Du, f as Uu, g as qu, h as ya, i as Hu, j as Vu, l as Fu, m as Wu, n as Ju, o as Gu, r as Lu, s as zu, u as Ku, w as Qu, x as Zu, y as Xu, z as Yu, A as ed, B as td, D as nd, E as rd, F as od, H as sd, I as ba, J as id, K as ad, L as cd, M as ud, N as dd, O as ki, G as Nt, C as es, a as _i, P as ld, Q as Si, R as ts, S as Pi, T as Ai, U as Ti, V as Ei, W as Ci, X as Mi, Y as md, Z as fd, _ as hd } from "./cosmwasm-CZWC0Vwt.mjs";
|
|
7
|
+
import { CosmwasmWormholeCore as pd } from "./index-CSkBcw-D.mjs";
|
|
8
|
+
import { c as gd, C as yd } from "./unsignedTransaction-B7ANn3fF.mjs";
|
|
9
|
+
import { r as bd } from "./chain-BqdQffpz.mjs";
|
|
10
10
|
function vd(e) {
|
|
11
11
|
return e.id !== void 0 && e.pending !== void 0 && e.data !== void 0;
|
|
12
12
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var Ir=Object.defineProperty;var xr=(e,t,r)=>t in e?Ir(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var V=(e,t,r)=>(xr(e,typeof t!="symbol"?t+"":t,r),r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const B=require("./index-D64qU2ma.js"),S=require("./sui-BE2FECKH.js");require("./index-BeJpXXCe.js");const Ar=require("./chain-B6MIHCrl.js");class _r{constructor(t,r,n,i,s=!1){V(this,"transaction");V(this,"network");V(this,"chain");V(this,"description");V(this,"parallelizable");this.transaction=t,this.network=r,this.chain=n,this.description=i,this.parallelizable=s}}class Cr extends TypeError{constructor(t,r){let n;const{message:i,explanation:s,...o}=t,{path:a}=t,c=a.length===0?i:`At path: ${a.join(".")} -- ${i}`;super(s??c),s!=null&&(this.cause=c),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>n??(n=[t,...r()])}}function Br(e){return K(e)&&typeof e[Symbol.iterator]=="function"}function K(e){return typeof e=="object"&&e!=null}function J(e){return typeof e=="symbol"?e.toString():typeof e=="string"?JSON.stringify(e):`${e}`}function $r(e){const{done:t,value:r}=e.next();return t?void 0:r}function Ur(e,t,r,n){if(e===!0)return;e===!1?e={}:typeof e=="string"&&(e={message:e});const{path:i,branch:s}=t,{type:o}=r,{refinement:a,message:c=`Expected a value of type \`${o}\`${a?` with refinement \`${a}\``:""}, but received: \`${J(n)}\``}=e;return{value:n,type:o,refinement:a,key:i[i.length-1],path:i,branch:s,...e,message:c}}function*Vt(e,t,r,n){Br(e)||(e=[e]);for(const i of e){const s=Ur(i,t,r,n);s&&(yield s)}}function*ut(e,t,r={}){const{path:n=[],branch:i=[e],coerce:s=!1,mask:o=!1}=r,a={path:n,branch:i};if(s&&(e=t.coercer(e,a),o&&t.type!=="type"&&K(t.schema)&&K(e)&&!Array.isArray(e)))for(const d in e)t.schema[d]===void 0&&delete e[d];let c="valid";for(const d of t.validator(e,a))d.explanation=r.message,c="not_valid",yield[d,void 0];for(let[d,l,g]of t.entries(e,a)){const m=ut(l,g,{path:d===void 0?n:[...n,d],branch:d===void 0?i:[...i,l],coerce:s,mask:o,message:r.message});for(const y of m)y[0]?(c=y[0].refinement!=null?"not_refined":"not_valid",yield[y[0],void 0]):s&&(l=y[1],d===void 0?e=l:e instanceof Map?e.set(d,l):e instanceof Set?e.add(l):K(e)&&(l!==void 0||d in e)&&(e[d]=l))}if(c!=="not_valid")for(const d of t.refiner(e,a))d.explanation=r.message,c="not_refined",yield[d,void 0];c==="valid"&&(yield[void 0,e])}class te{constructor(t){const{type:r,schema:n,validator:i,refiner:s,coercer:o=c=>c,entries:a=function*(){}}=t;this.type=r,this.schema=n,this.entries=a,this.coercer=o,i?this.validator=(c,d)=>{const l=i(c,d);return Vt(l,d,this,c)}:this.validator=()=>[],s?this.refiner=(c,d)=>{const l=s(c,d);return Vt(l,d,this,c)}:this.refiner=()=>[]}assert(t,r){return tt(t,this,r)}create(t,r){return Kt(t,this,r)}is(t){return L(t,this)}mask(t,r){return Jt(t,this,r)}validate(t,r={}){return Ie(t,this,r)}}function tt(e,t,r){const n=Ie(e,t,{message:r});if(n[0])throw n[0]}function Kt(e,t,r){const n=Ie(e,t,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function Jt(e,t,r){const n=Ie(e,t,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function L(e,t){return!Ie(e,t)[0]}function Ie(e,t,r={}){const n=ut(e,t,r),i=$r(n);return i[0]?[new Cr(i[0],function*(){for(const o of n)o[0]&&(yield o[0])}),void 0]:[void 0,i[1]]}function je(...e){const t=e[0].type==="type",r=e.map(i=>i.schema),n=Object.assign({},...r);return t?Rr(n):p(n)}function W(e,t){return new te({type:e,schema:null,validator:t})}function rt(){return W("any",()=>!0)}function E(e){return new te({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[r,n]of t.entries())yield[r,n,e]},coercer(t){return Array.isArray(t)?t.slice():t},validator(t){return Array.isArray(t)||`Expected an array value, but received: ${J(t)}`}})}function Mr(){return W("bigint",e=>typeof e=="bigint")}function z(){return W("boolean",e=>typeof e=="boolean")}function ee(){return W("integer",e=>typeof e=="number"&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${J(e)}`)}function v(e){const t=J(e),r=typeof e;return new te({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?e:null,validator(n){return n===e||`Expected the literal \`${t}\`, but received: ${J(n)}`}})}function qt(){return W("never",()=>!1)}function $(e){return new te({...e,validator:(t,r)=>t===null||e.validator(t,r),refiner:(t,r)=>t===null||e.refiner(t,r)})}function le(){return W("number",e=>typeof e=="number"&&!isNaN(e)||`Expected a number, but received: ${J(e)}`)}function p(e){const t=e?Object.keys(e):[],r=qt();return new te({type:"object",schema:e||null,*entries(n){if(e&&K(n)){const i=new Set(Object.keys(n));for(const s of t)i.delete(s),yield[s,n[s],e[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 T(e){return new te({...e,validator:(t,r)=>t===void 0||e.validator(t,r),refiner:(t,r)=>t===void 0||e.refiner(t,r)})}function Q(e,t){return new te({type:"record",schema:null,*entries(r){if(K(r))for(const n in r){const i=r[n];yield[n,n,e],yield[n,i,t]}},validator(r){return K(r)||`Expected an object, but received: ${J(r)}`}})}function h(){return W("string",e=>typeof e=="string"||`Expected a string, but received: ${J(e)}`)}function Ht(e){const t=qt();return new te({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(e.length,r.length);for(let i=0;i<n;i++)yield[i,r[i],e[i]||t]}},validator(r){return Array.isArray(r)||`Expected an array, but received: ${J(r)}`}})}function Rr(e){const t=Object.keys(e);return new te({type:"type",schema:e,*entries(r){if(K(r))for(const n of t)yield[n,r[n],e[n]]},validator(r){return K(r)||`Expected an object, but received: ${J(r)}`},coercer(r){return K(r)?{...r}:r}})}function U(e){const t=e.map(r=>r.type).join(" | ");return new te({type:"union",schema:null,coercer(r){for(const n of e){const[i,s]=n.validate(r,{coerce:!0});if(!i)return s}return r},validator(r,n){const i=[];for(const s of e){const[...o]=ut(r,s,n),[a]=o;if(a[0])for(const[c]of o)c&&i.push(c);else return[]}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${J(r)}`,...i]}})}function Xt(){return W("unknown",()=>!0)}const dt=U([p({AddressOwner:h()}),p({ObjectOwner:h()}),p({Shared:p({initial_shared_version:$(h())})}),v("Immutable")]);W("SuiJsonValue",()=>!0);const Pr=U([p({u32:h()}),p({u64:h()}),p({f64:h()})]);p({attributes:Q(h(),$(Pr)),featureFlags:Q(h(),z()),maxSupportedProtocolVersion:h(),minSupportedProtocolVersion:h(),protocolVersion:h()});U([h(),v("package")]);const oe=p({digest:h(),objectId:h(),version:U([le(),h(),Mr()])});p({owner:dt,reference:oe});p({objectId:h(),sequenceNumber:h()});p({payment:E(oe),owner:h(),price:h(),budget:h()});const Nr=je(oe,p({type:h(),owner:dt,previousTransaction:h()})),Dr=Q(h(),rt()),zr=Q(h(),Xt()),Vr=p({type:h(),fields:Dr,hasPublicTransfer:z()}),Fr=p({disassembled:zr}),Gr=U([je(Vr,p({dataType:v("moveObject")})),je(Fr,p({dataType:v("package")}))]),Lr=p({type:h(),hasPublicTransfer:z(),version:h(),bcsBytes:h()}),Wr=p({id:h(),moduleMap:Q(h(),h())}),Kr=U([je(Lr,p({dataType:v("moveObject")})),je(Wr,p({dataType:v("package")}))]);BigInt(1e9);const Zt=p({code:h(),error:T(h()),object_id:T(h()),parent_object_id:T(h()),version:T(h()),digest:T(h())}),Jr=p({data:$(T(Q(h(),h()))),error:$(T(Zt))}),qr=U([Jr,T(Q(h(),h()))]),Yt=p({objectId:h(),version:h(),digest:h(),type:$(T(h())),content:$(T(Gr)),bcs:$(T(Kr)),owner:$(T(dt)),previousTransaction:$(T(h())),storageRebate:$(T(h())),display:$(T(qr))});p({showType:$(T(z())),showContent:$(T(z())),showBcs:$(T(z())),showOwner:$(T(z())),showPreviousTransaction:$(T(z())),showStorageRebate:$(T(z())),showDisplay:$(T(z()))});U([v("Exists"),v("notExists"),v("Deleted")]);E(Nr);const Hr=p({data:$(T(Yt)),error:$(T(Zt))});function Xr(e){return e.data}function Zr(e){if(e.error&&"object_id"in e.error&&"version"in e.error&&"digest"in e.error){const t=e.error;return{objectId:t.object_id,version:t.version,digest:t.digest}}}function Ft(e){if("reference"in e)return e.reference;const t=Xr(e);return t?{objectId:t.objectId,version:t.version,digest:t.digest}:Zr(e)}p({objectId:h(),atCheckpoint:T(le())});p({data:E(Hr),nextCursor:T($(h())),hasNextPage:z()});U([p({details:Yt,status:v("VersionFound")}),p({details:h(),status:v("ObjectNotExists")}),p({details:oe,status:v("ObjectDeleted")}),p({details:Ht([h(),le()]),status:v("VersionNotFound")}),p({details:p({asked_version:le(),latest_version:le(),object_id:h()}),status:v("VersionTooHigh")})]);const Yr=U([h(),p({Object:h()})]);E(Yr);const Qr=p({address:h(),name:h()}),en=U([v("Private"),v("Public"),v("Friend")]),lt=p({abilities:E(h())}),tn=p({constraints:lt,isPhantom:z()}),rn=p({TypeParameter:le()}),qe=Ht([p({module:h(),package:h(),function:h()}),h()]);p({rank3Days:E(qe),rank7Days:E(qe),rank30Days:E(qe)});function Qt(e){if(!e)return!1;if(typeof e=="string"||L(e,rn)||er(e))return!0;if(typeof e!="object")return!1;const t=e;return!!(L(t.Reference,pe)||L(t.MutableReference,pe)||L(t.Vector,pe))}const pe=W("SuiMoveNormalizedType",Qt);function er(e){if(!e||typeof e!="object")return!1;const t=e;if(!t.Struct||typeof t.Struct!="object")return!1;const r=t.Struct;return!(typeof r.address!="string"||typeof r.module!="string"||typeof r.name!="string"||!Array.isArray(r.typeArguments)||!r.typeArguments.every(n=>Qt(n)))}W("SuiMoveNormalizedStructType",er);const nn=p({visibility:en,isEntry:z(),typeParameters:E(lt),parameters:E(pe),return:E(pe)}),sn=p({name:h(),type:pe}),an=p({abilities:lt,typeParameters:E(tn),fields:E(sn)}),on=p({fileFormatVersion:le(),address:h(),name:h(),friends:E(Qr),structs:Q(h(),an),exposedFunctions:Q(h(),nn)});Q(h(),on);function nt(e){return typeof e=="object"&&"MutableReference"in e?e.MutableReference:void 0}function tr(e){return typeof e=="object"&&"Reference"in e?e.Reference:void 0}function ft(e){if(typeof e=="object"&&"Struct"in e)return e;const t=tr(e),r=nt(e);if(typeof t=="object"&&"Struct"in t)return t;if(typeof r=="object"&&"Struct"in r)return r}function cn(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var n=0;n<e.length;n++){var i=e.charAt(n),s=i.charCodeAt(0);if(t[s]!==255)throw new TypeError(i+" is ambiguous");t[s]=n}var o=e.length,a=e.charAt(0),c=Math.log(o)/Math.log(256),d=Math.log(256)/Math.log(o);function l(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 w=0,b=0,f=0,x=y.length;f!==x&&y[f]===0;)f++,w++;for(var C=(x-f)*d+1>>>0,P=new Uint8Array(C);f!==x;){for(var A=y[f],k=0,N=C-1;(A!==0||k<b)&&N!==-1;N--,k++)A+=256*P[N]>>>0,P[N]=A%o>>>0,A=A/o>>>0;if(A!==0)throw new Error("Non-zero carry");b=k,f++}for(var q=C-b;q!==C&&P[q]===0;)q++;for(var he=a.repeat(w);q<C;++q)he+=e.charAt(P[q]);return he}function g(y){if(typeof y!="string")throw new TypeError("Expected String");if(y.length===0)return new Uint8Array;for(var w=0,b=0,f=0;y[w]===a;)b++,w++;for(var x=(y.length-w)*c+1>>>0,C=new Uint8Array(x);y[w];){var P=t[y.charCodeAt(w)];if(P===255)return;for(var A=0,k=x-1;(P!==0||A<f)&&k!==-1;k--,A++)P+=o*C[k]>>>0,C[k]=P%256>>>0,P=P/256>>>0;if(P!==0)throw new Error("Non-zero carry");f=A,w++}for(var N=x-f;N!==x&&C[N]===0;)N++;for(var q=new Uint8Array(b+(x-N)),he=b;N!==x;)q[he++]=C[N++];return q}function m(y){var w=g(y);if(w)return w;throw new Error("Non-base"+o+" character")}return{encode:l,decodeUnsafe:g,decode:m}}var un=cn;const dn=un,ln="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";var fn=dn(ln);const rr=B.getDefaultExportFromCjs(fn),xe=e=>rr.encode(e),ht=e=>rr.decode(e);function ce(e){return Uint8Array.from(atob(e),t=>t.charCodeAt(0))}const He=8192;function Ae(e){if(e.length<He)return btoa(String.fromCharCode(...e));let t="";for(var r=0;r<e.length;r+=He){const n=e.slice(r,r+He);t+=String.fromCharCode(...n)}return btoa(t)}function Ke(e){var i;const t=e.startsWith("0x")?e.slice(2):e,n=((i=(t.length%2===0?t:`0${t}}`).match(/.{2}/g))==null?void 0:i.map(s=>parseInt(s,16)))??[];return Uint8Array.from(n)}function _e(e){return e.reduce((t,r)=>t+r.toString(16).padStart(2,"0"),"")}function gt(e){let t=[],r=0;if(e===0)return[0];for(;e>0;)t[r]=e&127,(e>>=7)&&(t[r]|=128),r+=1;return t}function hn(e){let t=0,r=0,n=0;for(;;){let i=e[n];if(n+=1,t|=(i&127)<<r,!(i&128))break;r+=7}return{value:t,length:n}}class nr{constructor(t){this.bytePosition=0,this.dataView=new DataView(t.buffer)}shift(t){return this.bytePosition+=t,this}read8(){let t=this.dataView.getUint8(this.bytePosition);return this.shift(1),t}read16(){let t=this.dataView.getUint16(this.bytePosition,!0);return this.shift(2),t}read32(){let t=this.dataView.getUint32(this.bytePosition,!0);return this.shift(4),t}read64(){let t=this.read32(),n=this.read32().toString(16)+t.toString(16).padStart(8,"0");return BigInt("0x"+n).toString(10)}read128(){let t=BigInt(this.read64()),n=BigInt(this.read64()).toString(16)+t.toString(16).padStart(16,"0");return BigInt("0x"+n).toString(10)}read256(){let t=BigInt(this.read128()),n=BigInt(this.read128()).toString(16)+t.toString(16).padStart(32,"0");return BigInt("0x"+n).toString(10)}readBytes(t){let r=this.bytePosition+this.dataView.byteOffset,n=new Uint8Array(this.dataView.buffer,r,t);return this.shift(t),n}readULEB(){let t=this.bytePosition+this.dataView.byteOffset,r=new Uint8Array(this.dataView.buffer,t),{value:n,length:i}=hn(r);return this.shift(i),n}readVec(t){let r=this.readULEB(),n=[];for(let i=0;i<r;i++)n.push(t(this,i,r));return n}}function gn(e,t){switch(t){case"base58":return xe(e);case"base64":return Ae(e);case"hex":return _e(e);default:throw new Error("Unsupported encoding, supported values are: base64, hex")}}function pn(e,t){switch(t){case"base58":return ht(e);case"base64":return ce(e);case"hex":return Ke(e);default:throw new Error("Unsupported encoding, supported values are: base64, hex")}}function ir(e,t=["<",">"]){const[r,n]=t,i=[];let s="",o=0;for(let a=0;a<e.length;a++){const c=e[a];if(c===r&&o++,c===n&&o--,o===0&&c===","){i.push(s.trim()),s="";continue}s+=c}return i.push(s.trim()),i}class sr{constructor({size:t=1024,maxSize:r,allocateSize:n=1024}={}){this.bytePosition=0,this.size=t,this.maxSize=r||t,this.allocateSize=n,this.dataView=new DataView(new ArrayBuffer(t))}ensureSizeOrGrow(t){const r=this.bytePosition+t;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(t){return this.bytePosition+=t,this}write8(t){return this.ensureSizeOrGrow(1),this.dataView.setUint8(this.bytePosition,Number(t)),this.shift(1)}write16(t){return this.ensureSizeOrGrow(2),this.dataView.setUint16(this.bytePosition,Number(t),!0),this.shift(2)}write32(t){return this.ensureSizeOrGrow(4),this.dataView.setUint32(this.bytePosition,Number(t),!0),this.shift(4)}write64(t){return Xe(BigInt(t),8).forEach(r=>this.write8(r)),this}write128(t){return Xe(BigInt(t),16).forEach(r=>this.write8(r)),this}write256(t){return Xe(BigInt(t),32).forEach(r=>this.write8(r)),this}writeULEB(t){return gt(t).forEach(r=>this.write8(r)),this}writeVec(t,r){return this.writeULEB(t.length),Array.from(t).forEach((n,i)=>r(this,n,i,t.length)),this}*[Symbol.iterator](){for(let t=0;t<this.bytePosition;t++)yield this.dataView.getUint8(t);return this.toBytes()}toBytes(){return new Uint8Array(this.dataView.buffer.slice(0,this.bytePosition))}toString(t){return gn(this.toBytes(),t)}}function Xe(e,t){let r=new Uint8Array(t),n=0;for(;e>0;)r[n]=Number(e%BigInt(256)),e=e/BigInt(256),n+=1;return r}var ar=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},X=(e,t,r)=>(ar(e,t,"read from private field"),r?r.call(e):t.get(e)),ze=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},Ve=(e,t,r,n)=>(ar(e,t,"write to private field"),t.set(e,r),r),ge,be,Me,ae;const or=class{constructor(e){ze(this,ge,void 0),ze(this,be,void 0),this.name=e.name,this.read=e.read,this.serializedSize=e.serializedSize??(()=>null),Ve(this,ge,e.write),Ve(this,be,e.serialize??((t,r)=>{const n=new sr({size:this.serializedSize(t)??void 0,...r});return X(this,ge).call(this,t,n),n.toBytes()})),this.validate=e.validate??(()=>{})}write(e,t){this.validate(e),X(this,ge).call(this,e,t)}serialize(e,t){return this.validate(e),new yn(this,X(this,be).call(this,e,t))}parse(e){const t=new nr(e);return this.read(t)}transform({name:e,input:t,output:r}){return new or({name:e??this.name,read:n=>r(this.read(n)),write:(n,i)=>X(this,ge).call(this,t(n),i),serializedSize:n=>this.serializedSize(t(n)),serialize:(n,i)=>X(this,be).call(this,t(n),i),validate:n=>this.validate(t(n))})}};let Z=or;ge=new WeakMap;be=new WeakMap;const cr=Symbol.for("@mysten/serialized-bcs");function pt(e){return!!e&&typeof e=="object"&&e[cr]===!0}class yn{constructor(t,r){ze(this,Me,void 0),ze(this,ae,void 0),Ve(this,Me,t),Ve(this,ae,r)}get[cr](){return!0}toBytes(){return X(this,ae)}toHex(){return _e(X(this,ae))}toBase64(){return Ae(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 Fe({size:e,...t}){return new Z({...t,serializedSize:()=>e})}function Ze({readMethod:e,writeMethod:t,...r}){return Fe({...r,read:n=>n[e](),write:(n,i)=>i[t](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 Ye({readMethod:e,writeMethod:t,...r}){return Fe({...r,read:n=>n[e](),write:(n,i)=>i[t](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 mn({serialize:e,...t}){const r=new Z({...t,serialize:e,write:(n,i)=>{for(const s of r.serialize(n).toBytes())i.write8(s)}});return r}function wn({toBytes:e,fromBytes:t,...r}){return new Z({...r,read:n=>{const i=n.readULEB(),s=n.readBytes(i);return t(s)},write:(n,i)=>{const s=e(n);i.writeULEB(s.length);for(let o=0;o<s.length;o++)i.write8(s[o])},serialize:n=>{const i=e(n),s=gt(i.length),o=new Uint8Array(s.length+i.length);return o.set(s,0),o.set(i,s.length),o},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 bn(e){let t=null;function r(){return t||(t=e()),t}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 u={u8(e){return Ze({name:"u8",readMethod:"read8",writeMethod:"write8",size:1,maxValue:2**8-1,...e})},u16(e){return Ze({name:"u16",readMethod:"read16",writeMethod:"write16",size:2,maxValue:2**16-1,...e})},u32(e){return Ze({name:"u32",readMethod:"read32",writeMethod:"write32",size:4,maxValue:2**32-1,...e})},u64(e){return Ye({name:"u64",readMethod:"read64",writeMethod:"write64",size:8,maxValue:2n**64n-1n,...e})},u128(e){return Ye({name:"u128",readMethod:"read128",writeMethod:"write128",size:16,maxValue:2n**128n-1n,...e})},u256(e){return Ye({name:"u256",readMethod:"read256",writeMethod:"write256",size:32,maxValue:2n**256n-1n,...e})},bool(e){return Fe({name:"bool",size:1,read:t=>t.read8()===1,write:(t,r)=>r.write8(t?1:0),...e,validate:t=>{var r;if((r=e==null?void 0:e.validate)==null||r.call(e,t),typeof t!="boolean")throw new TypeError(`Expected boolean, found ${typeof t}`)}})},uleb128(e){return mn({name:"uleb128",read:t=>t.readULEB(),serialize:t=>Uint8Array.from(gt(t)),...e})},bytes(e,t){return Fe({name:`bytes[${e}]`,size:e,read:r=>r.readBytes(e),write:(r,n)=>{for(let i=0;i<e;i++)n.write8(r[i]??0)},...t,validate:r=>{var n;if((n=t==null?void 0:t.validate)==null||n.call(t,r),!("length"in r))throw new TypeError(`Expected array, found ${typeof r}`);if(r.length!==e)throw new TypeError(`Expected array of length ${e}, found ${r.length}`)}})},string(e){return wn({name:"string",toBytes:t=>new TextEncoder().encode(t),fromBytes:t=>new TextDecoder().decode(t),...e})},fixedArray(e,t,r){return new Z({name:`${t.name}[${e}]`,read:n=>{const i=new Array(e);for(let s=0;s<e;s++)i[s]=t.read(n);return i},write:(n,i)=>{for(const s of n)t.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!==e)throw new TypeError(`Expected array of length ${e}, found ${n.length}`)}})},option(e){return u.enum(`Option<${e.name}>`,{None:null,Some:e}).transform({input:t=>t==null?{None:!0}:{Some:t},output:t=>"Some"in t?t.Some:null})},vector(e,t){return new Z({name:`vector<${e.name}>`,read:r=>{const n=r.readULEB(),i=new Array(n);for(let s=0;s<n;s++)i[s]=e.read(r);return i},write:(r,n)=>{n.writeULEB(r.length);for(const i of r)e.write(i,n)},...t,validate:r=>{var n;if((n=t==null?void 0:t.validate)==null||n.call(t,r),!("length"in r))throw new TypeError(`Expected array, found ${typeof r}`)}})},tuple(e,t){return new Z({name:`(${e.map(r=>r.name).join(", ")})`,serializedSize:r=>{let n=0;for(let i=0;i<e.length;i++){const s=e[i].serializedSize(r[i]);if(s==null)return null;n+=s}return n},read:r=>{const n=[];for(const i of e)n.push(i.read(r));return n},write:(r,n)=>{for(let i=0;i<e.length;i++)e[i].write(r[i],n)},...t,validate:r=>{var n;if((n=t==null?void 0:t.validate)==null||n.call(t,r),!Array.isArray(r))throw new TypeError(`Expected array, found ${typeof r}`);if(r.length!==e.length)throw new TypeError(`Expected array of length ${e.length}, found ${r.length}`)}})},struct(e,t,r){const n=Object.entries(t);return new Z({name:e,serializedSize:i=>{let s=0;for(const[o,a]of n){const c=a.serializedSize(i[o]);if(c==null)return null;s+=c}return s},read:i=>{const s={};for(const[o,a]of n)s[o]=a.read(i);return s},write:(i,s)=>{for(const[o,a]of n)a.write(i[o],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(e,t,r){const n=Object.entries(t);return new Z({name:e,read:i=>{const s=i.readULEB(),[o,a]=n[s];return{[o]:(a==null?void 0:a.read(i))??!0}},write:(i,s)=>{const[o,a]=Object.entries(i)[0];for(let c=0;c<n.length;c++){const[d,l]=n[c];if(d===o){s.writeULEB(c),l==null||l.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[o]=s;if(!Object.hasOwn(t,o))throw new TypeError(`Invalid enum variant ${o}`)}})},map(e,t){return u.vector(u.tuple([e,t])).transform({name:`Map<${e.name}, ${t.name}>`,input:r=>[...r.entries()],output:r=>{const n=new Map;for(const[i,s]of r)n.set(i,s);return n}})},generic(e,t){return(...r)=>t(...r).transform({name:`${t.name}<${r.map(n=>n.name).join(", ")}>`,input:n=>n,output:n=>n})},lazy(e){return bn(e)}},Sn=32,Se=class{constructor(e){if(this.types=new Map,this.counter=0,e instanceof Se){this.schema=e.schema,this.types=new Map(e.types);return}if(this.schema=e,this.registerAddressType(Se.ADDRESS,e.addressLength,e.addressEncoding),this.registerVectorType(e.vectorType),e.types&&e.types.structs)for(let t of Object.keys(e.types.structs))this.registerStructType(t,e.types.structs[t]);if(e.types&&e.types.enums)for(let t of Object.keys(e.types.enums))this.registerEnumType(t,e.types.enums[t]);if(e.types&&e.types.aliases)for(let t of Object.keys(e.types.aliases))this.registerAlias(t,e.types.aliases[t]);e.withPrimitives!==!1&&Tn(this)}tempKey(){return`bcs-struct-${++this.counter}`}ser(e,t,r){if(typeof e=="string"||Array.isArray(e)){const{name:n,params:i}=this.parseTypeName(e);return this.getTypeInterface(n).encode(this,t,r,i)}if(typeof e=="object"){const n=this.tempKey();return new Se(this).registerStructType(n,e).ser(n,t,r)}throw new Error(`Incorrect type passed into the '.ser()' function.
|
|
1
|
+
"use strict";var Ir=Object.defineProperty;var xr=(e,t,r)=>t in e?Ir(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var V=(e,t,r)=>(xr(e,typeof t!="symbol"?t+"":t,r),r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const B=require("./index-C2_AHiqv.js"),S=require("./sui-iNn-cH44.js");require("./index-tlEJpVxO.js");const Ar=require("./chain-C453VbjW.js");class _r{constructor(t,r,n,i,s=!1){V(this,"transaction");V(this,"network");V(this,"chain");V(this,"description");V(this,"parallelizable");this.transaction=t,this.network=r,this.chain=n,this.description=i,this.parallelizable=s}}class Cr extends TypeError{constructor(t,r){let n;const{message:i,explanation:s,...o}=t,{path:a}=t,c=a.length===0?i:`At path: ${a.join(".")} -- ${i}`;super(s??c),s!=null&&(this.cause=c),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>n??(n=[t,...r()])}}function Br(e){return K(e)&&typeof e[Symbol.iterator]=="function"}function K(e){return typeof e=="object"&&e!=null}function J(e){return typeof e=="symbol"?e.toString():typeof e=="string"?JSON.stringify(e):`${e}`}function $r(e){const{done:t,value:r}=e.next();return t?void 0:r}function Ur(e,t,r,n){if(e===!0)return;e===!1?e={}:typeof e=="string"&&(e={message:e});const{path:i,branch:s}=t,{type:o}=r,{refinement:a,message:c=`Expected a value of type \`${o}\`${a?` with refinement \`${a}\``:""}, but received: \`${J(n)}\``}=e;return{value:n,type:o,refinement:a,key:i[i.length-1],path:i,branch:s,...e,message:c}}function*Vt(e,t,r,n){Br(e)||(e=[e]);for(const i of e){const s=Ur(i,t,r,n);s&&(yield s)}}function*ut(e,t,r={}){const{path:n=[],branch:i=[e],coerce:s=!1,mask:o=!1}=r,a={path:n,branch:i};if(s&&(e=t.coercer(e,a),o&&t.type!=="type"&&K(t.schema)&&K(e)&&!Array.isArray(e)))for(const d in e)t.schema[d]===void 0&&delete e[d];let c="valid";for(const d of t.validator(e,a))d.explanation=r.message,c="not_valid",yield[d,void 0];for(let[d,l,g]of t.entries(e,a)){const m=ut(l,g,{path:d===void 0?n:[...n,d],branch:d===void 0?i:[...i,l],coerce:s,mask:o,message:r.message});for(const y of m)y[0]?(c=y[0].refinement!=null?"not_refined":"not_valid",yield[y[0],void 0]):s&&(l=y[1],d===void 0?e=l:e instanceof Map?e.set(d,l):e instanceof Set?e.add(l):K(e)&&(l!==void 0||d in e)&&(e[d]=l))}if(c!=="not_valid")for(const d of t.refiner(e,a))d.explanation=r.message,c="not_refined",yield[d,void 0];c==="valid"&&(yield[void 0,e])}class te{constructor(t){const{type:r,schema:n,validator:i,refiner:s,coercer:o=c=>c,entries:a=function*(){}}=t;this.type=r,this.schema=n,this.entries=a,this.coercer=o,i?this.validator=(c,d)=>{const l=i(c,d);return Vt(l,d,this,c)}:this.validator=()=>[],s?this.refiner=(c,d)=>{const l=s(c,d);return Vt(l,d,this,c)}:this.refiner=()=>[]}assert(t,r){return tt(t,this,r)}create(t,r){return Kt(t,this,r)}is(t){return L(t,this)}mask(t,r){return Jt(t,this,r)}validate(t,r={}){return Ie(t,this,r)}}function tt(e,t,r){const n=Ie(e,t,{message:r});if(n[0])throw n[0]}function Kt(e,t,r){const n=Ie(e,t,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function Jt(e,t,r){const n=Ie(e,t,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function L(e,t){return!Ie(e,t)[0]}function Ie(e,t,r={}){const n=ut(e,t,r),i=$r(n);return i[0]?[new Cr(i[0],function*(){for(const o of n)o[0]&&(yield o[0])}),void 0]:[void 0,i[1]]}function je(...e){const t=e[0].type==="type",r=e.map(i=>i.schema),n=Object.assign({},...r);return t?Rr(n):p(n)}function W(e,t){return new te({type:e,schema:null,validator:t})}function rt(){return W("any",()=>!0)}function E(e){return new te({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[r,n]of t.entries())yield[r,n,e]},coercer(t){return Array.isArray(t)?t.slice():t},validator(t){return Array.isArray(t)||`Expected an array value, but received: ${J(t)}`}})}function Mr(){return W("bigint",e=>typeof e=="bigint")}function z(){return W("boolean",e=>typeof e=="boolean")}function ee(){return W("integer",e=>typeof e=="number"&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${J(e)}`)}function v(e){const t=J(e),r=typeof e;return new te({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?e:null,validator(n){return n===e||`Expected the literal \`${t}\`, but received: ${J(n)}`}})}function qt(){return W("never",()=>!1)}function $(e){return new te({...e,validator:(t,r)=>t===null||e.validator(t,r),refiner:(t,r)=>t===null||e.refiner(t,r)})}function le(){return W("number",e=>typeof e=="number"&&!isNaN(e)||`Expected a number, but received: ${J(e)}`)}function p(e){const t=e?Object.keys(e):[],r=qt();return new te({type:"object",schema:e||null,*entries(n){if(e&&K(n)){const i=new Set(Object.keys(n));for(const s of t)i.delete(s),yield[s,n[s],e[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 T(e){return new te({...e,validator:(t,r)=>t===void 0||e.validator(t,r),refiner:(t,r)=>t===void 0||e.refiner(t,r)})}function Q(e,t){return new te({type:"record",schema:null,*entries(r){if(K(r))for(const n in r){const i=r[n];yield[n,n,e],yield[n,i,t]}},validator(r){return K(r)||`Expected an object, but received: ${J(r)}`}})}function h(){return W("string",e=>typeof e=="string"||`Expected a string, but received: ${J(e)}`)}function Ht(e){const t=qt();return new te({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(e.length,r.length);for(let i=0;i<n;i++)yield[i,r[i],e[i]||t]}},validator(r){return Array.isArray(r)||`Expected an array, but received: ${J(r)}`}})}function Rr(e){const t=Object.keys(e);return new te({type:"type",schema:e,*entries(r){if(K(r))for(const n of t)yield[n,r[n],e[n]]},validator(r){return K(r)||`Expected an object, but received: ${J(r)}`},coercer(r){return K(r)?{...r}:r}})}function U(e){const t=e.map(r=>r.type).join(" | ");return new te({type:"union",schema:null,coercer(r){for(const n of e){const[i,s]=n.validate(r,{coerce:!0});if(!i)return s}return r},validator(r,n){const i=[];for(const s of e){const[...o]=ut(r,s,n),[a]=o;if(a[0])for(const[c]of o)c&&i.push(c);else return[]}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${J(r)}`,...i]}})}function Xt(){return W("unknown",()=>!0)}const dt=U([p({AddressOwner:h()}),p({ObjectOwner:h()}),p({Shared:p({initial_shared_version:$(h())})}),v("Immutable")]);W("SuiJsonValue",()=>!0);const Pr=U([p({u32:h()}),p({u64:h()}),p({f64:h()})]);p({attributes:Q(h(),$(Pr)),featureFlags:Q(h(),z()),maxSupportedProtocolVersion:h(),minSupportedProtocolVersion:h(),protocolVersion:h()});U([h(),v("package")]);const oe=p({digest:h(),objectId:h(),version:U([le(),h(),Mr()])});p({owner:dt,reference:oe});p({objectId:h(),sequenceNumber:h()});p({payment:E(oe),owner:h(),price:h(),budget:h()});const Nr=je(oe,p({type:h(),owner:dt,previousTransaction:h()})),Dr=Q(h(),rt()),zr=Q(h(),Xt()),Vr=p({type:h(),fields:Dr,hasPublicTransfer:z()}),Fr=p({disassembled:zr}),Gr=U([je(Vr,p({dataType:v("moveObject")})),je(Fr,p({dataType:v("package")}))]),Lr=p({type:h(),hasPublicTransfer:z(),version:h(),bcsBytes:h()}),Wr=p({id:h(),moduleMap:Q(h(),h())}),Kr=U([je(Lr,p({dataType:v("moveObject")})),je(Wr,p({dataType:v("package")}))]);BigInt(1e9);const Zt=p({code:h(),error:T(h()),object_id:T(h()),parent_object_id:T(h()),version:T(h()),digest:T(h())}),Jr=p({data:$(T(Q(h(),h()))),error:$(T(Zt))}),qr=U([Jr,T(Q(h(),h()))]),Yt=p({objectId:h(),version:h(),digest:h(),type:$(T(h())),content:$(T(Gr)),bcs:$(T(Kr)),owner:$(T(dt)),previousTransaction:$(T(h())),storageRebate:$(T(h())),display:$(T(qr))});p({showType:$(T(z())),showContent:$(T(z())),showBcs:$(T(z())),showOwner:$(T(z())),showPreviousTransaction:$(T(z())),showStorageRebate:$(T(z())),showDisplay:$(T(z()))});U([v("Exists"),v("notExists"),v("Deleted")]);E(Nr);const Hr=p({data:$(T(Yt)),error:$(T(Zt))});function Xr(e){return e.data}function Zr(e){if(e.error&&"object_id"in e.error&&"version"in e.error&&"digest"in e.error){const t=e.error;return{objectId:t.object_id,version:t.version,digest:t.digest}}}function Ft(e){if("reference"in e)return e.reference;const t=Xr(e);return t?{objectId:t.objectId,version:t.version,digest:t.digest}:Zr(e)}p({objectId:h(),atCheckpoint:T(le())});p({data:E(Hr),nextCursor:T($(h())),hasNextPage:z()});U([p({details:Yt,status:v("VersionFound")}),p({details:h(),status:v("ObjectNotExists")}),p({details:oe,status:v("ObjectDeleted")}),p({details:Ht([h(),le()]),status:v("VersionNotFound")}),p({details:p({asked_version:le(),latest_version:le(),object_id:h()}),status:v("VersionTooHigh")})]);const Yr=U([h(),p({Object:h()})]);E(Yr);const Qr=p({address:h(),name:h()}),en=U([v("Private"),v("Public"),v("Friend")]),lt=p({abilities:E(h())}),tn=p({constraints:lt,isPhantom:z()}),rn=p({TypeParameter:le()}),qe=Ht([p({module:h(),package:h(),function:h()}),h()]);p({rank3Days:E(qe),rank7Days:E(qe),rank30Days:E(qe)});function Qt(e){if(!e)return!1;if(typeof e=="string"||L(e,rn)||er(e))return!0;if(typeof e!="object")return!1;const t=e;return!!(L(t.Reference,pe)||L(t.MutableReference,pe)||L(t.Vector,pe))}const pe=W("SuiMoveNormalizedType",Qt);function er(e){if(!e||typeof e!="object")return!1;const t=e;if(!t.Struct||typeof t.Struct!="object")return!1;const r=t.Struct;return!(typeof r.address!="string"||typeof r.module!="string"||typeof r.name!="string"||!Array.isArray(r.typeArguments)||!r.typeArguments.every(n=>Qt(n)))}W("SuiMoveNormalizedStructType",er);const nn=p({visibility:en,isEntry:z(),typeParameters:E(lt),parameters:E(pe),return:E(pe)}),sn=p({name:h(),type:pe}),an=p({abilities:lt,typeParameters:E(tn),fields:E(sn)}),on=p({fileFormatVersion:le(),address:h(),name:h(),friends:E(Qr),structs:Q(h(),an),exposedFunctions:Q(h(),nn)});Q(h(),on);function nt(e){return typeof e=="object"&&"MutableReference"in e?e.MutableReference:void 0}function tr(e){return typeof e=="object"&&"Reference"in e?e.Reference:void 0}function ft(e){if(typeof e=="object"&&"Struct"in e)return e;const t=tr(e),r=nt(e);if(typeof t=="object"&&"Struct"in t)return t;if(typeof r=="object"&&"Struct"in r)return r}function cn(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var n=0;n<e.length;n++){var i=e.charAt(n),s=i.charCodeAt(0);if(t[s]!==255)throw new TypeError(i+" is ambiguous");t[s]=n}var o=e.length,a=e.charAt(0),c=Math.log(o)/Math.log(256),d=Math.log(256)/Math.log(o);function l(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 w=0,b=0,f=0,x=y.length;f!==x&&y[f]===0;)f++,w++;for(var C=(x-f)*d+1>>>0,P=new Uint8Array(C);f!==x;){for(var A=y[f],k=0,N=C-1;(A!==0||k<b)&&N!==-1;N--,k++)A+=256*P[N]>>>0,P[N]=A%o>>>0,A=A/o>>>0;if(A!==0)throw new Error("Non-zero carry");b=k,f++}for(var q=C-b;q!==C&&P[q]===0;)q++;for(var he=a.repeat(w);q<C;++q)he+=e.charAt(P[q]);return he}function g(y){if(typeof y!="string")throw new TypeError("Expected String");if(y.length===0)return new Uint8Array;for(var w=0,b=0,f=0;y[w]===a;)b++,w++;for(var x=(y.length-w)*c+1>>>0,C=new Uint8Array(x);y[w];){var P=t[y.charCodeAt(w)];if(P===255)return;for(var A=0,k=x-1;(P!==0||A<f)&&k!==-1;k--,A++)P+=o*C[k]>>>0,C[k]=P%256>>>0,P=P/256>>>0;if(P!==0)throw new Error("Non-zero carry");f=A,w++}for(var N=x-f;N!==x&&C[N]===0;)N++;for(var q=new Uint8Array(b+(x-N)),he=b;N!==x;)q[he++]=C[N++];return q}function m(y){var w=g(y);if(w)return w;throw new Error("Non-base"+o+" character")}return{encode:l,decodeUnsafe:g,decode:m}}var un=cn;const dn=un,ln="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";var fn=dn(ln);const rr=B.getDefaultExportFromCjs(fn),xe=e=>rr.encode(e),ht=e=>rr.decode(e);function ce(e){return Uint8Array.from(atob(e),t=>t.charCodeAt(0))}const He=8192;function Ae(e){if(e.length<He)return btoa(String.fromCharCode(...e));let t="";for(var r=0;r<e.length;r+=He){const n=e.slice(r,r+He);t+=String.fromCharCode(...n)}return btoa(t)}function Ke(e){var i;const t=e.startsWith("0x")?e.slice(2):e,n=((i=(t.length%2===0?t:`0${t}}`).match(/.{2}/g))==null?void 0:i.map(s=>parseInt(s,16)))??[];return Uint8Array.from(n)}function _e(e){return e.reduce((t,r)=>t+r.toString(16).padStart(2,"0"),"")}function gt(e){let t=[],r=0;if(e===0)return[0];for(;e>0;)t[r]=e&127,(e>>=7)&&(t[r]|=128),r+=1;return t}function hn(e){let t=0,r=0,n=0;for(;;){let i=e[n];if(n+=1,t|=(i&127)<<r,!(i&128))break;r+=7}return{value:t,length:n}}class nr{constructor(t){this.bytePosition=0,this.dataView=new DataView(t.buffer)}shift(t){return this.bytePosition+=t,this}read8(){let t=this.dataView.getUint8(this.bytePosition);return this.shift(1),t}read16(){let t=this.dataView.getUint16(this.bytePosition,!0);return this.shift(2),t}read32(){let t=this.dataView.getUint32(this.bytePosition,!0);return this.shift(4),t}read64(){let t=this.read32(),n=this.read32().toString(16)+t.toString(16).padStart(8,"0");return BigInt("0x"+n).toString(10)}read128(){let t=BigInt(this.read64()),n=BigInt(this.read64()).toString(16)+t.toString(16).padStart(16,"0");return BigInt("0x"+n).toString(10)}read256(){let t=BigInt(this.read128()),n=BigInt(this.read128()).toString(16)+t.toString(16).padStart(32,"0");return BigInt("0x"+n).toString(10)}readBytes(t){let r=this.bytePosition+this.dataView.byteOffset,n=new Uint8Array(this.dataView.buffer,r,t);return this.shift(t),n}readULEB(){let t=this.bytePosition+this.dataView.byteOffset,r=new Uint8Array(this.dataView.buffer,t),{value:n,length:i}=hn(r);return this.shift(i),n}readVec(t){let r=this.readULEB(),n=[];for(let i=0;i<r;i++)n.push(t(this,i,r));return n}}function gn(e,t){switch(t){case"base58":return xe(e);case"base64":return Ae(e);case"hex":return _e(e);default:throw new Error("Unsupported encoding, supported values are: base64, hex")}}function pn(e,t){switch(t){case"base58":return ht(e);case"base64":return ce(e);case"hex":return Ke(e);default:throw new Error("Unsupported encoding, supported values are: base64, hex")}}function ir(e,t=["<",">"]){const[r,n]=t,i=[];let s="",o=0;for(let a=0;a<e.length;a++){const c=e[a];if(c===r&&o++,c===n&&o--,o===0&&c===","){i.push(s.trim()),s="";continue}s+=c}return i.push(s.trim()),i}class sr{constructor({size:t=1024,maxSize:r,allocateSize:n=1024}={}){this.bytePosition=0,this.size=t,this.maxSize=r||t,this.allocateSize=n,this.dataView=new DataView(new ArrayBuffer(t))}ensureSizeOrGrow(t){const r=this.bytePosition+t;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(t){return this.bytePosition+=t,this}write8(t){return this.ensureSizeOrGrow(1),this.dataView.setUint8(this.bytePosition,Number(t)),this.shift(1)}write16(t){return this.ensureSizeOrGrow(2),this.dataView.setUint16(this.bytePosition,Number(t),!0),this.shift(2)}write32(t){return this.ensureSizeOrGrow(4),this.dataView.setUint32(this.bytePosition,Number(t),!0),this.shift(4)}write64(t){return Xe(BigInt(t),8).forEach(r=>this.write8(r)),this}write128(t){return Xe(BigInt(t),16).forEach(r=>this.write8(r)),this}write256(t){return Xe(BigInt(t),32).forEach(r=>this.write8(r)),this}writeULEB(t){return gt(t).forEach(r=>this.write8(r)),this}writeVec(t,r){return this.writeULEB(t.length),Array.from(t).forEach((n,i)=>r(this,n,i,t.length)),this}*[Symbol.iterator](){for(let t=0;t<this.bytePosition;t++)yield this.dataView.getUint8(t);return this.toBytes()}toBytes(){return new Uint8Array(this.dataView.buffer.slice(0,this.bytePosition))}toString(t){return gn(this.toBytes(),t)}}function Xe(e,t){let r=new Uint8Array(t),n=0;for(;e>0;)r[n]=Number(e%BigInt(256)),e=e/BigInt(256),n+=1;return r}var ar=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},X=(e,t,r)=>(ar(e,t,"read from private field"),r?r.call(e):t.get(e)),ze=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},Ve=(e,t,r,n)=>(ar(e,t,"write to private field"),t.set(e,r),r),ge,be,Me,ae;const or=class{constructor(e){ze(this,ge,void 0),ze(this,be,void 0),this.name=e.name,this.read=e.read,this.serializedSize=e.serializedSize??(()=>null),Ve(this,ge,e.write),Ve(this,be,e.serialize??((t,r)=>{const n=new sr({size:this.serializedSize(t)??void 0,...r});return X(this,ge).call(this,t,n),n.toBytes()})),this.validate=e.validate??(()=>{})}write(e,t){this.validate(e),X(this,ge).call(this,e,t)}serialize(e,t){return this.validate(e),new yn(this,X(this,be).call(this,e,t))}parse(e){const t=new nr(e);return this.read(t)}transform({name:e,input:t,output:r}){return new or({name:e??this.name,read:n=>r(this.read(n)),write:(n,i)=>X(this,ge).call(this,t(n),i),serializedSize:n=>this.serializedSize(t(n)),serialize:(n,i)=>X(this,be).call(this,t(n),i),validate:n=>this.validate(t(n))})}};let Z=or;ge=new WeakMap;be=new WeakMap;const cr=Symbol.for("@mysten/serialized-bcs");function pt(e){return!!e&&typeof e=="object"&&e[cr]===!0}class yn{constructor(t,r){ze(this,Me,void 0),ze(this,ae,void 0),Ve(this,Me,t),Ve(this,ae,r)}get[cr](){return!0}toBytes(){return X(this,ae)}toHex(){return _e(X(this,ae))}toBase64(){return Ae(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 Fe({size:e,...t}){return new Z({...t,serializedSize:()=>e})}function Ze({readMethod:e,writeMethod:t,...r}){return Fe({...r,read:n=>n[e](),write:(n,i)=>i[t](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 Ye({readMethod:e,writeMethod:t,...r}){return Fe({...r,read:n=>n[e](),write:(n,i)=>i[t](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 mn({serialize:e,...t}){const r=new Z({...t,serialize:e,write:(n,i)=>{for(const s of r.serialize(n).toBytes())i.write8(s)}});return r}function wn({toBytes:e,fromBytes:t,...r}){return new Z({...r,read:n=>{const i=n.readULEB(),s=n.readBytes(i);return t(s)},write:(n,i)=>{const s=e(n);i.writeULEB(s.length);for(let o=0;o<s.length;o++)i.write8(s[o])},serialize:n=>{const i=e(n),s=gt(i.length),o=new Uint8Array(s.length+i.length);return o.set(s,0),o.set(i,s.length),o},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 bn(e){let t=null;function r(){return t||(t=e()),t}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 u={u8(e){return Ze({name:"u8",readMethod:"read8",writeMethod:"write8",size:1,maxValue:2**8-1,...e})},u16(e){return Ze({name:"u16",readMethod:"read16",writeMethod:"write16",size:2,maxValue:2**16-1,...e})},u32(e){return Ze({name:"u32",readMethod:"read32",writeMethod:"write32",size:4,maxValue:2**32-1,...e})},u64(e){return Ye({name:"u64",readMethod:"read64",writeMethod:"write64",size:8,maxValue:2n**64n-1n,...e})},u128(e){return Ye({name:"u128",readMethod:"read128",writeMethod:"write128",size:16,maxValue:2n**128n-1n,...e})},u256(e){return Ye({name:"u256",readMethod:"read256",writeMethod:"write256",size:32,maxValue:2n**256n-1n,...e})},bool(e){return Fe({name:"bool",size:1,read:t=>t.read8()===1,write:(t,r)=>r.write8(t?1:0),...e,validate:t=>{var r;if((r=e==null?void 0:e.validate)==null||r.call(e,t),typeof t!="boolean")throw new TypeError(`Expected boolean, found ${typeof t}`)}})},uleb128(e){return mn({name:"uleb128",read:t=>t.readULEB(),serialize:t=>Uint8Array.from(gt(t)),...e})},bytes(e,t){return Fe({name:`bytes[${e}]`,size:e,read:r=>r.readBytes(e),write:(r,n)=>{for(let i=0;i<e;i++)n.write8(r[i]??0)},...t,validate:r=>{var n;if((n=t==null?void 0:t.validate)==null||n.call(t,r),!("length"in r))throw new TypeError(`Expected array, found ${typeof r}`);if(r.length!==e)throw new TypeError(`Expected array of length ${e}, found ${r.length}`)}})},string(e){return wn({name:"string",toBytes:t=>new TextEncoder().encode(t),fromBytes:t=>new TextDecoder().decode(t),...e})},fixedArray(e,t,r){return new Z({name:`${t.name}[${e}]`,read:n=>{const i=new Array(e);for(let s=0;s<e;s++)i[s]=t.read(n);return i},write:(n,i)=>{for(const s of n)t.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!==e)throw new TypeError(`Expected array of length ${e}, found ${n.length}`)}})},option(e){return u.enum(`Option<${e.name}>`,{None:null,Some:e}).transform({input:t=>t==null?{None:!0}:{Some:t},output:t=>"Some"in t?t.Some:null})},vector(e,t){return new Z({name:`vector<${e.name}>`,read:r=>{const n=r.readULEB(),i=new Array(n);for(let s=0;s<n;s++)i[s]=e.read(r);return i},write:(r,n)=>{n.writeULEB(r.length);for(const i of r)e.write(i,n)},...t,validate:r=>{var n;if((n=t==null?void 0:t.validate)==null||n.call(t,r),!("length"in r))throw new TypeError(`Expected array, found ${typeof r}`)}})},tuple(e,t){return new Z({name:`(${e.map(r=>r.name).join(", ")})`,serializedSize:r=>{let n=0;for(let i=0;i<e.length;i++){const s=e[i].serializedSize(r[i]);if(s==null)return null;n+=s}return n},read:r=>{const n=[];for(const i of e)n.push(i.read(r));return n},write:(r,n)=>{for(let i=0;i<e.length;i++)e[i].write(r[i],n)},...t,validate:r=>{var n;if((n=t==null?void 0:t.validate)==null||n.call(t,r),!Array.isArray(r))throw new TypeError(`Expected array, found ${typeof r}`);if(r.length!==e.length)throw new TypeError(`Expected array of length ${e.length}, found ${r.length}`)}})},struct(e,t,r){const n=Object.entries(t);return new Z({name:e,serializedSize:i=>{let s=0;for(const[o,a]of n){const c=a.serializedSize(i[o]);if(c==null)return null;s+=c}return s},read:i=>{const s={};for(const[o,a]of n)s[o]=a.read(i);return s},write:(i,s)=>{for(const[o,a]of n)a.write(i[o],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(e,t,r){const n=Object.entries(t);return new Z({name:e,read:i=>{const s=i.readULEB(),[o,a]=n[s];return{[o]:(a==null?void 0:a.read(i))??!0}},write:(i,s)=>{const[o,a]=Object.entries(i)[0];for(let c=0;c<n.length;c++){const[d,l]=n[c];if(d===o){s.writeULEB(c),l==null||l.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[o]=s;if(!Object.hasOwn(t,o))throw new TypeError(`Invalid enum variant ${o}`)}})},map(e,t){return u.vector(u.tuple([e,t])).transform({name:`Map<${e.name}, ${t.name}>`,input:r=>[...r.entries()],output:r=>{const n=new Map;for(const[i,s]of r)n.set(i,s);return n}})},generic(e,t){return(...r)=>t(...r).transform({name:`${t.name}<${r.map(n=>n.name).join(", ")}>`,input:n=>n,output:n=>n})},lazy(e){return bn(e)}},Sn=32,Se=class{constructor(e){if(this.types=new Map,this.counter=0,e instanceof Se){this.schema=e.schema,this.types=new Map(e.types);return}if(this.schema=e,this.registerAddressType(Se.ADDRESS,e.addressLength,e.addressEncoding),this.registerVectorType(e.vectorType),e.types&&e.types.structs)for(let t of Object.keys(e.types.structs))this.registerStructType(t,e.types.structs[t]);if(e.types&&e.types.enums)for(let t of Object.keys(e.types.enums))this.registerEnumType(t,e.types.enums[t]);if(e.types&&e.types.aliases)for(let t of Object.keys(e.types.aliases))this.registerAlias(t,e.types.aliases[t]);e.withPrimitives!==!1&&Tn(this)}tempKey(){return`bcs-struct-${++this.counter}`}ser(e,t,r){if(typeof e=="string"||Array.isArray(e)){const{name:n,params:i}=this.parseTypeName(e);return this.getTypeInterface(n).encode(this,t,r,i)}if(typeof e=="object"){const n=this.tempKey();return new Se(this).registerStructType(n,e).ser(n,t,r)}throw new Error(`Incorrect type passed into the '.ser()' function.
|
|
2
2
|
${JSON.stringify(e)}`)}de(e,t,r){if(typeof t=="string")if(r)t=pn(t,r);else throw new Error("To pass a string to `bcs.de`, specify encoding");if(typeof e=="string"||Array.isArray(e)){const{name:n,params:i}=this.parseTypeName(e);return this.getTypeInterface(n).decode(this,t,i)}if(typeof e=="object"){const n=new Se(this),i=this.tempKey();return n.registerStructType(i,e).de(i,t,r)}throw new Error(`Incorrect type passed into the '.de()' function.
|
|
3
3
|
${JSON.stringify(e)}`)}hasType(e){return this.types.has(e)}registerAlias(e,t){return this.types.set(e,t),this}registerType(e,t,r,n=()=>!0){const{name:i,params:s}=this.parseTypeName(e);return this.types.set(i,{encode(o,a,c,d){const l=s.reduce((g,m,y)=>Object.assign(g,{[m]:d[y]}),{});return this._encodeRaw.call(o,new sr(c),a,d,l)},decode(o,a,c){const d=s.reduce((l,g,m)=>Object.assign(l,{[g]:c[m]}),{});return this._decodeRaw.call(o,new nr(a),c,d)},_encodeRaw(o,a,c,d){if(n(a))return t.call(this,o,a,c,d);throw new Error(`Validation failed for type ${i}, data: ${a}`)},_decodeRaw(o,a,c){return r.call(this,o,a,c)}}),this}registerBcsType(e,t){return this.registerType(e,(r,n,i)=>{const s=i.map(o=>new Z({name:String(o),write:(a,c)=>{const{name:d,params:l}=this.parseTypeName(o),g=this.getTypeInterface(d),m=l.reduce((y,w,b)=>Object.assign(y,{[w]:i[b]}),{});return g._encodeRaw.call(this,c,a,l,m)},read:()=>{throw new Error("Not implemented")}}));return t(...s).write(n,r),r},(r,n)=>{const i=n.map(s=>new Z({name:String(s),write:(o,a)=>{throw new Error("Not implemented")},read:o=>{const{name:a,params:c}=this.parseTypeName(s),d=this.getTypeInterface(a),l=c.reduce((g,m,y)=>Object.assign(g,{[m]:n[y]}),{});return d._decodeRaw.call(this,o,c,l)}}));return t(...i).read(r)}),this}registerAddressType(e,t,r="hex"){switch(r){case"base64":return this.registerType(e,function(i,s){return ce(s).reduce((o,a)=>o.write8(a),i)},function(i){return Ae(i.readBytes(t))});case"hex":return this.registerType(e,function(i,s){return Ke(s).reduce((o,a)=>o.write8(a),i)},function(i){return _e(i.readBytes(t))});default:throw new Error("Unsupported encoding! Use either hex or base64")}}registerVectorType(e){let{name:t,params:r}=this.parseTypeName(e);if(r.length>1)throw new Error("Vector can have only one type parameter; got "+t);return this.registerType(e,function(i,s,o,a){return i.writeVec(s,(c,d)=>{let l=o[0];if(!l)throw new Error(`Incorrect number of type parameters passed a to vector '${e}'`);let{name:g,params:m}=this.parseTypeName(l);if(this.hasType(g))return this.getTypeInterface(g)._encodeRaw.call(this,c,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:w}=this.parseTypeName(a[g]);return this.getTypeInterface(y)._encodeRaw.call(this,c,d,w,a)})},function(i,s,o){return i.readVec(a=>{let c=s[0];if(!c)throw new Error(`Incorrect number of type parameters passed to a vector '${e}'`);let{name:d,params:l}=this.parseTypeName(c);if(this.hasType(d))return this.getTypeInterface(d)._decodeRaw.call(this,a,l,o);if(!(d in o))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(o[d]);return this.getTypeInterface(g)._decodeRaw.call(this,a,m,o)})})}registerStructType(e,t){for(let o in t){let a=this.tempKey(),c=t[o];!Array.isArray(c)&&typeof c!="string"&&(t[o]=a,this.registerStructType(a,c))}let r=Object.freeze(t),n=Object.keys(r),{name:i,params:s}=this.parseTypeName(e);return this.registerType(e,function(a,c,d,l){if(!c||c.constructor!==Object)throw new Error(`Expected ${i} to be an Object, got: ${c}`);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 c))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,c[g],y,l);else{const w=s.indexOf(m);let{name:b,params:f}=this.parseTypeName(d[w]);if(this.hasType(b)){this.getTypeInterface(b)._encodeRaw.call(this,a,c[g],f,l);continue}if(!(b in l))throw new Error(`Unable to find a matching type definition for ${b} in ${i}; make sure you passed a generic`);let{name:x,params:C}=this.parseTypeName(l[b]);this.getTypeInterface(x)._encodeRaw.call(this,a,c[g],C,l)}}return a},function(a,c,d){if(c.length!==s.length)throw new Error(`Incorrect number of generic parameters passed; expected: ${s.length}, got: ${c.length}`);let l={};for(let g of n){const{name:m,params:y}=this.parseTypeName(r[g]);if(!s.includes(m))l[g]=this.getTypeInterface(m)._decodeRaw.call(this,a,y,d);else{const w=s.indexOf(m);let{name:b,params:f}=this.parseTypeName(c[w]);if(this.hasType(b)){l[g]=this.getTypeInterface(b)._decodeRaw.call(this,a,f,d);continue}if(!(b in d))throw new Error(`Unable to find a matching type definition for ${b} in ${i}; make sure you passed a generic`);let{name:x,params:C}=this.parseTypeName(d[b]);l[g]=this.getTypeInterface(x)._decodeRaw.call(this,a,C,d)}}return l})}registerEnumType(e,t){for(let o in t){let a=this.tempKey(),c=t[o];c!==null&&!Array.isArray(c)&&typeof c!="string"&&(t[o]=a,this.registerStructType(a,c))}let r=Object.freeze(t),n=Object.keys(r),{name:i,params:s}=this.parseTypeName(e);return this.registerType(e,function(a,c,d,l){if(!c)throw new Error(`Unable to write enum "${i}", missing data.
|
|
4
4
|
Received: "${c}"`);if(typeof c!="object")throw new Error(`Incorrect data passed into enum "${i}", expected object with properties: "${n.join(" | ")}".
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { d as te, ab as el, y as It, bP as Bo, o as Nw, g as Tw } from "./index-
|
|
2
|
-
import { c as U, s as Vo, x as tl, r as rl, H as Cw, a as il, q as xs } from "./index-
|
|
3
|
-
import { c as $w, a as xw, g as ku, s as Dw, d as Fw, k as qw, b as jw, I as mr, f as Et, t as dt, e as zu, C as Uw, r as Mw, h as Lr, i as sl, j as Nt, l as js, G as Lw, E as Ge, y as rt, o as Us, m as Ms, n as Hu, p as kw, q as zw, u as Hw, v as Ko, w as Ls, x as Wo, z as er, Y as Bw, A as Vw, B as Bu, D as Kw } from "./browser-
|
|
1
|
+
import { d as te, ab as el, y as It, bP as Bo, o as Nw, g as Tw } from "./index-DXycTbzg.mjs";
|
|
2
|
+
import { c as U, s as Vo, x as tl, r as rl, H as Cw, a as il, q as xs } from "./index-CY3avmpk.mjs";
|
|
3
|
+
import { c as $w, a as xw, g as ku, s as Dw, d as Fw, k as qw, b as jw, I as mr, f as Et, t as dt, e as zu, C as Uw, r as Mw, h as Lr, i as sl, j as Nt, l as js, G as Lw, E as Ge, y as rt, o as Us, m as Ms, n as Hu, p as kw, q as zw, u as Hw, v as Ko, w as Ls, x as Wo, z as er, Y as Bw, A as Vw, B as Bu, D as Kw } from "./browser-ByPSU-Sm.mjs";
|
|
4
4
|
var he = {};
|
|
5
5
|
Object.defineProperty(he, "__esModule", { value: !0 });
|
|
6
6
|
he.getLocalStorage = he.getLocalStorageOrThrow = he.getCrypto = he.getCryptoOrThrow = he.getLocation = he.getLocationOrThrow = he.getNavigator = he.getNavigatorOrThrow = he.getDocument = he.getDocumentOrThrow = he.getFromWindowOrThrow = he.getFromWindow = void 0;
|
|
@@ -8620,7 +8620,7 @@ class ua {
|
|
|
8620
8620
|
if (this.rpc = this.getRpcConfig(t), this.chainId = this.rpc.chains.length ? qs(this.rpc.chains) : qs(this.rpc.optionalChains), this.signer = await wP.init({ projectId: this.rpc.projectId, metadata: this.rpc.metadata, disableProviderPing: t.disableProviderPing, relayUrl: t.relayUrl, storageOptions: t.storageOptions }), this.registerEventListeners(), await this.loadPersistedSession(), this.rpc.showQrModal) {
|
|
8621
8621
|
let r;
|
|
8622
8622
|
try {
|
|
8623
|
-
const { WalletConnectModal: s } = await import("./index-
|
|
8623
|
+
const { WalletConnectModal: s } = await import("./index-CZytaOh1.mjs").then((a) => a.i);
|
|
8624
8624
|
r = s;
|
|
8625
8625
|
} catch {
|
|
8626
8626
|
throw new Error("To use QR modal, please install @walletconnect/modal package");
|