@wormhole-foundation/wormhole-connect 0.3.18-beta.2-development → 0.3.18-beta.3-development
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{ccip-Cn2GV6zJ.js → ccip-DZSSxbfG.js} +1 -1
- package/dist/assets/{evm-DtOGrurb.js → evm-DPbsPo2H.js} +4 -4
- package/dist/assets/{index-BMsphhTc.js → index-DQiwN_Ue.js} +2 -2
- package/dist/assets/{index-CgYSKnqj.js → index-DeBYURSI.js} +1 -1
- package/dist/assets/{index.es-CemSjxmT.js → index.es-YhlgvURC.js} +2 -2
- package/dist/main.js +4 -4
- package/dist/src/components/TokensModal.d.ts.map +1 -1
- package/lib/{algorand-BDEvXX59.js → algorand--fALMVQ6.js} +1 -1
- package/lib/{algorand-Zc_bwW4S.mjs → algorand-BscStaE0.mjs} +4 -4
- package/lib/{aptos-2xBTg_HB.js → aptos-B3AS31XA.js} +1 -1
- package/lib/{aptos-BXil1ow6.mjs → aptos-D3gQDkVy.mjs} +4 -4
- package/lib/{aptos-HGzvDQev.mjs → aptos-DblrFWKz.mjs} +1 -1
- package/lib/{aptos-DBVV7qfV.js → aptos-uzjcRbKQ.js} +2 -2
- package/lib/{browser-DkelnPvs.js → browser-CUR1_-g7.js} +1 -1
- package/lib/{browser-D9O31Eeu.mjs → browser-CzNUhOtu.mjs} +2 -2
- package/lib/{ccip-C6SEFKkH.js → ccip-5uEJrSao.js} +1 -1
- package/lib/{ccip-BbYeuDVL.mjs → ccip-6d6x_AR7.mjs} +1 -1
- package/lib/{chain-BNKwvp-5.js → chain-Bq0KV5Nv.js} +1 -1
- package/lib/{chain-CdLYfAPM.mjs → chain-WayEKuld.mjs} +1 -1
- package/lib/{cosmos-BquWOK1X.mjs → cosmos-CwUr8XHO.mjs} +3 -3
- package/lib/{cosmos-Bsg4ShMs.js → cosmos-uP_qWSoq.js} +1 -1
- package/lib/{cosmwasm-DYmgsUUs.mjs → cosmwasm-ByfSCJro.mjs} +6 -6
- package/lib/{cosmwasm-Bhw3FsD_.js → cosmwasm-nZ1bv1b_.js} +2 -2
- package/lib/{create-D0TucuHl.js → create-CvZ650sz.js} +1 -1
- package/lib/{create-HDqF-1ZK.mjs → create-DppBfW47.mjs} +1 -1
- package/lib/{ens-validation.es6-BCps0Eec.js → ens-validation.es6-CCfWbdrS.js} +1 -1
- package/lib/{ens-validation.es6-w8x_dHmb.mjs → ens-validation.es6-CJs8RCzz.mjs} +2 -2
- package/lib/{evm-BbX0J1y-.js → evm-B80a5HsG.js} +2 -2
- package/lib/{evm-Dr0UlgwP.mjs → evm-BHI64qKH.mjs} +6 -6
- package/lib/{evm-BpzK53GX.js → evm-BSRvb7zQ.js} +4 -4
- package/lib/{evm-2KelLB7H.mjs → evm-DYiU2-MQ.mjs} +6 -6
- package/lib/{index-DaO7I-qg.js → index--J8UGeLt.js} +1 -1
- package/lib/{index-BcDN2lKv.mjs → index-00seDHdc.mjs} +5 -5
- package/lib/{index-D3MP5ran.js → index-B98kSotj.js} +1 -1
- package/lib/{index-zIY9Ty8L.js → index-BCWmM6sh.js} +1 -1
- package/lib/{index-Cpoq8bln.mjs → index-BMEA_Z4x.mjs} +27 -29
- package/lib/{index-DsDKaGAZ.mjs → index-BO4gCfyo.mjs} +4 -4
- package/lib/{index--Ya24MuT.mjs → index-BPttYMSW.mjs} +4 -4
- package/lib/{index-DIvMhatg.js → index-BR0KcmSP.js} +1 -1
- package/lib/{index-BTzpW2CH.js → index-BRws2oLK.js} +1 -1
- package/lib/{index-B-SCKn9E.js → index-BUGVfe_P.js} +1 -1
- package/lib/{index-DnCA55BS.mjs → index-BVlhk1Zx.mjs} +5 -5
- package/lib/{index-Buf5ViDI.mjs → index-BfaX86DY.mjs} +3 -3
- package/lib/{index-NzkgoUpB.js → index-BmHNRhrd.js} +1 -1
- package/lib/{index-CZgNyZsy.js → index-Bn43dUZE.js} +1 -1
- package/lib/{index-BG6SOggM.mjs → index-Bo_tkV1D.mjs} +4 -4
- package/lib/{index-DDZSvfje.js → index-Bs2fWIwl.js} +1 -1
- package/lib/{index-X4H_rID0.mjs → index-BxsrjQ0g.mjs} +1 -1
- package/lib/{index-LXVztnX2.mjs → index-CGXg743L.mjs} +4 -4
- package/lib/{index-e7hjhyhE.js → index-CGpTGfVX.js} +1 -1
- package/lib/{index-BRGuBbmG.js → index-CLqv0W4C.js} +1 -1
- package/lib/{index-C6xc4p84.mjs → index-CQBMnJe7.mjs} +5 -5
- package/lib/{index-Cl-uVarz.mjs → index-CXpmXMhQ.mjs} +4 -4
- package/lib/{index-t7bJ4K5j.js → index-CjCHChpV.js} +1 -1
- package/lib/{index-Cv97j9VV.mjs → index-Cnyhr_GO.mjs} +4 -4
- package/lib/{index-lKHt_xhK.mjs → index-D1i1U0GS.mjs} +2 -2
- package/lib/{index-beeGh_NR.js → index-DAxvZmWh.js} +1 -1
- package/lib/{index-B5hw5mz3.js → index-DBG3lw8A.js} +1 -1
- package/lib/{index-BlByGb6g.js → index-DDYPSDXG.js} +1 -1
- package/lib/{index-BszwlEHw.js → index-DGy0PI4x.js} +1 -1
- package/lib/{index-axLvotHN.js → index-DL8e8Ka6.js} +1 -1
- package/lib/{index-DnBgHoFF.mjs → index-DNGg8WTv.mjs} +2 -2
- package/lib/{index-Dpo5JDQ4.mjs → index-DQ2pTa4G.mjs} +4 -4
- package/lib/{index-TS5n3zuc.mjs → index-D_T-tAub.mjs} +3 -3
- package/lib/{index-CccfGakZ.mjs → index-DgYJEsdX.mjs} +6 -6
- package/lib/{index-DTnmfiVy.mjs → index-E1UraJoM.mjs} +4 -4
- package/lib/{index-DJs2hxJ9.mjs → index-E1ooefEo.mjs} +2 -2
- package/lib/{index-DDgLIB9M.mjs → index-FWQH1rP1.mjs} +4 -4
- package/lib/{index-gttJGZ38.js → index-FbJRnzPp.js} +1 -1
- package/lib/{index-LA5IFiOg.js → index-OFbST_Zc.js} +1 -1
- package/lib/{index-Bk8dO7l7.mjs → index-Pwy5eDgZ.mjs} +3 -3
- package/lib/{index-DpAzpz2b.mjs → index-WptHX8MN.mjs} +1 -1
- package/lib/{index-TBqhnkaj.js → index-aCGqbPEi.js} +1 -1
- package/lib/{index-Cc0jpWQp.js → index-c66y1A6n.js} +1 -1
- package/lib/{index-dO02pyGr.mjs → index-eglOHB-b.mjs} +4 -4
- package/lib/{index-BYtnAVI1.js → index-haDnu8fh.js} +1 -1
- package/lib/{index-B4AF-Mv-.js → index-s2bgjlxF.js} +4 -4
- package/lib/{index.es-BuUqRsMC.js → index.es-C8TErlAd.js} +2 -2
- package/lib/{index.es-BNrPiOfV.mjs → index.es-CYR-A5sx.mjs} +4 -4
- package/lib/index.js +1 -1
- package/lib/index.mjs +1 -1
- package/lib/{libsodium-wrappers-ByFZy5hK.mjs → libsodium-wrappers-ARgV8dAO.mjs} +1 -1
- package/lib/{libsodium-wrappers-DEhSVGdH.js → libsodium-wrappers-DPGrOV2g.js} +1 -1
- package/lib/{sei-BjdQujMd.js → sei-Cjl5-5UW.js} +1 -1
- package/lib/{sei-D7pceI_5.mjs → sei-J9YwRQlR.mjs} +2 -2
- package/lib/{solana-BNgUb2lt.mjs → solana-3b1G6Ldj.mjs} +6 -6
- package/lib/{solana-DtLIToHc.mjs → solana-BnUyf5pK.mjs} +3 -3
- package/lib/{solana-D4Kn_xyO.js → solana-DFbLZfms.js} +2 -2
- package/lib/{solana-BuMaCwGs.js → solana-Dd_Vo-ZU.js} +1 -1
- package/lib/{solanaEmbed.esm-Cu68qIpS.mjs → solanaEmbed.esm-BeK6jZyl.mjs} +2 -2
- package/lib/{solanaEmbed.esm-BIYw7Z4-.js → solanaEmbed.esm-DWWS4MCV.js} +1 -1
- package/lib/src/components/TokensModal.d.ts.map +1 -1
- package/lib/{sui-B7wNAAIg.mjs → sui-B14yKSv0.mjs} +1 -1
- package/lib/{sui-BemqzeyY.js → sui-BwHn_8Xv.js} +2 -2
- package/lib/{sui-NM9S9bWA.js → sui-C9dQK1dR.js} +1 -1
- package/lib/{sui-D4a4x3cu.mjs → sui-Ccg74tOQ.mjs} +4 -4
- package/lib/{unsignedTransaction-CNIMIRIN.mjs → unsignedTransaction-N51EO9OV.mjs} +2 -2
- package/lib/{unsignedTransaction-DIjo7pbX.js → unsignedTransaction-qRahjlzp.js} +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const H=require("./index-B4AF-Mv-.js"),iu=require("./dijkstra-CtFxn7S9.js"),P=require("./browser-DkelnPvs.js"),L=require("./index-D3MP5ran.js");let nu=class extends P.r{constructor(e){super(e),this.events=new H.eventsExports.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async request(e,r){return this.requestStrict(P.formatJsonRpcRequest(e.method,e.params||[],e.id||P.getBigIntRpcId().toString()),r)}async requestStrict(e,r){return new Promise(async(i,n)=>{if(!this.connection.connected)try{await this.open()}catch(s){n(s)}this.events.on(`${e.id}`,s=>{P.isJsonRpcError(s)?n(s.error):i(s.result)});try{await this.connection.send(e,r)}catch(s){n(s)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),P.isJsonRpcResponse(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&e.code===3e3&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:""}`)),this.events.emit("disconnect")}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),typeof e=="string"&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",e=>this.onPayload(e)),this.connection.on("close",e=>this.onClose(e)),this.connection.on("error",e=>this.events.emit("error",e)),this.connection.on("register_error",e=>this.onClose()),this.hasRegisteredEventListeners=!0)}};var su=function(){var t=document.getSelection();if(!t.rangeCount)return function(){};for(var e=document.activeElement,r=[],i=0;i<t.rangeCount;i++)r.push(t.getRangeAt(i));switch(e.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":e.blur();break;default:e=null;break}return t.removeAllRanges(),function(){t.type==="Caret"&&t.removeAllRanges(),t.rangeCount||r.forEach(function(n){t.addRange(n)}),e&&e.focus()}},ou=su,So={"text/plain":"Text","text/html":"Url",default:"Text"},au="Copy to clipboard: #{key}, Enter";function cu(t){var e=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return t.replace(/#{\s*key\s*}/g,e)}function hu(t,e){var r,i,n,s,o,c,h=!1;e||(e={}),r=e.debug||!1;try{n=ou(),s=document.createRange(),o=document.getSelection(),c=document.createElement("span"),c.textContent=t,c.ariaHidden="true",c.style.all="unset",c.style.position="fixed",c.style.top=0,c.style.clip="rect(0, 0, 0, 0)",c.style.whiteSpace="pre",c.style.webkitUserSelect="text",c.style.MozUserSelect="text",c.style.msUserSelect="text",c.style.userSelect="text",c.addEventListener("copy",function(d){if(d.stopPropagation(),e.format)if(d.preventDefault(),typeof d.clipboardData>"u"){r&&console.warn("unable to use e.clipboardData"),r&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var m=So[e.format]||So.default;window.clipboardData.setData(m,t)}else d.clipboardData.clearData(),d.clipboardData.setData(e.format,t);e.onCopy&&(d.preventDefault(),e.onCopy(d.clipboardData))}),document.body.appendChild(c),s.selectNodeContents(c),o.addRange(s);var u=document.execCommand("copy");if(!u)throw new Error("copy command was unsuccessful");h=!0}catch(d){r&&console.error("unable to copy using execCommand: ",d),r&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(e.format||"text",t),e.onCopy&&e.onCopy(window.clipboardData),h=!0}catch(m){r&&console.error("unable to copy using clipboardData: ",m),r&&console.error("falling back to prompt"),i=cu("message"in e?e.message:au),window.prompt(i,t)}}finally{o&&(typeof o.removeRange=="function"?o.removeRange(s):o.removeAllRanges()),c&&document.body.removeChild(c),n()}return h}var lu=hu,uu={}.toString,zs=Array.isArray||function(t){return uu.call(t)=="[object Array]"},js={},he={};Object.defineProperty(he,"__esModule",{value:!0});var yc=he.getLocalStorage=Cc=he.getLocalStorageOrThrow=xc=he.getCrypto=Mc=he.getCryptoOrThrow=Ic=he.getLocation=Sc=he.getLocationOrThrow=Ec=he.getNavigator=Ac=he.getNavigatorOrThrow=_c=he.getDocument=bc=he.getDocumentOrThrow=wc=he.getFromWindowOrThrow=vc=he.getFromWindow=void 0;function kr(t){let e;return typeof window<"u"&&typeof window[t]<"u"&&(e=window[t]),e}var vc=he.getFromWindow=kr;function ri(t){const e=kr(t);if(!e)throw new Error(`${t} is not defined in Window`);return e}var wc=he.getFromWindowOrThrow=ri;function fu(){return ri("document")}var bc=he.getDocumentOrThrow=fu;function du(){return kr("document")}var _c=he.getDocument=du;function pu(){return ri("navigator")}var Ac=he.getNavigatorOrThrow=pu;function gu(){return kr("navigator")}var Ec=he.getNavigator=gu;function mu(){return ri("location")}var Sc=he.getLocationOrThrow=mu;function yu(){return kr("location")}var Ic=he.getLocation=yu;function vu(){return ri("crypto")}var Mc=he.getCryptoOrThrow=vu;function wu(){return kr("crypto")}var xc=he.getCrypto=wu;function bu(){return ri("localStorage")}var Cc=he.getLocalStorageOrThrow=bu;function _u(){return kr("localStorage")}yc=he.getLocalStorage=_u;Object.defineProperty(js,"__esModule",{value:!0});var Nc=js.getWindowMetadata=void 0;const Io=he;function Au(){let t,e;try{t=Io.getDocumentOrThrow(),e=Io.getLocationOrThrow()}catch{return null}function r(){const m=t.getElementsByTagName("link"),b=[];for(let A=0;A<m.length;A++){const E=m[A],x=E.getAttribute("rel");if(x&&x.toLowerCase().indexOf("icon")>-1){const I=E.getAttribute("href");if(I)if(I.toLowerCase().indexOf("https:")===-1&&I.toLowerCase().indexOf("http:")===-1&&I.indexOf("//")!==0){let C=e.protocol+"//"+e.host;if(I.indexOf("/")===0)C+=I;else{const R=e.pathname.split("/");R.pop();const T=R.join("/");C+=T+"/"+I}b.push(C)}else if(I.indexOf("//")===0){const C=e.protocol+I;b.push(C)}else b.push(I)}}return b}function i(...m){const b=t.getElementsByTagName("meta");for(let A=0;A<b.length;A++){const E=b[A],x=["itemprop","property","name"].map(I=>E.getAttribute(I)).filter(I=>I?m.includes(I):!1);if(x.length&&x){const I=E.getAttribute("content");if(I)return I}}return""}function n(){let m=i("name","og:site_name","og:title","twitter:title");return m||(m=t.title),m}function s(){return i("description","og:description","twitter:description","keywords")}const o=n(),c=s(),h=e.origin,u=r();return{description:c,url:h,icons:u,name:o}}Nc=js.getWindowMetadata=Au;var Eu=function(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var i=Array(t),n=0,e=0;e<r;e++)for(var s=arguments[e],o=0,c=s.length;o<c;o++,n++)i[n]=s[o];return i},Su=function(){function t(e,r,i){this.name=e,this.version=r,this.os=i,this.type="browser"}return t}(),Iu=function(){function t(e){this.version=e,this.type="node",this.name="node",this.os=H.dist.process.platform}return t}(),Mu=function(){function t(e,r,i,n){this.name=e,this.version=r,this.os=i,this.bot=n,this.type="bot-device"}return t}(),xu=function(){function t(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return t}(),Cu=function(){function t(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return t}(),Nu=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,Ru=/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,Mo=3,Pu=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FBAV\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["searchbot",Nu]],xo=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function Tu(t){return t?Co(t):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new Cu:typeof navigator<"u"?Co(navigator.userAgent):ku()}function Ou(t){return t!==""&&Pu.reduce(function(e,r){var i=r[0],n=r[1];if(e)return e;var s=n.exec(t);return!!s&&[i,s]},!1)}function Co(t){var e=Ou(t);if(!e)return null;var r=e[0],i=e[1];if(r==="searchbot")return new xu;var n=i[1]&&i[1].split(/[._]/).slice(0,3);n?n.length<Mo&&(n=Eu(n,Fu(Mo-n.length))):n=[];var s=n.join("."),o=Bu(t),c=Ru.exec(t);return c&&c[1]?new Mu(r,s,o,c[1]):new Su(r,s,o)}function Bu(t){for(var e=0,r=xo.length;e<r;e++){var i=xo[e],n=i[0],s=i[1],o=s.exec(t);if(o)return n}return null}function ku(){var t=typeof H.dist.process<"u"&&H.dist.process.version;return t?new Iu(H.dist.process.version.slice(1)):null}function Fu(t){for(var e=[],r=0;r<t;r++)e.push("0");return e}function Ks(t){return Tu(t)}function gn(){const t=Ks();return t&&t.os?t.os:void 0}function Rc(){const t=gn();return t?t.toLowerCase().includes("android"):!1}function Pc(){const t=gn();return t?t.toLowerCase().includes("ios")||t.toLowerCase().includes("mac")&&navigator.maxTouchPoints>1:!1}function Du(){return gn()?Rc()||Pc():!1}function Tc(){const t=Ks();return t&&t.name?t.name.toLowerCase()==="node":!1}function qu(){return!Tc()&&!!Oc()}const Lu=vc,Uu=wc,$u=bc,zu=_c,ju=Ac,Oc=Ec,Ku=Sc,Vu=Ic,Hu=Mc,Wu=xc,Ju=Cc,mn=yc;function Qu(){return Nc()}function Gu(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return JSON.parse(t)}catch{return t}}function Yu(t){return typeof t=="string"?t:JSON.stringify(t)}const Bc=Gu,kc=Yu;function Fc(t,e){const r=kc(e),i=mn();i&&i.setItem(t,r)}function Xu(t){let e=null,r=null;const i=mn();return i&&(r=i.getItem(t)),e=r&&Bc(r),e}function Zu(t){const e=mn();e&&e.removeItem(t)}const Dc="WALLETCONNECT_DEEPLINK_CHOICE";function ef(t,e){const r=encodeURIComponent(t);return e.universalLink?`${e.universalLink}/wc?uri=${r}`:e.deepLink?`${e.deepLink}${e.deepLink.endsWith(":")?"//":"/"}wc?uri=${r}`:""}function tf(t){const e=t.href.split("?")[0];Fc(Dc,Object.assign(Object.assign({},t),{href:e}))}function qc(t,e){return t.filter(r=>r.name.toLowerCase().includes(e.toLowerCase()))[0]}function rf(t,e){let r=t;return e&&(r=e.map(i=>qc(t,i)).filter(Boolean)),r}const Lc="https://registry.walletconnect.com";function nf(){return Lc+"/api/v2/wallets"}function sf(){return Lc+"/api/v2/dapps"}function Uc(t,e="mobile"){var r;return{name:t.name||"",shortName:t.metadata.shortName||"",color:t.metadata.colors.primary||"",logo:(r=t.image_url.sm)!==null&&r!==void 0?r:"",universalLink:t[e].universal||"",deepLink:t[e].native||""}}function of(t,e="mobile"){return Object.values(t).filter(r=>!!r[e].universal||!!r[e].native).map(r=>Uc(r,e))}const af=Object.freeze(Object.defineProperty({__proto__:null,detectEnv:Ks,detectOS:gn,formatIOSMobile:ef,formatMobileRegistry:of,formatMobileRegistryEntry:Uc,getClientMeta:Qu,getCrypto:Wu,getCryptoOrThrow:Hu,getDappRegistryUrl:sf,getDocument:zu,getDocumentOrThrow:$u,getFromWindow:Lu,getFromWindowOrThrow:Uu,getLocal:Xu,getLocalStorage:mn,getLocalStorageOrThrow:Ju,getLocation:Vu,getLocationOrThrow:Ku,getMobileLinkRegistry:rf,getMobileRegistryEntry:qc,getNavigator:Oc,getNavigatorOrThrow:ju,getWalletRegistryUrl:nf,isAndroid:Rc,isBrowser:qu,isIOS:Pc,isMobile:Du,isNode:Tc,mobileLinkChoiceKey:Dc,removeLocal:Zu,safeJsonParse:Bc,safeJsonStringify:kc,saveMobileLinkInfo:tf,setLocal:Fc},Symbol.toStringTag,{value:"Module"})),cf=H.getAugmentedNamespace(af);var Pi={},hf=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},$c={},fr={},lf=zs;function uf(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},t.foo()===42}catch{return!1}}ne.TYPED_ARRAY_SUPPORT=uf();var No=ne.TYPED_ARRAY_SUPPORT?2147483647:1073741823;function ne(t,e,r){return!ne.TYPED_ARRAY_SUPPORT&&!(this instanceof ne)?new ne(t,e,r):typeof t=="number"?zc(this,t):vf(this,t,e,r)}ne.TYPED_ARRAY_SUPPORT&&(ne.prototype.__proto__=Uint8Array.prototype,ne.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&ne[Symbol.species]===ne&&Object.defineProperty(ne,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}));function Vs(t){if(t>=No)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+No.toString(16)+" bytes");return t|0}function ff(t){return t!==t}function Jr(t,e){var r;return ne.TYPED_ARRAY_SUPPORT?(r=new Uint8Array(e),r.__proto__=ne.prototype):(r=t,r===null&&(r=new ne(e)),r.length=e),r}function zc(t,e){var r=Jr(t,e<0?0:Vs(e)|0);if(!ne.TYPED_ARRAY_SUPPORT)for(var i=0;i<e;++i)r[i]=0;return r}function df(t,e){var r=Kc(e)|0,i=Jr(t,r),n=i.write(e);return n!==r&&(i=i.slice(0,n)),i}function ws(t,e){for(var r=e.length<0?0:Vs(e.length)|0,i=Jr(t,r),n=0;n<r;n+=1)i[n]=e[n]&255;return i}function pf(t,e,r,i){if(r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(i||0))throw new RangeError("'length' is out of bounds");var n;return r===void 0&&i===void 0?n=new Uint8Array(e):i===void 0?n=new Uint8Array(e,r):n=new Uint8Array(e,r,i),ne.TYPED_ARRAY_SUPPORT?n.__proto__=ne.prototype:n=ws(t,n),n}function gf(t,e){if(ne.isBuffer(e)){var r=Vs(e.length)|0,i=Jr(t,r);return i.length===0||e.copy(i,0,0,r),i}if(e){if(typeof ArrayBuffer<"u"&&e.buffer instanceof ArrayBuffer||"length"in e)return typeof e.length!="number"||ff(e.length)?Jr(t,0):ws(t,e);if(e.type==="Buffer"&&Array.isArray(e.data))return ws(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function jc(t,e){e=e||1/0;for(var r,i=t.length,n=null,s=[],o=0;o<i;++o){if(r=t.charCodeAt(o),r>55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(o+1===i){(e-=3)>-1&&s.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&s.push(239,191,189),n=r;continue}r=(n-55296<<10|r-56320)+65536}else n&&(e-=3)>-1&&s.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;s.push(r)}else if(r<2048){if((e-=2)<0)break;s.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;s.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return s}function Kc(t){if(ne.isBuffer(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var e=t.length;return e===0?0:jc(t).length}function mf(t,e,r,i){for(var n=0;n<i&&!(n+r>=e.length||n>=t.length);++n)e[n+r]=t[n];return n}function yf(t,e,r,i){return mf(jc(e,t.length-r),t,r,i)}function vf(t,e,r,i){if(typeof e=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer?pf(t,e,r,i):typeof e=="string"?df(t,e):gf(t,e)}ne.prototype.write=function(e,r,i){r===void 0?(i=this.length,r=0):i===void 0&&typeof r=="string"?(i=this.length,r=0):isFinite(r)&&(r=r|0,isFinite(i)?i=i|0:i=void 0);var n=this.length-r;if((i===void 0||i>n)&&(i=n),e.length>0&&(i<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");return yf(this,e,r,i)};ne.prototype.slice=function(e,r){var i=this.length;e=~~e,r=r===void 0?i:~~r,e<0?(e+=i,e<0&&(e=0)):e>i&&(e=i),r<0?(r+=i,r<0&&(r=0)):r>i&&(r=i),r<e&&(r=e);var n;if(ne.TYPED_ARRAY_SUPPORT)n=this.subarray(e,r),n.__proto__=ne.prototype;else{var s=r-e;n=new ne(s,void 0);for(var o=0;o<s;++o)n[o]=this[o+e]}return n};ne.prototype.copy=function(e,r,i,n){if(i||(i=0),!n&&n!==0&&(n=this.length),r>=e.length&&(r=e.length),r||(r=0),n>0&&n<i&&(n=i),n===i||e.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-r<n-i&&(n=e.length-r+i);var s=n-i,o;if(this===e&&i<r&&r<n)for(o=s-1;o>=0;--o)e[o+r]=this[o+i];else if(s<1e3||!ne.TYPED_ARRAY_SUPPORT)for(o=0;o<s;++o)e[o+r]=this[o+i];else Uint8Array.prototype.set.call(e,this.subarray(i,i+s),r);return s};ne.prototype.fill=function(e,r,i){if(typeof e=="string"){if(typeof r=="string"?(r=0,i=this.length):typeof i=="string"&&(i=this.length),e.length===1){var n=e.charCodeAt(0);n<256&&(e=n)}}else typeof e=="number"&&(e=e&255);if(r<0||this.length<r||this.length<i)throw new RangeError("Out of range index");if(i<=r)return this;r=r>>>0,i=i===void 0?this.length:i>>>0,e||(e=0);var s;if(typeof e=="number")for(s=r;s<i;++s)this[s]=e;else{var o=ne.isBuffer(e)?e:new ne(e),c=o.length;for(s=0;s<i-r;++s)this[s+r]=o[s%c]}return this};ne.concat=function(e,r){if(!lf(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return Jr(null,0);var i;if(r===void 0)for(r=0,i=0;i<e.length;++i)r+=e[i].length;var n=zc(null,r),s=0;for(i=0;i<e.length;++i){var o=e[i];if(!ne.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,s),s+=o.length}return n};ne.byteLength=Kc;ne.prototype._isBuffer=!0;ne.isBuffer=function(e){return!!(e!=null&&e._isBuffer)};fr.alloc=function(t){var e=new ne(t);return e.fill(0),e};fr.from=function(t){return new ne(t)};var yt={},Hs,wf=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];yt.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return e*4+17};yt.getSymbolTotalCodewords=function(e){return wf[e]};yt.getBCHDigit=function(t){for(var e=0;t!==0;)e++,t>>>=1;return e};yt.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');Hs=e};yt.isKanjiModeEnabled=function(){return typeof Hs<"u"};yt.toSJIS=function(e){return Hs(e)};var yn={};(function(t){t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2};function e(r){if(typeof r!="string")throw new Error("Param is not a string");var i=r.toLowerCase();switch(i){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+r)}}t.isValid=function(i){return i&&typeof i.bit<"u"&&i.bit>=0&&i.bit<4},t.from=function(i,n){if(t.isValid(i))return i;try{return e(i)}catch{return n}}})(yn);function Vc(){this.buffer=[],this.length=0}Vc.prototype={get:function(t){var e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)===1},put:function(t,e){for(var r=0;r<e;r++)this.putBit((t>>>e-r-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var bf=Vc,Ro=fr;function Ti(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=Ro.alloc(t*t),this.reservedBit=Ro.alloc(t*t)}Ti.prototype.set=function(t,e,r,i){var n=t*this.size+e;this.data[n]=r,i&&(this.reservedBit[n]=!0)};Ti.prototype.get=function(t,e){return this.data[t*this.size+e]};Ti.prototype.xor=function(t,e,r){this.data[t*this.size+e]^=r};Ti.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};var _f=Ti,Hc={};(function(t){var e=yt.getSymbolSize;t.getRowColCoords=function(i){if(i===1)return[];for(var n=Math.floor(i/7)+2,s=e(i),o=s===145?26:Math.ceil((s-13)/(2*n-2))*2,c=[s-7],h=1;h<n-1;h++)c[h]=c[h-1]-o;return c.push(6),c.reverse()},t.getPositions=function(i){for(var n=[],s=t.getRowColCoords(i),o=s.length,c=0;c<o;c++)for(var h=0;h<o;h++)c===0&&h===0||c===0&&h===o-1||c===o-1&&h===0||n.push([s[c],s[h]]);return n}})(Hc);var Wc={},Af=yt.getSymbolSize,Po=7;Wc.getPositions=function(e){var r=Af(e);return[[0,0],[r-Po,0],[0,r-Po]]};var Jc={};(function(t){t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var e={N1:3,N2:3,N3:40,N4:10};t.isValid=function(n){return n!=null&&n!==""&&!isNaN(n)&&n>=0&&n<=7},t.from=function(n){return t.isValid(n)?parseInt(n,10):void 0},t.getPenaltyN1=function(n){for(var s=n.size,o=0,c=0,h=0,u=null,d=null,m=0;m<s;m++){c=h=0,u=d=null;for(var b=0;b<s;b++){var A=n.get(m,b);A===u?c++:(c>=5&&(o+=e.N1+(c-5)),u=A,c=1),A=n.get(b,m),A===d?h++:(h>=5&&(o+=e.N1+(h-5)),d=A,h=1)}c>=5&&(o+=e.N1+(c-5)),h>=5&&(o+=e.N1+(h-5))}return o},t.getPenaltyN2=function(n){for(var s=n.size,o=0,c=0;c<s-1;c++)for(var h=0;h<s-1;h++){var u=n.get(c,h)+n.get(c,h+1)+n.get(c+1,h)+n.get(c+1,h+1);(u===4||u===0)&&o++}return o*e.N2},t.getPenaltyN3=function(n){for(var s=n.size,o=0,c=0,h=0,u=0;u<s;u++){c=h=0;for(var d=0;d<s;d++)c=c<<1&2047|n.get(u,d),d>=10&&(c===1488||c===93)&&o++,h=h<<1&2047|n.get(d,u),d>=10&&(h===1488||h===93)&&o++}return o*e.N3},t.getPenaltyN4=function(n){for(var s=0,o=n.data.length,c=0;c<o;c++)s+=n.data[c];var h=Math.abs(Math.ceil(s*100/o/5)-10);return h*e.N4};function r(i,n,s){switch(i){case t.Patterns.PATTERN000:return(n+s)%2===0;case t.Patterns.PATTERN001:return n%2===0;case t.Patterns.PATTERN010:return s%3===0;case t.Patterns.PATTERN011:return(n+s)%3===0;case t.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(s/3))%2===0;case t.Patterns.PATTERN101:return n*s%2+n*s%3===0;case t.Patterns.PATTERN110:return(n*s%2+n*s%3)%2===0;case t.Patterns.PATTERN111:return(n*s%3+(n+s)%2)%2===0;default:throw new Error("bad maskPattern:"+i)}}t.applyMask=function(n,s){for(var o=s.size,c=0;c<o;c++)for(var h=0;h<o;h++)s.isReserved(h,c)||s.xor(h,c,r(n,h,c))},t.getBestMask=function(n,s){for(var o=Object.keys(t.Patterns).length,c=0,h=1/0,u=0;u<o;u++){s(u),t.applyMask(u,n);var d=t.getPenaltyN1(n)+t.getPenaltyN2(n)+t.getPenaltyN3(n)+t.getPenaltyN4(n);t.applyMask(u,n),d<h&&(h=d,c=u)}return c}})(Jc);var vn={},cr=yn,Ui=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],$i=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];vn.getBlocksCount=function(e,r){switch(r){case cr.L:return Ui[(e-1)*4+0];case cr.M:return Ui[(e-1)*4+1];case cr.Q:return Ui[(e-1)*4+2];case cr.H:return Ui[(e-1)*4+3];default:return}};vn.getTotalCodewordsCount=function(e,r){switch(r){case cr.L:return $i[(e-1)*4+0];case cr.M:return $i[(e-1)*4+1];case cr.Q:return $i[(e-1)*4+2];case cr.H:return $i[(e-1)*4+3];default:return}};var Qc={},wn={},Gc=fr,bi=Gc.alloc(512),tn=Gc.alloc(256);(function(){for(var e=1,r=0;r<255;r++)bi[r]=e,tn[e]=r,e<<=1,e&256&&(e^=285);for(r=255;r<512;r++)bi[r]=bi[r-255]})();wn.log=function(e){if(e<1)throw new Error("log("+e+")");return tn[e]};wn.exp=function(e){return bi[e]};wn.mul=function(e,r){return e===0||r===0?0:bi[tn[e]+tn[r]]};(function(t){var e=fr,r=wn;t.mul=function(n,s){for(var o=e.alloc(n.length+s.length-1),c=0;c<n.length;c++)for(var h=0;h<s.length;h++)o[c+h]^=r.mul(n[c],s[h]);return o},t.mod=function(n,s){for(var o=e.from(n);o.length-s.length>=0;){for(var c=o[0],h=0;h<s.length;h++)o[h]^=r.mul(s[h],c);for(var u=0;u<o.length&&o[u]===0;)u++;o=o.slice(u)}return o},t.generateECPolynomial=function(n){for(var s=e.from([1]),o=0;o<n;o++)s=t.mul(s,[1,r.exp(o)]);return s}})(Qc);var To=fr,Yc=Qc,Ef=H.bufferPolyfill.Buffer;function Ws(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}Ws.prototype.initialize=function(e){this.degree=e,this.genPoly=Yc.generateECPolynomial(this.degree)};Ws.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");var r=To.alloc(this.degree),i=Ef.concat([e,r],e.length+this.degree),n=Yc.mod(i,this.genPoly),s=this.degree-n.length;if(s>0){var o=To.alloc(this.degree);return n.copy(o,s),o}return n};var Sf=Ws,Xc={},dr={},Js={};Js.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var Ut={},Zc="[0-9]+",If="[A-Z $%*+\\-./:]+",Ii="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";Ii=Ii.replace(/u/g,"\\u");var Mf="(?:(?![A-Z0-9 $%*+\\-./:]|"+Ii+`)(?:.|[\r
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const H=require("./index-s2bgjlxF.js"),iu=require("./dijkstra-CtFxn7S9.js"),P=require("./browser-CUR1_-g7.js"),L=require("./index-B98kSotj.js");let nu=class extends P.r{constructor(e){super(e),this.events=new H.eventsExports.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async request(e,r){return this.requestStrict(P.formatJsonRpcRequest(e.method,e.params||[],e.id||P.getBigIntRpcId().toString()),r)}async requestStrict(e,r){return new Promise(async(i,n)=>{if(!this.connection.connected)try{await this.open()}catch(s){n(s)}this.events.on(`${e.id}`,s=>{P.isJsonRpcError(s)?n(s.error):i(s.result)});try{await this.connection.send(e,r)}catch(s){n(s)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),P.isJsonRpcResponse(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&e.code===3e3&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:""}`)),this.events.emit("disconnect")}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),typeof e=="string"&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",e=>this.onPayload(e)),this.connection.on("close",e=>this.onClose(e)),this.connection.on("error",e=>this.events.emit("error",e)),this.connection.on("register_error",e=>this.onClose()),this.hasRegisteredEventListeners=!0)}};var su=function(){var t=document.getSelection();if(!t.rangeCount)return function(){};for(var e=document.activeElement,r=[],i=0;i<t.rangeCount;i++)r.push(t.getRangeAt(i));switch(e.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":e.blur();break;default:e=null;break}return t.removeAllRanges(),function(){t.type==="Caret"&&t.removeAllRanges(),t.rangeCount||r.forEach(function(n){t.addRange(n)}),e&&e.focus()}},ou=su,So={"text/plain":"Text","text/html":"Url",default:"Text"},au="Copy to clipboard: #{key}, Enter";function cu(t){var e=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return t.replace(/#{\s*key\s*}/g,e)}function hu(t,e){var r,i,n,s,o,c,h=!1;e||(e={}),r=e.debug||!1;try{n=ou(),s=document.createRange(),o=document.getSelection(),c=document.createElement("span"),c.textContent=t,c.ariaHidden="true",c.style.all="unset",c.style.position="fixed",c.style.top=0,c.style.clip="rect(0, 0, 0, 0)",c.style.whiteSpace="pre",c.style.webkitUserSelect="text",c.style.MozUserSelect="text",c.style.msUserSelect="text",c.style.userSelect="text",c.addEventListener("copy",function(d){if(d.stopPropagation(),e.format)if(d.preventDefault(),typeof d.clipboardData>"u"){r&&console.warn("unable to use e.clipboardData"),r&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var m=So[e.format]||So.default;window.clipboardData.setData(m,t)}else d.clipboardData.clearData(),d.clipboardData.setData(e.format,t);e.onCopy&&(d.preventDefault(),e.onCopy(d.clipboardData))}),document.body.appendChild(c),s.selectNodeContents(c),o.addRange(s);var u=document.execCommand("copy");if(!u)throw new Error("copy command was unsuccessful");h=!0}catch(d){r&&console.error("unable to copy using execCommand: ",d),r&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(e.format||"text",t),e.onCopy&&e.onCopy(window.clipboardData),h=!0}catch(m){r&&console.error("unable to copy using clipboardData: ",m),r&&console.error("falling back to prompt"),i=cu("message"in e?e.message:au),window.prompt(i,t)}}finally{o&&(typeof o.removeRange=="function"?o.removeRange(s):o.removeAllRanges()),c&&document.body.removeChild(c),n()}return h}var lu=hu,uu={}.toString,zs=Array.isArray||function(t){return uu.call(t)=="[object Array]"},js={},he={};Object.defineProperty(he,"__esModule",{value:!0});var yc=he.getLocalStorage=Cc=he.getLocalStorageOrThrow=xc=he.getCrypto=Mc=he.getCryptoOrThrow=Ic=he.getLocation=Sc=he.getLocationOrThrow=Ec=he.getNavigator=Ac=he.getNavigatorOrThrow=_c=he.getDocument=bc=he.getDocumentOrThrow=wc=he.getFromWindowOrThrow=vc=he.getFromWindow=void 0;function kr(t){let e;return typeof window<"u"&&typeof window[t]<"u"&&(e=window[t]),e}var vc=he.getFromWindow=kr;function ri(t){const e=kr(t);if(!e)throw new Error(`${t} is not defined in Window`);return e}var wc=he.getFromWindowOrThrow=ri;function fu(){return ri("document")}var bc=he.getDocumentOrThrow=fu;function du(){return kr("document")}var _c=he.getDocument=du;function pu(){return ri("navigator")}var Ac=he.getNavigatorOrThrow=pu;function gu(){return kr("navigator")}var Ec=he.getNavigator=gu;function mu(){return ri("location")}var Sc=he.getLocationOrThrow=mu;function yu(){return kr("location")}var Ic=he.getLocation=yu;function vu(){return ri("crypto")}var Mc=he.getCryptoOrThrow=vu;function wu(){return kr("crypto")}var xc=he.getCrypto=wu;function bu(){return ri("localStorage")}var Cc=he.getLocalStorageOrThrow=bu;function _u(){return kr("localStorage")}yc=he.getLocalStorage=_u;Object.defineProperty(js,"__esModule",{value:!0});var Nc=js.getWindowMetadata=void 0;const Io=he;function Au(){let t,e;try{t=Io.getDocumentOrThrow(),e=Io.getLocationOrThrow()}catch{return null}function r(){const m=t.getElementsByTagName("link"),b=[];for(let A=0;A<m.length;A++){const E=m[A],x=E.getAttribute("rel");if(x&&x.toLowerCase().indexOf("icon")>-1){const I=E.getAttribute("href");if(I)if(I.toLowerCase().indexOf("https:")===-1&&I.toLowerCase().indexOf("http:")===-1&&I.indexOf("//")!==0){let C=e.protocol+"//"+e.host;if(I.indexOf("/")===0)C+=I;else{const R=e.pathname.split("/");R.pop();const T=R.join("/");C+=T+"/"+I}b.push(C)}else if(I.indexOf("//")===0){const C=e.protocol+I;b.push(C)}else b.push(I)}}return b}function i(...m){const b=t.getElementsByTagName("meta");for(let A=0;A<b.length;A++){const E=b[A],x=["itemprop","property","name"].map(I=>E.getAttribute(I)).filter(I=>I?m.includes(I):!1);if(x.length&&x){const I=E.getAttribute("content");if(I)return I}}return""}function n(){let m=i("name","og:site_name","og:title","twitter:title");return m||(m=t.title),m}function s(){return i("description","og:description","twitter:description","keywords")}const o=n(),c=s(),h=e.origin,u=r();return{description:c,url:h,icons:u,name:o}}Nc=js.getWindowMetadata=Au;var Eu=function(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var i=Array(t),n=0,e=0;e<r;e++)for(var s=arguments[e],o=0,c=s.length;o<c;o++,n++)i[n]=s[o];return i},Su=function(){function t(e,r,i){this.name=e,this.version=r,this.os=i,this.type="browser"}return t}(),Iu=function(){function t(e){this.version=e,this.type="node",this.name="node",this.os=H.dist.process.platform}return t}(),Mu=function(){function t(e,r,i,n){this.name=e,this.version=r,this.os=i,this.bot=n,this.type="bot-device"}return t}(),xu=function(){function t(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return t}(),Cu=function(){function t(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return t}(),Nu=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,Ru=/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,Mo=3,Pu=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FBAV\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["searchbot",Nu]],xo=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function Tu(t){return t?Co(t):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new Cu:typeof navigator<"u"?Co(navigator.userAgent):ku()}function Ou(t){return t!==""&&Pu.reduce(function(e,r){var i=r[0],n=r[1];if(e)return e;var s=n.exec(t);return!!s&&[i,s]},!1)}function Co(t){var e=Ou(t);if(!e)return null;var r=e[0],i=e[1];if(r==="searchbot")return new xu;var n=i[1]&&i[1].split(/[._]/).slice(0,3);n?n.length<Mo&&(n=Eu(n,Fu(Mo-n.length))):n=[];var s=n.join("."),o=Bu(t),c=Ru.exec(t);return c&&c[1]?new Mu(r,s,o,c[1]):new Su(r,s,o)}function Bu(t){for(var e=0,r=xo.length;e<r;e++){var i=xo[e],n=i[0],s=i[1],o=s.exec(t);if(o)return n}return null}function ku(){var t=typeof H.dist.process<"u"&&H.dist.process.version;return t?new Iu(H.dist.process.version.slice(1)):null}function Fu(t){for(var e=[],r=0;r<t;r++)e.push("0");return e}function Ks(t){return Tu(t)}function gn(){const t=Ks();return t&&t.os?t.os:void 0}function Rc(){const t=gn();return t?t.toLowerCase().includes("android"):!1}function Pc(){const t=gn();return t?t.toLowerCase().includes("ios")||t.toLowerCase().includes("mac")&&navigator.maxTouchPoints>1:!1}function Du(){return gn()?Rc()||Pc():!1}function Tc(){const t=Ks();return t&&t.name?t.name.toLowerCase()==="node":!1}function qu(){return!Tc()&&!!Oc()}const Lu=vc,Uu=wc,$u=bc,zu=_c,ju=Ac,Oc=Ec,Ku=Sc,Vu=Ic,Hu=Mc,Wu=xc,Ju=Cc,mn=yc;function Qu(){return Nc()}function Gu(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return JSON.parse(t)}catch{return t}}function Yu(t){return typeof t=="string"?t:JSON.stringify(t)}const Bc=Gu,kc=Yu;function Fc(t,e){const r=kc(e),i=mn();i&&i.setItem(t,r)}function Xu(t){let e=null,r=null;const i=mn();return i&&(r=i.getItem(t)),e=r&&Bc(r),e}function Zu(t){const e=mn();e&&e.removeItem(t)}const Dc="WALLETCONNECT_DEEPLINK_CHOICE";function ef(t,e){const r=encodeURIComponent(t);return e.universalLink?`${e.universalLink}/wc?uri=${r}`:e.deepLink?`${e.deepLink}${e.deepLink.endsWith(":")?"//":"/"}wc?uri=${r}`:""}function tf(t){const e=t.href.split("?")[0];Fc(Dc,Object.assign(Object.assign({},t),{href:e}))}function qc(t,e){return t.filter(r=>r.name.toLowerCase().includes(e.toLowerCase()))[0]}function rf(t,e){let r=t;return e&&(r=e.map(i=>qc(t,i)).filter(Boolean)),r}const Lc="https://registry.walletconnect.com";function nf(){return Lc+"/api/v2/wallets"}function sf(){return Lc+"/api/v2/dapps"}function Uc(t,e="mobile"){var r;return{name:t.name||"",shortName:t.metadata.shortName||"",color:t.metadata.colors.primary||"",logo:(r=t.image_url.sm)!==null&&r!==void 0?r:"",universalLink:t[e].universal||"",deepLink:t[e].native||""}}function of(t,e="mobile"){return Object.values(t).filter(r=>!!r[e].universal||!!r[e].native).map(r=>Uc(r,e))}const af=Object.freeze(Object.defineProperty({__proto__:null,detectEnv:Ks,detectOS:gn,formatIOSMobile:ef,formatMobileRegistry:of,formatMobileRegistryEntry:Uc,getClientMeta:Qu,getCrypto:Wu,getCryptoOrThrow:Hu,getDappRegistryUrl:sf,getDocument:zu,getDocumentOrThrow:$u,getFromWindow:Lu,getFromWindowOrThrow:Uu,getLocal:Xu,getLocalStorage:mn,getLocalStorageOrThrow:Ju,getLocation:Vu,getLocationOrThrow:Ku,getMobileLinkRegistry:rf,getMobileRegistryEntry:qc,getNavigator:Oc,getNavigatorOrThrow:ju,getWalletRegistryUrl:nf,isAndroid:Rc,isBrowser:qu,isIOS:Pc,isMobile:Du,isNode:Tc,mobileLinkChoiceKey:Dc,removeLocal:Zu,safeJsonParse:Bc,safeJsonStringify:kc,saveMobileLinkInfo:tf,setLocal:Fc},Symbol.toStringTag,{value:"Module"})),cf=H.getAugmentedNamespace(af);var Pi={},hf=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},$c={},fr={},lf=zs;function uf(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},t.foo()===42}catch{return!1}}ne.TYPED_ARRAY_SUPPORT=uf();var No=ne.TYPED_ARRAY_SUPPORT?2147483647:1073741823;function ne(t,e,r){return!ne.TYPED_ARRAY_SUPPORT&&!(this instanceof ne)?new ne(t,e,r):typeof t=="number"?zc(this,t):vf(this,t,e,r)}ne.TYPED_ARRAY_SUPPORT&&(ne.prototype.__proto__=Uint8Array.prototype,ne.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&ne[Symbol.species]===ne&&Object.defineProperty(ne,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}));function Vs(t){if(t>=No)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+No.toString(16)+" bytes");return t|0}function ff(t){return t!==t}function Jr(t,e){var r;return ne.TYPED_ARRAY_SUPPORT?(r=new Uint8Array(e),r.__proto__=ne.prototype):(r=t,r===null&&(r=new ne(e)),r.length=e),r}function zc(t,e){var r=Jr(t,e<0?0:Vs(e)|0);if(!ne.TYPED_ARRAY_SUPPORT)for(var i=0;i<e;++i)r[i]=0;return r}function df(t,e){var r=Kc(e)|0,i=Jr(t,r),n=i.write(e);return n!==r&&(i=i.slice(0,n)),i}function ws(t,e){for(var r=e.length<0?0:Vs(e.length)|0,i=Jr(t,r),n=0;n<r;n+=1)i[n]=e[n]&255;return i}function pf(t,e,r,i){if(r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(i||0))throw new RangeError("'length' is out of bounds");var n;return r===void 0&&i===void 0?n=new Uint8Array(e):i===void 0?n=new Uint8Array(e,r):n=new Uint8Array(e,r,i),ne.TYPED_ARRAY_SUPPORT?n.__proto__=ne.prototype:n=ws(t,n),n}function gf(t,e){if(ne.isBuffer(e)){var r=Vs(e.length)|0,i=Jr(t,r);return i.length===0||e.copy(i,0,0,r),i}if(e){if(typeof ArrayBuffer<"u"&&e.buffer instanceof ArrayBuffer||"length"in e)return typeof e.length!="number"||ff(e.length)?Jr(t,0):ws(t,e);if(e.type==="Buffer"&&Array.isArray(e.data))return ws(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function jc(t,e){e=e||1/0;for(var r,i=t.length,n=null,s=[],o=0;o<i;++o){if(r=t.charCodeAt(o),r>55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(o+1===i){(e-=3)>-1&&s.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&s.push(239,191,189),n=r;continue}r=(n-55296<<10|r-56320)+65536}else n&&(e-=3)>-1&&s.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;s.push(r)}else if(r<2048){if((e-=2)<0)break;s.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;s.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return s}function Kc(t){if(ne.isBuffer(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var e=t.length;return e===0?0:jc(t).length}function mf(t,e,r,i){for(var n=0;n<i&&!(n+r>=e.length||n>=t.length);++n)e[n+r]=t[n];return n}function yf(t,e,r,i){return mf(jc(e,t.length-r),t,r,i)}function vf(t,e,r,i){if(typeof e=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer?pf(t,e,r,i):typeof e=="string"?df(t,e):gf(t,e)}ne.prototype.write=function(e,r,i){r===void 0?(i=this.length,r=0):i===void 0&&typeof r=="string"?(i=this.length,r=0):isFinite(r)&&(r=r|0,isFinite(i)?i=i|0:i=void 0);var n=this.length-r;if((i===void 0||i>n)&&(i=n),e.length>0&&(i<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");return yf(this,e,r,i)};ne.prototype.slice=function(e,r){var i=this.length;e=~~e,r=r===void 0?i:~~r,e<0?(e+=i,e<0&&(e=0)):e>i&&(e=i),r<0?(r+=i,r<0&&(r=0)):r>i&&(r=i),r<e&&(r=e);var n;if(ne.TYPED_ARRAY_SUPPORT)n=this.subarray(e,r),n.__proto__=ne.prototype;else{var s=r-e;n=new ne(s,void 0);for(var o=0;o<s;++o)n[o]=this[o+e]}return n};ne.prototype.copy=function(e,r,i,n){if(i||(i=0),!n&&n!==0&&(n=this.length),r>=e.length&&(r=e.length),r||(r=0),n>0&&n<i&&(n=i),n===i||e.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-r<n-i&&(n=e.length-r+i);var s=n-i,o;if(this===e&&i<r&&r<n)for(o=s-1;o>=0;--o)e[o+r]=this[o+i];else if(s<1e3||!ne.TYPED_ARRAY_SUPPORT)for(o=0;o<s;++o)e[o+r]=this[o+i];else Uint8Array.prototype.set.call(e,this.subarray(i,i+s),r);return s};ne.prototype.fill=function(e,r,i){if(typeof e=="string"){if(typeof r=="string"?(r=0,i=this.length):typeof i=="string"&&(i=this.length),e.length===1){var n=e.charCodeAt(0);n<256&&(e=n)}}else typeof e=="number"&&(e=e&255);if(r<0||this.length<r||this.length<i)throw new RangeError("Out of range index");if(i<=r)return this;r=r>>>0,i=i===void 0?this.length:i>>>0,e||(e=0);var s;if(typeof e=="number")for(s=r;s<i;++s)this[s]=e;else{var o=ne.isBuffer(e)?e:new ne(e),c=o.length;for(s=0;s<i-r;++s)this[s+r]=o[s%c]}return this};ne.concat=function(e,r){if(!lf(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return Jr(null,0);var i;if(r===void 0)for(r=0,i=0;i<e.length;++i)r+=e[i].length;var n=zc(null,r),s=0;for(i=0;i<e.length;++i){var o=e[i];if(!ne.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,s),s+=o.length}return n};ne.byteLength=Kc;ne.prototype._isBuffer=!0;ne.isBuffer=function(e){return!!(e!=null&&e._isBuffer)};fr.alloc=function(t){var e=new ne(t);return e.fill(0),e};fr.from=function(t){return new ne(t)};var yt={},Hs,wf=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];yt.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return e*4+17};yt.getSymbolTotalCodewords=function(e){return wf[e]};yt.getBCHDigit=function(t){for(var e=0;t!==0;)e++,t>>>=1;return e};yt.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');Hs=e};yt.isKanjiModeEnabled=function(){return typeof Hs<"u"};yt.toSJIS=function(e){return Hs(e)};var yn={};(function(t){t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2};function e(r){if(typeof r!="string")throw new Error("Param is not a string");var i=r.toLowerCase();switch(i){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+r)}}t.isValid=function(i){return i&&typeof i.bit<"u"&&i.bit>=0&&i.bit<4},t.from=function(i,n){if(t.isValid(i))return i;try{return e(i)}catch{return n}}})(yn);function Vc(){this.buffer=[],this.length=0}Vc.prototype={get:function(t){var e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)===1},put:function(t,e){for(var r=0;r<e;r++)this.putBit((t>>>e-r-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var bf=Vc,Ro=fr;function Ti(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=Ro.alloc(t*t),this.reservedBit=Ro.alloc(t*t)}Ti.prototype.set=function(t,e,r,i){var n=t*this.size+e;this.data[n]=r,i&&(this.reservedBit[n]=!0)};Ti.prototype.get=function(t,e){return this.data[t*this.size+e]};Ti.prototype.xor=function(t,e,r){this.data[t*this.size+e]^=r};Ti.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};var _f=Ti,Hc={};(function(t){var e=yt.getSymbolSize;t.getRowColCoords=function(i){if(i===1)return[];for(var n=Math.floor(i/7)+2,s=e(i),o=s===145?26:Math.ceil((s-13)/(2*n-2))*2,c=[s-7],h=1;h<n-1;h++)c[h]=c[h-1]-o;return c.push(6),c.reverse()},t.getPositions=function(i){for(var n=[],s=t.getRowColCoords(i),o=s.length,c=0;c<o;c++)for(var h=0;h<o;h++)c===0&&h===0||c===0&&h===o-1||c===o-1&&h===0||n.push([s[c],s[h]]);return n}})(Hc);var Wc={},Af=yt.getSymbolSize,Po=7;Wc.getPositions=function(e){var r=Af(e);return[[0,0],[r-Po,0],[0,r-Po]]};var Jc={};(function(t){t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var e={N1:3,N2:3,N3:40,N4:10};t.isValid=function(n){return n!=null&&n!==""&&!isNaN(n)&&n>=0&&n<=7},t.from=function(n){return t.isValid(n)?parseInt(n,10):void 0},t.getPenaltyN1=function(n){for(var s=n.size,o=0,c=0,h=0,u=null,d=null,m=0;m<s;m++){c=h=0,u=d=null;for(var b=0;b<s;b++){var A=n.get(m,b);A===u?c++:(c>=5&&(o+=e.N1+(c-5)),u=A,c=1),A=n.get(b,m),A===d?h++:(h>=5&&(o+=e.N1+(h-5)),d=A,h=1)}c>=5&&(o+=e.N1+(c-5)),h>=5&&(o+=e.N1+(h-5))}return o},t.getPenaltyN2=function(n){for(var s=n.size,o=0,c=0;c<s-1;c++)for(var h=0;h<s-1;h++){var u=n.get(c,h)+n.get(c,h+1)+n.get(c+1,h)+n.get(c+1,h+1);(u===4||u===0)&&o++}return o*e.N2},t.getPenaltyN3=function(n){for(var s=n.size,o=0,c=0,h=0,u=0;u<s;u++){c=h=0;for(var d=0;d<s;d++)c=c<<1&2047|n.get(u,d),d>=10&&(c===1488||c===93)&&o++,h=h<<1&2047|n.get(d,u),d>=10&&(h===1488||h===93)&&o++}return o*e.N3},t.getPenaltyN4=function(n){for(var s=0,o=n.data.length,c=0;c<o;c++)s+=n.data[c];var h=Math.abs(Math.ceil(s*100/o/5)-10);return h*e.N4};function r(i,n,s){switch(i){case t.Patterns.PATTERN000:return(n+s)%2===0;case t.Patterns.PATTERN001:return n%2===0;case t.Patterns.PATTERN010:return s%3===0;case t.Patterns.PATTERN011:return(n+s)%3===0;case t.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(s/3))%2===0;case t.Patterns.PATTERN101:return n*s%2+n*s%3===0;case t.Patterns.PATTERN110:return(n*s%2+n*s%3)%2===0;case t.Patterns.PATTERN111:return(n*s%3+(n+s)%2)%2===0;default:throw new Error("bad maskPattern:"+i)}}t.applyMask=function(n,s){for(var o=s.size,c=0;c<o;c++)for(var h=0;h<o;h++)s.isReserved(h,c)||s.xor(h,c,r(n,h,c))},t.getBestMask=function(n,s){for(var o=Object.keys(t.Patterns).length,c=0,h=1/0,u=0;u<o;u++){s(u),t.applyMask(u,n);var d=t.getPenaltyN1(n)+t.getPenaltyN2(n)+t.getPenaltyN3(n)+t.getPenaltyN4(n);t.applyMask(u,n),d<h&&(h=d,c=u)}return c}})(Jc);var vn={},cr=yn,Ui=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],$i=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];vn.getBlocksCount=function(e,r){switch(r){case cr.L:return Ui[(e-1)*4+0];case cr.M:return Ui[(e-1)*4+1];case cr.Q:return Ui[(e-1)*4+2];case cr.H:return Ui[(e-1)*4+3];default:return}};vn.getTotalCodewordsCount=function(e,r){switch(r){case cr.L:return $i[(e-1)*4+0];case cr.M:return $i[(e-1)*4+1];case cr.Q:return $i[(e-1)*4+2];case cr.H:return $i[(e-1)*4+3];default:return}};var Qc={},wn={},Gc=fr,bi=Gc.alloc(512),tn=Gc.alloc(256);(function(){for(var e=1,r=0;r<255;r++)bi[r]=e,tn[e]=r,e<<=1,e&256&&(e^=285);for(r=255;r<512;r++)bi[r]=bi[r-255]})();wn.log=function(e){if(e<1)throw new Error("log("+e+")");return tn[e]};wn.exp=function(e){return bi[e]};wn.mul=function(e,r){return e===0||r===0?0:bi[tn[e]+tn[r]]};(function(t){var e=fr,r=wn;t.mul=function(n,s){for(var o=e.alloc(n.length+s.length-1),c=0;c<n.length;c++)for(var h=0;h<s.length;h++)o[c+h]^=r.mul(n[c],s[h]);return o},t.mod=function(n,s){for(var o=e.from(n);o.length-s.length>=0;){for(var c=o[0],h=0;h<s.length;h++)o[h]^=r.mul(s[h],c);for(var u=0;u<o.length&&o[u]===0;)u++;o=o.slice(u)}return o},t.generateECPolynomial=function(n){for(var s=e.from([1]),o=0;o<n;o++)s=t.mul(s,[1,r.exp(o)]);return s}})(Qc);var To=fr,Yc=Qc,Ef=H.bufferPolyfill.Buffer;function Ws(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}Ws.prototype.initialize=function(e){this.degree=e,this.genPoly=Yc.generateECPolynomial(this.degree)};Ws.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");var r=To.alloc(this.degree),i=Ef.concat([e,r],e.length+this.degree),n=Yc.mod(i,this.genPoly),s=this.degree-n.length;if(s>0){var o=To.alloc(this.degree);return n.copy(o,s),o}return n};var Sf=Ws,Xc={},dr={},Js={};Js.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var Ut={},Zc="[0-9]+",If="[A-Z $%*+\\-./:]+",Ii="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";Ii=Ii.replace(/u/g,"\\u");var Mf="(?:(?![A-Z0-9 $%*+\\-./:]|"+Ii+`)(?:.|[\r
|
|
2
2
|
]))+`;Ut.KANJI=new RegExp(Ii,"g");Ut.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");Ut.BYTE=new RegExp(Mf,"g");Ut.NUMERIC=new RegExp(Zc,"g");Ut.ALPHANUMERIC=new RegExp(If,"g");var xf=new RegExp("^"+Ii+"$"),Cf=new RegExp("^"+Zc+"$"),Nf=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");Ut.testKanji=function(e){return xf.test(e)};Ut.testNumeric=function(e){return Cf.test(e)};Ut.testAlphanumeric=function(e){return Nf.test(e)};(function(t){var e=Js,r=Ut;t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(s,o){if(!s.ccBits)throw new Error("Invalid mode: "+s);if(!e.isValid(o))throw new Error("Invalid version: "+o);return o>=1&&o<10?s.ccBits[0]:o<27?s.ccBits[1]:s.ccBits[2]},t.getBestModeForData=function(s){return r.testNumeric(s)?t.NUMERIC:r.testAlphanumeric(s)?t.ALPHANUMERIC:r.testKanji(s)?t.KANJI:t.BYTE},t.toString=function(s){if(s&&s.id)return s.id;throw new Error("Invalid mode")},t.isValid=function(s){return s&&s.bit&&s.ccBits};function i(n){if(typeof n!="string")throw new Error("Param is not a string");var s=n.toLowerCase();switch(s){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+n)}}t.from=function(s,o){if(t.isValid(s))return s;try{return i(s)}catch{return o}}})(dr);(function(t){var e=yt,r=vn,i=yn,n=dr,s=Js,o=zs,c=7973,h=e.getBCHDigit(c);function u(A,E,x){for(var I=1;I<=40;I++)if(E<=t.getCapacity(I,x,A))return I}function d(A,E){return n.getCharCountIndicator(A,E)+4}function m(A,E){var x=0;return A.forEach(function(I){var C=d(I.mode,E);x+=C+I.getBitsLength()}),x}function b(A,E){for(var x=1;x<=40;x++){var I=m(A,x);if(I<=t.getCapacity(x,E,n.MIXED))return x}}t.from=function(E,x){return s.isValid(E)?parseInt(E,10):x},t.getCapacity=function(E,x,I){if(!s.isValid(E))throw new Error("Invalid QR Code version");typeof I>"u"&&(I=n.BYTE);var C=e.getSymbolTotalCodewords(E),R=r.getTotalCodewordsCount(E,x),T=(C-R)*8;if(I===n.MIXED)return T;var N=T-d(I,E);switch(I){case n.NUMERIC:return Math.floor(N/10*3);case n.ALPHANUMERIC:return Math.floor(N/11*2);case n.KANJI:return Math.floor(N/13);case n.BYTE:default:return Math.floor(N/8)}},t.getBestVersionForData=function(E,x){var I,C=i.from(x,i.M);if(o(E)){if(E.length>1)return b(E,C);if(E.length===0)return 1;I=E[0]}else I=E;return u(I.mode,I.getLength(),C)},t.getEncodedBits=function(E){if(!s.isValid(E)||E<7)throw new Error("Invalid QR Code version");for(var x=E<<12;e.getBCHDigit(x)-h>=0;)x^=c<<e.getBCHDigit(x)-h;return E<<12|x}})(Xc);var eh={},bs=yt,th=1335,Rf=21522,Oo=bs.getBCHDigit(th);eh.getEncodedBits=function(e,r){for(var i=e.bit<<3|r,n=i<<10;bs.getBCHDigit(n)-Oo>=0;)n^=th<<bs.getBCHDigit(n)-Oo;return(i<<10|n)^Rf};var rh={},Pf=dr;function Qr(t){this.mode=Pf.NUMERIC,this.data=t.toString()}Qr.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)};Qr.prototype.getLength=function(){return this.data.length};Qr.prototype.getBitsLength=function(){return Qr.getBitsLength(this.data.length)};Qr.prototype.write=function(e){var r,i,n;for(r=0;r+3<=this.data.length;r+=3)i=this.data.substr(r,3),n=parseInt(i,10),e.put(n,10);var s=this.data.length-r;s>0&&(i=this.data.substr(r),n=parseInt(i,10),e.put(n,s*3+1))};var Tf=Qr,Of=dr,$n=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function Gr(t){this.mode=Of.ALPHANUMERIC,this.data=t}Gr.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)};Gr.prototype.getLength=function(){return this.data.length};Gr.prototype.getBitsLength=function(){return Gr.getBitsLength(this.data.length)};Gr.prototype.write=function(e){var r;for(r=0;r+2<=this.data.length;r+=2){var i=$n.indexOf(this.data[r])*45;i+=$n.indexOf(this.data[r+1]),e.put(i,11)}this.data.length%2&&e.put($n.indexOf(this.data[r]),6)};var Bf=Gr,kf=fr,Ff=dr;function Yr(t){this.mode=Ff.BYTE,this.data=kf.from(t)}Yr.getBitsLength=function(e){return e*8};Yr.prototype.getLength=function(){return this.data.length};Yr.prototype.getBitsLength=function(){return Yr.getBitsLength(this.data.length)};Yr.prototype.write=function(t){for(var e=0,r=this.data.length;e<r;e++)t.put(this.data[e],8)};var Df=Yr,qf=dr,Lf=yt;function Xr(t){this.mode=qf.KANJI,this.data=t}Xr.getBitsLength=function(e){return e*13};Xr.prototype.getLength=function(){return this.data.length};Xr.prototype.getBitsLength=function(){return Xr.getBitsLength(this.data.length)};Xr.prototype.write=function(t){var e;for(e=0;e<this.data.length;e++){var r=Lf.toSJIS(this.data[e]);if(r>=33088&&r<=40956)r-=33088;else if(r>=57408&&r<=60351)r-=49472;else throw new Error("Invalid SJIS character: "+this.data[e]+`
|
|
3
3
|
Make sure your charset is UTF-8`);r=(r>>>8&255)*192+(r&255),t.put(r,13)}};var Uf=Xr;(function(t){var e=dr,r=Tf,i=Bf,n=Df,s=Uf,o=Ut,c=yt,h=iu.dijkstraExports;function u(C){return unescape(encodeURIComponent(C)).length}function d(C,R,T){for(var N=[],F;(F=C.exec(T))!==null;)N.push({data:F[0],index:F.index,mode:R,length:F[0].length});return N}function m(C){var R=d(o.NUMERIC,e.NUMERIC,C),T=d(o.ALPHANUMERIC,e.ALPHANUMERIC,C),N,F;c.isKanjiModeEnabled()?(N=d(o.BYTE,e.BYTE,C),F=d(o.KANJI,e.KANJI,C)):(N=d(o.BYTE_KANJI,e.BYTE,C),F=[]);var D=R.concat(T,N,F);return D.sort(function(U,j){return U.index-j.index}).map(function(U){return{data:U.data,mode:U.mode,length:U.length}})}function b(C,R){switch(R){case e.NUMERIC:return r.getBitsLength(C);case e.ALPHANUMERIC:return i.getBitsLength(C);case e.KANJI:return s.getBitsLength(C);case e.BYTE:return n.getBitsLength(C)}}function A(C){return C.reduce(function(R,T){var N=R.length-1>=0?R[R.length-1]:null;return N&&N.mode===T.mode?(R[R.length-1].data+=T.data,R):(R.push(T),R)},[])}function E(C){for(var R=[],T=0;T<C.length;T++){var N=C[T];switch(N.mode){case e.NUMERIC:R.push([N,{data:N.data,mode:e.ALPHANUMERIC,length:N.length},{data:N.data,mode:e.BYTE,length:N.length}]);break;case e.ALPHANUMERIC:R.push([N,{data:N.data,mode:e.BYTE,length:N.length}]);break;case e.KANJI:R.push([N,{data:N.data,mode:e.BYTE,length:u(N.data)}]);break;case e.BYTE:R.push([{data:N.data,mode:e.BYTE,length:u(N.data)}])}}return R}function x(C,R){for(var T={},N={start:{}},F=["start"],D=0;D<C.length;D++){for(var U=C[D],j=[],Z=0;Z<U.length;Z++){var oe=U[Z],ee=""+D+Z;j.push(ee),T[ee]={node:oe,lastCount:0},N[ee]={};for(var ae=0;ae<F.length;ae++){var a=F[ae];T[a]&&T[a].node.mode===oe.mode?(N[a][ee]=b(T[a].lastCount+oe.length,oe.mode)-b(T[a].lastCount,oe.mode),T[a].lastCount+=oe.length):(T[a]&&(T[a].lastCount=oe.length),N[a][ee]=b(oe.length,oe.mode)+4+e.getCharCountIndicator(oe.mode,R))}}F=j}for(ae=0;ae<F.length;ae++)N[F[ae]].end=0;return{map:N,table:T}}function I(C,R){var T,N=e.getBestModeForData(C);if(T=e.from(R,N),T!==e.BYTE&&T.bit<N.bit)throw new Error('"'+C+'" cannot be encoded with mode '+e.toString(T)+`.
|
|
4
4
|
Suggested mode is: `+e.toString(N));switch(T===e.KANJI&&!c.isKanjiModeEnabled()&&(T=e.BYTE),T){case e.NUMERIC:return new r(C);case e.ALPHANUMERIC:return new i(C);case e.KANJI:return new s(C);case e.BYTE:return new n(C)}}t.fromArray=function(R){return R.reduce(function(T,N){return typeof N=="string"?T.push(I(N,null)):N.data&&T.push(I(N.data,N.mode)),T},[])},t.fromString=function(R,T){for(var N=m(R,c.isKanjiModeEnabled()),F=E(N),D=x(F,T),U=h.find_path(D.map,"start","end"),j=[],Z=1;Z<U.length-1;Z++)j.push(D.table[U[Z]].node);return t.fromArray(A(j))},t.rawSplit=function(R){return t.fromArray(m(R,c.isKanjiModeEnabled()))}})(rh);var Bo=fr,bn=yt,zn=yn,$f=bf,zf=_f,jf=Hc,Kf=Wc,_s=Jc,As=vn,Vf=Sf,rn=Xc,Hf=eh,Wf=dr,jn=rh,Jf=zs;function Qf(t,e){for(var r=t.size,i=Kf.getPositions(e),n=0;n<i.length;n++)for(var s=i[n][0],o=i[n][1],c=-1;c<=7;c++)if(!(s+c<=-1||r<=s+c))for(var h=-1;h<=7;h++)o+h<=-1||r<=o+h||(c>=0&&c<=6&&(h===0||h===6)||h>=0&&h<=6&&(c===0||c===6)||c>=2&&c<=4&&h>=2&&h<=4?t.set(s+c,o+h,!0,!0):t.set(s+c,o+h,!1,!0))}function Gf(t){for(var e=t.size,r=8;r<e-8;r++){var i=r%2===0;t.set(r,6,i,!0),t.set(6,r,i,!0)}}function Yf(t,e){for(var r=jf.getPositions(e),i=0;i<r.length;i++)for(var n=r[i][0],s=r[i][1],o=-2;o<=2;o++)for(var c=-2;c<=2;c++)o===-2||o===2||c===-2||c===2||o===0&&c===0?t.set(n+o,s+c,!0,!0):t.set(n+o,s+c,!1,!0)}function Xf(t,e){for(var r=t.size,i=rn.getEncodedBits(e),n,s,o,c=0;c<18;c++)n=Math.floor(c/3),s=c%3+r-8-3,o=(i>>c&1)===1,t.set(n,s,o,!0),t.set(s,n,o,!0)}function Kn(t,e,r){var i=t.size,n=Hf.getEncodedBits(e,r),s,o;for(s=0;s<15;s++)o=(n>>s&1)===1,s<6?t.set(s,8,o,!0):s<8?t.set(s+1,8,o,!0):t.set(i-15+s,8,o,!0),s<8?t.set(8,i-s-1,o,!0):s<9?t.set(8,15-s-1+1,o,!0):t.set(8,15-s-1,o,!0);t.set(i-8,8,1,!0)}function Zf(t,e){for(var r=t.size,i=-1,n=r-1,s=7,o=0,c=r-1;c>0;c-=2)for(c===6&&c--;;){for(var h=0;h<2;h++)if(!t.isReserved(n,c-h)){var u=!1;o<e.length&&(u=(e[o]>>>s&1)===1),t.set(n,c-h,u),s--,s===-1&&(o++,s=7)}if(n+=i,n<0||r<=n){n-=i,i=-i;break}}}function ed(t,e,r){var i=new $f;r.forEach(function(u){i.put(u.mode.bit,4),i.put(u.getLength(),Wf.getCharCountIndicator(u.mode,t)),u.write(i)});var n=bn.getSymbolTotalCodewords(t),s=As.getTotalCodewordsCount(t,e),o=(n-s)*8;for(i.getLengthInBits()+4<=o&&i.put(0,4);i.getLengthInBits()%8!==0;)i.putBit(0);for(var c=(o-i.getLengthInBits())/8,h=0;h<c;h++)i.put(h%2?17:236,8);return td(i,t,e)}function td(t,e,r){for(var i=bn.getSymbolTotalCodewords(e),n=As.getTotalCodewordsCount(e,r),s=i-n,o=As.getBlocksCount(e,r),c=i%o,h=o-c,u=Math.floor(i/o),d=Math.floor(s/o),m=d+1,b=u-d,A=new Vf(b),E=0,x=new Array(o),I=new Array(o),C=0,R=Bo.from(t.buffer),T=0;T<o;T++){var N=T<h?d:m;x[T]=R.slice(E,E+N),I[T]=A.encode(x[T]),E+=N,C=Math.max(C,N)}var F=Bo.alloc(i),D=0,U,j;for(U=0;U<C;U++)for(j=0;j<o;j++)U<x[j].length&&(F[D++]=x[j][U]);for(U=0;U<b;U++)for(j=0;j<o;j++)F[D++]=I[j][U];return F}function rd(t,e,r,i){var n;if(Jf(t))n=jn.fromArray(t);else if(typeof t=="string"){var s=e;if(!s){var o=jn.rawSplit(t);s=rn.getBestVersionForData(o,r)}n=jn.fromString(t,s||40)}else throw new Error("Invalid data");var c=rn.getBestVersionForData(n,r);if(!c)throw new Error("The amount of data is too big to be stored in a QR Code");if(!e)e=c;else if(e<c)throw new Error(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var U=Object.defineProperty;var R=(T,n,e)=>n in T?U(T,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):T[n]=e;var A=(T,n,e)=>(R(T,typeof n!="symbol"?n+"":n,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./index-BTzpW2CH.js"),t=require("./index-B4AF-Mv-.js"),c=require("./algorand-BDEvXX59.js"),q=require("./chain-BNKwvp-5.js"),W=t.ABIMethod.fromSignature("portal_transfer(byte[])byte[]"),g=class g{constructor(n,e,r,s){A(this,"network");A(this,"chain");A(this,"connection");A(this,"contracts");A(this,"chainId");A(this,"coreBridge");A(this,"coreAppId");A(this,"coreAppAddress");A(this,"tokenBridgeAppId");A(this,"tokenBridgeAddress");if(this.network=n,this.chain=e,this.connection=r,this.contracts=s,this.chainId=t.toChainId(e),!s.coreBridge)throw new Error(`Core contract address for chain ${e} not found`);const i=BigInt(s.coreBridge);if(this.coreAppId=i,this.coreAppAddress=t.getApplicationAddress(i),this.coreBridge=new p.AlgorandWormholeCore(n,e,r,s),!s.tokenBridge)throw new Error(`TokenBridge contract address for chain ${e} not found`);const a=BigInt(s.tokenBridge);this.tokenBridgeAppId=a,this.tokenBridgeAddress=t.getApplicationAddress(a)}static async fromRpc(n,e){const[r,s]=await c.AlgorandPlatform.chainFromRpc(n),i=e[s];if(i.network!==r)throw new Error(`Network mismatch: ${i.network} != ${r}`);return new g(r,s,n,i.contracts)}async isWrappedAsset(n){const e=new c.AlgorandAddress(n).toInt();if(e===0)return!1;const r=await this.connection.getAssetByID(e).do(),i=t.Asset.from_obj_for_encoding(r).params.creator,a=await this.connection.accountInformation(i).exclude("all").do(),o=t.Account.from_obj_for_encoding(a);return(o==null?void 0:o.authAddr)===this.tokenBridgeAddress}async getOriginalAsset(n){const e=new c.AlgorandAddress(n).toInt(),r=await this.connection.getAssetByID(e).do(),s=t.Asset.from_obj_for_encoding(r),i=await p.StorageLogicSig.decodeLocalState(this.connection,this.tokenBridgeAppId,s.params.creator);if(i.length<94)throw new Error("Invalid local state data");const a=i.slice(92,94),o=t.toChain(t.bignum.decode(a)),l=new t.UniversalAddress(i.slice(60,92));return{chain:o,address:l}}async getWrappedAsset(n){const e=p.StorageLogicSig.forWrappedAsset(this.tokenBridgeAppId,n),r=await p.StorageLogicSig.decodeLocalState(this.connection,this.tokenBridgeAppId,e.address());if(r.length<8)throw new Error("Invalid wrapped asset data");return t.toNative(this.chain,t.bignum.decode(r.slice(0,8)).toString())}async hasWrappedAsset(n){try{return await this.getWrappedAsset(n),!0}catch{}return!1}async getWrappedNative(){return t.toNative(this.chain,"0")}async isTransferCompleted(n){const e=p.StorageLogicSig.forMessageId(this.tokenBridgeAppId,{sequence:n.sequence,chain:n.emitterChain,emitter:n.emitterAddress});try{return await p.StorageLogicSig.checkBitsSet(this.connection,this.tokenBridgeAppId,e.address(),n.sequence)}catch{}return!1}async*createAttestation(n,e){if(!e)throw new Error("Payer required to create attestation");const r=new c.AlgorandAddress(e).toString(),s=new c.AlgorandAddress(n).toInt(),i=[],a=await this.connection.getTransactionParams().do(),o=p.StorageLogicSig.forEmitter(this.coreAppId,new c.AlgorandAddress(this.tokenBridgeAddress).toUint8Array()),{accounts:[l],txs:x}=await p.AlgorandWormholeCore.maybeCreateStorageTx(this.connection,r,this.coreAppId,o,a);i.push(...x);let f="",d;if(s!==0){const I=await this.connection.getAssetByID(s).do(),S=t.Asset.from_obj_for_encoding(I),C=await this.connection.accountInformation(S.params.creator).do();if(d=t.Account.from_obj_for_encoding(C),d.authAddr===this.tokenBridgeAddress.toString())throw new Error("Cannot re-attest wormhole assets")}const w=p.StorageLogicSig.forNativeAsset(this.tokenBridgeAppId,BigInt(s)),k=await p.AlgorandWormholeCore.maybeCreateStorageTx(this.connection,r,this.tokenBridgeAppId,w);f=k.accounts[0],i.push(...k.txs);const u=t.makeApplicationCallTxnFromObject({from:r,appIndex:c.safeBigIntToNumber(this.tokenBridgeAppId),onComplete:t.OnApplicationComplete.NoOpOC,appArgs:[g.noop],suggestedParams:a});i.push({tx:u});const m=await this.coreBridge.getMessageFee();if(m>BigInt(0)){const I=t.makePaymentTxnWithSuggestedParamsFromObject({from:r,suggestedParams:a,to:this.tokenBridgeAddress,amount:m});i.push({tx:I})}let b=[l,f,this.coreAppAddress];d&&b.push(d.address);let h=t.makeApplicationCallTxnFromObject({appArgs:[g.attestToken,t.bignum.toBytes(s,8)],accounts:b,appIndex:c.safeBigIntToNumber(this.tokenBridgeAppId),foreignApps:[c.safeBigIntToNumber(this.coreAppId)],foreignAssets:[s],from:r,onComplete:t.OnApplicationComplete.NoOpOC,suggestedParams:a});m>BigInt(0)?h.fee*=3:h.fee*=2,i.push({tx:h});for(const I of i)yield this.createUnsignedTx(I,"TokenBridge.createAttestation",!0)}async*submitAttestation(n,e,r){if(!e)throw new Error("Sender required to submit attestation");r||(r=await this.connection.getTransactionParams().do());const s=e.toString(),a=p.StorageLogicSig.forWrappedAsset(this.tokenBridgeAppId,n.payload.token).address(),o=[],l=[],x=await p.StorageLogicSig.decodeLocalState(this.connection,this.tokenBridgeAppId,a);x.length>8&&l.push(new c.AlgorandAddress(x.slice(0,8)).toInt()),o.push({tx:t.makePaymentTxnWithSuggestedParamsFromObject({from:s,to:a,amount:1e5,suggestedParams:r})});let f=new Uint8Array(1);f[0]=1,o.push({tx:t.makeApplicationCallTxnFromObject({appArgs:[g.noop,f],appIndex:c.safeBigIntToNumber(this.tokenBridgeAppId),from:s,onComplete:t.OnApplicationComplete.NoOpOC,suggestedParams:r})}),f=new Uint8Array(1),f[0]=2,o.push({tx:t.makeApplicationCallTxnFromObject({appArgs:[g.noop,f],appIndex:c.safeBigIntToNumber(this.tokenBridgeAppId),from:s,onComplete:t.OnApplicationComplete.NoOpOC,suggestedParams:r})}),o.push({tx:t.makeApplicationCallTxnFromObject({accounts:[],appArgs:[g.receiveAttest,t.serialize(n)],appIndex:c.safeBigIntToNumber(this.tokenBridgeAppId),foreignAssets:l,from:s,onComplete:t.OnApplicationComplete.NoOpOC,suggestedParams:r})}),o[o.length-1].tx.fee=o[o.length-1].tx.fee*2;for(const d of o)yield this.createUnsignedTx(d,"TokenBridge.submitAttestation",!0)}async*transfer(n,e,r,s,i){const a=n.toString(),o=t.isNative(r)?0:new c.AlgorandAddress(r).toInt(),l=s,x=t.toChainId(e.chain),f=e.address.toUniversalAddress().toUint8Array(),d=await this.connection.getTransactionParams().do(),w=BigInt(0),k=p.StorageLogicSig.fromData({appId:this.coreAppId,appAddress:t.decodeAddress(this.coreAppAddress).publicKey,idx:BigInt(0),address:t.decodeAddress(this.tokenBridgeAddress).publicKey}),u=[],{accounts:[m],txs:b}=await p.AlgorandWormholeCore.maybeCreateStorageTx(this.connection,a,this.coreAppId,k,d);u.push(...b);let h="",I,S=!1;if(o!==0){const B=await this.connection.getAssetByID(o).do();h=t.Asset.from_obj_for_encoding(B).params.creator;const O=await this.connection.accountInformation(h).do();I=t.Account.from_obj_for_encoding(O),S=I.authAddr===this.tokenBridgeAddress.toString()}const C=await this.coreBridge.getMessageFee();if(C>0&&u.push({tx:t.makePaymentTxnWithSuggestedParamsFromObject({from:a,to:this.tokenBridgeAddress,amount:C,suggestedParams:d})}),!S){const B=p.StorageLogicSig.forNativeAsset(this.tokenBridgeAppId,BigInt(o)),{accounts:[y],txs:O}=await p.AlgorandWormholeCore.maybeCreateStorageTx(this.connection,a,this.tokenBridgeAppId,B,d);h=y,O.push(...O)}if(o!==0&&!await g.isOptedInToAsset(this.connection,h,o)){const B=t.makePaymentTxnWithSuggestedParamsFromObject({from:a,to:h,amount:1e5,suggestedParams:d});let y=t.makeApplicationCallTxnFromObject({from:a,appIndex:c.safeBigIntToNumber(this.tokenBridgeAppId),onComplete:t.OnApplicationComplete.NoOpOC,appArgs:[g.optIn,t.bigIntToBytes(o,8)],foreignAssets:[o],accounts:[h],suggestedParams:d});y.fee*=2,u.unshift({tx:B},{tx:y})}const P=t.makeApplicationCallTxnFromObject({from:a,appIndex:c.safeBigIntToNumber(this.tokenBridgeAppId),onComplete:t.OnApplicationComplete.NoOpOC,appArgs:[g.noop],suggestedParams:d});u.push({tx:P});let j=[];if(o===0){const B=t.makePaymentTxnWithSuggestedParamsFromObject({from:a,to:h,amount:l,suggestedParams:d});u.push({tx:B}),j=[m,h,h]}else{const B=t.makeAssetTransferTxnWithSuggestedParamsFromObject({from:a,to:h,amount:l,assetIndex:o,suggestedParams:d});u.push({tx:B}),j=I!=null&&I.address?[m,h,I.address]:[m,h]}const F=[g.sendTransfer,t.bignum.toBytes(o,8),t.bignum.toBytes(l,8),f,t.bignum.toBytes(x,8),t.bignum.toBytes(w,8)];i&&F.push(i);const L=t.makeApplicationCallTxnFromObject({from:a,appIndex:c.safeBigIntToNumber(this.tokenBridgeAppId),onComplete:t.OnApplicationComplete.NoOpOC,appArgs:F,foreignApps:[c.safeBigIntToNumber(this.coreAppId)],foreignAssets:[o],accounts:j,suggestedParams:d});L.fee*=2,u.push({tx:L});for(const B of u)yield this.createUnsignedTx(B,"TokenBridge.transfer",!0)}async*redeem(n,e,r=!0,s){s||(s=await this.connection.getTransactionParams().do());const i=new c.AlgorandAddress(n).toString(),{accounts:a,txs:o}=await p.AlgorandWormholeCore.submitVAAHeader(this.connection,this.coreAppId,this.tokenBridgeAppId,e,i);let l,x="",f=[],d=0;if(e.payload.token.chain!==this.chain){l=p.StorageLogicSig.forWrappedAsset(this.tokenBridgeAppId,e.payload.token),x=l.address();const m=await p.StorageLogicSig.decodeLocalState(this.connection,this.tokenBridgeAppId,x);d=new c.AlgorandAddress(m.slice(0,8)).toInt()}else{const m=new c.AlgorandAddress(e.payload.token.address).toBigInt();l=p.StorageLogicSig.forNativeAsset(this.tokenBridgeAppId,m),x=l.address(),d=c.safeBigIntToNumber(m)}a.push(x);let w=0,k="";if(e.payloadName==="TransferWithPayload"?(w=new c.AlgorandAddress(e.payload.to.address).toInt(),k=t.getApplicationAddress(w)):k=new c.AlgorandAddress(e.payload.to.address.toUint8Array()).toString(),a.push(k),d!==0&&(f.push(d),!await g.isOptedInToAsset(this.connection,k,d))){if(i!=k)throw new Error("Cannot ASA optin for somebody else (asset "+d.toString()+")");o.unshift({tx:t.makeAssetTransferTxnWithSuggestedParamsFromObject({amount:0,assetIndex:d,from:i,suggestedParams:s,to:i})})}const u={accounts:a,appArgs:[g.completeTransfer,t.serialize(e)],appIndex:c.safeBigIntToNumber(this.tokenBridgeAppId),foreignAssets:f,from:i,onComplete:t.OnApplicationComplete.NoOpOC,suggestedParams:s};o.push({tx:t.makeApplicationCallTxnFromObject(u)}),o[o.length-1].tx.fee=o[o.length-1].tx.fee*(e.payloadName==="Transfer"&&e.payload.fee!==void 0&&e.payload.fee===0n?2:3),e.payloadName==="TransferWithPayload"&&(o[o.length-1].tx.appForeignApps=[w],o.push({tx:t.makeApplicationCallTxnFromObject({appArgs:[W.getSelector(),W.args[0].type.encode(t.serialize(e))],appIndex:w,foreignAssets:f,from:i,onComplete:t.OnApplicationComplete.NoOpOC,suggestedParams:s})}));for(const m of o)yield this.createUnsignedTx(m,"TokenBridge.redeem",!0)}static async isOptedInToAsset(n,e,r){var s;try{const i=await n.accountAssetInformation(e,r).do();return(((s=t.AccountAssetResponse.from_obj_for_encoding(i).assetHolding)==null?void 0:s.amount)??0)>0}catch{}return!1}createUnsignedTx(n,e,r=!0){return new p.AlgorandUnsignedTransaction(n,this.network,this.chain,e,r)}};A(g,"sendTransfer",t.bytes.encode("sendTransfer")),A(g,"attestToken",t.bytes.encode("attestToken")),A(g,"noop",t.bytes.encode("nop")),A(g,"optIn",t.bytes.encode("optin")),A(g,"completeTransfer",t.bytes.encode("completeTransfer")),A(g,"receiveAttest",t.bytes.encode("receiveAttest"));let N=g;q.registerProtocol(c._platform,"TokenBridge",N);exports.AlgorandTokenBridge=N;exports.TransferMethodSelector=W;
|
|
1
|
+
"use strict";var U=Object.defineProperty;var R=(T,n,e)=>n in T?U(T,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):T[n]=e;var A=(T,n,e)=>(R(T,typeof n!="symbol"?n+"":n,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./index-BRws2oLK.js"),t=require("./index-s2bgjlxF.js"),c=require("./algorand--fALMVQ6.js"),q=require("./chain-Bq0KV5Nv.js"),W=t.ABIMethod.fromSignature("portal_transfer(byte[])byte[]"),g=class g{constructor(n,e,r,s){A(this,"network");A(this,"chain");A(this,"connection");A(this,"contracts");A(this,"chainId");A(this,"coreBridge");A(this,"coreAppId");A(this,"coreAppAddress");A(this,"tokenBridgeAppId");A(this,"tokenBridgeAddress");if(this.network=n,this.chain=e,this.connection=r,this.contracts=s,this.chainId=t.toChainId(e),!s.coreBridge)throw new Error(`Core contract address for chain ${e} not found`);const i=BigInt(s.coreBridge);if(this.coreAppId=i,this.coreAppAddress=t.getApplicationAddress(i),this.coreBridge=new p.AlgorandWormholeCore(n,e,r,s),!s.tokenBridge)throw new Error(`TokenBridge contract address for chain ${e} not found`);const a=BigInt(s.tokenBridge);this.tokenBridgeAppId=a,this.tokenBridgeAddress=t.getApplicationAddress(a)}static async fromRpc(n,e){const[r,s]=await c.AlgorandPlatform.chainFromRpc(n),i=e[s];if(i.network!==r)throw new Error(`Network mismatch: ${i.network} != ${r}`);return new g(r,s,n,i.contracts)}async isWrappedAsset(n){const e=new c.AlgorandAddress(n).toInt();if(e===0)return!1;const r=await this.connection.getAssetByID(e).do(),i=t.Asset.from_obj_for_encoding(r).params.creator,a=await this.connection.accountInformation(i).exclude("all").do(),o=t.Account.from_obj_for_encoding(a);return(o==null?void 0:o.authAddr)===this.tokenBridgeAddress}async getOriginalAsset(n){const e=new c.AlgorandAddress(n).toInt(),r=await this.connection.getAssetByID(e).do(),s=t.Asset.from_obj_for_encoding(r),i=await p.StorageLogicSig.decodeLocalState(this.connection,this.tokenBridgeAppId,s.params.creator);if(i.length<94)throw new Error("Invalid local state data");const a=i.slice(92,94),o=t.toChain(t.bignum.decode(a)),l=new t.UniversalAddress(i.slice(60,92));return{chain:o,address:l}}async getWrappedAsset(n){const e=p.StorageLogicSig.forWrappedAsset(this.tokenBridgeAppId,n),r=await p.StorageLogicSig.decodeLocalState(this.connection,this.tokenBridgeAppId,e.address());if(r.length<8)throw new Error("Invalid wrapped asset data");return t.toNative(this.chain,t.bignum.decode(r.slice(0,8)).toString())}async hasWrappedAsset(n){try{return await this.getWrappedAsset(n),!0}catch{}return!1}async getWrappedNative(){return t.toNative(this.chain,"0")}async isTransferCompleted(n){const e=p.StorageLogicSig.forMessageId(this.tokenBridgeAppId,{sequence:n.sequence,chain:n.emitterChain,emitter:n.emitterAddress});try{return await p.StorageLogicSig.checkBitsSet(this.connection,this.tokenBridgeAppId,e.address(),n.sequence)}catch{}return!1}async*createAttestation(n,e){if(!e)throw new Error("Payer required to create attestation");const r=new c.AlgorandAddress(e).toString(),s=new c.AlgorandAddress(n).toInt(),i=[],a=await this.connection.getTransactionParams().do(),o=p.StorageLogicSig.forEmitter(this.coreAppId,new c.AlgorandAddress(this.tokenBridgeAddress).toUint8Array()),{accounts:[l],txs:x}=await p.AlgorandWormholeCore.maybeCreateStorageTx(this.connection,r,this.coreAppId,o,a);i.push(...x);let f="",d;if(s!==0){const I=await this.connection.getAssetByID(s).do(),S=t.Asset.from_obj_for_encoding(I),C=await this.connection.accountInformation(S.params.creator).do();if(d=t.Account.from_obj_for_encoding(C),d.authAddr===this.tokenBridgeAddress.toString())throw new Error("Cannot re-attest wormhole assets")}const w=p.StorageLogicSig.forNativeAsset(this.tokenBridgeAppId,BigInt(s)),k=await p.AlgorandWormholeCore.maybeCreateStorageTx(this.connection,r,this.tokenBridgeAppId,w);f=k.accounts[0],i.push(...k.txs);const u=t.makeApplicationCallTxnFromObject({from:r,appIndex:c.safeBigIntToNumber(this.tokenBridgeAppId),onComplete:t.OnApplicationComplete.NoOpOC,appArgs:[g.noop],suggestedParams:a});i.push({tx:u});const m=await this.coreBridge.getMessageFee();if(m>BigInt(0)){const I=t.makePaymentTxnWithSuggestedParamsFromObject({from:r,suggestedParams:a,to:this.tokenBridgeAddress,amount:m});i.push({tx:I})}let b=[l,f,this.coreAppAddress];d&&b.push(d.address);let h=t.makeApplicationCallTxnFromObject({appArgs:[g.attestToken,t.bignum.toBytes(s,8)],accounts:b,appIndex:c.safeBigIntToNumber(this.tokenBridgeAppId),foreignApps:[c.safeBigIntToNumber(this.coreAppId)],foreignAssets:[s],from:r,onComplete:t.OnApplicationComplete.NoOpOC,suggestedParams:a});m>BigInt(0)?h.fee*=3:h.fee*=2,i.push({tx:h});for(const I of i)yield this.createUnsignedTx(I,"TokenBridge.createAttestation",!0)}async*submitAttestation(n,e,r){if(!e)throw new Error("Sender required to submit attestation");r||(r=await this.connection.getTransactionParams().do());const s=e.toString(),a=p.StorageLogicSig.forWrappedAsset(this.tokenBridgeAppId,n.payload.token).address(),o=[],l=[],x=await p.StorageLogicSig.decodeLocalState(this.connection,this.tokenBridgeAppId,a);x.length>8&&l.push(new c.AlgorandAddress(x.slice(0,8)).toInt()),o.push({tx:t.makePaymentTxnWithSuggestedParamsFromObject({from:s,to:a,amount:1e5,suggestedParams:r})});let f=new Uint8Array(1);f[0]=1,o.push({tx:t.makeApplicationCallTxnFromObject({appArgs:[g.noop,f],appIndex:c.safeBigIntToNumber(this.tokenBridgeAppId),from:s,onComplete:t.OnApplicationComplete.NoOpOC,suggestedParams:r})}),f=new Uint8Array(1),f[0]=2,o.push({tx:t.makeApplicationCallTxnFromObject({appArgs:[g.noop,f],appIndex:c.safeBigIntToNumber(this.tokenBridgeAppId),from:s,onComplete:t.OnApplicationComplete.NoOpOC,suggestedParams:r})}),o.push({tx:t.makeApplicationCallTxnFromObject({accounts:[],appArgs:[g.receiveAttest,t.serialize(n)],appIndex:c.safeBigIntToNumber(this.tokenBridgeAppId),foreignAssets:l,from:s,onComplete:t.OnApplicationComplete.NoOpOC,suggestedParams:r})}),o[o.length-1].tx.fee=o[o.length-1].tx.fee*2;for(const d of o)yield this.createUnsignedTx(d,"TokenBridge.submitAttestation",!0)}async*transfer(n,e,r,s,i){const a=n.toString(),o=t.isNative(r)?0:new c.AlgorandAddress(r).toInt(),l=s,x=t.toChainId(e.chain),f=e.address.toUniversalAddress().toUint8Array(),d=await this.connection.getTransactionParams().do(),w=BigInt(0),k=p.StorageLogicSig.fromData({appId:this.coreAppId,appAddress:t.decodeAddress(this.coreAppAddress).publicKey,idx:BigInt(0),address:t.decodeAddress(this.tokenBridgeAddress).publicKey}),u=[],{accounts:[m],txs:b}=await p.AlgorandWormholeCore.maybeCreateStorageTx(this.connection,a,this.coreAppId,k,d);u.push(...b);let h="",I,S=!1;if(o!==0){const B=await this.connection.getAssetByID(o).do();h=t.Asset.from_obj_for_encoding(B).params.creator;const O=await this.connection.accountInformation(h).do();I=t.Account.from_obj_for_encoding(O),S=I.authAddr===this.tokenBridgeAddress.toString()}const C=await this.coreBridge.getMessageFee();if(C>0&&u.push({tx:t.makePaymentTxnWithSuggestedParamsFromObject({from:a,to:this.tokenBridgeAddress,amount:C,suggestedParams:d})}),!S){const B=p.StorageLogicSig.forNativeAsset(this.tokenBridgeAppId,BigInt(o)),{accounts:[y],txs:O}=await p.AlgorandWormholeCore.maybeCreateStorageTx(this.connection,a,this.tokenBridgeAppId,B,d);h=y,O.push(...O)}if(o!==0&&!await g.isOptedInToAsset(this.connection,h,o)){const B=t.makePaymentTxnWithSuggestedParamsFromObject({from:a,to:h,amount:1e5,suggestedParams:d});let y=t.makeApplicationCallTxnFromObject({from:a,appIndex:c.safeBigIntToNumber(this.tokenBridgeAppId),onComplete:t.OnApplicationComplete.NoOpOC,appArgs:[g.optIn,t.bigIntToBytes(o,8)],foreignAssets:[o],accounts:[h],suggestedParams:d});y.fee*=2,u.unshift({tx:B},{tx:y})}const P=t.makeApplicationCallTxnFromObject({from:a,appIndex:c.safeBigIntToNumber(this.tokenBridgeAppId),onComplete:t.OnApplicationComplete.NoOpOC,appArgs:[g.noop],suggestedParams:d});u.push({tx:P});let j=[];if(o===0){const B=t.makePaymentTxnWithSuggestedParamsFromObject({from:a,to:h,amount:l,suggestedParams:d});u.push({tx:B}),j=[m,h,h]}else{const B=t.makeAssetTransferTxnWithSuggestedParamsFromObject({from:a,to:h,amount:l,assetIndex:o,suggestedParams:d});u.push({tx:B}),j=I!=null&&I.address?[m,h,I.address]:[m,h]}const F=[g.sendTransfer,t.bignum.toBytes(o,8),t.bignum.toBytes(l,8),f,t.bignum.toBytes(x,8),t.bignum.toBytes(w,8)];i&&F.push(i);const L=t.makeApplicationCallTxnFromObject({from:a,appIndex:c.safeBigIntToNumber(this.tokenBridgeAppId),onComplete:t.OnApplicationComplete.NoOpOC,appArgs:F,foreignApps:[c.safeBigIntToNumber(this.coreAppId)],foreignAssets:[o],accounts:j,suggestedParams:d});L.fee*=2,u.push({tx:L});for(const B of u)yield this.createUnsignedTx(B,"TokenBridge.transfer",!0)}async*redeem(n,e,r=!0,s){s||(s=await this.connection.getTransactionParams().do());const i=new c.AlgorandAddress(n).toString(),{accounts:a,txs:o}=await p.AlgorandWormholeCore.submitVAAHeader(this.connection,this.coreAppId,this.tokenBridgeAppId,e,i);let l,x="",f=[],d=0;if(e.payload.token.chain!==this.chain){l=p.StorageLogicSig.forWrappedAsset(this.tokenBridgeAppId,e.payload.token),x=l.address();const m=await p.StorageLogicSig.decodeLocalState(this.connection,this.tokenBridgeAppId,x);d=new c.AlgorandAddress(m.slice(0,8)).toInt()}else{const m=new c.AlgorandAddress(e.payload.token.address).toBigInt();l=p.StorageLogicSig.forNativeAsset(this.tokenBridgeAppId,m),x=l.address(),d=c.safeBigIntToNumber(m)}a.push(x);let w=0,k="";if(e.payloadName==="TransferWithPayload"?(w=new c.AlgorandAddress(e.payload.to.address).toInt(),k=t.getApplicationAddress(w)):k=new c.AlgorandAddress(e.payload.to.address.toUint8Array()).toString(),a.push(k),d!==0&&(f.push(d),!await g.isOptedInToAsset(this.connection,k,d))){if(i!=k)throw new Error("Cannot ASA optin for somebody else (asset "+d.toString()+")");o.unshift({tx:t.makeAssetTransferTxnWithSuggestedParamsFromObject({amount:0,assetIndex:d,from:i,suggestedParams:s,to:i})})}const u={accounts:a,appArgs:[g.completeTransfer,t.serialize(e)],appIndex:c.safeBigIntToNumber(this.tokenBridgeAppId),foreignAssets:f,from:i,onComplete:t.OnApplicationComplete.NoOpOC,suggestedParams:s};o.push({tx:t.makeApplicationCallTxnFromObject(u)}),o[o.length-1].tx.fee=o[o.length-1].tx.fee*(e.payloadName==="Transfer"&&e.payload.fee!==void 0&&e.payload.fee===0n?2:3),e.payloadName==="TransferWithPayload"&&(o[o.length-1].tx.appForeignApps=[w],o.push({tx:t.makeApplicationCallTxnFromObject({appArgs:[W.getSelector(),W.args[0].type.encode(t.serialize(e))],appIndex:w,foreignAssets:f,from:i,onComplete:t.OnApplicationComplete.NoOpOC,suggestedParams:s})}));for(const m of o)yield this.createUnsignedTx(m,"TokenBridge.redeem",!0)}static async isOptedInToAsset(n,e,r){var s;try{const i=await n.accountAssetInformation(e,r).do();return(((s=t.AccountAssetResponse.from_obj_for_encoding(i).assetHolding)==null?void 0:s.amount)??0)>0}catch{}return!1}createUnsignedTx(n,e,r=!0){return new p.AlgorandUnsignedTransaction(n,this.network,this.chain,e,r)}};A(g,"sendTransfer",t.bytes.encode("sendTransfer")),A(g,"attestToken",t.bytes.encode("attestToken")),A(g,"noop",t.bytes.encode("nop")),A(g,"optIn",t.bytes.encode("optin")),A(g,"completeTransfer",t.bytes.encode("completeTransfer")),A(g,"receiveAttest",t.bytes.encode("receiveAttest"));let N=g;q.registerProtocol(c._platform,"TokenBridge",N);exports.AlgorandTokenBridge=N;exports.TransferMethodSelector=W;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const fe = Symbol(), ee = Object.getPrototypeOf, G = /* @__PURE__ */ new WeakMap(), me = (e) => e && (G.has(e) ? G.get(e) : ee(e) === Object.prototype || ee(e) === Array.prototype), ge = (e) => me(e) && e[fe] || null, te = (e, t = !0) => {
|
|
2
2
|
G.set(e, t);
|
|
3
3
|
};
|
|
4
|
-
var z = { BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0, SSR: !1, REACT_APP_CONNECT_VERSION: "0.3.18-beta.
|
|
4
|
+
var z = { BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0, SSR: !1, REACT_APP_CONNECT_VERSION: "0.3.18-beta.3-development" };
|
|
5
5
|
const q = (e) => typeof e == "object" && e !== null, A = /* @__PURE__ */ new WeakMap(), x = /* @__PURE__ */ new WeakSet(), he = (e = Object.is, t = (n, h) => new Proxy(n, h), s = (n) => q(n) && !x.has(n) && (Array.isArray(n) || !(Symbol.iterator in n)) && !(n instanceof WeakMap) && !(n instanceof WeakSet) && !(n instanceof Error) && !(n instanceof Number) && !(n instanceof Date) && !(n instanceof String) && !(n instanceof RegExp) && !(n instanceof ArrayBuffer), r = (n) => {
|
|
6
6
|
switch (n.status) {
|
|
7
7
|
case "fulfilled":
|
|
@@ -392,7 +392,7 @@ class ke {
|
|
|
392
392
|
}
|
|
393
393
|
async initUi() {
|
|
394
394
|
if (typeof window < "u") {
|
|
395
|
-
await import("./index-
|
|
395
|
+
await import("./index-E1ooefEo.mjs");
|
|
396
396
|
const t = document.createElement("wcm-modal");
|
|
397
397
|
document.body.insertAdjacentElement("beforeend", t), w.setIsUiLoaded(!0);
|
|
398
398
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
var m = Object.defineProperty;
|
|
2
2
|
var w = (c, e, r) => e in c ? m(c, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : c[e] = r;
|
|
3
3
|
var a = (c, e, r) => (w(c, typeof e != "symbol" ? e + "" : e, r), r);
|
|
4
|
-
import { C as p, _ as u } from "./cosmwasm-
|
|
5
|
-
import { c as g } from "./create-
|
|
6
|
-
import { au as l, at as h } from "./index-
|
|
7
|
-
import { r as f } from "./chain-
|
|
4
|
+
import { C as p, _ as u } from "./cosmwasm-ByfSCJro.mjs";
|
|
5
|
+
import { c as g } from "./create-DppBfW47.mjs";
|
|
6
|
+
import { au as l, at as h } from "./index-BMEA_Z4x.mjs";
|
|
7
|
+
import { r as f } from "./chain-WayEKuld.mjs";
|
|
8
8
|
class i {
|
|
9
9
|
constructor(e, r, s, t) {
|
|
10
10
|
a(this, "network");
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
var T = Object.defineProperty;
|
|
2
2
|
var B = (i, e, t) => e in i ? T(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
|
|
3
3
|
var a = (i, e, t) => (B(i, typeof e != "symbol" ? e + "" : e, t), t);
|
|
4
|
-
import { cf as g, ck as b, b5 as I, cl as x, bp as A, c5 as v, c6 as S, au as U, bO as f, d as $, c7 as F, b_ as d, az as m, at as c, cm as E } from "./index-
|
|
5
|
-
import { a as h, A as C, c as O, b as k, d as w, i as W } from "./aptos-
|
|
6
|
-
import { r as R } from "./chain-
|
|
4
|
+
import { cf as g, ck as b, b5 as I, cl as x, bp as A, c5 as v, c6 as S, au as U, bO as f, d as $, c7 as F, b_ as d, az as m, at as c, cm as E } from "./index-BMEA_Z4x.mjs";
|
|
5
|
+
import { a as h, A as C, c as O, b as k, d as w, i as W } from "./aptos-D3gQDkVy.mjs";
|
|
6
|
+
import { r as R } from "./chain-WayEKuld.mjs";
|
|
7
7
|
class N {
|
|
8
8
|
constructor(e, t, s, n, r = !1) {
|
|
9
9
|
a(this, "transaction");
|
|
@@ -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-BMEA_Z4x.mjs";
|
|
5
|
+
import { t as Bt, c as Wr, m as Ou } from "./ens-validation.es6-CJs8RCzz.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-ByfSCJro.mjs";
|
|
7
|
+
import { CosmwasmWormholeCore as pd } from "./index-DQ2pTa4G.mjs";
|
|
8
|
+
import { c as gd, C as yd } from "./unsignedTransaction-N51EO9OV.mjs";
|
|
9
|
+
import { r as bd } from "./chain-WayEKuld.mjs";
|
|
10
10
|
function vd(e) {
|
|
11
11
|
return e.id !== void 0 && e.pending !== void 0 && e.data !== void 0;
|
|
12
12
|
}
|
|
@@ -17,10 +17,10 @@ var f1 = (a, e, t, n) => ({
|
|
|
17
17
|
return u(a, e, n);
|
|
18
18
|
}
|
|
19
19
|
}), N = (a, e, t) => (F6(a, e, "access private method"), t);
|
|
20
|
-
import { a as D1 } from "./index-
|
|
21
|
-
import { by as V1, c5 as b1, bp as Z0, c6 as Fe, au as Le, az as E6, c7 as $e, b_ as m6, bO as W1 } from "./index-
|
|
22
|
-
import { E as L0, d as De, a as Q, u as c1, e as c6, b as s0, c as H1, _ as G1 } from "./evm-
|
|
23
|
-
import { r as z1 } from "./chain-
|
|
20
|
+
import { a as D1 } from "./index-BO4gCfyo.mjs";
|
|
21
|
+
import { by as V1, c5 as b1, bp as Z0, c6 as Fe, au as Le, az as E6, c7 as $e, b_ as m6, bO as W1 } from "./index-BMEA_Z4x.mjs";
|
|
22
|
+
import { E as L0, d as De, a as Q, u as c1, e as c6, b as s0, c as H1, _ as G1 } from "./evm-BHI64qKH.mjs";
|
|
23
|
+
import { r as z1 } from "./chain-WayEKuld.mjs";
|
|
24
24
|
class Z6 {
|
|
25
25
|
constructor(e, t, n, r) {
|
|
26
26
|
o(this, "network");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as _t, s as ce, T as N, o as ot, R as Uo, a as C, t as H, p as K, y as gt } from "./index-
|
|
1
|
+
import { n as _t, s as ce, T as N, o as ot, R as Uo, a as C, t as H, p as K, y as gt } from "./index-DNGg8WTv.mjs";
|
|
2
2
|
import { d as Wo } from "./dijkstra-BZM-8g-B.mjs";
|
|
3
|
-
import { d as Ho } from "./index-
|
|
3
|
+
import { d as Ho } from "./index-BMEA_Z4x.mjs";
|
|
4
4
|
var jo = function(t) {
|
|
5
5
|
for (var r = [], n = t.length, o = 0; o < n; o++) {
|
|
6
6
|
var i = t.charCodeAt(o);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
var V = Object.defineProperty;
|
|
2
2
|
var Q = (O, s, t) => s in O ? V(O, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : O[s] = t;
|
|
3
3
|
var d = (O, s, t) => (Q(O, typeof s != "symbol" ? s + "" : s, t), t);
|
|
4
|
-
import { A as S, S as g, a as X } from "./index
|
|
5
|
-
import { cG as Y, b5 as C, bp as $, cv as q, cH as _, cy as D, c6 as Z, aC as b, au as tt, bO as z, cz as y, cA as k, cD as W, b_ as L, az as et, bG as H, cI as st, cJ as K, cK as ot } from "./index-
|
|
6
|
-
import { a as nt, A as l, s as u, _ as rt } from "./algorand-
|
|
7
|
-
import { r as at } from "./chain-
|
|
4
|
+
import { A as S, S as g, a as X } from "./index-BPttYMSW.mjs";
|
|
5
|
+
import { cG as Y, b5 as C, bp as $, cv as q, cH as _, cy as D, c6 as Z, aC as b, au as tt, bO as z, cz as y, cA as k, cD as W, b_ as L, az as et, bG as H, cI as st, cJ as K, cK as ot } from "./index-BMEA_Z4x.mjs";
|
|
6
|
+
import { a as nt, A as l, s as u, _ as rt } from "./algorand-BscStaE0.mjs";
|
|
7
|
+
import { r as at } from "./chain-WayEKuld.mjs";
|
|
8
8
|
const G = Y.fromSignature("portal_transfer(byte[])byte[]"), c = class c {
|
|
9
9
|
constructor(s, t, n, o) {
|
|
10
10
|
d(this, "network");
|