@wormhole-foundation/wormhole-connect 3.0.0-beta.7-development → 3.0.0-beta.9-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.
Files changed (153) hide show
  1. package/dist/main.js +48 -48
  2. package/dist/src/config/tokens.d.ts +0 -1
  3. package/dist/src/config/tokens.d.ts.map +1 -1
  4. package/dist/src/contexts/TokensContext.d.ts.map +1 -1
  5. package/dist/src/utils/errors.d.ts +1 -0
  6. package/dist/src/utils/errors.d.ts.map +1 -1
  7. package/dist/src/views/v2/Bridge/WalletConnector/Sidebar.d.ts.map +1 -1
  8. package/dist/src/views/v2/Redeem/TransactionDetails/index.d.ts.map +1 -1
  9. package/lib/{account-QG_Hi4er.js → account-BSFuCEgk.js} +1 -1
  10. package/lib/{account-BK8xMTUI.mjs → account-y1ICRMSr.mjs} +1 -1
  11. package/lib/{address-B-_yHNB2.js → address-BwcXVurJ.js} +1 -1
  12. package/lib/{address-CNhzoegm.js → address-D8qNQEOW.js} +1 -1
  13. package/lib/{address-BWXkejmE.mjs → address-DaoiwqzU.mjs} +1 -1
  14. package/lib/{address-RcMobNYE.js → address-DnSRsubO.js} +7 -7
  15. package/lib/{address-CBux52Na.mjs → address-DqsMcbcT.mjs} +612 -588
  16. package/lib/{address-DKHa7TFU.mjs → address-S7wMItHX.mjs} +1 -1
  17. package/lib/{aptos-9aq-5gkF.mjs → aptos-CSVdIYqJ.mjs} +3 -3
  18. package/lib/{aptos-XxKO9242.js → aptos-C_j04MF5.js} +1 -1
  19. package/lib/{aptos-C180o9od.mjs → aptos-C_sLjrbm.mjs} +15 -15
  20. package/lib/{aptos-BZ2mcuTd.js → aptos-ma6bumqy.js} +2 -2
  21. package/lib/{base64-Dmj19Uvu.mjs → base64-B2xumR3a.mjs} +3 -2
  22. package/lib/{base64-BfY07bq5.js → base64-a1Dr6hMt.js} +1 -1
  23. package/lib/{blake2b-CgbIfNRX.mjs → blake2b-CR50AGep.mjs} +1 -1
  24. package/lib/{blake2b-CoM94_cH.js → blake2b-Dkm1d7Wp.js} +1 -1
  25. package/lib/{browser-ponyfill-BAEAyXvw.js → browser-ponyfill-BTt_ELXG.js} +1 -1
  26. package/lib/{browser-ponyfill-BecG2Lnb.mjs → browser-ponyfill-uCX78ltK.mjs} +1 -1
  27. package/lib/{ccip-CUqskd5M.mjs → ccip-69mFHkV9.mjs} +1 -1
  28. package/lib/{ccip-oytFtCzk.js → ccip-BFyWlloE.js} +1 -1
  29. package/lib/{chain-itK5uGYL.js → chain-Cio41-Lr.js} +1 -1
  30. package/lib/{chain-sKZNJgPZ.mjs → chain-DbmG-oEQ.mjs} +1 -1
  31. package/lib/{chunk-IMTC3J2M-DKLPKqnP.mjs → chunk-IMTC3J2M-CmFt3nz5.mjs} +137 -135
  32. package/lib/chunk-IMTC3J2M-NMBEZ4p8.js +471 -0
  33. package/lib/{constants-DrDsewBe.mjs → constants-JcrZQeMq.mjs} +3 -3
  34. package/lib/{constants-Bmrui4ZY.js → constants-lsjPx3va.js} +1 -1
  35. package/lib/{contract-MJZ8ZoSX.js → contract-CcVq6MSa.js} +1 -1
  36. package/lib/{contract-BVaUamai.mjs → contract-DrK81GRi.mjs} +109 -109
  37. package/lib/create-BtJgfMdJ.mjs +18 -0
  38. package/lib/{create-DO_-1_Hb.js → create-Q6N34YQz.js} +1 -1
  39. package/lib/{evm-IjnSHeSg.mjs → evm--hXXT-db.mjs} +9 -9
  40. package/lib/{evm-C-aa4dBG.mjs → evm-BBqhcxFC.mjs} +83 -83
  41. package/lib/{evm-D_r84vhS.js → evm-CNq2zXwl.js} +3 -3
  42. package/lib/{evm-ZSzF-61X.js → evm-l0300AWS.js} +2 -2
  43. package/lib/executor.js +470 -1
  44. package/lib/executor.mjs +7106 -560
  45. package/lib/hosted.js +1 -1
  46. package/lib/hosted.mjs +1 -1
  47. package/lib/{index-aA-2Ygs3.mjs → index-98w8rrCe.mjs} +1 -1
  48. package/lib/{index-Bb8InrQU.mjs → index-9dr91dtY.mjs} +2 -2
  49. package/lib/{index-DNaxNpBa.js → index-BABC5__9.js} +1 -1
  50. package/lib/{index-CapdlI6H.js → index-BAjc-UZH.js} +1 -1
  51. package/lib/{index-Cx-ODuWg.mjs → index-BN-aj3dN.mjs} +4 -4
  52. package/lib/{index-BeQ668oT.js → index-BV7XVrd8.js} +1 -1
  53. package/lib/{index-CKaF7Gzs.mjs → index-BbUxOO56.mjs} +14 -14
  54. package/lib/{index-D3cDkU4S.js → index-BfPE3vDw.js} +1 -1
  55. package/lib/{index-Batb-GTa.mjs → index-BlCHxlUD.mjs} +5 -5
  56. package/lib/{index-CZYUYK5K.js → index-BnCQiOiA.js} +1 -1
  57. package/lib/{index-CsdQttEt.mjs → index-BqmCeCU_.mjs} +5 -5
  58. package/lib/{index-Ce0EI1tW.mjs → index-BtrXSq3R.mjs} +5 -5
  59. package/lib/{index-CE0rxdUf.js → index-C-ORpsiU.js} +1 -1
  60. package/lib/{index-DyE-3pz1.js → index-C0un9IYm.js} +1 -1
  61. package/lib/{index-DdvRmaTh.mjs → index-C4HPXgbm.mjs} +7 -7
  62. package/lib/{index-DgIxcujP.mjs → index-COkYtNvE.mjs} +36 -36
  63. package/lib/{index-CLy98PXT.mjs → index-COs6VyCx.mjs} +13 -13
  64. package/lib/{index-43m4zMem.js → index-COsUDXFI.js} +1 -1
  65. package/lib/{index-B36we0ml.mjs → index-CUYHyKgr.mjs} +7 -7
  66. package/lib/{index-BcAXCy1h.js → index-CUyxr8OX.js} +1 -1
  67. package/lib/{index-DDBLdcME.mjs → index-CX0qxE9A.mjs} +11 -11
  68. package/lib/{index-C2Pe6i5V.js → index-CiFTvTwg.js} +1 -1
  69. package/lib/{index-DNcx7dMI.mjs → index-CofxOTyV.mjs} +5 -5
  70. package/lib/{index-BGqRY1Ww.js → index-CsR_y9ji.js} +1 -1
  71. package/lib/{index-CA5XKv-J.js → index-CuoxLyOv.js} +1 -1
  72. package/lib/{index-DRCX2iXw.js → index-CvEfOpn2.js} +1 -1
  73. package/lib/{index-CV3K6bKD.js → index-Cxwfq1al.js} +1 -1
  74. package/lib/{index-CjroDahP.mjs → index-D0tl0B36.mjs} +2 -2
  75. package/lib/{index-f_27F6WX.js → index-D4KtQtgE.js} +1 -1
  76. package/lib/{index-D2o0FZvZ.js → index-D74ZE0n9.js} +1 -1
  77. package/lib/{index-DkZjpCle.js → index-DLFGcXjy.js} +1 -1
  78. package/lib/{index-07cEoDZD.mjs → index-DNvr2HlM.mjs} +13 -13
  79. package/lib/{index-Cu7gFSJv.mjs → index-DPfKYdEf.mjs} +1 -1
  80. package/lib/{index-Bogu114a.js → index-Db3GFx2x.js} +1 -1
  81. package/lib/{index-Dt-63Ecw.js → index-DbJV-Hi3.js} +1 -1
  82. package/lib/{index-B-S6avdv.js → index-DebLDCcs.js} +1 -1
  83. package/lib/{index-DC1ot7tO.js → index-DjbQ-yfQ.js} +1 -1
  84. package/lib/{index-Cry2AYTm.mjs → index-DsKRmXnW.mjs} +3 -3
  85. package/lib/{index-FCA-cXcS.js → index-DtUeWT1n.js} +1 -1
  86. package/lib/{index-DyvQhGPY.mjs → index-DtfwfGsA.mjs} +2 -2
  87. package/lib/{index-DDBdrN7Y.mjs → index-DvozGHS-.mjs} +7070 -7093
  88. package/lib/{index-Cyo0tNu5.mjs → index-Dx7nqevs.mjs} +2 -2
  89. package/lib/{index-Blzzdktm.js → index-LJw0S70V.js} +1 -1
  90. package/lib/{index-rAnJYuJr.mjs → index-Nh2mSVy3.mjs} +9 -9
  91. package/lib/{index-B5XhLD_L.mjs → index-S_O9ybUy.mjs} +5 -5
  92. package/lib/{index-CIhJm6vf.js → index-S_dcknx7.js} +86 -86
  93. package/lib/{index-Dsaj5lf_.js → index-U1ceHkB6.js} +1 -1
  94. package/lib/{index-BUlzgqNa.mjs → index-Yp3NfcfI.mjs} +4 -4
  95. package/lib/{index-DRleG63r.mjs → index-Z48MvcFr.mjs} +1 -1
  96. package/lib/{index-B9hin5U8.mjs → index-ejTR4WLF.mjs} +5 -5
  97. package/lib/{index-BUfjw4S2.mjs → index-kyD2rWx8.mjs} +11 -11
  98. package/lib/{index-BL4H4RbP.js → index-lG1-neJv.js} +1 -1
  99. package/lib/{index-CuDLHfKb.mjs → index-sz4KACqf.mjs} +5 -5
  100. package/lib/{index-dpkTW-H8.js → index-vIUqmO0o.js} +1 -1
  101. package/lib/{index.es-MXzok_Dp.js → index.es-C4RhqFy8.js} +2 -2
  102. package/lib/{index.es-C6ziEcYX.mjs → index.es-D5O0G4Af.mjs} +7 -7
  103. package/lib/index.js +1 -1
  104. package/lib/index.mjs +1 -1
  105. package/lib/mayan.js +1 -1
  106. package/lib/mayan.mjs +10 -10
  107. package/lib/{mint-C3SdQH_S.mjs → mint-CKsi-DrV.mjs} +2 -2
  108. package/lib/{mint-BxtkCWBh.js → mint-DNcbNuI1.js} +1 -1
  109. package/lib/ntt.js +1 -1
  110. package/lib/ntt.mjs +10 -10
  111. package/lib/{platform-Czq0KkFa.mjs → platform-BCxJ-CNM.mjs} +7 -7
  112. package/lib/{platform-CG_VHRJU.js → platform-BqUizEYV.js} +1 -1
  113. package/lib/{platform-CUeBR_i4.mjs → platform-CB3TPh7I.mjs} +17 -17
  114. package/lib/{platform-CyTWPtDR.js → platform-CGIgJRY3.js} +1 -1
  115. package/lib/{platform-PNwsacZi.js → platform-D7pe3gG2.js} +1 -1
  116. package/lib/{platform-Droe0nZu.mjs → platform-DTVt42uH.mjs} +4 -4
  117. package/lib/provider-jsonrpc-DYBOGqdj.js +1 -0
  118. package/lib/{provider-jsonrpc-CVWSLk8g.mjs → provider-jsonrpc-MOE1VIOF.mjs} +155 -155
  119. package/lib/{sha3-BMK6V2DM.mjs → sha3-BZUtvEPh.mjs} +1 -1
  120. package/lib/{sha3-uufRWTnZ.js → sha3-c6o5MDKC.js} +1 -1
  121. package/lib/{signer-L9IdBy4K.js → signer-BAFbrQDv.js} +1 -1
  122. package/lib/{signer-CYkXKdE1.mjs → signer-CwtXMDcn.mjs} +25 -25
  123. package/lib/solana-Cg0N1W8e.js +1 -0
  124. package/lib/{solana-iU2xZ6yu.js → solana-DIO5mbHM.js} +1 -1
  125. package/lib/{solana-CE7DDmW7.mjs → solana-Dr5BmG1x.mjs} +6 -6
  126. package/lib/solana-mJ922Ek9.mjs +18 -0
  127. package/lib/{solanaEmbed.esm-BtaI5pum.mjs → solanaEmbed.esm-C4t2kCSL.mjs} +3 -3
  128. package/lib/{solanaEmbed.esm-DUsdVcC-.js → solanaEmbed.esm-D0xXx6VI.js} +1 -1
  129. package/lib/src/config/tokens.d.ts +0 -1
  130. package/lib/src/config/tokens.d.ts.map +1 -1
  131. package/lib/src/contexts/TokensContext.d.ts.map +1 -1
  132. package/lib/src/utils/errors.d.ts +1 -0
  133. package/lib/src/utils/errors.d.ts.map +1 -1
  134. package/lib/src/views/v2/Bridge/WalletConnector/Sidebar.d.ts.map +1 -1
  135. package/lib/src/views/v2/Redeem/TransactionDetails/index.d.ts.map +1 -1
  136. package/lib/{sui-BIE_b_7o.mjs → sui-AbsMI4yt.mjs} +3 -3
  137. package/lib/{sui-CNPKXqM6.js → sui-BSJIqJNt.js} +1 -1
  138. package/lib/{sui-Dva2w10T.js → sui-Bzh8kAZm.js} +1 -1
  139. package/lib/{sui-BJsKaZg2.mjs → sui-CZTSBdD4.mjs} +16 -16
  140. package/lib/{tokens-D4usSvOD.js → tokens-BUeRxOcP.js} +1 -1
  141. package/lib/{tokens-CQnhplD_.mjs → tokens-Vm--egzg.mjs} +4 -4
  142. package/lib/{units-CPUigdwl.js → units-LPlUOt3D.js} +1 -1
  143. package/lib/{units-YkCOGDr9.mjs → units-b10-QTSu.mjs} +28 -28
  144. package/lib/{unsignedTransaction-C0WXQMmv.mjs → unsignedTransaction-BJw0T6uN.mjs} +28 -28
  145. package/lib/{unsignedTransaction-DFUF8DSp.js → unsignedTransaction-CIkLJt6N.js} +1 -1
  146. package/lib/{web3-B3Usc-Qj.mjs → web3-BHuP7CTp.mjs} +7 -7
  147. package/lib/{web3-CjTx3huW.js → web3-SO_UBSxv.js} +1 -1
  148. package/package.json +2 -2
  149. package/lib/chunk-IMTC3J2M-D-un3eDX.js +0 -471
  150. package/lib/create-CQ6n4Ga8.mjs +0 -18
  151. package/lib/provider-jsonrpc-1gjszS3Q.js +0 -1
  152. package/lib/solana-BRQmi9BN.js +0 -1
  153. package/lib/solana-Bs7_C3BS.mjs +0 -18
@@ -1,15 +1,15 @@
1
- "use strict";var Gh=Object.defineProperty;var Yh=(n,e,t)=>e in n?Gh(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var re=(n,e,t)=>Yh(n,typeof e!="symbol"?e+"":e,t);var an=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function $s(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function Ec(n){if(n.__esModule)return n;var e=n.default;if(typeof e=="function"){var t=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(r){var s=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:function(){return n[r]}})}),t}var Ve={},oe={},Xi={};Xi.byteLength=Jh;Xi.toByteArray=em;Xi.fromByteArray=rm;var yn=[],Qt=[],Xh=typeof Uint8Array<"u"?Uint8Array:Array,na="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var Wr=0,Zh=na.length;Wr<Zh;++Wr)yn[Wr]=na[Wr],Qt[na.charCodeAt(Wr)]=Wr;Qt[45]=62;Qt[95]=63;function pu(n){var e=n.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=n.indexOf("=");t===-1&&(t=e);var r=t===e?0:4-t%4;return[t,r]}function Jh(n){var e=pu(n),t=e[0],r=e[1];return(t+r)*3/4-r}function Qh(n,e,t){return(e+t)*3/4-t}function em(n){var e,t=pu(n),r=t[0],s=t[1],i=new Xh(Qh(n,r,s)),o=0,a=s>0?r-4:r,l;for(l=0;l<a;l+=4)e=Qt[n.charCodeAt(l)]<<18|Qt[n.charCodeAt(l+1)]<<12|Qt[n.charCodeAt(l+2)]<<6|Qt[n.charCodeAt(l+3)],i[o++]=e>>16&255,i[o++]=e>>8&255,i[o++]=e&255;return s===2&&(e=Qt[n.charCodeAt(l)]<<2|Qt[n.charCodeAt(l+1)]>>4,i[o++]=e&255),s===1&&(e=Qt[n.charCodeAt(l)]<<10|Qt[n.charCodeAt(l+1)]<<4|Qt[n.charCodeAt(l+2)]>>2,i[o++]=e>>8&255,i[o++]=e&255),i}function tm(n){return yn[n>>18&63]+yn[n>>12&63]+yn[n>>6&63]+yn[n&63]}function nm(n,e,t){for(var r,s=[],i=e;i<t;i+=3)r=(n[i]<<16&16711680)+(n[i+1]<<8&65280)+(n[i+2]&255),s.push(tm(r));return s.join("")}function rm(n){for(var e,t=n.length,r=t%3,s=[],i=16383,o=0,a=t-r;o<a;o+=i)s.push(nm(n,o,o+i>a?a:o+i));return r===1?(e=n[t-1],s.push(yn[e>>2]+yn[e<<4&63]+"==")):r===2&&(e=(n[t-2]<<8)+n[t-1],s.push(yn[e>>10]+yn[e>>4&63]+yn[e<<2&63]+"=")),s.join("")}var Bc={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */Bc.read=function(n,e,t,r,s){var i,o,a=s*8-r-1,l=(1<<a)-1,h=l>>1,m=-7,E=t?s-1:0,S=t?-1:1,A=n[e+E];for(E+=S,i=A&(1<<-m)-1,A>>=-m,m+=a;m>0;i=i*256+n[e+E],E+=S,m-=8);for(o=i&(1<<-m)-1,i>>=-m,m+=r;m>0;o=o*256+n[e+E],E+=S,m-=8);if(i===0)i=1-h;else{if(i===l)return o?NaN:(A?-1:1)*(1/0);o=o+Math.pow(2,r),i=i-h}return(A?-1:1)*o*Math.pow(2,i-r)};Bc.write=function(n,e,t,r,s,i){var o,a,l,h=i*8-s-1,m=(1<<h)-1,E=m>>1,S=s===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=r?0:i-1,g=r?1:-1,D=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=m):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),o+E>=1?e+=S/l:e+=S*Math.pow(2,1-E),e*l>=2&&(o++,l/=2),o+E>=m?(a=0,o=m):o+E>=1?(a=(e*l-1)*Math.pow(2,s),o=o+E):(a=e*Math.pow(2,E-1)*Math.pow(2,s),o=0));s>=8;n[t+A]=a&255,A+=g,a/=256,s-=8);for(o=o<<s|a,h+=s;h>0;n[t+A]=o&255,A+=g,o/=256,h-=8);n[t+A-g]|=D*128};/*!
1
+ "use strict";var rm=Object.defineProperty;var sm=(n,e,t)=>e in n?rm(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var re=(n,e,t)=>sm(n,typeof e!="symbol"?e+"":e,t);var an=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Vs(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function Bc(n){if(n.__esModule)return n;var e=n.default;if(typeof e=="function"){var t=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(r){var s=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:function(){return n[r]}})}),t}var Ve={},oe={},Zi={};Zi.byteLength=am;Zi.toByteArray=lm;Zi.fromByteArray=fm;var yn=[],Qt=[],im=typeof Uint8Array<"u"?Uint8Array:Array,ra="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var Pr=0,om=ra.length;Pr<om;++Pr)yn[Pr]=ra[Pr],Qt[ra.charCodeAt(Pr)]=Pr;Qt[45]=62;Qt[95]=63;function yu(n){var e=n.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=n.indexOf("=");t===-1&&(t=e);var r=t===e?0:4-t%4;return[t,r]}function am(n){var e=yu(n),t=e[0],r=e[1];return(t+r)*3/4-r}function cm(n,e,t){return(e+t)*3/4-t}function lm(n){var e,t=yu(n),r=t[0],s=t[1],i=new im(cm(n,r,s)),o=0,a=s>0?r-4:r,l;for(l=0;l<a;l+=4)e=Qt[n.charCodeAt(l)]<<18|Qt[n.charCodeAt(l+1)]<<12|Qt[n.charCodeAt(l+2)]<<6|Qt[n.charCodeAt(l+3)],i[o++]=e>>16&255,i[o++]=e>>8&255,i[o++]=e&255;return s===2&&(e=Qt[n.charCodeAt(l)]<<2|Qt[n.charCodeAt(l+1)]>>4,i[o++]=e&255),s===1&&(e=Qt[n.charCodeAt(l)]<<10|Qt[n.charCodeAt(l+1)]<<4|Qt[n.charCodeAt(l+2)]>>2,i[o++]=e>>8&255,i[o++]=e&255),i}function dm(n){return yn[n>>18&63]+yn[n>>12&63]+yn[n>>6&63]+yn[n&63]}function um(n,e,t){for(var r,s=[],i=e;i<t;i+=3)r=(n[i]<<16&16711680)+(n[i+1]<<8&65280)+(n[i+2]&255),s.push(dm(r));return s.join("")}function fm(n){for(var e,t=n.length,r=t%3,s=[],i=16383,o=0,a=t-r;o<a;o+=i)s.push(um(n,o,o+i>a?a:o+i));return r===1?(e=n[t-1],s.push(yn[e>>2]+yn[e<<4&63]+"==")):r===2&&(e=(n[t-2]<<8)+n[t-1],s.push(yn[e>>10]+yn[e>>4&63]+yn[e<<2&63]+"=")),s.join("")}var xc={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */xc.read=function(n,e,t,r,s){var i,o,a=s*8-r-1,l=(1<<a)-1,h=l>>1,m=-7,E=t?s-1:0,S=t?-1:1,A=n[e+E];for(E+=S,i=A&(1<<-m)-1,A>>=-m,m+=a;m>0;i=i*256+n[e+E],E+=S,m-=8);for(o=i&(1<<-m)-1,i>>=-m,m+=r;m>0;o=o*256+n[e+E],E+=S,m-=8);if(i===0)i=1-h;else{if(i===l)return o?NaN:(A?-1:1)*(1/0);o=o+Math.pow(2,r),i=i-h}return(A?-1:1)*o*Math.pow(2,i-r)};xc.write=function(n,e,t,r,s,i){var o,a,l,h=i*8-s-1,m=(1<<h)-1,E=m>>1,S=s===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=r?0:i-1,g=r?1:-1,D=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=m):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),o+E>=1?e+=S/l:e+=S*Math.pow(2,1-E),e*l>=2&&(o++,l/=2),o+E>=m?(a=0,o=m):o+E>=1?(a=(e*l-1)*Math.pow(2,s),o=o+E):(a=e*Math.pow(2,E-1)*Math.pow(2,s),o=0));s>=8;n[t+A]=a&255,A+=g,a/=256,s-=8);for(o=o<<s|a,h+=s;h>0;n[t+A]=o&255,A+=g,o/=256,h-=8);n[t+A-g]|=D*128};/*!
2
2
  * The buffer module from node.js, for the browser.
3
3
  *
4
4
  * @author Feross Aboukhadijeh <https://feross.org>
5
5
  * @license MIT
6
- */(function(n){const e=Xi,t=Bc,r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;n.Buffer=a,n.SlowBuffer=R,n.INSPECT_MAX_BYTES=50;const s=2147483647;n.kMaxLength=s,a.TYPED_ARRAY_SUPPORT=i(),!a.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function i(){try{const w=new Uint8Array(1),d={foo:function(){return 42}};return Object.setPrototypeOf(d,Uint8Array.prototype),Object.setPrototypeOf(w,d),w.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function o(w){if(w>s)throw new RangeError('The value "'+w+'" is invalid for option "size"');const d=new Uint8Array(w);return Object.setPrototypeOf(d,a.prototype),d}function a(w,d,f){if(typeof w=="number"){if(typeof d=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return E(w)}return l(w,d,f)}a.poolSize=8192;function l(w,d,f){if(typeof w=="string")return S(w,d);if(ArrayBuffer.isView(w))return g(w);if(w==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof w);if(Ft(w,ArrayBuffer)||w&&Ft(w.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Ft(w,SharedArrayBuffer)||w&&Ft(w.buffer,SharedArrayBuffer)))return D(w,d,f);if(typeof w=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const v=w.valueOf&&w.valueOf();if(v!=null&&v!==w)return a.from(v,d,f);const M=x(w);if(M)return M;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof w[Symbol.toPrimitive]=="function")return a.from(w[Symbol.toPrimitive]("string"),d,f);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof w)}a.from=function(w,d,f){return l(w,d,f)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function h(w){if(typeof w!="number")throw new TypeError('"size" argument must be of type number');if(w<0)throw new RangeError('The value "'+w+'" is invalid for option "size"')}function m(w,d,f){return h(w),w<=0?o(w):d!==void 0?typeof f=="string"?o(w).fill(d,f):o(w).fill(d):o(w)}a.alloc=function(w,d,f){return m(w,d,f)};function E(w){return h(w),o(w<0?0:U(w)|0)}a.allocUnsafe=function(w){return E(w)},a.allocUnsafeSlow=function(w){return E(w)};function S(w,d){if((typeof d!="string"||d==="")&&(d="utf8"),!a.isEncoding(d))throw new TypeError("Unknown encoding: "+d);const f=F(w,d)|0;let v=o(f);const M=v.write(w,d);return M!==f&&(v=v.slice(0,M)),v}function A(w){const d=w.length<0?0:U(w.length)|0,f=o(d);for(let v=0;v<d;v+=1)f[v]=w[v]&255;return f}function g(w){if(Ft(w,Uint8Array)){const d=new Uint8Array(w);return D(d.buffer,d.byteOffset,d.byteLength)}return A(w)}function D(w,d,f){if(d<0||w.byteLength<d)throw new RangeError('"offset" is outside of buffer bounds');if(w.byteLength<d+(f||0))throw new RangeError('"length" is outside of buffer bounds');let v;return d===void 0&&f===void 0?v=new Uint8Array(w):f===void 0?v=new Uint8Array(w,d):v=new Uint8Array(w,d,f),Object.setPrototypeOf(v,a.prototype),v}function x(w){if(a.isBuffer(w)){const d=U(w.length)|0,f=o(d);return f.length===0||w.copy(f,0,0,d),f}if(w.length!==void 0)return typeof w.length!="number"||Pe(w.length)?o(0):A(w);if(w.type==="Buffer"&&Array.isArray(w.data))return A(w.data)}function U(w){if(w>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return w|0}function R(w){return+w!=w&&(w=0),a.alloc(+w)}a.isBuffer=function(d){return d!=null&&d._isBuffer===!0&&d!==a.prototype},a.compare=function(d,f){if(Ft(d,Uint8Array)&&(d=a.from(d,d.offset,d.byteLength)),Ft(f,Uint8Array)&&(f=a.from(f,f.offset,f.byteLength)),!a.isBuffer(d)||!a.isBuffer(f))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(d===f)return 0;let v=d.length,M=f.length;for(let P=0,N=Math.min(v,M);P<N;++P)if(d[P]!==f[P]){v=d[P],M=f[P];break}return v<M?-1:M<v?1:0},a.isEncoding=function(d){switch(String(d).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(d,f){if(!Array.isArray(d))throw new TypeError('"list" argument must be an Array of Buffers');if(d.length===0)return a.alloc(0);let v;if(f===void 0)for(f=0,v=0;v<d.length;++v)f+=d[v].length;const M=a.allocUnsafe(f);let P=0;for(v=0;v<d.length;++v){let N=d[v];if(Ft(N,Uint8Array))P+N.length>M.length?(a.isBuffer(N)||(N=a.from(N)),N.copy(M,P)):Uint8Array.prototype.set.call(M,N,P);else if(a.isBuffer(N))N.copy(M,P);else throw new TypeError('"list" argument must be an Array of Buffers');P+=N.length}return M};function F(w,d){if(a.isBuffer(w))return w.length;if(ArrayBuffer.isView(w)||Ft(w,ArrayBuffer))return w.byteLength;if(typeof w!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof w);const f=w.length,v=arguments.length>2&&arguments[2]===!0;if(!v&&f===0)return 0;let M=!1;for(;;)switch(d){case"ascii":case"latin1":case"binary":return f;case"utf8":case"utf-8":return Le(w).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return f*2;case"hex":return f>>>1;case"base64":return Oe(w).length;default:if(M)return v?-1:Le(w).length;d=(""+d).toLowerCase(),M=!0}}a.byteLength=F;function W(w,d,f){let v=!1;if((d===void 0||d<0)&&(d=0),d>this.length||((f===void 0||f>this.length)&&(f=this.length),f<=0)||(f>>>=0,d>>>=0,f<=d))return"";for(w||(w="utf8");;)switch(w){case"hex":return T(this,d,f);case"utf8":case"utf-8":return c(this,d,f);case"ascii":return y(this,d,f);case"latin1":case"binary":return C(this,d,f);case"base64":return I(this,d,f);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,d,f);default:if(v)throw new TypeError("Unknown encoding: "+w);w=(w+"").toLowerCase(),v=!0}}a.prototype._isBuffer=!0;function z(w,d,f){const v=w[d];w[d]=w[f],w[f]=v}a.prototype.swap16=function(){const d=this.length;if(d%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let f=0;f<d;f+=2)z(this,f,f+1);return this},a.prototype.swap32=function(){const d=this.length;if(d%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let f=0;f<d;f+=4)z(this,f,f+3),z(this,f+1,f+2);return this},a.prototype.swap64=function(){const d=this.length;if(d%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let f=0;f<d;f+=8)z(this,f,f+7),z(this,f+1,f+6),z(this,f+2,f+5),z(this,f+3,f+4);return this},a.prototype.toString=function(){const d=this.length;return d===0?"":arguments.length===0?c(this,0,d):W.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(d){if(!a.isBuffer(d))throw new TypeError("Argument must be a Buffer");return this===d?!0:a.compare(this,d)===0},a.prototype.inspect=function(){let d="";const f=n.INSPECT_MAX_BYTES;return d=this.toString("hex",0,f).replace(/(.{2})/g,"$1 ").trim(),this.length>f&&(d+=" ... "),"<Buffer "+d+">"},r&&(a.prototype[r]=a.prototype.inspect),a.prototype.compare=function(d,f,v,M,P){if(Ft(d,Uint8Array)&&(d=a.from(d,d.offset,d.byteLength)),!a.isBuffer(d))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof d);if(f===void 0&&(f=0),v===void 0&&(v=d?d.length:0),M===void 0&&(M=0),P===void 0&&(P=this.length),f<0||v>d.length||M<0||P>this.length)throw new RangeError("out of range index");if(M>=P&&f>=v)return 0;if(M>=P)return-1;if(f>=v)return 1;if(f>>>=0,v>>>=0,M>>>=0,P>>>=0,this===d)return 0;let N=P-M,be=v-f;const he=Math.min(N,be),fe=this.slice(M,P),Ke=d.slice(f,v);for(let de=0;de<he;++de)if(fe[de]!==Ke[de]){N=fe[de],be=Ke[de];break}return N<be?-1:be<N?1:0};function H(w,d,f,v,M){if(w.length===0)return-1;if(typeof f=="string"?(v=f,f=0):f>2147483647?f=2147483647:f<-2147483648&&(f=-2147483648),f=+f,Pe(f)&&(f=M?0:w.length-1),f<0&&(f=w.length+f),f>=w.length){if(M)return-1;f=w.length-1}else if(f<0)if(M)f=0;else return-1;if(typeof d=="string"&&(d=a.from(d,v)),a.isBuffer(d))return d.length===0?-1:K(w,d,f,v,M);if(typeof d=="number")return d=d&255,typeof Uint8Array.prototype.indexOf=="function"?M?Uint8Array.prototype.indexOf.call(w,d,f):Uint8Array.prototype.lastIndexOf.call(w,d,f):K(w,[d],f,v,M);throw new TypeError("val must be string, number or Buffer")}function K(w,d,f,v,M){let P=1,N=w.length,be=d.length;if(v!==void 0&&(v=String(v).toLowerCase(),v==="ucs2"||v==="ucs-2"||v==="utf16le"||v==="utf-16le")){if(w.length<2||d.length<2)return-1;P=2,N/=2,be/=2,f/=2}function he(Ke,de){return P===1?Ke[de]:Ke.readUInt16BE(de*P)}let fe;if(M){let Ke=-1;for(fe=f;fe<N;fe++)if(he(w,fe)===he(d,Ke===-1?0:fe-Ke)){if(Ke===-1&&(Ke=fe),fe-Ke+1===be)return Ke*P}else Ke!==-1&&(fe-=fe-Ke),Ke=-1}else for(f+be>N&&(f=N-be),fe=f;fe>=0;fe--){let Ke=!0;for(let de=0;de<be;de++)if(he(w,fe+de)!==he(d,de)){Ke=!1;break}if(Ke)return fe}return-1}a.prototype.includes=function(d,f,v){return this.indexOf(d,f,v)!==-1},a.prototype.indexOf=function(d,f,v){return H(this,d,f,v,!0)},a.prototype.lastIndexOf=function(d,f,v){return H(this,d,f,v,!1)};function G(w,d,f,v){f=Number(f)||0;const M=w.length-f;v?(v=Number(v),v>M&&(v=M)):v=M;const P=d.length;v>P/2&&(v=P/2);let N;for(N=0;N<v;++N){const be=parseInt(d.substr(N*2,2),16);if(Pe(be))return N;w[f+N]=be}return N}function V(w,d,f,v){return Re(Le(d,w.length-f),w,f,v)}function ie(w,d,f,v){return Re($e(d),w,f,v)}function ne(w,d,f,v){return Re(Oe(d),w,f,v)}function ae(w,d,f,v){return Re(Rr(d,w.length-f),w,f,v)}a.prototype.write=function(d,f,v,M){if(f===void 0)M="utf8",v=this.length,f=0;else if(v===void 0&&typeof f=="string")M=f,v=this.length,f=0;else if(isFinite(f))f=f>>>0,isFinite(v)?(v=v>>>0,M===void 0&&(M="utf8")):(M=v,v=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const P=this.length-f;if((v===void 0||v>P)&&(v=P),d.length>0&&(v<0||f<0)||f>this.length)throw new RangeError("Attempt to write outside buffer bounds");M||(M="utf8");let N=!1;for(;;)switch(M){case"hex":return G(this,d,f,v);case"utf8":case"utf-8":return V(this,d,f,v);case"ascii":case"latin1":case"binary":return ie(this,d,f,v);case"base64":return ne(this,d,f,v);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ae(this,d,f,v);default:if(N)throw new TypeError("Unknown encoding: "+M);M=(""+M).toLowerCase(),N=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function I(w,d,f){return d===0&&f===w.length?e.fromByteArray(w):e.fromByteArray(w.slice(d,f))}function c(w,d,f){f=Math.min(w.length,f);const v=[];let M=d;for(;M<f;){const P=w[M];let N=null,be=P>239?4:P>223?3:P>191?2:1;if(M+be<=f){let he,fe,Ke,de;switch(be){case 1:P<128&&(N=P);break;case 2:he=w[M+1],(he&192)===128&&(de=(P&31)<<6|he&63,de>127&&(N=de));break;case 3:he=w[M+1],fe=w[M+2],(he&192)===128&&(fe&192)===128&&(de=(P&15)<<12|(he&63)<<6|fe&63,de>2047&&(de<55296||de>57343)&&(N=de));break;case 4:he=w[M+1],fe=w[M+2],Ke=w[M+3],(he&192)===128&&(fe&192)===128&&(Ke&192)===128&&(de=(P&15)<<18|(he&63)<<12|(fe&63)<<6|Ke&63,de>65535&&de<1114112&&(N=de))}}N===null?(N=65533,be=1):N>65535&&(N-=65536,v.push(N>>>10&1023|55296),N=56320|N&1023),v.push(N),M+=be}return p(v)}const b=4096;function p(w){const d=w.length;if(d<=b)return String.fromCharCode.apply(String,w);let f="",v=0;for(;v<d;)f+=String.fromCharCode.apply(String,w.slice(v,v+=b));return f}function y(w,d,f){let v="";f=Math.min(w.length,f);for(let M=d;M<f;++M)v+=String.fromCharCode(w[M]&127);return v}function C(w,d,f){let v="";f=Math.min(w.length,f);for(let M=d;M<f;++M)v+=String.fromCharCode(w[M]);return v}function T(w,d,f){const v=w.length;(!d||d<0)&&(d=0),(!f||f<0||f>v)&&(f=v);let M="";for(let P=d;P<f;++P)M+=He[w[P]];return M}function _(w,d,f){const v=w.slice(d,f);let M="";for(let P=0;P<v.length-1;P+=2)M+=String.fromCharCode(v[P]+v[P+1]*256);return M}a.prototype.slice=function(d,f){const v=this.length;d=~~d,f=f===void 0?v:~~f,d<0?(d+=v,d<0&&(d=0)):d>v&&(d=v),f<0?(f+=v,f<0&&(f=0)):f>v&&(f=v),f<d&&(f=d);const M=this.subarray(d,f);return Object.setPrototypeOf(M,a.prototype),M};function B(w,d,f){if(w%1!==0||w<0)throw new RangeError("offset is not uint");if(w+d>f)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(d,f,v){d=d>>>0,f=f>>>0,v||B(d,f,this.length);let M=this[d],P=1,N=0;for(;++N<f&&(P*=256);)M+=this[d+N]*P;return M},a.prototype.readUintBE=a.prototype.readUIntBE=function(d,f,v){d=d>>>0,f=f>>>0,v||B(d,f,this.length);let M=this[d+--f],P=1;for(;f>0&&(P*=256);)M+=this[d+--f]*P;return M},a.prototype.readUint8=a.prototype.readUInt8=function(d,f){return d=d>>>0,f||B(d,1,this.length),this[d]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(d,f){return d=d>>>0,f||B(d,2,this.length),this[d]|this[d+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(d,f){return d=d>>>0,f||B(d,2,this.length),this[d]<<8|this[d+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(d,f){return d=d>>>0,f||B(d,4,this.length),(this[d]|this[d+1]<<8|this[d+2]<<16)+this[d+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(d,f){return d=d>>>0,f||B(d,4,this.length),this[d]*16777216+(this[d+1]<<16|this[d+2]<<8|this[d+3])},a.prototype.readBigUInt64LE=jt(function(d){d=d>>>0,tt(d,"offset");const f=this[d],v=this[d+7];(f===void 0||v===void 0)&&Ce(d,this.length-8);const M=f+this[++d]*2**8+this[++d]*2**16+this[++d]*2**24,P=this[++d]+this[++d]*2**8+this[++d]*2**16+v*2**24;return BigInt(M)+(BigInt(P)<<BigInt(32))}),a.prototype.readBigUInt64BE=jt(function(d){d=d>>>0,tt(d,"offset");const f=this[d],v=this[d+7];(f===void 0||v===void 0)&&Ce(d,this.length-8);const M=f*2**24+this[++d]*2**16+this[++d]*2**8+this[++d],P=this[++d]*2**24+this[++d]*2**16+this[++d]*2**8+v;return(BigInt(M)<<BigInt(32))+BigInt(P)}),a.prototype.readIntLE=function(d,f,v){d=d>>>0,f=f>>>0,v||B(d,f,this.length);let M=this[d],P=1,N=0;for(;++N<f&&(P*=256);)M+=this[d+N]*P;return P*=128,M>=P&&(M-=Math.pow(2,8*f)),M},a.prototype.readIntBE=function(d,f,v){d=d>>>0,f=f>>>0,v||B(d,f,this.length);let M=f,P=1,N=this[d+--M];for(;M>0&&(P*=256);)N+=this[d+--M]*P;return P*=128,N>=P&&(N-=Math.pow(2,8*f)),N},a.prototype.readInt8=function(d,f){return d=d>>>0,f||B(d,1,this.length),this[d]&128?(255-this[d]+1)*-1:this[d]},a.prototype.readInt16LE=function(d,f){d=d>>>0,f||B(d,2,this.length);const v=this[d]|this[d+1]<<8;return v&32768?v|4294901760:v},a.prototype.readInt16BE=function(d,f){d=d>>>0,f||B(d,2,this.length);const v=this[d+1]|this[d]<<8;return v&32768?v|4294901760:v},a.prototype.readInt32LE=function(d,f){return d=d>>>0,f||B(d,4,this.length),this[d]|this[d+1]<<8|this[d+2]<<16|this[d+3]<<24},a.prototype.readInt32BE=function(d,f){return d=d>>>0,f||B(d,4,this.length),this[d]<<24|this[d+1]<<16|this[d+2]<<8|this[d+3]},a.prototype.readBigInt64LE=jt(function(d){d=d>>>0,tt(d,"offset");const f=this[d],v=this[d+7];(f===void 0||v===void 0)&&Ce(d,this.length-8);const M=this[d+4]+this[d+5]*2**8+this[d+6]*2**16+(v<<24);return(BigInt(M)<<BigInt(32))+BigInt(f+this[++d]*2**8+this[++d]*2**16+this[++d]*2**24)}),a.prototype.readBigInt64BE=jt(function(d){d=d>>>0,tt(d,"offset");const f=this[d],v=this[d+7];(f===void 0||v===void 0)&&Ce(d,this.length-8);const M=(f<<24)+this[++d]*2**16+this[++d]*2**8+this[++d];return(BigInt(M)<<BigInt(32))+BigInt(this[++d]*2**24+this[++d]*2**16+this[++d]*2**8+v)}),a.prototype.readFloatLE=function(d,f){return d=d>>>0,f||B(d,4,this.length),t.read(this,d,!0,23,4)},a.prototype.readFloatBE=function(d,f){return d=d>>>0,f||B(d,4,this.length),t.read(this,d,!1,23,4)},a.prototype.readDoubleLE=function(d,f){return d=d>>>0,f||B(d,8,this.length),t.read(this,d,!0,52,8)},a.prototype.readDoubleBE=function(d,f){return d=d>>>0,f||B(d,8,this.length),t.read(this,d,!1,52,8)};function u(w,d,f,v,M,P){if(!a.isBuffer(w))throw new TypeError('"buffer" argument must be a Buffer instance');if(d>M||d<P)throw new RangeError('"value" argument is out of bounds');if(f+v>w.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(d,f,v,M){if(d=+d,f=f>>>0,v=v>>>0,!M){const be=Math.pow(2,8*v)-1;u(this,d,f,v,be,0)}let P=1,N=0;for(this[f]=d&255;++N<v&&(P*=256);)this[f+N]=d/P&255;return f+v},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(d,f,v,M){if(d=+d,f=f>>>0,v=v>>>0,!M){const be=Math.pow(2,8*v)-1;u(this,d,f,v,be,0)}let P=v-1,N=1;for(this[f+P]=d&255;--P>=0&&(N*=256);)this[f+P]=d/N&255;return f+v},a.prototype.writeUint8=a.prototype.writeUInt8=function(d,f,v){return d=+d,f=f>>>0,v||u(this,d,f,1,255,0),this[f]=d&255,f+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(d,f,v){return d=+d,f=f>>>0,v||u(this,d,f,2,65535,0),this[f]=d&255,this[f+1]=d>>>8,f+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(d,f,v){return d=+d,f=f>>>0,v||u(this,d,f,2,65535,0),this[f]=d>>>8,this[f+1]=d&255,f+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(d,f,v){return d=+d,f=f>>>0,v||u(this,d,f,4,4294967295,0),this[f+3]=d>>>24,this[f+2]=d>>>16,this[f+1]=d>>>8,this[f]=d&255,f+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(d,f,v){return d=+d,f=f>>>0,v||u(this,d,f,4,4294967295,0),this[f]=d>>>24,this[f+1]=d>>>16,this[f+2]=d>>>8,this[f+3]=d&255,f+4};function k(w,d,f,v,M){ye(d,v,M,w,f,7);let P=Number(d&BigInt(4294967295));w[f++]=P,P=P>>8,w[f++]=P,P=P>>8,w[f++]=P,P=P>>8,w[f++]=P;let N=Number(d>>BigInt(32)&BigInt(4294967295));return w[f++]=N,N=N>>8,w[f++]=N,N=N>>8,w[f++]=N,N=N>>8,w[f++]=N,f}function $(w,d,f,v,M){ye(d,v,M,w,f,7);let P=Number(d&BigInt(4294967295));w[f+7]=P,P=P>>8,w[f+6]=P,P=P>>8,w[f+5]=P,P=P>>8,w[f+4]=P;let N=Number(d>>BigInt(32)&BigInt(4294967295));return w[f+3]=N,N=N>>8,w[f+2]=N,N=N>>8,w[f+1]=N,N=N>>8,w[f]=N,f+8}a.prototype.writeBigUInt64LE=jt(function(d,f=0){return k(this,d,f,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=jt(function(d,f=0){return $(this,d,f,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(d,f,v,M){if(d=+d,f=f>>>0,!M){const he=Math.pow(2,8*v-1);u(this,d,f,v,he-1,-he)}let P=0,N=1,be=0;for(this[f]=d&255;++P<v&&(N*=256);)d<0&&be===0&&this[f+P-1]!==0&&(be=1),this[f+P]=(d/N>>0)-be&255;return f+v},a.prototype.writeIntBE=function(d,f,v,M){if(d=+d,f=f>>>0,!M){const he=Math.pow(2,8*v-1);u(this,d,f,v,he-1,-he)}let P=v-1,N=1,be=0;for(this[f+P]=d&255;--P>=0&&(N*=256);)d<0&&be===0&&this[f+P+1]!==0&&(be=1),this[f+P]=(d/N>>0)-be&255;return f+v},a.prototype.writeInt8=function(d,f,v){return d=+d,f=f>>>0,v||u(this,d,f,1,127,-128),d<0&&(d=255+d+1),this[f]=d&255,f+1},a.prototype.writeInt16LE=function(d,f,v){return d=+d,f=f>>>0,v||u(this,d,f,2,32767,-32768),this[f]=d&255,this[f+1]=d>>>8,f+2},a.prototype.writeInt16BE=function(d,f,v){return d=+d,f=f>>>0,v||u(this,d,f,2,32767,-32768),this[f]=d>>>8,this[f+1]=d&255,f+2},a.prototype.writeInt32LE=function(d,f,v){return d=+d,f=f>>>0,v||u(this,d,f,4,2147483647,-2147483648),this[f]=d&255,this[f+1]=d>>>8,this[f+2]=d>>>16,this[f+3]=d>>>24,f+4},a.prototype.writeInt32BE=function(d,f,v){return d=+d,f=f>>>0,v||u(this,d,f,4,2147483647,-2147483648),d<0&&(d=4294967295+d+1),this[f]=d>>>24,this[f+1]=d>>>16,this[f+2]=d>>>8,this[f+3]=d&255,f+4},a.prototype.writeBigInt64LE=jt(function(d,f=0){return k(this,d,f,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=jt(function(d,f=0){return $(this,d,f,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Z(w,d,f,v,M,P){if(f+v>w.length)throw new RangeError("Index out of range");if(f<0)throw new RangeError("Index out of range")}function ee(w,d,f,v,M){return d=+d,f=f>>>0,M||Z(w,d,f,4),t.write(w,d,f,v,23,4),f+4}a.prototype.writeFloatLE=function(d,f,v){return ee(this,d,f,!0,v)},a.prototype.writeFloatBE=function(d,f,v){return ee(this,d,f,!1,v)};function Ae(w,d,f,v,M){return d=+d,f=f>>>0,M||Z(w,d,f,8),t.write(w,d,f,v,52,8),f+8}a.prototype.writeDoubleLE=function(d,f,v){return Ae(this,d,f,!0,v)},a.prototype.writeDoubleBE=function(d,f,v){return Ae(this,d,f,!1,v)},a.prototype.copy=function(d,f,v,M){if(!a.isBuffer(d))throw new TypeError("argument should be a Buffer");if(v||(v=0),!M&&M!==0&&(M=this.length),f>=d.length&&(f=d.length),f||(f=0),M>0&&M<v&&(M=v),M===v||d.length===0||this.length===0)return 0;if(f<0)throw new RangeError("targetStart out of bounds");if(v<0||v>=this.length)throw new RangeError("Index out of range");if(M<0)throw new RangeError("sourceEnd out of bounds");M>this.length&&(M=this.length),d.length-f<M-v&&(M=d.length-f+v);const P=M-v;return this===d&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(f,v,M):Uint8Array.prototype.set.call(d,this.subarray(v,M),f),P},a.prototype.fill=function(d,f,v,M){if(typeof d=="string"){if(typeof f=="string"?(M=f,f=0,v=this.length):typeof v=="string"&&(M=v,v=this.length),M!==void 0&&typeof M!="string")throw new TypeError("encoding must be a string");if(typeof M=="string"&&!a.isEncoding(M))throw new TypeError("Unknown encoding: "+M);if(d.length===1){const N=d.charCodeAt(0);(M==="utf8"&&N<128||M==="latin1")&&(d=N)}}else typeof d=="number"?d=d&255:typeof d=="boolean"&&(d=Number(d));if(f<0||this.length<f||this.length<v)throw new RangeError("Out of range index");if(v<=f)return this;f=f>>>0,v=v===void 0?this.length:v>>>0,d||(d=0);let P;if(typeof d=="number")for(P=f;P<v;++P)this[P]=d;else{const N=a.isBuffer(d)?d:a.from(d,M),be=N.length;if(be===0)throw new TypeError('The value "'+d+'" is invalid for argument "value"');for(P=0;P<v-f;++P)this[P+f]=N[P%be]}return this};const le={};function ue(w,d,f){le[w]=class extends f{constructor(){super(),Object.defineProperty(this,"message",{value:d.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${w}]`,this.stack,delete this.name}get code(){return w}set code(M){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:M,writable:!0})}toString(){return`${this.name} [${w}]: ${this.message}`}}}ue("ERR_BUFFER_OUT_OF_BOUNDS",function(w){return w?`${w} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),ue("ERR_INVALID_ARG_TYPE",function(w,d){return`The "${w}" argument must be of type number. Received type ${typeof d}`},TypeError),ue("ERR_OUT_OF_RANGE",function(w,d,f){let v=`The value of "${w}" is out of range.`,M=f;return Number.isInteger(f)&&Math.abs(f)>2**32?M=Ze(String(f)):typeof f=="bigint"&&(M=String(f),(f>BigInt(2)**BigInt(32)||f<-(BigInt(2)**BigInt(32)))&&(M=Ze(M)),M+="n"),v+=` It must be ${d}. Received ${M}`,v},RangeError);function Ze(w){let d="",f=w.length;const v=w[0]==="-"?1:0;for(;f>=v+4;f-=3)d=`_${w.slice(f-3,f)}${d}`;return`${w.slice(0,f)}${d}`}function Ee(w,d,f){tt(d,"offset"),(w[d]===void 0||w[d+f]===void 0)&&Ce(d,w.length-(f+1))}function ye(w,d,f,v,M,P){if(w>f||w<d){const N=typeof d=="bigint"?"n":"";let be;throw d===0||d===BigInt(0)?be=`>= 0${N} and < 2${N} ** ${(P+1)*8}${N}`:be=`>= -(2${N} ** ${(P+1)*8-1}${N}) and < 2 ** ${(P+1)*8-1}${N}`,new le.ERR_OUT_OF_RANGE("value",be,w)}Ee(v,M,P)}function tt(w,d){if(typeof w!="number")throw new le.ERR_INVALID_ARG_TYPE(d,"number",w)}function Ce(w,d,f){throw Math.floor(w)!==w?(tt(w,f),new le.ERR_OUT_OF_RANGE("offset","an integer",w)):d<0?new le.ERR_BUFFER_OUT_OF_BOUNDS:new le.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${d}`,w)}const ke=/[^+/0-9A-Za-z-_]/g;function Mr(w){if(w=w.split("=")[0],w=w.trim().replace(ke,""),w.length<2)return"";for(;w.length%4!==0;)w=w+"=";return w}function Le(w,d){d=d||1/0;let f;const v=w.length;let M=null;const P=[];for(let N=0;N<v;++N){if(f=w.charCodeAt(N),f>55295&&f<57344){if(!M){if(f>56319){(d-=3)>-1&&P.push(239,191,189);continue}else if(N+1===v){(d-=3)>-1&&P.push(239,191,189);continue}M=f;continue}if(f<56320){(d-=3)>-1&&P.push(239,191,189),M=f;continue}f=(M-55296<<10|f-56320)+65536}else M&&(d-=3)>-1&&P.push(239,191,189);if(M=null,f<128){if((d-=1)<0)break;P.push(f)}else if(f<2048){if((d-=2)<0)break;P.push(f>>6|192,f&63|128)}else if(f<65536){if((d-=3)<0)break;P.push(f>>12|224,f>>6&63|128,f&63|128)}else if(f<1114112){if((d-=4)<0)break;P.push(f>>18|240,f>>12&63|128,f>>6&63|128,f&63|128)}else throw new Error("Invalid code point")}return P}function $e(w){const d=[];for(let f=0;f<w.length;++f)d.push(w.charCodeAt(f)&255);return d}function Rr(w,d){let f,v,M;const P=[];for(let N=0;N<w.length&&!((d-=2)<0);++N)f=w.charCodeAt(N),v=f>>8,M=f%256,P.push(M),P.push(v);return P}function Oe(w){return e.toByteArray(Mr(w))}function Re(w,d,f,v){let M;for(M=0;M<v&&!(M+f>=d.length||M>=w.length);++M)d[M+f]=w[M];return M}function Ft(w,d){return w instanceof d||w!=null&&w.constructor!=null&&w.constructor.name!=null&&w.constructor.name===d.name}function Pe(w){return w!==w}const He=function(){const w="0123456789abcdef",d=new Array(256);for(let f=0;f<16;++f){const v=f*16;for(let M=0;M<16;++M)d[v+M]=w[f]+w[M]}return d}();function jt(w){return typeof BigInt>"u"?qe:w}function qe(){throw new Error("BigInt not supported")}})(oe);var gu={exports:{}},et=gu.exports={},bn,pn;function Ia(){throw new Error("setTimeout has not been defined")}function Ua(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?bn=setTimeout:bn=Ia}catch{bn=Ia}try{typeof clearTimeout=="function"?pn=clearTimeout:pn=Ua}catch{pn=Ua}})();function yu(n){if(bn===setTimeout)return setTimeout(n,0);if((bn===Ia||!bn)&&setTimeout)return bn=setTimeout,setTimeout(n,0);try{return bn(n,0)}catch{try{return bn.call(null,n,0)}catch{return bn.call(this,n,0)}}}function sm(n){if(pn===clearTimeout)return clearTimeout(n);if((pn===Ua||!pn)&&clearTimeout)return pn=clearTimeout,clearTimeout(n);try{return pn(n)}catch{try{return pn.call(null,n)}catch{return pn.call(this,n)}}}var zn=[],Hr=!1,dr,mi=-1;function im(){!Hr||!dr||(Hr=!1,dr.length?zn=dr.concat(zn):mi=-1,zn.length&&wu())}function wu(){if(!Hr){var n=yu(im);Hr=!0;for(var e=zn.length;e;){for(dr=zn,zn=[];++mi<e;)dr&&dr[mi].run();mi=-1,e=zn.length}dr=null,Hr=!1,sm(n)}}et.nextTick=function(n){var e=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)e[t-1]=arguments[t];zn.push(new Au(n,e)),zn.length===1&&!Hr&&yu(wu)};function Au(n,e){this.fun=n,this.array=e}Au.prototype.run=function(){this.fun.apply(null,this.array)};et.title="browser";et.browser=!0;et.env={};et.argv=[];et.version="";et.versions={};function Kn(){}et.on=Kn;et.addListener=Kn;et.once=Kn;et.off=Kn;et.removeListener=Kn;et.removeAllListeners=Kn;et.emit=Kn;et.prependListener=Kn;et.prependOnceListener=Kn;et.listeners=function(n){return[]};et.binding=function(n){throw new Error("process.binding is not supported")};et.cwd=function(){return"/"};et.chdir=function(n){throw new Error("process.chdir is not supported")};et.umask=function(){return 0};var Eu=gu.exports;(function(n){Object.defineProperty(n,Symbol.toStringTag,{value:"Module"});const e=oe,t=Eu,r=o=>o&&o.__esModule?o:{default:o},s=r(t),i=globalThis||window||void 0||self;Object.defineProperty(n,"Buffer",{enumerable:!0,get:()=>e.Buffer}),Object.defineProperty(n,"process",{enumerable:!0,get:()=>s.default}),n.global=i})(Ve);const Ii=n=>[...Array(n).keys()],Bu=(n,e)=>n.map(t=>t[e]),ur=n=>Ii(n[0].length).map(e=>Ii(n.length).map(t=>n[t][e])),om=(n,e,t)=>{const r=new Set(Array.isArray(e)?e:[e]);return n.filter((s,i)=>r.has(i)!==t)};function am(n,e=!1){if(n.length===0)throw new Error("Can't calculate median of empty array");const t=e?n:[...n].sort((o,a)=>o>a?1:o<a?-1:0),r=Math.floor(t.length/2);if(t.length%2===1)return t[r];const s=t[r-1],i=t[r];if(typeof s=="bigint"&&typeof i=="bigint")return(s+i)/2n;if(typeof s=="number"&&typeof i=="number")return(s+i)/2;throw new Error("Can't calculate median of array with mixed number and bigint")}function cm(n){return["string","number","symbol","bigint","boolean"].includes(typeof n)}const Nl=n=>n.length===2&&!Array.isArray(n[0])&&Array.isArray(n[1]),Ui=n=>n.length===0?[]:Array.isArray(n[0])?n.map(([e,t])=>Array.isArray(t)?(Nl(t)?Ui(t):t).map(r=>[e,r].flat()):[[e,t]]).flat():Nl(n)?Ui(n[1]).map(e=>[n[0],e]):n,lm=(n,e)=>{const t=Ui(n);if(t.length===0)throw new Error("Invalid mapping: empty");const r=e===void 0?[Ii(t[0].length-1),[t[0].length-1]]:e.map(S=>typeof S=="number"?[S]:S);let s=[],i=!0;const o=(S,A)=>{const g=Array.from(new Set(S[0]).values()),D=new Map(g.map(U=>[U,[]]));for(const[U,R]of S[0].entries())D.get(R).push(U);if(S.length===1){const U=Object.fromEntries(g.map(R=>[R,D.get(R).map(F=>A[F].length===1?A[F][0]:A[F])]));if(i){for(const R of D.values())if(R.length>1)return i=!1,U;s.push(U)}return U}const x=ur(S.slice(1));return Object.fromEntries(g.map(U=>{const R=D.get(U),F=ur(R.map(z=>x[z])),W=R.map(z=>A[z]);return[U,o(F,W)]}))},a=ur(t),l=S=>{const A=a[S];if(A===void 0)throw new Error(`Invalid shape: column ${S} does not exist`);return A},[h,m]=r.map(S=>S.map(A=>l(A)));if(h.length===0)throw new Error("Invalid shape: empty key set");if(m.length===0)throw new Error("Invalid shape: empty value set");for(const S of h)for(const A of S)if(!cm(A))throw new Error(`Invalid key: ${A} in ${S}`);const E=o(h,ur(m));if(i)for(const S of s)for(const A of Object.keys(S))S[A]=S[A][0];return E};function we(n,e){const t=r=>{const s=(...i)=>i.reduce((o,a)=>o?o[a.toString()]??void 0:void 0,r);return Object.assign(s,{has:(...i)=>s(...i)!==void 0,get:(...i)=>s(...i),subMap:i=>t(r[i.toString()])})};return t(lm(n,e))}function xc(n){let e=null;return()=>(e||(e=n()),e)}function dm(n){try{return n(),!1}catch{return!0}}function um(n,e,t){return n<e?e:n>t?t:n}var fm=["int","uint","bytes","array","switch"],xu="big",Zi=6,Ar=n=>typeof n=="number"||typeof n=="bigint",Jr=n=>n instanceof Uint8Array,hm=n=>Ar(n)||Jr(n),Ds=n=>fm.includes(n==null?void 0:n.binary),mm=n=>Ds(n)||Array.isArray(n)&&n.every(Ds),bm=n=>typeof(n==null?void 0:n.from)=="number",pm=n=>typeof(n==null?void 0:n.from)=="bigint",gm=n=>bm(n)||pm(n),Qr=n=>Jr(n==null?void 0:n.from),ym=n=>gm(n)||Qr(n),Cu=(n,e)=>{if(n!==e)throw new Error(`size mismatch: layout size: ${n}, data size: ${e}`);return e},bi=(n,e)=>"size"in n&&n.size!==void 0?Cu(n.size,e):e,_a=(n,e)=>{if(n!=e)throw new Error(`value mismatch: (constant) layout value: ${n}, data value: ${e}`)},Ma=(n,e,t)=>{const r=(h,m)=>m===void 0?[0,h.length]:Array.isArray(m)?m:[m,h.length],[s,i]=r(n,t==null?void 0:t.customSlice),[o,a]=r(e,t==null?void 0:t.dataSlize),l=i-s;Cu(l,a-o);for(let h=0;h<n.length;++h)if(n[h+s]!==e[h+o])throw new Error(`binary data mismatch: layout value: ${n}, offset: ${s}, data value: ${e}, offset: ${o}`)};function Su(n,e){const t=e[n.idTag??"id"];return n.layouts.find(([r])=>(Array.isArray(r)?r[1]:r)==t)}function Du(n){return sr(n,en)}var en=Symbol("staticCalc");function wm(n,e){const t=[],r=sr(n,e,t);if(r===null)throw new Error(`coding error: couldn't calculate layout size for layout ${n} with data ${e}`);return[r,t]}function zl(n,e,t){const r=s=>(t!==void 0&&t.push(s),s);switch(n.binary){case"int":case"uint":return n.size;case"bytes":{const s="lengthSize"in n?n.lengthSize|0:0;if("layout"in n){const{custom:o}=n,a=sr(n.layout,o===void 0?e:typeof o.from=="function"?e!==en?r(o.from(e)):en:o.from,t);return a===null?"size"in n?n.size??null:null:s+bi(n,a)}const{custom:i}=n;return Jr(i)?s+i.length:Qr(i)?s+i.from.length:i===void 0?e!==en?s+bi(n,e.length):null:e!==en?s+bi(n,r(i.from(e)).length):null}case"array":{const s="length"in n?n.length:void 0;if(e===en){if(s!==void 0){const o=sr(n.layout,en,t);return o!==null?s*o:null}return null}let i=0;if(s!==void 0&&s!==e.length)throw new Error(`array length mismatch: layout length: ${s}, data length: ${e.length}`);"lengthSize"in n&&n.lengthSize!==void 0&&(i+=n.lengthSize);for(let o=0;o<e.length;++o){const a=sr(n.layout,e[o],t);if(a===null)return null;i+=a}return i}case"switch":{if(e!==en){const[i,o]=Su(n,e),a=sr(o,e,t);return a!==null?n.idSize+a:null}let s=null;for(const[i,o]of n.layouts){const a=sr(o,en,t);if(s===null)s=a;else if(a!==s)return null}return n.idSize+s}}}function sr(n,e,t){if(Ds(n))return zl(n,e,t);let r=0;for(const s of n){let i;if(e===en)i=en;else if(!("omit"in s)||!s.omit){if(!(s.name in e))throw new Error(`missing data for layout item: ${s.name}`);i=e[s.name]}const o=zl(s,i,t);if(o===null){if(e!==en)throw new Error(`coding error: couldn't calculate size for layout item: ${s.name}`);return null}r+=o}return r}var ra=(n,e)=>{n.bytes.set(e,n.offset),n.offset+=e.length},Hl=n=>n.bytesConversions[n.position++];function Cn(n,e,t){const[r,s]=wm(n,e),i={bytes:t??new Uint8Array(r),offset:0};if(pi(n,e,i,{bytesConversions:s,position:0}),i.offset!==i.bytes.length)throw new Error(`encoded data is shorter than expected: ${i.bytes.length} > ${i.offset}`);return t?i.offset:i.bytes}var Am=2**(Zi*8);function fr(n,e,t,r=xu,s=!1){if(!s&&n<0)throw new Error(`Value ${n} is negative but unsigned`);if(typeof n=="number"){if(!Number.isInteger(n))throw new Error(`Value ${n} is not an integer`);if(e>Zi){if(n>=Am)throw new Error(`Value ${n} is too large to be safely converted into an integer`);if(s&&n<-281474976710656)throw new Error(`Value ${n} is too small to be safely converted into an integer`)}}const i=2n**BigInt(e*8-(s?1:0));if(n>=i)throw new Error(`Value ${n} is too large for ${e} bytes`);if(s&&n<-i)throw new Error(`Value ${n} is too small for ${e} bytes`);for(let o=0;o<e;++o)t.bytes[t.offset+o]=Number(BigInt(n)>>BigInt(8*(r==="big"?e-o-1:o))&0xffn);t.offset+=e}function pi(n,e,t,r){if(Ds(n))ql(n,e,t,r);else for(const s of n)try{ql(s,e[s.name],t,r)}catch(i){throw i.message=`when serializing item '${s.name}': ${i.message}`,i}}function ql(n,e,t,r){switch(n.binary){case"int":case"uint":{const s=(()=>{var i;return Ar(n.custom)?("omit"in n&&n.omit||_a(n.custom,e),n.custom):Ar((i=n==null?void 0:n.custom)==null?void 0:i.from)?n.custom.from:n.custom!==void 0?n.custom.from(e):e})();fr(s,n.size,t,n.endianness,n.binary==="int");break}case"bytes":{const s=t.offset;if("lengthSize"in n&&n.lengthSize!==void 0&&(t.offset+=n.lengthSize),"layout"in n){const{custom:i}=n;let o;i===void 0?o=e:typeof i.from!="function"?o=i.from:o=Hl(r),pi(n.layout,o,t,r)}else{const{custom:i}=n;Jr(i)?("omit"in n&&n.omit||Ma(i,e),ra(t,i)):Qr(i)?ra(t,i.from):ra(t,i!==void 0?Hl(r):e)}if("lengthSize"in n&&n.lengthSize!==void 0){const i=t.offset-s-n.lengthSize,o=t.offset;t.offset=s,fr(i,n.lengthSize,t,n.lengthEndianness),t.offset=o}else bi(n,t.offset-s);break}case"array":{if("length"in n&&n.length!==e.length)throw new Error(`array length mismatch: layout length: ${n.length}, data length: ${e.length}`);"lengthSize"in n&&n.lengthSize!==void 0&&fr(e.length,n.lengthSize,t,n.lengthEndianness);for(let s=0;s<e.length;++s)pi(n.layout,e[s],t,r);break}case"switch":{const[s,i]=Su(n,e),o=Array.isArray(s)?s[0]:s;fr(o,n.idSize,t,n.idEndianness),pi(i,e,t,r);break}}}function vu(n){const e=n.custom;if(!("cachedSerializedFrom"in e)&&(e.cachedSerializedFrom=Cn(n.layout,e.from),"size"in n&&n.size!==void 0&&n.size!==e.cachedSerializedFrom.length))throw new Error("Layout specification error: custom.from does not serialize to specified size");return e.cachedSerializedFrom}function Sn(n,e,t){const r=t??!0,s={bytes:e,offset:0,end:e.length},i=As(n,s);if(r&&s.offset!==s.end)throw new Error(`encoded data is longer than expected: ${s.end} > ${s.offset}`);return r?i:[i,s.offset]}function gi(n,e){const t=n.offset+e;if(t>n.end)throw new Error(`chunk is shorter than expected: ${n.end} < ${t}`);n.offset=t}function As(n,e){if(!Array.isArray(n))return Kl(n,e);let t={};for(const r of n)try{(r.omit?{}:t)[r.name]=Kl(r,e)}catch(s){throw s.message=`when deserializing item '${r.name}': ${s.message}`,s}return t}function ii(n,e,t=xu,r=!1){let s=0n;for(let i=0;i<e;++i)s|=BigInt(n.bytes[n.offset+i])<<BigInt(8*(t==="big"?e-i-1:i));return r&&n.bytes[n.offset+(t==="big"?0:e-1)]&128&&(s-=1n<<BigInt(8*e)),gi(n,e),e>Zi?s:Number(s)}function Kl(n,e){switch(n.binary){case"int":case"uint":{const t=ii(e,n.size,n.endianness,n.binary==="int"),{custom:r}=n;return Ar(r)?(_a(r,t),r):Ar(r==null?void 0:r.from)?(_a(r.from,t),r.to):r!==void 0?r.to(t):t}case"bytes":{const t="lengthSize"in n&&n.lengthSize!==void 0?ii(e,n.lengthSize,n.lengthEndianness):n==null?void 0:n.size;if("layout"in n){const{custom:a}=n,l=e.offset;let h;if(t===void 0)h=As(n.layout,e);else{const m={...e,end:e.offset+t};if(gi(e,t),h=As(n.layout,m),m.offset!==m.end)throw new Error(`read less data than expected: ${m.offset-e.offset} < ${t}`)}return a!==void 0?typeof a.from!="function"?(Ma(vu(n),e.bytes,{dataSlize:[l,e.offset]}),a.to):a.to(h):h}const{custom:r}=n;{let a,l;if(Jr(r)?a=r:Qr(r)&&(a=r.from,l=r.to),a!==void 0){const h=t??a.length,m=e.bytes.subarray(e.offset,e.offset+h);return Ma(a,m),gi(e,h),l??a}}const s=e.offset,i=t!==void 0?e.offset+t:e.end;gi(e,i-s);const o=e.bytes.subarray(s,i);return r!==void 0?r.to(o):o}case"array":{let t=[];const{layout:r}=n,s=()=>{const o=As(r,e);t.push(o)};let i=null;if("length"in n&&n.length!==void 0?i=n.length:"lengthSize"in n&&n.lengthSize!==void 0&&(i=ii(e,n.lengthSize,n.lengthEndianness)),i!==null)for(let o=0;o<i;++o)s();else for(;e.offset<e.end;)s();return t}case"switch":{const t=ii(e,n.idSize,n.idEndianness),{layouts:r}=n;if(r.length===0)throw new Error("switch item has no layouts");const s=typeof r[0][0]=="number",i=r.find(([h])=>s?h===t:h[0]===t);if(i===void 0)throw new Error(`unknown id value: ${t}`);const[o,a]=i,l=As(a,e);return{[n.idTag??"id"]:s?t:o[1],...l}}}}function Em(n,e){return yi(n,e)}function jl(n,e){switch(n.binary){case"bytes":if("layout"in n){const{custom:t}=n;return t===void 0||typeof t.from!="function"?yi(n.layout,t?t.from:e):e}case"int":case"uint":{const{custom:t}=n;return n!=null&&n.omit?void 0:hm(t)?t:ym(t)?t.to:e}case"array":return Array.isArray(e)?e.map(t=>yi(n.layout,t)):void 0;case"switch":{const t=e[n.idTag??"id"],[r,s]=n.layouts.find(([i])=>(Array.isArray(i)?i[1]:i)==t);return{[n.idTag??"id"]:t,...yi(s,e)}}}}function yi(n,e){if(e=e??{},Ds(n))return jl(n,e);const t={};for(const r of n){const s=jl(r,e[r.name]??{});s!==void 0&&(t[r.name]=s)}return t}function Bm(n,e){const[t,r]=Cm(n);if(!t)throw new Error("Cannot uniquely distinguished the given layouts");return s=>{const i=r(s);return i.length===0?null:i[0]}}function Ra(n){return n.reduce((e,t)=>e|BigInt(1)<<BigInt(t),BigInt(0))}function oi(n){const e=[];for(let t=0n;n>0n;n>>=1n,++t)n&1n&&e.push(Number(t));return e}function Et(n){let e=0;for(;n>0n;n>>=1n)e+=Number(n&1n);return e}var $l=n=>n>0?2**(8*n)-1:1/0;function Vl(n,e,t){var r;switch(n.binary){case"int":case"uint":{const s=Ar(n.custom)?n.custom:Ar((r=n==null?void 0:n.custom)==null?void 0:r.from)?n.custom.from:null;if(s!==null&&e!==null){const i={bytes:new Uint8Array(n.size),offset:0};fr(s,n.size,i,n.endianness,n.binary==="int"),t.push([e,i.bytes])}return[n.size,n.size]}case"bytes":{const s="lengthSize"in n?n.lengthSize|0:0;let i,o;if("layout"in n){const{custom:l}=n;if(l!==void 0&&typeof l.from!="function")i=vu(n),o=i.length;else{const h=Du(n.layout);h!==null&&(o=h)}}else{const{custom:l}=n;Jr(l)?(i=l,o=l.length):Qr(l)&&(i=l.from,o=l.from.length)}if(s>0&&e!==null){if(o!==void 0){const l={bytes:new Uint8Array(s),offset:0},h=n.lengthEndianness;fr(o,s,l,h,!1),t.push([e,l.bytes])}e+=s}if(i!==void 0)return e!==null&&t.push([e,i]),[s+i.length,s+i.length];const a="size"in n&&n.size!==void 0?[n.size,n.size]:void 0;if("layout"in n){const l=wi(n.layout,e,t);return a??[s+l[0],s+l[1]]}return a??[s,$l(s)]}case"array":{if("length"in n){let i=[];const o=wi(n.layout,0,i);if(e!==null)if(o[0]!==o[1]){if(n.length>0)for(const[a,l]of i)t.push([e+a,l])}else for(let a=0;a<n.length;++a)for(const[l,h]of i)t.push([e+l+a*o[0],h]);return[n.length*o[0],n.length*o[1]]}const s=n.lengthSize|0;return[s,$l(s)]}case"switch":{const s=n.layouts.map(l=>[]),{idSize:i,idEndianness:o}=n,a=n.layouts.map(([l,h],m)=>{const E=Array.isArray(l)?l[0]:l;if(e!==null){const A={bytes:new Uint8Array(i),offset:0};fr(E,i,A,o),s[m].push([0,A.bytes])}const S=wi(h,e!==null?i:null,s[m]);return[S[0]+i,S[1]+i]});return e!==null&&s.every(l=>l.length>0)&&(()=>{const l=Math.min(...s.map(m=>m.at(-1)[0]+m.at(-1)[1].length)),h=s.map(m=>0);for(let m=0;m<l;){let E=null,S=0;for(;S<s.length;){let A=h[S];const g=s[S],[D,x]=g[A];if(D+x.length<=m){if(++A,A===g.length)return;h[S]=A,m=g[A][0];break}const U=x[m-D];if(E===null&&(E=U),U!==E){++m;break}++S}S===s.length&&(t.push([e+m,new Uint8Array([E])]),++m)}})(),[Math.min(...a.map(([l])=>l)),Math.max(...a.map(([l,h])=>h))]}}}function wi(n,e,t){if(!Array.isArray(n))return Vl(n,e,t);let r=[0,0];for(const s of n){const i=Vl(s,e,t);r[0]+=i[0],r[1]+=i[1],e!==null&&(e=i[0]===i[1]?e+i[0]:null)}return r}function xm(n){const e=new Map;let t=[];const r=s=>{for(;t.length>0&&t[0][0]<s;){const i=t[0][0]+1,o=t.findIndex(([a])=>i<=a);o===-1?t=[]:t.splice(0,o),e.set(i,Ra(t.map(([,a])=>a)))}};for(const[[s,i],o]of n){r(s);const a=t.findIndex(([l])=>l>i);a===-1?t.push([i,o]):t.splice(a,0,[i,o]),e.set(s,Ra(t.map(([,l])=>l)))}return r(1/0),e}function Cm(n){if(n.length===0)throw new Error("Cannot discriminate empty set of layouts");const e=0n,t=(1n<<BigInt(n.length))-1n,r=n.map(()=>[]),s=n.map((F,W)=>wi(F,0,r[W])),i=s.map((F,W)=>[F,W]).sort(([[F]],[[W]])=>F-W),o=(()=>{let F=t;const W=new Map;for(const[[z],H]of i)F^=1n<<BigInt(H),W.set(z,F);return W})(),a=xm(i),l=n.length-Math.max(...[...a.values()].map(F=>Et(F))),h=F=>{let W=t;for(const[z,H]of o){if(F<z)break;W=H}return W},m=F=>{let W=e;for(const[z,H]of a){if(F<z)break;W=H}return W},E=Array.from({length:Math.max(...r.map(F=>F.length>0?F.at(-1)[0]+F.at(-1)[1].length:0))}).map(()=>[]);for(let F=0;F<r.length;++F)for(const[W,z]of r[F])for(let H=0;H<z.length;++H)E[W+H].push([z[H],F]);let S=[];for(const[F,W]of E.entries()){const z=h(F),H=z^Ra(W.map(([,ie])=>ie)),K=t^z,G=new Map;for(const[ie,ne]of W)G.has(ie)||G.set(ie,e),G.set(ie,G.get(ie)|1n<<BigInt(ne));let V=n.length-Math.max(Et(H),Et(K));for(const ie of G.values()){const ne=W.length-Et(ie)+Et(K);V=Math.min(V,ne)}if(V!==0){if(V===n.length-1)return[!0,ie=>oi(ie.length<=F?K:G.get(ie[F])??e)];S.push([V,F,K,G,H])}}if(l===n.length-1)return[!0,F=>oi(m(F.length))];S.sort(([F],[W])=>W-F);let A=!0;const g=new Map,D=new Map,x=(F,W)=>{g.set(F,W),D.has(Et(F))||D.set(Et(F),[]),D.get(Et(F)).push(F)},U=(F,W)=>{if(Et(F)<=1||g.has(F))return;let z=0;const H=new Map;for(const G of oi(F)){const V=s[G][0],ie=a.get(V)&F;H.set(V,ie),z=Math.max(z,Et(ie))}z=Et(F)-z;const K=[];for(const[G,V,ie,ne,ae]of W){const I=new Map;let c=0;for(const[y,C]of ne){const T=C&F;Et(T)>0&&(I.set(y,T),c+=Et(T))}const b=ie&F;let p=I.size>0?G:0;for(const y of I.values()){const C=c-Et(y)+Et(b);p=Math.min(p,C)}if(p!==0){if(p===Et(F)-1){x(F,[V,b,I]);return}K.push([p,V,b,I,ae&F])}}if(z===Et(F)-1){x(F,"size");return}if(K.sort(([G],[V])=>V-G),K.length>0&&K[0][0]>=z){const[,G,V,ie,ne]=K[0];x(F,[G,V,ie]),U(V,K);for(const ae of ie.values())U(ae|ne,K.slice(1));return}if(z>0){x(F,"size");for(const G of H.values())U(G,K);return}x(F,"indistinguishable"),A=!1};U(t,S);const R=F=>{for(let W=Et(F)+1;W<n.length-2;++W)for(const z of D.get(W)??[])if((F&z)==F)return g.get(z);throw new Error("Implementation error in layout discrimination algorithm")};return[A,F=>{let W=t,z=g.get(W);for(;z!=="indistinguishable";){if(z==="size")W&=m(F.length);else{const[H,K,G]=z;if(F.length<=H)W&=K;else{const V=F[H];for(const[ie,ne]of G)ie!==V&&(W^=W&ne);W^=W&K}}if(Et(W)<=1)break;z=g.get(W)??R(W)}return oi(W)}]}var Ji=(n,e)=>({...n,binary:"bytes",...e===void 0?{}:mm(e)?{layout:e}:e instanceof Uint8Array||Qr(e)||!Array.isArray(e)?{custom:e}:{layout:e[0],custom:e[1]}});function Sm(n,e){const t=Object.fromEntries(n.map(([s,i])=>[i,s])),r=Object.fromEntries(n);return{binary:"uint",size:(e==null?void 0:e.size)??1,endianness:(e==null?void 0:e.endianness)??"big",custom:{to:s=>{const i=t[s];if(i===void 0)throw new Error(`Invalid enum value: ${s}`);return i},from:s=>r[s]}}}function Dm(n,e){return{binary:"uint",size:Math.ceil(n.length/8),custom:{to:t=>{const r={};for(let s=0;s<n.length;++s)n[s]&&(r[n[s]]=(BigInt(t)&1n<<BigInt(s))!==0n);return r},from:t=>{let r=0n;for(let s=0;s<n.length;++s)n[s]&&t[n[s]]&&(r|=1n<<BigInt(s));return n.length>Zi?r:Number(r)}}}}function vm(n,e){return Number(Number(n).toFixed(e))}function Ai(n,e){if(km(n,e),n=n.toString(),n.includes("e"))throw new Error("Scientific notation is not supported yet by Amount");const t=n.split(".");if(t.length>2)throw"Too many decimals";let[r,s]=t.length===0?["0",""]:t.length===1?[t[0],""]:t;if(s=s.padEnd(e,"0"),s.length>e){if(BigInt(s.substring(e))!==0n)throw new Error("Amount: invalid input. Decimals too low.");s=s.substring(0,e)}return{amount:BigInt(r+s).toString(),decimals:e}}function Ei(n,e){if(n.decimals<=e)return n;const t=BigInt(n.decimals-e);return{amount:(gn(n)/10n**t*10n**t).toString(),decimals:n.decimals}}function Es(n,e){if(n.decimals===e)return n;if(n.amount==="0")return{amount:n.amount,decimals:e};const t=e-n.decimals;if(t>0)return{amount:n.amount+"0".repeat(t),decimals:e};if(BigInt(n.amount.substring(n.amount.length+t))===0n)return{amount:n.amount.substring(0,n.amount.length+t),decimals:e};throw new Error(`scaleAmount(${JSON.stringify(n)}, ${e}) would result in altered amount. Use truncateAmount first if you intended to truncate it.`)}function qr(n,e){return{amount:n.toString(),decimals:e}}function gn(n){return ku(n),BigInt(n.amount)}function Cc(n,e){ku(n);let t=n.amount.substring(0,n.amount.length-n.decimals).padStart(1,"0"),r=n.amount.substring(n.amount.length-n.decimals).padStart(n.decimals,"0");if(e!==void 0){for(;r.length>e&&r[r.length-1]==="0";)r=r.substring(0,r.length-1);r=r.padEnd(e,"0")}else r=r.replace(/0+$/,"");return r.length>0?`${t}.${r}`:t}function Bs(n){return Number(Cc(n))}function Gl(n,e){return Cc(qr(n,e))}function km(n,e){if(typeof n=="number"){if(!isFinite(n))throw new Error("Amount: invalid input. Amount must be finite");if(n<0)throw new Error("Amount: invalid input. Amount cannot be negative")}else if(!/^[0-9\.]*$/.test(n))throw new Error("Amount: invalid input. Must only contain digits.");if(!isFinite(e))throw new Error("Amount: invalid input. Decimals must be finite")}function ku(n){if(!/^[0-9]*$/.test(n.amount))throw new Error("Amount: invalid input. Must only contain digits.");if(n.decimals<0)throw new Error("Amount: invalid input. Decimals must be >= 0");if(!isFinite(n.decimals))throw new Error("Amount: invalid input. Decimals must be a finite number.")}const vs=(n=0,e=0,t=0)=>new Date(Date.now()+(n*60*60+e*60+t)*1e3);/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */function ks(n){return n instanceof Uint8Array||ArrayBuffer.isView(n)&&n.constructor.name==="Uint8Array"}function Fu(n,e){return Array.isArray(e)?e.length===0?!0:n?e.every(t=>typeof t=="string"):e.every(t=>Number.isSafeInteger(t)):!1}function Tu(n){if(typeof n!="function")throw new Error("function expected");return!0}function jr(n,e){if(typeof e!="string")throw new Error(`${n}: string expected`);return!0}function es(n){if(!Number.isSafeInteger(n))throw new Error(`invalid integer: ${n}`)}function _i(n){if(!Array.isArray(n))throw new Error("array expected")}function Mi(n,e){if(!Fu(!0,e))throw new Error(`${n}: array of strings expected`)}function Sc(n,e){if(!Fu(!1,e))throw new Error(`${n}: array of numbers expected`)}function Vs(...n){const e=i=>i,t=(i,o)=>a=>i(o(a)),r=n.map(i=>i.encode).reduceRight(t,e),s=n.map(i=>i.decode).reduce(t,e);return{encode:r,decode:s}}function Qi(n){const e=typeof n=="string"?n.split(""):n,t=e.length;Mi("alphabet",e);const r=new Map(e.map((s,i)=>[s,i]));return{encode:s=>(_i(s),s.map(i=>{if(!Number.isSafeInteger(i)||i<0||i>=t)throw new Error(`alphabet.encode: digit index outside alphabet "${i}". Allowed: ${n}`);return e[i]})),decode:s=>(_i(s),s.map(i=>{jr("alphabet.decode",i);const o=r.get(i);if(o===void 0)throw new Error(`Unknown letter: "${i}". Allowed: ${n}`);return o}))}}function eo(n=""){return jr("join",n),{encode:e=>(Mi("join.decode",e),e.join(n)),decode:e=>(jr("join.decode",e),e.split(n))}}function Fm(n,e="="){return es(n),jr("padding",e),{encode(t){for(Mi("padding.encode",t);t.length*n%8;)t.push(e);return t},decode(t){Mi("padding.decode",t);let r=t.length;if(r*n%8)throw new Error("padding: invalid, string should have whole number of bytes");for(;r>0&&t[r-1]===e;r--)if((r-1)*n%8===0)throw new Error("padding: invalid, string has too much padding");return t.slice(0,r)}}}function Yl(n,e,t){if(e<2)throw new Error(`convertRadix: invalid from=${e}, base cannot be less than 2`);if(t<2)throw new Error(`convertRadix: invalid to=${t}, base cannot be less than 2`);if(_i(n),!n.length)return[];let r=0;const s=[],i=Array.from(n,a=>{if(es(a),a<0||a>=e)throw new Error(`invalid integer: ${a}`);return a}),o=i.length;for(;;){let a=0,l=!0;for(let h=r;h<o;h++){const m=i[h],E=e*a,S=E+m;if(!Number.isSafeInteger(S)||E/e!==a||S-m!==E)throw new Error("convertRadix: carry overflow");const A=S/t;a=S%t;const g=Math.floor(A);if(i[h]=g,!Number.isSafeInteger(g)||g*t+a!==S)throw new Error("convertRadix: carry overflow");if(l)g?l=!1:r=h;else continue}if(s.push(a),l)break}for(let a=0;a<n.length-1&&n[a]===0;a++)s.push(0);return s.reverse()}const Iu=(n,e)=>e===0?n:Iu(e,n%e),Ri=(n,e)=>n+(e-Iu(n,e)),Bi=(()=>{let n=[];for(let e=0;e<40;e++)n.push(2**e);return n})();function Wa(n,e,t,r){if(_i(n),e<=0||e>32)throw new Error(`convertRadix2: wrong from=${e}`);if(t<=0||t>32)throw new Error(`convertRadix2: wrong to=${t}`);if(Ri(e,t)>32)throw new Error(`convertRadix2: carry overflow from=${e} to=${t} carryBits=${Ri(e,t)}`);let s=0,i=0;const o=Bi[e],a=Bi[t]-1,l=[];for(const h of n){if(es(h),h>=o)throw new Error(`convertRadix2: invalid data word=${h} from=${e}`);if(s=s<<e|h,i+e>32)throw new Error(`convertRadix2: carry overflow pos=${i} from=${e}`);for(i+=e;i>=t;i-=t)l.push((s>>i-t&a)>>>0);const m=Bi[i];if(m===void 0)throw new Error("invalid carry");s&=m-1}if(s=s<<t-i&a,!r&&i>=e)throw new Error("Excess padding");if(!r&&s>0)throw new Error(`Non-zero padding: ${s}`);return r&&i>0&&l.push(s>>>0),l}function Tm(n){es(n);const e=2**8;return{encode:t=>{if(!ks(t))throw new Error("radix.encode input should be Uint8Array");return Yl(Array.from(t),e,n)},decode:t=>(Sc("radix.decode",t),Uint8Array.from(Yl(t,n,e)))}}function Dc(n,e=!1){if(es(n),n<=0||n>32)throw new Error("radix2: bits should be in (0..32]");if(Ri(8,n)>32||Ri(n,8)>32)throw new Error("radix2: carry overflow");return{encode:t=>{if(!ks(t))throw new Error("radix2.encode input should be Uint8Array");return Wa(Array.from(t),8,n,!e)},decode:t=>(Sc("radix2.decode",t),Uint8Array.from(Wa(t,n,8,e)))}}function Xl(n){return Tu(n),function(...e){try{return n.apply(null,e)}catch{}}}function Im(n,e){return es(n),Tu(e),{encode(t){if(!ks(t))throw new Error("checksum.encode: input should be Uint8Array");const r=e(t).slice(0,n),s=new Uint8Array(t.length+n);return s.set(t),s.set(r,t.length),s},decode(t){if(!ks(t))throw new Error("checksum.decode: input should be Uint8Array");const r=t.slice(0,-n),s=t.slice(-n),i=e(r).slice(0,n);for(let o=0;o<n;o++)if(i[o]!==s[o])throw new Error("Invalid checksum");return r}}}const Zl=Vs(Dc(4),Qi("0123456789ABCDEF"),eo("")),Jl=Vs(Dc(6),Qi("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),Fm(6),eo("")),Um=n=>Vs(Tm(58),Qi(n),eo("")),Pa=Um("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),_m=n=>Vs(Im(4,e=>n(n(e))),Pa),La=Vs(Qi("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),eo("")),Ql=[996825010,642813549,513874426,1027748829,705979059];function bs(n){const e=n>>25;let t=(n&33554431)<<5;for(let r=0;r<Ql.length;r++)(e>>r&1)===1&&(t^=Ql[r]);return t}function ed(n,e,t=1){const r=n.length;let s=1;for(let i=0;i<r;i++){const o=n.charCodeAt(i);if(o<33||o>126)throw new Error(`Invalid prefix (${n})`);s=bs(s)^o>>5}s=bs(s);for(let i=0;i<r;i++)s=bs(s)^n.charCodeAt(i)&31;for(let i of e)s=bs(s)^i;for(let i=0;i<6;i++)s=bs(s);return s^=t,La.encode(Wa([s%Bi[30]],30,5,!1))}function Mm(n){const e=n==="bech32"?1:734539939,t=Dc(5),r=t.decode,s=t.encode,i=Xl(r);function o(E,S,A=90){jr("bech32.encode prefix",E),ks(S)&&(S=Array.from(S)),Sc("bech32.encode",S);const g=E.length;if(g===0)throw new TypeError(`Invalid prefix length ${g}`);const D=g+7+S.length;if(A!==!1&&D>A)throw new TypeError(`Length ${D} exceeds limit ${A}`);const x=E.toLowerCase(),U=ed(x,S,e);return`${x}1${La.encode(S)}${U}`}function a(E,S=90){jr("bech32.decode input",E);const A=E.length;if(A<8||S!==!1&&A>S)throw new TypeError(`invalid string length: ${A} (${E}). Expected (8..${S})`);const g=E.toLowerCase();if(E!==g&&E!==E.toUpperCase())throw new Error("String must be lowercase or uppercase");const D=g.lastIndexOf("1");if(D===0||D===-1)throw new Error('Letter "1" must be present between prefix and data only');const x=g.slice(0,D),U=g.slice(D+1);if(U.length<6)throw new Error("Data must be at least 6 characters long");const R=La.decode(U).slice(0,-6),F=ed(x,R,e);if(!U.endsWith(F))throw new Error(`Invalid checksum in ${E}: expected "${F}"`);return{prefix:x,words:R}}const l=Xl(a);function h(E){const{prefix:S,words:A}=a(E,!1);return{prefix:S,words:A,bytes:r(A)}}function m(E,S){return o(E,s(S))}return{encode:o,decode:a,encodeFromBytes:m,decodeToBytes:h,decodeUnsafe:l,fromWords:r,fromWordsUnsafe:i,toWords:s}}const Uu=Mm("bech32"),_u=(n,e)=>e.startsWith(n)?e.slice(n.length):e,Rm=/^(?:0x)?[0-9a-fA-F]+$/,_t={valid:n=>Rm.test(n),decode:n=>Zl.decode(_u("0x",n).toUpperCase()),encode:(n,e=!1)=>(n=typeof n=="string"?zt.encode(n):n,(e?"0x":"")+Zl.encode(n).toLowerCase())},Wm=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,to={valid:n=>Wm.test(n),decode:Jl.decode,encode:n=>Jl.encode(typeof n=="string"?zt.encode(n):n)},Mu={decode:Pa.decode,encode:n=>Pa.encode(typeof n=="string"?zt.encode(n):n)},xs={decode:n=>(typeof n!="string"&&(n=_t.encode(n,!0)),n===""||n==="0x"?0n:BigInt(n)),encode:(n,e=!1)=>xs.toString(n,e),toString:(n,e=!1)=>{let t=n.toString(16);return t=t.length%2===1?t="0"+t:t,e?"0x"+t:t},toBytes:(n,e)=>{typeof n=="number"&&(n=xs.toBigInt(n));const t=_t.decode(xs.toString(n));if(!e)return t;if(e<t.length)throw new Error(`Can't fit ${n} into ${e} bytes.`);return zt.zpad(t,e)},toNumber:n=>{if(n>BigInt(Number.MAX_SAFE_INTEGER))throw new Error(`Invalid cast: ${n} exceeds MAX_SAFE_INTEGER`);return Number(n)},toBigInt:n=>{if(n>Number.MAX_SAFE_INTEGER)throw new Error(`Invalid cast: ${n} exceeds MAX_SAFE_INTEGER`);return BigInt(n)}},zt={encode:n=>new TextEncoder().encode(n),decode:n=>new TextDecoder().decode(n),equals:(n,e)=>n.length===e.length&&n.every((t,r)=>t===e[r]),zpad:(n,e,t=!0)=>t?zt.concat(new Uint8Array(e-n.length),n):zt.concat(n,new Uint8Array(e-n.length)),concat:(...n)=>{const e=n.reduce((s,i)=>s+i.length,0),t=new Uint8Array(e);let r=0;return n.forEach(s=>{t.set(s,r),r+=s.length}),t}},vc=[[1,"Solana"],[2,"Ethereum"],[3,"Terra"],[4,"Bsc"],[5,"Polygon"],[6,"Avalanche"],[7,"Oasis"],[8,"Algorand"],[9,"Aurora"],[10,"Fantom"],[11,"Karura"],[12,"Acala"],[13,"Klaytn"],[14,"Celo"],[15,"Near"],[16,"Moonbeam"],[17,"Neon"],[18,"Terra2"],[19,"Injective"],[20,"Osmosis"],[21,"Sui"],[22,"Aptos"],[23,"Arbitrum"],[24,"Optimism"],[25,"Gnosis"],[26,"Pythnet"],[28,"Xpla"],[29,"Btc"],[30,"Base"],[32,"Sei"],[34,"Scroll"],[35,"Mantle"],[36,"Blast"],[37,"Xlayer"],[38,"Linea"],[39,"Berachain"],[40,"Seievm"],[43,"Snaxchain"],[44,"Unichain"],[45,"Worldchain"],[46,"Ink"],[47,"HyperEVM"],[48,"Monad"],[50,"Mezo"],[3104,"Wormchain"],[4e3,"Cosmoshub"],[4001,"Evmos"],[4002,"Kujira"],[4003,"Neutron"],[4004,"Celestia"],[4005,"Stargaze"],[4006,"Seda"],[4007,"Dymension"],[4008,"Provenance"],[4009,"Noble"],[10002,"Sepolia"],[10003,"ArbitrumSepolia"],[10004,"BaseSepolia"],[10005,"OptimismSepolia"],[10006,"Holesky"],[10007,"PolygonSepolia"]],[v6,Ru]=ur(vc),no=we(vc,[1,0]),Wi=we(vc),ro=n=>no.has(n),Oa=n=>Wi.has(n),Gs=n=>{switch(typeof n){case"string":if(ro(n))return no(n);break;case"number":if(Oa(n))return n;break}throw Error(`Cannot convert to ChainId: ${n}`)},ts=n=>{switch(typeof n){case"string":if(ro(n))return n;break;case"number":if(Oa(n))return Wi(n);break;case"bigint":if(Oa(Number(n)))return Wi.get(Number(n));break}throw Error(`Cannot convert to Chain: ${n}`)},kc=[["Evm",["Acala","Arbitrum","Aurora","Avalanche","Base","Bsc","Celo","Ethereum","Fantom","Gnosis","Karura","Klaytn","Moonbeam","Neon","Oasis","Optimism","Polygon","Sepolia","ArbitrumSepolia","BaseSepolia","OptimismSepolia","Holesky","PolygonSepolia","Mantle","Scroll","Blast","Xlayer","Linea","Berachain","Seievm","Snaxchain","Unichain","Worldchain","Ink","HyperEVM","Monad","Mezo"]],["Solana",["Solana","Pythnet"]],["Cosmwasm",["Cosmoshub","Evmos","Injective","Kujira","Osmosis","Sei","Terra","Terra2","Wormchain","Xpla","Dymension","Neutron","Stargaze","Celestia","Seda","Provenance","Noble"]],["Btc",["Btc"]],["Algorand",["Algorand"]],["Sui",["Sui"]],["Aptos",["Aptos"]],["Near",["Near"]]];Bu(kc,0);const Wu=we(kc),ns=we(kc,[1,0]),Pm=[["Evm","hex"],["Solana","base58"],["Cosmwasm","bech32"],["Btc","bech32"],["Algorand","algorandAppId"],["Sui","hex"],["Aptos","hex"],["Near","sha256"]],Lm=we(Pm),rs={byAddress:(n,e)=>Object.values(n).find(t=>Pu(t.address,e)),native:n=>rs.byAddress(n,"native"),bySymbol:(n,e)=>{const t=Object.values(n).filter(r=>r.symbol===e);return t&&t.length>0?t:void 0},byKey:(n,e)=>{const t=Object.entries(n).find(([r])=>e===r);return t?t[1]:void 0}},Pu=(n,e)=>n.toLowerCase()===e.toLowerCase();var td;(function(n){n[n.Finalized=1]="Finalized",n[n.Immediate=200]="Immediate",n[n.Safe=201]="Safe"})(td||(td={}));const Om=[["Ethereum",32]];we(Om);const Nm=[["Solana",32],["Ethereum",72],["Bsc",15],["Optimism",512],["Base",512],["Arbitrum",4096],["Blast",512],["Xlayer",300],["Scroll",300],["Mantle",512],["Worldchain",512],["Polygon",32],["Fantom",1],["Celo",1],["Moonbeam",1],["Karura",1],["Acala",1],["Oasis",1],["Avalanche",0],["Sui",0],["Algorand",0],["Aptos",0],["Klaytn",0],["Sei",0],["Near",0],["Osmosis",0],["Terra",0],["Terra2",0],["Xpla",0],["Injective",0],["Berachain",1],["Seievm",1],["Snaxchain",512],["Unichain",1024],["Ink",512],["HyperEVM",1],["Monad",1],["Mezo",1],["Cosmoshub",0],["Evmos",0],["Kujira",0],["Neutron",0],["Celestia",0],["Stargaze",0],["Dymension",0],["Provenance",0],["Noble",0],["Sepolia",72],["ArbitrumSepolia",4096],["BaseSepolia",512],["OptimismSepolia",512],["PolygonSepolia",32]],Lu=we(Nm),zm=[["Acala",12e3],["Algorand",3300],["Aptos",4e3],["Arbitrum",260],["ArbitrumSepolia",260],["Aurora",3e3],["Avalanche",2e3],["Base",2e3],["BaseSepolia",2e3],["Blast",2e3],["Bsc",3e3],["Celo",5e3],["Cosmoshub",5e3],["Ethereum",15e3],["Evmos",2e3],["Fantom",2500],["Gnosis",5e3],["Holesky",15e3],["Injective",2500],["Karura",12e3],["Klaytn",1e3],["Kujira",3e3],["Mantle",2e3],["Moonbeam",12e3],["Monad",1e3],["Near",1500],["Neon",3e4],["Oasis",6e3],["Optimism",2e3],["OptimismSepolia",2e3],["Osmosis",6e3],["Polygon",2e3],["PolygonSepolia",2e3],["Scroll",3e3],["Sei",400],["Sepolia",15e3],["Solana",400],["Sui",3e3],["Terra",6e3],["Terra2",6e3],["Unichain",1e3],["Xpla",5e3],["Xlayer",3e3],["Worldchain",2e3],["Ink",1e3],["Wormchain",5e3],["Btc",6e5],["Pythnet",400],["Dymension",5e3],["Celestia",5e3],["Neutron",5e3],["Stargaze",5e3],["Seda",7500],["Berachain",2e3],["Mezo",4e3]],Ou=we(zm);function Fc(n){const e=Lu.get(n);if(e===void 0)throw new Error("Cannot find finality for "+n);const t=Ou.get(n);if(t===void 0)throw new Error("Cannot find block time for "+n);return e*t}const Hm=[["Evm",18],["Solana",9],["Sui",9],["Aptos",8],["Cosmwasm",6],["Algorand",6],["Btc",8],["Near",12]],Nu=we(Hm),qm=[["Mainnet",[["Ethereum",{name:"Etherscan",baseUrl:"https://etherscan.io/",endpoints:{tx:"tx/",account:"address/"}}],["Solana",{name:"Solana Explorer",baseUrl:"https://explorer.solana.com/",endpoints:{tx:"tx/",account:"address/"}}],["Polygon",{name:"PolygonScan",baseUrl:"https://polygonscan.com/",endpoints:{tx:"tx/",account:"address/"}}],["Bsc",{name:"BscScan",baseUrl:"https://bscscan.com/",endpoints:{tx:"tx/",account:"address/"}}],["Avalanche",{name:"Snowtrace",baseUrl:"https://snowtrace.io/",endpoints:{tx:"tx/",account:"address/"}}],["Fantom",{name:"FTMscan",baseUrl:"https://ftmscan.com/",endpoints:{tx:"tx/",account:"address/"}}],["Celo",{name:"Celo Explorer",baseUrl:"https://explorer.celo.org/mainnet/",endpoints:{tx:"tx/",account:"address/"}}],["Moonbeam",{name:"Moonscan",baseUrl:"https://moonscan.io/",endpoints:{tx:"tx/",account:"address/"}}],["Sui",{name:"Sui Explorer",baseUrl:"https://explorer.sui.io/",endpoints:{tx:"txblock/",account:"address/"}}],["Aptos",{name:"Aptos Explorer",baseUrl:"https://explorer.aptoslabs.com/",endpoints:{tx:"txn/",account:"account/"}}],["Sei",{name:"Sei Explorer",baseUrl:"https://sei.explorers.guru/",endpoints:{tx:"transaction/",account:"address/"}}],["Karura",{name:"Karura Explorer",baseUrl:"https://blockscout.karura.network/",endpoints:{tx:"tx/",account:"address/"}}],["Acala",{name:"Acala Explorer",baseUrl:"https://blockscout.acala.network/",endpoints:{tx:"tx/",account:"address/"}}]]],["Testnet",[["Ethereum",{name:"Etherscan",baseUrl:"https://goerli.etherscan.io/",endpoints:{tx:"tx/",account:"address/"}}],["Polygon",{name:"PolygonScan",baseUrl:"https://mumbai.polygonscan.com/",endpoints:{tx:"tx/",account:"address/"}}],["Bsc",{name:"BscScan",baseUrl:"https://testnet.bscscan.com/",endpoints:{tx:"tx/",account:"address/"}}],["Avalanche",{name:"Snowtrace",baseUrl:"https://testnet.snowtrace.io/",endpoints:{tx:"tx/",account:"address/"}}],["Fantom",{name:"FTMscan",baseUrl:"https://testnet.ftmscan.com/",endpoints:{tx:"tx/",account:"address/"}}],["Celo",{name:"Celo Explorer",baseUrl:"https://explorer.celo.org/alfajores/",endpoints:{tx:"tx/",account:"address/"}}],["Moonbeam",{name:"Moonscan",baseUrl:"https://moonbase.moonscan.io/",endpoints:{tx:"tx/",account:"address/"}}],["Solana",{name:"Solana Explorer",baseUrl:"https://explorer.solana.com/",endpoints:{tx:"tx/",account:"address/"},networkQuery:{default:"Devnet",Testnet:"?cluster=testnet",Devnet:"?cluster=devnet"}}],["Sui",{name:"Sui Explorer",baseUrl:"https://explorer.sui.io/",endpoints:{tx:"txblock/",account:"address/"},networkQuery:{default:"Testnet",Testnet:"?network=testnet",Devnet:"?network=devnet"}}],["Aptos",{name:"Aptos Explorer",baseUrl:"https://explorer.aptoslabs.com/",endpoints:{tx:"txn/",account:"account/"},networkQuery:{default:"Testnet",Testnet:"?network=testnet",Devnet:"?network=devnet"}}],["Sei",{name:"Sei Explorer",baseUrl:"https://sei.explorers.guru/",endpoints:{tx:"transaction/",account:"address/"}}],["Karura",{name:"Karura Explorer",baseUrl:"https://blockscout.karura-testnet.aca-staging.network/",endpoints:{tx:"tx/",account:"address/"}}],["Acala",{name:"Acala Explorer",baseUrl:"https://blockscout.acala-dev.aca-dev.network/",endpoints:{tx:"tx/",account:"address/"}}]]]],Km=we(qm),jm=(n,e)=>n==="Devnet"?void 0:Km.get(n,e),$m=[["Mainnet",[["Ethereum","https://ethereum-rpc.publicnode.com"],["Solana","https://api.mainnet-beta.solana.com"],["Polygon","https://polygon-bor-rpc.publicnode.com"],["Bsc","https://bsc-rpc.publicnode.com"],["Avalanche","https://avalanche-c-chain-rpc.publicnode.com"],["Fantom","https://rpcapi.fantom.network"],["Celo","https://celo-rpc.publicnode.com"],["Moonbeam","https://moonbeam-rpc.publicnode.com"],["Sui","https://rpc.mainnet.sui.io"],["Aptos","https://fullnode.mainnet.aptoslabs.com/v1"],["Arbitrum","https://arb1.arbitrum.io/rpc"],["Optimism","https://mainnet.optimism.io"],["Base","https://mainnet.base.org"],["Osmosis","https://osmosis-rpc.polkachu.com"],["Cosmoshub","https://cosmos-rpc.publicnode.com:443"],["Evmos","https://evmos-rpc.polkachu.com"],["Injective","https://sentry.tm.injective.network"],["Wormchain","https://wormchain-rpc.quickapi.com"],["Xpla","https://dimension-rpc.xpla.dev"],["Sei","https://sei-rpc.polkachu.com/"],["Algorand","https://mainnet-api.algonode.cloud"],["Terra","https://terra-classic-rpc.publicnode.com"],["Terra2","https://terra-rpc.polkachu.com"],["Karura","https://eth-rpc-karura.aca-api.network"],["Acala","https://eth-rpc-acala.aca-api.network"],["Oasis","https://emerald.oasis.dev"],["Dymension","https://dymension-rpc.polkachu.com/"],["Stargaze","https://stargaze-rpc.polkachu.com/"],["Celestia","https://celestia-rpc.polkachu.com/"],["Neutron","https://neutron-rpc.polkachu.com/"],["Blast","https://rpc.blast.io"],["Provenance","https://rpc.provenance.io/"],["Noble","https://noble-rpc.polkachu.com/"],["Linea","https://rpc.linea.build"],["Scroll","https://scroll-rpc.publicnode.com"],["Xlayer","https://xlayerrpc.okx.com/"],["Gnosis","https://gnosis-rpc.publicnode.com"],["Mantle","https://rpc.mantle.xyz"],["Klaytn","https://public-en.node.kaia.io"],["Snaxchain","https://mainnet.snaxchain.io"],["Berachain","https://rpc.berachain.com"],["Unichain","https://mainnet.unichain.org"],["Worldchain","https://worldchain-mainnet.g.alchemy.com/public"],["Ink","https://rpc-qnd.inkonchain.com"]]],["Testnet",[["Bsc","https://data-seed-prebsc-1-s3.binance.org:8545"],["Avalanche","https://api.avax-test.network/ext/bc/C/rpc"],["Fantom","https://rpc.testnet.fantom.network"],["Celo","https://alfajores-forno.celo-testnet.org"],["Solana","https://api.devnet.solana.com"],["Oasis","https://testnet.emerald.oasis.io"],["Moonbeam","https://rpc.api.moonbase.moonbeam.network"],["Sui","https://fullnode.testnet.sui.io"],["Aptos","https://fullnode.testnet.aptoslabs.com/v1"],["Sei","https://sei-testnet-rpc.polkachu.com"],["Injective","https://testnet.sentry.tm.injective.network"],["Osmosis","https://rpc.testnet.osmosis.zone"],["Cosmoshub","https://rpc.sentry-02.theta-testnet.polypore.xyz"],["Evmos","https://evmos-testnet-rpc.polkachu.com"],["Wormchain","https://gateway.testnet.xlabs.xyz/"],["Xpla","https://cube-rpc.xpla.dev"],["Sepolia","https://ethereum-sepolia.publicnode.com"],["Algorand","https://testnet-api.algonode.cloud"],["Terra","https://bombay.stakesystems.io"],["Terra2","https://terra-testnet-rpc.polkachu.com"],["ArbitrumSepolia","https://sepolia-rollup.arbitrum.io/rpc"],["OptimismSepolia","https://sepolia.optimism.io"],["BaseSepolia","https://sepolia.base.org"],["PolygonSepolia","https://rpc-amoy.polygon.technology/"],["Mantle","https://rpc.testnet.mantle.xyz"],["Karura","https://eth-rpc-karura-testnet.aca-staging.network"],["Acala","https://eth-rpc-acala-testnet.aca-staging.network"],["Blast","https://sepolia.blast.io"],["Berachain","https://bepolia.rpc.berachain.com/"],["Seievm","https://evm-rpc-testnet.sei-apis.com/"],["Linea","https://rpc.sepolia.linea.build"],["Xlayer","https://testrpc.xlayer.tech/"],["Scroll","https://scroll-sepolia-rpc.publicnode.com"],["Gnosis","https://rpc.chiadochain.net"],["Klaytn","https://public-en-kairos.node.kaia.io"],["Snaxchain","https://testnet.snaxchain.io"],["Unichain","https://sepolia.unichain.org"],["Worldchain","https://worldchain-sepolia.g.alchemy.com/public"],["Ink","https://rpc-qnd-sepolia.inkonchain.com"],["HyperEVM","https://api.hyperliquid-testnet.xyz/evm"],["Monad","https://testnet-rpc.monad.xyz"],["Noble","https://noble-testnet-rpc.polkachu.com/"],["Mezo","https://rpc.test.mezo.org"]]],["Devnet",[["Ethereum","http://eth-devnet:8545"],["Bsc","http://eth-devnet2:8545"],["Solana","http://solana-devnet:8899"]]]],Vm=we($m),zu=(n,e)=>Vm.get(n,e)??"",Hu=[["Mainnet",[["Aptos",1n],["Algorand","mainnet-v1.0"],["Near","mainnet"],["Cosmoshub","cosmoshub-4"],["Evmos","evmos_9001-2"],["Injective","injective-1"],["Osmosis","osmosis-1"],["Sei","pacific-1"],["Terra","columbus-5"],["Terra2","phoenix-1"],["Wormchain","wormchain"],["Xpla","dimension_37-1"],["Kujira","kaiyo-1"],["Solana","5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpKuc147dw2N9d"],["Sui","35834a8a"],["Acala",787n],["Arbitrum",42161n],["Aurora",1313161554n],["Avalanche",43114n],["Base",8453n],["Bsc",56n],["Celo",42220n],["Ethereum",1n],["Fantom",250n],["Gnosis",100n],["Karura",686n],["Klaytn",8217n],["Moonbeam",1284n],["Neon",245022934n],["Oasis",42262n],["Optimism",10n],["Polygon",137n],["Neutron","neutron-1"],["Stargaze","stargaze-1"],["Celestia","celestia"],["Dymension","dymension_1100-1"],["Provenance","pio-mainnet-1"],["Noble","noble-1"],["Xlayer",196n],["Mantle",5000n],["Scroll",534352n],["Blast",81457n],["Linea",59144n],["Snaxchain",2192n],["Berachain",80094n],["Unichain",130n],["Worldchain",480n],["Ink",57073n]]],["Testnet",[["Aptos",2n],["Algorand","testnet-v1.0"],["Near","testnet"],["Cosmoshub","theta-testnet-001"],["Evmos","evmos_9000-4"],["Injective","injective-888"],["Osmosis","osmo-test-5"],["Sei","atlantic-2"],["Terra","bombay-12"],["Terra2","pisco-1"],["Wormchain","wormchain-testnet-0"],["Xpla","cube_47-5"],["Kujira","harpoon-4"],["Solana","EtWTRABZaYq6iMfeYKouRu166VU2xqa1wcaWoxPkrZBG"],["Sui","4c78adac"],["Acala",597n],["Arbitrum",421613n],["Aurora",1313161555n],["Avalanche",43113n],["Base",84531n],["Bsc",97n],["Celo",44787n],["Ethereum",5n],["Fantom",4002n],["Gnosis",10200n],["Karura",596n],["Klaytn",1001n],["Moonbeam",1287n],["Neon",245022940n],["Oasis",42261n],["Optimism",420n],["Polygon",80001n],["Sepolia",11155111n],["ArbitrumSepolia",421614n],["BaseSepolia",84532n],["OptimismSepolia",11155420n],["PolygonSepolia",80002n],["Holesky",17000n],["Neutron","pion-1"],["Celestia","mocha-4"],["Seda","seda-1-testnet"],["Noble","grand-1"],["Blast",168587773n],["Mantle",5003n],["Scroll",534351n],["Berachain",80069n],["Seievm",1328n],["Snaxchain",13001n],["Unichain",1301n],["Worldchain",4801n],["Ink",763373n],["HyperEVM",998n],["Xlayer",195n],["Linea",59141n],["Monad",10143n],["Mezo",31611n]]],["Devnet",[["Aptos",0n],["Algorand","sandnet-v1.0"],["Bsc",1397n],["Ethereum",1337n],["Injective","injective_devnet_fake"],["Solana","8wF6jKV3cKwyaVkWcoV9KpDqmkjvEYno9hKZrKx8TbZn"]]]],qu=we(Hu),Gm=we(Hu,[2,[0,1]]);function Ym(n,e){const r=Gm(e).filter(([s,i])=>ns(i)===n);if(r.length!==1)throw new Error(`Platform ${n} has multiple chains with native chain id ${e}`);return r[0]}const Xm=[["Mainnet","https://iris-api.circle.com/v1/attestations"],["Testnet","https://iris-api-sandbox.circle.com/v1/attestations"]],nd=we(Xm),Zm=[["Mainnet",[["Ethereum","0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"],["Avalanche","0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E"],["Optimism","0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85"],["Arbitrum","0xaf88d065e77c8cC2239327C5EDb3A432268e5831"],["Solana","EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"],["Base","0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"],["Polygon","0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359"],["Sui","0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC"],["Aptos","0xbae207659db88bea0cbead6da0ed00aac12edcdda169e591cd41c94180b46f3b"],["Unichain","0x078D782b760474a361dDA0AF3839290b0EF57AD6"]]],["Testnet",[["Sepolia","0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238"],["Avalanche","0x5425890298aed601595a70AB815c96711a31Bc65"],["OptimismSepolia","0x5fd84259d66Cd46123540766Be93DFE6D43130D7"],["ArbitrumSepolia","0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d"],["Solana","4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU"],["BaseSepolia","0x036CbD53842c5426634e7929541eC2318f3dCF7e"],["Polygon","0x9999f7Fea5938fD3b1E26A12c3f2fb024e194f97"],["Sui","0xa1ec7fc00a6f40db9693ad1415d0c193ad3906494428cf252621037bd7117e29::usdc::USDC"],["Aptos","0x69091fbab5f7d635ee7ac5098cf0c1efbe31d68fec0f2cd565e8d168daf52832"],["Unichain","0x31d0220469e10c4E71834a79b1f276d740d3768F"]]]],Cs=we(Zm),Tc=[["Mainnet",[["Ethereum",0],["Avalanche",1],["Optimism",2],["Arbitrum",3],["Solana",5],["Base",6],["Polygon",7],["Sui",8],["Aptos",9],["Unichain",10]]],["Testnet",[["Sepolia",0],["Avalanche",1],["OptimismSepolia",2],["ArbitrumSepolia",3],["Solana",5],["BaseSepolia",6],["Polygon",7],["Sui",8],["Aptos",9],["Unichain",10]]]],Ku=we(Tc,[[0,1],2]),Na=we(Tc,[[0,2],1]),[k6,F6]=ur(Tc),za=(n,e)=>Ku.has(n,e),rd=(n,e)=>Na.has(n,e),sd=(n,e)=>Cs.has(n,e),xi=(n,e)=>{switch(typeof e){case"string":if(za(n,e))return e;break;case"number":if(rd(n,e))return Na(n,e);break;case"bigint":const t=Number(e);if(rd(n,t))return Na(n,t);break}throw Error(`Cannot convert to Chain: ${e}`)},Jm=[["Mainnet",[["Solana","worm2ZoG2kUd4vFXhvjh93UUH596ayRfgQ2MgjNMTth"],["Ethereum","0x98f3c9e6E3fAce36bAAd05FE09d375Ef1464288B"],["Terra","terra1dq03ugtd40zu9hcgdzrsq6z2z4hwhc9tqk2uy5"],["Bsc","0x98f3c9e6E3fAce36bAAd05FE09d375Ef1464288B"],["Polygon","0x7A4B5a56256163F07b2C80A7cA55aBE66c4ec4d7"],["Avalanche","0x54a8e5f9c4CbA08F9943965859F6c34eAF03E26c"],["Oasis","0xfE8cD454b4A1CA468B57D79c0cc77Ef5B6f64585"],["Algorand","842125965"],["Aurora","0xa321448d90d4e5b0A732867c18eA198e75CAC48E"],["Fantom","0x126783A6Cb203a3E35344528B26ca3a0489a1485"],["Karura","0xa321448d90d4e5b0A732867c18eA198e75CAC48E"],["Acala","0xa321448d90d4e5b0A732867c18eA198e75CAC48E"],["Klaytn","0x0C21603c4f3a6387e241c0091A7EA39E43E90bb7"],["Celo","0xa321448d90d4e5b0A732867c18eA198e75CAC48E"],["Near","contract.wormhole_crypto.near"],["Injective","inj17p9rzwnnfxcjp32un9ug7yhhzgtkhvl9l2q74d"],["Aptos","0x5bc11445584a763c1fa7ed39081f1b920954da14e04b32440cba863d03e19625"],["Sui","0xaeab97f96cf9877fee2883315d459552b2b921edc16d7ceac6eab944dd88919c"],["Moonbeam","0xC8e2b0cD52Cf01b0Ce87d389Daa3d414d4cE29f3"],["Terra2","terra12mrnzvhx3rpej6843uge2yyfppfyd3u9c3uq223q8sl48huz9juqffcnhp"],["Arbitrum","0xa5f208e072434bC67592E4C49C1B991BA79BCA46"],["Optimism","0xEe91C335eab126dF5fDB3797EA9d6aD93aeC9722"],["Gnosis","0xa321448d90d4e5b0A732867c18eA198e75CAC48E"],["Pythnet","H3fxXJ86ADW2PNuDDmZJg6mzTtPxkYCpNuQUTgmJ7AjU"],["Base","0xbebdb6C8ddC678FfA9f8748f85C815C556Dd8ac6"],["Xlayer","0x194B123c5E96B9b2E49763619985790Dc241CAC0"],["Xpla","xpla1jn8qmdda5m6f6fqu9qv46rt7ajhklg40ukpqchkejcvy8x7w26cqxamv3w"],["Sei","sei1gjrrme22cyha4ht2xapn3f08zzw6z3d4uxx6fyy9zd5dyr3yxgzqqncdqn"],["Wormchain","wormhole1ufs3tlq4umljk0qfe8k5ya0x6hpavn897u2cnf9k0en9jr7qarqqaqfk2j"],["Neutron","neutron16rerygcpahqcxx5t8vjla46ym8ccn7xz7rtc6ju5ujcd36cmc7zs9zrunh"],["Blast","0xbebdb6C8ddC678FfA9f8748f85C815C556Dd8ac6"],["Scroll","0xbebdb6C8ddC678FfA9f8748f85C815C556Dd8ac6"],["Mantle","0xbebdb6C8ddC678FfA9f8748f85C815C556Dd8ac6"],["Snaxchain","0xc1BA3CC4bFE724A08FbbFbF64F8db196738665f4"],["Berachain","0xCa1D5a146B03f6303baF59e5AD5615ae0b9d146D"],["Unichain","0xCa1D5a146B03f6303baF59e5AD5615ae0b9d146D"],["Worldchain","0xcbcEe4e081464A15d8Ad5f58BB493954421eB506"],["Ink","0xCa1D5a146B03f6303baF59e5AD5615ae0b9d146D"]]],["Testnet",[["Solana","3u8hJUVTA4jH1wYAyUur7FFZVQ8H635K3tSHHF4ssjQ5"],["Ethereum","0x706abc4E45D419950511e474C7B9Ed348A4a716c"],["Terra","terra1pd65m0q9tl3v8znnz5f5ltsfegyzah7g42cx5v"],["Bsc","0x68605AD7b15c732a30b1BbC62BE8F2A509D74b4D"],["Polygon","0x0CBE91CF822c73C2315FB05100C2F714765d5c20"],["Avalanche","0x7bbcE28e64B3F8b84d876Ab298393c38ad7aac4C"],["Oasis","0xc1C338397ffA53a2Eb12A7038b4eeb34791F8aCb"],["Algorand","86525623"],["Aurora","0xBd07292de7b505a4E803CEe286184f7Acf908F5e"],["Fantom","0x1BB3B4119b7BA9dfad76B0545fb3F531383c3bB7"],["Karura","0x64fb09E405D2043ed7785a29E296C766D56F2056"],["Acala","0x64fb09E405D2043ed7785a29E296C766D56F2056"],["Klaytn","0x1830CC6eE66c84D2F177B94D544967c774E624cA"],["Celo","0x88505117CA88e7dd2eC6EA1E13f0948db2D50D56"],["Near","wormhole.wormhole.testnet"],["Injective","inj1xx3aupmgv3ce537c0yce8zzd3sz567syuyedpg"],["Osmosis","osmo1hggkxr0hpw83f8vuft7ruvmmamsxmwk2hzz6nytdkzyup9krt0dq27sgyx"],["Aptos","0x5bc11445584a763c1fa7ed39081f1b920954da14e04b32440cba863d03e19625"],["Sui","0x31358d198147da50db32eda2562951d53973a0c0ad5ed738e9b17d88b213d790"],["Moonbeam","0xa5B7D85a8f27dd7907dc8FdC21FA5657D5E2F901"],["Neon","0x268557122Ffd64c85750d630b716471118F323c8"],["Terra2","terra19nv3xr5lrmmr7egvrk2kqgw4kcn43xrtd5g0mpgwwvhetusk4k7s66jyv0"],["Arbitrum","0xC7A204bDBFe983FCD8d8E61D02b475D4073fF97e"],["Optimism","0x6b9C8671cdDC8dEab9c719bB87cBd3e782bA6a35"],["Gnosis","0xBB73cB66C26740F31d1FabDC6b7A46a038A300dd"],["Pythnet","EUrRARh92Cdc54xrDn6qzaqjA77NRrCcfbr8kPwoTL4z"],["Xpla","xpla1upkjn4mthr0047kahvn0llqx4qpqfn75lnph4jpxfn8walmm8mqsanyy35"],["Base","0x23908A62110e21C04F3A4e011d24F901F911744A"],["Sei","sei1nna9mzp274djrgzhzkac2gvm3j27l402s4xzr08chq57pjsupqnqaj0d5s"],["Sepolia","0x4a8bc80Ed5a4067f1CCf107057b8270E0cC11A78"],["Wormchain","wormhole16jzpxp0e8550c9aht6q9svcux30vtyyyyxv5w2l2djjra46580wsazcjwp"],["ArbitrumSepolia","0x6b9C8671cdDC8dEab9c719bB87cBd3e782bA6a35"],["BaseSepolia","0x79A1027a6A159502049F10906D333EC57E95F083"],["OptimismSepolia","0x31377888146f3253211EFEf5c676D41ECe7D58Fe"],["Holesky","0xa10f2eF61dE1f19f586ab8B6F2EbA89bACE63F7a"],["Neutron","neutron1enf63k37nnv9cugggpm06mg70emcnxgj9p64v2s8yx7a2yhhzk2q6xesk4"],["Mantle","0x376428e7f26D5867e69201b275553C45B09EE090"],["PolygonSepolia","0x6b9C8671cdDC8dEab9c719bB87cBd3e782bA6a35"],["Scroll","0x055F47F1250012C6B20c436570a76e52c17Af2D5"],["Blast","0x473e002D7add6fB67a4964F13bFd61280Ca46886"],["Berachain","0xBB73cB66C26740F31d1FabDC6b7A46a038A300dd"],["Seievm","0xBB73cB66C26740F31d1FabDC6b7A46a038A300dd"],["Snaxchain","0xBB73cB66C26740F31d1FabDC6b7A46a038A300dd"],["Unichain","0xBB73cB66C26740F31d1FabDC6b7A46a038A300dd"],["Worldchain","0xe5E02cD12B6FcA153b0d7fF4bF55730AE7B3C93A"],["Ink","0xBB73cB66C26740F31d1FabDC6b7A46a038A300dd"],["HyperEVM","0xBB73cB66C26740F31d1FabDC6b7A46a038A300dd"],["Xlayer","0xA31aa3FDb7aF7Db93d18DDA4e19F811342EDF780"],["Linea","0x79A1027a6A159502049F10906D333EC57E95F083"],["Monad","0xBB73cB66C26740F31d1FabDC6b7A46a038A300dd"],["Mezo","0x268557122Ffd64c85750d630b716471118F323c8"]]],["Devnet",[["Solana","Bridge1p5gheXUvJ6jGWGeCsgPKgnE3YgdGKRVCMY9o"],["Ethereum","0xC89Ce4735882C9F0f0FE26686c53074E09B0D550"],["Terra","terra14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9ssrc8au"],["Bsc","0xC89Ce4735882C9F0f0FE26686c53074E09B0D550"],["Algorand","1004"],["Near","wormhole.test.near"],["Aptos","0xde0036a9600559e295d5f6802ef6f3f802f510366e0c23912b0655d972166017"],["Sui","0x5a5160ca3c2037f4b4051344096ef7a48ebf4400b3f385e57ea90e1628a8bde0"],["Terra2","terra14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9ssrc8au"],["Wormchain","wormhole17p9rzwnnfxcjp32un9ug7yhhzgtkhvl9jfksztgw5uh69wac2pgshdnj3k"]]]],ju=[["Mainnet",[["Solana","wormDTUJ6AWPNvk59vGQbDvGJmqbDTdgWgAqcLBCgUb"],["Ethereum","0x3ee18B2214AFF97000D974cf647E7C347E8fa585"],["Terra","terra10nmmwe8r3g99a9newtqa7a75xfgs2e8z87r2sf"],["Bsc","0xB6F6D86a8f9879A9c87f643768d9efc38c1Da6E7"],["Polygon","0x5a58505a96D1dbf8dF91cB21B54419FC36e93fdE"],["Avalanche","0x0e082F06FF657D94310cB8cE8B0D9a04541d8052"],["Oasis","0x5848C791e09901b40A9Ef749f2a6735b418d7564"],["Algorand","842126029"],["Aurora","0x51b5123a7b0F9b2bA265f9c4C8de7D78D52f510F"],["Fantom","0x7C9Fc5741288cDFdD83CeB07f3ea7e22618D79D2"],["Karura","0xae9d7fe007b3327AA64A32824Aaac52C42a6E624"],["Acala","0xae9d7fe007b3327AA64A32824Aaac52C42a6E624"],["Klaytn","0x5b08ac39EAED75c0439FC750d9FE7E1F9dD0193F"],["Celo","0x796Dff6D74F3E27060B71255Fe517BFb23C93eed"],["Near","contract.portalbridge.near"],["Injective","inj1ghd753shjuwexxywmgs4xz7x2q732vcnxxynfn"],["Aptos","0x576410486a2da45eee6c949c995670112ddf2fbeedab20350d506328eefc9d4f"],["Sui","0xc57508ee0d4595e5a8728974a4a93a787d38f339757230d441e895422c07aba9"],["Moonbeam","0xb1731c586ca89a23809861c6103f0b96b3f57d92"],["Terra2","terra153366q50k7t8nn7gec00hg66crnhkdggpgdtaxltaq6xrutkkz3s992fw9"],["Arbitrum","0x0b2402144Bb366A632D14B83F244D2e0e21bD39c"],["Optimism","0x1D68124e65faFC907325e3EDbF8c4d84499DAa8b"],["Base","0x8d2de8d2f73F1F4cAB472AC9A881C9b123C79627"],["Xlayer","0x5537857664B0f9eFe38C9f320F75fEf23234D904"],["Xpla","xpla137w0wfch2dfmz7jl2ap8pcmswasj8kg06ay4dtjzw7tzkn77ufxqfw7acv"],["Sei","sei1smzlm9t79kur392nu9egl8p8je9j92q4gzguewj56a05kyxxra0qy0nuf3"],["Wormchain","wormhole1466nf3zuxpya8q9emxukd7vftaf6h4psr0a07srl5zw74zh84yjq4lyjmh"],["Blast","0x24850c6f61C438823F01B7A3BF2B89B72174Fa9d"],["Scroll","0x24850c6f61C438823F01B7A3BF2B89B72174Fa9d"],["Mantle","0x24850c6f61C438823F01B7A3BF2B89B72174Fa9d"],["Snaxchain","0x8B94bfE456B48a6025b92E11Be393BAa86e68410"],["Berachain","0x3Ff72741fd67D6AD0668d93B41a09248F4700560"],["Unichain","0x3Ff72741fd67D6AD0668d93B41a09248F4700560"],["Worldchain","0xc309275443519adca74c9136b02A38eF96E3a1f6"],["Ink","0x3Ff72741fd67D6AD0668d93B41a09248F4700560"]]],["Testnet",[["Solana","DZnkkTmCiFWfYTfT41X3Rd1kDgozqzxWaHqsw6W4x2oe"],["Ethereum","0xF890982f9310df57d00f659cf4fd87e65adEd8d7"],["Terra","terra1pseddrv0yfsn76u4zxrjmtf45kdlmalswdv39a"],["Bsc","0x9dcF9D205C9De35334D646BeE44b2D2859712A09"],["Polygon","0x377D55a7928c046E18eEbb61977e714d2a76472a"],["Avalanche","0x61E44E506Ca5659E6c0bba9b678586fA2d729756"],["Oasis","0x88d8004A9BdbfD9D28090A02010C19897a29605c"],["Algorand","86525641"],["Aurora","0xD05eD3ad637b890D68a854d607eEAF11aF456fba"],["Fantom","0x599CEa2204B4FaECd584Ab1F2b6aCA137a0afbE8"],["Karura","0xe157115ef34c93145Fec2FE53706846853B07F42"],["Acala","0xe157115ef34c93145Fec2FE53706846853B07F42"],["Klaytn","0xC7A13BE098720840dEa132D860fDfa030884b09A"],["Celo","0x05ca6037eC51F8b712eD2E6Fa72219FEaE74E153"],["Near","token.wormhole.testnet"],["Injective","inj1q0e70vhrv063eah90mu97sazhywmeegp7myvnh"],["Aptos","0x576410486a2da45eee6c949c995670112ddf2fbeedab20350d506328eefc9d4f"],["Sui","0x6fb10cdb7aa299e9a4308752dadecb049ff55a892de92992a1edbd7912b3d6da"],["Moonbeam","0xbc976D4b9D57E57c3cA52e1Fd136C45FF7955A96"],["Neon","0xEe3dB83916Ccdc3593b734F7F2d16D630F39F1D0"],["Terra2","terra1c02vds4uhgtrmcw7ldlg75zumdqxr8hwf7npseuf2h58jzhpgjxsgmwkvk"],["Arbitrum","0x23908A62110e21C04F3A4e011d24F901F911744A"],["ArbitrumSepolia","0xC7A204bDBFe983FCD8d8E61D02b475D4073fF97e"],["Optimism","0xC7A204bDBFe983FCD8d8E61D02b475D4073fF97e"],["OptimismSepolia","0x99737Ec4B815d816c49A385943baf0380e75c0Ac"],["Xpla","xpla1kek6zgdaxcsu35nqfsyvs2t9vs87dqkkq6hjdgczacysjn67vt8sern93x"],["Base","0xA31aa3FDb7aF7Db93d18DDA4e19F811342EDF780"],["BaseSepolia","0x86F55A04690fd7815A3D802bD587e83eA888B239"],["Sei","sei1jv5xw094mclanxt5emammy875qelf3v62u4tl4lp5nhte3w3s9ts9w9az2"],["Sepolia","0xDB5492265f6038831E89f495670FF909aDe94bd9"],["Wormchain","wormhole1aaf9r6s7nxhysuegqrxv0wpm27ypyv4886medd3mrkrw6t4yfcnst3qpex"],["Holesky","0x76d093BbaE4529a342080546cAFEec4AcbA59EC6"],["Mantle","0x75Bfa155a9D7A3714b0861c8a8aF0C4633c45b5D"],["PolygonSepolia","0xC7A204bDBFe983FCD8d8E61D02b475D4073fF97e"],["Scroll","0x22427d90B7dA3fA4642F7025A854c7254E4e45BF"],["Blast","0x430855B4D43b8AEB9D2B9869B74d58dda79C0dB2"],["Xlayer","0xdA91a06299BBF302091B053c6B9EF86Eff0f930D"],["Berachain","0xa10f2eF61dE1f19f586ab8B6F2EbA89bACE63F7a"],["Seievm","0x23908A62110e21C04F3A4e011d24F901F911744A"],["Snaxchain","0xa10f2eF61dE1f19f586ab8B6F2EbA89bACE63F7a"],["Unichain","0xa10f2eF61dE1f19f586ab8B6F2EbA89bACE63F7a"],["Worldchain","0x430855B4D43b8AEB9D2B9869B74d58dda79C0dB2"],["Ink","0x376428e7f26D5867e69201b275553C45B09EE090"],["HyperEVM","0x4a8bc80Ed5a4067f1CCf107057b8270E0cC11A78"],["Linea","0xC7A204bDBFe983FCD8d8E61D02b475D4073fF97e"],["Monad","0xF323dcDe4d33efe83cf455F78F9F6cc656e6B659"],["Mezo","0xA31aa3FDb7aF7Db93d18DDA4e19F811342EDF780"]]],["Devnet",[["Solana","B6RHG3mfcckmrYN1UhmJzyS1XX3fZKbkeUcpJe9Sy3FE"],["Ethereum","0x0290FB167208Af455bB137780163b7B7a9a10C16"],["Terra","terra1nc5tatafv6eyq7llkr2gv50ff9e22mnf70qgjlv737ktmt4eswrquka9l6"],["Bsc","0x0290FB167208Af455bB137780163b7B7a9a10C16"],["Algorand","1006"],["Near","token.test.near"],["Aptos","0x84a5f374d29fc77e370014dce4fd6a55b58ad608de8074b0be5571701724da31"],["Sui","0xa6a3da85bbe05da5bfd953708d56f1a3a023e7fb58e5a824a3d4de3791e8f690"],["Terra2","terra1nc5tatafv6eyq7llkr2gv50ff9e22mnf70qgjlv737ktmt4eswrquka9l6"],["Wormchain","wormhole1ghd753shjuwexxywmgs4xz7x2q732vcnkm6h2pyv9s6ah3hylvrqtm7t3h"]]]],$u=[["Mainnet",[["Ethereum","0xcafd2f0a35a4459fa40c0517e17e6fa2939441ca"],["Bsc","0xcafd2f0a35a4459fa40c0517e17e6fa2939441ca"],["Polygon","0xcafd2f0a35a4459fa40c0517e17e6fa2939441ca"],["Avalanche","0xcafd2f0a35a4459fa40c0517e17e6fa2939441ca"],["Fantom","0xcafd2f0a35a4459fa40c0517e17e6fa2939441ca"],["Celo","0xcafd2f0a35a4459fa40c0517e17e6fa2939441ca"],["Sui","0x57f4e0ba41a7045e29d435bc66cc4175f381eb700e6ec16d4fdfe92e5a4dff9f"],["Solana","3vxKRPwUTiEkeUVyoZ9MXFe1V71sRLbLqu1gRYaWmehQ"],["Base","0xaE8dc4a7438801Ec4edC0B035EcCCcF3807F4CC1"],["Moonbeam","0xcafd2f0a35a4459fa40c0517e17e6fa2939441ca"],["Arbitrum","0xaE8dc4a7438801Ec4edC0B035EcCCcF3807F4CC1"],["Optimism","0xaE8dc4a7438801Ec4edC0B035EcCCcF3807F4CC1"]]],["Testnet",[["Ethereum","0x9563a59c15842a6f322b10f69d1dd88b41f2e97b"],["Bsc","0x9563a59c15842a6f322b10f69d1dd88b41f2e97b"],["Polygon","0x9563a59c15842a6f322b10f69d1dd88b41f2e97b"],["Avalanche","0x9563a59c15842a6f322b10f69d1dd88b41f2e97b"],["Fantom","0x9563a59c15842a6f322b10f69d1dd88b41f2e97b"],["Celo","0x9563a59c15842a6f322b10f69d1dd88b41f2e97b"],["Sui","0xb30040e5120f8cb853b691cb6d45981ae884b1d68521a9dc7c3ae881c0031923"],["Base","0xae8dc4a7438801ec4edc0b035eccccf3807f4cc1"],["Moonbeam","0x9563a59c15842a6f322b10f69d1dd88b41f2e97b"],["Solana","3bPRWXqtSfUaCw3S4wdgvypQtsSzcmvDeaqSqPDkncrg"],["Sepolia",""],["ArbitrumSepolia","0xaE8dc4a7438801Ec4edC0B035EcCCcF3807F4CC1"],["OptimismSepolia","0xaE8dc4a7438801Ec4edC0B035EcCCcF3807F4CC1"],["BaseSepolia",""]]]],Qm=[["Mainnet",[["Solana","WnFt12ZrnzZrFZkt2xsNsaNWoQribnuQ5B5FrDbwDhD"],["Ethereum","0x6FFd7EdE62328b3Af38FCD61461Bbfc52F5651fE"],["Bsc","0x5a58505a96D1dbf8dF91cB21B54419FC36e93fdE"],["Polygon","0x90BBd86a6Fe93D3bc3ed6335935447E75fAb7fCf"],["Avalanche","0xf7B6737Ca9c4e08aE573F75A97B73D7a813f5De5"],["Oasis","0x04952D522Ff217f40B5Ef3cbF659EcA7b952a6c1"],["Aurora","0x6dcC0484472523ed9Cdc017F711Bcbf909789284"],["Fantom","0xA9c7119aBDa80d4a4E0C06C8F4d8cF5893234535"],["Karura","0xb91e3638F82A1fACb28690b37e3aAE45d2c33808"],["Acala","0xb91e3638F82A1fACb28690b37e3aAE45d2c33808"],["Klaytn","0x3c3c561757BAa0b78c5C025CdEAa4ee24C1dFfEf"],["Celo","0xA6A377d75ca5c9052c9a77ED1e865Cc25Bd97bf3"],["Aptos","0x1bdffae984043833ed7fe223f7af7a3f8902d04129b14f801823e64827da7130"],["Moonbeam","0x453cfbe096c0f8d763e8c5f24b441097d577bde2"],["Arbitrum","0x3dD14D553cFD986EAC8e3bddF629d82073e188c8"],["Base","0xDA3adC6621B2677BEf9aD26598e6939CF0D92f88"],["Optimism","0xfE8cD454b4A1CA468B57D79c0cc77Ef5B6f64585"]]],["Testnet",[["Solana","2rHhojZ7hpu1zA91nvZmT8TqWWvMcKmmNBCr2mKTtMq4"],["Ethereum","0xD8E4C2DbDd2e2bd8F1336EA691dBFF6952B1a6eB"],["Bsc","0xcD16E5613EF35599dc82B24Cb45B5A93D779f1EE"],["Polygon","0x51a02d0dcb5e52F5b92bdAA38FA013C91c7309A9"],["Avalanche","0xD601BAf2EEE3C028344471684F6b27E789D9075D"],["Oasis","0xC5c25B41AB0b797571620F5204Afa116A44c0ebA"],["Aurora","0x8F399607E9BA2405D87F5f3e1B78D950b44b2e24"],["Fantom","0x63eD9318628D26BdCB15df58B53BB27231D1B227"],["Klaytn","0x94c994fC51c13101062958b567e743f1a04432dE"],["Celo","0xaCD8190F647a31E56A656748bC30F69259f245Db"],["Moonbeam","0x98A0F4B96972b32Fcb3BD03cAeB66A44a6aB9Edb"],["Neon","0x66E5BcFD45D2F3f166c567ADa663f9d2ffb292B4"],["Arbitrum","0xEe3dB83916Ccdc3593b734F7F2d16D630F39F1D0"],["Optimism","0x23908A62110e21C04F3A4e011d24F901F911744A"],["Base","0xF681d1cc5F25a3694E348e7975d7564Aa581db59"],["Sepolia","0x6a0B52ac198e4870e5F3797d5B403838a5bbFD99"],["Aptos","0x1bdffae984043833ed7fe223f7af7a3f8902d04129b14f801823e64827da7130"],["ArbitrumSepolia","0x23908A62110e21C04F3A4e011d24F901F911744A"],["BaseSepolia","0x268557122Ffd64c85750d630b716471118F323c8"],["OptimismSepolia","0x27812285fbe85BA1DF242929B906B31EE3dd1b9f"],["Holesky","0xc8941d483c45eF8FB72E4d1F9dDE089C95fF8171"],["PolygonSepolia","0x23908A62110e21C04F3A4e011d24F901F911744A"],["Mantle","0xD7D732C8Bf5eBF620EA55b5828eae20418eEF083"],["Scroll","0x47B9a1406BEe29a3001BFEB7e45aE45fFFB40c18"]]],["Devnet",[["Solana","NFTWqJR8YnRVqPDvTJrYuLrQDitTG5AScqbeghi4zSA"],["Ethereum","0x26b4afb60d6c903165150c6f0aa14f8016be4aec"],["Terra","terra1plju286nnfj3z54wgcggd4enwaa9fgf5kgrgzl"],["Bsc","0x26b4afb60d6c903165150c6f0aa14f8016be4aec"],["Aptos","0x46da3d4c569388af61f951bdd1153f4c875f90c2991f6b2d0a38e2161a40852c"]]]],e1=[["Mainnet",[["Ethereum","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Bsc","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Polygon","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Avalanche","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Fantom","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Klaytn","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Celo","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Moonbeam","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Base","0x706f82e9bb5b0813501714ab5974216704980e31"],["Arbitrum","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Optimism","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Blast","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Scroll","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Mantle","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Xlayer","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Berachain","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Ink","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Worldchain","0x1520cc9e779c56dab5866bebfb885c86840c33d3"],["Snaxchain","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Unichain","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"]]],["Testnet",[["Ethereum","0x28D8F1Be96f97C1387e94A53e00eCcFb4E75175a"],["Bsc","0x80aC94316391752A193C1c47E27D382b507c93F3"],["Polygon","0x0591C25ebd0580E0d4F27A82Fc2e24E7489CB5e0"],["Avalanche","0xA3cF45939bD6260bcFe3D66bc73d60f19e49a8BB"],["Fantom","0x7B1bD7a6b4E61c2a123AC6BC2cbfC614437D0470"],["Celo","0x306B68267Deb7c5DfCDa3619E22E9Ca39C374f84"],["Seievm","0x362fca37E45fe1096b42021b543f462D49a5C8df"],["Moonbeam","0x0591C25ebd0580E0d4F27A82Fc2e24E7489CB5e0"],["Arbitrum","0xAd753479354283eEE1b86c9470c84D42f229FF43"],["Optimism","0x01A957A525a5b7A72808bA9D10c389674E459891"],["Base","0xea8029CD7FCAEFFcD1F53686430Db0Fc8ed384E1"],["Sepolia","0x7B1bD7a6b4E61c2a123AC6BC2cbfC614437D0470"],["ArbitrumSepolia","0x7B1bD7a6b4E61c2a123AC6BC2cbfC614437D0470"],["BaseSepolia","0x93BAD53DDfB6132b0aC8E37f6029163E63372cEE"],["OptimismSepolia","0x93BAD53DDfB6132b0aC8E37f6029163E63372cEE"],["Berachain","0x362fca37E45fe1096b42021b543f462D49a5C8df"],["Unichain","0x362fca37E45fe1096b42021b543f462D49a5C8df"],["Ink","0x362fca37E45fe1096b42021b543f462D49a5C8df"],["Monad","0x362fca37E45fe1096b42021b543f462D49a5C8df"]]],["Devnet",[["Ethereum","0xcC680D088586c09c3E0E099a676FA4b6e42467b4"],["Bsc","0xcC680D088586c09c3E0E099a676FA4b6e42467b4"]]]],Vu=[["Mainnet",[["Ethereum",{tokenMessenger:"0xbd3fa81b58ba92a82136038b25adec7066af3155",messageTransmitter:"0x0a992d191deec32afe36203ad87d7d289a738f81",wormholeRelayer:"0x4cb69FaE7e7Af841e44E1A1c30Af640739378bb2",wormhole:"0xAaDA05BD399372f0b0463744C09113c137636f6a"}],["Avalanche",{tokenMessenger:"0x6b25532e1060ce10cc3b0a99e5683b91bfde6982",messageTransmitter:"0x8186359af5f57fbb40c6b14a588d2a59c0c29880",wormholeRelayer:"0x4cb69FaE7e7Af841e44E1A1c30Af640739378bb2",wormhole:"0x09Fb06A271faFf70A651047395AaEb6265265F13"}],["Optimism",{tokenMessenger:"0x2B4069517957735bE00ceE0fadAE88a26365528f",messageTransmitter:"0x4d41f22c5a0e5c74090899e5a8fb597a8842b3e8",wormholeRelayer:"0x4cb69FaE7e7Af841e44E1A1c30Af640739378bb2",wormhole:"0x2703483B1a5a7c577e8680de9Df8Be03c6f30e3c"}],["Arbitrum",{tokenMessenger:"0x19330d10D9Cc8751218eaf51E8885D058642E08A",messageTransmitter:"0xC30362313FBBA5cf9163F0bb16a0e01f01A896ca",wormholeRelayer:"0x4cb69FaE7e7Af841e44E1A1c30Af640739378bb2",wormhole:"0x2703483B1a5a7c577e8680de9Df8Be03c6f30e3c"}],["Base",{tokenMessenger:"0x1682Ae6375C4E4A97e4B583BC394c861A46D8962",messageTransmitter:"0xAD09780d193884d503182aD4588450C416D6F9D4",wormholeRelayer:"0x4cb69FaE7e7Af841e44E1A1c30Af640739378bb2",wormhole:"0x03faBB06Fa052557143dC28eFCFc63FC12843f1D"}],["Solana",{tokenMessenger:"CCTPiPYPc6AsJuwueEnWgSgucamXDZwBd53dQ11YiKX3",messageTransmitter:"CCTPmbSD7gX1bxKPAmg77w8oFzNFpaQiQUWD43TKaecd",wormholeRelayer:"",wormhole:""}],["Polygon",{tokenMessenger:"0x9daF8c91AEFAE50b9c0E69629D3F6Ca40cA3B3FE",messageTransmitter:"0xF3be9355363857F3e001be68856A2f96b4C39Ba9",wormholeRelayer:"0x4cb69FaE7e7Af841e44E1A1c30Af640739378bb2",wormhole:"0x0FF28217dCc90372345954563486528aa865cDd6"}],["Sui",{tokenMessenger:"0x2aa6c5d56376c371f88a6cc42e852824994993cb9bab8d3e6450cbe3cb32b94e",messageTransmitter:"0x08d87d37ba49e785dde270a83f8e979605b03dc552b5548f26fdf2f49bf7ed1b",wormholeRelayer:"",wormhole:""}],["Aptos",{tokenMessenger:"0x9e6702a472080ea3caaf6ba9dfaa6effad2290a9ba9adaacd5af5c618e42782d",messageTransmitter:"0x177e17751820e4b4371873ca8c30279be63bdea63b88ed0f2239c2eea10f1772",wormholeRelayer:"",wormhole:""}],["Unichain",{tokenMessenger:"0x4e744b28E787c3aD0e810eD65A24461D4ac5a762",messageTransmitter:"0x353bE9E2E38AB1D19104534e4edC21c643Df86f4",wormholeRelayer:"",wormhole:""}]]],["Testnet",[["Sepolia",{tokenMessenger:"0x9f3B8679c73C2Fef8b59B4f3444d4e156fb70AA5",messageTransmitter:"0x7865fAfC2db2093669d92c0F33AeEF291086BEFD",wormholeRelayer:"0x4cb69FaE7e7Af841e44E1A1c30Af640739378bb2",wormhole:"0x2703483B1a5a7c577e8680de9Df8Be03c6f30e3c"}],["Avalanche",{tokenMessenger:"0xeb08f243e5d3fcff26a9e38ae5520a669f4019d0",messageTransmitter:"0xa9fb1b3009dcb79e2fe346c16a604b8fa8ae0a79",wormholeRelayer:"0x774a70bbd03327c21460b60f25b677d9e46ab458",wormhole:"0x58f4c17449c90665891c42e14d34aae7a26a472e"}],["OptimismSepolia",{tokenMessenger:"0x9f3B8679c73C2Fef8b59B4f3444d4e156fb70AA5",messageTransmitter:"0x7865fAfC2db2093669d92c0F33AeEF291086BEFD",wormholeRelayer:"0x4cb69FaE7e7Af841e44E1A1c30Af640739378bb2",wormhole:"0x2703483B1a5a7c577e8680de9Df8Be03c6f30e3c"}],["ArbitrumSepolia",{tokenMessenger:"0x9f3B8679c73C2Fef8b59B4f3444d4e156fb70AA5",messageTransmitter:"0xaCF1ceeF35caAc005e15888dDb8A3515C41B4872",wormholeRelayer:"0x4cb69FaE7e7Af841e44E1A1c30Af640739378bb2",wormhole:"0x2703483B1a5a7c577e8680de9Df8Be03c6f30e3c"}],["Solana",{tokenMessenger:"CCTPiPYPc6AsJuwueEnWgSgucamXDZwBd53dQ11YiKX3",messageTransmitter:"CCTPmbSD7gX1bxKPAmg77w8oFzNFpaQiQUWD43TKaecd",wormholeRelayer:"",wormhole:""}],["BaseSepolia",{tokenMessenger:"0x9f3B8679c73C2Fef8b59B4f3444d4e156fb70AA5",messageTransmitter:"0x7865fAfC2db2093669d92c0F33AeEF291086BEFD",wormholeRelayer:"0x4cb69FaE7e7Af841e44E1A1c30Af640739378bb2",wormhole:"0x2703483B1a5a7c577e8680de9Df8Be03c6f30e3c"}],["Polygon",{tokenMessenger:"0x9f3B8679c73C2Fef8b59B4f3444d4e156fb70AA5",messageTransmitter:"0xe09A679F56207EF33F5b9d8fb4499Ec00792eA73",wormholeRelayer:"0x4cb69FaE7e7Af841e44E1A1c30Af640739378bb2",wormhole:"0x2703483B1a5a7c577e8680de9Df8Be03c6f30e3c"}],["Sui",{tokenMessenger:"0x31cc14d80c175ae39777c0238f20594c6d4869cfab199f40b69f3319956b8beb",messageTransmitter:"0x4931e06dce648b3931f890035bd196920770e913e43e45990b383f6486fdd0a5",wormholeRelayer:"",wormhole:""}],["Aptos",{tokenMessenger:"0x5f9b937419dda90aa06c1836b7847f65bbbe3f1217567758dc2488be31a477b9",messageTransmitter:"0x081e86cebf457a0c6004f35bd648a2794698f52e0dde09a48619dcd3d4cc23d9",wormholeRelayer:"",wormhole:""}],["Unichain",{tokenMessenger:"0x8ed94B8dAd2Dc5453862ea5e316A8e71AAed9782",messageTransmitter:"0xbc498c326533d675cf571B90A2Ced265ACb7d086",wormholeRelayer:"",wormhole:""}]]]],t1=[["Mainnet",[["Wormchain","wormhole14ejqjyq8um4p3xfqj74yld5waqljf88fz25yxnma0cngspxe3les00fpjx"]]],["Testnet",[["Wormchain","wormhole1ctnjk7an90lz5wjfvr3cf6x984a8cjnv8dpmztmlpcq4xteaa2xs9pwmzk"]]]],n1=[["Mainnet",[["Sei","sei189adguawugk3e55zn63z8r9ll29xrjwca636ra7v7gxuzn98sxyqwzt47l"]]],["Testnet",[["Sei","sei1dkdwdvknx0qav5cp5kw68mkn3r99m3svkyjfvkztwh97dv2lm0ksj6xrak"]]]],r1=[["Mainnet",[["Polygon",["Ethereum","0x86E4Dc95c7FBdBf52e33D563BbDB00823894C287"]],["Optimism",["Ethereum","0xdfe97868233d1aa22e815a266982f2cf17685a27"]],["Arbitrum",["Ethereum","0x1c479675ad559dc151f6ec7ed3fbf8cee79582b6"]]]],["Testnet",[["Polygon",["Ethereum","0x2890ba17efe978480615e330ecb65333b880928e"]],["Optimism",["Ethereum","0xe6dfba0953616bacab0c9a8ecb3a9bba77fc15c0"]],["Arbitrum",["Ethereum","0x45af9ed1d03703e480ce7d328fb684bb67da5049"]]]]],Gu=[["Mainnet",[["Ethereum",{porticoUniswap:"0x48b6101128C0ed1E208b7C910e60542A2ee6f476",uniswapQuoterV2:"0x61fFE014bA17989E743c5F6cB21bF9697530B21e",porticoPancakeSwap:"0x4db1683d60e0a933A9A477a19FA32F472bB9d06e",pancakeSwapQuoterV2:"0xB048Bbc1Ee6b733FFfCFb9e9CeF7375518e25997"}],["Polygon",{porticoUniswap:"0x227bABe533fa9a1085f5261210E0B7137E44437B",uniswapQuoterV2:"0x61fFE014bA17989E743c5F6cB21bF9697530B21e",porticoPancakeSwap:void 0,pancakeSwapQuoterV2:void 0}],["Bsc",{porticoUniswap:"0x05498574BD0Fa99eeCB01e1241661E7eE58F8a85",uniswapQuoterV2:"0x78D78E420Da98ad378D7799bE8f4AF69033EB077",porticoPancakeSwap:"0xF352DC165783538A26e38A536e76DceF227d90F2",pancakeSwapQuoterV2:"0xB048Bbc1Ee6b733FFfCFb9e9CeF7375518e25997"}],["Avalanche",{porticoUniswap:"0xE565E118e75304dD3cF83dff409c90034b7EA18a",uniswapQuoterV2:"0xbe0F5544EC67e9B3b2D979aaA43f18Fd87E6257F",porticoPancakeSwap:void 0,pancakeSwapQuoterV2:void 0}],["Arbitrum",{porticoUniswap:"0x48fa7528bFD6164DdF09dF0Ed22451cF59c84130",uniswapQuoterV2:"0x61fFE014bA17989E743c5F6cB21bF9697530B21e",porticoPancakeSwap:"0xE70946692E2e56ae47BfAe2d93d31bd60952B090",pancakeSwapQuoterV2:"0xB048Bbc1Ee6b733FFfCFb9e9CeF7375518e25997"}],["Optimism",{porticoUniswap:"0x9ae506cDDd27DEe1275fd1fe6627E5dc65257061",uniswapQuoterV2:"0x61fFE014bA17989E743c5F6cB21bF9697530B21e",porticoPancakeSwap:void 0,pancakeSwapQuoterV2:void 0}],["Base",{porticoUniswap:"0x610d4DFAC3EC32e0be98D18DDb280DACD76A1889",uniswapQuoterV2:"0x3d4e44Eb1374240CE5F1B871ab261CD16335B76a",porticoPancakeSwap:"0x4568aa1eA0ED54db666c58B4526B3FC9BD9be9bf",pancakeSwapQuoterV2:"0xB048Bbc1Ee6b733FFfCFb9e9CeF7375518e25997"}],["Celo",{porticoUniswap:"0xE565E118e75304dD3cF83dff409c90034b7EA18a",uniswapQuoterV2:"0x82825d0554fA07f7FC52Ab63c961F330fdEFa8E8",porticoPancakeSwap:void 0,pancakeSwapQuoterV2:void 0}]]]],s1=[["Mainnet",[["Solana","87MEvHZCXE3ML5rrmh5uX1FbShHmRXXS32xJDGbQ7h5t"],["Polygon","0x09959798B95d00a3183d20FaC298E4594E599eab"],["Arbitrum","0x1293a54e160D1cd7075487898d65266081A15458"],["Optimism","0x1293a54e160D1cd7075487898d65266081A15458"],["Base","0x09959798B95d00a3183d20FaC298E4594E599eab"]]]],i1=we(Jm),o1=we(ju),a1=we($u),c1=we(Qm),l1=we(e1),id=we(t1),od=we(n1),ad=we(Gu),Ci=we(s1),Ha=we(Vu);we(r1);const d1=we(ju,[0,1]),u1=we($u,[0,1]),f1=we(Vu,[0,1]),h1=we(Gu,[0,1]),Ic=[["Mainnet",[["0x58CC3AE5C097b213cE3c81979e1B9f9570746AA5","JumpCrypto"],["0xfF6CB952589BDE862c25Ef4392132fb9D4A42157","Staked"],["0x114De8460193bdf3A2fCf81f86a09765F4762fD1","Figment"],["0x107A0086b32d7A0977926A205131d8731D39cbEB","ChainodeTech"],["0x8C82B2fd82FaeD2711d59AF0F2499D16e726f6b2","Inotel"],["0x11b39756C042441BE6D8650b69b54EbE715E2343","HashQuark"],["0x54Ce5B4D348fb74B958e8966e2ec3dBd4958a7cd","Chainlayer"],["0x15e7cAF07C4e3DC8e7C469f92C8Cd88FB8005a20","xLabs"],["0x74a3bf913953D695260D88BC1aA25A4eeE363ef0","Forbole"],["0x000aC0076727b35FBea2dAc28fEE5cCB0fEA768e","StakingFund"],["0xAF45Ced136b9D9e24903464AE889F5C8a723FC14","MoonletWallet"],["0xf93124b7c738843CBB89E864c862c38cddCccF95","P2PValidator"],["0xD2CC37A4dc036a8D232b48f62cDD4731412f4890","01Node"],["0xDA798F6896A3331F64b48c12D1D57Fd9cbe70811","MCF"],["0x71AA1BE1D36CaFE3867910F99C09e347899C19C3","Everstake"],["0x8192b6E7387CCd768277c17DAb1b7a5027c0b3Cf","ChorusOne"],["0x178e21ad2E77AE06711549CFBB1f9c7a9d8096e8","Syncnode"],["0x5E1487F35515d02A92753504a8D75471b9f49EdB","Triton"],["0x6FbEBc898F403E4773E95feB15E80C9A99c8348d","StakingFacilities"]]],["Testnet",[["0x13947Bd48b18E53fdAeEe77F3473391aC727C638","Testnet guardian"]]]],[T6,I6]=om(ur(Ui(Ic)),[1,2]);we(Ic,[[0,2],1]);we(Ic,[1,[0,2]]);const Uc=5,m1=[["Mainnet",[["Ethereum","0x18084fbA666a33d37592fA2633fD49a74DD93a88"],["Solana","6DNSN2BJsaPFdFFc1zP37kkeNe4Usc1Sqkzr9C9vPWcU"],["Polygon","0x236aa50979D5f3De3Bd1Eeb40E81137F22ab794b"],["Arbitrum","0x6c84a8f1c29108F47a79964b5Fe888D4f4D0dE40"],["Optimism","0x6c84a8f1c29108F47a79964b5Fe888D4f4D0dE40"],["Base","0x236aa50979D5f3De3Bd1Eeb40E81137F22ab794b"]]]],b1=we(m1);function Fs(n){if(!Number.isSafeInteger(n)||n<0)throw new Error("positive integer expected, got "+n)}function p1(n){return n instanceof Uint8Array||ArrayBuffer.isView(n)&&n.constructor.name==="Uint8Array"}function vr(n,...e){if(!p1(n))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(n.length))throw new Error("Uint8Array expected of length "+e+", got length="+n.length)}function Yu(n){if(typeof n!="function"||typeof n.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Fs(n.outputLen),Fs(n.blockLen)}function Er(n,e=!0){if(n.destroyed)throw new Error("Hash instance has been destroyed");if(e&&n.finished)throw new Error("Hash#digest() has already been called")}function _c(n,e){vr(n);const t=e.outputLen;if(n.length<t)throw new Error("digestInto() expects output buffer of length at least "+t)}const Pr=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Xu(n){return new Uint32Array(n.buffer,n.byteOffset,Math.floor(n.byteLength/4))}function Si(n){return new DataView(n.buffer,n.byteOffset,n.byteLength)}function hn(n,e){return n<<32-e|n>>>e}function g1(n,e){return n<<e|n>>>32-e>>>0}const Pi=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function Zu(n){return n<<24&4278190080|n<<8&16711680|n>>>8&65280|n>>>24&255}const y1=Pi?n=>n:n=>Zu(n);function qa(n){for(let e=0;e<n.length;e++)n[e]=Zu(n[e])}const w1=Array.from({length:256},(n,e)=>e.toString(16).padStart(2,"0"));function A1(n){vr(n);let e="";for(let t=0;t<n.length;t++)e+=w1[n[t]];return e}const _n={_0:48,_9:57,A:65,F:70,a:97,f:102};function cd(n){if(n>=_n._0&&n<=_n._9)return n-_n._0;if(n>=_n.A&&n<=_n.F)return n-(_n.A-10);if(n>=_n.a&&n<=_n.f)return n-(_n.a-10)}function E1(n){if(typeof n!="string")throw new Error("hex string expected, got "+typeof n);const e=n.length,t=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);const r=new Uint8Array(t);for(let s=0,i=0;s<t;s++,i+=2){const o=cd(n.charCodeAt(i)),a=cd(n.charCodeAt(i+1));if(o===void 0||a===void 0){const l=n[i]+n[i+1];throw new Error('hex string expected, got non-hex character "'+l+'" at index '+i)}r[s]=o*16+a}return r}function Ju(n){if(typeof n!="string")throw new Error("utf8ToBytes expected string, got "+typeof n);return new Uint8Array(new TextEncoder().encode(n))}function ss(n){return typeof n=="string"&&(n=Ju(n)),vr(n),n}function Qu(...n){let e=0;for(let r=0;r<n.length;r++){const s=n[r];vr(s),e+=s.length}const t=new Uint8Array(e);for(let r=0,s=0;r<n.length;r++){const i=n[r];t.set(i,s),s+=i.length}return t}let so=class{clone(){return this._cloneInto()}};function B1(n,e){if(e!==void 0&&{}.toString.call(e)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(n,e)}function Ys(n){const e=r=>n().update(ss(r)).digest(),t=n();return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=()=>n(),e}function x1(n){const e=(r,s)=>n(s).update(ss(r)).digest(),t=n({});return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=r=>n(r),e}function Mc(n=32){if(Pr&&typeof Pr.getRandomValues=="function")return Pr.getRandomValues(new Uint8Array(n));if(Pr&&typeof Pr.randomBytes=="function")return Pr.randomBytes(n);throw new Error("crypto.getRandomValues must be defined")}function C1(n,e,t,r){if(typeof n.setBigUint64=="function")return n.setBigUint64(e,t,r);const s=BigInt(32),i=BigInt(4294967295),o=Number(t>>s&i),a=Number(t&i),l=r?4:0,h=r?0:4;n.setUint32(e+l,o,r),n.setUint32(e+h,a,r)}function S1(n,e,t){return n&e^~n&t}function D1(n,e,t){return n&e^n&t^e&t}class Rc extends so{constructor(e,t,r,s){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=s,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=Si(this.buffer)}update(e){Er(this);const{view:t,buffer:r,blockLen:s}=this;e=ss(e);const i=e.length;for(let o=0;o<i;){const a=Math.min(s-this.pos,i-o);if(a===s){const l=Si(e);for(;s<=i-o;o+=s)this.process(l,o);continue}r.set(e.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===s&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Er(this),_c(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:s,isLE:i}=this;let{pos:o}=this;t[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>s-o&&(this.process(r,0),o=0);for(let E=o;E<s;E++)t[E]=0;C1(r,s-8,BigInt(this.length*8),i),this.process(r,0);const a=Si(e),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const h=l/4,m=this.get();if(h>m.length)throw new Error("_sha2: outputLen bigger than state");for(let E=0;E<h;E++)a.setUint32(4*E,m[E],i)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:r,length:s,finished:i,destroyed:o,pos:a}=this;return e.length=s,e.pos=a,e.finished=i,e.destroyed=o,s%t&&e.buffer.set(r),e}}const v1=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),jn=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),$n=new Uint32Array(64);class k1 extends Rc{constructor(){super(64,32,8,!1),this.A=jn[0]|0,this.B=jn[1]|0,this.C=jn[2]|0,this.D=jn[3]|0,this.E=jn[4]|0,this.F=jn[5]|0,this.G=jn[6]|0,this.H=jn[7]|0}get(){const{A:e,B:t,C:r,D:s,E:i,F:o,G:a,H:l}=this;return[e,t,r,s,i,o,a,l]}set(e,t,r,s,i,o,a,l){this.A=e|0,this.B=t|0,this.C=r|0,this.D=s|0,this.E=i|0,this.F=o|0,this.G=a|0,this.H=l|0}process(e,t){for(let E=0;E<16;E++,t+=4)$n[E]=e.getUint32(t,!1);for(let E=16;E<64;E++){const S=$n[E-15],A=$n[E-2],g=hn(S,7)^hn(S,18)^S>>>3,D=hn(A,17)^hn(A,19)^A>>>10;$n[E]=D+$n[E-7]+g+$n[E-16]|0}let{A:r,B:s,C:i,D:o,E:a,F:l,G:h,H:m}=this;for(let E=0;E<64;E++){const S=hn(a,6)^hn(a,11)^hn(a,25),A=m+S+S1(a,l,h)+v1[E]+$n[E]|0,D=(hn(r,2)^hn(r,13)^hn(r,22))+D1(r,s,i)|0;m=h,h=l,l=a,a=o+A|0,o=i,i=s,s=r,r=A+D|0}r=r+this.A|0,s=s+this.B|0,i=i+this.C|0,o=o+this.D|0,a=a+this.E|0,l=l+this.F|0,h=h+this.G|0,m=m+this.H|0,this.set(r,s,i,o,a,l,h,m)}roundClean(){$n.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const Ts=Ys(()=>new k1),ai=BigInt(2**32-1),Ka=BigInt(32);function ef(n,e=!1){return e?{h:Number(n&ai),l:Number(n>>Ka&ai)}:{h:Number(n>>Ka&ai)|0,l:Number(n&ai)|0}}function tf(n,e=!1){let t=new Uint32Array(n.length),r=new Uint32Array(n.length);for(let s=0;s<n.length;s++){const{h:i,l:o}=ef(n[s],e);[t[s],r[s]]=[i,o]}return[t,r]}const F1=(n,e)=>BigInt(n>>>0)<<Ka|BigInt(e>>>0),T1=(n,e,t)=>n>>>t,I1=(n,e,t)=>n<<32-t|e>>>t,U1=(n,e,t)=>n>>>t|e<<32-t,_1=(n,e,t)=>n<<32-t|e>>>t,M1=(n,e,t)=>n<<64-t|e>>>t-32,R1=(n,e,t)=>n>>>t-32|e<<64-t,W1=(n,e)=>e,P1=(n,e)=>n,nf=(n,e,t)=>n<<t|e>>>32-t,rf=(n,e,t)=>e<<t|n>>>32-t,sf=(n,e,t)=>e<<t-32|n>>>64-t,of=(n,e,t)=>n<<t-32|e>>>64-t;function L1(n,e,t,r){const s=(e>>>0)+(r>>>0);return{h:n+t+(s/2**32|0)|0,l:s|0}}const O1=(n,e,t)=>(n>>>0)+(e>>>0)+(t>>>0),N1=(n,e,t,r)=>e+t+r+(n/2**32|0)|0,z1=(n,e,t,r)=>(n>>>0)+(e>>>0)+(t>>>0)+(r>>>0),H1=(n,e,t,r,s)=>e+t+r+s+(n/2**32|0)|0,q1=(n,e,t,r,s)=>(n>>>0)+(e>>>0)+(t>>>0)+(r>>>0)+(s>>>0),K1=(n,e,t,r,s,i)=>e+t+r+s+i+(n/2**32|0)|0,me={fromBig:ef,split:tf,toBig:F1,shrSH:T1,shrSL:I1,rotrSH:U1,rotrSL:_1,rotrBH:M1,rotrBL:R1,rotr32H:W1,rotr32L:P1,rotlSH:nf,rotlSL:rf,rotlBH:sf,rotlBL:of,add:L1,add3L:O1,add3H:N1,add4L:z1,add4H:H1,add5H:K1,add5L:q1},af=[],cf=[],lf=[],j1=BigInt(0),ps=BigInt(1),$1=BigInt(2),V1=BigInt(7),G1=BigInt(256),Y1=BigInt(113);for(let n=0,e=ps,t=1,r=0;n<24;n++){[t,r]=[r,(2*t+3*r)%5],af.push(2*(5*r+t)),cf.push((n+1)*(n+2)/2%64);let s=j1;for(let i=0;i<7;i++)e=(e<<ps^(e>>V1)*Y1)%G1,e&$1&&(s^=ps<<(ps<<BigInt(i))-ps);lf.push(s)}const[X1,Z1]=tf(lf,!0),ld=(n,e,t)=>t>32?sf(n,e,t):nf(n,e,t),dd=(n,e,t)=>t>32?of(n,e,t):rf(n,e,t);function J1(n,e=24){const t=new Uint32Array(10);for(let r=24-e;r<24;r++){for(let o=0;o<10;o++)t[o]=n[o]^n[o+10]^n[o+20]^n[o+30]^n[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,l=(o+2)%10,h=t[l],m=t[l+1],E=ld(h,m,1)^t[a],S=dd(h,m,1)^t[a+1];for(let A=0;A<50;A+=10)n[o+A]^=E,n[o+A+1]^=S}let s=n[2],i=n[3];for(let o=0;o<24;o++){const a=cf[o],l=ld(s,i,a),h=dd(s,i,a),m=af[o];s=n[m],i=n[m+1],n[m]=l,n[m+1]=h}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)t[a]=n[o+a];for(let a=0;a<10;a++)n[o+a]^=~t[(a+2)%10]&t[(a+4)%10]}n[0]^=X1[r],n[1]^=Z1[r]}t.fill(0)}let Q1=class df extends so{constructor(e,t,r,s=!1,i=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=s,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,Fs(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=Xu(this.state)}keccak(){Pi||qa(this.state32),J1(this.state32,this.rounds),Pi||qa(this.state32),this.posOut=0,this.pos=0}update(e){Er(this);const{blockLen:t,state:r}=this;e=ss(e);const s=e.length;for(let i=0;i<s;){const o=Math.min(t-this.pos,s-i);for(let a=0;a<o;a++)r[this.pos++]^=e[i++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:t,pos:r,blockLen:s}=this;e[r]^=t,t&128&&r===s-1&&this.keccak(),e[s-1]^=128,this.keccak()}writeInto(e){Er(this,!1),vr(e),this.finish();const t=this.state,{blockLen:r}=this;for(let s=0,i=e.length;s<i;){this.posOut>=r&&this.keccak();const o=Math.min(r-this.posOut,i-s);e.set(t.subarray(this.posOut,this.posOut+o),s),this.posOut+=o,s+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return Fs(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(_c(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:t,suffix:r,outputLen:s,rounds:i,enableXOF:o}=this;return e||(e=new df(t,r,s,o,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=r,e.outputLen=s,e.enableXOF=o,e.destroyed=this.destroyed,e}};const uf=(n,e,t)=>Ys(()=>new Q1(e,n,t)),eb=uf(6,136,256/8),Is=uf(1,136,256/8),[tb,nb]=me.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(n=>BigInt(n))),Vn=new Uint32Array(80),Gn=new Uint32Array(80);class ff extends Rc{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:t,Bh:r,Bl:s,Ch:i,Cl:o,Dh:a,Dl:l,Eh:h,El:m,Fh:E,Fl:S,Gh:A,Gl:g,Hh:D,Hl:x}=this;return[e,t,r,s,i,o,a,l,h,m,E,S,A,g,D,x]}set(e,t,r,s,i,o,a,l,h,m,E,S,A,g,D,x){this.Ah=e|0,this.Al=t|0,this.Bh=r|0,this.Bl=s|0,this.Ch=i|0,this.Cl=o|0,this.Dh=a|0,this.Dl=l|0,this.Eh=h|0,this.El=m|0,this.Fh=E|0,this.Fl=S|0,this.Gh=A|0,this.Gl=g|0,this.Hh=D|0,this.Hl=x|0}process(e,t){for(let F=0;F<16;F++,t+=4)Vn[F]=e.getUint32(t),Gn[F]=e.getUint32(t+=4);for(let F=16;F<80;F++){const W=Vn[F-15]|0,z=Gn[F-15]|0,H=me.rotrSH(W,z,1)^me.rotrSH(W,z,8)^me.shrSH(W,z,7),K=me.rotrSL(W,z,1)^me.rotrSL(W,z,8)^me.shrSL(W,z,7),G=Vn[F-2]|0,V=Gn[F-2]|0,ie=me.rotrSH(G,V,19)^me.rotrBH(G,V,61)^me.shrSH(G,V,6),ne=me.rotrSL(G,V,19)^me.rotrBL(G,V,61)^me.shrSL(G,V,6),ae=me.add4L(K,ne,Gn[F-7],Gn[F-16]),I=me.add4H(ae,H,ie,Vn[F-7],Vn[F-16]);Vn[F]=I|0,Gn[F]=ae|0}let{Ah:r,Al:s,Bh:i,Bl:o,Ch:a,Cl:l,Dh:h,Dl:m,Eh:E,El:S,Fh:A,Fl:g,Gh:D,Gl:x,Hh:U,Hl:R}=this;for(let F=0;F<80;F++){const W=me.rotrSH(E,S,14)^me.rotrSH(E,S,18)^me.rotrBH(E,S,41),z=me.rotrSL(E,S,14)^me.rotrSL(E,S,18)^me.rotrBL(E,S,41),H=E&A^~E&D,K=S&g^~S&x,G=me.add5L(R,z,K,nb[F],Gn[F]),V=me.add5H(G,U,W,H,tb[F],Vn[F]),ie=G|0,ne=me.rotrSH(r,s,28)^me.rotrBH(r,s,34)^me.rotrBH(r,s,39),ae=me.rotrSL(r,s,28)^me.rotrBL(r,s,34)^me.rotrBL(r,s,39),I=r&i^r&a^i&a,c=s&o^s&l^o&l;U=D|0,R=x|0,D=A|0,x=g|0,A=E|0,g=S|0,{h:E,l:S}=me.add(h|0,m|0,V|0,ie|0),h=a|0,m=l|0,a=i|0,l=o|0,i=r|0,o=s|0;const b=me.add3L(ie,ae,c);r=me.add3H(b,V,ne,I),s=b|0}({h:r,l:s}=me.add(this.Ah|0,this.Al|0,r|0,s|0)),{h:i,l:o}=me.add(this.Bh|0,this.Bl|0,i|0,o|0),{h:a,l}=me.add(this.Ch|0,this.Cl|0,a|0,l|0),{h,l:m}=me.add(this.Dh|0,this.Dl|0,h|0,m|0),{h:E,l:S}=me.add(this.Eh|0,this.El|0,E|0,S|0),{h:A,l:g}=me.add(this.Fh|0,this.Fl|0,A|0,g|0),{h:D,l:x}=me.add(this.Gh|0,this.Gl|0,D|0,x|0),{h:U,l:R}=me.add(this.Hh|0,this.Hl|0,U|0,R|0),this.set(r,s,i,o,a,l,h,m,E,S,A,g,D,x,U,R)}roundClean(){Vn.fill(0),Gn.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class rb extends ff{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}}const hf=Ys(()=>new ff),sb=Ys(()=>new rb);class mf extends so{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,Yu(e);const r=ss(t);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const s=this.blockLen,i=new Uint8Array(s);i.set(r.length>s?e.create().update(r).digest():r);for(let o=0;o<i.length;o++)i[o]^=54;this.iHash.update(i),this.oHash=e.create();for(let o=0;o<i.length;o++)i[o]^=106;this.oHash.update(i),i.fill(0)}update(e){return Er(this),this.iHash.update(e),this}digestInto(e){Er(this),vr(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:r,finished:s,destroyed:i,blockLen:o,outputLen:a}=this;return e=e,e.finished=s,e.destroyed=i,e.blockLen=o,e.outputLen=a,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const Wc=(n,e,t)=>new mf(n,e).update(t).digest();Wc.create=(n,e)=>new mf(n,e);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const io=BigInt(0),oo=BigInt(1),ib=BigInt(2);function Br(n){return n instanceof Uint8Array||ArrayBuffer.isView(n)&&n.constructor.name==="Uint8Array"}function Xs(n){if(!Br(n))throw new Error("Uint8Array expected")}function qn(n,e){if(typeof e!="boolean")throw new Error(n+" boolean expected, got "+e)}const ob=Array.from({length:256},(n,e)=>e.toString(16).padStart(2,"0"));function xr(n){Xs(n);let e="";for(let t=0;t<n.length;t++)e+=ob[n[t]];return e}function Or(n){const e=n.toString(16);return e.length&1?"0"+e:e}function Pc(n){if(typeof n!="string")throw new Error("hex string expected, got "+typeof n);return n===""?io:BigInt("0x"+n)}const Mn={_0:48,_9:57,A:65,F:70,a:97,f:102};function ud(n){if(n>=Mn._0&&n<=Mn._9)return n-Mn._0;if(n>=Mn.A&&n<=Mn.F)return n-(Mn.A-10);if(n>=Mn.a&&n<=Mn.f)return n-(Mn.a-10)}function $r(n){if(typeof n!="string")throw new Error("hex string expected, got "+typeof n);const e=n.length,t=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);const r=new Uint8Array(t);for(let s=0,i=0;s<t;s++,i+=2){const o=ud(n.charCodeAt(i)),a=ud(n.charCodeAt(i+1));if(o===void 0||a===void 0){const l=n[i]+n[i+1];throw new Error('hex string expected, got non-hex character "'+l+'" at index '+i)}r[s]=o*16+a}return r}function mr(n){return Pc(xr(n))}function Kr(n){return Xs(n),Pc(xr(Uint8Array.from(n).reverse()))}function Vr(n,e){return $r(n.toString(16).padStart(e*2,"0"))}function Us(n,e){return Vr(n,e).reverse()}function ab(n){return $r(Or(n))}function At(n,e,t){let r;if(typeof e=="string")try{r=$r(e)}catch(i){throw new Error(n+" must be hex string or Uint8Array, cause: "+i)}else if(Br(e))r=Uint8Array.from(e);else throw new Error(n+" must be hex string or Uint8Array");const s=r.length;if(typeof t=="number"&&s!==t)throw new Error(n+" of length "+t+" expected, got "+s);return r}function Cr(...n){let e=0;for(let r=0;r<n.length;r++){const s=n[r];Xs(s),e+=s.length}const t=new Uint8Array(e);for(let r=0,s=0;r<n.length;r++){const i=n[r];t.set(i,s),s+=i.length}return t}function cb(n,e){if(n.length!==e.length)return!1;let t=0;for(let r=0;r<n.length;r++)t|=n[r]^e[r];return t===0}function lb(n){if(typeof n!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(n))}const sa=n=>typeof n=="bigint"&&io<=n;function ao(n,e,t){return sa(n)&&sa(e)&&sa(t)&&e<=n&&n<t}function tn(n,e,t,r){if(!ao(e,t,r))throw new Error("expected valid "+n+": "+t+" <= n < "+r+", got "+e)}function bf(n){let e;for(e=0;n>io;n>>=oo,e+=1);return e}function db(n,e){return n>>BigInt(e)&oo}function ub(n,e,t){return n|(t?oo:io)<<BigInt(e)}const Lc=n=>(ib<<BigInt(n-1))-oo,ia=n=>new Uint8Array(n),fd=n=>Uint8Array.from(n);function pf(n,e,t){if(typeof n!="number"||n<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof t!="function")throw new Error("hmacFn must be a function");let r=ia(n),s=ia(n),i=0;const o=()=>{r.fill(1),s.fill(0),i=0},a=(...E)=>t(s,r,...E),l=(E=ia())=>{s=a(fd([0]),E),r=a(),E.length!==0&&(s=a(fd([1]),E),r=a())},h=()=>{if(i++>=1e3)throw new Error("drbg: tried 1000 values");let E=0;const S=[];for(;E<e;){r=a();const A=r.slice();S.push(A),E+=r.length}return Cr(...S)};return(E,S)=>{o(),l(E);let A;for(;!(A=S(h()));)l();return o(),A}}const fb={bigint:n=>typeof n=="bigint",function:n=>typeof n=="function",boolean:n=>typeof n=="boolean",string:n=>typeof n=="string",stringOrUint8Array:n=>typeof n=="string"||Br(n),isSafeInteger:n=>Number.isSafeInteger(n),array:n=>Array.isArray(n),field:(n,e)=>e.Fp.isValid(n),hash:n=>typeof n=="function"&&Number.isSafeInteger(n.outputLen)};function is(n,e,t={}){const r=(s,i,o)=>{const a=fb[i];if(typeof a!="function")throw new Error("invalid validator function");const l=n[s];if(!(o&&l===void 0)&&!a(l,n))throw new Error("param "+String(s)+" is invalid. Expected "+i+", got "+l)};for(const[s,i]of Object.entries(e))r(s,i,!1);for(const[s,i]of Object.entries(t))r(s,i,!0);return n}const hb=()=>{throw new Error("not implemented")};function _s(n){const e=new WeakMap;return(t,...r)=>{const s=e.get(t);if(s!==void 0)return s;const i=n(t,...r);return e.set(t,i),i}}const mb=Object.freeze(Object.defineProperty({__proto__:null,aInRange:tn,abool:qn,abytes:Xs,bitGet:db,bitLen:bf,bitMask:Lc,bitSet:ub,bytesToHex:xr,bytesToNumberBE:mr,bytesToNumberLE:Kr,concatBytes:Cr,createHmacDrbg:pf,ensureBytes:At,equalBytes:cb,hexToBytes:$r,hexToNumber:Pc,inRange:ao,isBytes:Br,memoized:_s,notImplemented:hb,numberToBytesBE:Vr,numberToBytesLE:Us,numberToHexUnpadded:Or,numberToVarBytesBE:ab,utf8ToBytes:lb,validateObject:is},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const kt=BigInt(0),Ye=BigInt(1),ir=BigInt(2),bb=BigInt(3),ja=BigInt(4),hd=BigInt(5),md=BigInt(8);function je(n,e){const t=n%e;return t>=kt?t:e+t}function pb(n,e,t){if(e<kt)throw new Error("invalid exponent, negatives unsupported");if(t<=kt)throw new Error("invalid modulus");if(t===Ye)return kt;let r=Ye;for(;e>kt;)e&Ye&&(r=r*n%t),n=n*n%t,e>>=Ye;return r}function Je(n,e,t){let r=n;for(;e-- >kt;)r*=r,r%=t;return r}function $a(n,e){if(n===kt)throw new Error("invert: expected non-zero number");if(e<=kt)throw new Error("invert: expected positive modulus, got "+e);let t=je(n,e),r=e,s=kt,i=Ye;for(;t!==kt;){const a=r/t,l=r%t,h=s-i*a;r=t,t=l,s=i,i=h}if(r!==Ye)throw new Error("invert: does not exist");return je(s,e)}function gb(n){const e=(n-Ye)/ir;let t,r,s;for(t=n-Ye,r=0;t%ir===kt;t/=ir,r++);for(s=ir;s<n&&pb(s,e,n)!==n-Ye;s++)if(s>1e3)throw new Error("Cannot find square root: likely non-prime P");if(r===1){const o=(n+Ye)/ja;return function(l,h){const m=l.pow(h,o);if(!l.eql(l.sqr(m),h))throw new Error("Cannot find square root");return m}}const i=(t+Ye)/ir;return function(a,l){if(a.pow(l,e)===a.neg(a.ONE))throw new Error("Cannot find square root");let h=r,m=a.pow(a.mul(a.ONE,s),t),E=a.pow(l,i),S=a.pow(l,t);for(;!a.eql(S,a.ONE);){if(a.eql(S,a.ZERO))return a.ZERO;let A=1;for(let D=a.sqr(S);A<h&&!a.eql(D,a.ONE);A++)D=a.sqr(D);const g=a.pow(m,Ye<<BigInt(h-A-1));m=a.sqr(g),E=a.mul(E,g),S=a.mul(S,m),h=A}return E}}function yb(n){if(n%ja===bb){const e=(n+Ye)/ja;return function(r,s){const i=r.pow(s,e);if(!r.eql(r.sqr(i),s))throw new Error("Cannot find square root");return i}}if(n%md===hd){const e=(n-hd)/md;return function(r,s){const i=r.mul(s,ir),o=r.pow(i,e),a=r.mul(s,o),l=r.mul(r.mul(a,ir),o),h=r.mul(a,r.sub(l,r.ONE));if(!r.eql(r.sqr(h),s))throw new Error("Cannot find square root");return h}}return gb(n)}const wb=(n,e)=>(je(n,e)&Ye)===Ye,Ab=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Eb(n){const e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},t=Ab.reduce((r,s)=>(r[s]="function",r),e);return is(n,t)}function Bb(n,e,t){if(t<kt)throw new Error("invalid exponent, negatives unsupported");if(t===kt)return n.ONE;if(t===Ye)return e;let r=n.ONE,s=e;for(;t>kt;)t&Ye&&(r=n.mul(r,s)),s=n.sqr(s),t>>=Ye;return r}function xb(n,e){const t=new Array(e.length),r=e.reduce((i,o,a)=>n.is0(o)?i:(t[a]=i,n.mul(i,o)),n.ONE),s=n.inv(r);return e.reduceRight((i,o,a)=>n.is0(o)?i:(t[a]=n.mul(i,t[a]),n.mul(i,o)),s),t}function gf(n,e){const t=e!==void 0?e:n.toString(2).length,r=Math.ceil(t/8);return{nBitLength:t,nByteLength:r}}function co(n,e,t=!1,r={}){if(n<=kt)throw new Error("invalid field: expected ORDER > 0, got "+n);const{nBitLength:s,nByteLength:i}=gf(n,e);if(i>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let o;const a=Object.freeze({ORDER:n,isLE:t,BITS:s,BYTES:i,MASK:Lc(s),ZERO:kt,ONE:Ye,create:l=>je(l,n),isValid:l=>{if(typeof l!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof l);return kt<=l&&l<n},is0:l=>l===kt,isOdd:l=>(l&Ye)===Ye,neg:l=>je(-l,n),eql:(l,h)=>l===h,sqr:l=>je(l*l,n),add:(l,h)=>je(l+h,n),sub:(l,h)=>je(l-h,n),mul:(l,h)=>je(l*h,n),pow:(l,h)=>Bb(a,l,h),div:(l,h)=>je(l*$a(h,n),n),sqrN:l=>l*l,addN:(l,h)=>l+h,subN:(l,h)=>l-h,mulN:(l,h)=>l*h,inv:l=>$a(l,n),sqrt:r.sqrt||(l=>(o||(o=yb(n)),o(a,l))),invertBatch:l=>xb(a,l),cmov:(l,h,m)=>m?h:l,toBytes:l=>t?Us(l,i):Vr(l,i),fromBytes:l=>{if(l.length!==i)throw new Error("Field.fromBytes: expected "+i+" bytes, got "+l.length);return t?Kr(l):mr(l)}});return Object.freeze(a)}function yf(n){if(typeof n!="bigint")throw new Error("field order must be bigint");const e=n.toString(2).length;return Math.ceil(e/8)}function wf(n){const e=yf(n);return e+Math.ceil(e/2)}function Cb(n,e,t=!1){const r=n.length,s=yf(e),i=wf(e);if(r<16||r<i||r>1024)throw new Error("expected "+i+"-1024 bytes of input, got "+r);const o=t?Kr(n):mr(n),a=je(o,e-Ye)+Ye;return t?Us(a,s):Vr(a,s)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const bd=BigInt(0),ci=BigInt(1);function oa(n,e){const t=e.negate();return n?t:e}function Af(n,e){if(!Number.isSafeInteger(n)||n<=0||n>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+n)}function aa(n,e){Af(n,e);const t=Math.ceil(e/n)+1,r=2**(n-1);return{windows:t,windowSize:r}}function Sb(n,e){if(!Array.isArray(n))throw new Error("array expected");n.forEach((t,r)=>{if(!(t instanceof e))throw new Error("invalid point at index "+r)})}function Db(n,e){if(!Array.isArray(n))throw new Error("array of scalars expected");n.forEach((t,r)=>{if(!e.isValid(t))throw new Error("invalid scalar at index "+r)})}const ca=new WeakMap,Ef=new WeakMap;function la(n){return Ef.get(n)||1}function Bf(n,e){return{constTimeNegate:oa,hasPrecomputes(t){return la(t)!==1},unsafeLadder(t,r,s=n.ZERO){let i=t;for(;r>bd;)r&ci&&(s=s.add(i)),i=i.double(),r>>=ci;return s},precomputeWindow(t,r){const{windows:s,windowSize:i}=aa(r,e),o=[];let a=t,l=a;for(let h=0;h<s;h++){l=a,o.push(l);for(let m=1;m<i;m++)l=l.add(a),o.push(l);a=l.double()}return o},wNAF(t,r,s){const{windows:i,windowSize:o}=aa(t,e);let a=n.ZERO,l=n.BASE;const h=BigInt(2**t-1),m=2**t,E=BigInt(t);for(let S=0;S<i;S++){const A=S*o;let g=Number(s&h);s>>=E,g>o&&(g-=m,s+=ci);const D=A,x=A+Math.abs(g)-1,U=S%2!==0,R=g<0;g===0?l=l.add(oa(U,r[D])):a=a.add(oa(R,r[x]))}return{p:a,f:l}},wNAFUnsafe(t,r,s,i=n.ZERO){const{windows:o,windowSize:a}=aa(t,e),l=BigInt(2**t-1),h=2**t,m=BigInt(t);for(let E=0;E<o;E++){const S=E*a;if(s===bd)break;let A=Number(s&l);if(s>>=m,A>a&&(A-=h,s+=ci),A===0)continue;let g=r[S+Math.abs(A)-1];A<0&&(g=g.negate()),i=i.add(g)}return i},getPrecomputes(t,r,s){let i=ca.get(r);return i||(i=this.precomputeWindow(r,t),t!==1&&ca.set(r,s(i))),i},wNAFCached(t,r,s){const i=la(t);return this.wNAF(i,this.getPrecomputes(i,t,s),r)},wNAFCachedUnsafe(t,r,s,i){const o=la(t);return o===1?this.unsafeLadder(t,r,i):this.wNAFUnsafe(o,this.getPrecomputes(o,t,s),r,i)},setWindowSize(t,r){Af(r,e),Ef.set(t,r),ca.delete(t)}}}function xf(n,e,t,r){if(Sb(t,n),Db(r,e),t.length!==r.length)throw new Error("arrays of points and scalars must have equal length");const s=n.ZERO,i=bf(BigInt(t.length)),o=i>12?i-3:i>4?i-2:i?2:1,a=(1<<o)-1,l=new Array(a+1).fill(s),h=Math.floor((e.BITS-1)/o)*o;let m=s;for(let E=h;E>=0;E-=o){l.fill(s);for(let A=0;A<r.length;A++){const g=r[A],D=Number(g>>BigInt(E)&BigInt(a));l[D]=l[D].add(t[A])}let S=s;for(let A=l.length-1,g=s;A>0;A--)g=g.add(l[A]),S=S.add(g);if(m=m.add(S),E!==0)for(let A=0;A<o;A++)m=m.double()}return m}function Oc(n){return Eb(n.Fp),is(n,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...gf(n.n,n.nBitLength),...n,p:n.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function pd(n){n.lowS!==void 0&&qn("lowS",n.lowS),n.prehash!==void 0&&qn("prehash",n.prehash)}function vb(n){const e=Oc(n);is(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:t,Fp:r,a:s}=e;if(t){if(!r.eql(s,r.ZERO))throw new Error("invalid endomorphism, can only be defined for Koblitz curves that have a=0");if(typeof t!="object"||typeof t.beta!="bigint"||typeof t.splitScalar!="function")throw new Error("invalid endomorphism, expected beta: bigint and splitScalar: function")}return Object.freeze({...e})}const{bytesToNumberBE:kb,hexToBytes:Fb}=mb;class Tb extends Error{constructor(e=""){super(e)}}const Wn={Err:Tb,_tlv:{encode:(n,e)=>{const{Err:t}=Wn;if(n<0||n>256)throw new t("tlv.encode: wrong tag");if(e.length&1)throw new t("tlv.encode: unpadded data");const r=e.length/2,s=Or(r);if(s.length/2&128)throw new t("tlv.encode: long form length too big");const i=r>127?Or(s.length/2|128):"";return Or(n)+i+s+e},decode(n,e){const{Err:t}=Wn;let r=0;if(n<0||n>256)throw new t("tlv.encode: wrong tag");if(e.length<2||e[r++]!==n)throw new t("tlv.decode: wrong tlv");const s=e[r++],i=!!(s&128);let o=0;if(!i)o=s;else{const l=s&127;if(!l)throw new t("tlv.decode(long): indefinite length not supported");if(l>4)throw new t("tlv.decode(long): byte length is too big");const h=e.subarray(r,r+l);if(h.length!==l)throw new t("tlv.decode: length bytes not complete");if(h[0]===0)throw new t("tlv.decode(long): zero leftmost byte");for(const m of h)o=o<<8|m;if(r+=l,o<128)throw new t("tlv.decode(long): not minimal encoding")}const a=e.subarray(r,r+o);if(a.length!==o)throw new t("tlv.decode: wrong value length");return{v:a,l:e.subarray(r+o)}}},_int:{encode(n){const{Err:e}=Wn;if(n<Pn)throw new e("integer: negative integers are not allowed");let t=Or(n);if(Number.parseInt(t[0],16)&8&&(t="00"+t),t.length&1)throw new e("unexpected DER parsing assertion: unpadded hex");return t},decode(n){const{Err:e}=Wn;if(n[0]&128)throw new e("invalid signature integer: negative");if(n[0]===0&&!(n[1]&128))throw new e("invalid signature integer: unnecessary leading zero");return kb(n)}},toSig(n){const{Err:e,_int:t,_tlv:r}=Wn,s=typeof n=="string"?Fb(n):n;Xs(s);const{v:i,l:o}=r.decode(48,s);if(o.length)throw new e("invalid signature: left bytes after parsing");const{v:a,l}=r.decode(2,i),{v:h,l:m}=r.decode(2,l);if(m.length)throw new e("invalid signature: left bytes after parsing");return{r:t.decode(a),s:t.decode(h)}},hexFromSig(n){const{_tlv:e,_int:t}=Wn,r=e.encode(2,t.encode(n.r)),s=e.encode(2,t.encode(n.s)),i=r+s;return e.encode(48,i)}},Pn=BigInt(0),St=BigInt(1);BigInt(2);const gd=BigInt(3);BigInt(4);function Ib(n){const e=vb(n),{Fp:t}=e,r=co(e.n,e.nBitLength),s=e.toBytes||((D,x,U)=>{const R=x.toAffine();return Cr(Uint8Array.from([4]),t.toBytes(R.x),t.toBytes(R.y))}),i=e.fromBytes||(D=>{const x=D.subarray(1),U=t.fromBytes(x.subarray(0,t.BYTES)),R=t.fromBytes(x.subarray(t.BYTES,2*t.BYTES));return{x:U,y:R}});function o(D){const{a:x,b:U}=e,R=t.sqr(D),F=t.mul(R,D);return t.add(t.add(F,t.mul(D,x)),U)}if(!t.eql(t.sqr(e.Gy),o(e.Gx)))throw new Error("bad generator point: equation left != right");function a(D){return ao(D,St,e.n)}function l(D){const{allowedPrivateKeyLengths:x,nByteLength:U,wrapPrivateKey:R,n:F}=e;if(x&&typeof D!="bigint"){if(Br(D)&&(D=xr(D)),typeof D!="string"||!x.includes(D.length))throw new Error("invalid private key");D=D.padStart(U*2,"0")}let W;try{W=typeof D=="bigint"?D:mr(At("private key",D,U))}catch{throw new Error("invalid private key, expected hex or "+U+" bytes, got "+typeof D)}return R&&(W=je(W,F)),tn("private key",W,St,F),W}function h(D){if(!(D instanceof S))throw new Error("ProjectivePoint expected")}const m=_s((D,x)=>{const{px:U,py:R,pz:F}=D;if(t.eql(F,t.ONE))return{x:U,y:R};const W=D.is0();x==null&&(x=W?t.ONE:t.inv(F));const z=t.mul(U,x),H=t.mul(R,x),K=t.mul(F,x);if(W)return{x:t.ZERO,y:t.ZERO};if(!t.eql(K,t.ONE))throw new Error("invZ was invalid");return{x:z,y:H}}),E=_s(D=>{if(D.is0()){if(e.allowInfinityPoint&&!t.is0(D.py))return;throw new Error("bad point: ZERO")}const{x,y:U}=D.toAffine();if(!t.isValid(x)||!t.isValid(U))throw new Error("bad point: x or y not FE");const R=t.sqr(U),F=o(x);if(!t.eql(R,F))throw new Error("bad point: equation left != right");if(!D.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class S{constructor(x,U,R){if(this.px=x,this.py=U,this.pz=R,x==null||!t.isValid(x))throw new Error("x required");if(U==null||!t.isValid(U))throw new Error("y required");if(R==null||!t.isValid(R))throw new Error("z required");Object.freeze(this)}static fromAffine(x){const{x:U,y:R}=x||{};if(!x||!t.isValid(U)||!t.isValid(R))throw new Error("invalid affine point");if(x instanceof S)throw new Error("projective point not allowed");const F=W=>t.eql(W,t.ZERO);return F(U)&&F(R)?S.ZERO:new S(U,R,t.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(x){const U=t.invertBatch(x.map(R=>R.pz));return x.map((R,F)=>R.toAffine(U[F])).map(S.fromAffine)}static fromHex(x){const U=S.fromAffine(i(At("pointHex",x)));return U.assertValidity(),U}static fromPrivateKey(x){return S.BASE.multiply(l(x))}static msm(x,U){return xf(S,r,x,U)}_setWindowSize(x){g.setWindowSize(this,x)}assertValidity(){E(this)}hasEvenY(){const{y:x}=this.toAffine();if(t.isOdd)return!t.isOdd(x);throw new Error("Field doesn't support isOdd")}equals(x){h(x);const{px:U,py:R,pz:F}=this,{px:W,py:z,pz:H}=x,K=t.eql(t.mul(U,H),t.mul(W,F)),G=t.eql(t.mul(R,H),t.mul(z,F));return K&&G}negate(){return new S(this.px,t.neg(this.py),this.pz)}double(){const{a:x,b:U}=e,R=t.mul(U,gd),{px:F,py:W,pz:z}=this;let H=t.ZERO,K=t.ZERO,G=t.ZERO,V=t.mul(F,F),ie=t.mul(W,W),ne=t.mul(z,z),ae=t.mul(F,W);return ae=t.add(ae,ae),G=t.mul(F,z),G=t.add(G,G),H=t.mul(x,G),K=t.mul(R,ne),K=t.add(H,K),H=t.sub(ie,K),K=t.add(ie,K),K=t.mul(H,K),H=t.mul(ae,H),G=t.mul(R,G),ne=t.mul(x,ne),ae=t.sub(V,ne),ae=t.mul(x,ae),ae=t.add(ae,G),G=t.add(V,V),V=t.add(G,V),V=t.add(V,ne),V=t.mul(V,ae),K=t.add(K,V),ne=t.mul(W,z),ne=t.add(ne,ne),V=t.mul(ne,ae),H=t.sub(H,V),G=t.mul(ne,ie),G=t.add(G,G),G=t.add(G,G),new S(H,K,G)}add(x){h(x);const{px:U,py:R,pz:F}=this,{px:W,py:z,pz:H}=x;let K=t.ZERO,G=t.ZERO,V=t.ZERO;const ie=e.a,ne=t.mul(e.b,gd);let ae=t.mul(U,W),I=t.mul(R,z),c=t.mul(F,H),b=t.add(U,R),p=t.add(W,z);b=t.mul(b,p),p=t.add(ae,I),b=t.sub(b,p),p=t.add(U,F);let y=t.add(W,H);return p=t.mul(p,y),y=t.add(ae,c),p=t.sub(p,y),y=t.add(R,F),K=t.add(z,H),y=t.mul(y,K),K=t.add(I,c),y=t.sub(y,K),V=t.mul(ie,p),K=t.mul(ne,c),V=t.add(K,V),K=t.sub(I,V),V=t.add(I,V),G=t.mul(K,V),I=t.add(ae,ae),I=t.add(I,ae),c=t.mul(ie,c),p=t.mul(ne,p),I=t.add(I,c),c=t.sub(ae,c),c=t.mul(ie,c),p=t.add(p,c),ae=t.mul(I,p),G=t.add(G,ae),ae=t.mul(y,p),K=t.mul(b,K),K=t.sub(K,ae),ae=t.mul(b,I),V=t.mul(y,V),V=t.add(V,ae),new S(K,G,V)}subtract(x){return this.add(x.negate())}is0(){return this.equals(S.ZERO)}wNAF(x){return g.wNAFCached(this,x,S.normalizeZ)}multiplyUnsafe(x){const{endo:U,n:R}=e;tn("scalar",x,Pn,R);const F=S.ZERO;if(x===Pn)return F;if(this.is0()||x===St)return this;if(!U||g.hasPrecomputes(this))return g.wNAFCachedUnsafe(this,x,S.normalizeZ);let{k1neg:W,k1:z,k2neg:H,k2:K}=U.splitScalar(x),G=F,V=F,ie=this;for(;z>Pn||K>Pn;)z&St&&(G=G.add(ie)),K&St&&(V=V.add(ie)),ie=ie.double(),z>>=St,K>>=St;return W&&(G=G.negate()),H&&(V=V.negate()),V=new S(t.mul(V.px,U.beta),V.py,V.pz),G.add(V)}multiply(x){const{endo:U,n:R}=e;tn("scalar",x,St,R);let F,W;if(U){const{k1neg:z,k1:H,k2neg:K,k2:G}=U.splitScalar(x);let{p:V,f:ie}=this.wNAF(H),{p:ne,f:ae}=this.wNAF(G);V=g.constTimeNegate(z,V),ne=g.constTimeNegate(K,ne),ne=new S(t.mul(ne.px,U.beta),ne.py,ne.pz),F=V.add(ne),W=ie.add(ae)}else{const{p:z,f:H}=this.wNAF(x);F=z,W=H}return S.normalizeZ([F,W])[0]}multiplyAndAddUnsafe(x,U,R){const F=S.BASE,W=(H,K)=>K===Pn||K===St||!H.equals(F)?H.multiplyUnsafe(K):H.multiply(K),z=W(this,U).add(W(x,R));return z.is0()?void 0:z}toAffine(x){return m(this,x)}isTorsionFree(){const{h:x,isTorsionFree:U}=e;if(x===St)return!0;if(U)return U(S,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:x,clearCofactor:U}=e;return x===St?this:U?U(S,this):this.multiplyUnsafe(e.h)}toRawBytes(x=!0){return qn("isCompressed",x),this.assertValidity(),s(S,this,x)}toHex(x=!0){return qn("isCompressed",x),xr(this.toRawBytes(x))}}S.BASE=new S(e.Gx,e.Gy,t.ONE),S.ZERO=new S(t.ZERO,t.ONE,t.ZERO);const A=e.nBitLength,g=Bf(S,e.endo?Math.ceil(A/2):A);return{CURVE:e,ProjectivePoint:S,normPrivateKeyToScalar:l,weierstrassEquation:o,isWithinCurveOrder:a}}function Ub(n){const e=Oc(n);return is(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function _b(n){const e=Ub(n),{Fp:t,n:r}=e,s=t.BYTES+1,i=2*t.BYTES+1;function o(c){return je(c,r)}function a(c){return $a(c,r)}const{ProjectivePoint:l,normPrivateKeyToScalar:h,weierstrassEquation:m,isWithinCurveOrder:E}=Ib({...e,toBytes(c,b,p){const y=b.toAffine(),C=t.toBytes(y.x),T=Cr;return qn("isCompressed",p),p?T(Uint8Array.from([b.hasEvenY()?2:3]),C):T(Uint8Array.from([4]),C,t.toBytes(y.y))},fromBytes(c){const b=c.length,p=c[0],y=c.subarray(1);if(b===s&&(p===2||p===3)){const C=mr(y);if(!ao(C,St,t.ORDER))throw new Error("Point is not on curve");const T=m(C);let _;try{_=t.sqrt(T)}catch(k){const $=k instanceof Error?": "+k.message:"";throw new Error("Point is not on curve"+$)}const B=(_&St)===St;return(p&1)===1!==B&&(_=t.neg(_)),{x:C,y:_}}else if(b===i&&p===4){const C=t.fromBytes(y.subarray(0,t.BYTES)),T=t.fromBytes(y.subarray(t.BYTES,2*t.BYTES));return{x:C,y:T}}else{const C=s,T=i;throw new Error("invalid Point, expected length of "+C+", or uncompressed "+T+", got "+b)}}}),S=c=>xr(Vr(c,e.nByteLength));function A(c){const b=r>>St;return c>b}function g(c){return A(c)?o(-c):c}const D=(c,b,p)=>mr(c.slice(b,p));class x{constructor(b,p,y){this.r=b,this.s=p,this.recovery=y,this.assertValidity()}static fromCompact(b){const p=e.nByteLength;return b=At("compactSignature",b,p*2),new x(D(b,0,p),D(b,p,2*p))}static fromDER(b){const{r:p,s:y}=Wn.toSig(At("DER",b));return new x(p,y)}assertValidity(){tn("r",this.r,St,r),tn("s",this.s,St,r)}addRecoveryBit(b){return new x(this.r,this.s,b)}recoverPublicKey(b){const{r:p,s:y,recovery:C}=this,T=H(At("msgHash",b));if(C==null||![0,1,2,3].includes(C))throw new Error("recovery id invalid");const _=C===2||C===3?p+e.n:p;if(_>=t.ORDER)throw new Error("recovery id 2 or 3 invalid");const B=C&1?"03":"02",u=l.fromHex(B+S(_)),k=a(_),$=o(-T*k),Z=o(y*k),ee=l.BASE.multiplyAndAddUnsafe(u,$,Z);if(!ee)throw new Error("point at infinify");return ee.assertValidity(),ee}hasHighS(){return A(this.s)}normalizeS(){return this.hasHighS()?new x(this.r,o(-this.s),this.recovery):this}toDERRawBytes(){return $r(this.toDERHex())}toDERHex(){return Wn.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return $r(this.toCompactHex())}toCompactHex(){return S(this.r)+S(this.s)}}const U={isValidPrivateKey(c){try{return h(c),!0}catch{return!1}},normPrivateKeyToScalar:h,randomPrivateKey:()=>{const c=wf(e.n);return Cb(e.randomBytes(c),e.n)},precompute(c=8,b=l.BASE){return b._setWindowSize(c),b.multiply(BigInt(3)),b}};function R(c,b=!0){return l.fromPrivateKey(c).toRawBytes(b)}function F(c){const b=Br(c),p=typeof c=="string",y=(b||p)&&c.length;return b?y===s||y===i:p?y===2*s||y===2*i:c instanceof l}function W(c,b,p=!0){if(F(c))throw new Error("first arg must be private key");if(!F(b))throw new Error("second arg must be public key");return l.fromHex(b).multiply(h(c)).toRawBytes(p)}const z=e.bits2int||function(c){if(c.length>8192)throw new Error("input is too large");const b=mr(c),p=c.length*8-e.nBitLength;return p>0?b>>BigInt(p):b},H=e.bits2int_modN||function(c){return o(z(c))},K=Lc(e.nBitLength);function G(c){return tn("num < 2^"+e.nBitLength,c,Pn,K),Vr(c,e.nByteLength)}function V(c,b,p=ie){if(["recovered","canonical"].some(le=>le in p))throw new Error("sign() legacy options not supported");const{hash:y,randomBytes:C}=e;let{lowS:T,prehash:_,extraEntropy:B}=p;T==null&&(T=!0),c=At("msgHash",c),pd(p),_&&(c=At("prehashed msgHash",y(c)));const u=H(c),k=h(b),$=[G(k),G(u)];if(B!=null&&B!==!1){const le=B===!0?C(t.BYTES):B;$.push(At("extraEntropy",le))}const Z=Cr(...$),ee=u;function Ae(le){const ue=z(le);if(!E(ue))return;const Ze=a(ue),Ee=l.BASE.multiply(ue).toAffine(),ye=o(Ee.x);if(ye===Pn)return;const tt=o(Ze*o(ee+ye*k));if(tt===Pn)return;let Ce=(Ee.x===ye?0:2)|Number(Ee.y&St),ke=tt;return T&&A(tt)&&(ke=g(tt),Ce^=1),new x(ye,ke,Ce)}return{seed:Z,k2sig:Ae}}const ie={lowS:e.lowS,prehash:!1},ne={lowS:e.lowS,prehash:!1};function ae(c,b,p=ie){const{seed:y,k2sig:C}=V(c,b,p),T=e;return pf(T.hash.outputLen,T.nByteLength,T.hmac)(y,C)}l.BASE._setWindowSize(8);function I(c,b,p,y=ne){var Ce;const C=c;b=At("msgHash",b),p=At("publicKey",p);const{lowS:T,prehash:_,format:B}=y;if(pd(y),"strict"in y)throw new Error("options.strict was renamed to lowS");if(B!==void 0&&B!=="compact"&&B!=="der")throw new Error("format must be compact or der");const u=typeof C=="string"||Br(C),k=!u&&!B&&typeof C=="object"&&C!==null&&typeof C.r=="bigint"&&typeof C.s=="bigint";if(!u&&!k)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let $,Z;try{if(k&&($=new x(C.r,C.s)),u){try{B!=="compact"&&($=x.fromDER(C))}catch(ke){if(!(ke instanceof Wn.Err))throw ke}!$&&B!=="der"&&($=x.fromCompact(C))}Z=l.fromHex(p)}catch{return!1}if(!$||T&&$.hasHighS())return!1;_&&(b=e.hash(b));const{r:ee,s:Ae}=$,le=H(b),ue=a(Ae),Ze=o(le*ue),Ee=o(ee*ue),ye=(Ce=l.BASE.multiplyAndAddUnsafe(Z,Ze,Ee))==null?void 0:Ce.toAffine();return ye?o(ye.x)===ee:!1}return{CURVE:e,getPublicKey:R,getSharedSecret:W,sign:ae,verify:I,ProjectivePoint:l,Signature:x,utils:U}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Mb(n){return{hash:n,hmac:(e,...t)=>Wc(n,e,Qu(...t)),randomBytes:Mc}}function Rb(n,e){const t=r=>_b({...n,...Mb(r)});return{...t(e),create:t}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Cf=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),yd=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Wb=BigInt(1),Va=BigInt(2),wd=(n,e)=>(n+e/Va)/e;function Pb(n){const e=Cf,t=BigInt(3),r=BigInt(6),s=BigInt(11),i=BigInt(22),o=BigInt(23),a=BigInt(44),l=BigInt(88),h=n*n*n%e,m=h*h*n%e,E=Je(m,t,e)*m%e,S=Je(E,t,e)*m%e,A=Je(S,Va,e)*h%e,g=Je(A,s,e)*A%e,D=Je(g,i,e)*g%e,x=Je(D,a,e)*D%e,U=Je(x,l,e)*x%e,R=Je(U,a,e)*D%e,F=Je(R,t,e)*m%e,W=Je(F,o,e)*g%e,z=Je(W,r,e)*h%e,H=Je(z,Va,e);if(!Ga.eql(Ga.sqr(H),n))throw new Error("Cannot find square root");return H}const Ga=co(Cf,void 0,void 0,{sqrt:Pb}),Hn=Rb({a:BigInt(0),b:BigInt(7),Fp:Ga,n:yd,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:n=>{const e=yd,t=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-Wb*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=t,o=BigInt("0x100000000000000000000000000000000"),a=wd(i*n,e),l=wd(-r*n,e);let h=je(n-a*t-l*s,e),m=je(-a*r-l*i,e);const E=h>o,S=m>o;if(E&&(h=e-h),S&&(m=e-m),h>o||m>o)throw new Error("splitScalar: Endomorphism failed, k="+n);return{k1neg:E,k1:h,k2neg:S,k2:m}}}},Ts);BigInt(0);Hn.ProjectivePoint;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const ln=BigInt(0),$t=BigInt(1),li=BigInt(2),Lb=BigInt(8),Ob={zip215:!0};function Nb(n){const e=Oc(n);return is(n,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...e})}function zb(n){const e=Nb(n),{Fp:t,n:r,prehash:s,hash:i,randomBytes:o,nByteLength:a,h:l}=e,h=li<<BigInt(a*8)-$t,m=t.create,E=co(e.n,e.nBitLength),S=e.uvRatio||((p,y)=>{try{return{isValid:!0,value:t.sqrt(p*t.inv(y))}}catch{return{isValid:!1,value:ln}}}),A=e.adjustScalarBytes||(p=>p),g=e.domain||((p,y,C)=>{if(qn("phflag",C),y.length||C)throw new Error("Contexts/pre-hash are not supported");return p});function D(p,y){tn("coordinate "+p,y,ln,h)}function x(p){if(!(p instanceof F))throw new Error("ExtendedPoint expected")}const U=_s((p,y)=>{const{ex:C,ey:T,ez:_}=p,B=p.is0();y==null&&(y=B?Lb:t.inv(_));const u=m(C*y),k=m(T*y),$=m(_*y);if(B)return{x:ln,y:$t};if($!==$t)throw new Error("invZ was invalid");return{x:u,y:k}}),R=_s(p=>{const{a:y,d:C}=e;if(p.is0())throw new Error("bad point: ZERO");const{ex:T,ey:_,ez:B,et:u}=p,k=m(T*T),$=m(_*_),Z=m(B*B),ee=m(Z*Z),Ae=m(k*y),le=m(Z*m(Ae+$)),ue=m(ee+m(C*m(k*$)));if(le!==ue)throw new Error("bad point: equation left != right (1)");const Ze=m(T*_),Ee=m(B*u);if(Ze!==Ee)throw new Error("bad point: equation left != right (2)");return!0});class F{constructor(y,C,T,_){this.ex=y,this.ey=C,this.ez=T,this.et=_,D("x",y),D("y",C),D("z",T),D("t",_),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(y){if(y instanceof F)throw new Error("extended point not allowed");const{x:C,y:T}=y||{};return D("x",C),D("y",T),new F(C,T,$t,m(C*T))}static normalizeZ(y){const C=t.invertBatch(y.map(T=>T.ez));return y.map((T,_)=>T.toAffine(C[_])).map(F.fromAffine)}static msm(y,C){return xf(F,E,y,C)}_setWindowSize(y){H.setWindowSize(this,y)}assertValidity(){R(this)}equals(y){x(y);const{ex:C,ey:T,ez:_}=this,{ex:B,ey:u,ez:k}=y,$=m(C*k),Z=m(B*_),ee=m(T*k),Ae=m(u*_);return $===Z&&ee===Ae}is0(){return this.equals(F.ZERO)}negate(){return new F(m(-this.ex),this.ey,this.ez,m(-this.et))}double(){const{a:y}=e,{ex:C,ey:T,ez:_}=this,B=m(C*C),u=m(T*T),k=m(li*m(_*_)),$=m(y*B),Z=C+T,ee=m(m(Z*Z)-B-u),Ae=$+u,le=Ae-k,ue=$-u,Ze=m(ee*le),Ee=m(Ae*ue),ye=m(ee*ue),tt=m(le*Ae);return new F(Ze,Ee,tt,ye)}add(y){x(y);const{a:C,d:T}=e,{ex:_,ey:B,ez:u,et:k}=this,{ex:$,ey:Z,ez:ee,et:Ae}=y;if(C===BigInt(-1)){const Oe=m((B-_)*(Z+$)),Re=m((B+_)*(Z-$)),Ft=m(Re-Oe);if(Ft===ln)return this.double();const Pe=m(u*li*Ae),He=m(k*li*ee),jt=He+Pe,qe=Re+Oe,w=He-Pe,d=m(jt*Ft),f=m(qe*w),v=m(jt*w),M=m(Ft*qe);return new F(d,f,M,v)}const le=m(_*$),ue=m(B*Z),Ze=m(k*T*Ae),Ee=m(u*ee),ye=m((_+B)*($+Z)-le-ue),tt=Ee-Ze,Ce=Ee+Ze,ke=m(ue-C*le),Mr=m(ye*tt),Le=m(Ce*ke),$e=m(ye*ke),Rr=m(tt*Ce);return new F(Mr,Le,Rr,$e)}subtract(y){return this.add(y.negate())}wNAF(y){return H.wNAFCached(this,y,F.normalizeZ)}multiply(y){const C=y;tn("scalar",C,$t,r);const{p:T,f:_}=this.wNAF(C);return F.normalizeZ([T,_])[0]}multiplyUnsafe(y,C=F.ZERO){const T=y;return tn("scalar",T,ln,r),T===ln?z:this.is0()||T===$t?this:H.wNAFCachedUnsafe(this,T,F.normalizeZ,C)}isSmallOrder(){return this.multiplyUnsafe(l).is0()}isTorsionFree(){return H.unsafeLadder(this,r).is0()}toAffine(y){return U(this,y)}clearCofactor(){const{h:y}=e;return y===$t?this:this.multiplyUnsafe(y)}static fromHex(y,C=!1){const{d:T,a:_}=e,B=t.BYTES;y=At("pointHex",y,B),qn("zip215",C);const u=y.slice(),k=y[B-1];u[B-1]=k&-129;const $=Kr(u),Z=C?h:t.ORDER;tn("pointHex.y",$,ln,Z);const ee=m($*$),Ae=m(ee-$t),le=m(T*ee-_);let{isValid:ue,value:Ze}=S(Ae,le);if(!ue)throw new Error("Point.fromHex: invalid y coordinate");const Ee=(Ze&$t)===$t,ye=(k&128)!==0;if(!C&&Ze===ln&&ye)throw new Error("Point.fromHex: x=0 and x_0=1");return ye!==Ee&&(Ze=m(-Ze)),F.fromAffine({x:Ze,y:$})}static fromPrivateKey(y){return V(y).point}toRawBytes(){const{x:y,y:C}=this.toAffine(),T=Us(C,t.BYTES);return T[T.length-1]|=y&$t?128:0,T}toHex(){return xr(this.toRawBytes())}}F.BASE=new F(e.Gx,e.Gy,$t,m(e.Gx*e.Gy)),F.ZERO=new F(ln,$t,$t,ln);const{BASE:W,ZERO:z}=F,H=Bf(F,a*8);function K(p){return je(p,r)}function G(p){return K(Kr(p))}function V(p){const y=t.BYTES;p=At("private key",p,y);const C=At("hashed private key",i(p),2*y),T=A(C.slice(0,y)),_=C.slice(y,2*y),B=G(T),u=W.multiply(B),k=u.toRawBytes();return{head:T,prefix:_,scalar:B,point:u,pointBytes:k}}function ie(p){return V(p).pointBytes}function ne(p=new Uint8Array,...y){const C=Cr(...y);return G(i(g(C,At("context",p),!!s)))}function ae(p,y,C={}){p=At("message",p),s&&(p=s(p));const{prefix:T,scalar:_,pointBytes:B}=V(y),u=ne(C.context,T,p),k=W.multiply(u).toRawBytes(),$=ne(C.context,k,B,p),Z=K(u+$*_);tn("signature.s",Z,ln,r);const ee=Cr(k,Us(Z,t.BYTES));return At("result",ee,t.BYTES*2)}const I=Ob;function c(p,y,C,T=I){const{context:_,zip215:B}=T,u=t.BYTES;p=At("signature",p,2*u),y=At("message",y),C=At("publicKey",C,u),B!==void 0&&qn("zip215",B),s&&(y=s(y));const k=Kr(p.slice(u,2*u));let $,Z,ee;try{$=F.fromHex(C,B),Z=F.fromHex(p.slice(0,u),B),ee=W.multiplyUnsafe(k)}catch{return!1}if(!B&&$.isSmallOrder())return!1;const Ae=ne(_,Z.toRawBytes(),$.toRawBytes(),y);return Z.add($.multiplyUnsafe(Ae)).subtract(ee).clearCofactor().equals(F.ZERO)}return W._setWindowSize(8),{CURVE:e,getPublicKey:ie,sign:ae,verify:c,ExtendedPoint:F,utils:{getExtendedPublicKey:V,randomPrivateKey:()=>o(t.BYTES),precompute(p=8,y=F.BASE){return y._setWindowSize(p),y.multiply(BigInt(3)),y}}}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Nc=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),Ad=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");BigInt(0);const Hb=BigInt(1),Ed=BigInt(2);BigInt(3);const qb=BigInt(5),Kb=BigInt(8);function jb(n){const e=BigInt(10),t=BigInt(20),r=BigInt(40),s=BigInt(80),i=Nc,a=n*n%i*n%i,l=Je(a,Ed,i)*a%i,h=Je(l,Hb,i)*n%i,m=Je(h,qb,i)*h%i,E=Je(m,e,i)*m%i,S=Je(E,t,i)*E%i,A=Je(S,r,i)*S%i,g=Je(A,s,i)*A%i,D=Je(g,s,i)*A%i,x=Je(D,e,i)*m%i;return{pow_p_5_8:Je(x,Ed,i)*n%i,b2:a}}function $b(n){return n[0]&=248,n[31]&=127,n[31]|=64,n}function Vb(n,e){const t=Nc,r=je(e*e*e,t),s=je(r*r*e,t),i=jb(n*s).pow_p_5_8;let o=je(n*r*i,t);const a=je(e*o*o,t),l=o,h=je(o*Ad,t),m=a===n,E=a===je(-n,t),S=a===je(-n*Ad,t);return m&&(o=l),(E||S)&&(o=h),wb(o,t)&&(o=je(-o,t)),{isValid:m||E,value:o}}const Gb=co(Nc,void 0,!0),Yb={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:Gb,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:Kb,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:hf,randomBytes:Mc,adjustScalarBytes:$b,uvRatio:Vb},kr=zb(Yb),Xb=[{name:"appIdPrefix",binary:"bytes",custom:zt.encode("appID"),omit:!0},{name:"appId",binary:"uint",size:8}],mn=class mn{constructor(e,t="hex"){re(this,"address");this.address=typeof e=="string"?mn.stringToUint8Array(e,t):e}toNative(e){return tr(e,this)}unwrap(){return this.address}toString(){return _t.encode(this.address,!0)}toUint8Array(){return this.address}toUniversalAddress(){return this}equals(e){return zt.equals(this.address,e.address)}static isValidAddress(e,t="hex"){return!dm(()=>mn.stringToUint8Array(e,t))}static instanceof(e){return typeof e=="object"&&"constructor"in e&&e.constructor.type===mn.type}static stringToUint8Array(e,t){const r=(()=>{switch(t){case"hex":if(![40,2*this.byteSize].includes(e.length-(e.startsWith("0x")?2:0)))throw new Error(`string ${e} has invalid length for format ${t}`);return _t.decode(e);case"base58":return Mu.decode(e);case"bech32":return Uu.decodeToBytes(e).bytes;case"algorandAppId":return sb(Cn(Xb,{appId:BigInt(e)}));case"sha256":return Ts(e)}})();if(r.length>mn.byteSize)throw new Error(`string ${e} has invalid length for format ${t}`);return r.length<mn.byteSize?zt.zpad(r,mn.byteSize):r}};re(mn,"byteSize",32),re(mn,"type","Universal");let Nt=mn;function Zb(n){return typeof n=="object"&&"setChain"in n}const Ya=new Map;function zc(n,e){Ya.has(n)||Ya.set(n,e)}function tr(n,e){const t=ns.get(n),r=Ya.get(t);if(!r)throw new Error(`No native address type registered for platform ${t}, import the platform directly or, if using sdk package, import the addresses conditional export`);try{const s=new r(e);return Zb(s)&&s.setChain(n),s}catch(s){const i=`Error parsing address as a native ${n} address: ${s.message}`;if(Nt.instanceof(e))throw i;return new Nt(e).toNative(n)}}function Sf(n,e){const t=ns.get(n);return new Nt(e,Lm.get(t))}const Xa=(n,e)=>n?`${n}:${e}`:e,Za=new Map;function Jb(n,e,t){const r=Xa(n,e);if(Za.has(r))throw new Error(`Payload type ${r} already registered`);Za.set(r,t)}function xt(n,e){for(const[t,r]of e)Jb(n,t,r)}const Mt={binary:"uint",size:32},Qb={binary:"uint",size:2},qt=n=>({...Qb,custom:{to:e=>{if(e===0){if(!(n!=null&&n.allowNull))throw new Error("ChainId 0 is not valid for this protocol and action");return null}const t=ts(e),r=(n==null?void 0:n.allowedChains)??Ru;if(!r.includes(t))throw new Error(`Chain ${t} not in allowed chains ${r}`);return t},from:e=>e==null?0:no(e)}}),Ms={binary:"uint",size:4},Hc={binary:"uint",size:8},Df={binary:"uint",size:4},rr=n=>({name:"payloadId",binary:"uint",size:1,custom:n,omit:!0}),qc={binary:"uint",size:8};class ep{constructor(e,t,r){re(this,"r");re(this,"s");re(this,"v");this.r=e,this.s=t,this.v=r}encode(){return Cn(Ja,this)}static decode(e){return Sn(Ja,e)}}var Bd;(function(n){function e(i){return Hn.getPublicKey(i)}n.toPubkey=e;function t(i,o){if(o.length!=32)throw new Error("hash.length != 32");return Hn.sign(o,i)}n.sign=t;function r(i,o,a){const{r:l,s:h}=i;return Hn.verify({r:l,s:h},a,o)}n.validate=r;function s(i,o){const{r:a,s:l,v:h}=i,m=new Hn.Signature(a,l);return m.recovery=h,m.recoverPublicKey(o).toRawBytes()}n.recover=s})(Bd||(Bd={}));const tp=[{name:"r",binary:"uint",size:32},{name:"s",binary:"uint",size:32},{name:"v",binary:"uint",size:1}],Ja={binary:"bytes",layout:tp,custom:{to:n=>new ep(n.r,n.s,n.v),from:n=>({r:n.r,s:n.s,v:n.v})}},xe={binary:"bytes",size:32,custom:{to:n=>new Nt(n),from:n=>n.toUint8Array()}},np=n=>{const e=n.findIndex(t=>t!==0);return-1<e?n.slice(e):new Uint8Array([])},rp={to:zt.decode,from:zt.encode},vf=n=>({binary:"bytes",size:n,custom:{to:e=>zt.decode(np(e)),from:e=>zt.zpad(zt.encode(e),n)}});function kf(n){const e=n.indexOf(":");return e!==-1?[n.slice(0,e),n.slice(e+1)]:[null,n]}const sp=[{name:"guardianIndex",binary:"uint",size:1},{name:"signature",...Ja}],Kc=[{name:"version",binary:"uint",size:1,custom:1,omit:!0},{name:"guardianSet",...Df},{name:"signatures",binary:"array",lengthSize:1,layout:sp}],jc=[{name:"timestamp",binary:"uint",size:4},{name:"nonce",binary:"uint",size:4},{name:"emitterChain",...qt()},{name:"emitterAddress",...xe},{name:"sequence",...qc},{name:"consistencyLevel",binary:"uint",size:1}],ip=[...Kc,...jc];function Rs(n){const e=Za.get(n);if(!e)throw new Error(`No layout registered for payload type ${n}`);return e}function Ff(n){return{name:"payload",binary:"bytes",...n==="Uint8Array"?{}:{layout:Rs(n)}}}function Qa(n){const e=[...ip,Ff(n.payloadLiteral)];return Cn(e,n)}function op(n,e){if(n==="Uint8Array")return e;const t=Rs(n);return Cn(t,e)}function $c(n,e){const t=(()=>{if(Array.isArray(n[0]))return n.flatMap(([o,a])=>a.map(l=>Xa(o,l)));if(typeof n[1]=="string")return n;const[s,i]=n;return i.map(o=>Xa(s,o))})(),r=Bm(t.map(s=>Rs(s)));return s=>{typeof s=="string"&&(s=_t.decode(s));const i=r(s);return Array.isArray(i)?i.map(o=>t[o]):i!==null?t[i]:null}}function Ws(n,e){typeof e=="string"&&(e=_t.decode(e));const[t,r]=Sn(Kc,e,!1);for(let A=1;A<t.signatures.length;++A)if(t.signatures[A].guardianIndex<=t.signatures[A-1].guardianIndex)throw new Error("Guardian signatures must be in ascending order of guardian set index");const s=r,[i,o]=Sn(jc,e.subarray(s),!1),a=s+o,[l,h]=typeof n=="string"?[n,xd(n,e.subarray(a))]:xd(n,e.subarray(a)),[m,E]=kf(l),S=Is(e.slice(s));return{protocolName:m,payloadName:E,payloadLiteral:l,...t,...i,payload:h,hash:S}}function xd(n,e,t=0){return(()=>{if(typeof e=="string"&&(e=_t.decode(e)),n==="Uint8Array")return e.slice(t);if(typeof n=="string")return Sn(Rs(n),e.subarray(t));const r=n(e.slice(t));if(r===null)throw new Error(`Encoded data does not match any of the given payload types - ${e}`);return[r,Sn(Rs(r),e.subarray(t))]})()}const ap=[["Ethereum",[["ETH",{symbol:"ETH",decimals:18,address:"native",wrappedKey:"WETH"}],["WETH",{symbol:"WETH",decimals:18,address:"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"}],["USDCeth",{symbol:"USDC",decimals:6,address:"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"}],["WBTC",{symbol:"WBTC",decimals:8,address:"0x2260fac5e5542a773aa44fbcfedf7c193bc2c599"}],["USDT",{symbol:"USDT",decimals:6,address:"0xdac17f958d2ee523a2206206994597c13d831ec7"}],["DAI",{symbol:"DAI",decimals:18,address:"0x6b175474e89094c44da98b954eedeac495271d0f"}],["BUSD",{symbol:"BUSD",decimals:18,address:"0x4fabb145d64652a948d72533023f6e7a623c7c53"}],["WMATIC",{symbol:"WMATIC",decimals:18,address:"0x7c9f4C87d911613Fe9ca58b579f737911AAD2D43",original:"Polygon"}],["WBNB",{symbol:"WBNB",decimals:18,address:"0x418D75f65a02b3D53B2418FB8E1fe493759c7605",original:"Bsc"}],["USDCbnb",{symbol:"USDC",decimals:18,address:"0x7cd167B101D2808Cfd2C45d17b2E7EA9F46b74B6",original:"Bsc"}],["WAVAX",{symbol:"WAVAX",decimals:18,address:"0x85f138bfEE4ef8e540890CFb48F620571d67Eda3",original:"Avalanche"}],["USDCavax",{symbol:"USDC",decimals:6,address:"0x39EbF69137D98FB7659Ef8D4ea21ec26394389d7",original:"Avalanche"}],["WFTM",{symbol:"WFTM",decimals:18,address:"0x4cD2690d86284e044cb63E60F1EB218a825a7e92",original:"Fantom"}],["CELO",{symbol:"CELO",decimals:18,address:"0x3294395e62F4eB6aF3f1Fcf89f5602D90Fb3Ef69",original:"Celo"}],["WGLMR",{symbol:"WGLMR",decimals:18,address:"0x93d3696A9F879b331f40CB5059e37015423A3Bd0",original:"Moonbeam"}],["WSOL",{symbol:"WSOL",decimals:9,address:"0xD31a59c85aE9D8edEFeC411D448f90841571b89c",original:"Solana"}],["USDCsol",{symbol:"USDC",decimals:6,address:"0x41f7B8b9b897276b7AAE926a9016935280b44E97",original:"Solana"}],["SUI",{symbol:"SUI",decimals:9,address:"0x84074EA631dEc7a4edcD5303d164D5dEa4c653D6",original:"Sui"}],["APT",{symbol:"APT",decimals:8,address:"0x8CDf7AF57E4c8B930e1B23c477c22f076530585e",original:"Aptos"}],["WETHarbitrum",{symbol:"WETH",decimals:18,address:"0xb945E3F853B5f8033C8513Cf3cE9F8AD9beBB1c9",original:"Arbitrum"}],["USDCarbitrum",{symbol:"USDC",decimals:6,address:"0xCFc006a32a98031C2338BF9d5ff8ED2c0Cae4a9e",original:"Arbitrum"}],["WETHoptimism",{symbol:"WETH",decimals:18,address:"0x8B5653Ae095529155462eDa8CF664eD96773F557",original:"Optimism"}],["WETHbase",{symbol:"WETH",decimals:18,address:"0x1D4241F7370253C0f12EFC536B7e16E462Fb3526",original:"Base"}],["tBTC",{symbol:"tBTC",decimals:18,address:"0x18084fbA666a33d37592fA2633fD49a74DD93a88"}],["tBTCpolygon",{symbol:"tBTC",decimals:18,address:"0xb4c624dBC50804dA086cf2380cD55dEBC0d22E96",original:"Polygon"}],["tBTCoptimism",{symbol:"tBTC",decimals:18,address:"0xB8d1E0642bFD3744CaBd2ca8830cFabE19b2Ca54",original:"Optimism"}],["tBTCarbitrum",{symbol:"tBTC",decimals:18,address:"0x4F3819A6cfF717BFfE801a75c73A984141c76589",original:"Arbitrum"}],["tBTCbase",{symbol:"tBTC",decimals:18,address:"0x733F28B3e315046Db01dAbC292D6F0F7F26C4551",original:"Base"}],["wstETH",{symbol:"wstETH",decimals:18,address:"0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0"}],["WKLAY",{symbol:"WKLAY",decimals:18,address:"0x9AEA32B459e96C8eF5010f69130bf95fd129ac05",original:"Klaytn"}],["PYTH",{symbol:"PYTH",decimals:6,address:"0xeFc0CED4B3D536103e76a1c4c74F0385C8F4Bdd3",original:"Solana"}]]],["Bsc",[["WETH",{symbol:"WETH",decimals:18,address:"0x4DB5a66E937A9F4473fA95b1cAF1d1E1D62E29EA",original:"Ethereum"}],["USDCeth",{symbol:"USDC",decimals:6,address:"0xB04906e95AB5D797aDA81508115611fee694c2b3",original:"Ethereum"}],["WBTC",{symbol:"WBTC",decimals:8,address:"0x43359676E1A3F9FbB5de095333f8e9c1B46dFA44",original:"Ethereum"}],["USDT",{symbol:"USDT",decimals:6,address:"0x524bC91Dc82d6b90EF29F76A3ECAaBAffFD490Bc",original:"Ethereum"}],["DAI",{symbol:"DAI",decimals:18,address:"0x3413a030EF81a3dD5a302F4B4D11d911e12ed337",original:"Ethereum"}],["BUSD",{symbol:"BUSD",decimals:18,address:"0x035de3679E692C471072d1A09bEb9298fBB2BD31",original:"Ethereum"}],["WMATIC",{symbol:"WMATIC",decimals:18,address:"0xc836d8dC361E44DbE64c4862D55BA041F88Ddd39",original:"Polygon"}],["USDCpolygon",{symbol:"USDC",decimals:6,address:"0xe6d82Bbe75041E42E51d755e922cE1BA91af9c4d",original:"Polygon"}],["BNB",{symbol:"BNB",decimals:18,address:"native",wrappedKey:"WBNB"}],["WBNB",{symbol:"WBNB",decimals:18,address:"0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c"}],["USDCbnb",{symbol:"USDC",decimals:18,address:"0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d"}],["WAVAX",{symbol:"WAVAX",decimals:18,address:"0x96412902aa9aFf61E13f085e70D3152C6ef2a817",original:"Avalanche"}],["USDCavax",{symbol:"USDC",decimals:6,address:"0xc88Dc63bf0c8c8198C97Db0945E3eF25Ca89A8e4",original:"Avalanche"}],["WFTM",{symbol:"WFTM",decimals:18,address:"0xbF8413EE8612E0E4f66Aa63B5ebE27f3C5883d47",original:"Fantom"}],["CELO",{symbol:"CELO",decimals:18,address:"0x2A335e327a55b177f5B40132fEC5D7298aa0D7e6",original:"Celo"}],["WGLMR",{symbol:"WGLMR",decimals:18,address:"0x1C063db3c621BF901FC6C1D03328b08b2F9bbfba",original:"Moonbeam"}],["WSOL",{symbol:"WSOL",decimals:9,address:"0xfA54fF1a158B5189Ebba6ae130CEd6bbd3aEA76e",original:"Solana"}],["USDCsol",{symbol:"USDC",decimals:6,address:"0x91Ca579B0D47E5cfD5D0862c21D5659d39C8eCf0",original:"Solana"}],["SUI",{symbol:"SUI",decimals:9,address:"0x8314f6Bf1B4dd8604A0fC33C84F9AF2fc07AABC8",original:"Sui"}],["APT",{symbol:"APT",decimals:8,address:"0x2Ba98cf7Edd2c5C794e21bc3Dc6973D3C2585eE3",original:"Aptos"}],["WETHarbitrum",{symbol:"WETH",decimals:18,address:"0xaA1eEdABC48D078350ccBdD620bD088848e299E5",original:"Arbitrum"}],["USDCarbitrum",{symbol:"USDC",decimals:6,address:"0x5caa170b465122D15a6D20FD9A804a9613CE7882",original:"Arbitrum"}],["WETHoptimism",{symbol:"WETH",decimals:18,address:"0x94AEc09B5e2CE591e39DC6aa58A3A6E85Ed45265",original:"Optimism"}],["USDCoptimism",{symbol:"USDC",decimals:6,address:"0xa41ae127D04F7ee73B5058E2C60Fb7c7A2D21F79",original:"Optimism"}],["WETHbsc",{symbol:"WETH",decimals:18,address:"0x2170Ed0880ac9A755fd29B2688956BD959F933F8"}],["WETHbase",{symbol:"WETH",decimals:18,address:"0x9dc152F4941cE1A138326e70c3600385bf0C22dD",original:"Base"}],["USDCbase",{symbol:"USDC",decimals:6,address:"0x55CaD531c8E303Cab8B3BE4bB4744Db4f896ac81",original:"Base"}],["tBTC",{symbol:"tBTC",decimals:18,address:"0x94c97dd3Bde5bC1406BCe82E7941A6365968521D",original:"Ethereum"}],["wstETH",{symbol:"wstETH",decimals:18,address:"0xad80E1A9B5824234afA9dE1F3bbDb8a994796169",original:"Ethereum"}],["WKLAY",{symbol:"WKLAY",decimals:18,address:"0xEA970e7b7D131Ea36c3051C9Ca11e785462fE00c",original:"Klaytn"}],["PYTH",{symbol:"PYTH",decimals:6,address:"0xb0188B0bb2cD4a6D2744637fC83C94a284B247Da",original:"Solana"}],["USDTbsc",{symbol:"USDT",decimals:18,address:"0x55d398326f99059fF775485246999027B3197955"}]]],["Polygon",[["WETH",{symbol:"WETH",decimals:18,address:"0x11CD37bb86F65419713f30673A480EA33c826872",original:"Ethereum"}],["USDCeth",{symbol:"USDC",decimals:6,address:"0x4318CB63A2b8edf2De971E2F17F77097e499459D",original:"Ethereum"}],["WBTC",{symbol:"WBTC",decimals:8,address:"0x5D49c278340655B56609FdF8976eb0612aF3a0C3",original:"Ethereum"}],["USDT",{symbol:"USDT",decimals:6,address:"0x9417669fBF23357D2774e9D421307bd5eA1006d2",original:"Ethereum"}],["DAI",{symbol:"DAI",decimals:18,address:"0x732EB1747ecCFC431fF19bc359ffc83755B1918c",original:"Ethereum"}],["BUSD",{symbol:"BUSD",decimals:18,address:"0x95ea750420da26bE1Ab0891e209e921bCd84763f",original:"Ethereum"}],["MATIC",{symbol:"MATIC",decimals:18,address:"native",wrappedKey:"WMATIC"}],["WMATIC",{symbol:"WMATIC",decimals:18,address:"0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270"}],["WETHpolygon",{symbol:"WETH",decimals:18,address:"0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619"}],["USDCpolygon",{symbol:"USDC",decimals:6,address:"0x3c499c542cef5e3811e1192ce70d8cc03d5c3359"}],["WBNB",{symbol:"WBNB",decimals:18,address:"0xeCDCB5B88F8e3C15f95c720C51c71c9E2080525d",original:"Bsc"}],["USDCbnb",{symbol:"USDC",decimals:18,address:"0x4B3a922c773BDCF3BA8f1A4FDAc2029E1D0E9868",original:"Bsc"}],["WAVAX",{symbol:"WAVAX",decimals:18,address:"0x7Bb11E7f8b10E9e571E5d8Eace04735fDFB2358a",original:"Avalanche"}],["USDCavax",{symbol:"USDC",decimals:6,address:"0xAEA5CC14DefbC1b845FDE729E563B717Ee6825ae",original:"Avalanche"}],["WFTM",{symbol:"WFTM",decimals:18,address:"0x3726831304D77f585f1Aca9d9841cc3Ef80dAa62",original:"Fantom"}],["CELO",{symbol:"CELO",decimals:18,address:"0x922F49a9911effc034eE756196E59BE7b90D43b3",original:"Celo"}],["WGLMR",{symbol:"WGLMR",decimals:18,address:"0xcC48d6CF842083fEc0E01d913fB964b585975F05",original:"Moonbeam"}],["WSOL",{symbol:"WSOL",decimals:9,address:"0xd93f7E271cB87c23AaA73edC008A79646d1F9912",original:"Solana"}],["USDCsol",{symbol:"USDC",decimals:6,address:"0x576Cf361711cd940CD9C397BB98C4C896cBd38De",original:"Solana"}],["SUI",{symbol:"SUI",decimals:9,address:"0x34bE049fEbfc6C64Ffd82Da08a8931A9a45f2cc8",original:"Sui"}],["APT",{symbol:"APT",decimals:8,address:"0xa4ef199d3ad524E9C3C51Ac46B303B103A307Cef",original:"Aptos"}],["WETHarbitrum",{symbol:"WETH",decimals:18,address:"0x6a5c59AB16268d2c872916054C50440B999e417C",original:"Arbitrum"}],["USDCarbitrum",{symbol:"USDC",decimals:6,address:"0x7800FE8951cdc1cDea748d878fAce63018D97960",original:"Arbitrum"}],["WETHoptimism",{symbol:"WETH",decimals:18,address:"0x8182De59485Bb646542Db8C7E5958148Dc699319",original:"Optimism"}],["USDCoptimism",{symbol:"USDC",decimals:6,address:"0x31F12aCb60C3c32EE884F3894a873347C097D925",original:"Optimism"}],["WETHbase",{symbol:"WETH",decimals:18,address:"0x5BCf8d8c097FbB35C371F921E3FF3e6F6Eb54B41",original:"Base"}],["USDCbase",{symbol:"USDC",decimals:6,address:"0x1eeCaB0F75fE93abbFa0cDFfb4fB13d1dC8706c8",original:"Base"}],["tBTC",{symbol:"tBTC",decimals:18,address:"0x3362b2B92b331925F09F9E5bCA3E8C43921a435C",original:"Ethereum"}],["tBTCpolygon",{symbol:"tBTC",decimals:18,address:"0x236aa50979D5f3De3Bd1Eeb40E81137F22ab794b"}],["tBTCoptimism",{symbol:"tBTC",decimals:18,address:"0x68A8797da1c8ED592600d70A5151886A92D2183C",original:"Optimism"}],["tBTCarbitrum",{symbol:"tBTC",decimals:18,address:"0x045D8c62D5326aa51a31518ECF3aF80C17421Aba",original:"Arbitrum"}],["wstETH",{symbol:"wstETH",decimals:18,address:"0xe082a7Fc696De18172Ad08D956569Ee80BC37f06",original:"Ethereum"}],["wstETHpolygon",{symbol:"wstETH",decimals:18,address:"0x03b54A6e9a984069379fae1a4fC4dBAE93B3bCCD"}],["WKLAY",{symbol:"WKLAY",decimals:18,address:"0x415ce980fde17F1FF102e1c6e4ce860Acc615D74",original:"Klaytn"}],["PYTH",{symbol:"PYTH",decimals:6,address:"0xFa4B761A1e07909Ba31331a5dfa12390E3ff5583",original:"Solana"}],["USDTpolygon",{symbol:"USDT",decimals:6,address:"0xc2132D05D31c914a87C6611C10748AEb04B58e8F"}]]],["Avalanche",[["WETH",{symbol:"WETH",decimals:18,address:"0x8b82A291F83ca07Af22120ABa21632088fC92931",original:"Ethereum"}],["USDCeth",{symbol:"USDC",decimals:6,address:"0xB24CA28D4e2742907115fECda335b40dbda07a4C",original:"Ethereum"}],["WBTC",{symbol:"WBTC",decimals:8,address:"0x1C0e79C5292c59bbC13C9F9f209D204cf4d65aD6",original:"Ethereum"}],["USDT",{symbol:"USDT",decimals:6,address:"0x9d228444FC4B7E15A2C481b48E10247A03351FD8",original:"Ethereum"}],["DAI",{symbol:"DAI",decimals:18,address:"0xca319f81D147559e19A522A0a0310Dd43A96cA0F",original:"Ethereum"}],["WMATIC",{symbol:"WMATIC",decimals:18,address:"0xf2f13f0B7008ab2FA4A2418F4ccC3684E49D20Eb",original:"Polygon"}],["USDCpolygon",{symbol:"USDC",decimals:6,address:"0xDb2d08f5A9C9ADBBA0DE5a69bbB1E9Ca03411692",original:"Polygon"}],["WBNB",{symbol:"WBNB",decimals:18,address:"0x442F7f22b1EE2c842bEAFf52880d4573E9201158",original:"Bsc"}],["USDCbnb",{symbol:"USDC",decimals:18,address:"0x6145E8a910aE937913426BF32De2b26039728ACF",original:"Bsc"}],["AVAX",{symbol:"AVAX",decimals:18,address:"native",wrappedKey:"WAVAX"}],["WAVAX",{symbol:"WAVAX",decimals:18,address:"0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7"}],["USDCavax",{symbol:"USDC",decimals:6,address:"0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E"}],["WETHavax",{symbol:"WETH",decimals:18,address:"0x49d5c2bdffac6ce2bfdb6640f4f80f226bc10bab"}],["WFTM",{symbol:"WFTM",decimals:18,address:"0xd19abc09B7b36F7558929b97a866f499a26c2f83",original:"Fantom"}],["CELO",{symbol:"CELO",decimals:18,address:"0x494317B8521c5a5287a06DEE467dd6fe285dA4a8",original:"Celo"}],["WGLMR",{symbol:"WGLMR",decimals:18,address:"0x375aA6C67BF499fBf01804A9f92C03c0776F372d",original:"Moonbeam"}],["WSOL",{symbol:"WSOL",decimals:9,address:"0xFE6B19286885a4F7F55AdAD09C3Cd1f906D2478F",original:"Solana"}],["USDCsol",{symbol:"USDC",decimals:6,address:"0x0950Fc1AD509358dAeaD5eB8020a3c7d8b43b9DA",original:"Solana"}],["SUI",{symbol:"SUI",decimals:9,address:"0x1703CB0F762D2a435199B64Ea47E5349B7C17480",original:"Sui"}],["APT",{symbol:"APT",decimals:8,address:"0x43c588459b3243fA541B98CC4B2E995b3de553A2",original:"Aptos"}],["WETHarbitrum",{symbol:"WETH",decimals:18,address:"0xDfDA518A1612030536bD77Fd67eAcbe90dDC52Ab",original:"Arbitrum"}],["USDCarbitrum",{symbol:"USDC",decimals:6,address:"0x4b5fE357Eb11c735078e47526D6e853DBff18541",original:"Arbitrum"}],["WETHoptimism",{symbol:"WETH",decimals:18,address:"0xDf11535274c0FD2Fe41A88bd1bBF802D72296037",original:"Optimism"}],["USDCoptimism",{symbol:"USDC",decimals:6,address:"0xBe04f76A0ba2100c3F2d6Aa1FD8484F415469573",original:"Optimism"}],["WETHbase",{symbol:"WETH",decimals:18,address:"0xFA83178c66fE51ee99109b5cC912f8098Ff812eF",original:"Base"}],["USDCbase",{symbol:"USDC",decimals:6,address:"0xab933e939a9236BD439F7d29b87CE712f42bAC06",original:"Base"}],["tBTC",{symbol:"tBTC",decimals:18,address:"0x3F531c038A0D2d9c7D19FC3554cd0439791526c4",original:"Ethereum"}],["WKLAY",{symbol:"WKLAY",decimals:18,address:"0x126C03982Ad6D7ef7E6aF020bF219e87185a6BC3",original:"Klaytn"}],["PYTH",{symbol:"PYTH",decimals:6,address:"0x8A0691e602B7a5FCc51a27E4a08376dE50889B42",original:"Solana"}],["USDTavax",{symbol:"USDT",decimals:6,address:"0x9702230a8ea53601f5cd2dc00fdbc13d4df4a8c7"}]]],["Fantom",[["WETH",{symbol:"WETH",decimals:18,address:"0x2A126f043BDEBe5A0A9841c51915E562D9B07289",original:"Ethereum"}],["USDCeth",{symbol:"USDC",decimals:6,address:"0x2Ec752329c3EB419136ca5e4432Aa2CDb1eA23e6",original:"Ethereum"}],["WBTC",{symbol:"WBTC",decimals:8,address:"0x87e9E225aD8a0755B9958fd95BE43DD6A91FF3A7",original:"Ethereum"}],["USDT",{symbol:"USDT",decimals:6,address:"0x14BCb86aEed6a74D3452550a25D37f1c30AA0A66",original:"Ethereum"}],["DAI",{symbol:"DAI",decimals:18,address:"0xEE786D3D73Ea645365c7248E4e40eDba08B1169F",original:"Ethereum"}],["WMATIC",{symbol:"WMATIC",decimals:18,address:"0xb88A6064B1F3FF5B9AE4A82fFD52560b0dF9FBD3",original:"Polygon"}],["USDCpolygon",{symbol:"USDC",decimals:6,address:"0xB4DcfD221048a1Dad989D39456BBd87762c26F06",original:"Polygon"}],["WBNB",{symbol:"WBNB",decimals:18,address:"0xc033551e05907Ddd643AE14b6D4a9CA72BfF509B",original:"Bsc"}],["USDCbnb",{symbol:"USDC",decimals:18,address:"0x0FcbDAC44c67A43607D3E95886dB19871ADc985F",original:"Bsc"}],["WAVAX",{symbol:"WAVAX",decimals:18,address:"0x358CE030DC6116Cc296E8B9F002728e65459C146",original:"Avalanche"}],["USDCavax",{symbol:"USDC",decimals:6,address:"0xEfE7701cb2B80664385Be226d0300912CA92f66A",original:"Avalanche"}],["FTM",{symbol:"FTM",decimals:18,address:"native",wrappedKey:"WFTM"}],["WFTM",{symbol:"WFTM",decimals:18,address:"0x21be370d5312f44cb42ce377bc9b8a0cef1a4c83"}],["CELO",{symbol:"CELO",decimals:18,address:"0xF432490C6c96C9d3bF523a499a1CEaFd8208A373",original:"Celo"}],["WGLMR",{symbol:"WGLMR",decimals:18,address:"0xBF227E92D6754EB4BFE26C40cb299ff2809Da45f",original:"Moonbeam"}],["WSOL",{symbol:"WSOL",decimals:9,address:"0xd99021C2A33e4Cf243010539c9e9b7c52E0236c1",original:"Solana"}],["USDCsol",{symbol:"USDC",decimals:6,address:"0xb8398DA4FB3BC4306B9D9d9d13d9573e7d0E299f",original:"Solana"}],["SUI",{symbol:"SUI",decimals:9,address:"0xC277423a21F6e32D886BF85Ef6cCB945d5D28347",original:"Sui"}],["APT",{symbol:"APT",decimals:8,address:"0x3Cd9162Ca5256b8E26A0e3Ad14CCfF7C0Da0F174",original:"Aptos"}],["WETHarbitrum",{symbol:"WETH",decimals:18,address:"0xE8367853A0823515D37b1538331B4704089becb4",original:"Arbitrum"}],["USDCarbitrum",{symbol:"USDC",decimals:6,address:"0x2228703672906fEe5eD681Ec28e42B4506b8c336",original:"Arbitrum"}],["WETHoptimism",{symbol:"WETH",decimals:18,address:"0xe8E8f941377A955bFA72880ec0dc2319dbC827a8",original:"Optimism"}],["USDCoptimism",{symbol:"USDC",decimals:6,address:"0x385b219f0C4fa2e84EfE5aaf9692a821C57B8248",original:"Optimism"}],["WETHbase",{symbol:"WETH",decimals:18,address:"0xd3365E7355230c78098b44B172eE27DAB95B041A",original:"Base"}],["USDCbase",{symbol:"USDC",decimals:6,address:"0xd9E4C283d8A49Dc3767A6F5a4dFdc1d0cEf21604",original:"Base"}],["tBTC",{symbol:"tBTC",decimals:18,address:"0xeE27799cF29D7F64647B92f47d543B382B49f83E",original:"Ethereum"}],["WKLAY",{symbol:"WKLAY",decimals:18,address:"0x787e2F3509583C0F03A339Be0826463C839CBE5E",original:"Klaytn"}],["PYTH",{symbol:"PYTH",decimals:6,address:"0x77ad3B2dA29FBd208F12c3C701E969F4422aAD79",original:"Solana"}]]],["Celo",[["WETH",{symbol:"WETH",decimals:18,address:"0x66803FB87aBd4aaC3cbB3fAd7C3aa01f6F3FB207",original:"Ethereum"}],["USDCeth",{symbol:"USDC",decimals:6,address:"0x37f750B7cC259A2f741AF45294f6a16572CF5cAd",original:"Ethereum"}],["WBTC",{symbol:"WBTC",decimals:8,address:"0xd71Ffd0940c920786eC4DbB5A12306669b5b81EF",original:"Ethereum"}],["USDT",{symbol:"USDT",decimals:6,address:"0x617f3112bf5397D0467D315cC709EF968D9ba546",original:"Ethereum"}],["DAI",{symbol:"DAI",decimals:18,address:"0x97926a82930bb7B33178E3c2f4ED1BFDc91A9FBF",original:"Ethereum"}],["BUSD",{symbol:"BUSD",decimals:18,address:"0x1dd42c0785ca90B677adc2ABad01dfc5ECcD0b4d",original:"Ethereum"}],["WMATIC",{symbol:"WMATIC",decimals:18,address:"0x9C234706292b1144133ED509ccc5B3CD193BF712",original:"Polygon"}],["USDCpolygon",{symbol:"USDC",decimals:6,address:"0x42c76808f3179A091Ee007A2955aF2522978ADE7",original:"Polygon"}],["WBNB",{symbol:"WBNB",decimals:18,address:"0xBf2554ce8A4D1351AFeB1aC3E5545AaF7591042d",original:"Bsc"}],["USDCbnb",{symbol:"USDC",decimals:18,address:"0x9d9abAE97a9344e3854527b4efbB366a1564bfEb",original:"Bsc"}],["WAVAX",{symbol:"WAVAX",decimals:18,address:"0xFFdb274b4909fC2efE26C8e4Ddc9fe91963cAA4d",original:"Avalanche"}],["USDCavax",{symbol:"USDC",decimals:6,address:"0x62FFf2D2D1692D52eAf043AeeC727F7918d269D3",original:"Avalanche"}],["WFTM",{symbol:"WFTM",decimals:18,address:"0xd1A342eE2210238233a347FEd61EE7Faf9f251ce",original:"Fantom"}],["CELO",{symbol:"CELO",decimals:18,address:"0x471ece3750da237f93b8e339c536989b8978a438"}],["USDT",{symbol:"USDT",decimals:6,address:"0x48065fbBE25f71C9282ddf5e1cD6D6A887483D5e"}],["WGLMR",{symbol:"WGLMR",decimals:18,address:"0x383A5513AbE4Fe36e0E00d484F710148E348Aa9D",original:"Moonbeam"}],["WSOL",{symbol:"WSOL",decimals:9,address:"0x4581E64115d46CcdeE65Be2336bEc86c9BA54C01",original:"Solana"}],["USDCsol",{symbol:"USDC",decimals:6,address:"0x8B6eef6C449D3Ac723a9C06a9eaE2dCd7d308BA9",original:"Solana"}],["SUI",{symbol:"SUI",decimals:9,address:"0x1Cb9859B1A16A67ef83A0c7b9A21eeC17d9a97Dc",original:"Sui"}],["APT",{symbol:"APT",decimals:8,address:"0x89F2b718Ca518db39d377F0ABBa6B42582b549F7",original:"Aptos"}],["WETHarbitrum",{symbol:"WETH",decimals:18,address:"0xc6F962fCcb140ece554AfD0E589f971532A57f14",original:"Arbitrum"}],["USDCarbitrum",{symbol:"USDC",decimals:6,address:"0xA41a62567d9eb960D84b72663FdaeBE0BCdE2683",original:"Arbitrum"}],["WETHoptimism",{symbol:"WETH",decimals:18,address:"0x8d53771b1Ec7461f8e45Bca2609c45bC0bbd0677",original:"Optimism"}],["USDCoptimism",{symbol:"USDC",decimals:6,address:"0xEe48963C003e21EaCEdFA8a0A19BB3cbF7E776Fe",original:"Optimism"}],["WETHbase",{symbol:"WETH",decimals:18,address:"0x905CADB645684140E285e2D09D39dF5a2082BC87",original:"Base"}],["USDCbase",{symbol:"USDC",decimals:6,address:"0x2e2acb1782Aad0490f8446b6fD4626C467987bD6",original:"Base"}],["tBTC",{symbol:"tBTC",decimals:18,address:"0xFaED7314060FCEc652ED91D9eac6c980DCA9D3B8",original:"Ethereum"}],["tBTCarbitrum",{symbol:"tBTC",decimals:18,address:"0x72878E7d3A8746e0c91b9F16F0b8ee4fDE9DDc06",original:"Arbitrum"}],["WKLAY",{symbol:"WKLAY",decimals:18,address:"0xe304254de5c2048F9bFb042dDFB54f84d1d77730",original:"Klaytn"}],["PYTH",{symbol:"PYTH",decimals:6,address:"0x985aa4814419ba338379A634785216301e51113D",original:"Solana"}]]],["Moonbeam",[["WETH",{symbol:"WETH",decimals:18,address:"0xab3f0245B83feB11d15AAffeFD7AD465a59817eD",original:"Ethereum"}],["USDCeth",{symbol:"USDC",decimals:6,address:"0x931715FEE2d06333043d11F658C8CE934aC61D0c",original:"Ethereum"}],["WBTC",{symbol:"WBTC",decimals:8,address:"0xE57eBd2d67B462E9926e04a8e33f01cD0D64346D",original:"Ethereum"}],["USDT",{symbol:"USDT",decimals:6,address:"0xc30E9cA94CF52f3Bf5692aaCF81353a27052c46f",original:"Ethereum"}],["DAI",{symbol:"DAI",decimals:18,address:"0x06e605775296e851FF43b4dAa541Bb0984E9D6fD",original:"Ethereum"}],["BUSD",{symbol:"BUSD",decimals:18,address:"0xa2284e1F98E4d0B7Eb6a6b4f3C57f1b209C755F3",original:"Ethereum"}],["WMATIC",{symbol:"WMATIC",decimals:18,address:"0x82DbDa803bb52434B1f4F41A6F0Acb1242A7dFa3",original:"Polygon"}],["USDCpolygon",{symbol:"USDC",decimals:6,address:"0x4415BfBDee669446550d55c749007EF60B520FC8",original:"Polygon"}],["WBNB",{symbol:"WBNB",decimals:18,address:"0xE3b841C3f96e647E6dc01b468d6D0AD3562a9eeb",original:"Bsc"}],["USDCbnb",{symbol:"USDC",decimals:18,address:"0x7f433E22366E03a3758CE22cCf82887d828078f8",original:"Bsc"}],["WAVAX",{symbol:"WAVAX",decimals:18,address:"0xd4937A95BeC789CC1AE1640714C61c160279B22F",original:"Avalanche"}],["USDCavax",{symbol:"USDC",decimals:6,address:"0xd4918c40cA9f02d42Cb53d06587aF42017Bc345D",original:"Avalanche"}],["WFTM",{symbol:"WFTM",decimals:18,address:"0x609AedD990bf45926bca9E4eE988b4Fb98587D3A",original:"Fantom"}],["CELO",{symbol:"CELO",decimals:18,address:"0xc1a792041985F65c17Eb65E66E254DC879CF380b",original:"Celo"}],["GLMR",{symbol:"GLMR",decimals:18,address:"native",wrappedKey:"WGLMR"}],["WGLMR",{symbol:"WGLMR",decimals:18,address:"0xAcc15dC74880C9944775448304B263D191c6077F"}],["WSOL",{symbol:"WSOL",decimals:9,address:"0x99Fec54a5Ad36D50A4Bba3a41CAB983a5BB86A7d",original:"Solana"}],["USDCsol",{symbol:"USDC",decimals:6,address:"0x098d6eE48341D6a0a0A72dE5baaF80A10E0F6082",original:"Solana"}],["SUI",{symbol:"SUI",decimals:9,address:"0x484eCCE6775143D3335Ed2C7bCB22151C53B9F49",original:"Sui"}],["APT",{symbol:"APT",decimals:8,address:"0x25331575641d35D9765e1934acC8F0991c58e904",original:"Aptos"}],["WETHarbitrum",{symbol:"WETH",decimals:18,address:"0x18872b45c603eD2EbC508b9C5514a85c2e2791FB",original:"Arbitrum"}],["WETHoptimism",{symbol:"WETH",decimals:18,address:"0xd4870F7F5AD8Ae5139E1a5D8AD4ac55204aE4490",original:"Optimism"}],["USDCoptimism",{symbol:"USDC",decimals:6,address:"0x7143e8EA96e158381057a58AfdDF44601c7e532C",original:"Optimism"}],["WETHbase",{symbol:"WETH",decimals:18,address:"0x6C6f83366A42fcA4D30a2D3f1914284de995Ac3a",original:"Base"}],["USDCbase",{symbol:"USDC",decimals:6,address:"0xE6d02a875CcC153c076fe418f33De3A5C420f505",original:"Base"}],["tBTC",{symbol:"tBTC",decimals:18,address:"0xeCd65E4B89495Ae63b4f11cA872a23680A7c419c",original:"Ethereum"}],["WKLAY",{symbol:"WKLAY",decimals:18,address:"0xf0a9476E4712123A807859f9Fd25fe98213379BD",original:"Klaytn"}]]],["Solana",[["WETH",{symbol:"WETH",decimals:8,address:"7vfCXTUXx5WJV5JADk17DUJ4ksgau7utNKj4b963voxs",original:"Ethereum"}],["USDCeth",{symbol:"USDC",decimals:6,address:"A9mUU4qviSctJVPJdBJWkb28deg915LYJKrzQ19ji3FM",original:"Ethereum"}],["WBTC",{symbol:"WBTC",decimals:8,address:"3NZ9JMVBmGAqocybic2c7LQCJScmgsAZ6vQqTDzcqmJh",original:"Ethereum"}],["USDT",{symbol:"USDT",decimals:6,address:"Dn4noZ5jgGfkntzcQSUZ8czkreiZ1ForXYoV2H8Dm7S1",original:"Ethereum"}],["DAI",{symbol:"DAI",decimals:8,address:"EjmyN6qEC1Tf1JxiG1ae7UTJhUxSwk1TCWNWqxWV4J6o",original:"Ethereum"}],["BUSD",{symbol:"BUSD",decimals:8,address:"33fsBLA8djQm82RpHmE3SuVrPGtZBWNYExsEUeKX1HXX",original:"Ethereum"}],["WMATIC",{symbol:"WMATIC",decimals:8,address:"Gz7VkD4MacbEB6yC5XD3HcumEiYx2EtDYYrfikGsvopG",original:"Polygon"}],["WBNB",{symbol:"WBNB",decimals:8,address:"9gP2kCy3wA1ctvYWQk75guqXuHfrEomqydHLtcTCqiLa",original:"Bsc"}],["USDCbnb",{symbol:"USDC",decimals:8,address:"FCqfQSujuPxy6V42UvafBhsysWtEq1vhjfMN1PUbgaxA",original:"Bsc"}],["WAVAX",{symbol:"WAVAX",decimals:8,address:"KgV1GvrHQmRBY8sHQQeUKwTm2r2h8t4C8qt12Cw1HVE",original:"Avalanche"}],["USDCavax",{symbol:"USDC",decimals:6,address:"FHfba3ov5P3RjaiLVgh8FTv4oirxQDoVXuoUUDvHuXax",original:"Avalanche"}],["WFTM",{symbol:"WFTM",decimals:8,address:"DRQBDBEWmwWGK13fRTLhSPzjbvMSUavhV6nW4RUH8W6T",original:"Fantom"}],["CELO",{symbol:"CELO",decimals:8,address:"9kvAcwQbqejuJMd59mKuw2bfSsLRaQ7zuvaTVHEeBBec",original:"Celo"}],["WGLMR",{symbol:"WGLMR",decimals:8,address:"7ixSaXGsHAFy34wogPk2YXiUX3BMmQMFdercdaHLnBby",original:"Moonbeam"}],["SOL",{symbol:"SOL",decimals:9,address:"native",wrappedKey:"WSOL"}],["WSOL",{symbol:"WSOL",decimals:9,address:"So11111111111111111111111111111111111111112"}],["USDCsol",{symbol:"USDC",decimals:6,address:"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"}],["SUI",{symbol:"SUI",decimals:8,address:"G1vJEgzepqhnVu35BN4jrkv3wVwkujYWFFCxhbEZ1CZr",original:"Sui"}],["APT",{symbol:"APT",decimals:8,address:"6LNeTYMqtNm1pBFN8PfhQaoLyegAH8GD32WmHU9erXKN",original:"Aptos"}],["WETHarbitrum",{symbol:"WETH",decimals:8,address:"CSD6JQMvLi46psjHdpfFdr826mF336pEVMJgjwcoS1m4",original:"Arbitrum"}],["USDCarbitrum",{symbol:"USDC",decimals:6,address:"CR4xnGrhsu1fWNPoX4KbTUUtqGMF3mzRLfj4S6YEs1Yo",original:"Arbitrum"}],["WETHoptimism",{symbol:"WETH",decimals:8,address:"8M6d63oL7dvMZ1gNbgGe3h8afMSWJEKEhtPTFM2u8h3c",original:"Optimism"}],["WETHbase",{symbol:"WETH",decimals:8,address:"DWXe1hxpnb8LAH21iyXcjvMbiAGzoYyuCVQtRLvZdLYd",original:"Base"}],["USDCbase",{symbol:"USDC",decimals:6,address:"EfqRM8ZGWhDTKJ7BHmFvNagKVu3AxQRDQs8WMMaoBCu6",original:"Base"}],["tBTC",{symbol:"tBTC",decimals:8,address:"25rXTx9zDZcHyTav5sRqM6YBvTGu9pPH9yv83uAEqbgG",original:"Ethereum"}],["tBTCsol",{symbol:"tBTC",decimals:8,address:"6DNSN2BJsaPFdFFc1zP37kkeNe4Usc1Sqkzr9C9vPWcU"}],["wstETH",{symbol:"wstETH",decimals:8,address:"ZScHuTtqZukUrtZS43teTKGs2VqkKL8k4QCouR2n6Uo",original:"Ethereum"}],["PYTH",{symbol:"PYTH",decimals:6,address:"HZ1JovNiVvGrGNiiYvEozEVgZ58xaU3RKwX8eACQBCt3"}]]],["Sui",[["WETH",{symbol:"WETH",decimals:8,address:"0xaf8cd5edc19c4512f4259f0bee101a40d41ebed738ade5874359610ef8eeced5::coin::COIN",original:"Ethereum"}],["USDCeth",{symbol:"USDC",decimals:6,address:"0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf::coin::COIN",original:"Ethereum"}],["WBTC",{symbol:"WBTC",decimals:8,address:"0x27792d9fed7f9844eb4839566001bb6f6cb4804f66aa2da6fe1ee242d896881::coin::COIN",original:"Ethereum"}],["USDT",{symbol:"USDT",decimals:6,address:"0xc060006111016b8a020ad5b33834984a437aaa7d3c74c18e09a95d48aceab08c::coin::COIN",original:"Ethereum"}],["WMATIC",{symbol:"WMATIC",decimals:8,address:"0xdbe380b13a6d0f5cdedd58de8f04625263f113b3f9db32b3e1983f49e2841676::coin::COIN",original:"Polygon"}],["USDCpolygon",{symbol:"USDC",decimals:6,address:"0x5c8c9082401982e8c2519a5c12883a5475295bf5cec4a0a13c26d35dd9a20d73::coin::COIN",original:"Polygon"}],["WBNB",{symbol:"WBNB",decimals:8,address:"0xb848cce11ef3a8f62eccea6eb5b35a12c4c2b1ee1af7755d02d7bd6218e8226f::coin::COIN",original:"Bsc"}],["USDCbnb",{symbol:"USDC",decimals:8,address:"0x909cba62ce96d54de25bec9502de5ca7b4f28901747bbf96b76c2e63ec5f1cba::coin::COIN",original:"Bsc"}],["WAVAX",{symbol:"WAVAX",decimals:8,address:"0x1e8b532cca6569cab9f9b9ebc73f8c13885012ade714729aa3b450e0339ac766::coin::COIN",original:"Avalanche"}],["USDCavax",{symbol:"USDC",decimals:6,address:"0xe596782fbaebef51ae99ffac8731aed98a80642b9dc193ed659c97fbc2cc0f84::coin::COIN",original:"Avalanche"}],["WFTM",{symbol:"WFTM",decimals:8,address:"0x6081300950a4f1e2081580e919c210436a1bed49080502834950d31ee55a2396::coin::COIN",original:"Fantom"}],["CELO",{symbol:"CELO",decimals:8,address:"0xa198f3be41cda8c07b3bf3fee02263526e535d682499806979a111e88a5a8d0f::coin::COIN",original:"Celo"}],["WGLMR",{symbol:"WGLMR",decimals:8,address:"0x66f87084e49c38f76502d17f87d17f943f183bb94117561eb573e075fdc5ff75::coin::COIN",original:"Moonbeam"}],["WSOL",{symbol:"WSOL",decimals:8,address:"0xb7844e289a8410e50fb3ca48d69eb9cf29e27d223ef90353fe1bd8e27ff8f3f8::coin::COIN",original:"Solana"}],["USDCsol",{symbol:"USDC",decimals:6,address:"0xb231fcda8bbddb31f2ef02e6161444aec64a514e2c89279584ac9806ce9cf037::coin::COIN",original:"Solana"}],["SUI",{symbol:"SUI",decimals:9,address:"0x2::sui::SUI"}],["APT",{symbol:"APT",decimals:8,address:"0x3a5143bb1196e3bcdfab6203d1683ae29edd26294fc8bfeafe4aaa9d2704df37::coin::COIN",original:"Aptos"}],["WETHarbitrum",{symbol:"WETH",decimals:8,address:"0x33744e7df340a4d01c23f6b18c13563f767545ea95f976f8045f056358419da3::coin::COIN",original:"Arbitrum"}],["USDCarbitrum",{symbol:"USDC",decimals:6,address:"0xc3f8927de33d3deb52c282a836082a413bc73c6ee0bd4d7ec7e3b6b4c28e9abf::coin::COIN",original:"Arbitrum"}],["WETHoptimism",{symbol:"WETH",decimals:8,address:"0xaab14ec22908de73d1b0619f5e03842398f8e68262981bd35ef44b42d22b23a::coin::COIN",original:"Optimism"}],["USDCoptimism",{symbol:"USDC",decimals:6,address:"0x6037801f060f0f54b3817bca05e3c8b9b9ffaa2da8e93fd5b80fa662aa3c9e55::coin::COIN",original:"Optimism"}],["WETHbase",{symbol:"WETH",decimals:8,address:"0xaecbc804fa7ca7cffc74c9a05eb6ae86fda0c68375b5c1724204a1065bcb239a::coin::COIN",original:"Base"}],["USDCbase",{symbol:"USDC",decimals:6,address:"0x7e3e74afcc1913aa9491c8cee89b02131a6e5519b090f16b54321835c1241cfb::coin::COIN",original:"Base"}],["tBTC",{symbol:"tBTC",decimals:8,address:"0xbc3a676894871284b3ccfb2eec66f428612000e2a6e6d23f592ce8833c27c973::coin::COIN",original:"Ethereum"}],["WKLAY",{symbol:"WKLAY",decimals:8,address:"0xa5ec915864d7f37b25ca9144b2db6ebcf29e73603c2ccf9d0e765adcd9049a98::coin::COIN",original:"Klaytn"}],["PYTH",{symbol:"PYTH",decimals:6,address:"0x9c6d76eb273e6b5ba2ec8d708b7fa336a5531f6be59f326b5be8d4d8b12348a4::coin::COIN",original:"Solana"}]]],["Aptos",[["WETH",{symbol:"WETH",decimals:8,address:"0xcc8a89c8dce9693d354449f1f73e60e14e347417854f029db5bc8e7454008abb::coin::T",original:"Ethereum"}],["USDCeth",{symbol:"USDC",decimals:6,address:"0x5e156f1207d0ebfa19a9eeff00d62a282278fb8719f4fab3a586a0a2c0fffbea::coin::T",original:"Ethereum"}],["WBTC",{symbol:"WBTC",decimals:8,address:"0xae478ff7d83ed072dbc5e264250e67ef58f57c99d89b447efd8a0a2e8b2be76e::coin::T",original:"Ethereum"}],["USDT",{symbol:"USDT",decimals:6,address:"0xa2eda21a58856fda86451436513b867c97eecb4ba099da5775520e0f7492e852::coin::T",original:"Ethereum"}],["DAI",{symbol:"DAI",decimals:8,address:"0x407a220699982ebb514568d007938d2447d33667e4418372ffec1ddb24491b6c::coin::T",original:"Ethereum"}],["BUSD",{symbol:"BUSD",decimals:8,address:"0x77400d2f56a01bad2d7c8c6fa282f62647ce3c03f43f2a8742e47ea01a91e24a::coin::T",original:"Ethereum"}],["WMATIC",{symbol:"WMATIC",decimals:8,address:"0x6781088e2a1629d38eda521467af4a8ca7bfa7e5516338017940389595c85c0f::coin::T",original:"Polygon"}],["USDCpolygon",{symbol:"USDC",decimals:6,address:"0xc5fd7820e9f053e6dd8e7dd8ca3ce8e9b10d200ba1692bdeb7a035217180ad4a::coin::T",original:"Polygon"}],["WBNB",{symbol:"WBNB",decimals:8,address:"0x6312bc0a484bc4e37013befc9949df2d7c8a78e01c6fe14a34018449d136ba86::coin::T",original:"Bsc"}],["USDCbnb",{symbol:"USDC",decimals:8,address:"0x79a6ed7a0607fdad2d18d67d1a0e552d4b09ebce5951f1e5c851732c02437595::coin::T",original:"Bsc"}],["WAVAX",{symbol:"WAVAX",decimals:8,address:"0x5b1bbc25524d41b17a95dac402cf2f584f56400bf5cc06b53c36b331b1ec6e8f::coin::T",original:"Avalanche"}],["USDCavax",{symbol:"USDC",decimals:6,address:"0x39d84c2af3b0c9895b45d4da098049e382c451ba63bec0ce0396ff7af4bb5dff::coin::T",original:"Avalanche"}],["WFTM",{symbol:"WFTM",decimals:8,address:"0xd1aa2ff36a0e93e1b4e4fecdecf8bb95bc5de399061c5e84b515281f48718842::coin::T",original:"Fantom"}],["CELO",{symbol:"CELO",decimals:8,address:"0xac0c3c35d50f6ef00e3b4db6998732fe9ed6331384925fe8ec95fcd7745a9112::coin::T",original:"Celo"}],["WGLMR",{symbol:"WGLMR",decimals:8,address:"0x7ab1283a7b13c4254d4e1f803d7ce6578442c1d7a40d0faee41cd48ba4884c8a::coin::T",original:"Moonbeam"}],["WSOL",{symbol:"WSOL",decimals:8,address:"0xdd89c0e695df0692205912fb69fc290418bed0dbe6e4573d744a6d5e6bab6c13::coin::T",original:"Solana"}],["USDCsol",{symbol:"USDC",decimals:6,address:"0xc91d826e29a3183eb3b6f6aa3a722089fdffb8e9642b94c5fcd4c48d035c0080::coin::T",original:"Solana"}],["SUI",{symbol:"SUI",decimals:8,address:"0xa72a97e872be9ee3d2f14d56fd511eb7e4a53f4055be3a267d8602e7685b41c0::coin::T",original:"Sui"}],["APT",{symbol:"APT",decimals:8,address:"0x1::aptos_coin::AptosCoin"}],["WETHarbitrum",{symbol:"WETH",decimals:8,address:"0x0e977796d7bfb3263609b90dffd264c7bd078ce35dac42b55302858d9fa3452b::coin::T",original:"Arbitrum"}],["USDCarbitrum",{symbol:"USDC",decimals:6,address:"0xca3a2c28bc8c6c762f752dd2a4ebbfd00356ca99977ce6636e3af5897124a87a::coin::T",original:"Arbitrum"}],["WETHoptimism",{symbol:"WETH",decimals:8,address:"0x6a7a7f36ef5e2d0e65fcf72669c20d514d68298b0f76c7554517208f73260aaf::coin::T",original:"Optimism"}],["USDCoptimism",{symbol:"USDC",decimals:6,address:"0x4f6ecb05a797902d472abc2f5804bde93a53d8b75f14f767824cdb1623a4ee83::coin::T",original:"Optimism"}],["WETHbase",{symbol:"WETH",decimals:8,address:"0x5b5f14781164cf77185a7b6acd8e4f3cbb7e7cfb1cd5760d2b8af81075fc153d::coin::T",original:"Base"}],["USDCbase",{symbol:"USDC",decimals:6,address:"0xfcc4fcd734d5b8578fb629d238d15264a49eca6165c7444c21feec3b4962eb88::coin::T",original:"Base"}],["tBTC",{symbol:"tBTC",decimals:8,address:"0x9d5a0f8215301fa8096df332b1533f6328f18c32fbac2a7089cfbea73b3068a7::coin::T",original:"Ethereum"}],["WKLAY",{symbol:"WKLAY",decimals:8,address:"0x539b652f8230a0e42adaeda4706b5639893d22362eda6ea897493c210cb48219::coin::T",original:"Klaytn"}],["PYTH",{symbol:"PYTH",decimals:6,address:"0x770211b47954e15bec1a4271bf33bacebc2d2adb43b7dc1ca45efa787615dd4c::coin::T",original:"Solana"}]]],["Base",[["WETH",{symbol:"WETH",decimals:18,address:"0x71b35ECb35104773537f849FBC353F81303A5860",original:"Ethereum"}],["USDCeth",{symbol:"USDC",decimals:6,address:"0xec267C53f53807c2337C257f8AC3Fc3cC07cc0ed",original:"Ethereum"}],["WBTC",{symbol:"WBTC",decimals:8,address:"0xE6396f780b543dF16ee3b784D789c75B68319db0",original:"Ethereum"}],["USDT",{symbol:"USDT",decimals:6,address:"0xFf0C62A4979400841eFaA6faADb07Ac7d5C98b27",original:"Ethereum"}],["DAI",{symbol:"DAI",decimals:18,address:"0x617Edadb51BfB43A44Bb91C7402129C23bA52381",original:"Ethereum"}],["WMATIC",{symbol:"WMATIC",decimals:18,address:"0xc863399E5c5C4011B1DC3fB602902C77BA72B709",original:"Polygon"}],["USDCpolygon",{symbol:"USDC",decimals:6,address:"0xFe1579BAc60363c8572CB30Bf4DD1Fd85811BBF8",original:"Polygon"}],["WBNB",{symbol:"WBNB",decimals:18,address:"0x7fdAa50d7399ac436943028edA6ed9a1BD89509f",original:"Bsc"}],["USDCbnb",{symbol:"USDC",decimals:18,address:"0x68E2b07F92ed506f92935d7359ECA84D5342dbb4",original:"Bsc"}],["WAVAX",{symbol:"WAVAX",decimals:18,address:"0xc449A60A31E1eebFE83c42E9465fd4Dc318aE9a7",original:"Avalanche"}],["USDCavax",{symbol:"USDC",decimals:6,address:"0xD83385fE100E20c269a5975D4Bf92525BcE09F87",original:"Avalanche"}],["WFTM",{symbol:"WFTM",decimals:18,address:"0x936Fa2DE8380Dc5BF34C80F1BaD53a9f3630263B",original:"Fantom"}],["CELO",{symbol:"CELO",decimals:18,address:"0x74df3823aA29D278cAD0A3632fCB56C896a38eD4",original:"Celo"}],["WGLMR",{symbol:"WGLMR",decimals:18,address:"0xfdB7311BeC3b2CcCF8407d0585f81B97b3b5eff1",original:"Moonbeam"}],["WSOL",{symbol:"WSOL",decimals:9,address:"0x1C61629598e4a901136a81BC138E5828dc150d67",original:"Solana"}],["USDCsol",{symbol:"USDC",decimals:6,address:"0xe8CE40EBBB844142400D21558a2F1c9683d69139",original:"Solana"}],["SUI",{symbol:"SUI",decimals:9,address:"0x36c6FBF7B49bF65f5F82b674af219C05b2a4aDD1",original:"Sui"}],["APT",{symbol:"APT",decimals:8,address:"0x1d36126289Be1658297A35CC3EB2BB80A7D7A04b",original:"Aptos"}],["WETHarbitrum",{symbol:"WETH",decimals:18,address:"0x9D36e0edb8BBaBeec5edE8a218dc2B9a6Fce494F",original:"Arbitrum"}],["USDCarbitrum",{symbol:"USDC",decimals:6,address:"0xb96B82Cd6D45d98Fb6897D16A5E4EE888329C513",original:"Arbitrum"}],["WETHoptimism",{symbol:"WETH",decimals:18,address:"0xCb725aC8d9985D3bE306Dd9e1517d3702929176c",original:"Optimism"}],["USDCoptimism",{symbol:"USDC",decimals:6,address:"0xc6bfBeb3002aD563D2d1f72614C61C83Bf147Acd",original:"Optimism"}],["ETHbase",{symbol:"ETH",decimals:18,address:"native",wrappedKey:"WETHbase"}],["WETHbase",{symbol:"WETH",decimals:18,address:"0x4200000000000000000000000000000000000006"}],["USDCbase",{symbol:"USDC",decimals:6,address:"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}],["wstETHbase",{symbol:"wstETH",decimals:18,address:"0xc1CBa3fCea344f92D9239c08C0568f6F2F0ee452"}],["tBTC",{symbol:"tBTC",decimals:18,address:"0x9EE95E6Bd1B3C5740F105d6fb06b8BDeF64Eec70",original:"Ethereum"}],["tBTCarbitrum",{symbol:"tBTC",decimals:18,address:"0x56D0873e0eCA4a56063e1BF945788365666CFBFC",original:"Arbitrum"}],["tBTCbase",{symbol:"tBTC",decimals:18,address:"0x236aa50979D5f3De3Bd1Eeb40E81137F22ab794b"}],["wstETH",{symbol:"wstETH",decimals:18,address:"0xEd4e2FD35161c3c0e33cA187fce64C70d44Ce32b",original:"Ethereum"}],["WKLAY",{symbol:"WKLAY",decimals:18,address:"0x41c433c146c47Dc53FC48cDc69e406e365e298E1",original:"Klaytn"}],["PYTH",{symbol:"PYTH",decimals:6,address:"0x4c5d8A75F3762c1561D96f177694f67378705E98",original:"Solana"}],["USDTbase",{symbol:"USDT",decimals:6,address:"0xfde4C96c8593536E31F229EA8f37b2ADa2699bb2"}]]],["Arbitrum",[["WETH",{symbol:"WETH",decimals:18,address:"0xD8369C2EDA18dD6518eABb1F85BD60606dEb39Ec",original:"Ethereum"}],["USDCeth",{symbol:"USDC",decimals:6,address:"0xC96F2715E2a242d50D1b0bC923dbe1740b8eCf18",original:"Ethereum"}],["WBTC",{symbol:"WBTC",decimals:8,address:"0x397846a8078d4845c7f5c6Ca76aeBbcFDc044fAe",original:"Ethereum"}],["USDT",{symbol:"USDT",decimals:6,address:"0xE4728F3E48E94C6DA2B53610E677cc241DAFB134",original:"Ethereum"}],["DAI",{symbol:"DAI",decimals:18,address:"0x5c4f2FEFB97F7DF09E762d95C83f0Ccf8bCe8234",original:"Ethereum"}],["WMATIC",{symbol:"WMATIC",decimals:18,address:"0x3ab0E28C3F56616aD7061b4db38aE337E3809AEA",original:"Polygon"}],["USDCpolygon",{symbol:"USDC",decimals:6,address:"0x599ADB10E6A012dF34935D47407450f6D7170e3C",original:"Polygon"}],["WBNB",{symbol:"WBNB",decimals:18,address:"0x7AF00405916D823eDb1121546EfA6F4972B51b84",original:"Bsc"}],["USDCbnb",{symbol:"USDC",decimals:18,address:"0x1a0590F951bc9C3818Ce75ba5Bbe92831b2cf57e",original:"Bsc"}],["WAVAX",{symbol:"WAVAX",decimals:18,address:"0x565609fAF65B92F7be02468acF86f8979423e514",original:"Avalanche"}],["USDCavax",{symbol:"USDC",decimals:6,address:"0x93e0FcbEd43CD6fC30DF00CcBD4669718dc74e77",original:"Avalanche"}],["WFTM",{symbol:"WFTM",decimals:18,address:"0x7f7dcDb91930033a4Eb269196EBb6fd5f0644E4B",original:"Fantom"}],["CELO",{symbol:"CELO",decimals:18,address:"0x4E51aC49bC5e2d87e0EF713E9e5AB2D71EF4F336",original:"Celo"}],["WGLMR",{symbol:"WGLMR",decimals:18,address:"0x944C5b67a03e6Cb93Ae1E4B70081f13b04CDB6Bd",original:"Moonbeam"}],["WSOL",{symbol:"WSOL",decimals:9,address:"0x2bcC6D6CdBbDC0a4071e48bb3B969b06B3330c07",original:"Solana"}],["USDCsol",{symbol:"USDC",decimals:6,address:"0x3870546cfd600ba87e4180686d29dC993A45d3B7",original:"Solana"}],["SUI",{symbol:"SUI",decimals:9,address:"0xCF79d86B8a830030aF6D835737d6eac3bE823fD7",original:"Sui"}],["APT",{symbol:"APT",decimals:8,address:"0x4EdeF400eDe5309240814b5FC403F224504604e9",original:"Aptos"}],["ETHarbitrum",{symbol:"ETH",decimals:18,address:"native",wrappedKey:"WETHarbitrum"}],["WETHarbitrum",{symbol:"WETH",decimals:18,address:"0x82af49447d8a07e3bd95bd0d56f35241523fbab1"}],["USDCarbitrum",{symbol:"USDC",decimals:6,address:"0xaf88d065e77c8cC2239327C5EDb3A432268e5831"}],["WETHoptimism",{symbol:"WETH",decimals:18,address:"0xB1fC645a86fB5085e12D8BDDb77702F728D2A26F",original:"Optimism"}],["USDCoptimism",{symbol:"USDC",decimals:6,address:"0x3A5C2Da9E30741cb59a5e9446A23A86886fC9DC2",original:"Optimism"}],["WETHbase",{symbol:"WETH",decimals:18,address:"0xBAfbCB010D920e0Dab9DFdcF634De1B777028a85",original:"Base"}],["USDCbase",{symbol:"USDC",decimals:6,address:"0x8619F97D4d08382548F536E5CE1D3e0D9bA40326",original:"Base"}],["tBTC",{symbol:"tBTC",decimals:18,address:"0x57723abc582DBfE11Ea01f1A1f48aEE20bD65D73",original:"Ethereum"}],["tBTCpolygon",{symbol:"tBTC",decimals:18,address:"0x3bab04bDFd2Dc3640c2B9390A2Da05bC1192D482",original:"Polygon"}],["tBTCoptimism",{symbol:"tBTC",decimals:18,address:"0x2519010b6585247BcDC8BcDa5C8730Be754b8c76",original:"Optimism"}],["tBTCarbitrum",{symbol:"tBTC",decimals:18,address:"0x6c84a8f1c29108F47a79964b5Fe888D4f4D0dE40"}],["wstETH",{symbol:"wstETH",decimals:18,address:"0xf2717122Dfdbe988ae811E7eFB157aAa07Ff9D0F",original:"Ethereum"}],["wstETHarbitrum",{symbol:"wstETH",decimals:18,address:"0x5979D7b546E38E414F7E9822514be443A4800529"}],["WKLAY",{symbol:"WKLAY",decimals:18,address:"0xFA95f6c796E54F9C4a99392CAE84410a25794BB3",original:"Klaytn"}],["PYTH",{symbol:"PYTH",decimals:6,address:"0xE4D5c6aE46ADFAF04313081e8C0052A30b6Dd724",original:"Solana"}],["USDTarbitrum",{symbol:"USDT",decimals:6,address:"0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9"}]]],["Optimism",[["WETH",{symbol:"WETH",decimals:18,address:"0xb47bC3ed6D70F04fe759b2529c9bc7377889678f",original:"Ethereum"}],["USDCeth",{symbol:"USDC",decimals:6,address:"0x711e53D031ea9B0bb0C24dD506df11b41AEA419e",original:"Ethereum"}],["WBTC",{symbol:"WBTC",decimals:8,address:"0xB214C19d81c99E75e84706a3aa0A757319023e26",original:"Ethereum"}],["USDT",{symbol:"USDT",decimals:6,address:"0xf6B4185FCf8aF291c0E3927fbEab7046b4f6A8CA",original:"Ethereum"}],["DAI",{symbol:"DAI",decimals:18,address:"0x098EA47D630b46df1E08e389e5e4466119c7dd30",original:"Ethereum"}],["WMATIC",{symbol:"WMATIC",decimals:18,address:"0x8f02B6a32cebcAe44D2Fd17d87966f5B5dD14c6d",original:"Polygon"}],["USDCpolygon",{symbol:"USDC",decimals:6,address:"0xbB1EaB9Eb8fDf65F0E291D013DA07B4b65a27a01",original:"Polygon"}],["WBNB",{symbol:"WBNB",decimals:18,address:"0x6A09fE65ACa27C12573F04aAFa290bD75497E1BC",original:"Bsc"}],["USDCbnb",{symbol:"USDC",decimals:18,address:"0x1C15057d1F3794C934a6cBC1f7EceE934050F219",original:"Bsc"}],["WAVAX",{symbol:"WAVAX",decimals:18,address:"0x8418C1d909842f458c9394886b83F19d62bF1A0D",original:"Avalanche"}],["USDCavax",{symbol:"USDC",decimals:6,address:"0x355f0a8a7ecAeD971b8Fbd50994558291ff2413a",original:"Avalanche"}],["WFTM",{symbol:"WFTM",decimals:18,address:"0x0b0ecbe5C3995541876d27633B63296570FB34Af",original:"Fantom"}],["CELO",{symbol:"CELO",decimals:18,address:"0x9b88D293b7a791E40d36A39765FFd5A1B9b5c349",original:"Celo"}],["WGLMR",{symbol:"WGLMR",decimals:18,address:"0xbffD46DFDb8d3a02b8D2E0F864a2cD712090a4D3",original:"Moonbeam"}],["WSOL",{symbol:"WSOL",decimals:9,address:"0xba1Cf949c382A32a09A17B2AdF3587fc7fA664f1",original:"Solana"}],["USDCsol",{symbol:"USDC",decimals:6,address:"0x6F974A6dfD5B166731704Be226795901c45Bb815",original:"Solana"}],["SUI",{symbol:"SUI",decimals:9,address:"0x27A533e438892DA192725b4C9AcA51447F457212",original:"Sui"}],["APT",{symbol:"APT",decimals:8,address:"0xC5B3AC2DF8D8D7AC851F763a5b3Ff23B4A696d59",original:"Aptos"}],["WETHarbitrum",{symbol:"WETH",decimals:18,address:"0x825206E1D29456337769e6f1384101E997C6A732",original:"Arbitrum"}],["USDCarbitrum",{symbol:"USDC",decimals:6,address:"0xa6252F56cc6eEA21165d56744C795F91c8a3Cf68",original:"Arbitrum"}],["ETHoptimism",{symbol:"ETH",decimals:18,address:"native",wrappedKey:"WETHoptimism"}],["WETHoptimism",{symbol:"WETH",decimals:18,address:"0x4200000000000000000000000000000000000006"}],["USDCoptimism",{symbol:"USDC",decimals:6,address:"0x0b2c639c533813f4aa9d7837caf62653d097ff85"}],["WETHbase",{symbol:"WETH",decimals:18,address:"0x3F369a664fa665e01e8EB9f20bFcE03A0CAb8971",original:"Base"}],["USDCbase",{symbol:"USDC",decimals:6,address:"0xb931c7BbD87A6e249EaA7355B13927F9c99Bce87",original:"Base"}],["tBTC",{symbol:"tBTC",decimals:18,address:"0xeC0a755664271b87002dDa33CA2484B24aF68912",original:"Ethereum"}],["tBTCpolygon",{symbol:"tBTC",decimals:18,address:"0xE4C32B9eA749fa0342B1C42C01E80028B97c3917",original:"Polygon"}],["tBTCoptimism",{symbol:"tBTC",decimals:18,address:"0x6c84a8f1c29108F47a79964b5Fe888D4f4D0dE40"}],["tBTCarbitrum",{symbol:"tBTC",decimals:18,address:"0x2390a5131fcba6e47f702172cF4876589E4161c6",original:"Arbitrum"}],["wstETH",{symbol:"wstETH",decimals:18,address:"0x855CFcEEe998c8ca34F9c914F584AbF72dC88B87",original:"Ethereum"}],["wstETHoptimism",{symbol:"wstETH",decimals:18,address:"0x1F32b1c2345538c0c6f582fCB022739c4A194Ebb"}],["WKLAY",{symbol:"WKLAY",decimals:18,address:"0xbbeF8233a0d10EEAb84E913FaDB337ab9b62F683",original:"Klaytn"}],["PYTH",{symbol:"PYTH",decimals:6,address:"0x99C59ACeBFEF3BBFB7129DC90D1a11DB0E91187f",original:"Solana"}],["USDToptimism",{symbol:"USDT",decimals:6,address:"0x94b008aA00579c1307B0EF2c499aD98a8ce58e58"}]]],["Wormchain",[["WETH",{symbol:"WETH",decimals:8,address:"wormhole18csycs4vm6varkp00apuqlsm7v4twg8jsljk8wfdd7cghr7g4rtslwqndm",original:"Ethereum"}],["USDCeth",{symbol:"USDC",decimals:6,address:"wormhole1utjx3594tlvfw4375esgu72wa4sdgf0q7x4ye27husf5kvuzp5rsr72gdq",original:"Ethereum"}],["WBTC",{symbol:"WBTC",decimals:8,address:"wormhole1nz0r0au8aj6dc00wmm3ufy4g4k86rjzlr8wkf92cktdlps5lgfcqxnx9yk",original:"Ethereum"}],["USDT",{symbol:"USDT",decimals:6,address:"wormhole1w27ekqvvtzfanfxnkw4jx2f8gdfeqwd3drkee3e64xat6phwjg0savgmhw",original:"Ethereum"}],["DAI",{symbol:"DAI",decimals:8,address:"wormhole1chejx4qqtvwxy6684yrsmf6pylancxqhk3vsmtleg5ta3zrffljqfscg87",original:"Ethereum"}],["BUSD",{symbol:"BUSD",decimals:8,address:"wormhole1msyushf6d76u9wupuvm6jdvc0x4trmv5w5kxr0hyt7n9npp233usg7pkhm",original:"Ethereum"}],["WMATIC",{symbol:"WMATIC",decimals:8,address:"wormhole1xmpenz0ykxfy8rxr3yc3d4dtqq4dpas4zz3xl6sh873us3vajlpszn4ph7",original:"Polygon"}],["WBNB",{symbol:"WBNB",decimals:8,address:"wormhole169nr66h9gcsfljvsnxnqfjakskcjt6ac8f58wqjuagu79m540teqfvaal4",original:"Bsc"}],["USDCbnb",{symbol:"USDC",decimals:8,address:"wormhole1g3acw7aumaj3r348cqn4kazrehlmn822w9p46sqwztnke27h3lysxj4ddr",original:"Bsc"}],["WAVAX",{symbol:"WAVAX",decimals:8,address:"wormhole1ml922hnp59jtq9a87arekvx60ezehwlg2v3j5pduplwkenfa68ksgmzxwr",original:"Avalanche"}],["USDCavax",{symbol:"USDC",decimals:6,address:"wormhole1gwm6mrnse9atzf4mer4dnrz64mp6pa75wpsxywu8gymt9fwsk46sfr372u",original:"Avalanche"}],["WFTM",{symbol:"WFTM",decimals:8,address:"wormhole1e0cwfmla7exa578xddl87paxexw9ymwrzysfjms8c2mstxjkldlqn45jqa",original:"Fantom"}],["CELO",{symbol:"CELO",decimals:8,address:"wormhole1kqey3a6k26kyensq7elcpx229tlj4d3qlshwhjq5xjm8dcdvu60qtef8k9",original:"Celo"}],["WGLMR",{symbol:"WGLMR",decimals:8,address:"wormhole1gzuv84xrwwhxhf0f62av279vfyrfrm7x58fcnadlr5m90gnx223ses2st0",original:"Moonbeam"}],["WSOL",{symbol:"WSOL",decimals:8,address:"wormhole1wn625s4jcmvk0szpl85rj5azkfc6suyvf75q6vrddscjdphtve8sca0pvl",original:"Solana"}],["USDCsol",{symbol:"USDC",decimals:6,address:"wormhole17fr8awnysyv3nt5je4strczdupssl8u9jqam890jfv72sh32yyqqhtg3ry",original:"Solana"}],["SUI",{symbol:"SUI",decimals:8,address:"wormhole19hlynxzedrlqv99v6qscww7d3crhl86qtd0vprpltg5g9xx6jk9q6ya33y",original:"Sui"}],["APT",{symbol:"APT",decimals:8,address:"wormhole1f9sxjn0qu8xylcpzlvnhrefnatndqxnrajfrnr5h97hegnmsdqhsh6juc0",original:"Aptos"}],["WETHarbitrum",{symbol:"WETH",decimals:8,address:"wormhole18nlwscr7290j463vcptqlgqudycry2rdnw2ysltpc2nqefk3353s808rl9",original:"Arbitrum"}],["WETHoptimism",{symbol:"WETH",decimals:8,address:"wormhole1ev8rhdflmlq6de5g7ttj585fhuv3jfhnuhfzyh7qrswhzaq2tkqswxz6y3",original:"Optimism"}],["USDCoptimism",{symbol:"USDC",decimals:6,address:"wormhole1snw0qugpjcxwtxzzkqt5guwavq85eumxzeagql2u2m662xrtnjuqyj3pkj",original:"Optimism"}],["USDCbase",{symbol:"USDC",decimals:6,address:"wormhole1edkult6zudk6ld23fesjfrehux35q86engsq5jlycl0e4upkz8mqkgcprf",original:"Base"}],["tBTC",{symbol:"tBTC",decimals:8,address:"wormhole1nu9wf9dw384attnpu0pwfet5fajn05w2ex4r07mghvk3xcwrt2yq5uutp5",original:"Ethereum"}],["tBTCpolygon",{symbol:"tBTC",decimals:8,address:"wormhole1uj24zecnaxz7ftz0sh6dsayfene4w3yptwg0422kves9duel67vsr7hlyz",original:"Polygon"}],["tBTCarbitrum",{symbol:"tBTC",decimals:8,address:"wormhole1q8ynvqvtw49ln73mn70v4me4q03fvvmhkf2lh4ueam5w4362s2asjmvxtd",original:"Arbitrum"}],["wstETH",{symbol:"wstETH",decimals:8,address:"wormhole1gg6f95cymcfrfzhpek7cf5wl53t5kng52cd2m0krgdlu8k58vd8qezy8pt",original:"Ethereum"}],["WKLAY",{symbol:"WKLAY",decimals:8,address:"wormhole1kyy876kye7k79fuzat532yyqkrzhlr6l7hc7lfa2rk5tygzhy00qrhjgkc",original:"Klaytn"}]]],["Osmosis",[["WETH",{symbol:"WETH",decimals:8,address:"ibc/62F82550D0B96522361C89B0DA1119DE262FBDFB25E5502BC5101B5C0D0DBAAC",original:"Ethereum"}],["USDCeth",{symbol:"USDC",decimals:6,address:"ibc/6B99DB46AA9FF47162148C1726866919E44A6A5E0274B90912FD17E19A337695",original:"Ethereum"}],["WBTC",{symbol:"WBTC",decimals:8,address:"ibc/E4CD61E1FA3EB04EF1BF924D676AB9FD55E84A0DCF4E78C11CCA0E14E5B42672",original:"Ethereum"}],["USDT",{symbol:"USDT",decimals:6,address:"ibc/2108F2D81CBE328F371AD0CEF56691B18A86E08C3651504E42487D9EE92DDE9C",original:"Ethereum"}],["DAI",{symbol:"DAI",decimals:8,address:"ibc/898ACF6F5DEBF535103BBD52E3E5B70A311AD097B198A152483F69290B4210C0",original:"Ethereum"}],["WMATIC",{symbol:"WMATIC",decimals:8,address:"ibc/03B6D1925A09B3033AA6FA8772202719ABDC51F8CC2A5C26D0A9B19832F2C023",original:"Polygon"}],["WBNB",{symbol:"WBNB",decimals:8,address:"ibc/5394BB30B3C9BD1EE84C9531E5094DDE2490964F518CBE8A4C91F748CE559AF5",original:"Bsc"}],["USDCbnb",{symbol:"USDC",decimals:8,address:"ibc/B28ACEF11D063FA8B1DA73C2F7DA3A1CFCCBC13E96B671698D4860E9367B55BB",original:"Bsc"}],["WAVAX",{symbol:"WAVAX",decimals:8,address:"ibc/22B44C7369EED16089B9840ADE399B80D9483B4E459E67643C96C681D7C463D0",original:"Avalanche"}],["USDCavax",{symbol:"USDC",decimals:6,address:"ibc/0B3C3D06228578334B66B57FBFBA4033216CEB8119B27ACDEE18D92DA5B28D43",original:"Avalanche"}],["WFTM",{symbol:"WFTM",decimals:8,address:"ibc/397DFE63D87F6940ECA583DFF5461E48BF0BA6554CBBE70278E307DDFDC8E9D5",original:"Fantom"}],["CELO",{symbol:"CELO",decimals:8,address:"ibc/83300733052AB5F6E0F0C221E24189B6DF26CC94C73D2F44627627F9DEF4A9C8",original:"Celo"}],["WGLMR",{symbol:"WGLMR",decimals:8,address:"ibc/0F2941B0168D8DB77DA1B6A2D3A95EC04026D3C97FA3BFE8FD1D5D3F983AA518",original:"Moonbeam"}],["WSOL",{symbol:"WSOL",decimals:8,address:"ibc/1E43D59E565D41FB4E54CA639B838FFD5BCFC20003D330A56CB1396231AA1CBA",original:"Solana"}],["USDCsol",{symbol:"USDC",decimals:6,address:"ibc/F08DE332018E8070CC4C68FE06E04E254F527556A614F5F8F9A68AF38D367E45",original:"Solana"}],["SUI",{symbol:"SUI",decimals:8,address:"ibc/B1C287C2701774522570010EEBCD864BCB7AB714711B3AA218699FDD75E832F5",original:"Sui"}],["APT",{symbol:"APT",decimals:8,address:"ibc/A4D176906C1646949574B48C1928D475F2DF56DE0AC04E1C99B08F90BC21ABDE",original:"Aptos"}],["USDCbase",{symbol:"USDC",decimals:6,address:"ibc/8AC0F990290BBEF3AEBFCBF70F902AD954781BB40D07EB76341272800D48D05F",original:"Base"}],["OSMO",{symbol:"OSMO",decimals:6,address:"uosmo"}],["tBTC",{symbol:"tBTC",decimals:8,address:"ibc/6207D35D2C08F2162575C3C4BFD524226E50639121A273045F1B393AF67DCEB3",original:"Ethereum"}],["wstETH",{symbol:"wstETH",decimals:8,address:"ibc/BF75AE1500CB7EC458E91A11731F1B6AC1F1FE1FA937A88564955ED6A83CA2FB",original:"Ethereum"}]]],["Evmos",[["WETH",{symbol:"WETH",decimals:8,address:"ibc/4442A8E0D487A49E76EA6606F5DADCF8D0DBDD8499112340C964970DB745EDA2",original:"Ethereum"}],["USDCeth",{symbol:"USDC",decimals:6,address:"ibc/0C19171CDC59451F91D2749CDEA63355532DCD5D8904CCBAC4953290E16AB8FD",original:"Ethereum"}],["WBTC",{symbol:"WBTC",decimals:8,address:"ibc/46C5DA1CB61C5BAA8730ABA467ADD58DE0333B075CACE28BC87E64AE8C9CA051",original:"Ethereum"}],["USDT",{symbol:"USDT",decimals:6,address:"ibc/C9072A294F5649D64E87A6998DD750576881E454CACCDAF7376EFC0FA243808D",original:"Ethereum"}],["USDCbnb",{symbol:"USDC",decimals:8,address:"ibc/8E08C01546EF346F7E9A3600DDBC88943ADF3B20A67F1F2DD7B83D85613BCCAB",original:"Bsc"}],["WAVAX",{symbol:"WAVAX",decimals:8,address:"ibc/2EA2FE172078576E62DA20F14EEED12B26611D93150FE1D68E1AAE00479AC335",original:"Avalanche"}],["USDCavax",{symbol:"USDC",decimals:6,address:"ibc/39913E647C3549D663B1ED7F0745E1779515170C5215B98B2C8410B4C073AD30",original:"Avalanche"}],["WFTM",{symbol:"WFTM",decimals:8,address:"ibc/9EFE5F5D75A87197DD257BA7A96A3BCCEC9DB59D257C742FB5AA9D3DF612D476",original:"Fantom"}],["WSOL",{symbol:"WSOL",decimals:8,address:"ibc/4443218F584A7AB2DFBCF93872D6E5B6967A11C53515DDF45A2CF387C54BD73A",original:"Solana"}],["WETHarbitrum",{symbol:"WETH",decimals:8,address:"ibc/9E2E7B4A53409267CD686F4EB67969C2602A0F5FF9BDB1082B00E71CC4815DDE",original:"Arbitrum"}],["EVMOS",{symbol:"EVMOS",decimals:18,address:"aevmos"}]]],["Kujira",[["WETH",{symbol:"WETH",decimals:8,address:"ibc/7D9D28CABB49A4BB1A50C3B7E4544BFDBC5DDFAEB84A7787755A34CE7196CE15",original:"Ethereum"}],["USDCeth",{symbol:"USDC",decimals:6,address:"ibc/C5EADE2C526B9629D230AC02A97644984ACB7C2F9A6C85126D1025CB0DA42588",original:"Ethereum"}],["WBTC",{symbol:"WBTC",decimals:8,address:"ibc/B2C7F21B604E3974A7DA5DAA9395905F2F3C85392F8A221CFDF62E4A9F4E48E4",original:"Ethereum"}],["DAI",{symbol:"DAI",decimals:8,address:"ibc/3CE8A3DE4AE5AE2B4B8C03B2B227CC284732EDC849E506615FF2AA3D8EB1BAFC",original:"Ethereum"}],["WAVAX",{symbol:"WAVAX",decimals:8,address:"ibc/28E7241F6508EB4692C721E91201377323796EF2758CCD83D220A40EAD32601E",original:"Avalanche"}],["USDCavax",{symbol:"USDC",decimals:6,address:"ibc/F9F41DB8DA49EA6AB9EB4B2C9E0ECDC2502ABDA2FE728B85994BF31240CBC163",original:"Avalanche"}],["CELO",{symbol:"CELO",decimals:8,address:"ibc/4ACD155D71182398277CBD2C630A7C8C5F0F16FFF77965FDE4C845A4CDE2D60C",original:"Celo"}],["WGLMR",{symbol:"WGLMR",decimals:8,address:"ibc/3D337ECC89A8421DD6F33C4B7DDE9D4A18D728A4A688BA30E41F466EC8DD3869",original:"Moonbeam"}],["WSOL",{symbol:"WSOL",decimals:8,address:"ibc/E5CA126979E2FFB4C70C072F8094D07ECF27773B37623AD2BF7582AD0726F0F3",original:"Solana"}],["SUI",{symbol:"SUI",decimals:8,address:"ibc/EBA52E7239CC1BC7F8ECF4F41523B6DD477FF067FD953315704A9A4FD2131B48",original:"Sui"}],["KUJI",{symbol:"KUJI",decimals:6,address:"ukuji"}]]],["Klaytn",[["KLAY",{symbol:"KLAY",decimals:18,address:"native",wrappedKey:"WKLAY"}],["WKLAY",{symbol:"WKLAY",decimals:18,address:"0xe4f05A66Ec68B54A58B17c22107b02e0232cC817"}]]]],Cd=we(ap,[0,[1,2]]),cp=[["Ethereum",[["ETH",{symbol:"ETH",decimals:18,address:"native",wrappedKey:"WETH"}],["WETH",{symbol:"WETH",decimals:18,address:"0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6"}],["USDCeth",{symbol:"USDC",decimals:6,address:"0x07865c6e87b9f70255377e024ace6630c1eaa37f"}],["WBTC",{symbol:"WBTC",decimals:8,address:"0xC04B0d3107736C32e19F1c62b2aF67BE61d63a05"}],["USDT",{symbol:"USDT",decimals:6,address:"0xC2C527C0CACF457746Bd31B2a698Fe89de2b6d49"}],["DAI",{symbol:"DAI",decimals:18,address:"0x11fE4B6AE13d2a6055C8D9cF65c55bac32B5d844"}],["WMATIC",{symbol:"WMATIC",decimals:18,address:"0x7cd0e8ff09cEB653813bD3d63d0554c1CB4BFdf6",original:"Polygon"}],["WBNB",{symbol:"WBNB",decimals:18,address:"0xB19693FEB013Bab65866dE0a845a9511064230cE",original:"Bsc"}],["WAVAX",{symbol:"WAVAX",decimals:18,address:"0x4C1b727f6df3B075E682C41a25687A69846aaC04",original:"Avalanche"}],["USDCavax",{symbol:"USDC",decimals:6,address:"0xF6699D3f725C4b64Cc6010F2DF77B4B05C76Cd5C",original:"Avalanche"}],["WFTM",{symbol:"WFTM",decimals:18,address:"0x0d7A9Cdbb7C21E64825cF81750A5081a32aFb5d4",original:"Fantom"}],["CELO",{symbol:"CELO",decimals:18,address:"0xe092525a787CD56B901279b5864a224c22B95B72",original:"Celo"}],["WGLMR",{symbol:"WGLMR",decimals:18,address:"0x0dc83BB61008A5E1194fe50fA9E474713C1AEcD7",original:"Moonbeam"}],["WSOL",{symbol:"WSOL",decimals:9,address:"0x494701CE895389d917a938f0ea202D4eB9684Eab",original:"Solana"}],["SUI",{symbol:"SUI",decimals:9,address:"0x70F7360C49D227ccBbb98fB7B69B7CDB651195bb",original:"Sui"}],["APT",{symbol:"APT",decimals:8,address:"0xd7A89a8DD20Cb4F252c7FB96B6421b37d82cE506",original:"Aptos"}],["USDCarbitrum",{symbol:"USDC",decimals:6,address:"0xd962F26D93c4eF609Ba00Ed6101326A1490B9489",original:"Arbitrum"}],["WETHbase",{symbol:"WETH",decimals:18,address:"0x76e39239e40857030D6f4D8545EFbd71F904d344",original:"Base"}],["USDCbase",{symbol:"USDC",decimals:6,address:"0x5aA392243437dDC8b4d86bfC90DF296908740A41",original:"Base"}],["tBTC",{symbol:"tBTC",decimals:18,address:"0x679874fBE6D4E7Cc54A59e315FF1eB266686a937"}],["tBTCarbitrum",{symbol:"tBTC",decimals:18,address:"0x575D93A2278FbF4E8Bd3d51B539a6E237C3F17c5",original:"Arbitrum"}],["tBTCsol",{symbol:"tBTC",decimals:8,address:"0x57A52B6F0b393AF7d36116183cA83E584e636eA4",original:"Solana"}],["wstETH",{symbol:"wstETH",decimals:18,address:"0x6320cD32aA674d2898A68ec82e869385Fc5f7E2f"}],["SEI",{symbol:"SEI",decimals:6,address:"0xd68df72136207E9471C915cf1B6Cf43D587D4E0A",original:"Sei"}],["WKLAY",{symbol:"WKLAY",decimals:18,address:"0x327e0c7D5cFa65d4f9E358dC9fA4446C49dBcB6C",original:"Klaytn"}]]],["Polygon",[["WETH",{symbol:"WETH",decimals:18,address:"0xc6735cc74553Cc2caeB9F5e1Ea0A4dAe12ef4632",original:"Ethereum"}],["USDCeth",{symbol:"USDC",decimals:6,address:"0x543237045a106D7fd2eE3e2B44b5728e70BDe9c3",original:"Ethereum"}],["USDT",{symbol:"USDT",decimals:6,address:"0x02E30E84161BE1aBfcBB2b154B11De4C2b5E0a32",original:"Ethereum"}],["DAI",{symbol:"DAI",decimals:18,address:"0x87374d35C5F1bD78c2b1da383F460e154e7D3E5e",original:"Ethereum"}],["MATIC",{symbol:"MATIC",decimals:18,address:"native",wrappedKey:"WMATIC"}],["WMATIC",{symbol:"WMATIC",decimals:18,address:"0x9c3C9283D3e44854697Cd22D3Faa240Cfb032889"}],["USDCpolygon",{symbol:"USDC",decimals:6,address:"0x9999f7fea5938fd3b1e26a12c3f2fb024e194f97"}],["WBNB",{symbol:"WBNB",decimals:18,address:"0x0C63D8ADB69204b2946DcB945a6f16d97C255eE2",original:"Bsc"}],["WAVAX",{symbol:"WAVAX",decimals:18,address:"0x51f3D34651523dD8CC4872ee261A1B0B3f73AceF",original:"Avalanche"}],["USDCavax",{symbol:"USDC",decimals:6,address:"0xcc048C353Fdc2f5c378B7BCab9B240Ca2b619f1c",original:"Avalanche"}],["WFTM",{symbol:"WFTM",decimals:18,address:"0x84aa9100a36D6c3514605F62342abF3cE77D5b97",original:"Fantom"}],["CELO",{symbol:"CELO",decimals:18,address:"0xAd027790A64331A11bd1b651739450cC9Dc0098F",original:"Celo"}],["WGLMR",{symbol:"WGLMR",decimals:18,address:"0x693b9AC2199d989bDA8C9C5b5d7A3680B4f40dAa",original:"Moonbeam"}],["WSOL",{symbol:"WSOL",decimals:9,address:"0x0284B4994456Fae4cb56E4d33228d51B674EAD1b",original:"Solana"}],["SUI",{symbol:"SUI",decimals:9,address:"0x3dadA6f29f80A0427C4989E17a5a2ada17441841",original:"Sui"}],["APT",{symbol:"APT",decimals:8,address:"0x226B436043B537BD158e84fA199E2Aa36bf364f8",original:"Aptos"}],["WETHoptimism",{symbol:"WETH",decimals:18,address:"0xC77d781f38Cf52F8Ea0b4c0F22312bB9A34911b5",original:"Optimism"}],["WETHbase",{symbol:"WETH",decimals:18,address:"0x68C4365d5229A44D9A59058B65500365492b5307",original:"Base"}],["tBTC",{symbol:"tBTC",decimals:18,address:"0xf6CC0Cc8D54a4b1A63a0E9745663e0c844Ee4D48",original:"Ethereum"}],["tBTCpolygon",{symbol:"tBTC",decimals:18,address:"0xBcD7917282E529BAA6f232DdDc75F3901245A492"}],["SEI",{symbol:"SEI",decimals:6,address:"0xc5C0229B38564E1E8083031405Be8d6E6e3Bc462",original:"Sei"}],["WKLAY",{symbol:"WKLAY",decimals:18,address:"0x7b34f3711705eB2963fB856cda063C979de4749e",original:"Klaytn"}]]],["Bsc",[["WETH",{symbol:"WETH",decimals:18,address:"0x064a85eac6b4Bd7190BCAd3458dBD9459989c37B",original:"Ethereum"}],["USDCeth",{symbol:"USDC",decimals:6,address:"0x861B5C16A2EcED022241072A7beA9D530b99EB6f",original:"Ethereum"}],["USDT",{symbol:"USDT",decimals:6,address:"0xe94AaBAdB6F833f65B8A9AdDD030985B775188c9",original:"Ethereum"}],["DAI",{symbol:"DAI",decimals:18,address:"0x45082C9Fc6BBCa72288F47Fad21dE0BECC75759E",original:"Ethereum"}],["WMATIC",{symbol:"WMATIC",decimals:18,address:"0x7FCDA925f0994121752ca14C334297BeC3d0eA9E",original:"Polygon"}],["BNB",{symbol:"BNB",decimals:18,address:"native",wrappedKey:"WBNB"}],["WBNB",{symbol:"WBNB",decimals:18,address:"0xae13d989daC2f0dEbFf460aC112a837C89BAa7cd"}],["WAVAX",{symbol:"WAVAX",decimals:18,address:"0x6cE9E2c8b59bbcf65dA375D3d8AB503c8524caf7",original:"Avalanche"}],["USDCavax",{symbol:"USDC",decimals:6,address:"0x1cfeCf72bcBE1E429A21A5B11E708C7c397AaC54",original:"Avalanche"}],["WFTM",{symbol:"WFTM",decimals:18,address:"0x9aB305B792DBdb8253bEE909E7006611Cb45175b",original:"Fantom"}],["CELO",{symbol:"CELO",decimals:18,address:"0x1471698cBD9cAB0228F2EEA9303A2b3aA0ABDC2B",original:"Celo"}],["WGLMR",{symbol:"WGLMR",decimals:18,address:"0x5C31B36599ED7f06b09c0ffC7A2F928cE496F046",original:"Moonbeam"}],["WSOL",{symbol:"WSOL",decimals:9,address:"0x30f19eBba919954FDc020B8A20aEF13ab5e02Af0",original:"Solana"}],["USDCsol",{symbol:"USDC",decimals:6,address:"0x51a3cc54eA30Da607974C5D07B8502599801AC08",original:"Solana"}],["SUI",{symbol:"SUI",decimals:9,address:"0x5A73D76e09Af2E428EC64aE10F91B78AC990B298",original:"Sui"}],["APT",{symbol:"APT",decimals:8,address:"0x4A7Bd5E135f421057F97BbA8BCeeE5c18334f454",original:"Aptos"}],["WETHarbitrum",{symbol:"WETH",decimals:18,address:"0x60845E2503Fcd945b3A6f0bC077a31CC913E654D",original:"Arbitrum"}],["USDCarbitrum",{symbol:"USDC",decimals:6,address:"0xe3aA397cb6d93Cce4fAd9Cc9E796CCa5E50FB5ED",original:"Arbitrum"}],["WETHbase",{symbol:"WETH",decimals:18,address:"0x63108fC941F3cCE0B484De19746B5Af949EAF6eE",original:"Base"}],["tBTC",{symbol:"tBTC",decimals:18,address:"0xE7176110261ef2FfC885dd568C1093f58F0aEee9",original:"Ethereum"}],["SEI",{symbol:"SEI",decimals:6,address:"0x79A8FFFCED130314eCC8782C846c4d8d4867A900",original:"Sei"}],["WKLAY",{symbol:"WKLAY",decimals:18,address:"0x79D34FDb686B5D139949E4F92D83EEe376489176",original:"Klaytn"}]]],["Avalanche",[["WETH",{symbol:"WETH",decimals:18,address:"0xbB5A2dC896Ec4E2fa77F40FA630582ed9c6D0172",original:"Ethereum"}],["USDCeth",{symbol:"USDC",decimals:6,address:"0x63A30f239DC8d1c17Bf6653a68Fc6C2F83641E6d",original:"Ethereum"}],["DAI",{symbol:"DAI",decimals:18,address:"0x3989C9c4bdd30400E6Aa90990683EAd6a1638A16",original:"Ethereum"}],["WMATIC",{symbol:"WMATIC",decimals:18,address:"0x78554394273957d7e55afC841aeA27Cce469AEd4",original:"Polygon"}],["WBNB",{symbol:"WBNB",decimals:18,address:"0x10F1053bF2884b28ee0Bd7a2dDBa237Af3511d29",original:"Bsc"}],["AVAX",{symbol:"AVAX",decimals:18,address:"native",wrappedKey:"WAVAX"}],["WAVAX",{symbol:"WAVAX",decimals:18,address:"0xd00ae08403B9bbb9124bB305C09058E32C39A48c"}],["USDCavax",{symbol:"USDC",decimals:6,address:"0x5425890298aed601595a70AB815c96711a31Bc65"}],["WFTM",{symbol:"WFTM",decimals:18,address:"0x094cB577C21Ab1360178beE74B9591fa12216dAD",original:"Fantom"}],["CELO",{symbol:"CELO",decimals:18,address:"0xC66d9c2b33c347d4A4441975f4688fcD5DD4c441",original:"Celo"}],["WGLMR",{symbol:"WGLMR",decimals:18,address:"0xf080782DF38eD5228D2FC2882d13D56c8f1D6f21",original:"Moonbeam"}],["WSOL",{symbol:"WSOL",decimals:9,address:"0xb10563644a6AB8948ee6d7f5b0a1fb15AaEa1E03",original:"Solana"}],["SUI",{symbol:"SUI",decimals:9,address:"0xfc5128F8556a6F059466E67740e6cC31EE5C2C47",original:"Sui"}],["APT",{symbol:"APT",decimals:8,address:"0x996a3f12C1FcD7339Ea8801f629201e4d42EAD04",original:"Aptos"}],["WETHarbitrum",{symbol:"WETH",decimals:18,address:"0x36Bd1562F874941eE62Ebb2b3A45B4A88A9df90e",original:"Arbitrum"}],["WETHoptimism",{symbol:"WETH",decimals:18,address:"0x301587BF484756441de43E522027e3751871237B",original:"Optimism"}],["WETHbase",{symbol:"WETH",decimals:18,address:"0xc07c754ef7473d315D973F7D9F7858C2eCe0a0a6",original:"Base"}],["tBTC",{symbol:"tBTC",decimals:18,address:"0x7E1779F65B644E5f98DdC4D2cB0A0106a7E6d9e1",original:"Ethereum"}],["tBTCarbitrum",{symbol:"tBTC",decimals:18,address:"0x4beDc7471374d7479120E44ea9593eBB85f48AD9",original:"Arbitrum"}],["SEI",{symbol:"SEI",decimals:6,address:"0xfe2eCDD1708aaebf1cF802C6124fAFb18B22dfEE",original:"Sei"}]]],["Fantom",[["WETH",{symbol:"WETH",decimals:18,address:"0x758FEebDDeC06f4bCcEc8F756C8efBD35d5b7124",original:"Ethereum"}],["USDCeth",{symbol:"USDC",decimals:6,address:"0xDF7928AF5B33F7de592594958D8d6Ff8472Eb407",original:"Ethereum"}],["USDT",{symbol:"USDT",decimals:6,address:"0x32eF19C4b3DF65a24972A489e70AdDef5E54262C",original:"Ethereum"}],["DAI",{symbol:"DAI",decimals:18,address:"0xE4FE5DF2084f9D81595e4fcba2399020FBE7b233",original:"Ethereum"}],["WMATIC",{symbol:"WMATIC",decimals:18,address:"0x47a4C4c0f96D6CBe5b5C0A46CB0E22d6A17F1430",original:"Polygon"}],["WBNB",{symbol:"WBNB",decimals:18,address:"0xfB174b43228950C2055CFc25AE93f2DCe8E2beF0",original:"Bsc"}],["WAVAX",{symbol:"WAVAX",decimals:18,address:"0x0f545Be981C37fB15ab7c65404648761e99016e4",original:"Avalanche"}],["USDCavax",{symbol:"USDC",decimals:6,address:"0x6BC4E8D8c1d54656D1DeBCa96efc53aFd1408aD2",original:"Avalanche"}],["FTM",{symbol:"FTM",decimals:18,address:"native",wrappedKey:"WFTM"}],["WFTM",{symbol:"WFTM",decimals:18,address:"0xf1277d1Ed8AD466beddF92ef448A132661956621"}],["CELO",{symbol:"CELO",decimals:18,address:"0xB18E73a69c3Aaea39a610372537Cf8482622d199",original:"Celo"}],["WGLMR",{symbol:"WGLMR",decimals:18,address:"0x41E3CFDFC255A4bF3C8D3560Bc8D3D9b5080338e",original:"Moonbeam"}],["WSOL",{symbol:"WSOL",decimals:9,address:"0xED1a08Fc69A7008d225890A96aaE258c465CC7ad",original:"Solana"}],["SUI",{symbol:"SUI",decimals:9,address:"0xd882AB49372eC093E8697B5153f54ab5e7738e3b",original:"Sui"}],["APT",{symbol:"APT",decimals:8,address:"0xAb2297E8994149BA91737944E40891881aF762a4",original:"Aptos"}],["WETHarbitrum",{symbol:"WETH",decimals:18,address:"0x456e08952f9091B6c268dC0cECad53d141152C59",original:"Arbitrum"}],["USDCoptimism",{symbol:"USDC",decimals:6,address:"0x685B29e17440c42758Ab3F80FD3603EF01bebe9A",original:"Optimism"}],["WETHbase",{symbol:"WETH",decimals:18,address:"0x01950A33DfFa63E6Bc23b5dB440505581A4cc0e7",original:"Base"}],["tBTC",{symbol:"tBTC",decimals:18,address:"0x66E080407407620844fE2083c33108BE55E087bc",original:"Ethereum"}],["SEI",{symbol:"SEI",decimals:6,address:"0x832e8050D6c64724500DE9B0ffe1CAc6c570a26d",original:"Sei"}]]],["Celo",[["WETH",{symbol:"WETH",decimals:18,address:"0x898471a82737dFFfB61915F9e8381e279076D72b",original:"Ethereum"}],["USDCeth",{symbol:"USDC",decimals:6,address:"0xB0524bEF6c61c6150B340b2828a890fD8dEa60C0",original:"Ethereum"}],["DAI",{symbol:"DAI",decimals:18,address:"0xeBB3fF6E5d61d3793Fdb60f7942BA78E636019f6",original:"Ethereum"}],["WMATIC",{symbol:"WMATIC",decimals:18,address:"0x7a56409988BBF8758b3ba412b9c7E3FE504C8544",original:"Polygon"}],["WBNB",{symbol:"WBNB",decimals:18,address:"0xa8050be9389466c3c524F10F131f244ACbf21A0D",original:"Bsc"}],["WAVAX",{symbol:"WAVAX",decimals:18,address:"0x502c8C83008D9Dd812a7C5fB886C063060C73Dbf",original:"Avalanche"}],["USDCavax",{symbol:"USDC",decimals:6,address:"0xDDB349c976cA2C873644F21f594767Eb5390C831",original:"Avalanche"}],["WFTM",{symbol:"WFTM",decimals:18,address:"0xE6F8710cA14CFe7F5aAAD3A799C3d1D92dCba938",original:"Fantom"}],["CELO",{symbol:"CELO",decimals:18,address:"0xF194afDf50B03e69Bd7D057c1Aa9e10c9954E4C9"}],["WGLMR",{symbol:"WGLMR",decimals:18,address:"0x132D2172D89cd9CfD480A8887c6bF92360fB460e",original:"Moonbeam"}],["WSOL",{symbol:"WSOL",decimals:9,address:"0x05EEF2AE1A7A938D78598F7d9e8b97A9bED0c9eC",original:"Solana"}],["SUI",{symbol:"SUI",decimals:9,address:"0xa40d9E69ca9867C4bFbeC11Ce79C939991e9bf26",original:"Sui"}],["APT",{symbol:"APT",decimals:8,address:"0xAC0a2fF7DD597de863878a3372142b07B614C125",original:"Aptos"}],["USDCarbitrum",{symbol:"USDC",decimals:6,address:"0x0C4AbF95Ff3d82d1F02f55e65050eA5bA062606E",original:"Arbitrum"}],["WETHoptimism",{symbol:"WETH",decimals:18,address:"0x28E768a51D19dcB753a24B79D1e89c92fee094Ba",original:"Optimism"}],["tBTC",{symbol:"tBTC",decimals:18,address:"0x01a050Fc725F4E99aAD43Eb6f8481f38ee6231aD",original:"Ethereum"}],["SEI",{symbol:"SEI",decimals:6,address:"0x05Efb4aC79ef48a4830f517834c6f5f039F16832",original:"Sei"}]]],["Moonbeam",[["WETH",{symbol:"WETH",decimals:18,address:"0xd27d8883E31FAA11B2613b14BE83ad8951C8783C",original:"Ethereum"}],["USDCeth",{symbol:"USDC",decimals:6,address:"0xE5dE10C4b744bac6b783fAF8d9B9fDFF14Acc3c9",original:"Ethereum"}],["USDT",{symbol:"USDT",decimals:6,address:"0x7f5Ca1bcFb38fDF4c0E0646FCbf3FA87740ff65D",original:"Ethereum"}],["DAI",{symbol:"DAI",decimals:18,address:"0xc31EC0108D8e886be58808B4C2C53f8365f1885D",original:"Ethereum"}],["WMATIC",{symbol:"WMATIC",decimals:18,address:"0xD2888f015BcB76CE3d27b6024cdEFA16836d0dbb",original:"Polygon"}],["WBNB",{symbol:"WBNB",decimals:18,address:"0x6097E80331B0c6aF4F74D7F2363E70Cb2Fd078A5",original:"Bsc"}],["WAVAX",{symbol:"WAVAX",decimals:18,address:"0x2E8afeCC19842229358f3650cc3F091908dcbaB4",original:"Avalanche"}],["USDCavax",{symbol:"USDC",decimals:6,address:"0x6533CE14804D113b1F494dC56c5D60A43cb5C3b5",original:"Avalanche"}],["WFTM",{symbol:"WFTM",decimals:18,address:"0x566c1cebc6A4AFa1C122E039C4BEBe77043148Ee",original:"Fantom"}],["CELO",{symbol:"CELO",decimals:18,address:"0x3406a9b09adf0cb36DC04c1523C4b294C6b79513",original:"Celo"}],["GLMR",{symbol:"GLMR",decimals:18,address:"native",wrappedKey:"WGLMR"}],["WGLMR",{symbol:"WGLMR",decimals:18,address:"0xD909178CC99d318e4D46e7E66a972955859670E1"}],["SUI",{symbol:"SUI",decimals:9,address:"0x2ed4B5B1071A3C676664E9085C0e3826542C1b27",original:"Sui"}],["APT",{symbol:"APT",decimals:8,address:"0xCaa2A1d3BbbA0D1466571e83b4E2CbE04252593D",original:"Aptos"}],["WETHarbitrum",{symbol:"WETH",decimals:18,address:"0x15025b956969DD8F1d0CD69959Ad97128F8f6D69",original:"Arbitrum"}],["USDCoptimism",{symbol:"USDC",decimals:6,address:"0xf98E630a3DD4F21Cab7a37Bb01209cb62959169D",original:"Optimism"}],["USDCbase",{symbol:"USDC",decimals:6,address:"0x7480641F5B00b4Fc39d6AaeC4Cd851EdEA7f31CF",original:"Base"}],["tBTC",{symbol:"tBTC",decimals:18,address:"0xf82E21cE03471983Afb9c2E3789Aa13a2d7242E8",original:"Ethereum"}],["SEI",{symbol:"SEI",decimals:6,address:"0x1EdDe35B7e058194B457B8621285EaFA710f01ea",original:"Sei"}]]],["Solana",[["WETH",{symbol:"WETH",decimals:8,address:"7VPWjBhCXrpYYBiRKZh1ubh9tLZZNkZGp2ReRphEV4Mc",original:"Ethereum"}],["USDCeth",{symbol:"USDC",decimals:6,address:"2BAqec7Qof3Y7VJatwFsRHUNSQBSkzaEsT1V5bW6dbZY",original:"Ethereum"}],["DAI",{symbol:"DAI",decimals:8,address:"3WK3mEDNPrNuQReBvM28NcsqrExMnPxD9pPJmgrUeKKH",original:"Ethereum"}],["WMATIC",{symbol:"WMATIC",decimals:8,address:"ACbmcQxbbhiXWM1GmapUSMmBYKMvnFLfAAXKqdo8xKwo",original:"Polygon"}],["WBNB",{symbol:"WBNB",decimals:8,address:"BaGfF51MQ3a61papTRDYaNefBgTQ9ywnVne5fCff4bxT",original:"Bsc"}],["WAVAX",{symbol:"WAVAX",decimals:8,address:"3Ftc5hTz9sG4huk79onufGiebJNDMZNL8HYgdMJ9E7JR",original:"Avalanche"}],["USDCavax",{symbol:"USDC",decimals:6,address:"GQtMXZxnuacCFTXVeTvyHi6P9F6chbtzhVc8JgD8hv7c",original:"Avalanche"}],["WFTM",{symbol:"WFTM",decimals:8,address:"DMw2tLaq1bVoAEKtkoUtieSk9bfCPUvubYLatTMsSVop",original:"Fantom"}],["CELO",{symbol:"CELO",decimals:8,address:"84F2QX9278ToDmA98u4A86xSV9hz1ovazr8zwGaX6qjS",original:"Celo"}],["WGLMR",{symbol:"WGLMR",decimals:8,address:"8987WGkYa5viiZ9DD8sS3PB5XghKmWjkEgmzvwDuoAEc",original:"Moonbeam"}],["SOL",{symbol:"SOL",decimals:9,address:"native",wrappedKey:"WSOL"}],["WSOL",{symbol:"WSOL",decimals:9,address:"So11111111111111111111111111111111111111112"}],["USDCsol",{symbol:"USDC",decimals:6,address:"4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU"}],["SUI",{symbol:"SUI",decimals:8,address:"BJZ72CjPQojVoH68mzrd4VQ4nr6KuhbAGnhZEZCujKxY",original:"Sui"}],["APT",{symbol:"APT",decimals:8,address:"7EvFD3JKCJVdtkAYdaSVKJsrPEJCzy2neJha7TREGrCa",original:"Aptos"}],["WETHbase",{symbol:"WETH",decimals:8,address:"EKZqcBZ3Y7YTDinpecA7SxRp9B4s1m99VHJ9jpvyTwzW",original:"Base"}],["tBTC",{symbol:"tBTC",decimals:8,address:"FMYvcyMJJ22whB9m3T5g1oPKwM6jpLnFBXnrY6eXmCrp",original:"Ethereum"}],["tBTCoptimism",{symbol:"tBTC",decimals:8,address:"HsPvRT3J7kuitNvNHogyZeSEagcqAqwwq2FPgrGfgApy",original:"Optimism"}],["tBTCsol",{symbol:"tBTC",decimals:8,address:"6DNSN2BJsaPFdFFc1zP37kkeNe4Usc1Sqkzr9C9vPWcU"}],["SEI",{symbol:"SEI",decimals:6,address:"8LFdfuhbfdH8oBzSKDgfPAxvLW24dCM9ttjBrBobURuk",original:"Sei"}]]],["Sui",[["WETH",{symbol:"WETH",decimals:8,address:"0x72831f626b1f0e11be201893d5cb641917730b1ccac778e4a77f8ab2052f0784::coin::COIN",original:"Ethereum"}],["USDCeth",{symbol:"USDC",decimals:6,address:"0x9e4396c19ec1c5f2214c79d3af3f31e59869640305560f8f2499c36fa9c8e0f2::coin::COIN",original:"Ethereum"}],["DAI",{symbol:"DAI",decimals:8,address:"0xe6fc78aa2b52b785bdcb67901cd85793a0b593248f315cb755974d23d0fcb837::coin::COIN",original:"Ethereum"}],["WMATIC",{symbol:"WMATIC",decimals:8,address:"0xa516bcbf83b29a2944bb53ec9f934ea7d78c3626d3ae411d2fb9dcb977522e67::coin::COIN",original:"Polygon"}],["WBNB",{symbol:"WBNB",decimals:8,address:"0xddcf8680a8a4b8a527d8c85ec203274991590c2ea898d1c4635b70164d9c584b::coin::COIN",original:"Bsc"}],["WAVAX",{symbol:"WAVAX",decimals:8,address:"0xa600741c469fb57ed01497ddf101e798fa79a9c529bd176675c5c4d970811f80::coin::COIN",original:"Avalanche"}],["USDCavax",{symbol:"USDC",decimals:6,address:"0x2aa8c885d04e676c4e87b7d0f94d4f3b243b1b5d93239d1cc41d5528ce1714c1::coin::COIN",original:"Avalanche"}],["WFTM",{symbol:"WFTM",decimals:8,address:"0x14e756ff65e0ac810a5f69ca5276ef5b899a6df3c4717de1f85559d8b5ae6ea6::coin::COIN",original:"Fantom"}],["CELO",{symbol:"CELO",decimals:8,address:"0x81868174a6b11e1acc337b3414f9912455435d486609fb8d50b34312865085f2::coin::COIN",original:"Celo"}],["WGLMR",{symbol:"WGLMR",decimals:8,address:"0xeffae382de96981f7ddd2d294429924827e8f325d612487a12d6a0b249171002::coin::COIN",original:"Moonbeam"}],["WSOL",{symbol:"WSOL",decimals:8,address:"0xbc03aaab4c11eb84df8bf39fdc714fa5d5b65b16eb7d155e22c74a68c8d4e17f::coin::COIN",original:"Solana"}],["SUI",{symbol:"SUI",decimals:9,address:"0x2::sui::SUI"}],["APT",{symbol:"APT",decimals:8,address:"0x812d6feb8b84e55d47a0bfcae9fb6a4e7e09be5ec86ce0a729e0f67d5f59f477::coin::COIN",original:"Aptos"}],["USDCoptimism",{symbol:"USDC",decimals:6,address:"0xbbc39df58a11072ceeac1f685393ca912d1a1bfd6e772053ec5a544f36124da::coin::COIN",original:"Optimism"}],["WETHbase",{symbol:"WETH",decimals:8,address:"0x7b442b988864149dedfb9b6a75a88c7c33b9ddd3d15a87bf25104e1fcdd680ab::coin::COIN",original:"Base"}],["USDCbase",{symbol:"USDC",decimals:6,address:"0x4125940814a0ca87465a1a59092a7344633ad03b48ad7cda36d799d8558012c1::coin::COIN",original:"Base"}],["tBTC",{symbol:"tBTC",decimals:8,address:"0xacf6784120b221a077ab0b84acc0b76930779eb55f157ea2492be4a60b808f6::coin::COIN",original:"Ethereum"}],["SEI",{symbol:"SEI",decimals:6,address:"0x22c5cdaabaae4b6d3351f9bba9511b0aebb0662a6c209a360f0776e1e77a8438::coin::COIN",original:"Sei"}]]],["Aptos",[["WETH",{symbol:"WETH",decimals:8,address:"0x381775005cb32cdd3dbf935ae1b978ed40d309c72b009cd4a812aab6d991418a::coin::T",original:"Ethereum"}],["WMATIC",{symbol:"WMATIC",decimals:8,address:"0x5f229253e2b2d03fb909f565feca49452582bd633a5816e5ce30aa593cb49d8a::coin::T",original:"Polygon"}],["WBNB",{symbol:"WBNB",decimals:8,address:"0xa5894f5ddb8647e6143102aa336ff07374f7b32e88c1c703aef5b7c9a370bf80::coin::T",original:"Bsc"}],["WAVAX",{symbol:"WAVAX",decimals:8,address:"0xbe8f4301c0b54e870902b9a23eeb95ce74ac190531782aa3262337ceb145401a::coin::T",original:"Avalanche"}],["USDCavax",{symbol:"USDC",decimals:6,address:"0x02ef7697bdb33361ca39d228671203afc0dea3202e792d79d2072b761d87c834::coin::T",original:"Avalanche"}],["WFTM",{symbol:"WFTM",decimals:8,address:"0x533c6ade00d15d1e014c41e29e34853e87df92c4e01a6a3f41318dbd098048d6::coin::T",original:"Fantom"}],["CELO",{symbol:"CELO",decimals:8,address:"0xecbb0f7e7d049499ca83ca1358344f56557886f6f7adc740d6734cce7bfc9a14::coin::T",original:"Celo"}],["WGLMR",{symbol:"WGLMR",decimals:8,address:"0x338373b6694f71dbeac5ca4a30503bf5f083888d71678aed31255de416be37c0::coin::T",original:"Moonbeam"}],["WSOL",{symbol:"WSOL",decimals:8,address:"0xdd89c0e695df0692205912fb69fc290418bed0dbe6e4573d744a6d5e6bab6c13::coin::T",original:"Solana"}],["SUI",{symbol:"SUI",decimals:8,address:"0x7b22d0e02f653d4fd1caddcfa4719a2b329da56eb81d8f27db703f02466c26a5::coin::T",original:"Sui"}],["APT",{symbol:"APT",decimals:8,address:"0x1::aptos_coin::AptosCoin"}],["USDCarbitrum",{symbol:"USDC",decimals:6,address:"0x3f0fdd44d96dae888d6c576218cf655458316a27c7bdc46537f61e531b10d3df::coin::T",original:"Arbitrum"}],["USDCoptimism",{symbol:"USDC",decimals:6,address:"0xcff1d9820851201436ad225dcc4374a2d15f52a74109283eb9881be799677e92::coin::T",original:"Optimism"}],["WETHbase",{symbol:"WETH",decimals:8,address:"0x5b5f14781164cf77185a7b6acd8e4f3cbb7e7cfb1cd5760d2b8af81075fc153d::coin::T",original:"Base"}],["USDCbase",{symbol:"USDC",decimals:6,address:"0xcfaabb3cb08ad612905dd6b2593d044ce857dfe5360148333b4635fb57d4d13f::coin::T",original:"Base"}],["tBTC",{symbol:"tBTC",decimals:8,address:"0x6e2d5d1a6d6d0e0c5db506ce64ead0530847a48b96516abbb08cdebe43fe3036::coin::T",original:"Ethereum"}],["SEI",{symbol:"SEI",decimals:6,address:"0xcae0ba0b7a435730ab65f1c8357d213e5cf9d4b377b96761745a8edaf9c9df6d::coin::T",original:"Sei"}]]],["Base",[["WETH",{symbol:"WETH",decimals:18,address:"0x44D627f900da8AdaC7561bD73aA745F132450798",original:"Ethereum"}],["USDCeth",{symbol:"USDC",decimals:6,address:"0x5010B0988a035915C91a2a432085824FcB3D8d3f",original:"Ethereum"}],["DAI",{symbol:"DAI",decimals:18,address:"0x31B2BAEE47Dc5Fc06baEC1BF73C124031b44fB97",original:"Ethereum"}],["WMATIC",{symbol:"WMATIC",decimals:18,address:"0xFFB5d863d5132523d013338845A1Bb01EDd440f4",original:"Polygon"}],["WBNB",{symbol:"WBNB",decimals:18,address:"0x9DeF11E63C23c71dE3716b81dD2Fdad2B24b8b7F",original:"Bsc"}],["WAVAX",{symbol:"WAVAX",decimals:18,address:"0x410B0EE532EFfB18fa4d90cc095B1CD58aC43d5a",original:"Avalanche"}],["USDCavax",{symbol:"USDC",decimals:6,address:"0x4C5208246676486064c501E1DAF2dD21596Bc5f5",original:"Avalanche"}],["WFTM",{symbol:"WFTM",decimals:18,address:"0xB4808E58713112AbAbB8167C7187F8988df38bbD",original:"Fantom"}],["CELO",{symbol:"CELO",decimals:18,address:"0x72C56041ea5fe8bDE99b2A123fb5964cDE8C7FE9",original:"Celo"}],["WGLMR",{symbol:"WGLMR",decimals:18,address:"0xCEc03b5710a464F4354AF35ebD0310238F656DFf",original:"Moonbeam"}],["WSOL",{symbol:"WSOL",decimals:9,address:"0x6Fb1dE2372e48fe66c84cf37cc2fb54EaEe62988",original:"Solana"}],["SUI",{symbol:"SUI",decimals:9,address:"0xEe0fC8BECD593B41AACBd93936fDAbc2A444370A",original:"Sui"}],["APT",{symbol:"APT",decimals:8,address:"0xd934A15FfA3945DD0Ba2cb7b4174024261A14874",original:"Aptos"}],["WETHarbitrum",{symbol:"WETH",decimals:18,address:"0x8eD43aBdc4f836aa60933177B31AC358ea09f27E",original:"Arbitrum"}],["WETHoptimism",{symbol:"WETH",decimals:18,address:"0x5c443C05C72F0660502d88642c807020cc9b71A2",original:"Optimism"}],["ETHbase",{symbol:"ETH",decimals:18,address:"native",wrappedKey:"WETHbase"}],["WETHbase",{symbol:"WETH",decimals:18,address:"0x4200000000000000000000000000000000000006"}],["USDCbase",{symbol:"USDC",decimals:6,address:"0xf175520c52418dfe19c8098071a252da48cd1c19"}],["tBTC",{symbol:"tBTC",decimals:18,address:"0x0219441240d89fAc3fD708d06d8fD3A072C02FB6",original:"Ethereum"}],["tBTCbase",{symbol:"tBTC",decimals:18,address:"0x783349cd20f26CE12e747b1a17bC38D252c9e119"}],["tBTCsol",{symbol:"tBTC",decimals:8,address:"0x9dA16Ae62De05bcb4606c4BFbB54046872501Bd0",original:"Solana"}],["SEI",{symbol:"SEI",decimals:6,address:"0x7B5edB2B3d2BeA8057a736B82AC6EF35c70bdadD",original:"Sei"}]]],["Sei",[["WETH",{symbol:"WETH",decimals:8,address:"sei13pzlt9etk44hj22lckncvampq2qu2gxv6r6774f3hma4vc07wqgsmftjx7",original:"Ethereum"}],["USDCeth",{symbol:"USDC",decimals:6,address:"sei1nj32y0h0vzam33ay42h2majlfk7tdkqcuk84srn0v2a52kmujgfsyfe78f",original:"Ethereum"}],["WMATIC",{symbol:"WMATIC",decimals:8,address:"sei1dc94as3vgxn3qkr5h0lnnrep69mtfku6jg4t94gfkunuyzr5g5eqyqvj9p",original:"Polygon"}],["WBNB",{symbol:"WBNB",decimals:8,address:"sei10a7see3f9t2j9l8fdweur3aqy4zgvz583a268hhhln3yzps6l5mqnl4ua6",original:"Bsc"}],["WAVAX",{symbol:"WAVAX",decimals:8,address:"sei1mgpq67pj7p2acy5x7r5lz7fulxmuxr3uh5f0szyvqgvru3glufzsxk8tnx",original:"Avalanche"}],["USDCavax",{symbol:"USDC",decimals:6,address:"sei1uyce5s6cc8hveg0maq2lg7wm6v6fvwqmznypj559nzf9wr9tmw3qnd3ce7",original:"Avalanche"}],["WFTM",{symbol:"WFTM",decimals:8,address:"sei1cr3j7rxq0dhq04ksftmj8n2w096w9g7ck8fngkvk2lrmy3qwz56q9thu9u",original:"Fantom"}],["CELO",{symbol:"CELO",decimals:8,address:"sei1yw4wv2zqg9xkn67zvq3azye0t8h0x9kgyg3d53jym24gxt49vdyswk5upj",original:"Celo"}],["WGLMR",{symbol:"WGLMR",decimals:8,address:"sei140m6xagmw0zesejzhsvk46zprgscr7tu94h36rwsutcsxcs4fmds9sevym",original:"Moonbeam"}],["WSOL",{symbol:"WSOL",decimals:8,address:"sei1at3xuugacwgu3ppx7fxzmtr3q6m3ztjuean9r2mwcnqupw28yezs7unxgz",original:"Solana"}],["SUI",{symbol:"SUI",decimals:8,address:"sei1rhpcprr2pffe6ydf078a0qeslhnlywxh2t3wjax4489z0m29cj9swj5khc",original:"Sui"}],["APT",{symbol:"APT",decimals:8,address:"sei1em74y5sts4h8y5zuhfdn4w5g8zs285qld3kczpk6rh32jpvjyqqsvv0pdt",original:"Aptos"}],["WETHarbitrum",{symbol:"WETH",decimals:8,address:"sei1pf5j3dgngm8yj2xkwmvmvt87g4vyc0szpjz92q8ly9erh23ytn4s983htv",original:"Arbitrum"}],["WETHbase",{symbol:"WETH",decimals:8,address:"sei1kdqylzcv86t7slg8m30mlfgna9xsrusghdgnavvurkv0rku7jvqqta7lka",original:"Base"}],["USDCbase",{symbol:"USDC",decimals:6,address:"sei1lf6ghmrkd7gn5jlj6xw64suycpjy7g4s5q92fc2gef4f8q3znanq95mmgv",original:"Base"}],["tBTCsol",{symbol:"tBTC",decimals:8,address:"sei1aj3uu9ejt8fk6rpjfhzluqnzqmv3enlndjmt8llkr7dn2dtz55xst4s3mn",original:"Solana"}],["SEI",{symbol:"SEI",decimals:6,address:"usei"}]]],["Arbitrum",[["WETH",{symbol:"WETH",decimals:18,address:"0x285d75E04D78F53f4Ed29A506a7e8479EEf3035f",original:"Ethereum"}],["USDCeth",{symbol:"USDC",decimals:6,address:"0x42A212A2E7eA8feF4ED28F439F16A6ABDd34DA35",original:"Ethereum"}],["USDT",{symbol:"USDT",decimals:6,address:"0x2B732F5ad6117818Ad3b7aC73C16033F6ECD78E5",original:"Ethereum"}],["WMATIC",{symbol:"WMATIC",decimals:18,address:"0x50FD4064cC536a964E2E0Dc7B3fE2313Ab386bEA",original:"Polygon"}],["WBNB",{symbol:"WBNB",decimals:18,address:"0xB039aC4Fa8Ed99d30C2f7D791294A9d5FAd698eF",original:"Bsc"}],["WAVAX",{symbol:"WAVAX",decimals:18,address:"0x92b0C4D27a05921Ded4BB117755990F567aEe049",original:"Avalanche"}],["USDCavax",{symbol:"USDC",decimals:6,address:"0xb39697B8BA5df91A169690DfEf88B911436619F2",original:"Avalanche"}],["WFTM",{symbol:"WFTM",decimals:18,address:"0xa507f7566B8aDE000E886166B95964677ef3b3Ef",original:"Fantom"}],["CELO",{symbol:"CELO",decimals:18,address:"0x9592eE6eD1D9E611b7aa6F20CCbD7Ba571Be8bdd",original:"Celo"}],["WSOL",{symbol:"WSOL",decimals:9,address:"0xF8cbdc4E54281b801f182039c250Ad6d13818250",original:"Solana"}],["SUI",{symbol:"SUI",decimals:9,address:"0xe64e2139fdf6Ee7e3795FE51955e21bA3d9eB9F7",original:"Sui"}],["APT",{symbol:"APT",decimals:8,address:"0xa81C3BEf2d6f10213b860458DC119666C0ba13bf",original:"Aptos"}],["ETHarbitrum",{symbol:"ETH",decimals:18,address:"native",wrappedKey:"WETHarbitrum"}],["WETHarbitrum",{symbol:"WETH",decimals:18,address:"0xee01c0cd76354c383b8c7b4e65ea88d00b06f36f"}],["USDCarbitrum",{symbol:"USDC",decimals:6,address:"0xfd064A18f3BF249cf1f87FC203E90D8f650f2d63"}],["WETHoptimism",{symbol:"WETH",decimals:18,address:"0xFd903eA23Bf65f26FdAf2eeb589cf007b108882E",original:"Optimism"}],["WETHbase",{symbol:"WETH",decimals:18,address:"0xbC4CB3CD7186fD457C072298C48d0eDf7213CAEa",original:"Base"}],["tBTC",{symbol:"tBTC",decimals:18,address:"0x97B5fE27a82b2B187D9a19C5782d9eB93B82DaC3",original:"Ethereum"}],["tBTCarbitrum",{symbol:"tBTC",decimals:18,address:"0x85727F4725A4B2834e00Db1AA8e1b843a188162F"}],["tBTCsol",{symbol:"tBTC",decimals:8,address:"0x227115F659f7c2939D23FedE68583F5291c395A6",original:"Solana"}],["SEI",{symbol:"SEI",decimals:6,address:"0x90eC817A1f7C1Eb18dD2985C534A78dD88747F47",original:"Sei"}]]],["Optimism",[["WETH",{symbol:"WETH",decimals:18,address:"0x33Db338718aC89Cd8DB13B56af05be3a3029BBE5",original:"Ethereum"}],["USDCeth",{symbol:"USDC",decimals:6,address:"0x0382F518AcE1a86224c78B7CDfa67B9774055A1b",original:"Ethereum"}],["WMATIC",{symbol:"WMATIC",decimals:18,address:"0x427B5a0b0384D7FD3AF81805A166a2d9C1116D7d",original:"Polygon"}],["WFTM",{symbol:"WFTM",decimals:18,address:"0x81BA80f5820273AA965086e710042d737993f12c",original:"Fantom"}],["WGLMR",{symbol:"WGLMR",decimals:18,address:"0x99436d62259532E0407A7aE78A3b48D119B13903",original:"Moonbeam"}],["WSOL",{symbol:"WSOL",decimals:9,address:"0x06EcAF6638070Ccf3b3dEA421b3becAA57f3e559",original:"Solana"}],["ETHoptimism",{symbol:"ETH",decimals:18,address:"native",wrappedKey:"WETHoptimism"}],["WETHoptimism",{symbol:"WETH",decimals:18,address:"0x4200000000000000000000000000000000000006"}],["USDCoptimism",{symbol:"USDC",decimals:6,address:"0xe05606174bac4A6364B31bd0eCA4bf4dD368f8C6"}],["WETHbase",{symbol:"WETH",decimals:18,address:"0x04b559971c90Dfb12D9795E95883e55f2fcf34Ed",original:"Base"}],["tBTC",{symbol:"tBTC",decimals:18,address:"0x5D89a5BcB86F15a2CCAb05e7E3bEE23fDF246a64",original:"Ethereum"}],["tBTCpolygon",{symbol:"tBTC",decimals:18,address:"0xE04e0F5f2C6ce45A40482C3AB92CA91D6741D717",original:"Polygon"}],["tBTCoptimism",{symbol:"tBTC",decimals:18,address:"0x1a53759DE2eADf73bd0b05c07a4F1F5B7912dA3d"}],["SEI",{symbol:"SEI",decimals:6,address:"0xE12be3D96fE101246bF2d290184B0eC6D35d02CA",original:"Sei"}]]],["Wormchain",[["WETH",{symbol:"WETH",decimals:8,address:"wormhole1vguuxez2h5ekltfj9gjd62fs5k4rl2zy5hfrncasykzw08rezpfs63pmq2",original:"Ethereum"}],["USDCeth",{symbol:"USDC",decimals:6,address:"wormhole1rl8su3hadqqq2v86lscpuklsh2mh84cxqvjdew4jt9yd07dzekyqkmcy3p",original:"Ethereum"}],["USDT",{symbol:"USDT",decimals:6,address:"wormhole1v2efcqkp2qtev06t0ksjnx6trxdd0f7fxg2zdrtzr8cr9wdpjkyqkv9ch6",original:"Ethereum"}],["DAI",{symbol:"DAI",decimals:8,address:"wormhole1uuwad4khwek2h05gmkktzmh8l4t0ep54yydlsqg0l4y2uh3tqfyq3an9k6",original:"Ethereum"}],["WMATIC",{symbol:"WMATIC",decimals:8,address:"wormhole1vhjnzk9ly03dugffvzfcwgry4dgc8x0sv0nqqtfxj3ajn7rn5ghq6whn2p",original:"Polygon"}],["WBNB",{symbol:"WBNB",decimals:8,address:"wormhole1335rlmhujm0gj5e9gh7at9jpqvqckz0mpe4v284ar4lw5mlkryzsnetfsj",original:"Bsc"}],["WAVAX",{symbol:"WAVAX",decimals:8,address:"wormhole1tqwwyth34550lg2437m05mjnjp8w7h5ka7m70jtzpxn4uh2ktsmq8dv649",original:"Avalanche"}],["USDCavax",{symbol:"USDC",decimals:6,address:"wormhole1qum2tr7hh4y7ruzew68c64myjec0dq2s2njf6waja5t0w879lutqv2exs9",original:"Avalanche"}],["WFTM",{symbol:"WFTM",decimals:8,address:"wormhole1808lz8dp2c39vhm9gnemt7zzj95nvrmjepxp7v3w4skzrlyzcmnsxkduxf",original:"Fantom"}],["CELO",{symbol:"CELO",decimals:8,address:"wormhole1e8z2wjelypwxw5sey62jvwjyup88w55q3h6m0x8jtwjf6sx5c7ys4mzydk",original:"Celo"}],["WGLMR",{symbol:"WGLMR",decimals:8,address:"wormhole10sfpr8ykh9xn93u8xec4ed3990nmvh86e0vaegkauqhlkxspysyqwavrxx",original:"Moonbeam"}],["WSOL",{symbol:"WSOL",decimals:8,address:"wormhole1gryz69gzl6mz2m66a4twg922jtlc47nlx73sxv88lvq86du5zvyqz3mt23",original:"Solana"}],["USDCsol",{symbol:"USDC",decimals:6,address:"wormhole1ced9v4plkf25q8c6k9gz0guq6l4xyjujpjlvxfg8lpaqywkmamashswq7p",original:"Solana"}],["SUI",{symbol:"SUI",decimals:8,address:"wormhole1yf4p93xu68j5fseupm4laj4k6f60gy7ynx6r5vvyr9c0hl3uy8vqpqd6h0",original:"Sui"}],["APT",{symbol:"APT",decimals:8,address:"wormhole1u8rft0gee23fa6a0t4t88ualrza5lj8ses4aur0l66c7efpvjezqchv34j",original:"Aptos"}],["WETHarbitrum",{symbol:"WETH",decimals:8,address:"wormhole186k0cp83c3wyvapgh8fxf66ededemzrfujvjfsx0xw3vr0u9g8sq2y30vx",original:"Arbitrum"}],["USDCarbitrum",{symbol:"USDC",decimals:6,address:"wormhole1s3pk90ccfl6ueehnj8s9pdgyjjlspmr3m5rv46arjh5v4g08dd0qrchjrk",original:"Arbitrum"}],["WETHoptimism",{symbol:"WETH",decimals:8,address:"wormhole12eu6c7f67l8gdl2lt0hz0dgdh24dhune6wjgy5t0es3tpfzhc3yspwnpfy",original:"Optimism"}],["USDCoptimism",{symbol:"USDC",decimals:6,address:"wormhole1u5z7097gm57zvun9wqsx6jxej2gpdjhg9l9xfe58rhpm29rtjmfqfnl4yv",original:"Optimism"}],["WETHbase",{symbol:"WETH",decimals:8,address:"wormhole10p89p4zh00dwdg8h52sysrqm0l2j47jj3kmg93pnz2a039ucw7esgl5vl9",original:"Base"}],["USDCbase",{symbol:"USDC",decimals:6,address:"wormhole1ja4txt6m0jjq0gmjtmv442f8wk0r5f5apaya0z55wwlrpg3p5xaq3qxw7h",original:"Base"}],["tBTCarbitrum",{symbol:"tBTC",decimals:8,address:"wormhole1rm8ztmk20lrd6ex8uqq3yu7a6eyfjwvg53pcuuj22ffe2y8r3yzqr8j4v9",original:"Arbitrum"}],["wstETH",{symbol:"wstETH",decimals:8,address:"wormhole1u2zdjcczjrenwmf57fmrpensk4the84azdm05m3unm387rm8asdsxqwfeu",original:"Ethereum"}]]],["Osmosis",[["WETH",{symbol:"WETH",decimals:8,address:"ibc/A4A8B6AE885DACD75B228031C0D18AD7EE1B914CED30C9F6F4230DDBD4A1CF2B",original:"Ethereum"}],["USDCeth",{symbol:"USDC",decimals:6,address:"ibc/3BB8C4BD1C90599B2FA5B5839DD0813EF7B94B0BD0904C4C5A61498AE81E0EE9",original:"Ethereum"}],["USDT",{symbol:"USDT",decimals:6,address:"ibc/1941ED1147121BA7DF35559597B6EB3251844DBBBE4557337D957CB95E0978C2",original:"Ethereum"}],["DAI",{symbol:"DAI",decimals:8,address:"ibc/2864B3418775DDB90EE1410EFF822FDA94E9F0FF77FC8771644761C79EDFE7A3",original:"Ethereum"}],["WMATIC",{symbol:"WMATIC",decimals:8,address:"ibc/43F15553F8598186394E81E18604B8B4532B2D7E855D9FFE68A2EF6802C18BE4",original:"Polygon"}],["WBNB",{symbol:"WBNB",decimals:8,address:"ibc/65A67BA10DE2378B32AC5A822321E370966D3D4E180DEFB4C3C5245B21088DDF",original:"Bsc"}],["WAVAX",{symbol:"WAVAX",decimals:8,address:"ibc/99EAD53D49EC7CC4E2E2EB26C22CF81C16727DF0C4BF7F7ACBF0D22D910DB5DE",original:"Avalanche"}],["USDCavax",{symbol:"USDC",decimals:6,address:"ibc/EC9FA5074F34F0644A025BB0263FDAE8F364C5E08523F6464465EF1010FF5A3A",original:"Avalanche"}],["WFTM",{symbol:"WFTM",decimals:8,address:"ibc/145C6B688F70B0C2F6D87546A5974A75CE75B3A2940275B750E65797B2996157",original:"Fantom"}],["CELO",{symbol:"CELO",decimals:8,address:"ibc/3A4EA3F8096856C0802F86B218DD74213B4C10224AA44BBD54AEAAA2ABF078BA",original:"Celo"}],["WGLMR",{symbol:"WGLMR",decimals:8,address:"ibc/7DB06BB67428510AFC3967DC90F5632C679D55D8C487A951A0EEC3160AF492A6",original:"Moonbeam"}],["WSOL",{symbol:"WSOL",decimals:8,address:"ibc/B5D53105A7AA2BEC4DA4B3304228F3856219AE7CF84A9023043C481629E3E319",original:"Solana"}],["USDCsol",{symbol:"USDC",decimals:6,address:"ibc/35A0467DE5744662078DE8B36CBBE0CF0EAA022565A3E6630CB375DDEBB96E05",original:"Solana"}],["SUI",{symbol:"SUI",decimals:8,address:"ibc/30778BA41ADF2D8A70B90DB53C2E0251731A40276EF6737215BB1A6ED9E90078",original:"Sui"}],["APT",{symbol:"APT",decimals:8,address:"ibc/7C495BD95757ED662A897C139F1C9F18275A86EE7203A0B073E2DB12B1E19D63",original:"Aptos"}],["WETHarbitrum",{symbol:"WETH",decimals:8,address:"ibc/221A4AADF7972F3BB8F48A6CA984FF0AE65B5D973FF1A695B9642AD702F51789",original:"Arbitrum"}],["USDCarbitrum",{symbol:"USDC",decimals:6,address:"ibc/06ED2700071B5A9C582F51A556537DA94E69EF547E7E6CCD8BFA3D95C818A525",original:"Arbitrum"}],["WETHoptimism",{symbol:"WETH",decimals:8,address:"ibc/80B3FECB24A4CE94537444E5BF937AC4C08A39BF90D59620D278FA185BD2B148",original:"Optimism"}],["USDCoptimism",{symbol:"USDC",decimals:6,address:"ibc/0A98A3947189D7C368170C76C3EF49486DDBE095F34B72A3C7F92AEBE1013A1D",original:"Optimism"}],["WETHbase",{symbol:"WETH",decimals:8,address:"ibc/A45069EA82C933945973E66E4222EEE4624498D4483508FE9BEBF9D519F2132F",original:"Base"}],["USDCbase",{symbol:"USDC",decimals:6,address:"ibc/2E4F8BC7F7AF33752CF7E290CAD4417EE67CD18FFC0D099E6519A440E588E0CE",original:"Base"}],["OSMO",{symbol:"OSMO",decimals:6,address:"uosmo"}],["wstETH",{symbol:"wstETH",decimals:8,address:"ibc/C66B7DB3ED665D2F5FE8ED15E88B5913A37D80601E161C5E53A743DE12C0FB85",original:"Ethereum"}]]],["Cosmoshub",[["WETH",{symbol:"WETH",decimals:8,address:"ibc/77FE9153FA76C3107CB9F6633AC33509A58529E9622327F216BA8107C79C2DE3",original:"Ethereum"}],["USDCeth",{symbol:"USDC",decimals:6,address:"ibc/D0EC31D1176BB69EA1A7CF7172CA0380B7AF488AFC6D55B101B8363C2141CD4F",original:"Ethereum"}],["USDT",{symbol:"USDT",decimals:6,address:"ibc/755FBC53FFB46FB505B5269F9BEDF47041F2A0EF2FF8D0520315403E5925C80A",original:"Ethereum"}],["DAI",{symbol:"DAI",decimals:8,address:"ibc/5F21E975410DA22AF565B1772DC45AD0BD5F6DA004981EBE291763F3D2C72A96",original:"Ethereum"}],["WMATIC",{symbol:"WMATIC",decimals:8,address:"ibc/37FB599287C6963C413E915FDE83EFA69A3CE8147675DD5A7F974B45F39C8A31",original:"Polygon"}],["WBNB",{symbol:"WBNB",decimals:8,address:"ibc/5B0D5974A56332468DD4B2D07C96A7386FCF8FE7303FF41234F90E410EF51937",original:"Bsc"}],["WAVAX",{symbol:"WAVAX",decimals:8,address:"ibc/BAEAC83736444C09656FBE666FB625974FCCDEE566EB700EBFD2642C5F6CF13A",original:"Avalanche"}],["USDCavax",{symbol:"USDC",decimals:6,address:"ibc/F09E98FA8682FF39130F171E9D89A948B0C3A452F2A31F22B6CC54A3AAE1CD4A",original:"Avalanche"}],["WFTM",{symbol:"WFTM",decimals:8,address:"ibc/919D8F138B7E71BB067C7301AB5C2D48415E8C3A2D9187861245CEC668F88E3C",original:"Fantom"}],["CELO",{symbol:"CELO",decimals:8,address:"ibc/009206915358A002C852A2A2CBEDB8446D2D02E519C815087A01F8BDB4DF77BA",original:"Celo"}],["WGLMR",{symbol:"WGLMR",decimals:8,address:"ibc/1EEDF447A6B046B20C00B1497BED5947219AEEBE0D9A85235C85133A554DF7A4",original:"Moonbeam"}],["WSOL",{symbol:"WSOL",decimals:8,address:"ibc/D3EA463A51E31B2B30BED1978575CAC145DBAB354B8A0EA5D4CFB12D737AF790",original:"Solana"}],["USDCsol",{symbol:"USDC",decimals:6,address:"ibc/26D8D6C63C8D37A5127591DDA905E04CC69CBD3A64F9DA3B1DA3FB0B6A7D9FA5",original:"Solana"}],["SUI",{symbol:"SUI",decimals:8,address:"ibc/129EC6B8A41BE07F94DD267F552F4AE1D5EAEBB51634A1468556AF06C10C2692",original:"Sui"}],["APT",{symbol:"APT",decimals:8,address:"ibc/0CCA5EB15BC2FE474E71DBC9698302CDE260B6F6548F91C30002F7CBF228197B",original:"Aptos"}],["WETHarbitrum",{symbol:"WETH",decimals:8,address:"ibc/AB4046AF5B6F146C006DE4DECAD929D24F762A701E09EC8B29000EC63A6E649B",original:"Arbitrum"}],["USDCarbitrum",{symbol:"USDC",decimals:6,address:"ibc/6D1B6A7A9EF692A279A6B5994C98C0D598D003D9203BE8309F14B6E57A58506E",original:"Arbitrum"}],["WETHoptimism",{symbol:"WETH",decimals:8,address:"ibc/A0298483510D803A045AA7F49CCBD0F9D01010FE0B1A346EBDFFF4BA820C3D21",original:"Optimism"}],["USDCoptimism",{symbol:"USDC",decimals:6,address:"ibc/CE3F2FE630DA6A1187F085CDC8D59BA8B20DA48F4866F2D71C5AB7A1D5859933",original:"Optimism"}],["WETHbase",{symbol:"WETH",decimals:8,address:"ibc/97035986A4BD0AF555713355A02EA31A4526616B6543E019E0D750007FABE06C",original:"Base"}],["USDCbase",{symbol:"USDC",decimals:6,address:"ibc/8560BA5F45C95AE716C05978E364F50C98347ACBEC745840C30F91611FA36698",original:"Base"}],["wstETH",{symbol:"wstETH",decimals:8,address:"ibc/5BB02667F9F0C8284FCF7716065C2779039817FBCB91E937F5149FE89FD8F202",original:"Ethereum"}],["ATOM",{symbol:"ATOM",decimals:6,address:"uatom"}]]],["Evmos",[["EVMOS",{symbol:"EVMOS",decimals:18,address:"atevmos"}]]],["Kujira",[["KUJI",{symbol:"KUJI",decimals:6,address:"ukuji"}]]],["Klaytn",[["KLAY",{symbol:"KLAY",decimals:18,address:"native",wrappedKey:"WKLAY"}],["WKLAY",{symbol:"WKLAY",decimals:18,address:"0x0339d5Eb6D195Ba90B13ed1BCeAa97EbD198b106"}]]],["Sepolia",[["ETHsepolia",{symbol:"ETH",decimals:18,address:"native",wrappedKey:"WETHsepolia"}],["WETHsepolia",{symbol:"WETH",decimals:18,address:"0xeef12A83EE5b7161D3873317c8E0E7B76e0B5D9c"}]]],["ArbitrumSepolia",[["ETHarbitrum_sepolia",{symbol:"ETH",decimals:18,address:"native",wrappedKey:"WETHarbitrum_sepolia"}],["WETHarbitrum_sepolia",{symbol:"WETH",decimals:18,address:"0x980B62Da83eFf3D4576C647993b0c1D7faf17c73"}]]],["BaseSepolia",[["ETHbase_sepolia",{symbol:"ETH",decimals:18,address:"native",wrappedKey:"WETHbase_sepolia"}],["WETHbase_sepolia",{symbol:"WETH",decimals:18,address:"0x4200000000000000000000000000000000000006"}]]],["OptimismSepolia",[["ETHoptimism_sepolia",{symbol:"ETH",decimals:18,address:"native",wrappedKey:"WETHoptimism_sepolia"}],["WETHoptimism_sepolia",{symbol:"WETH",decimals:18,address:"0x4200000000000000000000000000000000000006"}]]]],Sd=we(cp,[0,[1,2]]);function lo(n,e){if(n!=="Devnet"){if(n==="Mainnet"){if(!Cd.has(e))return;const t=Cd.get(e);return Object.fromEntries(t.map(([r,s])=>[r,{...s,chain:e,key:r}]))}if(n==="Testnet"){if(!Sd.has(e))return;const t=Sd.get(e);return Object.fromEntries(t.map(([r,s])=>[r,{...s,chain:e,key:r}]))}throw new Error("Unsupported network: "+n)}}function lp(n,e){const t=lo(n,e);return t?rs.native(t):void 0}function dp(n,e,t){const r=lo(n,e);return r?rs.byAddress(r,t):void 0}function up(n,e,t){const r=lo(n,e);return r?rs.byKey(r,t):void 0}function fp(n,e){const t={coreBridge:i1.get(n,e),tokenBridge:o1.get(n,e),nftBridge:c1.get(n,e),relayer:l1.get(n,e),tokenBridgeRelayer:a1.get(n,e),tbtc:Ci.get(n,e)};return Ha.has(n,e)&&(t.cctp=Ha.get(n,e)),id.has(n,e)&&(t.gateway=id.get(n,e)),od.has(n,e)&&(t.translator=od.get(n,e)),ad.has(n,e)&&(t.portico=ad.get(n,e)),Ci.has(n,e)&&(t.tbtc=Ci.get(n,e)),t}function Ot(n){return typeof n=="string"&&n==="native"}function Tf(n){return{chain:n,address:"native"}}function uo(n){return typeof n=="object"&&n.address!==void 0&&n.chain!==void 0&&ro(n.chain)}function If(n,e){return n.chain!==e.chain?!1:Ot(n.address)&&Ot(e.address)?!0:Dn(n)===Dn(e)}function Dn(n){return uo(n)&&Ot(n.address)?n.address:n.address.toNative(n.chain).toString()}function hp(n){if(Ot(n.address))throw new Error("Invalid address, cannot convert the string literal `native` to a Universal Address");return n.address.toUniversalAddress().toString()}function Uf(n,e,t){let r;if(uo(t)){if(!Ot(t.address))return[!1,t];r=t.address}else r=t;if(Ot(r)){const i=lp(n,e);if(!i)throw new Error("Invalid destination token");const o=i.wrappedKey,a=up(n,e,o);if(!a)throw new Error("Invalid wrapped token key: "+o);return[!0,{chain:e,address:tr(e,a.address)}]}return[!1,{chain:e,address:r}]}function _f(n){return n.chain!==void 0&&n.txid!==void 0}function da(n){return Ru.map(t=>{const r=ns(t);let s="";try{s=qu.get(n,t)}catch{}const i=lo(n,t),o=i?Object.values(i).find(l=>Ot(l.address)&&l.wrappedKey):void 0,a=o?i[o.wrappedKey]:void 0;return{key:t,platform:r,network:n,chainId:Gs(t),finalityThreshold:Lu.get(t)??0,blockTime:Ou.get(t)??0,contracts:fp(n,t),nativeTokenDecimals:Nu(r),nativeChainId:s,tokenMap:i,wrappedNative:a,explorer:jm(n,t),rpc:zu(n,t)}}).reduce((t,r)=>({...t,[r.key]:r}),{})}function mp(n){return Mf(n)||Vc(n)}function Mf(n){return typeof n=="object"&&"chain"in n&&typeof n.chain=="function"&&"address"in n&&typeof n.address=="function"&&"sign"in n&&typeof n.sign=="function"}function Vc(n){return typeof n=="object"&&"chain"in n&&typeof n.chain=="function"&&"address"in n&&typeof n.address=="function"&&"signAndSend"in n&&typeof n.signAndSend=="function"}class bp{constructor(e,t,r){re(this,"_chain");re(this,"_address");re(this,"_signer");this._chain=e,this._address=t,this._signer=r}unwrap(){return this._signer}}function br(n){return n.sequence!==void 0&&n.emitter!==void 0&&n.chain!==void 0}function Li(n){return n.hash!==void 0}const Dd=n=>[rr(1),{name:"token",binary:"bytes",layout:[{name:"address",...xe},{name:"amount",...Mt}]},{name:"sourceDomain",...Ms},{name:"targetDomain",...Ms},{name:"nonce",...Hc},{name:"caller",...xe},{name:"mintRecipient",...xe},Ji({name:"payload",lengthSize:2},n)],pp=[rr(1),{name:"targetRelayerFee",...Mt},{name:"toNativeTokenAmount",...Mt},{name:"targetRecipient",...xe}],gp=[["DepositWithPayload",Dd()],["TransferWithRelay",Dd(pp)]];xt("AutomaticCircleBridge",gp);const Rf={binary:"uint",size:4,custom:0,omit:!0},yp=[{name:"messageBodyVersion",...Rf},{name:"burnToken",...xe},{name:"mintRecipient",...xe},{name:"amount",...Mt},{name:"messageSender",...xe}],ec=[{name:"version",...Rf},{name:"sourceDomain",...Ms},{name:"destinationDomain",...Ms},{name:"nonce",...Hc},{name:"sender",...xe},{name:"recipient",...xe},{name:"destinationCaller",...xe},{name:"payload",binary:"bytes",layout:yp}],wp=[["Message",ec]];xt("CircleBridge",wp);exports.CircleBridge=void 0;(function(n){n.isCircleAttestation=e=>e.message!==void 0,n.deserialize=e=>{const t=Sn(ec,e),r=_t.encode(Is(e),!0);return[t,r]},n.serialize=e=>Cn(ec,e)})(exports.CircleBridge||(exports.CircleBridge={}));var vd;(function(n){const e="AutomaticCircleBridge",t=["DepositWithPayload","TransferWithRelay"];n.getTransferDiscriminator=xc(()=>$c([e,t]))})(vd||(vd={}));function Ap(n){return n.amount!==void 0&&n.from!==void 0&&n.to!==void 0}const kd={binary:"bytes",size:32,custom:{to:n=>Ii(n.byteLength).map(e=>String.fromCharCode(n[e])).join(""),from:n=>new Uint8Array(n.split("").map(e=>e.charCodeAt(0)))}},Wf=[{name:"token",binary:"bytes",layout:[{name:"amount",...Mt},{name:"address",...xe},{name:"chain",...qt()}]},{name:"to",binary:"bytes",layout:[{name:"address",...xe},{name:"chain",...qt()}]}],Pf=[rr(1),...Wf,{name:"fee",...Mt}],fo=n=>[rr(3),...Wf,{name:"from",...xe},Ji({name:"payload"},n)],Ep=[["AttestMeta",[rr(2),{name:"token",binary:"bytes",layout:[{name:"address",...xe},{name:"chain",...qt()}]},{name:"decimals",binary:"uint",size:1},{name:"symbol",...kd},{name:"name",...kd}]],["Transfer",Pf],["TransferWithPayload",fo()]];xt("TokenBridge",Ep);const Bp=Dm(["shouldWrapNative","shouldUnwrapNative"]),tc=[{name:"recipientChain",binary:"uint",endianness:"little",size:2},{name:"bridgeNonce",binary:"uint",endianness:"little",size:4},{name:"feeTierStart",binary:"uint",endianness:"little",size:3},{name:"feeTierFinish",binary:"uint",endianness:"little",size:3},{name:"padding",binary:"bytes",size:19},{name:"flags",...Bp}],nc=[{name:"flagSet",binary:"bytes",layout:tc},{name:"finalTokenAddress",...xe},{name:"recipientAddress",...xe},{name:"cannonAssetAmount",...Mt},{name:"minAmountFinish",...Mt},{name:"relayerFee",...Mt}],xp=[["Transfer",fo(nc)]];xt("PorticoBridge",xp);exports.PorticoBridge=void 0;(function(n){n.deserializePayload=e=>Sn(nc,e),n.serializePayload=e=>Cn(nc,e),n.deserializeFlagSet=e=>Sn(tc,e),n.serializeFlagSet=e=>Cn(tc,e)})(exports.PorticoBridge||(exports.PorticoBridge={}));const Lf={binary:"bytes",layout:[{name:"size",binary:"uint",size:4,custom:3*32,omit:!0},{name:"waste",binary:"uint",size:31,custom:0n,omit:!0},{name:"version",binary:"uint",size:1,custom:0,omit:!0},{name:"gasLimit",...Mt},{name:"targetChainRefundPerGasUnused",...Mt}]},Fd={binary:"bytes",layout:[{name:"chain",...qt()},{name:"address",...xe}]},Cp=[{name:"chain",...qt()},{name:"emitterAddress",...xe},{name:"sequence",...qc}],Sp=[{name:"size",binary:"uint",size:4,custom:12,omit:!0},{name:"domain",...Ms},{name:"nonce",...Hc}],Of={binary:"switch",idSize:1,idTag:"keyType",layouts:[[[1,"VAA"],Cp],[[2,"CCTP"],Sp]]},Nf=n=>[rr(1),{name:"target",...Fd},Ji({name:"payload",lengthSize:4},n),{name:"requestedReceiverValue",...Mt},{name:"extraReceiverValue",...Mt},{name:"executionInfo",...Lf},{name:"refund",...Fd},{name:"refundDeliveryProvider",...xe},{name:"sourceDeliveryProvider",...xe},{name:"senderAddress",...xe},{name:"messageKeys",binary:"array",lengthSize:1,layout:Of}],Dp=[["DeliveryInstruction",Nf()],["RedeliveryInstruction",[rr(2),{name:"deliveryVaaKey",binary:"bytes",layout:Of},{name:"targetChain",...qt()},{name:"newRequestedReceiverValue",...Mt},{name:"newEncodedExecutionInfo",...Lf},{name:"newSourceDeliveryProvider",...xe},{name:"newSenderAddress",...xe}]]];xt("Relayer",Dp);const vp=[rr(1),{name:"targetRelayerFee",...Mt},{name:"toNativeTokenAmount",...Mt},{name:"targetRecipient",...xe}],kp=[["TransferWithRelay",fo(vp)]];xt("AutomaticTokenBridge",kp);const Fp=n=>new Error(`Token ${n} is not a wrapped asset`);var rc;(function(n){const e="TokenBridge",t=["Transfer","TransferWithPayload"],r=["AttestMeta"];[...t,...r],n.getTransferDiscriminator=xc(()=>$c([e,t]))})(rc||(rc={}));function Tp(n){return n.token!==void 0&&n.amount!==void 0&&n.from!==void 0&&n.to!==void 0}const Ip=[["Add",1],["Subtract",2],["Unknown",3]],sc={binary:"bytes",size:20,custom:{to:n=>_t.encode(n,!0),from:n=>_t.decode(n)}},Up=[["UpgradeContract",[!1,[{name:"newContract",...xe}]]],["RegisterChain",[!0,[{name:"foreignChain",...qt()},{name:"foreignAddress",...xe}]]],["RecoverChainId",[!1,[{name:"evmChainId",binary:"uint",size:32},{name:"newChainId",...qt({allowedChains:Wu("Evm")})}]]],["GuardianSetUpgrade",[!0,[{name:"guardianSet",...Df},{name:"guardians",binary:"array",lengthSize:1,layout:sc}]]],["SetMessageFee",[!1,[{name:"messageFee",binary:"uint",size:32}]]],["TransferFees",[!0,[{name:"amount",binary:"uint",size:32},{name:"recipient",...xe}]]],["UpdateDefaultProvider",[!1,[{name:"defaultProvider",...xe}]]],["RegisterEmitterAndDomain",[!0,[{name:"emitterChain",...qt()},{name:"emitterAddress",...xe},{name:"domain",binary:"uint",size:4}]]],["UpdateFinality",[!1,[{name:"finality",binary:"uint",size:1}]]]],ua={binary:"bytes",size:32},Td=[{name:"contractAddr",...xe},{name:"codeId",binary:"uint",size:8}],_p=[["StoreCode",[!1,[{name:"wasmHash",...ua}]]],["InstantiateContract",[!1,[{name:"instantiationParamsHash",...ua}]]],["MigrateContract",[!1,[{name:"migrationParamsHash",...ua}]]],["AddWasmInstantiateAllowlist",[!1,Td]],["DeleteWasmInstantiateAllowlist",[!1,Td]]],Mp=(()=>{const n=s=>({binary:"bytes",size:s,custom:rp}),e=[{name:"height",binary:"uint",size:8}],t=Du(e),r=s=>[{name:"name",...n(s)},...e];return{binary:"bytes",custom:{to:s=>Sn(r(s.length-t),s),from:s=>Cn(r(s.name.length),s)}}})(),Rp=[["ScheduleUpgrade",[!1,Mp]],["CancelUpgrade",[!0,[]]],["SetIbcComposabilityMwContract",[!1,[{name:"contractAddress",...xe}]]]],Wp=[["ModifyBalance",[!1,[{name:"sequence",...qc},{name:"modifiedChain",...qt()},{name:"tokenChain",...qt()},{name:"tokenAddress",...xe},{name:"kind",...Sm(Ip)},{name:"amount",...Mt},{name:"reason",...vf(32)}]]]],Pp=[["ActionUpdateChannelChain",[!1,[{name:"channelId",...vf(64)},{name:"channelChain",...qt({allowedChains:Wu("Cosmwasm")})}]]]],Lp=[["GeneralPurposeEvm",[!1,[{name:"governanceContract",...sc},{name:"targetContract",...sc},{name:"payload",binary:"bytes",lengthSize:2}]]],["GeneralPurposeSolana",[!1,[{name:"governanceContract",...xe},{name:"payload",binary:"bytes"}]]]],zf=[...Up,..._p,...Rp,...Wp,...Pp,...Lp];Bu(zf,0);const Id=Object.fromEntries(zf),Op=[["WormholeCore","Core"],["TokenBridge","TokenBridge"],["NftBridge","NftBridge"],["Relayer","WormholeRelayer"],["CircleBridge","CircleIntegration"],["IbcBridge","IbcTranslator"],["IbcReceiver","IbcReceiver"],["GlobalAccountant","GlobalAccountant"],["GeneralPurposeGovernance","GeneralPurposeGovernance"],["WormchainGovernance","WasmdModule"],["GatewayGovernance","GatewayModule"]],Np=we(Op),zp=n=>({to:n,from:(()=>{const t=new Uint8Array(32),r=Np(n);for(let s=1;s<=r.length;++s)t[32-s]=r.charCodeAt(r.length-s);return t})()}),Hp=(n,e)=>({to:n,from:e}),qp=(n,e,t)=>[{name:"protocol",binary:"bytes",custom:zp(n)},{name:"action",binary:"uint",size:1,custom:Hp(e,t)},{name:"chain",...qt({allowNull:Id[e][0]})},{name:"actionArgs",binary:"bytes",layout:Id[e][1]}],_e=(n,e,t)=>[e,qp(n,e,t)],Kp=[_e("WormholeCore","UpgradeContract",1),_e("WormholeCore","GuardianSetUpgrade",2),_e("WormholeCore","SetMessageFee",3),_e("WormholeCore","TransferFees",4),_e("WormholeCore","RecoverChainId",5)],jp=[_e("TokenBridge","RegisterChain",1),_e("TokenBridge","UpgradeContract",2),_e("TokenBridge","RecoverChainId",3)],$p=[_e("NftBridge","RegisterChain",1),_e("NftBridge","UpgradeContract",2),_e("NftBridge","RecoverChainId",3)],Vp=[_e("Relayer","RegisterChain",1),_e("Relayer","UpgradeContract",2),_e("Relayer","UpdateDefaultProvider",3)],Gp=[_e("CircleBridge","UpdateFinality",1),_e("CircleBridge","RegisterEmitterAndDomain",2),_e("CircleBridge","UpgradeContract",3)],Yp=[_e("IbcBridge","ActionUpdateChannelChain",1)],Xp=[_e("IbcReceiver","ActionUpdateChannelChain",1)],Zp=[_e("GlobalAccountant","ModifyBalance",1)],Jp=[_e("GeneralPurposeGovernance","GeneralPurposeEvm",1),_e("GeneralPurposeGovernance","GeneralPurposeSolana",2)],Qp=[_e("WormchainGovernance","StoreCode",1),_e("WormchainGovernance","InstantiateContract",2),_e("WormchainGovernance","MigrateContract",3),_e("WormchainGovernance","AddWasmInstantiateAllowlist",4),_e("WormchainGovernance","DeleteWasmInstantiateAllowlist",5)],eg=[_e("GatewayGovernance","ScheduleUpgrade",1),_e("GatewayGovernance","CancelUpgrade",2),_e("GatewayGovernance","SetIbcComposabilityMwContract",3)];xt("WormholeCore",Kp);xt("TokenBridge",jp);xt("NftBridge",$p);xt("Relayer",Vp);xt("CircleBridge",Gp);xt("IbcBridge",Yp);xt("IbcReceiver",Xp);xt("GlobalAccountant",Zp);xt("GeneralPurposeGovernance",Jp);xt("WormchainGovernance",Qp);xt("GatewayGovernance",eg);exports.TBTCBridge=void 0;(function(n){const e="TBTCBridge",t=["GatewayTransfer","Transfer"];[...t],n.getTransferDiscriminator=xc(()=>$c([e,t])),n.getNativeTbtcToken=r=>{const s=b1.get("Mainnet",r);if(s)return{chain:r,address:tr(r,s)}}})(exports.TBTCBridge||(exports.TBTCBridge={}));const tg=[{name:"recipient",...xe}],ng=[["GatewayTransfer",fo(tg)],["Transfer",Pf]];xt("TBTCBridge",ng);function Hf(n,e){return function(){return n.apply(e,arguments)}}const{toString:rg}=Object.prototype,{getPrototypeOf:Gc}=Object,ho=(n=>e=>{const t=rg.call(e);return n[t]||(n[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),Fn=n=>(n=n.toLowerCase(),e=>ho(e)===n),mo=n=>e=>typeof e===n,{isArray:os}=Array,Ps=mo("undefined");function sg(n){return n!==null&&!Ps(n)&&n.constructor!==null&&!Ps(n.constructor)&&nn(n.constructor.isBuffer)&&n.constructor.isBuffer(n)}const qf=Fn("ArrayBuffer");function ig(n){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(n):e=n&&n.buffer&&qf(n.buffer),e}const og=mo("string"),nn=mo("function"),Kf=mo("number"),bo=n=>n!==null&&typeof n=="object",ag=n=>n===!0||n===!1,Di=n=>{if(ho(n)!=="object")return!1;const e=Gc(n);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)},cg=Fn("Date"),lg=Fn("File"),dg=Fn("Blob"),ug=Fn("FileList"),fg=n=>bo(n)&&nn(n.pipe),hg=n=>{let e;return n&&(typeof FormData=="function"&&n instanceof FormData||nn(n.append)&&((e=ho(n))==="formdata"||e==="object"&&nn(n.toString)&&n.toString()==="[object FormData]"))},mg=Fn("URLSearchParams"),bg=n=>n.trim?n.trim():n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Zs(n,e,{allOwnKeys:t=!1}={}){if(n===null||typeof n>"u")return;let r,s;if(typeof n!="object"&&(n=[n]),os(n))for(r=0,s=n.length;r<s;r++)e.call(null,n[r],r,n);else{const i=t?Object.getOwnPropertyNames(n):Object.keys(n),o=i.length;let a;for(r=0;r<o;r++)a=i[r],e.call(null,n[a],a,n)}}function jf(n,e){e=e.toLowerCase();const t=Object.keys(n);let r=t.length,s;for(;r-- >0;)if(s=t[r],e===s.toLowerCase())return s;return null}const $f=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:Ve.global,Vf=n=>!Ps(n)&&n!==$f;function ic(){const{caseless:n}=Vf(this)&&this||{},e={},t=(r,s)=>{const i=n&&jf(e,s)||s;Di(e[i])&&Di(r)?e[i]=ic(e[i],r):Di(r)?e[i]=ic({},r):os(r)?e[i]=r.slice():e[i]=r};for(let r=0,s=arguments.length;r<s;r++)arguments[r]&&Zs(arguments[r],t);return e}const pg=(n,e,t,{allOwnKeys:r}={})=>(Zs(e,(s,i)=>{t&&nn(s)?n[i]=Hf(s,t):n[i]=s},{allOwnKeys:r}),n),gg=n=>(n.charCodeAt(0)===65279&&(n=n.slice(1)),n),yg=(n,e,t,r)=>{n.prototype=Object.create(e.prototype,r),n.prototype.constructor=n,Object.defineProperty(n,"super",{value:e.prototype}),t&&Object.assign(n.prototype,t)},wg=(n,e,t,r)=>{let s,i,o;const a={};if(e=e||{},n==null)return e;do{for(s=Object.getOwnPropertyNames(n),i=s.length;i-- >0;)o=s[i],(!r||r(o,n,e))&&!a[o]&&(e[o]=n[o],a[o]=!0);n=t!==!1&&Gc(n)}while(n&&(!t||t(n,e))&&n!==Object.prototype);return e},Ag=(n,e,t)=>{n=String(n),(t===void 0||t>n.length)&&(t=n.length),t-=e.length;const r=n.indexOf(e,t);return r!==-1&&r===t},Eg=n=>{if(!n)return null;if(os(n))return n;let e=n.length;if(!Kf(e))return null;const t=new Array(e);for(;e-- >0;)t[e]=n[e];return t},Bg=(n=>e=>n&&e instanceof n)(typeof Uint8Array<"u"&&Gc(Uint8Array)),xg=(n,e)=>{const r=(n&&n[Symbol.iterator]).call(n);let s;for(;(s=r.next())&&!s.done;){const i=s.value;e.call(n,i[0],i[1])}},Cg=(n,e)=>{let t;const r=[];for(;(t=n.exec(e))!==null;)r.push(t);return r},Sg=Fn("HTMLFormElement"),Dg=n=>n.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,r,s){return r.toUpperCase()+s}),Ud=(({hasOwnProperty:n})=>(e,t)=>n.call(e,t))(Object.prototype),vg=Fn("RegExp"),Gf=(n,e)=>{const t=Object.getOwnPropertyDescriptors(n),r={};Zs(t,(s,i)=>{e(s,i,n)!==!1&&(r[i]=s)}),Object.defineProperties(n,r)},kg=n=>{Gf(n,(e,t)=>{if(nn(n)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;const r=n[t];if(nn(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")})}})},Fg=(n,e)=>{const t={},r=s=>{s.forEach(i=>{t[i]=!0})};return os(n)?r(n):r(String(n).split(e)),t},Tg=()=>{},Ig=(n,e)=>(n=+n,Number.isFinite(n)?n:e),fa="abcdefghijklmnopqrstuvwxyz",_d="0123456789",Yf={DIGIT:_d,ALPHA:fa,ALPHA_DIGIT:fa+fa.toUpperCase()+_d},Ug=(n=16,e=Yf.ALPHA_DIGIT)=>{let t="";const{length:r}=e;for(;n--;)t+=e[Math.random()*r|0];return t};function _g(n){return!!(n&&nn(n.append)&&n[Symbol.toStringTag]==="FormData"&&n[Symbol.iterator])}const Mg=n=>{const e=new Array(10),t=(r,s)=>{if(bo(r)){if(e.indexOf(r)>=0)return;if(!("toJSON"in r)){e[s]=r;const i=os(r)?[]:{};return Zs(r,(o,a)=>{const l=t(o,s+1);!Ps(l)&&(i[a]=l)}),e[s]=void 0,i}}return r};return t(n,0)},Rg=Fn("AsyncFunction"),Wg=n=>n&&(bo(n)||nn(n))&&nn(n.then)&&nn(n.catch),q={isArray:os,isArrayBuffer:qf,isBuffer:sg,isFormData:hg,isArrayBufferView:ig,isString:og,isNumber:Kf,isBoolean:ag,isObject:bo,isPlainObject:Di,isUndefined:Ps,isDate:cg,isFile:lg,isBlob:dg,isRegExp:vg,isFunction:nn,isStream:fg,isURLSearchParams:mg,isTypedArray:Bg,isFileList:ug,forEach:Zs,merge:ic,extend:pg,trim:bg,stripBOM:gg,inherits:yg,toFlatObject:wg,kindOf:ho,kindOfTest:Fn,endsWith:Ag,toArray:Eg,forEachEntry:xg,matchAll:Cg,isHTMLForm:Sg,hasOwnProperty:Ud,hasOwnProp:Ud,reduceDescriptors:Gf,freezeMethods:kg,toObjectSet:Fg,toCamelCase:Dg,noop:Tg,toFiniteNumber:Ig,findKey:jf,global:$f,isContextDefined:Vf,ALPHABET:Yf,generateString:Ug,isSpecCompliantForm:_g,toJSONObject:Mg,isAsyncFn:Rg,isThenable:Wg};function De(n,e,t,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=n,this.name="AxiosError",e&&(this.code=e),t&&(this.config=t),r&&(this.request=r),s&&(this.response=s)}q.inherits(De,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:q.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Xf=De.prototype,Zf={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(n=>{Zf[n]={value:n}});Object.defineProperties(De,Zf);Object.defineProperty(Xf,"isAxiosError",{value:!0});De.from=(n,e,t,r,s,i)=>{const o=Object.create(Xf);return q.toFlatObject(n,o,function(l){return l!==Error.prototype},a=>a!=="isAxiosError"),De.call(o,n.message,e,t,r,s),o.cause=n,o.name=n.name,i&&Object.assign(o,i),o};const Pg=null;function oc(n){return q.isPlainObject(n)||q.isArray(n)}function Jf(n){return q.endsWith(n,"[]")?n.slice(0,-2):n}function Md(n,e,t){return n?n.concat(e).map(function(s,i){return s=Jf(s),!t&&i?"["+s+"]":s}).join(t?".":""):e}function Lg(n){return q.isArray(n)&&!n.some(oc)}const Og=q.toFlatObject(q,{},null,function(e){return/^is[A-Z]/.test(e)});function po(n,e,t){if(!q.isObject(n))throw new TypeError("target must be an object");e=e||new FormData,t=q.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,function(D,x){return!q.isUndefined(x[D])});const r=t.metaTokens,s=t.visitor||m,i=t.dots,o=t.indexes,l=(t.Blob||typeof Blob<"u"&&Blob)&&q.isSpecCompliantForm(e);if(!q.isFunction(s))throw new TypeError("visitor must be a function");function h(g){if(g===null)return"";if(q.isDate(g))return g.toISOString();if(!l&&q.isBlob(g))throw new De("Blob is not supported. Use a Buffer instead.");return q.isArrayBuffer(g)||q.isTypedArray(g)?l&&typeof Blob=="function"?new Blob([g]):Ve.Buffer.from(g):g}function m(g,D,x){let U=g;if(g&&!x&&typeof g=="object"){if(q.endsWith(D,"{}"))D=r?D:D.slice(0,-2),g=JSON.stringify(g);else if(q.isArray(g)&&Lg(g)||(q.isFileList(g)||q.endsWith(D,"[]"))&&(U=q.toArray(g)))return D=Jf(D),U.forEach(function(F,W){!(q.isUndefined(F)||F===null)&&e.append(o===!0?Md([D],W,i):o===null?D:D+"[]",h(F))}),!1}return oc(g)?!0:(e.append(Md(x,D,i),h(g)),!1)}const E=[],S=Object.assign(Og,{defaultVisitor:m,convertValue:h,isVisitable:oc});function A(g,D){if(!q.isUndefined(g)){if(E.indexOf(g)!==-1)throw Error("Circular reference detected in "+D.join("."));E.push(g),q.forEach(g,function(U,R){(!(q.isUndefined(U)||U===null)&&s.call(e,U,q.isString(R)?R.trim():R,D,S))===!0&&A(U,D?D.concat(R):[R])}),E.pop()}}if(!q.isObject(n))throw new TypeError("data must be an object");return A(n),e}function Rd(n){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(n).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function Yc(n,e){this._pairs=[],n&&po(n,this,e)}const Qf=Yc.prototype;Qf.append=function(e,t){this._pairs.push([e,t])};Qf.toString=function(e){const t=e?function(r){return e.call(this,r,Rd)}:Rd;return this._pairs.map(function(s){return t(s[0])+"="+t(s[1])},"").join("&")};function Ng(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function e0(n,e,t){if(!e)return n;const r=t&&t.encode||Ng,s=t&&t.serialize;let i;if(s?i=s(e,t):i=q.isURLSearchParams(e)?e.toString():new Yc(e,t).toString(r),i){const o=n.indexOf("#");o!==-1&&(n=n.slice(0,o)),n+=(n.indexOf("?")===-1?"?":"&")+i}return n}class Wd{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){q.forEach(this.handlers,function(r){r!==null&&e(r)})}}const t0={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},zg=typeof URLSearchParams<"u"?URLSearchParams:Yc,Hg=typeof FormData<"u"?FormData:null,qg=typeof Blob<"u"?Blob:null,Kg=(()=>{let n;return typeof navigator<"u"&&((n=navigator.product)==="ReactNative"||n==="NativeScript"||n==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),jg=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Bn={classes:{URLSearchParams:zg,FormData:Hg,Blob:qg},isStandardBrowserEnv:Kg,isStandardBrowserWebWorkerEnv:jg,protocols:["http","https","file","blob","url","data"]};function $g(n,e){return po(n,new Bn.classes.URLSearchParams,Object.assign({visitor:function(t,r,s,i){return Bn.isNode&&q.isBuffer(t)?(this.append(r,t.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},e))}function Vg(n){return q.matchAll(/\w+|\[(\w*)]/g,n).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Gg(n){const e={},t=Object.keys(n);let r;const s=t.length;let i;for(r=0;r<s;r++)i=t[r],e[i]=n[i];return e}function n0(n){function e(t,r,s,i){let o=t[i++];const a=Number.isFinite(+o),l=i>=t.length;return o=!o&&q.isArray(s)?s.length:o,l?(q.hasOwnProp(s,o)?s[o]=[s[o],r]:s[o]=r,!a):((!s[o]||!q.isObject(s[o]))&&(s[o]=[]),e(t,r,s[o],i)&&q.isArray(s[o])&&(s[o]=Gg(s[o])),!a)}if(q.isFormData(n)&&q.isFunction(n.entries)){const t={};return q.forEachEntry(n,(r,s)=>{e(Vg(r),s,t,0)}),t}return null}const Yg={"Content-Type":void 0};function Xg(n,e,t){if(q.isString(n))try{return(e||JSON.parse)(n),q.trim(n)}catch(r){if(r.name!=="SyntaxError")throw r}return(t||JSON.stringify)(n)}const as={transitional:t0,adapter:["xhr","http"],transformRequest:[function(e,t){const r=t.getContentType()||"",s=r.indexOf("application/json")>-1,i=q.isObject(e);if(i&&q.isHTMLForm(e)&&(e=new FormData(e)),q.isFormData(e))return s&&s?JSON.stringify(n0(e)):e;if(q.isArrayBuffer(e)||q.isBuffer(e)||q.isStream(e)||q.isFile(e)||q.isBlob(e))return e;if(q.isArrayBufferView(e))return e.buffer;if(q.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return $g(e,this.formSerializer).toString();if((a=q.isFileList(e))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return po(a?{"files[]":e}:e,l&&new l,this.formSerializer)}}return i||s?(t.setContentType("application/json",!1),Xg(e)):e}],transformResponse:[function(e){const t=this.transitional||as.transitional,r=t&&t.forcedJSONParsing,s=this.responseType==="json";if(e&&q.isString(e)&&(r&&!this.responseType||s)){const o=!(t&&t.silentJSONParsing)&&s;try{return JSON.parse(e)}catch(a){if(o)throw a.name==="SyntaxError"?De.from(a,De.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Bn.classes.FormData,Blob:Bn.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};q.forEach(["delete","get","head"],function(e){as.headers[e]={}});q.forEach(["post","put","patch"],function(e){as.headers[e]=q.merge(Yg)});const Zg=q.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Jg=n=>{const e={};let t,r,s;return n&&n.split(`
7
- `).forEach(function(o){s=o.indexOf(":"),t=o.substring(0,s).trim().toLowerCase(),r=o.substring(s+1).trim(),!(!t||e[t]&&Zg[t])&&(t==="set-cookie"?e[t]?e[t].push(r):e[t]=[r]:e[t]=e[t]?e[t]+", "+r:r)}),e},Pd=Symbol("internals");function gs(n){return n&&String(n).trim().toLowerCase()}function vi(n){return n===!1||n==null?n:q.isArray(n)?n.map(vi):String(n)}function Qg(n){const e=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=t.exec(n);)e[r[1]]=r[2];return e}const ey=n=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim());function ha(n,e,t,r,s){if(q.isFunction(r))return r.call(this,e,t);if(s&&(e=t),!!q.isString(e)){if(q.isString(r))return e.indexOf(r)!==-1;if(q.isRegExp(r))return r.test(e)}}function ty(n){return n.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,r)=>t.toUpperCase()+r)}function ny(n,e){const t=q.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(n,r+t,{value:function(s,i,o){return this[r].call(this,e,s,i,o)},configurable:!0})})}let rn=class{constructor(e){e&&this.set(e)}set(e,t,r){const s=this;function i(a,l,h){const m=gs(l);if(!m)throw new Error("header name must be a non-empty string");const E=q.findKey(s,m);(!E||s[E]===void 0||h===!0||h===void 0&&s[E]!==!1)&&(s[E||l]=vi(a))}const o=(a,l)=>q.forEach(a,(h,m)=>i(h,m,l));return q.isPlainObject(e)||e instanceof this.constructor?o(e,t):q.isString(e)&&(e=e.trim())&&!ey(e)?o(Jg(e),t):e!=null&&i(t,e,r),this}get(e,t){if(e=gs(e),e){const r=q.findKey(this,e);if(r){const s=this[r];if(!t)return s;if(t===!0)return Qg(s);if(q.isFunction(t))return t.call(this,s,r);if(q.isRegExp(t))return t.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=gs(e),e){const r=q.findKey(this,e);return!!(r&&this[r]!==void 0&&(!t||ha(this,this[r],r,t)))}return!1}delete(e,t){const r=this;let s=!1;function i(o){if(o=gs(o),o){const a=q.findKey(r,o);a&&(!t||ha(r,r[a],a,t))&&(delete r[a],s=!0)}}return q.isArray(e)?e.forEach(i):i(e),s}clear(e){const t=Object.keys(this);let r=t.length,s=!1;for(;r--;){const i=t[r];(!e||ha(this,this[i],i,e,!0))&&(delete this[i],s=!0)}return s}normalize(e){const t=this,r={};return q.forEach(this,(s,i)=>{const o=q.findKey(r,i);if(o){t[o]=vi(s),delete t[i];return}const a=e?ty(i):String(i).trim();a!==i&&delete t[i],t[a]=vi(s),r[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return q.forEach(this,(r,s)=>{r!=null&&r!==!1&&(t[s]=e&&q.isArray(r)?r.join(", "):r)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join(`
8
- `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const r=new this(e);return t.forEach(s=>r.set(s)),r}static accessor(e){const r=(this[Pd]=this[Pd]={accessors:{}}).accessors,s=this.prototype;function i(o){const a=gs(o);r[a]||(ny(s,o),r[a]=!0)}return q.isArray(e)?e.forEach(i):i(e),this}};rn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);q.freezeMethods(rn.prototype);q.freezeMethods(rn);function ma(n,e){const t=this||as,r=e||t,s=rn.from(r.headers);let i=r.data;return q.forEach(n,function(a){i=a.call(t,i,s.normalize(),e?e.status:void 0)}),s.normalize(),i}function r0(n){return!!(n&&n.__CANCEL__)}function Js(n,e,t){De.call(this,n??"canceled",De.ERR_CANCELED,e,t),this.name="CanceledError"}q.inherits(Js,De,{__CANCEL__:!0});function ry(n,e,t){const r=t.config.validateStatus;!t.status||!r||r(t.status)?n(t):e(new De("Request failed with status code "+t.status,[De.ERR_BAD_REQUEST,De.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}const sy=Bn.isStandardBrowserEnv?function(){return{write:function(t,r,s,i,o,a){const l=[];l.push(t+"="+encodeURIComponent(r)),q.isNumber(s)&&l.push("expires="+new Date(s).toGMTString()),q.isString(i)&&l.push("path="+i),q.isString(o)&&l.push("domain="+o),a===!0&&l.push("secure"),document.cookie=l.join("; ")},read:function(t){const r=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return r?decodeURIComponent(r[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function iy(n){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)}function oy(n,e){return e?n.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):n}function s0(n,e){return n&&!iy(e)?oy(n,e):e}const ay=Bn.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let r;function s(i){let o=i;return e&&(t.setAttribute("href",o),o=t.href),t.setAttribute("href",o),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:t.pathname.charAt(0)==="/"?t.pathname:"/"+t.pathname}}return r=s(window.location.href),function(o){const a=q.isString(o)?s(o):o;return a.protocol===r.protocol&&a.host===r.host}}():function(){return function(){return!0}}();function cy(n){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(n);return e&&e[1]||""}function ly(n,e){n=n||10;const t=new Array(n),r=new Array(n);let s=0,i=0,o;return e=e!==void 0?e:1e3,function(l){const h=Date.now(),m=r[i];o||(o=h),t[s]=l,r[s]=h;let E=i,S=0;for(;E!==s;)S+=t[E++],E=E%n;if(s=(s+1)%n,s===i&&(i=(i+1)%n),h-o<e)return;const A=m&&h-m;return A?Math.round(S*1e3/A):void 0}}function Ld(n,e){let t=0;const r=ly(50,250);return s=>{const i=s.loaded,o=s.lengthComputable?s.total:void 0,a=i-t,l=r(a),h=i<=o;t=i;const m={loaded:i,total:o,progress:o?i/o:void 0,bytes:a,rate:l||void 0,estimated:l&&o&&h?(o-i)/l:void 0,event:s};m[e?"download":"upload"]=!0,n(m)}}const dy=typeof XMLHttpRequest<"u",uy=dy&&function(n){return new Promise(function(t,r){let s=n.data;const i=rn.from(n.headers).normalize(),o=n.responseType;let a;function l(){n.cancelToken&&n.cancelToken.unsubscribe(a),n.signal&&n.signal.removeEventListener("abort",a)}q.isFormData(s)&&(Bn.isStandardBrowserEnv||Bn.isStandardBrowserWebWorkerEnv?i.setContentType(!1):i.setContentType("multipart/form-data;",!1));let h=new XMLHttpRequest;if(n.auth){const A=n.auth.username||"",g=n.auth.password?unescape(encodeURIComponent(n.auth.password)):"";i.set("Authorization","Basic "+btoa(A+":"+g))}const m=s0(n.baseURL,n.url);h.open(n.method.toUpperCase(),e0(m,n.params,n.paramsSerializer),!0),h.timeout=n.timeout;function E(){if(!h)return;const A=rn.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),D={data:!o||o==="text"||o==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:A,config:n,request:h};ry(function(U){t(U),l()},function(U){r(U),l()},D),h=null}if("onloadend"in h?h.onloadend=E:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(E)},h.onabort=function(){h&&(r(new De("Request aborted",De.ECONNABORTED,n,h)),h=null)},h.onerror=function(){r(new De("Network Error",De.ERR_NETWORK,n,h)),h=null},h.ontimeout=function(){let g=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const D=n.transitional||t0;n.timeoutErrorMessage&&(g=n.timeoutErrorMessage),r(new De(g,D.clarifyTimeoutError?De.ETIMEDOUT:De.ECONNABORTED,n,h)),h=null},Bn.isStandardBrowserEnv){const A=(n.withCredentials||ay(m))&&n.xsrfCookieName&&sy.read(n.xsrfCookieName);A&&i.set(n.xsrfHeaderName,A)}s===void 0&&i.setContentType(null),"setRequestHeader"in h&&q.forEach(i.toJSON(),function(g,D){h.setRequestHeader(D,g)}),q.isUndefined(n.withCredentials)||(h.withCredentials=!!n.withCredentials),o&&o!=="json"&&(h.responseType=n.responseType),typeof n.onDownloadProgress=="function"&&h.addEventListener("progress",Ld(n.onDownloadProgress,!0)),typeof n.onUploadProgress=="function"&&h.upload&&h.upload.addEventListener("progress",Ld(n.onUploadProgress)),(n.cancelToken||n.signal)&&(a=A=>{h&&(r(!A||A.type?new Js(null,n,h):A),h.abort(),h=null)},n.cancelToken&&n.cancelToken.subscribe(a),n.signal&&(n.signal.aborted?a():n.signal.addEventListener("abort",a)));const S=cy(m);if(S&&Bn.protocols.indexOf(S)===-1){r(new De("Unsupported protocol "+S+":",De.ERR_BAD_REQUEST,n));return}h.send(s||null)})},ki={http:Pg,xhr:uy};q.forEach(ki,(n,e)=>{if(n){try{Object.defineProperty(n,"name",{value:e})}catch{}Object.defineProperty(n,"adapterName",{value:e})}});const fy={getAdapter:n=>{n=q.isArray(n)?n:[n];const{length:e}=n;let t,r;for(let s=0;s<e&&(t=n[s],!(r=q.isString(t)?ki[t.toLowerCase()]:t));s++);if(!r)throw r===!1?new De(`Adapter ${t} is not supported by the environment`,"ERR_NOT_SUPPORT"):new Error(q.hasOwnProp(ki,t)?`Adapter '${t}' is not available in the build`:`Unknown adapter '${t}'`);if(!q.isFunction(r))throw new TypeError("adapter is not a function");return r},adapters:ki};function ba(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new Js(null,n)}function Od(n){return ba(n),n.headers=rn.from(n.headers),n.data=ma.call(n,n.transformRequest),["post","put","patch"].indexOf(n.method)!==-1&&n.headers.setContentType("application/x-www-form-urlencoded",!1),fy.getAdapter(n.adapter||as.adapter)(n).then(function(r){return ba(n),r.data=ma.call(n,n.transformResponse,r),r.headers=rn.from(r.headers),r},function(r){return r0(r)||(ba(n),r&&r.response&&(r.response.data=ma.call(n,n.transformResponse,r.response),r.response.headers=rn.from(r.response.headers))),Promise.reject(r)})}const Nd=n=>n instanceof rn?n.toJSON():n;function Gr(n,e){e=e||{};const t={};function r(h,m,E){return q.isPlainObject(h)&&q.isPlainObject(m)?q.merge.call({caseless:E},h,m):q.isPlainObject(m)?q.merge({},m):q.isArray(m)?m.slice():m}function s(h,m,E){if(q.isUndefined(m)){if(!q.isUndefined(h))return r(void 0,h,E)}else return r(h,m,E)}function i(h,m){if(!q.isUndefined(m))return r(void 0,m)}function o(h,m){if(q.isUndefined(m)){if(!q.isUndefined(h))return r(void 0,h)}else return r(void 0,m)}function a(h,m,E){if(E in e)return r(h,m);if(E in n)return r(void 0,h)}const l={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(h,m)=>s(Nd(h),Nd(m),!0)};return q.forEach(Object.keys(Object.assign({},n,e)),function(m){const E=l[m]||s,S=E(n[m],e[m],m);q.isUndefined(S)&&E!==a||(t[m]=S)}),t}const i0="1.4.0",Xc={};["object","boolean","number","function","string","symbol"].forEach((n,e)=>{Xc[n]=function(r){return typeof r===n||"a"+(e<1?"n ":" ")+n}});const zd={};Xc.transitional=function(e,t,r){function s(i,o){return"[Axios v"+i0+"] Transitional option '"+i+"'"+o+(r?". "+r:"")}return(i,o,a)=>{if(e===!1)throw new De(s(o," has been removed"+(t?" in "+t:"")),De.ERR_DEPRECATED);return t&&!zd[o]&&(zd[o]=!0,console.warn(s(o," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(i,o,a):!0}};function hy(n,e,t){if(typeof n!="object")throw new De("options must be an object",De.ERR_BAD_OPTION_VALUE);const r=Object.keys(n);let s=r.length;for(;s-- >0;){const i=r[s],o=e[i];if(o){const a=n[i],l=a===void 0||o(a,i,n);if(l!==!0)throw new De("option "+i+" must be "+l,De.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new De("Unknown option "+i,De.ERR_BAD_OPTION)}}const ac={assertOptions:hy,validators:Xc},Yn=ac.validators;let pr=class{constructor(e){this.defaults=e,this.interceptors={request:new Wd,response:new Wd}}request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=Gr(this.defaults,t);const{transitional:r,paramsSerializer:s,headers:i}=t;r!==void 0&&ac.assertOptions(r,{silentJSONParsing:Yn.transitional(Yn.boolean),forcedJSONParsing:Yn.transitional(Yn.boolean),clarifyTimeoutError:Yn.transitional(Yn.boolean)},!1),s!=null&&(q.isFunction(s)?t.paramsSerializer={serialize:s}:ac.assertOptions(s,{encode:Yn.function,serialize:Yn.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o;o=i&&q.merge(i.common,i[t.method]),o&&q.forEach(["delete","get","head","post","put","patch","common"],g=>{delete i[g]}),t.headers=rn.concat(o,i);const a=[];let l=!0;this.interceptors.request.forEach(function(D){typeof D.runWhen=="function"&&D.runWhen(t)===!1||(l=l&&D.synchronous,a.unshift(D.fulfilled,D.rejected))});const h=[];this.interceptors.response.forEach(function(D){h.push(D.fulfilled,D.rejected)});let m,E=0,S;if(!l){const g=[Od.bind(this),void 0];for(g.unshift.apply(g,a),g.push.apply(g,h),S=g.length,m=Promise.resolve(t);E<S;)m=m.then(g[E++],g[E++]);return m}S=a.length;let A=t;for(E=0;E<S;){const g=a[E++],D=a[E++];try{A=g(A)}catch(x){D.call(this,x);break}}try{m=Od.call(this,A)}catch(g){return Promise.reject(g)}for(E=0,S=h.length;E<S;)m=m.then(h[E++],h[E++]);return m}getUri(e){e=Gr(this.defaults,e);const t=s0(e.baseURL,e.url);return e0(t,e.params,e.paramsSerializer)}};q.forEach(["delete","get","head","options"],function(e){pr.prototype[e]=function(t,r){return this.request(Gr(r||{},{method:e,url:t,data:(r||{}).data}))}});q.forEach(["post","put","patch"],function(e){function t(r){return function(i,o,a){return this.request(Gr(a||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}pr.prototype[e]=t(),pr.prototype[e+"Form"]=t(!0)});let my=class o0{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(i){t=i});const r=this;this.promise.then(s=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](s);r._listeners=null}),this.promise.then=s=>{let i;const o=new Promise(a=>{r.subscribe(a),i=a}).then(s);return o.cancel=function(){r.unsubscribe(i)},o},e(function(i,o,a){r.reason||(r.reason=new Js(i,o,a),t(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}static source(){let e;return{token:new o0(function(s){e=s}),cancel:e}}};function by(n){return function(t){return n.apply(null,t)}}function py(n){return q.isObject(n)&&n.isAxiosError===!0}const cc={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(cc).forEach(([n,e])=>{cc[e]=n});function a0(n){const e=new pr(n),t=Hf(pr.prototype.request,e);return q.extend(t,pr.prototype,e,{allOwnKeys:!0}),q.extend(t,e,null,{allOwnKeys:!0}),t.create=function(s){return a0(Gr(n,s))},t}const ve=a0(as);ve.Axios=pr;ve.CanceledError=Js;ve.CancelToken=my;ve.isCancel=r0;ve.VERSION=i0;ve.toFormData=po;ve.AxiosError=De;ve.Cancel=ve.CanceledError;ve.all=function(e){return Promise.all(e)};ve.spread=by;ve.isAxiosError=py;ve.mergeConfig=Gr;ve.AxiosHeaders=rn;ve.formToJSON=n=>n0(q.isHTMLForm(n)?new FormData(n):n);ve.HttpStatusCode=cc;ve.default=ve;const{Axios:R6,AxiosError:W6,CanceledError:P6,isCancel:L6,CancelToken:O6,VERSION:N6,all:z6,Cancel:H6,isAxiosError:q6,spread:K6,toFormData:j6,AxiosHeaders:$6,HttpStatusCode:V6,formToJSON:G6,mergeConfig:Y6}=ve,Ln=60*1e3,c0={Mainnet:{api:"https://api.wormholescan.io",circleAPI:nd("Mainnet"),chains:da("Mainnet")},Testnet:{api:"https://api.testnet.wormholescan.io",circleAPI:nd("Testnet"),chains:da("Testnet")},Devnet:{api:"http://guardian:7071",circleAPI:"",chains:da("Devnet")}};function l0(n,e){return Object.fromEntries(Object.entries(c0[n].chains).filter(([t,r])=>r.platform==e))}function gy(n,e){let t=c0[n];return e?Zc(t,e):t}function yy(n,e,t){const r=l0(n,e);return t?Zc(r,t):r}function Zc(n,e){n||(n={});for(const[t,r]of Object.entries(e))typeof r=="object"&&!Array.isArray(r)?n[t]=Zc(n[t],r):n[t]=r;return n}const wy=typeof Ve.process<"u";wy&&Ve.process.env.NETWORK;async function cs(n,e,t=Ln,r){const s=Math.floor(t/e);let i=0;return new Promise((o,a)=>{n().then(l=>{if(l!==null){o(l);return}let h=setInterval(async()=>{if(i>=s){clearInterval(h),o(null);return}const m=await n();m!==null?(clearInterval(h),o(m)):r&&console.log(`Retrying ${r}, attempt ${i}/${s} `),i++},e)})})}const Ay=2e3;var Hd;(function(n){n.complete="complete",n.pending_confirmations="pending_confirmations"})(Hd||(Hd={}));const Ey=n=>({message:n.attestation,status:n.status});async function By(n,e){var r;const t=`${n}/${e}`;try{const s=await ve.get(t),i=Ey(s==null?void 0:s.data);return i.message==="PENDING"?null:i.message}catch(s){if(!s||typeof s=="object"&&(ve.isAxiosError(s)&&((r=s.response)==null?void 0:r.status)===404||"status"in s&&s.status===404))return null;throw s}}async function xy(n,e,t){return cs(()=>By(n,e),Ay,t,"Circle:GetAttestation")}async function Ls(n,e,t){if(!mp(t))throw new Error("Invalid signer, not SignAndSendSigner or SignOnlySigner");return(await Cy(e,async i=>Vc(t)?t.signAndSend(i):n.sendWait(await t.sign(i)))).map(i=>({chain:n.chain,txid:i}))}async function Cy(n,e){const t=[];let r=[];for await(const s of n)s.parallelizable?r.push(s):(r.length>0&&(t.push(...await e(r)),r=[]),t.push(...await e([s])));return r.length>0&&t.push(...await e(r)),t}exports.TransferState=void 0;(function(n){n[n.Failed=-1]="Failed",n[n.Created=0]="Created",n[n.SourceInitiated=1]="SourceInitiated",n[n.SourceFinalized=2]="SourceFinalized",n[n.InReview=3]="InReview",n[n.Attested=4]="Attested",n[n.Refunded=5]="Refunded",n[n.DestinationInitiated=6]="DestinationInitiated",n[n.DestinationQueued=7]="DestinationQueued",n[n.DestinationFinalized=8]="DestinationFinalized"})(exports.TransferState||(exports.TransferState={}));function Jc(n){return n.state===exports.TransferState.SourceInitiated}function Os(n){return n.state===exports.TransferState.SourceFinalized}function qd(n){return n.state===exports.TransferState.InReview}function Ns(n){return n.state===exports.TransferState.Attested}function Sy(n){return n.state===exports.TransferState.Refunded}function Qc(n){return n.state===exports.TransferState.DestinationInitiated}function Dy(n){return n.state===exports.TransferState.DestinationQueued}function vy(n){return n.state===exports.TransferState.DestinationFinalized}function ky(n){return n.state<0}class Ct{constructor(e,t,r,s){re(this,"wh");re(this,"fromChain");re(this,"toChain");re(this,"_state");re(this,"transfer");re(this,"txids",[]);re(this,"attestations");this._state=exports.TransferState.Created,this.wh=e,this.transfer=t,this.fromChain=r??e.getChain(t.from.chain),this.toChain=s??e.getChain(t.to.chain)}getTransferState(){return this._state}static async from(e,t,r=Ln,s,i){if(Ap(t))return t={...t,...await Ct.destinationOverrides(e.getChain(t.from.chain),e.getChain(t.to.chain),t)},new Ct(e,t,s,i);let o;if(br(t))o=await Ct.fromWormholeMessageId(e,t,r);else if(_f(t))o=await Ct.fromTransaction(e,t,r,s);else if(Li(t))o=await Ct.fromCircleMessage(e,t);else throw new Error("Invalid `from` parameter for CircleTransfer");return o.fromChain=s??e.getChain(o.transfer.from.chain),o.toChain=i??e.getChain(o.transfer.to.chain),await o.fetchAttestation(r),o}static async fromWormholeMessageId(e,t,r){const{chain:s,emitter:i}=t,o=await Ct.getTransferVaa(e,t),a=o.payload.mintRecipient,l=xi(e.network,o.payload.targetDomain),{wormholeRelayer:h}=e.config.chains[l].contracts.cctp;let m=!1;if(h){const A=sn.chainAddress(s,h).address.toUniversalAddress();m=o.payloadName==="TransferWithRelay"&&a.equals(A)}const E={from:{chain:t.chain,address:o.payload.caller},to:{chain:l,address:a},amount:o.payload.token.amount,automatic:m},S=new Ct(e,E);return S.attestations=[{id:{emitter:i,sequence:o.sequence,chain:s},attestation:o}],S._state=exports.TransferState.Attested,S}static async fromCircleMessage(e,t){const[r,s]=exports.CircleBridge.deserialize(_t.decode(t)),{payload:i}=r,o=i.messageSender,a=i.mintRecipient,l=xi(e.network,r.sourceDomain),h=xi(e.network,r.destinationDomain),m={from:{chain:l,address:o},to:{chain:h,address:a},amount:i.amount,automatic:!1},E=new Ct(e,m);return E.attestations=[{id:{hash:s},attestation:{message:r}}],E._state=exports.TransferState.SourceInitiated,E}static async fromTransaction(e,t,r,s){const{chain:i,txid:o}=t;s=s??e.getChain(i);let a=[];try{a=await s.parseTransaction(o)}catch(h){if(!(h.message.includes("no bridge messages found")||h.message.includes("not found")))throw h}let l;if(a.length>0)l=await Ct.fromWormholeMessageId(e,a[0],r);else{const m=await(await s.getCircleBridge()).parseTransactionDetails(o),E={...m,automatic:!1};l=new Ct(e,E),l.attestations=[{id:m.id,attestation:{message:m.message}}]}return l._state=exports.TransferState.SourceInitiated,l.txids=[t],l}async initiateTransfer(e){if(this._state!==exports.TransferState.Created)throw new Error("Invalid state transition in `start`");return this.txids=await Ct.transfer(this.fromChain,this.transfer,e),this._state=exports.TransferState.SourceInitiated,this.txids.map(({txid:t})=>t)}async _fetchWormholeAttestation(e){let t=this.attestations??[];if(!t||t.length==0)throw new Error("No VAA details available");for(const r in t)t[r].attestation||(t[r].attestation=await Ct.getTransferVaa(this.wh,t[r].id,e));return this.attestations=t,t.map(r=>r.id)}async _fetchCircleAttestation(e){var r,s;let t=this.attestations??[];if(!t||t.length==0){if(this.txids.length===0)throw new Error("No circle attestations or transactions to fetch");const i=this.txids[((r=this.txids)==null?void 0:r.length)-1],l=await(await this.wh.getChain(this.transfer.from.chain).getCircleBridge()).parseTransactionDetails(i.txid);t=[{id:l.id,attestation:{message:l.message}}]}for(const i in t){const o=t[i];if((s=o.attestation)!=null&&s.attestation)continue;const a=await this.wh.getCircleAttestation(o.id.hash,e);if(a===null)throw new Error("No attestation available after timeout exhausted");t[i].attestation.attestation=a}return this.attestations=t,t.map(i=>i.id)}async fetchAttestation(e){if(this._state<exports.TransferState.SourceInitiated)throw new Error("Invalid state transition in `fetchAttestation`");const t=this.transfer.automatic?(await Promise.all([this._fetchWormholeAttestation(e),this._fetchCircleAttestation(e)])).flat():await this._fetchCircleAttestation(e);if(this._state=exports.TransferState.Attested,this.attestations&&this.attestations.length>0)for(const r of this.attestations){const{attestation:s}=r;if(!exports.CircleBridge.isCircleAttestation(s))continue;await Ct.isTransferComplete(this.toChain,s)&&(this._state=exports.TransferState.DestinationFinalized)}return t}async completeTransfer(e){var E;if(this._state<exports.TransferState.Attested)throw new Error("Invalid state transition in `finish`");if(this.transfer.automatic)throw this.attestations?this.attestations.find(A=>br(A.id))?new Error("No method to redeem auto circle bridge tx (yet)"):new Error("No VAA found"):new Error("No VAA details available");if(!this.attestations)throw new Error("No Circle Attestations found");const t=this.attestations.filter(S=>Li(S.id));if(t.length>1)throw new Error(`Expected a single circle attestation, found ${t.length}`);const{id:r,attestation:s}=t[0];if(!s)throw new Error(`No Circle Attestation for ${r.hash}`);const{message:i,attestation:o}=s;if(!o)throw new Error(`No Circle Attestation for ${r.hash}`);const a=await this.toChain.getCircleBridge(),l=sn.parseAddress(e.chain(),e.address()),h=a.redeem(l,i,o),m=await Ls(this.toChain,h,e);return(E=this.txids)==null||E.push(...m),m.map(({txid:S})=>S)}}(function(n){async function e(h,m,E){let S;return m.automatic?S=(await h.getAutomaticCircleBridge()).transfer(m.from.address,{chain:m.to.chain,address:m.to.address},m.amount,m.nativeGas):S=(await h.getCircleBridge()).transfer(m.from.address,{chain:m.to.chain,address:m.to.address},m.amount),await Ls(h,S,E)}n.transfer=e;async function*t(h,m,E=Ln,S,A){var x,U;const g=Date.now(),D=(R,F)=>Math.max(F-(Date.now()-R),0);if(S=S??h.getChain(m.from),A=A??h.getChain(m.to),Jc(m)){if(m.originTxs.length===0)throw"Invalid state transition: no originating transactions";const R=m.originTxs[m.originTxs.length-1],F=await n.getTransferMessage(S,R.txid);m={...m,attestation:{id:F.id,attestation:{message:F.message}},state:exports.TransferState.SourceFinalized},yield m}if(Os(m)){if(!m.attestation)throw"Invalid state transition: no attestation id";if(br(m.attestation.id)){let R=m.attestation.attestation?m.attestation.attestation:void 0;R||(R=await n.getTransferVaa(h,m.attestation.id,D(g,E)),m={...m,attestation:{id:m.attestation.id,attestation:R},state:exports.TransferState.Attested},yield m)}else if(Li(m.attestation.id)){const R=await h.getCircleAttestation(m.attestation.id.hash,E),F=m.originTxs[m.originTxs.length-1],z=await(await S.getCircleBridge()).parseTransactionDetails(F.txid);R&&(m={...m,attestation:{id:m.attestation.id,attestation:{attestation:R,message:z.message}},state:exports.TransferState.Attested},yield m)}}if(Ns(m)||Os(m)){if(!m.attestation)throw"Invalid state transition";if(br(m.attestation.id)){const R=await h.getTransactionStatus(m.attestation.id,D(g,E));if(R&&((U=(x=R.globalTx)==null?void 0:x.destinationTx)!=null&&U.txHash)){const{chainId:F,txHash:W}=R.globalTx.destinationTx;m={...m,destinationTxs:[{chain:ts(F),txid:W}],state:exports.TransferState.DestinationInitiated},yield m}}}(Ns(m)||Qc(m))&&(await n.isTransferComplete(A,m.attestation.attestation)&&(m={...m,state:exports.TransferState.DestinationFinalized,destinationTxs:[]}),yield m)}n.track=t;async function r(h,m,E){const S={...E};if(E.to.chain==="Solana"&&!S.automatic){const A=sn.parseAddress("Solana",Cs.get(m.network,m.chain));S.to=await m.getTokenAccount(S.to.address,A)}return S}n.destinationOverrides=r;async function s(h,m,E){const S=Cs.get(m.network,m.chain);if(!S)throw"Invalid transfer, no USDC contract on destination";const A=Cs.get(h.network,h.chain);if(!A)throw"Invalid transfer, no USDC contract on source";const g=sn.chainAddress(m.chain,S),D=sn.chainAddress(h.chain,A),x=(h.chain==="Polygon"?2e3*200:Fc(h.chain))+Uc,U=E.automatic?vs(0,5,0):vs(24,0,0);if(!E.automatic)return{sourceToken:{token:D,amount:E.amount},destinationToken:{token:g,amount:E.amount},eta:x,expires:U};let R=E.amount;const F=E.nativeGas?E.nativeGas:0n;R-=F;const z=await(await h.getAutomaticCircleBridge()).getRelayerFee(m.chain);R-=z;let H=0n;return E.nativeGas&&(H=await(await m.getAutomaticCircleBridge()).nativeTokenAmount(F)),{sourceToken:{token:D,amount:E.amount},destinationToken:{token:g,amount:R},relayFee:{token:D,amount:z},destinationNativeGas:H,eta:x,expires:U}}n.quoteTransfer=s;async function i(h,m){if(!exports.CircleBridge.isCircleAttestation(m))throw new Error("Must check for completion with circle message");return await(await h.getCircleBridge()).isTransferCompleted(m.message)}n.isTransferComplete=i;async function o(h,m,E){const S=await h.getVaa(m,"AutomaticCircleBridge:TransferWithRelay",E);if(!S)throw new Error("No VAA available after timeout exhausted");return S}n.getTransferVaa=o;async function a(h,m){return await(await h.getCircleBridge()).parseTransactionDetails(m)}n.getTransferMessage=a;function l(h){var R,F;const{from:m,to:E}=h.transfer;let S={from:m.chain,to:E.chain,state:exports.TransferState.Created};const A=h.txids.filter(W=>W.chain===h.transfer.from.chain);A.length>0&&(S={...S,state:exports.TransferState.SourceInitiated,originTxs:A});const g=((R=h.attestations)==null?void 0:R.filter(W=>br(W.id)))??[],D=((F=h.attestations)==null?void 0:F.filter(W=>Li(W.id)))??[],x=D.length>0?D[0]:g.length>0?g[0]:void 0;x&&x.id&&(S={...S,state:exports.TransferState.SourceFinalized,attestation:x},x.attestation&&(S={...S,state:exports.TransferState.Attested,attestation:{id:x.id,attestation:x.attestation}}));const U=h.txids.filter(W=>W.chain===h.transfer.to.chain);return U.length>0&&(S={...S,state:exports.TransferState.DestinationInitiated,destinationTxs:U}),S}n.getReceipt=l})(Ct||(Ct={}));const go=2e3;async function d0(n,e){var l;const{chain:t,emitter:r,sequence:s}=e,i=Gs(t),o=_u("0x",r.toString()),a=`${n}/v1/signed_vaa/${i}/${o}/${s}`;try{const{data:{vaaBytes:h}}=await ve.get(a);return to.decode(h)}catch(h){if(!h||typeof h=="object"&&(ve.isAxiosError(h)&&((l=h.response)==null?void 0:l.status)===404||"status"in h&&h.status===404))return null;throw h}}async function Fy(n,e,t){return await cs(()=>d0(n,e),go,t,"Wormholescan:GetVaaBytes")}async function Ty(n,e,t){const r=await d0(n,e);return r?Ws(t,r):null}async function Iy(n,e,t,r){return await cs(()=>Ty(n,e,t),go,r,"Wormholescan:GetVaaBytes")}async function Uy(n,e){var l;const{chain:t,emitter:r,sequence:s}=e,i=Gs(t),o=r.toUniversalAddress().toString(),a=`${n}/api/v1/transactions/${i}/${o}/${s}`;try{return(await ve.get(a)).data}catch(h){if(!h||typeof h=="object"&&(ve.isAxiosError(h)&&((l=h.response)==null?void 0:l.status)===404||"status"in h&&h.status===404))return null;throw h}}async function _y(n,e,t){return await cs(()=>Uy(n,e),go,t,"Wormholescan:GetTransactionStatus")}async function My(n,e){var r;const t=`${n}/api/v1/vaas?txHash=${e}`;try{const s=await ve.get(t);if(s.data.data.length>0)return s.data.data[0]}catch(s){if(!s||typeof s=="object"&&(ve.isAxiosError(s)&&((r=s.response)==null?void 0:r.status)===404||"status"in s&&s.status===404))return null;throw s}return null}async function Kd(n,e,t,r){const i=await cs(()=>My(n,e),go,r,"Wormholescan:GetVaaByTxHash");return i?Ws(t,to.decode(i.vaa)):null}async function Ry(n,e,t=50,r=0){var i;const s=`${n}/api/v1/transactions?address=${e}&pageSize=${t}&page=${r}`;try{const o=await ve.get(s);if(o.data.transactions.length>0)return o.data.transactions}catch(o){if(!o||typeof o=="object"&&(ve.isAxiosError(o)&&((i=o.response)==null?void 0:i.status)===404||"status"in o&&o.status===404))return null;throw o}return null}async function Wy(n){const e=`${n}/v1/governor/token_list`;try{const t=await ve.get(e);if(t.data&&t.data.entries.length>0)return t.data.entries.reduce((r,s)=>{const i=ts(s.originChainId);return r[i]=r[i]||{},r[i][s.originAddress]=s.price,r},{})}catch{}return null}async function Py(n){const e=`${n}/v1/governor/available_notional_by_chain`;try{const t=await ve.get(e);if(t.data&&t.data.entries.length>0)return t.data.entries.reduce((r,s)=>{const i=s.bigTransactionSize==="0"?void 0:Bs(Ai(s.bigTransactionSize,2));return r[ts(s.chainId)]={available:Bs(Ai(s.remainingAvailableNotional,2)),limit:Bs(Ai(s.notionalLimit,2)),maxSize:i},r},{})}catch{}return null}async function Ly(n,e){const{chain:t,emitter:r,sequence:s}=e,i=Gs(t),o=r.toUniversalAddress().toString(),a=`${n}/v1/governor/is_vaa_enqueued/${i}/${o}/${s}`;return(await ve.get(a)).data.isEnqueued}class wt{constructor(e,t,r,s){re(this,"wh");re(this,"fromChain");re(this,"toChain");re(this,"_state");re(this,"transfer");re(this,"txids",[]);re(this,"attestations");this._state=exports.TransferState.Created,this.wh=e,this.transfer=t,this.fromChain=r??e.getChain(t.from.chain),this.toChain=s??e.getChain(t.to.chain)}getTransferState(){return this._state}static async from(e,t,r=6e3,s,i){if(Tp(t))return s=s??e.getChain(t.from.chain),i=i??e.getChain(t.to.chain),wt.validateTransferDetails(e,t,s,i),t={...t,...await wt.destinationOverrides(s,i,t)},new wt(e,t,s,i);let o;if(br(t))o=await wt.fromIdentifier(e,t,r);else if(_f(t))o=await wt.fromTransaction(e,t,r,s);else throw new Error("Invalid `from` parameter for TokenTransfer");return o.fromChain=s??e.getChain(o.transfer.from.chain),o.toChain=i??e.getChain(o.transfer.to.chain),await o.fetchAttestation(r),o}static async fromIdentifier(e,t,r){const s=await wt.getTransferVaa(e,t,r);if(!s)throw new Error("VAA not found");const i=s.protocolName==="AutomaticTokenBridge";let o={chain:s.emitterChain,address:s.emitterAddress},{token:a,to:l}=s.payload,h;if(a.chain===o.chain)h=await e.getTokenNativeAddress(o.chain,a.chain,a.address);else{const U=await(await(await e.getChain(o.chain)).getTokenBridge()).getWrappedAsset(a);h=tr(o.chain,U.toString())}const m=await e.getDecimals(o.chain,h),E=Es(qr(a.amount,Math.min(m,wt.MAX_DECIMALS)),m);let S=0n;i&&(S=s.payload.payload.toNativeTokenAmount,o={chain:s.emitterChain,address:s.payload.from},l={chain:s.payload.to.chain,address:s.payload.payload.targetRecipient});const A={token:a,amount:gn(E),from:o,to:l,automatic:i,nativeGas:S},g=new wt(e,A);return g.attestations=[{id:t,attestation:s}],g._state=exports.TransferState.Attested,g}static async fromTransaction(e,t,r,s){s=s??e.getChain(t.chain);const i=await wt.getTransferMessage(s,t.txid,r),o=await wt.fromIdentifier(e,i,r);return o.txids=[t],o}async initiateTransfer(e){if(this._state!==exports.TransferState.Created)throw new Error("Invalid state transition in `initiateTransfer`");return this.txids=await wt.transfer(this.fromChain,this.transfer,e),this._state=exports.TransferState.SourceInitiated,this.txids.map(({txid:t})=>t)}async fetchAttestation(e){if(this._state<exports.TransferState.SourceInitiated||this._state>exports.TransferState.Attested)throw new Error("Invalid state transition in `fetchAttestation`, expected at least `SourceInitiated`");if(!this.attestations||this.attestations.length===0){if(this.txids.length===0)throw new Error("No VAAs set and txids available to look them up");const t=this.txids[this.txids.length-1],r=await wt.getTransferMessage(this.fromChain,t.txid,e);this.attestations=[{id:r}]}for(const t in this.attestations){if(this.attestations[t].attestation)continue;const r=await wt.getTransferVaa(this.wh,this.attestations[t].id,e);if(!r)throw new Error("VAA not found");this.attestations[t].attestation=r}if(this._state=exports.TransferState.Attested,this.attestations.length>0){const{attestation:t}=this.attestations[0];await wt.isTransferComplete(this.toChain,t)&&(this._state=exports.TransferState.DestinationFinalized)}return this.attestations.map(t=>t.id)}async completeTransfer(e){if(this._state<exports.TransferState.Attested)throw new Error("Invalid state transition, must be attested prior to calling `completeTransfer`.");if(!this.attestations)throw new Error("No VAA details available");const{attestation:t}=this.attestations[0];if(!t)throw new Error(`No VAA found for ${this.attestations[0].id.sequence}`);const r=await wt.redeem(this.toChain,t,e);return this.txids.push(...r),this._state=exports.TransferState.DestinationInitiated,r.map(({txid:s})=>s)}}(function(n){n.MAX_DECIMALS=8;async function e(A,g,D){const x=tr(D.chain(),D.address()),U=uo(g.token)?g.token.address:g.token;let R;return g.automatic?R=(await A.getAutomaticTokenBridge()).transfer(x,g.to,U,g.amount,g.nativeGas):R=(await A.getTokenBridge()).transfer(x,g.to,U,g.amount,g.payload),Ls(A,R,D)}n.transfer=e;async function t(A,g,D){const x=tr(D.chain(),D.address()),U=g.protocolName==="AutomaticTokenBridge"?(await A.getAutomaticTokenBridge()).redeem(x,g):(await A.getTokenBridge()).redeem(x,g);return Ls(A,U,D)}n.redeem=t;async function*r(A,g,D=Ln,x,U){var W,z;const R=Date.now(),F=(H,K)=>Math.max(K-(Date.now()-H),0);if(x=x??A.getChain(g.from),Jc(g)){if(g.originTxs.length===0)throw"Origin transactions required to fetch message id";const{txid:H}=g.originTxs[g.originTxs.length-1],K=await n.getTransferMessage(x,H,F(R,D));g={...g,state:exports.TransferState.SourceFinalized,attestation:{id:K}},yield g}if(Os(g)||qd(g)){if(!g.attestation.id)throw"Attestation id required to fetch attestation";const{id:H}=g.attestation,K=await n.getTransferVaa(A,H,F(R,D));throw K?(g={...g,attestation:{id:H,attestation:K},state:exports.TransferState.Attested},yield g):await n.isTransferEnqueued(A,H)&&(g={...g,state:exports.TransferState.InReview},yield g),new Error("Attestation not found")}if(Ns(g)||Os(g)||qd(g)){if(!g.attestation.id)throw"Attestation id required to fetch redeem tx";const{id:H}=g.attestation,K=await A.getTransactionStatus(H,F(R,D));if(K&&((z=(W=K.globalTx)==null?void 0:W.destinationTx)!=null&&z.txHash)){const{chainId:G,txHash:V}=K.globalTx.destinationTx;g={...g,destinationTxs:[{chain:ts(G),txid:V}],state:exports.TransferState.DestinationInitiated}}yield g}if(Ns(g)||Qc(g)){if(!g.attestation.attestation)throw"Signed Attestation required to check for redeem";if(g.attestation.attestation.payloadName==="AttestMeta")throw new Error("Unable to track an AttestMeta receipt");await n.isTransferComplete(U??A.getChain(g.attestation.attestation.payload.to.chain),g.attestation.attestation)&&(g={...g,state:exports.TransferState.DestinationFinalized}),yield g}yield g}n.track=r;function s(A){const{transfer:g}=A,D=g.from.chain,x=g.to.chain;let U={from:D,to:x,state:exports.TransferState.Created};const R=A.txids.filter(H=>H.chain===g.from.chain);R.length>0&&(U={...U,state:exports.TransferState.SourceInitiated,originTxs:R});const F=A.attestations&&A.attestations.length>0?A.attestations[0]:void 0,W=F&&F.id?{id:F.id,attestation:F.attestation}:void 0;W&&W.id&&(U={...U,state:exports.TransferState.SourceFinalized,attestation:{id:W.id}},W.attestation&&(U={...U,state:exports.TransferState.Attested,attestation:{id:W.id,attestation:W.attestation}}));const z=A.txids.filter(H=>H.chain===g.to.chain);return z.length>0&&(U={...U,state:exports.TransferState.DestinationFinalized,destinationTxs:z}),U}n.getReceipt=s;async function i(A,g,D){let x;const U=await A.getTokenBridge();if(Ot(D.address)){const W=await U.getWrappedNative();x={chain:D.chain,address:await U.getTokenUniversalAddress(W)}}else try{let W;Nt.instanceof(D.address)?W=await U.getWrappedAsset(D):W=D.address,x=await U.getOriginalAsset(W)}catch(W){if(!W.message.includes("not a wrapped asset"))throw W;let z;Nt.instanceof(D.address)?z=await U.getTokenNativeAddress(A.chain,D.address):z=D.address,x={chain:D.chain,address:await U.getTokenUniversalAddress(z)}}const R=await g.getTokenBridge();if(x.chain===g.chain){const W=await R.getTokenNativeAddress(x.chain,x.address),z=await R.getWrappedNative();return Dn({chain:g.chain,address:z})===Dn({chain:g.chain,address:W})?{chain:g.chain,address:"native"}:{chain:g.chain,address:W}}const F=await R.getWrappedAsset(x);return{chain:g.chain,address:F}}n.lookupDestinationToken=i;async function o(A,g){return g.protocolName==="AutomaticTokenBridge"&&(g=Ws("TokenBridge:TransferWithPayload",Qa(g))),(await A.getTokenBridge()).isTransferCompleted(g)}n.isTransferComplete=o;async function a(A,g,D){const x=await sn.parseMessageFromTx(A,g,D);if(x.length!==1)throw new Error("Expected a single Wormhole Message, got: "+x.length);return x[0]}n.getTransferMessage=a;async function l(A,g,D){const x=await A.getVaa(g,rc.getTransferDiscriminator(),D);if(!x)return null;if(x.payloadName==="TransferWithPayload"){const{chain:U,address:R}=x.payload.to,{tokenBridgeRelayer:F}=A.config.chains[U].contracts,W=F?Sf(U,F):null;if(W&&R.equals(W))return Ws("AutomaticTokenBridge:TransferWithRelay",Qa(x))}return x}n.getTransferVaa=l;async function h(A,g){return await A.getIsVaaEnqueued(g)}n.isTransferEnqueued=h;function m(A,g,D,x){if(g.amount===0n)throw new Error("Amount cannot be 0");if(g.from.chain===g.to.chain)throw new Error("Cannot transfer to the same chain");if(D=D??A.getChain(g.from.chain),x=x??A.getChain(g.to.chain),g.automatic){if(g.payload)throw new Error("Payload with automatic delivery is not supported");if(!D.supportsAutomaticTokenBridge())throw new Error(`Automatic Token Bridge not supported on ${g.from.chain}`);if(!x.supportsAutomaticTokenBridge())throw new Error(`Automatic Token Bridge not supported on ${g.to.chain}`);const U=g.nativeGas??0n;if(U>g.amount)throw new Error(`Native gas amount > amount (${U} > ${g.amount})`)}else{if(g.nativeGas)throw new Error("Gas Dropoff is only supported for automatic transfers");if(!D.supportsTokenBridge())throw new Error(`Token Bridge not supported on ${g.from.chain}`);if(!x.supportsTokenBridge())throw new Error(`Token Bridge not supported on ${g.to.chain}`)}}n.validateTransferDetails=m;async function E(A,g,D,x){const U=await g.getTokenBridge();let R;if(Ot(x.token.address))R=await U.getWrappedNative();else if(Nt.instanceof(x.token.address))try{R=await U.getWrappedAsset(x.token)}catch(B){if(!B.message.includes("not a wrapped asset"))throw B;R=await U.getTokenNativeAddress(g.chain,x.token.address)}else R=x.token.address;sn.tokenId(g.chain,R.toString());const F=await g.getDecimals(R),W=qr(x.amount,F),z=Ei(W,n.MAX_DECIMALS),[H,K]=await Promise.all([Wy(A.config.api),Py(A.config.api)]),G=[];if(K!==null&&g.chain in K&&H!==null){let B;if(Ot(x.token.address))B={chain:g.chain,address:await U.getTokenUniversalAddress(R)};else try{B=await U.getOriginalAsset(x.token.address)}catch(u){if(!u.message.includes("not a wrapped asset"))throw u;B={chain:g.chain,address:await U.getTokenUniversalAddress(R)}}if(B.chain in H&&B.address.toString()in H[B.chain]){const u=K[g.chain],$=H[B.chain][B.address.toString()]*Bs(z);u.maxSize&&$>u.maxSize&&G.push({type:"GovernorLimitWarning",reason:"ExceedsLargeTransferLimit"}),$>u.available&&G.push({type:"GovernorLimitWarning",reason:"ExceedsRemainingNotional"})}}const V=await n.lookupDestinationToken(g,D,x.token),ie=await D.getDecimals(V.address),ne=Es(z,ie),ae=Fc(g.chain)+Uc;if(!x.automatic)return{sourceToken:{token:x.token,amount:gn(z)},destinationToken:{token:V,amount:gn(ne)},warnings:G.length>0?G:void 0,eta:ae,expires:vs(24,0,0)};const c=await(await g.getAutomaticTokenBridge()).getRelayerFee(D.chain,R),b=Es(Ei(qr(c,F),n.MAX_DECIMALS),ie),p=x.nativeGas??0n,y=gn(Es(Ei(qr(p,F),n.MAX_DECIMALS),ie)),C=890880n;let T=0n;if(x.nativeGas){const B=await D.getAutomaticTokenBridge(),[u,k]=await Promise.all([B.maxSwapAmount(V.address),B.nativeTokenAmount(V.address,y)]);if(y>u)throw new Error(`Native gas amount exceeds maximum swap amount: ${Gl(y,ie)}>${Gl(u,ie)}`);if(D.chain==="Solana"&&k<C)throw new Error(`Native gas amount must be at least ${C} lamports`);T=k}const _=gn(ne)-y-gn(b);if(V.chain==="Solana"){const B=await D.getNativeWrappedTokenId();if((Ot(V.address)||If(V,B))&&_<C)throw new Error(`Destination amount must be at least ${C} lamports`)}return{sourceToken:{token:x.token,amount:gn(z)},destinationToken:{token:V,amount:_},relayFee:{token:V,amount:gn(b)},destinationNativeGas:T,warnings:G.length>0?G:void 0,eta:ae,expires:vs(0,5,0)}}n.quoteTransfer=E;async function S(A,g,D){const x={...D};if(D.to.chain==="Solana"&&!x.automatic){const U=await n.lookupDestinationToken(A,g,x.token);if(Ot(U.address)){const R=await g.getNativeWrappedTokenId();x.to=await g.getTokenAccount(x.to.address,R.address)}else x.to=await g.getTokenAccount(x.to.address,U.address)}if(x.to.chain==="Sei"){if(x.to.chain==="Sei"&&x.payload)throw new Error("Arbitrary payloads unsupported for Sei");x.payload=zt.encode(JSON.stringify({basic_recipient:{recipient:to.encode(x.to.address.toString())}}));const U=g.config.contracts.translator;if(U===void 0||U==="")throw new Error("Unexpected empty translator address");x.to=sn.chainAddress(x.to.chain,U)}return x}n.destinationOverrides=S})(wt||(wt={}));function Oy(n){if(n.length===0)return[];const{chain:e}=n[0];if(!n.every(t=>t.chain===e))throw new Error("Not every chain is equal");return Array.from(new Set(n.map(t=>Dn(t)))).map(t=>sn.tokenId(e,t))}async function Ny(n,e,t){const r=Dn(e),s=n.config.tokenMap?rs.byAddress(n.config.tokenMap,r):void 0,i=s?s.symbol:void 0,o=Ot(e.address)?await n.getNativeWrappedTokenId():void 0;return t=t??await n.getDecimals(e.address),{id:e,decimals:t,wrapped:o,symbol:i}}class u0{constructor(e,t){re(this,"wh");re(this,"routeConstructors");re(this,"inputTokenList");this.wh=e,this.routeConstructors=t}async supportedDestinationTokens(e,t,r){const[,s]=Uf(t.network,t.chain,e),i=await Promise.all(this.routeConstructors.map(async o=>{if(!o.supportedNetworks().includes(t.network))return[];const l=o.supportedChains(t.network);if(!l.includes(t.chain)||!l.includes(r.chain))return[];try{return await o.supportedDestinationTokens(s,t,r)}catch{return[]}}));return Oy(i.flat())}async findRoutes(e){return(await Promise.all(this.routeConstructors.map(async r=>{try{const s=r.supportedNetworks().includes(this.wh.network)&&r.supportedChains(this.wh.network).includes(e.toChain.chain)&&r.supportedChains(this.wh.network).includes(e.fromChain.chain),i=Dn(Ot(e.destination.id.address)?e.destination.wrapped:e.destination.id),o=(await r.supportedDestinationTokens(e.source.id,e.fromChain,e.toChain)).filter(a=>Dn(a)===i).length>0;return s&&o}catch{return!1}})).then(r=>this.routeConstructors.filter((s,i)=>r[i]))).map(r=>new r(this.wh))}}class sn{constructor(e,t,r){re(this,"_network");re(this,"_platforms");re(this,"_chains");re(this,"config");this._network=e,this.config=gy(e,r),this._chains=new Map,this._platforms=new Map;for(const s of t)this._platforms.set(s._platform,new s(e,this.config.chains))}get network(){return this._network}async circleTransfer(e,t,r,s,i,o){if(s&&i)throw new Error("Payload with automatic delivery is not supported");if(!za(this.network,t.chain)||!za(this.network,r.chain)||!sd(this.network,t.chain)||!sd(this.network,r.chain))throw new Error(`Network and chain not supported: ${this.network} ${t.chain} `);if(s){const h=await(await this.getChain(t.chain).getAutomaticCircleBridge()).getRelayerFee(r.chain)+(o||0n);if(e<h)throw new Error(`Amount must be > ${h} (relayerFee + nativeGas)`)}return await Ct.from(this,{amount:e,from:t,to:r,automatic:s,payload:i,nativeGas:o})}async tokenTransfer(e,t,r,s,i,o,a){return await wt.from(this,{token:e,amount:t,from:r,to:s,automatic:i,payload:o,nativeGas:a})}resolver(e){return new u0(this,e)}getContracts(e){var t;return(t=this.config.chains[e])==null?void 0:t.contracts}getPlatform(e){const t=this._platforms.get(e);if(!t)throw new Error(`Not able to retrieve platform ${e}. Did it get registered in the constructor?`);return t}getChain(e){const t=ns(e);return this._chains.has(e)||this._chains.set(e,this.getPlatform(t).getChain(e)),this._chains.get(e)}async getWrappedAsset(e,t){const s=await this.getChain(e).getTokenBridge();return{chain:e,address:await s.getWrappedAsset(t)}}async getOriginalAsset(e){return await(await this.getChain(e.chain).getTokenBridge()).getOriginalAsset(e.address)}async getTokenUniversalAddress(e,t){return await(await this.getChain(e).getTokenBridge()).getTokenUniversalAddress(t)}async getTokenNativeAddress(e,t,r){return await(await this.getChain(e).getTokenBridge()).getTokenNativeAddress(t,r)}async getDecimals(e,t){return await this.getChain(e).getDecimals(t)}async getBalance(e,t,r){return this.getChain(e).getBalance(r,t)}async getTokenAccount(e,t){return this.getChain(e.chain).getTokenAccount(e.address,t.address)}async getVaaBytes(e,t=Ln){return await Fy(this.config.api,e,t)}async getVaa(e,t,r=Ln){return typeof e=="string"?await Kd(this.config.api,e,t,r):await Iy(this.config.api,e,t,r)}async getIsVaaEnqueued(e){return await Ly(this.config.api,e)}async getCircleAttestation(e,t=Ln){return xy(this.config.circleAPI,e,t)}async getTransactionStatus(e,t=Ln){let r;if(typeof e=="string"){const s=await Kd(this.config.api,e,"Uint8Array",t);if(!s)return null;r={emitter:s.emitterAddress,chain:s.emitterChain,sequence:s.sequence}}else r=e;return await _y(this.config.api,r,t)}async getTransactionsForAddress(e,t=50,r=0){return Ry(this.config.api,e,t,r)}static parseAddress(e,t){return tr(e,t)}static canonicalAddress(e){return Dn(e)}static chainAddress(e,t){return{chain:e,address:sn.parseAddress(e,t)}}static tokenId(e,t){return Ot(t)?Tf(e):this.chainAddress(e,t)}static async parseMessageFromTx(e,t,r=Ln){const i=await cs(async()=>{try{const o=await e.parseTransaction(t);return o.length===0?null:o}catch(o){return console.error(o),null}},e.config.blockTime,r,"WormholeCore:ParseMessageFromTransaction");if(!i)throw new Error(`No WormholeMessageId found for ${t}`);return i}}class yo{constructor(e){re(this,"wh");this.wh=e}transferUrl(e){return`https://wormholescan.io/#/tx/${e}?network=${this.wh.network}`}}class f0 extends yo{}re(f0,"IS_AUTOMATIC",!0);function zy(n){return!!n.constructor.IS_AUTOMATIC}class lc extends yo{}re(lc,"NATIVE_GAS_DROPOFF_SUPPORTED",!1),re(lc,"IS_AUTOMATIC",!1);function Hy(n){return n.complete!==void 0}class qy extends yo{}function Ky(n){return n.finalize!==void 0}var dc={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */(function(n,e){var t=oe,r=t.Buffer;function s(o,a){for(var l in o)a[l]=o[l]}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?n.exports=t:(s(t,e),e.Buffer=i);function i(o,a,l){return r(o,a,l)}i.prototype=Object.create(r.prototype),s(r,i),i.from=function(o,a,l){if(typeof o=="number")throw new TypeError("Argument must not be a number");return r(o,a,l)},i.alloc=function(o,a,l){if(typeof o!="number")throw new TypeError("Argument must be a number");var h=r(o);return a!==void 0?typeof l=="string"?h.fill(a,l):h.fill(a):h.fill(0),h},i.allocUnsafe=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return r(o)},i.allocUnsafeSlow=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return t.SlowBuffer(o)}})(dc,dc.exports);var h0=dc.exports,el={exports:{}};el.exports;(function(n){(function(e,t){function r(I,c){if(!I)throw new Error(c||"Assertion failed")}function s(I,c){I.super_=c;var b=function(){};b.prototype=c.prototype,I.prototype=new b,I.prototype.constructor=I}function i(I,c,b){if(i.isBN(I))return I;this.negative=0,this.words=null,this.length=0,this.red=null,I!==null&&((c==="le"||c==="be")&&(b=c,c=10),this._init(I||0,c||10,b||"be"))}typeof e=="object"?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=oe.Buffer}catch{}i.isBN=function(c){return c instanceof i?!0:c!==null&&typeof c=="object"&&c.constructor.wordSize===i.wordSize&&Array.isArray(c.words)},i.max=function(c,b){return c.cmp(b)>0?c:b},i.min=function(c,b){return c.cmp(b)<0?c:b},i.prototype._init=function(c,b,p){if(typeof c=="number")return this._initNumber(c,b,p);if(typeof c=="object")return this._initArray(c,b,p);b==="hex"&&(b=16),r(b===(b|0)&&b>=2&&b<=36),c=c.toString().replace(/\s+/g,"");var y=0;c[0]==="-"&&(y++,this.negative=1),y<c.length&&(b===16?this._parseHex(c,y,p):(this._parseBase(c,b,y),p==="le"&&this._initArray(this.toArray(),b,p)))},i.prototype._initNumber=function(c,b,p){c<0&&(this.negative=1,c=-c),c<67108864?(this.words=[c&67108863],this.length=1):c<4503599627370496?(this.words=[c&67108863,c/67108864&67108863],this.length=2):(r(c<9007199254740992),this.words=[c&67108863,c/67108864&67108863,1],this.length=3),p==="le"&&this._initArray(this.toArray(),b,p)},i.prototype._initArray=function(c,b,p){if(r(typeof c.length=="number"),c.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(c.length/3),this.words=new Array(this.length);for(var y=0;y<this.length;y++)this.words[y]=0;var C,T,_=0;if(p==="be")for(y=c.length-1,C=0;y>=0;y-=3)T=c[y]|c[y-1]<<8|c[y-2]<<16,this.words[C]|=T<<_&67108863,this.words[C+1]=T>>>26-_&67108863,_+=24,_>=26&&(_-=26,C++);else if(p==="le")for(y=0,C=0;y<c.length;y+=3)T=c[y]|c[y+1]<<8|c[y+2]<<16,this.words[C]|=T<<_&67108863,this.words[C+1]=T>>>26-_&67108863,_+=24,_>=26&&(_-=26,C++);return this._strip()};function a(I,c){var b=I.charCodeAt(c);if(b>=48&&b<=57)return b-48;if(b>=65&&b<=70)return b-55;if(b>=97&&b<=102)return b-87;r(!1,"Invalid character in "+I)}function l(I,c,b){var p=a(I,b);return b-1>=c&&(p|=a(I,b-1)<<4),p}i.prototype._parseHex=function(c,b,p){this.length=Math.ceil((c.length-b)/6),this.words=new Array(this.length);for(var y=0;y<this.length;y++)this.words[y]=0;var C=0,T=0,_;if(p==="be")for(y=c.length-1;y>=b;y-=2)_=l(c,b,y)<<C,this.words[T]|=_&67108863,C>=18?(C-=18,T+=1,this.words[T]|=_>>>26):C+=8;else{var B=c.length-b;for(y=B%2===0?b+1:b;y<c.length;y+=2)_=l(c,b,y)<<C,this.words[T]|=_&67108863,C>=18?(C-=18,T+=1,this.words[T]|=_>>>26):C+=8}this._strip()};function h(I,c,b,p){for(var y=0,C=0,T=Math.min(I.length,b),_=c;_<T;_++){var B=I.charCodeAt(_)-48;y*=p,B>=49?C=B-49+10:B>=17?C=B-17+10:C=B,r(B>=0&&C<p,"Invalid character"),y+=C}return y}i.prototype._parseBase=function(c,b,p){this.words=[0],this.length=1;for(var y=0,C=1;C<=67108863;C*=b)y++;y--,C=C/b|0;for(var T=c.length-p,_=T%y,B=Math.min(T,T-_)+p,u=0,k=p;k<B;k+=y)u=h(c,k,k+y,b),this.imuln(C),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(_!==0){var $=1;for(u=h(c,k,c.length,b),k=0;k<_;k++)$*=b;this.imuln($),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this._strip()},i.prototype.copy=function(c){c.words=new Array(this.length);for(var b=0;b<this.length;b++)c.words[b]=this.words[b];c.length=this.length,c.negative=this.negative,c.red=this.red};function m(I,c){I.words=c.words,I.length=c.length,I.negative=c.negative,I.red=c.red}if(i.prototype._move=function(c){m(c,this)},i.prototype.clone=function(){var c=new i(null);return this.copy(c),c},i.prototype._expand=function(c){for(;this.length<c;)this.words[this.length++]=0;return this},i.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},i.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=E}catch{i.prototype.inspect=E}else i.prototype.inspect=E;function E(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var S=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],A=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],g=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];i.prototype.toString=function(c,b){c=c||10,b=b|0||1;var p;if(c===16||c==="hex"){p="";for(var y=0,C=0,T=0;T<this.length;T++){var _=this.words[T],B=((_<<y|C)&16777215).toString(16);C=_>>>24-y&16777215,y+=2,y>=26&&(y-=26,T--),C!==0||T!==this.length-1?p=S[6-B.length]+B+p:p=B+p}for(C!==0&&(p=C.toString(16)+p);p.length%b!==0;)p="0"+p;return this.negative!==0&&(p="-"+p),p}if(c===(c|0)&&c>=2&&c<=36){var u=A[c],k=g[c];p="";var $=this.clone();for($.negative=0;!$.isZero();){var Z=$.modrn(k).toString(c);$=$.idivn(k),$.isZero()?p=Z+p:p=S[u-Z.length]+Z+p}for(this.isZero()&&(p="0"+p);p.length%b!==0;)p="0"+p;return this.negative!==0&&(p="-"+p),p}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var c=this.words[0];return this.length===2?c+=this.words[1]*67108864:this.length===3&&this.words[2]===1?c+=4503599627370496+this.words[1]*67108864:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-c:c},i.prototype.toJSON=function(){return this.toString(16,2)},o&&(i.prototype.toBuffer=function(c,b){return this.toArrayLike(o,c,b)}),i.prototype.toArray=function(c,b){return this.toArrayLike(Array,c,b)};var D=function(c,b){return c.allocUnsafe?c.allocUnsafe(b):new c(b)};i.prototype.toArrayLike=function(c,b,p){this._strip();var y=this.byteLength(),C=p||Math.max(1,y);r(y<=C,"byte array longer than desired length"),r(C>0,"Requested array length <= 0");var T=D(c,C),_=b==="le"?"LE":"BE";return this["_toArrayLike"+_](T,y),T},i.prototype._toArrayLikeLE=function(c,b){for(var p=0,y=0,C=0,T=0;C<this.length;C++){var _=this.words[C]<<T|y;c[p++]=_&255,p<c.length&&(c[p++]=_>>8&255),p<c.length&&(c[p++]=_>>16&255),T===6?(p<c.length&&(c[p++]=_>>24&255),y=0,T=0):(y=_>>>24,T+=2)}if(p<c.length)for(c[p++]=y;p<c.length;)c[p++]=0},i.prototype._toArrayLikeBE=function(c,b){for(var p=c.length-1,y=0,C=0,T=0;C<this.length;C++){var _=this.words[C]<<T|y;c[p--]=_&255,p>=0&&(c[p--]=_>>8&255),p>=0&&(c[p--]=_>>16&255),T===6?(p>=0&&(c[p--]=_>>24&255),y=0,T=0):(y=_>>>24,T+=2)}if(p>=0)for(c[p--]=y;p>=0;)c[p--]=0},Math.clz32?i.prototype._countBits=function(c){return 32-Math.clz32(c)}:i.prototype._countBits=function(c){var b=c,p=0;return b>=4096&&(p+=13,b>>>=13),b>=64&&(p+=7,b>>>=7),b>=8&&(p+=4,b>>>=4),b>=2&&(p+=2,b>>>=2),p+b},i.prototype._zeroBits=function(c){if(c===0)return 26;var b=c,p=0;return b&8191||(p+=13,b>>>=13),b&127||(p+=7,b>>>=7),b&15||(p+=4,b>>>=4),b&3||(p+=2,b>>>=2),b&1||p++,p},i.prototype.bitLength=function(){var c=this.words[this.length-1],b=this._countBits(c);return(this.length-1)*26+b};function x(I){for(var c=new Array(I.bitLength()),b=0;b<c.length;b++){var p=b/26|0,y=b%26;c[b]=I.words[p]>>>y&1}return c}i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var c=0,b=0;b<this.length;b++){var p=this._zeroBits(this.words[b]);if(c+=p,p!==26)break}return c},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(c){return this.negative!==0?this.abs().inotn(c).iaddn(1):this.clone()},i.prototype.fromTwos=function(c){return this.testn(c-1)?this.notn(c).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return this.negative!==0},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(c){for(;this.length<c.length;)this.words[this.length++]=0;for(var b=0;b<c.length;b++)this.words[b]=this.words[b]|c.words[b];return this._strip()},i.prototype.ior=function(c){return r((this.negative|c.negative)===0),this.iuor(c)},i.prototype.or=function(c){return this.length>c.length?this.clone().ior(c):c.clone().ior(this)},i.prototype.uor=function(c){return this.length>c.length?this.clone().iuor(c):c.clone().iuor(this)},i.prototype.iuand=function(c){var b;this.length>c.length?b=c:b=this;for(var p=0;p<b.length;p++)this.words[p]=this.words[p]&c.words[p];return this.length=b.length,this._strip()},i.prototype.iand=function(c){return r((this.negative|c.negative)===0),this.iuand(c)},i.prototype.and=function(c){return this.length>c.length?this.clone().iand(c):c.clone().iand(this)},i.prototype.uand=function(c){return this.length>c.length?this.clone().iuand(c):c.clone().iuand(this)},i.prototype.iuxor=function(c){var b,p;this.length>c.length?(b=this,p=c):(b=c,p=this);for(var y=0;y<p.length;y++)this.words[y]=b.words[y]^p.words[y];if(this!==b)for(;y<b.length;y++)this.words[y]=b.words[y];return this.length=b.length,this._strip()},i.prototype.ixor=function(c){return r((this.negative|c.negative)===0),this.iuxor(c)},i.prototype.xor=function(c){return this.length>c.length?this.clone().ixor(c):c.clone().ixor(this)},i.prototype.uxor=function(c){return this.length>c.length?this.clone().iuxor(c):c.clone().iuxor(this)},i.prototype.inotn=function(c){r(typeof c=="number"&&c>=0);var b=Math.ceil(c/26)|0,p=c%26;this._expand(b),p>0&&b--;for(var y=0;y<b;y++)this.words[y]=~this.words[y]&67108863;return p>0&&(this.words[y]=~this.words[y]&67108863>>26-p),this._strip()},i.prototype.notn=function(c){return this.clone().inotn(c)},i.prototype.setn=function(c,b){r(typeof c=="number"&&c>=0);var p=c/26|0,y=c%26;return this._expand(p+1),b?this.words[p]=this.words[p]|1<<y:this.words[p]=this.words[p]&~(1<<y),this._strip()},i.prototype.iadd=function(c){var b;if(this.negative!==0&&c.negative===0)return this.negative=0,b=this.isub(c),this.negative^=1,this._normSign();if(this.negative===0&&c.negative!==0)return c.negative=0,b=this.isub(c),c.negative=1,b._normSign();var p,y;this.length>c.length?(p=this,y=c):(p=c,y=this);for(var C=0,T=0;T<y.length;T++)b=(p.words[T]|0)+(y.words[T]|0)+C,this.words[T]=b&67108863,C=b>>>26;for(;C!==0&&T<p.length;T++)b=(p.words[T]|0)+C,this.words[T]=b&67108863,C=b>>>26;if(this.length=p.length,C!==0)this.words[this.length]=C,this.length++;else if(p!==this)for(;T<p.length;T++)this.words[T]=p.words[T];return this},i.prototype.add=function(c){var b;return c.negative!==0&&this.negative===0?(c.negative=0,b=this.sub(c),c.negative^=1,b):c.negative===0&&this.negative!==0?(this.negative=0,b=c.sub(this),this.negative=1,b):this.length>c.length?this.clone().iadd(c):c.clone().iadd(this)},i.prototype.isub=function(c){if(c.negative!==0){c.negative=0;var b=this.iadd(c);return c.negative=1,b._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(c),this.negative=1,this._normSign();var p=this.cmp(c);if(p===0)return this.negative=0,this.length=1,this.words[0]=0,this;var y,C;p>0?(y=this,C=c):(y=c,C=this);for(var T=0,_=0;_<C.length;_++)b=(y.words[_]|0)-(C.words[_]|0)+T,T=b>>26,this.words[_]=b&67108863;for(;T!==0&&_<y.length;_++)b=(y.words[_]|0)+T,T=b>>26,this.words[_]=b&67108863;if(T===0&&_<y.length&&y!==this)for(;_<y.length;_++)this.words[_]=y.words[_];return this.length=Math.max(this.length,_),y!==this&&(this.negative=1),this._strip()},i.prototype.sub=function(c){return this.clone().isub(c)};function U(I,c,b){b.negative=c.negative^I.negative;var p=I.length+c.length|0;b.length=p,p=p-1|0;var y=I.words[0]|0,C=c.words[0]|0,T=y*C,_=T&67108863,B=T/67108864|0;b.words[0]=_;for(var u=1;u<p;u++){for(var k=B>>>26,$=B&67108863,Z=Math.min(u,c.length-1),ee=Math.max(0,u-I.length+1);ee<=Z;ee++){var Ae=u-ee|0;y=I.words[Ae]|0,C=c.words[ee]|0,T=y*C+$,k+=T/67108864|0,$=T&67108863}b.words[u]=$|0,B=k|0}return B!==0?b.words[u]=B|0:b.length--,b._strip()}var R=function(c,b,p){var y=c.words,C=b.words,T=p.words,_=0,B,u,k,$=y[0]|0,Z=$&8191,ee=$>>>13,Ae=y[1]|0,le=Ae&8191,ue=Ae>>>13,Ze=y[2]|0,Ee=Ze&8191,ye=Ze>>>13,tt=y[3]|0,Ce=tt&8191,ke=tt>>>13,Mr=y[4]|0,Le=Mr&8191,$e=Mr>>>13,Rr=y[5]|0,Oe=Rr&8191,Re=Rr>>>13,Ft=y[6]|0,Pe=Ft&8191,He=Ft>>>13,jt=y[7]|0,qe=jt&8191,w=jt>>>13,d=y[8]|0,f=d&8191,v=d>>>13,M=y[9]|0,P=M&8191,N=M>>>13,be=C[0]|0,he=be&8191,fe=be>>>13,Ke=C[1]|0,de=Ke&8191,nt=Ke>>>13,Ul=C[2]|0,rt=Ul&8191,st=Ul>>>13,_l=C[3]|0,it=_l&8191,ot=_l>>>13,Ml=C[4]|0,at=Ml&8191,ct=Ml>>>13,Rl=C[5]|0,lt=Rl&8191,dt=Rl>>>13,Wl=C[6]|0,ut=Wl&8191,ft=Wl>>>13,Pl=C[7]|0,ht=Pl&8191,mt=Pl>>>13,Ll=C[8]|0,bt=Ll&8191,pt=Ll>>>13,Ol=C[9]|0,gt=Ol&8191,yt=Ol>>>13;p.negative=c.negative^b.negative,p.length=19,B=Math.imul(Z,he),u=Math.imul(Z,fe),u=u+Math.imul(ee,he)|0,k=Math.imul(ee,fe);var Po=(_+B|0)+((u&8191)<<13)|0;_=(k+(u>>>13)|0)+(Po>>>26)|0,Po&=67108863,B=Math.imul(le,he),u=Math.imul(le,fe),u=u+Math.imul(ue,he)|0,k=Math.imul(ue,fe),B=B+Math.imul(Z,de)|0,u=u+Math.imul(Z,nt)|0,u=u+Math.imul(ee,de)|0,k=k+Math.imul(ee,nt)|0;var Lo=(_+B|0)+((u&8191)<<13)|0;_=(k+(u>>>13)|0)+(Lo>>>26)|0,Lo&=67108863,B=Math.imul(Ee,he),u=Math.imul(Ee,fe),u=u+Math.imul(ye,he)|0,k=Math.imul(ye,fe),B=B+Math.imul(le,de)|0,u=u+Math.imul(le,nt)|0,u=u+Math.imul(ue,de)|0,k=k+Math.imul(ue,nt)|0,B=B+Math.imul(Z,rt)|0,u=u+Math.imul(Z,st)|0,u=u+Math.imul(ee,rt)|0,k=k+Math.imul(ee,st)|0;var Oo=(_+B|0)+((u&8191)<<13)|0;_=(k+(u>>>13)|0)+(Oo>>>26)|0,Oo&=67108863,B=Math.imul(Ce,he),u=Math.imul(Ce,fe),u=u+Math.imul(ke,he)|0,k=Math.imul(ke,fe),B=B+Math.imul(Ee,de)|0,u=u+Math.imul(Ee,nt)|0,u=u+Math.imul(ye,de)|0,k=k+Math.imul(ye,nt)|0,B=B+Math.imul(le,rt)|0,u=u+Math.imul(le,st)|0,u=u+Math.imul(ue,rt)|0,k=k+Math.imul(ue,st)|0,B=B+Math.imul(Z,it)|0,u=u+Math.imul(Z,ot)|0,u=u+Math.imul(ee,it)|0,k=k+Math.imul(ee,ot)|0;var No=(_+B|0)+((u&8191)<<13)|0;_=(k+(u>>>13)|0)+(No>>>26)|0,No&=67108863,B=Math.imul(Le,he),u=Math.imul(Le,fe),u=u+Math.imul($e,he)|0,k=Math.imul($e,fe),B=B+Math.imul(Ce,de)|0,u=u+Math.imul(Ce,nt)|0,u=u+Math.imul(ke,de)|0,k=k+Math.imul(ke,nt)|0,B=B+Math.imul(Ee,rt)|0,u=u+Math.imul(Ee,st)|0,u=u+Math.imul(ye,rt)|0,k=k+Math.imul(ye,st)|0,B=B+Math.imul(le,it)|0,u=u+Math.imul(le,ot)|0,u=u+Math.imul(ue,it)|0,k=k+Math.imul(ue,ot)|0,B=B+Math.imul(Z,at)|0,u=u+Math.imul(Z,ct)|0,u=u+Math.imul(ee,at)|0,k=k+Math.imul(ee,ct)|0;var zo=(_+B|0)+((u&8191)<<13)|0;_=(k+(u>>>13)|0)+(zo>>>26)|0,zo&=67108863,B=Math.imul(Oe,he),u=Math.imul(Oe,fe),u=u+Math.imul(Re,he)|0,k=Math.imul(Re,fe),B=B+Math.imul(Le,de)|0,u=u+Math.imul(Le,nt)|0,u=u+Math.imul($e,de)|0,k=k+Math.imul($e,nt)|0,B=B+Math.imul(Ce,rt)|0,u=u+Math.imul(Ce,st)|0,u=u+Math.imul(ke,rt)|0,k=k+Math.imul(ke,st)|0,B=B+Math.imul(Ee,it)|0,u=u+Math.imul(Ee,ot)|0,u=u+Math.imul(ye,it)|0,k=k+Math.imul(ye,ot)|0,B=B+Math.imul(le,at)|0,u=u+Math.imul(le,ct)|0,u=u+Math.imul(ue,at)|0,k=k+Math.imul(ue,ct)|0,B=B+Math.imul(Z,lt)|0,u=u+Math.imul(Z,dt)|0,u=u+Math.imul(ee,lt)|0,k=k+Math.imul(ee,dt)|0;var Ho=(_+B|0)+((u&8191)<<13)|0;_=(k+(u>>>13)|0)+(Ho>>>26)|0,Ho&=67108863,B=Math.imul(Pe,he),u=Math.imul(Pe,fe),u=u+Math.imul(He,he)|0,k=Math.imul(He,fe),B=B+Math.imul(Oe,de)|0,u=u+Math.imul(Oe,nt)|0,u=u+Math.imul(Re,de)|0,k=k+Math.imul(Re,nt)|0,B=B+Math.imul(Le,rt)|0,u=u+Math.imul(Le,st)|0,u=u+Math.imul($e,rt)|0,k=k+Math.imul($e,st)|0,B=B+Math.imul(Ce,it)|0,u=u+Math.imul(Ce,ot)|0,u=u+Math.imul(ke,it)|0,k=k+Math.imul(ke,ot)|0,B=B+Math.imul(Ee,at)|0,u=u+Math.imul(Ee,ct)|0,u=u+Math.imul(ye,at)|0,k=k+Math.imul(ye,ct)|0,B=B+Math.imul(le,lt)|0,u=u+Math.imul(le,dt)|0,u=u+Math.imul(ue,lt)|0,k=k+Math.imul(ue,dt)|0,B=B+Math.imul(Z,ut)|0,u=u+Math.imul(Z,ft)|0,u=u+Math.imul(ee,ut)|0,k=k+Math.imul(ee,ft)|0;var qo=(_+B|0)+((u&8191)<<13)|0;_=(k+(u>>>13)|0)+(qo>>>26)|0,qo&=67108863,B=Math.imul(qe,he),u=Math.imul(qe,fe),u=u+Math.imul(w,he)|0,k=Math.imul(w,fe),B=B+Math.imul(Pe,de)|0,u=u+Math.imul(Pe,nt)|0,u=u+Math.imul(He,de)|0,k=k+Math.imul(He,nt)|0,B=B+Math.imul(Oe,rt)|0,u=u+Math.imul(Oe,st)|0,u=u+Math.imul(Re,rt)|0,k=k+Math.imul(Re,st)|0,B=B+Math.imul(Le,it)|0,u=u+Math.imul(Le,ot)|0,u=u+Math.imul($e,it)|0,k=k+Math.imul($e,ot)|0,B=B+Math.imul(Ce,at)|0,u=u+Math.imul(Ce,ct)|0,u=u+Math.imul(ke,at)|0,k=k+Math.imul(ke,ct)|0,B=B+Math.imul(Ee,lt)|0,u=u+Math.imul(Ee,dt)|0,u=u+Math.imul(ye,lt)|0,k=k+Math.imul(ye,dt)|0,B=B+Math.imul(le,ut)|0,u=u+Math.imul(le,ft)|0,u=u+Math.imul(ue,ut)|0,k=k+Math.imul(ue,ft)|0,B=B+Math.imul(Z,ht)|0,u=u+Math.imul(Z,mt)|0,u=u+Math.imul(ee,ht)|0,k=k+Math.imul(ee,mt)|0;var Ko=(_+B|0)+((u&8191)<<13)|0;_=(k+(u>>>13)|0)+(Ko>>>26)|0,Ko&=67108863,B=Math.imul(f,he),u=Math.imul(f,fe),u=u+Math.imul(v,he)|0,k=Math.imul(v,fe),B=B+Math.imul(qe,de)|0,u=u+Math.imul(qe,nt)|0,u=u+Math.imul(w,de)|0,k=k+Math.imul(w,nt)|0,B=B+Math.imul(Pe,rt)|0,u=u+Math.imul(Pe,st)|0,u=u+Math.imul(He,rt)|0,k=k+Math.imul(He,st)|0,B=B+Math.imul(Oe,it)|0,u=u+Math.imul(Oe,ot)|0,u=u+Math.imul(Re,it)|0,k=k+Math.imul(Re,ot)|0,B=B+Math.imul(Le,at)|0,u=u+Math.imul(Le,ct)|0,u=u+Math.imul($e,at)|0,k=k+Math.imul($e,ct)|0,B=B+Math.imul(Ce,lt)|0,u=u+Math.imul(Ce,dt)|0,u=u+Math.imul(ke,lt)|0,k=k+Math.imul(ke,dt)|0,B=B+Math.imul(Ee,ut)|0,u=u+Math.imul(Ee,ft)|0,u=u+Math.imul(ye,ut)|0,k=k+Math.imul(ye,ft)|0,B=B+Math.imul(le,ht)|0,u=u+Math.imul(le,mt)|0,u=u+Math.imul(ue,ht)|0,k=k+Math.imul(ue,mt)|0,B=B+Math.imul(Z,bt)|0,u=u+Math.imul(Z,pt)|0,u=u+Math.imul(ee,bt)|0,k=k+Math.imul(ee,pt)|0;var jo=(_+B|0)+((u&8191)<<13)|0;_=(k+(u>>>13)|0)+(jo>>>26)|0,jo&=67108863,B=Math.imul(P,he),u=Math.imul(P,fe),u=u+Math.imul(N,he)|0,k=Math.imul(N,fe),B=B+Math.imul(f,de)|0,u=u+Math.imul(f,nt)|0,u=u+Math.imul(v,de)|0,k=k+Math.imul(v,nt)|0,B=B+Math.imul(qe,rt)|0,u=u+Math.imul(qe,st)|0,u=u+Math.imul(w,rt)|0,k=k+Math.imul(w,st)|0,B=B+Math.imul(Pe,it)|0,u=u+Math.imul(Pe,ot)|0,u=u+Math.imul(He,it)|0,k=k+Math.imul(He,ot)|0,B=B+Math.imul(Oe,at)|0,u=u+Math.imul(Oe,ct)|0,u=u+Math.imul(Re,at)|0,k=k+Math.imul(Re,ct)|0,B=B+Math.imul(Le,lt)|0,u=u+Math.imul(Le,dt)|0,u=u+Math.imul($e,lt)|0,k=k+Math.imul($e,dt)|0,B=B+Math.imul(Ce,ut)|0,u=u+Math.imul(Ce,ft)|0,u=u+Math.imul(ke,ut)|0,k=k+Math.imul(ke,ft)|0,B=B+Math.imul(Ee,ht)|0,u=u+Math.imul(Ee,mt)|0,u=u+Math.imul(ye,ht)|0,k=k+Math.imul(ye,mt)|0,B=B+Math.imul(le,bt)|0,u=u+Math.imul(le,pt)|0,u=u+Math.imul(ue,bt)|0,k=k+Math.imul(ue,pt)|0,B=B+Math.imul(Z,gt)|0,u=u+Math.imul(Z,yt)|0,u=u+Math.imul(ee,gt)|0,k=k+Math.imul(ee,yt)|0;var $o=(_+B|0)+((u&8191)<<13)|0;_=(k+(u>>>13)|0)+($o>>>26)|0,$o&=67108863,B=Math.imul(P,de),u=Math.imul(P,nt),u=u+Math.imul(N,de)|0,k=Math.imul(N,nt),B=B+Math.imul(f,rt)|0,u=u+Math.imul(f,st)|0,u=u+Math.imul(v,rt)|0,k=k+Math.imul(v,st)|0,B=B+Math.imul(qe,it)|0,u=u+Math.imul(qe,ot)|0,u=u+Math.imul(w,it)|0,k=k+Math.imul(w,ot)|0,B=B+Math.imul(Pe,at)|0,u=u+Math.imul(Pe,ct)|0,u=u+Math.imul(He,at)|0,k=k+Math.imul(He,ct)|0,B=B+Math.imul(Oe,lt)|0,u=u+Math.imul(Oe,dt)|0,u=u+Math.imul(Re,lt)|0,k=k+Math.imul(Re,dt)|0,B=B+Math.imul(Le,ut)|0,u=u+Math.imul(Le,ft)|0,u=u+Math.imul($e,ut)|0,k=k+Math.imul($e,ft)|0,B=B+Math.imul(Ce,ht)|0,u=u+Math.imul(Ce,mt)|0,u=u+Math.imul(ke,ht)|0,k=k+Math.imul(ke,mt)|0,B=B+Math.imul(Ee,bt)|0,u=u+Math.imul(Ee,pt)|0,u=u+Math.imul(ye,bt)|0,k=k+Math.imul(ye,pt)|0,B=B+Math.imul(le,gt)|0,u=u+Math.imul(le,yt)|0,u=u+Math.imul(ue,gt)|0,k=k+Math.imul(ue,yt)|0;var Vo=(_+B|0)+((u&8191)<<13)|0;_=(k+(u>>>13)|0)+(Vo>>>26)|0,Vo&=67108863,B=Math.imul(P,rt),u=Math.imul(P,st),u=u+Math.imul(N,rt)|0,k=Math.imul(N,st),B=B+Math.imul(f,it)|0,u=u+Math.imul(f,ot)|0,u=u+Math.imul(v,it)|0,k=k+Math.imul(v,ot)|0,B=B+Math.imul(qe,at)|0,u=u+Math.imul(qe,ct)|0,u=u+Math.imul(w,at)|0,k=k+Math.imul(w,ct)|0,B=B+Math.imul(Pe,lt)|0,u=u+Math.imul(Pe,dt)|0,u=u+Math.imul(He,lt)|0,k=k+Math.imul(He,dt)|0,B=B+Math.imul(Oe,ut)|0,u=u+Math.imul(Oe,ft)|0,u=u+Math.imul(Re,ut)|0,k=k+Math.imul(Re,ft)|0,B=B+Math.imul(Le,ht)|0,u=u+Math.imul(Le,mt)|0,u=u+Math.imul($e,ht)|0,k=k+Math.imul($e,mt)|0,B=B+Math.imul(Ce,bt)|0,u=u+Math.imul(Ce,pt)|0,u=u+Math.imul(ke,bt)|0,k=k+Math.imul(ke,pt)|0,B=B+Math.imul(Ee,gt)|0,u=u+Math.imul(Ee,yt)|0,u=u+Math.imul(ye,gt)|0,k=k+Math.imul(ye,yt)|0;var Go=(_+B|0)+((u&8191)<<13)|0;_=(k+(u>>>13)|0)+(Go>>>26)|0,Go&=67108863,B=Math.imul(P,it),u=Math.imul(P,ot),u=u+Math.imul(N,it)|0,k=Math.imul(N,ot),B=B+Math.imul(f,at)|0,u=u+Math.imul(f,ct)|0,u=u+Math.imul(v,at)|0,k=k+Math.imul(v,ct)|0,B=B+Math.imul(qe,lt)|0,u=u+Math.imul(qe,dt)|0,u=u+Math.imul(w,lt)|0,k=k+Math.imul(w,dt)|0,B=B+Math.imul(Pe,ut)|0,u=u+Math.imul(Pe,ft)|0,u=u+Math.imul(He,ut)|0,k=k+Math.imul(He,ft)|0,B=B+Math.imul(Oe,ht)|0,u=u+Math.imul(Oe,mt)|0,u=u+Math.imul(Re,ht)|0,k=k+Math.imul(Re,mt)|0,B=B+Math.imul(Le,bt)|0,u=u+Math.imul(Le,pt)|0,u=u+Math.imul($e,bt)|0,k=k+Math.imul($e,pt)|0,B=B+Math.imul(Ce,gt)|0,u=u+Math.imul(Ce,yt)|0,u=u+Math.imul(ke,gt)|0,k=k+Math.imul(ke,yt)|0;var Yo=(_+B|0)+((u&8191)<<13)|0;_=(k+(u>>>13)|0)+(Yo>>>26)|0,Yo&=67108863,B=Math.imul(P,at),u=Math.imul(P,ct),u=u+Math.imul(N,at)|0,k=Math.imul(N,ct),B=B+Math.imul(f,lt)|0,u=u+Math.imul(f,dt)|0,u=u+Math.imul(v,lt)|0,k=k+Math.imul(v,dt)|0,B=B+Math.imul(qe,ut)|0,u=u+Math.imul(qe,ft)|0,u=u+Math.imul(w,ut)|0,k=k+Math.imul(w,ft)|0,B=B+Math.imul(Pe,ht)|0,u=u+Math.imul(Pe,mt)|0,u=u+Math.imul(He,ht)|0,k=k+Math.imul(He,mt)|0,B=B+Math.imul(Oe,bt)|0,u=u+Math.imul(Oe,pt)|0,u=u+Math.imul(Re,bt)|0,k=k+Math.imul(Re,pt)|0,B=B+Math.imul(Le,gt)|0,u=u+Math.imul(Le,yt)|0,u=u+Math.imul($e,gt)|0,k=k+Math.imul($e,yt)|0;var Xo=(_+B|0)+((u&8191)<<13)|0;_=(k+(u>>>13)|0)+(Xo>>>26)|0,Xo&=67108863,B=Math.imul(P,lt),u=Math.imul(P,dt),u=u+Math.imul(N,lt)|0,k=Math.imul(N,dt),B=B+Math.imul(f,ut)|0,u=u+Math.imul(f,ft)|0,u=u+Math.imul(v,ut)|0,k=k+Math.imul(v,ft)|0,B=B+Math.imul(qe,ht)|0,u=u+Math.imul(qe,mt)|0,u=u+Math.imul(w,ht)|0,k=k+Math.imul(w,mt)|0,B=B+Math.imul(Pe,bt)|0,u=u+Math.imul(Pe,pt)|0,u=u+Math.imul(He,bt)|0,k=k+Math.imul(He,pt)|0,B=B+Math.imul(Oe,gt)|0,u=u+Math.imul(Oe,yt)|0,u=u+Math.imul(Re,gt)|0,k=k+Math.imul(Re,yt)|0;var Zo=(_+B|0)+((u&8191)<<13)|0;_=(k+(u>>>13)|0)+(Zo>>>26)|0,Zo&=67108863,B=Math.imul(P,ut),u=Math.imul(P,ft),u=u+Math.imul(N,ut)|0,k=Math.imul(N,ft),B=B+Math.imul(f,ht)|0,u=u+Math.imul(f,mt)|0,u=u+Math.imul(v,ht)|0,k=k+Math.imul(v,mt)|0,B=B+Math.imul(qe,bt)|0,u=u+Math.imul(qe,pt)|0,u=u+Math.imul(w,bt)|0,k=k+Math.imul(w,pt)|0,B=B+Math.imul(Pe,gt)|0,u=u+Math.imul(Pe,yt)|0,u=u+Math.imul(He,gt)|0,k=k+Math.imul(He,yt)|0;var Jo=(_+B|0)+((u&8191)<<13)|0;_=(k+(u>>>13)|0)+(Jo>>>26)|0,Jo&=67108863,B=Math.imul(P,ht),u=Math.imul(P,mt),u=u+Math.imul(N,ht)|0,k=Math.imul(N,mt),B=B+Math.imul(f,bt)|0,u=u+Math.imul(f,pt)|0,u=u+Math.imul(v,bt)|0,k=k+Math.imul(v,pt)|0,B=B+Math.imul(qe,gt)|0,u=u+Math.imul(qe,yt)|0,u=u+Math.imul(w,gt)|0,k=k+Math.imul(w,yt)|0;var Qo=(_+B|0)+((u&8191)<<13)|0;_=(k+(u>>>13)|0)+(Qo>>>26)|0,Qo&=67108863,B=Math.imul(P,bt),u=Math.imul(P,pt),u=u+Math.imul(N,bt)|0,k=Math.imul(N,pt),B=B+Math.imul(f,gt)|0,u=u+Math.imul(f,yt)|0,u=u+Math.imul(v,gt)|0,k=k+Math.imul(v,yt)|0;var ea=(_+B|0)+((u&8191)<<13)|0;_=(k+(u>>>13)|0)+(ea>>>26)|0,ea&=67108863,B=Math.imul(P,gt),u=Math.imul(P,yt),u=u+Math.imul(N,gt)|0,k=Math.imul(N,yt);var ta=(_+B|0)+((u&8191)<<13)|0;return _=(k+(u>>>13)|0)+(ta>>>26)|0,ta&=67108863,T[0]=Po,T[1]=Lo,T[2]=Oo,T[3]=No,T[4]=zo,T[5]=Ho,T[6]=qo,T[7]=Ko,T[8]=jo,T[9]=$o,T[10]=Vo,T[11]=Go,T[12]=Yo,T[13]=Xo,T[14]=Zo,T[15]=Jo,T[16]=Qo,T[17]=ea,T[18]=ta,_!==0&&(T[19]=_,p.length++),p};Math.imul||(R=U);function F(I,c,b){b.negative=c.negative^I.negative,b.length=I.length+c.length;for(var p=0,y=0,C=0;C<b.length-1;C++){var T=y;y=0;for(var _=p&67108863,B=Math.min(C,c.length-1),u=Math.max(0,C-I.length+1);u<=B;u++){var k=C-u,$=I.words[k]|0,Z=c.words[u]|0,ee=$*Z,Ae=ee&67108863;T=T+(ee/67108864|0)|0,Ae=Ae+_|0,_=Ae&67108863,T=T+(Ae>>>26)|0,y+=T>>>26,T&=67108863}b.words[C]=_,p=T,T=y}return p!==0?b.words[C]=p:b.length--,b._strip()}function W(I,c,b){return F(I,c,b)}i.prototype.mulTo=function(c,b){var p,y=this.length+c.length;return this.length===10&&c.length===10?p=R(this,c,b):y<63?p=U(this,c,b):y<1024?p=F(this,c,b):p=W(this,c,b),p},i.prototype.mul=function(c){var b=new i(null);return b.words=new Array(this.length+c.length),this.mulTo(c,b)},i.prototype.mulf=function(c){var b=new i(null);return b.words=new Array(this.length+c.length),W(this,c,b)},i.prototype.imul=function(c){return this.clone().mulTo(c,this)},i.prototype.imuln=function(c){var b=c<0;b&&(c=-c),r(typeof c=="number"),r(c<67108864);for(var p=0,y=0;y<this.length;y++){var C=(this.words[y]|0)*c,T=(C&67108863)+(p&67108863);p>>=26,p+=C/67108864|0,p+=T>>>26,this.words[y]=T&67108863}return p!==0&&(this.words[y]=p,this.length++),b?this.ineg():this},i.prototype.muln=function(c){return this.clone().imuln(c)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(c){var b=x(c);if(b.length===0)return new i(1);for(var p=this,y=0;y<b.length&&b[y]===0;y++,p=p.sqr());if(++y<b.length)for(var C=p.sqr();y<b.length;y++,C=C.sqr())b[y]!==0&&(p=p.mul(C));return p},i.prototype.iushln=function(c){r(typeof c=="number"&&c>=0);var b=c%26,p=(c-b)/26,y=67108863>>>26-b<<26-b,C;if(b!==0){var T=0;for(C=0;C<this.length;C++){var _=this.words[C]&y,B=(this.words[C]|0)-_<<b;this.words[C]=B|T,T=_>>>26-b}T&&(this.words[C]=T,this.length++)}if(p!==0){for(C=this.length-1;C>=0;C--)this.words[C+p]=this.words[C];for(C=0;C<p;C++)this.words[C]=0;this.length+=p}return this._strip()},i.prototype.ishln=function(c){return r(this.negative===0),this.iushln(c)},i.prototype.iushrn=function(c,b,p){r(typeof c=="number"&&c>=0);var y;b?y=(b-b%26)/26:y=0;var C=c%26,T=Math.min((c-C)/26,this.length),_=67108863^67108863>>>C<<C,B=p;if(y-=T,y=Math.max(0,y),B){for(var u=0;u<T;u++)B.words[u]=this.words[u];B.length=T}if(T!==0)if(this.length>T)for(this.length-=T,u=0;u<this.length;u++)this.words[u]=this.words[u+T];else this.words[0]=0,this.length=1;var k=0;for(u=this.length-1;u>=0&&(k!==0||u>=y);u--){var $=this.words[u]|0;this.words[u]=k<<26-C|$>>>C,k=$&_}return B&&k!==0&&(B.words[B.length++]=k),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(c,b,p){return r(this.negative===0),this.iushrn(c,b,p)},i.prototype.shln=function(c){return this.clone().ishln(c)},i.prototype.ushln=function(c){return this.clone().iushln(c)},i.prototype.shrn=function(c){return this.clone().ishrn(c)},i.prototype.ushrn=function(c){return this.clone().iushrn(c)},i.prototype.testn=function(c){r(typeof c=="number"&&c>=0);var b=c%26,p=(c-b)/26,y=1<<b;if(this.length<=p)return!1;var C=this.words[p];return!!(C&y)},i.prototype.imaskn=function(c){r(typeof c=="number"&&c>=0);var b=c%26,p=(c-b)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=p)return this;if(b!==0&&p++,this.length=Math.min(p,this.length),b!==0){var y=67108863^67108863>>>b<<b;this.words[this.length-1]&=y}return this._strip()},i.prototype.maskn=function(c){return this.clone().imaskn(c)},i.prototype.iaddn=function(c){return r(typeof c=="number"),r(c<67108864),c<0?this.isubn(-c):this.negative!==0?this.length===1&&(this.words[0]|0)<=c?(this.words[0]=c-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(c),this.negative=1,this):this._iaddn(c)},i.prototype._iaddn=function(c){this.words[0]+=c;for(var b=0;b<this.length&&this.words[b]>=67108864;b++)this.words[b]-=67108864,b===this.length-1?this.words[b+1]=1:this.words[b+1]++;return this.length=Math.max(this.length,b+1),this},i.prototype.isubn=function(c){if(r(typeof c=="number"),r(c<67108864),c<0)return this.iaddn(-c);if(this.negative!==0)return this.negative=0,this.iaddn(c),this.negative=1,this;if(this.words[0]-=c,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var b=0;b<this.length&&this.words[b]<0;b++)this.words[b]+=67108864,this.words[b+1]-=1;return this._strip()},i.prototype.addn=function(c){return this.clone().iaddn(c)},i.prototype.subn=function(c){return this.clone().isubn(c)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(c,b,p){var y=c.length+p,C;this._expand(y);var T,_=0;for(C=0;C<c.length;C++){T=(this.words[C+p]|0)+_;var B=(c.words[C]|0)*b;T-=B&67108863,_=(T>>26)-(B/67108864|0),this.words[C+p]=T&67108863}for(;C<this.length-p;C++)T=(this.words[C+p]|0)+_,_=T>>26,this.words[C+p]=T&67108863;if(_===0)return this._strip();for(r(_===-1),_=0,C=0;C<this.length;C++)T=-(this.words[C]|0)+_,_=T>>26,this.words[C]=T&67108863;return this.negative=1,this._strip()},i.prototype._wordDiv=function(c,b){var p=this.length-c.length,y=this.clone(),C=c,T=C.words[C.length-1]|0,_=this._countBits(T);p=26-_,p!==0&&(C=C.ushln(p),y.iushln(p),T=C.words[C.length-1]|0);var B=y.length-C.length,u;if(b!=="mod"){u=new i(null),u.length=B+1,u.words=new Array(u.length);for(var k=0;k<u.length;k++)u.words[k]=0}var $=y.clone()._ishlnsubmul(C,1,B);$.negative===0&&(y=$,u&&(u.words[B]=1));for(var Z=B-1;Z>=0;Z--){var ee=(y.words[C.length+Z]|0)*67108864+(y.words[C.length+Z-1]|0);for(ee=Math.min(ee/T|0,67108863),y._ishlnsubmul(C,ee,Z);y.negative!==0;)ee--,y.negative=0,y._ishlnsubmul(C,1,Z),y.isZero()||(y.negative^=1);u&&(u.words[Z]=ee)}return u&&u._strip(),y._strip(),b!=="div"&&p!==0&&y.iushrn(p),{div:u||null,mod:y}},i.prototype.divmod=function(c,b,p){if(r(!c.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var y,C,T;return this.negative!==0&&c.negative===0?(T=this.neg().divmod(c,b),b!=="mod"&&(y=T.div.neg()),b!=="div"&&(C=T.mod.neg(),p&&C.negative!==0&&C.iadd(c)),{div:y,mod:C}):this.negative===0&&c.negative!==0?(T=this.divmod(c.neg(),b),b!=="mod"&&(y=T.div.neg()),{div:y,mod:T.mod}):this.negative&c.negative?(T=this.neg().divmod(c.neg(),b),b!=="div"&&(C=T.mod.neg(),p&&C.negative!==0&&C.isub(c)),{div:T.div,mod:C}):c.length>this.length||this.cmp(c)<0?{div:new i(0),mod:this}:c.length===1?b==="div"?{div:this.divn(c.words[0]),mod:null}:b==="mod"?{div:null,mod:new i(this.modrn(c.words[0]))}:{div:this.divn(c.words[0]),mod:new i(this.modrn(c.words[0]))}:this._wordDiv(c,b)},i.prototype.div=function(c){return this.divmod(c,"div",!1).div},i.prototype.mod=function(c){return this.divmod(c,"mod",!1).mod},i.prototype.umod=function(c){return this.divmod(c,"mod",!0).mod},i.prototype.divRound=function(c){var b=this.divmod(c);if(b.mod.isZero())return b.div;var p=b.div.negative!==0?b.mod.isub(c):b.mod,y=c.ushrn(1),C=c.andln(1),T=p.cmp(y);return T<0||C===1&&T===0?b.div:b.div.negative!==0?b.div.isubn(1):b.div.iaddn(1)},i.prototype.modrn=function(c){var b=c<0;b&&(c=-c),r(c<=67108863);for(var p=(1<<26)%c,y=0,C=this.length-1;C>=0;C--)y=(p*y+(this.words[C]|0))%c;return b?-y:y},i.prototype.modn=function(c){return this.modrn(c)},i.prototype.idivn=function(c){var b=c<0;b&&(c=-c),r(c<=67108863);for(var p=0,y=this.length-1;y>=0;y--){var C=(this.words[y]|0)+p*67108864;this.words[y]=C/c|0,p=C%c}return this._strip(),b?this.ineg():this},i.prototype.divn=function(c){return this.clone().idivn(c)},i.prototype.egcd=function(c){r(c.negative===0),r(!c.isZero());var b=this,p=c.clone();b.negative!==0?b=b.umod(c):b=b.clone();for(var y=new i(1),C=new i(0),T=new i(0),_=new i(1),B=0;b.isEven()&&p.isEven();)b.iushrn(1),p.iushrn(1),++B;for(var u=p.clone(),k=b.clone();!b.isZero();){for(var $=0,Z=1;!(b.words[0]&Z)&&$<26;++$,Z<<=1);if($>0)for(b.iushrn($);$-- >0;)(y.isOdd()||C.isOdd())&&(y.iadd(u),C.isub(k)),y.iushrn(1),C.iushrn(1);for(var ee=0,Ae=1;!(p.words[0]&Ae)&&ee<26;++ee,Ae<<=1);if(ee>0)for(p.iushrn(ee);ee-- >0;)(T.isOdd()||_.isOdd())&&(T.iadd(u),_.isub(k)),T.iushrn(1),_.iushrn(1);b.cmp(p)>=0?(b.isub(p),y.isub(T),C.isub(_)):(p.isub(b),T.isub(y),_.isub(C))}return{a:T,b:_,gcd:p.iushln(B)}},i.prototype._invmp=function(c){r(c.negative===0),r(!c.isZero());var b=this,p=c.clone();b.negative!==0?b=b.umod(c):b=b.clone();for(var y=new i(1),C=new i(0),T=p.clone();b.cmpn(1)>0&&p.cmpn(1)>0;){for(var _=0,B=1;!(b.words[0]&B)&&_<26;++_,B<<=1);if(_>0)for(b.iushrn(_);_-- >0;)y.isOdd()&&y.iadd(T),y.iushrn(1);for(var u=0,k=1;!(p.words[0]&k)&&u<26;++u,k<<=1);if(u>0)for(p.iushrn(u);u-- >0;)C.isOdd()&&C.iadd(T),C.iushrn(1);b.cmp(p)>=0?(b.isub(p),y.isub(C)):(p.isub(b),C.isub(y))}var $;return b.cmpn(1)===0?$=y:$=C,$.cmpn(0)<0&&$.iadd(c),$},i.prototype.gcd=function(c){if(this.isZero())return c.abs();if(c.isZero())return this.abs();var b=this.clone(),p=c.clone();b.negative=0,p.negative=0;for(var y=0;b.isEven()&&p.isEven();y++)b.iushrn(1),p.iushrn(1);do{for(;b.isEven();)b.iushrn(1);for(;p.isEven();)p.iushrn(1);var C=b.cmp(p);if(C<0){var T=b;b=p,p=T}else if(C===0||p.cmpn(1)===0)break;b.isub(p)}while(!0);return p.iushln(y)},i.prototype.invm=function(c){return this.egcd(c).a.umod(c)},i.prototype.isEven=function(){return(this.words[0]&1)===0},i.prototype.isOdd=function(){return(this.words[0]&1)===1},i.prototype.andln=function(c){return this.words[0]&c},i.prototype.bincn=function(c){r(typeof c=="number");var b=c%26,p=(c-b)/26,y=1<<b;if(this.length<=p)return this._expand(p+1),this.words[p]|=y,this;for(var C=y,T=p;C!==0&&T<this.length;T++){var _=this.words[T]|0;_+=C,C=_>>>26,_&=67108863,this.words[T]=_}return C!==0&&(this.words[T]=C,this.length++),this},i.prototype.isZero=function(){return this.length===1&&this.words[0]===0},i.prototype.cmpn=function(c){var b=c<0;if(this.negative!==0&&!b)return-1;if(this.negative===0&&b)return 1;this._strip();var p;if(this.length>1)p=1;else{b&&(c=-c),r(c<=67108863,"Number is too big");var y=this.words[0]|0;p=y===c?0:y<c?-1:1}return this.negative!==0?-p|0:p},i.prototype.cmp=function(c){if(this.negative!==0&&c.negative===0)return-1;if(this.negative===0&&c.negative!==0)return 1;var b=this.ucmp(c);return this.negative!==0?-b|0:b},i.prototype.ucmp=function(c){if(this.length>c.length)return 1;if(this.length<c.length)return-1;for(var b=0,p=this.length-1;p>=0;p--){var y=this.words[p]|0,C=c.words[p]|0;if(y!==C){y<C?b=-1:y>C&&(b=1);break}}return b},i.prototype.gtn=function(c){return this.cmpn(c)===1},i.prototype.gt=function(c){return this.cmp(c)===1},i.prototype.gten=function(c){return this.cmpn(c)>=0},i.prototype.gte=function(c){return this.cmp(c)>=0},i.prototype.ltn=function(c){return this.cmpn(c)===-1},i.prototype.lt=function(c){return this.cmp(c)===-1},i.prototype.lten=function(c){return this.cmpn(c)<=0},i.prototype.lte=function(c){return this.cmp(c)<=0},i.prototype.eqn=function(c){return this.cmpn(c)===0},i.prototype.eq=function(c){return this.cmp(c)===0},i.red=function(c){return new ne(c)},i.prototype.toRed=function(c){return r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),c.convertTo(this)._forceRed(c)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(c){return this.red=c,this},i.prototype.forceRed=function(c){return r(!this.red,"Already a number in reduction context"),this._forceRed(c)},i.prototype.redAdd=function(c){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,c)},i.prototype.redIAdd=function(c){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,c)},i.prototype.redSub=function(c){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,c)},i.prototype.redISub=function(c){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,c)},i.prototype.redShl=function(c){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,c)},i.prototype.redMul=function(c){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,c),this.red.mul(this,c)},i.prototype.redIMul=function(c){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,c),this.red.imul(this,c)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(c){return r(this.red&&!c.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,c)};var z={k256:null,p224:null,p192:null,p25519:null};function H(I,c){this.name=I,this.p=new i(c,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}H.prototype._tmp=function(){var c=new i(null);return c.words=new Array(Math.ceil(this.n/13)),c},H.prototype.ireduce=function(c){var b=c,p;do this.split(b,this.tmp),b=this.imulK(b),b=b.iadd(this.tmp),p=b.bitLength();while(p>this.n);var y=p<this.n?-1:b.ucmp(this.p);return y===0?(b.words[0]=0,b.length=1):y>0?b.isub(this.p):b.strip!==void 0?b.strip():b._strip(),b},H.prototype.split=function(c,b){c.iushrn(this.n,0,b)},H.prototype.imulK=function(c){return c.imul(this.k)};function K(){H.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}s(K,H),K.prototype.split=function(c,b){for(var p=4194303,y=Math.min(c.length,9),C=0;C<y;C++)b.words[C]=c.words[C];if(b.length=y,c.length<=9){c.words[0]=0,c.length=1;return}var T=c.words[9];for(b.words[b.length++]=T&p,C=10;C<c.length;C++){var _=c.words[C]|0;c.words[C-10]=(_&p)<<4|T>>>22,T=_}T>>>=22,c.words[C-10]=T,T===0&&c.length>10?c.length-=10:c.length-=9},K.prototype.imulK=function(c){c.words[c.length]=0,c.words[c.length+1]=0,c.length+=2;for(var b=0,p=0;p<c.length;p++){var y=c.words[p]|0;b+=y*977,c.words[p]=b&67108863,b=y*64+(b/67108864|0)}return c.words[c.length-1]===0&&(c.length--,c.words[c.length-1]===0&&c.length--),c};function G(){H.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}s(G,H);function V(){H.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}s(V,H);function ie(){H.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}s(ie,H),ie.prototype.imulK=function(c){for(var b=0,p=0;p<c.length;p++){var y=(c.words[p]|0)*19+b,C=y&67108863;y>>>=26,c.words[p]=C,b=y}return b!==0&&(c.words[c.length++]=b),c},i._prime=function(c){if(z[c])return z[c];var b;if(c==="k256")b=new K;else if(c==="p224")b=new G;else if(c==="p192")b=new V;else if(c==="p25519")b=new ie;else throw new Error("Unknown prime "+c);return z[c]=b,b};function ne(I){if(typeof I=="string"){var c=i._prime(I);this.m=c.p,this.prime=c}else r(I.gtn(1),"modulus must be greater than 1"),this.m=I,this.prime=null}ne.prototype._verify1=function(c){r(c.negative===0,"red works only with positives"),r(c.red,"red works only with red numbers")},ne.prototype._verify2=function(c,b){r((c.negative|b.negative)===0,"red works only with positives"),r(c.red&&c.red===b.red,"red works only with red numbers")},ne.prototype.imod=function(c){return this.prime?this.prime.ireduce(c)._forceRed(this):(m(c,c.umod(this.m)._forceRed(this)),c)},ne.prototype.neg=function(c){return c.isZero()?c.clone():this.m.sub(c)._forceRed(this)},ne.prototype.add=function(c,b){this._verify2(c,b);var p=c.add(b);return p.cmp(this.m)>=0&&p.isub(this.m),p._forceRed(this)},ne.prototype.iadd=function(c,b){this._verify2(c,b);var p=c.iadd(b);return p.cmp(this.m)>=0&&p.isub(this.m),p},ne.prototype.sub=function(c,b){this._verify2(c,b);var p=c.sub(b);return p.cmpn(0)<0&&p.iadd(this.m),p._forceRed(this)},ne.prototype.isub=function(c,b){this._verify2(c,b);var p=c.isub(b);return p.cmpn(0)<0&&p.iadd(this.m),p},ne.prototype.shl=function(c,b){return this._verify1(c),this.imod(c.ushln(b))},ne.prototype.imul=function(c,b){return this._verify2(c,b),this.imod(c.imul(b))},ne.prototype.mul=function(c,b){return this._verify2(c,b),this.imod(c.mul(b))},ne.prototype.isqr=function(c){return this.imul(c,c.clone())},ne.prototype.sqr=function(c){return this.mul(c,c)},ne.prototype.sqrt=function(c){if(c.isZero())return c.clone();var b=this.m.andln(3);if(r(b%2===1),b===3){var p=this.m.add(new i(1)).iushrn(2);return this.pow(c,p)}for(var y=this.m.subn(1),C=0;!y.isZero()&&y.andln(1)===0;)C++,y.iushrn(1);r(!y.isZero());var T=new i(1).toRed(this),_=T.redNeg(),B=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new i(2*u*u).toRed(this);this.pow(u,B).cmp(_)!==0;)u.redIAdd(_);for(var k=this.pow(u,y),$=this.pow(c,y.addn(1).iushrn(1)),Z=this.pow(c,y),ee=C;Z.cmp(T)!==0;){for(var Ae=Z,le=0;Ae.cmp(T)!==0;le++)Ae=Ae.redSqr();r(le<ee);var ue=this.pow(k,new i(1).iushln(ee-le-1));$=$.redMul(ue),k=ue.redSqr(),Z=Z.redMul(k),ee=le}return $},ne.prototype.invm=function(c){var b=c._invmp(this.m);return b.negative!==0?(b.negative=0,this.imod(b).redNeg()):this.imod(b)},ne.prototype.pow=function(c,b){if(b.isZero())return new i(1).toRed(this);if(b.cmpn(1)===0)return c.clone();var p=4,y=new Array(1<<p);y[0]=new i(1).toRed(this),y[1]=c;for(var C=2;C<y.length;C++)y[C]=this.mul(y[C-1],c);var T=y[0],_=0,B=0,u=b.bitLength()%26;for(u===0&&(u=26),C=b.length-1;C>=0;C--){for(var k=b.words[C],$=u-1;$>=0;$--){var Z=k>>$&1;if(T!==y[0]&&(T=this.sqr(T)),Z===0&&_===0){B=0;continue}_<<=1,_|=Z,B++,!(B!==p&&(C!==0||$!==0))&&(T=this.mul(T,y[_]),B=0,_=0)}u=26}return T},ne.prototype.convertTo=function(c){var b=c.umod(this.m);return b===c?b.clone():b},ne.prototype.convertFrom=function(c){var b=c.clone();return b.red=null,b},i.mont=function(c){return new ae(c)};function ae(I){ne.call(this,I),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}s(ae,ne),ae.prototype.convertTo=function(c){return this.imod(c.ushln(this.shift))},ae.prototype.convertFrom=function(c){var b=this.imod(c.mul(this.rinv));return b.red=null,b},ae.prototype.imul=function(c,b){if(c.isZero()||b.isZero())return c.words[0]=0,c.length=1,c;var p=c.imul(b),y=p.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),C=p.isub(y).iushrn(this.shift),T=C;return C.cmp(this.m)>=0?T=C.isub(this.m):C.cmpn(0)<0&&(T=C.iadd(this.m)),T._forceRed(this)},ae.prototype.mul=function(c,b){if(c.isZero()||b.isZero())return new i(0)._forceRed(this);var p=c.mul(b),y=p.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),C=p.isub(y).iushrn(this.shift),T=C;return C.cmp(this.m)>=0?T=C.isub(this.m):C.cmpn(0)<0&&(T=C.iadd(this.m)),T._forceRed(this)},ae.prototype.invm=function(c){var b=this.imod(c._invmp(this.m).mul(this.r2));return b._forceRed(this)}})(n,an)})(el);var tl=el.exports;const uc=$s(tl),m0="6.13.5";function jy(n,e,t){const r=e.split("|").map(i=>i.trim());for(let i=0;i<r.length;i++)switch(e){case"any":return;case"bigint":case"boolean":case"number":case"string":if(typeof n===e)return}const s=new Error(`invalid value for type ${e}`);throw s.code="INVALID_ARGUMENT",s.argument=`value.${t}`,s.value=n,s}async function $y(n){const e=Object.keys(n);return(await Promise.all(e.map(r=>Promise.resolve(n[r])))).reduce((r,s,i)=>(r[e[i]]=s,r),{})}function fc(n,e,t){for(let r in e){let s=e[r];const i=t?t[r]:null;i&&jy(s,i,r),Object.defineProperty(n,r,{enumerable:!0,value:s,writable:!1})}}function Nr(n){if(n==null)return"null";if(Array.isArray(n))return"[ "+n.map(Nr).join(", ")+" ]";if(n instanceof Uint8Array){const e="0123456789abcdef";let t="0x";for(let r=0;r<n.length;r++)t+=e[n[r]>>4],t+=e[n[r]&15];return t}if(typeof n=="object"&&typeof n.toJSON=="function")return Nr(n.toJSON());switch(typeof n){case"boolean":case"symbol":return n.toString();case"bigint":return BigInt(n).toString();case"number":return n.toString();case"string":return JSON.stringify(n);case"object":{const e=Object.keys(n);return e.sort(),"{ "+e.map(t=>`${Nr(t)}: ${Nr(n[t])}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function b0(n,e){return n&&n.code===e}function Vy(n){return b0(n,"CALL_EXCEPTION")}function p0(n,e,t){let r=n;{const i=[];if(t){if("message"in t||"code"in t||"name"in t)throw new Error(`value will overwrite populated values: ${Nr(t)}`);for(const o in t){if(o==="shortMessage")continue;const a=t[o];i.push(o+"="+Nr(a))}}i.push(`code=${e}`),i.push(`version=${m0}`),i.length&&(n+=" ("+i.join(", ")+")")}let s;switch(e){case"INVALID_ARGUMENT":s=new TypeError(n);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":s=new RangeError(n);break;default:s=new Error(n)}return fc(s,{code:e}),t&&Object.assign(s,t),s.shortMessage==null&&fc(s,{shortMessage:r}),s}function vn(n,e,t,r){if(!n)throw p0(e,t,r)}function Xn(n,e,t,r){vn(n,e,"INVALID_ARGUMENT",{argument:t,value:r})}function Gy(n,e,t){t==null&&(t=""),t&&(t=": "+t),vn(n>=e,"missing argument"+t,"MISSING_ARGUMENT",{count:n,expectedCount:e}),vn(n<=e,"too many arguments"+t,"UNEXPECTED_ARGUMENT",{count:n,expectedCount:e})}const Yy=["NFD","NFC","NFKD","NFKC"].reduce((n,e)=>{try{if("test".normalize(e)!=="test")throw new Error("bad");if(e==="NFD"&&"é".normalize("NFD")!=="é")throw new Error("broken");n.push(e)}catch{}return n},[]);function Xy(n){vn(Yy.indexOf(n)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:n}})}function Zy(n,e,t){if(t==null&&(t=""),n!==e){let r=t,s="new";t&&(r+=".",s+=" "+t),vn(!1,`private constructor; use ${r}from* methods`,"UNSUPPORTED_OPERATION",{operation:s})}}function g0(n,e,t){if(n instanceof Uint8Array)return t?new Uint8Array(n):n;if(typeof n=="string"&&n.match(/^0x(?:[0-9a-f][0-9a-f])*$/i)){const r=new Uint8Array((n.length-2)/2);let s=2;for(let i=0;i<r.length;i++)r[i]=parseInt(n.substring(s,s+2),16),s+=2;return r}Xn(!1,"invalid BytesLike value",e||"value",n)}function Fr(n,e){return g0(n,e,!1)}function Jy(n,e){return g0(n,e,!0)}function nl(n,e){return!(typeof n!="string"||!n.match(/^0x[0-9A-Fa-f]*$/)||typeof e=="number"&&n.length!==2+2*e||e===!0&&n.length%2!==0)}function Qy(n){return nl(n,!0)||n instanceof Uint8Array}const jd="0123456789abcdef";function Qs(n){const e=Fr(n);let t="0x";for(let r=0;r<e.length;r++){const s=e[r];t+=jd[(s&240)>>4]+jd[s&15]}return t}function e2(n){return"0x"+n.map(e=>Qs(e).substring(2)).join("")}function t2(n){return nl(n,!0)?(n.length-2)/2:Fr(n).length}function n2(n,e,t){const r=Fr(n);return t!=null&&t>r.length&&vn(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:r,length:r.length,offset:t}),Qs(r.slice(e??0,t??r.length))}function y0(n,e,t){const r=Fr(n);vn(e>=r.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(r),length:e,offset:e+1});const s=new Uint8Array(e);return s.fill(0),t?s.set(r,e-r.length):s.set(r,0),Qs(s)}function r2(n,e){return y0(n,e,!0)}function s2(n,e){return y0(n,e,!1)}function zs(n){if(!Number.isSafeInteger(n)||n<0)throw new Error(`Wrong positive integer: ${n}`)}function rl(n,...e){if(!(n instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(n.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${n.length}`)}function i2(n){if(typeof n!="function"||typeof n.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");zs(n.outputLen),zs(n.blockLen)}function hc(n,e=!0){if(n.destroyed)throw new Error("Hash instance has been destroyed");if(e&&n.finished)throw new Error("Hash#digest() has already been called")}function w0(n,e){rl(n);const t=e.outputLen;if(n.length<t)throw new Error(`digestInto() expects output buffer of length at least ${t}`)}const pa=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const A0=n=>n instanceof Uint8Array,E0=n=>new Uint32Array(n.buffer,n.byteOffset,Math.floor(n.byteLength/4)),o2=n=>new DataView(n.buffer,n.byteOffset,n.byteLength),a2=(n,e)=>n<<32-e|n>>>e,c2=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!c2)throw new Error("Non little-endian hardware is not supported");const l2=async()=>{};async function d2(n,e,t){let r=Date.now();for(let s=0;s<n;s++){t(s);const i=Date.now()-r;i>=0&&i<e||(await l2(),r+=i)}}function u2(n){if(typeof n!="string")throw new Error(`utf8ToBytes expected string, got ${typeof n}`);return new Uint8Array(new TextEncoder().encode(n))}function sl(n){if(typeof n=="string"&&(n=u2(n)),!A0(n))throw new Error(`expected Uint8Array, got ${typeof n}`);return n}function f2(...n){const e=new Uint8Array(n.reduce((r,s)=>r+s.length,0));let t=0;return n.forEach(r=>{if(!A0(r))throw new Error("Uint8Array expected");e.set(r,t),t+=r.length}),e}class B0{clone(){return this._cloneInto()}}const h2={}.toString;function m2(n,e){if(e!==void 0&&h2.call(e)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(n,e)}function x0(n){const e=r=>n().update(sl(r)).digest(),t=n();return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=()=>n(),e}function b2(n=32){if(pa&&typeof pa.getRandomValues=="function")return pa.getRandomValues(new Uint8Array(n));throw new Error("crypto.getRandomValues must be defined")}const di=BigInt(2**32-1),mc=BigInt(32);function C0(n,e=!1){return e?{h:Number(n&di),l:Number(n>>mc&di)}:{h:Number(n>>mc&di)|0,l:Number(n&di)|0}}function S0(n,e=!1){let t=new Uint32Array(n.length),r=new Uint32Array(n.length);for(let s=0;s<n.length;s++){const{h:i,l:o}=C0(n[s],e);[t[s],r[s]]=[i,o]}return[t,r]}const p2=(n,e)=>BigInt(n>>>0)<<mc|BigInt(e>>>0),g2=(n,e,t)=>n>>>t,y2=(n,e,t)=>n<<32-t|e>>>t,w2=(n,e,t)=>n>>>t|e<<32-t,A2=(n,e,t)=>n<<32-t|e>>>t,E2=(n,e,t)=>n<<64-t|e>>>t-32,B2=(n,e,t)=>n>>>t-32|e<<64-t,x2=(n,e)=>e,C2=(n,e)=>n,D0=(n,e,t)=>n<<t|e>>>32-t,v0=(n,e,t)=>e<<t|n>>>32-t,k0=(n,e,t)=>e<<t-32|n>>>64-t,F0=(n,e,t)=>n<<t-32|e>>>64-t;function S2(n,e,t,r){const s=(e>>>0)+(r>>>0);return{h:n+t+(s/2**32|0)|0,l:s|0}}const D2=(n,e,t)=>(n>>>0)+(e>>>0)+(t>>>0),v2=(n,e,t,r)=>e+t+r+(n/2**32|0)|0,k2=(n,e,t,r)=>(n>>>0)+(e>>>0)+(t>>>0)+(r>>>0),F2=(n,e,t,r,s)=>e+t+r+s+(n/2**32|0)|0,T2=(n,e,t,r,s)=>(n>>>0)+(e>>>0)+(t>>>0)+(r>>>0)+(s>>>0),I2=(n,e,t,r,s,i)=>e+t+r+s+i+(n/2**32|0)|0,U2={fromBig:C0,split:S0,toBig:p2,shrSH:g2,shrSL:y2,rotrSH:w2,rotrSL:A2,rotrBH:E2,rotrBL:B2,rotr32H:x2,rotr32L:C2,rotlSH:D0,rotlSL:v0,rotlBH:k0,rotlBL:F0,add:S2,add3L:D2,add3H:v2,add4L:k2,add4H:F2,add5H:I2,add5L:T2},[T0,I0,U0]=[[],[],[]],_2=BigInt(0),ys=BigInt(1),M2=BigInt(2),R2=BigInt(7),W2=BigInt(256),P2=BigInt(113);for(let n=0,e=ys,t=1,r=0;n<24;n++){[t,r]=[r,(2*t+3*r)%5],T0.push(2*(5*r+t)),I0.push((n+1)*(n+2)/2%64);let s=_2;for(let i=0;i<7;i++)e=(e<<ys^(e>>R2)*P2)%W2,e&M2&&(s^=ys<<(ys<<BigInt(i))-ys);U0.push(s)}const[L2,O2]=S0(U0,!0),$d=(n,e,t)=>t>32?k0(n,e,t):D0(n,e,t),Vd=(n,e,t)=>t>32?F0(n,e,t):v0(n,e,t);function N2(n,e=24){const t=new Uint32Array(10);for(let r=24-e;r<24;r++){for(let o=0;o<10;o++)t[o]=n[o]^n[o+10]^n[o+20]^n[o+30]^n[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,l=(o+2)%10,h=t[l],m=t[l+1],E=$d(h,m,1)^t[a],S=Vd(h,m,1)^t[a+1];for(let A=0;A<50;A+=10)n[o+A]^=E,n[o+A+1]^=S}let s=n[2],i=n[3];for(let o=0;o<24;o++){const a=I0[o],l=$d(s,i,a),h=Vd(s,i,a),m=T0[o];s=n[m],i=n[m+1],n[m]=l,n[m+1]=h}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)t[a]=n[o+a];for(let a=0;a<10;a++)n[o+a]^=~t[(a+2)%10]&t[(a+4)%10]}n[0]^=L2[r],n[1]^=O2[r]}t.fill(0)}class il extends B0{constructor(e,t,r,s=!1,i=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=s,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,zs(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=E0(this.state)}keccak(){N2(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){hc(this);const{blockLen:t,state:r}=this;e=sl(e);const s=e.length;for(let i=0;i<s;){const o=Math.min(t-this.pos,s-i);for(let a=0;a<o;a++)r[this.pos++]^=e[i++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:t,pos:r,blockLen:s}=this;e[r]^=t,t&128&&r===s-1&&this.keccak(),e[s-1]^=128,this.keccak()}writeInto(e){hc(this,!1),rl(e),this.finish();const t=this.state,{blockLen:r}=this;for(let s=0,i=e.length;s<i;){this.posOut>=r&&this.keccak();const o=Math.min(r-this.posOut,i-s);e.set(t.subarray(this.posOut,this.posOut+o),s),this.posOut+=o,s+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return zs(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(w0(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:t,suffix:r,outputLen:s,rounds:i,enableXOF:o}=this;return e||(e=new il(t,r,s,o,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=r,e.outputLen=s,e.enableXOF=o,e.destroyed=this.destroyed,e}}const z2=(n,e,t)=>x0(()=>new il(e,n,t)),H2=z2(1,136,256/8);let _0=!1;const M0=function(n){return H2(n)};let R0=M0;function ls(n){const e=Fr(n,"data");return Qs(R0(e))}ls._=M0;ls.lock=function(){_0=!0};ls.register=function(n){if(_0)throw new TypeError("keccak256 is locked");R0=n};Object.freeze(ls);const q2=BigInt(0),K2=BigInt(36);function Gd(n){n=n.toLowerCase();const e=n.substring(2).split(""),t=new Uint8Array(40);for(let s=0;s<40;s++)t[s]=e[s].charCodeAt(0);const r=Fr(ls(t));for(let s=0;s<40;s+=2)r[s>>1]>>4>=8&&(e[s]=e[s].toUpperCase()),(r[s>>1]&15)>=8&&(e[s+1]=e[s+1].toUpperCase());return"0x"+e.join("")}const ol={};for(let n=0;n<10;n++)ol[String(n)]=String(n);for(let n=0;n<26;n++)ol[String.fromCharCode(65+n)]=String(10+n);const Yd=15;function j2(n){n=n.toUpperCase(),n=n.substring(4)+n.substring(0,2)+"00";let e=n.split("").map(r=>ol[r]).join("");for(;e.length>=Yd;){let r=e.substring(0,Yd);e=parseInt(r,10)%97+e.substring(r.length)}let t=String(98-parseInt(e,10)%97);for(;t.length<2;)t="0"+t;return t}const $2=function(){const n={};for(let e=0;e<36;e++){const t="0123456789abcdefghijklmnopqrstuvwxyz"[e];n[t]=BigInt(e)}return n}();function V2(n){n=n.toLowerCase();let e=q2;for(let t=0;t<n.length;t++)e=e*K2+$2[n[t]];return e}function gr(n){if(Xn(typeof n=="string","invalid address","address",n),n.match(/^(0x)?[0-9a-fA-F]{40}$/)){n.startsWith("0x")||(n="0x"+n);const e=Gd(n);return Xn(!n.match(/([A-F].*[a-f])|([a-f].*[A-F])/)||e===n,"bad address checksum","address",n),e}if(n.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){Xn(n.substring(2,4)===j2(n),"bad icap checksum","address",n);let e=V2(n.substring(4)).toString(16);for(;e.length<40;)e="0"+e;return Gd("0x"+e)}Xn(!1,"invalid address","address",n)}function W0(n){return n&&typeof n.getAddress=="function"}function G2(n){try{return gr(n),!0}catch{}return!1}async function ga(n,e){const t=await e;return(t==null||t==="0x0000000000000000000000000000000000000000")&&(vn(typeof n!="string","unconfigured name","UNCONFIGURED_NAME",{value:n}),Xn(!1,"invalid AddressLike value; did not resolve to a value address","target",n)),gr(t)}function Y2(n,e){if(typeof n=="string")return n.match(/^0x[0-9a-f]{40}$/i)?gr(n):(vn(e!=null,"ENS resolution requires a provider","UNSUPPORTED_OPERATION",{operation:"resolveName"}),ga(n,e.resolveName(n)));if(W0(n))return ga(n,n.getAddress());if(n&&typeof n.then=="function")return ga(n,n);Xn(!1,"unsupported addressable value","target",n)}const X2=0,Z2=0n,al="Evm",J2=(n,e)=>({...n,from:e}),Q2=(n,e)=>({...n,chainId:e}),e8="0x0000000000000000000000000000000000000000",Jt=class Jt{constructor(e){re(this,"type","Native");re(this,"address");if(Jt.instanceof(e)){const t=e;this.address=t.address;return}if(typeof e=="string"){if(!Jt.isValidAddress(e))throw new Error(`Invalid EVM address, expected ${Jt.byteSize}-byte hex string but got ${e}`);this.address=gr(e)}else if(e instanceof Uint8Array)e=this.trimUniversalAddress(e),this.address=gr(_t.encode(e));else if(Nt.instanceof(e)){const t=this.trimUniversalAddress(e.toUint8Array());this.address=gr(_t.encode(t))}else throw new Error(`Invalid EVM address ${e}`)}unwrap(){return this.address}toString(){return this.address}toNative(){return this}toUint8Array(){return _t.decode(this.address)}toUniversalAddress(){return new Nt(this.address,"hex")}trimUniversalAddress(e){if(e.length===Jt.byteSize)return e;if(e.length<Jt.byteSize)throw new Error(`Invalid evm address, expected ${Jt.byteSize} bytes`);if(e.length!==Nt.byteSize)throw new Error(`Invalid universal address, expected ${Nt.byteSize} bytes`);if(xs.decode(e.slice(0,12))!==0n)throw new Error(`Invalid EVM address ${e} expected first 12 bytes to be 0s`);return e.slice(12)}static isValidAddress(e){return G2(e)}static instanceof(e){return e.constructor.platform===Jt.platform}equals(e){return Jt.instanceof(e)?e.address===this.address:e.equals(this.toUniversalAddress())}};re(Jt,"byteSize",20),re(Jt,"platform",al);let Oi=Jt;zc(al,Oi);var ui=h0.Buffer;function t8(n){if(n.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),t=0;t<e.length;t++)e[t]=255;for(var r=0;r<n.length;r++){var s=n.charAt(r),i=s.charCodeAt(0);if(e[i]!==255)throw new TypeError(s+" is ambiguous");e[i]=r}var o=n.length,a=n.charAt(0),l=Math.log(o)/Math.log(256),h=Math.log(256)/Math.log(o);function m(A){if((Array.isArray(A)||A instanceof Uint8Array)&&(A=ui.from(A)),!ui.isBuffer(A))throw new TypeError("Expected Buffer");if(A.length===0)return"";for(var g=0,D=0,x=0,U=A.length;x!==U&&A[x]===0;)x++,g++;for(var R=(U-x)*h+1>>>0,F=new Uint8Array(R);x!==U;){for(var W=A[x],z=0,H=R-1;(W!==0||z<D)&&H!==-1;H--,z++)W+=256*F[H]>>>0,F[H]=W%o>>>0,W=W/o>>>0;if(W!==0)throw new Error("Non-zero carry");D=z,x++}for(var K=R-D;K!==R&&F[K]===0;)K++;for(var G=a.repeat(g);K<R;++K)G+=n.charAt(F[K]);return G}function E(A){if(typeof A!="string")throw new TypeError("Expected String");if(A.length===0)return ui.alloc(0);for(var g=0,D=0,x=0;A[g]===a;)D++,g++;for(var U=(A.length-g)*l+1>>>0,R=new Uint8Array(U);g<A.length;){var F=e[A.charCodeAt(g)];if(F===255)return;for(var W=0,z=U-1;(F!==0||W<x)&&z!==-1;z--,W++)F+=o*R[z]>>>0,R[z]=F%256>>>0,F=F/256>>>0;if(F!==0)throw new Error("Non-zero carry");x=W,g++}for(var H=U-x;H!==U&&R[H]===0;)H++;var K=ui.allocUnsafe(D+(U-H));K.fill(0,0,D);for(var G=D;H!==U;)K[G++]=R[H++];return K}function S(A){var g=E(A);if(g)return g;throw new Error("Non-base"+o+" character")}return{encode:m,decodeUnsafe:E,decode:S}}var n8=t8,r8=n8,s8="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",P0=r8(s8);const vt=$s(P0);var Ut={};function On(n,e,t){return e<=n&&n<=t}function wo(n){if(n===void 0)return{};if(n===Object(n))return n;throw TypeError("Could not convert argument to dictionary")}function i8(n){for(var e=String(n),t=e.length,r=0,s=[];r<t;){var i=e.charCodeAt(r);if(i<55296||i>57343)s.push(i);else if(56320<=i&&i<=57343)s.push(65533);else if(55296<=i&&i<=56319)if(r===t-1)s.push(65533);else{var o=n.charCodeAt(r+1);if(56320<=o&&o<=57343){var a=i&1023,l=o&1023;s.push(65536+(a<<10)+l),r+=1}else s.push(65533)}r+=1}return s}function o8(n){for(var e="",t=0;t<n.length;++t){var r=n[t];r<=65535?e+=String.fromCharCode(r):(r-=65536,e+=String.fromCharCode((r>>10)+55296,(r&1023)+56320))}return e}var Ni=-1;function cl(n){this.tokens=[].slice.call(n)}cl.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.shift():Ni},prepend:function(n){if(Array.isArray(n))for(var e=n;e.length;)this.tokens.unshift(e.pop());else this.tokens.unshift(n)},push:function(n){if(Array.isArray(n))for(var e=n;e.length;)this.tokens.push(e.shift());else this.tokens.push(n)}};var Yr=-1;function ya(n,e){if(n)throw TypeError("Decoder error");return e||65533}var zi="utf-8";function Hi(n,e){if(!(this instanceof Hi))return new Hi(n,e);if(n=n!==void 0?String(n).toLowerCase():zi,n!==zi)throw new Error("Encoding not supported. Only utf-8 is supported");e=wo(e),this._streaming=!1,this._BOMseen=!1,this._decoder=null,this._fatal=!!e.fatal,this._ignoreBOM=!!e.ignoreBOM,Object.defineProperty(this,"encoding",{value:"utf-8"}),Object.defineProperty(this,"fatal",{value:this._fatal}),Object.defineProperty(this,"ignoreBOM",{value:this._ignoreBOM})}Hi.prototype={decode:function(e,t){var r;typeof e=="object"&&e instanceof ArrayBuffer?r=new Uint8Array(e):typeof e=="object"&&"buffer"in e&&e.buffer instanceof ArrayBuffer?r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):r=new Uint8Array(0),t=wo(t),this._streaming||(this._decoder=new a8({fatal:this._fatal}),this._BOMseen=!1),this._streaming=!!t.stream;for(var s=new cl(r),i=[],o;!s.endOfStream()&&(o=this._decoder.handler(s,s.read()),o!==Yr);)o!==null&&(Array.isArray(o)?i.push.apply(i,o):i.push(o));if(!this._streaming){do{if(o=this._decoder.handler(s,s.read()),o===Yr)break;o!==null&&(Array.isArray(o)?i.push.apply(i,o):i.push(o))}while(!s.endOfStream());this._decoder=null}return i.length&&["utf-8"].indexOf(this.encoding)!==-1&&!this._ignoreBOM&&!this._BOMseen&&(i[0]===65279?(this._BOMseen=!0,i.shift()):this._BOMseen=!0),o8(i)}};function qi(n,e){if(!(this instanceof qi))return new qi(n,e);if(n=n!==void 0?String(n).toLowerCase():zi,n!==zi)throw new Error("Encoding not supported. Only utf-8 is supported");e=wo(e),this._streaming=!1,this._encoder=null,this._options={fatal:!!e.fatal},Object.defineProperty(this,"encoding",{value:"utf-8"})}qi.prototype={encode:function(e,t){e=e?String(e):"",t=wo(t),this._streaming||(this._encoder=new c8(this._options)),this._streaming=!!t.stream;for(var r=[],s=new cl(i8(e)),i;!s.endOfStream()&&(i=this._encoder.handler(s,s.read()),i!==Yr);)Array.isArray(i)?r.push.apply(r,i):r.push(i);if(!this._streaming){for(;i=this._encoder.handler(s,s.read()),i!==Yr;)Array.isArray(i)?r.push.apply(r,i):r.push(i);this._encoder=null}return new Uint8Array(r)}};function a8(n){var e=n.fatal,t=0,r=0,s=0,i=128,o=191;this.handler=function(a,l){if(l===Ni&&s!==0)return s=0,ya(e);if(l===Ni)return Yr;if(s===0){if(On(l,0,127))return l;if(On(l,194,223))s=1,t=l-192;else if(On(l,224,239))l===224&&(i=160),l===237&&(o=159),s=2,t=l-224;else if(On(l,240,244))l===240&&(i=144),l===244&&(o=143),s=3,t=l-240;else return ya(e);return t=t<<6*s,null}if(!On(l,i,o))return t=s=r=0,i=128,o=191,a.prepend(l),ya(e);if(i=128,o=191,r+=1,t+=l-128<<6*(s-r),r!==s)return null;var h=t;return t=s=r=0,h}}function c8(n){n.fatal,this.handler=function(e,t){if(t===Ni)return Yr;if(On(t,0,127))return t;var r,s;On(t,128,2047)?(r=1,s=192):On(t,2048,65535)?(r=2,s=224):On(t,65536,1114111)&&(r=3,s=240);for(var i=[(t>>6*r)+s];r>0;){var o=t>>6*(r-1);i.push(128|o&63),r-=1}return i}}const l8=Object.freeze(Object.defineProperty({__proto__:null,TextDecoder:Hi,TextEncoder:qi},Symbol.toStringTag,{value:"Module"})),d8=Ec(l8);var u8=an&&an.__createBinding||(Object.create?function(n,e,t,r){r===void 0&&(r=t),Object.defineProperty(n,r,{enumerable:!0,get:function(){return e[t]}})}:function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]}),f8=an&&an.__setModuleDefault||(Object.create?function(n,e){Object.defineProperty(n,"default",{enumerable:!0,value:e})}:function(n,e){n.default=e}),Tn=an&&an.__decorate||function(n,e,t,r){var s=arguments.length,i=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(s<3?o(i):s>3?o(e,t,i):o(e,t))||i);return s>3&&i&&Object.defineProperty(e,t,i),i},h8=an&&an.__importStar||function(n){if(n&&n.__esModule)return n;var e={};if(n!=null)for(var t in n)t!=="default"&&Object.hasOwnProperty.call(n,t)&&u8(e,n,t);return f8(e,n),e},L0=an&&an.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Ut,"__esModule",{value:!0});var O0=Ut.deserializeUnchecked=j0=Ut.deserialize=K0=Ut.serialize=Ut.BinaryReader=Ut.BinaryWriter=Ut.BorshError=Ut.baseDecode=Ut.baseEncode=void 0;const Zn=L0(tl),N0=L0(P0),m8=h8(d8),b8=typeof TextDecoder!="function"?m8.TextDecoder:TextDecoder,p8=new b8("utf-8",{fatal:!0});function g8(n){return typeof n=="string"&&(n=Ve.Buffer.from(n,"utf8")),N0.default.encode(Ve.Buffer.from(n))}Ut.baseEncode=g8;function y8(n){return Ve.Buffer.from(N0.default.decode(n))}Ut.baseDecode=y8;const wa=1024;class Ht extends Error{constructor(e){super(e),this.fieldPath=[],this.originalMessage=e}addToFieldPath(e){this.fieldPath.splice(0,0,e),this.message=this.originalMessage+": "+this.fieldPath.join(".")}}Ut.BorshError=Ht;class z0{constructor(){this.buf=Ve.Buffer.alloc(wa),this.length=0}maybeResize(){this.buf.length<16+this.length&&(this.buf=Ve.Buffer.concat([this.buf,Ve.Buffer.alloc(wa)]))}writeU8(e){this.maybeResize(),this.buf.writeUInt8(e,this.length),this.length+=1}writeU16(e){this.maybeResize(),this.buf.writeUInt16LE(e,this.length),this.length+=2}writeU32(e){this.maybeResize(),this.buf.writeUInt32LE(e,this.length),this.length+=4}writeU64(e){this.maybeResize(),this.writeBuffer(Ve.Buffer.from(new Zn.default(e).toArray("le",8)))}writeU128(e){this.maybeResize(),this.writeBuffer(Ve.Buffer.from(new Zn.default(e).toArray("le",16)))}writeU256(e){this.maybeResize(),this.writeBuffer(Ve.Buffer.from(new Zn.default(e).toArray("le",32)))}writeU512(e){this.maybeResize(),this.writeBuffer(Ve.Buffer.from(new Zn.default(e).toArray("le",64)))}writeBuffer(e){this.buf=Ve.Buffer.concat([Ve.Buffer.from(this.buf.subarray(0,this.length)),e,Ve.Buffer.alloc(wa)]),this.length+=e.length}writeString(e){this.maybeResize();const t=Ve.Buffer.from(e,"utf8");this.writeU32(t.length),this.writeBuffer(t)}writeFixedArray(e){this.writeBuffer(Ve.Buffer.from(e))}writeArray(e,t){this.maybeResize(),this.writeU32(e.length);for(const r of e)this.maybeResize(),t(r)}toArray(){return this.buf.subarray(0,this.length)}}Ut.BinaryWriter=z0;function In(n,e,t){const r=t.value;t.value=function(...s){try{return r.apply(this,s)}catch(i){if(i instanceof RangeError){const o=i.code;if(["ERR_BUFFER_OUT_OF_BOUNDS","ERR_OUT_OF_RANGE"].indexOf(o)>=0)throw new Ht("Reached the end of buffer when deserializing")}throw i}}}class Zt{constructor(e){this.buf=e,this.offset=0}readU8(){const e=this.buf.readUInt8(this.offset);return this.offset+=1,e}readU16(){const e=this.buf.readUInt16LE(this.offset);return this.offset+=2,e}readU32(){const e=this.buf.readUInt32LE(this.offset);return this.offset+=4,e}readU64(){const e=this.readBuffer(8);return new Zn.default(e,"le")}readU128(){const e=this.readBuffer(16);return new Zn.default(e,"le")}readU256(){const e=this.readBuffer(32);return new Zn.default(e,"le")}readU512(){const e=this.readBuffer(64);return new Zn.default(e,"le")}readBuffer(e){if(this.offset+e>this.buf.length)throw new Ht(`Expected buffer length ${e} isn't within bounds`);const t=this.buf.slice(this.offset,this.offset+e);return this.offset+=e,t}readString(){const e=this.readU32(),t=this.readBuffer(e);try{return p8.decode(t)}catch(r){throw new Ht(`Error decoding UTF-8 string: ${r}`)}}readFixedArray(e){return new Uint8Array(this.readBuffer(e))}readArray(e){const t=this.readU32(),r=Array();for(let s=0;s<t;++s)r.push(e());return r}}Tn([In],Zt.prototype,"readU8",null);Tn([In],Zt.prototype,"readU16",null);Tn([In],Zt.prototype,"readU32",null);Tn([In],Zt.prototype,"readU64",null);Tn([In],Zt.prototype,"readU128",null);Tn([In],Zt.prototype,"readU256",null);Tn([In],Zt.prototype,"readU512",null);Tn([In],Zt.prototype,"readString",null);Tn([In],Zt.prototype,"readFixedArray",null);Tn([In],Zt.prototype,"readArray",null);Ut.BinaryReader=Zt;function H0(n){return n.charAt(0).toUpperCase()+n.slice(1)}function or(n,e,t,r,s){try{if(typeof r=="string")s[`write${H0(r)}`](t);else if(r instanceof Array)if(typeof r[0]=="number"){if(t.length!==r[0])throw new Ht(`Expecting byte array of length ${r[0]}, but got ${t.length} bytes`);s.writeFixedArray(t)}else if(r.length===2&&typeof r[1]=="number"){if(t.length!==r[1])throw new Ht(`Expecting byte array of length ${r[1]}, but got ${t.length} bytes`);for(let i=0;i<r[1];i++)or(n,null,t[i],r[0],s)}else s.writeArray(t,i=>{or(n,e,i,r[0],s)});else if(r.kind!==void 0)switch(r.kind){case"option":{t==null?s.writeU8(0):(s.writeU8(1),or(n,e,t,r.type,s));break}case"map":{s.writeU32(t.size),t.forEach((i,o)=>{or(n,e,o,r.key,s),or(n,e,i,r.value,s)});break}default:throw new Ht(`FieldType ${r} unrecognized`)}else q0(n,t,s)}catch(i){throw i instanceof Ht&&i.addToFieldPath(e),i}}function q0(n,e,t){if(typeof e.borshSerialize=="function"){e.borshSerialize(t);return}const r=n.get(e.constructor);if(!r)throw new Ht(`Class ${e.constructor.name} is missing in schema`);if(r.kind==="struct")r.fields.map(([s,i])=>{or(n,s,e[s],i,t)});else if(r.kind==="enum"){const s=e[r.field];for(let i=0;i<r.values.length;++i){const[o,a]=r.values[i];if(o===s){t.writeU8(i),or(n,o,e[o],a,t);break}}}else throw new Ht(`Unexpected schema kind: ${r.kind} for ${e.constructor.name}`)}function w8(n,e,t=z0){const r=new t;return q0(n,e,r),r.toArray()}var K0=Ut.serialize=w8;function ar(n,e,t,r){try{if(typeof t=="string")return r[`read${H0(t)}`]();if(t instanceof Array){if(typeof t[0]=="number")return r.readFixedArray(t[0]);if(typeof t[1]=="number"){const s=[];for(let i=0;i<t[1];i++)s.push(ar(n,null,t[0],r));return s}else return r.readArray(()=>ar(n,e,t[0],r))}if(t.kind==="option")return r.readU8()?ar(n,e,t.type,r):void 0;if(t.kind==="map"){let s=new Map;const i=r.readU32();for(let o=0;o<i;o++){const a=ar(n,e,t.key,r),l=ar(n,e,t.value,r);s.set(a,l)}return s}return ll(n,t,r)}catch(s){throw s instanceof Ht&&s.addToFieldPath(e),s}}function ll(n,e,t){if(typeof e.borshDeserialize=="function")return e.borshDeserialize(t);const r=n.get(e);if(!r)throw new Ht(`Class ${e.name} is missing in schema`);if(r.kind==="struct"){const s={};for(const[i,o]of n.get(e).fields)s[i]=ar(n,i,o,t);return new e(s)}if(r.kind==="enum"){const s=t.readU8();if(s>=r.values.length)throw new Ht(`Enum index: ${s} is out of range`);const[i,o]=r.values[s],a=ar(n,i,o,t);return new e({[i]:a})}throw new Ht(`Unexpected schema kind: ${r.kind} for ${e.constructor.name}`)}function A8(n,e,t,r=Zt){const s=new r(t),i=ll(n,e,s);if(s.offset<t.length)throw new Ht(`Unexpected ${t.length-s.offset} bytes after deserialized data`);return i}var j0=Ut.deserialize=A8;function E8(n,e,t,r=Zt){const s=new r(t);return ll(n,e,s)}O0=Ut.deserializeUnchecked=E8;var O={};Object.defineProperty(O,"__esModule",{value:!0});exports.s16=O.s16=O.s8=O.nu64be=O.u48be=O.u40be=O.u32be=O.u24be=O.u16be=It=O.nu64=O.u48=O.u40=exports.u32=O.u32=O.u24=exports.u16=O.u16=exports.u8=O.u8=Qn=O.offset=exports.greedy=O.greedy=O.Constant=O.UTF8=O.CString=O.Blob=O.Boolean=O.BitField=O.BitStructure=O.VariantLayout=O.Union=O.UnionLayoutDiscriminator=O.UnionDiscriminator=O.Structure=O.Sequence=O.DoubleBE=O.Double=O.FloatBE=O.Float=O.NearInt64BE=O.NearInt64=O.NearUInt64BE=O.NearUInt64=O.IntBE=O.Int=O.UIntBE=O.UInt=O.OffsetLayout=O.GreedyCount=O.ExternalLayout=O.bindConstructorLayout=O.nameWithProperty=O.Layout=O.uint8ArrayToBuffer=O.checkUint8Array=void 0;O.constant=O.utf8=O.cstr=exports.blob=O.blob=O.unionLayoutDiscriminator=O.union=exports.seq=O.seq=O.bits=exports.struct=O.struct=O.f64be=O.f64=O.f32be=O.f32=O.ns64be=O.s48be=O.s40be=O.s32be=O.s24be=O.s16be=exports.ns64=O.ns64=O.s48=O.s40=O.s32=O.s24=void 0;const dl=oe;function ds(n){if(!(n instanceof Uint8Array))throw new TypeError("b must be a Uint8Array")}O.checkUint8Array=ds;function Ie(n){return ds(n),dl.Buffer.from(n.buffer,n.byteOffset,n.length)}O.uint8ArrayToBuffer=Ie;class Me{constructor(e,t){if(!Number.isInteger(e))throw new TypeError("span must be an integer");this.span=e,this.property=t}makeDestinationObject(){return{}}getSpan(e,t){if(0>this.span)throw new RangeError("indeterminate span");return this.span}replicate(e){const t=Object.create(this.constructor.prototype);return Object.assign(t,this),t.property=e,t}fromArray(e){}}O.Layout=Me;function ul(n,e){return e.property?n+"["+e.property+"]":n}O.nameWithProperty=ul;function B8(n,e){if(typeof n!="function")throw new TypeError("Class must be constructor");if(Object.prototype.hasOwnProperty.call(n,"layout_"))throw new Error("Class is already bound to a layout");if(!(e&&e instanceof Me))throw new TypeError("layout must be a Layout");if(Object.prototype.hasOwnProperty.call(e,"boundConstructor_"))throw new Error("layout is already bound to a constructor");n.layout_=e,e.boundConstructor_=n,e.makeDestinationObject=()=>new n,Object.defineProperty(n.prototype,"encode",{value(t,r){return e.encode(this,t,r)},writable:!0}),Object.defineProperty(n,"decode",{value(t,r){return e.decode(t,r)},writable:!0})}O.bindConstructorLayout=B8;class Yt extends Me{isCount(){throw new Error("ExternalLayout is abstract")}}O.ExternalLayout=Yt;class $0 extends Yt{constructor(e=1,t){if(!Number.isInteger(e)||0>=e)throw new TypeError("elementSpan must be a (positive) integer");super(-1,t),this.elementSpan=e}isCount(){return!0}decode(e,t=0){ds(e);const r=e.length-t;return Math.floor(r/this.elementSpan)}encode(e,t,r){return 0}}O.GreedyCount=$0;class fl extends Yt{constructor(e,t=0,r){if(!(e instanceof Me))throw new TypeError("layout must be a Layout");if(!Number.isInteger(t))throw new TypeError("offset must be integer or undefined");super(e.span,r||e.property),this.layout=e,this.offset=t}isCount(){return this.layout instanceof on||this.layout instanceof un}decode(e,t=0){return this.layout.decode(e,t+this.offset)}encode(e,t,r=0){return this.layout.encode(e,t,r+this.offset)}}O.OffsetLayout=fl;class on extends Me{constructor(e,t){if(super(e,t),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,t=0){return Ie(e).readUIntLE(t,this.span)}encode(e,t,r=0){return Ie(t).writeUIntLE(e,r,this.span),this.span}}O.UInt=on;class un extends Me{constructor(e,t){if(super(e,t),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,t=0){return Ie(e).readUIntBE(t,this.span)}encode(e,t,r=0){return Ie(t).writeUIntBE(e,r,this.span),this.span}}O.UIntBE=un;class Tr extends Me{constructor(e,t){if(super(e,t),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,t=0){return Ie(e).readIntLE(t,this.span)}encode(e,t,r=0){return Ie(t).writeIntLE(e,r,this.span),this.span}}O.Int=Tr;class us extends Me{constructor(e,t){if(super(e,t),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,t=0){return Ie(e).readIntBE(t,this.span)}encode(e,t,r=0){return Ie(t).writeIntBE(e,r,this.span),this.span}}O.IntBE=us;const bc=Math.pow(2,32);function Ao(n){const e=Math.floor(n/bc),t=n-e*bc;return{hi32:e,lo32:t}}function Eo(n,e){return n*bc+e}class V0 extends Me{constructor(e){super(8,e)}decode(e,t=0){const r=Ie(e),s=r.readUInt32LE(t),i=r.readUInt32LE(t+4);return Eo(i,s)}encode(e,t,r=0){const s=Ao(e),i=Ie(t);return i.writeUInt32LE(s.lo32,r),i.writeUInt32LE(s.hi32,r+4),8}}O.NearUInt64=V0;class G0 extends Me{constructor(e){super(8,e)}decode(e,t=0){const r=Ie(e),s=r.readUInt32BE(t),i=r.readUInt32BE(t+4);return Eo(s,i)}encode(e,t,r=0){const s=Ao(e),i=Ie(t);return i.writeUInt32BE(s.hi32,r),i.writeUInt32BE(s.lo32,r+4),8}}O.NearUInt64BE=G0;class Y0 extends Me{constructor(e){super(8,e)}decode(e,t=0){const r=Ie(e),s=r.readUInt32LE(t),i=r.readInt32LE(t+4);return Eo(i,s)}encode(e,t,r=0){const s=Ao(e),i=Ie(t);return i.writeUInt32LE(s.lo32,r),i.writeInt32LE(s.hi32,r+4),8}}O.NearInt64=Y0;class X0 extends Me{constructor(e){super(8,e)}decode(e,t=0){const r=Ie(e),s=r.readInt32BE(t),i=r.readUInt32BE(t+4);return Eo(s,i)}encode(e,t,r=0){const s=Ao(e),i=Ie(t);return i.writeInt32BE(s.hi32,r),i.writeUInt32BE(s.lo32,r+4),8}}O.NearInt64BE=X0;class Z0 extends Me{constructor(e){super(4,e)}decode(e,t=0){return Ie(e).readFloatLE(t)}encode(e,t,r=0){return Ie(t).writeFloatLE(e,r),4}}O.Float=Z0;class J0 extends Me{constructor(e){super(4,e)}decode(e,t=0){return Ie(e).readFloatBE(t)}encode(e,t,r=0){return Ie(t).writeFloatBE(e,r),4}}O.FloatBE=J0;class Q0 extends Me{constructor(e){super(8,e)}decode(e,t=0){return Ie(e).readDoubleLE(t)}encode(e,t,r=0){return Ie(t).writeDoubleLE(e,r),8}}O.Double=Q0;class eh extends Me{constructor(e){super(8,e)}decode(e,t=0){return Ie(e).readDoubleBE(t)}encode(e,t,r=0){return Ie(t).writeDoubleBE(e,r),8}}O.DoubleBE=eh;class th extends Me{constructor(e,t,r){if(!(e instanceof Me))throw new TypeError("elementLayout must be a Layout");if(!(t instanceof Yt&&t.isCount()||Number.isInteger(t)&&0<=t))throw new TypeError("count must be non-negative integer or an unsigned integer ExternalLayout");let s=-1;!(t instanceof Yt)&&0<e.span&&(s=t*e.span),super(s,r),this.elementLayout=e,this.count=t}getSpan(e,t=0){if(0<=this.span)return this.span;let r=0,s=this.count;if(s instanceof Yt&&(s=s.decode(e,t)),0<this.elementLayout.span)r=s*this.elementLayout.span;else{let i=0;for(;i<s;)r+=this.elementLayout.getSpan(e,t+r),++i}return r}decode(e,t=0){const r=[];let s=0,i=this.count;for(i instanceof Yt&&(i=i.decode(e,t));s<i;)r.push(this.elementLayout.decode(e,t)),t+=this.elementLayout.getSpan(e,t),s+=1;return r}encode(e,t,r=0){const s=this.elementLayout,i=e.reduce((o,a)=>o+s.encode(a,t,r+o),0);return this.count instanceof Yt&&this.count.encode(e.length,t,r),i}}O.Sequence=th;class nh extends Me{constructor(e,t,r){if(!(Array.isArray(e)&&e.reduce((i,o)=>i&&o instanceof Me,!0)))throw new TypeError("fields must be array of Layout instances");typeof t=="boolean"&&r===void 0&&(r=t,t=void 0);for(const i of e)if(0>i.span&&i.property===void 0)throw new Error("fields cannot contain unnamed variable-length layout");let s=-1;try{s=e.reduce((i,o)=>i+o.getSpan(),0)}catch{}super(s,t),this.fields=e,this.decodePrefixes=!!r}getSpan(e,t=0){if(0<=this.span)return this.span;let r=0;try{r=this.fields.reduce((s,i)=>{const o=i.getSpan(e,t);return t+=o,s+o},0)}catch{throw new RangeError("indeterminate span")}return r}decode(e,t=0){ds(e);const r=this.makeDestinationObject();for(const s of this.fields)if(s.property!==void 0&&(r[s.property]=s.decode(e,t)),t+=s.getSpan(e,t),this.decodePrefixes&&e.length===t)break;return r}encode(e,t,r=0){const s=r;let i=0,o=0;for(const a of this.fields){let l=a.span;if(o=0<l?l:0,a.property!==void 0){const h=e[a.property];h!==void 0&&(o=a.encode(h,t,r),0>l&&(l=a.getSpan(t,r)))}i=r,r+=l}return i+o-s}fromArray(e){const t=this.makeDestinationObject();for(const r of this.fields)r.property!==void 0&&0<e.length&&(t[r.property]=e.shift());return t}layoutFor(e){if(typeof e!="string")throw new TypeError("property must be string");for(const t of this.fields)if(t.property===e)return t}offsetOf(e){if(typeof e!="string")throw new TypeError("property must be string");let t=0;for(const r of this.fields){if(r.property===e)return t;0>r.span?t=-1:0<=t&&(t+=r.span)}}}O.Structure=nh;class hl{constructor(e){this.property=e}decode(e,t){throw new Error("UnionDiscriminator is abstract")}encode(e,t,r){throw new Error("UnionDiscriminator is abstract")}}O.UnionDiscriminator=hl;class Ki extends hl{constructor(e,t){if(!(e instanceof Yt&&e.isCount()))throw new TypeError("layout must be an unsigned integer ExternalLayout");super(t||e.property||"variant"),this.layout=e}decode(e,t){return this.layout.decode(e,t)}encode(e,t,r){return this.layout.encode(e,t,r)}}O.UnionLayoutDiscriminator=Ki;class ml extends Me{constructor(e,t,r){let s;if(e instanceof on||e instanceof un)s=new Ki(new fl(e));else if(e instanceof Yt&&e.isCount())s=new Ki(e);else if(e instanceof hl)s=e;else throw new TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");if(t===void 0&&(t=null),!(t===null||t instanceof Me))throw new TypeError("defaultLayout must be null or a Layout");if(t!==null){if(0>t.span)throw new Error("defaultLayout must have constant span");t.property===void 0&&(t=t.replicate("content"))}let i=-1;t&&(i=t.span,0<=i&&(e instanceof on||e instanceof un)&&(i+=s.layout.span)),super(i,r),this.discriminator=s,this.usesPrefixDiscriminator=e instanceof on||e instanceof un,this.defaultLayout=t,this.registry={};let o=this.defaultGetSourceVariant.bind(this);this.getSourceVariant=function(a){return o(a)},this.configGetSourceVariant=function(a){o=a.bind(this)}}getSpan(e,t=0){if(0<=this.span)return this.span;const r=this.getVariant(e,t);if(!r)throw new Error("unable to determine span for unrecognized variant");return r.getSpan(e,t)}defaultGetSourceVariant(e){if(Object.prototype.hasOwnProperty.call(e,this.discriminator.property)){if(this.defaultLayout&&this.defaultLayout.property&&Object.prototype.hasOwnProperty.call(e,this.defaultLayout.property))return;const t=this.registry[e[this.discriminator.property]];if(t&&(!t.layout||t.property&&Object.prototype.hasOwnProperty.call(e,t.property)))return t}else for(const t in this.registry){const r=this.registry[t];if(r.property&&Object.prototype.hasOwnProperty.call(e,r.property))return r}throw new Error("unable to infer src variant")}decode(e,t=0){let r;const s=this.discriminator,i=s.decode(e,t),o=this.registry[i];if(o===void 0){const a=this.defaultLayout;let l=0;this.usesPrefixDiscriminator&&(l=s.layout.span),r=this.makeDestinationObject(),r[s.property]=i,r[a.property]=a.decode(e,t+l)}else r=o.decode(e,t);return r}encode(e,t,r=0){const s=this.getSourceVariant(e);if(s===void 0){const i=this.discriminator,o=this.defaultLayout;let a=0;return this.usesPrefixDiscriminator&&(a=i.layout.span),i.encode(e[i.property],t,r),a+o.encode(e[o.property],t,r+a)}return s.encode(e,t,r)}addVariant(e,t,r){const s=new rh(this,e,t,r);return this.registry[e]=s,s}getVariant(e,t=0){let r;return e instanceof Uint8Array?r=this.discriminator.decode(e,t):r=e,this.registry[r]}}O.Union=ml;class rh extends Me{constructor(e,t,r,s){if(!(e instanceof ml))throw new TypeError("union must be a Union");if(!Number.isInteger(t)||0>t)throw new TypeError("variant must be a (non-negative) integer");if(typeof r=="string"&&s===void 0&&(s=r,r=null),r){if(!(r instanceof Me))throw new TypeError("layout must be a Layout");if(e.defaultLayout!==null&&0<=r.span&&r.span>e.defaultLayout.span)throw new Error("variant span exceeds span of containing union");if(typeof s!="string")throw new TypeError("variant must have a String property")}let i=e.span;0>e.span&&(i=r?r.span:0,0<=i&&e.usesPrefixDiscriminator&&(i+=e.discriminator.layout.span)),super(i,s),this.union=e,this.variant=t,this.layout=r||null}getSpan(e,t=0){if(0<=this.span)return this.span;let r=0;this.union.usesPrefixDiscriminator&&(r=this.union.discriminator.layout.span);let s=0;return this.layout&&(s=this.layout.getSpan(e,t+r)),r+s}decode(e,t=0){const r=this.makeDestinationObject();if(this!==this.union.getVariant(e,t))throw new Error("variant mismatch");let s=0;return this.union.usesPrefixDiscriminator&&(s=this.union.discriminator.layout.span),this.layout?r[this.property]=this.layout.decode(e,t+s):this.property?r[this.property]=!0:this.union.usesPrefixDiscriminator&&(r[this.union.discriminator.property]=this.variant),r}encode(e,t,r=0){let s=0;if(this.union.usesPrefixDiscriminator&&(s=this.union.discriminator.layout.span),this.layout&&!Object.prototype.hasOwnProperty.call(e,this.property))throw new TypeError("variant lacks property "+this.property);this.union.discriminator.encode(this.variant,t,r);let i=s;if(this.layout&&(this.layout.encode(e[this.property],t,r+s),i+=this.layout.getSpan(t,r+s),0<=this.union.span&&i>this.union.span))throw new Error("encoded variant overruns containing union");return i}fromArray(e){if(this.layout)return this.layout.fromArray(e)}}O.VariantLayout=rh;function Lr(n){return 0>n&&(n+=4294967296),n}class bl extends Me{constructor(e,t,r){if(!(e instanceof on||e instanceof un))throw new TypeError("word must be a UInt or UIntBE layout");if(typeof t=="string"&&r===void 0&&(r=t,t=!1),4<e.span)throw new RangeError("word cannot exceed 32 bits");super(e.span,r),this.word=e,this.msb=!!t,this.fields=[];let s=0;this._packedSetValue=function(i){return s=Lr(i),this},this._packedGetValue=function(){return s}}decode(e,t=0){const r=this.makeDestinationObject(),s=this.word.decode(e,t);this._packedSetValue(s);for(const i of this.fields)i.property!==void 0&&(r[i.property]=i.decode(e));return r}encode(e,t,r=0){const s=this.word.decode(t,r);this._packedSetValue(s);for(const i of this.fields)if(i.property!==void 0){const o=e[i.property];o!==void 0&&i.encode(o)}return this.word.encode(this._packedGetValue(),t,r)}addField(e,t){const r=new pl(this,e,t);return this.fields.push(r),r}addBoolean(e){const t=new sh(this,e);return this.fields.push(t),t}fieldFor(e){if(typeof e!="string")throw new TypeError("property must be string");for(const t of this.fields)if(t.property===e)return t}}O.BitStructure=bl;class pl{constructor(e,t,r){if(!(e instanceof bl))throw new TypeError("container must be a BitStructure");if(!Number.isInteger(t)||0>=t)throw new TypeError("bits must be positive integer");const s=8*e.span,i=e.fields.reduce((o,a)=>o+a.bits,0);if(t+i>s)throw new Error("bits too long for span remainder ("+(s-i)+" of "+s+" remain)");this.container=e,this.bits=t,this.valueMask=(1<<t)-1,t===32&&(this.valueMask=4294967295),this.start=i,this.container.msb&&(this.start=s-i-t),this.wordMask=Lr(this.valueMask<<this.start),this.property=r}decode(e,t){const r=this.container._packedGetValue();return Lr(r&this.wordMask)>>>this.start}encode(e){if(typeof e!="number"||!Number.isInteger(e)||e!==Lr(e&this.valueMask))throw new TypeError(ul("BitField.encode",this)+" value must be integer not exceeding "+this.valueMask);const t=this.container._packedGetValue(),r=Lr(e<<this.start);this.container._packedSetValue(Lr(t&~this.wordMask)|r)}}O.BitField=pl;let sh=class extends pl{constructor(e,t){super(e,1,t)}decode(e,t){return!!super.decode(e,t)}encode(e){typeof e=="boolean"&&(e=+e),super.encode(e)}};O.Boolean=sh;let ih=class extends Me{constructor(e,t){if(!(e instanceof Yt&&e.isCount()||Number.isInteger(e)&&0<=e))throw new TypeError("length must be positive integer or an unsigned integer ExternalLayout");let r=-1;e instanceof Yt||(r=e),super(r,t),this.length=e}getSpan(e,t){let r=this.span;return 0>r&&(r=this.length.decode(e,t)),r}decode(e,t=0){let r=this.span;return 0>r&&(r=this.length.decode(e,t)),Ie(e).slice(t,t+r)}encode(e,t,r){let s=this.length;if(this.length instanceof Yt&&(s=e.length),!(e instanceof Uint8Array&&s===e.length))throw new TypeError(ul("Blob.encode",this)+" requires (length "+s+") Uint8Array as src");if(r+s>t.length)throw new RangeError("encoding overruns Uint8Array");const i=Ie(e);return Ie(t).write(i.toString("hex"),r,s,"hex"),this.length instanceof Yt&&this.length.encode(s,t,r),s}};O.Blob=ih;class oh extends Me{constructor(e){super(-1,e)}getSpan(e,t=0){ds(e);let r=t;for(;r<e.length&&e[r]!==0;)r+=1;return 1+r-t}decode(e,t=0){const r=this.getSpan(e,t);return Ie(e).slice(t,t+r-1).toString("utf-8")}encode(e,t,r=0){typeof e!="string"&&(e=String(e));const s=dl.Buffer.from(e,"utf8"),i=s.length;if(r+i>t.length)throw new RangeError("encoding overruns Buffer");const o=Ie(t);return s.copy(o,r),o[r+i]=0,i+1}}O.CString=oh;class ah extends Me{constructor(e,t){if(typeof e=="string"&&t===void 0&&(t=e,e=void 0),e===void 0)e=-1;else if(!Number.isInteger(e))throw new TypeError("maxSpan must be an integer");super(-1,t),this.maxSpan=e}getSpan(e,t=0){return ds(e),e.length-t}decode(e,t=0){const r=this.getSpan(e,t);if(0<=this.maxSpan&&this.maxSpan<r)throw new RangeError("text length exceeds maxSpan");return Ie(e).slice(t,t+r).toString("utf-8")}encode(e,t,r=0){typeof e!="string"&&(e=String(e));const s=dl.Buffer.from(e,"utf8"),i=s.length;if(0<=this.maxSpan&&this.maxSpan<i)throw new RangeError("text length exceeds maxSpan");if(r+i>t.length)throw new RangeError("encoding overruns Buffer");return s.copy(Ie(t),r),i}}O.UTF8=ah;class ch extends Me{constructor(e,t){super(0,t),this.value=e}decode(e,t){return this.value}encode(e,t,r){return 0}}O.Constant=ch;exports.greedy=O.greedy=(n,e)=>new $0(n,e);var Qn=O.offset=(n,e,t)=>new fl(n,e,t);exports.u8=O.u8=n=>new on(1,n);exports.u16=O.u16=n=>new on(2,n);O.u24=n=>new on(3,n);exports.u32=O.u32=n=>new on(4,n);O.u40=n=>new on(5,n);O.u48=n=>new on(6,n);var It=O.nu64=n=>new V0(n);O.u16be=n=>new un(2,n);O.u24be=n=>new un(3,n);O.u32be=n=>new un(4,n);O.u40be=n=>new un(5,n);O.u48be=n=>new un(6,n);O.nu64be=n=>new G0(n);O.s8=n=>new Tr(1,n);exports.s16=O.s16=n=>new Tr(2,n);O.s24=n=>new Tr(3,n);O.s32=n=>new Tr(4,n);O.s40=n=>new Tr(5,n);O.s48=n=>new Tr(6,n);exports.ns64=O.ns64=n=>new Y0(n);O.s16be=n=>new us(2,n);O.s24be=n=>new us(3,n);O.s32be=n=>new us(4,n);O.s40be=n=>new us(5,n);O.s48be=n=>new us(6,n);O.ns64be=n=>new X0(n);O.f32=n=>new Z0(n);O.f32be=n=>new J0(n);O.f64=n=>new Q0(n);O.f64be=n=>new eh(n);exports.struct=O.struct=(n,e,t)=>new nh(n,e,t);O.bits=(n,e,t)=>new bl(n,e,t);exports.seq=O.seq=(n,e,t)=>new th(n,e,t);O.union=(n,e,t)=>new ml(n,e,t);O.unionLayoutDiscriminator=(n,e)=>new Ki(n,e);exports.blob=O.blob=(n,e)=>new ih(n,e);O.cstr=n=>new oh(n);O.utf8=(n,e)=>new ah(n,e);O.constant=(n,e)=>new ch(n,e);var ei={};Object.defineProperty(ei,"__esModule",{value:!0});function x8(n){{const e=Ve.Buffer.from(n);e.reverse();const t=e.toString("hex");return t.length===0?BigInt(0):BigInt(`0x${t}`)}}var lh=ei.toBigIntLE=x8;function C8(n){{const e=n.toString("hex");return e.length===0?BigInt(0):BigInt(`0x${e}`)}}ei.toBigIntBE=C8;function S8(n,e){{const t=n.toString(16),r=Ve.Buffer.from(t.padStart(e*2,"0").slice(0,e*2),"hex");return r.reverse(),r}}var gl=ei.toBufferLE=S8;function D8(n,e){{const t=n.toString(16);return Ve.Buffer.from(t.padStart(e*2,"0").slice(0,e*2),"hex")}}ei.toBufferBE=D8;class v8 extends TypeError{constructor(e,t){let r;const{message:s,explanation:i,...o}=e,{path:a}=e,l=a.length===0?s:`At path: ${a.join(".")} -- ${s}`;super(i??l),i!=null&&(this.cause=l),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>r??(r=[e,...t()])}}function k8(n){return ti(n)&&typeof n[Symbol.iterator]=="function"}function ti(n){return typeof n=="object"&&n!=null}function ji(n){return ti(n)&&!Array.isArray(n)}function fn(n){return typeof n=="symbol"?n.toString():typeof n=="string"?JSON.stringify(n):`${n}`}function F8(n){const{done:e,value:t}=n.next();return e?void 0:t}function T8(n,e,t,r){if(n===!0)return;n===!1?n={}:typeof n=="string"&&(n={message:n});const{path:s,branch:i}=e,{type:o}=t,{refinement:a,message:l=`Expected a value of type \`${o}\`${a?` with refinement \`${a}\``:""}, but received: \`${fn(r)}\``}=n;return{value:r,type:o,refinement:a,key:s[s.length-1],path:s,branch:i,...n,message:l}}function*Xd(n,e,t,r){k8(n)||(n=[n]);for(const s of n){const i=T8(s,e,t,r);i&&(yield i)}}function*yl(n,e,t={}){const{path:r=[],branch:s=[n],coerce:i=!1,mask:o=!1}=t,a={path:r,branch:s,mask:o};i&&(n=e.coercer(n,a));let l="valid";for(const h of e.validator(n,a))h.explanation=t.message,l="not_valid",yield[h,void 0];for(let[h,m,E]of e.entries(n,a)){const S=yl(m,E,{path:h===void 0?r:[...r,h],branch:h===void 0?s:[...s,m],coerce:i,mask:o,message:t.message});for(const A of S)A[0]?(l=A[0].refinement!=null?"not_refined":"not_valid",yield[A[0],void 0]):i&&(m=A[1],h===void 0?n=m:n instanceof Map?n.set(h,m):n instanceof Set?n.add(m):ti(n)&&(m!==void 0||h in n)&&(n[h]=m))}if(l!=="not_valid")for(const h of e.refiner(n,a))h.explanation=t.message,l="not_refined",yield[h,void 0];l==="valid"&&(yield[void 0,n])}let Un=class{constructor(e){const{type:t,schema:r,validator:s,refiner:i,coercer:o=l=>l,entries:a=function*(){}}=e;this.type=t,this.schema=r,this.entries=a,this.coercer=o,s?this.validator=(l,h)=>{const m=s(l,h);return Xd(m,h,this,l)}:this.validator=()=>[],i?this.refiner=(l,h)=>{const m=i(l,h);return Xd(m,h,this,l)}:this.refiner=()=>[]}assert(e,t){return dh(e,this,t)}create(e,t){return J(e,this,t)}is(e){return uh(e,this)}mask(e,t){return I8(e,this,t)}validate(e,t={}){return ni(e,this,t)}};function dh(n,e,t){const r=ni(n,e,{message:t});if(r[0])throw r[0]}function J(n,e,t){const r=ni(n,e,{coerce:!0,message:t});if(r[0])throw r[0];return r[1]}function I8(n,e,t){const r=ni(n,e,{coerce:!0,mask:!0,message:t});if(r[0])throw r[0];return r[1]}function uh(n,e){return!ni(n,e)[0]}function ni(n,e,t={}){const r=yl(n,e,t),s=F8(r);return s[0]?[new v8(s[0],function*(){for(const o of r)o[0]&&(yield o[0])}),void 0]:[void 0,s[1]]}function Ir(n,e){return new Un({type:n,schema:null,validator:e})}function U8(){return Ir("any",()=>!0)}function Q(n){return new Un({type:"array",schema:n,*entries(e){if(n&&Array.isArray(e))for(const[t,r]of e.entries())yield[t,r,n]},coercer(e){return Array.isArray(e)?e.slice():e},validator(e){return Array.isArray(e)||`Expected an array value, but received: ${fn(e)}`}})}function kn(){return Ir("boolean",n=>typeof n=="boolean")}function wl(n){return Ir("instance",e=>e instanceof n||`Expected a \`${n.name}\` instance, but received: ${fn(e)}`)}function Ge(n){const e=fn(n),t=typeof n;return new Un({type:"literal",schema:t==="string"||t==="number"||t==="boolean"?n:null,validator(r){return r===n||`Expected the literal \`${e}\`, but received: ${fn(r)}`}})}function _8(){return Ir("never",()=>!1)}function te(n){return new Un({...n,validator:(e,t)=>e===null||n.validator(e,t),refiner:(e,t)=>e===null||n.refiner(e,t)})}function L(){return Ir("number",n=>typeof n=="number"&&!isNaN(n)||`Expected a number, but received: ${fn(n)}`)}function ce(n){return new Un({...n,validator:(e,t)=>e===void 0||n.validator(e,t),refiner:(e,t)=>e===void 0||n.refiner(e,t)})}function fh(n,e){return new Un({type:"record",schema:null,*entries(t){if(ti(t))for(const r in t){const s=t[r];yield[r,r,n],yield[r,s,e]}},validator(t){return ji(t)||`Expected an object, but received: ${fn(t)}`},coercer(t){return ji(t)?{...t}:t}})}function X(){return Ir("string",n=>typeof n=="string"||`Expected a string, but received: ${fn(n)}`)}function Al(n){const e=_8();return new Un({type:"tuple",schema:null,*entries(t){if(Array.isArray(t)){const r=Math.max(n.length,t.length);for(let s=0;s<r;s++)yield[s,t[s],n[s]||e]}},validator(t){return Array.isArray(t)||`Expected an array, but received: ${fn(t)}`},coercer(t){return Array.isArray(t)?t.slice():t}})}function j(n){const e=Object.keys(n);return new Un({type:"type",schema:n,*entries(t){if(ti(t))for(const r of e)yield[r,t[r],n[r]]},validator(t){return ji(t)||`Expected an object, but received: ${fn(t)}`},coercer(t){return ji(t)?{...t}:t}})}function Kt(n){const e=n.map(t=>t.type).join(" | ");return new Un({type:"union",schema:null,coercer(t,r){for(const s of n){const[i,o]=s.validate(t,{coerce:!0,mask:r.mask});if(!i)return o}return t},validator(t,r){const s=[];for(const i of n){const[...o]=yl(t,i,r),[a]=o;if(a[0])for(const[l]of o)l&&s.push(l);else return[]}return[`Expected the value to satisfy a union of \`${e}\`, but received: ${fn(t)}`,...s]}})}function fs(){return Ir("unknown",()=>!0)}function ri(n,e,t){return new Un({...n,coercer:(r,s)=>uh(r,e)?n.coercer(t(r,s),s):n.coercer(r,s)})}var fi,M8=new Uint8Array(16);function hh(){if(!fi&&(fi=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!fi))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return fi(M8)}const R8=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function Bo(n){return typeof n=="string"&&R8.test(n)}var Tt=[];for(var Aa=0;Aa<256;++Aa)Tt.push((Aa+256).toString(16).substr(1));function xo(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t=(Tt[n[e+0]]+Tt[n[e+1]]+Tt[n[e+2]]+Tt[n[e+3]]+"-"+Tt[n[e+4]]+Tt[n[e+5]]+"-"+Tt[n[e+6]]+Tt[n[e+7]]+"-"+Tt[n[e+8]]+Tt[n[e+9]]+"-"+Tt[n[e+10]]+Tt[n[e+11]]+Tt[n[e+12]]+Tt[n[e+13]]+Tt[n[e+14]]+Tt[n[e+15]]).toLowerCase();if(!Bo(t))throw TypeError("Stringified UUID is invalid");return t}var Zd,Ea,Ba=0,xa=0;function W8(n,e,t){var r=e&&t||0,s=e||new Array(16);n=n||{};var i=n.node||Zd,o=n.clockseq!==void 0?n.clockseq:Ea;if(i==null||o==null){var a=n.random||(n.rng||hh)();i==null&&(i=Zd=[a[0]|1,a[1],a[2],a[3],a[4],a[5]]),o==null&&(o=Ea=(a[6]<<8|a[7])&16383)}var l=n.msecs!==void 0?n.msecs:Date.now(),h=n.nsecs!==void 0?n.nsecs:xa+1,m=l-Ba+(h-xa)/1e4;if(m<0&&n.clockseq===void 0&&(o=o+1&16383),(m<0||l>Ba)&&n.nsecs===void 0&&(h=0),h>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");Ba=l,xa=h,Ea=o,l+=122192928e5;var E=((l&268435455)*1e4+h)%4294967296;s[r++]=E>>>24&255,s[r++]=E>>>16&255,s[r++]=E>>>8&255,s[r++]=E&255;var S=l/4294967296*1e4&268435455;s[r++]=S>>>8&255,s[r++]=S&255,s[r++]=S>>>24&15|16,s[r++]=S>>>16&255,s[r++]=o>>>8|128,s[r++]=o&255;for(var A=0;A<6;++A)s[r+A]=i[A];return e||xo(s)}function mh(n){if(!Bo(n))throw TypeError("Invalid UUID");var e,t=new Uint8Array(16);return t[0]=(e=parseInt(n.slice(0,8),16))>>>24,t[1]=e>>>16&255,t[2]=e>>>8&255,t[3]=e&255,t[4]=(e=parseInt(n.slice(9,13),16))>>>8,t[5]=e&255,t[6]=(e=parseInt(n.slice(14,18),16))>>>8,t[7]=e&255,t[8]=(e=parseInt(n.slice(19,23),16))>>>8,t[9]=e&255,t[10]=(e=parseInt(n.slice(24,36),16))/1099511627776&255,t[11]=e/4294967296&255,t[12]=e>>>24&255,t[13]=e>>>16&255,t[14]=e>>>8&255,t[15]=e&255,t}function P8(n){n=unescape(encodeURIComponent(n));for(var e=[],t=0;t<n.length;++t)e.push(n.charCodeAt(t));return e}var L8="6ba7b810-9dad-11d1-80b4-00c04fd430c8",O8="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function bh(n,e,t){function r(s,i,o,a){if(typeof s=="string"&&(s=P8(s)),typeof i=="string"&&(i=mh(i)),i.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var l=new Uint8Array(16+s.length);if(l.set(i),l.set(s,i.length),l=t(l),l[6]=l[6]&15|e,l[8]=l[8]&63|128,o){a=a||0;for(var h=0;h<16;++h)o[a+h]=l[h];return o}return xo(l)}try{r.name=n}catch{}return r.DNS=L8,r.URL=O8,r}function N8(n){if(typeof n=="string"){var e=unescape(encodeURIComponent(n));n=new Uint8Array(e.length);for(var t=0;t<e.length;++t)n[t]=e.charCodeAt(t)}return z8(H8(q8(n),n.length*8))}function z8(n){for(var e=[],t=n.length*32,r="0123456789abcdef",s=0;s<t;s+=8){var i=n[s>>5]>>>s%32&255,o=parseInt(r.charAt(i>>>4&15)+r.charAt(i&15),16);e.push(o)}return e}function ph(n){return(n+64>>>9<<4)+14+1}function H8(n,e){n[e>>5]|=128<<e%32,n[ph(e)-1]=e;for(var t=1732584193,r=-271733879,s=-1732584194,i=271733878,o=0;o<n.length;o+=16){var a=t,l=r,h=s,m=i;t=Rt(t,r,s,i,n[o],7,-680876936),i=Rt(i,t,r,s,n[o+1],12,-389564586),s=Rt(s,i,t,r,n[o+2],17,606105819),r=Rt(r,s,i,t,n[o+3],22,-1044525330),t=Rt(t,r,s,i,n[o+4],7,-176418897),i=Rt(i,t,r,s,n[o+5],12,1200080426),s=Rt(s,i,t,r,n[o+6],17,-1473231341),r=Rt(r,s,i,t,n[o+7],22,-45705983),t=Rt(t,r,s,i,n[o+8],7,1770035416),i=Rt(i,t,r,s,n[o+9],12,-1958414417),s=Rt(s,i,t,r,n[o+10],17,-42063),r=Rt(r,s,i,t,n[o+11],22,-1990404162),t=Rt(t,r,s,i,n[o+12],7,1804603682),i=Rt(i,t,r,s,n[o+13],12,-40341101),s=Rt(s,i,t,r,n[o+14],17,-1502002290),r=Rt(r,s,i,t,n[o+15],22,1236535329),t=Wt(t,r,s,i,n[o+1],5,-165796510),i=Wt(i,t,r,s,n[o+6],9,-1069501632),s=Wt(s,i,t,r,n[o+11],14,643717713),r=Wt(r,s,i,t,n[o],20,-373897302),t=Wt(t,r,s,i,n[o+5],5,-701558691),i=Wt(i,t,r,s,n[o+10],9,38016083),s=Wt(s,i,t,r,n[o+15],14,-660478335),r=Wt(r,s,i,t,n[o+4],20,-405537848),t=Wt(t,r,s,i,n[o+9],5,568446438),i=Wt(i,t,r,s,n[o+14],9,-1019803690),s=Wt(s,i,t,r,n[o+3],14,-187363961),r=Wt(r,s,i,t,n[o+8],20,1163531501),t=Wt(t,r,s,i,n[o+13],5,-1444681467),i=Wt(i,t,r,s,n[o+2],9,-51403784),s=Wt(s,i,t,r,n[o+7],14,1735328473),r=Wt(r,s,i,t,n[o+12],20,-1926607734),t=Pt(t,r,s,i,n[o+5],4,-378558),i=Pt(i,t,r,s,n[o+8],11,-2022574463),s=Pt(s,i,t,r,n[o+11],16,1839030562),r=Pt(r,s,i,t,n[o+14],23,-35309556),t=Pt(t,r,s,i,n[o+1],4,-1530992060),i=Pt(i,t,r,s,n[o+4],11,1272893353),s=Pt(s,i,t,r,n[o+7],16,-155497632),r=Pt(r,s,i,t,n[o+10],23,-1094730640),t=Pt(t,r,s,i,n[o+13],4,681279174),i=Pt(i,t,r,s,n[o],11,-358537222),s=Pt(s,i,t,r,n[o+3],16,-722521979),r=Pt(r,s,i,t,n[o+6],23,76029189),t=Pt(t,r,s,i,n[o+9],4,-640364487),i=Pt(i,t,r,s,n[o+12],11,-421815835),s=Pt(s,i,t,r,n[o+15],16,530742520),r=Pt(r,s,i,t,n[o+2],23,-995338651),t=Lt(t,r,s,i,n[o],6,-198630844),i=Lt(i,t,r,s,n[o+7],10,1126891415),s=Lt(s,i,t,r,n[o+14],15,-1416354905),r=Lt(r,s,i,t,n[o+5],21,-57434055),t=Lt(t,r,s,i,n[o+12],6,1700485571),i=Lt(i,t,r,s,n[o+3],10,-1894986606),s=Lt(s,i,t,r,n[o+10],15,-1051523),r=Lt(r,s,i,t,n[o+1],21,-2054922799),t=Lt(t,r,s,i,n[o+8],6,1873313359),i=Lt(i,t,r,s,n[o+15],10,-30611744),s=Lt(s,i,t,r,n[o+6],15,-1560198380),r=Lt(r,s,i,t,n[o+13],21,1309151649),t=Lt(t,r,s,i,n[o+4],6,-145523070),i=Lt(i,t,r,s,n[o+11],10,-1120210379),s=Lt(s,i,t,r,n[o+2],15,718787259),r=Lt(r,s,i,t,n[o+9],21,-343485551),t=Jn(t,a),r=Jn(r,l),s=Jn(s,h),i=Jn(i,m)}return[t,r,s,i]}function q8(n){if(n.length===0)return[];for(var e=n.length*8,t=new Uint32Array(ph(e)),r=0;r<e;r+=8)t[r>>5]|=(n[r/8]&255)<<r%32;return t}function Jn(n,e){var t=(n&65535)+(e&65535),r=(n>>16)+(e>>16)+(t>>16);return r<<16|t&65535}function K8(n,e){return n<<e|n>>>32-e}function Co(n,e,t,r,s,i){return Jn(K8(Jn(Jn(e,n),Jn(r,i)),s),t)}function Rt(n,e,t,r,s,i,o){return Co(e&t|~e&r,n,e,s,i,o)}function Wt(n,e,t,r,s,i,o){return Co(e&r|t&~r,n,e,s,i,o)}function Pt(n,e,t,r,s,i,o){return Co(e^t^r,n,e,s,i,o)}function Lt(n,e,t,r,s,i,o){return Co(t^(e|~r),n,e,s,i,o)}var j8=bh("v3",48,N8);function $8(n,e,t){n=n||{};var r=n.random||(n.rng||hh)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,e){t=t||0;for(var s=0;s<16;++s)e[t+s]=r[s];return e}return xo(r)}function V8(n,e,t,r){switch(n){case 0:return e&t^~e&r;case 1:return e^t^r;case 2:return e&t^e&r^t&r;case 3:return e^t^r}}function Ca(n,e){return n<<e|n>>>32-e}function G8(n){var e=[1518500249,1859775393,2400959708,3395469782],t=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof n=="string"){var r=unescape(encodeURIComponent(n));n=[];for(var s=0;s<r.length;++s)n.push(r.charCodeAt(s))}else Array.isArray(n)||(n=Array.prototype.slice.call(n));n.push(128);for(var i=n.length/4+2,o=Math.ceil(i/16),a=new Array(o),l=0;l<o;++l){for(var h=new Uint32Array(16),m=0;m<16;++m)h[m]=n[l*64+m*4]<<24|n[l*64+m*4+1]<<16|n[l*64+m*4+2]<<8|n[l*64+m*4+3];a[l]=h}a[o-1][14]=(n.length-1)*8/Math.pow(2,32),a[o-1][14]=Math.floor(a[o-1][14]),a[o-1][15]=(n.length-1)*8&4294967295;for(var E=0;E<o;++E){for(var S=new Uint32Array(80),A=0;A<16;++A)S[A]=a[E][A];for(var g=16;g<80;++g)S[g]=Ca(S[g-3]^S[g-8]^S[g-14]^S[g-16],1);for(var D=t[0],x=t[1],U=t[2],R=t[3],F=t[4],W=0;W<80;++W){var z=Math.floor(W/20),H=Ca(D,5)+V8(z,x,U,R)+F+e[z]+S[W]>>>0;F=R,R=U,U=Ca(x,30)>>>0,x=D,D=H}t[0]=t[0]+D>>>0,t[1]=t[1]+x>>>0,t[2]=t[2]+U>>>0,t[3]=t[3]+R>>>0,t[4]=t[4]+F>>>0}return[t[0]>>24&255,t[0]>>16&255,t[0]>>8&255,t[0]&255,t[1]>>24&255,t[1]>>16&255,t[1]>>8&255,t[1]&255,t[2]>>24&255,t[2]>>16&255,t[2]>>8&255,t[2]&255,t[3]>>24&255,t[3]>>16&255,t[3]>>8&255,t[3]&255,t[4]>>24&255,t[4]>>16&255,t[4]>>8&255,t[4]&255]}var Y8=bh("v5",80,G8);const X8="00000000-0000-0000-0000-000000000000";function Z8(n){if(!Bo(n))throw TypeError("Invalid UUID");return parseInt(n.substr(14,1),16)}const J8=Object.freeze(Object.defineProperty({__proto__:null,NIL:X8,parse:mh,stringify:xo,v1:W8,v3:j8,v4:$8,v5:Y8,validate:Bo,version:Z8},Symbol.toStringTag,{value:"Module"})),gh=Ec(J8),Q8=gh.v4,e3=function(n,e,t,r){if(typeof n!="string")throw new TypeError(n+" must be a string");r=r||{};const s=typeof r.version=="number"?r.version:2;if(s!==1&&s!==2)throw new TypeError(s+" must be 1 or 2");const i={method:n};if(s===2&&(i.jsonrpc="2.0"),e){if(typeof e!="object"&&!Array.isArray(e))throw new TypeError(e+" must be an object, array or omitted");i.params=e}if(typeof t>"u"){const o=typeof r.generator=="function"?r.generator:function(){return Q8()};i.id=o(i,r)}else s===2&&t===null?r.notificationIdNull&&(i.id=null):i.id=t;return i};var t3=e3;const n3=gh.v4,r3=t3,Hs=function(n,e){if(!(this instanceof Hs))return new Hs(n,e);e||(e={}),this.options={reviver:typeof e.reviver<"u"?e.reviver:null,replacer:typeof e.replacer<"u"?e.replacer:null,generator:typeof e.generator<"u"?e.generator:function(){return n3()},version:typeof e.version<"u"?e.version:2,notificationIdNull:typeof e.notificationIdNull=="boolean"?e.notificationIdNull:!1},this.callServer=n};var s3=Hs;Hs.prototype.request=function(n,e,t,r){const s=this;let i=null;const o=Array.isArray(n)&&typeof e=="function";if(this.options.version===1&&o)throw new TypeError("JSON-RPC 1.0 does not support batching");if(o||!o&&n&&typeof n=="object"&&typeof e=="function")r=e,i=n;else{typeof t=="function"&&(r=t,t=void 0);const h=typeof r=="function";try{i=r3(n,e,t,{generator:this.options.generator,version:this.options.version,notificationIdNull:this.options.notificationIdNull})}catch(m){if(h)return r(m);throw m}if(!h)return i}let l;try{l=JSON.stringify(i,this.options.replacer)}catch(h){return r(h)}return this.callServer(l,function(h,m){s._parseResponse(h,m,r)}),i};Hs.prototype._parseResponse=function(n,e,t){if(n){t(n);return}if(!e)return t();let r;try{r=JSON.parse(e,this.options.reviver)}catch(s){return t(s)}if(t.length===3)if(Array.isArray(r)){const s=function(o){return typeof o.error<"u"},i=function(o){return!s(o)};return t(null,r.filter(s),r.filter(i))}else return t(null,r.error,r.result);t(null,r)};const yh=$s(s3);var wh={exports:{}};(function(n){var e=Object.prototype.hasOwnProperty,t="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(t=!1));function s(l,h,m){this.fn=l,this.context=h,this.once=m||!1}function i(l,h,m,E,S){if(typeof m!="function")throw new TypeError("The listener must be a function");var A=new s(m,E||l,S),g=t?t+h:h;return l._events[g]?l._events[g].fn?l._events[g]=[l._events[g],A]:l._events[g].push(A):(l._events[g]=A,l._eventsCount++),l}function o(l,h){--l._eventsCount===0?l._events=new r:delete l._events[h]}function a(){this._events=new r,this._eventsCount=0}a.prototype.eventNames=function(){var h=[],m,E;if(this._eventsCount===0)return h;for(E in m=this._events)e.call(m,E)&&h.push(t?E.slice(1):E);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(m)):h},a.prototype.listeners=function(h){var m=t?t+h:h,E=this._events[m];if(!E)return[];if(E.fn)return[E.fn];for(var S=0,A=E.length,g=new Array(A);S<A;S++)g[S]=E[S].fn;return g},a.prototype.listenerCount=function(h){var m=t?t+h:h,E=this._events[m];return E?E.fn?1:E.length:0},a.prototype.emit=function(h,m,E,S,A,g){var D=t?t+h:h;if(!this._events[D])return!1;var x=this._events[D],U=arguments.length,R,F;if(x.fn){switch(x.once&&this.removeListener(h,x.fn,void 0,!0),U){case 1:return x.fn.call(x.context),!0;case 2:return x.fn.call(x.context,m),!0;case 3:return x.fn.call(x.context,m,E),!0;case 4:return x.fn.call(x.context,m,E,S),!0;case 5:return x.fn.call(x.context,m,E,S,A),!0;case 6:return x.fn.call(x.context,m,E,S,A,g),!0}for(F=1,R=new Array(U-1);F<U;F++)R[F-1]=arguments[F];x.fn.apply(x.context,R)}else{var W=x.length,z;for(F=0;F<W;F++)switch(x[F].once&&this.removeListener(h,x[F].fn,void 0,!0),U){case 1:x[F].fn.call(x[F].context);break;case 2:x[F].fn.call(x[F].context,m);break;case 3:x[F].fn.call(x[F].context,m,E);break;case 4:x[F].fn.call(x[F].context,m,E,S);break;default:if(!R)for(z=1,R=new Array(U-1);z<U;z++)R[z-1]=arguments[z];x[F].fn.apply(x[F].context,R)}}return!0},a.prototype.on=function(h,m,E){return i(this,h,m,E,!1)},a.prototype.once=function(h,m,E){return i(this,h,m,E,!0)},a.prototype.removeListener=function(h,m,E,S){var A=t?t+h:h;if(!this._events[A])return this;if(!m)return o(this,A),this;var g=this._events[A];if(g.fn)g.fn===m&&(!S||g.once)&&(!E||g.context===E)&&o(this,A);else{for(var D=0,x=[],U=g.length;D<U;D++)(g[D].fn!==m||S&&!g[D].once||E&&g[D].context!==E)&&x.push(g[D]);x.length?this._events[A]=x.length===1?x[0]:x:o(this,A)}return this},a.prototype.removeAllListeners=function(h){var m;return h?(m=t?t+h:h,this._events[m]&&o(this,m)):(this._events=new r,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=t,a.EventEmitter=a,n.exports=a})(wh);var i3=wh.exports;const El=$s(i3);var o3=class extends El{constructor(e,t,r){super();re(this,"socket");this.socket=new window.WebSocket(e,r),this.socket.onopen=()=>this.emit("open"),this.socket.onmessage=s=>this.emit("message",s.data),this.socket.onerror=s=>this.emit("error",s),this.socket.onclose=s=>{this.emit("close",s.code,s.reason)}}send(e,t,r){const s=r||t;try{this.socket.send(e),s()}catch(i){s(i)}}close(e,t){this.socket.close(e,t)}addEventListener(e,t,r){this.socket.addEventListener(e,t,r)}};function a3(n,e){return new o3(n,e)}var c3=class{encode(n){return JSON.stringify(n)}decode(n){return JSON.parse(n)}},l3=class extends El{constructor(e,t="ws://localhost:8080",{autoconnect:r=!0,reconnect:s=!0,reconnect_interval:i=1e3,max_reconnects:o=5,...a}={},l,h){super();re(this,"address");re(this,"rpc_id");re(this,"queue");re(this,"options");re(this,"autoconnect");re(this,"ready");re(this,"reconnect");re(this,"reconnect_timer_id");re(this,"reconnect_interval");re(this,"max_reconnects");re(this,"rest_options");re(this,"current_reconnects");re(this,"generate_request_id");re(this,"socket");re(this,"webSocketFactory");re(this,"dataPack");this.webSocketFactory=e,this.queue={},this.rpc_id=0,this.address=t,this.autoconnect=r,this.ready=!1,this.reconnect=s,this.reconnect_timer_id=void 0,this.reconnect_interval=i,this.max_reconnects=o,this.rest_options=a,this.current_reconnects=0,this.generate_request_id=l||(()=>++this.rpc_id),h?this.dataPack=h:this.dataPack=new c3,this.autoconnect&&this._connect(this.address,{autoconnect:this.autoconnect,reconnect:this.reconnect,reconnect_interval:this.reconnect_interval,max_reconnects:this.max_reconnects,...this.rest_options})}connect(){this.socket||this._connect(this.address,{autoconnect:this.autoconnect,reconnect:this.reconnect,reconnect_interval:this.reconnect_interval,max_reconnects:this.max_reconnects,...this.rest_options})}call(e,t,r,s){return!s&&typeof r=="object"&&(s=r,r=null),new Promise((i,o)=>{if(!this.ready)return o(new Error("socket not ready"));const a=this.generate_request_id(e,t),l={jsonrpc:"2.0",method:e,params:t||void 0,id:a};this.socket.send(this.dataPack.encode(l),s,h=>{if(h)return o(h);this.queue[a]={promise:[i,o]},r&&(this.queue[a].timeout=setTimeout(()=>{delete this.queue[a],o(new Error("reply timeout"))},r))})})}async login(e){const t=await this.call("rpc.login",e);if(!t)throw new Error("authentication failed");return t}async listMethods(){return await this.call("__listMethods")}notify(e,t){return new Promise((r,s)=>{if(!this.ready)return s(new Error("socket not ready"));const i={jsonrpc:"2.0",method:e,params:t};this.socket.send(this.dataPack.encode(i),o=>{if(o)return s(o);r()})})}async subscribe(e){typeof e=="string"&&(e=[e]);const t=await this.call("rpc.on",e);if(typeof e=="string"&&t[e]!=="ok")throw new Error("Failed subscribing to an event '"+e+"' with: "+t[e]);return t}async unsubscribe(e){typeof e=="string"&&(e=[e]);const t=await this.call("rpc.off",e);if(typeof e=="string"&&t[e]!=="ok")throw new Error("Failed unsubscribing from an event with: "+t);return t}close(e,t){this.socket.close(e||1e3,t)}setAutoReconnect(e){this.reconnect=e}setReconnectInterval(e){this.reconnect_interval=e}setMaxReconnects(e){this.max_reconnects=e}_connect(e,t){clearTimeout(this.reconnect_timer_id),this.socket=this.webSocketFactory(e,t),this.socket.addEventListener("open",()=>{this.ready=!0,this.emit("open"),this.current_reconnects=0}),this.socket.addEventListener("message",({data:r})=>{r instanceof ArrayBuffer&&(r=oe.Buffer.from(r).toString());try{r=this.dataPack.decode(r)}catch{return}if(r.notification&&this.listeners(r.notification).length){if(!Object.keys(r.params).length)return this.emit(r.notification);const s=[r.notification];if(r.params.constructor===Object)s.push(r.params);else for(let i=0;i<r.params.length;i++)s.push(r.params[i]);return Promise.resolve().then(()=>{this.emit.apply(this,s)})}if(!this.queue[r.id])return r.method?Promise.resolve().then(()=>{this.emit(r.method,r==null?void 0:r.params)}):void 0;"error"in r=="result"in r&&this.queue[r.id].promise[1](new Error('Server response malformed. Response must include either "result" or "error", but not both.')),this.queue[r.id].timeout&&clearTimeout(this.queue[r.id].timeout),r.error?this.queue[r.id].promise[1](r.error):this.queue[r.id].promise[0](r.result),delete this.queue[r.id]}),this.socket.addEventListener("error",r=>this.emit("error",r)),this.socket.addEventListener("close",({code:r,reason:s})=>{this.ready&&setTimeout(()=>this.emit("close",r,s),0),this.ready=!1,this.socket=void 0,r!==1e3&&(this.current_reconnects++,this.reconnect&&(this.max_reconnects>this.current_reconnects||this.max_reconnects===0)&&(this.reconnect_timer_id=setTimeout(()=>this._connect(e,t),this.reconnect_interval)))})}};const d3=kr.utils.randomPrivateKey,Jd=()=>{const n=kr.utils.randomPrivateKey(),e=$i(n),t=new Uint8Array(64);return t.set(n),t.set(e,32),{publicKey:e,secretKey:t}},$i=kr.getPublicKey;function Qd(n){try{return kr.ExtendedPoint.fromHex(n),!0}catch{return!1}}const Bl=(n,e)=>kr.sign(n,e.slice(0,32)),u3=kr.verify,ge=n=>oe.Buffer.isBuffer(n)?n:n instanceof Uint8Array?oe.Buffer.from(n.buffer,n.byteOffset,n.byteLength):oe.Buffer.from(n);class xl{constructor(e){Object.assign(this,e)}encode(){return oe.Buffer.from(K0(Ss,this))}static decode(e){return j0(Ss,this,e)}static decodeUnchecked(e){return O0(Ss,this,e)}}class f3 extends xl{constructor(e){if(super(e),this.enum="",Object.keys(e).length!==1)throw new Error("Enum can only take single value");Object.keys(e).map(t=>{this.enum=t})}}const Ss=new Map;var Ah;const Eh=32,xn=32;function h3(n){return n._bn!==void 0}let eu=1;class Y extends xl{constructor(e){if(super({}),this._bn=void 0,h3(e))this._bn=e._bn;else{if(typeof e=="string"){const t=vt.decode(e);if(t.length!=xn)throw new Error("Invalid public key input");this._bn=new uc(t)}else this._bn=new uc(e);if(this._bn.byteLength()>xn)throw new Error("Invalid public key input")}}static unique(){const e=new Y(eu);return eu+=1,new Y(e.toBuffer())}equals(e){return this._bn.eq(e._bn)}toBase58(){return vt.encode(this.toBytes())}toJSON(){return this.toBase58()}toBytes(){const e=this.toBuffer();return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}toBuffer(){const e=this._bn.toArrayLike(oe.Buffer);if(e.length===xn)return e;const t=oe.Buffer.alloc(32);return e.copy(t,32-e.length),t}get[Symbol.toStringTag](){return`PublicKey(${this.toString()})`}toString(){return this.toBase58()}static async createWithSeed(e,t,r){const s=oe.Buffer.concat([e.toBuffer(),oe.Buffer.from(t),r.toBuffer()]),i=Ts(s);return new Y(i)}static createProgramAddressSync(e,t){let r=oe.Buffer.alloc(0);e.forEach(function(i){if(i.length>Eh)throw new TypeError("Max seed length exceeded");r=oe.Buffer.concat([r,ge(i)])}),r=oe.Buffer.concat([r,t.toBuffer(),oe.Buffer.from("ProgramDerivedAddress")]);const s=Ts(r);if(Qd(s))throw new Error("Invalid seeds, address must fall off the curve");return new Y(s)}static async createProgramAddress(e,t){return this.createProgramAddressSync(e,t)}static findProgramAddressSync(e,t){let r=255,s;for(;r!=0;){try{const i=e.concat(oe.Buffer.from([r]));s=this.createProgramAddressSync(i,t)}catch(i){if(i instanceof TypeError)throw i;r--;continue}return[s,r]}throw new Error("Unable to find a viable program address nonce")}static async findProgramAddress(e,t){return this.findProgramAddressSync(e,t)}static isOnCurve(e){const t=new Y(e);return Qd(t.toBytes())}}Ah=Y;Y.default=new Ah("11111111111111111111111111111111");Ss.set(Y,{kind:"struct",fields:[["_bn","u256"]]});class m3{constructor(e){if(this._publicKey=void 0,this._secretKey=void 0,e){const t=ge(e);if(e.length!==64)throw new Error("bad secret key size");this._publicKey=t.slice(32,64),this._secretKey=t.slice(0,32)}else this._secretKey=ge(d3()),this._publicKey=ge($i(this._secretKey))}get publicKey(){return new Y(this._publicKey)}get secretKey(){return oe.Buffer.concat([this._secretKey,this._publicKey],64)}}const b3=new Y("BPFLoader1111111111111111111111111111111111"),er=1232,So=127,qs=64;class Do extends Error{constructor(e){super(`Signature ${e} has expired: block height exceeded.`),this.signature=void 0,this.signature=e}}Object.defineProperty(Do.prototype,"name",{value:"TransactionExpiredBlockheightExceededError"});class Cl extends Error{constructor(e,t){super(`Transaction was not confirmed in ${t.toFixed(2)} seconds. It is unknown if it succeeded or failed. Check signature ${e} using the Solana Explorer or CLI tools.`),this.signature=void 0,this.signature=e}}Object.defineProperty(Cl.prototype,"name",{value:"TransactionExpiredTimeoutError"});class zr extends Error{constructor(e){super(`Signature ${e} has expired: the nonce is no longer valid.`),this.signature=void 0,this.signature=e}}Object.defineProperty(zr.prototype,"name",{value:"TransactionExpiredNonceInvalidError"});class Ks{constructor(e,t){this.staticAccountKeys=void 0,this.accountKeysFromLookups=void 0,this.staticAccountKeys=e,this.accountKeysFromLookups=t}keySegments(){const e=[this.staticAccountKeys];return this.accountKeysFromLookups&&(e.push(this.accountKeysFromLookups.writable),e.push(this.accountKeysFromLookups.readonly)),e}get(e){for(const t of this.keySegments()){if(e<t.length)return t[e];e-=t.length}}get length(){return this.keySegments().flat().length}compileInstructions(e){if(this.length>256)throw new Error("Account index overflow encountered during compilation");const r=new Map;this.keySegments().flat().forEach((i,o)=>{r.set(i.toBase58(),o)});const s=i=>{const o=r.get(i.toBase58());if(o===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return o};return e.map(i=>({programIdIndex:s(i.programId),accountKeyIndexes:i.keys.map(o=>s(o.pubkey)),data:i.data}))}}const Be=(n="publicKey")=>exports.blob(32,n),p3=(n="signature")=>exports.blob(64,n),hr=(n="string")=>{const e=exports.struct([exports.u32("length"),exports.u32("lengthPadding"),exports.blob(Qn(exports.u32(),-8),"chars")],n),t=e.decode.bind(e),r=e.encode.bind(e),s=e;return s.decode=(i,o)=>t(i,o).chars.toString(),s.encode=(i,o,a)=>{const l={chars:oe.Buffer.from(i,"utf8")};return r(l,o,a)},s.alloc=i=>exports.u32().span+exports.u32().span+oe.Buffer.from(i,"utf8").length,s},g3=(n="authorized")=>exports.struct([Be("staker"),Be("withdrawer")],n),y3=(n="lockup")=>exports.struct([exports.ns64("unixTimestamp"),exports.ns64("epoch"),Be("custodian")],n),w3=(n="voteInit")=>exports.struct([Be("nodePubkey"),Be("authorizedVoter"),Be("authorizedWithdrawer"),exports.u8("commission")],n),A3=(n="voteAuthorizeWithSeedArgs")=>exports.struct([exports.u32("voteAuthorizationType"),Be("currentAuthorityDerivedKeyOwnerPubkey"),hr("currentAuthorityDerivedKeySeed"),Be("newAuthorized")],n);function Bh(n,e){const t=s=>{if(s.span>=0)return s.span;if(typeof s.alloc=="function")return s.alloc(e[s.property]);if("count"in s&&"elementLayout"in s){const i=e[s.property];if(Array.isArray(i))return i.length*t(s.elementLayout)}else if("fields"in s)return Bh({layout:s},e[s.property]);return 0};let r=0;return n.layout.fields.forEach(s=>{r+=t(s)}),r}function Vt(n){let e=0,t=0;for(;;){let r=n.shift();if(e|=(r&127)<<t*7,t+=1,!(r&128))break}return e}function Xt(n,e){let t=e;for(;;){let r=t&127;if(t>>=7,t==0){n.push(r);break}else r|=128,n.push(r)}}function Te(n,e){if(!n)throw new Error(e||"Assertion failed")}class vo{constructor(e,t){this.payer=void 0,this.keyMetaMap=void 0,this.payer=e,this.keyMetaMap=t}static compile(e,t){const r=new Map,s=o=>{const a=o.toBase58();let l=r.get(a);return l===void 0&&(l={isSigner:!1,isWritable:!1,isInvoked:!1},r.set(a,l)),l},i=s(t);i.isSigner=!0,i.isWritable=!0;for(const o of e){s(o.programId).isInvoked=!0;for(const a of o.keys){const l=s(a.pubkey);l.isSigner||(l.isSigner=a.isSigner),l.isWritable||(l.isWritable=a.isWritable)}}return new vo(t,r)}getMessageComponents(){const e=[...this.keyMetaMap.entries()];Te(e.length<=256,"Max static account keys length exceeded");const t=e.filter(([,l])=>l.isSigner&&l.isWritable),r=e.filter(([,l])=>l.isSigner&&!l.isWritable),s=e.filter(([,l])=>!l.isSigner&&l.isWritable),i=e.filter(([,l])=>!l.isSigner&&!l.isWritable),o={numRequiredSignatures:t.length+r.length,numReadonlySignedAccounts:r.length,numReadonlyUnsignedAccounts:i.length};{Te(t.length>0,"Expected at least one writable signer key");const[l]=t[0];Te(l===this.payer.toBase58(),"Expected first writable signer key to be the fee payer")}const a=[...t.map(([l])=>new Y(l)),...r.map(([l])=>new Y(l)),...s.map(([l])=>new Y(l)),...i.map(([l])=>new Y(l))];return[o,a]}extractTableLookup(e){const[t,r]=this.drainKeysFoundInLookupTable(e.state.addresses,o=>!o.isSigner&&!o.isInvoked&&o.isWritable),[s,i]=this.drainKeysFoundInLookupTable(e.state.addresses,o=>!o.isSigner&&!o.isInvoked&&!o.isWritable);if(!(t.length===0&&s.length===0))return[{accountKey:e.key,writableIndexes:t,readonlyIndexes:s},{writable:r,readonly:i}]}drainKeysFoundInLookupTable(e,t){const r=new Array,s=new Array;for(const[i,o]of this.keyMetaMap.entries())if(t(o)){const a=new Y(i),l=e.findIndex(h=>h.equals(a));l>=0&&(Te(l<256,"Max lookup table index exceeded"),r.push(l),s.push(a),this.keyMetaMap.delete(i))}return[r,s]}}const xh="Reached end of buffer unexpectedly";function wn(n){if(n.length===0)throw new Error(xh);return n.shift()}function Gt(n,...e){const[t]=e;if(e.length===2?t+(e[1]??0)>n.length:t>=n.length)throw new Error(xh);return n.splice(...e)}class cn{constructor(e){this.header=void 0,this.accountKeys=void 0,this.recentBlockhash=void 0,this.instructions=void 0,this.indexToProgramIds=new Map,this.header=e.header,this.accountKeys=e.accountKeys.map(t=>new Y(t)),this.recentBlockhash=e.recentBlockhash,this.instructions=e.instructions,this.instructions.forEach(t=>this.indexToProgramIds.set(t.programIdIndex,this.accountKeys[t.programIdIndex]))}get version(){return"legacy"}get staticAccountKeys(){return this.accountKeys}get compiledInstructions(){return this.instructions.map(e=>({programIdIndex:e.programIdIndex,accountKeyIndexes:e.accounts,data:vt.decode(e.data)}))}get addressTableLookups(){return[]}getAccountKeys(){return new Ks(this.staticAccountKeys)}static compile(e){const t=vo.compile(e.instructions,e.payerKey),[r,s]=t.getMessageComponents(),o=new Ks(s).compileInstructions(e.instructions).map(a=>({programIdIndex:a.programIdIndex,accounts:a.accountKeyIndexes,data:vt.encode(a.data)}));return new cn({header:r,accountKeys:s,recentBlockhash:e.recentBlockhash,instructions:o})}isAccountSigner(e){return e<this.header.numRequiredSignatures}isAccountWritable(e){const t=this.header.numRequiredSignatures;if(e>=this.header.numRequiredSignatures){const r=e-t,i=this.accountKeys.length-t-this.header.numReadonlyUnsignedAccounts;return r<i}else{const r=t-this.header.numReadonlySignedAccounts;return e<r}}isProgramId(e){return this.indexToProgramIds.has(e)}programIds(){return[...this.indexToProgramIds.values()]}nonProgramIds(){return this.accountKeys.filter((e,t)=>!this.isProgramId(t))}serialize(){const e=this.accountKeys.length;let t=[];Xt(t,e);const r=this.instructions.map(E=>{const{accounts:S,programIdIndex:A}=E,g=Array.from(vt.decode(E.data));let D=[];Xt(D,S.length);let x=[];return Xt(x,g.length),{programIdIndex:A,keyIndicesCount:oe.Buffer.from(D),keyIndices:S,dataLength:oe.Buffer.from(x),data:g}});let s=[];Xt(s,r.length);let i=oe.Buffer.alloc(er);oe.Buffer.from(s).copy(i);let o=s.length;r.forEach(E=>{const A=exports.struct([exports.u8("programIdIndex"),exports.blob(E.keyIndicesCount.length,"keyIndicesCount"),exports.seq(exports.u8("keyIndex"),E.keyIndices.length,"keyIndices"),exports.blob(E.dataLength.length,"dataLength"),exports.seq(exports.u8("userdatum"),E.data.length,"data")]).encode(E,i,o);o+=A}),i=i.slice(0,o);const a=exports.struct([exports.blob(1,"numRequiredSignatures"),exports.blob(1,"numReadonlySignedAccounts"),exports.blob(1,"numReadonlyUnsignedAccounts"),exports.blob(t.length,"keyCount"),exports.seq(Be("key"),e,"keys"),Be("recentBlockhash")]),l={numRequiredSignatures:oe.Buffer.from([this.header.numRequiredSignatures]),numReadonlySignedAccounts:oe.Buffer.from([this.header.numReadonlySignedAccounts]),numReadonlyUnsignedAccounts:oe.Buffer.from([this.header.numReadonlyUnsignedAccounts]),keyCount:oe.Buffer.from(t),keys:this.accountKeys.map(E=>ge(E.toBytes())),recentBlockhash:vt.decode(this.recentBlockhash)};let h=oe.Buffer.alloc(2048);const m=a.encode(l,h);return i.copy(h,m),h.slice(0,m+i.length)}static from(e){let t=[...e];const r=wn(t);if(r!==(r&So))throw new Error("Versioned messages must be deserialized with VersionedMessage.deserialize()");const s=wn(t),i=wn(t),o=Vt(t);let a=[];for(let S=0;S<o;S++){const A=Gt(t,0,xn);a.push(new Y(oe.Buffer.from(A)))}const l=Gt(t,0,xn),h=Vt(t);let m=[];for(let S=0;S<h;S++){const A=wn(t),g=Vt(t),D=Gt(t,0,g),x=Vt(t),U=Gt(t,0,x),R=vt.encode(oe.Buffer.from(U));m.push({programIdIndex:A,accounts:D,data:R})}const E={header:{numRequiredSignatures:r,numReadonlySignedAccounts:s,numReadonlyUnsignedAccounts:i},recentBlockhash:vt.encode(oe.Buffer.from(l)),accountKeys:a,instructions:m};return new cn(E)}}class nr{constructor(e){this.header=void 0,this.staticAccountKeys=void 0,this.recentBlockhash=void 0,this.compiledInstructions=void 0,this.addressTableLookups=void 0,this.header=e.header,this.staticAccountKeys=e.staticAccountKeys,this.recentBlockhash=e.recentBlockhash,this.compiledInstructions=e.compiledInstructions,this.addressTableLookups=e.addressTableLookups}get version(){return 0}get numAccountKeysFromLookups(){let e=0;for(const t of this.addressTableLookups)e+=t.readonlyIndexes.length+t.writableIndexes.length;return e}getAccountKeys(e){let t;if(e&&"accountKeysFromLookups"in e&&e.accountKeysFromLookups){if(this.numAccountKeysFromLookups!=e.accountKeysFromLookups.writable.length+e.accountKeysFromLookups.readonly.length)throw new Error("Failed to get account keys because of a mismatch in the number of account keys from lookups");t=e.accountKeysFromLookups}else if(e&&"addressLookupTableAccounts"in e&&e.addressLookupTableAccounts)t=this.resolveAddressTableLookups(e.addressLookupTableAccounts);else if(this.addressTableLookups.length>0)throw new Error("Failed to get account keys because address table lookups were not resolved");return new Ks(this.staticAccountKeys,t)}isAccountSigner(e){return e<this.header.numRequiredSignatures}isAccountWritable(e){const t=this.header.numRequiredSignatures,r=this.staticAccountKeys.length;if(e>=r){const s=e-r,i=this.addressTableLookups.reduce((o,a)=>o+a.writableIndexes.length,0);return s<i}else if(e>=this.header.numRequiredSignatures){const s=e-t,o=r-t-this.header.numReadonlyUnsignedAccounts;return s<o}else{const s=t-this.header.numReadonlySignedAccounts;return e<s}}resolveAddressTableLookups(e){const t={writable:[],readonly:[]};for(const r of this.addressTableLookups){const s=e.find(i=>i.key.equals(r.accountKey));if(!s)throw new Error(`Failed to find address lookup table account for table key ${r.accountKey.toBase58()}`);for(const i of r.writableIndexes)if(i<s.state.addresses.length)t.writable.push(s.state.addresses[i]);else throw new Error(`Failed to find address for index ${i} in address lookup table ${r.accountKey.toBase58()}`);for(const i of r.readonlyIndexes)if(i<s.state.addresses.length)t.readonly.push(s.state.addresses[i]);else throw new Error(`Failed to find address for index ${i} in address lookup table ${r.accountKey.toBase58()}`)}return t}static compile(e){const t=vo.compile(e.instructions,e.payerKey),r=new Array,s={writable:new Array,readonly:new Array},i=e.addressLookupTableAccounts||[];for(const m of i){const E=t.extractTableLookup(m);if(E!==void 0){const[S,{writable:A,readonly:g}]=E;r.push(S),s.writable.push(...A),s.readonly.push(...g)}}const[o,a]=t.getMessageComponents(),h=new Ks(a,s).compileInstructions(e.instructions);return new nr({header:o,staticAccountKeys:a,recentBlockhash:e.recentBlockhash,compiledInstructions:h,addressTableLookups:r})}serialize(){const e=Array();Xt(e,this.staticAccountKeys.length);const t=this.serializeInstructions(),r=Array();Xt(r,this.compiledInstructions.length);const s=this.serializeAddressTableLookups(),i=Array();Xt(i,this.addressTableLookups.length);const o=exports.struct([exports.u8("prefix"),exports.struct([exports.u8("numRequiredSignatures"),exports.u8("numReadonlySignedAccounts"),exports.u8("numReadonlyUnsignedAccounts")],"header"),exports.blob(e.length,"staticAccountKeysLength"),exports.seq(Be(),this.staticAccountKeys.length,"staticAccountKeys"),Be("recentBlockhash"),exports.blob(r.length,"instructionsLength"),exports.blob(t.length,"serializedInstructions"),exports.blob(i.length,"addressTableLookupsLength"),exports.blob(s.length,"serializedAddressTableLookups")]),a=new Uint8Array(er),h=o.encode({prefix:128,header:this.header,staticAccountKeysLength:new Uint8Array(e),staticAccountKeys:this.staticAccountKeys.map(m=>m.toBytes()),recentBlockhash:vt.decode(this.recentBlockhash),instructionsLength:new Uint8Array(r),serializedInstructions:t,addressTableLookupsLength:new Uint8Array(i),serializedAddressTableLookups:s},a);return a.slice(0,h)}serializeInstructions(){let e=0;const t=new Uint8Array(er);for(const r of this.compiledInstructions){const s=Array();Xt(s,r.accountKeyIndexes.length);const i=Array();Xt(i,r.data.length);const o=exports.struct([exports.u8("programIdIndex"),exports.blob(s.length,"encodedAccountKeyIndexesLength"),exports.seq(exports.u8(),r.accountKeyIndexes.length,"accountKeyIndexes"),exports.blob(i.length,"encodedDataLength"),exports.blob(r.data.length,"data")]);e+=o.encode({programIdIndex:r.programIdIndex,encodedAccountKeyIndexesLength:new Uint8Array(s),accountKeyIndexes:r.accountKeyIndexes,encodedDataLength:new Uint8Array(i),data:r.data},t,e)}return t.slice(0,e)}serializeAddressTableLookups(){let e=0;const t=new Uint8Array(er);for(const r of this.addressTableLookups){const s=Array();Xt(s,r.writableIndexes.length);const i=Array();Xt(i,r.readonlyIndexes.length);const o=exports.struct([Be("accountKey"),exports.blob(s.length,"encodedWritableIndexesLength"),exports.seq(exports.u8(),r.writableIndexes.length,"writableIndexes"),exports.blob(i.length,"encodedReadonlyIndexesLength"),exports.seq(exports.u8(),r.readonlyIndexes.length,"readonlyIndexes")]);e+=o.encode({accountKey:r.accountKey.toBytes(),encodedWritableIndexesLength:new Uint8Array(s),writableIndexes:r.writableIndexes,encodedReadonlyIndexesLength:new Uint8Array(i),readonlyIndexes:r.readonlyIndexes},t,e)}return t.slice(0,e)}static deserialize(e){let t=[...e];const r=wn(t),s=r&So;Te(r!==s,"Expected versioned message but received legacy message");const i=s;Te(i===0,`Expected versioned message with version 0 but found version ${i}`);const o={numRequiredSignatures:wn(t),numReadonlySignedAccounts:wn(t),numReadonlyUnsignedAccounts:wn(t)},a=[],l=Vt(t);for(let g=0;g<l;g++)a.push(new Y(Gt(t,0,xn)));const h=vt.encode(Gt(t,0,xn)),m=Vt(t),E=[];for(let g=0;g<m;g++){const D=wn(t),x=Vt(t),U=Gt(t,0,x),R=Vt(t),F=new Uint8Array(Gt(t,0,R));E.push({programIdIndex:D,accountKeyIndexes:U,data:F})}const S=Vt(t),A=[];for(let g=0;g<S;g++){const D=new Y(Gt(t,0,xn)),x=Vt(t),U=Gt(t,0,x),R=Vt(t),F=Gt(t,0,R);A.push({accountKey:D,writableIndexes:U,readonlyIndexes:F})}return new nr({header:o,staticAccountKeys:a,recentBlockhash:h,compiledInstructions:E,addressTableLookups:A})}}const Sl={deserializeMessageVersion(n){const e=n[0],t=e&So;return t===e?"legacy":t},deserialize:n=>{const e=Sl.deserializeMessageVersion(n);if(e==="legacy")return cn.from(n);if(e===0)return nr.deserialize(n);throw new Error(`Transaction message version ${e} deserialization is not supported`)}};let Rn=function(n){return n[n.BLOCKHEIGHT_EXCEEDED=0]="BLOCKHEIGHT_EXCEEDED",n[n.PROCESSED=1]="PROCESSED",n[n.TIMED_OUT=2]="TIMED_OUT",n[n.NONCE_INVALID=3]="NONCE_INVALID",n}({});const E3=oe.Buffer.alloc(qs).fill(0);class We{constructor(e){this.keys=void 0,this.programId=void 0,this.data=oe.Buffer.alloc(0),this.programId=e.programId,this.keys=e.keys,e.data&&(this.data=e.data)}toJSON(){return{keys:this.keys.map(({pubkey:e,isSigner:t,isWritable:r})=>({pubkey:e.toJSON(),isSigner:t,isWritable:r})),programId:this.programId.toJSON(),data:[...this.data]}}}class Fe{get signature(){return this.signatures.length>0?this.signatures[0].signature:null}constructor(e){if(this.signatures=[],this.feePayer=void 0,this.instructions=[],this.recentBlockhash=void 0,this.lastValidBlockHeight=void 0,this.nonceInfo=void 0,this.minNonceContextSlot=void 0,this._message=void 0,this._json=void 0,!!e)if(e.feePayer&&(this.feePayer=e.feePayer),e.signatures&&(this.signatures=e.signatures),Object.prototype.hasOwnProperty.call(e,"nonceInfo")){const{minContextSlot:t,nonceInfo:r}=e;this.minNonceContextSlot=t,this.nonceInfo=r}else if(Object.prototype.hasOwnProperty.call(e,"lastValidBlockHeight")){const{blockhash:t,lastValidBlockHeight:r}=e;this.recentBlockhash=t,this.lastValidBlockHeight=r}else{const{recentBlockhash:t,nonceInfo:r}=e;r&&(this.nonceInfo=r),this.recentBlockhash=t}}toJSON(){return{recentBlockhash:this.recentBlockhash||null,feePayer:this.feePayer?this.feePayer.toJSON():null,nonceInfo:this.nonceInfo?{nonce:this.nonceInfo.nonce,nonceInstruction:this.nonceInfo.nonceInstruction.toJSON()}:null,instructions:this.instructions.map(e=>e.toJSON()),signers:this.signatures.map(({publicKey:e})=>e.toJSON())}}add(...e){if(e.length===0)throw new Error("No instructions");return e.forEach(t=>{"instructions"in t?this.instructions=this.instructions.concat(t.instructions):"data"in t&&"programId"in t&&"keys"in t?this.instructions.push(t):this.instructions.push(new We(t))}),this}compileMessage(){if(this._message&&JSON.stringify(this.toJSON())===JSON.stringify(this._json))return this._message;let e,t;if(this.nonceInfo?(e=this.nonceInfo.nonce,this.instructions[0]!=this.nonceInfo.nonceInstruction?t=[this.nonceInfo.nonceInstruction,...this.instructions]:t=this.instructions):(e=this.recentBlockhash,t=this.instructions),!e)throw new Error("Transaction recentBlockhash required");t.length<1&&console.warn("No instructions provided");let r;if(this.feePayer)r=this.feePayer;else if(this.signatures.length>0&&this.signatures[0].publicKey)r=this.signatures[0].publicKey;else throw new Error("Transaction fee payer required");for(let D=0;D<t.length;D++)if(t[D].programId===void 0)throw new Error(`Transaction instruction index ${D} has undefined program id`);const s=[],i=[];t.forEach(D=>{D.keys.forEach(U=>{i.push({...U})});const x=D.programId.toString();s.includes(x)||s.push(x)}),s.forEach(D=>{i.push({pubkey:new Y(D),isSigner:!1,isWritable:!1})});const o=[];i.forEach(D=>{const x=D.pubkey.toString(),U=o.findIndex(R=>R.pubkey.toString()===x);U>-1?(o[U].isWritable=o[U].isWritable||D.isWritable,o[U].isSigner=o[U].isSigner||D.isSigner):o.push(D)}),o.sort(function(D,x){if(D.isSigner!==x.isSigner)return D.isSigner?-1:1;if(D.isWritable!==x.isWritable)return D.isWritable?-1:1;const U={localeMatcher:"best fit",usage:"sort",sensitivity:"variant",ignorePunctuation:!1,numeric:!1,caseFirst:"lower"};return D.pubkey.toBase58().localeCompare(x.pubkey.toBase58(),"en",U)});const a=o.findIndex(D=>D.pubkey.equals(r));if(a>-1){const[D]=o.splice(a,1);D.isSigner=!0,D.isWritable=!0,o.unshift(D)}else o.unshift({pubkey:r,isSigner:!0,isWritable:!0});for(const D of this.signatures){const x=o.findIndex(U=>U.pubkey.equals(D.publicKey));if(x>-1)o[x].isSigner||(o[x].isSigner=!0,console.warn("Transaction references a signature that is unnecessary, only the fee payer and instruction signer accounts should sign a transaction. This behavior is deprecated and will throw an error in the next major version release."));else throw new Error(`unknown signer: ${D.publicKey.toString()}`)}let l=0,h=0,m=0;const E=[],S=[];o.forEach(({pubkey:D,isSigner:x,isWritable:U})=>{x?(E.push(D.toString()),l+=1,U||(h+=1)):(S.push(D.toString()),U||(m+=1))});const A=E.concat(S),g=t.map(D=>{const{data:x,programId:U}=D;return{programIdIndex:A.indexOf(U.toString()),accounts:D.keys.map(R=>A.indexOf(R.pubkey.toString())),data:vt.encode(x)}});return g.forEach(D=>{Te(D.programIdIndex>=0),D.accounts.forEach(x=>Te(x>=0))}),new cn({header:{numRequiredSignatures:l,numReadonlySignedAccounts:h,numReadonlyUnsignedAccounts:m},accountKeys:A,recentBlockhash:e,instructions:g})}_compile(){const e=this.compileMessage(),t=e.accountKeys.slice(0,e.header.numRequiredSignatures);return this.signatures.length===t.length&&this.signatures.every((s,i)=>t[i].equals(s.publicKey))||(this.signatures=t.map(r=>({signature:null,publicKey:r}))),e}serializeMessage(){return this._compile().serialize()}async getEstimatedFee(e){return(await e.getFeeForMessage(this.compileMessage())).value}setSigners(...e){if(e.length===0)throw new Error("No signers");const t=new Set;this.signatures=e.filter(r=>{const s=r.toString();return t.has(s)?!1:(t.add(s),!0)}).map(r=>({signature:null,publicKey:r}))}sign(...e){if(e.length===0)throw new Error("No signers");const t=new Set,r=[];for(const i of e){const o=i.publicKey.toString();t.has(o)||(t.add(o),r.push(i))}this.signatures=r.map(i=>({signature:null,publicKey:i.publicKey}));const s=this._compile();this._partialSign(s,...r)}partialSign(...e){if(e.length===0)throw new Error("No signers");const t=new Set,r=[];for(const i of e){const o=i.publicKey.toString();t.has(o)||(t.add(o),r.push(i))}const s=this._compile();this._partialSign(s,...r)}_partialSign(e,...t){const r=e.serialize();t.forEach(s=>{const i=Bl(r,s.secretKey);this._addSignature(s.publicKey,ge(i))})}addSignature(e,t){this._compile(),this._addSignature(e,t)}_addSignature(e,t){Te(t.length===64);const r=this.signatures.findIndex(s=>e.equals(s.publicKey));if(r<0)throw new Error(`unknown signer: ${e.toString()}`);this.signatures[r].signature=oe.Buffer.from(t)}verifySignatures(e=!0){return!this._getMessageSignednessErrors(this.serializeMessage(),e)}_getMessageSignednessErrors(e,t){const r={};for(const{signature:s,publicKey:i}of this.signatures)s===null?t&&(r.missing||(r.missing=[])).push(i):u3(s,e,i.toBytes())||(r.invalid||(r.invalid=[])).push(i);return r.invalid||r.missing?r:void 0}serialize(e){const{requireAllSignatures:t,verifySignatures:r}=Object.assign({requireAllSignatures:!0,verifySignatures:!0},e),s=this.serializeMessage();if(r){const i=this._getMessageSignednessErrors(s,t);if(i){let o="Signature verification failed.";throw i.invalid&&(o+=`
6
+ */(function(n){const e=Zi,t=xc,r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;n.Buffer=a,n.SlowBuffer=R,n.INSPECT_MAX_BYTES=50;const s=2147483647;n.kMaxLength=s,a.TYPED_ARRAY_SUPPORT=i(),!a.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function i(){try{const w=new Uint8Array(1),d={foo:function(){return 42}};return Object.setPrototypeOf(d,Uint8Array.prototype),Object.setPrototypeOf(w,d),w.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function o(w){if(w>s)throw new RangeError('The value "'+w+'" is invalid for option "size"');const d=new Uint8Array(w);return Object.setPrototypeOf(d,a.prototype),d}function a(w,d,f){if(typeof w=="number"){if(typeof d=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return E(w)}return l(w,d,f)}a.poolSize=8192;function l(w,d,f){if(typeof w=="string")return S(w,d);if(ArrayBuffer.isView(w))return g(w);if(w==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof w);if(Ft(w,ArrayBuffer)||w&&Ft(w.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Ft(w,SharedArrayBuffer)||w&&Ft(w.buffer,SharedArrayBuffer)))return D(w,d,f);if(typeof w=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const v=w.valueOf&&w.valueOf();if(v!=null&&v!==w)return a.from(v,d,f);const M=x(w);if(M)return M;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof w[Symbol.toPrimitive]=="function")return a.from(w[Symbol.toPrimitive]("string"),d,f);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof w)}a.from=function(w,d,f){return l(w,d,f)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function h(w){if(typeof w!="number")throw new TypeError('"size" argument must be of type number');if(w<0)throw new RangeError('The value "'+w+'" is invalid for option "size"')}function m(w,d,f){return h(w),w<=0?o(w):d!==void 0?typeof f=="string"?o(w).fill(d,f):o(w).fill(d):o(w)}a.alloc=function(w,d,f){return m(w,d,f)};function E(w){return h(w),o(w<0?0:U(w)|0)}a.allocUnsafe=function(w){return E(w)},a.allocUnsafeSlow=function(w){return E(w)};function S(w,d){if((typeof d!="string"||d==="")&&(d="utf8"),!a.isEncoding(d))throw new TypeError("Unknown encoding: "+d);const f=F(w,d)|0;let v=o(f);const M=v.write(w,d);return M!==f&&(v=v.slice(0,M)),v}function A(w){const d=w.length<0?0:U(w.length)|0,f=o(d);for(let v=0;v<d;v+=1)f[v]=w[v]&255;return f}function g(w){if(Ft(w,Uint8Array)){const d=new Uint8Array(w);return D(d.buffer,d.byteOffset,d.byteLength)}return A(w)}function D(w,d,f){if(d<0||w.byteLength<d)throw new RangeError('"offset" is outside of buffer bounds');if(w.byteLength<d+(f||0))throw new RangeError('"length" is outside of buffer bounds');let v;return d===void 0&&f===void 0?v=new Uint8Array(w):f===void 0?v=new Uint8Array(w,d):v=new Uint8Array(w,d,f),Object.setPrototypeOf(v,a.prototype),v}function x(w){if(a.isBuffer(w)){const d=U(w.length)|0,f=o(d);return f.length===0||w.copy(f,0,0,d),f}if(w.length!==void 0)return typeof w.length!="number"||Pe(w.length)?o(0):A(w);if(w.type==="Buffer"&&Array.isArray(w.data))return A(w.data)}function U(w){if(w>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return w|0}function R(w){return+w!=w&&(w=0),a.alloc(+w)}a.isBuffer=function(d){return d!=null&&d._isBuffer===!0&&d!==a.prototype},a.compare=function(d,f){if(Ft(d,Uint8Array)&&(d=a.from(d,d.offset,d.byteLength)),Ft(f,Uint8Array)&&(f=a.from(f,f.offset,f.byteLength)),!a.isBuffer(d)||!a.isBuffer(f))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(d===f)return 0;let v=d.length,M=f.length;for(let P=0,N=Math.min(v,M);P<N;++P)if(d[P]!==f[P]){v=d[P],M=f[P];break}return v<M?-1:M<v?1:0},a.isEncoding=function(d){switch(String(d).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(d,f){if(!Array.isArray(d))throw new TypeError('"list" argument must be an Array of Buffers');if(d.length===0)return a.alloc(0);let v;if(f===void 0)for(f=0,v=0;v<d.length;++v)f+=d[v].length;const M=a.allocUnsafe(f);let P=0;for(v=0;v<d.length;++v){let N=d[v];if(Ft(N,Uint8Array))P+N.length>M.length?(a.isBuffer(N)||(N=a.from(N)),N.copy(M,P)):Uint8Array.prototype.set.call(M,N,P);else if(a.isBuffer(N))N.copy(M,P);else throw new TypeError('"list" argument must be an Array of Buffers');P+=N.length}return M};function F(w,d){if(a.isBuffer(w))return w.length;if(ArrayBuffer.isView(w)||Ft(w,ArrayBuffer))return w.byteLength;if(typeof w!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof w);const f=w.length,v=arguments.length>2&&arguments[2]===!0;if(!v&&f===0)return 0;let M=!1;for(;;)switch(d){case"ascii":case"latin1":case"binary":return f;case"utf8":case"utf-8":return Le(w).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return f*2;case"hex":return f>>>1;case"base64":return Oe(w).length;default:if(M)return v?-1:Le(w).length;d=(""+d).toLowerCase(),M=!0}}a.byteLength=F;function W(w,d,f){let v=!1;if((d===void 0||d<0)&&(d=0),d>this.length||((f===void 0||f>this.length)&&(f=this.length),f<=0)||(f>>>=0,d>>>=0,f<=d))return"";for(w||(w="utf8");;)switch(w){case"hex":return T(this,d,f);case"utf8":case"utf-8":return c(this,d,f);case"ascii":return y(this,d,f);case"latin1":case"binary":return C(this,d,f);case"base64":return I(this,d,f);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,d,f);default:if(v)throw new TypeError("Unknown encoding: "+w);w=(w+"").toLowerCase(),v=!0}}a.prototype._isBuffer=!0;function z(w,d,f){const v=w[d];w[d]=w[f],w[f]=v}a.prototype.swap16=function(){const d=this.length;if(d%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let f=0;f<d;f+=2)z(this,f,f+1);return this},a.prototype.swap32=function(){const d=this.length;if(d%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let f=0;f<d;f+=4)z(this,f,f+3),z(this,f+1,f+2);return this},a.prototype.swap64=function(){const d=this.length;if(d%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let f=0;f<d;f+=8)z(this,f,f+7),z(this,f+1,f+6),z(this,f+2,f+5),z(this,f+3,f+4);return this},a.prototype.toString=function(){const d=this.length;return d===0?"":arguments.length===0?c(this,0,d):W.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(d){if(!a.isBuffer(d))throw new TypeError("Argument must be a Buffer");return this===d?!0:a.compare(this,d)===0},a.prototype.inspect=function(){let d="";const f=n.INSPECT_MAX_BYTES;return d=this.toString("hex",0,f).replace(/(.{2})/g,"$1 ").trim(),this.length>f&&(d+=" ... "),"<Buffer "+d+">"},r&&(a.prototype[r]=a.prototype.inspect),a.prototype.compare=function(d,f,v,M,P){if(Ft(d,Uint8Array)&&(d=a.from(d,d.offset,d.byteLength)),!a.isBuffer(d))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof d);if(f===void 0&&(f=0),v===void 0&&(v=d?d.length:0),M===void 0&&(M=0),P===void 0&&(P=this.length),f<0||v>d.length||M<0||P>this.length)throw new RangeError("out of range index");if(M>=P&&f>=v)return 0;if(M>=P)return-1;if(f>=v)return 1;if(f>>>=0,v>>>=0,M>>>=0,P>>>=0,this===d)return 0;let N=P-M,be=v-f;const he=Math.min(N,be),fe=this.slice(M,P),Ke=d.slice(f,v);for(let de=0;de<he;++de)if(fe[de]!==Ke[de]){N=fe[de],be=Ke[de];break}return N<be?-1:be<N?1:0};function H(w,d,f,v,M){if(w.length===0)return-1;if(typeof f=="string"?(v=f,f=0):f>2147483647?f=2147483647:f<-2147483648&&(f=-2147483648),f=+f,Pe(f)&&(f=M?0:w.length-1),f<0&&(f=w.length+f),f>=w.length){if(M)return-1;f=w.length-1}else if(f<0)if(M)f=0;else return-1;if(typeof d=="string"&&(d=a.from(d,v)),a.isBuffer(d))return d.length===0?-1:K(w,d,f,v,M);if(typeof d=="number")return d=d&255,typeof Uint8Array.prototype.indexOf=="function"?M?Uint8Array.prototype.indexOf.call(w,d,f):Uint8Array.prototype.lastIndexOf.call(w,d,f):K(w,[d],f,v,M);throw new TypeError("val must be string, number or Buffer")}function K(w,d,f,v,M){let P=1,N=w.length,be=d.length;if(v!==void 0&&(v=String(v).toLowerCase(),v==="ucs2"||v==="ucs-2"||v==="utf16le"||v==="utf-16le")){if(w.length<2||d.length<2)return-1;P=2,N/=2,be/=2,f/=2}function he(Ke,de){return P===1?Ke[de]:Ke.readUInt16BE(de*P)}let fe;if(M){let Ke=-1;for(fe=f;fe<N;fe++)if(he(w,fe)===he(d,Ke===-1?0:fe-Ke)){if(Ke===-1&&(Ke=fe),fe-Ke+1===be)return Ke*P}else Ke!==-1&&(fe-=fe-Ke),Ke=-1}else for(f+be>N&&(f=N-be),fe=f;fe>=0;fe--){let Ke=!0;for(let de=0;de<be;de++)if(he(w,fe+de)!==he(d,de)){Ke=!1;break}if(Ke)return fe}return-1}a.prototype.includes=function(d,f,v){return this.indexOf(d,f,v)!==-1},a.prototype.indexOf=function(d,f,v){return H(this,d,f,v,!0)},a.prototype.lastIndexOf=function(d,f,v){return H(this,d,f,v,!1)};function G(w,d,f,v){f=Number(f)||0;const M=w.length-f;v?(v=Number(v),v>M&&(v=M)):v=M;const P=d.length;v>P/2&&(v=P/2);let N;for(N=0;N<v;++N){const be=parseInt(d.substr(N*2,2),16);if(Pe(be))return N;w[f+N]=be}return N}function V(w,d,f,v){return Re(Le(d,w.length-f),w,f,v)}function ie(w,d,f,v){return Re($e(d),w,f,v)}function ne(w,d,f,v){return Re(Oe(d),w,f,v)}function ae(w,d,f,v){return Re(Wr(d,w.length-f),w,f,v)}a.prototype.write=function(d,f,v,M){if(f===void 0)M="utf8",v=this.length,f=0;else if(v===void 0&&typeof f=="string")M=f,v=this.length,f=0;else if(isFinite(f))f=f>>>0,isFinite(v)?(v=v>>>0,M===void 0&&(M="utf8")):(M=v,v=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const P=this.length-f;if((v===void 0||v>P)&&(v=P),d.length>0&&(v<0||f<0)||f>this.length)throw new RangeError("Attempt to write outside buffer bounds");M||(M="utf8");let N=!1;for(;;)switch(M){case"hex":return G(this,d,f,v);case"utf8":case"utf-8":return V(this,d,f,v);case"ascii":case"latin1":case"binary":return ie(this,d,f,v);case"base64":return ne(this,d,f,v);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ae(this,d,f,v);default:if(N)throw new TypeError("Unknown encoding: "+M);M=(""+M).toLowerCase(),N=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function I(w,d,f){return d===0&&f===w.length?e.fromByteArray(w):e.fromByteArray(w.slice(d,f))}function c(w,d,f){f=Math.min(w.length,f);const v=[];let M=d;for(;M<f;){const P=w[M];let N=null,be=P>239?4:P>223?3:P>191?2:1;if(M+be<=f){let he,fe,Ke,de;switch(be){case 1:P<128&&(N=P);break;case 2:he=w[M+1],(he&192)===128&&(de=(P&31)<<6|he&63,de>127&&(N=de));break;case 3:he=w[M+1],fe=w[M+2],(he&192)===128&&(fe&192)===128&&(de=(P&15)<<12|(he&63)<<6|fe&63,de>2047&&(de<55296||de>57343)&&(N=de));break;case 4:he=w[M+1],fe=w[M+2],Ke=w[M+3],(he&192)===128&&(fe&192)===128&&(Ke&192)===128&&(de=(P&15)<<18|(he&63)<<12|(fe&63)<<6|Ke&63,de>65535&&de<1114112&&(N=de))}}N===null?(N=65533,be=1):N>65535&&(N-=65536,v.push(N>>>10&1023|55296),N=56320|N&1023),v.push(N),M+=be}return p(v)}const b=4096;function p(w){const d=w.length;if(d<=b)return String.fromCharCode.apply(String,w);let f="",v=0;for(;v<d;)f+=String.fromCharCode.apply(String,w.slice(v,v+=b));return f}function y(w,d,f){let v="";f=Math.min(w.length,f);for(let M=d;M<f;++M)v+=String.fromCharCode(w[M]&127);return v}function C(w,d,f){let v="";f=Math.min(w.length,f);for(let M=d;M<f;++M)v+=String.fromCharCode(w[M]);return v}function T(w,d,f){const v=w.length;(!d||d<0)&&(d=0),(!f||f<0||f>v)&&(f=v);let M="";for(let P=d;P<f;++P)M+=He[w[P]];return M}function _(w,d,f){const v=w.slice(d,f);let M="";for(let P=0;P<v.length-1;P+=2)M+=String.fromCharCode(v[P]+v[P+1]*256);return M}a.prototype.slice=function(d,f){const v=this.length;d=~~d,f=f===void 0?v:~~f,d<0?(d+=v,d<0&&(d=0)):d>v&&(d=v),f<0?(f+=v,f<0&&(f=0)):f>v&&(f=v),f<d&&(f=d);const M=this.subarray(d,f);return Object.setPrototypeOf(M,a.prototype),M};function B(w,d,f){if(w%1!==0||w<0)throw new RangeError("offset is not uint");if(w+d>f)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(d,f,v){d=d>>>0,f=f>>>0,v||B(d,f,this.length);let M=this[d],P=1,N=0;for(;++N<f&&(P*=256);)M+=this[d+N]*P;return M},a.prototype.readUintBE=a.prototype.readUIntBE=function(d,f,v){d=d>>>0,f=f>>>0,v||B(d,f,this.length);let M=this[d+--f],P=1;for(;f>0&&(P*=256);)M+=this[d+--f]*P;return M},a.prototype.readUint8=a.prototype.readUInt8=function(d,f){return d=d>>>0,f||B(d,1,this.length),this[d]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(d,f){return d=d>>>0,f||B(d,2,this.length),this[d]|this[d+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(d,f){return d=d>>>0,f||B(d,2,this.length),this[d]<<8|this[d+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(d,f){return d=d>>>0,f||B(d,4,this.length),(this[d]|this[d+1]<<8|this[d+2]<<16)+this[d+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(d,f){return d=d>>>0,f||B(d,4,this.length),this[d]*16777216+(this[d+1]<<16|this[d+2]<<8|this[d+3])},a.prototype.readBigUInt64LE=jt(function(d){d=d>>>0,nt(d,"offset");const f=this[d],v=this[d+7];(f===void 0||v===void 0)&&Ce(d,this.length-8);const M=f+this[++d]*2**8+this[++d]*2**16+this[++d]*2**24,P=this[++d]+this[++d]*2**8+this[++d]*2**16+v*2**24;return BigInt(M)+(BigInt(P)<<BigInt(32))}),a.prototype.readBigUInt64BE=jt(function(d){d=d>>>0,nt(d,"offset");const f=this[d],v=this[d+7];(f===void 0||v===void 0)&&Ce(d,this.length-8);const M=f*2**24+this[++d]*2**16+this[++d]*2**8+this[++d],P=this[++d]*2**24+this[++d]*2**16+this[++d]*2**8+v;return(BigInt(M)<<BigInt(32))+BigInt(P)}),a.prototype.readIntLE=function(d,f,v){d=d>>>0,f=f>>>0,v||B(d,f,this.length);let M=this[d],P=1,N=0;for(;++N<f&&(P*=256);)M+=this[d+N]*P;return P*=128,M>=P&&(M-=Math.pow(2,8*f)),M},a.prototype.readIntBE=function(d,f,v){d=d>>>0,f=f>>>0,v||B(d,f,this.length);let M=f,P=1,N=this[d+--M];for(;M>0&&(P*=256);)N+=this[d+--M]*P;return P*=128,N>=P&&(N-=Math.pow(2,8*f)),N},a.prototype.readInt8=function(d,f){return d=d>>>0,f||B(d,1,this.length),this[d]&128?(255-this[d]+1)*-1:this[d]},a.prototype.readInt16LE=function(d,f){d=d>>>0,f||B(d,2,this.length);const v=this[d]|this[d+1]<<8;return v&32768?v|4294901760:v},a.prototype.readInt16BE=function(d,f){d=d>>>0,f||B(d,2,this.length);const v=this[d+1]|this[d]<<8;return v&32768?v|4294901760:v},a.prototype.readInt32LE=function(d,f){return d=d>>>0,f||B(d,4,this.length),this[d]|this[d+1]<<8|this[d+2]<<16|this[d+3]<<24},a.prototype.readInt32BE=function(d,f){return d=d>>>0,f||B(d,4,this.length),this[d]<<24|this[d+1]<<16|this[d+2]<<8|this[d+3]},a.prototype.readBigInt64LE=jt(function(d){d=d>>>0,nt(d,"offset");const f=this[d],v=this[d+7];(f===void 0||v===void 0)&&Ce(d,this.length-8);const M=this[d+4]+this[d+5]*2**8+this[d+6]*2**16+(v<<24);return(BigInt(M)<<BigInt(32))+BigInt(f+this[++d]*2**8+this[++d]*2**16+this[++d]*2**24)}),a.prototype.readBigInt64BE=jt(function(d){d=d>>>0,nt(d,"offset");const f=this[d],v=this[d+7];(f===void 0||v===void 0)&&Ce(d,this.length-8);const M=(f<<24)+this[++d]*2**16+this[++d]*2**8+this[++d];return(BigInt(M)<<BigInt(32))+BigInt(this[++d]*2**24+this[++d]*2**16+this[++d]*2**8+v)}),a.prototype.readFloatLE=function(d,f){return d=d>>>0,f||B(d,4,this.length),t.read(this,d,!0,23,4)},a.prototype.readFloatBE=function(d,f){return d=d>>>0,f||B(d,4,this.length),t.read(this,d,!1,23,4)},a.prototype.readDoubleLE=function(d,f){return d=d>>>0,f||B(d,8,this.length),t.read(this,d,!0,52,8)},a.prototype.readDoubleBE=function(d,f){return d=d>>>0,f||B(d,8,this.length),t.read(this,d,!1,52,8)};function u(w,d,f,v,M,P){if(!a.isBuffer(w))throw new TypeError('"buffer" argument must be a Buffer instance');if(d>M||d<P)throw new RangeError('"value" argument is out of bounds');if(f+v>w.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(d,f,v,M){if(d=+d,f=f>>>0,v=v>>>0,!M){const be=Math.pow(2,8*v)-1;u(this,d,f,v,be,0)}let P=1,N=0;for(this[f]=d&255;++N<v&&(P*=256);)this[f+N]=d/P&255;return f+v},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(d,f,v,M){if(d=+d,f=f>>>0,v=v>>>0,!M){const be=Math.pow(2,8*v)-1;u(this,d,f,v,be,0)}let P=v-1,N=1;for(this[f+P]=d&255;--P>=0&&(N*=256);)this[f+P]=d/N&255;return f+v},a.prototype.writeUint8=a.prototype.writeUInt8=function(d,f,v){return d=+d,f=f>>>0,v||u(this,d,f,1,255,0),this[f]=d&255,f+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(d,f,v){return d=+d,f=f>>>0,v||u(this,d,f,2,65535,0),this[f]=d&255,this[f+1]=d>>>8,f+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(d,f,v){return d=+d,f=f>>>0,v||u(this,d,f,2,65535,0),this[f]=d>>>8,this[f+1]=d&255,f+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(d,f,v){return d=+d,f=f>>>0,v||u(this,d,f,4,4294967295,0),this[f+3]=d>>>24,this[f+2]=d>>>16,this[f+1]=d>>>8,this[f]=d&255,f+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(d,f,v){return d=+d,f=f>>>0,v||u(this,d,f,4,4294967295,0),this[f]=d>>>24,this[f+1]=d>>>16,this[f+2]=d>>>8,this[f+3]=d&255,f+4};function k(w,d,f,v,M){ye(d,v,M,w,f,7);let P=Number(d&BigInt(4294967295));w[f++]=P,P=P>>8,w[f++]=P,P=P>>8,w[f++]=P,P=P>>8,w[f++]=P;let N=Number(d>>BigInt(32)&BigInt(4294967295));return w[f++]=N,N=N>>8,w[f++]=N,N=N>>8,w[f++]=N,N=N>>8,w[f++]=N,f}function $(w,d,f,v,M){ye(d,v,M,w,f,7);let P=Number(d&BigInt(4294967295));w[f+7]=P,P=P>>8,w[f+6]=P,P=P>>8,w[f+5]=P,P=P>>8,w[f+4]=P;let N=Number(d>>BigInt(32)&BigInt(4294967295));return w[f+3]=N,N=N>>8,w[f+2]=N,N=N>>8,w[f+1]=N,N=N>>8,w[f]=N,f+8}a.prototype.writeBigUInt64LE=jt(function(d,f=0){return k(this,d,f,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=jt(function(d,f=0){return $(this,d,f,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(d,f,v,M){if(d=+d,f=f>>>0,!M){const he=Math.pow(2,8*v-1);u(this,d,f,v,he-1,-he)}let P=0,N=1,be=0;for(this[f]=d&255;++P<v&&(N*=256);)d<0&&be===0&&this[f+P-1]!==0&&(be=1),this[f+P]=(d/N>>0)-be&255;return f+v},a.prototype.writeIntBE=function(d,f,v,M){if(d=+d,f=f>>>0,!M){const he=Math.pow(2,8*v-1);u(this,d,f,v,he-1,-he)}let P=v-1,N=1,be=0;for(this[f+P]=d&255;--P>=0&&(N*=256);)d<0&&be===0&&this[f+P+1]!==0&&(be=1),this[f+P]=(d/N>>0)-be&255;return f+v},a.prototype.writeInt8=function(d,f,v){return d=+d,f=f>>>0,v||u(this,d,f,1,127,-128),d<0&&(d=255+d+1),this[f]=d&255,f+1},a.prototype.writeInt16LE=function(d,f,v){return d=+d,f=f>>>0,v||u(this,d,f,2,32767,-32768),this[f]=d&255,this[f+1]=d>>>8,f+2},a.prototype.writeInt16BE=function(d,f,v){return d=+d,f=f>>>0,v||u(this,d,f,2,32767,-32768),this[f]=d>>>8,this[f+1]=d&255,f+2},a.prototype.writeInt32LE=function(d,f,v){return d=+d,f=f>>>0,v||u(this,d,f,4,2147483647,-2147483648),this[f]=d&255,this[f+1]=d>>>8,this[f+2]=d>>>16,this[f+3]=d>>>24,f+4},a.prototype.writeInt32BE=function(d,f,v){return d=+d,f=f>>>0,v||u(this,d,f,4,2147483647,-2147483648),d<0&&(d=4294967295+d+1),this[f]=d>>>24,this[f+1]=d>>>16,this[f+2]=d>>>8,this[f+3]=d&255,f+4},a.prototype.writeBigInt64LE=jt(function(d,f=0){return k(this,d,f,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=jt(function(d,f=0){return $(this,d,f,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Z(w,d,f,v,M,P){if(f+v>w.length)throw new RangeError("Index out of range");if(f<0)throw new RangeError("Index out of range")}function ee(w,d,f,v,M){return d=+d,f=f>>>0,M||Z(w,d,f,4),t.write(w,d,f,v,23,4),f+4}a.prototype.writeFloatLE=function(d,f,v){return ee(this,d,f,!0,v)},a.prototype.writeFloatBE=function(d,f,v){return ee(this,d,f,!1,v)};function Ae(w,d,f,v,M){return d=+d,f=f>>>0,M||Z(w,d,f,8),t.write(w,d,f,v,52,8),f+8}a.prototype.writeDoubleLE=function(d,f,v){return Ae(this,d,f,!0,v)},a.prototype.writeDoubleBE=function(d,f,v){return Ae(this,d,f,!1,v)},a.prototype.copy=function(d,f,v,M){if(!a.isBuffer(d))throw new TypeError("argument should be a Buffer");if(v||(v=0),!M&&M!==0&&(M=this.length),f>=d.length&&(f=d.length),f||(f=0),M>0&&M<v&&(M=v),M===v||d.length===0||this.length===0)return 0;if(f<0)throw new RangeError("targetStart out of bounds");if(v<0||v>=this.length)throw new RangeError("Index out of range");if(M<0)throw new RangeError("sourceEnd out of bounds");M>this.length&&(M=this.length),d.length-f<M-v&&(M=d.length-f+v);const P=M-v;return this===d&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(f,v,M):Uint8Array.prototype.set.call(d,this.subarray(v,M),f),P},a.prototype.fill=function(d,f,v,M){if(typeof d=="string"){if(typeof f=="string"?(M=f,f=0,v=this.length):typeof v=="string"&&(M=v,v=this.length),M!==void 0&&typeof M!="string")throw new TypeError("encoding must be a string");if(typeof M=="string"&&!a.isEncoding(M))throw new TypeError("Unknown encoding: "+M);if(d.length===1){const N=d.charCodeAt(0);(M==="utf8"&&N<128||M==="latin1")&&(d=N)}}else typeof d=="number"?d=d&255:typeof d=="boolean"&&(d=Number(d));if(f<0||this.length<f||this.length<v)throw new RangeError("Out of range index");if(v<=f)return this;f=f>>>0,v=v===void 0?this.length:v>>>0,d||(d=0);let P;if(typeof d=="number")for(P=f;P<v;++P)this[P]=d;else{const N=a.isBuffer(d)?d:a.from(d,M),be=N.length;if(be===0)throw new TypeError('The value "'+d+'" is invalid for argument "value"');for(P=0;P<v-f;++P)this[P+f]=N[P%be]}return this};const le={};function ue(w,d,f){le[w]=class extends f{constructor(){super(),Object.defineProperty(this,"message",{value:d.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${w}]`,this.stack,delete this.name}get code(){return w}set code(M){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:M,writable:!0})}toString(){return`${this.name} [${w}]: ${this.message}`}}}ue("ERR_BUFFER_OUT_OF_BOUNDS",function(w){return w?`${w} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),ue("ERR_INVALID_ARG_TYPE",function(w,d){return`The "${w}" argument must be of type number. Received type ${typeof d}`},TypeError),ue("ERR_OUT_OF_RANGE",function(w,d,f){let v=`The value of "${w}" is out of range.`,M=f;return Number.isInteger(f)&&Math.abs(f)>2**32?M=Ze(String(f)):typeof f=="bigint"&&(M=String(f),(f>BigInt(2)**BigInt(32)||f<-(BigInt(2)**BigInt(32)))&&(M=Ze(M)),M+="n"),v+=` It must be ${d}. Received ${M}`,v},RangeError);function Ze(w){let d="",f=w.length;const v=w[0]==="-"?1:0;for(;f>=v+4;f-=3)d=`_${w.slice(f-3,f)}${d}`;return`${w.slice(0,f)}${d}`}function Ee(w,d,f){nt(d,"offset"),(w[d]===void 0||w[d+f]===void 0)&&Ce(d,w.length-(f+1))}function ye(w,d,f,v,M,P){if(w>f||w<d){const N=typeof d=="bigint"?"n":"";let be;throw d===0||d===BigInt(0)?be=`>= 0${N} and < 2${N} ** ${(P+1)*8}${N}`:be=`>= -(2${N} ** ${(P+1)*8-1}${N}) and < 2 ** ${(P+1)*8-1}${N}`,new le.ERR_OUT_OF_RANGE("value",be,w)}Ee(v,M,P)}function nt(w,d){if(typeof w!="number")throw new le.ERR_INVALID_ARG_TYPE(d,"number",w)}function Ce(w,d,f){throw Math.floor(w)!==w?(nt(w,f),new le.ERR_OUT_OF_RANGE("offset","an integer",w)):d<0?new le.ERR_BUFFER_OUT_OF_BOUNDS:new le.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${d}`,w)}const ke=/[^+/0-9A-Za-z-_]/g;function Rr(w){if(w=w.split("=")[0],w=w.trim().replace(ke,""),w.length<2)return"";for(;w.length%4!==0;)w=w+"=";return w}function Le(w,d){d=d||1/0;let f;const v=w.length;let M=null;const P=[];for(let N=0;N<v;++N){if(f=w.charCodeAt(N),f>55295&&f<57344){if(!M){if(f>56319){(d-=3)>-1&&P.push(239,191,189);continue}else if(N+1===v){(d-=3)>-1&&P.push(239,191,189);continue}M=f;continue}if(f<56320){(d-=3)>-1&&P.push(239,191,189),M=f;continue}f=(M-55296<<10|f-56320)+65536}else M&&(d-=3)>-1&&P.push(239,191,189);if(M=null,f<128){if((d-=1)<0)break;P.push(f)}else if(f<2048){if((d-=2)<0)break;P.push(f>>6|192,f&63|128)}else if(f<65536){if((d-=3)<0)break;P.push(f>>12|224,f>>6&63|128,f&63|128)}else if(f<1114112){if((d-=4)<0)break;P.push(f>>18|240,f>>12&63|128,f>>6&63|128,f&63|128)}else throw new Error("Invalid code point")}return P}function $e(w){const d=[];for(let f=0;f<w.length;++f)d.push(w.charCodeAt(f)&255);return d}function Wr(w,d){let f,v,M;const P=[];for(let N=0;N<w.length&&!((d-=2)<0);++N)f=w.charCodeAt(N),v=f>>8,M=f%256,P.push(M),P.push(v);return P}function Oe(w){return e.toByteArray(Rr(w))}function Re(w,d,f,v){let M;for(M=0;M<v&&!(M+f>=d.length||M>=w.length);++M)d[M+f]=w[M];return M}function Ft(w,d){return w instanceof d||w!=null&&w.constructor!=null&&w.constructor.name!=null&&w.constructor.name===d.name}function Pe(w){return w!==w}const He=function(){const w="0123456789abcdef",d=new Array(256);for(let f=0;f<16;++f){const v=f*16;for(let M=0;M<16;++M)d[v+M]=w[f]+w[M]}return d}();function jt(w){return typeof BigInt>"u"?qe:w}function qe(){throw new Error("BigInt not supported")}})(oe);var wu={exports:{}},tt=wu.exports={},bn,pn;function Ua(){throw new Error("setTimeout has not been defined")}function _a(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?bn=setTimeout:bn=Ua}catch{bn=Ua}try{typeof clearTimeout=="function"?pn=clearTimeout:pn=_a}catch{pn=_a}})();function Au(n){if(bn===setTimeout)return setTimeout(n,0);if((bn===Ua||!bn)&&setTimeout)return bn=setTimeout,setTimeout(n,0);try{return bn(n,0)}catch{try{return bn.call(null,n,0)}catch{return bn.call(this,n,0)}}}function hm(n){if(pn===clearTimeout)return clearTimeout(n);if((pn===_a||!pn)&&clearTimeout)return pn=clearTimeout,clearTimeout(n);try{return pn(n)}catch{try{return pn.call(null,n)}catch{return pn.call(this,n)}}}var zn=[],qr=!1,fr,bi=-1;function mm(){!qr||!fr||(qr=!1,fr.length?zn=fr.concat(zn):bi=-1,zn.length&&Eu())}function Eu(){if(!qr){var n=Au(mm);qr=!0;for(var e=zn.length;e;){for(fr=zn,zn=[];++bi<e;)fr&&fr[bi].run();bi=-1,e=zn.length}fr=null,qr=!1,hm(n)}}tt.nextTick=function(n){var e=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)e[t-1]=arguments[t];zn.push(new Bu(n,e)),zn.length===1&&!qr&&Au(Eu)};function Bu(n,e){this.fun=n,this.array=e}Bu.prototype.run=function(){this.fun.apply(null,this.array)};tt.title="browser";tt.browser=!0;tt.env={};tt.argv=[];tt.version="";tt.versions={};function Kn(){}tt.on=Kn;tt.addListener=Kn;tt.once=Kn;tt.off=Kn;tt.removeListener=Kn;tt.removeAllListeners=Kn;tt.emit=Kn;tt.prependListener=Kn;tt.prependOnceListener=Kn;tt.listeners=function(n){return[]};tt.binding=function(n){throw new Error("process.binding is not supported")};tt.cwd=function(){return"/"};tt.chdir=function(n){throw new Error("process.chdir is not supported")};tt.umask=function(){return 0};var xu=wu.exports;(function(n){Object.defineProperty(n,Symbol.toStringTag,{value:"Module"});const e=oe,t=xu,r=o=>o&&o.__esModule?o:{default:o},s=r(t),i=globalThis||window||void 0||self;Object.defineProperty(n,"Buffer",{enumerable:!0,get:()=>e.Buffer}),Object.defineProperty(n,"process",{enumerable:!0,get:()=>s.default}),n.global=i})(Ve);const Ui=n=>[...Array(n).keys()],Cu=(n,e)=>n.map(t=>t[e]),hr=n=>Ui(n[0].length).map(e=>Ui(n.length).map(t=>n[t][e])),bm=(n,e,t)=>{const r=new Set(Array.isArray(e)?e:[e]);return n.filter((s,i)=>r.has(i)!==t)};function pm(n,e=!1){if(n.length===0)throw new Error("Can't calculate median of empty array");const t=e?n:[...n].sort((o,a)=>o>a?1:o<a?-1:0),r=Math.floor(t.length/2);if(t.length%2===1)return t[r];const s=t[r-1],i=t[r];if(typeof s=="bigint"&&typeof i=="bigint")return(s+i)/2n;if(typeof s=="number"&&typeof i=="number")return(s+i)/2;throw new Error("Can't calculate median of array with mixed number and bigint")}function gm(n){return["string","number","symbol","bigint","boolean"].includes(typeof n)}const Hl=n=>n.length===2&&!Array.isArray(n[0])&&Array.isArray(n[1]),_i=n=>n.length===0?[]:Array.isArray(n[0])?n.map(([e,t])=>Array.isArray(t)?(Hl(t)?_i(t):t).map(r=>[e,r].flat()):[[e,t]]).flat():Hl(n)?_i(n[1]).map(e=>[n[0],e]):n,ym=(n,e)=>{const t=_i(n);if(t.length===0)throw new Error("Invalid mapping: empty");const r=e===void 0?[Ui(t[0].length-1),[t[0].length-1]]:e.map(S=>typeof S=="number"?[S]:S);let s=[],i=!0;const o=(S,A)=>{const g=Array.from(new Set(S[0]).values()),D=new Map(g.map(U=>[U,[]]));for(const[U,R]of S[0].entries())D.get(R).push(U);if(S.length===1){const U=Object.fromEntries(g.map(R=>[R,D.get(R).map(F=>A[F].length===1?A[F][0]:A[F])]));if(i){for(const R of D.values())if(R.length>1)return i=!1,U;s.push(U)}return U}const x=hr(S.slice(1));return Object.fromEntries(g.map(U=>{const R=D.get(U),F=hr(R.map(z=>x[z])),W=R.map(z=>A[z]);return[U,o(F,W)]}))},a=hr(t),l=S=>{const A=a[S];if(A===void 0)throw new Error(`Invalid shape: column ${S} does not exist`);return A},[h,m]=r.map(S=>S.map(A=>l(A)));if(h.length===0)throw new Error("Invalid shape: empty key set");if(m.length===0)throw new Error("Invalid shape: empty value set");for(const S of h)for(const A of S)if(!gm(A))throw new Error(`Invalid key: ${A} in ${S}`);const E=o(h,hr(m));if(i)for(const S of s)for(const A of Object.keys(S))S[A]=S[A][0];return E};function we(n,e){const t=r=>{const s=(...i)=>i.reduce((o,a)=>o?o[a.toString()]??void 0:void 0,r);return Object.assign(s,{has:(...i)=>s(...i)!==void 0,get:(...i)=>s(...i),subMap:i=>t(r[i.toString()])})};return t(ym(n,e))}function Cc(n){let e=null;return()=>(e||(e=n()),e)}function wm(n){try{return n(),!1}catch{return!0}}function Am(n,e,t){return n<e?e:n>t?t:n}var Em=["int","uint","bytes","array","switch"],Su="big",Ji=6,Er=n=>typeof n=="number"||typeof n=="bigint",es=n=>n instanceof Uint8Array,Bm=n=>Er(n)||es(n),ks=n=>Em.includes(n==null?void 0:n.binary),xm=n=>ks(n)||Array.isArray(n)&&n.every(ks),Cm=n=>typeof(n==null?void 0:n.from)=="number",Sm=n=>typeof(n==null?void 0:n.from)=="bigint",Dm=n=>Cm(n)||Sm(n),ts=n=>es(n==null?void 0:n.from),vm=n=>Dm(n)||ts(n),Du=(n,e)=>{if(n!==e)throw new Error(`size mismatch: layout size: ${n}, data size: ${e}`);return e},pi=(n,e)=>"size"in n&&n.size!==void 0?Du(n.size,e):e,Ma=(n,e)=>{if(n!=e)throw new Error(`value mismatch: (constant) layout value: ${n}, data value: ${e}`)},Ra=(n,e,t)=>{const r=(h,m)=>m===void 0?[0,h.length]:Array.isArray(m)?m:[m,h.length],[s,i]=r(n,t==null?void 0:t.customSlice),[o,a]=r(e,t==null?void 0:t.dataSlize),l=i-s;Du(l,a-o);for(let h=0;h<n.length;++h)if(n[h+s]!==e[h+o])throw new Error(`binary data mismatch: layout value: ${n}, offset: ${s}, data value: ${e}, offset: ${o}`)};function vu(n,e){const t=e[n.idTag??"id"];return n.layouts.find(([r])=>(Array.isArray(r)?r[1]:r)==t)}function ku(n){return ar(n,en)}var en=Symbol("staticCalc");function km(n,e){const t=[],r=ar(n,e,t);if(r===null)throw new Error(`coding error: couldn't calculate layout size for layout ${n} with data ${e}`);return[r,t]}function ql(n,e,t){const r=s=>(t!==void 0&&t.push(s),s);switch(n.binary){case"int":case"uint":return n.size;case"bytes":{const s="lengthSize"in n?n.lengthSize|0:0;if("layout"in n){const{custom:o}=n,a=ar(n.layout,o===void 0?e:typeof o.from=="function"?e!==en?r(o.from(e)):en:o.from,t);return a===null?"size"in n?n.size??null:null:s+pi(n,a)}const{custom:i}=n;return es(i)?s+i.length:ts(i)?s+i.from.length:i===void 0?e!==en?s+pi(n,e.length):null:e!==en?s+pi(n,r(i.from(e)).length):null}case"array":{const s="length"in n?n.length:void 0;if(e===en){if(s!==void 0){const o=ar(n.layout,en,t);return o!==null?s*o:null}return null}let i=0;if(s!==void 0&&s!==e.length)throw new Error(`array length mismatch: layout length: ${s}, data length: ${e.length}`);"lengthSize"in n&&n.lengthSize!==void 0&&(i+=n.lengthSize);for(let o=0;o<e.length;++o){const a=ar(n.layout,e[o],t);if(a===null)return null;i+=a}return i}case"switch":{if(e!==en){const[i,o]=vu(n,e),a=ar(o,e,t);return a!==null?n.idSize+a:null}let s=null;for(const[i,o]of n.layouts){const a=ar(o,en,t);if(s===null)s=a;else if(a!==s)return null}return n.idSize+s}}}function ar(n,e,t){if(ks(n))return ql(n,e,t);let r=0;for(const s of n){let i;if(e===en)i=en;else if(!("omit"in s)||!s.omit){if(!(s.name in e))throw new Error(`missing data for layout item: ${s.name}`);i=e[s.name]}const o=ql(s,i,t);if(o===null){if(e!==en)throw new Error(`coding error: couldn't calculate size for layout item: ${s.name}`);return null}r+=o}return r}var sa=(n,e)=>{n.bytes.set(e,n.offset),n.offset+=e.length},Kl=n=>n.bytesConversions[n.position++];function Cn(n,e,t){const[r,s]=km(n,e),i={bytes:t??new Uint8Array(r),offset:0};if(gi(n,e,i,{bytesConversions:s,position:0}),i.offset!==i.bytes.length)throw new Error(`encoded data is shorter than expected: ${i.bytes.length} > ${i.offset}`);return t?i.offset:i.bytes}var Fm=2**(Ji*8);function mr(n,e,t,r=Su,s=!1){if(!s&&n<0)throw new Error(`Value ${n} is negative but unsigned`);if(typeof n=="number"){if(!Number.isInteger(n))throw new Error(`Value ${n} is not an integer`);if(e>Ji){if(n>=Fm)throw new Error(`Value ${n} is too large to be safely converted into an integer`);if(s&&n<-281474976710656)throw new Error(`Value ${n} is too small to be safely converted into an integer`)}}const i=2n**BigInt(e*8-(s?1:0));if(n>=i)throw new Error(`Value ${n} is too large for ${e} bytes`);if(s&&n<-i)throw new Error(`Value ${n} is too small for ${e} bytes`);for(let o=0;o<e;++o)t.bytes[t.offset+o]=Number(BigInt(n)>>BigInt(8*(r==="big"?e-o-1:o))&0xffn);t.offset+=e}function gi(n,e,t,r){if(ks(n))jl(n,e,t,r);else for(const s of n)try{jl(s,e[s.name],t,r)}catch(i){throw i.message=`when serializing item '${s.name}': ${i.message}`,i}}function jl(n,e,t,r){switch(n.binary){case"int":case"uint":{const s=(()=>{var i;return Er(n.custom)?("omit"in n&&n.omit||Ma(n.custom,e),n.custom):Er((i=n==null?void 0:n.custom)==null?void 0:i.from)?n.custom.from:n.custom!==void 0?n.custom.from(e):e})();mr(s,n.size,t,n.endianness,n.binary==="int");break}case"bytes":{const s=t.offset;if("lengthSize"in n&&n.lengthSize!==void 0&&(t.offset+=n.lengthSize),"layout"in n){const{custom:i}=n;let o;i===void 0?o=e:typeof i.from!="function"?o=i.from:o=Kl(r),gi(n.layout,o,t,r)}else{const{custom:i}=n;es(i)?("omit"in n&&n.omit||Ra(i,e),sa(t,i)):ts(i)?sa(t,i.from):sa(t,i!==void 0?Kl(r):e)}if("lengthSize"in n&&n.lengthSize!==void 0){const i=t.offset-s-n.lengthSize,o=t.offset;t.offset=s,mr(i,n.lengthSize,t,n.lengthEndianness),t.offset=o}else pi(n,t.offset-s);break}case"array":{if("length"in n&&n.length!==e.length)throw new Error(`array length mismatch: layout length: ${n.length}, data length: ${e.length}`);"lengthSize"in n&&n.lengthSize!==void 0&&mr(e.length,n.lengthSize,t,n.lengthEndianness);for(let s=0;s<e.length;++s)gi(n.layout,e[s],t,r);break}case"switch":{const[s,i]=vu(n,e),o=Array.isArray(s)?s[0]:s;mr(o,n.idSize,t,n.idEndianness),gi(i,e,t,r);break}}}function Fu(n){const e=n.custom;if(!("cachedSerializedFrom"in e)&&(e.cachedSerializedFrom=Cn(n.layout,e.from),"size"in n&&n.size!==void 0&&n.size!==e.cachedSerializedFrom.length))throw new Error("Layout specification error: custom.from does not serialize to specified size");return e.cachedSerializedFrom}function Sn(n,e,t){const r=t??!0,s={bytes:e,offset:0,end:e.length},i=Bs(n,s);if(r&&s.offset!==s.end)throw new Error(`encoded data is longer than expected: ${s.end} > ${s.offset}`);return r?i:[i,s.offset]}function yi(n,e){const t=n.offset+e;if(t>n.end)throw new Error(`chunk is shorter than expected: ${n.end} < ${t}`);n.offset=t}function Bs(n,e){if(!Array.isArray(n))return $l(n,e);let t={};for(const r of n)try{(r.omit?{}:t)[r.name]=$l(r,e)}catch(s){throw s.message=`when deserializing item '${r.name}': ${s.message}`,s}return t}function oi(n,e,t=Su,r=!1){let s=0n;for(let i=0;i<e;++i)s|=BigInt(n.bytes[n.offset+i])<<BigInt(8*(t==="big"?e-i-1:i));return r&&n.bytes[n.offset+(t==="big"?0:e-1)]&128&&(s-=1n<<BigInt(8*e)),yi(n,e),e>Ji?s:Number(s)}function $l(n,e){switch(n.binary){case"int":case"uint":{const t=oi(e,n.size,n.endianness,n.binary==="int"),{custom:r}=n;return Er(r)?(Ma(r,t),r):Er(r==null?void 0:r.from)?(Ma(r.from,t),r.to):r!==void 0?r.to(t):t}case"bytes":{const t="lengthSize"in n&&n.lengthSize!==void 0?oi(e,n.lengthSize,n.lengthEndianness):n==null?void 0:n.size;if("layout"in n){const{custom:a}=n,l=e.offset;let h;if(t===void 0)h=Bs(n.layout,e);else{const m={...e,end:e.offset+t};if(yi(e,t),h=Bs(n.layout,m),m.offset!==m.end)throw new Error(`read less data than expected: ${m.offset-e.offset} < ${t}`)}return a!==void 0?typeof a.from!="function"?(Ra(Fu(n),e.bytes,{dataSlize:[l,e.offset]}),a.to):a.to(h):h}const{custom:r}=n;{let a,l;if(es(r)?a=r:ts(r)&&(a=r.from,l=r.to),a!==void 0){const h=t??a.length,m=e.bytes.subarray(e.offset,e.offset+h);return Ra(a,m),yi(e,h),l??a}}const s=e.offset,i=t!==void 0?e.offset+t:e.end;yi(e,i-s);const o=e.bytes.subarray(s,i);return r!==void 0?r.to(o):o}case"array":{let t=[];const{layout:r}=n,s=()=>{const o=Bs(r,e);t.push(o)};let i=null;if("length"in n&&n.length!==void 0?i=n.length:"lengthSize"in n&&n.lengthSize!==void 0&&(i=oi(e,n.lengthSize,n.lengthEndianness)),i!==null)for(let o=0;o<i;++o)s();else for(;e.offset<e.end;)s();return t}case"switch":{const t=oi(e,n.idSize,n.idEndianness),{layouts:r}=n;if(r.length===0)throw new Error("switch item has no layouts");const s=typeof r[0][0]=="number",i=r.find(([h])=>s?h===t:h[0]===t);if(i===void 0)throw new Error(`unknown id value: ${t}`);const[o,a]=i,l=Bs(a,e);return{[n.idTag??"id"]:s?t:o[1],...l}}}}function Tm(n,e){return wi(n,e)}function Vl(n,e){switch(n.binary){case"bytes":if("layout"in n){const{custom:t}=n;return t===void 0||typeof t.from!="function"?wi(n.layout,t?t.from:e):e}case"int":case"uint":{const{custom:t}=n;return n!=null&&n.omit?void 0:Bm(t)?t:vm(t)?t.to:e}case"array":return Array.isArray(e)?e.map(t=>wi(n.layout,t)):void 0;case"switch":{const t=e[n.idTag??"id"],[r,s]=n.layouts.find(([i])=>(Array.isArray(i)?i[1]:i)==t);return{[n.idTag??"id"]:t,...wi(s,e)}}}}function wi(n,e){if(e=e??{},ks(n))return Vl(n,e);const t={};for(const r of n){const s=Vl(r,e[r.name]??{});s!==void 0&&(t[r.name]=s)}return t}function Im(n,e){const[t,r]=_m(n);if(!t)throw new Error("Cannot uniquely distinguished the given layouts");return s=>{const i=r(s);return i.length===0?null:i[0]}}function Wa(n){return n.reduce((e,t)=>e|BigInt(1)<<BigInt(t),BigInt(0))}function ai(n){const e=[];for(let t=0n;n>0n;n>>=1n,++t)n&1n&&e.push(Number(t));return e}function Et(n){let e=0;for(;n>0n;n>>=1n)e+=Number(n&1n);return e}var Gl=n=>n>0?2**(8*n)-1:1/0;function Yl(n,e,t){var r;switch(n.binary){case"int":case"uint":{const s=Er(n.custom)?n.custom:Er((r=n==null?void 0:n.custom)==null?void 0:r.from)?n.custom.from:null;if(s!==null&&e!==null){const i={bytes:new Uint8Array(n.size),offset:0};mr(s,n.size,i,n.endianness,n.binary==="int"),t.push([e,i.bytes])}return[n.size,n.size]}case"bytes":{const s="lengthSize"in n?n.lengthSize|0:0;let i,o;if("layout"in n){const{custom:l}=n;if(l!==void 0&&typeof l.from!="function")i=Fu(n),o=i.length;else{const h=ku(n.layout);h!==null&&(o=h)}}else{const{custom:l}=n;es(l)?(i=l,o=l.length):ts(l)&&(i=l.from,o=l.from.length)}if(s>0&&e!==null){if(o!==void 0){const l={bytes:new Uint8Array(s),offset:0},h=n.lengthEndianness;mr(o,s,l,h,!1),t.push([e,l.bytes])}e+=s}if(i!==void 0)return e!==null&&t.push([e,i]),[s+i.length,s+i.length];const a="size"in n&&n.size!==void 0?[n.size,n.size]:void 0;if("layout"in n){const l=Ai(n.layout,e,t);return a??[s+l[0],s+l[1]]}return a??[s,Gl(s)]}case"array":{if("length"in n){let i=[];const o=Ai(n.layout,0,i);if(e!==null)if(o[0]!==o[1]){if(n.length>0)for(const[a,l]of i)t.push([e+a,l])}else for(let a=0;a<n.length;++a)for(const[l,h]of i)t.push([e+l+a*o[0],h]);return[n.length*o[0],n.length*o[1]]}const s=n.lengthSize|0;return[s,Gl(s)]}case"switch":{const s=n.layouts.map(l=>[]),{idSize:i,idEndianness:o}=n,a=n.layouts.map(([l,h],m)=>{const E=Array.isArray(l)?l[0]:l;if(e!==null){const A={bytes:new Uint8Array(i),offset:0};mr(E,i,A,o),s[m].push([0,A.bytes])}const S=Ai(h,e!==null?i:null,s[m]);return[S[0]+i,S[1]+i]});return e!==null&&s.every(l=>l.length>0)&&(()=>{const l=Math.min(...s.map(m=>m.at(-1)[0]+m.at(-1)[1].length)),h=s.map(m=>0);for(let m=0;m<l;){let E=null,S=0;for(;S<s.length;){let A=h[S];const g=s[S],[D,x]=g[A];if(D+x.length<=m){if(++A,A===g.length)return;h[S]=A,m=g[A][0];break}const U=x[m-D];if(E===null&&(E=U),U!==E){++m;break}++S}S===s.length&&(t.push([e+m,new Uint8Array([E])]),++m)}})(),[Math.min(...a.map(([l])=>l)),Math.max(...a.map(([l,h])=>h))]}}}function Ai(n,e,t){if(!Array.isArray(n))return Yl(n,e,t);let r=[0,0];for(const s of n){const i=Yl(s,e,t);r[0]+=i[0],r[1]+=i[1],e!==null&&(e=i[0]===i[1]?e+i[0]:null)}return r}function Um(n){const e=new Map;let t=[];const r=s=>{for(;t.length>0&&t[0][0]<s;){const i=t[0][0]+1,o=t.findIndex(([a])=>i<=a);o===-1?t=[]:t.splice(0,o),e.set(i,Wa(t.map(([,a])=>a)))}};for(const[[s,i],o]of n){r(s);const a=t.findIndex(([l])=>l>i);a===-1?t.push([i,o]):t.splice(a,0,[i,o]),e.set(s,Wa(t.map(([,l])=>l)))}return r(1/0),e}function _m(n){if(n.length===0)throw new Error("Cannot discriminate empty set of layouts");const e=0n,t=(1n<<BigInt(n.length))-1n,r=n.map(()=>[]),s=n.map((F,W)=>Ai(F,0,r[W])),i=s.map((F,W)=>[F,W]).sort(([[F]],[[W]])=>F-W),o=(()=>{let F=t;const W=new Map;for(const[[z],H]of i)F^=1n<<BigInt(H),W.set(z,F);return W})(),a=Um(i),l=n.length-Math.max(...[...a.values()].map(F=>Et(F))),h=F=>{let W=t;for(const[z,H]of o){if(F<z)break;W=H}return W},m=F=>{let W=e;for(const[z,H]of a){if(F<z)break;W=H}return W},E=Array.from({length:Math.max(...r.map(F=>F.length>0?F.at(-1)[0]+F.at(-1)[1].length:0))}).map(()=>[]);for(let F=0;F<r.length;++F)for(const[W,z]of r[F])for(let H=0;H<z.length;++H)E[W+H].push([z[H],F]);let S=[];for(const[F,W]of E.entries()){const z=h(F),H=z^Wa(W.map(([,ie])=>ie)),K=t^z,G=new Map;for(const[ie,ne]of W)G.has(ie)||G.set(ie,e),G.set(ie,G.get(ie)|1n<<BigInt(ne));let V=n.length-Math.max(Et(H),Et(K));for(const ie of G.values()){const ne=W.length-Et(ie)+Et(K);V=Math.min(V,ne)}if(V!==0){if(V===n.length-1)return[!0,ie=>ai(ie.length<=F?K:G.get(ie[F])??e)];S.push([V,F,K,G,H])}}if(l===n.length-1)return[!0,F=>ai(m(F.length))];S.sort(([F],[W])=>W-F);let A=!0;const g=new Map,D=new Map,x=(F,W)=>{g.set(F,W),D.has(Et(F))||D.set(Et(F),[]),D.get(Et(F)).push(F)},U=(F,W)=>{if(Et(F)<=1||g.has(F))return;let z=0;const H=new Map;for(const G of ai(F)){const V=s[G][0],ie=a.get(V)&F;H.set(V,ie),z=Math.max(z,Et(ie))}z=Et(F)-z;const K=[];for(const[G,V,ie,ne,ae]of W){const I=new Map;let c=0;for(const[y,C]of ne){const T=C&F;Et(T)>0&&(I.set(y,T),c+=Et(T))}const b=ie&F;let p=I.size>0?G:0;for(const y of I.values()){const C=c-Et(y)+Et(b);p=Math.min(p,C)}if(p!==0){if(p===Et(F)-1){x(F,[V,b,I]);return}K.push([p,V,b,I,ae&F])}}if(z===Et(F)-1){x(F,"size");return}if(K.sort(([G],[V])=>V-G),K.length>0&&K[0][0]>=z){const[,G,V,ie,ne]=K[0];x(F,[G,V,ie]),U(V,K);for(const ae of ie.values())U(ae|ne,K.slice(1));return}if(z>0){x(F,"size");for(const G of H.values())U(G,K);return}x(F,"indistinguishable"),A=!1};U(t,S);const R=F=>{for(let W=Et(F)+1;W<n.length-2;++W)for(const z of D.get(W)??[])if((F&z)==F)return g.get(z);throw new Error("Implementation error in layout discrimination algorithm")};return[A,F=>{let W=t,z=g.get(W);for(;z!=="indistinguishable";){if(z==="size")W&=m(F.length);else{const[H,K,G]=z;if(F.length<=H)W&=K;else{const V=F[H];for(const[ie,ne]of G)ie!==V&&(W^=W&ne);W^=W&K}}if(Et(W)<=1)break;z=g.get(W)??R(W)}return ai(W)}]}var Qi=(n,e)=>({...n,binary:"bytes",...e===void 0?{}:xm(e)?{layout:e}:e instanceof Uint8Array||ts(e)||!Array.isArray(e)?{custom:e}:{layout:e[0],custom:e[1]}});function Mm(n,e){const t=Object.fromEntries(n.map(([s,i])=>[i,s])),r=Object.fromEntries(n);return{binary:"uint",size:(e==null?void 0:e.size)??1,endianness:(e==null?void 0:e.endianness)??"big",custom:{to:s=>{const i=t[s];if(i===void 0)throw new Error(`Invalid enum value: ${s}`);return i},from:s=>r[s]}}}function Rm(n,e){return{binary:"uint",size:Math.ceil(n.length/8),custom:{to:t=>{const r={};for(let s=0;s<n.length;++s)n[s]&&(r[n[s]]=(BigInt(t)&1n<<BigInt(s))!==0n);return r},from:t=>{let r=0n;for(let s=0;s<n.length;++s)n[s]&&t[n[s]]&&(r|=1n<<BigInt(s));return n.length>Ji?r:Number(r)}}}}function Wm(n,e){return Number(Number(n).toFixed(e))}function Ei(n,e){if(Pm(n,e),n=n.toString(),n.includes("e"))throw new Error("Scientific notation is not supported yet by Amount");const t=n.split(".");if(t.length>2)throw"Too many decimals";let[r,s]=t.length===0?["0",""]:t.length===1?[t[0],""]:t;if(s=s.padEnd(e,"0"),s.length>e){if(BigInt(s.substring(e))!==0n)throw new Error("Amount: invalid input. Decimals too low.");s=s.substring(0,e)}return{amount:BigInt(r+s).toString(),decimals:e}}function Bi(n,e){if(n.decimals<=e)return n;const t=BigInt(n.decimals-e);return{amount:(gn(n)/10n**t*10n**t).toString(),decimals:n.decimals}}function xs(n,e){if(n.decimals===e)return n;if(n.amount==="0")return{amount:n.amount,decimals:e};const t=e-n.decimals;if(t>0)return{amount:n.amount+"0".repeat(t),decimals:e};if(BigInt(n.amount.substring(n.amount.length+t))===0n)return{amount:n.amount.substring(0,n.amount.length+t),decimals:e};throw new Error(`scaleAmount(${JSON.stringify(n)}, ${e}) would result in altered amount. Use truncateAmount first if you intended to truncate it.`)}function Kr(n,e){return{amount:n.toString(),decimals:e}}function gn(n){return Tu(n),BigInt(n.amount)}function Sc(n,e){Tu(n);let t=n.amount.substring(0,n.amount.length-n.decimals).padStart(1,"0"),r=n.amount.substring(n.amount.length-n.decimals).padStart(n.decimals,"0");if(e!==void 0){for(;r.length>e&&r[r.length-1]==="0";)r=r.substring(0,r.length-1);r=r.padEnd(e,"0")}else r=r.replace(/0+$/,"");return r.length>0?`${t}.${r}`:t}function Cs(n){return Number(Sc(n))}function Xl(n,e){return Sc(Kr(n,e))}function Pm(n,e){if(typeof n=="number"){if(!isFinite(n))throw new Error("Amount: invalid input. Amount must be finite");if(n<0)throw new Error("Amount: invalid input. Amount cannot be negative")}else if(!/^[0-9\.]*$/.test(n))throw new Error("Amount: invalid input. Must only contain digits.");if(!isFinite(e))throw new Error("Amount: invalid input. Decimals must be finite")}function Tu(n){if(!/^[0-9]*$/.test(n.amount))throw new Error("Amount: invalid input. Must only contain digits.");if(n.decimals<0)throw new Error("Amount: invalid input. Decimals must be >= 0");if(!isFinite(n.decimals))throw new Error("Amount: invalid input. Decimals must be a finite number.")}const Fs=(n=0,e=0,t=0)=>new Date(Date.now()+(n*60*60+e*60+t)*1e3);/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Ts(n){return n instanceof Uint8Array||ArrayBuffer.isView(n)&&n.constructor.name==="Uint8Array"}function Iu(n,e){return Array.isArray(e)?e.length===0?!0:n?e.every(t=>typeof t=="string"):e.every(t=>Number.isSafeInteger(t)):!1}function Uu(n){if(typeof n!="function")throw new Error("function expected");return!0}function $r(n,e){if(typeof e!="string")throw new Error(`${n}: string expected`);return!0}function ns(n){if(!Number.isSafeInteger(n))throw new Error(`invalid integer: ${n}`)}function Mi(n){if(!Array.isArray(n))throw new Error("array expected")}function Ri(n,e){if(!Iu(!0,e))throw new Error(`${n}: array of strings expected`)}function Dc(n,e){if(!Iu(!1,e))throw new Error(`${n}: array of numbers expected`)}function Gs(...n){const e=i=>i,t=(i,o)=>a=>i(o(a)),r=n.map(i=>i.encode).reduceRight(t,e),s=n.map(i=>i.decode).reduce(t,e);return{encode:r,decode:s}}function eo(n){const e=typeof n=="string"?n.split(""):n,t=e.length;Ri("alphabet",e);const r=new Map(e.map((s,i)=>[s,i]));return{encode:s=>(Mi(s),s.map(i=>{if(!Number.isSafeInteger(i)||i<0||i>=t)throw new Error(`alphabet.encode: digit index outside alphabet "${i}". Allowed: ${n}`);return e[i]})),decode:s=>(Mi(s),s.map(i=>{$r("alphabet.decode",i);const o=r.get(i);if(o===void 0)throw new Error(`Unknown letter: "${i}". Allowed: ${n}`);return o}))}}function to(n=""){return $r("join",n),{encode:e=>(Ri("join.decode",e),e.join(n)),decode:e=>($r("join.decode",e),e.split(n))}}function Lm(n,e="="){return ns(n),$r("padding",e),{encode(t){for(Ri("padding.encode",t);t.length*n%8;)t.push(e);return t},decode(t){Ri("padding.decode",t);let r=t.length;if(r*n%8)throw new Error("padding: invalid, string should have whole number of bytes");for(;r>0&&t[r-1]===e;r--)if((r-1)*n%8===0)throw new Error("padding: invalid, string has too much padding");return t.slice(0,r)}}}function Zl(n,e,t){if(e<2)throw new Error(`convertRadix: invalid from=${e}, base cannot be less than 2`);if(t<2)throw new Error(`convertRadix: invalid to=${t}, base cannot be less than 2`);if(Mi(n),!n.length)return[];let r=0;const s=[],i=Array.from(n,a=>{if(ns(a),a<0||a>=e)throw new Error(`invalid integer: ${a}`);return a}),o=i.length;for(;;){let a=0,l=!0;for(let h=r;h<o;h++){const m=i[h],E=e*a,S=E+m;if(!Number.isSafeInteger(S)||E/e!==a||S-m!==E)throw new Error("convertRadix: carry overflow");const A=S/t;a=S%t;const g=Math.floor(A);if(i[h]=g,!Number.isSafeInteger(g)||g*t+a!==S)throw new Error("convertRadix: carry overflow");if(l)g?l=!1:r=h;else continue}if(s.push(a),l)break}for(let a=0;a<n.length-1&&n[a]===0;a++)s.push(0);return s.reverse()}const _u=(n,e)=>e===0?n:_u(e,n%e),Wi=(n,e)=>n+(e-_u(n,e)),xi=(()=>{let n=[];for(let e=0;e<40;e++)n.push(2**e);return n})();function Pa(n,e,t,r){if(Mi(n),e<=0||e>32)throw new Error(`convertRadix2: wrong from=${e}`);if(t<=0||t>32)throw new Error(`convertRadix2: wrong to=${t}`);if(Wi(e,t)>32)throw new Error(`convertRadix2: carry overflow from=${e} to=${t} carryBits=${Wi(e,t)}`);let s=0,i=0;const o=xi[e],a=xi[t]-1,l=[];for(const h of n){if(ns(h),h>=o)throw new Error(`convertRadix2: invalid data word=${h} from=${e}`);if(s=s<<e|h,i+e>32)throw new Error(`convertRadix2: carry overflow pos=${i} from=${e}`);for(i+=e;i>=t;i-=t)l.push((s>>i-t&a)>>>0);const m=xi[i];if(m===void 0)throw new Error("invalid carry");s&=m-1}if(s=s<<t-i&a,!r&&i>=e)throw new Error("Excess padding");if(!r&&s>0)throw new Error(`Non-zero padding: ${s}`);return r&&i>0&&l.push(s>>>0),l}function Om(n){ns(n);const e=2**8;return{encode:t=>{if(!Ts(t))throw new Error("radix.encode input should be Uint8Array");return Zl(Array.from(t),e,n)},decode:t=>(Dc("radix.decode",t),Uint8Array.from(Zl(t,n,e)))}}function vc(n,e=!1){if(ns(n),n<=0||n>32)throw new Error("radix2: bits should be in (0..32]");if(Wi(8,n)>32||Wi(n,8)>32)throw new Error("radix2: carry overflow");return{encode:t=>{if(!Ts(t))throw new Error("radix2.encode input should be Uint8Array");return Pa(Array.from(t),8,n,!e)},decode:t=>(Dc("radix2.decode",t),Uint8Array.from(Pa(t,n,8,e)))}}function Jl(n){return Uu(n),function(...e){try{return n.apply(null,e)}catch{}}}function Nm(n,e){return ns(n),Uu(e),{encode(t){if(!Ts(t))throw new Error("checksum.encode: input should be Uint8Array");const r=e(t).slice(0,n),s=new Uint8Array(t.length+n);return s.set(t),s.set(r,t.length),s},decode(t){if(!Ts(t))throw new Error("checksum.decode: input should be Uint8Array");const r=t.slice(0,-n),s=t.slice(-n),i=e(r).slice(0,n);for(let o=0;o<n;o++)if(i[o]!==s[o])throw new Error("Invalid checksum");return r}}}const Ql=Gs(vc(4),eo("0123456789ABCDEF"),to("")),ed=Gs(vc(6),eo("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),Lm(6),to("")),zm=n=>Gs(Om(58),eo(n),to("")),La=zm("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),Hm=n=>Gs(Nm(4,e=>n(n(e))),La),Oa=Gs(eo("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),to("")),td=[996825010,642813549,513874426,1027748829,705979059];function gs(n){const e=n>>25;let t=(n&33554431)<<5;for(let r=0;r<td.length;r++)(e>>r&1)===1&&(t^=td[r]);return t}function nd(n,e,t=1){const r=n.length;let s=1;for(let i=0;i<r;i++){const o=n.charCodeAt(i);if(o<33||o>126)throw new Error(`Invalid prefix (${n})`);s=gs(s)^o>>5}s=gs(s);for(let i=0;i<r;i++)s=gs(s)^n.charCodeAt(i)&31;for(let i of e)s=gs(s)^i;for(let i=0;i<6;i++)s=gs(s);return s^=t,Oa.encode(Pa([s%xi[30]],30,5,!1))}function qm(n){const e=n==="bech32"?1:734539939,t=vc(5),r=t.decode,s=t.encode,i=Jl(r);function o(E,S,A=90){$r("bech32.encode prefix",E),Ts(S)&&(S=Array.from(S)),Dc("bech32.encode",S);const g=E.length;if(g===0)throw new TypeError(`Invalid prefix length ${g}`);const D=g+7+S.length;if(A!==!1&&D>A)throw new TypeError(`Length ${D} exceeds limit ${A}`);const x=E.toLowerCase(),U=nd(x,S,e);return`${x}1${Oa.encode(S)}${U}`}function a(E,S=90){$r("bech32.decode input",E);const A=E.length;if(A<8||S!==!1&&A>S)throw new TypeError(`invalid string length: ${A} (${E}). Expected (8..${S})`);const g=E.toLowerCase();if(E!==g&&E!==E.toUpperCase())throw new Error("String must be lowercase or uppercase");const D=g.lastIndexOf("1");if(D===0||D===-1)throw new Error('Letter "1" must be present between prefix and data only');const x=g.slice(0,D),U=g.slice(D+1);if(U.length<6)throw new Error("Data must be at least 6 characters long");const R=Oa.decode(U).slice(0,-6),F=nd(x,R,e);if(!U.endsWith(F))throw new Error(`Invalid checksum in ${E}: expected "${F}"`);return{prefix:x,words:R}}const l=Jl(a);function h(E){const{prefix:S,words:A}=a(E,!1);return{prefix:S,words:A,bytes:r(A)}}function m(E,S){return o(E,s(S))}return{encode:o,decode:a,encodeFromBytes:m,decodeToBytes:h,decodeUnsafe:l,fromWords:r,fromWordsUnsafe:i,toWords:s}}const Mu=qm("bech32"),Ru=(n,e)=>e.startsWith(n)?e.slice(n.length):e,Km=/^(?:0x)?[0-9a-fA-F]+$/,_t={valid:n=>Km.test(n),decode:n=>Ql.decode(Ru("0x",n).toUpperCase()),encode:(n,e=!1)=>(n=typeof n=="string"?zt.encode(n):n,(e?"0x":"")+Ql.encode(n).toLowerCase())},jm=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,no={valid:n=>jm.test(n),decode:ed.decode,encode:n=>ed.encode(typeof n=="string"?zt.encode(n):n)},Wu={decode:La.decode,encode:n=>La.encode(typeof n=="string"?zt.encode(n):n)},Ss={decode:n=>(typeof n!="string"&&(n=_t.encode(n,!0)),n===""||n==="0x"?0n:BigInt(n)),encode:(n,e=!1)=>Ss.toString(n,e),toString:(n,e=!1)=>{let t=n.toString(16);return t=t.length%2===1?t="0"+t:t,e?"0x"+t:t},toBytes:(n,e)=>{typeof n=="number"&&(n=Ss.toBigInt(n));const t=_t.decode(Ss.toString(n));if(!e)return t;if(e<t.length)throw new Error(`Can't fit ${n} into ${e} bytes.`);return zt.zpad(t,e)},toNumber:n=>{if(n>BigInt(Number.MAX_SAFE_INTEGER))throw new Error(`Invalid cast: ${n} exceeds MAX_SAFE_INTEGER`);return Number(n)},toBigInt:n=>{if(n>Number.MAX_SAFE_INTEGER)throw new Error(`Invalid cast: ${n} exceeds MAX_SAFE_INTEGER`);return BigInt(n)}},zt={encode:n=>new TextEncoder().encode(n),decode:n=>new TextDecoder().decode(n),equals:(n,e)=>n.length===e.length&&n.every((t,r)=>t===e[r]),zpad:(n,e,t=!0)=>t?zt.concat(new Uint8Array(e-n.length),n):zt.concat(n,new Uint8Array(e-n.length)),concat:(...n)=>{const e=n.reduce((s,i)=>s+i.length,0),t=new Uint8Array(e);let r=0;return n.forEach(s=>{t.set(s,r),r+=s.length}),t}},kc=[[1,"Solana"],[2,"Ethereum"],[3,"Terra"],[4,"Bsc"],[5,"Polygon"],[6,"Avalanche"],[7,"Oasis"],[8,"Algorand"],[9,"Aurora"],[10,"Fantom"],[11,"Karura"],[12,"Acala"],[13,"Klaytn"],[14,"Celo"],[15,"Near"],[16,"Moonbeam"],[17,"Neon"],[18,"Terra2"],[19,"Injective"],[20,"Osmosis"],[21,"Sui"],[22,"Aptos"],[23,"Arbitrum"],[24,"Optimism"],[25,"Gnosis"],[26,"Pythnet"],[28,"Xpla"],[29,"Btc"],[30,"Base"],[32,"Sei"],[34,"Scroll"],[35,"Mantle"],[36,"Blast"],[37,"Xlayer"],[38,"Linea"],[39,"Berachain"],[40,"Seievm"],[43,"Snaxchain"],[44,"Unichain"],[45,"Worldchain"],[46,"Ink"],[47,"HyperEVM"],[48,"Monad"],[50,"Mezo"],[3104,"Wormchain"],[4e3,"Cosmoshub"],[4001,"Evmos"],[4002,"Kujira"],[4003,"Neutron"],[4004,"Celestia"],[4005,"Stargaze"],[4006,"Seda"],[4007,"Dymension"],[4008,"Provenance"],[4009,"Noble"],[10002,"Sepolia"],[10003,"ArbitrumSepolia"],[10004,"BaseSepolia"],[10005,"OptimismSepolia"],[10006,"Holesky"],[10007,"PolygonSepolia"]],[k6,Pu]=hr(kc),ro=we(kc,[1,0]),Pi=we(kc),so=n=>ro.has(n),Na=n=>Pi.has(n),Ys=n=>{switch(typeof n){case"string":if(so(n))return ro(n);break;case"number":if(Na(n))return n;break}throw Error(`Cannot convert to ChainId: ${n}`)},rs=n=>{switch(typeof n){case"string":if(so(n))return n;break;case"number":if(Na(n))return Pi(n);break;case"bigint":if(Na(Number(n)))return Pi.get(Number(n));break}throw Error(`Cannot convert to Chain: ${n}`)},Fc=[["Evm",["Acala","Arbitrum","Aurora","Avalanche","Base","Bsc","Celo","Ethereum","Fantom","Gnosis","Karura","Klaytn","Moonbeam","Neon","Oasis","Optimism","Polygon","Sepolia","ArbitrumSepolia","BaseSepolia","OptimismSepolia","Holesky","PolygonSepolia","Mantle","Scroll","Blast","Xlayer","Linea","Berachain","Seievm","Snaxchain","Unichain","Worldchain","Ink","HyperEVM","Monad","Mezo"]],["Solana",["Solana","Pythnet"]],["Cosmwasm",["Cosmoshub","Evmos","Injective","Kujira","Osmosis","Sei","Terra","Terra2","Wormchain","Xpla","Dymension","Neutron","Stargaze","Celestia","Seda","Provenance","Noble"]],["Btc",["Btc"]],["Algorand",["Algorand"]],["Sui",["Sui"]],["Aptos",["Aptos"]],["Near",["Near"]]];Cu(Fc,0);const Lu=we(Fc),ss=we(Fc,[1,0]),$m=[["Evm","hex"],["Solana","base58"],["Cosmwasm","bech32"],["Btc","bech32"],["Algorand","algorandAppId"],["Sui","hex"],["Aptos","hex"],["Near","sha256"]],Vm=we($m),is={byAddress:(n,e)=>Object.values(n).find(t=>Ou(t.address,e)),native:n=>is.byAddress(n,"native"),bySymbol:(n,e)=>{const t=Object.values(n).filter(r=>r.symbol===e);return t&&t.length>0?t:void 0},byKey:(n,e)=>{const t=Object.entries(n).find(([r])=>e===r);return t?t[1]:void 0}},Ou=(n,e)=>n.toLowerCase()===e.toLowerCase();var rd;(function(n){n[n.Finalized=1]="Finalized",n[n.Immediate=200]="Immediate",n[n.Safe=201]="Safe"})(rd||(rd={}));const Gm=[["Ethereum",32]];we(Gm);const Ym=[["Solana",32],["Ethereum",72],["Bsc",15],["Optimism",512],["Base",512],["Arbitrum",4096],["Blast",512],["Xlayer",300],["Scroll",300],["Mantle",512],["Worldchain",512],["Polygon",32],["Fantom",1],["Celo",1],["Moonbeam",1],["Karura",1],["Acala",1],["Oasis",1],["Avalanche",0],["Sui",0],["Algorand",0],["Aptos",0],["Klaytn",0],["Sei",0],["Near",0],["Osmosis",0],["Terra",0],["Terra2",0],["Xpla",0],["Injective",0],["Berachain",1],["Seievm",1],["Snaxchain",512],["Unichain",1024],["Ink",512],["HyperEVM",1],["Monad",1],["Mezo",1],["Cosmoshub",0],["Evmos",0],["Kujira",0],["Neutron",0],["Celestia",0],["Stargaze",0],["Dymension",0],["Provenance",0],["Noble",0],["Sepolia",72],["ArbitrumSepolia",4096],["BaseSepolia",512],["OptimismSepolia",512],["PolygonSepolia",32]],Nu=we(Ym),Xm=[["Acala",12e3],["Algorand",3300],["Aptos",4e3],["Arbitrum",260],["ArbitrumSepolia",260],["Aurora",3e3],["Avalanche",2e3],["Base",2e3],["BaseSepolia",2e3],["Blast",2e3],["Bsc",3e3],["Celo",5e3],["Cosmoshub",5e3],["Ethereum",15e3],["Evmos",2e3],["Fantom",2500],["Gnosis",5e3],["Holesky",15e3],["Injective",2500],["Karura",12e3],["Klaytn",1e3],["Kujira",3e3],["Mantle",2e3],["Moonbeam",12e3],["Monad",1e3],["Near",1500],["Neon",3e4],["Oasis",6e3],["Optimism",2e3],["OptimismSepolia",2e3],["Osmosis",6e3],["Polygon",2e3],["PolygonSepolia",2e3],["Scroll",3e3],["Sei",400],["Sepolia",15e3],["Solana",400],["Sui",3e3],["Terra",6e3],["Terra2",6e3],["Unichain",1e3],["Xpla",5e3],["Xlayer",3e3],["Worldchain",2e3],["Ink",1e3],["Wormchain",5e3],["Btc",6e5],["Pythnet",400],["Dymension",5e3],["Celestia",5e3],["Neutron",5e3],["Stargaze",5e3],["Seda",7500],["Berachain",2e3],["Mezo",4e3]],zu=we(Xm);function Tc(n){const e=Nu.get(n);if(e===void 0)throw new Error("Cannot find finality for "+n);const t=zu.get(n);if(t===void 0)throw new Error("Cannot find block time for "+n);return e*t}const Zm=[["Evm",18],["Solana",9],["Sui",9],["Aptos",8],["Cosmwasm",6],["Algorand",6],["Btc",8],["Near",12]],Hu=we(Zm),Jm=[["Mainnet",[["Ethereum",{name:"Etherscan",baseUrl:"https://etherscan.io/",endpoints:{tx:"tx/",account:"address/"}}],["Solana",{name:"Solana Explorer",baseUrl:"https://explorer.solana.com/",endpoints:{tx:"tx/",account:"address/"}}],["Polygon",{name:"PolygonScan",baseUrl:"https://polygonscan.com/",endpoints:{tx:"tx/",account:"address/"}}],["Bsc",{name:"BscScan",baseUrl:"https://bscscan.com/",endpoints:{tx:"tx/",account:"address/"}}],["Avalanche",{name:"Snowtrace",baseUrl:"https://snowtrace.io/",endpoints:{tx:"tx/",account:"address/"}}],["Fantom",{name:"FTMscan",baseUrl:"https://ftmscan.com/",endpoints:{tx:"tx/",account:"address/"}}],["Celo",{name:"Celo Explorer",baseUrl:"https://explorer.celo.org/mainnet/",endpoints:{tx:"tx/",account:"address/"}}],["Moonbeam",{name:"Moonscan",baseUrl:"https://moonscan.io/",endpoints:{tx:"tx/",account:"address/"}}],["Sui",{name:"Sui Explorer",baseUrl:"https://explorer.sui.io/",endpoints:{tx:"txblock/",account:"address/"}}],["Aptos",{name:"Aptos Explorer",baseUrl:"https://explorer.aptoslabs.com/",endpoints:{tx:"txn/",account:"account/"}}],["Sei",{name:"Sei Explorer",baseUrl:"https://sei.explorers.guru/",endpoints:{tx:"transaction/",account:"address/"}}],["Karura",{name:"Karura Explorer",baseUrl:"https://blockscout.karura.network/",endpoints:{tx:"tx/",account:"address/"}}],["Acala",{name:"Acala Explorer",baseUrl:"https://blockscout.acala.network/",endpoints:{tx:"tx/",account:"address/"}}]]],["Testnet",[["Ethereum",{name:"Etherscan",baseUrl:"https://goerli.etherscan.io/",endpoints:{tx:"tx/",account:"address/"}}],["Polygon",{name:"PolygonScan",baseUrl:"https://mumbai.polygonscan.com/",endpoints:{tx:"tx/",account:"address/"}}],["Bsc",{name:"BscScan",baseUrl:"https://testnet.bscscan.com/",endpoints:{tx:"tx/",account:"address/"}}],["Avalanche",{name:"Snowtrace",baseUrl:"https://testnet.snowtrace.io/",endpoints:{tx:"tx/",account:"address/"}}],["Fantom",{name:"FTMscan",baseUrl:"https://testnet.ftmscan.com/",endpoints:{tx:"tx/",account:"address/"}}],["Celo",{name:"Celo Explorer",baseUrl:"https://explorer.celo.org/alfajores/",endpoints:{tx:"tx/",account:"address/"}}],["Moonbeam",{name:"Moonscan",baseUrl:"https://moonbase.moonscan.io/",endpoints:{tx:"tx/",account:"address/"}}],["Solana",{name:"Solana Explorer",baseUrl:"https://explorer.solana.com/",endpoints:{tx:"tx/",account:"address/"},networkQuery:{default:"Devnet",Testnet:"?cluster=testnet",Devnet:"?cluster=devnet"}}],["Sui",{name:"Sui Explorer",baseUrl:"https://explorer.sui.io/",endpoints:{tx:"txblock/",account:"address/"},networkQuery:{default:"Testnet",Testnet:"?network=testnet",Devnet:"?network=devnet"}}],["Aptos",{name:"Aptos Explorer",baseUrl:"https://explorer.aptoslabs.com/",endpoints:{tx:"txn/",account:"account/"},networkQuery:{default:"Testnet",Testnet:"?network=testnet",Devnet:"?network=devnet"}}],["Sei",{name:"Sei Explorer",baseUrl:"https://sei.explorers.guru/",endpoints:{tx:"transaction/",account:"address/"}}],["Karura",{name:"Karura Explorer",baseUrl:"https://blockscout.karura-testnet.aca-staging.network/",endpoints:{tx:"tx/",account:"address/"}}],["Acala",{name:"Acala Explorer",baseUrl:"https://blockscout.acala-dev.aca-dev.network/",endpoints:{tx:"tx/",account:"address/"}}]]]],Qm=we(Jm),e1=(n,e)=>n==="Devnet"?void 0:Qm.get(n,e),t1=[["Mainnet",[["Ethereum","https://ethereum-rpc.publicnode.com"],["Solana","https://api.mainnet-beta.solana.com"],["Polygon","https://polygon-bor-rpc.publicnode.com"],["Bsc","https://bsc-rpc.publicnode.com"],["Avalanche","https://avalanche-c-chain-rpc.publicnode.com"],["Fantom","https://rpcapi.fantom.network"],["Celo","https://celo-rpc.publicnode.com"],["Moonbeam","https://moonbeam-rpc.publicnode.com"],["Sui","https://rpc.mainnet.sui.io"],["Aptos","https://fullnode.mainnet.aptoslabs.com/v1"],["Arbitrum","https://arb1.arbitrum.io/rpc"],["Optimism","https://mainnet.optimism.io"],["Base","https://mainnet.base.org"],["Osmosis","https://osmosis-rpc.polkachu.com"],["Cosmoshub","https://cosmos-rpc.publicnode.com:443"],["Evmos","https://evmos-rpc.polkachu.com"],["Injective","https://sentry.tm.injective.network"],["Wormchain","https://wormchain-rpc.quickapi.com"],["Xpla","https://dimension-rpc.xpla.dev"],["Sei","https://sei-rpc.polkachu.com/"],["Algorand","https://mainnet-api.algonode.cloud"],["Terra","https://terra-classic-rpc.publicnode.com"],["Terra2","https://terra-rpc.polkachu.com"],["Karura","https://eth-rpc-karura.aca-api.network"],["Acala","https://eth-rpc-acala.aca-api.network"],["Oasis","https://emerald.oasis.dev"],["Dymension","https://dymension-rpc.polkachu.com/"],["Stargaze","https://stargaze-rpc.polkachu.com/"],["Celestia","https://celestia-rpc.polkachu.com/"],["Neutron","https://neutron-rpc.polkachu.com/"],["Blast","https://rpc.blast.io"],["Provenance","https://rpc.provenance.io/"],["Noble","https://noble-rpc.polkachu.com/"],["Linea","https://rpc.linea.build"],["Scroll","https://scroll-rpc.publicnode.com"],["Xlayer","https://xlayerrpc.okx.com/"],["Gnosis","https://gnosis-rpc.publicnode.com"],["Mantle","https://rpc.mantle.xyz"],["Klaytn","https://public-en.node.kaia.io"],["Snaxchain","https://mainnet.snaxchain.io"],["Berachain","https://rpc.berachain.com"],["Unichain","https://mainnet.unichain.org"],["Worldchain","https://worldchain-mainnet.g.alchemy.com/public"],["Ink","https://rpc-qnd.inkonchain.com"]]],["Testnet",[["Bsc","https://data-seed-prebsc-1-s3.binance.org:8545"],["Avalanche","https://api.avax-test.network/ext/bc/C/rpc"],["Fantom","https://rpc.testnet.fantom.network"],["Celo","https://alfajores-forno.celo-testnet.org"],["Solana","https://api.devnet.solana.com"],["Oasis","https://testnet.emerald.oasis.io"],["Moonbeam","https://rpc.api.moonbase.moonbeam.network"],["Sui","https://fullnode.testnet.sui.io"],["Aptos","https://fullnode.testnet.aptoslabs.com/v1"],["Sei","https://sei-testnet-rpc.polkachu.com"],["Injective","https://testnet.sentry.tm.injective.network"],["Osmosis","https://rpc.testnet.osmosis.zone"],["Cosmoshub","https://rpc.sentry-02.theta-testnet.polypore.xyz"],["Evmos","https://evmos-testnet-rpc.polkachu.com"],["Wormchain","https://gateway.testnet.xlabs.xyz/"],["Xpla","https://cube-rpc.xpla.dev"],["Sepolia","https://ethereum-sepolia.publicnode.com"],["Algorand","https://testnet-api.algonode.cloud"],["Terra","https://bombay.stakesystems.io"],["Terra2","https://terra-testnet-rpc.polkachu.com"],["ArbitrumSepolia","https://sepolia-rollup.arbitrum.io/rpc"],["OptimismSepolia","https://sepolia.optimism.io"],["BaseSepolia","https://sepolia.base.org"],["PolygonSepolia","https://rpc-amoy.polygon.technology/"],["Mantle","https://rpc.testnet.mantle.xyz"],["Karura","https://eth-rpc-karura-testnet.aca-staging.network"],["Acala","https://eth-rpc-acala-testnet.aca-staging.network"],["Blast","https://sepolia.blast.io"],["Berachain","https://bepolia.rpc.berachain.com/"],["Seievm","https://evm-rpc-testnet.sei-apis.com/"],["Linea","https://rpc.sepolia.linea.build"],["Xlayer","https://testrpc.xlayer.tech/"],["Scroll","https://scroll-sepolia-rpc.publicnode.com"],["Gnosis","https://rpc.chiadochain.net"],["Klaytn","https://public-en-kairos.node.kaia.io"],["Snaxchain","https://testnet.snaxchain.io"],["Unichain","https://sepolia.unichain.org"],["Worldchain","https://worldchain-sepolia.g.alchemy.com/public"],["Ink","https://rpc-qnd-sepolia.inkonchain.com"],["HyperEVM","https://api.hyperliquid-testnet.xyz/evm"],["Monad","https://testnet-rpc.monad.xyz"],["Noble","https://noble-testnet-rpc.polkachu.com/"],["Mezo","https://rpc.test.mezo.org"]]],["Devnet",[["Ethereum","http://eth-devnet:8545"],["Bsc","http://eth-devnet2:8545"],["Solana","http://solana-devnet:8899"]]]],n1=we(t1),qu=(n,e)=>n1.get(n,e)??"",Ku=[["Mainnet",[["Aptos",1n],["Algorand","mainnet-v1.0"],["Near","mainnet"],["Cosmoshub","cosmoshub-4"],["Evmos","evmos_9001-2"],["Injective","injective-1"],["Osmosis","osmosis-1"],["Sei","pacific-1"],["Terra","columbus-5"],["Terra2","phoenix-1"],["Wormchain","wormchain"],["Xpla","dimension_37-1"],["Kujira","kaiyo-1"],["Solana","5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpKuc147dw2N9d"],["Sui","35834a8a"],["Acala",787n],["Arbitrum",42161n],["Aurora",1313161554n],["Avalanche",43114n],["Base",8453n],["Bsc",56n],["Celo",42220n],["Ethereum",1n],["Fantom",250n],["Gnosis",100n],["Karura",686n],["Klaytn",8217n],["Moonbeam",1284n],["Neon",245022934n],["Oasis",42262n],["Optimism",10n],["Polygon",137n],["Neutron","neutron-1"],["Stargaze","stargaze-1"],["Celestia","celestia"],["Dymension","dymension_1100-1"],["Provenance","pio-mainnet-1"],["Noble","noble-1"],["Xlayer",196n],["Mantle",5000n],["Scroll",534352n],["Blast",81457n],["Linea",59144n],["Snaxchain",2192n],["Berachain",80094n],["Unichain",130n],["Worldchain",480n],["Ink",57073n]]],["Testnet",[["Aptos",2n],["Algorand","testnet-v1.0"],["Near","testnet"],["Cosmoshub","theta-testnet-001"],["Evmos","evmos_9000-4"],["Injective","injective-888"],["Osmosis","osmo-test-5"],["Sei","atlantic-2"],["Terra","bombay-12"],["Terra2","pisco-1"],["Wormchain","wormchain-testnet-0"],["Xpla","cube_47-5"],["Kujira","harpoon-4"],["Solana","EtWTRABZaYq6iMfeYKouRu166VU2xqa1wcaWoxPkrZBG"],["Sui","4c78adac"],["Acala",597n],["Arbitrum",421613n],["Aurora",1313161555n],["Avalanche",43113n],["Base",84531n],["Bsc",97n],["Celo",44787n],["Ethereum",5n],["Fantom",4002n],["Gnosis",10200n],["Karura",596n],["Klaytn",1001n],["Moonbeam",1287n],["Neon",245022940n],["Oasis",42261n],["Optimism",420n],["Polygon",80001n],["Sepolia",11155111n],["ArbitrumSepolia",421614n],["BaseSepolia",84532n],["OptimismSepolia",11155420n],["PolygonSepolia",80002n],["Holesky",17000n],["Neutron","pion-1"],["Celestia","mocha-4"],["Seda","seda-1-testnet"],["Noble","grand-1"],["Blast",168587773n],["Mantle",5003n],["Scroll",534351n],["Berachain",80069n],["Seievm",1328n],["Snaxchain",13001n],["Unichain",1301n],["Worldchain",4801n],["Ink",763373n],["HyperEVM",998n],["Xlayer",195n],["Linea",59141n],["Monad",10143n],["Mezo",31611n]]],["Devnet",[["Aptos",0n],["Algorand","sandnet-v1.0"],["Bsc",1397n],["Ethereum",1337n],["Injective","injective_devnet_fake"],["Solana","8wF6jKV3cKwyaVkWcoV9KpDqmkjvEYno9hKZrKx8TbZn"]]]],ju=we(Ku),r1=we(Ku,[2,[0,1]]);function s1(n,e){const r=r1(e).filter(([s,i])=>ss(i)===n);if(r.length!==1)throw new Error(`Platform ${n} has multiple chains with native chain id ${e}`);return r[0]}const i1=[["Mainnet","https://iris-api.circle.com/v1/attestations"],["Testnet","https://iris-api-sandbox.circle.com/v1/attestations"]],sd=we(i1),o1=[["Mainnet",[["Ethereum","0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"],["Avalanche","0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E"],["Optimism","0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85"],["Arbitrum","0xaf88d065e77c8cC2239327C5EDb3A432268e5831"],["Solana","EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"],["Base","0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"],["Polygon","0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359"],["Sui","0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC"],["Aptos","0xbae207659db88bea0cbead6da0ed00aac12edcdda169e591cd41c94180b46f3b"],["Unichain","0x078D782b760474a361dDA0AF3839290b0EF57AD6"]]],["Testnet",[["Sepolia","0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238"],["Avalanche","0x5425890298aed601595a70AB815c96711a31Bc65"],["OptimismSepolia","0x5fd84259d66Cd46123540766Be93DFE6D43130D7"],["ArbitrumSepolia","0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d"],["Solana","4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU"],["BaseSepolia","0x036CbD53842c5426634e7929541eC2318f3dCF7e"],["Polygon","0x9999f7Fea5938fD3b1E26A12c3f2fb024e194f97"],["Sui","0xa1ec7fc00a6f40db9693ad1415d0c193ad3906494428cf252621037bd7117e29::usdc::USDC"],["Aptos","0x69091fbab5f7d635ee7ac5098cf0c1efbe31d68fec0f2cd565e8d168daf52832"],["Unichain","0x31d0220469e10c4E71834a79b1f276d740d3768F"]]]],Ds=we(o1),Ic=[["Mainnet",[["Ethereum",0],["Avalanche",1],["Optimism",2],["Arbitrum",3],["Solana",5],["Base",6],["Polygon",7],["Sui",8],["Aptos",9],["Unichain",10]]],["Testnet",[["Sepolia",0],["Avalanche",1],["OptimismSepolia",2],["ArbitrumSepolia",3],["Solana",5],["BaseSepolia",6],["Polygon",7],["Sui",8],["Aptos",9],["Unichain",10]]]],$u=we(Ic,[[0,1],2]),za=we(Ic,[[0,2],1]),[F6,T6]=hr(Ic),Ha=(n,e)=>$u.has(n,e),id=(n,e)=>za.has(n,e),od=(n,e)=>Ds.has(n,e),Ci=(n,e)=>{switch(typeof e){case"string":if(Ha(n,e))return e;break;case"number":if(id(n,e))return za(n,e);break;case"bigint":const t=Number(e);if(id(n,t))return za(n,t);break}throw Error(`Cannot convert to Chain: ${e}`)},a1=[["Mainnet",[["Solana","worm2ZoG2kUd4vFXhvjh93UUH596ayRfgQ2MgjNMTth"],["Ethereum","0x98f3c9e6E3fAce36bAAd05FE09d375Ef1464288B"],["Terra","terra1dq03ugtd40zu9hcgdzrsq6z2z4hwhc9tqk2uy5"],["Bsc","0x98f3c9e6E3fAce36bAAd05FE09d375Ef1464288B"],["Polygon","0x7A4B5a56256163F07b2C80A7cA55aBE66c4ec4d7"],["Avalanche","0x54a8e5f9c4CbA08F9943965859F6c34eAF03E26c"],["Oasis","0xfE8cD454b4A1CA468B57D79c0cc77Ef5B6f64585"],["Algorand","842125965"],["Aurora","0xa321448d90d4e5b0A732867c18eA198e75CAC48E"],["Fantom","0x126783A6Cb203a3E35344528B26ca3a0489a1485"],["Karura","0xa321448d90d4e5b0A732867c18eA198e75CAC48E"],["Acala","0xa321448d90d4e5b0A732867c18eA198e75CAC48E"],["Klaytn","0x0C21603c4f3a6387e241c0091A7EA39E43E90bb7"],["Celo","0xa321448d90d4e5b0A732867c18eA198e75CAC48E"],["Near","contract.wormhole_crypto.near"],["Injective","inj17p9rzwnnfxcjp32un9ug7yhhzgtkhvl9l2q74d"],["Aptos","0x5bc11445584a763c1fa7ed39081f1b920954da14e04b32440cba863d03e19625"],["Sui","0xaeab97f96cf9877fee2883315d459552b2b921edc16d7ceac6eab944dd88919c"],["Moonbeam","0xC8e2b0cD52Cf01b0Ce87d389Daa3d414d4cE29f3"],["Terra2","terra12mrnzvhx3rpej6843uge2yyfppfyd3u9c3uq223q8sl48huz9juqffcnhp"],["Arbitrum","0xa5f208e072434bC67592E4C49C1B991BA79BCA46"],["Optimism","0xEe91C335eab126dF5fDB3797EA9d6aD93aeC9722"],["Gnosis","0xa321448d90d4e5b0A732867c18eA198e75CAC48E"],["Pythnet","H3fxXJ86ADW2PNuDDmZJg6mzTtPxkYCpNuQUTgmJ7AjU"],["Base","0xbebdb6C8ddC678FfA9f8748f85C815C556Dd8ac6"],["Xlayer","0x194B123c5E96B9b2E49763619985790Dc241CAC0"],["Xpla","xpla1jn8qmdda5m6f6fqu9qv46rt7ajhklg40ukpqchkejcvy8x7w26cqxamv3w"],["Sei","sei1gjrrme22cyha4ht2xapn3f08zzw6z3d4uxx6fyy9zd5dyr3yxgzqqncdqn"],["Wormchain","wormhole1ufs3tlq4umljk0qfe8k5ya0x6hpavn897u2cnf9k0en9jr7qarqqaqfk2j"],["Neutron","neutron16rerygcpahqcxx5t8vjla46ym8ccn7xz7rtc6ju5ujcd36cmc7zs9zrunh"],["Blast","0xbebdb6C8ddC678FfA9f8748f85C815C556Dd8ac6"],["Scroll","0xbebdb6C8ddC678FfA9f8748f85C815C556Dd8ac6"],["Mantle","0xbebdb6C8ddC678FfA9f8748f85C815C556Dd8ac6"],["Snaxchain","0xc1BA3CC4bFE724A08FbbFbF64F8db196738665f4"],["Berachain","0xCa1D5a146B03f6303baF59e5AD5615ae0b9d146D"],["Unichain","0xCa1D5a146B03f6303baF59e5AD5615ae0b9d146D"],["Worldchain","0xcbcEe4e081464A15d8Ad5f58BB493954421eB506"],["Ink","0xCa1D5a146B03f6303baF59e5AD5615ae0b9d146D"]]],["Testnet",[["Solana","3u8hJUVTA4jH1wYAyUur7FFZVQ8H635K3tSHHF4ssjQ5"],["Ethereum","0x706abc4E45D419950511e474C7B9Ed348A4a716c"],["Terra","terra1pd65m0q9tl3v8znnz5f5ltsfegyzah7g42cx5v"],["Bsc","0x68605AD7b15c732a30b1BbC62BE8F2A509D74b4D"],["Polygon","0x0CBE91CF822c73C2315FB05100C2F714765d5c20"],["Avalanche","0x7bbcE28e64B3F8b84d876Ab298393c38ad7aac4C"],["Oasis","0xc1C338397ffA53a2Eb12A7038b4eeb34791F8aCb"],["Algorand","86525623"],["Aurora","0xBd07292de7b505a4E803CEe286184f7Acf908F5e"],["Fantom","0x1BB3B4119b7BA9dfad76B0545fb3F531383c3bB7"],["Karura","0x64fb09E405D2043ed7785a29E296C766D56F2056"],["Acala","0x64fb09E405D2043ed7785a29E296C766D56F2056"],["Klaytn","0x1830CC6eE66c84D2F177B94D544967c774E624cA"],["Celo","0x88505117CA88e7dd2eC6EA1E13f0948db2D50D56"],["Near","wormhole.wormhole.testnet"],["Injective","inj1xx3aupmgv3ce537c0yce8zzd3sz567syuyedpg"],["Osmosis","osmo1hggkxr0hpw83f8vuft7ruvmmamsxmwk2hzz6nytdkzyup9krt0dq27sgyx"],["Aptos","0x5bc11445584a763c1fa7ed39081f1b920954da14e04b32440cba863d03e19625"],["Sui","0x31358d198147da50db32eda2562951d53973a0c0ad5ed738e9b17d88b213d790"],["Moonbeam","0xa5B7D85a8f27dd7907dc8FdC21FA5657D5E2F901"],["Neon","0x268557122Ffd64c85750d630b716471118F323c8"],["Terra2","terra19nv3xr5lrmmr7egvrk2kqgw4kcn43xrtd5g0mpgwwvhetusk4k7s66jyv0"],["Arbitrum","0xC7A204bDBFe983FCD8d8E61D02b475D4073fF97e"],["Optimism","0x6b9C8671cdDC8dEab9c719bB87cBd3e782bA6a35"],["Gnosis","0xBB73cB66C26740F31d1FabDC6b7A46a038A300dd"],["Pythnet","EUrRARh92Cdc54xrDn6qzaqjA77NRrCcfbr8kPwoTL4z"],["Xpla","xpla1upkjn4mthr0047kahvn0llqx4qpqfn75lnph4jpxfn8walmm8mqsanyy35"],["Base","0x23908A62110e21C04F3A4e011d24F901F911744A"],["Sei","sei1nna9mzp274djrgzhzkac2gvm3j27l402s4xzr08chq57pjsupqnqaj0d5s"],["Sepolia","0x4a8bc80Ed5a4067f1CCf107057b8270E0cC11A78"],["Wormchain","wormhole16jzpxp0e8550c9aht6q9svcux30vtyyyyxv5w2l2djjra46580wsazcjwp"],["ArbitrumSepolia","0x6b9C8671cdDC8dEab9c719bB87cBd3e782bA6a35"],["BaseSepolia","0x79A1027a6A159502049F10906D333EC57E95F083"],["OptimismSepolia","0x31377888146f3253211EFEf5c676D41ECe7D58Fe"],["Holesky","0xa10f2eF61dE1f19f586ab8B6F2EbA89bACE63F7a"],["Neutron","neutron1enf63k37nnv9cugggpm06mg70emcnxgj9p64v2s8yx7a2yhhzk2q6xesk4"],["Mantle","0x376428e7f26D5867e69201b275553C45B09EE090"],["PolygonSepolia","0x6b9C8671cdDC8dEab9c719bB87cBd3e782bA6a35"],["Scroll","0x055F47F1250012C6B20c436570a76e52c17Af2D5"],["Blast","0x473e002D7add6fB67a4964F13bFd61280Ca46886"],["Berachain","0xBB73cB66C26740F31d1FabDC6b7A46a038A300dd"],["Seievm","0xBB73cB66C26740F31d1FabDC6b7A46a038A300dd"],["Snaxchain","0xBB73cB66C26740F31d1FabDC6b7A46a038A300dd"],["Unichain","0xBB73cB66C26740F31d1FabDC6b7A46a038A300dd"],["Worldchain","0xe5E02cD12B6FcA153b0d7fF4bF55730AE7B3C93A"],["Ink","0xBB73cB66C26740F31d1FabDC6b7A46a038A300dd"],["HyperEVM","0xBB73cB66C26740F31d1FabDC6b7A46a038A300dd"],["Xlayer","0xA31aa3FDb7aF7Db93d18DDA4e19F811342EDF780"],["Linea","0x79A1027a6A159502049F10906D333EC57E95F083"],["Monad","0xBB73cB66C26740F31d1FabDC6b7A46a038A300dd"],["Mezo","0x268557122Ffd64c85750d630b716471118F323c8"]]],["Devnet",[["Solana","Bridge1p5gheXUvJ6jGWGeCsgPKgnE3YgdGKRVCMY9o"],["Ethereum","0xC89Ce4735882C9F0f0FE26686c53074E09B0D550"],["Terra","terra14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9ssrc8au"],["Bsc","0xC89Ce4735882C9F0f0FE26686c53074E09B0D550"],["Algorand","1004"],["Near","wormhole.test.near"],["Aptos","0xde0036a9600559e295d5f6802ef6f3f802f510366e0c23912b0655d972166017"],["Sui","0x5a5160ca3c2037f4b4051344096ef7a48ebf4400b3f385e57ea90e1628a8bde0"],["Terra2","terra14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9ssrc8au"],["Wormchain","wormhole17p9rzwnnfxcjp32un9ug7yhhzgtkhvl9jfksztgw5uh69wac2pgshdnj3k"]]]],Vu=[["Mainnet",[["Solana","wormDTUJ6AWPNvk59vGQbDvGJmqbDTdgWgAqcLBCgUb"],["Ethereum","0x3ee18B2214AFF97000D974cf647E7C347E8fa585"],["Terra","terra10nmmwe8r3g99a9newtqa7a75xfgs2e8z87r2sf"],["Bsc","0xB6F6D86a8f9879A9c87f643768d9efc38c1Da6E7"],["Polygon","0x5a58505a96D1dbf8dF91cB21B54419FC36e93fdE"],["Avalanche","0x0e082F06FF657D94310cB8cE8B0D9a04541d8052"],["Oasis","0x5848C791e09901b40A9Ef749f2a6735b418d7564"],["Algorand","842126029"],["Aurora","0x51b5123a7b0F9b2bA265f9c4C8de7D78D52f510F"],["Fantom","0x7C9Fc5741288cDFdD83CeB07f3ea7e22618D79D2"],["Karura","0xae9d7fe007b3327AA64A32824Aaac52C42a6E624"],["Acala","0xae9d7fe007b3327AA64A32824Aaac52C42a6E624"],["Klaytn","0x5b08ac39EAED75c0439FC750d9FE7E1F9dD0193F"],["Celo","0x796Dff6D74F3E27060B71255Fe517BFb23C93eed"],["Near","contract.portalbridge.near"],["Injective","inj1ghd753shjuwexxywmgs4xz7x2q732vcnxxynfn"],["Aptos","0x576410486a2da45eee6c949c995670112ddf2fbeedab20350d506328eefc9d4f"],["Sui","0xc57508ee0d4595e5a8728974a4a93a787d38f339757230d441e895422c07aba9"],["Moonbeam","0xb1731c586ca89a23809861c6103f0b96b3f57d92"],["Terra2","terra153366q50k7t8nn7gec00hg66crnhkdggpgdtaxltaq6xrutkkz3s992fw9"],["Arbitrum","0x0b2402144Bb366A632D14B83F244D2e0e21bD39c"],["Optimism","0x1D68124e65faFC907325e3EDbF8c4d84499DAa8b"],["Base","0x8d2de8d2f73F1F4cAB472AC9A881C9b123C79627"],["Xlayer","0x5537857664B0f9eFe38C9f320F75fEf23234D904"],["Xpla","xpla137w0wfch2dfmz7jl2ap8pcmswasj8kg06ay4dtjzw7tzkn77ufxqfw7acv"],["Sei","sei1smzlm9t79kur392nu9egl8p8je9j92q4gzguewj56a05kyxxra0qy0nuf3"],["Wormchain","wormhole1466nf3zuxpya8q9emxukd7vftaf6h4psr0a07srl5zw74zh84yjq4lyjmh"],["Blast","0x24850c6f61C438823F01B7A3BF2B89B72174Fa9d"],["Scroll","0x24850c6f61C438823F01B7A3BF2B89B72174Fa9d"],["Mantle","0x24850c6f61C438823F01B7A3BF2B89B72174Fa9d"],["Snaxchain","0x8B94bfE456B48a6025b92E11Be393BAa86e68410"],["Berachain","0x3Ff72741fd67D6AD0668d93B41a09248F4700560"],["Unichain","0x3Ff72741fd67D6AD0668d93B41a09248F4700560"],["Worldchain","0xc309275443519adca74c9136b02A38eF96E3a1f6"],["Ink","0x3Ff72741fd67D6AD0668d93B41a09248F4700560"]]],["Testnet",[["Solana","DZnkkTmCiFWfYTfT41X3Rd1kDgozqzxWaHqsw6W4x2oe"],["Ethereum","0xF890982f9310df57d00f659cf4fd87e65adEd8d7"],["Terra","terra1pseddrv0yfsn76u4zxrjmtf45kdlmalswdv39a"],["Bsc","0x9dcF9D205C9De35334D646BeE44b2D2859712A09"],["Polygon","0x377D55a7928c046E18eEbb61977e714d2a76472a"],["Avalanche","0x61E44E506Ca5659E6c0bba9b678586fA2d729756"],["Oasis","0x88d8004A9BdbfD9D28090A02010C19897a29605c"],["Algorand","86525641"],["Aurora","0xD05eD3ad637b890D68a854d607eEAF11aF456fba"],["Fantom","0x599CEa2204B4FaECd584Ab1F2b6aCA137a0afbE8"],["Karura","0xe157115ef34c93145Fec2FE53706846853B07F42"],["Acala","0xe157115ef34c93145Fec2FE53706846853B07F42"],["Klaytn","0xC7A13BE098720840dEa132D860fDfa030884b09A"],["Celo","0x05ca6037eC51F8b712eD2E6Fa72219FEaE74E153"],["Near","token.wormhole.testnet"],["Injective","inj1q0e70vhrv063eah90mu97sazhywmeegp7myvnh"],["Aptos","0x576410486a2da45eee6c949c995670112ddf2fbeedab20350d506328eefc9d4f"],["Sui","0x6fb10cdb7aa299e9a4308752dadecb049ff55a892de92992a1edbd7912b3d6da"],["Moonbeam","0xbc976D4b9D57E57c3cA52e1Fd136C45FF7955A96"],["Neon","0xEe3dB83916Ccdc3593b734F7F2d16D630F39F1D0"],["Terra2","terra1c02vds4uhgtrmcw7ldlg75zumdqxr8hwf7npseuf2h58jzhpgjxsgmwkvk"],["Arbitrum","0x23908A62110e21C04F3A4e011d24F901F911744A"],["ArbitrumSepolia","0xC7A204bDBFe983FCD8d8E61D02b475D4073fF97e"],["Optimism","0xC7A204bDBFe983FCD8d8E61D02b475D4073fF97e"],["OptimismSepolia","0x99737Ec4B815d816c49A385943baf0380e75c0Ac"],["Xpla","xpla1kek6zgdaxcsu35nqfsyvs2t9vs87dqkkq6hjdgczacysjn67vt8sern93x"],["Base","0xA31aa3FDb7aF7Db93d18DDA4e19F811342EDF780"],["BaseSepolia","0x86F55A04690fd7815A3D802bD587e83eA888B239"],["Sei","sei1jv5xw094mclanxt5emammy875qelf3v62u4tl4lp5nhte3w3s9ts9w9az2"],["Sepolia","0xDB5492265f6038831E89f495670FF909aDe94bd9"],["Wormchain","wormhole1aaf9r6s7nxhysuegqrxv0wpm27ypyv4886medd3mrkrw6t4yfcnst3qpex"],["Holesky","0x76d093BbaE4529a342080546cAFEec4AcbA59EC6"],["Mantle","0x75Bfa155a9D7A3714b0861c8a8aF0C4633c45b5D"],["PolygonSepolia","0xC7A204bDBFe983FCD8d8E61D02b475D4073fF97e"],["Scroll","0x22427d90B7dA3fA4642F7025A854c7254E4e45BF"],["Blast","0x430855B4D43b8AEB9D2B9869B74d58dda79C0dB2"],["Xlayer","0xdA91a06299BBF302091B053c6B9EF86Eff0f930D"],["Berachain","0xa10f2eF61dE1f19f586ab8B6F2EbA89bACE63F7a"],["Seievm","0x23908A62110e21C04F3A4e011d24F901F911744A"],["Snaxchain","0xa10f2eF61dE1f19f586ab8B6F2EbA89bACE63F7a"],["Unichain","0xa10f2eF61dE1f19f586ab8B6F2EbA89bACE63F7a"],["Worldchain","0x430855B4D43b8AEB9D2B9869B74d58dda79C0dB2"],["Ink","0x376428e7f26D5867e69201b275553C45B09EE090"],["HyperEVM","0x4a8bc80Ed5a4067f1CCf107057b8270E0cC11A78"],["Linea","0xC7A204bDBFe983FCD8d8E61D02b475D4073fF97e"],["Monad","0xF323dcDe4d33efe83cf455F78F9F6cc656e6B659"],["Mezo","0xA31aa3FDb7aF7Db93d18DDA4e19F811342EDF780"]]],["Devnet",[["Solana","B6RHG3mfcckmrYN1UhmJzyS1XX3fZKbkeUcpJe9Sy3FE"],["Ethereum","0x0290FB167208Af455bB137780163b7B7a9a10C16"],["Terra","terra1nc5tatafv6eyq7llkr2gv50ff9e22mnf70qgjlv737ktmt4eswrquka9l6"],["Bsc","0x0290FB167208Af455bB137780163b7B7a9a10C16"],["Algorand","1006"],["Near","token.test.near"],["Aptos","0x84a5f374d29fc77e370014dce4fd6a55b58ad608de8074b0be5571701724da31"],["Sui","0xa6a3da85bbe05da5bfd953708d56f1a3a023e7fb58e5a824a3d4de3791e8f690"],["Terra2","terra1nc5tatafv6eyq7llkr2gv50ff9e22mnf70qgjlv737ktmt4eswrquka9l6"],["Wormchain","wormhole1ghd753shjuwexxywmgs4xz7x2q732vcnkm6h2pyv9s6ah3hylvrqtm7t3h"]]]],Gu=[["Mainnet",[["Ethereum","0xcafd2f0a35a4459fa40c0517e17e6fa2939441ca"],["Bsc","0xcafd2f0a35a4459fa40c0517e17e6fa2939441ca"],["Polygon","0xcafd2f0a35a4459fa40c0517e17e6fa2939441ca"],["Avalanche","0xcafd2f0a35a4459fa40c0517e17e6fa2939441ca"],["Fantom","0xcafd2f0a35a4459fa40c0517e17e6fa2939441ca"],["Celo","0xcafd2f0a35a4459fa40c0517e17e6fa2939441ca"],["Sui","0x57f4e0ba41a7045e29d435bc66cc4175f381eb700e6ec16d4fdfe92e5a4dff9f"],["Solana","3vxKRPwUTiEkeUVyoZ9MXFe1V71sRLbLqu1gRYaWmehQ"],["Base","0xaE8dc4a7438801Ec4edC0B035EcCCcF3807F4CC1"],["Moonbeam","0xcafd2f0a35a4459fa40c0517e17e6fa2939441ca"],["Arbitrum","0xaE8dc4a7438801Ec4edC0B035EcCCcF3807F4CC1"],["Optimism","0xaE8dc4a7438801Ec4edC0B035EcCCcF3807F4CC1"]]],["Testnet",[["Ethereum","0x9563a59c15842a6f322b10f69d1dd88b41f2e97b"],["Bsc","0x9563a59c15842a6f322b10f69d1dd88b41f2e97b"],["Polygon","0x9563a59c15842a6f322b10f69d1dd88b41f2e97b"],["Avalanche","0x9563a59c15842a6f322b10f69d1dd88b41f2e97b"],["Fantom","0x9563a59c15842a6f322b10f69d1dd88b41f2e97b"],["Celo","0x9563a59c15842a6f322b10f69d1dd88b41f2e97b"],["Sui","0xb30040e5120f8cb853b691cb6d45981ae884b1d68521a9dc7c3ae881c0031923"],["Base","0xae8dc4a7438801ec4edc0b035eccccf3807f4cc1"],["Moonbeam","0x9563a59c15842a6f322b10f69d1dd88b41f2e97b"],["Solana","3bPRWXqtSfUaCw3S4wdgvypQtsSzcmvDeaqSqPDkncrg"],["Sepolia",""],["ArbitrumSepolia","0xaE8dc4a7438801Ec4edC0B035EcCCcF3807F4CC1"],["OptimismSepolia","0xaE8dc4a7438801Ec4edC0B035EcCCcF3807F4CC1"],["BaseSepolia",""]]]],c1=[["Mainnet",[["Solana","WnFt12ZrnzZrFZkt2xsNsaNWoQribnuQ5B5FrDbwDhD"],["Ethereum","0x6FFd7EdE62328b3Af38FCD61461Bbfc52F5651fE"],["Bsc","0x5a58505a96D1dbf8dF91cB21B54419FC36e93fdE"],["Polygon","0x90BBd86a6Fe93D3bc3ed6335935447E75fAb7fCf"],["Avalanche","0xf7B6737Ca9c4e08aE573F75A97B73D7a813f5De5"],["Oasis","0x04952D522Ff217f40B5Ef3cbF659EcA7b952a6c1"],["Aurora","0x6dcC0484472523ed9Cdc017F711Bcbf909789284"],["Fantom","0xA9c7119aBDa80d4a4E0C06C8F4d8cF5893234535"],["Karura","0xb91e3638F82A1fACb28690b37e3aAE45d2c33808"],["Acala","0xb91e3638F82A1fACb28690b37e3aAE45d2c33808"],["Klaytn","0x3c3c561757BAa0b78c5C025CdEAa4ee24C1dFfEf"],["Celo","0xA6A377d75ca5c9052c9a77ED1e865Cc25Bd97bf3"],["Aptos","0x1bdffae984043833ed7fe223f7af7a3f8902d04129b14f801823e64827da7130"],["Moonbeam","0x453cfbe096c0f8d763e8c5f24b441097d577bde2"],["Arbitrum","0x3dD14D553cFD986EAC8e3bddF629d82073e188c8"],["Base","0xDA3adC6621B2677BEf9aD26598e6939CF0D92f88"],["Optimism","0xfE8cD454b4A1CA468B57D79c0cc77Ef5B6f64585"]]],["Testnet",[["Solana","2rHhojZ7hpu1zA91nvZmT8TqWWvMcKmmNBCr2mKTtMq4"],["Ethereum","0xD8E4C2DbDd2e2bd8F1336EA691dBFF6952B1a6eB"],["Bsc","0xcD16E5613EF35599dc82B24Cb45B5A93D779f1EE"],["Polygon","0x51a02d0dcb5e52F5b92bdAA38FA013C91c7309A9"],["Avalanche","0xD601BAf2EEE3C028344471684F6b27E789D9075D"],["Oasis","0xC5c25B41AB0b797571620F5204Afa116A44c0ebA"],["Aurora","0x8F399607E9BA2405D87F5f3e1B78D950b44b2e24"],["Fantom","0x63eD9318628D26BdCB15df58B53BB27231D1B227"],["Klaytn","0x94c994fC51c13101062958b567e743f1a04432dE"],["Celo","0xaCD8190F647a31E56A656748bC30F69259f245Db"],["Moonbeam","0x98A0F4B96972b32Fcb3BD03cAeB66A44a6aB9Edb"],["Neon","0x66E5BcFD45D2F3f166c567ADa663f9d2ffb292B4"],["Arbitrum","0xEe3dB83916Ccdc3593b734F7F2d16D630F39F1D0"],["Optimism","0x23908A62110e21C04F3A4e011d24F901F911744A"],["Base","0xF681d1cc5F25a3694E348e7975d7564Aa581db59"],["Sepolia","0x6a0B52ac198e4870e5F3797d5B403838a5bbFD99"],["Aptos","0x1bdffae984043833ed7fe223f7af7a3f8902d04129b14f801823e64827da7130"],["ArbitrumSepolia","0x23908A62110e21C04F3A4e011d24F901F911744A"],["BaseSepolia","0x268557122Ffd64c85750d630b716471118F323c8"],["OptimismSepolia","0x27812285fbe85BA1DF242929B906B31EE3dd1b9f"],["Holesky","0xc8941d483c45eF8FB72E4d1F9dDE089C95fF8171"],["PolygonSepolia","0x23908A62110e21C04F3A4e011d24F901F911744A"],["Mantle","0xD7D732C8Bf5eBF620EA55b5828eae20418eEF083"],["Scroll","0x47B9a1406BEe29a3001BFEB7e45aE45fFFB40c18"]]],["Devnet",[["Solana","NFTWqJR8YnRVqPDvTJrYuLrQDitTG5AScqbeghi4zSA"],["Ethereum","0x26b4afb60d6c903165150c6f0aa14f8016be4aec"],["Terra","terra1plju286nnfj3z54wgcggd4enwaa9fgf5kgrgzl"],["Bsc","0x26b4afb60d6c903165150c6f0aa14f8016be4aec"],["Aptos","0x46da3d4c569388af61f951bdd1153f4c875f90c2991f6b2d0a38e2161a40852c"]]]],l1=[["Mainnet",[["Ethereum","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Bsc","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Polygon","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Avalanche","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Fantom","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Klaytn","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Celo","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Moonbeam","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Base","0x706f82e9bb5b0813501714ab5974216704980e31"],["Arbitrum","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Optimism","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Blast","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Scroll","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Mantle","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Xlayer","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Berachain","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Ink","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Worldchain","0x1520cc9e779c56dab5866bebfb885c86840c33d3"],["Snaxchain","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Unichain","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"]]],["Testnet",[["Ethereum","0x28D8F1Be96f97C1387e94A53e00eCcFb4E75175a"],["Bsc","0x80aC94316391752A193C1c47E27D382b507c93F3"],["Polygon","0x0591C25ebd0580E0d4F27A82Fc2e24E7489CB5e0"],["Avalanche","0xA3cF45939bD6260bcFe3D66bc73d60f19e49a8BB"],["Fantom","0x7B1bD7a6b4E61c2a123AC6BC2cbfC614437D0470"],["Celo","0x306B68267Deb7c5DfCDa3619E22E9Ca39C374f84"],["Seievm","0x362fca37E45fe1096b42021b543f462D49a5C8df"],["Moonbeam","0x0591C25ebd0580E0d4F27A82Fc2e24E7489CB5e0"],["Arbitrum","0xAd753479354283eEE1b86c9470c84D42f229FF43"],["Optimism","0x01A957A525a5b7A72808bA9D10c389674E459891"],["Base","0xea8029CD7FCAEFFcD1F53686430Db0Fc8ed384E1"],["Sepolia","0x7B1bD7a6b4E61c2a123AC6BC2cbfC614437D0470"],["ArbitrumSepolia","0x7B1bD7a6b4E61c2a123AC6BC2cbfC614437D0470"],["BaseSepolia","0x93BAD53DDfB6132b0aC8E37f6029163E63372cEE"],["OptimismSepolia","0x93BAD53DDfB6132b0aC8E37f6029163E63372cEE"],["Berachain","0x362fca37E45fe1096b42021b543f462D49a5C8df"],["Unichain","0x362fca37E45fe1096b42021b543f462D49a5C8df"],["Ink","0x362fca37E45fe1096b42021b543f462D49a5C8df"],["Monad","0x362fca37E45fe1096b42021b543f462D49a5C8df"]]],["Devnet",[["Ethereum","0xcC680D088586c09c3E0E099a676FA4b6e42467b4"],["Bsc","0xcC680D088586c09c3E0E099a676FA4b6e42467b4"]]]],Yu=[["Mainnet",[["Ethereum",{tokenMessenger:"0xbd3fa81b58ba92a82136038b25adec7066af3155",messageTransmitter:"0x0a992d191deec32afe36203ad87d7d289a738f81",wormholeRelayer:"0x4cb69FaE7e7Af841e44E1A1c30Af640739378bb2",wormhole:"0xAaDA05BD399372f0b0463744C09113c137636f6a"}],["Avalanche",{tokenMessenger:"0x6b25532e1060ce10cc3b0a99e5683b91bfde6982",messageTransmitter:"0x8186359af5f57fbb40c6b14a588d2a59c0c29880",wormholeRelayer:"0x4cb69FaE7e7Af841e44E1A1c30Af640739378bb2",wormhole:"0x09Fb06A271faFf70A651047395AaEb6265265F13"}],["Optimism",{tokenMessenger:"0x2B4069517957735bE00ceE0fadAE88a26365528f",messageTransmitter:"0x4d41f22c5a0e5c74090899e5a8fb597a8842b3e8",wormholeRelayer:"0x4cb69FaE7e7Af841e44E1A1c30Af640739378bb2",wormhole:"0x2703483B1a5a7c577e8680de9Df8Be03c6f30e3c"}],["Arbitrum",{tokenMessenger:"0x19330d10D9Cc8751218eaf51E8885D058642E08A",messageTransmitter:"0xC30362313FBBA5cf9163F0bb16a0e01f01A896ca",wormholeRelayer:"0x4cb69FaE7e7Af841e44E1A1c30Af640739378bb2",wormhole:"0x2703483B1a5a7c577e8680de9Df8Be03c6f30e3c"}],["Base",{tokenMessenger:"0x1682Ae6375C4E4A97e4B583BC394c861A46D8962",messageTransmitter:"0xAD09780d193884d503182aD4588450C416D6F9D4",wormholeRelayer:"0x4cb69FaE7e7Af841e44E1A1c30Af640739378bb2",wormhole:"0x03faBB06Fa052557143dC28eFCFc63FC12843f1D"}],["Solana",{tokenMessenger:"CCTPiPYPc6AsJuwueEnWgSgucamXDZwBd53dQ11YiKX3",messageTransmitter:"CCTPmbSD7gX1bxKPAmg77w8oFzNFpaQiQUWD43TKaecd",wormholeRelayer:"",wormhole:""}],["Polygon",{tokenMessenger:"0x9daF8c91AEFAE50b9c0E69629D3F6Ca40cA3B3FE",messageTransmitter:"0xF3be9355363857F3e001be68856A2f96b4C39Ba9",wormholeRelayer:"0x4cb69FaE7e7Af841e44E1A1c30Af640739378bb2",wormhole:"0x0FF28217dCc90372345954563486528aa865cDd6"}],["Sui",{tokenMessenger:"0x2aa6c5d56376c371f88a6cc42e852824994993cb9bab8d3e6450cbe3cb32b94e",messageTransmitter:"0x08d87d37ba49e785dde270a83f8e979605b03dc552b5548f26fdf2f49bf7ed1b",wormholeRelayer:"",wormhole:""}],["Aptos",{tokenMessenger:"0x9e6702a472080ea3caaf6ba9dfaa6effad2290a9ba9adaacd5af5c618e42782d",messageTransmitter:"0x177e17751820e4b4371873ca8c30279be63bdea63b88ed0f2239c2eea10f1772",wormholeRelayer:"",wormhole:""}],["Unichain",{tokenMessenger:"0x4e744b28E787c3aD0e810eD65A24461D4ac5a762",messageTransmitter:"0x353bE9E2E38AB1D19104534e4edC21c643Df86f4",wormholeRelayer:"",wormhole:""}]]],["Testnet",[["Sepolia",{tokenMessenger:"0x9f3B8679c73C2Fef8b59B4f3444d4e156fb70AA5",messageTransmitter:"0x7865fAfC2db2093669d92c0F33AeEF291086BEFD",wormholeRelayer:"0x4cb69FaE7e7Af841e44E1A1c30Af640739378bb2",wormhole:"0x2703483B1a5a7c577e8680de9Df8Be03c6f30e3c"}],["Avalanche",{tokenMessenger:"0xeb08f243e5d3fcff26a9e38ae5520a669f4019d0",messageTransmitter:"0xa9fb1b3009dcb79e2fe346c16a604b8fa8ae0a79",wormholeRelayer:"0x774a70bbd03327c21460b60f25b677d9e46ab458",wormhole:"0x58f4c17449c90665891c42e14d34aae7a26a472e"}],["OptimismSepolia",{tokenMessenger:"0x9f3B8679c73C2Fef8b59B4f3444d4e156fb70AA5",messageTransmitter:"0x7865fAfC2db2093669d92c0F33AeEF291086BEFD",wormholeRelayer:"0x4cb69FaE7e7Af841e44E1A1c30Af640739378bb2",wormhole:"0x2703483B1a5a7c577e8680de9Df8Be03c6f30e3c"}],["ArbitrumSepolia",{tokenMessenger:"0x9f3B8679c73C2Fef8b59B4f3444d4e156fb70AA5",messageTransmitter:"0xaCF1ceeF35caAc005e15888dDb8A3515C41B4872",wormholeRelayer:"0x4cb69FaE7e7Af841e44E1A1c30Af640739378bb2",wormhole:"0x2703483B1a5a7c577e8680de9Df8Be03c6f30e3c"}],["Solana",{tokenMessenger:"CCTPiPYPc6AsJuwueEnWgSgucamXDZwBd53dQ11YiKX3",messageTransmitter:"CCTPmbSD7gX1bxKPAmg77w8oFzNFpaQiQUWD43TKaecd",wormholeRelayer:"",wormhole:""}],["BaseSepolia",{tokenMessenger:"0x9f3B8679c73C2Fef8b59B4f3444d4e156fb70AA5",messageTransmitter:"0x7865fAfC2db2093669d92c0F33AeEF291086BEFD",wormholeRelayer:"0x4cb69FaE7e7Af841e44E1A1c30Af640739378bb2",wormhole:"0x2703483B1a5a7c577e8680de9Df8Be03c6f30e3c"}],["Polygon",{tokenMessenger:"0x9f3B8679c73C2Fef8b59B4f3444d4e156fb70AA5",messageTransmitter:"0xe09A679F56207EF33F5b9d8fb4499Ec00792eA73",wormholeRelayer:"0x4cb69FaE7e7Af841e44E1A1c30Af640739378bb2",wormhole:"0x2703483B1a5a7c577e8680de9Df8Be03c6f30e3c"}],["Sui",{tokenMessenger:"0x31cc14d80c175ae39777c0238f20594c6d4869cfab199f40b69f3319956b8beb",messageTransmitter:"0x4931e06dce648b3931f890035bd196920770e913e43e45990b383f6486fdd0a5",wormholeRelayer:"",wormhole:""}],["Aptos",{tokenMessenger:"0x5f9b937419dda90aa06c1836b7847f65bbbe3f1217567758dc2488be31a477b9",messageTransmitter:"0x081e86cebf457a0c6004f35bd648a2794698f52e0dde09a48619dcd3d4cc23d9",wormholeRelayer:"",wormhole:""}],["Unichain",{tokenMessenger:"0x8ed94B8dAd2Dc5453862ea5e316A8e71AAed9782",messageTransmitter:"0xbc498c326533d675cf571B90A2Ced265ACb7d086",wormholeRelayer:"",wormhole:""}]]]],d1=[["Mainnet",[["Wormchain","wormhole14ejqjyq8um4p3xfqj74yld5waqljf88fz25yxnma0cngspxe3les00fpjx"]]],["Testnet",[["Wormchain","wormhole1ctnjk7an90lz5wjfvr3cf6x984a8cjnv8dpmztmlpcq4xteaa2xs9pwmzk"]]]],u1=[["Mainnet",[["Sei","sei189adguawugk3e55zn63z8r9ll29xrjwca636ra7v7gxuzn98sxyqwzt47l"]]],["Testnet",[["Sei","sei1dkdwdvknx0qav5cp5kw68mkn3r99m3svkyjfvkztwh97dv2lm0ksj6xrak"]]]],f1=[["Mainnet",[["Polygon",["Ethereum","0x86E4Dc95c7FBdBf52e33D563BbDB00823894C287"]],["Optimism",["Ethereum","0xdfe97868233d1aa22e815a266982f2cf17685a27"]],["Arbitrum",["Ethereum","0x1c479675ad559dc151f6ec7ed3fbf8cee79582b6"]]]],["Testnet",[["Polygon",["Ethereum","0x2890ba17efe978480615e330ecb65333b880928e"]],["Optimism",["Ethereum","0xe6dfba0953616bacab0c9a8ecb3a9bba77fc15c0"]],["Arbitrum",["Ethereum","0x45af9ed1d03703e480ce7d328fb684bb67da5049"]]]]],Xu=[["Mainnet",[["Ethereum",{porticoUniswap:"0x48b6101128C0ed1E208b7C910e60542A2ee6f476",uniswapQuoterV2:"0x61fFE014bA17989E743c5F6cB21bF9697530B21e",porticoPancakeSwap:"0x4db1683d60e0a933A9A477a19FA32F472bB9d06e",pancakeSwapQuoterV2:"0xB048Bbc1Ee6b733FFfCFb9e9CeF7375518e25997"}],["Polygon",{porticoUniswap:"0x227bABe533fa9a1085f5261210E0B7137E44437B",uniswapQuoterV2:"0x61fFE014bA17989E743c5F6cB21bF9697530B21e",porticoPancakeSwap:void 0,pancakeSwapQuoterV2:void 0}],["Bsc",{porticoUniswap:"0x05498574BD0Fa99eeCB01e1241661E7eE58F8a85",uniswapQuoterV2:"0x78D78E420Da98ad378D7799bE8f4AF69033EB077",porticoPancakeSwap:"0xF352DC165783538A26e38A536e76DceF227d90F2",pancakeSwapQuoterV2:"0xB048Bbc1Ee6b733FFfCFb9e9CeF7375518e25997"}],["Avalanche",{porticoUniswap:"0xE565E118e75304dD3cF83dff409c90034b7EA18a",uniswapQuoterV2:"0xbe0F5544EC67e9B3b2D979aaA43f18Fd87E6257F",porticoPancakeSwap:void 0,pancakeSwapQuoterV2:void 0}],["Arbitrum",{porticoUniswap:"0x48fa7528bFD6164DdF09dF0Ed22451cF59c84130",uniswapQuoterV2:"0x61fFE014bA17989E743c5F6cB21bF9697530B21e",porticoPancakeSwap:"0xE70946692E2e56ae47BfAe2d93d31bd60952B090",pancakeSwapQuoterV2:"0xB048Bbc1Ee6b733FFfCFb9e9CeF7375518e25997"}],["Optimism",{porticoUniswap:"0x9ae506cDDd27DEe1275fd1fe6627E5dc65257061",uniswapQuoterV2:"0x61fFE014bA17989E743c5F6cB21bF9697530B21e",porticoPancakeSwap:void 0,pancakeSwapQuoterV2:void 0}],["Base",{porticoUniswap:"0x610d4DFAC3EC32e0be98D18DDb280DACD76A1889",uniswapQuoterV2:"0x3d4e44Eb1374240CE5F1B871ab261CD16335B76a",porticoPancakeSwap:"0x4568aa1eA0ED54db666c58B4526B3FC9BD9be9bf",pancakeSwapQuoterV2:"0xB048Bbc1Ee6b733FFfCFb9e9CeF7375518e25997"}],["Celo",{porticoUniswap:"0xE565E118e75304dD3cF83dff409c90034b7EA18a",uniswapQuoterV2:"0x82825d0554fA07f7FC52Ab63c961F330fdEFa8E8",porticoPancakeSwap:void 0,pancakeSwapQuoterV2:void 0}]]]],h1=[["Mainnet",[["Solana","87MEvHZCXE3ML5rrmh5uX1FbShHmRXXS32xJDGbQ7h5t"],["Polygon","0x09959798B95d00a3183d20FaC298E4594E599eab"],["Arbitrum","0x1293a54e160D1cd7075487898d65266081A15458"],["Optimism","0x1293a54e160D1cd7075487898d65266081A15458"],["Base","0x09959798B95d00a3183d20FaC298E4594E599eab"]]]],m1=we(a1),b1=we(Vu),p1=we(Gu),g1=we(c1),y1=we(l1),ad=we(d1),cd=we(u1),ld=we(Xu),Si=we(h1),qa=we(Yu);we(f1);const w1=we(Vu,[0,1]),A1=we(Gu,[0,1]),E1=we(Yu,[0,1]),B1=we(Xu,[0,1]),Uc=[["Mainnet",[["0x58CC3AE5C097b213cE3c81979e1B9f9570746AA5","JumpCrypto"],["0xfF6CB952589BDE862c25Ef4392132fb9D4A42157","Staked"],["0x114De8460193bdf3A2fCf81f86a09765F4762fD1","Figment"],["0x107A0086b32d7A0977926A205131d8731D39cbEB","ChainodeTech"],["0x8C82B2fd82FaeD2711d59AF0F2499D16e726f6b2","Inotel"],["0x11b39756C042441BE6D8650b69b54EbE715E2343","HashQuark"],["0x54Ce5B4D348fb74B958e8966e2ec3dBd4958a7cd","Chainlayer"],["0x15e7cAF07C4e3DC8e7C469f92C8Cd88FB8005a20","xLabs"],["0x74a3bf913953D695260D88BC1aA25A4eeE363ef0","Forbole"],["0x000aC0076727b35FBea2dAc28fEE5cCB0fEA768e","StakingFund"],["0xAF45Ced136b9D9e24903464AE889F5C8a723FC14","MoonletWallet"],["0xf93124b7c738843CBB89E864c862c38cddCccF95","P2PValidator"],["0xD2CC37A4dc036a8D232b48f62cDD4731412f4890","01Node"],["0xDA798F6896A3331F64b48c12D1D57Fd9cbe70811","MCF"],["0x71AA1BE1D36CaFE3867910F99C09e347899C19C3","Everstake"],["0x8192b6E7387CCd768277c17DAb1b7a5027c0b3Cf","ChorusOne"],["0x178e21ad2E77AE06711549CFBB1f9c7a9d8096e8","Syncnode"],["0x5E1487F35515d02A92753504a8D75471b9f49EdB","Triton"],["0x6FbEBc898F403E4773E95feB15E80C9A99c8348d","StakingFacilities"]]],["Testnet",[["0x13947Bd48b18E53fdAeEe77F3473391aC727C638","Testnet guardian"]]]],[I6,U6]=bm(hr(_i(Uc)),[1,2]);we(Uc,[[0,2],1]);we(Uc,[1,[0,2]]);const _c=5,x1=[["Mainnet",[["Ethereum","0x18084fbA666a33d37592fA2633fD49a74DD93a88"],["Solana","6DNSN2BJsaPFdFFc1zP37kkeNe4Usc1Sqkzr9C9vPWcU"],["Polygon","0x236aa50979D5f3De3Bd1Eeb40E81137F22ab794b"],["Arbitrum","0x6c84a8f1c29108F47a79964b5Fe888D4f4D0dE40"],["Optimism","0x6c84a8f1c29108F47a79964b5Fe888D4f4D0dE40"],["Base","0x236aa50979D5f3De3Bd1Eeb40E81137F22ab794b"]]]],C1=we(x1);function Is(n){if(!Number.isSafeInteger(n)||n<0)throw new Error("positive integer expected, got "+n)}function S1(n){return n instanceof Uint8Array||ArrayBuffer.isView(n)&&n.constructor.name==="Uint8Array"}function vr(n,...e){if(!S1(n))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(n.length))throw new Error("Uint8Array expected of length "+e+", got length="+n.length)}function Zu(n){if(typeof n!="function"||typeof n.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Is(n.outputLen),Is(n.blockLen)}function Br(n,e=!0){if(n.destroyed)throw new Error("Hash instance has been destroyed");if(e&&n.finished)throw new Error("Hash#digest() has already been called")}function Mc(n,e){vr(n);const t=e.outputLen;if(n.length<t)throw new Error("digestInto() expects output buffer of length at least "+t)}const Lr=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Ju(n){return new Uint32Array(n.buffer,n.byteOffset,Math.floor(n.byteLength/4))}function Di(n){return new DataView(n.buffer,n.byteOffset,n.byteLength)}function hn(n,e){return n<<32-e|n>>>e}function D1(n,e){return n<<e|n>>>32-e>>>0}const Li=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function Qu(n){return n<<24&4278190080|n<<8&16711680|n>>>8&65280|n>>>24&255}const v1=Li?n=>n:n=>Qu(n);function Ka(n){for(let e=0;e<n.length;e++)n[e]=Qu(n[e])}const k1=Array.from({length:256},(n,e)=>e.toString(16).padStart(2,"0"));function F1(n){vr(n);let e="";for(let t=0;t<n.length;t++)e+=k1[n[t]];return e}const _n={_0:48,_9:57,A:65,F:70,a:97,f:102};function dd(n){if(n>=_n._0&&n<=_n._9)return n-_n._0;if(n>=_n.A&&n<=_n.F)return n-(_n.A-10);if(n>=_n.a&&n<=_n.f)return n-(_n.a-10)}function T1(n){if(typeof n!="string")throw new Error("hex string expected, got "+typeof n);const e=n.length,t=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);const r=new Uint8Array(t);for(let s=0,i=0;s<t;s++,i+=2){const o=dd(n.charCodeAt(i)),a=dd(n.charCodeAt(i+1));if(o===void 0||a===void 0){const l=n[i]+n[i+1];throw new Error('hex string expected, got non-hex character "'+l+'" at index '+i)}r[s]=o*16+a}return r}function ef(n){if(typeof n!="string")throw new Error("utf8ToBytes expected string, got "+typeof n);return new Uint8Array(new TextEncoder().encode(n))}function os(n){return typeof n=="string"&&(n=ef(n)),vr(n),n}function tf(...n){let e=0;for(let r=0;r<n.length;r++){const s=n[r];vr(s),e+=s.length}const t=new Uint8Array(e);for(let r=0,s=0;r<n.length;r++){const i=n[r];t.set(i,s),s+=i.length}return t}let io=class{clone(){return this._cloneInto()}};function I1(n,e){if(e!==void 0&&{}.toString.call(e)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(n,e)}function Xs(n){const e=r=>n().update(os(r)).digest(),t=n();return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=()=>n(),e}function U1(n){const e=(r,s)=>n(s).update(os(r)).digest(),t=n({});return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=r=>n(r),e}function Rc(n=32){if(Lr&&typeof Lr.getRandomValues=="function")return Lr.getRandomValues(new Uint8Array(n));if(Lr&&typeof Lr.randomBytes=="function")return Lr.randomBytes(n);throw new Error("crypto.getRandomValues must be defined")}function _1(n,e,t,r){if(typeof n.setBigUint64=="function")return n.setBigUint64(e,t,r);const s=BigInt(32),i=BigInt(4294967295),o=Number(t>>s&i),a=Number(t&i),l=r?4:0,h=r?0:4;n.setUint32(e+l,o,r),n.setUint32(e+h,a,r)}function M1(n,e,t){return n&e^~n&t}function R1(n,e,t){return n&e^n&t^e&t}class Wc extends io{constructor(e,t,r,s){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=s,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=Di(this.buffer)}update(e){Br(this);const{view:t,buffer:r,blockLen:s}=this;e=os(e);const i=e.length;for(let o=0;o<i;){const a=Math.min(s-this.pos,i-o);if(a===s){const l=Di(e);for(;s<=i-o;o+=s)this.process(l,o);continue}r.set(e.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===s&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Br(this),Mc(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:s,isLE:i}=this;let{pos:o}=this;t[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>s-o&&(this.process(r,0),o=0);for(let E=o;E<s;E++)t[E]=0;_1(r,s-8,BigInt(this.length*8),i),this.process(r,0);const a=Di(e),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const h=l/4,m=this.get();if(h>m.length)throw new Error("_sha2: outputLen bigger than state");for(let E=0;E<h;E++)a.setUint32(4*E,m[E],i)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:r,length:s,finished:i,destroyed:o,pos:a}=this;return e.length=s,e.pos=a,e.finished=i,e.destroyed=o,s%t&&e.buffer.set(r),e}}const W1=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),jn=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),$n=new Uint32Array(64);class P1 extends Wc{constructor(){super(64,32,8,!1),this.A=jn[0]|0,this.B=jn[1]|0,this.C=jn[2]|0,this.D=jn[3]|0,this.E=jn[4]|0,this.F=jn[5]|0,this.G=jn[6]|0,this.H=jn[7]|0}get(){const{A:e,B:t,C:r,D:s,E:i,F:o,G:a,H:l}=this;return[e,t,r,s,i,o,a,l]}set(e,t,r,s,i,o,a,l){this.A=e|0,this.B=t|0,this.C=r|0,this.D=s|0,this.E=i|0,this.F=o|0,this.G=a|0,this.H=l|0}process(e,t){for(let E=0;E<16;E++,t+=4)$n[E]=e.getUint32(t,!1);for(let E=16;E<64;E++){const S=$n[E-15],A=$n[E-2],g=hn(S,7)^hn(S,18)^S>>>3,D=hn(A,17)^hn(A,19)^A>>>10;$n[E]=D+$n[E-7]+g+$n[E-16]|0}let{A:r,B:s,C:i,D:o,E:a,F:l,G:h,H:m}=this;for(let E=0;E<64;E++){const S=hn(a,6)^hn(a,11)^hn(a,25),A=m+S+M1(a,l,h)+W1[E]+$n[E]|0,D=(hn(r,2)^hn(r,13)^hn(r,22))+R1(r,s,i)|0;m=h,h=l,l=a,a=o+A|0,o=i,i=s,s=r,r=A+D|0}r=r+this.A|0,s=s+this.B|0,i=i+this.C|0,o=o+this.D|0,a=a+this.E|0,l=l+this.F|0,h=h+this.G|0,m=m+this.H|0,this.set(r,s,i,o,a,l,h,m)}roundClean(){$n.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const Us=Xs(()=>new P1),ci=BigInt(2**32-1),ja=BigInt(32);function nf(n,e=!1){return e?{h:Number(n&ci),l:Number(n>>ja&ci)}:{h:Number(n>>ja&ci)|0,l:Number(n&ci)|0}}function rf(n,e=!1){let t=new Uint32Array(n.length),r=new Uint32Array(n.length);for(let s=0;s<n.length;s++){const{h:i,l:o}=nf(n[s],e);[t[s],r[s]]=[i,o]}return[t,r]}const L1=(n,e)=>BigInt(n>>>0)<<ja|BigInt(e>>>0),O1=(n,e,t)=>n>>>t,N1=(n,e,t)=>n<<32-t|e>>>t,z1=(n,e,t)=>n>>>t|e<<32-t,H1=(n,e,t)=>n<<32-t|e>>>t,q1=(n,e,t)=>n<<64-t|e>>>t-32,K1=(n,e,t)=>n>>>t-32|e<<64-t,j1=(n,e)=>e,$1=(n,e)=>n,sf=(n,e,t)=>n<<t|e>>>32-t,of=(n,e,t)=>e<<t|n>>>32-t,af=(n,e,t)=>e<<t-32|n>>>64-t,cf=(n,e,t)=>n<<t-32|e>>>64-t;function V1(n,e,t,r){const s=(e>>>0)+(r>>>0);return{h:n+t+(s/2**32|0)|0,l:s|0}}const G1=(n,e,t)=>(n>>>0)+(e>>>0)+(t>>>0),Y1=(n,e,t,r)=>e+t+r+(n/2**32|0)|0,X1=(n,e,t,r)=>(n>>>0)+(e>>>0)+(t>>>0)+(r>>>0),Z1=(n,e,t,r,s)=>e+t+r+s+(n/2**32|0)|0,J1=(n,e,t,r,s)=>(n>>>0)+(e>>>0)+(t>>>0)+(r>>>0)+(s>>>0),Q1=(n,e,t,r,s,i)=>e+t+r+s+i+(n/2**32|0)|0,me={fromBig:nf,split:rf,toBig:L1,shrSH:O1,shrSL:N1,rotrSH:z1,rotrSL:H1,rotrBH:q1,rotrBL:K1,rotr32H:j1,rotr32L:$1,rotlSH:sf,rotlSL:of,rotlBH:af,rotlBL:cf,add:V1,add3L:G1,add3H:Y1,add4L:X1,add4H:Z1,add5H:Q1,add5L:J1},lf=[],df=[],uf=[],eb=BigInt(0),ys=BigInt(1),tb=BigInt(2),nb=BigInt(7),rb=BigInt(256),sb=BigInt(113);for(let n=0,e=ys,t=1,r=0;n<24;n++){[t,r]=[r,(2*t+3*r)%5],lf.push(2*(5*r+t)),df.push((n+1)*(n+2)/2%64);let s=eb;for(let i=0;i<7;i++)e=(e<<ys^(e>>nb)*sb)%rb,e&tb&&(s^=ys<<(ys<<BigInt(i))-ys);uf.push(s)}const[ib,ob]=rf(uf,!0),ud=(n,e,t)=>t>32?af(n,e,t):sf(n,e,t),fd=(n,e,t)=>t>32?cf(n,e,t):of(n,e,t);function ab(n,e=24){const t=new Uint32Array(10);for(let r=24-e;r<24;r++){for(let o=0;o<10;o++)t[o]=n[o]^n[o+10]^n[o+20]^n[o+30]^n[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,l=(o+2)%10,h=t[l],m=t[l+1],E=ud(h,m,1)^t[a],S=fd(h,m,1)^t[a+1];for(let A=0;A<50;A+=10)n[o+A]^=E,n[o+A+1]^=S}let s=n[2],i=n[3];for(let o=0;o<24;o++){const a=df[o],l=ud(s,i,a),h=fd(s,i,a),m=lf[o];s=n[m],i=n[m+1],n[m]=l,n[m+1]=h}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)t[a]=n[o+a];for(let a=0;a<10;a++)n[o+a]^=~t[(a+2)%10]&t[(a+4)%10]}n[0]^=ib[r],n[1]^=ob[r]}t.fill(0)}let cb=class ff extends io{constructor(e,t,r,s=!1,i=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=s,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,Is(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=Ju(this.state)}keccak(){Li||Ka(this.state32),ab(this.state32,this.rounds),Li||Ka(this.state32),this.posOut=0,this.pos=0}update(e){Br(this);const{blockLen:t,state:r}=this;e=os(e);const s=e.length;for(let i=0;i<s;){const o=Math.min(t-this.pos,s-i);for(let a=0;a<o;a++)r[this.pos++]^=e[i++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:t,pos:r,blockLen:s}=this;e[r]^=t,t&128&&r===s-1&&this.keccak(),e[s-1]^=128,this.keccak()}writeInto(e){Br(this,!1),vr(e),this.finish();const t=this.state,{blockLen:r}=this;for(let s=0,i=e.length;s<i;){this.posOut>=r&&this.keccak();const o=Math.min(r-this.posOut,i-s);e.set(t.subarray(this.posOut,this.posOut+o),s),this.posOut+=o,s+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return Is(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(Mc(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:t,suffix:r,outputLen:s,rounds:i,enableXOF:o}=this;return e||(e=new ff(t,r,s,o,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=r,e.outputLen=s,e.enableXOF=o,e.destroyed=this.destroyed,e}};const hf=(n,e,t)=>Xs(()=>new cb(e,n,t)),lb=hf(6,136,256/8),_s=hf(1,136,256/8),[db,ub]=me.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(n=>BigInt(n))),Vn=new Uint32Array(80),Gn=new Uint32Array(80);class mf extends Wc{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:t,Bh:r,Bl:s,Ch:i,Cl:o,Dh:a,Dl:l,Eh:h,El:m,Fh:E,Fl:S,Gh:A,Gl:g,Hh:D,Hl:x}=this;return[e,t,r,s,i,o,a,l,h,m,E,S,A,g,D,x]}set(e,t,r,s,i,o,a,l,h,m,E,S,A,g,D,x){this.Ah=e|0,this.Al=t|0,this.Bh=r|0,this.Bl=s|0,this.Ch=i|0,this.Cl=o|0,this.Dh=a|0,this.Dl=l|0,this.Eh=h|0,this.El=m|0,this.Fh=E|0,this.Fl=S|0,this.Gh=A|0,this.Gl=g|0,this.Hh=D|0,this.Hl=x|0}process(e,t){for(let F=0;F<16;F++,t+=4)Vn[F]=e.getUint32(t),Gn[F]=e.getUint32(t+=4);for(let F=16;F<80;F++){const W=Vn[F-15]|0,z=Gn[F-15]|0,H=me.rotrSH(W,z,1)^me.rotrSH(W,z,8)^me.shrSH(W,z,7),K=me.rotrSL(W,z,1)^me.rotrSL(W,z,8)^me.shrSL(W,z,7),G=Vn[F-2]|0,V=Gn[F-2]|0,ie=me.rotrSH(G,V,19)^me.rotrBH(G,V,61)^me.shrSH(G,V,6),ne=me.rotrSL(G,V,19)^me.rotrBL(G,V,61)^me.shrSL(G,V,6),ae=me.add4L(K,ne,Gn[F-7],Gn[F-16]),I=me.add4H(ae,H,ie,Vn[F-7],Vn[F-16]);Vn[F]=I|0,Gn[F]=ae|0}let{Ah:r,Al:s,Bh:i,Bl:o,Ch:a,Cl:l,Dh:h,Dl:m,Eh:E,El:S,Fh:A,Fl:g,Gh:D,Gl:x,Hh:U,Hl:R}=this;for(let F=0;F<80;F++){const W=me.rotrSH(E,S,14)^me.rotrSH(E,S,18)^me.rotrBH(E,S,41),z=me.rotrSL(E,S,14)^me.rotrSL(E,S,18)^me.rotrBL(E,S,41),H=E&A^~E&D,K=S&g^~S&x,G=me.add5L(R,z,K,ub[F],Gn[F]),V=me.add5H(G,U,W,H,db[F],Vn[F]),ie=G|0,ne=me.rotrSH(r,s,28)^me.rotrBH(r,s,34)^me.rotrBH(r,s,39),ae=me.rotrSL(r,s,28)^me.rotrBL(r,s,34)^me.rotrBL(r,s,39),I=r&i^r&a^i&a,c=s&o^s&l^o&l;U=D|0,R=x|0,D=A|0,x=g|0,A=E|0,g=S|0,{h:E,l:S}=me.add(h|0,m|0,V|0,ie|0),h=a|0,m=l|0,a=i|0,l=o|0,i=r|0,o=s|0;const b=me.add3L(ie,ae,c);r=me.add3H(b,V,ne,I),s=b|0}({h:r,l:s}=me.add(this.Ah|0,this.Al|0,r|0,s|0)),{h:i,l:o}=me.add(this.Bh|0,this.Bl|0,i|0,o|0),{h:a,l}=me.add(this.Ch|0,this.Cl|0,a|0,l|0),{h,l:m}=me.add(this.Dh|0,this.Dl|0,h|0,m|0),{h:E,l:S}=me.add(this.Eh|0,this.El|0,E|0,S|0),{h:A,l:g}=me.add(this.Fh|0,this.Fl|0,A|0,g|0),{h:D,l:x}=me.add(this.Gh|0,this.Gl|0,D|0,x|0),{h:U,l:R}=me.add(this.Hh|0,this.Hl|0,U|0,R|0),this.set(r,s,i,o,a,l,h,m,E,S,A,g,D,x,U,R)}roundClean(){Vn.fill(0),Gn.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class fb extends mf{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}}const bf=Xs(()=>new mf),hb=Xs(()=>new fb);class pf extends io{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,Zu(e);const r=os(t);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const s=this.blockLen,i=new Uint8Array(s);i.set(r.length>s?e.create().update(r).digest():r);for(let o=0;o<i.length;o++)i[o]^=54;this.iHash.update(i),this.oHash=e.create();for(let o=0;o<i.length;o++)i[o]^=106;this.oHash.update(i),i.fill(0)}update(e){return Br(this),this.iHash.update(e),this}digestInto(e){Br(this),vr(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:r,finished:s,destroyed:i,blockLen:o,outputLen:a}=this;return e=e,e.finished=s,e.destroyed=i,e.blockLen=o,e.outputLen=a,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const Pc=(n,e,t)=>new pf(n,e).update(t).digest();Pc.create=(n,e)=>new pf(n,e);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const oo=BigInt(0),ao=BigInt(1),mb=BigInt(2);function xr(n){return n instanceof Uint8Array||ArrayBuffer.isView(n)&&n.constructor.name==="Uint8Array"}function as(n){if(!xr(n))throw new Error("Uint8Array expected")}function qn(n,e){if(typeof e!="boolean")throw new Error(n+" boolean expected, got "+e)}const bb=Array.from({length:256},(n,e)=>e.toString(16).padStart(2,"0"));function Cr(n){as(n);let e="";for(let t=0;t<n.length;t++)e+=bb[n[t]];return e}function Nr(n){const e=n.toString(16);return e.length&1?"0"+e:e}function Lc(n){if(typeof n!="string")throw new Error("hex string expected, got "+typeof n);return n===""?oo:BigInt("0x"+n)}const Mn={_0:48,_9:57,A:65,F:70,a:97,f:102};function hd(n){if(n>=Mn._0&&n<=Mn._9)return n-Mn._0;if(n>=Mn.A&&n<=Mn.F)return n-(Mn.A-10);if(n>=Mn.a&&n<=Mn.f)return n-(Mn.a-10)}function Vr(n){if(typeof n!="string")throw new Error("hex string expected, got "+typeof n);const e=n.length,t=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);const r=new Uint8Array(t);for(let s=0,i=0;s<t;s++,i+=2){const o=hd(n.charCodeAt(i)),a=hd(n.charCodeAt(i+1));if(o===void 0||a===void 0){const l=n[i]+n[i+1];throw new Error('hex string expected, got non-hex character "'+l+'" at index '+i)}r[s]=o*16+a}return r}function er(n){return Lc(Cr(n))}function jr(n){return as(n),Lc(Cr(Uint8Array.from(n).reverse()))}function Gr(n,e){return Vr(n.toString(16).padStart(e*2,"0"))}function Ms(n,e){return Gr(n,e).reverse()}function pb(n){return Vr(Nr(n))}function et(n,e,t){let r;if(typeof e=="string")try{r=Vr(e)}catch(i){throw new Error(n+" must be hex string or Uint8Array, cause: "+i)}else if(xr(e))r=Uint8Array.from(e);else throw new Error(n+" must be hex string or Uint8Array");const s=r.length;if(typeof t=="number"&&s!==t)throw new Error(n+" of length "+t+" expected, got "+s);return r}function rr(...n){let e=0;for(let r=0;r<n.length;r++){const s=n[r];as(s),e+=s.length}const t=new Uint8Array(e);for(let r=0,s=0;r<n.length;r++){const i=n[r];t.set(i,s),s+=i.length}return t}function gb(n,e){if(n.length!==e.length)return!1;let t=0;for(let r=0;r<n.length;r++)t|=n[r]^e[r];return t===0}function gf(n){if(typeof n!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(n))}const ia=n=>typeof n=="bigint"&&oo<=n;function co(n,e,t){return ia(n)&&ia(e)&&ia(t)&&e<=n&&n<t}function tn(n,e,t,r){if(!co(e,t,r))throw new Error("expected valid "+n+": "+t+" <= n < "+r+", got "+e)}function Oc(n){let e;for(e=0;n>oo;n>>=ao,e+=1);return e}function yf(n,e){return n>>BigInt(e)&ao}function yb(n,e,t){return n|(t?ao:oo)<<BigInt(e)}const lo=n=>(mb<<BigInt(n-1))-ao,oa=n=>new Uint8Array(n),md=n=>Uint8Array.from(n);function wf(n,e,t){if(typeof n!="number"||n<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof t!="function")throw new Error("hmacFn must be a function");let r=oa(n),s=oa(n),i=0;const o=()=>{r.fill(1),s.fill(0),i=0},a=(...E)=>t(s,r,...E),l=(E=oa())=>{s=a(md([0]),E),r=a(),E.length!==0&&(s=a(md([1]),E),r=a())},h=()=>{if(i++>=1e3)throw new Error("drbg: tried 1000 values");let E=0;const S=[];for(;E<e;){r=a();const A=r.slice();S.push(A),E+=r.length}return rr(...S)};return(E,S)=>{o(),l(E);let A;for(;!(A=S(h()));)l();return o(),A}}const wb={bigint:n=>typeof n=="bigint",function:n=>typeof n=="function",boolean:n=>typeof n=="boolean",string:n=>typeof n=="string",stringOrUint8Array:n=>typeof n=="string"||xr(n),isSafeInteger:n=>Number.isSafeInteger(n),array:n=>Array.isArray(n),field:(n,e)=>e.Fp.isValid(n),hash:n=>typeof n=="function"&&Number.isSafeInteger(n.outputLen)};function kr(n,e,t={}){const r=(s,i,o)=>{const a=wb[i];if(typeof a!="function")throw new Error("invalid validator function");const l=n[s];if(!(o&&l===void 0)&&!a(l,n))throw new Error("param "+String(s)+" is invalid. Expected "+i+", got "+l)};for(const[s,i]of Object.entries(e))r(s,i,!1);for(const[s,i]of Object.entries(t))r(s,i,!0);return n}const Af=()=>{throw new Error("not implemented")};function Yr(n){const e=new WeakMap;return(t,...r)=>{const s=e.get(t);if(s!==void 0)return s;const i=n(t,...r);return e.set(t,i),i}}const Ab=Object.freeze(Object.defineProperty({__proto__:null,aInRange:tn,abool:qn,abytes:as,bitGet:yf,bitLen:Oc,bitMask:lo,bitSet:yb,bytesToHex:Cr,bytesToNumberBE:er,bytesToNumberLE:jr,concatBytes:rr,createHmacDrbg:wf,ensureBytes:et,equalBytes:gb,hexToBytes:Vr,hexToNumber:Lc,inRange:co,isBytes:xr,memoized:Yr,notImplemented:Af,numberToBytesBE:Gr,numberToBytesLE:Ms,numberToHexUnpadded:Nr,numberToVarBytesBE:pb,utf8ToBytes:gf,validateObject:kr},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const kt=BigInt(0),Ge=BigInt(1),Xn=BigInt(2),Eb=BigInt(3),$a=BigInt(4),bd=BigInt(5),pd=BigInt(8);function je(n,e){const t=n%e;return t>=kt?t:e+t}function Bb(n,e,t){if(e<kt)throw new Error("invalid exponent, negatives unsupported");if(t<=kt)throw new Error("invalid modulus");if(t===Ge)return kt;let r=Ge;for(;e>kt;)e&Ge&&(r=r*n%t),n=n*n%t,e>>=Ge;return r}function Je(n,e,t){let r=n;for(;e-- >kt;)r*=r,r%=t;return r}function Va(n,e){if(n===kt)throw new Error("invert: expected non-zero number");if(e<=kt)throw new Error("invert: expected positive modulus, got "+e);let t=je(n,e),r=e,s=kt,i=Ge;for(;t!==kt;){const a=r/t,l=r%t,h=s-i*a;r=t,t=l,s=i,i=h}if(r!==Ge)throw new Error("invert: does not exist");return je(s,e)}function xb(n){const e=(n-Ge)/Xn;let t,r,s;for(t=n-Ge,r=0;t%Xn===kt;t/=Xn,r++);for(s=Xn;s<n&&Bb(s,e,n)!==n-Ge;s++)if(s>1e3)throw new Error("Cannot find square root: likely non-prime P");if(r===1){const o=(n+Ge)/$a;return function(l,h){const m=l.pow(h,o);if(!l.eql(l.sqr(m),h))throw new Error("Cannot find square root");return m}}const i=(t+Ge)/Xn;return function(a,l){if(a.pow(l,e)===a.neg(a.ONE))throw new Error("Cannot find square root");let h=r,m=a.pow(a.mul(a.ONE,s),t),E=a.pow(l,i),S=a.pow(l,t);for(;!a.eql(S,a.ONE);){if(a.eql(S,a.ZERO))return a.ZERO;let A=1;for(let D=a.sqr(S);A<h&&!a.eql(D,a.ONE);A++)D=a.sqr(D);const g=a.pow(m,Ge<<BigInt(h-A-1));m=a.sqr(g),E=a.mul(E,g),S=a.mul(S,m),h=A}return E}}function Cb(n){if(n%$a===Eb){const e=(n+Ge)/$a;return function(r,s){const i=r.pow(s,e);if(!r.eql(r.sqr(i),s))throw new Error("Cannot find square root");return i}}if(n%pd===bd){const e=(n-bd)/pd;return function(r,s){const i=r.mul(s,Xn),o=r.pow(i,e),a=r.mul(s,o),l=r.mul(r.mul(a,Xn),o),h=r.mul(a,r.sub(l,r.ONE));if(!r.eql(r.sqr(h),s))throw new Error("Cannot find square root");return h}}return xb(n)}const Sb=(n,e)=>(je(n,e)&Ge)===Ge,Db=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function vb(n){const e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},t=Db.reduce((r,s)=>(r[s]="function",r),e);return kr(n,t)}function Ef(n,e,t){if(t<kt)throw new Error("invalid exponent, negatives unsupported");if(t===kt)return n.ONE;if(t===Ge)return e;let r=n.ONE,s=e;for(;t>kt;)t&Ge&&(r=n.mul(r,s)),s=n.sqr(s),t>>=Ge;return r}function Bf(n,e){const t=new Array(e.length),r=e.reduce((i,o,a)=>n.is0(o)?i:(t[a]=i,n.mul(i,o)),n.ONE),s=n.inv(r);return e.reduceRight((i,o,a)=>n.is0(o)?i:(t[a]=n.mul(i,t[a]),n.mul(i,o)),s),t}function kb(n){const e=(n-Ge)/Xn;return(t,r)=>t.pow(r,e)}function xf(n,e){const t=e!==void 0?e:n.toString(2).length,r=Math.ceil(t/8);return{nBitLength:t,nByteLength:r}}function Zs(n,e,t=!1,r={}){if(n<=kt)throw new Error("invalid field: expected ORDER > 0, got "+n);const{nBitLength:s,nByteLength:i}=xf(n,e);if(i>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let o;const a=Object.freeze({ORDER:n,isLE:t,BITS:s,BYTES:i,MASK:lo(s),ZERO:kt,ONE:Ge,create:l=>je(l,n),isValid:l=>{if(typeof l!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof l);return kt<=l&&l<n},is0:l=>l===kt,isOdd:l=>(l&Ge)===Ge,neg:l=>je(-l,n),eql:(l,h)=>l===h,sqr:l=>je(l*l,n),add:(l,h)=>je(l+h,n),sub:(l,h)=>je(l-h,n),mul:(l,h)=>je(l*h,n),pow:(l,h)=>Ef(a,l,h),div:(l,h)=>je(l*Va(h,n),n),sqrN:l=>l*l,addN:(l,h)=>l+h,subN:(l,h)=>l-h,mulN:(l,h)=>l*h,inv:l=>Va(l,n),sqrt:r.sqrt||(l=>(o||(o=Cb(n)),o(a,l))),invertBatch:l=>Bf(a,l),cmov:(l,h,m)=>m?h:l,toBytes:l=>t?Ms(l,i):Gr(l,i),fromBytes:l=>{if(l.length!==i)throw new Error("Field.fromBytes: expected "+i+" bytes, got "+l.length);return t?jr(l):er(l)}});return Object.freeze(a)}function Cf(n){if(typeof n!="bigint")throw new Error("field order must be bigint");const e=n.toString(2).length;return Math.ceil(e/8)}function Nc(n){const e=Cf(n);return e+Math.ceil(e/2)}function Sf(n,e,t=!1){const r=n.length,s=Cf(e),i=Nc(e);if(r<16||r<i||r>1024)throw new Error("expected "+i+"-1024 bytes of input, got "+r);const o=t?jr(n):er(n),a=je(o,e-Ge)+Ge;return t?Ms(a,s):Gr(a,s)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const gd=BigInt(0),li=BigInt(1);function aa(n,e){const t=e.negate();return n?t:e}function Df(n,e){if(!Number.isSafeInteger(n)||n<=0||n>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+n)}function ca(n,e){Df(n,e);const t=Math.ceil(e/n)+1,r=2**(n-1);return{windows:t,windowSize:r}}function Fb(n,e){if(!Array.isArray(n))throw new Error("array expected");n.forEach((t,r)=>{if(!(t instanceof e))throw new Error("invalid point at index "+r)})}function Tb(n,e){if(!Array.isArray(n))throw new Error("array of scalars expected");n.forEach((t,r)=>{if(!e.isValid(t))throw new Error("invalid scalar at index "+r)})}const la=new WeakMap,vf=new WeakMap;function da(n){return vf.get(n)||1}function kf(n,e){return{constTimeNegate:aa,hasPrecomputes(t){return da(t)!==1},unsafeLadder(t,r,s=n.ZERO){let i=t;for(;r>gd;)r&li&&(s=s.add(i)),i=i.double(),r>>=li;return s},precomputeWindow(t,r){const{windows:s,windowSize:i}=ca(r,e),o=[];let a=t,l=a;for(let h=0;h<s;h++){l=a,o.push(l);for(let m=1;m<i;m++)l=l.add(a),o.push(l);a=l.double()}return o},wNAF(t,r,s){const{windows:i,windowSize:o}=ca(t,e);let a=n.ZERO,l=n.BASE;const h=BigInt(2**t-1),m=2**t,E=BigInt(t);for(let S=0;S<i;S++){const A=S*o;let g=Number(s&h);s>>=E,g>o&&(g-=m,s+=li);const D=A,x=A+Math.abs(g)-1,U=S%2!==0,R=g<0;g===0?l=l.add(aa(U,r[D])):a=a.add(aa(R,r[x]))}return{p:a,f:l}},wNAFUnsafe(t,r,s,i=n.ZERO){const{windows:o,windowSize:a}=ca(t,e),l=BigInt(2**t-1),h=2**t,m=BigInt(t);for(let E=0;E<o;E++){const S=E*a;if(s===gd)break;let A=Number(s&l);if(s>>=m,A>a&&(A-=h,s+=li),A===0)continue;let g=r[S+Math.abs(A)-1];A<0&&(g=g.negate()),i=i.add(g)}return i},getPrecomputes(t,r,s){let i=la.get(r);return i||(i=this.precomputeWindow(r,t),t!==1&&la.set(r,s(i))),i},wNAFCached(t,r,s){const i=da(t);return this.wNAF(i,this.getPrecomputes(i,t,s),r)},wNAFCachedUnsafe(t,r,s,i){const o=da(t);return o===1?this.unsafeLadder(t,r,i):this.wNAFUnsafe(o,this.getPrecomputes(o,t,s),r,i)},setWindowSize(t,r){Df(r,e),vf.set(t,r),la.delete(t)}}}function Ff(n,e,t,r){if(Fb(t,n),Tb(r,e),t.length!==r.length)throw new Error("arrays of points and scalars must have equal length");const s=n.ZERO,i=Oc(BigInt(t.length)),o=i>12?i-3:i>4?i-2:i?2:1,a=(1<<o)-1,l=new Array(a+1).fill(s),h=Math.floor((e.BITS-1)/o)*o;let m=s;for(let E=h;E>=0;E-=o){l.fill(s);for(let A=0;A<r.length;A++){const g=r[A],D=Number(g>>BigInt(E)&BigInt(a));l[D]=l[D].add(t[A])}let S=s;for(let A=l.length-1,g=s;A>0;A--)g=g.add(l[A]),S=S.add(g);if(m=m.add(S),E!==0)for(let A=0;A<o;A++)m=m.double()}return m}function zc(n){return vb(n.Fp),kr(n,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...xf(n.n,n.nBitLength),...n,p:n.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function yd(n){n.lowS!==void 0&&qn("lowS",n.lowS),n.prehash!==void 0&&qn("prehash",n.prehash)}function Ib(n){const e=zc(n);kr(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:t,Fp:r,a:s}=e;if(t){if(!r.eql(s,r.ZERO))throw new Error("invalid endomorphism, can only be defined for Koblitz curves that have a=0");if(typeof t!="object"||typeof t.beta!="bigint"||typeof t.splitScalar!="function")throw new Error("invalid endomorphism, expected beta: bigint and splitScalar: function")}return Object.freeze({...e})}const{bytesToNumberBE:Ub,hexToBytes:_b}=Ab;class Mb extends Error{constructor(e=""){super(e)}}const Wn={Err:Mb,_tlv:{encode:(n,e)=>{const{Err:t}=Wn;if(n<0||n>256)throw new t("tlv.encode: wrong tag");if(e.length&1)throw new t("tlv.encode: unpadded data");const r=e.length/2,s=Nr(r);if(s.length/2&128)throw new t("tlv.encode: long form length too big");const i=r>127?Nr(s.length/2|128):"";return Nr(n)+i+s+e},decode(n,e){const{Err:t}=Wn;let r=0;if(n<0||n>256)throw new t("tlv.encode: wrong tag");if(e.length<2||e[r++]!==n)throw new t("tlv.decode: wrong tlv");const s=e[r++],i=!!(s&128);let o=0;if(!i)o=s;else{const l=s&127;if(!l)throw new t("tlv.decode(long): indefinite length not supported");if(l>4)throw new t("tlv.decode(long): byte length is too big");const h=e.subarray(r,r+l);if(h.length!==l)throw new t("tlv.decode: length bytes not complete");if(h[0]===0)throw new t("tlv.decode(long): zero leftmost byte");for(const m of h)o=o<<8|m;if(r+=l,o<128)throw new t("tlv.decode(long): not minimal encoding")}const a=e.subarray(r,r+o);if(a.length!==o)throw new t("tlv.decode: wrong value length");return{v:a,l:e.subarray(r+o)}}},_int:{encode(n){const{Err:e}=Wn;if(n<Pn)throw new e("integer: negative integers are not allowed");let t=Nr(n);if(Number.parseInt(t[0],16)&8&&(t="00"+t),t.length&1)throw new e("unexpected DER parsing assertion: unpadded hex");return t},decode(n){const{Err:e}=Wn;if(n[0]&128)throw new e("invalid signature integer: negative");if(n[0]===0&&!(n[1]&128))throw new e("invalid signature integer: unnecessary leading zero");return Ub(n)}},toSig(n){const{Err:e,_int:t,_tlv:r}=Wn,s=typeof n=="string"?_b(n):n;as(s);const{v:i,l:o}=r.decode(48,s);if(o.length)throw new e("invalid signature: left bytes after parsing");const{v:a,l}=r.decode(2,i),{v:h,l:m}=r.decode(2,l);if(m.length)throw new e("invalid signature: left bytes after parsing");return{r:t.decode(a),s:t.decode(h)}},hexFromSig(n){const{_tlv:e,_int:t}=Wn,r=e.encode(2,t.encode(n.r)),s=e.encode(2,t.encode(n.s)),i=r+s;return e.encode(48,i)}},Pn=BigInt(0),St=BigInt(1);BigInt(2);const wd=BigInt(3);BigInt(4);function Tf(n){const e=Ib(n),{Fp:t}=e,r=Zs(e.n,e.nBitLength),s=e.toBytes||((D,x,U)=>{const R=x.toAffine();return rr(Uint8Array.from([4]),t.toBytes(R.x),t.toBytes(R.y))}),i=e.fromBytes||(D=>{const x=D.subarray(1),U=t.fromBytes(x.subarray(0,t.BYTES)),R=t.fromBytes(x.subarray(t.BYTES,2*t.BYTES));return{x:U,y:R}});function o(D){const{a:x,b:U}=e,R=t.sqr(D),F=t.mul(R,D);return t.add(t.add(F,t.mul(D,x)),U)}if(!t.eql(t.sqr(e.Gy),o(e.Gx)))throw new Error("bad generator point: equation left != right");function a(D){return co(D,St,e.n)}function l(D){const{allowedPrivateKeyLengths:x,nByteLength:U,wrapPrivateKey:R,n:F}=e;if(x&&typeof D!="bigint"){if(xr(D)&&(D=Cr(D)),typeof D!="string"||!x.includes(D.length))throw new Error("invalid private key");D=D.padStart(U*2,"0")}let W;try{W=typeof D=="bigint"?D:er(et("private key",D,U))}catch{throw new Error("invalid private key, expected hex or "+U+" bytes, got "+typeof D)}return R&&(W=je(W,F)),tn("private key",W,St,F),W}function h(D){if(!(D instanceof S))throw new Error("ProjectivePoint expected")}const m=Yr((D,x)=>{const{px:U,py:R,pz:F}=D;if(t.eql(F,t.ONE))return{x:U,y:R};const W=D.is0();x==null&&(x=W?t.ONE:t.inv(F));const z=t.mul(U,x),H=t.mul(R,x),K=t.mul(F,x);if(W)return{x:t.ZERO,y:t.ZERO};if(!t.eql(K,t.ONE))throw new Error("invZ was invalid");return{x:z,y:H}}),E=Yr(D=>{if(D.is0()){if(e.allowInfinityPoint&&!t.is0(D.py))return;throw new Error("bad point: ZERO")}const{x,y:U}=D.toAffine();if(!t.isValid(x)||!t.isValid(U))throw new Error("bad point: x or y not FE");const R=t.sqr(U),F=o(x);if(!t.eql(R,F))throw new Error("bad point: equation left != right");if(!D.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class S{constructor(x,U,R){if(this.px=x,this.py=U,this.pz=R,x==null||!t.isValid(x))throw new Error("x required");if(U==null||!t.isValid(U))throw new Error("y required");if(R==null||!t.isValid(R))throw new Error("z required");Object.freeze(this)}static fromAffine(x){const{x:U,y:R}=x||{};if(!x||!t.isValid(U)||!t.isValid(R))throw new Error("invalid affine point");if(x instanceof S)throw new Error("projective point not allowed");const F=W=>t.eql(W,t.ZERO);return F(U)&&F(R)?S.ZERO:new S(U,R,t.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(x){const U=t.invertBatch(x.map(R=>R.pz));return x.map((R,F)=>R.toAffine(U[F])).map(S.fromAffine)}static fromHex(x){const U=S.fromAffine(i(et("pointHex",x)));return U.assertValidity(),U}static fromPrivateKey(x){return S.BASE.multiply(l(x))}static msm(x,U){return Ff(S,r,x,U)}_setWindowSize(x){g.setWindowSize(this,x)}assertValidity(){E(this)}hasEvenY(){const{y:x}=this.toAffine();if(t.isOdd)return!t.isOdd(x);throw new Error("Field doesn't support isOdd")}equals(x){h(x);const{px:U,py:R,pz:F}=this,{px:W,py:z,pz:H}=x,K=t.eql(t.mul(U,H),t.mul(W,F)),G=t.eql(t.mul(R,H),t.mul(z,F));return K&&G}negate(){return new S(this.px,t.neg(this.py),this.pz)}double(){const{a:x,b:U}=e,R=t.mul(U,wd),{px:F,py:W,pz:z}=this;let H=t.ZERO,K=t.ZERO,G=t.ZERO,V=t.mul(F,F),ie=t.mul(W,W),ne=t.mul(z,z),ae=t.mul(F,W);return ae=t.add(ae,ae),G=t.mul(F,z),G=t.add(G,G),H=t.mul(x,G),K=t.mul(R,ne),K=t.add(H,K),H=t.sub(ie,K),K=t.add(ie,K),K=t.mul(H,K),H=t.mul(ae,H),G=t.mul(R,G),ne=t.mul(x,ne),ae=t.sub(V,ne),ae=t.mul(x,ae),ae=t.add(ae,G),G=t.add(V,V),V=t.add(G,V),V=t.add(V,ne),V=t.mul(V,ae),K=t.add(K,V),ne=t.mul(W,z),ne=t.add(ne,ne),V=t.mul(ne,ae),H=t.sub(H,V),G=t.mul(ne,ie),G=t.add(G,G),G=t.add(G,G),new S(H,K,G)}add(x){h(x);const{px:U,py:R,pz:F}=this,{px:W,py:z,pz:H}=x;let K=t.ZERO,G=t.ZERO,V=t.ZERO;const ie=e.a,ne=t.mul(e.b,wd);let ae=t.mul(U,W),I=t.mul(R,z),c=t.mul(F,H),b=t.add(U,R),p=t.add(W,z);b=t.mul(b,p),p=t.add(ae,I),b=t.sub(b,p),p=t.add(U,F);let y=t.add(W,H);return p=t.mul(p,y),y=t.add(ae,c),p=t.sub(p,y),y=t.add(R,F),K=t.add(z,H),y=t.mul(y,K),K=t.add(I,c),y=t.sub(y,K),V=t.mul(ie,p),K=t.mul(ne,c),V=t.add(K,V),K=t.sub(I,V),V=t.add(I,V),G=t.mul(K,V),I=t.add(ae,ae),I=t.add(I,ae),c=t.mul(ie,c),p=t.mul(ne,p),I=t.add(I,c),c=t.sub(ae,c),c=t.mul(ie,c),p=t.add(p,c),ae=t.mul(I,p),G=t.add(G,ae),ae=t.mul(y,p),K=t.mul(b,K),K=t.sub(K,ae),ae=t.mul(b,I),V=t.mul(y,V),V=t.add(V,ae),new S(K,G,V)}subtract(x){return this.add(x.negate())}is0(){return this.equals(S.ZERO)}wNAF(x){return g.wNAFCached(this,x,S.normalizeZ)}multiplyUnsafe(x){const{endo:U,n:R}=e;tn("scalar",x,Pn,R);const F=S.ZERO;if(x===Pn)return F;if(this.is0()||x===St)return this;if(!U||g.hasPrecomputes(this))return g.wNAFCachedUnsafe(this,x,S.normalizeZ);let{k1neg:W,k1:z,k2neg:H,k2:K}=U.splitScalar(x),G=F,V=F,ie=this;for(;z>Pn||K>Pn;)z&St&&(G=G.add(ie)),K&St&&(V=V.add(ie)),ie=ie.double(),z>>=St,K>>=St;return W&&(G=G.negate()),H&&(V=V.negate()),V=new S(t.mul(V.px,U.beta),V.py,V.pz),G.add(V)}multiply(x){const{endo:U,n:R}=e;tn("scalar",x,St,R);let F,W;if(U){const{k1neg:z,k1:H,k2neg:K,k2:G}=U.splitScalar(x);let{p:V,f:ie}=this.wNAF(H),{p:ne,f:ae}=this.wNAF(G);V=g.constTimeNegate(z,V),ne=g.constTimeNegate(K,ne),ne=new S(t.mul(ne.px,U.beta),ne.py,ne.pz),F=V.add(ne),W=ie.add(ae)}else{const{p:z,f:H}=this.wNAF(x);F=z,W=H}return S.normalizeZ([F,W])[0]}multiplyAndAddUnsafe(x,U,R){const F=S.BASE,W=(H,K)=>K===Pn||K===St||!H.equals(F)?H.multiplyUnsafe(K):H.multiply(K),z=W(this,U).add(W(x,R));return z.is0()?void 0:z}toAffine(x){return m(this,x)}isTorsionFree(){const{h:x,isTorsionFree:U}=e;if(x===St)return!0;if(U)return U(S,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:x,clearCofactor:U}=e;return x===St?this:U?U(S,this):this.multiplyUnsafe(e.h)}toRawBytes(x=!0){return qn("isCompressed",x),this.assertValidity(),s(S,this,x)}toHex(x=!0){return qn("isCompressed",x),Cr(this.toRawBytes(x))}}S.BASE=new S(e.Gx,e.Gy,t.ONE),S.ZERO=new S(t.ZERO,t.ONE,t.ZERO);const A=e.nBitLength,g=kf(S,e.endo?Math.ceil(A/2):A);return{CURVE:e,ProjectivePoint:S,normPrivateKeyToScalar:l,weierstrassEquation:o,isWithinCurveOrder:a}}function Rb(n){const e=zc(n);return kr(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function If(n){const e=Rb(n),{Fp:t,n:r}=e,s=t.BYTES+1,i=2*t.BYTES+1;function o(c){return je(c,r)}function a(c){return Va(c,r)}const{ProjectivePoint:l,normPrivateKeyToScalar:h,weierstrassEquation:m,isWithinCurveOrder:E}=Tf({...e,toBytes(c,b,p){const y=b.toAffine(),C=t.toBytes(y.x),T=rr;return qn("isCompressed",p),p?T(Uint8Array.from([b.hasEvenY()?2:3]),C):T(Uint8Array.from([4]),C,t.toBytes(y.y))},fromBytes(c){const b=c.length,p=c[0],y=c.subarray(1);if(b===s&&(p===2||p===3)){const C=er(y);if(!co(C,St,t.ORDER))throw new Error("Point is not on curve");const T=m(C);let _;try{_=t.sqrt(T)}catch(k){const $=k instanceof Error?": "+k.message:"";throw new Error("Point is not on curve"+$)}const B=(_&St)===St;return(p&1)===1!==B&&(_=t.neg(_)),{x:C,y:_}}else if(b===i&&p===4){const C=t.fromBytes(y.subarray(0,t.BYTES)),T=t.fromBytes(y.subarray(t.BYTES,2*t.BYTES));return{x:C,y:T}}else{const C=s,T=i;throw new Error("invalid Point, expected length of "+C+", or uncompressed "+T+", got "+b)}}}),S=c=>Cr(Gr(c,e.nByteLength));function A(c){const b=r>>St;return c>b}function g(c){return A(c)?o(-c):c}const D=(c,b,p)=>er(c.slice(b,p));class x{constructor(b,p,y){this.r=b,this.s=p,this.recovery=y,this.assertValidity()}static fromCompact(b){const p=e.nByteLength;return b=et("compactSignature",b,p*2),new x(D(b,0,p),D(b,p,2*p))}static fromDER(b){const{r:p,s:y}=Wn.toSig(et("DER",b));return new x(p,y)}assertValidity(){tn("r",this.r,St,r),tn("s",this.s,St,r)}addRecoveryBit(b){return new x(this.r,this.s,b)}recoverPublicKey(b){const{r:p,s:y,recovery:C}=this,T=H(et("msgHash",b));if(C==null||![0,1,2,3].includes(C))throw new Error("recovery id invalid");const _=C===2||C===3?p+e.n:p;if(_>=t.ORDER)throw new Error("recovery id 2 or 3 invalid");const B=C&1?"03":"02",u=l.fromHex(B+S(_)),k=a(_),$=o(-T*k),Z=o(y*k),ee=l.BASE.multiplyAndAddUnsafe(u,$,Z);if(!ee)throw new Error("point at infinify");return ee.assertValidity(),ee}hasHighS(){return A(this.s)}normalizeS(){return this.hasHighS()?new x(this.r,o(-this.s),this.recovery):this}toDERRawBytes(){return Vr(this.toDERHex())}toDERHex(){return Wn.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Vr(this.toCompactHex())}toCompactHex(){return S(this.r)+S(this.s)}}const U={isValidPrivateKey(c){try{return h(c),!0}catch{return!1}},normPrivateKeyToScalar:h,randomPrivateKey:()=>{const c=Nc(e.n);return Sf(e.randomBytes(c),e.n)},precompute(c=8,b=l.BASE){return b._setWindowSize(c),b.multiply(BigInt(3)),b}};function R(c,b=!0){return l.fromPrivateKey(c).toRawBytes(b)}function F(c){const b=xr(c),p=typeof c=="string",y=(b||p)&&c.length;return b?y===s||y===i:p?y===2*s||y===2*i:c instanceof l}function W(c,b,p=!0){if(F(c))throw new Error("first arg must be private key");if(!F(b))throw new Error("second arg must be public key");return l.fromHex(b).multiply(h(c)).toRawBytes(p)}const z=e.bits2int||function(c){if(c.length>8192)throw new Error("input is too large");const b=er(c),p=c.length*8-e.nBitLength;return p>0?b>>BigInt(p):b},H=e.bits2int_modN||function(c){return o(z(c))},K=lo(e.nBitLength);function G(c){return tn("num < 2^"+e.nBitLength,c,Pn,K),Gr(c,e.nByteLength)}function V(c,b,p=ie){if(["recovered","canonical"].some(le=>le in p))throw new Error("sign() legacy options not supported");const{hash:y,randomBytes:C}=e;let{lowS:T,prehash:_,extraEntropy:B}=p;T==null&&(T=!0),c=et("msgHash",c),yd(p),_&&(c=et("prehashed msgHash",y(c)));const u=H(c),k=h(b),$=[G(k),G(u)];if(B!=null&&B!==!1){const le=B===!0?C(t.BYTES):B;$.push(et("extraEntropy",le))}const Z=rr(...$),ee=u;function Ae(le){const ue=z(le);if(!E(ue))return;const Ze=a(ue),Ee=l.BASE.multiply(ue).toAffine(),ye=o(Ee.x);if(ye===Pn)return;const nt=o(Ze*o(ee+ye*k));if(nt===Pn)return;let Ce=(Ee.x===ye?0:2)|Number(Ee.y&St),ke=nt;return T&&A(nt)&&(ke=g(nt),Ce^=1),new x(ye,ke,Ce)}return{seed:Z,k2sig:Ae}}const ie={lowS:e.lowS,prehash:!1},ne={lowS:e.lowS,prehash:!1};function ae(c,b,p=ie){const{seed:y,k2sig:C}=V(c,b,p),T=e;return wf(T.hash.outputLen,T.nByteLength,T.hmac)(y,C)}l.BASE._setWindowSize(8);function I(c,b,p,y=ne){var Ce;const C=c;b=et("msgHash",b),p=et("publicKey",p);const{lowS:T,prehash:_,format:B}=y;if(yd(y),"strict"in y)throw new Error("options.strict was renamed to lowS");if(B!==void 0&&B!=="compact"&&B!=="der")throw new Error("format must be compact or der");const u=typeof C=="string"||xr(C),k=!u&&!B&&typeof C=="object"&&C!==null&&typeof C.r=="bigint"&&typeof C.s=="bigint";if(!u&&!k)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let $,Z;try{if(k&&($=new x(C.r,C.s)),u){try{B!=="compact"&&($=x.fromDER(C))}catch(ke){if(!(ke instanceof Wn.Err))throw ke}!$&&B!=="der"&&($=x.fromCompact(C))}Z=l.fromHex(p)}catch{return!1}if(!$||T&&$.hasHighS())return!1;_&&(b=e.hash(b));const{r:ee,s:Ae}=$,le=H(b),ue=a(Ae),Ze=o(le*ue),Ee=o(ee*ue),ye=(Ce=l.BASE.multiplyAndAddUnsafe(Z,Ze,Ee))==null?void 0:Ce.toAffine();return ye?o(ye.x)===ee:!1}return{CURVE:e,getPublicKey:R,getSharedSecret:W,sign:ae,verify:I,ProjectivePoint:l,Signature:x,utils:U}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Uf(n){return{hash:n,hmac:(e,...t)=>Pc(n,e,tf(...t)),randomBytes:Rc}}function Wb(n,e){const t=r=>If({...n,...Uf(r)});return{...t(e),create:t}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _f=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Ad=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Pb=BigInt(1),Ga=BigInt(2),Ed=(n,e)=>(n+e/Ga)/e;function Lb(n){const e=_f,t=BigInt(3),r=BigInt(6),s=BigInt(11),i=BigInt(22),o=BigInt(23),a=BigInt(44),l=BigInt(88),h=n*n*n%e,m=h*h*n%e,E=Je(m,t,e)*m%e,S=Je(E,t,e)*m%e,A=Je(S,Ga,e)*h%e,g=Je(A,s,e)*A%e,D=Je(g,i,e)*g%e,x=Je(D,a,e)*D%e,U=Je(x,l,e)*x%e,R=Je(U,a,e)*D%e,F=Je(R,t,e)*m%e,W=Je(F,o,e)*g%e,z=Je(W,r,e)*h%e,H=Je(z,Ga,e);if(!Ya.eql(Ya.sqr(H),n))throw new Error("Cannot find square root");return H}const Ya=Zs(_f,void 0,void 0,{sqrt:Lb}),Hn=Wb({a:BigInt(0),b:BigInt(7),Fp:Ya,n:Ad,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:n=>{const e=Ad,t=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-Pb*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=t,o=BigInt("0x100000000000000000000000000000000"),a=Ed(i*n,e),l=Ed(-r*n,e);let h=je(n-a*t-l*s,e),m=je(-a*r-l*i,e);const E=h>o,S=m>o;if(E&&(h=e-h),S&&(m=e-m),h>o||m>o)throw new Error("splitScalar: Endomorphism failed, k="+n);return{k1neg:E,k1:h,k2neg:S,k2:m}}}},Us);BigInt(0);Hn.ProjectivePoint;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const ln=BigInt(0),$t=BigInt(1),di=BigInt(2),Ob=BigInt(8),Nb={zip215:!0};function zb(n){const e=zc(n);return kr(n,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...e})}function Hb(n){const e=zb(n),{Fp:t,n:r,prehash:s,hash:i,randomBytes:o,nByteLength:a,h:l}=e,h=di<<BigInt(a*8)-$t,m=t.create,E=Zs(e.n,e.nBitLength),S=e.uvRatio||((p,y)=>{try{return{isValid:!0,value:t.sqrt(p*t.inv(y))}}catch{return{isValid:!1,value:ln}}}),A=e.adjustScalarBytes||(p=>p),g=e.domain||((p,y,C)=>{if(qn("phflag",C),y.length||C)throw new Error("Contexts/pre-hash are not supported");return p});function D(p,y){tn("coordinate "+p,y,ln,h)}function x(p){if(!(p instanceof F))throw new Error("ExtendedPoint expected")}const U=Yr((p,y)=>{const{ex:C,ey:T,ez:_}=p,B=p.is0();y==null&&(y=B?Ob:t.inv(_));const u=m(C*y),k=m(T*y),$=m(_*y);if(B)return{x:ln,y:$t};if($!==$t)throw new Error("invZ was invalid");return{x:u,y:k}}),R=Yr(p=>{const{a:y,d:C}=e;if(p.is0())throw new Error("bad point: ZERO");const{ex:T,ey:_,ez:B,et:u}=p,k=m(T*T),$=m(_*_),Z=m(B*B),ee=m(Z*Z),Ae=m(k*y),le=m(Z*m(Ae+$)),ue=m(ee+m(C*m(k*$)));if(le!==ue)throw new Error("bad point: equation left != right (1)");const Ze=m(T*_),Ee=m(B*u);if(Ze!==Ee)throw new Error("bad point: equation left != right (2)");return!0});class F{constructor(y,C,T,_){this.ex=y,this.ey=C,this.ez=T,this.et=_,D("x",y),D("y",C),D("z",T),D("t",_),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(y){if(y instanceof F)throw new Error("extended point not allowed");const{x:C,y:T}=y||{};return D("x",C),D("y",T),new F(C,T,$t,m(C*T))}static normalizeZ(y){const C=t.invertBatch(y.map(T=>T.ez));return y.map((T,_)=>T.toAffine(C[_])).map(F.fromAffine)}static msm(y,C){return Ff(F,E,y,C)}_setWindowSize(y){H.setWindowSize(this,y)}assertValidity(){R(this)}equals(y){x(y);const{ex:C,ey:T,ez:_}=this,{ex:B,ey:u,ez:k}=y,$=m(C*k),Z=m(B*_),ee=m(T*k),Ae=m(u*_);return $===Z&&ee===Ae}is0(){return this.equals(F.ZERO)}negate(){return new F(m(-this.ex),this.ey,this.ez,m(-this.et))}double(){const{a:y}=e,{ex:C,ey:T,ez:_}=this,B=m(C*C),u=m(T*T),k=m(di*m(_*_)),$=m(y*B),Z=C+T,ee=m(m(Z*Z)-B-u),Ae=$+u,le=Ae-k,ue=$-u,Ze=m(ee*le),Ee=m(Ae*ue),ye=m(ee*ue),nt=m(le*Ae);return new F(Ze,Ee,nt,ye)}add(y){x(y);const{a:C,d:T}=e,{ex:_,ey:B,ez:u,et:k}=this,{ex:$,ey:Z,ez:ee,et:Ae}=y;if(C===BigInt(-1)){const Oe=m((B-_)*(Z+$)),Re=m((B+_)*(Z-$)),Ft=m(Re-Oe);if(Ft===ln)return this.double();const Pe=m(u*di*Ae),He=m(k*di*ee),jt=He+Pe,qe=Re+Oe,w=He-Pe,d=m(jt*Ft),f=m(qe*w),v=m(jt*w),M=m(Ft*qe);return new F(d,f,M,v)}const le=m(_*$),ue=m(B*Z),Ze=m(k*T*Ae),Ee=m(u*ee),ye=m((_+B)*($+Z)-le-ue),nt=Ee-Ze,Ce=Ee+Ze,ke=m(ue-C*le),Rr=m(ye*nt),Le=m(Ce*ke),$e=m(ye*ke),Wr=m(nt*Ce);return new F(Rr,Le,Wr,$e)}subtract(y){return this.add(y.negate())}wNAF(y){return H.wNAFCached(this,y,F.normalizeZ)}multiply(y){const C=y;tn("scalar",C,$t,r);const{p:T,f:_}=this.wNAF(C);return F.normalizeZ([T,_])[0]}multiplyUnsafe(y,C=F.ZERO){const T=y;return tn("scalar",T,ln,r),T===ln?z:this.is0()||T===$t?this:H.wNAFCachedUnsafe(this,T,F.normalizeZ,C)}isSmallOrder(){return this.multiplyUnsafe(l).is0()}isTorsionFree(){return H.unsafeLadder(this,r).is0()}toAffine(y){return U(this,y)}clearCofactor(){const{h:y}=e;return y===$t?this:this.multiplyUnsafe(y)}static fromHex(y,C=!1){const{d:T,a:_}=e,B=t.BYTES;y=et("pointHex",y,B),qn("zip215",C);const u=y.slice(),k=y[B-1];u[B-1]=k&-129;const $=jr(u),Z=C?h:t.ORDER;tn("pointHex.y",$,ln,Z);const ee=m($*$),Ae=m(ee-$t),le=m(T*ee-_);let{isValid:ue,value:Ze}=S(Ae,le);if(!ue)throw new Error("Point.fromHex: invalid y coordinate");const Ee=(Ze&$t)===$t,ye=(k&128)!==0;if(!C&&Ze===ln&&ye)throw new Error("Point.fromHex: x=0 and x_0=1");return ye!==Ee&&(Ze=m(-Ze)),F.fromAffine({x:Ze,y:$})}static fromPrivateKey(y){return V(y).point}toRawBytes(){const{x:y,y:C}=this.toAffine(),T=Ms(C,t.BYTES);return T[T.length-1]|=y&$t?128:0,T}toHex(){return Cr(this.toRawBytes())}}F.BASE=new F(e.Gx,e.Gy,$t,m(e.Gx*e.Gy)),F.ZERO=new F(ln,$t,$t,ln);const{BASE:W,ZERO:z}=F,H=kf(F,a*8);function K(p){return je(p,r)}function G(p){return K(jr(p))}function V(p){const y=t.BYTES;p=et("private key",p,y);const C=et("hashed private key",i(p),2*y),T=A(C.slice(0,y)),_=C.slice(y,2*y),B=G(T),u=W.multiply(B),k=u.toRawBytes();return{head:T,prefix:_,scalar:B,point:u,pointBytes:k}}function ie(p){return V(p).pointBytes}function ne(p=new Uint8Array,...y){const C=rr(...y);return G(i(g(C,et("context",p),!!s)))}function ae(p,y,C={}){p=et("message",p),s&&(p=s(p));const{prefix:T,scalar:_,pointBytes:B}=V(y),u=ne(C.context,T,p),k=W.multiply(u).toRawBytes(),$=ne(C.context,k,B,p),Z=K(u+$*_);tn("signature.s",Z,ln,r);const ee=rr(k,Ms(Z,t.BYTES));return et("result",ee,t.BYTES*2)}const I=Nb;function c(p,y,C,T=I){const{context:_,zip215:B}=T,u=t.BYTES;p=et("signature",p,2*u),y=et("message",y),C=et("publicKey",C,u),B!==void 0&&qn("zip215",B),s&&(y=s(y));const k=jr(p.slice(u,2*u));let $,Z,ee;try{$=F.fromHex(C,B),Z=F.fromHex(p.slice(0,u),B),ee=W.multiplyUnsafe(k)}catch{return!1}if(!B&&$.isSmallOrder())return!1;const Ae=ne(_,Z.toRawBytes(),$.toRawBytes(),y);return Z.add($.multiplyUnsafe(Ae)).subtract(ee).clearCofactor().equals(F.ZERO)}return W._setWindowSize(8),{CURVE:e,getPublicKey:ie,sign:ae,verify:c,ExtendedPoint:F,utils:{getExtendedPublicKey:V,randomPrivateKey:()=>o(t.BYTES),precompute(p=8,y=F.BASE){return y._setWindowSize(p),y.multiply(BigInt(3)),y}}}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Hc=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),Bd=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");BigInt(0);const qb=BigInt(1),xd=BigInt(2);BigInt(3);const Kb=BigInt(5),jb=BigInt(8);function $b(n){const e=BigInt(10),t=BigInt(20),r=BigInt(40),s=BigInt(80),i=Hc,a=n*n%i*n%i,l=Je(a,xd,i)*a%i,h=Je(l,qb,i)*n%i,m=Je(h,Kb,i)*h%i,E=Je(m,e,i)*m%i,S=Je(E,t,i)*E%i,A=Je(S,r,i)*S%i,g=Je(A,s,i)*A%i,D=Je(g,s,i)*A%i,x=Je(D,e,i)*m%i;return{pow_p_5_8:Je(x,xd,i)*n%i,b2:a}}function Vb(n){return n[0]&=248,n[31]&=127,n[31]|=64,n}function Gb(n,e){const t=Hc,r=je(e*e*e,t),s=je(r*r*e,t),i=$b(n*s).pow_p_5_8;let o=je(n*r*i,t);const a=je(e*o*o,t),l=o,h=je(o*Bd,t),m=a===n,E=a===je(-n,t),S=a===je(-n*Bd,t);return m&&(o=l),(E||S)&&(o=h),Sb(o,t)&&(o=je(-o,t)),{isValid:m||E,value:o}}const Yb=Zs(Hc,void 0,!0),Xb={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:Yb,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:jb,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:bf,randomBytes:Rc,adjustScalarBytes:Vb,uvRatio:Gb},Fr=Hb(Xb),Zb=[{name:"appIdPrefix",binary:"bytes",custom:zt.encode("appID"),omit:!0},{name:"appId",binary:"uint",size:8}],mn=class mn{constructor(e,t="hex"){re(this,"address");this.address=typeof e=="string"?mn.stringToUint8Array(e,t):e}toNative(e){return sr(e,this)}unwrap(){return this.address}toString(){return _t.encode(this.address,!0)}toUint8Array(){return this.address}toUniversalAddress(){return this}equals(e){return zt.equals(this.address,e.address)}static isValidAddress(e,t="hex"){return!wm(()=>mn.stringToUint8Array(e,t))}static instanceof(e){return typeof e=="object"&&"constructor"in e&&e.constructor.type===mn.type}static stringToUint8Array(e,t){const r=(()=>{switch(t){case"hex":if(![40,2*this.byteSize].includes(e.length-(e.startsWith("0x")?2:0)))throw new Error(`string ${e} has invalid length for format ${t}`);return _t.decode(e);case"base58":return Wu.decode(e);case"bech32":return Mu.decodeToBytes(e).bytes;case"algorandAppId":return hb(Cn(Zb,{appId:BigInt(e)}));case"sha256":return Us(e)}})();if(r.length>mn.byteSize)throw new Error(`string ${e} has invalid length for format ${t}`);return r.length<mn.byteSize?zt.zpad(r,mn.byteSize):r}};re(mn,"byteSize",32),re(mn,"type","Universal");let Nt=mn;function Jb(n){return typeof n=="object"&&"setChain"in n}const Xa=new Map;function qc(n,e){Xa.has(n)||Xa.set(n,e)}function sr(n,e){const t=ss.get(n),r=Xa.get(t);if(!r)throw new Error(`No native address type registered for platform ${t}, import the platform directly or, if using sdk package, import the addresses conditional export`);try{const s=new r(e);return Jb(s)&&s.setChain(n),s}catch(s){const i=`Error parsing address as a native ${n} address: ${s.message}`;if(Nt.instanceof(e))throw i;return new Nt(e).toNative(n)}}function Mf(n,e){const t=ss.get(n);return new Nt(e,Vm.get(t))}const Za=(n,e)=>n?`${n}:${e}`:e,Ja=new Map;function Qb(n,e,t){const r=Za(n,e);if(Ja.has(r))throw new Error(`Payload type ${r} already registered`);Ja.set(r,t)}function xt(n,e){for(const[t,r]of e)Qb(n,t,r)}const Mt={binary:"uint",size:32},ep={binary:"uint",size:2},qt=n=>({...ep,custom:{to:e=>{if(e===0){if(!(n!=null&&n.allowNull))throw new Error("ChainId 0 is not valid for this protocol and action");return null}const t=rs(e),r=(n==null?void 0:n.allowedChains)??Pu;if(!r.includes(t))throw new Error(`Chain ${t} not in allowed chains ${r}`);return t},from:e=>e==null?0:ro(e)}}),Rs={binary:"uint",size:4},Kc={binary:"uint",size:8},Rf={binary:"uint",size:4},or=n=>({name:"payloadId",binary:"uint",size:1,custom:n,omit:!0}),jc={binary:"uint",size:8};class tp{constructor(e,t,r){re(this,"r");re(this,"s");re(this,"v");this.r=e,this.s=t,this.v=r}encode(){return Cn(Qa,this)}static decode(e){return Sn(Qa,e)}}var Cd;(function(n){function e(i){return Hn.getPublicKey(i)}n.toPubkey=e;function t(i,o){if(o.length!=32)throw new Error("hash.length != 32");return Hn.sign(o,i)}n.sign=t;function r(i,o,a){const{r:l,s:h}=i;return Hn.verify({r:l,s:h},a,o)}n.validate=r;function s(i,o){const{r:a,s:l,v:h}=i,m=new Hn.Signature(a,l);return m.recovery=h,m.recoverPublicKey(o).toRawBytes()}n.recover=s})(Cd||(Cd={}));const np=[{name:"r",binary:"uint",size:32},{name:"s",binary:"uint",size:32},{name:"v",binary:"uint",size:1}],Qa={binary:"bytes",layout:np,custom:{to:n=>new tp(n.r,n.s,n.v),from:n=>({r:n.r,s:n.s,v:n.v})}},xe={binary:"bytes",size:32,custom:{to:n=>new Nt(n),from:n=>n.toUint8Array()}},rp=n=>{const e=n.findIndex(t=>t!==0);return-1<e?n.slice(e):new Uint8Array([])},sp={to:zt.decode,from:zt.encode},Wf=n=>({binary:"bytes",size:n,custom:{to:e=>zt.decode(rp(e)),from:e=>zt.zpad(zt.encode(e),n)}});function Pf(n){const e=n.indexOf(":");return e!==-1?[n.slice(0,e),n.slice(e+1)]:[null,n]}const ip=[{name:"guardianIndex",binary:"uint",size:1},{name:"signature",...Qa}],$c=[{name:"version",binary:"uint",size:1,custom:1,omit:!0},{name:"guardianSet",...Rf},{name:"signatures",binary:"array",lengthSize:1,layout:ip}],Vc=[{name:"timestamp",binary:"uint",size:4},{name:"nonce",binary:"uint",size:4},{name:"emitterChain",...qt()},{name:"emitterAddress",...xe},{name:"sequence",...jc},{name:"consistencyLevel",binary:"uint",size:1}],op=[...$c,...Vc];function Ws(n){const e=Ja.get(n);if(!e)throw new Error(`No layout registered for payload type ${n}`);return e}function Lf(n){return{name:"payload",binary:"bytes",...n==="Uint8Array"?{}:{layout:Ws(n)}}}function ec(n){const e=[...op,Lf(n.payloadLiteral)];return Cn(e,n)}function ap(n,e){if(n==="Uint8Array")return e;const t=Ws(n);return Cn(t,e)}function Gc(n,e){const t=(()=>{if(Array.isArray(n[0]))return n.flatMap(([o,a])=>a.map(l=>Za(o,l)));if(typeof n[1]=="string")return n;const[s,i]=n;return i.map(o=>Za(s,o))})(),r=Im(t.map(s=>Ws(s)));return s=>{typeof s=="string"&&(s=_t.decode(s));const i=r(s);return Array.isArray(i)?i.map(o=>t[o]):i!==null?t[i]:null}}function Ps(n,e){typeof e=="string"&&(e=_t.decode(e));const[t,r]=Sn($c,e,!1);for(let A=1;A<t.signatures.length;++A)if(t.signatures[A].guardianIndex<=t.signatures[A-1].guardianIndex)throw new Error("Guardian signatures must be in ascending order of guardian set index");const s=r,[i,o]=Sn(Vc,e.subarray(s),!1),a=s+o,[l,h]=typeof n=="string"?[n,Sd(n,e.subarray(a))]:Sd(n,e.subarray(a)),[m,E]=Pf(l),S=_s(e.slice(s));return{protocolName:m,payloadName:E,payloadLiteral:l,...t,...i,payload:h,hash:S}}function Sd(n,e,t=0){return(()=>{if(typeof e=="string"&&(e=_t.decode(e)),n==="Uint8Array")return e.slice(t);if(typeof n=="string")return Sn(Ws(n),e.subarray(t));const r=n(e.slice(t));if(r===null)throw new Error(`Encoded data does not match any of the given payload types - ${e}`);return[r,Sn(Ws(r),e.subarray(t))]})()}const cp=[["Ethereum",[["ETH",{symbol:"ETH",decimals:18,address:"native",wrappedKey:"WETH"}],["WETH",{symbol:"WETH",decimals:18,address:"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"}],["USDCeth",{symbol:"USDC",decimals:6,address:"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"}],["WBTC",{symbol:"WBTC",decimals:8,address:"0x2260fac5e5542a773aa44fbcfedf7c193bc2c599"}],["USDT",{symbol:"USDT",decimals:6,address:"0xdac17f958d2ee523a2206206994597c13d831ec7"}],["DAI",{symbol:"DAI",decimals:18,address:"0x6b175474e89094c44da98b954eedeac495271d0f"}],["BUSD",{symbol:"BUSD",decimals:18,address:"0x4fabb145d64652a948d72533023f6e7a623c7c53"}],["WMATIC",{symbol:"WMATIC",decimals:18,address:"0x7c9f4C87d911613Fe9ca58b579f737911AAD2D43",original:"Polygon"}],["WBNB",{symbol:"WBNB",decimals:18,address:"0x418D75f65a02b3D53B2418FB8E1fe493759c7605",original:"Bsc"}],["USDCbnb",{symbol:"USDC",decimals:18,address:"0x7cd167B101D2808Cfd2C45d17b2E7EA9F46b74B6",original:"Bsc"}],["WAVAX",{symbol:"WAVAX",decimals:18,address:"0x85f138bfEE4ef8e540890CFb48F620571d67Eda3",original:"Avalanche"}],["USDCavax",{symbol:"USDC",decimals:6,address:"0x39EbF69137D98FB7659Ef8D4ea21ec26394389d7",original:"Avalanche"}],["WFTM",{symbol:"WFTM",decimals:18,address:"0x4cD2690d86284e044cb63E60F1EB218a825a7e92",original:"Fantom"}],["CELO",{symbol:"CELO",decimals:18,address:"0x3294395e62F4eB6aF3f1Fcf89f5602D90Fb3Ef69",original:"Celo"}],["WGLMR",{symbol:"WGLMR",decimals:18,address:"0x93d3696A9F879b331f40CB5059e37015423A3Bd0",original:"Moonbeam"}],["WSOL",{symbol:"WSOL",decimals:9,address:"0xD31a59c85aE9D8edEFeC411D448f90841571b89c",original:"Solana"}],["USDCsol",{symbol:"USDC",decimals:6,address:"0x41f7B8b9b897276b7AAE926a9016935280b44E97",original:"Solana"}],["SUI",{symbol:"SUI",decimals:9,address:"0x84074EA631dEc7a4edcD5303d164D5dEa4c653D6",original:"Sui"}],["APT",{symbol:"APT",decimals:8,address:"0x8CDf7AF57E4c8B930e1B23c477c22f076530585e",original:"Aptos"}],["WETHarbitrum",{symbol:"WETH",decimals:18,address:"0xb945E3F853B5f8033C8513Cf3cE9F8AD9beBB1c9",original:"Arbitrum"}],["USDCarbitrum",{symbol:"USDC",decimals:6,address:"0xCFc006a32a98031C2338BF9d5ff8ED2c0Cae4a9e",original:"Arbitrum"}],["WETHoptimism",{symbol:"WETH",decimals:18,address:"0x8B5653Ae095529155462eDa8CF664eD96773F557",original:"Optimism"}],["WETHbase",{symbol:"WETH",decimals:18,address:"0x1D4241F7370253C0f12EFC536B7e16E462Fb3526",original:"Base"}],["tBTC",{symbol:"tBTC",decimals:18,address:"0x18084fbA666a33d37592fA2633fD49a74DD93a88"}],["tBTCpolygon",{symbol:"tBTC",decimals:18,address:"0xb4c624dBC50804dA086cf2380cD55dEBC0d22E96",original:"Polygon"}],["tBTCoptimism",{symbol:"tBTC",decimals:18,address:"0xB8d1E0642bFD3744CaBd2ca8830cFabE19b2Ca54",original:"Optimism"}],["tBTCarbitrum",{symbol:"tBTC",decimals:18,address:"0x4F3819A6cfF717BFfE801a75c73A984141c76589",original:"Arbitrum"}],["tBTCbase",{symbol:"tBTC",decimals:18,address:"0x733F28B3e315046Db01dAbC292D6F0F7F26C4551",original:"Base"}],["wstETH",{symbol:"wstETH",decimals:18,address:"0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0"}],["WKLAY",{symbol:"WKLAY",decimals:18,address:"0x9AEA32B459e96C8eF5010f69130bf95fd129ac05",original:"Klaytn"}],["PYTH",{symbol:"PYTH",decimals:6,address:"0xeFc0CED4B3D536103e76a1c4c74F0385C8F4Bdd3",original:"Solana"}]]],["Bsc",[["WETH",{symbol:"WETH",decimals:18,address:"0x4DB5a66E937A9F4473fA95b1cAF1d1E1D62E29EA",original:"Ethereum"}],["USDCeth",{symbol:"USDC",decimals:6,address:"0xB04906e95AB5D797aDA81508115611fee694c2b3",original:"Ethereum"}],["WBTC",{symbol:"WBTC",decimals:8,address:"0x43359676E1A3F9FbB5de095333f8e9c1B46dFA44",original:"Ethereum"}],["USDT",{symbol:"USDT",decimals:6,address:"0x524bC91Dc82d6b90EF29F76A3ECAaBAffFD490Bc",original:"Ethereum"}],["DAI",{symbol:"DAI",decimals:18,address:"0x3413a030EF81a3dD5a302F4B4D11d911e12ed337",original:"Ethereum"}],["BUSD",{symbol:"BUSD",decimals:18,address:"0x035de3679E692C471072d1A09bEb9298fBB2BD31",original:"Ethereum"}],["WMATIC",{symbol:"WMATIC",decimals:18,address:"0xc836d8dC361E44DbE64c4862D55BA041F88Ddd39",original:"Polygon"}],["USDCpolygon",{symbol:"USDC",decimals:6,address:"0xe6d82Bbe75041E42E51d755e922cE1BA91af9c4d",original:"Polygon"}],["BNB",{symbol:"BNB",decimals:18,address:"native",wrappedKey:"WBNB"}],["WBNB",{symbol:"WBNB",decimals:18,address:"0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c"}],["USDCbnb",{symbol:"USDC",decimals:18,address:"0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d"}],["WAVAX",{symbol:"WAVAX",decimals:18,address:"0x96412902aa9aFf61E13f085e70D3152C6ef2a817",original:"Avalanche"}],["USDCavax",{symbol:"USDC",decimals:6,address:"0xc88Dc63bf0c8c8198C97Db0945E3eF25Ca89A8e4",original:"Avalanche"}],["WFTM",{symbol:"WFTM",decimals:18,address:"0xbF8413EE8612E0E4f66Aa63B5ebE27f3C5883d47",original:"Fantom"}],["CELO",{symbol:"CELO",decimals:18,address:"0x2A335e327a55b177f5B40132fEC5D7298aa0D7e6",original:"Celo"}],["WGLMR",{symbol:"WGLMR",decimals:18,address:"0x1C063db3c621BF901FC6C1D03328b08b2F9bbfba",original:"Moonbeam"}],["WSOL",{symbol:"WSOL",decimals:9,address:"0xfA54fF1a158B5189Ebba6ae130CEd6bbd3aEA76e",original:"Solana"}],["USDCsol",{symbol:"USDC",decimals:6,address:"0x91Ca579B0D47E5cfD5D0862c21D5659d39C8eCf0",original:"Solana"}],["SUI",{symbol:"SUI",decimals:9,address:"0x8314f6Bf1B4dd8604A0fC33C84F9AF2fc07AABC8",original:"Sui"}],["APT",{symbol:"APT",decimals:8,address:"0x2Ba98cf7Edd2c5C794e21bc3Dc6973D3C2585eE3",original:"Aptos"}],["WETHarbitrum",{symbol:"WETH",decimals:18,address:"0xaA1eEdABC48D078350ccBdD620bD088848e299E5",original:"Arbitrum"}],["USDCarbitrum",{symbol:"USDC",decimals:6,address:"0x5caa170b465122D15a6D20FD9A804a9613CE7882",original:"Arbitrum"}],["WETHoptimism",{symbol:"WETH",decimals:18,address:"0x94AEc09B5e2CE591e39DC6aa58A3A6E85Ed45265",original:"Optimism"}],["USDCoptimism",{symbol:"USDC",decimals:6,address:"0xa41ae127D04F7ee73B5058E2C60Fb7c7A2D21F79",original:"Optimism"}],["WETHbsc",{symbol:"WETH",decimals:18,address:"0x2170Ed0880ac9A755fd29B2688956BD959F933F8"}],["WETHbase",{symbol:"WETH",decimals:18,address:"0x9dc152F4941cE1A138326e70c3600385bf0C22dD",original:"Base"}],["USDCbase",{symbol:"USDC",decimals:6,address:"0x55CaD531c8E303Cab8B3BE4bB4744Db4f896ac81",original:"Base"}],["tBTC",{symbol:"tBTC",decimals:18,address:"0x94c97dd3Bde5bC1406BCe82E7941A6365968521D",original:"Ethereum"}],["wstETH",{symbol:"wstETH",decimals:18,address:"0xad80E1A9B5824234afA9dE1F3bbDb8a994796169",original:"Ethereum"}],["WKLAY",{symbol:"WKLAY",decimals:18,address:"0xEA970e7b7D131Ea36c3051C9Ca11e785462fE00c",original:"Klaytn"}],["PYTH",{symbol:"PYTH",decimals:6,address:"0xb0188B0bb2cD4a6D2744637fC83C94a284B247Da",original:"Solana"}],["USDTbsc",{symbol:"USDT",decimals:18,address:"0x55d398326f99059fF775485246999027B3197955"}]]],["Polygon",[["WETH",{symbol:"WETH",decimals:18,address:"0x11CD37bb86F65419713f30673A480EA33c826872",original:"Ethereum"}],["USDCeth",{symbol:"USDC",decimals:6,address:"0x4318CB63A2b8edf2De971E2F17F77097e499459D",original:"Ethereum"}],["WBTC",{symbol:"WBTC",decimals:8,address:"0x5D49c278340655B56609FdF8976eb0612aF3a0C3",original:"Ethereum"}],["USDT",{symbol:"USDT",decimals:6,address:"0x9417669fBF23357D2774e9D421307bd5eA1006d2",original:"Ethereum"}],["DAI",{symbol:"DAI",decimals:18,address:"0x732EB1747ecCFC431fF19bc359ffc83755B1918c",original:"Ethereum"}],["BUSD",{symbol:"BUSD",decimals:18,address:"0x95ea750420da26bE1Ab0891e209e921bCd84763f",original:"Ethereum"}],["MATIC",{symbol:"MATIC",decimals:18,address:"native",wrappedKey:"WMATIC"}],["WMATIC",{symbol:"WMATIC",decimals:18,address:"0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270"}],["WETHpolygon",{symbol:"WETH",decimals:18,address:"0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619"}],["USDCpolygon",{symbol:"USDC",decimals:6,address:"0x3c499c542cef5e3811e1192ce70d8cc03d5c3359"}],["WBNB",{symbol:"WBNB",decimals:18,address:"0xeCDCB5B88F8e3C15f95c720C51c71c9E2080525d",original:"Bsc"}],["USDCbnb",{symbol:"USDC",decimals:18,address:"0x4B3a922c773BDCF3BA8f1A4FDAc2029E1D0E9868",original:"Bsc"}],["WAVAX",{symbol:"WAVAX",decimals:18,address:"0x7Bb11E7f8b10E9e571E5d8Eace04735fDFB2358a",original:"Avalanche"}],["USDCavax",{symbol:"USDC",decimals:6,address:"0xAEA5CC14DefbC1b845FDE729E563B717Ee6825ae",original:"Avalanche"}],["WFTM",{symbol:"WFTM",decimals:18,address:"0x3726831304D77f585f1Aca9d9841cc3Ef80dAa62",original:"Fantom"}],["CELO",{symbol:"CELO",decimals:18,address:"0x922F49a9911effc034eE756196E59BE7b90D43b3",original:"Celo"}],["WGLMR",{symbol:"WGLMR",decimals:18,address:"0xcC48d6CF842083fEc0E01d913fB964b585975F05",original:"Moonbeam"}],["WSOL",{symbol:"WSOL",decimals:9,address:"0xd93f7E271cB87c23AaA73edC008A79646d1F9912",original:"Solana"}],["USDCsol",{symbol:"USDC",decimals:6,address:"0x576Cf361711cd940CD9C397BB98C4C896cBd38De",original:"Solana"}],["SUI",{symbol:"SUI",decimals:9,address:"0x34bE049fEbfc6C64Ffd82Da08a8931A9a45f2cc8",original:"Sui"}],["APT",{symbol:"APT",decimals:8,address:"0xa4ef199d3ad524E9C3C51Ac46B303B103A307Cef",original:"Aptos"}],["WETHarbitrum",{symbol:"WETH",decimals:18,address:"0x6a5c59AB16268d2c872916054C50440B999e417C",original:"Arbitrum"}],["USDCarbitrum",{symbol:"USDC",decimals:6,address:"0x7800FE8951cdc1cDea748d878fAce63018D97960",original:"Arbitrum"}],["WETHoptimism",{symbol:"WETH",decimals:18,address:"0x8182De59485Bb646542Db8C7E5958148Dc699319",original:"Optimism"}],["USDCoptimism",{symbol:"USDC",decimals:6,address:"0x31F12aCb60C3c32EE884F3894a873347C097D925",original:"Optimism"}],["WETHbase",{symbol:"WETH",decimals:18,address:"0x5BCf8d8c097FbB35C371F921E3FF3e6F6Eb54B41",original:"Base"}],["USDCbase",{symbol:"USDC",decimals:6,address:"0x1eeCaB0F75fE93abbFa0cDFfb4fB13d1dC8706c8",original:"Base"}],["tBTC",{symbol:"tBTC",decimals:18,address:"0x3362b2B92b331925F09F9E5bCA3E8C43921a435C",original:"Ethereum"}],["tBTCpolygon",{symbol:"tBTC",decimals:18,address:"0x236aa50979D5f3De3Bd1Eeb40E81137F22ab794b"}],["tBTCoptimism",{symbol:"tBTC",decimals:18,address:"0x68A8797da1c8ED592600d70A5151886A92D2183C",original:"Optimism"}],["tBTCarbitrum",{symbol:"tBTC",decimals:18,address:"0x045D8c62D5326aa51a31518ECF3aF80C17421Aba",original:"Arbitrum"}],["wstETH",{symbol:"wstETH",decimals:18,address:"0xe082a7Fc696De18172Ad08D956569Ee80BC37f06",original:"Ethereum"}],["wstETHpolygon",{symbol:"wstETH",decimals:18,address:"0x03b54A6e9a984069379fae1a4fC4dBAE93B3bCCD"}],["WKLAY",{symbol:"WKLAY",decimals:18,address:"0x415ce980fde17F1FF102e1c6e4ce860Acc615D74",original:"Klaytn"}],["PYTH",{symbol:"PYTH",decimals:6,address:"0xFa4B761A1e07909Ba31331a5dfa12390E3ff5583",original:"Solana"}],["USDTpolygon",{symbol:"USDT",decimals:6,address:"0xc2132D05D31c914a87C6611C10748AEb04B58e8F"}]]],["Avalanche",[["WETH",{symbol:"WETH",decimals:18,address:"0x8b82A291F83ca07Af22120ABa21632088fC92931",original:"Ethereum"}],["USDCeth",{symbol:"USDC",decimals:6,address:"0xB24CA28D4e2742907115fECda335b40dbda07a4C",original:"Ethereum"}],["WBTC",{symbol:"WBTC",decimals:8,address:"0x1C0e79C5292c59bbC13C9F9f209D204cf4d65aD6",original:"Ethereum"}],["USDT",{symbol:"USDT",decimals:6,address:"0x9d228444FC4B7E15A2C481b48E10247A03351FD8",original:"Ethereum"}],["DAI",{symbol:"DAI",decimals:18,address:"0xca319f81D147559e19A522A0a0310Dd43A96cA0F",original:"Ethereum"}],["WMATIC",{symbol:"WMATIC",decimals:18,address:"0xf2f13f0B7008ab2FA4A2418F4ccC3684E49D20Eb",original:"Polygon"}],["USDCpolygon",{symbol:"USDC",decimals:6,address:"0xDb2d08f5A9C9ADBBA0DE5a69bbB1E9Ca03411692",original:"Polygon"}],["WBNB",{symbol:"WBNB",decimals:18,address:"0x442F7f22b1EE2c842bEAFf52880d4573E9201158",original:"Bsc"}],["USDCbnb",{symbol:"USDC",decimals:18,address:"0x6145E8a910aE937913426BF32De2b26039728ACF",original:"Bsc"}],["AVAX",{symbol:"AVAX",decimals:18,address:"native",wrappedKey:"WAVAX"}],["WAVAX",{symbol:"WAVAX",decimals:18,address:"0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7"}],["USDCavax",{symbol:"USDC",decimals:6,address:"0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E"}],["WETHavax",{symbol:"WETH",decimals:18,address:"0x49d5c2bdffac6ce2bfdb6640f4f80f226bc10bab"}],["WFTM",{symbol:"WFTM",decimals:18,address:"0xd19abc09B7b36F7558929b97a866f499a26c2f83",original:"Fantom"}],["CELO",{symbol:"CELO",decimals:18,address:"0x494317B8521c5a5287a06DEE467dd6fe285dA4a8",original:"Celo"}],["WGLMR",{symbol:"WGLMR",decimals:18,address:"0x375aA6C67BF499fBf01804A9f92C03c0776F372d",original:"Moonbeam"}],["WSOL",{symbol:"WSOL",decimals:9,address:"0xFE6B19286885a4F7F55AdAD09C3Cd1f906D2478F",original:"Solana"}],["USDCsol",{symbol:"USDC",decimals:6,address:"0x0950Fc1AD509358dAeaD5eB8020a3c7d8b43b9DA",original:"Solana"}],["SUI",{symbol:"SUI",decimals:9,address:"0x1703CB0F762D2a435199B64Ea47E5349B7C17480",original:"Sui"}],["APT",{symbol:"APT",decimals:8,address:"0x43c588459b3243fA541B98CC4B2E995b3de553A2",original:"Aptos"}],["WETHarbitrum",{symbol:"WETH",decimals:18,address:"0xDfDA518A1612030536bD77Fd67eAcbe90dDC52Ab",original:"Arbitrum"}],["USDCarbitrum",{symbol:"USDC",decimals:6,address:"0x4b5fE357Eb11c735078e47526D6e853DBff18541",original:"Arbitrum"}],["WETHoptimism",{symbol:"WETH",decimals:18,address:"0xDf11535274c0FD2Fe41A88bd1bBF802D72296037",original:"Optimism"}],["USDCoptimism",{symbol:"USDC",decimals:6,address:"0xBe04f76A0ba2100c3F2d6Aa1FD8484F415469573",original:"Optimism"}],["WETHbase",{symbol:"WETH",decimals:18,address:"0xFA83178c66fE51ee99109b5cC912f8098Ff812eF",original:"Base"}],["USDCbase",{symbol:"USDC",decimals:6,address:"0xab933e939a9236BD439F7d29b87CE712f42bAC06",original:"Base"}],["tBTC",{symbol:"tBTC",decimals:18,address:"0x3F531c038A0D2d9c7D19FC3554cd0439791526c4",original:"Ethereum"}],["WKLAY",{symbol:"WKLAY",decimals:18,address:"0x126C03982Ad6D7ef7E6aF020bF219e87185a6BC3",original:"Klaytn"}],["PYTH",{symbol:"PYTH",decimals:6,address:"0x8A0691e602B7a5FCc51a27E4a08376dE50889B42",original:"Solana"}],["USDTavax",{symbol:"USDT",decimals:6,address:"0x9702230a8ea53601f5cd2dc00fdbc13d4df4a8c7"}]]],["Fantom",[["WETH",{symbol:"WETH",decimals:18,address:"0x2A126f043BDEBe5A0A9841c51915E562D9B07289",original:"Ethereum"}],["USDCeth",{symbol:"USDC",decimals:6,address:"0x2Ec752329c3EB419136ca5e4432Aa2CDb1eA23e6",original:"Ethereum"}],["WBTC",{symbol:"WBTC",decimals:8,address:"0x87e9E225aD8a0755B9958fd95BE43DD6A91FF3A7",original:"Ethereum"}],["USDT",{symbol:"USDT",decimals:6,address:"0x14BCb86aEed6a74D3452550a25D37f1c30AA0A66",original:"Ethereum"}],["DAI",{symbol:"DAI",decimals:18,address:"0xEE786D3D73Ea645365c7248E4e40eDba08B1169F",original:"Ethereum"}],["WMATIC",{symbol:"WMATIC",decimals:18,address:"0xb88A6064B1F3FF5B9AE4A82fFD52560b0dF9FBD3",original:"Polygon"}],["USDCpolygon",{symbol:"USDC",decimals:6,address:"0xB4DcfD221048a1Dad989D39456BBd87762c26F06",original:"Polygon"}],["WBNB",{symbol:"WBNB",decimals:18,address:"0xc033551e05907Ddd643AE14b6D4a9CA72BfF509B",original:"Bsc"}],["USDCbnb",{symbol:"USDC",decimals:18,address:"0x0FcbDAC44c67A43607D3E95886dB19871ADc985F",original:"Bsc"}],["WAVAX",{symbol:"WAVAX",decimals:18,address:"0x358CE030DC6116Cc296E8B9F002728e65459C146",original:"Avalanche"}],["USDCavax",{symbol:"USDC",decimals:6,address:"0xEfE7701cb2B80664385Be226d0300912CA92f66A",original:"Avalanche"}],["FTM",{symbol:"FTM",decimals:18,address:"native",wrappedKey:"WFTM"}],["WFTM",{symbol:"WFTM",decimals:18,address:"0x21be370d5312f44cb42ce377bc9b8a0cef1a4c83"}],["CELO",{symbol:"CELO",decimals:18,address:"0xF432490C6c96C9d3bF523a499a1CEaFd8208A373",original:"Celo"}],["WGLMR",{symbol:"WGLMR",decimals:18,address:"0xBF227E92D6754EB4BFE26C40cb299ff2809Da45f",original:"Moonbeam"}],["WSOL",{symbol:"WSOL",decimals:9,address:"0xd99021C2A33e4Cf243010539c9e9b7c52E0236c1",original:"Solana"}],["USDCsol",{symbol:"USDC",decimals:6,address:"0xb8398DA4FB3BC4306B9D9d9d13d9573e7d0E299f",original:"Solana"}],["SUI",{symbol:"SUI",decimals:9,address:"0xC277423a21F6e32D886BF85Ef6cCB945d5D28347",original:"Sui"}],["APT",{symbol:"APT",decimals:8,address:"0x3Cd9162Ca5256b8E26A0e3Ad14CCfF7C0Da0F174",original:"Aptos"}],["WETHarbitrum",{symbol:"WETH",decimals:18,address:"0xE8367853A0823515D37b1538331B4704089becb4",original:"Arbitrum"}],["USDCarbitrum",{symbol:"USDC",decimals:6,address:"0x2228703672906fEe5eD681Ec28e42B4506b8c336",original:"Arbitrum"}],["WETHoptimism",{symbol:"WETH",decimals:18,address:"0xe8E8f941377A955bFA72880ec0dc2319dbC827a8",original:"Optimism"}],["USDCoptimism",{symbol:"USDC",decimals:6,address:"0x385b219f0C4fa2e84EfE5aaf9692a821C57B8248",original:"Optimism"}],["WETHbase",{symbol:"WETH",decimals:18,address:"0xd3365E7355230c78098b44B172eE27DAB95B041A",original:"Base"}],["USDCbase",{symbol:"USDC",decimals:6,address:"0xd9E4C283d8A49Dc3767A6F5a4dFdc1d0cEf21604",original:"Base"}],["tBTC",{symbol:"tBTC",decimals:18,address:"0xeE27799cF29D7F64647B92f47d543B382B49f83E",original:"Ethereum"}],["WKLAY",{symbol:"WKLAY",decimals:18,address:"0x787e2F3509583C0F03A339Be0826463C839CBE5E",original:"Klaytn"}],["PYTH",{symbol:"PYTH",decimals:6,address:"0x77ad3B2dA29FBd208F12c3C701E969F4422aAD79",original:"Solana"}]]],["Celo",[["WETH",{symbol:"WETH",decimals:18,address:"0x66803FB87aBd4aaC3cbB3fAd7C3aa01f6F3FB207",original:"Ethereum"}],["USDCeth",{symbol:"USDC",decimals:6,address:"0x37f750B7cC259A2f741AF45294f6a16572CF5cAd",original:"Ethereum"}],["WBTC",{symbol:"WBTC",decimals:8,address:"0xd71Ffd0940c920786eC4DbB5A12306669b5b81EF",original:"Ethereum"}],["USDT",{symbol:"USDT",decimals:6,address:"0x617f3112bf5397D0467D315cC709EF968D9ba546",original:"Ethereum"}],["DAI",{symbol:"DAI",decimals:18,address:"0x97926a82930bb7B33178E3c2f4ED1BFDc91A9FBF",original:"Ethereum"}],["BUSD",{symbol:"BUSD",decimals:18,address:"0x1dd42c0785ca90B677adc2ABad01dfc5ECcD0b4d",original:"Ethereum"}],["WMATIC",{symbol:"WMATIC",decimals:18,address:"0x9C234706292b1144133ED509ccc5B3CD193BF712",original:"Polygon"}],["USDCpolygon",{symbol:"USDC",decimals:6,address:"0x42c76808f3179A091Ee007A2955aF2522978ADE7",original:"Polygon"}],["WBNB",{symbol:"WBNB",decimals:18,address:"0xBf2554ce8A4D1351AFeB1aC3E5545AaF7591042d",original:"Bsc"}],["USDCbnb",{symbol:"USDC",decimals:18,address:"0x9d9abAE97a9344e3854527b4efbB366a1564bfEb",original:"Bsc"}],["WAVAX",{symbol:"WAVAX",decimals:18,address:"0xFFdb274b4909fC2efE26C8e4Ddc9fe91963cAA4d",original:"Avalanche"}],["USDCavax",{symbol:"USDC",decimals:6,address:"0x62FFf2D2D1692D52eAf043AeeC727F7918d269D3",original:"Avalanche"}],["WFTM",{symbol:"WFTM",decimals:18,address:"0xd1A342eE2210238233a347FEd61EE7Faf9f251ce",original:"Fantom"}],["CELO",{symbol:"CELO",decimals:18,address:"0x471ece3750da237f93b8e339c536989b8978a438"}],["USDT",{symbol:"USDT",decimals:6,address:"0x48065fbBE25f71C9282ddf5e1cD6D6A887483D5e"}],["WGLMR",{symbol:"WGLMR",decimals:18,address:"0x383A5513AbE4Fe36e0E00d484F710148E348Aa9D",original:"Moonbeam"}],["WSOL",{symbol:"WSOL",decimals:9,address:"0x4581E64115d46CcdeE65Be2336bEc86c9BA54C01",original:"Solana"}],["USDCsol",{symbol:"USDC",decimals:6,address:"0x8B6eef6C449D3Ac723a9C06a9eaE2dCd7d308BA9",original:"Solana"}],["SUI",{symbol:"SUI",decimals:9,address:"0x1Cb9859B1A16A67ef83A0c7b9A21eeC17d9a97Dc",original:"Sui"}],["APT",{symbol:"APT",decimals:8,address:"0x89F2b718Ca518db39d377F0ABBa6B42582b549F7",original:"Aptos"}],["WETHarbitrum",{symbol:"WETH",decimals:18,address:"0xc6F962fCcb140ece554AfD0E589f971532A57f14",original:"Arbitrum"}],["USDCarbitrum",{symbol:"USDC",decimals:6,address:"0xA41a62567d9eb960D84b72663FdaeBE0BCdE2683",original:"Arbitrum"}],["WETHoptimism",{symbol:"WETH",decimals:18,address:"0x8d53771b1Ec7461f8e45Bca2609c45bC0bbd0677",original:"Optimism"}],["USDCoptimism",{symbol:"USDC",decimals:6,address:"0xEe48963C003e21EaCEdFA8a0A19BB3cbF7E776Fe",original:"Optimism"}],["WETHbase",{symbol:"WETH",decimals:18,address:"0x905CADB645684140E285e2D09D39dF5a2082BC87",original:"Base"}],["USDCbase",{symbol:"USDC",decimals:6,address:"0x2e2acb1782Aad0490f8446b6fD4626C467987bD6",original:"Base"}],["tBTC",{symbol:"tBTC",decimals:18,address:"0xFaED7314060FCEc652ED91D9eac6c980DCA9D3B8",original:"Ethereum"}],["tBTCarbitrum",{symbol:"tBTC",decimals:18,address:"0x72878E7d3A8746e0c91b9F16F0b8ee4fDE9DDc06",original:"Arbitrum"}],["WKLAY",{symbol:"WKLAY",decimals:18,address:"0xe304254de5c2048F9bFb042dDFB54f84d1d77730",original:"Klaytn"}],["PYTH",{symbol:"PYTH",decimals:6,address:"0x985aa4814419ba338379A634785216301e51113D",original:"Solana"}]]],["Moonbeam",[["WETH",{symbol:"WETH",decimals:18,address:"0xab3f0245B83feB11d15AAffeFD7AD465a59817eD",original:"Ethereum"}],["USDCeth",{symbol:"USDC",decimals:6,address:"0x931715FEE2d06333043d11F658C8CE934aC61D0c",original:"Ethereum"}],["WBTC",{symbol:"WBTC",decimals:8,address:"0xE57eBd2d67B462E9926e04a8e33f01cD0D64346D",original:"Ethereum"}],["USDT",{symbol:"USDT",decimals:6,address:"0xc30E9cA94CF52f3Bf5692aaCF81353a27052c46f",original:"Ethereum"}],["DAI",{symbol:"DAI",decimals:18,address:"0x06e605775296e851FF43b4dAa541Bb0984E9D6fD",original:"Ethereum"}],["BUSD",{symbol:"BUSD",decimals:18,address:"0xa2284e1F98E4d0B7Eb6a6b4f3C57f1b209C755F3",original:"Ethereum"}],["WMATIC",{symbol:"WMATIC",decimals:18,address:"0x82DbDa803bb52434B1f4F41A6F0Acb1242A7dFa3",original:"Polygon"}],["USDCpolygon",{symbol:"USDC",decimals:6,address:"0x4415BfBDee669446550d55c749007EF60B520FC8",original:"Polygon"}],["WBNB",{symbol:"WBNB",decimals:18,address:"0xE3b841C3f96e647E6dc01b468d6D0AD3562a9eeb",original:"Bsc"}],["USDCbnb",{symbol:"USDC",decimals:18,address:"0x7f433E22366E03a3758CE22cCf82887d828078f8",original:"Bsc"}],["WAVAX",{symbol:"WAVAX",decimals:18,address:"0xd4937A95BeC789CC1AE1640714C61c160279B22F",original:"Avalanche"}],["USDCavax",{symbol:"USDC",decimals:6,address:"0xd4918c40cA9f02d42Cb53d06587aF42017Bc345D",original:"Avalanche"}],["WFTM",{symbol:"WFTM",decimals:18,address:"0x609AedD990bf45926bca9E4eE988b4Fb98587D3A",original:"Fantom"}],["CELO",{symbol:"CELO",decimals:18,address:"0xc1a792041985F65c17Eb65E66E254DC879CF380b",original:"Celo"}],["GLMR",{symbol:"GLMR",decimals:18,address:"native",wrappedKey:"WGLMR"}],["WGLMR",{symbol:"WGLMR",decimals:18,address:"0xAcc15dC74880C9944775448304B263D191c6077F"}],["WSOL",{symbol:"WSOL",decimals:9,address:"0x99Fec54a5Ad36D50A4Bba3a41CAB983a5BB86A7d",original:"Solana"}],["USDCsol",{symbol:"USDC",decimals:6,address:"0x098d6eE48341D6a0a0A72dE5baaF80A10E0F6082",original:"Solana"}],["SUI",{symbol:"SUI",decimals:9,address:"0x484eCCE6775143D3335Ed2C7bCB22151C53B9F49",original:"Sui"}],["APT",{symbol:"APT",decimals:8,address:"0x25331575641d35D9765e1934acC8F0991c58e904",original:"Aptos"}],["WETHarbitrum",{symbol:"WETH",decimals:18,address:"0x18872b45c603eD2EbC508b9C5514a85c2e2791FB",original:"Arbitrum"}],["WETHoptimism",{symbol:"WETH",decimals:18,address:"0xd4870F7F5AD8Ae5139E1a5D8AD4ac55204aE4490",original:"Optimism"}],["USDCoptimism",{symbol:"USDC",decimals:6,address:"0x7143e8EA96e158381057a58AfdDF44601c7e532C",original:"Optimism"}],["WETHbase",{symbol:"WETH",decimals:18,address:"0x6C6f83366A42fcA4D30a2D3f1914284de995Ac3a",original:"Base"}],["USDCbase",{symbol:"USDC",decimals:6,address:"0xE6d02a875CcC153c076fe418f33De3A5C420f505",original:"Base"}],["tBTC",{symbol:"tBTC",decimals:18,address:"0xeCd65E4B89495Ae63b4f11cA872a23680A7c419c",original:"Ethereum"}],["WKLAY",{symbol:"WKLAY",decimals:18,address:"0xf0a9476E4712123A807859f9Fd25fe98213379BD",original:"Klaytn"}]]],["Solana",[["WETH",{symbol:"WETH",decimals:8,address:"7vfCXTUXx5WJV5JADk17DUJ4ksgau7utNKj4b963voxs",original:"Ethereum"}],["USDCeth",{symbol:"USDC",decimals:6,address:"A9mUU4qviSctJVPJdBJWkb28deg915LYJKrzQ19ji3FM",original:"Ethereum"}],["WBTC",{symbol:"WBTC",decimals:8,address:"3NZ9JMVBmGAqocybic2c7LQCJScmgsAZ6vQqTDzcqmJh",original:"Ethereum"}],["USDT",{symbol:"USDT",decimals:6,address:"Dn4noZ5jgGfkntzcQSUZ8czkreiZ1ForXYoV2H8Dm7S1",original:"Ethereum"}],["DAI",{symbol:"DAI",decimals:8,address:"EjmyN6qEC1Tf1JxiG1ae7UTJhUxSwk1TCWNWqxWV4J6o",original:"Ethereum"}],["BUSD",{symbol:"BUSD",decimals:8,address:"33fsBLA8djQm82RpHmE3SuVrPGtZBWNYExsEUeKX1HXX",original:"Ethereum"}],["WMATIC",{symbol:"WMATIC",decimals:8,address:"Gz7VkD4MacbEB6yC5XD3HcumEiYx2EtDYYrfikGsvopG",original:"Polygon"}],["WBNB",{symbol:"WBNB",decimals:8,address:"9gP2kCy3wA1ctvYWQk75guqXuHfrEomqydHLtcTCqiLa",original:"Bsc"}],["USDCbnb",{symbol:"USDC",decimals:8,address:"FCqfQSujuPxy6V42UvafBhsysWtEq1vhjfMN1PUbgaxA",original:"Bsc"}],["WAVAX",{symbol:"WAVAX",decimals:8,address:"KgV1GvrHQmRBY8sHQQeUKwTm2r2h8t4C8qt12Cw1HVE",original:"Avalanche"}],["USDCavax",{symbol:"USDC",decimals:6,address:"FHfba3ov5P3RjaiLVgh8FTv4oirxQDoVXuoUUDvHuXax",original:"Avalanche"}],["WFTM",{symbol:"WFTM",decimals:8,address:"DRQBDBEWmwWGK13fRTLhSPzjbvMSUavhV6nW4RUH8W6T",original:"Fantom"}],["CELO",{symbol:"CELO",decimals:8,address:"9kvAcwQbqejuJMd59mKuw2bfSsLRaQ7zuvaTVHEeBBec",original:"Celo"}],["WGLMR",{symbol:"WGLMR",decimals:8,address:"7ixSaXGsHAFy34wogPk2YXiUX3BMmQMFdercdaHLnBby",original:"Moonbeam"}],["SOL",{symbol:"SOL",decimals:9,address:"native",wrappedKey:"WSOL"}],["WSOL",{symbol:"WSOL",decimals:9,address:"So11111111111111111111111111111111111111112"}],["USDCsol",{symbol:"USDC",decimals:6,address:"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"}],["SUI",{symbol:"SUI",decimals:8,address:"G1vJEgzepqhnVu35BN4jrkv3wVwkujYWFFCxhbEZ1CZr",original:"Sui"}],["APT",{symbol:"APT",decimals:8,address:"6LNeTYMqtNm1pBFN8PfhQaoLyegAH8GD32WmHU9erXKN",original:"Aptos"}],["WETHarbitrum",{symbol:"WETH",decimals:8,address:"CSD6JQMvLi46psjHdpfFdr826mF336pEVMJgjwcoS1m4",original:"Arbitrum"}],["USDCarbitrum",{symbol:"USDC",decimals:6,address:"CR4xnGrhsu1fWNPoX4KbTUUtqGMF3mzRLfj4S6YEs1Yo",original:"Arbitrum"}],["WETHoptimism",{symbol:"WETH",decimals:8,address:"8M6d63oL7dvMZ1gNbgGe3h8afMSWJEKEhtPTFM2u8h3c",original:"Optimism"}],["WETHbase",{symbol:"WETH",decimals:8,address:"DWXe1hxpnb8LAH21iyXcjvMbiAGzoYyuCVQtRLvZdLYd",original:"Base"}],["USDCbase",{symbol:"USDC",decimals:6,address:"EfqRM8ZGWhDTKJ7BHmFvNagKVu3AxQRDQs8WMMaoBCu6",original:"Base"}],["tBTC",{symbol:"tBTC",decimals:8,address:"25rXTx9zDZcHyTav5sRqM6YBvTGu9pPH9yv83uAEqbgG",original:"Ethereum"}],["tBTCsol",{symbol:"tBTC",decimals:8,address:"6DNSN2BJsaPFdFFc1zP37kkeNe4Usc1Sqkzr9C9vPWcU"}],["wstETH",{symbol:"wstETH",decimals:8,address:"ZScHuTtqZukUrtZS43teTKGs2VqkKL8k4QCouR2n6Uo",original:"Ethereum"}],["PYTH",{symbol:"PYTH",decimals:6,address:"HZ1JovNiVvGrGNiiYvEozEVgZ58xaU3RKwX8eACQBCt3"}]]],["Sui",[["WETH",{symbol:"WETH",decimals:8,address:"0xaf8cd5edc19c4512f4259f0bee101a40d41ebed738ade5874359610ef8eeced5::coin::COIN",original:"Ethereum"}],["USDCeth",{symbol:"USDC",decimals:6,address:"0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf::coin::COIN",original:"Ethereum"}],["WBTC",{symbol:"WBTC",decimals:8,address:"0x27792d9fed7f9844eb4839566001bb6f6cb4804f66aa2da6fe1ee242d896881::coin::COIN",original:"Ethereum"}],["USDT",{symbol:"USDT",decimals:6,address:"0xc060006111016b8a020ad5b33834984a437aaa7d3c74c18e09a95d48aceab08c::coin::COIN",original:"Ethereum"}],["WMATIC",{symbol:"WMATIC",decimals:8,address:"0xdbe380b13a6d0f5cdedd58de8f04625263f113b3f9db32b3e1983f49e2841676::coin::COIN",original:"Polygon"}],["USDCpolygon",{symbol:"USDC",decimals:6,address:"0x5c8c9082401982e8c2519a5c12883a5475295bf5cec4a0a13c26d35dd9a20d73::coin::COIN",original:"Polygon"}],["WBNB",{symbol:"WBNB",decimals:8,address:"0xb848cce11ef3a8f62eccea6eb5b35a12c4c2b1ee1af7755d02d7bd6218e8226f::coin::COIN",original:"Bsc"}],["USDCbnb",{symbol:"USDC",decimals:8,address:"0x909cba62ce96d54de25bec9502de5ca7b4f28901747bbf96b76c2e63ec5f1cba::coin::COIN",original:"Bsc"}],["WAVAX",{symbol:"WAVAX",decimals:8,address:"0x1e8b532cca6569cab9f9b9ebc73f8c13885012ade714729aa3b450e0339ac766::coin::COIN",original:"Avalanche"}],["USDCavax",{symbol:"USDC",decimals:6,address:"0xe596782fbaebef51ae99ffac8731aed98a80642b9dc193ed659c97fbc2cc0f84::coin::COIN",original:"Avalanche"}],["WFTM",{symbol:"WFTM",decimals:8,address:"0x6081300950a4f1e2081580e919c210436a1bed49080502834950d31ee55a2396::coin::COIN",original:"Fantom"}],["CELO",{symbol:"CELO",decimals:8,address:"0xa198f3be41cda8c07b3bf3fee02263526e535d682499806979a111e88a5a8d0f::coin::COIN",original:"Celo"}],["WGLMR",{symbol:"WGLMR",decimals:8,address:"0x66f87084e49c38f76502d17f87d17f943f183bb94117561eb573e075fdc5ff75::coin::COIN",original:"Moonbeam"}],["WSOL",{symbol:"WSOL",decimals:8,address:"0xb7844e289a8410e50fb3ca48d69eb9cf29e27d223ef90353fe1bd8e27ff8f3f8::coin::COIN",original:"Solana"}],["USDCsol",{symbol:"USDC",decimals:6,address:"0xb231fcda8bbddb31f2ef02e6161444aec64a514e2c89279584ac9806ce9cf037::coin::COIN",original:"Solana"}],["SUI",{symbol:"SUI",decimals:9,address:"0x2::sui::SUI"}],["APT",{symbol:"APT",decimals:8,address:"0x3a5143bb1196e3bcdfab6203d1683ae29edd26294fc8bfeafe4aaa9d2704df37::coin::COIN",original:"Aptos"}],["WETHarbitrum",{symbol:"WETH",decimals:8,address:"0x33744e7df340a4d01c23f6b18c13563f767545ea95f976f8045f056358419da3::coin::COIN",original:"Arbitrum"}],["USDCarbitrum",{symbol:"USDC",decimals:6,address:"0xc3f8927de33d3deb52c282a836082a413bc73c6ee0bd4d7ec7e3b6b4c28e9abf::coin::COIN",original:"Arbitrum"}],["WETHoptimism",{symbol:"WETH",decimals:8,address:"0xaab14ec22908de73d1b0619f5e03842398f8e68262981bd35ef44b42d22b23a::coin::COIN",original:"Optimism"}],["USDCoptimism",{symbol:"USDC",decimals:6,address:"0x6037801f060f0f54b3817bca05e3c8b9b9ffaa2da8e93fd5b80fa662aa3c9e55::coin::COIN",original:"Optimism"}],["WETHbase",{symbol:"WETH",decimals:8,address:"0xaecbc804fa7ca7cffc74c9a05eb6ae86fda0c68375b5c1724204a1065bcb239a::coin::COIN",original:"Base"}],["USDCbase",{symbol:"USDC",decimals:6,address:"0x7e3e74afcc1913aa9491c8cee89b02131a6e5519b090f16b54321835c1241cfb::coin::COIN",original:"Base"}],["tBTC",{symbol:"tBTC",decimals:8,address:"0xbc3a676894871284b3ccfb2eec66f428612000e2a6e6d23f592ce8833c27c973::coin::COIN",original:"Ethereum"}],["WKLAY",{symbol:"WKLAY",decimals:8,address:"0xa5ec915864d7f37b25ca9144b2db6ebcf29e73603c2ccf9d0e765adcd9049a98::coin::COIN",original:"Klaytn"}],["PYTH",{symbol:"PYTH",decimals:6,address:"0x9c6d76eb273e6b5ba2ec8d708b7fa336a5531f6be59f326b5be8d4d8b12348a4::coin::COIN",original:"Solana"}]]],["Aptos",[["WETH",{symbol:"WETH",decimals:8,address:"0xcc8a89c8dce9693d354449f1f73e60e14e347417854f029db5bc8e7454008abb::coin::T",original:"Ethereum"}],["USDCeth",{symbol:"USDC",decimals:6,address:"0x5e156f1207d0ebfa19a9eeff00d62a282278fb8719f4fab3a586a0a2c0fffbea::coin::T",original:"Ethereum"}],["WBTC",{symbol:"WBTC",decimals:8,address:"0xae478ff7d83ed072dbc5e264250e67ef58f57c99d89b447efd8a0a2e8b2be76e::coin::T",original:"Ethereum"}],["USDT",{symbol:"USDT",decimals:6,address:"0xa2eda21a58856fda86451436513b867c97eecb4ba099da5775520e0f7492e852::coin::T",original:"Ethereum"}],["DAI",{symbol:"DAI",decimals:8,address:"0x407a220699982ebb514568d007938d2447d33667e4418372ffec1ddb24491b6c::coin::T",original:"Ethereum"}],["BUSD",{symbol:"BUSD",decimals:8,address:"0x77400d2f56a01bad2d7c8c6fa282f62647ce3c03f43f2a8742e47ea01a91e24a::coin::T",original:"Ethereum"}],["WMATIC",{symbol:"WMATIC",decimals:8,address:"0x6781088e2a1629d38eda521467af4a8ca7bfa7e5516338017940389595c85c0f::coin::T",original:"Polygon"}],["USDCpolygon",{symbol:"USDC",decimals:6,address:"0xc5fd7820e9f053e6dd8e7dd8ca3ce8e9b10d200ba1692bdeb7a035217180ad4a::coin::T",original:"Polygon"}],["WBNB",{symbol:"WBNB",decimals:8,address:"0x6312bc0a484bc4e37013befc9949df2d7c8a78e01c6fe14a34018449d136ba86::coin::T",original:"Bsc"}],["USDCbnb",{symbol:"USDC",decimals:8,address:"0x79a6ed7a0607fdad2d18d67d1a0e552d4b09ebce5951f1e5c851732c02437595::coin::T",original:"Bsc"}],["WAVAX",{symbol:"WAVAX",decimals:8,address:"0x5b1bbc25524d41b17a95dac402cf2f584f56400bf5cc06b53c36b331b1ec6e8f::coin::T",original:"Avalanche"}],["USDCavax",{symbol:"USDC",decimals:6,address:"0x39d84c2af3b0c9895b45d4da098049e382c451ba63bec0ce0396ff7af4bb5dff::coin::T",original:"Avalanche"}],["WFTM",{symbol:"WFTM",decimals:8,address:"0xd1aa2ff36a0e93e1b4e4fecdecf8bb95bc5de399061c5e84b515281f48718842::coin::T",original:"Fantom"}],["CELO",{symbol:"CELO",decimals:8,address:"0xac0c3c35d50f6ef00e3b4db6998732fe9ed6331384925fe8ec95fcd7745a9112::coin::T",original:"Celo"}],["WGLMR",{symbol:"WGLMR",decimals:8,address:"0x7ab1283a7b13c4254d4e1f803d7ce6578442c1d7a40d0faee41cd48ba4884c8a::coin::T",original:"Moonbeam"}],["WSOL",{symbol:"WSOL",decimals:8,address:"0xdd89c0e695df0692205912fb69fc290418bed0dbe6e4573d744a6d5e6bab6c13::coin::T",original:"Solana"}],["USDCsol",{symbol:"USDC",decimals:6,address:"0xc91d826e29a3183eb3b6f6aa3a722089fdffb8e9642b94c5fcd4c48d035c0080::coin::T",original:"Solana"}],["SUI",{symbol:"SUI",decimals:8,address:"0xa72a97e872be9ee3d2f14d56fd511eb7e4a53f4055be3a267d8602e7685b41c0::coin::T",original:"Sui"}],["APT",{symbol:"APT",decimals:8,address:"0x1::aptos_coin::AptosCoin"}],["WETHarbitrum",{symbol:"WETH",decimals:8,address:"0x0e977796d7bfb3263609b90dffd264c7bd078ce35dac42b55302858d9fa3452b::coin::T",original:"Arbitrum"}],["USDCarbitrum",{symbol:"USDC",decimals:6,address:"0xca3a2c28bc8c6c762f752dd2a4ebbfd00356ca99977ce6636e3af5897124a87a::coin::T",original:"Arbitrum"}],["WETHoptimism",{symbol:"WETH",decimals:8,address:"0x6a7a7f36ef5e2d0e65fcf72669c20d514d68298b0f76c7554517208f73260aaf::coin::T",original:"Optimism"}],["USDCoptimism",{symbol:"USDC",decimals:6,address:"0x4f6ecb05a797902d472abc2f5804bde93a53d8b75f14f767824cdb1623a4ee83::coin::T",original:"Optimism"}],["WETHbase",{symbol:"WETH",decimals:8,address:"0x5b5f14781164cf77185a7b6acd8e4f3cbb7e7cfb1cd5760d2b8af81075fc153d::coin::T",original:"Base"}],["USDCbase",{symbol:"USDC",decimals:6,address:"0xfcc4fcd734d5b8578fb629d238d15264a49eca6165c7444c21feec3b4962eb88::coin::T",original:"Base"}],["tBTC",{symbol:"tBTC",decimals:8,address:"0x9d5a0f8215301fa8096df332b1533f6328f18c32fbac2a7089cfbea73b3068a7::coin::T",original:"Ethereum"}],["WKLAY",{symbol:"WKLAY",decimals:8,address:"0x539b652f8230a0e42adaeda4706b5639893d22362eda6ea897493c210cb48219::coin::T",original:"Klaytn"}],["PYTH",{symbol:"PYTH",decimals:6,address:"0x770211b47954e15bec1a4271bf33bacebc2d2adb43b7dc1ca45efa787615dd4c::coin::T",original:"Solana"}]]],["Base",[["WETH",{symbol:"WETH",decimals:18,address:"0x71b35ECb35104773537f849FBC353F81303A5860",original:"Ethereum"}],["USDCeth",{symbol:"USDC",decimals:6,address:"0xec267C53f53807c2337C257f8AC3Fc3cC07cc0ed",original:"Ethereum"}],["WBTC",{symbol:"WBTC",decimals:8,address:"0xE6396f780b543dF16ee3b784D789c75B68319db0",original:"Ethereum"}],["USDT",{symbol:"USDT",decimals:6,address:"0xFf0C62A4979400841eFaA6faADb07Ac7d5C98b27",original:"Ethereum"}],["DAI",{symbol:"DAI",decimals:18,address:"0x617Edadb51BfB43A44Bb91C7402129C23bA52381",original:"Ethereum"}],["WMATIC",{symbol:"WMATIC",decimals:18,address:"0xc863399E5c5C4011B1DC3fB602902C77BA72B709",original:"Polygon"}],["USDCpolygon",{symbol:"USDC",decimals:6,address:"0xFe1579BAc60363c8572CB30Bf4DD1Fd85811BBF8",original:"Polygon"}],["WBNB",{symbol:"WBNB",decimals:18,address:"0x7fdAa50d7399ac436943028edA6ed9a1BD89509f",original:"Bsc"}],["USDCbnb",{symbol:"USDC",decimals:18,address:"0x68E2b07F92ed506f92935d7359ECA84D5342dbb4",original:"Bsc"}],["WAVAX",{symbol:"WAVAX",decimals:18,address:"0xc449A60A31E1eebFE83c42E9465fd4Dc318aE9a7",original:"Avalanche"}],["USDCavax",{symbol:"USDC",decimals:6,address:"0xD83385fE100E20c269a5975D4Bf92525BcE09F87",original:"Avalanche"}],["WFTM",{symbol:"WFTM",decimals:18,address:"0x936Fa2DE8380Dc5BF34C80F1BaD53a9f3630263B",original:"Fantom"}],["CELO",{symbol:"CELO",decimals:18,address:"0x74df3823aA29D278cAD0A3632fCB56C896a38eD4",original:"Celo"}],["WGLMR",{symbol:"WGLMR",decimals:18,address:"0xfdB7311BeC3b2CcCF8407d0585f81B97b3b5eff1",original:"Moonbeam"}],["WSOL",{symbol:"WSOL",decimals:9,address:"0x1C61629598e4a901136a81BC138E5828dc150d67",original:"Solana"}],["USDCsol",{symbol:"USDC",decimals:6,address:"0xe8CE40EBBB844142400D21558a2F1c9683d69139",original:"Solana"}],["SUI",{symbol:"SUI",decimals:9,address:"0x36c6FBF7B49bF65f5F82b674af219C05b2a4aDD1",original:"Sui"}],["APT",{symbol:"APT",decimals:8,address:"0x1d36126289Be1658297A35CC3EB2BB80A7D7A04b",original:"Aptos"}],["WETHarbitrum",{symbol:"WETH",decimals:18,address:"0x9D36e0edb8BBaBeec5edE8a218dc2B9a6Fce494F",original:"Arbitrum"}],["USDCarbitrum",{symbol:"USDC",decimals:6,address:"0xb96B82Cd6D45d98Fb6897D16A5E4EE888329C513",original:"Arbitrum"}],["WETHoptimism",{symbol:"WETH",decimals:18,address:"0xCb725aC8d9985D3bE306Dd9e1517d3702929176c",original:"Optimism"}],["USDCoptimism",{symbol:"USDC",decimals:6,address:"0xc6bfBeb3002aD563D2d1f72614C61C83Bf147Acd",original:"Optimism"}],["ETHbase",{symbol:"ETH",decimals:18,address:"native",wrappedKey:"WETHbase"}],["WETHbase",{symbol:"WETH",decimals:18,address:"0x4200000000000000000000000000000000000006"}],["USDCbase",{symbol:"USDC",decimals:6,address:"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}],["wstETHbase",{symbol:"wstETH",decimals:18,address:"0xc1CBa3fCea344f92D9239c08C0568f6F2F0ee452"}],["tBTC",{symbol:"tBTC",decimals:18,address:"0x9EE95E6Bd1B3C5740F105d6fb06b8BDeF64Eec70",original:"Ethereum"}],["tBTCarbitrum",{symbol:"tBTC",decimals:18,address:"0x56D0873e0eCA4a56063e1BF945788365666CFBFC",original:"Arbitrum"}],["tBTCbase",{symbol:"tBTC",decimals:18,address:"0x236aa50979D5f3De3Bd1Eeb40E81137F22ab794b"}],["wstETH",{symbol:"wstETH",decimals:18,address:"0xEd4e2FD35161c3c0e33cA187fce64C70d44Ce32b",original:"Ethereum"}],["WKLAY",{symbol:"WKLAY",decimals:18,address:"0x41c433c146c47Dc53FC48cDc69e406e365e298E1",original:"Klaytn"}],["PYTH",{symbol:"PYTH",decimals:6,address:"0x4c5d8A75F3762c1561D96f177694f67378705E98",original:"Solana"}],["USDTbase",{symbol:"USDT",decimals:6,address:"0xfde4C96c8593536E31F229EA8f37b2ADa2699bb2"}]]],["Arbitrum",[["WETH",{symbol:"WETH",decimals:18,address:"0xD8369C2EDA18dD6518eABb1F85BD60606dEb39Ec",original:"Ethereum"}],["USDCeth",{symbol:"USDC",decimals:6,address:"0xC96F2715E2a242d50D1b0bC923dbe1740b8eCf18",original:"Ethereum"}],["WBTC",{symbol:"WBTC",decimals:8,address:"0x397846a8078d4845c7f5c6Ca76aeBbcFDc044fAe",original:"Ethereum"}],["USDT",{symbol:"USDT",decimals:6,address:"0xE4728F3E48E94C6DA2B53610E677cc241DAFB134",original:"Ethereum"}],["DAI",{symbol:"DAI",decimals:18,address:"0x5c4f2FEFB97F7DF09E762d95C83f0Ccf8bCe8234",original:"Ethereum"}],["WMATIC",{symbol:"WMATIC",decimals:18,address:"0x3ab0E28C3F56616aD7061b4db38aE337E3809AEA",original:"Polygon"}],["USDCpolygon",{symbol:"USDC",decimals:6,address:"0x599ADB10E6A012dF34935D47407450f6D7170e3C",original:"Polygon"}],["WBNB",{symbol:"WBNB",decimals:18,address:"0x7AF00405916D823eDb1121546EfA6F4972B51b84",original:"Bsc"}],["USDCbnb",{symbol:"USDC",decimals:18,address:"0x1a0590F951bc9C3818Ce75ba5Bbe92831b2cf57e",original:"Bsc"}],["WAVAX",{symbol:"WAVAX",decimals:18,address:"0x565609fAF65B92F7be02468acF86f8979423e514",original:"Avalanche"}],["USDCavax",{symbol:"USDC",decimals:6,address:"0x93e0FcbEd43CD6fC30DF00CcBD4669718dc74e77",original:"Avalanche"}],["WFTM",{symbol:"WFTM",decimals:18,address:"0x7f7dcDb91930033a4Eb269196EBb6fd5f0644E4B",original:"Fantom"}],["CELO",{symbol:"CELO",decimals:18,address:"0x4E51aC49bC5e2d87e0EF713E9e5AB2D71EF4F336",original:"Celo"}],["WGLMR",{symbol:"WGLMR",decimals:18,address:"0x944C5b67a03e6Cb93Ae1E4B70081f13b04CDB6Bd",original:"Moonbeam"}],["WSOL",{symbol:"WSOL",decimals:9,address:"0x2bcC6D6CdBbDC0a4071e48bb3B969b06B3330c07",original:"Solana"}],["USDCsol",{symbol:"USDC",decimals:6,address:"0x3870546cfd600ba87e4180686d29dC993A45d3B7",original:"Solana"}],["SUI",{symbol:"SUI",decimals:9,address:"0xCF79d86B8a830030aF6D835737d6eac3bE823fD7",original:"Sui"}],["APT",{symbol:"APT",decimals:8,address:"0x4EdeF400eDe5309240814b5FC403F224504604e9",original:"Aptos"}],["ETHarbitrum",{symbol:"ETH",decimals:18,address:"native",wrappedKey:"WETHarbitrum"}],["WETHarbitrum",{symbol:"WETH",decimals:18,address:"0x82af49447d8a07e3bd95bd0d56f35241523fbab1"}],["USDCarbitrum",{symbol:"USDC",decimals:6,address:"0xaf88d065e77c8cC2239327C5EDb3A432268e5831"}],["WETHoptimism",{symbol:"WETH",decimals:18,address:"0xB1fC645a86fB5085e12D8BDDb77702F728D2A26F",original:"Optimism"}],["USDCoptimism",{symbol:"USDC",decimals:6,address:"0x3A5C2Da9E30741cb59a5e9446A23A86886fC9DC2",original:"Optimism"}],["WETHbase",{symbol:"WETH",decimals:18,address:"0xBAfbCB010D920e0Dab9DFdcF634De1B777028a85",original:"Base"}],["USDCbase",{symbol:"USDC",decimals:6,address:"0x8619F97D4d08382548F536E5CE1D3e0D9bA40326",original:"Base"}],["tBTC",{symbol:"tBTC",decimals:18,address:"0x57723abc582DBfE11Ea01f1A1f48aEE20bD65D73",original:"Ethereum"}],["tBTCpolygon",{symbol:"tBTC",decimals:18,address:"0x3bab04bDFd2Dc3640c2B9390A2Da05bC1192D482",original:"Polygon"}],["tBTCoptimism",{symbol:"tBTC",decimals:18,address:"0x2519010b6585247BcDC8BcDa5C8730Be754b8c76",original:"Optimism"}],["tBTCarbitrum",{symbol:"tBTC",decimals:18,address:"0x6c84a8f1c29108F47a79964b5Fe888D4f4D0dE40"}],["wstETH",{symbol:"wstETH",decimals:18,address:"0xf2717122Dfdbe988ae811E7eFB157aAa07Ff9D0F",original:"Ethereum"}],["wstETHarbitrum",{symbol:"wstETH",decimals:18,address:"0x5979D7b546E38E414F7E9822514be443A4800529"}],["WKLAY",{symbol:"WKLAY",decimals:18,address:"0xFA95f6c796E54F9C4a99392CAE84410a25794BB3",original:"Klaytn"}],["PYTH",{symbol:"PYTH",decimals:6,address:"0xE4D5c6aE46ADFAF04313081e8C0052A30b6Dd724",original:"Solana"}],["USDTarbitrum",{symbol:"USDT",decimals:6,address:"0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9"}]]],["Optimism",[["WETH",{symbol:"WETH",decimals:18,address:"0xb47bC3ed6D70F04fe759b2529c9bc7377889678f",original:"Ethereum"}],["USDCeth",{symbol:"USDC",decimals:6,address:"0x711e53D031ea9B0bb0C24dD506df11b41AEA419e",original:"Ethereum"}],["WBTC",{symbol:"WBTC",decimals:8,address:"0xB214C19d81c99E75e84706a3aa0A757319023e26",original:"Ethereum"}],["USDT",{symbol:"USDT",decimals:6,address:"0xf6B4185FCf8aF291c0E3927fbEab7046b4f6A8CA",original:"Ethereum"}],["DAI",{symbol:"DAI",decimals:18,address:"0x098EA47D630b46df1E08e389e5e4466119c7dd30",original:"Ethereum"}],["WMATIC",{symbol:"WMATIC",decimals:18,address:"0x8f02B6a32cebcAe44D2Fd17d87966f5B5dD14c6d",original:"Polygon"}],["USDCpolygon",{symbol:"USDC",decimals:6,address:"0xbB1EaB9Eb8fDf65F0E291D013DA07B4b65a27a01",original:"Polygon"}],["WBNB",{symbol:"WBNB",decimals:18,address:"0x6A09fE65ACa27C12573F04aAFa290bD75497E1BC",original:"Bsc"}],["USDCbnb",{symbol:"USDC",decimals:18,address:"0x1C15057d1F3794C934a6cBC1f7EceE934050F219",original:"Bsc"}],["WAVAX",{symbol:"WAVAX",decimals:18,address:"0x8418C1d909842f458c9394886b83F19d62bF1A0D",original:"Avalanche"}],["USDCavax",{symbol:"USDC",decimals:6,address:"0x355f0a8a7ecAeD971b8Fbd50994558291ff2413a",original:"Avalanche"}],["WFTM",{symbol:"WFTM",decimals:18,address:"0x0b0ecbe5C3995541876d27633B63296570FB34Af",original:"Fantom"}],["CELO",{symbol:"CELO",decimals:18,address:"0x9b88D293b7a791E40d36A39765FFd5A1B9b5c349",original:"Celo"}],["WGLMR",{symbol:"WGLMR",decimals:18,address:"0xbffD46DFDb8d3a02b8D2E0F864a2cD712090a4D3",original:"Moonbeam"}],["WSOL",{symbol:"WSOL",decimals:9,address:"0xba1Cf949c382A32a09A17B2AdF3587fc7fA664f1",original:"Solana"}],["USDCsol",{symbol:"USDC",decimals:6,address:"0x6F974A6dfD5B166731704Be226795901c45Bb815",original:"Solana"}],["SUI",{symbol:"SUI",decimals:9,address:"0x27A533e438892DA192725b4C9AcA51447F457212",original:"Sui"}],["APT",{symbol:"APT",decimals:8,address:"0xC5B3AC2DF8D8D7AC851F763a5b3Ff23B4A696d59",original:"Aptos"}],["WETHarbitrum",{symbol:"WETH",decimals:18,address:"0x825206E1D29456337769e6f1384101E997C6A732",original:"Arbitrum"}],["USDCarbitrum",{symbol:"USDC",decimals:6,address:"0xa6252F56cc6eEA21165d56744C795F91c8a3Cf68",original:"Arbitrum"}],["ETHoptimism",{symbol:"ETH",decimals:18,address:"native",wrappedKey:"WETHoptimism"}],["WETHoptimism",{symbol:"WETH",decimals:18,address:"0x4200000000000000000000000000000000000006"}],["USDCoptimism",{symbol:"USDC",decimals:6,address:"0x0b2c639c533813f4aa9d7837caf62653d097ff85"}],["WETHbase",{symbol:"WETH",decimals:18,address:"0x3F369a664fa665e01e8EB9f20bFcE03A0CAb8971",original:"Base"}],["USDCbase",{symbol:"USDC",decimals:6,address:"0xb931c7BbD87A6e249EaA7355B13927F9c99Bce87",original:"Base"}],["tBTC",{symbol:"tBTC",decimals:18,address:"0xeC0a755664271b87002dDa33CA2484B24aF68912",original:"Ethereum"}],["tBTCpolygon",{symbol:"tBTC",decimals:18,address:"0xE4C32B9eA749fa0342B1C42C01E80028B97c3917",original:"Polygon"}],["tBTCoptimism",{symbol:"tBTC",decimals:18,address:"0x6c84a8f1c29108F47a79964b5Fe888D4f4D0dE40"}],["tBTCarbitrum",{symbol:"tBTC",decimals:18,address:"0x2390a5131fcba6e47f702172cF4876589E4161c6",original:"Arbitrum"}],["wstETH",{symbol:"wstETH",decimals:18,address:"0x855CFcEEe998c8ca34F9c914F584AbF72dC88B87",original:"Ethereum"}],["wstETHoptimism",{symbol:"wstETH",decimals:18,address:"0x1F32b1c2345538c0c6f582fCB022739c4A194Ebb"}],["WKLAY",{symbol:"WKLAY",decimals:18,address:"0xbbeF8233a0d10EEAb84E913FaDB337ab9b62F683",original:"Klaytn"}],["PYTH",{symbol:"PYTH",decimals:6,address:"0x99C59ACeBFEF3BBFB7129DC90D1a11DB0E91187f",original:"Solana"}],["USDToptimism",{symbol:"USDT",decimals:6,address:"0x94b008aA00579c1307B0EF2c499aD98a8ce58e58"}]]],["Wormchain",[["WETH",{symbol:"WETH",decimals:8,address:"wormhole18csycs4vm6varkp00apuqlsm7v4twg8jsljk8wfdd7cghr7g4rtslwqndm",original:"Ethereum"}],["USDCeth",{symbol:"USDC",decimals:6,address:"wormhole1utjx3594tlvfw4375esgu72wa4sdgf0q7x4ye27husf5kvuzp5rsr72gdq",original:"Ethereum"}],["WBTC",{symbol:"WBTC",decimals:8,address:"wormhole1nz0r0au8aj6dc00wmm3ufy4g4k86rjzlr8wkf92cktdlps5lgfcqxnx9yk",original:"Ethereum"}],["USDT",{symbol:"USDT",decimals:6,address:"wormhole1w27ekqvvtzfanfxnkw4jx2f8gdfeqwd3drkee3e64xat6phwjg0savgmhw",original:"Ethereum"}],["DAI",{symbol:"DAI",decimals:8,address:"wormhole1chejx4qqtvwxy6684yrsmf6pylancxqhk3vsmtleg5ta3zrffljqfscg87",original:"Ethereum"}],["BUSD",{symbol:"BUSD",decimals:8,address:"wormhole1msyushf6d76u9wupuvm6jdvc0x4trmv5w5kxr0hyt7n9npp233usg7pkhm",original:"Ethereum"}],["WMATIC",{symbol:"WMATIC",decimals:8,address:"wormhole1xmpenz0ykxfy8rxr3yc3d4dtqq4dpas4zz3xl6sh873us3vajlpszn4ph7",original:"Polygon"}],["WBNB",{symbol:"WBNB",decimals:8,address:"wormhole169nr66h9gcsfljvsnxnqfjakskcjt6ac8f58wqjuagu79m540teqfvaal4",original:"Bsc"}],["USDCbnb",{symbol:"USDC",decimals:8,address:"wormhole1g3acw7aumaj3r348cqn4kazrehlmn822w9p46sqwztnke27h3lysxj4ddr",original:"Bsc"}],["WAVAX",{symbol:"WAVAX",decimals:8,address:"wormhole1ml922hnp59jtq9a87arekvx60ezehwlg2v3j5pduplwkenfa68ksgmzxwr",original:"Avalanche"}],["USDCavax",{symbol:"USDC",decimals:6,address:"wormhole1gwm6mrnse9atzf4mer4dnrz64mp6pa75wpsxywu8gymt9fwsk46sfr372u",original:"Avalanche"}],["WFTM",{symbol:"WFTM",decimals:8,address:"wormhole1e0cwfmla7exa578xddl87paxexw9ymwrzysfjms8c2mstxjkldlqn45jqa",original:"Fantom"}],["CELO",{symbol:"CELO",decimals:8,address:"wormhole1kqey3a6k26kyensq7elcpx229tlj4d3qlshwhjq5xjm8dcdvu60qtef8k9",original:"Celo"}],["WGLMR",{symbol:"WGLMR",decimals:8,address:"wormhole1gzuv84xrwwhxhf0f62av279vfyrfrm7x58fcnadlr5m90gnx223ses2st0",original:"Moonbeam"}],["WSOL",{symbol:"WSOL",decimals:8,address:"wormhole1wn625s4jcmvk0szpl85rj5azkfc6suyvf75q6vrddscjdphtve8sca0pvl",original:"Solana"}],["USDCsol",{symbol:"USDC",decimals:6,address:"wormhole17fr8awnysyv3nt5je4strczdupssl8u9jqam890jfv72sh32yyqqhtg3ry",original:"Solana"}],["SUI",{symbol:"SUI",decimals:8,address:"wormhole19hlynxzedrlqv99v6qscww7d3crhl86qtd0vprpltg5g9xx6jk9q6ya33y",original:"Sui"}],["APT",{symbol:"APT",decimals:8,address:"wormhole1f9sxjn0qu8xylcpzlvnhrefnatndqxnrajfrnr5h97hegnmsdqhsh6juc0",original:"Aptos"}],["WETHarbitrum",{symbol:"WETH",decimals:8,address:"wormhole18nlwscr7290j463vcptqlgqudycry2rdnw2ysltpc2nqefk3353s808rl9",original:"Arbitrum"}],["WETHoptimism",{symbol:"WETH",decimals:8,address:"wormhole1ev8rhdflmlq6de5g7ttj585fhuv3jfhnuhfzyh7qrswhzaq2tkqswxz6y3",original:"Optimism"}],["USDCoptimism",{symbol:"USDC",decimals:6,address:"wormhole1snw0qugpjcxwtxzzkqt5guwavq85eumxzeagql2u2m662xrtnjuqyj3pkj",original:"Optimism"}],["USDCbase",{symbol:"USDC",decimals:6,address:"wormhole1edkult6zudk6ld23fesjfrehux35q86engsq5jlycl0e4upkz8mqkgcprf",original:"Base"}],["tBTC",{symbol:"tBTC",decimals:8,address:"wormhole1nu9wf9dw384attnpu0pwfet5fajn05w2ex4r07mghvk3xcwrt2yq5uutp5",original:"Ethereum"}],["tBTCpolygon",{symbol:"tBTC",decimals:8,address:"wormhole1uj24zecnaxz7ftz0sh6dsayfene4w3yptwg0422kves9duel67vsr7hlyz",original:"Polygon"}],["tBTCarbitrum",{symbol:"tBTC",decimals:8,address:"wormhole1q8ynvqvtw49ln73mn70v4me4q03fvvmhkf2lh4ueam5w4362s2asjmvxtd",original:"Arbitrum"}],["wstETH",{symbol:"wstETH",decimals:8,address:"wormhole1gg6f95cymcfrfzhpek7cf5wl53t5kng52cd2m0krgdlu8k58vd8qezy8pt",original:"Ethereum"}],["WKLAY",{symbol:"WKLAY",decimals:8,address:"wormhole1kyy876kye7k79fuzat532yyqkrzhlr6l7hc7lfa2rk5tygzhy00qrhjgkc",original:"Klaytn"}]]],["Osmosis",[["WETH",{symbol:"WETH",decimals:8,address:"ibc/62F82550D0B96522361C89B0DA1119DE262FBDFB25E5502BC5101B5C0D0DBAAC",original:"Ethereum"}],["USDCeth",{symbol:"USDC",decimals:6,address:"ibc/6B99DB46AA9FF47162148C1726866919E44A6A5E0274B90912FD17E19A337695",original:"Ethereum"}],["WBTC",{symbol:"WBTC",decimals:8,address:"ibc/E4CD61E1FA3EB04EF1BF924D676AB9FD55E84A0DCF4E78C11CCA0E14E5B42672",original:"Ethereum"}],["USDT",{symbol:"USDT",decimals:6,address:"ibc/2108F2D81CBE328F371AD0CEF56691B18A86E08C3651504E42487D9EE92DDE9C",original:"Ethereum"}],["DAI",{symbol:"DAI",decimals:8,address:"ibc/898ACF6F5DEBF535103BBD52E3E5B70A311AD097B198A152483F69290B4210C0",original:"Ethereum"}],["WMATIC",{symbol:"WMATIC",decimals:8,address:"ibc/03B6D1925A09B3033AA6FA8772202719ABDC51F8CC2A5C26D0A9B19832F2C023",original:"Polygon"}],["WBNB",{symbol:"WBNB",decimals:8,address:"ibc/5394BB30B3C9BD1EE84C9531E5094DDE2490964F518CBE8A4C91F748CE559AF5",original:"Bsc"}],["USDCbnb",{symbol:"USDC",decimals:8,address:"ibc/B28ACEF11D063FA8B1DA73C2F7DA3A1CFCCBC13E96B671698D4860E9367B55BB",original:"Bsc"}],["WAVAX",{symbol:"WAVAX",decimals:8,address:"ibc/22B44C7369EED16089B9840ADE399B80D9483B4E459E67643C96C681D7C463D0",original:"Avalanche"}],["USDCavax",{symbol:"USDC",decimals:6,address:"ibc/0B3C3D06228578334B66B57FBFBA4033216CEB8119B27ACDEE18D92DA5B28D43",original:"Avalanche"}],["WFTM",{symbol:"WFTM",decimals:8,address:"ibc/397DFE63D87F6940ECA583DFF5461E48BF0BA6554CBBE70278E307DDFDC8E9D5",original:"Fantom"}],["CELO",{symbol:"CELO",decimals:8,address:"ibc/83300733052AB5F6E0F0C221E24189B6DF26CC94C73D2F44627627F9DEF4A9C8",original:"Celo"}],["WGLMR",{symbol:"WGLMR",decimals:8,address:"ibc/0F2941B0168D8DB77DA1B6A2D3A95EC04026D3C97FA3BFE8FD1D5D3F983AA518",original:"Moonbeam"}],["WSOL",{symbol:"WSOL",decimals:8,address:"ibc/1E43D59E565D41FB4E54CA639B838FFD5BCFC20003D330A56CB1396231AA1CBA",original:"Solana"}],["USDCsol",{symbol:"USDC",decimals:6,address:"ibc/F08DE332018E8070CC4C68FE06E04E254F527556A614F5F8F9A68AF38D367E45",original:"Solana"}],["SUI",{symbol:"SUI",decimals:8,address:"ibc/B1C287C2701774522570010EEBCD864BCB7AB714711B3AA218699FDD75E832F5",original:"Sui"}],["APT",{symbol:"APT",decimals:8,address:"ibc/A4D176906C1646949574B48C1928D475F2DF56DE0AC04E1C99B08F90BC21ABDE",original:"Aptos"}],["USDCbase",{symbol:"USDC",decimals:6,address:"ibc/8AC0F990290BBEF3AEBFCBF70F902AD954781BB40D07EB76341272800D48D05F",original:"Base"}],["OSMO",{symbol:"OSMO",decimals:6,address:"uosmo"}],["tBTC",{symbol:"tBTC",decimals:8,address:"ibc/6207D35D2C08F2162575C3C4BFD524226E50639121A273045F1B393AF67DCEB3",original:"Ethereum"}],["wstETH",{symbol:"wstETH",decimals:8,address:"ibc/BF75AE1500CB7EC458E91A11731F1B6AC1F1FE1FA937A88564955ED6A83CA2FB",original:"Ethereum"}]]],["Evmos",[["WETH",{symbol:"WETH",decimals:8,address:"ibc/4442A8E0D487A49E76EA6606F5DADCF8D0DBDD8499112340C964970DB745EDA2",original:"Ethereum"}],["USDCeth",{symbol:"USDC",decimals:6,address:"ibc/0C19171CDC59451F91D2749CDEA63355532DCD5D8904CCBAC4953290E16AB8FD",original:"Ethereum"}],["WBTC",{symbol:"WBTC",decimals:8,address:"ibc/46C5DA1CB61C5BAA8730ABA467ADD58DE0333B075CACE28BC87E64AE8C9CA051",original:"Ethereum"}],["USDT",{symbol:"USDT",decimals:6,address:"ibc/C9072A294F5649D64E87A6998DD750576881E454CACCDAF7376EFC0FA243808D",original:"Ethereum"}],["USDCbnb",{symbol:"USDC",decimals:8,address:"ibc/8E08C01546EF346F7E9A3600DDBC88943ADF3B20A67F1F2DD7B83D85613BCCAB",original:"Bsc"}],["WAVAX",{symbol:"WAVAX",decimals:8,address:"ibc/2EA2FE172078576E62DA20F14EEED12B26611D93150FE1D68E1AAE00479AC335",original:"Avalanche"}],["USDCavax",{symbol:"USDC",decimals:6,address:"ibc/39913E647C3549D663B1ED7F0745E1779515170C5215B98B2C8410B4C073AD30",original:"Avalanche"}],["WFTM",{symbol:"WFTM",decimals:8,address:"ibc/9EFE5F5D75A87197DD257BA7A96A3BCCEC9DB59D257C742FB5AA9D3DF612D476",original:"Fantom"}],["WSOL",{symbol:"WSOL",decimals:8,address:"ibc/4443218F584A7AB2DFBCF93872D6E5B6967A11C53515DDF45A2CF387C54BD73A",original:"Solana"}],["WETHarbitrum",{symbol:"WETH",decimals:8,address:"ibc/9E2E7B4A53409267CD686F4EB67969C2602A0F5FF9BDB1082B00E71CC4815DDE",original:"Arbitrum"}],["EVMOS",{symbol:"EVMOS",decimals:18,address:"aevmos"}]]],["Kujira",[["WETH",{symbol:"WETH",decimals:8,address:"ibc/7D9D28CABB49A4BB1A50C3B7E4544BFDBC5DDFAEB84A7787755A34CE7196CE15",original:"Ethereum"}],["USDCeth",{symbol:"USDC",decimals:6,address:"ibc/C5EADE2C526B9629D230AC02A97644984ACB7C2F9A6C85126D1025CB0DA42588",original:"Ethereum"}],["WBTC",{symbol:"WBTC",decimals:8,address:"ibc/B2C7F21B604E3974A7DA5DAA9395905F2F3C85392F8A221CFDF62E4A9F4E48E4",original:"Ethereum"}],["DAI",{symbol:"DAI",decimals:8,address:"ibc/3CE8A3DE4AE5AE2B4B8C03B2B227CC284732EDC849E506615FF2AA3D8EB1BAFC",original:"Ethereum"}],["WAVAX",{symbol:"WAVAX",decimals:8,address:"ibc/28E7241F6508EB4692C721E91201377323796EF2758CCD83D220A40EAD32601E",original:"Avalanche"}],["USDCavax",{symbol:"USDC",decimals:6,address:"ibc/F9F41DB8DA49EA6AB9EB4B2C9E0ECDC2502ABDA2FE728B85994BF31240CBC163",original:"Avalanche"}],["CELO",{symbol:"CELO",decimals:8,address:"ibc/4ACD155D71182398277CBD2C630A7C8C5F0F16FFF77965FDE4C845A4CDE2D60C",original:"Celo"}],["WGLMR",{symbol:"WGLMR",decimals:8,address:"ibc/3D337ECC89A8421DD6F33C4B7DDE9D4A18D728A4A688BA30E41F466EC8DD3869",original:"Moonbeam"}],["WSOL",{symbol:"WSOL",decimals:8,address:"ibc/E5CA126979E2FFB4C70C072F8094D07ECF27773B37623AD2BF7582AD0726F0F3",original:"Solana"}],["SUI",{symbol:"SUI",decimals:8,address:"ibc/EBA52E7239CC1BC7F8ECF4F41523B6DD477FF067FD953315704A9A4FD2131B48",original:"Sui"}],["KUJI",{symbol:"KUJI",decimals:6,address:"ukuji"}]]],["Klaytn",[["KLAY",{symbol:"KLAY",decimals:18,address:"native",wrappedKey:"WKLAY"}],["WKLAY",{symbol:"WKLAY",decimals:18,address:"0xe4f05A66Ec68B54A58B17c22107b02e0232cC817"}]]]],Dd=we(cp,[0,[1,2]]),lp=[["Ethereum",[["ETH",{symbol:"ETH",decimals:18,address:"native",wrappedKey:"WETH"}],["WETH",{symbol:"WETH",decimals:18,address:"0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6"}],["USDCeth",{symbol:"USDC",decimals:6,address:"0x07865c6e87b9f70255377e024ace6630c1eaa37f"}],["WBTC",{symbol:"WBTC",decimals:8,address:"0xC04B0d3107736C32e19F1c62b2aF67BE61d63a05"}],["USDT",{symbol:"USDT",decimals:6,address:"0xC2C527C0CACF457746Bd31B2a698Fe89de2b6d49"}],["DAI",{symbol:"DAI",decimals:18,address:"0x11fE4B6AE13d2a6055C8D9cF65c55bac32B5d844"}],["WMATIC",{symbol:"WMATIC",decimals:18,address:"0x7cd0e8ff09cEB653813bD3d63d0554c1CB4BFdf6",original:"Polygon"}],["WBNB",{symbol:"WBNB",decimals:18,address:"0xB19693FEB013Bab65866dE0a845a9511064230cE",original:"Bsc"}],["WAVAX",{symbol:"WAVAX",decimals:18,address:"0x4C1b727f6df3B075E682C41a25687A69846aaC04",original:"Avalanche"}],["USDCavax",{symbol:"USDC",decimals:6,address:"0xF6699D3f725C4b64Cc6010F2DF77B4B05C76Cd5C",original:"Avalanche"}],["WFTM",{symbol:"WFTM",decimals:18,address:"0x0d7A9Cdbb7C21E64825cF81750A5081a32aFb5d4",original:"Fantom"}],["CELO",{symbol:"CELO",decimals:18,address:"0xe092525a787CD56B901279b5864a224c22B95B72",original:"Celo"}],["WGLMR",{symbol:"WGLMR",decimals:18,address:"0x0dc83BB61008A5E1194fe50fA9E474713C1AEcD7",original:"Moonbeam"}],["WSOL",{symbol:"WSOL",decimals:9,address:"0x494701CE895389d917a938f0ea202D4eB9684Eab",original:"Solana"}],["SUI",{symbol:"SUI",decimals:9,address:"0x70F7360C49D227ccBbb98fB7B69B7CDB651195bb",original:"Sui"}],["APT",{symbol:"APT",decimals:8,address:"0xd7A89a8DD20Cb4F252c7FB96B6421b37d82cE506",original:"Aptos"}],["USDCarbitrum",{symbol:"USDC",decimals:6,address:"0xd962F26D93c4eF609Ba00Ed6101326A1490B9489",original:"Arbitrum"}],["WETHbase",{symbol:"WETH",decimals:18,address:"0x76e39239e40857030D6f4D8545EFbd71F904d344",original:"Base"}],["USDCbase",{symbol:"USDC",decimals:6,address:"0x5aA392243437dDC8b4d86bfC90DF296908740A41",original:"Base"}],["tBTC",{symbol:"tBTC",decimals:18,address:"0x679874fBE6D4E7Cc54A59e315FF1eB266686a937"}],["tBTCarbitrum",{symbol:"tBTC",decimals:18,address:"0x575D93A2278FbF4E8Bd3d51B539a6E237C3F17c5",original:"Arbitrum"}],["tBTCsol",{symbol:"tBTC",decimals:8,address:"0x57A52B6F0b393AF7d36116183cA83E584e636eA4",original:"Solana"}],["wstETH",{symbol:"wstETH",decimals:18,address:"0x6320cD32aA674d2898A68ec82e869385Fc5f7E2f"}],["SEI",{symbol:"SEI",decimals:6,address:"0xd68df72136207E9471C915cf1B6Cf43D587D4E0A",original:"Sei"}],["WKLAY",{symbol:"WKLAY",decimals:18,address:"0x327e0c7D5cFa65d4f9E358dC9fA4446C49dBcB6C",original:"Klaytn"}]]],["Polygon",[["WETH",{symbol:"WETH",decimals:18,address:"0xc6735cc74553Cc2caeB9F5e1Ea0A4dAe12ef4632",original:"Ethereum"}],["USDCeth",{symbol:"USDC",decimals:6,address:"0x543237045a106D7fd2eE3e2B44b5728e70BDe9c3",original:"Ethereum"}],["USDT",{symbol:"USDT",decimals:6,address:"0x02E30E84161BE1aBfcBB2b154B11De4C2b5E0a32",original:"Ethereum"}],["DAI",{symbol:"DAI",decimals:18,address:"0x87374d35C5F1bD78c2b1da383F460e154e7D3E5e",original:"Ethereum"}],["MATIC",{symbol:"MATIC",decimals:18,address:"native",wrappedKey:"WMATIC"}],["WMATIC",{symbol:"WMATIC",decimals:18,address:"0x9c3C9283D3e44854697Cd22D3Faa240Cfb032889"}],["USDCpolygon",{symbol:"USDC",decimals:6,address:"0x9999f7fea5938fd3b1e26a12c3f2fb024e194f97"}],["WBNB",{symbol:"WBNB",decimals:18,address:"0x0C63D8ADB69204b2946DcB945a6f16d97C255eE2",original:"Bsc"}],["WAVAX",{symbol:"WAVAX",decimals:18,address:"0x51f3D34651523dD8CC4872ee261A1B0B3f73AceF",original:"Avalanche"}],["USDCavax",{symbol:"USDC",decimals:6,address:"0xcc048C353Fdc2f5c378B7BCab9B240Ca2b619f1c",original:"Avalanche"}],["WFTM",{symbol:"WFTM",decimals:18,address:"0x84aa9100a36D6c3514605F62342abF3cE77D5b97",original:"Fantom"}],["CELO",{symbol:"CELO",decimals:18,address:"0xAd027790A64331A11bd1b651739450cC9Dc0098F",original:"Celo"}],["WGLMR",{symbol:"WGLMR",decimals:18,address:"0x693b9AC2199d989bDA8C9C5b5d7A3680B4f40dAa",original:"Moonbeam"}],["WSOL",{symbol:"WSOL",decimals:9,address:"0x0284B4994456Fae4cb56E4d33228d51B674EAD1b",original:"Solana"}],["SUI",{symbol:"SUI",decimals:9,address:"0x3dadA6f29f80A0427C4989E17a5a2ada17441841",original:"Sui"}],["APT",{symbol:"APT",decimals:8,address:"0x226B436043B537BD158e84fA199E2Aa36bf364f8",original:"Aptos"}],["WETHoptimism",{symbol:"WETH",decimals:18,address:"0xC77d781f38Cf52F8Ea0b4c0F22312bB9A34911b5",original:"Optimism"}],["WETHbase",{symbol:"WETH",decimals:18,address:"0x68C4365d5229A44D9A59058B65500365492b5307",original:"Base"}],["tBTC",{symbol:"tBTC",decimals:18,address:"0xf6CC0Cc8D54a4b1A63a0E9745663e0c844Ee4D48",original:"Ethereum"}],["tBTCpolygon",{symbol:"tBTC",decimals:18,address:"0xBcD7917282E529BAA6f232DdDc75F3901245A492"}],["SEI",{symbol:"SEI",decimals:6,address:"0xc5C0229B38564E1E8083031405Be8d6E6e3Bc462",original:"Sei"}],["WKLAY",{symbol:"WKLAY",decimals:18,address:"0x7b34f3711705eB2963fB856cda063C979de4749e",original:"Klaytn"}]]],["Bsc",[["WETH",{symbol:"WETH",decimals:18,address:"0x064a85eac6b4Bd7190BCAd3458dBD9459989c37B",original:"Ethereum"}],["USDCeth",{symbol:"USDC",decimals:6,address:"0x861B5C16A2EcED022241072A7beA9D530b99EB6f",original:"Ethereum"}],["USDT",{symbol:"USDT",decimals:6,address:"0xe94AaBAdB6F833f65B8A9AdDD030985B775188c9",original:"Ethereum"}],["DAI",{symbol:"DAI",decimals:18,address:"0x45082C9Fc6BBCa72288F47Fad21dE0BECC75759E",original:"Ethereum"}],["WMATIC",{symbol:"WMATIC",decimals:18,address:"0x7FCDA925f0994121752ca14C334297BeC3d0eA9E",original:"Polygon"}],["BNB",{symbol:"BNB",decimals:18,address:"native",wrappedKey:"WBNB"}],["WBNB",{symbol:"WBNB",decimals:18,address:"0xae13d989daC2f0dEbFf460aC112a837C89BAa7cd"}],["WAVAX",{symbol:"WAVAX",decimals:18,address:"0x6cE9E2c8b59bbcf65dA375D3d8AB503c8524caf7",original:"Avalanche"}],["USDCavax",{symbol:"USDC",decimals:6,address:"0x1cfeCf72bcBE1E429A21A5B11E708C7c397AaC54",original:"Avalanche"}],["WFTM",{symbol:"WFTM",decimals:18,address:"0x9aB305B792DBdb8253bEE909E7006611Cb45175b",original:"Fantom"}],["CELO",{symbol:"CELO",decimals:18,address:"0x1471698cBD9cAB0228F2EEA9303A2b3aA0ABDC2B",original:"Celo"}],["WGLMR",{symbol:"WGLMR",decimals:18,address:"0x5C31B36599ED7f06b09c0ffC7A2F928cE496F046",original:"Moonbeam"}],["WSOL",{symbol:"WSOL",decimals:9,address:"0x30f19eBba919954FDc020B8A20aEF13ab5e02Af0",original:"Solana"}],["USDCsol",{symbol:"USDC",decimals:6,address:"0x51a3cc54eA30Da607974C5D07B8502599801AC08",original:"Solana"}],["SUI",{symbol:"SUI",decimals:9,address:"0x5A73D76e09Af2E428EC64aE10F91B78AC990B298",original:"Sui"}],["APT",{symbol:"APT",decimals:8,address:"0x4A7Bd5E135f421057F97BbA8BCeeE5c18334f454",original:"Aptos"}],["WETHarbitrum",{symbol:"WETH",decimals:18,address:"0x60845E2503Fcd945b3A6f0bC077a31CC913E654D",original:"Arbitrum"}],["USDCarbitrum",{symbol:"USDC",decimals:6,address:"0xe3aA397cb6d93Cce4fAd9Cc9E796CCa5E50FB5ED",original:"Arbitrum"}],["WETHbase",{symbol:"WETH",decimals:18,address:"0x63108fC941F3cCE0B484De19746B5Af949EAF6eE",original:"Base"}],["tBTC",{symbol:"tBTC",decimals:18,address:"0xE7176110261ef2FfC885dd568C1093f58F0aEee9",original:"Ethereum"}],["SEI",{symbol:"SEI",decimals:6,address:"0x79A8FFFCED130314eCC8782C846c4d8d4867A900",original:"Sei"}],["WKLAY",{symbol:"WKLAY",decimals:18,address:"0x79D34FDb686B5D139949E4F92D83EEe376489176",original:"Klaytn"}]]],["Avalanche",[["WETH",{symbol:"WETH",decimals:18,address:"0xbB5A2dC896Ec4E2fa77F40FA630582ed9c6D0172",original:"Ethereum"}],["USDCeth",{symbol:"USDC",decimals:6,address:"0x63A30f239DC8d1c17Bf6653a68Fc6C2F83641E6d",original:"Ethereum"}],["DAI",{symbol:"DAI",decimals:18,address:"0x3989C9c4bdd30400E6Aa90990683EAd6a1638A16",original:"Ethereum"}],["WMATIC",{symbol:"WMATIC",decimals:18,address:"0x78554394273957d7e55afC841aeA27Cce469AEd4",original:"Polygon"}],["WBNB",{symbol:"WBNB",decimals:18,address:"0x10F1053bF2884b28ee0Bd7a2dDBa237Af3511d29",original:"Bsc"}],["AVAX",{symbol:"AVAX",decimals:18,address:"native",wrappedKey:"WAVAX"}],["WAVAX",{symbol:"WAVAX",decimals:18,address:"0xd00ae08403B9bbb9124bB305C09058E32C39A48c"}],["USDCavax",{symbol:"USDC",decimals:6,address:"0x5425890298aed601595a70AB815c96711a31Bc65"}],["WFTM",{symbol:"WFTM",decimals:18,address:"0x094cB577C21Ab1360178beE74B9591fa12216dAD",original:"Fantom"}],["CELO",{symbol:"CELO",decimals:18,address:"0xC66d9c2b33c347d4A4441975f4688fcD5DD4c441",original:"Celo"}],["WGLMR",{symbol:"WGLMR",decimals:18,address:"0xf080782DF38eD5228D2FC2882d13D56c8f1D6f21",original:"Moonbeam"}],["WSOL",{symbol:"WSOL",decimals:9,address:"0xb10563644a6AB8948ee6d7f5b0a1fb15AaEa1E03",original:"Solana"}],["SUI",{symbol:"SUI",decimals:9,address:"0xfc5128F8556a6F059466E67740e6cC31EE5C2C47",original:"Sui"}],["APT",{symbol:"APT",decimals:8,address:"0x996a3f12C1FcD7339Ea8801f629201e4d42EAD04",original:"Aptos"}],["WETHarbitrum",{symbol:"WETH",decimals:18,address:"0x36Bd1562F874941eE62Ebb2b3A45B4A88A9df90e",original:"Arbitrum"}],["WETHoptimism",{symbol:"WETH",decimals:18,address:"0x301587BF484756441de43E522027e3751871237B",original:"Optimism"}],["WETHbase",{symbol:"WETH",decimals:18,address:"0xc07c754ef7473d315D973F7D9F7858C2eCe0a0a6",original:"Base"}],["tBTC",{symbol:"tBTC",decimals:18,address:"0x7E1779F65B644E5f98DdC4D2cB0A0106a7E6d9e1",original:"Ethereum"}],["tBTCarbitrum",{symbol:"tBTC",decimals:18,address:"0x4beDc7471374d7479120E44ea9593eBB85f48AD9",original:"Arbitrum"}],["SEI",{symbol:"SEI",decimals:6,address:"0xfe2eCDD1708aaebf1cF802C6124fAFb18B22dfEE",original:"Sei"}]]],["Fantom",[["WETH",{symbol:"WETH",decimals:18,address:"0x758FEebDDeC06f4bCcEc8F756C8efBD35d5b7124",original:"Ethereum"}],["USDCeth",{symbol:"USDC",decimals:6,address:"0xDF7928AF5B33F7de592594958D8d6Ff8472Eb407",original:"Ethereum"}],["USDT",{symbol:"USDT",decimals:6,address:"0x32eF19C4b3DF65a24972A489e70AdDef5E54262C",original:"Ethereum"}],["DAI",{symbol:"DAI",decimals:18,address:"0xE4FE5DF2084f9D81595e4fcba2399020FBE7b233",original:"Ethereum"}],["WMATIC",{symbol:"WMATIC",decimals:18,address:"0x47a4C4c0f96D6CBe5b5C0A46CB0E22d6A17F1430",original:"Polygon"}],["WBNB",{symbol:"WBNB",decimals:18,address:"0xfB174b43228950C2055CFc25AE93f2DCe8E2beF0",original:"Bsc"}],["WAVAX",{symbol:"WAVAX",decimals:18,address:"0x0f545Be981C37fB15ab7c65404648761e99016e4",original:"Avalanche"}],["USDCavax",{symbol:"USDC",decimals:6,address:"0x6BC4E8D8c1d54656D1DeBCa96efc53aFd1408aD2",original:"Avalanche"}],["FTM",{symbol:"FTM",decimals:18,address:"native",wrappedKey:"WFTM"}],["WFTM",{symbol:"WFTM",decimals:18,address:"0xf1277d1Ed8AD466beddF92ef448A132661956621"}],["CELO",{symbol:"CELO",decimals:18,address:"0xB18E73a69c3Aaea39a610372537Cf8482622d199",original:"Celo"}],["WGLMR",{symbol:"WGLMR",decimals:18,address:"0x41E3CFDFC255A4bF3C8D3560Bc8D3D9b5080338e",original:"Moonbeam"}],["WSOL",{symbol:"WSOL",decimals:9,address:"0xED1a08Fc69A7008d225890A96aaE258c465CC7ad",original:"Solana"}],["SUI",{symbol:"SUI",decimals:9,address:"0xd882AB49372eC093E8697B5153f54ab5e7738e3b",original:"Sui"}],["APT",{symbol:"APT",decimals:8,address:"0xAb2297E8994149BA91737944E40891881aF762a4",original:"Aptos"}],["WETHarbitrum",{symbol:"WETH",decimals:18,address:"0x456e08952f9091B6c268dC0cECad53d141152C59",original:"Arbitrum"}],["USDCoptimism",{symbol:"USDC",decimals:6,address:"0x685B29e17440c42758Ab3F80FD3603EF01bebe9A",original:"Optimism"}],["WETHbase",{symbol:"WETH",decimals:18,address:"0x01950A33DfFa63E6Bc23b5dB440505581A4cc0e7",original:"Base"}],["tBTC",{symbol:"tBTC",decimals:18,address:"0x66E080407407620844fE2083c33108BE55E087bc",original:"Ethereum"}],["SEI",{symbol:"SEI",decimals:6,address:"0x832e8050D6c64724500DE9B0ffe1CAc6c570a26d",original:"Sei"}]]],["Celo",[["WETH",{symbol:"WETH",decimals:18,address:"0x898471a82737dFFfB61915F9e8381e279076D72b",original:"Ethereum"}],["USDCeth",{symbol:"USDC",decimals:6,address:"0xB0524bEF6c61c6150B340b2828a890fD8dEa60C0",original:"Ethereum"}],["DAI",{symbol:"DAI",decimals:18,address:"0xeBB3fF6E5d61d3793Fdb60f7942BA78E636019f6",original:"Ethereum"}],["WMATIC",{symbol:"WMATIC",decimals:18,address:"0x7a56409988BBF8758b3ba412b9c7E3FE504C8544",original:"Polygon"}],["WBNB",{symbol:"WBNB",decimals:18,address:"0xa8050be9389466c3c524F10F131f244ACbf21A0D",original:"Bsc"}],["WAVAX",{symbol:"WAVAX",decimals:18,address:"0x502c8C83008D9Dd812a7C5fB886C063060C73Dbf",original:"Avalanche"}],["USDCavax",{symbol:"USDC",decimals:6,address:"0xDDB349c976cA2C873644F21f594767Eb5390C831",original:"Avalanche"}],["WFTM",{symbol:"WFTM",decimals:18,address:"0xE6F8710cA14CFe7F5aAAD3A799C3d1D92dCba938",original:"Fantom"}],["CELO",{symbol:"CELO",decimals:18,address:"0xF194afDf50B03e69Bd7D057c1Aa9e10c9954E4C9"}],["WGLMR",{symbol:"WGLMR",decimals:18,address:"0x132D2172D89cd9CfD480A8887c6bF92360fB460e",original:"Moonbeam"}],["WSOL",{symbol:"WSOL",decimals:9,address:"0x05EEF2AE1A7A938D78598F7d9e8b97A9bED0c9eC",original:"Solana"}],["SUI",{symbol:"SUI",decimals:9,address:"0xa40d9E69ca9867C4bFbeC11Ce79C939991e9bf26",original:"Sui"}],["APT",{symbol:"APT",decimals:8,address:"0xAC0a2fF7DD597de863878a3372142b07B614C125",original:"Aptos"}],["USDCarbitrum",{symbol:"USDC",decimals:6,address:"0x0C4AbF95Ff3d82d1F02f55e65050eA5bA062606E",original:"Arbitrum"}],["WETHoptimism",{symbol:"WETH",decimals:18,address:"0x28E768a51D19dcB753a24B79D1e89c92fee094Ba",original:"Optimism"}],["tBTC",{symbol:"tBTC",decimals:18,address:"0x01a050Fc725F4E99aAD43Eb6f8481f38ee6231aD",original:"Ethereum"}],["SEI",{symbol:"SEI",decimals:6,address:"0x05Efb4aC79ef48a4830f517834c6f5f039F16832",original:"Sei"}]]],["Moonbeam",[["WETH",{symbol:"WETH",decimals:18,address:"0xd27d8883E31FAA11B2613b14BE83ad8951C8783C",original:"Ethereum"}],["USDCeth",{symbol:"USDC",decimals:6,address:"0xE5dE10C4b744bac6b783fAF8d9B9fDFF14Acc3c9",original:"Ethereum"}],["USDT",{symbol:"USDT",decimals:6,address:"0x7f5Ca1bcFb38fDF4c0E0646FCbf3FA87740ff65D",original:"Ethereum"}],["DAI",{symbol:"DAI",decimals:18,address:"0xc31EC0108D8e886be58808B4C2C53f8365f1885D",original:"Ethereum"}],["WMATIC",{symbol:"WMATIC",decimals:18,address:"0xD2888f015BcB76CE3d27b6024cdEFA16836d0dbb",original:"Polygon"}],["WBNB",{symbol:"WBNB",decimals:18,address:"0x6097E80331B0c6aF4F74D7F2363E70Cb2Fd078A5",original:"Bsc"}],["WAVAX",{symbol:"WAVAX",decimals:18,address:"0x2E8afeCC19842229358f3650cc3F091908dcbaB4",original:"Avalanche"}],["USDCavax",{symbol:"USDC",decimals:6,address:"0x6533CE14804D113b1F494dC56c5D60A43cb5C3b5",original:"Avalanche"}],["WFTM",{symbol:"WFTM",decimals:18,address:"0x566c1cebc6A4AFa1C122E039C4BEBe77043148Ee",original:"Fantom"}],["CELO",{symbol:"CELO",decimals:18,address:"0x3406a9b09adf0cb36DC04c1523C4b294C6b79513",original:"Celo"}],["GLMR",{symbol:"GLMR",decimals:18,address:"native",wrappedKey:"WGLMR"}],["WGLMR",{symbol:"WGLMR",decimals:18,address:"0xD909178CC99d318e4D46e7E66a972955859670E1"}],["SUI",{symbol:"SUI",decimals:9,address:"0x2ed4B5B1071A3C676664E9085C0e3826542C1b27",original:"Sui"}],["APT",{symbol:"APT",decimals:8,address:"0xCaa2A1d3BbbA0D1466571e83b4E2CbE04252593D",original:"Aptos"}],["WETHarbitrum",{symbol:"WETH",decimals:18,address:"0x15025b956969DD8F1d0CD69959Ad97128F8f6D69",original:"Arbitrum"}],["USDCoptimism",{symbol:"USDC",decimals:6,address:"0xf98E630a3DD4F21Cab7a37Bb01209cb62959169D",original:"Optimism"}],["USDCbase",{symbol:"USDC",decimals:6,address:"0x7480641F5B00b4Fc39d6AaeC4Cd851EdEA7f31CF",original:"Base"}],["tBTC",{symbol:"tBTC",decimals:18,address:"0xf82E21cE03471983Afb9c2E3789Aa13a2d7242E8",original:"Ethereum"}],["SEI",{symbol:"SEI",decimals:6,address:"0x1EdDe35B7e058194B457B8621285EaFA710f01ea",original:"Sei"}]]],["Solana",[["WETH",{symbol:"WETH",decimals:8,address:"7VPWjBhCXrpYYBiRKZh1ubh9tLZZNkZGp2ReRphEV4Mc",original:"Ethereum"}],["USDCeth",{symbol:"USDC",decimals:6,address:"2BAqec7Qof3Y7VJatwFsRHUNSQBSkzaEsT1V5bW6dbZY",original:"Ethereum"}],["DAI",{symbol:"DAI",decimals:8,address:"3WK3mEDNPrNuQReBvM28NcsqrExMnPxD9pPJmgrUeKKH",original:"Ethereum"}],["WMATIC",{symbol:"WMATIC",decimals:8,address:"ACbmcQxbbhiXWM1GmapUSMmBYKMvnFLfAAXKqdo8xKwo",original:"Polygon"}],["WBNB",{symbol:"WBNB",decimals:8,address:"BaGfF51MQ3a61papTRDYaNefBgTQ9ywnVne5fCff4bxT",original:"Bsc"}],["WAVAX",{symbol:"WAVAX",decimals:8,address:"3Ftc5hTz9sG4huk79onufGiebJNDMZNL8HYgdMJ9E7JR",original:"Avalanche"}],["USDCavax",{symbol:"USDC",decimals:6,address:"GQtMXZxnuacCFTXVeTvyHi6P9F6chbtzhVc8JgD8hv7c",original:"Avalanche"}],["WFTM",{symbol:"WFTM",decimals:8,address:"DMw2tLaq1bVoAEKtkoUtieSk9bfCPUvubYLatTMsSVop",original:"Fantom"}],["CELO",{symbol:"CELO",decimals:8,address:"84F2QX9278ToDmA98u4A86xSV9hz1ovazr8zwGaX6qjS",original:"Celo"}],["WGLMR",{symbol:"WGLMR",decimals:8,address:"8987WGkYa5viiZ9DD8sS3PB5XghKmWjkEgmzvwDuoAEc",original:"Moonbeam"}],["SOL",{symbol:"SOL",decimals:9,address:"native",wrappedKey:"WSOL"}],["WSOL",{symbol:"WSOL",decimals:9,address:"So11111111111111111111111111111111111111112"}],["USDCsol",{symbol:"USDC",decimals:6,address:"4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU"}],["SUI",{symbol:"SUI",decimals:8,address:"BJZ72CjPQojVoH68mzrd4VQ4nr6KuhbAGnhZEZCujKxY",original:"Sui"}],["APT",{symbol:"APT",decimals:8,address:"7EvFD3JKCJVdtkAYdaSVKJsrPEJCzy2neJha7TREGrCa",original:"Aptos"}],["WETHbase",{symbol:"WETH",decimals:8,address:"EKZqcBZ3Y7YTDinpecA7SxRp9B4s1m99VHJ9jpvyTwzW",original:"Base"}],["tBTC",{symbol:"tBTC",decimals:8,address:"FMYvcyMJJ22whB9m3T5g1oPKwM6jpLnFBXnrY6eXmCrp",original:"Ethereum"}],["tBTCoptimism",{symbol:"tBTC",decimals:8,address:"HsPvRT3J7kuitNvNHogyZeSEagcqAqwwq2FPgrGfgApy",original:"Optimism"}],["tBTCsol",{symbol:"tBTC",decimals:8,address:"6DNSN2BJsaPFdFFc1zP37kkeNe4Usc1Sqkzr9C9vPWcU"}],["SEI",{symbol:"SEI",decimals:6,address:"8LFdfuhbfdH8oBzSKDgfPAxvLW24dCM9ttjBrBobURuk",original:"Sei"}]]],["Sui",[["WETH",{symbol:"WETH",decimals:8,address:"0x72831f626b1f0e11be201893d5cb641917730b1ccac778e4a77f8ab2052f0784::coin::COIN",original:"Ethereum"}],["USDCeth",{symbol:"USDC",decimals:6,address:"0x9e4396c19ec1c5f2214c79d3af3f31e59869640305560f8f2499c36fa9c8e0f2::coin::COIN",original:"Ethereum"}],["DAI",{symbol:"DAI",decimals:8,address:"0xe6fc78aa2b52b785bdcb67901cd85793a0b593248f315cb755974d23d0fcb837::coin::COIN",original:"Ethereum"}],["WMATIC",{symbol:"WMATIC",decimals:8,address:"0xa516bcbf83b29a2944bb53ec9f934ea7d78c3626d3ae411d2fb9dcb977522e67::coin::COIN",original:"Polygon"}],["WBNB",{symbol:"WBNB",decimals:8,address:"0xddcf8680a8a4b8a527d8c85ec203274991590c2ea898d1c4635b70164d9c584b::coin::COIN",original:"Bsc"}],["WAVAX",{symbol:"WAVAX",decimals:8,address:"0xa600741c469fb57ed01497ddf101e798fa79a9c529bd176675c5c4d970811f80::coin::COIN",original:"Avalanche"}],["USDCavax",{symbol:"USDC",decimals:6,address:"0x2aa8c885d04e676c4e87b7d0f94d4f3b243b1b5d93239d1cc41d5528ce1714c1::coin::COIN",original:"Avalanche"}],["WFTM",{symbol:"WFTM",decimals:8,address:"0x14e756ff65e0ac810a5f69ca5276ef5b899a6df3c4717de1f85559d8b5ae6ea6::coin::COIN",original:"Fantom"}],["CELO",{symbol:"CELO",decimals:8,address:"0x81868174a6b11e1acc337b3414f9912455435d486609fb8d50b34312865085f2::coin::COIN",original:"Celo"}],["WGLMR",{symbol:"WGLMR",decimals:8,address:"0xeffae382de96981f7ddd2d294429924827e8f325d612487a12d6a0b249171002::coin::COIN",original:"Moonbeam"}],["WSOL",{symbol:"WSOL",decimals:8,address:"0xbc03aaab4c11eb84df8bf39fdc714fa5d5b65b16eb7d155e22c74a68c8d4e17f::coin::COIN",original:"Solana"}],["SUI",{symbol:"SUI",decimals:9,address:"0x2::sui::SUI"}],["APT",{symbol:"APT",decimals:8,address:"0x812d6feb8b84e55d47a0bfcae9fb6a4e7e09be5ec86ce0a729e0f67d5f59f477::coin::COIN",original:"Aptos"}],["USDCoptimism",{symbol:"USDC",decimals:6,address:"0xbbc39df58a11072ceeac1f685393ca912d1a1bfd6e772053ec5a544f36124da::coin::COIN",original:"Optimism"}],["WETHbase",{symbol:"WETH",decimals:8,address:"0x7b442b988864149dedfb9b6a75a88c7c33b9ddd3d15a87bf25104e1fcdd680ab::coin::COIN",original:"Base"}],["USDCbase",{symbol:"USDC",decimals:6,address:"0x4125940814a0ca87465a1a59092a7344633ad03b48ad7cda36d799d8558012c1::coin::COIN",original:"Base"}],["tBTC",{symbol:"tBTC",decimals:8,address:"0xacf6784120b221a077ab0b84acc0b76930779eb55f157ea2492be4a60b808f6::coin::COIN",original:"Ethereum"}],["SEI",{symbol:"SEI",decimals:6,address:"0x22c5cdaabaae4b6d3351f9bba9511b0aebb0662a6c209a360f0776e1e77a8438::coin::COIN",original:"Sei"}]]],["Aptos",[["WETH",{symbol:"WETH",decimals:8,address:"0x381775005cb32cdd3dbf935ae1b978ed40d309c72b009cd4a812aab6d991418a::coin::T",original:"Ethereum"}],["WMATIC",{symbol:"WMATIC",decimals:8,address:"0x5f229253e2b2d03fb909f565feca49452582bd633a5816e5ce30aa593cb49d8a::coin::T",original:"Polygon"}],["WBNB",{symbol:"WBNB",decimals:8,address:"0xa5894f5ddb8647e6143102aa336ff07374f7b32e88c1c703aef5b7c9a370bf80::coin::T",original:"Bsc"}],["WAVAX",{symbol:"WAVAX",decimals:8,address:"0xbe8f4301c0b54e870902b9a23eeb95ce74ac190531782aa3262337ceb145401a::coin::T",original:"Avalanche"}],["USDCavax",{symbol:"USDC",decimals:6,address:"0x02ef7697bdb33361ca39d228671203afc0dea3202e792d79d2072b761d87c834::coin::T",original:"Avalanche"}],["WFTM",{symbol:"WFTM",decimals:8,address:"0x533c6ade00d15d1e014c41e29e34853e87df92c4e01a6a3f41318dbd098048d6::coin::T",original:"Fantom"}],["CELO",{symbol:"CELO",decimals:8,address:"0xecbb0f7e7d049499ca83ca1358344f56557886f6f7adc740d6734cce7bfc9a14::coin::T",original:"Celo"}],["WGLMR",{symbol:"WGLMR",decimals:8,address:"0x338373b6694f71dbeac5ca4a30503bf5f083888d71678aed31255de416be37c0::coin::T",original:"Moonbeam"}],["WSOL",{symbol:"WSOL",decimals:8,address:"0xdd89c0e695df0692205912fb69fc290418bed0dbe6e4573d744a6d5e6bab6c13::coin::T",original:"Solana"}],["SUI",{symbol:"SUI",decimals:8,address:"0x7b22d0e02f653d4fd1caddcfa4719a2b329da56eb81d8f27db703f02466c26a5::coin::T",original:"Sui"}],["APT",{symbol:"APT",decimals:8,address:"0x1::aptos_coin::AptosCoin"}],["USDCarbitrum",{symbol:"USDC",decimals:6,address:"0x3f0fdd44d96dae888d6c576218cf655458316a27c7bdc46537f61e531b10d3df::coin::T",original:"Arbitrum"}],["USDCoptimism",{symbol:"USDC",decimals:6,address:"0xcff1d9820851201436ad225dcc4374a2d15f52a74109283eb9881be799677e92::coin::T",original:"Optimism"}],["WETHbase",{symbol:"WETH",decimals:8,address:"0x5b5f14781164cf77185a7b6acd8e4f3cbb7e7cfb1cd5760d2b8af81075fc153d::coin::T",original:"Base"}],["USDCbase",{symbol:"USDC",decimals:6,address:"0xcfaabb3cb08ad612905dd6b2593d044ce857dfe5360148333b4635fb57d4d13f::coin::T",original:"Base"}],["tBTC",{symbol:"tBTC",decimals:8,address:"0x6e2d5d1a6d6d0e0c5db506ce64ead0530847a48b96516abbb08cdebe43fe3036::coin::T",original:"Ethereum"}],["SEI",{symbol:"SEI",decimals:6,address:"0xcae0ba0b7a435730ab65f1c8357d213e5cf9d4b377b96761745a8edaf9c9df6d::coin::T",original:"Sei"}]]],["Base",[["WETH",{symbol:"WETH",decimals:18,address:"0x44D627f900da8AdaC7561bD73aA745F132450798",original:"Ethereum"}],["USDCeth",{symbol:"USDC",decimals:6,address:"0x5010B0988a035915C91a2a432085824FcB3D8d3f",original:"Ethereum"}],["DAI",{symbol:"DAI",decimals:18,address:"0x31B2BAEE47Dc5Fc06baEC1BF73C124031b44fB97",original:"Ethereum"}],["WMATIC",{symbol:"WMATIC",decimals:18,address:"0xFFB5d863d5132523d013338845A1Bb01EDd440f4",original:"Polygon"}],["WBNB",{symbol:"WBNB",decimals:18,address:"0x9DeF11E63C23c71dE3716b81dD2Fdad2B24b8b7F",original:"Bsc"}],["WAVAX",{symbol:"WAVAX",decimals:18,address:"0x410B0EE532EFfB18fa4d90cc095B1CD58aC43d5a",original:"Avalanche"}],["USDCavax",{symbol:"USDC",decimals:6,address:"0x4C5208246676486064c501E1DAF2dD21596Bc5f5",original:"Avalanche"}],["WFTM",{symbol:"WFTM",decimals:18,address:"0xB4808E58713112AbAbB8167C7187F8988df38bbD",original:"Fantom"}],["CELO",{symbol:"CELO",decimals:18,address:"0x72C56041ea5fe8bDE99b2A123fb5964cDE8C7FE9",original:"Celo"}],["WGLMR",{symbol:"WGLMR",decimals:18,address:"0xCEc03b5710a464F4354AF35ebD0310238F656DFf",original:"Moonbeam"}],["WSOL",{symbol:"WSOL",decimals:9,address:"0x6Fb1dE2372e48fe66c84cf37cc2fb54EaEe62988",original:"Solana"}],["SUI",{symbol:"SUI",decimals:9,address:"0xEe0fC8BECD593B41AACBd93936fDAbc2A444370A",original:"Sui"}],["APT",{symbol:"APT",decimals:8,address:"0xd934A15FfA3945DD0Ba2cb7b4174024261A14874",original:"Aptos"}],["WETHarbitrum",{symbol:"WETH",decimals:18,address:"0x8eD43aBdc4f836aa60933177B31AC358ea09f27E",original:"Arbitrum"}],["WETHoptimism",{symbol:"WETH",decimals:18,address:"0x5c443C05C72F0660502d88642c807020cc9b71A2",original:"Optimism"}],["ETHbase",{symbol:"ETH",decimals:18,address:"native",wrappedKey:"WETHbase"}],["WETHbase",{symbol:"WETH",decimals:18,address:"0x4200000000000000000000000000000000000006"}],["USDCbase",{symbol:"USDC",decimals:6,address:"0xf175520c52418dfe19c8098071a252da48cd1c19"}],["tBTC",{symbol:"tBTC",decimals:18,address:"0x0219441240d89fAc3fD708d06d8fD3A072C02FB6",original:"Ethereum"}],["tBTCbase",{symbol:"tBTC",decimals:18,address:"0x783349cd20f26CE12e747b1a17bC38D252c9e119"}],["tBTCsol",{symbol:"tBTC",decimals:8,address:"0x9dA16Ae62De05bcb4606c4BFbB54046872501Bd0",original:"Solana"}],["SEI",{symbol:"SEI",decimals:6,address:"0x7B5edB2B3d2BeA8057a736B82AC6EF35c70bdadD",original:"Sei"}]]],["Sei",[["WETH",{symbol:"WETH",decimals:8,address:"sei13pzlt9etk44hj22lckncvampq2qu2gxv6r6774f3hma4vc07wqgsmftjx7",original:"Ethereum"}],["USDCeth",{symbol:"USDC",decimals:6,address:"sei1nj32y0h0vzam33ay42h2majlfk7tdkqcuk84srn0v2a52kmujgfsyfe78f",original:"Ethereum"}],["WMATIC",{symbol:"WMATIC",decimals:8,address:"sei1dc94as3vgxn3qkr5h0lnnrep69mtfku6jg4t94gfkunuyzr5g5eqyqvj9p",original:"Polygon"}],["WBNB",{symbol:"WBNB",decimals:8,address:"sei10a7see3f9t2j9l8fdweur3aqy4zgvz583a268hhhln3yzps6l5mqnl4ua6",original:"Bsc"}],["WAVAX",{symbol:"WAVAX",decimals:8,address:"sei1mgpq67pj7p2acy5x7r5lz7fulxmuxr3uh5f0szyvqgvru3glufzsxk8tnx",original:"Avalanche"}],["USDCavax",{symbol:"USDC",decimals:6,address:"sei1uyce5s6cc8hveg0maq2lg7wm6v6fvwqmznypj559nzf9wr9tmw3qnd3ce7",original:"Avalanche"}],["WFTM",{symbol:"WFTM",decimals:8,address:"sei1cr3j7rxq0dhq04ksftmj8n2w096w9g7ck8fngkvk2lrmy3qwz56q9thu9u",original:"Fantom"}],["CELO",{symbol:"CELO",decimals:8,address:"sei1yw4wv2zqg9xkn67zvq3azye0t8h0x9kgyg3d53jym24gxt49vdyswk5upj",original:"Celo"}],["WGLMR",{symbol:"WGLMR",decimals:8,address:"sei140m6xagmw0zesejzhsvk46zprgscr7tu94h36rwsutcsxcs4fmds9sevym",original:"Moonbeam"}],["WSOL",{symbol:"WSOL",decimals:8,address:"sei1at3xuugacwgu3ppx7fxzmtr3q6m3ztjuean9r2mwcnqupw28yezs7unxgz",original:"Solana"}],["SUI",{symbol:"SUI",decimals:8,address:"sei1rhpcprr2pffe6ydf078a0qeslhnlywxh2t3wjax4489z0m29cj9swj5khc",original:"Sui"}],["APT",{symbol:"APT",decimals:8,address:"sei1em74y5sts4h8y5zuhfdn4w5g8zs285qld3kczpk6rh32jpvjyqqsvv0pdt",original:"Aptos"}],["WETHarbitrum",{symbol:"WETH",decimals:8,address:"sei1pf5j3dgngm8yj2xkwmvmvt87g4vyc0szpjz92q8ly9erh23ytn4s983htv",original:"Arbitrum"}],["WETHbase",{symbol:"WETH",decimals:8,address:"sei1kdqylzcv86t7slg8m30mlfgna9xsrusghdgnavvurkv0rku7jvqqta7lka",original:"Base"}],["USDCbase",{symbol:"USDC",decimals:6,address:"sei1lf6ghmrkd7gn5jlj6xw64suycpjy7g4s5q92fc2gef4f8q3znanq95mmgv",original:"Base"}],["tBTCsol",{symbol:"tBTC",decimals:8,address:"sei1aj3uu9ejt8fk6rpjfhzluqnzqmv3enlndjmt8llkr7dn2dtz55xst4s3mn",original:"Solana"}],["SEI",{symbol:"SEI",decimals:6,address:"usei"}]]],["Arbitrum",[["WETH",{symbol:"WETH",decimals:18,address:"0x285d75E04D78F53f4Ed29A506a7e8479EEf3035f",original:"Ethereum"}],["USDCeth",{symbol:"USDC",decimals:6,address:"0x42A212A2E7eA8feF4ED28F439F16A6ABDd34DA35",original:"Ethereum"}],["USDT",{symbol:"USDT",decimals:6,address:"0x2B732F5ad6117818Ad3b7aC73C16033F6ECD78E5",original:"Ethereum"}],["WMATIC",{symbol:"WMATIC",decimals:18,address:"0x50FD4064cC536a964E2E0Dc7B3fE2313Ab386bEA",original:"Polygon"}],["WBNB",{symbol:"WBNB",decimals:18,address:"0xB039aC4Fa8Ed99d30C2f7D791294A9d5FAd698eF",original:"Bsc"}],["WAVAX",{symbol:"WAVAX",decimals:18,address:"0x92b0C4D27a05921Ded4BB117755990F567aEe049",original:"Avalanche"}],["USDCavax",{symbol:"USDC",decimals:6,address:"0xb39697B8BA5df91A169690DfEf88B911436619F2",original:"Avalanche"}],["WFTM",{symbol:"WFTM",decimals:18,address:"0xa507f7566B8aDE000E886166B95964677ef3b3Ef",original:"Fantom"}],["CELO",{symbol:"CELO",decimals:18,address:"0x9592eE6eD1D9E611b7aa6F20CCbD7Ba571Be8bdd",original:"Celo"}],["WSOL",{symbol:"WSOL",decimals:9,address:"0xF8cbdc4E54281b801f182039c250Ad6d13818250",original:"Solana"}],["SUI",{symbol:"SUI",decimals:9,address:"0xe64e2139fdf6Ee7e3795FE51955e21bA3d9eB9F7",original:"Sui"}],["APT",{symbol:"APT",decimals:8,address:"0xa81C3BEf2d6f10213b860458DC119666C0ba13bf",original:"Aptos"}],["ETHarbitrum",{symbol:"ETH",decimals:18,address:"native",wrappedKey:"WETHarbitrum"}],["WETHarbitrum",{symbol:"WETH",decimals:18,address:"0xee01c0cd76354c383b8c7b4e65ea88d00b06f36f"}],["USDCarbitrum",{symbol:"USDC",decimals:6,address:"0xfd064A18f3BF249cf1f87FC203E90D8f650f2d63"}],["WETHoptimism",{symbol:"WETH",decimals:18,address:"0xFd903eA23Bf65f26FdAf2eeb589cf007b108882E",original:"Optimism"}],["WETHbase",{symbol:"WETH",decimals:18,address:"0xbC4CB3CD7186fD457C072298C48d0eDf7213CAEa",original:"Base"}],["tBTC",{symbol:"tBTC",decimals:18,address:"0x97B5fE27a82b2B187D9a19C5782d9eB93B82DaC3",original:"Ethereum"}],["tBTCarbitrum",{symbol:"tBTC",decimals:18,address:"0x85727F4725A4B2834e00Db1AA8e1b843a188162F"}],["tBTCsol",{symbol:"tBTC",decimals:8,address:"0x227115F659f7c2939D23FedE68583F5291c395A6",original:"Solana"}],["SEI",{symbol:"SEI",decimals:6,address:"0x90eC817A1f7C1Eb18dD2985C534A78dD88747F47",original:"Sei"}]]],["Optimism",[["WETH",{symbol:"WETH",decimals:18,address:"0x33Db338718aC89Cd8DB13B56af05be3a3029BBE5",original:"Ethereum"}],["USDCeth",{symbol:"USDC",decimals:6,address:"0x0382F518AcE1a86224c78B7CDfa67B9774055A1b",original:"Ethereum"}],["WMATIC",{symbol:"WMATIC",decimals:18,address:"0x427B5a0b0384D7FD3AF81805A166a2d9C1116D7d",original:"Polygon"}],["WFTM",{symbol:"WFTM",decimals:18,address:"0x81BA80f5820273AA965086e710042d737993f12c",original:"Fantom"}],["WGLMR",{symbol:"WGLMR",decimals:18,address:"0x99436d62259532E0407A7aE78A3b48D119B13903",original:"Moonbeam"}],["WSOL",{symbol:"WSOL",decimals:9,address:"0x06EcAF6638070Ccf3b3dEA421b3becAA57f3e559",original:"Solana"}],["ETHoptimism",{symbol:"ETH",decimals:18,address:"native",wrappedKey:"WETHoptimism"}],["WETHoptimism",{symbol:"WETH",decimals:18,address:"0x4200000000000000000000000000000000000006"}],["USDCoptimism",{symbol:"USDC",decimals:6,address:"0xe05606174bac4A6364B31bd0eCA4bf4dD368f8C6"}],["WETHbase",{symbol:"WETH",decimals:18,address:"0x04b559971c90Dfb12D9795E95883e55f2fcf34Ed",original:"Base"}],["tBTC",{symbol:"tBTC",decimals:18,address:"0x5D89a5BcB86F15a2CCAb05e7E3bEE23fDF246a64",original:"Ethereum"}],["tBTCpolygon",{symbol:"tBTC",decimals:18,address:"0xE04e0F5f2C6ce45A40482C3AB92CA91D6741D717",original:"Polygon"}],["tBTCoptimism",{symbol:"tBTC",decimals:18,address:"0x1a53759DE2eADf73bd0b05c07a4F1F5B7912dA3d"}],["SEI",{symbol:"SEI",decimals:6,address:"0xE12be3D96fE101246bF2d290184B0eC6D35d02CA",original:"Sei"}]]],["Wormchain",[["WETH",{symbol:"WETH",decimals:8,address:"wormhole1vguuxez2h5ekltfj9gjd62fs5k4rl2zy5hfrncasykzw08rezpfs63pmq2",original:"Ethereum"}],["USDCeth",{symbol:"USDC",decimals:6,address:"wormhole1rl8su3hadqqq2v86lscpuklsh2mh84cxqvjdew4jt9yd07dzekyqkmcy3p",original:"Ethereum"}],["USDT",{symbol:"USDT",decimals:6,address:"wormhole1v2efcqkp2qtev06t0ksjnx6trxdd0f7fxg2zdrtzr8cr9wdpjkyqkv9ch6",original:"Ethereum"}],["DAI",{symbol:"DAI",decimals:8,address:"wormhole1uuwad4khwek2h05gmkktzmh8l4t0ep54yydlsqg0l4y2uh3tqfyq3an9k6",original:"Ethereum"}],["WMATIC",{symbol:"WMATIC",decimals:8,address:"wormhole1vhjnzk9ly03dugffvzfcwgry4dgc8x0sv0nqqtfxj3ajn7rn5ghq6whn2p",original:"Polygon"}],["WBNB",{symbol:"WBNB",decimals:8,address:"wormhole1335rlmhujm0gj5e9gh7at9jpqvqckz0mpe4v284ar4lw5mlkryzsnetfsj",original:"Bsc"}],["WAVAX",{symbol:"WAVAX",decimals:8,address:"wormhole1tqwwyth34550lg2437m05mjnjp8w7h5ka7m70jtzpxn4uh2ktsmq8dv649",original:"Avalanche"}],["USDCavax",{symbol:"USDC",decimals:6,address:"wormhole1qum2tr7hh4y7ruzew68c64myjec0dq2s2njf6waja5t0w879lutqv2exs9",original:"Avalanche"}],["WFTM",{symbol:"WFTM",decimals:8,address:"wormhole1808lz8dp2c39vhm9gnemt7zzj95nvrmjepxp7v3w4skzrlyzcmnsxkduxf",original:"Fantom"}],["CELO",{symbol:"CELO",decimals:8,address:"wormhole1e8z2wjelypwxw5sey62jvwjyup88w55q3h6m0x8jtwjf6sx5c7ys4mzydk",original:"Celo"}],["WGLMR",{symbol:"WGLMR",decimals:8,address:"wormhole10sfpr8ykh9xn93u8xec4ed3990nmvh86e0vaegkauqhlkxspysyqwavrxx",original:"Moonbeam"}],["WSOL",{symbol:"WSOL",decimals:8,address:"wormhole1gryz69gzl6mz2m66a4twg922jtlc47nlx73sxv88lvq86du5zvyqz3mt23",original:"Solana"}],["USDCsol",{symbol:"USDC",decimals:6,address:"wormhole1ced9v4plkf25q8c6k9gz0guq6l4xyjujpjlvxfg8lpaqywkmamashswq7p",original:"Solana"}],["SUI",{symbol:"SUI",decimals:8,address:"wormhole1yf4p93xu68j5fseupm4laj4k6f60gy7ynx6r5vvyr9c0hl3uy8vqpqd6h0",original:"Sui"}],["APT",{symbol:"APT",decimals:8,address:"wormhole1u8rft0gee23fa6a0t4t88ualrza5lj8ses4aur0l66c7efpvjezqchv34j",original:"Aptos"}],["WETHarbitrum",{symbol:"WETH",decimals:8,address:"wormhole186k0cp83c3wyvapgh8fxf66ededemzrfujvjfsx0xw3vr0u9g8sq2y30vx",original:"Arbitrum"}],["USDCarbitrum",{symbol:"USDC",decimals:6,address:"wormhole1s3pk90ccfl6ueehnj8s9pdgyjjlspmr3m5rv46arjh5v4g08dd0qrchjrk",original:"Arbitrum"}],["WETHoptimism",{symbol:"WETH",decimals:8,address:"wormhole12eu6c7f67l8gdl2lt0hz0dgdh24dhune6wjgy5t0es3tpfzhc3yspwnpfy",original:"Optimism"}],["USDCoptimism",{symbol:"USDC",decimals:6,address:"wormhole1u5z7097gm57zvun9wqsx6jxej2gpdjhg9l9xfe58rhpm29rtjmfqfnl4yv",original:"Optimism"}],["WETHbase",{symbol:"WETH",decimals:8,address:"wormhole10p89p4zh00dwdg8h52sysrqm0l2j47jj3kmg93pnz2a039ucw7esgl5vl9",original:"Base"}],["USDCbase",{symbol:"USDC",decimals:6,address:"wormhole1ja4txt6m0jjq0gmjtmv442f8wk0r5f5apaya0z55wwlrpg3p5xaq3qxw7h",original:"Base"}],["tBTCarbitrum",{symbol:"tBTC",decimals:8,address:"wormhole1rm8ztmk20lrd6ex8uqq3yu7a6eyfjwvg53pcuuj22ffe2y8r3yzqr8j4v9",original:"Arbitrum"}],["wstETH",{symbol:"wstETH",decimals:8,address:"wormhole1u2zdjcczjrenwmf57fmrpensk4the84azdm05m3unm387rm8asdsxqwfeu",original:"Ethereum"}]]],["Osmosis",[["WETH",{symbol:"WETH",decimals:8,address:"ibc/A4A8B6AE885DACD75B228031C0D18AD7EE1B914CED30C9F6F4230DDBD4A1CF2B",original:"Ethereum"}],["USDCeth",{symbol:"USDC",decimals:6,address:"ibc/3BB8C4BD1C90599B2FA5B5839DD0813EF7B94B0BD0904C4C5A61498AE81E0EE9",original:"Ethereum"}],["USDT",{symbol:"USDT",decimals:6,address:"ibc/1941ED1147121BA7DF35559597B6EB3251844DBBBE4557337D957CB95E0978C2",original:"Ethereum"}],["DAI",{symbol:"DAI",decimals:8,address:"ibc/2864B3418775DDB90EE1410EFF822FDA94E9F0FF77FC8771644761C79EDFE7A3",original:"Ethereum"}],["WMATIC",{symbol:"WMATIC",decimals:8,address:"ibc/43F15553F8598186394E81E18604B8B4532B2D7E855D9FFE68A2EF6802C18BE4",original:"Polygon"}],["WBNB",{symbol:"WBNB",decimals:8,address:"ibc/65A67BA10DE2378B32AC5A822321E370966D3D4E180DEFB4C3C5245B21088DDF",original:"Bsc"}],["WAVAX",{symbol:"WAVAX",decimals:8,address:"ibc/99EAD53D49EC7CC4E2E2EB26C22CF81C16727DF0C4BF7F7ACBF0D22D910DB5DE",original:"Avalanche"}],["USDCavax",{symbol:"USDC",decimals:6,address:"ibc/EC9FA5074F34F0644A025BB0263FDAE8F364C5E08523F6464465EF1010FF5A3A",original:"Avalanche"}],["WFTM",{symbol:"WFTM",decimals:8,address:"ibc/145C6B688F70B0C2F6D87546A5974A75CE75B3A2940275B750E65797B2996157",original:"Fantom"}],["CELO",{symbol:"CELO",decimals:8,address:"ibc/3A4EA3F8096856C0802F86B218DD74213B4C10224AA44BBD54AEAAA2ABF078BA",original:"Celo"}],["WGLMR",{symbol:"WGLMR",decimals:8,address:"ibc/7DB06BB67428510AFC3967DC90F5632C679D55D8C487A951A0EEC3160AF492A6",original:"Moonbeam"}],["WSOL",{symbol:"WSOL",decimals:8,address:"ibc/B5D53105A7AA2BEC4DA4B3304228F3856219AE7CF84A9023043C481629E3E319",original:"Solana"}],["USDCsol",{symbol:"USDC",decimals:6,address:"ibc/35A0467DE5744662078DE8B36CBBE0CF0EAA022565A3E6630CB375DDEBB96E05",original:"Solana"}],["SUI",{symbol:"SUI",decimals:8,address:"ibc/30778BA41ADF2D8A70B90DB53C2E0251731A40276EF6737215BB1A6ED9E90078",original:"Sui"}],["APT",{symbol:"APT",decimals:8,address:"ibc/7C495BD95757ED662A897C139F1C9F18275A86EE7203A0B073E2DB12B1E19D63",original:"Aptos"}],["WETHarbitrum",{symbol:"WETH",decimals:8,address:"ibc/221A4AADF7972F3BB8F48A6CA984FF0AE65B5D973FF1A695B9642AD702F51789",original:"Arbitrum"}],["USDCarbitrum",{symbol:"USDC",decimals:6,address:"ibc/06ED2700071B5A9C582F51A556537DA94E69EF547E7E6CCD8BFA3D95C818A525",original:"Arbitrum"}],["WETHoptimism",{symbol:"WETH",decimals:8,address:"ibc/80B3FECB24A4CE94537444E5BF937AC4C08A39BF90D59620D278FA185BD2B148",original:"Optimism"}],["USDCoptimism",{symbol:"USDC",decimals:6,address:"ibc/0A98A3947189D7C368170C76C3EF49486DDBE095F34B72A3C7F92AEBE1013A1D",original:"Optimism"}],["WETHbase",{symbol:"WETH",decimals:8,address:"ibc/A45069EA82C933945973E66E4222EEE4624498D4483508FE9BEBF9D519F2132F",original:"Base"}],["USDCbase",{symbol:"USDC",decimals:6,address:"ibc/2E4F8BC7F7AF33752CF7E290CAD4417EE67CD18FFC0D099E6519A440E588E0CE",original:"Base"}],["OSMO",{symbol:"OSMO",decimals:6,address:"uosmo"}],["wstETH",{symbol:"wstETH",decimals:8,address:"ibc/C66B7DB3ED665D2F5FE8ED15E88B5913A37D80601E161C5E53A743DE12C0FB85",original:"Ethereum"}]]],["Cosmoshub",[["WETH",{symbol:"WETH",decimals:8,address:"ibc/77FE9153FA76C3107CB9F6633AC33509A58529E9622327F216BA8107C79C2DE3",original:"Ethereum"}],["USDCeth",{symbol:"USDC",decimals:6,address:"ibc/D0EC31D1176BB69EA1A7CF7172CA0380B7AF488AFC6D55B101B8363C2141CD4F",original:"Ethereum"}],["USDT",{symbol:"USDT",decimals:6,address:"ibc/755FBC53FFB46FB505B5269F9BEDF47041F2A0EF2FF8D0520315403E5925C80A",original:"Ethereum"}],["DAI",{symbol:"DAI",decimals:8,address:"ibc/5F21E975410DA22AF565B1772DC45AD0BD5F6DA004981EBE291763F3D2C72A96",original:"Ethereum"}],["WMATIC",{symbol:"WMATIC",decimals:8,address:"ibc/37FB599287C6963C413E915FDE83EFA69A3CE8147675DD5A7F974B45F39C8A31",original:"Polygon"}],["WBNB",{symbol:"WBNB",decimals:8,address:"ibc/5B0D5974A56332468DD4B2D07C96A7386FCF8FE7303FF41234F90E410EF51937",original:"Bsc"}],["WAVAX",{symbol:"WAVAX",decimals:8,address:"ibc/BAEAC83736444C09656FBE666FB625974FCCDEE566EB700EBFD2642C5F6CF13A",original:"Avalanche"}],["USDCavax",{symbol:"USDC",decimals:6,address:"ibc/F09E98FA8682FF39130F171E9D89A948B0C3A452F2A31F22B6CC54A3AAE1CD4A",original:"Avalanche"}],["WFTM",{symbol:"WFTM",decimals:8,address:"ibc/919D8F138B7E71BB067C7301AB5C2D48415E8C3A2D9187861245CEC668F88E3C",original:"Fantom"}],["CELO",{symbol:"CELO",decimals:8,address:"ibc/009206915358A002C852A2A2CBEDB8446D2D02E519C815087A01F8BDB4DF77BA",original:"Celo"}],["WGLMR",{symbol:"WGLMR",decimals:8,address:"ibc/1EEDF447A6B046B20C00B1497BED5947219AEEBE0D9A85235C85133A554DF7A4",original:"Moonbeam"}],["WSOL",{symbol:"WSOL",decimals:8,address:"ibc/D3EA463A51E31B2B30BED1978575CAC145DBAB354B8A0EA5D4CFB12D737AF790",original:"Solana"}],["USDCsol",{symbol:"USDC",decimals:6,address:"ibc/26D8D6C63C8D37A5127591DDA905E04CC69CBD3A64F9DA3B1DA3FB0B6A7D9FA5",original:"Solana"}],["SUI",{symbol:"SUI",decimals:8,address:"ibc/129EC6B8A41BE07F94DD267F552F4AE1D5EAEBB51634A1468556AF06C10C2692",original:"Sui"}],["APT",{symbol:"APT",decimals:8,address:"ibc/0CCA5EB15BC2FE474E71DBC9698302CDE260B6F6548F91C30002F7CBF228197B",original:"Aptos"}],["WETHarbitrum",{symbol:"WETH",decimals:8,address:"ibc/AB4046AF5B6F146C006DE4DECAD929D24F762A701E09EC8B29000EC63A6E649B",original:"Arbitrum"}],["USDCarbitrum",{symbol:"USDC",decimals:6,address:"ibc/6D1B6A7A9EF692A279A6B5994C98C0D598D003D9203BE8309F14B6E57A58506E",original:"Arbitrum"}],["WETHoptimism",{symbol:"WETH",decimals:8,address:"ibc/A0298483510D803A045AA7F49CCBD0F9D01010FE0B1A346EBDFFF4BA820C3D21",original:"Optimism"}],["USDCoptimism",{symbol:"USDC",decimals:6,address:"ibc/CE3F2FE630DA6A1187F085CDC8D59BA8B20DA48F4866F2D71C5AB7A1D5859933",original:"Optimism"}],["WETHbase",{symbol:"WETH",decimals:8,address:"ibc/97035986A4BD0AF555713355A02EA31A4526616B6543E019E0D750007FABE06C",original:"Base"}],["USDCbase",{symbol:"USDC",decimals:6,address:"ibc/8560BA5F45C95AE716C05978E364F50C98347ACBEC745840C30F91611FA36698",original:"Base"}],["wstETH",{symbol:"wstETH",decimals:8,address:"ibc/5BB02667F9F0C8284FCF7716065C2779039817FBCB91E937F5149FE89FD8F202",original:"Ethereum"}],["ATOM",{symbol:"ATOM",decimals:6,address:"uatom"}]]],["Evmos",[["EVMOS",{symbol:"EVMOS",decimals:18,address:"atevmos"}]]],["Kujira",[["KUJI",{symbol:"KUJI",decimals:6,address:"ukuji"}]]],["Klaytn",[["KLAY",{symbol:"KLAY",decimals:18,address:"native",wrappedKey:"WKLAY"}],["WKLAY",{symbol:"WKLAY",decimals:18,address:"0x0339d5Eb6D195Ba90B13ed1BCeAa97EbD198b106"}]]],["Sepolia",[["ETHsepolia",{symbol:"ETH",decimals:18,address:"native",wrappedKey:"WETHsepolia"}],["WETHsepolia",{symbol:"WETH",decimals:18,address:"0xeef12A83EE5b7161D3873317c8E0E7B76e0B5D9c"}]]],["ArbitrumSepolia",[["ETHarbitrum_sepolia",{symbol:"ETH",decimals:18,address:"native",wrappedKey:"WETHarbitrum_sepolia"}],["WETHarbitrum_sepolia",{symbol:"WETH",decimals:18,address:"0x980B62Da83eFf3D4576C647993b0c1D7faf17c73"}]]],["BaseSepolia",[["ETHbase_sepolia",{symbol:"ETH",decimals:18,address:"native",wrappedKey:"WETHbase_sepolia"}],["WETHbase_sepolia",{symbol:"WETH",decimals:18,address:"0x4200000000000000000000000000000000000006"}]]],["OptimismSepolia",[["ETHoptimism_sepolia",{symbol:"ETH",decimals:18,address:"native",wrappedKey:"WETHoptimism_sepolia"}],["WETHoptimism_sepolia",{symbol:"WETH",decimals:18,address:"0x4200000000000000000000000000000000000006"}]]]],vd=we(lp,[0,[1,2]]);function uo(n,e){if(n!=="Devnet"){if(n==="Mainnet"){if(!Dd.has(e))return;const t=Dd.get(e);return Object.fromEntries(t.map(([r,s])=>[r,{...s,chain:e,key:r}]))}if(n==="Testnet"){if(!vd.has(e))return;const t=vd.get(e);return Object.fromEntries(t.map(([r,s])=>[r,{...s,chain:e,key:r}]))}throw new Error("Unsupported network: "+n)}}function dp(n,e){const t=uo(n,e);return t?is.native(t):void 0}function up(n,e,t){const r=uo(n,e);return r?is.byAddress(r,t):void 0}function fp(n,e,t){const r=uo(n,e);return r?is.byKey(r,t):void 0}function hp(n,e){const t={coreBridge:m1.get(n,e),tokenBridge:b1.get(n,e),nftBridge:g1.get(n,e),relayer:y1.get(n,e),tokenBridgeRelayer:p1.get(n,e),tbtc:Si.get(n,e)};return qa.has(n,e)&&(t.cctp=qa.get(n,e)),ad.has(n,e)&&(t.gateway=ad.get(n,e)),cd.has(n,e)&&(t.translator=cd.get(n,e)),ld.has(n,e)&&(t.portico=ld.get(n,e)),Si.has(n,e)&&(t.tbtc=Si.get(n,e)),t}function Ot(n){return typeof n=="string"&&n==="native"}function Of(n){return{chain:n,address:"native"}}function fo(n){return typeof n=="object"&&n.address!==void 0&&n.chain!==void 0&&so(n.chain)}function Nf(n,e){return n.chain!==e.chain?!1:Ot(n.address)&&Ot(e.address)?!0:Dn(n)===Dn(e)}function Dn(n){return fo(n)&&Ot(n.address)?n.address:n.address.toNative(n.chain).toString()}function mp(n){if(Ot(n.address))throw new Error("Invalid address, cannot convert the string literal `native` to a Universal Address");return n.address.toUniversalAddress().toString()}function zf(n,e,t){let r;if(fo(t)){if(!Ot(t.address))return[!1,t];r=t.address}else r=t;if(Ot(r)){const i=dp(n,e);if(!i)throw new Error("Invalid destination token");const o=i.wrappedKey,a=fp(n,e,o);if(!a)throw new Error("Invalid wrapped token key: "+o);return[!0,{chain:e,address:sr(e,a.address)}]}return[!1,{chain:e,address:r}]}function Hf(n){return n.chain!==void 0&&n.txid!==void 0}function ua(n){return Pu.map(t=>{const r=ss(t);let s="";try{s=ju.get(n,t)}catch{}const i=uo(n,t),o=i?Object.values(i).find(l=>Ot(l.address)&&l.wrappedKey):void 0,a=o?i[o.wrappedKey]:void 0;return{key:t,platform:r,network:n,chainId:Ys(t),finalityThreshold:Nu.get(t)??0,blockTime:zu.get(t)??0,contracts:hp(n,t),nativeTokenDecimals:Hu(r),nativeChainId:s,tokenMap:i,wrappedNative:a,explorer:e1(n,t),rpc:qu(n,t)}}).reduce((t,r)=>({...t,[r.key]:r}),{})}function bp(n){return qf(n)||Yc(n)}function qf(n){return typeof n=="object"&&"chain"in n&&typeof n.chain=="function"&&"address"in n&&typeof n.address=="function"&&"sign"in n&&typeof n.sign=="function"}function Yc(n){return typeof n=="object"&&"chain"in n&&typeof n.chain=="function"&&"address"in n&&typeof n.address=="function"&&"signAndSend"in n&&typeof n.signAndSend=="function"}class pp{constructor(e,t,r){re(this,"_chain");re(this,"_address");re(this,"_signer");this._chain=e,this._address=t,this._signer=r}unwrap(){return this._signer}}function pr(n){return n.sequence!==void 0&&n.emitter!==void 0&&n.chain!==void 0}function Oi(n){return n.hash!==void 0}const kd=n=>[or(1),{name:"token",binary:"bytes",layout:[{name:"address",...xe},{name:"amount",...Mt}]},{name:"sourceDomain",...Rs},{name:"targetDomain",...Rs},{name:"nonce",...Kc},{name:"caller",...xe},{name:"mintRecipient",...xe},Qi({name:"payload",lengthSize:2},n)],gp=[or(1),{name:"targetRelayerFee",...Mt},{name:"toNativeTokenAmount",...Mt},{name:"targetRecipient",...xe}],yp=[["DepositWithPayload",kd()],["TransferWithRelay",kd(gp)]];xt("AutomaticCircleBridge",yp);const Kf={binary:"uint",size:4,custom:0,omit:!0},wp=[{name:"messageBodyVersion",...Kf},{name:"burnToken",...xe},{name:"mintRecipient",...xe},{name:"amount",...Mt},{name:"messageSender",...xe}],tc=[{name:"version",...Kf},{name:"sourceDomain",...Rs},{name:"destinationDomain",...Rs},{name:"nonce",...Kc},{name:"sender",...xe},{name:"recipient",...xe},{name:"destinationCaller",...xe},{name:"payload",binary:"bytes",layout:wp}],Ap=[["Message",tc]];xt("CircleBridge",Ap);exports.CircleBridge=void 0;(function(n){n.isCircleAttestation=e=>e.message!==void 0,n.deserialize=e=>{const t=Sn(tc,e),r=_t.encode(_s(e),!0);return[t,r]},n.serialize=e=>Cn(tc,e)})(exports.CircleBridge||(exports.CircleBridge={}));var Fd;(function(n){const e="AutomaticCircleBridge",t=["DepositWithPayload","TransferWithRelay"];n.getTransferDiscriminator=Cc(()=>Gc([e,t]))})(Fd||(Fd={}));function Ep(n){return n.amount!==void 0&&n.from!==void 0&&n.to!==void 0}const Td={binary:"bytes",size:32,custom:{to:n=>Ui(n.byteLength).map(e=>String.fromCharCode(n[e])).join(""),from:n=>new Uint8Array(n.split("").map(e=>e.charCodeAt(0)))}},jf=[{name:"token",binary:"bytes",layout:[{name:"amount",...Mt},{name:"address",...xe},{name:"chain",...qt()}]},{name:"to",binary:"bytes",layout:[{name:"address",...xe},{name:"chain",...qt()}]}],$f=[or(1),...jf,{name:"fee",...Mt}],ho=n=>[or(3),...jf,{name:"from",...xe},Qi({name:"payload"},n)],Bp=[["AttestMeta",[or(2),{name:"token",binary:"bytes",layout:[{name:"address",...xe},{name:"chain",...qt()}]},{name:"decimals",binary:"uint",size:1},{name:"symbol",...Td},{name:"name",...Td}]],["Transfer",$f],["TransferWithPayload",ho()]];xt("TokenBridge",Bp);const xp=Rm(["shouldWrapNative","shouldUnwrapNative"]),nc=[{name:"recipientChain",binary:"uint",endianness:"little",size:2},{name:"bridgeNonce",binary:"uint",endianness:"little",size:4},{name:"feeTierStart",binary:"uint",endianness:"little",size:3},{name:"feeTierFinish",binary:"uint",endianness:"little",size:3},{name:"padding",binary:"bytes",size:19},{name:"flags",...xp}],rc=[{name:"flagSet",binary:"bytes",layout:nc},{name:"finalTokenAddress",...xe},{name:"recipientAddress",...xe},{name:"cannonAssetAmount",...Mt},{name:"minAmountFinish",...Mt},{name:"relayerFee",...Mt}],Cp=[["Transfer",ho(rc)]];xt("PorticoBridge",Cp);exports.PorticoBridge=void 0;(function(n){n.deserializePayload=e=>Sn(rc,e),n.serializePayload=e=>Cn(rc,e),n.deserializeFlagSet=e=>Sn(nc,e),n.serializeFlagSet=e=>Cn(nc,e)})(exports.PorticoBridge||(exports.PorticoBridge={}));const Vf={binary:"bytes",layout:[{name:"size",binary:"uint",size:4,custom:3*32,omit:!0},{name:"waste",binary:"uint",size:31,custom:0n,omit:!0},{name:"version",binary:"uint",size:1,custom:0,omit:!0},{name:"gasLimit",...Mt},{name:"targetChainRefundPerGasUnused",...Mt}]},Id={binary:"bytes",layout:[{name:"chain",...qt()},{name:"address",...xe}]},Sp=[{name:"chain",...qt()},{name:"emitterAddress",...xe},{name:"sequence",...jc}],Dp=[{name:"size",binary:"uint",size:4,custom:12,omit:!0},{name:"domain",...Rs},{name:"nonce",...Kc}],Gf={binary:"switch",idSize:1,idTag:"keyType",layouts:[[[1,"VAA"],Sp],[[2,"CCTP"],Dp]]},Yf=n=>[or(1),{name:"target",...Id},Qi({name:"payload",lengthSize:4},n),{name:"requestedReceiverValue",...Mt},{name:"extraReceiverValue",...Mt},{name:"executionInfo",...Vf},{name:"refund",...Id},{name:"refundDeliveryProvider",...xe},{name:"sourceDeliveryProvider",...xe},{name:"senderAddress",...xe},{name:"messageKeys",binary:"array",lengthSize:1,layout:Gf}],vp=[["DeliveryInstruction",Yf()],["RedeliveryInstruction",[or(2),{name:"deliveryVaaKey",binary:"bytes",layout:Gf},{name:"targetChain",...qt()},{name:"newRequestedReceiverValue",...Mt},{name:"newEncodedExecutionInfo",...Vf},{name:"newSourceDeliveryProvider",...xe},{name:"newSenderAddress",...xe}]]];xt("Relayer",vp);const kp=[or(1),{name:"targetRelayerFee",...Mt},{name:"toNativeTokenAmount",...Mt},{name:"targetRecipient",...xe}],Fp=[["TransferWithRelay",ho(kp)]];xt("AutomaticTokenBridge",Fp);const Tp=n=>new Error(`Token ${n} is not a wrapped asset`);var sc;(function(n){const e="TokenBridge",t=["Transfer","TransferWithPayload"],r=["AttestMeta"];[...t,...r],n.getTransferDiscriminator=Cc(()=>Gc([e,t]))})(sc||(sc={}));function Ip(n){return n.token!==void 0&&n.amount!==void 0&&n.from!==void 0&&n.to!==void 0}const Up=[["Add",1],["Subtract",2],["Unknown",3]],ic={binary:"bytes",size:20,custom:{to:n=>_t.encode(n,!0),from:n=>_t.decode(n)}},_p=[["UpgradeContract",[!1,[{name:"newContract",...xe}]]],["RegisterChain",[!0,[{name:"foreignChain",...qt()},{name:"foreignAddress",...xe}]]],["RecoverChainId",[!1,[{name:"evmChainId",binary:"uint",size:32},{name:"newChainId",...qt({allowedChains:Lu("Evm")})}]]],["GuardianSetUpgrade",[!0,[{name:"guardianSet",...Rf},{name:"guardians",binary:"array",lengthSize:1,layout:ic}]]],["SetMessageFee",[!1,[{name:"messageFee",binary:"uint",size:32}]]],["TransferFees",[!0,[{name:"amount",binary:"uint",size:32},{name:"recipient",...xe}]]],["UpdateDefaultProvider",[!1,[{name:"defaultProvider",...xe}]]],["RegisterEmitterAndDomain",[!0,[{name:"emitterChain",...qt()},{name:"emitterAddress",...xe},{name:"domain",binary:"uint",size:4}]]],["UpdateFinality",[!1,[{name:"finality",binary:"uint",size:1}]]]],fa={binary:"bytes",size:32},Ud=[{name:"contractAddr",...xe},{name:"codeId",binary:"uint",size:8}],Mp=[["StoreCode",[!1,[{name:"wasmHash",...fa}]]],["InstantiateContract",[!1,[{name:"instantiationParamsHash",...fa}]]],["MigrateContract",[!1,[{name:"migrationParamsHash",...fa}]]],["AddWasmInstantiateAllowlist",[!1,Ud]],["DeleteWasmInstantiateAllowlist",[!1,Ud]]],Rp=(()=>{const n=s=>({binary:"bytes",size:s,custom:sp}),e=[{name:"height",binary:"uint",size:8}],t=ku(e),r=s=>[{name:"name",...n(s)},...e];return{binary:"bytes",custom:{to:s=>Sn(r(s.length-t),s),from:s=>Cn(r(s.name.length),s)}}})(),Wp=[["ScheduleUpgrade",[!1,Rp]],["CancelUpgrade",[!0,[]]],["SetIbcComposabilityMwContract",[!1,[{name:"contractAddress",...xe}]]]],Pp=[["ModifyBalance",[!1,[{name:"sequence",...jc},{name:"modifiedChain",...qt()},{name:"tokenChain",...qt()},{name:"tokenAddress",...xe},{name:"kind",...Mm(Up)},{name:"amount",...Mt},{name:"reason",...Wf(32)}]]]],Lp=[["ActionUpdateChannelChain",[!1,[{name:"channelId",...Wf(64)},{name:"channelChain",...qt({allowedChains:Lu("Cosmwasm")})}]]]],Op=[["GeneralPurposeEvm",[!1,[{name:"governanceContract",...ic},{name:"targetContract",...ic},{name:"payload",binary:"bytes",lengthSize:2}]]],["GeneralPurposeSolana",[!1,[{name:"governanceContract",...xe},{name:"payload",binary:"bytes"}]]]],Xf=[..._p,...Mp,...Wp,...Pp,...Lp,...Op];Cu(Xf,0);const _d=Object.fromEntries(Xf),Np=[["WormholeCore","Core"],["TokenBridge","TokenBridge"],["NftBridge","NftBridge"],["Relayer","WormholeRelayer"],["CircleBridge","CircleIntegration"],["IbcBridge","IbcTranslator"],["IbcReceiver","IbcReceiver"],["GlobalAccountant","GlobalAccountant"],["GeneralPurposeGovernance","GeneralPurposeGovernance"],["WormchainGovernance","WasmdModule"],["GatewayGovernance","GatewayModule"]],zp=we(Np),Hp=n=>({to:n,from:(()=>{const t=new Uint8Array(32),r=zp(n);for(let s=1;s<=r.length;++s)t[32-s]=r.charCodeAt(r.length-s);return t})()}),qp=(n,e)=>({to:n,from:e}),Kp=(n,e,t)=>[{name:"protocol",binary:"bytes",custom:Hp(n)},{name:"action",binary:"uint",size:1,custom:qp(e,t)},{name:"chain",...qt({allowNull:_d[e][0]})},{name:"actionArgs",binary:"bytes",layout:_d[e][1]}],_e=(n,e,t)=>[e,Kp(n,e,t)],jp=[_e("WormholeCore","UpgradeContract",1),_e("WormholeCore","GuardianSetUpgrade",2),_e("WormholeCore","SetMessageFee",3),_e("WormholeCore","TransferFees",4),_e("WormholeCore","RecoverChainId",5)],$p=[_e("TokenBridge","RegisterChain",1),_e("TokenBridge","UpgradeContract",2),_e("TokenBridge","RecoverChainId",3)],Vp=[_e("NftBridge","RegisterChain",1),_e("NftBridge","UpgradeContract",2),_e("NftBridge","RecoverChainId",3)],Gp=[_e("Relayer","RegisterChain",1),_e("Relayer","UpgradeContract",2),_e("Relayer","UpdateDefaultProvider",3)],Yp=[_e("CircleBridge","UpdateFinality",1),_e("CircleBridge","RegisterEmitterAndDomain",2),_e("CircleBridge","UpgradeContract",3)],Xp=[_e("IbcBridge","ActionUpdateChannelChain",1)],Zp=[_e("IbcReceiver","ActionUpdateChannelChain",1)],Jp=[_e("GlobalAccountant","ModifyBalance",1)],Qp=[_e("GeneralPurposeGovernance","GeneralPurposeEvm",1),_e("GeneralPurposeGovernance","GeneralPurposeSolana",2)],eg=[_e("WormchainGovernance","StoreCode",1),_e("WormchainGovernance","InstantiateContract",2),_e("WormchainGovernance","MigrateContract",3),_e("WormchainGovernance","AddWasmInstantiateAllowlist",4),_e("WormchainGovernance","DeleteWasmInstantiateAllowlist",5)],tg=[_e("GatewayGovernance","ScheduleUpgrade",1),_e("GatewayGovernance","CancelUpgrade",2),_e("GatewayGovernance","SetIbcComposabilityMwContract",3)];xt("WormholeCore",jp);xt("TokenBridge",$p);xt("NftBridge",Vp);xt("Relayer",Gp);xt("CircleBridge",Yp);xt("IbcBridge",Xp);xt("IbcReceiver",Zp);xt("GlobalAccountant",Jp);xt("GeneralPurposeGovernance",Qp);xt("WormchainGovernance",eg);xt("GatewayGovernance",tg);exports.TBTCBridge=void 0;(function(n){const e="TBTCBridge",t=["GatewayTransfer","Transfer"];[...t],n.getTransferDiscriminator=Cc(()=>Gc([e,t])),n.getNativeTbtcToken=r=>{const s=C1.get("Mainnet",r);if(s)return{chain:r,address:sr(r,s)}}})(exports.TBTCBridge||(exports.TBTCBridge={}));const ng=[{name:"recipient",...xe}],rg=[["GatewayTransfer",ho(ng)],["Transfer",$f]];xt("TBTCBridge",rg);function Zf(n,e){return function(){return n.apply(e,arguments)}}const{toString:sg}=Object.prototype,{getPrototypeOf:Xc}=Object,mo=(n=>e=>{const t=sg.call(e);return n[t]||(n[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),Fn=n=>(n=n.toLowerCase(),e=>mo(e)===n),bo=n=>e=>typeof e===n,{isArray:cs}=Array,Ls=bo("undefined");function ig(n){return n!==null&&!Ls(n)&&n.constructor!==null&&!Ls(n.constructor)&&nn(n.constructor.isBuffer)&&n.constructor.isBuffer(n)}const Jf=Fn("ArrayBuffer");function og(n){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(n):e=n&&n.buffer&&Jf(n.buffer),e}const ag=bo("string"),nn=bo("function"),Qf=bo("number"),po=n=>n!==null&&typeof n=="object",cg=n=>n===!0||n===!1,vi=n=>{if(mo(n)!=="object")return!1;const e=Xc(n);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)},lg=Fn("Date"),dg=Fn("File"),ug=Fn("Blob"),fg=Fn("FileList"),hg=n=>po(n)&&nn(n.pipe),mg=n=>{let e;return n&&(typeof FormData=="function"&&n instanceof FormData||nn(n.append)&&((e=mo(n))==="formdata"||e==="object"&&nn(n.toString)&&n.toString()==="[object FormData]"))},bg=Fn("URLSearchParams"),pg=n=>n.trim?n.trim():n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Js(n,e,{allOwnKeys:t=!1}={}){if(n===null||typeof n>"u")return;let r,s;if(typeof n!="object"&&(n=[n]),cs(n))for(r=0,s=n.length;r<s;r++)e.call(null,n[r],r,n);else{const i=t?Object.getOwnPropertyNames(n):Object.keys(n),o=i.length;let a;for(r=0;r<o;r++)a=i[r],e.call(null,n[a],a,n)}}function e0(n,e){e=e.toLowerCase();const t=Object.keys(n);let r=t.length,s;for(;r-- >0;)if(s=t[r],e===s.toLowerCase())return s;return null}const t0=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:Ve.global,n0=n=>!Ls(n)&&n!==t0;function oc(){const{caseless:n}=n0(this)&&this||{},e={},t=(r,s)=>{const i=n&&e0(e,s)||s;vi(e[i])&&vi(r)?e[i]=oc(e[i],r):vi(r)?e[i]=oc({},r):cs(r)?e[i]=r.slice():e[i]=r};for(let r=0,s=arguments.length;r<s;r++)arguments[r]&&Js(arguments[r],t);return e}const gg=(n,e,t,{allOwnKeys:r}={})=>(Js(e,(s,i)=>{t&&nn(s)?n[i]=Zf(s,t):n[i]=s},{allOwnKeys:r}),n),yg=n=>(n.charCodeAt(0)===65279&&(n=n.slice(1)),n),wg=(n,e,t,r)=>{n.prototype=Object.create(e.prototype,r),n.prototype.constructor=n,Object.defineProperty(n,"super",{value:e.prototype}),t&&Object.assign(n.prototype,t)},Ag=(n,e,t,r)=>{let s,i,o;const a={};if(e=e||{},n==null)return e;do{for(s=Object.getOwnPropertyNames(n),i=s.length;i-- >0;)o=s[i],(!r||r(o,n,e))&&!a[o]&&(e[o]=n[o],a[o]=!0);n=t!==!1&&Xc(n)}while(n&&(!t||t(n,e))&&n!==Object.prototype);return e},Eg=(n,e,t)=>{n=String(n),(t===void 0||t>n.length)&&(t=n.length),t-=e.length;const r=n.indexOf(e,t);return r!==-1&&r===t},Bg=n=>{if(!n)return null;if(cs(n))return n;let e=n.length;if(!Qf(e))return null;const t=new Array(e);for(;e-- >0;)t[e]=n[e];return t},xg=(n=>e=>n&&e instanceof n)(typeof Uint8Array<"u"&&Xc(Uint8Array)),Cg=(n,e)=>{const r=(n&&n[Symbol.iterator]).call(n);let s;for(;(s=r.next())&&!s.done;){const i=s.value;e.call(n,i[0],i[1])}},Sg=(n,e)=>{let t;const r=[];for(;(t=n.exec(e))!==null;)r.push(t);return r},Dg=Fn("HTMLFormElement"),vg=n=>n.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,r,s){return r.toUpperCase()+s}),Md=(({hasOwnProperty:n})=>(e,t)=>n.call(e,t))(Object.prototype),kg=Fn("RegExp"),r0=(n,e)=>{const t=Object.getOwnPropertyDescriptors(n),r={};Js(t,(s,i)=>{e(s,i,n)!==!1&&(r[i]=s)}),Object.defineProperties(n,r)},Fg=n=>{r0(n,(e,t)=>{if(nn(n)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;const r=n[t];if(nn(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")})}})},Tg=(n,e)=>{const t={},r=s=>{s.forEach(i=>{t[i]=!0})};return cs(n)?r(n):r(String(n).split(e)),t},Ig=()=>{},Ug=(n,e)=>(n=+n,Number.isFinite(n)?n:e),ha="abcdefghijklmnopqrstuvwxyz",Rd="0123456789",s0={DIGIT:Rd,ALPHA:ha,ALPHA_DIGIT:ha+ha.toUpperCase()+Rd},_g=(n=16,e=s0.ALPHA_DIGIT)=>{let t="";const{length:r}=e;for(;n--;)t+=e[Math.random()*r|0];return t};function Mg(n){return!!(n&&nn(n.append)&&n[Symbol.toStringTag]==="FormData"&&n[Symbol.iterator])}const Rg=n=>{const e=new Array(10),t=(r,s)=>{if(po(r)){if(e.indexOf(r)>=0)return;if(!("toJSON"in r)){e[s]=r;const i=cs(r)?[]:{};return Js(r,(o,a)=>{const l=t(o,s+1);!Ls(l)&&(i[a]=l)}),e[s]=void 0,i}}return r};return t(n,0)},Wg=Fn("AsyncFunction"),Pg=n=>n&&(po(n)||nn(n))&&nn(n.then)&&nn(n.catch),q={isArray:cs,isArrayBuffer:Jf,isBuffer:ig,isFormData:mg,isArrayBufferView:og,isString:ag,isNumber:Qf,isBoolean:cg,isObject:po,isPlainObject:vi,isUndefined:Ls,isDate:lg,isFile:dg,isBlob:ug,isRegExp:kg,isFunction:nn,isStream:hg,isURLSearchParams:bg,isTypedArray:xg,isFileList:fg,forEach:Js,merge:oc,extend:gg,trim:pg,stripBOM:yg,inherits:wg,toFlatObject:Ag,kindOf:mo,kindOfTest:Fn,endsWith:Eg,toArray:Bg,forEachEntry:Cg,matchAll:Sg,isHTMLForm:Dg,hasOwnProperty:Md,hasOwnProp:Md,reduceDescriptors:r0,freezeMethods:Fg,toObjectSet:Tg,toCamelCase:vg,noop:Ig,toFiniteNumber:Ug,findKey:e0,global:t0,isContextDefined:n0,ALPHABET:s0,generateString:_g,isSpecCompliantForm:Mg,toJSONObject:Rg,isAsyncFn:Wg,isThenable:Pg};function De(n,e,t,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=n,this.name="AxiosError",e&&(this.code=e),t&&(this.config=t),r&&(this.request=r),s&&(this.response=s)}q.inherits(De,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:q.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const i0=De.prototype,o0={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(n=>{o0[n]={value:n}});Object.defineProperties(De,o0);Object.defineProperty(i0,"isAxiosError",{value:!0});De.from=(n,e,t,r,s,i)=>{const o=Object.create(i0);return q.toFlatObject(n,o,function(l){return l!==Error.prototype},a=>a!=="isAxiosError"),De.call(o,n.message,e,t,r,s),o.cause=n,o.name=n.name,i&&Object.assign(o,i),o};const Lg=null;function ac(n){return q.isPlainObject(n)||q.isArray(n)}function a0(n){return q.endsWith(n,"[]")?n.slice(0,-2):n}function Wd(n,e,t){return n?n.concat(e).map(function(s,i){return s=a0(s),!t&&i?"["+s+"]":s}).join(t?".":""):e}function Og(n){return q.isArray(n)&&!n.some(ac)}const Ng=q.toFlatObject(q,{},null,function(e){return/^is[A-Z]/.test(e)});function go(n,e,t){if(!q.isObject(n))throw new TypeError("target must be an object");e=e||new FormData,t=q.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,function(D,x){return!q.isUndefined(x[D])});const r=t.metaTokens,s=t.visitor||m,i=t.dots,o=t.indexes,l=(t.Blob||typeof Blob<"u"&&Blob)&&q.isSpecCompliantForm(e);if(!q.isFunction(s))throw new TypeError("visitor must be a function");function h(g){if(g===null)return"";if(q.isDate(g))return g.toISOString();if(!l&&q.isBlob(g))throw new De("Blob is not supported. Use a Buffer instead.");return q.isArrayBuffer(g)||q.isTypedArray(g)?l&&typeof Blob=="function"?new Blob([g]):Ve.Buffer.from(g):g}function m(g,D,x){let U=g;if(g&&!x&&typeof g=="object"){if(q.endsWith(D,"{}"))D=r?D:D.slice(0,-2),g=JSON.stringify(g);else if(q.isArray(g)&&Og(g)||(q.isFileList(g)||q.endsWith(D,"[]"))&&(U=q.toArray(g)))return D=a0(D),U.forEach(function(F,W){!(q.isUndefined(F)||F===null)&&e.append(o===!0?Wd([D],W,i):o===null?D:D+"[]",h(F))}),!1}return ac(g)?!0:(e.append(Wd(x,D,i),h(g)),!1)}const E=[],S=Object.assign(Ng,{defaultVisitor:m,convertValue:h,isVisitable:ac});function A(g,D){if(!q.isUndefined(g)){if(E.indexOf(g)!==-1)throw Error("Circular reference detected in "+D.join("."));E.push(g),q.forEach(g,function(U,R){(!(q.isUndefined(U)||U===null)&&s.call(e,U,q.isString(R)?R.trim():R,D,S))===!0&&A(U,D?D.concat(R):[R])}),E.pop()}}if(!q.isObject(n))throw new TypeError("data must be an object");return A(n),e}function Pd(n){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(n).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function Zc(n,e){this._pairs=[],n&&go(n,this,e)}const c0=Zc.prototype;c0.append=function(e,t){this._pairs.push([e,t])};c0.toString=function(e){const t=e?function(r){return e.call(this,r,Pd)}:Pd;return this._pairs.map(function(s){return t(s[0])+"="+t(s[1])},"").join("&")};function zg(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function l0(n,e,t){if(!e)return n;const r=t&&t.encode||zg,s=t&&t.serialize;let i;if(s?i=s(e,t):i=q.isURLSearchParams(e)?e.toString():new Zc(e,t).toString(r),i){const o=n.indexOf("#");o!==-1&&(n=n.slice(0,o)),n+=(n.indexOf("?")===-1?"?":"&")+i}return n}class Ld{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){q.forEach(this.handlers,function(r){r!==null&&e(r)})}}const d0={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Hg=typeof URLSearchParams<"u"?URLSearchParams:Zc,qg=typeof FormData<"u"?FormData:null,Kg=typeof Blob<"u"?Blob:null,jg=(()=>{let n;return typeof navigator<"u"&&((n=navigator.product)==="ReactNative"||n==="NativeScript"||n==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),$g=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Bn={classes:{URLSearchParams:Hg,FormData:qg,Blob:Kg},isStandardBrowserEnv:jg,isStandardBrowserWebWorkerEnv:$g,protocols:["http","https","file","blob","url","data"]};function Vg(n,e){return go(n,new Bn.classes.URLSearchParams,Object.assign({visitor:function(t,r,s,i){return Bn.isNode&&q.isBuffer(t)?(this.append(r,t.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},e))}function Gg(n){return q.matchAll(/\w+|\[(\w*)]/g,n).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Yg(n){const e={},t=Object.keys(n);let r;const s=t.length;let i;for(r=0;r<s;r++)i=t[r],e[i]=n[i];return e}function u0(n){function e(t,r,s,i){let o=t[i++];const a=Number.isFinite(+o),l=i>=t.length;return o=!o&&q.isArray(s)?s.length:o,l?(q.hasOwnProp(s,o)?s[o]=[s[o],r]:s[o]=r,!a):((!s[o]||!q.isObject(s[o]))&&(s[o]=[]),e(t,r,s[o],i)&&q.isArray(s[o])&&(s[o]=Yg(s[o])),!a)}if(q.isFormData(n)&&q.isFunction(n.entries)){const t={};return q.forEachEntry(n,(r,s)=>{e(Gg(r),s,t,0)}),t}return null}const Xg={"Content-Type":void 0};function Zg(n,e,t){if(q.isString(n))try{return(e||JSON.parse)(n),q.trim(n)}catch(r){if(r.name!=="SyntaxError")throw r}return(t||JSON.stringify)(n)}const ls={transitional:d0,adapter:["xhr","http"],transformRequest:[function(e,t){const r=t.getContentType()||"",s=r.indexOf("application/json")>-1,i=q.isObject(e);if(i&&q.isHTMLForm(e)&&(e=new FormData(e)),q.isFormData(e))return s&&s?JSON.stringify(u0(e)):e;if(q.isArrayBuffer(e)||q.isBuffer(e)||q.isStream(e)||q.isFile(e)||q.isBlob(e))return e;if(q.isArrayBufferView(e))return e.buffer;if(q.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Vg(e,this.formSerializer).toString();if((a=q.isFileList(e))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return go(a?{"files[]":e}:e,l&&new l,this.formSerializer)}}return i||s?(t.setContentType("application/json",!1),Zg(e)):e}],transformResponse:[function(e){const t=this.transitional||ls.transitional,r=t&&t.forcedJSONParsing,s=this.responseType==="json";if(e&&q.isString(e)&&(r&&!this.responseType||s)){const o=!(t&&t.silentJSONParsing)&&s;try{return JSON.parse(e)}catch(a){if(o)throw a.name==="SyntaxError"?De.from(a,De.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Bn.classes.FormData,Blob:Bn.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};q.forEach(["delete","get","head"],function(e){ls.headers[e]={}});q.forEach(["post","put","patch"],function(e){ls.headers[e]=q.merge(Xg)});const Jg=q.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Qg=n=>{const e={};let t,r,s;return n&&n.split(`
7
+ `).forEach(function(o){s=o.indexOf(":"),t=o.substring(0,s).trim().toLowerCase(),r=o.substring(s+1).trim(),!(!t||e[t]&&Jg[t])&&(t==="set-cookie"?e[t]?e[t].push(r):e[t]=[r]:e[t]=e[t]?e[t]+", "+r:r)}),e},Od=Symbol("internals");function ws(n){return n&&String(n).trim().toLowerCase()}function ki(n){return n===!1||n==null?n:q.isArray(n)?n.map(ki):String(n)}function ey(n){const e=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=t.exec(n);)e[r[1]]=r[2];return e}const ty=n=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim());function ma(n,e,t,r,s){if(q.isFunction(r))return r.call(this,e,t);if(s&&(e=t),!!q.isString(e)){if(q.isString(r))return e.indexOf(r)!==-1;if(q.isRegExp(r))return r.test(e)}}function ny(n){return n.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,r)=>t.toUpperCase()+r)}function ry(n,e){const t=q.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(n,r+t,{value:function(s,i,o){return this[r].call(this,e,s,i,o)},configurable:!0})})}let rn=class{constructor(e){e&&this.set(e)}set(e,t,r){const s=this;function i(a,l,h){const m=ws(l);if(!m)throw new Error("header name must be a non-empty string");const E=q.findKey(s,m);(!E||s[E]===void 0||h===!0||h===void 0&&s[E]!==!1)&&(s[E||l]=ki(a))}const o=(a,l)=>q.forEach(a,(h,m)=>i(h,m,l));return q.isPlainObject(e)||e instanceof this.constructor?o(e,t):q.isString(e)&&(e=e.trim())&&!ty(e)?o(Qg(e),t):e!=null&&i(t,e,r),this}get(e,t){if(e=ws(e),e){const r=q.findKey(this,e);if(r){const s=this[r];if(!t)return s;if(t===!0)return ey(s);if(q.isFunction(t))return t.call(this,s,r);if(q.isRegExp(t))return t.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=ws(e),e){const r=q.findKey(this,e);return!!(r&&this[r]!==void 0&&(!t||ma(this,this[r],r,t)))}return!1}delete(e,t){const r=this;let s=!1;function i(o){if(o=ws(o),o){const a=q.findKey(r,o);a&&(!t||ma(r,r[a],a,t))&&(delete r[a],s=!0)}}return q.isArray(e)?e.forEach(i):i(e),s}clear(e){const t=Object.keys(this);let r=t.length,s=!1;for(;r--;){const i=t[r];(!e||ma(this,this[i],i,e,!0))&&(delete this[i],s=!0)}return s}normalize(e){const t=this,r={};return q.forEach(this,(s,i)=>{const o=q.findKey(r,i);if(o){t[o]=ki(s),delete t[i];return}const a=e?ny(i):String(i).trim();a!==i&&delete t[i],t[a]=ki(s),r[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return q.forEach(this,(r,s)=>{r!=null&&r!==!1&&(t[s]=e&&q.isArray(r)?r.join(", "):r)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join(`
8
+ `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const r=new this(e);return t.forEach(s=>r.set(s)),r}static accessor(e){const r=(this[Od]=this[Od]={accessors:{}}).accessors,s=this.prototype;function i(o){const a=ws(o);r[a]||(ry(s,o),r[a]=!0)}return q.isArray(e)?e.forEach(i):i(e),this}};rn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);q.freezeMethods(rn.prototype);q.freezeMethods(rn);function ba(n,e){const t=this||ls,r=e||t,s=rn.from(r.headers);let i=r.data;return q.forEach(n,function(a){i=a.call(t,i,s.normalize(),e?e.status:void 0)}),s.normalize(),i}function f0(n){return!!(n&&n.__CANCEL__)}function Qs(n,e,t){De.call(this,n??"canceled",De.ERR_CANCELED,e,t),this.name="CanceledError"}q.inherits(Qs,De,{__CANCEL__:!0});function sy(n,e,t){const r=t.config.validateStatus;!t.status||!r||r(t.status)?n(t):e(new De("Request failed with status code "+t.status,[De.ERR_BAD_REQUEST,De.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}const iy=Bn.isStandardBrowserEnv?function(){return{write:function(t,r,s,i,o,a){const l=[];l.push(t+"="+encodeURIComponent(r)),q.isNumber(s)&&l.push("expires="+new Date(s).toGMTString()),q.isString(i)&&l.push("path="+i),q.isString(o)&&l.push("domain="+o),a===!0&&l.push("secure"),document.cookie=l.join("; ")},read:function(t){const r=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return r?decodeURIComponent(r[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function oy(n){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)}function ay(n,e){return e?n.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):n}function h0(n,e){return n&&!oy(e)?ay(n,e):e}const cy=Bn.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let r;function s(i){let o=i;return e&&(t.setAttribute("href",o),o=t.href),t.setAttribute("href",o),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:t.pathname.charAt(0)==="/"?t.pathname:"/"+t.pathname}}return r=s(window.location.href),function(o){const a=q.isString(o)?s(o):o;return a.protocol===r.protocol&&a.host===r.host}}():function(){return function(){return!0}}();function ly(n){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(n);return e&&e[1]||""}function dy(n,e){n=n||10;const t=new Array(n),r=new Array(n);let s=0,i=0,o;return e=e!==void 0?e:1e3,function(l){const h=Date.now(),m=r[i];o||(o=h),t[s]=l,r[s]=h;let E=i,S=0;for(;E!==s;)S+=t[E++],E=E%n;if(s=(s+1)%n,s===i&&(i=(i+1)%n),h-o<e)return;const A=m&&h-m;return A?Math.round(S*1e3/A):void 0}}function Nd(n,e){let t=0;const r=dy(50,250);return s=>{const i=s.loaded,o=s.lengthComputable?s.total:void 0,a=i-t,l=r(a),h=i<=o;t=i;const m={loaded:i,total:o,progress:o?i/o:void 0,bytes:a,rate:l||void 0,estimated:l&&o&&h?(o-i)/l:void 0,event:s};m[e?"download":"upload"]=!0,n(m)}}const uy=typeof XMLHttpRequest<"u",fy=uy&&function(n){return new Promise(function(t,r){let s=n.data;const i=rn.from(n.headers).normalize(),o=n.responseType;let a;function l(){n.cancelToken&&n.cancelToken.unsubscribe(a),n.signal&&n.signal.removeEventListener("abort",a)}q.isFormData(s)&&(Bn.isStandardBrowserEnv||Bn.isStandardBrowserWebWorkerEnv?i.setContentType(!1):i.setContentType("multipart/form-data;",!1));let h=new XMLHttpRequest;if(n.auth){const A=n.auth.username||"",g=n.auth.password?unescape(encodeURIComponent(n.auth.password)):"";i.set("Authorization","Basic "+btoa(A+":"+g))}const m=h0(n.baseURL,n.url);h.open(n.method.toUpperCase(),l0(m,n.params,n.paramsSerializer),!0),h.timeout=n.timeout;function E(){if(!h)return;const A=rn.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),D={data:!o||o==="text"||o==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:A,config:n,request:h};sy(function(U){t(U),l()},function(U){r(U),l()},D),h=null}if("onloadend"in h?h.onloadend=E:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(E)},h.onabort=function(){h&&(r(new De("Request aborted",De.ECONNABORTED,n,h)),h=null)},h.onerror=function(){r(new De("Network Error",De.ERR_NETWORK,n,h)),h=null},h.ontimeout=function(){let g=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const D=n.transitional||d0;n.timeoutErrorMessage&&(g=n.timeoutErrorMessage),r(new De(g,D.clarifyTimeoutError?De.ETIMEDOUT:De.ECONNABORTED,n,h)),h=null},Bn.isStandardBrowserEnv){const A=(n.withCredentials||cy(m))&&n.xsrfCookieName&&iy.read(n.xsrfCookieName);A&&i.set(n.xsrfHeaderName,A)}s===void 0&&i.setContentType(null),"setRequestHeader"in h&&q.forEach(i.toJSON(),function(g,D){h.setRequestHeader(D,g)}),q.isUndefined(n.withCredentials)||(h.withCredentials=!!n.withCredentials),o&&o!=="json"&&(h.responseType=n.responseType),typeof n.onDownloadProgress=="function"&&h.addEventListener("progress",Nd(n.onDownloadProgress,!0)),typeof n.onUploadProgress=="function"&&h.upload&&h.upload.addEventListener("progress",Nd(n.onUploadProgress)),(n.cancelToken||n.signal)&&(a=A=>{h&&(r(!A||A.type?new Qs(null,n,h):A),h.abort(),h=null)},n.cancelToken&&n.cancelToken.subscribe(a),n.signal&&(n.signal.aborted?a():n.signal.addEventListener("abort",a)));const S=ly(m);if(S&&Bn.protocols.indexOf(S)===-1){r(new De("Unsupported protocol "+S+":",De.ERR_BAD_REQUEST,n));return}h.send(s||null)})},Fi={http:Lg,xhr:fy};q.forEach(Fi,(n,e)=>{if(n){try{Object.defineProperty(n,"name",{value:e})}catch{}Object.defineProperty(n,"adapterName",{value:e})}});const hy={getAdapter:n=>{n=q.isArray(n)?n:[n];const{length:e}=n;let t,r;for(let s=0;s<e&&(t=n[s],!(r=q.isString(t)?Fi[t.toLowerCase()]:t));s++);if(!r)throw r===!1?new De(`Adapter ${t} is not supported by the environment`,"ERR_NOT_SUPPORT"):new Error(q.hasOwnProp(Fi,t)?`Adapter '${t}' is not available in the build`:`Unknown adapter '${t}'`);if(!q.isFunction(r))throw new TypeError("adapter is not a function");return r},adapters:Fi};function pa(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new Qs(null,n)}function zd(n){return pa(n),n.headers=rn.from(n.headers),n.data=ba.call(n,n.transformRequest),["post","put","patch"].indexOf(n.method)!==-1&&n.headers.setContentType("application/x-www-form-urlencoded",!1),hy.getAdapter(n.adapter||ls.adapter)(n).then(function(r){return pa(n),r.data=ba.call(n,n.transformResponse,r),r.headers=rn.from(r.headers),r},function(r){return f0(r)||(pa(n),r&&r.response&&(r.response.data=ba.call(n,n.transformResponse,r.response),r.response.headers=rn.from(r.response.headers))),Promise.reject(r)})}const Hd=n=>n instanceof rn?n.toJSON():n;function Xr(n,e){e=e||{};const t={};function r(h,m,E){return q.isPlainObject(h)&&q.isPlainObject(m)?q.merge.call({caseless:E},h,m):q.isPlainObject(m)?q.merge({},m):q.isArray(m)?m.slice():m}function s(h,m,E){if(q.isUndefined(m)){if(!q.isUndefined(h))return r(void 0,h,E)}else return r(h,m,E)}function i(h,m){if(!q.isUndefined(m))return r(void 0,m)}function o(h,m){if(q.isUndefined(m)){if(!q.isUndefined(h))return r(void 0,h)}else return r(void 0,m)}function a(h,m,E){if(E in e)return r(h,m);if(E in n)return r(void 0,h)}const l={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(h,m)=>s(Hd(h),Hd(m),!0)};return q.forEach(Object.keys(Object.assign({},n,e)),function(m){const E=l[m]||s,S=E(n[m],e[m],m);q.isUndefined(S)&&E!==a||(t[m]=S)}),t}const m0="1.4.0",Jc={};["object","boolean","number","function","string","symbol"].forEach((n,e)=>{Jc[n]=function(r){return typeof r===n||"a"+(e<1?"n ":" ")+n}});const qd={};Jc.transitional=function(e,t,r){function s(i,o){return"[Axios v"+m0+"] Transitional option '"+i+"'"+o+(r?". "+r:"")}return(i,o,a)=>{if(e===!1)throw new De(s(o," has been removed"+(t?" in "+t:"")),De.ERR_DEPRECATED);return t&&!qd[o]&&(qd[o]=!0,console.warn(s(o," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(i,o,a):!0}};function my(n,e,t){if(typeof n!="object")throw new De("options must be an object",De.ERR_BAD_OPTION_VALUE);const r=Object.keys(n);let s=r.length;for(;s-- >0;){const i=r[s],o=e[i];if(o){const a=n[i],l=a===void 0||o(a,i,n);if(l!==!0)throw new De("option "+i+" must be "+l,De.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new De("Unknown option "+i,De.ERR_BAD_OPTION)}}const cc={assertOptions:my,validators:Jc},Yn=cc.validators;let gr=class{constructor(e){this.defaults=e,this.interceptors={request:new Ld,response:new Ld}}request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=Xr(this.defaults,t);const{transitional:r,paramsSerializer:s,headers:i}=t;r!==void 0&&cc.assertOptions(r,{silentJSONParsing:Yn.transitional(Yn.boolean),forcedJSONParsing:Yn.transitional(Yn.boolean),clarifyTimeoutError:Yn.transitional(Yn.boolean)},!1),s!=null&&(q.isFunction(s)?t.paramsSerializer={serialize:s}:cc.assertOptions(s,{encode:Yn.function,serialize:Yn.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o;o=i&&q.merge(i.common,i[t.method]),o&&q.forEach(["delete","get","head","post","put","patch","common"],g=>{delete i[g]}),t.headers=rn.concat(o,i);const a=[];let l=!0;this.interceptors.request.forEach(function(D){typeof D.runWhen=="function"&&D.runWhen(t)===!1||(l=l&&D.synchronous,a.unshift(D.fulfilled,D.rejected))});const h=[];this.interceptors.response.forEach(function(D){h.push(D.fulfilled,D.rejected)});let m,E=0,S;if(!l){const g=[zd.bind(this),void 0];for(g.unshift.apply(g,a),g.push.apply(g,h),S=g.length,m=Promise.resolve(t);E<S;)m=m.then(g[E++],g[E++]);return m}S=a.length;let A=t;for(E=0;E<S;){const g=a[E++],D=a[E++];try{A=g(A)}catch(x){D.call(this,x);break}}try{m=zd.call(this,A)}catch(g){return Promise.reject(g)}for(E=0,S=h.length;E<S;)m=m.then(h[E++],h[E++]);return m}getUri(e){e=Xr(this.defaults,e);const t=h0(e.baseURL,e.url);return l0(t,e.params,e.paramsSerializer)}};q.forEach(["delete","get","head","options"],function(e){gr.prototype[e]=function(t,r){return this.request(Xr(r||{},{method:e,url:t,data:(r||{}).data}))}});q.forEach(["post","put","patch"],function(e){function t(r){return function(i,o,a){return this.request(Xr(a||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}gr.prototype[e]=t(),gr.prototype[e+"Form"]=t(!0)});let by=class b0{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(i){t=i});const r=this;this.promise.then(s=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](s);r._listeners=null}),this.promise.then=s=>{let i;const o=new Promise(a=>{r.subscribe(a),i=a}).then(s);return o.cancel=function(){r.unsubscribe(i)},o},e(function(i,o,a){r.reason||(r.reason=new Qs(i,o,a),t(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}static source(){let e;return{token:new b0(function(s){e=s}),cancel:e}}};function py(n){return function(t){return n.apply(null,t)}}function gy(n){return q.isObject(n)&&n.isAxiosError===!0}const lc={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(lc).forEach(([n,e])=>{lc[e]=n});function p0(n){const e=new gr(n),t=Zf(gr.prototype.request,e);return q.extend(t,gr.prototype,e,{allOwnKeys:!0}),q.extend(t,e,null,{allOwnKeys:!0}),t.create=function(s){return p0(Xr(n,s))},t}const ve=p0(ls);ve.Axios=gr;ve.CanceledError=Qs;ve.CancelToken=by;ve.isCancel=f0;ve.VERSION=m0;ve.toFormData=go;ve.AxiosError=De;ve.Cancel=ve.CanceledError;ve.all=function(e){return Promise.all(e)};ve.spread=py;ve.isAxiosError=gy;ve.mergeConfig=Xr;ve.AxiosHeaders=rn;ve.formToJSON=n=>u0(q.isHTMLForm(n)?new FormData(n):n);ve.HttpStatusCode=lc;ve.default=ve;const{Axios:W6,AxiosError:P6,CanceledError:L6,isCancel:O6,CancelToken:N6,VERSION:z6,all:H6,Cancel:q6,isAxiosError:K6,spread:j6,toFormData:$6,AxiosHeaders:V6,HttpStatusCode:G6,formToJSON:Y6,mergeConfig:X6}=ve,Ln=60*1e3,g0={Mainnet:{api:"https://api.wormholescan.io",circleAPI:sd("Mainnet"),chains:ua("Mainnet")},Testnet:{api:"https://api.testnet.wormholescan.io",circleAPI:sd("Testnet"),chains:ua("Testnet")},Devnet:{api:"http://guardian:7071",circleAPI:"",chains:ua("Devnet")}};function y0(n,e){return Object.fromEntries(Object.entries(g0[n].chains).filter(([t,r])=>r.platform==e))}function yy(n,e){let t=g0[n];return e?Qc(t,e):t}function wy(n,e,t){const r=y0(n,e);return t?Qc(r,t):r}function Qc(n,e){n||(n={});for(const[t,r]of Object.entries(e))typeof r=="object"&&!Array.isArray(r)?n[t]=Qc(n[t],r):n[t]=r;return n}const Ay=typeof Ve.process<"u";Ay&&Ve.process.env.NETWORK;async function ds(n,e,t=Ln,r){const s=Math.floor(t/e);let i=0;return new Promise((o,a)=>{n().then(l=>{if(l!==null){o(l);return}let h=setInterval(async()=>{if(i>=s){clearInterval(h),o(null);return}const m=await n();m!==null?(clearInterval(h),o(m)):r&&console.log(`Retrying ${r}, attempt ${i}/${s} `),i++},e)})})}const Ey=2e3;var Kd;(function(n){n.complete="complete",n.pending_confirmations="pending_confirmations"})(Kd||(Kd={}));const By=n=>({message:n.attestation,status:n.status});async function xy(n,e){var r;const t=`${n}/${e}`;try{const s=await ve.get(t),i=By(s==null?void 0:s.data);return i.message==="PENDING"?null:i.message}catch(s){if(!s||typeof s=="object"&&(ve.isAxiosError(s)&&((r=s.response)==null?void 0:r.status)===404||"status"in s&&s.status===404))return null;throw s}}async function Cy(n,e,t){return ds(()=>xy(n,e),Ey,t,"Circle:GetAttestation")}async function Os(n,e,t){if(!bp(t))throw new Error("Invalid signer, not SignAndSendSigner or SignOnlySigner");return(await Sy(e,async i=>Yc(t)?t.signAndSend(i):n.sendWait(await t.sign(i)))).map(i=>({chain:n.chain,txid:i}))}async function Sy(n,e){const t=[];let r=[];for await(const s of n)s.parallelizable?r.push(s):(r.length>0&&(t.push(...await e(r)),r=[]),t.push(...await e([s])));return r.length>0&&t.push(...await e(r)),t}exports.TransferState=void 0;(function(n){n[n.Failed=-1]="Failed",n[n.Created=0]="Created",n[n.SourceInitiated=1]="SourceInitiated",n[n.SourceFinalized=2]="SourceFinalized",n[n.InReview=3]="InReview",n[n.Attested=4]="Attested",n[n.Refunded=5]="Refunded",n[n.DestinationInitiated=6]="DestinationInitiated",n[n.DestinationQueued=7]="DestinationQueued",n[n.DestinationFinalized=8]="DestinationFinalized"})(exports.TransferState||(exports.TransferState={}));function el(n){return n.state===exports.TransferState.SourceInitiated}function Ns(n){return n.state===exports.TransferState.SourceFinalized}function jd(n){return n.state===exports.TransferState.InReview}function zs(n){return n.state===exports.TransferState.Attested}function Dy(n){return n.state===exports.TransferState.Refunded}function tl(n){return n.state===exports.TransferState.DestinationInitiated}function vy(n){return n.state===exports.TransferState.DestinationQueued}function ky(n){return n.state===exports.TransferState.DestinationFinalized}function Fy(n){return n.state<0}class Ct{constructor(e,t,r,s){re(this,"wh");re(this,"fromChain");re(this,"toChain");re(this,"_state");re(this,"transfer");re(this,"txids",[]);re(this,"attestations");this._state=exports.TransferState.Created,this.wh=e,this.transfer=t,this.fromChain=r??e.getChain(t.from.chain),this.toChain=s??e.getChain(t.to.chain)}getTransferState(){return this._state}static async from(e,t,r=Ln,s,i){if(Ep(t))return t={...t,...await Ct.destinationOverrides(e.getChain(t.from.chain),e.getChain(t.to.chain),t)},new Ct(e,t,s,i);let o;if(pr(t))o=await Ct.fromWormholeMessageId(e,t,r);else if(Hf(t))o=await Ct.fromTransaction(e,t,r,s);else if(Oi(t))o=await Ct.fromCircleMessage(e,t);else throw new Error("Invalid `from` parameter for CircleTransfer");return o.fromChain=s??e.getChain(o.transfer.from.chain),o.toChain=i??e.getChain(o.transfer.to.chain),await o.fetchAttestation(r),o}static async fromWormholeMessageId(e,t,r){const{chain:s,emitter:i}=t,o=await Ct.getTransferVaa(e,t),a=o.payload.mintRecipient,l=Ci(e.network,o.payload.targetDomain),{wormholeRelayer:h}=e.config.chains[l].contracts.cctp;let m=!1;if(h){const A=sn.chainAddress(s,h).address.toUniversalAddress();m=o.payloadName==="TransferWithRelay"&&a.equals(A)}const E={from:{chain:t.chain,address:o.payload.caller},to:{chain:l,address:a},amount:o.payload.token.amount,automatic:m},S=new Ct(e,E);return S.attestations=[{id:{emitter:i,sequence:o.sequence,chain:s},attestation:o}],S._state=exports.TransferState.Attested,S}static async fromCircleMessage(e,t){const[r,s]=exports.CircleBridge.deserialize(_t.decode(t)),{payload:i}=r,o=i.messageSender,a=i.mintRecipient,l=Ci(e.network,r.sourceDomain),h=Ci(e.network,r.destinationDomain),m={from:{chain:l,address:o},to:{chain:h,address:a},amount:i.amount,automatic:!1},E=new Ct(e,m);return E.attestations=[{id:{hash:s},attestation:{message:r}}],E._state=exports.TransferState.SourceInitiated,E}static async fromTransaction(e,t,r,s){const{chain:i,txid:o}=t;s=s??e.getChain(i);let a=[];try{a=await s.parseTransaction(o)}catch(h){if(!(h.message.includes("no bridge messages found")||h.message.includes("not found")))throw h}let l;if(a.length>0)l=await Ct.fromWormholeMessageId(e,a[0],r);else{const m=await(await s.getCircleBridge()).parseTransactionDetails(o),E={...m,automatic:!1};l=new Ct(e,E),l.attestations=[{id:m.id,attestation:{message:m.message}}]}return l._state=exports.TransferState.SourceInitiated,l.txids=[t],l}async initiateTransfer(e){if(this._state!==exports.TransferState.Created)throw new Error("Invalid state transition in `start`");return this.txids=await Ct.transfer(this.fromChain,this.transfer,e),this._state=exports.TransferState.SourceInitiated,this.txids.map(({txid:t})=>t)}async _fetchWormholeAttestation(e){let t=this.attestations??[];if(!t||t.length==0)throw new Error("No VAA details available");for(const r in t)t[r].attestation||(t[r].attestation=await Ct.getTransferVaa(this.wh,t[r].id,e));return this.attestations=t,t.map(r=>r.id)}async _fetchCircleAttestation(e){var r,s;let t=this.attestations??[];if(!t||t.length==0){if(this.txids.length===0)throw new Error("No circle attestations or transactions to fetch");const i=this.txids[((r=this.txids)==null?void 0:r.length)-1],l=await(await this.wh.getChain(this.transfer.from.chain).getCircleBridge()).parseTransactionDetails(i.txid);t=[{id:l.id,attestation:{message:l.message}}]}for(const i in t){const o=t[i];if((s=o.attestation)!=null&&s.attestation)continue;const a=await this.wh.getCircleAttestation(o.id.hash,e);if(a===null)throw new Error("No attestation available after timeout exhausted");t[i].attestation.attestation=a}return this.attestations=t,t.map(i=>i.id)}async fetchAttestation(e){if(this._state<exports.TransferState.SourceInitiated)throw new Error("Invalid state transition in `fetchAttestation`");const t=this.transfer.automatic?(await Promise.all([this._fetchWormholeAttestation(e),this._fetchCircleAttestation(e)])).flat():await this._fetchCircleAttestation(e);if(this._state=exports.TransferState.Attested,this.attestations&&this.attestations.length>0)for(const r of this.attestations){const{attestation:s}=r;if(!exports.CircleBridge.isCircleAttestation(s))continue;await Ct.isTransferComplete(this.toChain,s)&&(this._state=exports.TransferState.DestinationFinalized)}return t}async completeTransfer(e){var E;if(this._state<exports.TransferState.Attested)throw new Error("Invalid state transition in `finish`");if(this.transfer.automatic)throw this.attestations?this.attestations.find(A=>pr(A.id))?new Error("No method to redeem auto circle bridge tx (yet)"):new Error("No VAA found"):new Error("No VAA details available");if(!this.attestations)throw new Error("No Circle Attestations found");const t=this.attestations.filter(S=>Oi(S.id));if(t.length>1)throw new Error(`Expected a single circle attestation, found ${t.length}`);const{id:r,attestation:s}=t[0];if(!s)throw new Error(`No Circle Attestation for ${r.hash}`);const{message:i,attestation:o}=s;if(!o)throw new Error(`No Circle Attestation for ${r.hash}`);const a=await this.toChain.getCircleBridge(),l=sn.parseAddress(e.chain(),e.address()),h=a.redeem(l,i,o),m=await Os(this.toChain,h,e);return(E=this.txids)==null||E.push(...m),m.map(({txid:S})=>S)}}(function(n){async function e(h,m,E){let S;return m.automatic?S=(await h.getAutomaticCircleBridge()).transfer(m.from.address,{chain:m.to.chain,address:m.to.address},m.amount,m.nativeGas):S=(await h.getCircleBridge()).transfer(m.from.address,{chain:m.to.chain,address:m.to.address},m.amount),await Os(h,S,E)}n.transfer=e;async function*t(h,m,E=Ln,S,A){var x,U;const g=Date.now(),D=(R,F)=>Math.max(F-(Date.now()-R),0);if(S=S??h.getChain(m.from),A=A??h.getChain(m.to),el(m)){if(m.originTxs.length===0)throw"Invalid state transition: no originating transactions";const R=m.originTxs[m.originTxs.length-1],F=await n.getTransferMessage(S,R.txid);m={...m,attestation:{id:F.id,attestation:{message:F.message}},state:exports.TransferState.SourceFinalized},yield m}if(Ns(m)){if(!m.attestation)throw"Invalid state transition: no attestation id";if(pr(m.attestation.id)){let R=m.attestation.attestation?m.attestation.attestation:void 0;R||(R=await n.getTransferVaa(h,m.attestation.id,D(g,E)),m={...m,attestation:{id:m.attestation.id,attestation:R},state:exports.TransferState.Attested},yield m)}else if(Oi(m.attestation.id)){const R=await h.getCircleAttestation(m.attestation.id.hash,E),F=m.originTxs[m.originTxs.length-1],z=await(await S.getCircleBridge()).parseTransactionDetails(F.txid);R&&(m={...m,attestation:{id:m.attestation.id,attestation:{attestation:R,message:z.message}},state:exports.TransferState.Attested},yield m)}}if(zs(m)||Ns(m)){if(!m.attestation)throw"Invalid state transition";if(pr(m.attestation.id)){const R=await h.getTransactionStatus(m.attestation.id,D(g,E));if(R&&((U=(x=R.globalTx)==null?void 0:x.destinationTx)!=null&&U.txHash)){const{chainId:F,txHash:W}=R.globalTx.destinationTx;m={...m,destinationTxs:[{chain:rs(F),txid:W}],state:exports.TransferState.DestinationInitiated},yield m}}}(zs(m)||tl(m))&&(await n.isTransferComplete(A,m.attestation.attestation)&&(m={...m,state:exports.TransferState.DestinationFinalized,destinationTxs:[]}),yield m)}n.track=t;async function r(h,m,E){const S={...E};if(E.to.chain==="Solana"&&!S.automatic){const A=sn.parseAddress("Solana",Ds.get(m.network,m.chain));S.to=await m.getTokenAccount(S.to.address,A)}return S}n.destinationOverrides=r;async function s(h,m,E){const S=Ds.get(m.network,m.chain);if(!S)throw"Invalid transfer, no USDC contract on destination";const A=Ds.get(h.network,h.chain);if(!A)throw"Invalid transfer, no USDC contract on source";const g=sn.chainAddress(m.chain,S),D=sn.chainAddress(h.chain,A),x=(h.chain==="Polygon"?2e3*200:Tc(h.chain))+_c,U=E.automatic?Fs(0,5,0):Fs(24,0,0);if(!E.automatic)return{sourceToken:{token:D,amount:E.amount},destinationToken:{token:g,amount:E.amount},eta:x,expires:U};let R=E.amount;const F=E.nativeGas?E.nativeGas:0n;R-=F;const z=await(await h.getAutomaticCircleBridge()).getRelayerFee(m.chain);R-=z;let H=0n;return E.nativeGas&&(H=await(await m.getAutomaticCircleBridge()).nativeTokenAmount(F)),{sourceToken:{token:D,amount:E.amount},destinationToken:{token:g,amount:R},relayFee:{token:D,amount:z},destinationNativeGas:H,eta:x,expires:U}}n.quoteTransfer=s;async function i(h,m){if(!exports.CircleBridge.isCircleAttestation(m))throw new Error("Must check for completion with circle message");return await(await h.getCircleBridge()).isTransferCompleted(m.message)}n.isTransferComplete=i;async function o(h,m,E){const S=await h.getVaa(m,"AutomaticCircleBridge:TransferWithRelay",E);if(!S)throw new Error("No VAA available after timeout exhausted");return S}n.getTransferVaa=o;async function a(h,m){return await(await h.getCircleBridge()).parseTransactionDetails(m)}n.getTransferMessage=a;function l(h){var R,F;const{from:m,to:E}=h.transfer;let S={from:m.chain,to:E.chain,state:exports.TransferState.Created};const A=h.txids.filter(W=>W.chain===h.transfer.from.chain);A.length>0&&(S={...S,state:exports.TransferState.SourceInitiated,originTxs:A});const g=((R=h.attestations)==null?void 0:R.filter(W=>pr(W.id)))??[],D=((F=h.attestations)==null?void 0:F.filter(W=>Oi(W.id)))??[],x=D.length>0?D[0]:g.length>0?g[0]:void 0;x&&x.id&&(S={...S,state:exports.TransferState.SourceFinalized,attestation:x},x.attestation&&(S={...S,state:exports.TransferState.Attested,attestation:{id:x.id,attestation:x.attestation}}));const U=h.txids.filter(W=>W.chain===h.transfer.to.chain);return U.length>0&&(S={...S,state:exports.TransferState.DestinationInitiated,destinationTxs:U}),S}n.getReceipt=l})(Ct||(Ct={}));const yo=2e3;async function w0(n,e){var l;const{chain:t,emitter:r,sequence:s}=e,i=Ys(t),o=Ru("0x",r.toString()),a=`${n}/v1/signed_vaa/${i}/${o}/${s}`;try{const{data:{vaaBytes:h}}=await ve.get(a);return no.decode(h)}catch(h){if(!h||typeof h=="object"&&(ve.isAxiosError(h)&&((l=h.response)==null?void 0:l.status)===404||"status"in h&&h.status===404))return null;throw h}}async function Ty(n,e,t){return await ds(()=>w0(n,e),yo,t,"Wormholescan:GetVaaBytes")}async function Iy(n,e,t){const r=await w0(n,e);return r?Ps(t,r):null}async function Uy(n,e,t,r){return await ds(()=>Iy(n,e,t),yo,r,"Wormholescan:GetVaaBytes")}async function _y(n,e){var l;const{chain:t,emitter:r,sequence:s}=e,i=Ys(t),o=r.toUniversalAddress().toString(),a=`${n}/api/v1/transactions/${i}/${o}/${s}`;try{return(await ve.get(a)).data}catch(h){if(!h||typeof h=="object"&&(ve.isAxiosError(h)&&((l=h.response)==null?void 0:l.status)===404||"status"in h&&h.status===404))return null;throw h}}async function My(n,e,t){return await ds(()=>_y(n,e),yo,t,"Wormholescan:GetTransactionStatus")}async function Ry(n,e){var r;const t=`${n}/api/v1/vaas?txHash=${e}`;try{const s=await ve.get(t);if(s.data.data.length>0)return s.data.data[0]}catch(s){if(!s||typeof s=="object"&&(ve.isAxiosError(s)&&((r=s.response)==null?void 0:r.status)===404||"status"in s&&s.status===404))return null;throw s}return null}async function $d(n,e,t,r){const i=await ds(()=>Ry(n,e),yo,r,"Wormholescan:GetVaaByTxHash");return i?Ps(t,no.decode(i.vaa)):null}async function Wy(n,e,t=50,r=0){var i;const s=`${n}/api/v1/transactions?address=${e}&pageSize=${t}&page=${r}`;try{const o=await ve.get(s);if(o.data.transactions.length>0)return o.data.transactions}catch(o){if(!o||typeof o=="object"&&(ve.isAxiosError(o)&&((i=o.response)==null?void 0:i.status)===404||"status"in o&&o.status===404))return null;throw o}return null}async function Py(n){const e=`${n}/v1/governor/token_list`;try{const t=await ve.get(e);if(t.data&&t.data.entries.length>0)return t.data.entries.reduce((r,s)=>{const i=rs(s.originChainId);return r[i]=r[i]||{},r[i][s.originAddress]=s.price,r},{})}catch{}return null}async function Ly(n){const e=`${n}/v1/governor/available_notional_by_chain`;try{const t=await ve.get(e);if(t.data&&t.data.entries.length>0)return t.data.entries.reduce((r,s)=>{const i=s.bigTransactionSize==="0"?void 0:Cs(Ei(s.bigTransactionSize,2));return r[rs(s.chainId)]={available:Cs(Ei(s.remainingAvailableNotional,2)),limit:Cs(Ei(s.notionalLimit,2)),maxSize:i},r},{})}catch{}return null}async function Oy(n,e){const{chain:t,emitter:r,sequence:s}=e,i=Ys(t),o=r.toUniversalAddress().toString(),a=`${n}/v1/governor/is_vaa_enqueued/${i}/${o}/${s}`;return(await ve.get(a)).data.isEnqueued}class At{constructor(e,t,r,s){re(this,"wh");re(this,"fromChain");re(this,"toChain");re(this,"_state");re(this,"transfer");re(this,"txids",[]);re(this,"attestations");this._state=exports.TransferState.Created,this.wh=e,this.transfer=t,this.fromChain=r??e.getChain(t.from.chain),this.toChain=s??e.getChain(t.to.chain)}getTransferState(){return this._state}static async from(e,t,r=6e3,s,i){if(Ip(t))return s=s??e.getChain(t.from.chain),i=i??e.getChain(t.to.chain),At.validateTransferDetails(e,t,s,i),t={...t,...await At.destinationOverrides(s,i,t)},new At(e,t,s,i);let o;if(pr(t))o=await At.fromIdentifier(e,t,r);else if(Hf(t))o=await At.fromTransaction(e,t,r,s);else throw new Error("Invalid `from` parameter for TokenTransfer");return o.fromChain=s??e.getChain(o.transfer.from.chain),o.toChain=i??e.getChain(o.transfer.to.chain),await o.fetchAttestation(r),o}static async fromIdentifier(e,t,r){const s=await At.getTransferVaa(e,t,r);if(!s)throw new Error("VAA not found");const i=s.protocolName==="AutomaticTokenBridge";let o={chain:s.emitterChain,address:s.emitterAddress},{token:a,to:l}=s.payload,h;if(a.chain===o.chain)h=await e.getTokenNativeAddress(o.chain,a.chain,a.address);else{const U=await(await(await e.getChain(o.chain)).getTokenBridge()).getWrappedAsset(a);h=sr(o.chain,U.toString())}const m=await e.getDecimals(o.chain,h),E=xs(Kr(a.amount,Math.min(m,At.MAX_DECIMALS)),m);let S=0n;i&&(S=s.payload.payload.toNativeTokenAmount,o={chain:s.emitterChain,address:s.payload.from},l={chain:s.payload.to.chain,address:s.payload.payload.targetRecipient});const A={token:a,amount:gn(E),from:o,to:l,automatic:i,nativeGas:S},g=new At(e,A);return g.attestations=[{id:t,attestation:s}],g._state=exports.TransferState.Attested,g}static async fromTransaction(e,t,r,s){s=s??e.getChain(t.chain);const i=await At.getTransferMessage(s,t.txid,r),o=await At.fromIdentifier(e,i,r);return o.txids=[t],o}async initiateTransfer(e){if(this._state!==exports.TransferState.Created)throw new Error("Invalid state transition in `initiateTransfer`");return this.txids=await At.transfer(this.fromChain,this.transfer,e),this._state=exports.TransferState.SourceInitiated,this.txids.map(({txid:t})=>t)}async fetchAttestation(e){if(this._state<exports.TransferState.SourceInitiated||this._state>exports.TransferState.Attested)throw new Error("Invalid state transition in `fetchAttestation`, expected at least `SourceInitiated`");if(!this.attestations||this.attestations.length===0){if(this.txids.length===0)throw new Error("No VAAs set and txids available to look them up");const t=this.txids[this.txids.length-1],r=await At.getTransferMessage(this.fromChain,t.txid,e);this.attestations=[{id:r}]}for(const t in this.attestations){if(this.attestations[t].attestation)continue;const r=await At.getTransferVaa(this.wh,this.attestations[t].id,e);if(!r)throw new Error("VAA not found");this.attestations[t].attestation=r}if(this._state=exports.TransferState.Attested,this.attestations.length>0){const{attestation:t}=this.attestations[0];await At.isTransferComplete(this.toChain,t)&&(this._state=exports.TransferState.DestinationFinalized)}return this.attestations.map(t=>t.id)}async completeTransfer(e){if(this._state<exports.TransferState.Attested)throw new Error("Invalid state transition, must be attested prior to calling `completeTransfer`.");if(!this.attestations)throw new Error("No VAA details available");const{attestation:t}=this.attestations[0];if(!t)throw new Error(`No VAA found for ${this.attestations[0].id.sequence}`);const r=await At.redeem(this.toChain,t,e);return this.txids.push(...r),this._state=exports.TransferState.DestinationInitiated,r.map(({txid:s})=>s)}}(function(n){n.MAX_DECIMALS=8;async function e(A,g,D){const x=sr(D.chain(),D.address()),U=fo(g.token)?g.token.address:g.token;let R;return g.automatic?R=(await A.getAutomaticTokenBridge()).transfer(x,g.to,U,g.amount,g.nativeGas):R=(await A.getTokenBridge()).transfer(x,g.to,U,g.amount,g.payload),Os(A,R,D)}n.transfer=e;async function t(A,g,D){const x=sr(D.chain(),D.address()),U=g.protocolName==="AutomaticTokenBridge"?(await A.getAutomaticTokenBridge()).redeem(x,g):(await A.getTokenBridge()).redeem(x,g);return Os(A,U,D)}n.redeem=t;async function*r(A,g,D=Ln,x,U){var W,z;const R=Date.now(),F=(H,K)=>Math.max(K-(Date.now()-H),0);if(x=x??A.getChain(g.from),el(g)){if(g.originTxs.length===0)throw"Origin transactions required to fetch message id";const{txid:H}=g.originTxs[g.originTxs.length-1],K=await n.getTransferMessage(x,H,F(R,D));g={...g,state:exports.TransferState.SourceFinalized,attestation:{id:K}},yield g}if(Ns(g)||jd(g)){if(!g.attestation.id)throw"Attestation id required to fetch attestation";const{id:H}=g.attestation,K=await n.getTransferVaa(A,H,F(R,D));throw K?(g={...g,attestation:{id:H,attestation:K},state:exports.TransferState.Attested},yield g):await n.isTransferEnqueued(A,H)&&(g={...g,state:exports.TransferState.InReview},yield g),new Error("Attestation not found")}if(zs(g)||Ns(g)||jd(g)){if(!g.attestation.id)throw"Attestation id required to fetch redeem tx";const{id:H}=g.attestation,K=await A.getTransactionStatus(H,F(R,D));if(K&&((z=(W=K.globalTx)==null?void 0:W.destinationTx)!=null&&z.txHash)){const{chainId:G,txHash:V}=K.globalTx.destinationTx;g={...g,destinationTxs:[{chain:rs(G),txid:V}],state:exports.TransferState.DestinationInitiated}}yield g}if(zs(g)||tl(g)){if(!g.attestation.attestation)throw"Signed Attestation required to check for redeem";if(g.attestation.attestation.payloadName==="AttestMeta")throw new Error("Unable to track an AttestMeta receipt");await n.isTransferComplete(U??A.getChain(g.attestation.attestation.payload.to.chain),g.attestation.attestation)&&(g={...g,state:exports.TransferState.DestinationFinalized}),yield g}yield g}n.track=r;function s(A){const{transfer:g}=A,D=g.from.chain,x=g.to.chain;let U={from:D,to:x,state:exports.TransferState.Created};const R=A.txids.filter(H=>H.chain===g.from.chain);R.length>0&&(U={...U,state:exports.TransferState.SourceInitiated,originTxs:R});const F=A.attestations&&A.attestations.length>0?A.attestations[0]:void 0,W=F&&F.id?{id:F.id,attestation:F.attestation}:void 0;W&&W.id&&(U={...U,state:exports.TransferState.SourceFinalized,attestation:{id:W.id}},W.attestation&&(U={...U,state:exports.TransferState.Attested,attestation:{id:W.id,attestation:W.attestation}}));const z=A.txids.filter(H=>H.chain===g.to.chain);return z.length>0&&(U={...U,state:exports.TransferState.DestinationFinalized,destinationTxs:z}),U}n.getReceipt=s;async function i(A,g,D){let x;const U=await A.getTokenBridge();if(Ot(D.address)){const W=await U.getWrappedNative();x={chain:D.chain,address:await U.getTokenUniversalAddress(W)}}else try{let W;Nt.instanceof(D.address)?W=await U.getWrappedAsset(D):W=D.address,x=await U.getOriginalAsset(W)}catch(W){if(!W.message.includes("not a wrapped asset"))throw W;let z;Nt.instanceof(D.address)?z=await U.getTokenNativeAddress(A.chain,D.address):z=D.address,x={chain:D.chain,address:await U.getTokenUniversalAddress(z)}}const R=await g.getTokenBridge();if(x.chain===g.chain){const W=await R.getTokenNativeAddress(x.chain,x.address),z=await R.getWrappedNative();return Dn({chain:g.chain,address:z})===Dn({chain:g.chain,address:W})?{chain:g.chain,address:"native"}:{chain:g.chain,address:W}}const F=await R.getWrappedAsset(x);return{chain:g.chain,address:F}}n.lookupDestinationToken=i;async function o(A,g){return g.protocolName==="AutomaticTokenBridge"&&(g=Ps("TokenBridge:TransferWithPayload",ec(g))),(await A.getTokenBridge()).isTransferCompleted(g)}n.isTransferComplete=o;async function a(A,g,D){const x=await sn.parseMessageFromTx(A,g,D);if(x.length!==1)throw new Error("Expected a single Wormhole Message, got: "+x.length);return x[0]}n.getTransferMessage=a;async function l(A,g,D){const x=await A.getVaa(g,sc.getTransferDiscriminator(),D);if(!x)return null;if(x.payloadName==="TransferWithPayload"){const{chain:U,address:R}=x.payload.to,{tokenBridgeRelayer:F}=A.config.chains[U].contracts,W=F?Mf(U,F):null;if(W&&R.equals(W))return Ps("AutomaticTokenBridge:TransferWithRelay",ec(x))}return x}n.getTransferVaa=l;async function h(A,g){return await A.getIsVaaEnqueued(g)}n.isTransferEnqueued=h;function m(A,g,D,x){if(g.amount===0n)throw new Error("Amount cannot be 0");if(g.from.chain===g.to.chain)throw new Error("Cannot transfer to the same chain");if(D=D??A.getChain(g.from.chain),x=x??A.getChain(g.to.chain),g.automatic){if(g.payload)throw new Error("Payload with automatic delivery is not supported");if(!D.supportsAutomaticTokenBridge())throw new Error(`Automatic Token Bridge not supported on ${g.from.chain}`);if(!x.supportsAutomaticTokenBridge())throw new Error(`Automatic Token Bridge not supported on ${g.to.chain}`);const U=g.nativeGas??0n;if(U>g.amount)throw new Error(`Native gas amount > amount (${U} > ${g.amount})`)}else{if(g.nativeGas)throw new Error("Gas Dropoff is only supported for automatic transfers");if(!D.supportsTokenBridge())throw new Error(`Token Bridge not supported on ${g.from.chain}`);if(!x.supportsTokenBridge())throw new Error(`Token Bridge not supported on ${g.to.chain}`)}}n.validateTransferDetails=m;async function E(A,g,D,x){const U=await g.getTokenBridge();let R;if(Ot(x.token.address))R=await U.getWrappedNative();else if(Nt.instanceof(x.token.address))try{R=await U.getWrappedAsset(x.token)}catch(B){if(!B.message.includes("not a wrapped asset"))throw B;R=await U.getTokenNativeAddress(g.chain,x.token.address)}else R=x.token.address;sn.tokenId(g.chain,R.toString());const F=await g.getDecimals(R),W=Kr(x.amount,F),z=Bi(W,n.MAX_DECIMALS),[H,K]=await Promise.all([Py(A.config.api),Ly(A.config.api)]),G=[];if(K!==null&&g.chain in K&&H!==null){let B;if(Ot(x.token.address))B={chain:g.chain,address:await U.getTokenUniversalAddress(R)};else try{B=await U.getOriginalAsset(x.token.address)}catch(u){if(!u.message.includes("not a wrapped asset"))throw u;B={chain:g.chain,address:await U.getTokenUniversalAddress(R)}}if(B.chain in H&&B.address.toString()in H[B.chain]){const u=K[g.chain],$=H[B.chain][B.address.toString()]*Cs(z);u.maxSize&&$>u.maxSize&&G.push({type:"GovernorLimitWarning",reason:"ExceedsLargeTransferLimit"}),$>u.available&&G.push({type:"GovernorLimitWarning",reason:"ExceedsRemainingNotional"})}}const V=await n.lookupDestinationToken(g,D,x.token),ie=await D.getDecimals(V.address),ne=xs(z,ie),ae=Tc(g.chain)+_c;if(!x.automatic)return{sourceToken:{token:x.token,amount:gn(z)},destinationToken:{token:V,amount:gn(ne)},warnings:G.length>0?G:void 0,eta:ae,expires:Fs(24,0,0)};const c=await(await g.getAutomaticTokenBridge()).getRelayerFee(D.chain,R),b=xs(Bi(Kr(c,F),n.MAX_DECIMALS),ie),p=x.nativeGas??0n,y=gn(xs(Bi(Kr(p,F),n.MAX_DECIMALS),ie)),C=890880n;let T=0n;if(x.nativeGas){const B=await D.getAutomaticTokenBridge(),[u,k]=await Promise.all([B.maxSwapAmount(V.address),B.nativeTokenAmount(V.address,y)]);if(y>u)throw new Error(`Native gas amount exceeds maximum swap amount: ${Xl(y,ie)}>${Xl(u,ie)}`);if(D.chain==="Solana"&&k<C)throw new Error(`Native gas amount must be at least ${C} lamports`);T=k}const _=gn(ne)-y-gn(b);if(V.chain==="Solana"){const B=await D.getNativeWrappedTokenId();if((Ot(V.address)||Nf(V,B))&&_<C)throw new Error(`Destination amount must be at least ${C} lamports`)}return{sourceToken:{token:x.token,amount:gn(z)},destinationToken:{token:V,amount:_},relayFee:{token:V,amount:gn(b)},destinationNativeGas:T,warnings:G.length>0?G:void 0,eta:ae,expires:Fs(0,5,0)}}n.quoteTransfer=E;async function S(A,g,D){const x={...D};if(D.to.chain==="Solana"&&!x.automatic){const U=await n.lookupDestinationToken(A,g,x.token);if(Ot(U.address)){const R=await g.getNativeWrappedTokenId();x.to=await g.getTokenAccount(x.to.address,R.address)}else x.to=await g.getTokenAccount(x.to.address,U.address)}if(x.to.chain==="Sei"){if(x.to.chain==="Sei"&&x.payload)throw new Error("Arbitrary payloads unsupported for Sei");x.payload=zt.encode(JSON.stringify({basic_recipient:{recipient:no.encode(x.to.address.toString())}}));const U=g.config.contracts.translator;if(U===void 0||U==="")throw new Error("Unexpected empty translator address");x.to=sn.chainAddress(x.to.chain,U)}return x}n.destinationOverrides=S})(At||(At={}));function Ny(n){if(n.length===0)return[];const{chain:e}=n[0];if(!n.every(t=>t.chain===e))throw new Error("Not every chain is equal");return Array.from(new Set(n.map(t=>Dn(t)))).map(t=>sn.tokenId(e,t))}async function zy(n,e,t){const r=Dn(e),s=n.config.tokenMap?is.byAddress(n.config.tokenMap,r):void 0,i=s?s.symbol:void 0,o=Ot(e.address)?await n.getNativeWrappedTokenId():void 0;return t=t??await n.getDecimals(e.address),{id:e,decimals:t,wrapped:o,symbol:i}}class A0{constructor(e,t){re(this,"wh");re(this,"routeConstructors");re(this,"inputTokenList");this.wh=e,this.routeConstructors=t}async supportedDestinationTokens(e,t,r){const[,s]=zf(t.network,t.chain,e),i=await Promise.all(this.routeConstructors.map(async o=>{if(!o.supportedNetworks().includes(t.network))return[];const l=o.supportedChains(t.network);if(!l.includes(t.chain)||!l.includes(r.chain))return[];try{return await o.supportedDestinationTokens(s,t,r)}catch{return[]}}));return Ny(i.flat())}async findRoutes(e){return(await Promise.all(this.routeConstructors.map(async r=>{try{const s=r.supportedNetworks().includes(this.wh.network)&&r.supportedChains(this.wh.network).includes(e.toChain.chain)&&r.supportedChains(this.wh.network).includes(e.fromChain.chain),i=Dn(Ot(e.destination.id.address)?e.destination.wrapped:e.destination.id),o=(await r.supportedDestinationTokens(e.source.id,e.fromChain,e.toChain)).filter(a=>Dn(a)===i).length>0;return s&&o}catch{return!1}})).then(r=>this.routeConstructors.filter((s,i)=>r[i]))).map(r=>new r(this.wh))}}class sn{constructor(e,t,r){re(this,"_network");re(this,"_platforms");re(this,"_chains");re(this,"config");this._network=e,this.config=yy(e,r),this._chains=new Map,this._platforms=new Map;for(const s of t)this._platforms.set(s._platform,new s(e,this.config.chains))}get network(){return this._network}async circleTransfer(e,t,r,s,i,o){if(s&&i)throw new Error("Payload with automatic delivery is not supported");if(!Ha(this.network,t.chain)||!Ha(this.network,r.chain)||!od(this.network,t.chain)||!od(this.network,r.chain))throw new Error(`Network and chain not supported: ${this.network} ${t.chain} `);if(s){const h=await(await this.getChain(t.chain).getAutomaticCircleBridge()).getRelayerFee(r.chain)+(o||0n);if(e<h)throw new Error(`Amount must be > ${h} (relayerFee + nativeGas)`)}return await Ct.from(this,{amount:e,from:t,to:r,automatic:s,payload:i,nativeGas:o})}async tokenTransfer(e,t,r,s,i,o,a){return await At.from(this,{token:e,amount:t,from:r,to:s,automatic:i,payload:o,nativeGas:a})}resolver(e){return new A0(this,e)}getContracts(e){var t;return(t=this.config.chains[e])==null?void 0:t.contracts}getPlatform(e){const t=this._platforms.get(e);if(!t)throw new Error(`Not able to retrieve platform ${e}. Did it get registered in the constructor?`);return t}getChain(e){const t=ss(e);return this._chains.has(e)||this._chains.set(e,this.getPlatform(t).getChain(e)),this._chains.get(e)}async getWrappedAsset(e,t){const s=await this.getChain(e).getTokenBridge();return{chain:e,address:await s.getWrappedAsset(t)}}async getOriginalAsset(e){return await(await this.getChain(e.chain).getTokenBridge()).getOriginalAsset(e.address)}async getTokenUniversalAddress(e,t){return await(await this.getChain(e).getTokenBridge()).getTokenUniversalAddress(t)}async getTokenNativeAddress(e,t,r){return await(await this.getChain(e).getTokenBridge()).getTokenNativeAddress(t,r)}async getDecimals(e,t){return await this.getChain(e).getDecimals(t)}async getBalance(e,t,r){return this.getChain(e).getBalance(r,t)}async getTokenAccount(e,t){return this.getChain(e.chain).getTokenAccount(e.address,t.address)}async getVaaBytes(e,t=Ln){return await Ty(this.config.api,e,t)}async getVaa(e,t,r=Ln){return typeof e=="string"?await $d(this.config.api,e,t,r):await Uy(this.config.api,e,t,r)}async getIsVaaEnqueued(e){return await Oy(this.config.api,e)}async getCircleAttestation(e,t=Ln){return Cy(this.config.circleAPI,e,t)}async getTransactionStatus(e,t=Ln){let r;if(typeof e=="string"){const s=await $d(this.config.api,e,"Uint8Array",t);if(!s)return null;r={emitter:s.emitterAddress,chain:s.emitterChain,sequence:s.sequence}}else r=e;return await My(this.config.api,r,t)}async getTransactionsForAddress(e,t=50,r=0){return Wy(this.config.api,e,t,r)}static parseAddress(e,t){return sr(e,t)}static canonicalAddress(e){return Dn(e)}static chainAddress(e,t){return{chain:e,address:sn.parseAddress(e,t)}}static tokenId(e,t){return Ot(t)?Of(e):this.chainAddress(e,t)}static async parseMessageFromTx(e,t,r=Ln){const i=await ds(async()=>{try{const o=await e.parseTransaction(t);return o.length===0?null:o}catch(o){return console.error(o),null}},e.config.blockTime,r,"WormholeCore:ParseMessageFromTransaction");if(!i)throw new Error(`No WormholeMessageId found for ${t}`);return i}}class wo{constructor(e){re(this,"wh");this.wh=e}transferUrl(e){return`https://wormholescan.io/#/tx/${e}?network=${this.wh.network}`}}class E0 extends wo{}re(E0,"IS_AUTOMATIC",!0);function Hy(n){return!!n.constructor.IS_AUTOMATIC}class dc extends wo{}re(dc,"NATIVE_GAS_DROPOFF_SUPPORTED",!1),re(dc,"IS_AUTOMATIC",!1);function qy(n){return n.complete!==void 0}class Ky extends wo{}function jy(n){return n.finalize!==void 0}var uc={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */(function(n,e){var t=oe,r=t.Buffer;function s(o,a){for(var l in o)a[l]=o[l]}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?n.exports=t:(s(t,e),e.Buffer=i);function i(o,a,l){return r(o,a,l)}i.prototype=Object.create(r.prototype),s(r,i),i.from=function(o,a,l){if(typeof o=="number")throw new TypeError("Argument must not be a number");return r(o,a,l)},i.alloc=function(o,a,l){if(typeof o!="number")throw new TypeError("Argument must be a number");var h=r(o);return a!==void 0?typeof l=="string"?h.fill(a,l):h.fill(a):h.fill(0),h},i.allocUnsafe=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return r(o)},i.allocUnsafeSlow=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return t.SlowBuffer(o)}})(uc,uc.exports);var B0=uc.exports,nl={exports:{}};nl.exports;(function(n){(function(e,t){function r(I,c){if(!I)throw new Error(c||"Assertion failed")}function s(I,c){I.super_=c;var b=function(){};b.prototype=c.prototype,I.prototype=new b,I.prototype.constructor=I}function i(I,c,b){if(i.isBN(I))return I;this.negative=0,this.words=null,this.length=0,this.red=null,I!==null&&((c==="le"||c==="be")&&(b=c,c=10),this._init(I||0,c||10,b||"be"))}typeof e=="object"?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=oe.Buffer}catch{}i.isBN=function(c){return c instanceof i?!0:c!==null&&typeof c=="object"&&c.constructor.wordSize===i.wordSize&&Array.isArray(c.words)},i.max=function(c,b){return c.cmp(b)>0?c:b},i.min=function(c,b){return c.cmp(b)<0?c:b},i.prototype._init=function(c,b,p){if(typeof c=="number")return this._initNumber(c,b,p);if(typeof c=="object")return this._initArray(c,b,p);b==="hex"&&(b=16),r(b===(b|0)&&b>=2&&b<=36),c=c.toString().replace(/\s+/g,"");var y=0;c[0]==="-"&&(y++,this.negative=1),y<c.length&&(b===16?this._parseHex(c,y,p):(this._parseBase(c,b,y),p==="le"&&this._initArray(this.toArray(),b,p)))},i.prototype._initNumber=function(c,b,p){c<0&&(this.negative=1,c=-c),c<67108864?(this.words=[c&67108863],this.length=1):c<4503599627370496?(this.words=[c&67108863,c/67108864&67108863],this.length=2):(r(c<9007199254740992),this.words=[c&67108863,c/67108864&67108863,1],this.length=3),p==="le"&&this._initArray(this.toArray(),b,p)},i.prototype._initArray=function(c,b,p){if(r(typeof c.length=="number"),c.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(c.length/3),this.words=new Array(this.length);for(var y=0;y<this.length;y++)this.words[y]=0;var C,T,_=0;if(p==="be")for(y=c.length-1,C=0;y>=0;y-=3)T=c[y]|c[y-1]<<8|c[y-2]<<16,this.words[C]|=T<<_&67108863,this.words[C+1]=T>>>26-_&67108863,_+=24,_>=26&&(_-=26,C++);else if(p==="le")for(y=0,C=0;y<c.length;y+=3)T=c[y]|c[y+1]<<8|c[y+2]<<16,this.words[C]|=T<<_&67108863,this.words[C+1]=T>>>26-_&67108863,_+=24,_>=26&&(_-=26,C++);return this._strip()};function a(I,c){var b=I.charCodeAt(c);if(b>=48&&b<=57)return b-48;if(b>=65&&b<=70)return b-55;if(b>=97&&b<=102)return b-87;r(!1,"Invalid character in "+I)}function l(I,c,b){var p=a(I,b);return b-1>=c&&(p|=a(I,b-1)<<4),p}i.prototype._parseHex=function(c,b,p){this.length=Math.ceil((c.length-b)/6),this.words=new Array(this.length);for(var y=0;y<this.length;y++)this.words[y]=0;var C=0,T=0,_;if(p==="be")for(y=c.length-1;y>=b;y-=2)_=l(c,b,y)<<C,this.words[T]|=_&67108863,C>=18?(C-=18,T+=1,this.words[T]|=_>>>26):C+=8;else{var B=c.length-b;for(y=B%2===0?b+1:b;y<c.length;y+=2)_=l(c,b,y)<<C,this.words[T]|=_&67108863,C>=18?(C-=18,T+=1,this.words[T]|=_>>>26):C+=8}this._strip()};function h(I,c,b,p){for(var y=0,C=0,T=Math.min(I.length,b),_=c;_<T;_++){var B=I.charCodeAt(_)-48;y*=p,B>=49?C=B-49+10:B>=17?C=B-17+10:C=B,r(B>=0&&C<p,"Invalid character"),y+=C}return y}i.prototype._parseBase=function(c,b,p){this.words=[0],this.length=1;for(var y=0,C=1;C<=67108863;C*=b)y++;y--,C=C/b|0;for(var T=c.length-p,_=T%y,B=Math.min(T,T-_)+p,u=0,k=p;k<B;k+=y)u=h(c,k,k+y,b),this.imuln(C),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(_!==0){var $=1;for(u=h(c,k,c.length,b),k=0;k<_;k++)$*=b;this.imuln($),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this._strip()},i.prototype.copy=function(c){c.words=new Array(this.length);for(var b=0;b<this.length;b++)c.words[b]=this.words[b];c.length=this.length,c.negative=this.negative,c.red=this.red};function m(I,c){I.words=c.words,I.length=c.length,I.negative=c.negative,I.red=c.red}if(i.prototype._move=function(c){m(c,this)},i.prototype.clone=function(){var c=new i(null);return this.copy(c),c},i.prototype._expand=function(c){for(;this.length<c;)this.words[this.length++]=0;return this},i.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},i.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=E}catch{i.prototype.inspect=E}else i.prototype.inspect=E;function E(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var S=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],A=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],g=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];i.prototype.toString=function(c,b){c=c||10,b=b|0||1;var p;if(c===16||c==="hex"){p="";for(var y=0,C=0,T=0;T<this.length;T++){var _=this.words[T],B=((_<<y|C)&16777215).toString(16);C=_>>>24-y&16777215,y+=2,y>=26&&(y-=26,T--),C!==0||T!==this.length-1?p=S[6-B.length]+B+p:p=B+p}for(C!==0&&(p=C.toString(16)+p);p.length%b!==0;)p="0"+p;return this.negative!==0&&(p="-"+p),p}if(c===(c|0)&&c>=2&&c<=36){var u=A[c],k=g[c];p="";var $=this.clone();for($.negative=0;!$.isZero();){var Z=$.modrn(k).toString(c);$=$.idivn(k),$.isZero()?p=Z+p:p=S[u-Z.length]+Z+p}for(this.isZero()&&(p="0"+p);p.length%b!==0;)p="0"+p;return this.negative!==0&&(p="-"+p),p}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var c=this.words[0];return this.length===2?c+=this.words[1]*67108864:this.length===3&&this.words[2]===1?c+=4503599627370496+this.words[1]*67108864:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-c:c},i.prototype.toJSON=function(){return this.toString(16,2)},o&&(i.prototype.toBuffer=function(c,b){return this.toArrayLike(o,c,b)}),i.prototype.toArray=function(c,b){return this.toArrayLike(Array,c,b)};var D=function(c,b){return c.allocUnsafe?c.allocUnsafe(b):new c(b)};i.prototype.toArrayLike=function(c,b,p){this._strip();var y=this.byteLength(),C=p||Math.max(1,y);r(y<=C,"byte array longer than desired length"),r(C>0,"Requested array length <= 0");var T=D(c,C),_=b==="le"?"LE":"BE";return this["_toArrayLike"+_](T,y),T},i.prototype._toArrayLikeLE=function(c,b){for(var p=0,y=0,C=0,T=0;C<this.length;C++){var _=this.words[C]<<T|y;c[p++]=_&255,p<c.length&&(c[p++]=_>>8&255),p<c.length&&(c[p++]=_>>16&255),T===6?(p<c.length&&(c[p++]=_>>24&255),y=0,T=0):(y=_>>>24,T+=2)}if(p<c.length)for(c[p++]=y;p<c.length;)c[p++]=0},i.prototype._toArrayLikeBE=function(c,b){for(var p=c.length-1,y=0,C=0,T=0;C<this.length;C++){var _=this.words[C]<<T|y;c[p--]=_&255,p>=0&&(c[p--]=_>>8&255),p>=0&&(c[p--]=_>>16&255),T===6?(p>=0&&(c[p--]=_>>24&255),y=0,T=0):(y=_>>>24,T+=2)}if(p>=0)for(c[p--]=y;p>=0;)c[p--]=0},Math.clz32?i.prototype._countBits=function(c){return 32-Math.clz32(c)}:i.prototype._countBits=function(c){var b=c,p=0;return b>=4096&&(p+=13,b>>>=13),b>=64&&(p+=7,b>>>=7),b>=8&&(p+=4,b>>>=4),b>=2&&(p+=2,b>>>=2),p+b},i.prototype._zeroBits=function(c){if(c===0)return 26;var b=c,p=0;return b&8191||(p+=13,b>>>=13),b&127||(p+=7,b>>>=7),b&15||(p+=4,b>>>=4),b&3||(p+=2,b>>>=2),b&1||p++,p},i.prototype.bitLength=function(){var c=this.words[this.length-1],b=this._countBits(c);return(this.length-1)*26+b};function x(I){for(var c=new Array(I.bitLength()),b=0;b<c.length;b++){var p=b/26|0,y=b%26;c[b]=I.words[p]>>>y&1}return c}i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var c=0,b=0;b<this.length;b++){var p=this._zeroBits(this.words[b]);if(c+=p,p!==26)break}return c},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(c){return this.negative!==0?this.abs().inotn(c).iaddn(1):this.clone()},i.prototype.fromTwos=function(c){return this.testn(c-1)?this.notn(c).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return this.negative!==0},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(c){for(;this.length<c.length;)this.words[this.length++]=0;for(var b=0;b<c.length;b++)this.words[b]=this.words[b]|c.words[b];return this._strip()},i.prototype.ior=function(c){return r((this.negative|c.negative)===0),this.iuor(c)},i.prototype.or=function(c){return this.length>c.length?this.clone().ior(c):c.clone().ior(this)},i.prototype.uor=function(c){return this.length>c.length?this.clone().iuor(c):c.clone().iuor(this)},i.prototype.iuand=function(c){var b;this.length>c.length?b=c:b=this;for(var p=0;p<b.length;p++)this.words[p]=this.words[p]&c.words[p];return this.length=b.length,this._strip()},i.prototype.iand=function(c){return r((this.negative|c.negative)===0),this.iuand(c)},i.prototype.and=function(c){return this.length>c.length?this.clone().iand(c):c.clone().iand(this)},i.prototype.uand=function(c){return this.length>c.length?this.clone().iuand(c):c.clone().iuand(this)},i.prototype.iuxor=function(c){var b,p;this.length>c.length?(b=this,p=c):(b=c,p=this);for(var y=0;y<p.length;y++)this.words[y]=b.words[y]^p.words[y];if(this!==b)for(;y<b.length;y++)this.words[y]=b.words[y];return this.length=b.length,this._strip()},i.prototype.ixor=function(c){return r((this.negative|c.negative)===0),this.iuxor(c)},i.prototype.xor=function(c){return this.length>c.length?this.clone().ixor(c):c.clone().ixor(this)},i.prototype.uxor=function(c){return this.length>c.length?this.clone().iuxor(c):c.clone().iuxor(this)},i.prototype.inotn=function(c){r(typeof c=="number"&&c>=0);var b=Math.ceil(c/26)|0,p=c%26;this._expand(b),p>0&&b--;for(var y=0;y<b;y++)this.words[y]=~this.words[y]&67108863;return p>0&&(this.words[y]=~this.words[y]&67108863>>26-p),this._strip()},i.prototype.notn=function(c){return this.clone().inotn(c)},i.prototype.setn=function(c,b){r(typeof c=="number"&&c>=0);var p=c/26|0,y=c%26;return this._expand(p+1),b?this.words[p]=this.words[p]|1<<y:this.words[p]=this.words[p]&~(1<<y),this._strip()},i.prototype.iadd=function(c){var b;if(this.negative!==0&&c.negative===0)return this.negative=0,b=this.isub(c),this.negative^=1,this._normSign();if(this.negative===0&&c.negative!==0)return c.negative=0,b=this.isub(c),c.negative=1,b._normSign();var p,y;this.length>c.length?(p=this,y=c):(p=c,y=this);for(var C=0,T=0;T<y.length;T++)b=(p.words[T]|0)+(y.words[T]|0)+C,this.words[T]=b&67108863,C=b>>>26;for(;C!==0&&T<p.length;T++)b=(p.words[T]|0)+C,this.words[T]=b&67108863,C=b>>>26;if(this.length=p.length,C!==0)this.words[this.length]=C,this.length++;else if(p!==this)for(;T<p.length;T++)this.words[T]=p.words[T];return this},i.prototype.add=function(c){var b;return c.negative!==0&&this.negative===0?(c.negative=0,b=this.sub(c),c.negative^=1,b):c.negative===0&&this.negative!==0?(this.negative=0,b=c.sub(this),this.negative=1,b):this.length>c.length?this.clone().iadd(c):c.clone().iadd(this)},i.prototype.isub=function(c){if(c.negative!==0){c.negative=0;var b=this.iadd(c);return c.negative=1,b._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(c),this.negative=1,this._normSign();var p=this.cmp(c);if(p===0)return this.negative=0,this.length=1,this.words[0]=0,this;var y,C;p>0?(y=this,C=c):(y=c,C=this);for(var T=0,_=0;_<C.length;_++)b=(y.words[_]|0)-(C.words[_]|0)+T,T=b>>26,this.words[_]=b&67108863;for(;T!==0&&_<y.length;_++)b=(y.words[_]|0)+T,T=b>>26,this.words[_]=b&67108863;if(T===0&&_<y.length&&y!==this)for(;_<y.length;_++)this.words[_]=y.words[_];return this.length=Math.max(this.length,_),y!==this&&(this.negative=1),this._strip()},i.prototype.sub=function(c){return this.clone().isub(c)};function U(I,c,b){b.negative=c.negative^I.negative;var p=I.length+c.length|0;b.length=p,p=p-1|0;var y=I.words[0]|0,C=c.words[0]|0,T=y*C,_=T&67108863,B=T/67108864|0;b.words[0]=_;for(var u=1;u<p;u++){for(var k=B>>>26,$=B&67108863,Z=Math.min(u,c.length-1),ee=Math.max(0,u-I.length+1);ee<=Z;ee++){var Ae=u-ee|0;y=I.words[Ae]|0,C=c.words[ee]|0,T=y*C+$,k+=T/67108864|0,$=T&67108863}b.words[u]=$|0,B=k|0}return B!==0?b.words[u]=B|0:b.length--,b._strip()}var R=function(c,b,p){var y=c.words,C=b.words,T=p.words,_=0,B,u,k,$=y[0]|0,Z=$&8191,ee=$>>>13,Ae=y[1]|0,le=Ae&8191,ue=Ae>>>13,Ze=y[2]|0,Ee=Ze&8191,ye=Ze>>>13,nt=y[3]|0,Ce=nt&8191,ke=nt>>>13,Rr=y[4]|0,Le=Rr&8191,$e=Rr>>>13,Wr=y[5]|0,Oe=Wr&8191,Re=Wr>>>13,Ft=y[6]|0,Pe=Ft&8191,He=Ft>>>13,jt=y[7]|0,qe=jt&8191,w=jt>>>13,d=y[8]|0,f=d&8191,v=d>>>13,M=y[9]|0,P=M&8191,N=M>>>13,be=C[0]|0,he=be&8191,fe=be>>>13,Ke=C[1]|0,de=Ke&8191,rt=Ke>>>13,Ml=C[2]|0,st=Ml&8191,it=Ml>>>13,Rl=C[3]|0,ot=Rl&8191,at=Rl>>>13,Wl=C[4]|0,ct=Wl&8191,lt=Wl>>>13,Pl=C[5]|0,dt=Pl&8191,ut=Pl>>>13,Ll=C[6]|0,ft=Ll&8191,ht=Ll>>>13,Ol=C[7]|0,mt=Ol&8191,bt=Ol>>>13,Nl=C[8]|0,pt=Nl&8191,gt=Nl>>>13,zl=C[9]|0,yt=zl&8191,wt=zl>>>13;p.negative=c.negative^b.negative,p.length=19,B=Math.imul(Z,he),u=Math.imul(Z,fe),u=u+Math.imul(ee,he)|0,k=Math.imul(ee,fe);var Lo=(_+B|0)+((u&8191)<<13)|0;_=(k+(u>>>13)|0)+(Lo>>>26)|0,Lo&=67108863,B=Math.imul(le,he),u=Math.imul(le,fe),u=u+Math.imul(ue,he)|0,k=Math.imul(ue,fe),B=B+Math.imul(Z,de)|0,u=u+Math.imul(Z,rt)|0,u=u+Math.imul(ee,de)|0,k=k+Math.imul(ee,rt)|0;var Oo=(_+B|0)+((u&8191)<<13)|0;_=(k+(u>>>13)|0)+(Oo>>>26)|0,Oo&=67108863,B=Math.imul(Ee,he),u=Math.imul(Ee,fe),u=u+Math.imul(ye,he)|0,k=Math.imul(ye,fe),B=B+Math.imul(le,de)|0,u=u+Math.imul(le,rt)|0,u=u+Math.imul(ue,de)|0,k=k+Math.imul(ue,rt)|0,B=B+Math.imul(Z,st)|0,u=u+Math.imul(Z,it)|0,u=u+Math.imul(ee,st)|0,k=k+Math.imul(ee,it)|0;var No=(_+B|0)+((u&8191)<<13)|0;_=(k+(u>>>13)|0)+(No>>>26)|0,No&=67108863,B=Math.imul(Ce,he),u=Math.imul(Ce,fe),u=u+Math.imul(ke,he)|0,k=Math.imul(ke,fe),B=B+Math.imul(Ee,de)|0,u=u+Math.imul(Ee,rt)|0,u=u+Math.imul(ye,de)|0,k=k+Math.imul(ye,rt)|0,B=B+Math.imul(le,st)|0,u=u+Math.imul(le,it)|0,u=u+Math.imul(ue,st)|0,k=k+Math.imul(ue,it)|0,B=B+Math.imul(Z,ot)|0,u=u+Math.imul(Z,at)|0,u=u+Math.imul(ee,ot)|0,k=k+Math.imul(ee,at)|0;var zo=(_+B|0)+((u&8191)<<13)|0;_=(k+(u>>>13)|0)+(zo>>>26)|0,zo&=67108863,B=Math.imul(Le,he),u=Math.imul(Le,fe),u=u+Math.imul($e,he)|0,k=Math.imul($e,fe),B=B+Math.imul(Ce,de)|0,u=u+Math.imul(Ce,rt)|0,u=u+Math.imul(ke,de)|0,k=k+Math.imul(ke,rt)|0,B=B+Math.imul(Ee,st)|0,u=u+Math.imul(Ee,it)|0,u=u+Math.imul(ye,st)|0,k=k+Math.imul(ye,it)|0,B=B+Math.imul(le,ot)|0,u=u+Math.imul(le,at)|0,u=u+Math.imul(ue,ot)|0,k=k+Math.imul(ue,at)|0,B=B+Math.imul(Z,ct)|0,u=u+Math.imul(Z,lt)|0,u=u+Math.imul(ee,ct)|0,k=k+Math.imul(ee,lt)|0;var Ho=(_+B|0)+((u&8191)<<13)|0;_=(k+(u>>>13)|0)+(Ho>>>26)|0,Ho&=67108863,B=Math.imul(Oe,he),u=Math.imul(Oe,fe),u=u+Math.imul(Re,he)|0,k=Math.imul(Re,fe),B=B+Math.imul(Le,de)|0,u=u+Math.imul(Le,rt)|0,u=u+Math.imul($e,de)|0,k=k+Math.imul($e,rt)|0,B=B+Math.imul(Ce,st)|0,u=u+Math.imul(Ce,it)|0,u=u+Math.imul(ke,st)|0,k=k+Math.imul(ke,it)|0,B=B+Math.imul(Ee,ot)|0,u=u+Math.imul(Ee,at)|0,u=u+Math.imul(ye,ot)|0,k=k+Math.imul(ye,at)|0,B=B+Math.imul(le,ct)|0,u=u+Math.imul(le,lt)|0,u=u+Math.imul(ue,ct)|0,k=k+Math.imul(ue,lt)|0,B=B+Math.imul(Z,dt)|0,u=u+Math.imul(Z,ut)|0,u=u+Math.imul(ee,dt)|0,k=k+Math.imul(ee,ut)|0;var qo=(_+B|0)+((u&8191)<<13)|0;_=(k+(u>>>13)|0)+(qo>>>26)|0,qo&=67108863,B=Math.imul(Pe,he),u=Math.imul(Pe,fe),u=u+Math.imul(He,he)|0,k=Math.imul(He,fe),B=B+Math.imul(Oe,de)|0,u=u+Math.imul(Oe,rt)|0,u=u+Math.imul(Re,de)|0,k=k+Math.imul(Re,rt)|0,B=B+Math.imul(Le,st)|0,u=u+Math.imul(Le,it)|0,u=u+Math.imul($e,st)|0,k=k+Math.imul($e,it)|0,B=B+Math.imul(Ce,ot)|0,u=u+Math.imul(Ce,at)|0,u=u+Math.imul(ke,ot)|0,k=k+Math.imul(ke,at)|0,B=B+Math.imul(Ee,ct)|0,u=u+Math.imul(Ee,lt)|0,u=u+Math.imul(ye,ct)|0,k=k+Math.imul(ye,lt)|0,B=B+Math.imul(le,dt)|0,u=u+Math.imul(le,ut)|0,u=u+Math.imul(ue,dt)|0,k=k+Math.imul(ue,ut)|0,B=B+Math.imul(Z,ft)|0,u=u+Math.imul(Z,ht)|0,u=u+Math.imul(ee,ft)|0,k=k+Math.imul(ee,ht)|0;var Ko=(_+B|0)+((u&8191)<<13)|0;_=(k+(u>>>13)|0)+(Ko>>>26)|0,Ko&=67108863,B=Math.imul(qe,he),u=Math.imul(qe,fe),u=u+Math.imul(w,he)|0,k=Math.imul(w,fe),B=B+Math.imul(Pe,de)|0,u=u+Math.imul(Pe,rt)|0,u=u+Math.imul(He,de)|0,k=k+Math.imul(He,rt)|0,B=B+Math.imul(Oe,st)|0,u=u+Math.imul(Oe,it)|0,u=u+Math.imul(Re,st)|0,k=k+Math.imul(Re,it)|0,B=B+Math.imul(Le,ot)|0,u=u+Math.imul(Le,at)|0,u=u+Math.imul($e,ot)|0,k=k+Math.imul($e,at)|0,B=B+Math.imul(Ce,ct)|0,u=u+Math.imul(Ce,lt)|0,u=u+Math.imul(ke,ct)|0,k=k+Math.imul(ke,lt)|0,B=B+Math.imul(Ee,dt)|0,u=u+Math.imul(Ee,ut)|0,u=u+Math.imul(ye,dt)|0,k=k+Math.imul(ye,ut)|0,B=B+Math.imul(le,ft)|0,u=u+Math.imul(le,ht)|0,u=u+Math.imul(ue,ft)|0,k=k+Math.imul(ue,ht)|0,B=B+Math.imul(Z,mt)|0,u=u+Math.imul(Z,bt)|0,u=u+Math.imul(ee,mt)|0,k=k+Math.imul(ee,bt)|0;var jo=(_+B|0)+((u&8191)<<13)|0;_=(k+(u>>>13)|0)+(jo>>>26)|0,jo&=67108863,B=Math.imul(f,he),u=Math.imul(f,fe),u=u+Math.imul(v,he)|0,k=Math.imul(v,fe),B=B+Math.imul(qe,de)|0,u=u+Math.imul(qe,rt)|0,u=u+Math.imul(w,de)|0,k=k+Math.imul(w,rt)|0,B=B+Math.imul(Pe,st)|0,u=u+Math.imul(Pe,it)|0,u=u+Math.imul(He,st)|0,k=k+Math.imul(He,it)|0,B=B+Math.imul(Oe,ot)|0,u=u+Math.imul(Oe,at)|0,u=u+Math.imul(Re,ot)|0,k=k+Math.imul(Re,at)|0,B=B+Math.imul(Le,ct)|0,u=u+Math.imul(Le,lt)|0,u=u+Math.imul($e,ct)|0,k=k+Math.imul($e,lt)|0,B=B+Math.imul(Ce,dt)|0,u=u+Math.imul(Ce,ut)|0,u=u+Math.imul(ke,dt)|0,k=k+Math.imul(ke,ut)|0,B=B+Math.imul(Ee,ft)|0,u=u+Math.imul(Ee,ht)|0,u=u+Math.imul(ye,ft)|0,k=k+Math.imul(ye,ht)|0,B=B+Math.imul(le,mt)|0,u=u+Math.imul(le,bt)|0,u=u+Math.imul(ue,mt)|0,k=k+Math.imul(ue,bt)|0,B=B+Math.imul(Z,pt)|0,u=u+Math.imul(Z,gt)|0,u=u+Math.imul(ee,pt)|0,k=k+Math.imul(ee,gt)|0;var $o=(_+B|0)+((u&8191)<<13)|0;_=(k+(u>>>13)|0)+($o>>>26)|0,$o&=67108863,B=Math.imul(P,he),u=Math.imul(P,fe),u=u+Math.imul(N,he)|0,k=Math.imul(N,fe),B=B+Math.imul(f,de)|0,u=u+Math.imul(f,rt)|0,u=u+Math.imul(v,de)|0,k=k+Math.imul(v,rt)|0,B=B+Math.imul(qe,st)|0,u=u+Math.imul(qe,it)|0,u=u+Math.imul(w,st)|0,k=k+Math.imul(w,it)|0,B=B+Math.imul(Pe,ot)|0,u=u+Math.imul(Pe,at)|0,u=u+Math.imul(He,ot)|0,k=k+Math.imul(He,at)|0,B=B+Math.imul(Oe,ct)|0,u=u+Math.imul(Oe,lt)|0,u=u+Math.imul(Re,ct)|0,k=k+Math.imul(Re,lt)|0,B=B+Math.imul(Le,dt)|0,u=u+Math.imul(Le,ut)|0,u=u+Math.imul($e,dt)|0,k=k+Math.imul($e,ut)|0,B=B+Math.imul(Ce,ft)|0,u=u+Math.imul(Ce,ht)|0,u=u+Math.imul(ke,ft)|0,k=k+Math.imul(ke,ht)|0,B=B+Math.imul(Ee,mt)|0,u=u+Math.imul(Ee,bt)|0,u=u+Math.imul(ye,mt)|0,k=k+Math.imul(ye,bt)|0,B=B+Math.imul(le,pt)|0,u=u+Math.imul(le,gt)|0,u=u+Math.imul(ue,pt)|0,k=k+Math.imul(ue,gt)|0,B=B+Math.imul(Z,yt)|0,u=u+Math.imul(Z,wt)|0,u=u+Math.imul(ee,yt)|0,k=k+Math.imul(ee,wt)|0;var Vo=(_+B|0)+((u&8191)<<13)|0;_=(k+(u>>>13)|0)+(Vo>>>26)|0,Vo&=67108863,B=Math.imul(P,de),u=Math.imul(P,rt),u=u+Math.imul(N,de)|0,k=Math.imul(N,rt),B=B+Math.imul(f,st)|0,u=u+Math.imul(f,it)|0,u=u+Math.imul(v,st)|0,k=k+Math.imul(v,it)|0,B=B+Math.imul(qe,ot)|0,u=u+Math.imul(qe,at)|0,u=u+Math.imul(w,ot)|0,k=k+Math.imul(w,at)|0,B=B+Math.imul(Pe,ct)|0,u=u+Math.imul(Pe,lt)|0,u=u+Math.imul(He,ct)|0,k=k+Math.imul(He,lt)|0,B=B+Math.imul(Oe,dt)|0,u=u+Math.imul(Oe,ut)|0,u=u+Math.imul(Re,dt)|0,k=k+Math.imul(Re,ut)|0,B=B+Math.imul(Le,ft)|0,u=u+Math.imul(Le,ht)|0,u=u+Math.imul($e,ft)|0,k=k+Math.imul($e,ht)|0,B=B+Math.imul(Ce,mt)|0,u=u+Math.imul(Ce,bt)|0,u=u+Math.imul(ke,mt)|0,k=k+Math.imul(ke,bt)|0,B=B+Math.imul(Ee,pt)|0,u=u+Math.imul(Ee,gt)|0,u=u+Math.imul(ye,pt)|0,k=k+Math.imul(ye,gt)|0,B=B+Math.imul(le,yt)|0,u=u+Math.imul(le,wt)|0,u=u+Math.imul(ue,yt)|0,k=k+Math.imul(ue,wt)|0;var Go=(_+B|0)+((u&8191)<<13)|0;_=(k+(u>>>13)|0)+(Go>>>26)|0,Go&=67108863,B=Math.imul(P,st),u=Math.imul(P,it),u=u+Math.imul(N,st)|0,k=Math.imul(N,it),B=B+Math.imul(f,ot)|0,u=u+Math.imul(f,at)|0,u=u+Math.imul(v,ot)|0,k=k+Math.imul(v,at)|0,B=B+Math.imul(qe,ct)|0,u=u+Math.imul(qe,lt)|0,u=u+Math.imul(w,ct)|0,k=k+Math.imul(w,lt)|0,B=B+Math.imul(Pe,dt)|0,u=u+Math.imul(Pe,ut)|0,u=u+Math.imul(He,dt)|0,k=k+Math.imul(He,ut)|0,B=B+Math.imul(Oe,ft)|0,u=u+Math.imul(Oe,ht)|0,u=u+Math.imul(Re,ft)|0,k=k+Math.imul(Re,ht)|0,B=B+Math.imul(Le,mt)|0,u=u+Math.imul(Le,bt)|0,u=u+Math.imul($e,mt)|0,k=k+Math.imul($e,bt)|0,B=B+Math.imul(Ce,pt)|0,u=u+Math.imul(Ce,gt)|0,u=u+Math.imul(ke,pt)|0,k=k+Math.imul(ke,gt)|0,B=B+Math.imul(Ee,yt)|0,u=u+Math.imul(Ee,wt)|0,u=u+Math.imul(ye,yt)|0,k=k+Math.imul(ye,wt)|0;var Yo=(_+B|0)+((u&8191)<<13)|0;_=(k+(u>>>13)|0)+(Yo>>>26)|0,Yo&=67108863,B=Math.imul(P,ot),u=Math.imul(P,at),u=u+Math.imul(N,ot)|0,k=Math.imul(N,at),B=B+Math.imul(f,ct)|0,u=u+Math.imul(f,lt)|0,u=u+Math.imul(v,ct)|0,k=k+Math.imul(v,lt)|0,B=B+Math.imul(qe,dt)|0,u=u+Math.imul(qe,ut)|0,u=u+Math.imul(w,dt)|0,k=k+Math.imul(w,ut)|0,B=B+Math.imul(Pe,ft)|0,u=u+Math.imul(Pe,ht)|0,u=u+Math.imul(He,ft)|0,k=k+Math.imul(He,ht)|0,B=B+Math.imul(Oe,mt)|0,u=u+Math.imul(Oe,bt)|0,u=u+Math.imul(Re,mt)|0,k=k+Math.imul(Re,bt)|0,B=B+Math.imul(Le,pt)|0,u=u+Math.imul(Le,gt)|0,u=u+Math.imul($e,pt)|0,k=k+Math.imul($e,gt)|0,B=B+Math.imul(Ce,yt)|0,u=u+Math.imul(Ce,wt)|0,u=u+Math.imul(ke,yt)|0,k=k+Math.imul(ke,wt)|0;var Xo=(_+B|0)+((u&8191)<<13)|0;_=(k+(u>>>13)|0)+(Xo>>>26)|0,Xo&=67108863,B=Math.imul(P,ct),u=Math.imul(P,lt),u=u+Math.imul(N,ct)|0,k=Math.imul(N,lt),B=B+Math.imul(f,dt)|0,u=u+Math.imul(f,ut)|0,u=u+Math.imul(v,dt)|0,k=k+Math.imul(v,ut)|0,B=B+Math.imul(qe,ft)|0,u=u+Math.imul(qe,ht)|0,u=u+Math.imul(w,ft)|0,k=k+Math.imul(w,ht)|0,B=B+Math.imul(Pe,mt)|0,u=u+Math.imul(Pe,bt)|0,u=u+Math.imul(He,mt)|0,k=k+Math.imul(He,bt)|0,B=B+Math.imul(Oe,pt)|0,u=u+Math.imul(Oe,gt)|0,u=u+Math.imul(Re,pt)|0,k=k+Math.imul(Re,gt)|0,B=B+Math.imul(Le,yt)|0,u=u+Math.imul(Le,wt)|0,u=u+Math.imul($e,yt)|0,k=k+Math.imul($e,wt)|0;var Zo=(_+B|0)+((u&8191)<<13)|0;_=(k+(u>>>13)|0)+(Zo>>>26)|0,Zo&=67108863,B=Math.imul(P,dt),u=Math.imul(P,ut),u=u+Math.imul(N,dt)|0,k=Math.imul(N,ut),B=B+Math.imul(f,ft)|0,u=u+Math.imul(f,ht)|0,u=u+Math.imul(v,ft)|0,k=k+Math.imul(v,ht)|0,B=B+Math.imul(qe,mt)|0,u=u+Math.imul(qe,bt)|0,u=u+Math.imul(w,mt)|0,k=k+Math.imul(w,bt)|0,B=B+Math.imul(Pe,pt)|0,u=u+Math.imul(Pe,gt)|0,u=u+Math.imul(He,pt)|0,k=k+Math.imul(He,gt)|0,B=B+Math.imul(Oe,yt)|0,u=u+Math.imul(Oe,wt)|0,u=u+Math.imul(Re,yt)|0,k=k+Math.imul(Re,wt)|0;var Jo=(_+B|0)+((u&8191)<<13)|0;_=(k+(u>>>13)|0)+(Jo>>>26)|0,Jo&=67108863,B=Math.imul(P,ft),u=Math.imul(P,ht),u=u+Math.imul(N,ft)|0,k=Math.imul(N,ht),B=B+Math.imul(f,mt)|0,u=u+Math.imul(f,bt)|0,u=u+Math.imul(v,mt)|0,k=k+Math.imul(v,bt)|0,B=B+Math.imul(qe,pt)|0,u=u+Math.imul(qe,gt)|0,u=u+Math.imul(w,pt)|0,k=k+Math.imul(w,gt)|0,B=B+Math.imul(Pe,yt)|0,u=u+Math.imul(Pe,wt)|0,u=u+Math.imul(He,yt)|0,k=k+Math.imul(He,wt)|0;var Qo=(_+B|0)+((u&8191)<<13)|0;_=(k+(u>>>13)|0)+(Qo>>>26)|0,Qo&=67108863,B=Math.imul(P,mt),u=Math.imul(P,bt),u=u+Math.imul(N,mt)|0,k=Math.imul(N,bt),B=B+Math.imul(f,pt)|0,u=u+Math.imul(f,gt)|0,u=u+Math.imul(v,pt)|0,k=k+Math.imul(v,gt)|0,B=B+Math.imul(qe,yt)|0,u=u+Math.imul(qe,wt)|0,u=u+Math.imul(w,yt)|0,k=k+Math.imul(w,wt)|0;var ea=(_+B|0)+((u&8191)<<13)|0;_=(k+(u>>>13)|0)+(ea>>>26)|0,ea&=67108863,B=Math.imul(P,pt),u=Math.imul(P,gt),u=u+Math.imul(N,pt)|0,k=Math.imul(N,gt),B=B+Math.imul(f,yt)|0,u=u+Math.imul(f,wt)|0,u=u+Math.imul(v,yt)|0,k=k+Math.imul(v,wt)|0;var ta=(_+B|0)+((u&8191)<<13)|0;_=(k+(u>>>13)|0)+(ta>>>26)|0,ta&=67108863,B=Math.imul(P,yt),u=Math.imul(P,wt),u=u+Math.imul(N,yt)|0,k=Math.imul(N,wt);var na=(_+B|0)+((u&8191)<<13)|0;return _=(k+(u>>>13)|0)+(na>>>26)|0,na&=67108863,T[0]=Lo,T[1]=Oo,T[2]=No,T[3]=zo,T[4]=Ho,T[5]=qo,T[6]=Ko,T[7]=jo,T[8]=$o,T[9]=Vo,T[10]=Go,T[11]=Yo,T[12]=Xo,T[13]=Zo,T[14]=Jo,T[15]=Qo,T[16]=ea,T[17]=ta,T[18]=na,_!==0&&(T[19]=_,p.length++),p};Math.imul||(R=U);function F(I,c,b){b.negative=c.negative^I.negative,b.length=I.length+c.length;for(var p=0,y=0,C=0;C<b.length-1;C++){var T=y;y=0;for(var _=p&67108863,B=Math.min(C,c.length-1),u=Math.max(0,C-I.length+1);u<=B;u++){var k=C-u,$=I.words[k]|0,Z=c.words[u]|0,ee=$*Z,Ae=ee&67108863;T=T+(ee/67108864|0)|0,Ae=Ae+_|0,_=Ae&67108863,T=T+(Ae>>>26)|0,y+=T>>>26,T&=67108863}b.words[C]=_,p=T,T=y}return p!==0?b.words[C]=p:b.length--,b._strip()}function W(I,c,b){return F(I,c,b)}i.prototype.mulTo=function(c,b){var p,y=this.length+c.length;return this.length===10&&c.length===10?p=R(this,c,b):y<63?p=U(this,c,b):y<1024?p=F(this,c,b):p=W(this,c,b),p},i.prototype.mul=function(c){var b=new i(null);return b.words=new Array(this.length+c.length),this.mulTo(c,b)},i.prototype.mulf=function(c){var b=new i(null);return b.words=new Array(this.length+c.length),W(this,c,b)},i.prototype.imul=function(c){return this.clone().mulTo(c,this)},i.prototype.imuln=function(c){var b=c<0;b&&(c=-c),r(typeof c=="number"),r(c<67108864);for(var p=0,y=0;y<this.length;y++){var C=(this.words[y]|0)*c,T=(C&67108863)+(p&67108863);p>>=26,p+=C/67108864|0,p+=T>>>26,this.words[y]=T&67108863}return p!==0&&(this.words[y]=p,this.length++),b?this.ineg():this},i.prototype.muln=function(c){return this.clone().imuln(c)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(c){var b=x(c);if(b.length===0)return new i(1);for(var p=this,y=0;y<b.length&&b[y]===0;y++,p=p.sqr());if(++y<b.length)for(var C=p.sqr();y<b.length;y++,C=C.sqr())b[y]!==0&&(p=p.mul(C));return p},i.prototype.iushln=function(c){r(typeof c=="number"&&c>=0);var b=c%26,p=(c-b)/26,y=67108863>>>26-b<<26-b,C;if(b!==0){var T=0;for(C=0;C<this.length;C++){var _=this.words[C]&y,B=(this.words[C]|0)-_<<b;this.words[C]=B|T,T=_>>>26-b}T&&(this.words[C]=T,this.length++)}if(p!==0){for(C=this.length-1;C>=0;C--)this.words[C+p]=this.words[C];for(C=0;C<p;C++)this.words[C]=0;this.length+=p}return this._strip()},i.prototype.ishln=function(c){return r(this.negative===0),this.iushln(c)},i.prototype.iushrn=function(c,b,p){r(typeof c=="number"&&c>=0);var y;b?y=(b-b%26)/26:y=0;var C=c%26,T=Math.min((c-C)/26,this.length),_=67108863^67108863>>>C<<C,B=p;if(y-=T,y=Math.max(0,y),B){for(var u=0;u<T;u++)B.words[u]=this.words[u];B.length=T}if(T!==0)if(this.length>T)for(this.length-=T,u=0;u<this.length;u++)this.words[u]=this.words[u+T];else this.words[0]=0,this.length=1;var k=0;for(u=this.length-1;u>=0&&(k!==0||u>=y);u--){var $=this.words[u]|0;this.words[u]=k<<26-C|$>>>C,k=$&_}return B&&k!==0&&(B.words[B.length++]=k),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(c,b,p){return r(this.negative===0),this.iushrn(c,b,p)},i.prototype.shln=function(c){return this.clone().ishln(c)},i.prototype.ushln=function(c){return this.clone().iushln(c)},i.prototype.shrn=function(c){return this.clone().ishrn(c)},i.prototype.ushrn=function(c){return this.clone().iushrn(c)},i.prototype.testn=function(c){r(typeof c=="number"&&c>=0);var b=c%26,p=(c-b)/26,y=1<<b;if(this.length<=p)return!1;var C=this.words[p];return!!(C&y)},i.prototype.imaskn=function(c){r(typeof c=="number"&&c>=0);var b=c%26,p=(c-b)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=p)return this;if(b!==0&&p++,this.length=Math.min(p,this.length),b!==0){var y=67108863^67108863>>>b<<b;this.words[this.length-1]&=y}return this._strip()},i.prototype.maskn=function(c){return this.clone().imaskn(c)},i.prototype.iaddn=function(c){return r(typeof c=="number"),r(c<67108864),c<0?this.isubn(-c):this.negative!==0?this.length===1&&(this.words[0]|0)<=c?(this.words[0]=c-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(c),this.negative=1,this):this._iaddn(c)},i.prototype._iaddn=function(c){this.words[0]+=c;for(var b=0;b<this.length&&this.words[b]>=67108864;b++)this.words[b]-=67108864,b===this.length-1?this.words[b+1]=1:this.words[b+1]++;return this.length=Math.max(this.length,b+1),this},i.prototype.isubn=function(c){if(r(typeof c=="number"),r(c<67108864),c<0)return this.iaddn(-c);if(this.negative!==0)return this.negative=0,this.iaddn(c),this.negative=1,this;if(this.words[0]-=c,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var b=0;b<this.length&&this.words[b]<0;b++)this.words[b]+=67108864,this.words[b+1]-=1;return this._strip()},i.prototype.addn=function(c){return this.clone().iaddn(c)},i.prototype.subn=function(c){return this.clone().isubn(c)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(c,b,p){var y=c.length+p,C;this._expand(y);var T,_=0;for(C=0;C<c.length;C++){T=(this.words[C+p]|0)+_;var B=(c.words[C]|0)*b;T-=B&67108863,_=(T>>26)-(B/67108864|0),this.words[C+p]=T&67108863}for(;C<this.length-p;C++)T=(this.words[C+p]|0)+_,_=T>>26,this.words[C+p]=T&67108863;if(_===0)return this._strip();for(r(_===-1),_=0,C=0;C<this.length;C++)T=-(this.words[C]|0)+_,_=T>>26,this.words[C]=T&67108863;return this.negative=1,this._strip()},i.prototype._wordDiv=function(c,b){var p=this.length-c.length,y=this.clone(),C=c,T=C.words[C.length-1]|0,_=this._countBits(T);p=26-_,p!==0&&(C=C.ushln(p),y.iushln(p),T=C.words[C.length-1]|0);var B=y.length-C.length,u;if(b!=="mod"){u=new i(null),u.length=B+1,u.words=new Array(u.length);for(var k=0;k<u.length;k++)u.words[k]=0}var $=y.clone()._ishlnsubmul(C,1,B);$.negative===0&&(y=$,u&&(u.words[B]=1));for(var Z=B-1;Z>=0;Z--){var ee=(y.words[C.length+Z]|0)*67108864+(y.words[C.length+Z-1]|0);for(ee=Math.min(ee/T|0,67108863),y._ishlnsubmul(C,ee,Z);y.negative!==0;)ee--,y.negative=0,y._ishlnsubmul(C,1,Z),y.isZero()||(y.negative^=1);u&&(u.words[Z]=ee)}return u&&u._strip(),y._strip(),b!=="div"&&p!==0&&y.iushrn(p),{div:u||null,mod:y}},i.prototype.divmod=function(c,b,p){if(r(!c.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var y,C,T;return this.negative!==0&&c.negative===0?(T=this.neg().divmod(c,b),b!=="mod"&&(y=T.div.neg()),b!=="div"&&(C=T.mod.neg(),p&&C.negative!==0&&C.iadd(c)),{div:y,mod:C}):this.negative===0&&c.negative!==0?(T=this.divmod(c.neg(),b),b!=="mod"&&(y=T.div.neg()),{div:y,mod:T.mod}):this.negative&c.negative?(T=this.neg().divmod(c.neg(),b),b!=="div"&&(C=T.mod.neg(),p&&C.negative!==0&&C.isub(c)),{div:T.div,mod:C}):c.length>this.length||this.cmp(c)<0?{div:new i(0),mod:this}:c.length===1?b==="div"?{div:this.divn(c.words[0]),mod:null}:b==="mod"?{div:null,mod:new i(this.modrn(c.words[0]))}:{div:this.divn(c.words[0]),mod:new i(this.modrn(c.words[0]))}:this._wordDiv(c,b)},i.prototype.div=function(c){return this.divmod(c,"div",!1).div},i.prototype.mod=function(c){return this.divmod(c,"mod",!1).mod},i.prototype.umod=function(c){return this.divmod(c,"mod",!0).mod},i.prototype.divRound=function(c){var b=this.divmod(c);if(b.mod.isZero())return b.div;var p=b.div.negative!==0?b.mod.isub(c):b.mod,y=c.ushrn(1),C=c.andln(1),T=p.cmp(y);return T<0||C===1&&T===0?b.div:b.div.negative!==0?b.div.isubn(1):b.div.iaddn(1)},i.prototype.modrn=function(c){var b=c<0;b&&(c=-c),r(c<=67108863);for(var p=(1<<26)%c,y=0,C=this.length-1;C>=0;C--)y=(p*y+(this.words[C]|0))%c;return b?-y:y},i.prototype.modn=function(c){return this.modrn(c)},i.prototype.idivn=function(c){var b=c<0;b&&(c=-c),r(c<=67108863);for(var p=0,y=this.length-1;y>=0;y--){var C=(this.words[y]|0)+p*67108864;this.words[y]=C/c|0,p=C%c}return this._strip(),b?this.ineg():this},i.prototype.divn=function(c){return this.clone().idivn(c)},i.prototype.egcd=function(c){r(c.negative===0),r(!c.isZero());var b=this,p=c.clone();b.negative!==0?b=b.umod(c):b=b.clone();for(var y=new i(1),C=new i(0),T=new i(0),_=new i(1),B=0;b.isEven()&&p.isEven();)b.iushrn(1),p.iushrn(1),++B;for(var u=p.clone(),k=b.clone();!b.isZero();){for(var $=0,Z=1;!(b.words[0]&Z)&&$<26;++$,Z<<=1);if($>0)for(b.iushrn($);$-- >0;)(y.isOdd()||C.isOdd())&&(y.iadd(u),C.isub(k)),y.iushrn(1),C.iushrn(1);for(var ee=0,Ae=1;!(p.words[0]&Ae)&&ee<26;++ee,Ae<<=1);if(ee>0)for(p.iushrn(ee);ee-- >0;)(T.isOdd()||_.isOdd())&&(T.iadd(u),_.isub(k)),T.iushrn(1),_.iushrn(1);b.cmp(p)>=0?(b.isub(p),y.isub(T),C.isub(_)):(p.isub(b),T.isub(y),_.isub(C))}return{a:T,b:_,gcd:p.iushln(B)}},i.prototype._invmp=function(c){r(c.negative===0),r(!c.isZero());var b=this,p=c.clone();b.negative!==0?b=b.umod(c):b=b.clone();for(var y=new i(1),C=new i(0),T=p.clone();b.cmpn(1)>0&&p.cmpn(1)>0;){for(var _=0,B=1;!(b.words[0]&B)&&_<26;++_,B<<=1);if(_>0)for(b.iushrn(_);_-- >0;)y.isOdd()&&y.iadd(T),y.iushrn(1);for(var u=0,k=1;!(p.words[0]&k)&&u<26;++u,k<<=1);if(u>0)for(p.iushrn(u);u-- >0;)C.isOdd()&&C.iadd(T),C.iushrn(1);b.cmp(p)>=0?(b.isub(p),y.isub(C)):(p.isub(b),C.isub(y))}var $;return b.cmpn(1)===0?$=y:$=C,$.cmpn(0)<0&&$.iadd(c),$},i.prototype.gcd=function(c){if(this.isZero())return c.abs();if(c.isZero())return this.abs();var b=this.clone(),p=c.clone();b.negative=0,p.negative=0;for(var y=0;b.isEven()&&p.isEven();y++)b.iushrn(1),p.iushrn(1);do{for(;b.isEven();)b.iushrn(1);for(;p.isEven();)p.iushrn(1);var C=b.cmp(p);if(C<0){var T=b;b=p,p=T}else if(C===0||p.cmpn(1)===0)break;b.isub(p)}while(!0);return p.iushln(y)},i.prototype.invm=function(c){return this.egcd(c).a.umod(c)},i.prototype.isEven=function(){return(this.words[0]&1)===0},i.prototype.isOdd=function(){return(this.words[0]&1)===1},i.prototype.andln=function(c){return this.words[0]&c},i.prototype.bincn=function(c){r(typeof c=="number");var b=c%26,p=(c-b)/26,y=1<<b;if(this.length<=p)return this._expand(p+1),this.words[p]|=y,this;for(var C=y,T=p;C!==0&&T<this.length;T++){var _=this.words[T]|0;_+=C,C=_>>>26,_&=67108863,this.words[T]=_}return C!==0&&(this.words[T]=C,this.length++),this},i.prototype.isZero=function(){return this.length===1&&this.words[0]===0},i.prototype.cmpn=function(c){var b=c<0;if(this.negative!==0&&!b)return-1;if(this.negative===0&&b)return 1;this._strip();var p;if(this.length>1)p=1;else{b&&(c=-c),r(c<=67108863,"Number is too big");var y=this.words[0]|0;p=y===c?0:y<c?-1:1}return this.negative!==0?-p|0:p},i.prototype.cmp=function(c){if(this.negative!==0&&c.negative===0)return-1;if(this.negative===0&&c.negative!==0)return 1;var b=this.ucmp(c);return this.negative!==0?-b|0:b},i.prototype.ucmp=function(c){if(this.length>c.length)return 1;if(this.length<c.length)return-1;for(var b=0,p=this.length-1;p>=0;p--){var y=this.words[p]|0,C=c.words[p]|0;if(y!==C){y<C?b=-1:y>C&&(b=1);break}}return b},i.prototype.gtn=function(c){return this.cmpn(c)===1},i.prototype.gt=function(c){return this.cmp(c)===1},i.prototype.gten=function(c){return this.cmpn(c)>=0},i.prototype.gte=function(c){return this.cmp(c)>=0},i.prototype.ltn=function(c){return this.cmpn(c)===-1},i.prototype.lt=function(c){return this.cmp(c)===-1},i.prototype.lten=function(c){return this.cmpn(c)<=0},i.prototype.lte=function(c){return this.cmp(c)<=0},i.prototype.eqn=function(c){return this.cmpn(c)===0},i.prototype.eq=function(c){return this.cmp(c)===0},i.red=function(c){return new ne(c)},i.prototype.toRed=function(c){return r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),c.convertTo(this)._forceRed(c)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(c){return this.red=c,this},i.prototype.forceRed=function(c){return r(!this.red,"Already a number in reduction context"),this._forceRed(c)},i.prototype.redAdd=function(c){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,c)},i.prototype.redIAdd=function(c){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,c)},i.prototype.redSub=function(c){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,c)},i.prototype.redISub=function(c){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,c)},i.prototype.redShl=function(c){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,c)},i.prototype.redMul=function(c){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,c),this.red.mul(this,c)},i.prototype.redIMul=function(c){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,c),this.red.imul(this,c)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(c){return r(this.red&&!c.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,c)};var z={k256:null,p224:null,p192:null,p25519:null};function H(I,c){this.name=I,this.p=new i(c,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}H.prototype._tmp=function(){var c=new i(null);return c.words=new Array(Math.ceil(this.n/13)),c},H.prototype.ireduce=function(c){var b=c,p;do this.split(b,this.tmp),b=this.imulK(b),b=b.iadd(this.tmp),p=b.bitLength();while(p>this.n);var y=p<this.n?-1:b.ucmp(this.p);return y===0?(b.words[0]=0,b.length=1):y>0?b.isub(this.p):b.strip!==void 0?b.strip():b._strip(),b},H.prototype.split=function(c,b){c.iushrn(this.n,0,b)},H.prototype.imulK=function(c){return c.imul(this.k)};function K(){H.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}s(K,H),K.prototype.split=function(c,b){for(var p=4194303,y=Math.min(c.length,9),C=0;C<y;C++)b.words[C]=c.words[C];if(b.length=y,c.length<=9){c.words[0]=0,c.length=1;return}var T=c.words[9];for(b.words[b.length++]=T&p,C=10;C<c.length;C++){var _=c.words[C]|0;c.words[C-10]=(_&p)<<4|T>>>22,T=_}T>>>=22,c.words[C-10]=T,T===0&&c.length>10?c.length-=10:c.length-=9},K.prototype.imulK=function(c){c.words[c.length]=0,c.words[c.length+1]=0,c.length+=2;for(var b=0,p=0;p<c.length;p++){var y=c.words[p]|0;b+=y*977,c.words[p]=b&67108863,b=y*64+(b/67108864|0)}return c.words[c.length-1]===0&&(c.length--,c.words[c.length-1]===0&&c.length--),c};function G(){H.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}s(G,H);function V(){H.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}s(V,H);function ie(){H.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}s(ie,H),ie.prototype.imulK=function(c){for(var b=0,p=0;p<c.length;p++){var y=(c.words[p]|0)*19+b,C=y&67108863;y>>>=26,c.words[p]=C,b=y}return b!==0&&(c.words[c.length++]=b),c},i._prime=function(c){if(z[c])return z[c];var b;if(c==="k256")b=new K;else if(c==="p224")b=new G;else if(c==="p192")b=new V;else if(c==="p25519")b=new ie;else throw new Error("Unknown prime "+c);return z[c]=b,b};function ne(I){if(typeof I=="string"){var c=i._prime(I);this.m=c.p,this.prime=c}else r(I.gtn(1),"modulus must be greater than 1"),this.m=I,this.prime=null}ne.prototype._verify1=function(c){r(c.negative===0,"red works only with positives"),r(c.red,"red works only with red numbers")},ne.prototype._verify2=function(c,b){r((c.negative|b.negative)===0,"red works only with positives"),r(c.red&&c.red===b.red,"red works only with red numbers")},ne.prototype.imod=function(c){return this.prime?this.prime.ireduce(c)._forceRed(this):(m(c,c.umod(this.m)._forceRed(this)),c)},ne.prototype.neg=function(c){return c.isZero()?c.clone():this.m.sub(c)._forceRed(this)},ne.prototype.add=function(c,b){this._verify2(c,b);var p=c.add(b);return p.cmp(this.m)>=0&&p.isub(this.m),p._forceRed(this)},ne.prototype.iadd=function(c,b){this._verify2(c,b);var p=c.iadd(b);return p.cmp(this.m)>=0&&p.isub(this.m),p},ne.prototype.sub=function(c,b){this._verify2(c,b);var p=c.sub(b);return p.cmpn(0)<0&&p.iadd(this.m),p._forceRed(this)},ne.prototype.isub=function(c,b){this._verify2(c,b);var p=c.isub(b);return p.cmpn(0)<0&&p.iadd(this.m),p},ne.prototype.shl=function(c,b){return this._verify1(c),this.imod(c.ushln(b))},ne.prototype.imul=function(c,b){return this._verify2(c,b),this.imod(c.imul(b))},ne.prototype.mul=function(c,b){return this._verify2(c,b),this.imod(c.mul(b))},ne.prototype.isqr=function(c){return this.imul(c,c.clone())},ne.prototype.sqr=function(c){return this.mul(c,c)},ne.prototype.sqrt=function(c){if(c.isZero())return c.clone();var b=this.m.andln(3);if(r(b%2===1),b===3){var p=this.m.add(new i(1)).iushrn(2);return this.pow(c,p)}for(var y=this.m.subn(1),C=0;!y.isZero()&&y.andln(1)===0;)C++,y.iushrn(1);r(!y.isZero());var T=new i(1).toRed(this),_=T.redNeg(),B=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new i(2*u*u).toRed(this);this.pow(u,B).cmp(_)!==0;)u.redIAdd(_);for(var k=this.pow(u,y),$=this.pow(c,y.addn(1).iushrn(1)),Z=this.pow(c,y),ee=C;Z.cmp(T)!==0;){for(var Ae=Z,le=0;Ae.cmp(T)!==0;le++)Ae=Ae.redSqr();r(le<ee);var ue=this.pow(k,new i(1).iushln(ee-le-1));$=$.redMul(ue),k=ue.redSqr(),Z=Z.redMul(k),ee=le}return $},ne.prototype.invm=function(c){var b=c._invmp(this.m);return b.negative!==0?(b.negative=0,this.imod(b).redNeg()):this.imod(b)},ne.prototype.pow=function(c,b){if(b.isZero())return new i(1).toRed(this);if(b.cmpn(1)===0)return c.clone();var p=4,y=new Array(1<<p);y[0]=new i(1).toRed(this),y[1]=c;for(var C=2;C<y.length;C++)y[C]=this.mul(y[C-1],c);var T=y[0],_=0,B=0,u=b.bitLength()%26;for(u===0&&(u=26),C=b.length-1;C>=0;C--){for(var k=b.words[C],$=u-1;$>=0;$--){var Z=k>>$&1;if(T!==y[0]&&(T=this.sqr(T)),Z===0&&_===0){B=0;continue}_<<=1,_|=Z,B++,!(B!==p&&(C!==0||$!==0))&&(T=this.mul(T,y[_]),B=0,_=0)}u=26}return T},ne.prototype.convertTo=function(c){var b=c.umod(this.m);return b===c?b.clone():b},ne.prototype.convertFrom=function(c){var b=c.clone();return b.red=null,b},i.mont=function(c){return new ae(c)};function ae(I){ne.call(this,I),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}s(ae,ne),ae.prototype.convertTo=function(c){return this.imod(c.ushln(this.shift))},ae.prototype.convertFrom=function(c){var b=this.imod(c.mul(this.rinv));return b.red=null,b},ae.prototype.imul=function(c,b){if(c.isZero()||b.isZero())return c.words[0]=0,c.length=1,c;var p=c.imul(b),y=p.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),C=p.isub(y).iushrn(this.shift),T=C;return C.cmp(this.m)>=0?T=C.isub(this.m):C.cmpn(0)<0&&(T=C.iadd(this.m)),T._forceRed(this)},ae.prototype.mul=function(c,b){if(c.isZero()||b.isZero())return new i(0)._forceRed(this);var p=c.mul(b),y=p.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),C=p.isub(y).iushrn(this.shift),T=C;return C.cmp(this.m)>=0?T=C.isub(this.m):C.cmpn(0)<0&&(T=C.iadd(this.m)),T._forceRed(this)},ae.prototype.invm=function(c){var b=this.imod(c._invmp(this.m).mul(this.r2));return b._forceRed(this)}})(n,an)})(nl);var rl=nl.exports;const fc=Vs(rl),x0="6.13.5";function $y(n,e,t){const r=e.split("|").map(i=>i.trim());for(let i=0;i<r.length;i++)switch(e){case"any":return;case"bigint":case"boolean":case"number":case"string":if(typeof n===e)return}const s=new Error(`invalid value for type ${e}`);throw s.code="INVALID_ARGUMENT",s.argument=`value.${t}`,s.value=n,s}async function Vy(n){const e=Object.keys(n);return(await Promise.all(e.map(r=>Promise.resolve(n[r])))).reduce((r,s,i)=>(r[e[i]]=s,r),{})}function hc(n,e,t){for(let r in e){let s=e[r];const i=t?t[r]:null;i&&$y(s,i,r),Object.defineProperty(n,r,{enumerable:!0,value:s,writable:!1})}}function zr(n){if(n==null)return"null";if(Array.isArray(n))return"[ "+n.map(zr).join(", ")+" ]";if(n instanceof Uint8Array){const e="0123456789abcdef";let t="0x";for(let r=0;r<n.length;r++)t+=e[n[r]>>4],t+=e[n[r]&15];return t}if(typeof n=="object"&&typeof n.toJSON=="function")return zr(n.toJSON());switch(typeof n){case"boolean":case"symbol":return n.toString();case"bigint":return BigInt(n).toString();case"number":return n.toString();case"string":return JSON.stringify(n);case"object":{const e=Object.keys(n);return e.sort(),"{ "+e.map(t=>`${zr(t)}: ${zr(n[t])}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function C0(n,e){return n&&n.code===e}function Gy(n){return C0(n,"CALL_EXCEPTION")}function S0(n,e,t){let r=n;{const i=[];if(t){if("message"in t||"code"in t||"name"in t)throw new Error(`value will overwrite populated values: ${zr(t)}`);for(const o in t){if(o==="shortMessage")continue;const a=t[o];i.push(o+"="+zr(a))}}i.push(`code=${e}`),i.push(`version=${x0}`),i.length&&(n+=" ("+i.join(", ")+")")}let s;switch(e){case"INVALID_ARGUMENT":s=new TypeError(n);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":s=new RangeError(n);break;default:s=new Error(n)}return hc(s,{code:e}),t&&Object.assign(s,t),s.shortMessage==null&&hc(s,{shortMessage:r}),s}function vn(n,e,t,r){if(!n)throw S0(e,t,r)}function Zn(n,e,t,r){vn(n,e,"INVALID_ARGUMENT",{argument:t,value:r})}function Yy(n,e,t){t==null&&(t=""),t&&(t=": "+t),vn(n>=e,"missing argument"+t,"MISSING_ARGUMENT",{count:n,expectedCount:e}),vn(n<=e,"too many arguments"+t,"UNEXPECTED_ARGUMENT",{count:n,expectedCount:e})}const Xy=["NFD","NFC","NFKD","NFKC"].reduce((n,e)=>{try{if("test".normalize(e)!=="test")throw new Error("bad");if(e==="NFD"&&"é".normalize("NFD")!=="é")throw new Error("broken");n.push(e)}catch{}return n},[]);function Zy(n){vn(Xy.indexOf(n)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:n}})}function Jy(n,e,t){if(t==null&&(t=""),n!==e){let r=t,s="new";t&&(r+=".",s+=" "+t),vn(!1,`private constructor; use ${r}from* methods`,"UNSUPPORTED_OPERATION",{operation:s})}}function D0(n,e,t){if(n instanceof Uint8Array)return t?new Uint8Array(n):n;if(typeof n=="string"&&n.match(/^0x(?:[0-9a-f][0-9a-f])*$/i)){const r=new Uint8Array((n.length-2)/2);let s=2;for(let i=0;i<r.length;i++)r[i]=parseInt(n.substring(s,s+2),16),s+=2;return r}Zn(!1,"invalid BytesLike value",e||"value",n)}function Tr(n,e){return D0(n,e,!1)}function Qy(n,e){return D0(n,e,!0)}function sl(n,e){return!(typeof n!="string"||!n.match(/^0x[0-9A-Fa-f]*$/)||typeof e=="number"&&n.length!==2+2*e||e===!0&&n.length%2!==0)}function e2(n){return sl(n,!0)||n instanceof Uint8Array}const Vd="0123456789abcdef";function ei(n){const e=Tr(n);let t="0x";for(let r=0;r<e.length;r++){const s=e[r];t+=Vd[(s&240)>>4]+Vd[s&15]}return t}function t2(n){return"0x"+n.map(e=>ei(e).substring(2)).join("")}function n2(n){return sl(n,!0)?(n.length-2)/2:Tr(n).length}function r2(n,e,t){const r=Tr(n);return t!=null&&t>r.length&&vn(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:r,length:r.length,offset:t}),ei(r.slice(e??0,t??r.length))}function v0(n,e,t){const r=Tr(n);vn(e>=r.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(r),length:e,offset:e+1});const s=new Uint8Array(e);return s.fill(0),t?s.set(r,e-r.length):s.set(r,0),ei(s)}function s2(n,e){return v0(n,e,!0)}function i2(n,e){return v0(n,e,!1)}function Hs(n){if(!Number.isSafeInteger(n)||n<0)throw new Error(`Wrong positive integer: ${n}`)}function il(n,...e){if(!(n instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(n.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${n.length}`)}function o2(n){if(typeof n!="function"||typeof n.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Hs(n.outputLen),Hs(n.blockLen)}function mc(n,e=!0){if(n.destroyed)throw new Error("Hash instance has been destroyed");if(e&&n.finished)throw new Error("Hash#digest() has already been called")}function k0(n,e){il(n);const t=e.outputLen;if(n.length<t)throw new Error(`digestInto() expects output buffer of length at least ${t}`)}const ga=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const F0=n=>n instanceof Uint8Array,T0=n=>new Uint32Array(n.buffer,n.byteOffset,Math.floor(n.byteLength/4)),a2=n=>new DataView(n.buffer,n.byteOffset,n.byteLength),c2=(n,e)=>n<<32-e|n>>>e,l2=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!l2)throw new Error("Non little-endian hardware is not supported");const d2=async()=>{};async function u2(n,e,t){let r=Date.now();for(let s=0;s<n;s++){t(s);const i=Date.now()-r;i>=0&&i<e||(await d2(),r+=i)}}function f2(n){if(typeof n!="string")throw new Error(`utf8ToBytes expected string, got ${typeof n}`);return new Uint8Array(new TextEncoder().encode(n))}function ol(n){if(typeof n=="string"&&(n=f2(n)),!F0(n))throw new Error(`expected Uint8Array, got ${typeof n}`);return n}function h2(...n){const e=new Uint8Array(n.reduce((r,s)=>r+s.length,0));let t=0;return n.forEach(r=>{if(!F0(r))throw new Error("Uint8Array expected");e.set(r,t),t+=r.length}),e}class I0{clone(){return this._cloneInto()}}const m2={}.toString;function b2(n,e){if(e!==void 0&&m2.call(e)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(n,e)}function U0(n){const e=r=>n().update(ol(r)).digest(),t=n();return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=()=>n(),e}function p2(n=32){if(ga&&typeof ga.getRandomValues=="function")return ga.getRandomValues(new Uint8Array(n));throw new Error("crypto.getRandomValues must be defined")}const ui=BigInt(2**32-1),bc=BigInt(32);function _0(n,e=!1){return e?{h:Number(n&ui),l:Number(n>>bc&ui)}:{h:Number(n>>bc&ui)|0,l:Number(n&ui)|0}}function M0(n,e=!1){let t=new Uint32Array(n.length),r=new Uint32Array(n.length);for(let s=0;s<n.length;s++){const{h:i,l:o}=_0(n[s],e);[t[s],r[s]]=[i,o]}return[t,r]}const g2=(n,e)=>BigInt(n>>>0)<<bc|BigInt(e>>>0),y2=(n,e,t)=>n>>>t,w2=(n,e,t)=>n<<32-t|e>>>t,A2=(n,e,t)=>n>>>t|e<<32-t,E2=(n,e,t)=>n<<32-t|e>>>t,B2=(n,e,t)=>n<<64-t|e>>>t-32,x2=(n,e,t)=>n>>>t-32|e<<64-t,C2=(n,e)=>e,S2=(n,e)=>n,R0=(n,e,t)=>n<<t|e>>>32-t,W0=(n,e,t)=>e<<t|n>>>32-t,P0=(n,e,t)=>e<<t-32|n>>>64-t,L0=(n,e,t)=>n<<t-32|e>>>64-t;function D2(n,e,t,r){const s=(e>>>0)+(r>>>0);return{h:n+t+(s/2**32|0)|0,l:s|0}}const v2=(n,e,t)=>(n>>>0)+(e>>>0)+(t>>>0),k2=(n,e,t,r)=>e+t+r+(n/2**32|0)|0,F2=(n,e,t,r)=>(n>>>0)+(e>>>0)+(t>>>0)+(r>>>0),T2=(n,e,t,r,s)=>e+t+r+s+(n/2**32|0)|0,I2=(n,e,t,r,s)=>(n>>>0)+(e>>>0)+(t>>>0)+(r>>>0)+(s>>>0),U2=(n,e,t,r,s,i)=>e+t+r+s+i+(n/2**32|0)|0,_2={fromBig:_0,split:M0,toBig:g2,shrSH:y2,shrSL:w2,rotrSH:A2,rotrSL:E2,rotrBH:B2,rotrBL:x2,rotr32H:C2,rotr32L:S2,rotlSH:R0,rotlSL:W0,rotlBH:P0,rotlBL:L0,add:D2,add3L:v2,add3H:k2,add4L:F2,add4H:T2,add5H:U2,add5L:I2},[O0,N0,z0]=[[],[],[]],M2=BigInt(0),As=BigInt(1),R2=BigInt(2),W2=BigInt(7),P2=BigInt(256),L2=BigInt(113);for(let n=0,e=As,t=1,r=0;n<24;n++){[t,r]=[r,(2*t+3*r)%5],O0.push(2*(5*r+t)),N0.push((n+1)*(n+2)/2%64);let s=M2;for(let i=0;i<7;i++)e=(e<<As^(e>>W2)*L2)%P2,e&R2&&(s^=As<<(As<<BigInt(i))-As);z0.push(s)}const[O2,N2]=M0(z0,!0),Gd=(n,e,t)=>t>32?P0(n,e,t):R0(n,e,t),Yd=(n,e,t)=>t>32?L0(n,e,t):W0(n,e,t);function z2(n,e=24){const t=new Uint32Array(10);for(let r=24-e;r<24;r++){for(let o=0;o<10;o++)t[o]=n[o]^n[o+10]^n[o+20]^n[o+30]^n[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,l=(o+2)%10,h=t[l],m=t[l+1],E=Gd(h,m,1)^t[a],S=Yd(h,m,1)^t[a+1];for(let A=0;A<50;A+=10)n[o+A]^=E,n[o+A+1]^=S}let s=n[2],i=n[3];for(let o=0;o<24;o++){const a=N0[o],l=Gd(s,i,a),h=Yd(s,i,a),m=O0[o];s=n[m],i=n[m+1],n[m]=l,n[m+1]=h}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)t[a]=n[o+a];for(let a=0;a<10;a++)n[o+a]^=~t[(a+2)%10]&t[(a+4)%10]}n[0]^=O2[r],n[1]^=N2[r]}t.fill(0)}class al extends I0{constructor(e,t,r,s=!1,i=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=s,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,Hs(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=T0(this.state)}keccak(){z2(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){mc(this);const{blockLen:t,state:r}=this;e=ol(e);const s=e.length;for(let i=0;i<s;){const o=Math.min(t-this.pos,s-i);for(let a=0;a<o;a++)r[this.pos++]^=e[i++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:t,pos:r,blockLen:s}=this;e[r]^=t,t&128&&r===s-1&&this.keccak(),e[s-1]^=128,this.keccak()}writeInto(e){mc(this,!1),il(e),this.finish();const t=this.state,{blockLen:r}=this;for(let s=0,i=e.length;s<i;){this.posOut>=r&&this.keccak();const o=Math.min(r-this.posOut,i-s);e.set(t.subarray(this.posOut,this.posOut+o),s),this.posOut+=o,s+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return Hs(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(k0(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:t,suffix:r,outputLen:s,rounds:i,enableXOF:o}=this;return e||(e=new al(t,r,s,o,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=r,e.outputLen=s,e.enableXOF=o,e.destroyed=this.destroyed,e}}const H2=(n,e,t)=>U0(()=>new al(e,n,t)),q2=H2(1,136,256/8);let H0=!1;const q0=function(n){return q2(n)};let K0=q0;function us(n){const e=Tr(n,"data");return ei(K0(e))}us._=q0;us.lock=function(){H0=!0};us.register=function(n){if(H0)throw new TypeError("keccak256 is locked");K0=n};Object.freeze(us);const K2=BigInt(0),j2=BigInt(36);function Xd(n){n=n.toLowerCase();const e=n.substring(2).split(""),t=new Uint8Array(40);for(let s=0;s<40;s++)t[s]=e[s].charCodeAt(0);const r=Tr(us(t));for(let s=0;s<40;s+=2)r[s>>1]>>4>=8&&(e[s]=e[s].toUpperCase()),(r[s>>1]&15)>=8&&(e[s+1]=e[s+1].toUpperCase());return"0x"+e.join("")}const cl={};for(let n=0;n<10;n++)cl[String(n)]=String(n);for(let n=0;n<26;n++)cl[String.fromCharCode(65+n)]=String(10+n);const Zd=15;function $2(n){n=n.toUpperCase(),n=n.substring(4)+n.substring(0,2)+"00";let e=n.split("").map(r=>cl[r]).join("");for(;e.length>=Zd;){let r=e.substring(0,Zd);e=parseInt(r,10)%97+e.substring(r.length)}let t=String(98-parseInt(e,10)%97);for(;t.length<2;)t="0"+t;return t}const V2=function(){const n={};for(let e=0;e<36;e++){const t="0123456789abcdefghijklmnopqrstuvwxyz"[e];n[t]=BigInt(e)}return n}();function G2(n){n=n.toLowerCase();let e=K2;for(let t=0;t<n.length;t++)e=e*j2+V2[n[t]];return e}function yr(n){if(Zn(typeof n=="string","invalid address","address",n),n.match(/^(0x)?[0-9a-fA-F]{40}$/)){n.startsWith("0x")||(n="0x"+n);const e=Xd(n);return Zn(!n.match(/([A-F].*[a-f])|([a-f].*[A-F])/)||e===n,"bad address checksum","address",n),e}if(n.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){Zn(n.substring(2,4)===$2(n),"bad icap checksum","address",n);let e=G2(n.substring(4)).toString(16);for(;e.length<40;)e="0"+e;return Xd("0x"+e)}Zn(!1,"invalid address","address",n)}function j0(n){return n&&typeof n.getAddress=="function"}function Y2(n){try{return yr(n),!0}catch{}return!1}async function ya(n,e){const t=await e;return(t==null||t==="0x0000000000000000000000000000000000000000")&&(vn(typeof n!="string","unconfigured name","UNCONFIGURED_NAME",{value:n}),Zn(!1,"invalid AddressLike value; did not resolve to a value address","target",n)),yr(t)}function X2(n,e){if(typeof n=="string")return n.match(/^0x[0-9a-f]{40}$/i)?yr(n):(vn(e!=null,"ENS resolution requires a provider","UNSUPPORTED_OPERATION",{operation:"resolveName"}),ya(n,e.resolveName(n)));if(j0(n))return ya(n,n.getAddress());if(n&&typeof n.then=="function")return ya(n,n);Zn(!1,"unsupported addressable value","target",n)}const Z2=0,J2=0n,ll="Evm",Q2=(n,e)=>({...n,from:e}),e8=(n,e)=>({...n,chainId:e}),t8="0x0000000000000000000000000000000000000000",Jt=class Jt{constructor(e){re(this,"type","Native");re(this,"address");if(Jt.instanceof(e)){const t=e;this.address=t.address;return}if(typeof e=="string"){if(!Jt.isValidAddress(e))throw new Error(`Invalid EVM address, expected ${Jt.byteSize}-byte hex string but got ${e}`);this.address=yr(e)}else if(e instanceof Uint8Array)e=this.trimUniversalAddress(e),this.address=yr(_t.encode(e));else if(Nt.instanceof(e)){const t=this.trimUniversalAddress(e.toUint8Array());this.address=yr(_t.encode(t))}else throw new Error(`Invalid EVM address ${e}`)}unwrap(){return this.address}toString(){return this.address}toNative(){return this}toUint8Array(){return _t.decode(this.address)}toUniversalAddress(){return new Nt(this.address,"hex")}trimUniversalAddress(e){if(e.length===Jt.byteSize)return e;if(e.length<Jt.byteSize)throw new Error(`Invalid evm address, expected ${Jt.byteSize} bytes`);if(e.length!==Nt.byteSize)throw new Error(`Invalid universal address, expected ${Nt.byteSize} bytes`);if(Ss.decode(e.slice(0,12))!==0n)throw new Error(`Invalid EVM address ${e} expected first 12 bytes to be 0s`);return e.slice(12)}static isValidAddress(e){return Y2(e)}static instanceof(e){return e.constructor.platform===Jt.platform}equals(e){return Jt.instanceof(e)?e.address===this.address:e.equals(this.toUniversalAddress())}};re(Jt,"byteSize",20),re(Jt,"platform",ll);let Ni=Jt;qc(ll,Ni);var fi=B0.Buffer;function n8(n){if(n.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),t=0;t<e.length;t++)e[t]=255;for(var r=0;r<n.length;r++){var s=n.charAt(r),i=s.charCodeAt(0);if(e[i]!==255)throw new TypeError(s+" is ambiguous");e[i]=r}var o=n.length,a=n.charAt(0),l=Math.log(o)/Math.log(256),h=Math.log(256)/Math.log(o);function m(A){if((Array.isArray(A)||A instanceof Uint8Array)&&(A=fi.from(A)),!fi.isBuffer(A))throw new TypeError("Expected Buffer");if(A.length===0)return"";for(var g=0,D=0,x=0,U=A.length;x!==U&&A[x]===0;)x++,g++;for(var R=(U-x)*h+1>>>0,F=new Uint8Array(R);x!==U;){for(var W=A[x],z=0,H=R-1;(W!==0||z<D)&&H!==-1;H--,z++)W+=256*F[H]>>>0,F[H]=W%o>>>0,W=W/o>>>0;if(W!==0)throw new Error("Non-zero carry");D=z,x++}for(var K=R-D;K!==R&&F[K]===0;)K++;for(var G=a.repeat(g);K<R;++K)G+=n.charAt(F[K]);return G}function E(A){if(typeof A!="string")throw new TypeError("Expected String");if(A.length===0)return fi.alloc(0);for(var g=0,D=0,x=0;A[g]===a;)D++,g++;for(var U=(A.length-g)*l+1>>>0,R=new Uint8Array(U);g<A.length;){var F=e[A.charCodeAt(g)];if(F===255)return;for(var W=0,z=U-1;(F!==0||W<x)&&z!==-1;z--,W++)F+=o*R[z]>>>0,R[z]=F%256>>>0,F=F/256>>>0;if(F!==0)throw new Error("Non-zero carry");x=W,g++}for(var H=U-x;H!==U&&R[H]===0;)H++;var K=fi.allocUnsafe(D+(U-H));K.fill(0,0,D);for(var G=D;H!==U;)K[G++]=R[H++];return K}function S(A){var g=E(A);if(g)return g;throw new Error("Non-base"+o+" character")}return{encode:m,decodeUnsafe:E,decode:S}}var r8=n8,s8=r8,i8="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",$0=s8(i8);const vt=Vs($0);var Ut={};function On(n,e,t){return e<=n&&n<=t}function Ao(n){if(n===void 0)return{};if(n===Object(n))return n;throw TypeError("Could not convert argument to dictionary")}function o8(n){for(var e=String(n),t=e.length,r=0,s=[];r<t;){var i=e.charCodeAt(r);if(i<55296||i>57343)s.push(i);else if(56320<=i&&i<=57343)s.push(65533);else if(55296<=i&&i<=56319)if(r===t-1)s.push(65533);else{var o=n.charCodeAt(r+1);if(56320<=o&&o<=57343){var a=i&1023,l=o&1023;s.push(65536+(a<<10)+l),r+=1}else s.push(65533)}r+=1}return s}function a8(n){for(var e="",t=0;t<n.length;++t){var r=n[t];r<=65535?e+=String.fromCharCode(r):(r-=65536,e+=String.fromCharCode((r>>10)+55296,(r&1023)+56320))}return e}var zi=-1;function dl(n){this.tokens=[].slice.call(n)}dl.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.shift():zi},prepend:function(n){if(Array.isArray(n))for(var e=n;e.length;)this.tokens.unshift(e.pop());else this.tokens.unshift(n)},push:function(n){if(Array.isArray(n))for(var e=n;e.length;)this.tokens.push(e.shift());else this.tokens.push(n)}};var Zr=-1;function wa(n,e){if(n)throw TypeError("Decoder error");return e||65533}var Hi="utf-8";function qi(n,e){if(!(this instanceof qi))return new qi(n,e);if(n=n!==void 0?String(n).toLowerCase():Hi,n!==Hi)throw new Error("Encoding not supported. Only utf-8 is supported");e=Ao(e),this._streaming=!1,this._BOMseen=!1,this._decoder=null,this._fatal=!!e.fatal,this._ignoreBOM=!!e.ignoreBOM,Object.defineProperty(this,"encoding",{value:"utf-8"}),Object.defineProperty(this,"fatal",{value:this._fatal}),Object.defineProperty(this,"ignoreBOM",{value:this._ignoreBOM})}qi.prototype={decode:function(e,t){var r;typeof e=="object"&&e instanceof ArrayBuffer?r=new Uint8Array(e):typeof e=="object"&&"buffer"in e&&e.buffer instanceof ArrayBuffer?r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):r=new Uint8Array(0),t=Ao(t),this._streaming||(this._decoder=new c8({fatal:this._fatal}),this._BOMseen=!1),this._streaming=!!t.stream;for(var s=new dl(r),i=[],o;!s.endOfStream()&&(o=this._decoder.handler(s,s.read()),o!==Zr);)o!==null&&(Array.isArray(o)?i.push.apply(i,o):i.push(o));if(!this._streaming){do{if(o=this._decoder.handler(s,s.read()),o===Zr)break;o!==null&&(Array.isArray(o)?i.push.apply(i,o):i.push(o))}while(!s.endOfStream());this._decoder=null}return i.length&&["utf-8"].indexOf(this.encoding)!==-1&&!this._ignoreBOM&&!this._BOMseen&&(i[0]===65279?(this._BOMseen=!0,i.shift()):this._BOMseen=!0),a8(i)}};function Ki(n,e){if(!(this instanceof Ki))return new Ki(n,e);if(n=n!==void 0?String(n).toLowerCase():Hi,n!==Hi)throw new Error("Encoding not supported. Only utf-8 is supported");e=Ao(e),this._streaming=!1,this._encoder=null,this._options={fatal:!!e.fatal},Object.defineProperty(this,"encoding",{value:"utf-8"})}Ki.prototype={encode:function(e,t){e=e?String(e):"",t=Ao(t),this._streaming||(this._encoder=new l8(this._options)),this._streaming=!!t.stream;for(var r=[],s=new dl(o8(e)),i;!s.endOfStream()&&(i=this._encoder.handler(s,s.read()),i!==Zr);)Array.isArray(i)?r.push.apply(r,i):r.push(i);if(!this._streaming){for(;i=this._encoder.handler(s,s.read()),i!==Zr;)Array.isArray(i)?r.push.apply(r,i):r.push(i);this._encoder=null}return new Uint8Array(r)}};function c8(n){var e=n.fatal,t=0,r=0,s=0,i=128,o=191;this.handler=function(a,l){if(l===zi&&s!==0)return s=0,wa(e);if(l===zi)return Zr;if(s===0){if(On(l,0,127))return l;if(On(l,194,223))s=1,t=l-192;else if(On(l,224,239))l===224&&(i=160),l===237&&(o=159),s=2,t=l-224;else if(On(l,240,244))l===240&&(i=144),l===244&&(o=143),s=3,t=l-240;else return wa(e);return t=t<<6*s,null}if(!On(l,i,o))return t=s=r=0,i=128,o=191,a.prepend(l),wa(e);if(i=128,o=191,r+=1,t+=l-128<<6*(s-r),r!==s)return null;var h=t;return t=s=r=0,h}}function l8(n){n.fatal,this.handler=function(e,t){if(t===zi)return Zr;if(On(t,0,127))return t;var r,s;On(t,128,2047)?(r=1,s=192):On(t,2048,65535)?(r=2,s=224):On(t,65536,1114111)&&(r=3,s=240);for(var i=[(t>>6*r)+s];r>0;){var o=t>>6*(r-1);i.push(128|o&63),r-=1}return i}}const d8=Object.freeze(Object.defineProperty({__proto__:null,TextDecoder:qi,TextEncoder:Ki},Symbol.toStringTag,{value:"Module"})),u8=Bc(d8);var f8=an&&an.__createBinding||(Object.create?function(n,e,t,r){r===void 0&&(r=t),Object.defineProperty(n,r,{enumerable:!0,get:function(){return e[t]}})}:function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]}),h8=an&&an.__setModuleDefault||(Object.create?function(n,e){Object.defineProperty(n,"default",{enumerable:!0,value:e})}:function(n,e){n.default=e}),Tn=an&&an.__decorate||function(n,e,t,r){var s=arguments.length,i=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(s<3?o(i):s>3?o(e,t,i):o(e,t))||i);return s>3&&i&&Object.defineProperty(e,t,i),i},m8=an&&an.__importStar||function(n){if(n&&n.__esModule)return n;var e={};if(n!=null)for(var t in n)t!=="default"&&Object.hasOwnProperty.call(n,t)&&f8(e,n,t);return h8(e,n),e},V0=an&&an.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Ut,"__esModule",{value:!0});var G0=Ut.deserializeUnchecked=eh=Ut.deserialize=Q0=Ut.serialize=Ut.BinaryReader=Ut.BinaryWriter=Ut.BorshError=Ut.baseDecode=Ut.baseEncode=void 0;const Jn=V0(rl),Y0=V0($0),b8=m8(u8),p8=typeof TextDecoder!="function"?b8.TextDecoder:TextDecoder,g8=new p8("utf-8",{fatal:!0});function y8(n){return typeof n=="string"&&(n=Ve.Buffer.from(n,"utf8")),Y0.default.encode(Ve.Buffer.from(n))}Ut.baseEncode=y8;function w8(n){return Ve.Buffer.from(Y0.default.decode(n))}Ut.baseDecode=w8;const Aa=1024;class Ht extends Error{constructor(e){super(e),this.fieldPath=[],this.originalMessage=e}addToFieldPath(e){this.fieldPath.splice(0,0,e),this.message=this.originalMessage+": "+this.fieldPath.join(".")}}Ut.BorshError=Ht;class X0{constructor(){this.buf=Ve.Buffer.alloc(Aa),this.length=0}maybeResize(){this.buf.length<16+this.length&&(this.buf=Ve.Buffer.concat([this.buf,Ve.Buffer.alloc(Aa)]))}writeU8(e){this.maybeResize(),this.buf.writeUInt8(e,this.length),this.length+=1}writeU16(e){this.maybeResize(),this.buf.writeUInt16LE(e,this.length),this.length+=2}writeU32(e){this.maybeResize(),this.buf.writeUInt32LE(e,this.length),this.length+=4}writeU64(e){this.maybeResize(),this.writeBuffer(Ve.Buffer.from(new Jn.default(e).toArray("le",8)))}writeU128(e){this.maybeResize(),this.writeBuffer(Ve.Buffer.from(new Jn.default(e).toArray("le",16)))}writeU256(e){this.maybeResize(),this.writeBuffer(Ve.Buffer.from(new Jn.default(e).toArray("le",32)))}writeU512(e){this.maybeResize(),this.writeBuffer(Ve.Buffer.from(new Jn.default(e).toArray("le",64)))}writeBuffer(e){this.buf=Ve.Buffer.concat([Ve.Buffer.from(this.buf.subarray(0,this.length)),e,Ve.Buffer.alloc(Aa)]),this.length+=e.length}writeString(e){this.maybeResize();const t=Ve.Buffer.from(e,"utf8");this.writeU32(t.length),this.writeBuffer(t)}writeFixedArray(e){this.writeBuffer(Ve.Buffer.from(e))}writeArray(e,t){this.maybeResize(),this.writeU32(e.length);for(const r of e)this.maybeResize(),t(r)}toArray(){return this.buf.subarray(0,this.length)}}Ut.BinaryWriter=X0;function In(n,e,t){const r=t.value;t.value=function(...s){try{return r.apply(this,s)}catch(i){if(i instanceof RangeError){const o=i.code;if(["ERR_BUFFER_OUT_OF_BOUNDS","ERR_OUT_OF_RANGE"].indexOf(o)>=0)throw new Ht("Reached the end of buffer when deserializing")}throw i}}}class Zt{constructor(e){this.buf=e,this.offset=0}readU8(){const e=this.buf.readUInt8(this.offset);return this.offset+=1,e}readU16(){const e=this.buf.readUInt16LE(this.offset);return this.offset+=2,e}readU32(){const e=this.buf.readUInt32LE(this.offset);return this.offset+=4,e}readU64(){const e=this.readBuffer(8);return new Jn.default(e,"le")}readU128(){const e=this.readBuffer(16);return new Jn.default(e,"le")}readU256(){const e=this.readBuffer(32);return new Jn.default(e,"le")}readU512(){const e=this.readBuffer(64);return new Jn.default(e,"le")}readBuffer(e){if(this.offset+e>this.buf.length)throw new Ht(`Expected buffer length ${e} isn't within bounds`);const t=this.buf.slice(this.offset,this.offset+e);return this.offset+=e,t}readString(){const e=this.readU32(),t=this.readBuffer(e);try{return g8.decode(t)}catch(r){throw new Ht(`Error decoding UTF-8 string: ${r}`)}}readFixedArray(e){return new Uint8Array(this.readBuffer(e))}readArray(e){const t=this.readU32(),r=Array();for(let s=0;s<t;++s)r.push(e());return r}}Tn([In],Zt.prototype,"readU8",null);Tn([In],Zt.prototype,"readU16",null);Tn([In],Zt.prototype,"readU32",null);Tn([In],Zt.prototype,"readU64",null);Tn([In],Zt.prototype,"readU128",null);Tn([In],Zt.prototype,"readU256",null);Tn([In],Zt.prototype,"readU512",null);Tn([In],Zt.prototype,"readString",null);Tn([In],Zt.prototype,"readFixedArray",null);Tn([In],Zt.prototype,"readArray",null);Ut.BinaryReader=Zt;function Z0(n){return n.charAt(0).toUpperCase()+n.slice(1)}function cr(n,e,t,r,s){try{if(typeof r=="string")s[`write${Z0(r)}`](t);else if(r instanceof Array)if(typeof r[0]=="number"){if(t.length!==r[0])throw new Ht(`Expecting byte array of length ${r[0]}, but got ${t.length} bytes`);s.writeFixedArray(t)}else if(r.length===2&&typeof r[1]=="number"){if(t.length!==r[1])throw new Ht(`Expecting byte array of length ${r[1]}, but got ${t.length} bytes`);for(let i=0;i<r[1];i++)cr(n,null,t[i],r[0],s)}else s.writeArray(t,i=>{cr(n,e,i,r[0],s)});else if(r.kind!==void 0)switch(r.kind){case"option":{t==null?s.writeU8(0):(s.writeU8(1),cr(n,e,t,r.type,s));break}case"map":{s.writeU32(t.size),t.forEach((i,o)=>{cr(n,e,o,r.key,s),cr(n,e,i,r.value,s)});break}default:throw new Ht(`FieldType ${r} unrecognized`)}else J0(n,t,s)}catch(i){throw i instanceof Ht&&i.addToFieldPath(e),i}}function J0(n,e,t){if(typeof e.borshSerialize=="function"){e.borshSerialize(t);return}const r=n.get(e.constructor);if(!r)throw new Ht(`Class ${e.constructor.name} is missing in schema`);if(r.kind==="struct")r.fields.map(([s,i])=>{cr(n,s,e[s],i,t)});else if(r.kind==="enum"){const s=e[r.field];for(let i=0;i<r.values.length;++i){const[o,a]=r.values[i];if(o===s){t.writeU8(i),cr(n,o,e[o],a,t);break}}}else throw new Ht(`Unexpected schema kind: ${r.kind} for ${e.constructor.name}`)}function A8(n,e,t=X0){const r=new t;return J0(n,e,r),r.toArray()}var Q0=Ut.serialize=A8;function lr(n,e,t,r){try{if(typeof t=="string")return r[`read${Z0(t)}`]();if(t instanceof Array){if(typeof t[0]=="number")return r.readFixedArray(t[0]);if(typeof t[1]=="number"){const s=[];for(let i=0;i<t[1];i++)s.push(lr(n,null,t[0],r));return s}else return r.readArray(()=>lr(n,e,t[0],r))}if(t.kind==="option")return r.readU8()?lr(n,e,t.type,r):void 0;if(t.kind==="map"){let s=new Map;const i=r.readU32();for(let o=0;o<i;o++){const a=lr(n,e,t.key,r),l=lr(n,e,t.value,r);s.set(a,l)}return s}return ul(n,t,r)}catch(s){throw s instanceof Ht&&s.addToFieldPath(e),s}}function ul(n,e,t){if(typeof e.borshDeserialize=="function")return e.borshDeserialize(t);const r=n.get(e);if(!r)throw new Ht(`Class ${e.name} is missing in schema`);if(r.kind==="struct"){const s={};for(const[i,o]of n.get(e).fields)s[i]=lr(n,i,o,t);return new e(s)}if(r.kind==="enum"){const s=t.readU8();if(s>=r.values.length)throw new Ht(`Enum index: ${s} is out of range`);const[i,o]=r.values[s],a=lr(n,i,o,t);return new e({[i]:a})}throw new Ht(`Unexpected schema kind: ${r.kind} for ${e.constructor.name}`)}function E8(n,e,t,r=Zt){const s=new r(t),i=ul(n,e,s);if(s.offset<t.length)throw new Ht(`Unexpected ${t.length-s.offset} bytes after deserialized data`);return i}var eh=Ut.deserialize=E8;function B8(n,e,t,r=Zt){const s=new r(t);return ul(n,e,s)}G0=Ut.deserializeUnchecked=B8;var O={};Object.defineProperty(O,"__esModule",{value:!0});exports.s16=O.s16=O.s8=O.nu64be=O.u48be=O.u40be=O.u32be=O.u24be=O.u16be=It=O.nu64=O.u48=O.u40=exports.u32=O.u32=O.u24=exports.u16=O.u16=exports.u8=O.u8=tr=O.offset=exports.greedy=O.greedy=O.Constant=O.UTF8=O.CString=O.Blob=O.Boolean=O.BitField=O.BitStructure=O.VariantLayout=O.Union=O.UnionLayoutDiscriminator=O.UnionDiscriminator=O.Structure=O.Sequence=O.DoubleBE=O.Double=O.FloatBE=O.Float=O.NearInt64BE=O.NearInt64=O.NearUInt64BE=O.NearUInt64=O.IntBE=O.Int=O.UIntBE=O.UInt=O.OffsetLayout=O.GreedyCount=O.ExternalLayout=O.bindConstructorLayout=O.nameWithProperty=O.Layout=O.uint8ArrayToBuffer=O.checkUint8Array=void 0;O.constant=O.utf8=O.cstr=exports.blob=O.blob=O.unionLayoutDiscriminator=O.union=exports.seq=O.seq=O.bits=exports.struct=O.struct=O.f64be=O.f64=O.f32be=O.f32=O.ns64be=O.s48be=O.s40be=O.s32be=O.s24be=O.s16be=exports.ns64=O.ns64=O.s48=O.s40=O.s32=O.s24=void 0;const fl=oe;function fs(n){if(!(n instanceof Uint8Array))throw new TypeError("b must be a Uint8Array")}O.checkUint8Array=fs;function Ie(n){return fs(n),fl.Buffer.from(n.buffer,n.byteOffset,n.length)}O.uint8ArrayToBuffer=Ie;class Me{constructor(e,t){if(!Number.isInteger(e))throw new TypeError("span must be an integer");this.span=e,this.property=t}makeDestinationObject(){return{}}getSpan(e,t){if(0>this.span)throw new RangeError("indeterminate span");return this.span}replicate(e){const t=Object.create(this.constructor.prototype);return Object.assign(t,this),t.property=e,t}fromArray(e){}}O.Layout=Me;function hl(n,e){return e.property?n+"["+e.property+"]":n}O.nameWithProperty=hl;function x8(n,e){if(typeof n!="function")throw new TypeError("Class must be constructor");if(Object.prototype.hasOwnProperty.call(n,"layout_"))throw new Error("Class is already bound to a layout");if(!(e&&e instanceof Me))throw new TypeError("layout must be a Layout");if(Object.prototype.hasOwnProperty.call(e,"boundConstructor_"))throw new Error("layout is already bound to a constructor");n.layout_=e,e.boundConstructor_=n,e.makeDestinationObject=()=>new n,Object.defineProperty(n.prototype,"encode",{value(t,r){return e.encode(this,t,r)},writable:!0}),Object.defineProperty(n,"decode",{value(t,r){return e.decode(t,r)},writable:!0})}O.bindConstructorLayout=x8;class Yt extends Me{isCount(){throw new Error("ExternalLayout is abstract")}}O.ExternalLayout=Yt;class th extends Yt{constructor(e=1,t){if(!Number.isInteger(e)||0>=e)throw new TypeError("elementSpan must be a (positive) integer");super(-1,t),this.elementSpan=e}isCount(){return!0}decode(e,t=0){fs(e);const r=e.length-t;return Math.floor(r/this.elementSpan)}encode(e,t,r){return 0}}O.GreedyCount=th;class ml extends Yt{constructor(e,t=0,r){if(!(e instanceof Me))throw new TypeError("layout must be a Layout");if(!Number.isInteger(t))throw new TypeError("offset must be integer or undefined");super(e.span,r||e.property),this.layout=e,this.offset=t}isCount(){return this.layout instanceof on||this.layout instanceof un}decode(e,t=0){return this.layout.decode(e,t+this.offset)}encode(e,t,r=0){return this.layout.encode(e,t,r+this.offset)}}O.OffsetLayout=ml;class on extends Me{constructor(e,t){if(super(e,t),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,t=0){return Ie(e).readUIntLE(t,this.span)}encode(e,t,r=0){return Ie(t).writeUIntLE(e,r,this.span),this.span}}O.UInt=on;class un extends Me{constructor(e,t){if(super(e,t),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,t=0){return Ie(e).readUIntBE(t,this.span)}encode(e,t,r=0){return Ie(t).writeUIntBE(e,r,this.span),this.span}}O.UIntBE=un;class Ir extends Me{constructor(e,t){if(super(e,t),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,t=0){return Ie(e).readIntLE(t,this.span)}encode(e,t,r=0){return Ie(t).writeIntLE(e,r,this.span),this.span}}O.Int=Ir;class hs extends Me{constructor(e,t){if(super(e,t),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,t=0){return Ie(e).readIntBE(t,this.span)}encode(e,t,r=0){return Ie(t).writeIntBE(e,r,this.span),this.span}}O.IntBE=hs;const pc=Math.pow(2,32);function Eo(n){const e=Math.floor(n/pc),t=n-e*pc;return{hi32:e,lo32:t}}function Bo(n,e){return n*pc+e}class nh extends Me{constructor(e){super(8,e)}decode(e,t=0){const r=Ie(e),s=r.readUInt32LE(t),i=r.readUInt32LE(t+4);return Bo(i,s)}encode(e,t,r=0){const s=Eo(e),i=Ie(t);return i.writeUInt32LE(s.lo32,r),i.writeUInt32LE(s.hi32,r+4),8}}O.NearUInt64=nh;class rh extends Me{constructor(e){super(8,e)}decode(e,t=0){const r=Ie(e),s=r.readUInt32BE(t),i=r.readUInt32BE(t+4);return Bo(s,i)}encode(e,t,r=0){const s=Eo(e),i=Ie(t);return i.writeUInt32BE(s.hi32,r),i.writeUInt32BE(s.lo32,r+4),8}}O.NearUInt64BE=rh;class sh extends Me{constructor(e){super(8,e)}decode(e,t=0){const r=Ie(e),s=r.readUInt32LE(t),i=r.readInt32LE(t+4);return Bo(i,s)}encode(e,t,r=0){const s=Eo(e),i=Ie(t);return i.writeUInt32LE(s.lo32,r),i.writeInt32LE(s.hi32,r+4),8}}O.NearInt64=sh;class ih extends Me{constructor(e){super(8,e)}decode(e,t=0){const r=Ie(e),s=r.readInt32BE(t),i=r.readUInt32BE(t+4);return Bo(s,i)}encode(e,t,r=0){const s=Eo(e),i=Ie(t);return i.writeInt32BE(s.hi32,r),i.writeUInt32BE(s.lo32,r+4),8}}O.NearInt64BE=ih;class oh extends Me{constructor(e){super(4,e)}decode(e,t=0){return Ie(e).readFloatLE(t)}encode(e,t,r=0){return Ie(t).writeFloatLE(e,r),4}}O.Float=oh;class ah extends Me{constructor(e){super(4,e)}decode(e,t=0){return Ie(e).readFloatBE(t)}encode(e,t,r=0){return Ie(t).writeFloatBE(e,r),4}}O.FloatBE=ah;class ch extends Me{constructor(e){super(8,e)}decode(e,t=0){return Ie(e).readDoubleLE(t)}encode(e,t,r=0){return Ie(t).writeDoubleLE(e,r),8}}O.Double=ch;class lh extends Me{constructor(e){super(8,e)}decode(e,t=0){return Ie(e).readDoubleBE(t)}encode(e,t,r=0){return Ie(t).writeDoubleBE(e,r),8}}O.DoubleBE=lh;class dh extends Me{constructor(e,t,r){if(!(e instanceof Me))throw new TypeError("elementLayout must be a Layout");if(!(t instanceof Yt&&t.isCount()||Number.isInteger(t)&&0<=t))throw new TypeError("count must be non-negative integer or an unsigned integer ExternalLayout");let s=-1;!(t instanceof Yt)&&0<e.span&&(s=t*e.span),super(s,r),this.elementLayout=e,this.count=t}getSpan(e,t=0){if(0<=this.span)return this.span;let r=0,s=this.count;if(s instanceof Yt&&(s=s.decode(e,t)),0<this.elementLayout.span)r=s*this.elementLayout.span;else{let i=0;for(;i<s;)r+=this.elementLayout.getSpan(e,t+r),++i}return r}decode(e,t=0){const r=[];let s=0,i=this.count;for(i instanceof Yt&&(i=i.decode(e,t));s<i;)r.push(this.elementLayout.decode(e,t)),t+=this.elementLayout.getSpan(e,t),s+=1;return r}encode(e,t,r=0){const s=this.elementLayout,i=e.reduce((o,a)=>o+s.encode(a,t,r+o),0);return this.count instanceof Yt&&this.count.encode(e.length,t,r),i}}O.Sequence=dh;class uh extends Me{constructor(e,t,r){if(!(Array.isArray(e)&&e.reduce((i,o)=>i&&o instanceof Me,!0)))throw new TypeError("fields must be array of Layout instances");typeof t=="boolean"&&r===void 0&&(r=t,t=void 0);for(const i of e)if(0>i.span&&i.property===void 0)throw new Error("fields cannot contain unnamed variable-length layout");let s=-1;try{s=e.reduce((i,o)=>i+o.getSpan(),0)}catch{}super(s,t),this.fields=e,this.decodePrefixes=!!r}getSpan(e,t=0){if(0<=this.span)return this.span;let r=0;try{r=this.fields.reduce((s,i)=>{const o=i.getSpan(e,t);return t+=o,s+o},0)}catch{throw new RangeError("indeterminate span")}return r}decode(e,t=0){fs(e);const r=this.makeDestinationObject();for(const s of this.fields)if(s.property!==void 0&&(r[s.property]=s.decode(e,t)),t+=s.getSpan(e,t),this.decodePrefixes&&e.length===t)break;return r}encode(e,t,r=0){const s=r;let i=0,o=0;for(const a of this.fields){let l=a.span;if(o=0<l?l:0,a.property!==void 0){const h=e[a.property];h!==void 0&&(o=a.encode(h,t,r),0>l&&(l=a.getSpan(t,r)))}i=r,r+=l}return i+o-s}fromArray(e){const t=this.makeDestinationObject();for(const r of this.fields)r.property!==void 0&&0<e.length&&(t[r.property]=e.shift());return t}layoutFor(e){if(typeof e!="string")throw new TypeError("property must be string");for(const t of this.fields)if(t.property===e)return t}offsetOf(e){if(typeof e!="string")throw new TypeError("property must be string");let t=0;for(const r of this.fields){if(r.property===e)return t;0>r.span?t=-1:0<=t&&(t+=r.span)}}}O.Structure=uh;class bl{constructor(e){this.property=e}decode(e,t){throw new Error("UnionDiscriminator is abstract")}encode(e,t,r){throw new Error("UnionDiscriminator is abstract")}}O.UnionDiscriminator=bl;class ji extends bl{constructor(e,t){if(!(e instanceof Yt&&e.isCount()))throw new TypeError("layout must be an unsigned integer ExternalLayout");super(t||e.property||"variant"),this.layout=e}decode(e,t){return this.layout.decode(e,t)}encode(e,t,r){return this.layout.encode(e,t,r)}}O.UnionLayoutDiscriminator=ji;class pl extends Me{constructor(e,t,r){let s;if(e instanceof on||e instanceof un)s=new ji(new ml(e));else if(e instanceof Yt&&e.isCount())s=new ji(e);else if(e instanceof bl)s=e;else throw new TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");if(t===void 0&&(t=null),!(t===null||t instanceof Me))throw new TypeError("defaultLayout must be null or a Layout");if(t!==null){if(0>t.span)throw new Error("defaultLayout must have constant span");t.property===void 0&&(t=t.replicate("content"))}let i=-1;t&&(i=t.span,0<=i&&(e instanceof on||e instanceof un)&&(i+=s.layout.span)),super(i,r),this.discriminator=s,this.usesPrefixDiscriminator=e instanceof on||e instanceof un,this.defaultLayout=t,this.registry={};let o=this.defaultGetSourceVariant.bind(this);this.getSourceVariant=function(a){return o(a)},this.configGetSourceVariant=function(a){o=a.bind(this)}}getSpan(e,t=0){if(0<=this.span)return this.span;const r=this.getVariant(e,t);if(!r)throw new Error("unable to determine span for unrecognized variant");return r.getSpan(e,t)}defaultGetSourceVariant(e){if(Object.prototype.hasOwnProperty.call(e,this.discriminator.property)){if(this.defaultLayout&&this.defaultLayout.property&&Object.prototype.hasOwnProperty.call(e,this.defaultLayout.property))return;const t=this.registry[e[this.discriminator.property]];if(t&&(!t.layout||t.property&&Object.prototype.hasOwnProperty.call(e,t.property)))return t}else for(const t in this.registry){const r=this.registry[t];if(r.property&&Object.prototype.hasOwnProperty.call(e,r.property))return r}throw new Error("unable to infer src variant")}decode(e,t=0){let r;const s=this.discriminator,i=s.decode(e,t),o=this.registry[i];if(o===void 0){const a=this.defaultLayout;let l=0;this.usesPrefixDiscriminator&&(l=s.layout.span),r=this.makeDestinationObject(),r[s.property]=i,r[a.property]=a.decode(e,t+l)}else r=o.decode(e,t);return r}encode(e,t,r=0){const s=this.getSourceVariant(e);if(s===void 0){const i=this.discriminator,o=this.defaultLayout;let a=0;return this.usesPrefixDiscriminator&&(a=i.layout.span),i.encode(e[i.property],t,r),a+o.encode(e[o.property],t,r+a)}return s.encode(e,t,r)}addVariant(e,t,r){const s=new fh(this,e,t,r);return this.registry[e]=s,s}getVariant(e,t=0){let r;return e instanceof Uint8Array?r=this.discriminator.decode(e,t):r=e,this.registry[r]}}O.Union=pl;class fh extends Me{constructor(e,t,r,s){if(!(e instanceof pl))throw new TypeError("union must be a Union");if(!Number.isInteger(t)||0>t)throw new TypeError("variant must be a (non-negative) integer");if(typeof r=="string"&&s===void 0&&(s=r,r=null),r){if(!(r instanceof Me))throw new TypeError("layout must be a Layout");if(e.defaultLayout!==null&&0<=r.span&&r.span>e.defaultLayout.span)throw new Error("variant span exceeds span of containing union");if(typeof s!="string")throw new TypeError("variant must have a String property")}let i=e.span;0>e.span&&(i=r?r.span:0,0<=i&&e.usesPrefixDiscriminator&&(i+=e.discriminator.layout.span)),super(i,s),this.union=e,this.variant=t,this.layout=r||null}getSpan(e,t=0){if(0<=this.span)return this.span;let r=0;this.union.usesPrefixDiscriminator&&(r=this.union.discriminator.layout.span);let s=0;return this.layout&&(s=this.layout.getSpan(e,t+r)),r+s}decode(e,t=0){const r=this.makeDestinationObject();if(this!==this.union.getVariant(e,t))throw new Error("variant mismatch");let s=0;return this.union.usesPrefixDiscriminator&&(s=this.union.discriminator.layout.span),this.layout?r[this.property]=this.layout.decode(e,t+s):this.property?r[this.property]=!0:this.union.usesPrefixDiscriminator&&(r[this.union.discriminator.property]=this.variant),r}encode(e,t,r=0){let s=0;if(this.union.usesPrefixDiscriminator&&(s=this.union.discriminator.layout.span),this.layout&&!Object.prototype.hasOwnProperty.call(e,this.property))throw new TypeError("variant lacks property "+this.property);this.union.discriminator.encode(this.variant,t,r);let i=s;if(this.layout&&(this.layout.encode(e[this.property],t,r+s),i+=this.layout.getSpan(t,r+s),0<=this.union.span&&i>this.union.span))throw new Error("encoded variant overruns containing union");return i}fromArray(e){if(this.layout)return this.layout.fromArray(e)}}O.VariantLayout=fh;function Or(n){return 0>n&&(n+=4294967296),n}class gl extends Me{constructor(e,t,r){if(!(e instanceof on||e instanceof un))throw new TypeError("word must be a UInt or UIntBE layout");if(typeof t=="string"&&r===void 0&&(r=t,t=!1),4<e.span)throw new RangeError("word cannot exceed 32 bits");super(e.span,r),this.word=e,this.msb=!!t,this.fields=[];let s=0;this._packedSetValue=function(i){return s=Or(i),this},this._packedGetValue=function(){return s}}decode(e,t=0){const r=this.makeDestinationObject(),s=this.word.decode(e,t);this._packedSetValue(s);for(const i of this.fields)i.property!==void 0&&(r[i.property]=i.decode(e));return r}encode(e,t,r=0){const s=this.word.decode(t,r);this._packedSetValue(s);for(const i of this.fields)if(i.property!==void 0){const o=e[i.property];o!==void 0&&i.encode(o)}return this.word.encode(this._packedGetValue(),t,r)}addField(e,t){const r=new yl(this,e,t);return this.fields.push(r),r}addBoolean(e){const t=new hh(this,e);return this.fields.push(t),t}fieldFor(e){if(typeof e!="string")throw new TypeError("property must be string");for(const t of this.fields)if(t.property===e)return t}}O.BitStructure=gl;class yl{constructor(e,t,r){if(!(e instanceof gl))throw new TypeError("container must be a BitStructure");if(!Number.isInteger(t)||0>=t)throw new TypeError("bits must be positive integer");const s=8*e.span,i=e.fields.reduce((o,a)=>o+a.bits,0);if(t+i>s)throw new Error("bits too long for span remainder ("+(s-i)+" of "+s+" remain)");this.container=e,this.bits=t,this.valueMask=(1<<t)-1,t===32&&(this.valueMask=4294967295),this.start=i,this.container.msb&&(this.start=s-i-t),this.wordMask=Or(this.valueMask<<this.start),this.property=r}decode(e,t){const r=this.container._packedGetValue();return Or(r&this.wordMask)>>>this.start}encode(e){if(typeof e!="number"||!Number.isInteger(e)||e!==Or(e&this.valueMask))throw new TypeError(hl("BitField.encode",this)+" value must be integer not exceeding "+this.valueMask);const t=this.container._packedGetValue(),r=Or(e<<this.start);this.container._packedSetValue(Or(t&~this.wordMask)|r)}}O.BitField=yl;let hh=class extends yl{constructor(e,t){super(e,1,t)}decode(e,t){return!!super.decode(e,t)}encode(e){typeof e=="boolean"&&(e=+e),super.encode(e)}};O.Boolean=hh;let mh=class extends Me{constructor(e,t){if(!(e instanceof Yt&&e.isCount()||Number.isInteger(e)&&0<=e))throw new TypeError("length must be positive integer or an unsigned integer ExternalLayout");let r=-1;e instanceof Yt||(r=e),super(r,t),this.length=e}getSpan(e,t){let r=this.span;return 0>r&&(r=this.length.decode(e,t)),r}decode(e,t=0){let r=this.span;return 0>r&&(r=this.length.decode(e,t)),Ie(e).slice(t,t+r)}encode(e,t,r){let s=this.length;if(this.length instanceof Yt&&(s=e.length),!(e instanceof Uint8Array&&s===e.length))throw new TypeError(hl("Blob.encode",this)+" requires (length "+s+") Uint8Array as src");if(r+s>t.length)throw new RangeError("encoding overruns Uint8Array");const i=Ie(e);return Ie(t).write(i.toString("hex"),r,s,"hex"),this.length instanceof Yt&&this.length.encode(s,t,r),s}};O.Blob=mh;class bh extends Me{constructor(e){super(-1,e)}getSpan(e,t=0){fs(e);let r=t;for(;r<e.length&&e[r]!==0;)r+=1;return 1+r-t}decode(e,t=0){const r=this.getSpan(e,t);return Ie(e).slice(t,t+r-1).toString("utf-8")}encode(e,t,r=0){typeof e!="string"&&(e=String(e));const s=fl.Buffer.from(e,"utf8"),i=s.length;if(r+i>t.length)throw new RangeError("encoding overruns Buffer");const o=Ie(t);return s.copy(o,r),o[r+i]=0,i+1}}O.CString=bh;class ph extends Me{constructor(e,t){if(typeof e=="string"&&t===void 0&&(t=e,e=void 0),e===void 0)e=-1;else if(!Number.isInteger(e))throw new TypeError("maxSpan must be an integer");super(-1,t),this.maxSpan=e}getSpan(e,t=0){return fs(e),e.length-t}decode(e,t=0){const r=this.getSpan(e,t);if(0<=this.maxSpan&&this.maxSpan<r)throw new RangeError("text length exceeds maxSpan");return Ie(e).slice(t,t+r).toString("utf-8")}encode(e,t,r=0){typeof e!="string"&&(e=String(e));const s=fl.Buffer.from(e,"utf8"),i=s.length;if(0<=this.maxSpan&&this.maxSpan<i)throw new RangeError("text length exceeds maxSpan");if(r+i>t.length)throw new RangeError("encoding overruns Buffer");return s.copy(Ie(t),r),i}}O.UTF8=ph;class gh extends Me{constructor(e,t){super(0,t),this.value=e}decode(e,t){return this.value}encode(e,t,r){return 0}}O.Constant=gh;exports.greedy=O.greedy=(n,e)=>new th(n,e);var tr=O.offset=(n,e,t)=>new ml(n,e,t);exports.u8=O.u8=n=>new on(1,n);exports.u16=O.u16=n=>new on(2,n);O.u24=n=>new on(3,n);exports.u32=O.u32=n=>new on(4,n);O.u40=n=>new on(5,n);O.u48=n=>new on(6,n);var It=O.nu64=n=>new nh(n);O.u16be=n=>new un(2,n);O.u24be=n=>new un(3,n);O.u32be=n=>new un(4,n);O.u40be=n=>new un(5,n);O.u48be=n=>new un(6,n);O.nu64be=n=>new rh(n);O.s8=n=>new Ir(1,n);exports.s16=O.s16=n=>new Ir(2,n);O.s24=n=>new Ir(3,n);O.s32=n=>new Ir(4,n);O.s40=n=>new Ir(5,n);O.s48=n=>new Ir(6,n);exports.ns64=O.ns64=n=>new sh(n);O.s16be=n=>new hs(2,n);O.s24be=n=>new hs(3,n);O.s32be=n=>new hs(4,n);O.s40be=n=>new hs(5,n);O.s48be=n=>new hs(6,n);O.ns64be=n=>new ih(n);O.f32=n=>new oh(n);O.f32be=n=>new ah(n);O.f64=n=>new ch(n);O.f64be=n=>new lh(n);exports.struct=O.struct=(n,e,t)=>new uh(n,e,t);O.bits=(n,e,t)=>new gl(n,e,t);exports.seq=O.seq=(n,e,t)=>new dh(n,e,t);O.union=(n,e,t)=>new pl(n,e,t);O.unionLayoutDiscriminator=(n,e)=>new ji(n,e);exports.blob=O.blob=(n,e)=>new mh(n,e);O.cstr=n=>new bh(n);O.utf8=(n,e)=>new ph(n,e);O.constant=(n,e)=>new gh(n,e);var ti={};Object.defineProperty(ti,"__esModule",{value:!0});function C8(n){{const e=Ve.Buffer.from(n);e.reverse();const t=e.toString("hex");return t.length===0?BigInt(0):BigInt(`0x${t}`)}}var yh=ti.toBigIntLE=C8;function S8(n){{const e=n.toString("hex");return e.length===0?BigInt(0):BigInt(`0x${e}`)}}ti.toBigIntBE=S8;function D8(n,e){{const t=n.toString(16),r=Ve.Buffer.from(t.padStart(e*2,"0").slice(0,e*2),"hex");return r.reverse(),r}}var wl=ti.toBufferLE=D8;function v8(n,e){{const t=n.toString(16);return Ve.Buffer.from(t.padStart(e*2,"0").slice(0,e*2),"hex")}}ti.toBufferBE=v8;class k8 extends TypeError{constructor(e,t){let r;const{message:s,explanation:i,...o}=e,{path:a}=e,l=a.length===0?s:`At path: ${a.join(".")} -- ${s}`;super(i??l),i!=null&&(this.cause=l),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>r??(r=[e,...t()])}}function F8(n){return ni(n)&&typeof n[Symbol.iterator]=="function"}function ni(n){return typeof n=="object"&&n!=null}function $i(n){return ni(n)&&!Array.isArray(n)}function fn(n){return typeof n=="symbol"?n.toString():typeof n=="string"?JSON.stringify(n):`${n}`}function T8(n){const{done:e,value:t}=n.next();return e?void 0:t}function I8(n,e,t,r){if(n===!0)return;n===!1?n={}:typeof n=="string"&&(n={message:n});const{path:s,branch:i}=e,{type:o}=t,{refinement:a,message:l=`Expected a value of type \`${o}\`${a?` with refinement \`${a}\``:""}, but received: \`${fn(r)}\``}=n;return{value:r,type:o,refinement:a,key:s[s.length-1],path:s,branch:i,...n,message:l}}function*Jd(n,e,t,r){F8(n)||(n=[n]);for(const s of n){const i=I8(s,e,t,r);i&&(yield i)}}function*Al(n,e,t={}){const{path:r=[],branch:s=[n],coerce:i=!1,mask:o=!1}=t,a={path:r,branch:s,mask:o};i&&(n=e.coercer(n,a));let l="valid";for(const h of e.validator(n,a))h.explanation=t.message,l="not_valid",yield[h,void 0];for(let[h,m,E]of e.entries(n,a)){const S=Al(m,E,{path:h===void 0?r:[...r,h],branch:h===void 0?s:[...s,m],coerce:i,mask:o,message:t.message});for(const A of S)A[0]?(l=A[0].refinement!=null?"not_refined":"not_valid",yield[A[0],void 0]):i&&(m=A[1],h===void 0?n=m:n instanceof Map?n.set(h,m):n instanceof Set?n.add(m):ni(n)&&(m!==void 0||h in n)&&(n[h]=m))}if(l!=="not_valid")for(const h of e.refiner(n,a))h.explanation=t.message,l="not_refined",yield[h,void 0];l==="valid"&&(yield[void 0,n])}let Un=class{constructor(e){const{type:t,schema:r,validator:s,refiner:i,coercer:o=l=>l,entries:a=function*(){}}=e;this.type=t,this.schema=r,this.entries=a,this.coercer=o,s?this.validator=(l,h)=>{const m=s(l,h);return Jd(m,h,this,l)}:this.validator=()=>[],i?this.refiner=(l,h)=>{const m=i(l,h);return Jd(m,h,this,l)}:this.refiner=()=>[]}assert(e,t){return wh(e,this,t)}create(e,t){return J(e,this,t)}is(e){return Ah(e,this)}mask(e,t){return U8(e,this,t)}validate(e,t={}){return ri(e,this,t)}};function wh(n,e,t){const r=ri(n,e,{message:t});if(r[0])throw r[0]}function J(n,e,t){const r=ri(n,e,{coerce:!0,message:t});if(r[0])throw r[0];return r[1]}function U8(n,e,t){const r=ri(n,e,{coerce:!0,mask:!0,message:t});if(r[0])throw r[0];return r[1]}function Ah(n,e){return!ri(n,e)[0]}function ri(n,e,t={}){const r=Al(n,e,t),s=T8(r);return s[0]?[new k8(s[0],function*(){for(const o of r)o[0]&&(yield o[0])}),void 0]:[void 0,s[1]]}function Ur(n,e){return new Un({type:n,schema:null,validator:e})}function _8(){return Ur("any",()=>!0)}function Q(n){return new Un({type:"array",schema:n,*entries(e){if(n&&Array.isArray(e))for(const[t,r]of e.entries())yield[t,r,n]},coercer(e){return Array.isArray(e)?e.slice():e},validator(e){return Array.isArray(e)||`Expected an array value, but received: ${fn(e)}`}})}function kn(){return Ur("boolean",n=>typeof n=="boolean")}function El(n){return Ur("instance",e=>e instanceof n||`Expected a \`${n.name}\` instance, but received: ${fn(e)}`)}function Ye(n){const e=fn(n),t=typeof n;return new Un({type:"literal",schema:t==="string"||t==="number"||t==="boolean"?n:null,validator(r){return r===n||`Expected the literal \`${e}\`, but received: ${fn(r)}`}})}function M8(){return Ur("never",()=>!1)}function te(n){return new Un({...n,validator:(e,t)=>e===null||n.validator(e,t),refiner:(e,t)=>e===null||n.refiner(e,t)})}function L(){return Ur("number",n=>typeof n=="number"&&!isNaN(n)||`Expected a number, but received: ${fn(n)}`)}function ce(n){return new Un({...n,validator:(e,t)=>e===void 0||n.validator(e,t),refiner:(e,t)=>e===void 0||n.refiner(e,t)})}function Eh(n,e){return new Un({type:"record",schema:null,*entries(t){if(ni(t))for(const r in t){const s=t[r];yield[r,r,n],yield[r,s,e]}},validator(t){return $i(t)||`Expected an object, but received: ${fn(t)}`},coercer(t){return $i(t)?{...t}:t}})}function X(){return Ur("string",n=>typeof n=="string"||`Expected a string, but received: ${fn(n)}`)}function Bl(n){const e=M8();return new Un({type:"tuple",schema:null,*entries(t){if(Array.isArray(t)){const r=Math.max(n.length,t.length);for(let s=0;s<r;s++)yield[s,t[s],n[s]||e]}},validator(t){return Array.isArray(t)||`Expected an array, but received: ${fn(t)}`},coercer(t){return Array.isArray(t)?t.slice():t}})}function j(n){const e=Object.keys(n);return new Un({type:"type",schema:n,*entries(t){if(ni(t))for(const r of e)yield[r,t[r],n[r]]},validator(t){return $i(t)||`Expected an object, but received: ${fn(t)}`},coercer(t){return $i(t)?{...t}:t}})}function Kt(n){const e=n.map(t=>t.type).join(" | ");return new Un({type:"union",schema:null,coercer(t,r){for(const s of n){const[i,o]=s.validate(t,{coerce:!0,mask:r.mask});if(!i)return o}return t},validator(t,r){const s=[];for(const i of n){const[...o]=Al(t,i,r),[a]=o;if(a[0])for(const[l]of o)l&&s.push(l);else return[]}return[`Expected the value to satisfy a union of \`${e}\`, but received: ${fn(t)}`,...s]}})}function ms(){return Ur("unknown",()=>!0)}function si(n,e,t){return new Un({...n,coercer:(r,s)=>Ah(r,e)?n.coercer(t(r,s),s):n.coercer(r,s)})}var hi,R8=new Uint8Array(16);function Bh(){if(!hi&&(hi=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!hi))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return hi(R8)}const W8=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function xo(n){return typeof n=="string"&&W8.test(n)}var Tt=[];for(var Ea=0;Ea<256;++Ea)Tt.push((Ea+256).toString(16).substr(1));function Co(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t=(Tt[n[e+0]]+Tt[n[e+1]]+Tt[n[e+2]]+Tt[n[e+3]]+"-"+Tt[n[e+4]]+Tt[n[e+5]]+"-"+Tt[n[e+6]]+Tt[n[e+7]]+"-"+Tt[n[e+8]]+Tt[n[e+9]]+"-"+Tt[n[e+10]]+Tt[n[e+11]]+Tt[n[e+12]]+Tt[n[e+13]]+Tt[n[e+14]]+Tt[n[e+15]]).toLowerCase();if(!xo(t))throw TypeError("Stringified UUID is invalid");return t}var Qd,Ba,xa=0,Ca=0;function P8(n,e,t){var r=e&&t||0,s=e||new Array(16);n=n||{};var i=n.node||Qd,o=n.clockseq!==void 0?n.clockseq:Ba;if(i==null||o==null){var a=n.random||(n.rng||Bh)();i==null&&(i=Qd=[a[0]|1,a[1],a[2],a[3],a[4],a[5]]),o==null&&(o=Ba=(a[6]<<8|a[7])&16383)}var l=n.msecs!==void 0?n.msecs:Date.now(),h=n.nsecs!==void 0?n.nsecs:Ca+1,m=l-xa+(h-Ca)/1e4;if(m<0&&n.clockseq===void 0&&(o=o+1&16383),(m<0||l>xa)&&n.nsecs===void 0&&(h=0),h>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");xa=l,Ca=h,Ba=o,l+=122192928e5;var E=((l&268435455)*1e4+h)%4294967296;s[r++]=E>>>24&255,s[r++]=E>>>16&255,s[r++]=E>>>8&255,s[r++]=E&255;var S=l/4294967296*1e4&268435455;s[r++]=S>>>8&255,s[r++]=S&255,s[r++]=S>>>24&15|16,s[r++]=S>>>16&255,s[r++]=o>>>8|128,s[r++]=o&255;for(var A=0;A<6;++A)s[r+A]=i[A];return e||Co(s)}function xh(n){if(!xo(n))throw TypeError("Invalid UUID");var e,t=new Uint8Array(16);return t[0]=(e=parseInt(n.slice(0,8),16))>>>24,t[1]=e>>>16&255,t[2]=e>>>8&255,t[3]=e&255,t[4]=(e=parseInt(n.slice(9,13),16))>>>8,t[5]=e&255,t[6]=(e=parseInt(n.slice(14,18),16))>>>8,t[7]=e&255,t[8]=(e=parseInt(n.slice(19,23),16))>>>8,t[9]=e&255,t[10]=(e=parseInt(n.slice(24,36),16))/1099511627776&255,t[11]=e/4294967296&255,t[12]=e>>>24&255,t[13]=e>>>16&255,t[14]=e>>>8&255,t[15]=e&255,t}function L8(n){n=unescape(encodeURIComponent(n));for(var e=[],t=0;t<n.length;++t)e.push(n.charCodeAt(t));return e}var O8="6ba7b810-9dad-11d1-80b4-00c04fd430c8",N8="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function Ch(n,e,t){function r(s,i,o,a){if(typeof s=="string"&&(s=L8(s)),typeof i=="string"&&(i=xh(i)),i.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var l=new Uint8Array(16+s.length);if(l.set(i),l.set(s,i.length),l=t(l),l[6]=l[6]&15|e,l[8]=l[8]&63|128,o){a=a||0;for(var h=0;h<16;++h)o[a+h]=l[h];return o}return Co(l)}try{r.name=n}catch{}return r.DNS=O8,r.URL=N8,r}function z8(n){if(typeof n=="string"){var e=unescape(encodeURIComponent(n));n=new Uint8Array(e.length);for(var t=0;t<e.length;++t)n[t]=e.charCodeAt(t)}return H8(q8(K8(n),n.length*8))}function H8(n){for(var e=[],t=n.length*32,r="0123456789abcdef",s=0;s<t;s+=8){var i=n[s>>5]>>>s%32&255,o=parseInt(r.charAt(i>>>4&15)+r.charAt(i&15),16);e.push(o)}return e}function Sh(n){return(n+64>>>9<<4)+14+1}function q8(n,e){n[e>>5]|=128<<e%32,n[Sh(e)-1]=e;for(var t=1732584193,r=-271733879,s=-1732584194,i=271733878,o=0;o<n.length;o+=16){var a=t,l=r,h=s,m=i;t=Rt(t,r,s,i,n[o],7,-680876936),i=Rt(i,t,r,s,n[o+1],12,-389564586),s=Rt(s,i,t,r,n[o+2],17,606105819),r=Rt(r,s,i,t,n[o+3],22,-1044525330),t=Rt(t,r,s,i,n[o+4],7,-176418897),i=Rt(i,t,r,s,n[o+5],12,1200080426),s=Rt(s,i,t,r,n[o+6],17,-1473231341),r=Rt(r,s,i,t,n[o+7],22,-45705983),t=Rt(t,r,s,i,n[o+8],7,1770035416),i=Rt(i,t,r,s,n[o+9],12,-1958414417),s=Rt(s,i,t,r,n[o+10],17,-42063),r=Rt(r,s,i,t,n[o+11],22,-1990404162),t=Rt(t,r,s,i,n[o+12],7,1804603682),i=Rt(i,t,r,s,n[o+13],12,-40341101),s=Rt(s,i,t,r,n[o+14],17,-1502002290),r=Rt(r,s,i,t,n[o+15],22,1236535329),t=Wt(t,r,s,i,n[o+1],5,-165796510),i=Wt(i,t,r,s,n[o+6],9,-1069501632),s=Wt(s,i,t,r,n[o+11],14,643717713),r=Wt(r,s,i,t,n[o],20,-373897302),t=Wt(t,r,s,i,n[o+5],5,-701558691),i=Wt(i,t,r,s,n[o+10],9,38016083),s=Wt(s,i,t,r,n[o+15],14,-660478335),r=Wt(r,s,i,t,n[o+4],20,-405537848),t=Wt(t,r,s,i,n[o+9],5,568446438),i=Wt(i,t,r,s,n[o+14],9,-1019803690),s=Wt(s,i,t,r,n[o+3],14,-187363961),r=Wt(r,s,i,t,n[o+8],20,1163531501),t=Wt(t,r,s,i,n[o+13],5,-1444681467),i=Wt(i,t,r,s,n[o+2],9,-51403784),s=Wt(s,i,t,r,n[o+7],14,1735328473),r=Wt(r,s,i,t,n[o+12],20,-1926607734),t=Pt(t,r,s,i,n[o+5],4,-378558),i=Pt(i,t,r,s,n[o+8],11,-2022574463),s=Pt(s,i,t,r,n[o+11],16,1839030562),r=Pt(r,s,i,t,n[o+14],23,-35309556),t=Pt(t,r,s,i,n[o+1],4,-1530992060),i=Pt(i,t,r,s,n[o+4],11,1272893353),s=Pt(s,i,t,r,n[o+7],16,-155497632),r=Pt(r,s,i,t,n[o+10],23,-1094730640),t=Pt(t,r,s,i,n[o+13],4,681279174),i=Pt(i,t,r,s,n[o],11,-358537222),s=Pt(s,i,t,r,n[o+3],16,-722521979),r=Pt(r,s,i,t,n[o+6],23,76029189),t=Pt(t,r,s,i,n[o+9],4,-640364487),i=Pt(i,t,r,s,n[o+12],11,-421815835),s=Pt(s,i,t,r,n[o+15],16,530742520),r=Pt(r,s,i,t,n[o+2],23,-995338651),t=Lt(t,r,s,i,n[o],6,-198630844),i=Lt(i,t,r,s,n[o+7],10,1126891415),s=Lt(s,i,t,r,n[o+14],15,-1416354905),r=Lt(r,s,i,t,n[o+5],21,-57434055),t=Lt(t,r,s,i,n[o+12],6,1700485571),i=Lt(i,t,r,s,n[o+3],10,-1894986606),s=Lt(s,i,t,r,n[o+10],15,-1051523),r=Lt(r,s,i,t,n[o+1],21,-2054922799),t=Lt(t,r,s,i,n[o+8],6,1873313359),i=Lt(i,t,r,s,n[o+15],10,-30611744),s=Lt(s,i,t,r,n[o+6],15,-1560198380),r=Lt(r,s,i,t,n[o+13],21,1309151649),t=Lt(t,r,s,i,n[o+4],6,-145523070),i=Lt(i,t,r,s,n[o+11],10,-1120210379),s=Lt(s,i,t,r,n[o+2],15,718787259),r=Lt(r,s,i,t,n[o+9],21,-343485551),t=Qn(t,a),r=Qn(r,l),s=Qn(s,h),i=Qn(i,m)}return[t,r,s,i]}function K8(n){if(n.length===0)return[];for(var e=n.length*8,t=new Uint32Array(Sh(e)),r=0;r<e;r+=8)t[r>>5]|=(n[r/8]&255)<<r%32;return t}function Qn(n,e){var t=(n&65535)+(e&65535),r=(n>>16)+(e>>16)+(t>>16);return r<<16|t&65535}function j8(n,e){return n<<e|n>>>32-e}function So(n,e,t,r,s,i){return Qn(j8(Qn(Qn(e,n),Qn(r,i)),s),t)}function Rt(n,e,t,r,s,i,o){return So(e&t|~e&r,n,e,s,i,o)}function Wt(n,e,t,r,s,i,o){return So(e&r|t&~r,n,e,s,i,o)}function Pt(n,e,t,r,s,i,o){return So(e^t^r,n,e,s,i,o)}function Lt(n,e,t,r,s,i,o){return So(t^(e|~r),n,e,s,i,o)}var $8=Ch("v3",48,z8);function V8(n,e,t){n=n||{};var r=n.random||(n.rng||Bh)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,e){t=t||0;for(var s=0;s<16;++s)e[t+s]=r[s];return e}return Co(r)}function G8(n,e,t,r){switch(n){case 0:return e&t^~e&r;case 1:return e^t^r;case 2:return e&t^e&r^t&r;case 3:return e^t^r}}function Sa(n,e){return n<<e|n>>>32-e}function Y8(n){var e=[1518500249,1859775393,2400959708,3395469782],t=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof n=="string"){var r=unescape(encodeURIComponent(n));n=[];for(var s=0;s<r.length;++s)n.push(r.charCodeAt(s))}else Array.isArray(n)||(n=Array.prototype.slice.call(n));n.push(128);for(var i=n.length/4+2,o=Math.ceil(i/16),a=new Array(o),l=0;l<o;++l){for(var h=new Uint32Array(16),m=0;m<16;++m)h[m]=n[l*64+m*4]<<24|n[l*64+m*4+1]<<16|n[l*64+m*4+2]<<8|n[l*64+m*4+3];a[l]=h}a[o-1][14]=(n.length-1)*8/Math.pow(2,32),a[o-1][14]=Math.floor(a[o-1][14]),a[o-1][15]=(n.length-1)*8&4294967295;for(var E=0;E<o;++E){for(var S=new Uint32Array(80),A=0;A<16;++A)S[A]=a[E][A];for(var g=16;g<80;++g)S[g]=Sa(S[g-3]^S[g-8]^S[g-14]^S[g-16],1);for(var D=t[0],x=t[1],U=t[2],R=t[3],F=t[4],W=0;W<80;++W){var z=Math.floor(W/20),H=Sa(D,5)+G8(z,x,U,R)+F+e[z]+S[W]>>>0;F=R,R=U,U=Sa(x,30)>>>0,x=D,D=H}t[0]=t[0]+D>>>0,t[1]=t[1]+x>>>0,t[2]=t[2]+U>>>0,t[3]=t[3]+R>>>0,t[4]=t[4]+F>>>0}return[t[0]>>24&255,t[0]>>16&255,t[0]>>8&255,t[0]&255,t[1]>>24&255,t[1]>>16&255,t[1]>>8&255,t[1]&255,t[2]>>24&255,t[2]>>16&255,t[2]>>8&255,t[2]&255,t[3]>>24&255,t[3]>>16&255,t[3]>>8&255,t[3]&255,t[4]>>24&255,t[4]>>16&255,t[4]>>8&255,t[4]&255]}var X8=Ch("v5",80,Y8);const Z8="00000000-0000-0000-0000-000000000000";function J8(n){if(!xo(n))throw TypeError("Invalid UUID");return parseInt(n.substr(14,1),16)}const Q8=Object.freeze(Object.defineProperty({__proto__:null,NIL:Z8,parse:xh,stringify:Co,v1:P8,v3:$8,v4:V8,v5:X8,validate:xo,version:J8},Symbol.toStringTag,{value:"Module"})),Dh=Bc(Q8),e3=Dh.v4,t3=function(n,e,t,r){if(typeof n!="string")throw new TypeError(n+" must be a string");r=r||{};const s=typeof r.version=="number"?r.version:2;if(s!==1&&s!==2)throw new TypeError(s+" must be 1 or 2");const i={method:n};if(s===2&&(i.jsonrpc="2.0"),e){if(typeof e!="object"&&!Array.isArray(e))throw new TypeError(e+" must be an object, array or omitted");i.params=e}if(typeof t>"u"){const o=typeof r.generator=="function"?r.generator:function(){return e3()};i.id=o(i,r)}else s===2&&t===null?r.notificationIdNull&&(i.id=null):i.id=t;return i};var n3=t3;const r3=Dh.v4,s3=n3,qs=function(n,e){if(!(this instanceof qs))return new qs(n,e);e||(e={}),this.options={reviver:typeof e.reviver<"u"?e.reviver:null,replacer:typeof e.replacer<"u"?e.replacer:null,generator:typeof e.generator<"u"?e.generator:function(){return r3()},version:typeof e.version<"u"?e.version:2,notificationIdNull:typeof e.notificationIdNull=="boolean"?e.notificationIdNull:!1},this.callServer=n};var i3=qs;qs.prototype.request=function(n,e,t,r){const s=this;let i=null;const o=Array.isArray(n)&&typeof e=="function";if(this.options.version===1&&o)throw new TypeError("JSON-RPC 1.0 does not support batching");if(o||!o&&n&&typeof n=="object"&&typeof e=="function")r=e,i=n;else{typeof t=="function"&&(r=t,t=void 0);const h=typeof r=="function";try{i=s3(n,e,t,{generator:this.options.generator,version:this.options.version,notificationIdNull:this.options.notificationIdNull})}catch(m){if(h)return r(m);throw m}if(!h)return i}let l;try{l=JSON.stringify(i,this.options.replacer)}catch(h){return r(h)}return this.callServer(l,function(h,m){s._parseResponse(h,m,r)}),i};qs.prototype._parseResponse=function(n,e,t){if(n){t(n);return}if(!e)return t();let r;try{r=JSON.parse(e,this.options.reviver)}catch(s){return t(s)}if(t.length===3)if(Array.isArray(r)){const s=function(o){return typeof o.error<"u"},i=function(o){return!s(o)};return t(null,r.filter(s),r.filter(i))}else return t(null,r.error,r.result);t(null,r)};const vh=Vs(i3);var kh={exports:{}};(function(n){var e=Object.prototype.hasOwnProperty,t="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(t=!1));function s(l,h,m){this.fn=l,this.context=h,this.once=m||!1}function i(l,h,m,E,S){if(typeof m!="function")throw new TypeError("The listener must be a function");var A=new s(m,E||l,S),g=t?t+h:h;return l._events[g]?l._events[g].fn?l._events[g]=[l._events[g],A]:l._events[g].push(A):(l._events[g]=A,l._eventsCount++),l}function o(l,h){--l._eventsCount===0?l._events=new r:delete l._events[h]}function a(){this._events=new r,this._eventsCount=0}a.prototype.eventNames=function(){var h=[],m,E;if(this._eventsCount===0)return h;for(E in m=this._events)e.call(m,E)&&h.push(t?E.slice(1):E);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(m)):h},a.prototype.listeners=function(h){var m=t?t+h:h,E=this._events[m];if(!E)return[];if(E.fn)return[E.fn];for(var S=0,A=E.length,g=new Array(A);S<A;S++)g[S]=E[S].fn;return g},a.prototype.listenerCount=function(h){var m=t?t+h:h,E=this._events[m];return E?E.fn?1:E.length:0},a.prototype.emit=function(h,m,E,S,A,g){var D=t?t+h:h;if(!this._events[D])return!1;var x=this._events[D],U=arguments.length,R,F;if(x.fn){switch(x.once&&this.removeListener(h,x.fn,void 0,!0),U){case 1:return x.fn.call(x.context),!0;case 2:return x.fn.call(x.context,m),!0;case 3:return x.fn.call(x.context,m,E),!0;case 4:return x.fn.call(x.context,m,E,S),!0;case 5:return x.fn.call(x.context,m,E,S,A),!0;case 6:return x.fn.call(x.context,m,E,S,A,g),!0}for(F=1,R=new Array(U-1);F<U;F++)R[F-1]=arguments[F];x.fn.apply(x.context,R)}else{var W=x.length,z;for(F=0;F<W;F++)switch(x[F].once&&this.removeListener(h,x[F].fn,void 0,!0),U){case 1:x[F].fn.call(x[F].context);break;case 2:x[F].fn.call(x[F].context,m);break;case 3:x[F].fn.call(x[F].context,m,E);break;case 4:x[F].fn.call(x[F].context,m,E,S);break;default:if(!R)for(z=1,R=new Array(U-1);z<U;z++)R[z-1]=arguments[z];x[F].fn.apply(x[F].context,R)}}return!0},a.prototype.on=function(h,m,E){return i(this,h,m,E,!1)},a.prototype.once=function(h,m,E){return i(this,h,m,E,!0)},a.prototype.removeListener=function(h,m,E,S){var A=t?t+h:h;if(!this._events[A])return this;if(!m)return o(this,A),this;var g=this._events[A];if(g.fn)g.fn===m&&(!S||g.once)&&(!E||g.context===E)&&o(this,A);else{for(var D=0,x=[],U=g.length;D<U;D++)(g[D].fn!==m||S&&!g[D].once||E&&g[D].context!==E)&&x.push(g[D]);x.length?this._events[A]=x.length===1?x[0]:x:o(this,A)}return this},a.prototype.removeAllListeners=function(h){var m;return h?(m=t?t+h:h,this._events[m]&&o(this,m)):(this._events=new r,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=t,a.EventEmitter=a,n.exports=a})(kh);var o3=kh.exports;const xl=Vs(o3);var a3=class extends xl{constructor(e,t,r){super();re(this,"socket");this.socket=new window.WebSocket(e,r),this.socket.onopen=()=>this.emit("open"),this.socket.onmessage=s=>this.emit("message",s.data),this.socket.onerror=s=>this.emit("error",s),this.socket.onclose=s=>{this.emit("close",s.code,s.reason)}}send(e,t,r){const s=r||t;try{this.socket.send(e),s()}catch(i){s(i)}}close(e,t){this.socket.close(e,t)}addEventListener(e,t,r){this.socket.addEventListener(e,t,r)}};function c3(n,e){return new a3(n,e)}var l3=class{encode(n){return JSON.stringify(n)}decode(n){return JSON.parse(n)}},d3=class extends xl{constructor(e,t="ws://localhost:8080",{autoconnect:r=!0,reconnect:s=!0,reconnect_interval:i=1e3,max_reconnects:o=5,...a}={},l,h){super();re(this,"address");re(this,"rpc_id");re(this,"queue");re(this,"options");re(this,"autoconnect");re(this,"ready");re(this,"reconnect");re(this,"reconnect_timer_id");re(this,"reconnect_interval");re(this,"max_reconnects");re(this,"rest_options");re(this,"current_reconnects");re(this,"generate_request_id");re(this,"socket");re(this,"webSocketFactory");re(this,"dataPack");this.webSocketFactory=e,this.queue={},this.rpc_id=0,this.address=t,this.autoconnect=r,this.ready=!1,this.reconnect=s,this.reconnect_timer_id=void 0,this.reconnect_interval=i,this.max_reconnects=o,this.rest_options=a,this.current_reconnects=0,this.generate_request_id=l||(()=>++this.rpc_id),h?this.dataPack=h:this.dataPack=new l3,this.autoconnect&&this._connect(this.address,{autoconnect:this.autoconnect,reconnect:this.reconnect,reconnect_interval:this.reconnect_interval,max_reconnects:this.max_reconnects,...this.rest_options})}connect(){this.socket||this._connect(this.address,{autoconnect:this.autoconnect,reconnect:this.reconnect,reconnect_interval:this.reconnect_interval,max_reconnects:this.max_reconnects,...this.rest_options})}call(e,t,r,s){return!s&&typeof r=="object"&&(s=r,r=null),new Promise((i,o)=>{if(!this.ready)return o(new Error("socket not ready"));const a=this.generate_request_id(e,t),l={jsonrpc:"2.0",method:e,params:t||void 0,id:a};this.socket.send(this.dataPack.encode(l),s,h=>{if(h)return o(h);this.queue[a]={promise:[i,o]},r&&(this.queue[a].timeout=setTimeout(()=>{delete this.queue[a],o(new Error("reply timeout"))},r))})})}async login(e){const t=await this.call("rpc.login",e);if(!t)throw new Error("authentication failed");return t}async listMethods(){return await this.call("__listMethods")}notify(e,t){return new Promise((r,s)=>{if(!this.ready)return s(new Error("socket not ready"));const i={jsonrpc:"2.0",method:e,params:t};this.socket.send(this.dataPack.encode(i),o=>{if(o)return s(o);r()})})}async subscribe(e){typeof e=="string"&&(e=[e]);const t=await this.call("rpc.on",e);if(typeof e=="string"&&t[e]!=="ok")throw new Error("Failed subscribing to an event '"+e+"' with: "+t[e]);return t}async unsubscribe(e){typeof e=="string"&&(e=[e]);const t=await this.call("rpc.off",e);if(typeof e=="string"&&t[e]!=="ok")throw new Error("Failed unsubscribing from an event with: "+t);return t}close(e,t){this.socket.close(e||1e3,t)}setAutoReconnect(e){this.reconnect=e}setReconnectInterval(e){this.reconnect_interval=e}setMaxReconnects(e){this.max_reconnects=e}_connect(e,t){clearTimeout(this.reconnect_timer_id),this.socket=this.webSocketFactory(e,t),this.socket.addEventListener("open",()=>{this.ready=!0,this.emit("open"),this.current_reconnects=0}),this.socket.addEventListener("message",({data:r})=>{r instanceof ArrayBuffer&&(r=oe.Buffer.from(r).toString());try{r=this.dataPack.decode(r)}catch{return}if(r.notification&&this.listeners(r.notification).length){if(!Object.keys(r.params).length)return this.emit(r.notification);const s=[r.notification];if(r.params.constructor===Object)s.push(r.params);else for(let i=0;i<r.params.length;i++)s.push(r.params[i]);return Promise.resolve().then(()=>{this.emit.apply(this,s)})}if(!this.queue[r.id])return r.method?Promise.resolve().then(()=>{this.emit(r.method,r==null?void 0:r.params)}):void 0;"error"in r=="result"in r&&this.queue[r.id].promise[1](new Error('Server response malformed. Response must include either "result" or "error", but not both.')),this.queue[r.id].timeout&&clearTimeout(this.queue[r.id].timeout),r.error?this.queue[r.id].promise[1](r.error):this.queue[r.id].promise[0](r.result),delete this.queue[r.id]}),this.socket.addEventListener("error",r=>this.emit("error",r)),this.socket.addEventListener("close",({code:r,reason:s})=>{this.ready&&setTimeout(()=>this.emit("close",r,s),0),this.ready=!1,this.socket=void 0,r!==1e3&&(this.current_reconnects++,this.reconnect&&(this.max_reconnects>this.current_reconnects||this.max_reconnects===0)&&(this.reconnect_timer_id=setTimeout(()=>this._connect(e,t),this.reconnect_interval)))})}};const u3=Fr.utils.randomPrivateKey,eu=()=>{const n=Fr.utils.randomPrivateKey(),e=Vi(n),t=new Uint8Array(64);return t.set(n),t.set(e,32),{publicKey:e,secretKey:t}},Vi=Fr.getPublicKey;function tu(n){try{return Fr.ExtendedPoint.fromHex(n),!0}catch{return!1}}const Cl=(n,e)=>Fr.sign(n,e.slice(0,32)),f3=Fr.verify,ge=n=>oe.Buffer.isBuffer(n)?n:n instanceof Uint8Array?oe.Buffer.from(n.buffer,n.byteOffset,n.byteLength):oe.Buffer.from(n);class Sl{constructor(e){Object.assign(this,e)}encode(){return oe.Buffer.from(Q0(vs,this))}static decode(e){return eh(vs,this,e)}static decodeUnchecked(e){return G0(vs,this,e)}}class h3 extends Sl{constructor(e){if(super(e),this.enum="",Object.keys(e).length!==1)throw new Error("Enum can only take single value");Object.keys(e).map(t=>{this.enum=t})}}const vs=new Map;var Fh;const Th=32,xn=32;function m3(n){return n._bn!==void 0}let nu=1;class Y extends Sl{constructor(e){if(super({}),this._bn=void 0,m3(e))this._bn=e._bn;else{if(typeof e=="string"){const t=vt.decode(e);if(t.length!=xn)throw new Error("Invalid public key input");this._bn=new fc(t)}else this._bn=new fc(e);if(this._bn.byteLength()>xn)throw new Error("Invalid public key input")}}static unique(){const e=new Y(nu);return nu+=1,new Y(e.toBuffer())}equals(e){return this._bn.eq(e._bn)}toBase58(){return vt.encode(this.toBytes())}toJSON(){return this.toBase58()}toBytes(){const e=this.toBuffer();return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}toBuffer(){const e=this._bn.toArrayLike(oe.Buffer);if(e.length===xn)return e;const t=oe.Buffer.alloc(32);return e.copy(t,32-e.length),t}get[Symbol.toStringTag](){return`PublicKey(${this.toString()})`}toString(){return this.toBase58()}static async createWithSeed(e,t,r){const s=oe.Buffer.concat([e.toBuffer(),oe.Buffer.from(t),r.toBuffer()]),i=Us(s);return new Y(i)}static createProgramAddressSync(e,t){let r=oe.Buffer.alloc(0);e.forEach(function(i){if(i.length>Th)throw new TypeError("Max seed length exceeded");r=oe.Buffer.concat([r,ge(i)])}),r=oe.Buffer.concat([r,t.toBuffer(),oe.Buffer.from("ProgramDerivedAddress")]);const s=Us(r);if(tu(s))throw new Error("Invalid seeds, address must fall off the curve");return new Y(s)}static async createProgramAddress(e,t){return this.createProgramAddressSync(e,t)}static findProgramAddressSync(e,t){let r=255,s;for(;r!=0;){try{const i=e.concat(oe.Buffer.from([r]));s=this.createProgramAddressSync(i,t)}catch(i){if(i instanceof TypeError)throw i;r--;continue}return[s,r]}throw new Error("Unable to find a viable program address nonce")}static async findProgramAddress(e,t){return this.findProgramAddressSync(e,t)}static isOnCurve(e){const t=new Y(e);return tu(t.toBytes())}}Fh=Y;Y.default=new Fh("11111111111111111111111111111111");vs.set(Y,{kind:"struct",fields:[["_bn","u256"]]});class b3{constructor(e){if(this._publicKey=void 0,this._secretKey=void 0,e){const t=ge(e);if(e.length!==64)throw new Error("bad secret key size");this._publicKey=t.slice(32,64),this._secretKey=t.slice(0,32)}else this._secretKey=ge(u3()),this._publicKey=ge(Vi(this._secretKey))}get publicKey(){return new Y(this._publicKey)}get secretKey(){return oe.Buffer.concat([this._secretKey,this._publicKey],64)}}const p3=new Y("BPFLoader1111111111111111111111111111111111"),nr=1232,Do=127,Ks=64;class vo extends Error{constructor(e){super(`Signature ${e} has expired: block height exceeded.`),this.signature=void 0,this.signature=e}}Object.defineProperty(vo.prototype,"name",{value:"TransactionExpiredBlockheightExceededError"});class Dl extends Error{constructor(e,t){super(`Transaction was not confirmed in ${t.toFixed(2)} seconds. It is unknown if it succeeded or failed. Check signature ${e} using the Solana Explorer or CLI tools.`),this.signature=void 0,this.signature=e}}Object.defineProperty(Dl.prototype,"name",{value:"TransactionExpiredTimeoutError"});class Hr extends Error{constructor(e){super(`Signature ${e} has expired: the nonce is no longer valid.`),this.signature=void 0,this.signature=e}}Object.defineProperty(Hr.prototype,"name",{value:"TransactionExpiredNonceInvalidError"});class js{constructor(e,t){this.staticAccountKeys=void 0,this.accountKeysFromLookups=void 0,this.staticAccountKeys=e,this.accountKeysFromLookups=t}keySegments(){const e=[this.staticAccountKeys];return this.accountKeysFromLookups&&(e.push(this.accountKeysFromLookups.writable),e.push(this.accountKeysFromLookups.readonly)),e}get(e){for(const t of this.keySegments()){if(e<t.length)return t[e];e-=t.length}}get length(){return this.keySegments().flat().length}compileInstructions(e){if(this.length>256)throw new Error("Account index overflow encountered during compilation");const r=new Map;this.keySegments().flat().forEach((i,o)=>{r.set(i.toBase58(),o)});const s=i=>{const o=r.get(i.toBase58());if(o===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return o};return e.map(i=>({programIdIndex:s(i.programId),accountKeyIndexes:i.keys.map(o=>s(o.pubkey)),data:i.data}))}}const Be=(n="publicKey")=>exports.blob(32,n),g3=(n="signature")=>exports.blob(64,n),br=(n="string")=>{const e=exports.struct([exports.u32("length"),exports.u32("lengthPadding"),exports.blob(tr(exports.u32(),-8),"chars")],n),t=e.decode.bind(e),r=e.encode.bind(e),s=e;return s.decode=(i,o)=>t(i,o).chars.toString(),s.encode=(i,o,a)=>{const l={chars:oe.Buffer.from(i,"utf8")};return r(l,o,a)},s.alloc=i=>exports.u32().span+exports.u32().span+oe.Buffer.from(i,"utf8").length,s},y3=(n="authorized")=>exports.struct([Be("staker"),Be("withdrawer")],n),w3=(n="lockup")=>exports.struct([exports.ns64("unixTimestamp"),exports.ns64("epoch"),Be("custodian")],n),A3=(n="voteInit")=>exports.struct([Be("nodePubkey"),Be("authorizedVoter"),Be("authorizedWithdrawer"),exports.u8("commission")],n),E3=(n="voteAuthorizeWithSeedArgs")=>exports.struct([exports.u32("voteAuthorizationType"),Be("currentAuthorityDerivedKeyOwnerPubkey"),br("currentAuthorityDerivedKeySeed"),Be("newAuthorized")],n);function Ih(n,e){const t=s=>{if(s.span>=0)return s.span;if(typeof s.alloc=="function")return s.alloc(e[s.property]);if("count"in s&&"elementLayout"in s){const i=e[s.property];if(Array.isArray(i))return i.length*t(s.elementLayout)}else if("fields"in s)return Ih({layout:s},e[s.property]);return 0};let r=0;return n.layout.fields.forEach(s=>{r+=t(s)}),r}function Vt(n){let e=0,t=0;for(;;){let r=n.shift();if(e|=(r&127)<<t*7,t+=1,!(r&128))break}return e}function Xt(n,e){let t=e;for(;;){let r=t&127;if(t>>=7,t==0){n.push(r);break}else r|=128,n.push(r)}}function Te(n,e){if(!n)throw new Error(e||"Assertion failed")}class ko{constructor(e,t){this.payer=void 0,this.keyMetaMap=void 0,this.payer=e,this.keyMetaMap=t}static compile(e,t){const r=new Map,s=o=>{const a=o.toBase58();let l=r.get(a);return l===void 0&&(l={isSigner:!1,isWritable:!1,isInvoked:!1},r.set(a,l)),l},i=s(t);i.isSigner=!0,i.isWritable=!0;for(const o of e){s(o.programId).isInvoked=!0;for(const a of o.keys){const l=s(a.pubkey);l.isSigner||(l.isSigner=a.isSigner),l.isWritable||(l.isWritable=a.isWritable)}}return new ko(t,r)}getMessageComponents(){const e=[...this.keyMetaMap.entries()];Te(e.length<=256,"Max static account keys length exceeded");const t=e.filter(([,l])=>l.isSigner&&l.isWritable),r=e.filter(([,l])=>l.isSigner&&!l.isWritable),s=e.filter(([,l])=>!l.isSigner&&l.isWritable),i=e.filter(([,l])=>!l.isSigner&&!l.isWritable),o={numRequiredSignatures:t.length+r.length,numReadonlySignedAccounts:r.length,numReadonlyUnsignedAccounts:i.length};{Te(t.length>0,"Expected at least one writable signer key");const[l]=t[0];Te(l===this.payer.toBase58(),"Expected first writable signer key to be the fee payer")}const a=[...t.map(([l])=>new Y(l)),...r.map(([l])=>new Y(l)),...s.map(([l])=>new Y(l)),...i.map(([l])=>new Y(l))];return[o,a]}extractTableLookup(e){const[t,r]=this.drainKeysFoundInLookupTable(e.state.addresses,o=>!o.isSigner&&!o.isInvoked&&o.isWritable),[s,i]=this.drainKeysFoundInLookupTable(e.state.addresses,o=>!o.isSigner&&!o.isInvoked&&!o.isWritable);if(!(t.length===0&&s.length===0))return[{accountKey:e.key,writableIndexes:t,readonlyIndexes:s},{writable:r,readonly:i}]}drainKeysFoundInLookupTable(e,t){const r=new Array,s=new Array;for(const[i,o]of this.keyMetaMap.entries())if(t(o)){const a=new Y(i),l=e.findIndex(h=>h.equals(a));l>=0&&(Te(l<256,"Max lookup table index exceeded"),r.push(l),s.push(a),this.keyMetaMap.delete(i))}return[r,s]}}const Uh="Reached end of buffer unexpectedly";function wn(n){if(n.length===0)throw new Error(Uh);return n.shift()}function Gt(n,...e){const[t]=e;if(e.length===2?t+(e[1]??0)>n.length:t>=n.length)throw new Error(Uh);return n.splice(...e)}class cn{constructor(e){this.header=void 0,this.accountKeys=void 0,this.recentBlockhash=void 0,this.instructions=void 0,this.indexToProgramIds=new Map,this.header=e.header,this.accountKeys=e.accountKeys.map(t=>new Y(t)),this.recentBlockhash=e.recentBlockhash,this.instructions=e.instructions,this.instructions.forEach(t=>this.indexToProgramIds.set(t.programIdIndex,this.accountKeys[t.programIdIndex]))}get version(){return"legacy"}get staticAccountKeys(){return this.accountKeys}get compiledInstructions(){return this.instructions.map(e=>({programIdIndex:e.programIdIndex,accountKeyIndexes:e.accounts,data:vt.decode(e.data)}))}get addressTableLookups(){return[]}getAccountKeys(){return new js(this.staticAccountKeys)}static compile(e){const t=ko.compile(e.instructions,e.payerKey),[r,s]=t.getMessageComponents(),o=new js(s).compileInstructions(e.instructions).map(a=>({programIdIndex:a.programIdIndex,accounts:a.accountKeyIndexes,data:vt.encode(a.data)}));return new cn({header:r,accountKeys:s,recentBlockhash:e.recentBlockhash,instructions:o})}isAccountSigner(e){return e<this.header.numRequiredSignatures}isAccountWritable(e){const t=this.header.numRequiredSignatures;if(e>=this.header.numRequiredSignatures){const r=e-t,i=this.accountKeys.length-t-this.header.numReadonlyUnsignedAccounts;return r<i}else{const r=t-this.header.numReadonlySignedAccounts;return e<r}}isProgramId(e){return this.indexToProgramIds.has(e)}programIds(){return[...this.indexToProgramIds.values()]}nonProgramIds(){return this.accountKeys.filter((e,t)=>!this.isProgramId(t))}serialize(){const e=this.accountKeys.length;let t=[];Xt(t,e);const r=this.instructions.map(E=>{const{accounts:S,programIdIndex:A}=E,g=Array.from(vt.decode(E.data));let D=[];Xt(D,S.length);let x=[];return Xt(x,g.length),{programIdIndex:A,keyIndicesCount:oe.Buffer.from(D),keyIndices:S,dataLength:oe.Buffer.from(x),data:g}});let s=[];Xt(s,r.length);let i=oe.Buffer.alloc(nr);oe.Buffer.from(s).copy(i);let o=s.length;r.forEach(E=>{const A=exports.struct([exports.u8("programIdIndex"),exports.blob(E.keyIndicesCount.length,"keyIndicesCount"),exports.seq(exports.u8("keyIndex"),E.keyIndices.length,"keyIndices"),exports.blob(E.dataLength.length,"dataLength"),exports.seq(exports.u8("userdatum"),E.data.length,"data")]).encode(E,i,o);o+=A}),i=i.slice(0,o);const a=exports.struct([exports.blob(1,"numRequiredSignatures"),exports.blob(1,"numReadonlySignedAccounts"),exports.blob(1,"numReadonlyUnsignedAccounts"),exports.blob(t.length,"keyCount"),exports.seq(Be("key"),e,"keys"),Be("recentBlockhash")]),l={numRequiredSignatures:oe.Buffer.from([this.header.numRequiredSignatures]),numReadonlySignedAccounts:oe.Buffer.from([this.header.numReadonlySignedAccounts]),numReadonlyUnsignedAccounts:oe.Buffer.from([this.header.numReadonlyUnsignedAccounts]),keyCount:oe.Buffer.from(t),keys:this.accountKeys.map(E=>ge(E.toBytes())),recentBlockhash:vt.decode(this.recentBlockhash)};let h=oe.Buffer.alloc(2048);const m=a.encode(l,h);return i.copy(h,m),h.slice(0,m+i.length)}static from(e){let t=[...e];const r=wn(t);if(r!==(r&Do))throw new Error("Versioned messages must be deserialized with VersionedMessage.deserialize()");const s=wn(t),i=wn(t),o=Vt(t);let a=[];for(let S=0;S<o;S++){const A=Gt(t,0,xn);a.push(new Y(oe.Buffer.from(A)))}const l=Gt(t,0,xn),h=Vt(t);let m=[];for(let S=0;S<h;S++){const A=wn(t),g=Vt(t),D=Gt(t,0,g),x=Vt(t),U=Gt(t,0,x),R=vt.encode(oe.Buffer.from(U));m.push({programIdIndex:A,accounts:D,data:R})}const E={header:{numRequiredSignatures:r,numReadonlySignedAccounts:s,numReadonlyUnsignedAccounts:i},recentBlockhash:vt.encode(oe.Buffer.from(l)),accountKeys:a,instructions:m};return new cn(E)}}class ir{constructor(e){this.header=void 0,this.staticAccountKeys=void 0,this.recentBlockhash=void 0,this.compiledInstructions=void 0,this.addressTableLookups=void 0,this.header=e.header,this.staticAccountKeys=e.staticAccountKeys,this.recentBlockhash=e.recentBlockhash,this.compiledInstructions=e.compiledInstructions,this.addressTableLookups=e.addressTableLookups}get version(){return 0}get numAccountKeysFromLookups(){let e=0;for(const t of this.addressTableLookups)e+=t.readonlyIndexes.length+t.writableIndexes.length;return e}getAccountKeys(e){let t;if(e&&"accountKeysFromLookups"in e&&e.accountKeysFromLookups){if(this.numAccountKeysFromLookups!=e.accountKeysFromLookups.writable.length+e.accountKeysFromLookups.readonly.length)throw new Error("Failed to get account keys because of a mismatch in the number of account keys from lookups");t=e.accountKeysFromLookups}else if(e&&"addressLookupTableAccounts"in e&&e.addressLookupTableAccounts)t=this.resolveAddressTableLookups(e.addressLookupTableAccounts);else if(this.addressTableLookups.length>0)throw new Error("Failed to get account keys because address table lookups were not resolved");return new js(this.staticAccountKeys,t)}isAccountSigner(e){return e<this.header.numRequiredSignatures}isAccountWritable(e){const t=this.header.numRequiredSignatures,r=this.staticAccountKeys.length;if(e>=r){const s=e-r,i=this.addressTableLookups.reduce((o,a)=>o+a.writableIndexes.length,0);return s<i}else if(e>=this.header.numRequiredSignatures){const s=e-t,o=r-t-this.header.numReadonlyUnsignedAccounts;return s<o}else{const s=t-this.header.numReadonlySignedAccounts;return e<s}}resolveAddressTableLookups(e){const t={writable:[],readonly:[]};for(const r of this.addressTableLookups){const s=e.find(i=>i.key.equals(r.accountKey));if(!s)throw new Error(`Failed to find address lookup table account for table key ${r.accountKey.toBase58()}`);for(const i of r.writableIndexes)if(i<s.state.addresses.length)t.writable.push(s.state.addresses[i]);else throw new Error(`Failed to find address for index ${i} in address lookup table ${r.accountKey.toBase58()}`);for(const i of r.readonlyIndexes)if(i<s.state.addresses.length)t.readonly.push(s.state.addresses[i]);else throw new Error(`Failed to find address for index ${i} in address lookup table ${r.accountKey.toBase58()}`)}return t}static compile(e){const t=ko.compile(e.instructions,e.payerKey),r=new Array,s={writable:new Array,readonly:new Array},i=e.addressLookupTableAccounts||[];for(const m of i){const E=t.extractTableLookup(m);if(E!==void 0){const[S,{writable:A,readonly:g}]=E;r.push(S),s.writable.push(...A),s.readonly.push(...g)}}const[o,a]=t.getMessageComponents(),h=new js(a,s).compileInstructions(e.instructions);return new ir({header:o,staticAccountKeys:a,recentBlockhash:e.recentBlockhash,compiledInstructions:h,addressTableLookups:r})}serialize(){const e=Array();Xt(e,this.staticAccountKeys.length);const t=this.serializeInstructions(),r=Array();Xt(r,this.compiledInstructions.length);const s=this.serializeAddressTableLookups(),i=Array();Xt(i,this.addressTableLookups.length);const o=exports.struct([exports.u8("prefix"),exports.struct([exports.u8("numRequiredSignatures"),exports.u8("numReadonlySignedAccounts"),exports.u8("numReadonlyUnsignedAccounts")],"header"),exports.blob(e.length,"staticAccountKeysLength"),exports.seq(Be(),this.staticAccountKeys.length,"staticAccountKeys"),Be("recentBlockhash"),exports.blob(r.length,"instructionsLength"),exports.blob(t.length,"serializedInstructions"),exports.blob(i.length,"addressTableLookupsLength"),exports.blob(s.length,"serializedAddressTableLookups")]),a=new Uint8Array(nr),h=o.encode({prefix:128,header:this.header,staticAccountKeysLength:new Uint8Array(e),staticAccountKeys:this.staticAccountKeys.map(m=>m.toBytes()),recentBlockhash:vt.decode(this.recentBlockhash),instructionsLength:new Uint8Array(r),serializedInstructions:t,addressTableLookupsLength:new Uint8Array(i),serializedAddressTableLookups:s},a);return a.slice(0,h)}serializeInstructions(){let e=0;const t=new Uint8Array(nr);for(const r of this.compiledInstructions){const s=Array();Xt(s,r.accountKeyIndexes.length);const i=Array();Xt(i,r.data.length);const o=exports.struct([exports.u8("programIdIndex"),exports.blob(s.length,"encodedAccountKeyIndexesLength"),exports.seq(exports.u8(),r.accountKeyIndexes.length,"accountKeyIndexes"),exports.blob(i.length,"encodedDataLength"),exports.blob(r.data.length,"data")]);e+=o.encode({programIdIndex:r.programIdIndex,encodedAccountKeyIndexesLength:new Uint8Array(s),accountKeyIndexes:r.accountKeyIndexes,encodedDataLength:new Uint8Array(i),data:r.data},t,e)}return t.slice(0,e)}serializeAddressTableLookups(){let e=0;const t=new Uint8Array(nr);for(const r of this.addressTableLookups){const s=Array();Xt(s,r.writableIndexes.length);const i=Array();Xt(i,r.readonlyIndexes.length);const o=exports.struct([Be("accountKey"),exports.blob(s.length,"encodedWritableIndexesLength"),exports.seq(exports.u8(),r.writableIndexes.length,"writableIndexes"),exports.blob(i.length,"encodedReadonlyIndexesLength"),exports.seq(exports.u8(),r.readonlyIndexes.length,"readonlyIndexes")]);e+=o.encode({accountKey:r.accountKey.toBytes(),encodedWritableIndexesLength:new Uint8Array(s),writableIndexes:r.writableIndexes,encodedReadonlyIndexesLength:new Uint8Array(i),readonlyIndexes:r.readonlyIndexes},t,e)}return t.slice(0,e)}static deserialize(e){let t=[...e];const r=wn(t),s=r&Do;Te(r!==s,"Expected versioned message but received legacy message");const i=s;Te(i===0,`Expected versioned message with version 0 but found version ${i}`);const o={numRequiredSignatures:wn(t),numReadonlySignedAccounts:wn(t),numReadonlyUnsignedAccounts:wn(t)},a=[],l=Vt(t);for(let g=0;g<l;g++)a.push(new Y(Gt(t,0,xn)));const h=vt.encode(Gt(t,0,xn)),m=Vt(t),E=[];for(let g=0;g<m;g++){const D=wn(t),x=Vt(t),U=Gt(t,0,x),R=Vt(t),F=new Uint8Array(Gt(t,0,R));E.push({programIdIndex:D,accountKeyIndexes:U,data:F})}const S=Vt(t),A=[];for(let g=0;g<S;g++){const D=new Y(Gt(t,0,xn)),x=Vt(t),U=Gt(t,0,x),R=Vt(t),F=Gt(t,0,R);A.push({accountKey:D,writableIndexes:U,readonlyIndexes:F})}return new ir({header:o,staticAccountKeys:a,recentBlockhash:h,compiledInstructions:E,addressTableLookups:A})}}const vl={deserializeMessageVersion(n){const e=n[0],t=e&Do;return t===e?"legacy":t},deserialize:n=>{const e=vl.deserializeMessageVersion(n);if(e==="legacy")return cn.from(n);if(e===0)return ir.deserialize(n);throw new Error(`Transaction message version ${e} deserialization is not supported`)}};let Rn=function(n){return n[n.BLOCKHEIGHT_EXCEEDED=0]="BLOCKHEIGHT_EXCEEDED",n[n.PROCESSED=1]="PROCESSED",n[n.TIMED_OUT=2]="TIMED_OUT",n[n.NONCE_INVALID=3]="NONCE_INVALID",n}({});const B3=oe.Buffer.alloc(Ks).fill(0);class We{constructor(e){this.keys=void 0,this.programId=void 0,this.data=oe.Buffer.alloc(0),this.programId=e.programId,this.keys=e.keys,e.data&&(this.data=e.data)}toJSON(){return{keys:this.keys.map(({pubkey:e,isSigner:t,isWritable:r})=>({pubkey:e.toJSON(),isSigner:t,isWritable:r})),programId:this.programId.toJSON(),data:[...this.data]}}}class Fe{get signature(){return this.signatures.length>0?this.signatures[0].signature:null}constructor(e){if(this.signatures=[],this.feePayer=void 0,this.instructions=[],this.recentBlockhash=void 0,this.lastValidBlockHeight=void 0,this.nonceInfo=void 0,this.minNonceContextSlot=void 0,this._message=void 0,this._json=void 0,!!e)if(e.feePayer&&(this.feePayer=e.feePayer),e.signatures&&(this.signatures=e.signatures),Object.prototype.hasOwnProperty.call(e,"nonceInfo")){const{minContextSlot:t,nonceInfo:r}=e;this.minNonceContextSlot=t,this.nonceInfo=r}else if(Object.prototype.hasOwnProperty.call(e,"lastValidBlockHeight")){const{blockhash:t,lastValidBlockHeight:r}=e;this.recentBlockhash=t,this.lastValidBlockHeight=r}else{const{recentBlockhash:t,nonceInfo:r}=e;r&&(this.nonceInfo=r),this.recentBlockhash=t}}toJSON(){return{recentBlockhash:this.recentBlockhash||null,feePayer:this.feePayer?this.feePayer.toJSON():null,nonceInfo:this.nonceInfo?{nonce:this.nonceInfo.nonce,nonceInstruction:this.nonceInfo.nonceInstruction.toJSON()}:null,instructions:this.instructions.map(e=>e.toJSON()),signers:this.signatures.map(({publicKey:e})=>e.toJSON())}}add(...e){if(e.length===0)throw new Error("No instructions");return e.forEach(t=>{"instructions"in t?this.instructions=this.instructions.concat(t.instructions):"data"in t&&"programId"in t&&"keys"in t?this.instructions.push(t):this.instructions.push(new We(t))}),this}compileMessage(){if(this._message&&JSON.stringify(this.toJSON())===JSON.stringify(this._json))return this._message;let e,t;if(this.nonceInfo?(e=this.nonceInfo.nonce,this.instructions[0]!=this.nonceInfo.nonceInstruction?t=[this.nonceInfo.nonceInstruction,...this.instructions]:t=this.instructions):(e=this.recentBlockhash,t=this.instructions),!e)throw new Error("Transaction recentBlockhash required");t.length<1&&console.warn("No instructions provided");let r;if(this.feePayer)r=this.feePayer;else if(this.signatures.length>0&&this.signatures[0].publicKey)r=this.signatures[0].publicKey;else throw new Error("Transaction fee payer required");for(let D=0;D<t.length;D++)if(t[D].programId===void 0)throw new Error(`Transaction instruction index ${D} has undefined program id`);const s=[],i=[];t.forEach(D=>{D.keys.forEach(U=>{i.push({...U})});const x=D.programId.toString();s.includes(x)||s.push(x)}),s.forEach(D=>{i.push({pubkey:new Y(D),isSigner:!1,isWritable:!1})});const o=[];i.forEach(D=>{const x=D.pubkey.toString(),U=o.findIndex(R=>R.pubkey.toString()===x);U>-1?(o[U].isWritable=o[U].isWritable||D.isWritable,o[U].isSigner=o[U].isSigner||D.isSigner):o.push(D)}),o.sort(function(D,x){if(D.isSigner!==x.isSigner)return D.isSigner?-1:1;if(D.isWritable!==x.isWritable)return D.isWritable?-1:1;const U={localeMatcher:"best fit",usage:"sort",sensitivity:"variant",ignorePunctuation:!1,numeric:!1,caseFirst:"lower"};return D.pubkey.toBase58().localeCompare(x.pubkey.toBase58(),"en",U)});const a=o.findIndex(D=>D.pubkey.equals(r));if(a>-1){const[D]=o.splice(a,1);D.isSigner=!0,D.isWritable=!0,o.unshift(D)}else o.unshift({pubkey:r,isSigner:!0,isWritable:!0});for(const D of this.signatures){const x=o.findIndex(U=>U.pubkey.equals(D.publicKey));if(x>-1)o[x].isSigner||(o[x].isSigner=!0,console.warn("Transaction references a signature that is unnecessary, only the fee payer and instruction signer accounts should sign a transaction. This behavior is deprecated and will throw an error in the next major version release."));else throw new Error(`unknown signer: ${D.publicKey.toString()}`)}let l=0,h=0,m=0;const E=[],S=[];o.forEach(({pubkey:D,isSigner:x,isWritable:U})=>{x?(E.push(D.toString()),l+=1,U||(h+=1)):(S.push(D.toString()),U||(m+=1))});const A=E.concat(S),g=t.map(D=>{const{data:x,programId:U}=D;return{programIdIndex:A.indexOf(U.toString()),accounts:D.keys.map(R=>A.indexOf(R.pubkey.toString())),data:vt.encode(x)}});return g.forEach(D=>{Te(D.programIdIndex>=0),D.accounts.forEach(x=>Te(x>=0))}),new cn({header:{numRequiredSignatures:l,numReadonlySignedAccounts:h,numReadonlyUnsignedAccounts:m},accountKeys:A,recentBlockhash:e,instructions:g})}_compile(){const e=this.compileMessage(),t=e.accountKeys.slice(0,e.header.numRequiredSignatures);return this.signatures.length===t.length&&this.signatures.every((s,i)=>t[i].equals(s.publicKey))||(this.signatures=t.map(r=>({signature:null,publicKey:r}))),e}serializeMessage(){return this._compile().serialize()}async getEstimatedFee(e){return(await e.getFeeForMessage(this.compileMessage())).value}setSigners(...e){if(e.length===0)throw new Error("No signers");const t=new Set;this.signatures=e.filter(r=>{const s=r.toString();return t.has(s)?!1:(t.add(s),!0)}).map(r=>({signature:null,publicKey:r}))}sign(...e){if(e.length===0)throw new Error("No signers");const t=new Set,r=[];for(const i of e){const o=i.publicKey.toString();t.has(o)||(t.add(o),r.push(i))}this.signatures=r.map(i=>({signature:null,publicKey:i.publicKey}));const s=this._compile();this._partialSign(s,...r)}partialSign(...e){if(e.length===0)throw new Error("No signers");const t=new Set,r=[];for(const i of e){const o=i.publicKey.toString();t.has(o)||(t.add(o),r.push(i))}const s=this._compile();this._partialSign(s,...r)}_partialSign(e,...t){const r=e.serialize();t.forEach(s=>{const i=Cl(r,s.secretKey);this._addSignature(s.publicKey,ge(i))})}addSignature(e,t){this._compile(),this._addSignature(e,t)}_addSignature(e,t){Te(t.length===64);const r=this.signatures.findIndex(s=>e.equals(s.publicKey));if(r<0)throw new Error(`unknown signer: ${e.toString()}`);this.signatures[r].signature=oe.Buffer.from(t)}verifySignatures(e=!0){return!this._getMessageSignednessErrors(this.serializeMessage(),e)}_getMessageSignednessErrors(e,t){const r={};for(const{signature:s,publicKey:i}of this.signatures)s===null?t&&(r.missing||(r.missing=[])).push(i):f3(s,e,i.toBytes())||(r.invalid||(r.invalid=[])).push(i);return r.invalid||r.missing?r:void 0}serialize(e){const{requireAllSignatures:t,verifySignatures:r}=Object.assign({requireAllSignatures:!0,verifySignatures:!0},e),s=this.serializeMessage();if(r){const i=this._getMessageSignednessErrors(s,t);if(i){let o="Signature verification failed.";throw i.invalid&&(o+=`
9
9
  Invalid signature for public key${i.invalid.length===1?"":"(s)"} [\`${i.invalid.map(a=>a.toBase58()).join("`, `")}\`].`),i.missing&&(o+=`
10
- Missing signature for public key${i.missing.length===1?"":"(s)"} [\`${i.missing.map(a=>a.toBase58()).join("`, `")}\`].`),new Error(o)}}return this._serialize(s)}_serialize(e){const{signatures:t}=this,r=[];Xt(r,t.length);const s=r.length+t.length*64+e.length,i=oe.Buffer.alloc(s);return Te(t.length<256),oe.Buffer.from(r).copy(i,0),t.forEach(({signature:o},a)=>{o!==null&&(Te(o.length===64,"signature has invalid length"),oe.Buffer.from(o).copy(i,r.length+a*64))}),e.copy(i,r.length+t.length*64),Te(i.length<=er,`Transaction too large: ${i.length} > ${er}`),i}get keys(){return Te(this.instructions.length===1),this.instructions[0].keys.map(e=>e.pubkey)}get programId(){return Te(this.instructions.length===1),this.instructions[0].programId}get data(){return Te(this.instructions.length===1),this.instructions[0].data}static from(e){let t=[...e];const r=Vt(t);let s=[];for(let i=0;i<r;i++){const o=Gt(t,0,qs);s.push(vt.encode(oe.Buffer.from(o)))}return Fe.populate(cn.from(t),s)}static populate(e,t=[]){const r=new Fe;return r.recentBlockhash=e.recentBlockhash,e.header.numRequiredSignatures>0&&(r.feePayer=e.accountKeys[0]),t.forEach((s,i)=>{const o={signature:s==vt.encode(E3)?null:vt.decode(s),publicKey:e.accountKeys[i]};r.signatures.push(o)}),e.instructions.forEach(s=>{const i=s.accounts.map(o=>{const a=e.accountKeys[o];return{pubkey:a,isSigner:r.signatures.some(l=>l.publicKey.toString()===a.toString())||e.isAccountSigner(o),isWritable:e.isAccountWritable(o)}});r.instructions.push(new We({keys:i,programId:e.accountKeys[s.programIdIndex],data:vt.decode(s.data)}))}),r._message=e,r._json=r.toJSON(),r}}class ko{constructor(e){this.payerKey=void 0,this.instructions=void 0,this.recentBlockhash=void 0,this.payerKey=e.payerKey,this.instructions=e.instructions,this.recentBlockhash=e.recentBlockhash}static decompile(e,t){const{header:r,compiledInstructions:s,recentBlockhash:i}=e,{numRequiredSignatures:o,numReadonlySignedAccounts:a,numReadonlyUnsignedAccounts:l}=r,h=o-a;Te(h>0,"Message header is invalid");const m=e.staticAccountKeys.length-o-l;Te(m>=0,"Message header is invalid");const E=e.getAccountKeys(t),S=E.get(0);if(S===void 0)throw new Error("Failed to decompile message because no account keys were found");const A=[];for(const g of s){const D=[];for(const U of g.accountKeyIndexes){const R=E.get(U);if(R===void 0)throw new Error(`Failed to find key for account key index ${U}`);const F=U<o;let W;F?W=U<h:U<E.staticAccountKeys.length?W=U-o<m:W=U-E.staticAccountKeys.length<E.accountKeysFromLookups.writable.length,D.push({pubkey:R,isSigner:U<r.numRequiredSignatures,isWritable:W})}const x=E.get(g.programIdIndex);if(x===void 0)throw new Error(`Failed to find program id for program id index ${g.programIdIndex}`);A.push(new We({programId:x,data:ge(g.data),keys:D}))}return new ko({payerKey:S,instructions:A,recentBlockhash:i})}compileToLegacyMessage(){return cn.compile({payerKey:this.payerKey,recentBlockhash:this.recentBlockhash,instructions:this.instructions})}compileToV0Message(e){return nr.compile({payerKey:this.payerKey,recentBlockhash:this.recentBlockhash,instructions:this.instructions,addressLookupTableAccounts:e})}}class Fo{get version(){return this.message.version}constructor(e,t){if(this.signatures=void 0,this.message=void 0,t!==void 0)Te(t.length===e.header.numRequiredSignatures,"Expected signatures length to be equal to the number of required signatures"),this.signatures=t;else{const r=[];for(let s=0;s<e.header.numRequiredSignatures;s++)r.push(new Uint8Array(qs));this.signatures=r}this.message=e}serialize(){const e=this.message.serialize(),t=Array();Xt(t,this.signatures.length);const r=exports.struct([exports.blob(t.length,"encodedSignaturesLength"),exports.seq(p3(),this.signatures.length,"signatures"),exports.blob(e.length,"serializedMessage")]),s=new Uint8Array(2048),i=r.encode({encodedSignaturesLength:new Uint8Array(t),signatures:this.signatures,serializedMessage:e},s);return s.slice(0,i)}static deserialize(e){let t=[...e];const r=[],s=Vt(t);for(let o=0;o<s;o++)r.push(new Uint8Array(Gt(t,0,qs)));const i=Sl.deserialize(new Uint8Array(t));return new Fo(i,r)}sign(e){const t=this.message.serialize(),r=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures);for(const s of e){const i=r.findIndex(o=>o.equals(s.publicKey));Te(i>=0,`Cannot sign with non signer key ${s.publicKey.toBase58()}`),this.signatures[i]=Bl(t,s.secretKey)}}addSignature(e,t){Te(t.byteLength===64,"Signature must be 64 bytes long");const s=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures).findIndex(i=>i.equals(e));Te(s>=0,`Can not add signature; \`${e.toBase58()}\` is not required to sign this transaction`),this.signatures[s]=t}}const B3=160,x3=64,C3=B3/x3,Ch=1e3/C3,dn=new Y("SysvarC1ock11111111111111111111111111111111"),S3=new Y("SysvarEpochSchedu1e111111111111111111111111"),Sh=new Y("Sysvar1nstructions1111111111111111111111111"),Fi=new Y("SysvarRecentB1ockHashes11111111111111111111"),Sr=new Y("SysvarRent111111111111111111111111111111111"),D3=new Y("SysvarRewards111111111111111111111111111111"),v3=new Y("SysvarS1otHashes111111111111111111111111111"),k3=new Y("SysvarS1otHistory11111111111111111111111111"),Ti=new Y("SysvarStakeHistory1111111111111111111111111");class Xr extends Error{constructor({action:e,signature:t,transactionMessage:r,logs:s}){const i=s?`Logs:
10
+ Missing signature for public key${i.missing.length===1?"":"(s)"} [\`${i.missing.map(a=>a.toBase58()).join("`, `")}\`].`),new Error(o)}}return this._serialize(s)}_serialize(e){const{signatures:t}=this,r=[];Xt(r,t.length);const s=r.length+t.length*64+e.length,i=oe.Buffer.alloc(s);return Te(t.length<256),oe.Buffer.from(r).copy(i,0),t.forEach(({signature:o},a)=>{o!==null&&(Te(o.length===64,"signature has invalid length"),oe.Buffer.from(o).copy(i,r.length+a*64))}),e.copy(i,r.length+t.length*64),Te(i.length<=nr,`Transaction too large: ${i.length} > ${nr}`),i}get keys(){return Te(this.instructions.length===1),this.instructions[0].keys.map(e=>e.pubkey)}get programId(){return Te(this.instructions.length===1),this.instructions[0].programId}get data(){return Te(this.instructions.length===1),this.instructions[0].data}static from(e){let t=[...e];const r=Vt(t);let s=[];for(let i=0;i<r;i++){const o=Gt(t,0,Ks);s.push(vt.encode(oe.Buffer.from(o)))}return Fe.populate(cn.from(t),s)}static populate(e,t=[]){const r=new Fe;return r.recentBlockhash=e.recentBlockhash,e.header.numRequiredSignatures>0&&(r.feePayer=e.accountKeys[0]),t.forEach((s,i)=>{const o={signature:s==vt.encode(B3)?null:vt.decode(s),publicKey:e.accountKeys[i]};r.signatures.push(o)}),e.instructions.forEach(s=>{const i=s.accounts.map(o=>{const a=e.accountKeys[o];return{pubkey:a,isSigner:r.signatures.some(l=>l.publicKey.toString()===a.toString())||e.isAccountSigner(o),isWritable:e.isAccountWritable(o)}});r.instructions.push(new We({keys:i,programId:e.accountKeys[s.programIdIndex],data:vt.decode(s.data)}))}),r._message=e,r._json=r.toJSON(),r}}class Fo{constructor(e){this.payerKey=void 0,this.instructions=void 0,this.recentBlockhash=void 0,this.payerKey=e.payerKey,this.instructions=e.instructions,this.recentBlockhash=e.recentBlockhash}static decompile(e,t){const{header:r,compiledInstructions:s,recentBlockhash:i}=e,{numRequiredSignatures:o,numReadonlySignedAccounts:a,numReadonlyUnsignedAccounts:l}=r,h=o-a;Te(h>0,"Message header is invalid");const m=e.staticAccountKeys.length-o-l;Te(m>=0,"Message header is invalid");const E=e.getAccountKeys(t),S=E.get(0);if(S===void 0)throw new Error("Failed to decompile message because no account keys were found");const A=[];for(const g of s){const D=[];for(const U of g.accountKeyIndexes){const R=E.get(U);if(R===void 0)throw new Error(`Failed to find key for account key index ${U}`);const F=U<o;let W;F?W=U<h:U<E.staticAccountKeys.length?W=U-o<m:W=U-E.staticAccountKeys.length<E.accountKeysFromLookups.writable.length,D.push({pubkey:R,isSigner:U<r.numRequiredSignatures,isWritable:W})}const x=E.get(g.programIdIndex);if(x===void 0)throw new Error(`Failed to find program id for program id index ${g.programIdIndex}`);A.push(new We({programId:x,data:ge(g.data),keys:D}))}return new Fo({payerKey:S,instructions:A,recentBlockhash:i})}compileToLegacyMessage(){return cn.compile({payerKey:this.payerKey,recentBlockhash:this.recentBlockhash,instructions:this.instructions})}compileToV0Message(e){return ir.compile({payerKey:this.payerKey,recentBlockhash:this.recentBlockhash,instructions:this.instructions,addressLookupTableAccounts:e})}}class To{get version(){return this.message.version}constructor(e,t){if(this.signatures=void 0,this.message=void 0,t!==void 0)Te(t.length===e.header.numRequiredSignatures,"Expected signatures length to be equal to the number of required signatures"),this.signatures=t;else{const r=[];for(let s=0;s<e.header.numRequiredSignatures;s++)r.push(new Uint8Array(Ks));this.signatures=r}this.message=e}serialize(){const e=this.message.serialize(),t=Array();Xt(t,this.signatures.length);const r=exports.struct([exports.blob(t.length,"encodedSignaturesLength"),exports.seq(g3(),this.signatures.length,"signatures"),exports.blob(e.length,"serializedMessage")]),s=new Uint8Array(2048),i=r.encode({encodedSignaturesLength:new Uint8Array(t),signatures:this.signatures,serializedMessage:e},s);return s.slice(0,i)}static deserialize(e){let t=[...e];const r=[],s=Vt(t);for(let o=0;o<s;o++)r.push(new Uint8Array(Gt(t,0,Ks)));const i=vl.deserialize(new Uint8Array(t));return new To(i,r)}sign(e){const t=this.message.serialize(),r=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures);for(const s of e){const i=r.findIndex(o=>o.equals(s.publicKey));Te(i>=0,`Cannot sign with non signer key ${s.publicKey.toBase58()}`),this.signatures[i]=Cl(t,s.secretKey)}}addSignature(e,t){Te(t.byteLength===64,"Signature must be 64 bytes long");const s=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures).findIndex(i=>i.equals(e));Te(s>=0,`Can not add signature; \`${e.toBase58()}\` is not required to sign this transaction`),this.signatures[s]=t}}const x3=160,C3=64,S3=x3/C3,_h=1e3/S3,dn=new Y("SysvarC1ock11111111111111111111111111111111"),D3=new Y("SysvarEpochSchedu1e111111111111111111111111"),Mh=new Y("Sysvar1nstructions1111111111111111111111111"),Ti=new Y("SysvarRecentB1ockHashes11111111111111111111"),Sr=new Y("SysvarRent111111111111111111111111111111111"),v3=new Y("SysvarRewards111111111111111111111111111111"),k3=new Y("SysvarS1otHashes111111111111111111111111111"),F3=new Y("SysvarS1otHistory11111111111111111111111111"),Ii=new Y("SysvarStakeHistory1111111111111111111111111");class Jr extends Error{constructor({action:e,signature:t,transactionMessage:r,logs:s}){const i=s?`Logs:
11
11
  ${JSON.stringify(s.slice(-10),null,2)}. `:"",o="\nCatch the `SendTransactionError` and call `getLogs()` on it for full details.";let a;switch(e){case"send":a=`Transaction ${t} resulted in an error.
12
12
  ${r}. `+i+o;break;case"simulate":a=`Simulation failed.
13
13
  Message: ${r}.
14
- `+i+o;break;default:a=`Unknown action '${(l=>l)(e)}'`}super(a),this.signature=void 0,this.transactionMessage=void 0,this.transactionLogs=void 0,this.signature=t,this.transactionMessage=r,this.transactionLogs=s||void 0}get transactionError(){return{message:this.transactionMessage,logs:Array.isArray(this.transactionLogs)?this.transactionLogs:void 0}}get logs(){const e=this.transactionLogs;if(!(e!=null&&typeof e=="object"&&"then"in e))return e}async getLogs(e){return Array.isArray(this.transactionLogs)||(this.transactionLogs=new Promise((t,r)=>{e.getTransaction(this.signature).then(s=>{if(s&&s.meta&&s.meta.logMessages){const i=s.meta.logMessages;this.transactionLogs=i,t(i)}else r(new Error("Log messages not found"))}).catch(r)})),await this.transactionLogs}}const F3={JSON_RPC_SERVER_ERROR_BLOCK_CLEANED_UP:-32001,JSON_RPC_SERVER_ERROR_SEND_TRANSACTION_PREFLIGHT_FAILURE:-32002,JSON_RPC_SERVER_ERROR_TRANSACTION_SIGNATURE_VERIFICATION_FAILURE:-32003,JSON_RPC_SERVER_ERROR_BLOCK_NOT_AVAILABLE:-32004,JSON_RPC_SERVER_ERROR_NODE_UNHEALTHY:-32005,JSON_RPC_SERVER_ERROR_TRANSACTION_PRECOMPILE_VERIFICATION_FAILURE:-32006,JSON_RPC_SERVER_ERROR_SLOT_SKIPPED:-32007,JSON_RPC_SERVER_ERROR_NO_SNAPSHOT:-32008,JSON_RPC_SERVER_ERROR_LONG_TERM_STORAGE_SLOT_SKIPPED:-32009,JSON_RPC_SERVER_ERROR_KEY_EXCLUDED_FROM_SECONDARY_INDEX:-32010,JSON_RPC_SERVER_ERROR_TRANSACTION_HISTORY_NOT_AVAILABLE:-32011,JSON_RPC_SCAN_ERROR:-32012,JSON_RPC_SERVER_ERROR_TRANSACTION_SIGNATURE_LEN_MISMATCH:-32013,JSON_RPC_SERVER_ERROR_BLOCK_STATUS_NOT_AVAILABLE_YET:-32014,JSON_RPC_SERVER_ERROR_UNSUPPORTED_TRANSACTION_VERSION:-32015,JSON_RPC_SERVER_ERROR_MIN_CONTEXT_SLOT_NOT_REACHED:-32016};class se extends Error{constructor({code:e,message:t,data:r},s){super(s!=null?`${s}: ${t}`:t),this.code=void 0,this.data=void 0,this.code=e,this.data=r,this.name="SolanaJSONRPCError"}}async function pc(n,e,t,r){const s=r&&{skipPreflight:r.skipPreflight,preflightCommitment:r.preflightCommitment||r.commitment,maxRetries:r.maxRetries,minContextSlot:r.minContextSlot},i=await n.sendTransaction(e,t,s);let o;if(e.recentBlockhash!=null&&e.lastValidBlockHeight!=null)o=(await n.confirmTransaction({abortSignal:r==null?void 0:r.abortSignal,signature:i,blockhash:e.recentBlockhash,lastValidBlockHeight:e.lastValidBlockHeight},r&&r.commitment)).value;else if(e.minNonceContextSlot!=null&&e.nonceInfo!=null){const{nonceInstruction:a}=e.nonceInfo,l=a.keys[0].pubkey;o=(await n.confirmTransaction({abortSignal:r==null?void 0:r.abortSignal,minContextSlot:e.minNonceContextSlot,nonceAccountPubkey:l,nonceValue:e.nonceInfo.nonce,signature:i},r&&r.commitment)).value}else(r==null?void 0:r.abortSignal)!=null&&console.warn("sendAndConfirmTransaction(): A transaction with a deprecated confirmation strategy was supplied along with an `abortSignal`. Only transactions having `lastValidBlockHeight` or a combination of `nonceInfo` and `minNonceContextSlot` are abortable."),o=(await n.confirmTransaction(i,r&&r.commitment)).value;if(o.err)throw i!=null?new Xr({action:"send",signature:i,transactionMessage:`Status: (${JSON.stringify(o)})`}):new Error(`Transaction ${i} failed (${JSON.stringify(o)})`);return i}function cr(n){return new Promise(e=>setTimeout(e,n))}function Se(n,e){const t=n.layout.span>=0?n.layout.span:Bh(n,e),r=oe.Buffer.alloc(t),s=Object.assign({instruction:n.index},e);return n.layout.encode(s,r),r}function Ue(n,e){let t;try{t=n.layout.decode(e)}catch(r){throw new Error("invalid instruction; "+r)}if(t.instruction!==n.index)throw new Error(`invalid instruction; instruction index mismatch ${t.instruction} != ${n.index}`);return t}const Dh=It("lamportsPerSignature"),vh=exports.struct([exports.u32("version"),exports.u32("state"),Be("authorizedPubkey"),Be("nonce"),exports.struct([Dh],"feeCalculator")]),gc=vh.span;class To{constructor(e){this.authorizedPubkey=void 0,this.nonce=void 0,this.feeCalculator=void 0,this.authorizedPubkey=e.authorizedPubkey,this.nonce=e.nonce,this.feeCalculator=e.feeCalculator}static fromAccountData(e){const t=vh.decode(ge(e),0);return new To({authorizedPubkey:new Y(t.authorizedPubkey),nonce:new Y(t.nonce).toString(),feeCalculator:t.feeCalculator})}}const T3=n=>{const e=n.decode.bind(n),t=n.encode.bind(n);return{decode:e,encode:t}},I3=n=>e=>{const t=exports.blob(n,e),{encode:r,decode:s}=T3(t),i=t;return i.decode=(o,a)=>{const l=s(o,a);return lh(oe.Buffer.from(l))},i.encode=(o,a,l)=>{const h=gl(o,n);return r(h,a,l)},i},Zr=I3(8);class U3{constructor(){}static decodeInstructionType(e){this.checkProgramId(e.programId);const r=exports.u32("instruction").decode(e.data);let s;for(const[i,o]of Object.entries(ze))if(o.index==r){s=i;break}if(!s)throw new Error("Instruction type incorrect; not a SystemInstruction");return s}static decodeCreateAccount(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);const{lamports:t,space:r,programId:s}=Ue(ze.Create,e.data);return{fromPubkey:e.keys[0].pubkey,newAccountPubkey:e.keys[1].pubkey,lamports:t,space:r,programId:new Y(s)}}static decodeTransfer(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);const{lamports:t}=Ue(ze.Transfer,e.data);return{fromPubkey:e.keys[0].pubkey,toPubkey:e.keys[1].pubkey,lamports:t}}static decodeTransferWithSeed(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);const{lamports:t,seed:r,programId:s}=Ue(ze.TransferWithSeed,e.data);return{fromPubkey:e.keys[0].pubkey,basePubkey:e.keys[1].pubkey,toPubkey:e.keys[2].pubkey,lamports:t,seed:r,programId:new Y(s)}}static decodeAllocate(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,1);const{space:t}=Ue(ze.Allocate,e.data);return{accountPubkey:e.keys[0].pubkey,space:t}}static decodeAllocateWithSeed(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,1);const{base:t,seed:r,space:s,programId:i}=Ue(ze.AllocateWithSeed,e.data);return{accountPubkey:e.keys[0].pubkey,basePubkey:new Y(t),seed:r,space:s,programId:new Y(i)}}static decodeAssign(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,1);const{programId:t}=Ue(ze.Assign,e.data);return{accountPubkey:e.keys[0].pubkey,programId:new Y(t)}}static decodeAssignWithSeed(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,1);const{base:t,seed:r,programId:s}=Ue(ze.AssignWithSeed,e.data);return{accountPubkey:e.keys[0].pubkey,basePubkey:new Y(t),seed:r,programId:new Y(s)}}static decodeCreateWithSeed(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);const{base:t,seed:r,lamports:s,space:i,programId:o}=Ue(ze.CreateWithSeed,e.data);return{fromPubkey:e.keys[0].pubkey,newAccountPubkey:e.keys[1].pubkey,basePubkey:new Y(t),seed:r,lamports:s,space:i,programId:new Y(o)}}static decodeNonceInitialize(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);const{authorized:t}=Ue(ze.InitializeNonceAccount,e.data);return{noncePubkey:e.keys[0].pubkey,authorizedPubkey:new Y(t)}}static decodeNonceAdvance(e){return this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3),Ue(ze.AdvanceNonceAccount,e.data),{noncePubkey:e.keys[0].pubkey,authorizedPubkey:e.keys[2].pubkey}}static decodeNonceWithdraw(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,5);const{lamports:t}=Ue(ze.WithdrawNonceAccount,e.data);return{noncePubkey:e.keys[0].pubkey,toPubkey:e.keys[1].pubkey,authorizedPubkey:e.keys[4].pubkey,lamports:t}}static decodeNonceAuthorize(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);const{authorized:t}=Ue(ze.AuthorizeNonceAccount,e.data);return{noncePubkey:e.keys[0].pubkey,authorizedPubkey:e.keys[1].pubkey,newAuthorizedPubkey:new Y(t)}}static checkProgramId(e){if(!e.equals(Bt.programId))throw new Error("invalid instruction; programId is not SystemProgram")}static checkKeyLength(e,t){if(e.length<t)throw new Error(`invalid instruction; found ${e.length} keys, expected at least ${t}`)}}const ze=Object.freeze({Create:{index:0,layout:exports.struct([exports.u32("instruction"),exports.ns64("lamports"),exports.ns64("space"),Be("programId")])},Assign:{index:1,layout:exports.struct([exports.u32("instruction"),Be("programId")])},Transfer:{index:2,layout:exports.struct([exports.u32("instruction"),Zr("lamports")])},CreateWithSeed:{index:3,layout:exports.struct([exports.u32("instruction"),Be("base"),hr("seed"),exports.ns64("lamports"),exports.ns64("space"),Be("programId")])},AdvanceNonceAccount:{index:4,layout:exports.struct([exports.u32("instruction")])},WithdrawNonceAccount:{index:5,layout:exports.struct([exports.u32("instruction"),exports.ns64("lamports")])},InitializeNonceAccount:{index:6,layout:exports.struct([exports.u32("instruction"),Be("authorized")])},AuthorizeNonceAccount:{index:7,layout:exports.struct([exports.u32("instruction"),Be("authorized")])},Allocate:{index:8,layout:exports.struct([exports.u32("instruction"),exports.ns64("space")])},AllocateWithSeed:{index:9,layout:exports.struct([exports.u32("instruction"),Be("base"),hr("seed"),exports.ns64("space"),Be("programId")])},AssignWithSeed:{index:10,layout:exports.struct([exports.u32("instruction"),Be("base"),hr("seed"),Be("programId")])},TransferWithSeed:{index:11,layout:exports.struct([exports.u32("instruction"),Zr("lamports"),hr("seed"),Be("programId")])},UpgradeNonceAccount:{index:12,layout:exports.struct([exports.u32("instruction")])}});class Bt{constructor(){}static createAccount(e){const t=ze.Create,r=Se(t,{lamports:e.lamports,space:e.space,programId:ge(e.programId.toBuffer())});return new We({keys:[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.newAccountPubkey,isSigner:!0,isWritable:!0}],programId:this.programId,data:r})}static transfer(e){let t,r;if("basePubkey"in e){const s=ze.TransferWithSeed;t=Se(s,{lamports:BigInt(e.lamports),seed:e.seed,programId:ge(e.programId.toBuffer())}),r=[{pubkey:e.fromPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0}]}else{const s=ze.Transfer;t=Se(s,{lamports:BigInt(e.lamports)}),r=[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0}]}return new We({keys:r,programId:this.programId,data:t})}static assign(e){let t,r;if("basePubkey"in e){const s=ze.AssignWithSeed;t=Se(s,{base:ge(e.basePubkey.toBuffer()),seed:e.seed,programId:ge(e.programId.toBuffer())}),r=[{pubkey:e.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1}]}else{const s=ze.Assign;t=Se(s,{programId:ge(e.programId.toBuffer())}),r=[{pubkey:e.accountPubkey,isSigner:!0,isWritable:!0}]}return new We({keys:r,programId:this.programId,data:t})}static createAccountWithSeed(e){const t=ze.CreateWithSeed,r=Se(t,{base:ge(e.basePubkey.toBuffer()),seed:e.seed,lamports:e.lamports,space:e.space,programId:ge(e.programId.toBuffer())});let s=[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.newAccountPubkey,isSigner:!1,isWritable:!0}];return e.basePubkey.equals(e.fromPubkey)||s.push({pubkey:e.basePubkey,isSigner:!0,isWritable:!1}),new We({keys:s,programId:this.programId,data:r})}static createNonceAccount(e){const t=new Fe;"basePubkey"in e&&"seed"in e?t.add(Bt.createAccountWithSeed({fromPubkey:e.fromPubkey,newAccountPubkey:e.noncePubkey,basePubkey:e.basePubkey,seed:e.seed,lamports:e.lamports,space:gc,programId:this.programId})):t.add(Bt.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.noncePubkey,lamports:e.lamports,space:gc,programId:this.programId}));const r={noncePubkey:e.noncePubkey,authorizedPubkey:e.authorizedPubkey};return t.add(this.nonceInitialize(r)),t}static nonceInitialize(e){const t=ze.InitializeNonceAccount,r=Se(t,{authorized:ge(e.authorizedPubkey.toBuffer())}),s={keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:Fi,isSigner:!1,isWritable:!1},{pubkey:Sr,isSigner:!1,isWritable:!1}],programId:this.programId,data:r};return new We(s)}static nonceAdvance(e){const t=ze.AdvanceNonceAccount,r=Se(t),s={keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:Fi,isSigner:!1,isWritable:!1},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:r};return new We(s)}static nonceWithdraw(e){const t=ze.WithdrawNonceAccount,r=Se(t,{lamports:e.lamports});return new We({keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0},{pubkey:Fi,isSigner:!1,isWritable:!1},{pubkey:Sr,isSigner:!1,isWritable:!1},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:r})}static nonceAuthorize(e){const t=ze.AuthorizeNonceAccount,r=Se(t,{authorized:ge(e.newAuthorizedPubkey.toBuffer())});return new We({keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:r})}static allocate(e){let t,r;if("basePubkey"in e){const s=ze.AllocateWithSeed;t=Se(s,{base:ge(e.basePubkey.toBuffer()),seed:e.seed,space:e.space,programId:ge(e.programId.toBuffer())}),r=[{pubkey:e.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1}]}else{const s=ze.Allocate;t=Se(s,{space:e.space}),r=[{pubkey:e.accountPubkey,isSigner:!0,isWritable:!0}]}return new We({keys:r,programId:this.programId,data:t})}}Bt.programId=new Y("11111111111111111111111111111111");const _3=er-300;class Dr{constructor(){}static getMinNumSignatures(e){return 2*(Math.ceil(e/Dr.chunkSize)+1+1)}static async load(e,t,r,s,i){{const E=await e.getMinimumBalanceForRentExemption(i.length),S=await e.getAccountInfo(r.publicKey,"confirmed");let A=null;if(S!==null){if(S.executable)return console.error("Program load failed, account is already executable"),!1;S.data.length!==i.length&&(A=A||new Fe,A.add(Bt.allocate({accountPubkey:r.publicKey,space:i.length}))),S.owner.equals(s)||(A=A||new Fe,A.add(Bt.assign({accountPubkey:r.publicKey,programId:s}))),S.lamports<E&&(A=A||new Fe,A.add(Bt.transfer({fromPubkey:t.publicKey,toPubkey:r.publicKey,lamports:E-S.lamports})))}else A=new Fe().add(Bt.createAccount({fromPubkey:t.publicKey,newAccountPubkey:r.publicKey,lamports:E>0?E:1,space:i.length,programId:s}));A!==null&&await pc(e,A,[t,r],{commitment:"confirmed"})}const o=exports.struct([exports.u32("instruction"),exports.u32("offset"),exports.u32("bytesLength"),exports.u32("bytesLengthPadding"),exports.seq(exports.u8("byte"),Qn(exports.u32(),-8),"bytes")]),a=Dr.chunkSize;let l=0,h=i,m=[];for(;h.length>0;){const E=h.slice(0,a),S=oe.Buffer.alloc(a+16);o.encode({instruction:0,offset:l,bytes:E,bytesLength:0,bytesLengthPadding:0},S);const A=new Fe().add({keys:[{pubkey:r.publicKey,isSigner:!0,isWritable:!0}],programId:s,data:S});m.push(pc(e,A,[t,r],{commitment:"confirmed"})),e._rpcEndpoint.includes("solana.com")&&await cr(1e3/4),l+=a,h=h.slice(a)}await Promise.all(m);{const E=exports.struct([exports.u32("instruction")]),S=oe.Buffer.alloc(E.span);E.encode({instruction:1},S);const A=new Fe().add({keys:[{pubkey:r.publicKey,isSigner:!0,isWritable:!0},{pubkey:Sr,isSigner:!1,isWritable:!1}],programId:s,data:S}),g="processed",D=await e.sendTransaction(A,[t,r],{preflightCommitment:g}),{context:x,value:U}=await e.confirmTransaction({signature:D,lastValidBlockHeight:A.lastValidBlockHeight,blockhash:A.recentBlockhash},g);if(U.err)throw new Error(`Transaction ${D} failed (${JSON.stringify(U)})`);for(;;){try{if(await e.getSlot({commitment:g})>x.slot)break}catch{}await new Promise(R=>setTimeout(R,Math.round(Ch/2)))}}return!0}}Dr.chunkSize=_3;const M3=new Y("BPFLoader2111111111111111111111111111111111");class R3{static getMinNumSignatures(e){return Dr.getMinNumSignatures(e)}static load(e,t,r,s,i){return Dr.load(e,t,r,i,s)}}function W3(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Sa,tu;function P3(){if(tu)return Sa;tu=1;var n=Object.prototype.toString,e=Object.keys||function(r){var s=[];for(var i in r)s.push(i);return s};function t(r,s){var i,o,a,l,h,m,E;if(r===!0)return"true";if(r===!1)return"false";switch(typeof r){case"object":if(r===null)return null;if(r.toJSON&&typeof r.toJSON=="function")return t(r.toJSON(),s);if(E=n.call(r),E==="[object Array]"){for(a="[",o=r.length-1,i=0;i<o;i++)a+=t(r[i],!0)+",";return o>-1&&(a+=t(r[i],!0)),a+"]"}else if(E==="[object Object]"){for(l=e(r).sort(),o=l.length,a="",i=0;i<o;)h=l[i],m=t(r[h],!1),m!==void 0&&(a&&(a+=","),a+=JSON.stringify(h)+":"+m),i++;return"{"+a+"}"}else return JSON.stringify(r);case"function":case"undefined":return s?null:void 0;case"string":return JSON.stringify(r);default:return isFinite(r)?r:null}}return Sa=function(r){var s=t(r,!1);if(s!==void 0)return""+s},Sa}var L3=P3(),nu=W3(L3);const ws=32;function Da(n){let e=0;for(;n>1;)n/=2,e++;return e}function O3(n){return n===0?1:(n--,n|=n>>1,n|=n>>2,n|=n>>4,n|=n>>8,n|=n>>16,n|=n>>32,n+1)}class kh{constructor(e,t,r,s,i){this.slotsPerEpoch=void 0,this.leaderScheduleSlotOffset=void 0,this.warmup=void 0,this.firstNormalEpoch=void 0,this.firstNormalSlot=void 0,this.slotsPerEpoch=e,this.leaderScheduleSlotOffset=t,this.warmup=r,this.firstNormalEpoch=s,this.firstNormalSlot=i}getEpoch(e){return this.getEpochAndSlotIndex(e)[0]}getEpochAndSlotIndex(e){if(e<this.firstNormalSlot){const t=Da(O3(e+ws+1))-Da(ws)-1,r=this.getSlotsInEpoch(t),s=e-(r-ws);return[t,s]}else{const t=e-this.firstNormalSlot,r=Math.floor(t/this.slotsPerEpoch),s=this.firstNormalEpoch+r,i=t%this.slotsPerEpoch;return[s,i]}}getFirstSlotInEpoch(e){return e<=this.firstNormalEpoch?(Math.pow(2,e)-1)*ws:(e-this.firstNormalEpoch)*this.slotsPerEpoch+this.firstNormalSlot}getLastSlotInEpoch(e){return this.getFirstSlotInEpoch(e)+this.getSlotsInEpoch(e)-1}getSlotsInEpoch(e){return e<this.firstNormalEpoch?Math.pow(2,e+Da(ws)):this.slotsPerEpoch}}var N3=globalThis.fetch;class z3 extends l3{constructor(e,t,r){const s=i=>{const o=a3(i,{autoconnect:!0,max_reconnects:5,reconnect:!0,reconnect_interval:1e3,...t});return"socket"in o?this.underlyingSocket=o.socket:this.underlyingSocket=o,o};super(s,e,t,r),this.underlyingSocket=void 0}call(...e){var r;const t=(r=this.underlyingSocket)==null?void 0:r.readyState;return t===1?super.call(...e):Promise.reject(new Error("Tried to call a JSON-RPC method `"+e[0]+"` but the socket was not `CONNECTING` or `OPEN` (`readyState` was "+t+")"))}notify(...e){var r;const t=(r=this.underlyingSocket)==null?void 0:r.readyState;return t===1?super.notify(...e):Promise.reject(new Error("Tried to send a JSON-RPC notification `"+e[0]+"` but the socket was not `CONNECTING` or `OPEN` (`readyState` was "+t+")"))}}function H3(n,e){let t;try{t=n.layout.decode(e)}catch(r){throw new Error("invalid instruction; "+r)}if(t.typeIndex!==n.index)throw new Error(`invalid account data; account type mismatch ${t.typeIndex} != ${n.index}`);return t}const ru=56;class Vi{constructor(e){this.key=void 0,this.state=void 0,this.key=e.key,this.state=e.state}isActive(){const e=BigInt("0xffffffffffffffff");return this.state.deactivationSlot===e}static deserialize(e){const t=H3(q3,e),r=e.length-ru;Te(r>=0,"lookup table is invalid"),Te(r%32===0,"lookup table is invalid");const s=r/32,{addresses:i}=exports.struct([exports.seq(Be(),s,"addresses")]).decode(e.slice(ru));return{deactivationSlot:t.deactivationSlot,lastExtendedSlot:t.lastExtendedSlot,lastExtendedSlotStartIndex:t.lastExtendedStartIndex,authority:t.authority.length!==0?new Y(t.authority[0]):void 0,addresses:i.map(o=>new Y(o))}}}const q3={index:1,layout:exports.struct([exports.u32("typeIndex"),Zr("deactivationSlot"),It("lastExtendedSlot"),exports.u8("lastExtendedStartIndex"),exports.u8(),exports.seq(Be(),Qn(exports.u8(),-1),"authority")])},K3=/^[^:]+:\/\/([^:[]+|\[[^\]]+\])(:\d+)?(.*)/i;function j3(n){const e=n.match(K3);if(e==null)throw TypeError(`Failed to validate endpoint URL \`${n}\``);const[t,r,s,i]=e,o=n.startsWith("https:")?"wss:":"ws:",a=s==null?null:parseInt(s.slice(1),10),l=a==null?"":`:${a+1}`;return`${o}//${r}${l}${i}`}const Xe=ri(wl(Y),X(),n=>new Y(n)),Fh=Al([X(),Ge("base64")]),Dl=ri(wl(oe.Buffer),Fh,n=>oe.Buffer.from(n[0],"base64")),Th=30*1e3;function $3(n){if(/^https?:/.test(n)===!1)throw new TypeError("Endpoint URL must start with `http:` or `https:`.");return n}function Ne(n){let e,t;if(typeof n=="string")e=n;else if(n){const{commitment:r,...s}=n;e=r,t=s}return{commitment:e,config:t}}function su(n){return n.map(e=>"memcmp"in e?{...e,memcmp:{...e.memcmp,encoding:e.memcmp.encoding??"base58"}}:e)}function Ih(n){return Kt([j({jsonrpc:Ge("2.0"),id:X(),result:n}),j({jsonrpc:Ge("2.0"),id:X(),error:j({code:fs(),message:X(),data:ce(U8())})})])}const V3=Ih(fs());function pe(n){return ri(Ih(n),V3,e=>"error"in e?e:{...e,result:J(e.result,n)})}function Qe(n){return pe(j({context:j({slot:L()}),value:n}))}function Io(n){return j({context:j({slot:L()}),value:n})}function va(n,e){return n===0?new nr({header:e.header,staticAccountKeys:e.accountKeys.map(t=>new Y(t)),recentBlockhash:e.recentBlockhash,compiledInstructions:e.instructions.map(t=>({programIdIndex:t.programIdIndex,accountKeyIndexes:t.accounts,data:vt.decode(t.data)})),addressTableLookups:e.addressTableLookups}):new cn(e)}const G3=j({foundation:L(),foundationTerm:L(),initial:L(),taper:L(),terminal:L()}),Y3=pe(Q(te(j({epoch:L(),effectiveSlot:L(),amount:L(),postBalance:L(),commission:ce(te(L()))})))),X3=Q(j({slot:L(),prioritizationFee:L()})),Z3=j({total:L(),validator:L(),foundation:L(),epoch:L()}),J3=j({epoch:L(),slotIndex:L(),slotsInEpoch:L(),absoluteSlot:L(),blockHeight:ce(L()),transactionCount:ce(L())}),Q3=j({slotsPerEpoch:L(),leaderScheduleSlotOffset:L(),warmup:kn(),firstNormalEpoch:L(),firstNormalSlot:L()}),e4=fh(X(),Q(L())),Ur=te(Kt([j({}),X()])),t4=j({err:Ur}),n4=Ge("receivedSignature"),r4=j({"solana-core":X(),"feature-set":ce(L())}),s4=j({program:X(),programId:Xe,parsed:fs()}),i4=j({programId:Xe,accounts:Q(Xe),data:X()}),iu=Qe(j({err:te(Kt([j({}),X()])),logs:te(Q(X())),accounts:ce(te(Q(te(j({executable:kn(),owner:X(),lamports:L(),data:Q(X()),rentEpoch:ce(L())}))))),unitsConsumed:ce(L()),returnData:ce(te(j({programId:X(),data:Al([X(),Ge("base64")])}))),innerInstructions:ce(te(Q(j({index:L(),instructions:Q(Kt([s4,i4]))}))))})),o4=Qe(j({byIdentity:fh(X(),Q(L())),range:j({firstSlot:L(),lastSlot:L()})}));function a4(n,e,t,r,s,i){const o=t||N3;let a;i!=null&&console.warn("You have supplied an `httpAgent` when creating a `Connection` in a browser environment.It has been ignored; `httpAgent` is only used in Node environments.");let l;return r&&(l=async(m,E)=>{const S=await new Promise((A,g)=>{try{r(m,E,(D,x)=>A([D,x]))}catch(D){g(D)}});return await o(...S)}),new yh(async(m,E)=>{const S={method:"POST",body:m,agent:a,headers:Object.assign({"Content-Type":"application/json"},e||{},a6)};try{let A=5,g,D=500;for(;l?g=await l(n,S):g=await o(n,S),!(g.status!==429||s===!0||(A-=1,A===0));)console.error(`Server responded with ${g.status} ${g.statusText}. Retrying after ${D}ms delay...`),await cr(D),D*=2;const x=await g.text();g.ok?E(null,x):E(new Error(`${g.status} ${g.statusText}: ${x}`))}catch(A){A instanceof Error&&E(A)}},{})}function c4(n){return(e,t)=>new Promise((r,s)=>{n.request(e,t,(i,o)=>{if(i){s(i);return}r(o)})})}function l4(n){return e=>new Promise((t,r)=>{e.length===0&&t([]);const s=e.map(i=>n.request(i.methodName,i.args));n.request(s,(i,o)=>{if(i){r(i);return}t(o)})})}const d4=pe(G3),u4=pe(Z3),f4=pe(X3),h4=pe(J3),m4=pe(Q3),b4=pe(e4),p4=pe(L()),g4=Qe(j({total:L(),circulating:L(),nonCirculating:L(),nonCirculatingAccounts:Q(Xe)})),yc=j({amount:X(),uiAmount:te(L()),decimals:L(),uiAmountString:ce(X())}),y4=Qe(Q(j({address:Xe,amount:X(),uiAmount:te(L()),decimals:L(),uiAmountString:ce(X())}))),w4=Qe(Q(j({pubkey:Xe,account:j({executable:kn(),owner:Xe,lamports:L(),data:Dl,rentEpoch:L()})}))),wc=j({program:X(),parsed:fs(),space:L()}),A4=Qe(Q(j({pubkey:Xe,account:j({executable:kn(),owner:Xe,lamports:L(),data:wc,rentEpoch:L()})}))),E4=Qe(Q(j({lamports:L(),address:Xe}))),js=j({executable:kn(),owner:Xe,lamports:L(),data:Dl,rentEpoch:L()}),B4=j({pubkey:Xe,account:js}),x4=ri(Kt([wl(oe.Buffer),wc]),Kt([Fh,wc]),n=>Array.isArray(n)?J(n,Dl):n),Ac=j({executable:kn(),owner:Xe,lamports:L(),data:x4,rentEpoch:L()}),C4=j({pubkey:Xe,account:Ac}),S4=j({state:Kt([Ge("active"),Ge("inactive"),Ge("activating"),Ge("deactivating")]),active:L(),inactive:L()}),D4=pe(Q(j({signature:X(),slot:L(),err:Ur,memo:te(X()),blockTime:ce(te(L()))}))),v4=pe(Q(j({signature:X(),slot:L(),err:Ur,memo:te(X()),blockTime:ce(te(L()))}))),k4=j({subscription:L(),result:Io(js)}),F4=j({pubkey:Xe,account:js}),T4=j({subscription:L(),result:Io(F4)}),I4=j({parent:L(),slot:L(),root:L()}),U4=j({subscription:L(),result:I4}),_4=Kt([j({type:Kt([Ge("firstShredReceived"),Ge("completed"),Ge("optimisticConfirmation"),Ge("root")]),slot:L(),timestamp:L()}),j({type:Ge("createdBank"),parent:L(),slot:L(),timestamp:L()}),j({type:Ge("frozen"),slot:L(),timestamp:L(),stats:j({numTransactionEntries:L(),numSuccessfulTransactions:L(),numFailedTransactions:L(),maxTransactionsPerEntry:L()})}),j({type:Ge("dead"),slot:L(),timestamp:L(),err:X()})]),M4=j({subscription:L(),result:_4}),R4=j({subscription:L(),result:Io(Kt([t4,n4]))}),W4=j({subscription:L(),result:L()}),P4=j({pubkey:X(),gossip:te(X()),tpu:te(X()),rpc:te(X()),version:te(X())}),ou=j({votePubkey:X(),nodePubkey:X(),activatedStake:L(),epochVoteAccount:kn(),epochCredits:Q(Al([L(),L(),L()])),commission:L(),lastVote:L(),rootSlot:te(L())}),L4=pe(j({current:Q(ou),delinquent:Q(ou)})),O4=Kt([Ge("processed"),Ge("confirmed"),Ge("finalized")]),N4=j({slot:L(),confirmations:te(L()),err:Ur,confirmationStatus:ce(O4)}),z4=Qe(Q(te(N4))),H4=pe(L()),Uh=j({accountKey:Xe,writableIndexes:Q(L()),readonlyIndexes:Q(L())}),vl=j({signatures:Q(X()),message:j({accountKeys:Q(X()),header:j({numRequiredSignatures:L(),numReadonlySignedAccounts:L(),numReadonlyUnsignedAccounts:L()}),instructions:Q(j({accounts:Q(L()),data:X(),programIdIndex:L()})),recentBlockhash:X(),addressTableLookups:ce(Q(Uh))})}),_h=j({pubkey:Xe,signer:kn(),writable:kn(),source:ce(Kt([Ge("transaction"),Ge("lookupTable")]))}),Mh=j({accountKeys:Q(_h),signatures:Q(X())}),Rh=j({parsed:fs(),program:X(),programId:Xe}),Wh=j({accounts:Q(Xe),data:X(),programId:Xe}),q4=Kt([Wh,Rh]),K4=Kt([j({parsed:fs(),program:X(),programId:X()}),j({accounts:Q(X()),data:X(),programId:X()})]),Ph=ri(q4,K4,n=>"accounts"in n?J(n,Wh):J(n,Rh)),Lh=j({signatures:Q(X()),message:j({accountKeys:Q(_h),instructions:Q(Ph),recentBlockhash:X(),addressTableLookups:ce(te(Q(Uh)))})}),Gi=j({accountIndex:L(),mint:X(),owner:ce(X()),programId:ce(X()),uiTokenAmount:yc}),Oh=j({writable:Q(Xe),readonly:Q(Xe)}),Uo=j({err:Ur,fee:L(),innerInstructions:ce(te(Q(j({index:L(),instructions:Q(j({accounts:Q(L()),data:X(),programIdIndex:L()}))})))),preBalances:Q(L()),postBalances:Q(L()),logMessages:ce(te(Q(X()))),preTokenBalances:ce(te(Q(Gi))),postTokenBalances:ce(te(Q(Gi))),loadedAddresses:ce(Oh),computeUnitsConsumed:ce(L())}),kl=j({err:Ur,fee:L(),innerInstructions:ce(te(Q(j({index:L(),instructions:Q(Ph)})))),preBalances:Q(L()),postBalances:Q(L()),logMessages:ce(te(Q(X()))),preTokenBalances:ce(te(Q(Gi))),postTokenBalances:ce(te(Q(Gi))),loadedAddresses:ce(Oh),computeUnitsConsumed:ce(L())}),hs=Kt([Ge(0),Ge("legacy")]),_r=j({pubkey:X(),lamports:L(),postBalance:te(L()),rewardType:te(X()),commission:ce(te(L()))}),j4=pe(te(j({blockhash:X(),previousBlockhash:X(),parentSlot:L(),transactions:Q(j({transaction:vl,meta:te(Uo),version:ce(hs)})),rewards:ce(Q(_r)),blockTime:te(L()),blockHeight:te(L())}))),$4=pe(te(j({blockhash:X(),previousBlockhash:X(),parentSlot:L(),rewards:ce(Q(_r)),blockTime:te(L()),blockHeight:te(L())}))),V4=pe(te(j({blockhash:X(),previousBlockhash:X(),parentSlot:L(),transactions:Q(j({transaction:Mh,meta:te(Uo),version:ce(hs)})),rewards:ce(Q(_r)),blockTime:te(L()),blockHeight:te(L())}))),G4=pe(te(j({blockhash:X(),previousBlockhash:X(),parentSlot:L(),transactions:Q(j({transaction:Lh,meta:te(kl),version:ce(hs)})),rewards:ce(Q(_r)),blockTime:te(L()),blockHeight:te(L())}))),Y4=pe(te(j({blockhash:X(),previousBlockhash:X(),parentSlot:L(),transactions:Q(j({transaction:Mh,meta:te(kl),version:ce(hs)})),rewards:ce(Q(_r)),blockTime:te(L()),blockHeight:te(L())}))),X4=pe(te(j({blockhash:X(),previousBlockhash:X(),parentSlot:L(),rewards:ce(Q(_r)),blockTime:te(L()),blockHeight:te(L())}))),Z4=pe(te(j({blockhash:X(),previousBlockhash:X(),parentSlot:L(),transactions:Q(j({transaction:vl,meta:te(Uo)})),rewards:ce(Q(_r)),blockTime:te(L())}))),au=pe(te(j({blockhash:X(),previousBlockhash:X(),parentSlot:L(),signatures:Q(X()),blockTime:te(L())}))),ka=pe(te(j({slot:L(),meta:te(Uo),blockTime:ce(te(L())),transaction:vl,version:ce(hs)}))),hi=pe(te(j({slot:L(),transaction:Lh,meta:te(kl),blockTime:ce(te(L())),version:ce(hs)}))),J4=Qe(j({blockhash:X(),lastValidBlockHeight:L()})),Q4=Qe(kn()),e6=j({slot:L(),numTransactions:L(),numSlots:L(),samplePeriodSecs:L()}),t6=pe(Q(e6)),n6=Qe(te(j({feeCalculator:j({lamportsPerSignature:L()})}))),r6=pe(X()),s6=pe(X()),i6=j({err:Ur,logs:Q(X()),signature:X()}),o6=j({result:Io(i6),subscription:L()}),a6={"solana-client":"js/1.0.0-maintenance"};class Nh{constructor(e,t){this._commitment=void 0,this._confirmTransactionInitialTimeout=void 0,this._rpcEndpoint=void 0,this._rpcWsEndpoint=void 0,this._rpcClient=void 0,this._rpcRequest=void 0,this._rpcBatchRequest=void 0,this._rpcWebSocket=void 0,this._rpcWebSocketConnected=!1,this._rpcWebSocketHeartbeat=null,this._rpcWebSocketIdleTimeout=null,this._rpcWebSocketGeneration=0,this._disableBlockhashCaching=!1,this._pollingBlockhash=!1,this._blockhashInfo={latestBlockhash:null,lastFetch:0,transactionSignatures:[],simulatedSignatures:[]},this._nextClientSubscriptionId=0,this._subscriptionDisposeFunctionsByClientSubscriptionId={},this._subscriptionHashByClientSubscriptionId={},this._subscriptionStateChangeCallbacksByHash={},this._subscriptionCallbacksByServerSubscriptionId={},this._subscriptionsByHash={},this._subscriptionsAutoDisposedByRpc=new Set,this.getBlockHeight=(()=>{const h={};return async m=>{const{commitment:E,config:S}=Ne(m),A=this._buildArgs([],E,void 0,S),g=nu(A);return h[g]=h[g]??(async()=>{try{const D=await this._rpcRequest("getBlockHeight",A),x=J(D,pe(L()));if("error"in x)throw new se(x.error,"failed to get block height information");return x.result}finally{delete h[g]}})(),await h[g]}})();let r,s,i,o,a,l;t&&typeof t=="string"?this._commitment=t:t&&(this._commitment=t.commitment,this._confirmTransactionInitialTimeout=t.confirmTransactionInitialTimeout,r=t.wsEndpoint,s=t.httpHeaders,i=t.fetch,o=t.fetchMiddleware,a=t.disableRetryOnRateLimit,l=t.httpAgent),this._rpcEndpoint=$3(e),this._rpcWsEndpoint=r||j3(e),this._rpcClient=a4(e,s,i,o,a,l),this._rpcRequest=c4(this._rpcClient),this._rpcBatchRequest=l4(this._rpcClient),this._rpcWebSocket=new z3(this._rpcWsEndpoint,{autoconnect:!1,max_reconnects:1/0}),this._rpcWebSocket.on("open",this._wsOnOpen.bind(this)),this._rpcWebSocket.on("error",this._wsOnError.bind(this)),this._rpcWebSocket.on("close",this._wsOnClose.bind(this)),this._rpcWebSocket.on("accountNotification",this._wsOnAccountNotification.bind(this)),this._rpcWebSocket.on("programNotification",this._wsOnProgramAccountNotification.bind(this)),this._rpcWebSocket.on("slotNotification",this._wsOnSlotNotification.bind(this)),this._rpcWebSocket.on("slotsUpdatesNotification",this._wsOnSlotUpdatesNotification.bind(this)),this._rpcWebSocket.on("signatureNotification",this._wsOnSignatureNotification.bind(this)),this._rpcWebSocket.on("rootNotification",this._wsOnRootNotification.bind(this)),this._rpcWebSocket.on("logsNotification",this._wsOnLogsNotification.bind(this))}get commitment(){return this._commitment}get rpcEndpoint(){return this._rpcEndpoint}async getBalanceAndContext(e,t){const{commitment:r,config:s}=Ne(t),i=this._buildArgs([e.toBase58()],r,void 0,s),o=await this._rpcRequest("getBalance",i),a=J(o,Qe(L()));if("error"in a)throw new se(a.error,`failed to get balance for ${e.toBase58()}`);return a.result}async getBalance(e,t){return await this.getBalanceAndContext(e,t).then(r=>r.value).catch(r=>{throw new Error("failed to get balance of account "+e.toBase58()+": "+r)})}async getBlockTime(e){const t=await this._rpcRequest("getBlockTime",[e]),r=J(t,pe(te(L())));if("error"in r)throw new se(r.error,`failed to get block time for slot ${e}`);return r.result}async getMinimumLedgerSlot(){const e=await this._rpcRequest("minimumLedgerSlot",[]),t=J(e,pe(L()));if("error"in t)throw new se(t.error,"failed to get minimum ledger slot");return t.result}async getFirstAvailableBlock(){const e=await this._rpcRequest("getFirstAvailableBlock",[]),t=J(e,p4);if("error"in t)throw new se(t.error,"failed to get first available block");return t.result}async getSupply(e){let t={};typeof e=="string"?t={commitment:e}:e?t={...e,commitment:e&&e.commitment||this.commitment}:t={commitment:this.commitment};const r=await this._rpcRequest("getSupply",[t]),s=J(r,g4);if("error"in s)throw new se(s.error,"failed to get supply");return s.result}async getTokenSupply(e,t){const r=this._buildArgs([e.toBase58()],t),s=await this._rpcRequest("getTokenSupply",r),i=J(s,Qe(yc));if("error"in i)throw new se(i.error,"failed to get token supply");return i.result}async getTokenAccountBalance(e,t){const r=this._buildArgs([e.toBase58()],t),s=await this._rpcRequest("getTokenAccountBalance",r),i=J(s,Qe(yc));if("error"in i)throw new se(i.error,"failed to get token account balance");return i.result}async getTokenAccountsByOwner(e,t,r){const{commitment:s,config:i}=Ne(r);let o=[e.toBase58()];"mint"in t?o.push({mint:t.mint.toBase58()}):o.push({programId:t.programId.toBase58()});const a=this._buildArgs(o,s,"base64",i),l=await this._rpcRequest("getTokenAccountsByOwner",a),h=J(l,w4);if("error"in h)throw new se(h.error,`failed to get token accounts owned by account ${e.toBase58()}`);return h.result}async getParsedTokenAccountsByOwner(e,t,r){let s=[e.toBase58()];"mint"in t?s.push({mint:t.mint.toBase58()}):s.push({programId:t.programId.toBase58()});const i=this._buildArgs(s,r,"jsonParsed"),o=await this._rpcRequest("getTokenAccountsByOwner",i),a=J(o,A4);if("error"in a)throw new se(a.error,`failed to get token accounts owned by account ${e.toBase58()}`);return a.result}async getLargestAccounts(e){const t={...e,commitment:e&&e.commitment||this.commitment},r=t.filter||t.commitment?[t]:[],s=await this._rpcRequest("getLargestAccounts",r),i=J(s,E4);if("error"in i)throw new se(i.error,"failed to get largest accounts");return i.result}async getTokenLargestAccounts(e,t){const r=this._buildArgs([e.toBase58()],t),s=await this._rpcRequest("getTokenLargestAccounts",r),i=J(s,y4);if("error"in i)throw new se(i.error,"failed to get token largest accounts");return i.result}async getAccountInfoAndContext(e,t){const{commitment:r,config:s}=Ne(t),i=this._buildArgs([e.toBase58()],r,"base64",s),o=await this._rpcRequest("getAccountInfo",i),a=J(o,Qe(te(js)));if("error"in a)throw new se(a.error,`failed to get info about account ${e.toBase58()}`);return a.result}async getParsedAccountInfo(e,t){const{commitment:r,config:s}=Ne(t),i=this._buildArgs([e.toBase58()],r,"jsonParsed",s),o=await this._rpcRequest("getAccountInfo",i),a=J(o,Qe(te(Ac)));if("error"in a)throw new se(a.error,`failed to get info about account ${e.toBase58()}`);return a.result}async getAccountInfo(e,t){try{return(await this.getAccountInfoAndContext(e,t)).value}catch(r){throw new Error("failed to get info about account "+e.toBase58()+": "+r)}}async getMultipleParsedAccounts(e,t){const{commitment:r,config:s}=Ne(t),i=e.map(h=>h.toBase58()),o=this._buildArgs([i],r,"jsonParsed",s),a=await this._rpcRequest("getMultipleAccounts",o),l=J(a,Qe(Q(te(Ac))));if("error"in l)throw new se(l.error,`failed to get info for accounts ${i}`);return l.result}async getMultipleAccountsInfoAndContext(e,t){const{commitment:r,config:s}=Ne(t),i=e.map(h=>h.toBase58()),o=this._buildArgs([i],r,"base64",s),a=await this._rpcRequest("getMultipleAccounts",o),l=J(a,Qe(Q(te(js))));if("error"in l)throw new se(l.error,`failed to get info for accounts ${i}`);return l.result}async getMultipleAccountsInfo(e,t){return(await this.getMultipleAccountsInfoAndContext(e,t)).value}async getStakeActivation(e,t,r){const{commitment:s,config:i}=Ne(t),o=this._buildArgs([e.toBase58()],s,void 0,{...i,epoch:r??(i==null?void 0:i.epoch)}),a=await this._rpcRequest("getStakeActivation",o),l=J(a,pe(S4));if("error"in l)throw new se(l.error,`failed to get Stake Activation ${e.toBase58()}`);return l.result}async getProgramAccounts(e,t){const{commitment:r,config:s}=Ne(t),{encoding:i,...o}=s||{},a=this._buildArgs([e.toBase58()],r,i||"base64",{...o,...o.filters?{filters:su(o.filters)}:null}),l=await this._rpcRequest("getProgramAccounts",a),h=Q(B4),m=o.withContext===!0?J(l,Qe(h)):J(l,pe(h));if("error"in m)throw new se(m.error,`failed to get accounts owned by program ${e.toBase58()}`);return m.result}async getParsedProgramAccounts(e,t){const{commitment:r,config:s}=Ne(t),i=this._buildArgs([e.toBase58()],r,"jsonParsed",s),o=await this._rpcRequest("getProgramAccounts",i),a=J(o,pe(Q(C4)));if("error"in a)throw new se(a.error,`failed to get accounts owned by program ${e.toBase58()}`);return a.result}async confirmTransaction(e,t){var i;let r;if(typeof e=="string")r=e;else{const o=e;if((i=o.abortSignal)!=null&&i.aborted)return Promise.reject(o.abortSignal.reason);r=o.signature}let s;try{s=vt.decode(r)}catch{throw new Error("signature must be base58 encoded: "+r)}return Te(s.length===64,"signature has invalid length"),typeof e=="string"?await this.confirmTransactionUsingLegacyTimeoutStrategy({commitment:t||this.commitment,signature:r}):"lastValidBlockHeight"in e?await this.confirmTransactionUsingBlockHeightExceedanceStrategy({commitment:t||this.commitment,strategy:e}):await this.confirmTransactionUsingDurableNonceStrategy({commitment:t||this.commitment,strategy:e})}getCancellationPromise(e){return new Promise((t,r)=>{e!=null&&(e.aborted?r(e.reason):e.addEventListener("abort",()=>{r(e.reason)}))})}getTransactionConfirmationPromise({commitment:e,signature:t}){let r,s,i=!1;const o=new Promise((l,h)=>{try{r=this.onSignature(t,(E,S)=>{r=void 0;const A={context:S,value:E};l({__type:Rn.PROCESSED,response:A})},e);const m=new Promise(E=>{r==null?E():s=this._onSubscriptionStateChange(r,S=>{S==="subscribed"&&E()})});(async()=>{if(await m,i)return;const E=await this.getSignatureStatus(t);if(i||E==null)return;const{context:S,value:A}=E;if(A!=null)if(A!=null&&A.err)h(A.err);else{switch(e){case"confirmed":case"single":case"singleGossip":{if(A.confirmationStatus==="processed")return;break}case"finalized":case"max":case"root":{if(A.confirmationStatus==="processed"||A.confirmationStatus==="confirmed")return;break}case"processed":case"recent":}i=!0,l({__type:Rn.PROCESSED,response:{context:S,value:A}})}})()}catch(m){h(m)}});return{abortConfirmation:()=>{s&&(s(),s=void 0),r!=null&&(this.removeSignatureListener(r),r=void 0)},confirmationPromise:o}}async confirmTransactionUsingBlockHeightExceedanceStrategy({commitment:e,strategy:{abortSignal:t,lastValidBlockHeight:r,signature:s}}){let i=!1;const o=new Promise(E=>{const S=async()=>{try{return await this.getBlockHeight(e)}catch{return-1}};(async()=>{let A=await S();if(!i){for(;A<=r;)if(await cr(1e3),i||(A=await S(),i))return;E({__type:Rn.BLOCKHEIGHT_EXCEEDED})}})()}),{abortConfirmation:a,confirmationPromise:l}=this.getTransactionConfirmationPromise({commitment:e,signature:s}),h=this.getCancellationPromise(t);let m;try{const E=await Promise.race([h,l,o]);if(E.__type===Rn.PROCESSED)m=E.response;else throw new Do(s)}finally{i=!0,a()}return m}async confirmTransactionUsingDurableNonceStrategy({commitment:e,strategy:{abortSignal:t,minContextSlot:r,nonceAccountPubkey:s,nonceValue:i,signature:o}}){let a=!1;const l=new Promise(A=>{let g=i,D=null;const x=async()=>{try{const{context:U,value:R}=await this.getNonceAndContext(s,{commitment:e,minContextSlot:r});return D=U.slot,R==null?void 0:R.nonce}catch{return g}};(async()=>{if(g=await x(),!a)for(;;){if(i!==g){A({__type:Rn.NONCE_INVALID,slotInWhichNonceDidAdvance:D});return}if(await cr(2e3),a||(g=await x(),a))return}})()}),{abortConfirmation:h,confirmationPromise:m}=this.getTransactionConfirmationPromise({commitment:e,signature:o}),E=this.getCancellationPromise(t);let S;try{const A=await Promise.race([E,m,l]);if(A.__type===Rn.PROCESSED)S=A.response;else{let g;for(;;){const D=await this.getSignatureStatus(o);if(D==null)break;if(D.context.slot<(A.slotInWhichNonceDidAdvance??r)){await cr(400);continue}g=D;break}if(g!=null&&g.value){const D=e||"finalized",{confirmationStatus:x}=g.value;switch(D){case"processed":case"recent":if(x!=="processed"&&x!=="confirmed"&&x!=="finalized")throw new zr(o);break;case"confirmed":case"single":case"singleGossip":if(x!=="confirmed"&&x!=="finalized")throw new zr(o);break;case"finalized":case"max":case"root":if(x!=="finalized")throw new zr(o);break;default:}S={context:g.context,value:{err:g.value.err}}}else throw new zr(o)}}finally{a=!0,h()}return S}async confirmTransactionUsingLegacyTimeoutStrategy({commitment:e,signature:t}){let r;const s=new Promise(l=>{let h=this._confirmTransactionInitialTimeout||6e4;switch(e){case"processed":case"recent":case"single":case"confirmed":case"singleGossip":{h=this._confirmTransactionInitialTimeout||3e4;break}}r=setTimeout(()=>l({__type:Rn.TIMED_OUT,timeoutMs:h}),h)}),{abortConfirmation:i,confirmationPromise:o}=this.getTransactionConfirmationPromise({commitment:e,signature:t});let a;try{const l=await Promise.race([o,s]);if(l.__type===Rn.PROCESSED)a=l.response;else throw new Cl(t,l.timeoutMs/1e3)}finally{clearTimeout(r),i()}return a}async getClusterNodes(){const e=await this._rpcRequest("getClusterNodes",[]),t=J(e,pe(Q(P4)));if("error"in t)throw new se(t.error,"failed to get cluster nodes");return t.result}async getVoteAccounts(e){const t=this._buildArgs([],e),r=await this._rpcRequest("getVoteAccounts",t),s=J(r,L4);if("error"in s)throw new se(s.error,"failed to get vote accounts");return s.result}async getSlot(e){const{commitment:t,config:r}=Ne(e),s=this._buildArgs([],t,void 0,r),i=await this._rpcRequest("getSlot",s),o=J(i,pe(L()));if("error"in o)throw new se(o.error,"failed to get slot");return o.result}async getSlotLeader(e){const{commitment:t,config:r}=Ne(e),s=this._buildArgs([],t,void 0,r),i=await this._rpcRequest("getSlotLeader",s),o=J(i,pe(X()));if("error"in o)throw new se(o.error,"failed to get slot leader");return o.result}async getSlotLeaders(e,t){const r=[e,t],s=await this._rpcRequest("getSlotLeaders",r),i=J(s,pe(Q(Xe)));if("error"in i)throw new se(i.error,"failed to get slot leaders");return i.result}async getSignatureStatus(e,t){const{context:r,value:s}=await this.getSignatureStatuses([e],t);Te(s.length===1);const i=s[0];return{context:r,value:i}}async getSignatureStatuses(e,t){const r=[e];t&&r.push(t);const s=await this._rpcRequest("getSignatureStatuses",r),i=J(s,z4);if("error"in i)throw new se(i.error,"failed to get signature status");return i.result}async getTransactionCount(e){const{commitment:t,config:r}=Ne(e),s=this._buildArgs([],t,void 0,r),i=await this._rpcRequest("getTransactionCount",s),o=J(i,pe(L()));if("error"in o)throw new se(o.error,"failed to get transaction count");return o.result}async getTotalSupply(e){return(await this.getSupply({commitment:e,excludeNonCirculatingAccountsList:!0})).value.total}async getInflationGovernor(e){const t=this._buildArgs([],e),r=await this._rpcRequest("getInflationGovernor",t),s=J(r,d4);if("error"in s)throw new se(s.error,"failed to get inflation");return s.result}async getInflationReward(e,t,r){const{commitment:s,config:i}=Ne(r),o=this._buildArgs([e.map(h=>h.toBase58())],s,void 0,{...i,epoch:t??(i==null?void 0:i.epoch)}),a=await this._rpcRequest("getInflationReward",o),l=J(a,Y3);if("error"in l)throw new se(l.error,"failed to get inflation reward");return l.result}async getInflationRate(){const e=await this._rpcRequest("getInflationRate",[]),t=J(e,u4);if("error"in t)throw new se(t.error,"failed to get inflation rate");return t.result}async getEpochInfo(e){const{commitment:t,config:r}=Ne(e),s=this._buildArgs([],t,void 0,r),i=await this._rpcRequest("getEpochInfo",s),o=J(i,h4);if("error"in o)throw new se(o.error,"failed to get epoch info");return o.result}async getEpochSchedule(){const e=await this._rpcRequest("getEpochSchedule",[]),t=J(e,m4);if("error"in t)throw new se(t.error,"failed to get epoch schedule");const r=t.result;return new kh(r.slotsPerEpoch,r.leaderScheduleSlotOffset,r.warmup,r.firstNormalEpoch,r.firstNormalSlot)}async getLeaderSchedule(){const e=await this._rpcRequest("getLeaderSchedule",[]),t=J(e,b4);if("error"in t)throw new se(t.error,"failed to get leader schedule");return t.result}async getMinimumBalanceForRentExemption(e,t){const r=this._buildArgs([e],t),s=await this._rpcRequest("getMinimumBalanceForRentExemption",r),i=J(s,H4);return"error"in i?(console.warn("Unable to fetch minimum balance for rent exemption"),0):i.result}async getRecentBlockhashAndContext(e){const{context:t,value:{blockhash:r}}=await this.getLatestBlockhashAndContext(e);return{context:t,value:{blockhash:r,feeCalculator:{get lamportsPerSignature(){throw new Error("The capability to fetch `lamportsPerSignature` using the `getRecentBlockhash` API is no longer offered by the network. Use the `getFeeForMessage` API to obtain the fee for a given message.")},toJSON(){return{}}}}}}async getRecentPerformanceSamples(e){const t=await this._rpcRequest("getRecentPerformanceSamples",e?[e]:[]),r=J(t,t6);if("error"in r)throw new se(r.error,"failed to get recent performance samples");return r.result}async getFeeCalculatorForBlockhash(e,t){const r=this._buildArgs([e],t),s=await this._rpcRequest("getFeeCalculatorForBlockhash",r),i=J(s,n6);if("error"in i)throw new se(i.error,"failed to get fee calculator");const{context:o,value:a}=i.result;return{context:o,value:a!==null?a.feeCalculator:null}}async getFeeForMessage(e,t){const r=ge(e.serialize()).toString("base64"),s=this._buildArgs([r],t),i=await this._rpcRequest("getFeeForMessage",s),o=J(i,Qe(te(L())));if("error"in o)throw new se(o.error,"failed to get fee for message");if(o.result===null)throw new Error("invalid blockhash");return o.result}async getRecentPrioritizationFees(e){var o;const t=(o=e==null?void 0:e.lockedWritableAccounts)==null?void 0:o.map(a=>a.toBase58()),r=t!=null&&t.length?[t]:[],s=await this._rpcRequest("getRecentPrioritizationFees",r),i=J(s,f4);if("error"in i)throw new se(i.error,"failed to get recent prioritization fees");return i.result}async getRecentBlockhash(e){try{return(await this.getRecentBlockhashAndContext(e)).value}catch(t){throw new Error("failed to get recent blockhash: "+t)}}async getLatestBlockhash(e){try{return(await this.getLatestBlockhashAndContext(e)).value}catch(t){throw new Error("failed to get recent blockhash: "+t)}}async getLatestBlockhashAndContext(e){const{commitment:t,config:r}=Ne(e),s=this._buildArgs([],t,void 0,r),i=await this._rpcRequest("getLatestBlockhash",s),o=J(i,J4);if("error"in o)throw new se(o.error,"failed to get latest blockhash");return o.result}async isBlockhashValid(e,t){const{commitment:r,config:s}=Ne(t),i=this._buildArgs([e],r,void 0,s),o=await this._rpcRequest("isBlockhashValid",i),a=J(o,Q4);if("error"in a)throw new se(a.error,"failed to determine if the blockhash `"+e+"`is valid");return a.result}async getVersion(){const e=await this._rpcRequest("getVersion",[]),t=J(e,pe(r4));if("error"in t)throw new se(t.error,"failed to get version");return t.result}async getGenesisHash(){const e=await this._rpcRequest("getGenesisHash",[]),t=J(e,pe(X()));if("error"in t)throw new se(t.error,"failed to get genesis hash");return t.result}async getBlock(e,t){const{commitment:r,config:s}=Ne(t),i=this._buildArgsAtLeastConfirmed([e],r,void 0,s),o=await this._rpcRequest("getBlock",i);try{switch(s==null?void 0:s.transactionDetails){case"accounts":{const a=J(o,V4);if("error"in a)throw a.error;return a.result}case"none":{const a=J(o,$4);if("error"in a)throw a.error;return a.result}default:{const a=J(o,j4);if("error"in a)throw a.error;const{result:l}=a;return l?{...l,transactions:l.transactions.map(({transaction:h,meta:m,version:E})=>({meta:m,transaction:{...h,message:va(E,h.message)},version:E}))}:null}}}catch(a){throw new se(a,"failed to get confirmed block")}}async getParsedBlock(e,t){const{commitment:r,config:s}=Ne(t),i=this._buildArgsAtLeastConfirmed([e],r,"jsonParsed",s),o=await this._rpcRequest("getBlock",i);try{switch(s==null?void 0:s.transactionDetails){case"accounts":{const a=J(o,Y4);if("error"in a)throw a.error;return a.result}case"none":{const a=J(o,X4);if("error"in a)throw a.error;return a.result}default:{const a=J(o,G4);if("error"in a)throw a.error;return a.result}}}catch(a){throw new se(a,"failed to get block")}}async getBlockProduction(e){let t,r;if(typeof e=="string")r=e;else if(e){const{commitment:a,...l}=e;r=a,t=l}const s=this._buildArgs([],r,"base64",t),i=await this._rpcRequest("getBlockProduction",s),o=J(i,o4);if("error"in o)throw new se(o.error,"failed to get block production information");return o.result}async getTransaction(e,t){const{commitment:r,config:s}=Ne(t),i=this._buildArgsAtLeastConfirmed([e],r,void 0,s),o=await this._rpcRequest("getTransaction",i),a=J(o,ka);if("error"in a)throw new se(a.error,"failed to get transaction");const l=a.result;return l&&{...l,transaction:{...l.transaction,message:va(l.version,l.transaction.message)}}}async getParsedTransaction(e,t){const{commitment:r,config:s}=Ne(t),i=this._buildArgsAtLeastConfirmed([e],r,"jsonParsed",s),o=await this._rpcRequest("getTransaction",i),a=J(o,hi);if("error"in a)throw new se(a.error,"failed to get transaction");return a.result}async getParsedTransactions(e,t){const{commitment:r,config:s}=Ne(t),i=e.map(l=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([l],r,"jsonParsed",s)}));return(await this._rpcBatchRequest(i)).map(l=>{const h=J(l,hi);if("error"in h)throw new se(h.error,"failed to get transactions");return h.result})}async getTransactions(e,t){const{commitment:r,config:s}=Ne(t),i=e.map(l=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([l],r,void 0,s)}));return(await this._rpcBatchRequest(i)).map(l=>{const h=J(l,ka);if("error"in h)throw new se(h.error,"failed to get transactions");const m=h.result;return m&&{...m,transaction:{...m.transaction,message:va(m.version,m.transaction.message)}}})}async getConfirmedBlock(e,t){const r=this._buildArgsAtLeastConfirmed([e],t),s=await this._rpcRequest("getBlock",r),i=J(s,Z4);if("error"in i)throw new se(i.error,"failed to get confirmed block");const o=i.result;if(!o)throw new Error("Confirmed block "+e+" not found");const a={...o,transactions:o.transactions.map(({transaction:l,meta:h})=>{const m=new cn(l.message);return{meta:h,transaction:{...l,message:m}}})};return{...a,transactions:a.transactions.map(({transaction:l,meta:h})=>({meta:h,transaction:Fe.populate(l.message,l.signatures)}))}}async getBlocks(e,t,r){const s=this._buildArgsAtLeastConfirmed(t!==void 0?[e,t]:[e],r),i=await this._rpcRequest("getBlocks",s),o=J(i,pe(Q(L())));if("error"in o)throw new se(o.error,"failed to get blocks");return o.result}async getBlockSignatures(e,t){const r=this._buildArgsAtLeastConfirmed([e],t,void 0,{transactionDetails:"signatures",rewards:!1}),s=await this._rpcRequest("getBlock",r),i=J(s,au);if("error"in i)throw new se(i.error,"failed to get block");const o=i.result;if(!o)throw new Error("Block "+e+" not found");return o}async getConfirmedBlockSignatures(e,t){const r=this._buildArgsAtLeastConfirmed([e],t,void 0,{transactionDetails:"signatures",rewards:!1}),s=await this._rpcRequest("getBlock",r),i=J(s,au);if("error"in i)throw new se(i.error,"failed to get confirmed block");const o=i.result;if(!o)throw new Error("Confirmed block "+e+" not found");return o}async getConfirmedTransaction(e,t){const r=this._buildArgsAtLeastConfirmed([e],t),s=await this._rpcRequest("getTransaction",r),i=J(s,ka);if("error"in i)throw new se(i.error,"failed to get transaction");const o=i.result;if(!o)return o;const a=new cn(o.transaction.message),l=o.transaction.signatures;return{...o,transaction:Fe.populate(a,l)}}async getParsedConfirmedTransaction(e,t){const r=this._buildArgsAtLeastConfirmed([e],t,"jsonParsed"),s=await this._rpcRequest("getTransaction",r),i=J(s,hi);if("error"in i)throw new se(i.error,"failed to get confirmed transaction");return i.result}async getParsedConfirmedTransactions(e,t){const r=e.map(o=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([o],t,"jsonParsed")}));return(await this._rpcBatchRequest(r)).map(o=>{const a=J(o,hi);if("error"in a)throw new se(a.error,"failed to get confirmed transactions");return a.result})}async getConfirmedSignaturesForAddress(e,t,r){let s={},i=await this.getFirstAvailableBlock();for(;!("until"in s)&&(t--,!(t<=0||t<i));)try{const l=await this.getConfirmedBlockSignatures(t,"finalized");l.signatures.length>0&&(s.until=l.signatures[l.signatures.length-1].toString())}catch(l){if(l instanceof Error&&l.message.includes("skipped"))continue;throw l}let o=await this.getSlot("finalized");for(;!("before"in s)&&(r++,!(r>o));)try{const l=await this.getConfirmedBlockSignatures(r);l.signatures.length>0&&(s.before=l.signatures[l.signatures.length-1].toString())}catch(l){if(l instanceof Error&&l.message.includes("skipped"))continue;throw l}return(await this.getConfirmedSignaturesForAddress2(e,s)).map(l=>l.signature)}async getConfirmedSignaturesForAddress2(e,t,r){const s=this._buildArgsAtLeastConfirmed([e.toBase58()],r,void 0,t),i=await this._rpcRequest("getConfirmedSignaturesForAddress2",s),o=J(i,D4);if("error"in o)throw new se(o.error,"failed to get confirmed signatures for address");return o.result}async getSignaturesForAddress(e,t,r){const s=this._buildArgsAtLeastConfirmed([e.toBase58()],r,void 0,t),i=await this._rpcRequest("getSignaturesForAddress",s),o=J(i,v4);if("error"in o)throw new se(o.error,"failed to get signatures for address");return o.result}async getAddressLookupTable(e,t){const{context:r,value:s}=await this.getAccountInfoAndContext(e,t);let i=null;return s!==null&&(i=new Vi({key:e,state:Vi.deserialize(s.data)})),{context:r,value:i}}async getNonceAndContext(e,t){const{context:r,value:s}=await this.getAccountInfoAndContext(e,t);let i=null;return s!==null&&(i=To.fromAccountData(s.data)),{context:r,value:i}}async getNonce(e,t){return await this.getNonceAndContext(e,t).then(r=>r.value).catch(r=>{throw new Error("failed to get nonce for account "+e.toBase58()+": "+r)})}async requestAirdrop(e,t){const r=await this._rpcRequest("requestAirdrop",[e.toBase58(),t]),s=J(r,r6);if("error"in s)throw new se(s.error,`airdrop to ${e.toBase58()} failed`);return s.result}async _blockhashWithExpiryBlockHeight(e){if(!e){for(;this._pollingBlockhash;)await cr(100);const r=Date.now()-this._blockhashInfo.lastFetch>=Th;if(this._blockhashInfo.latestBlockhash!==null&&!r)return this._blockhashInfo.latestBlockhash}return await this._pollNewBlockhash()}async _pollNewBlockhash(){this._pollingBlockhash=!0;try{const e=Date.now(),t=this._blockhashInfo.latestBlockhash,r=t?t.blockhash:null;for(let s=0;s<50;s++){const i=await this.getLatestBlockhash("finalized");if(r!==i.blockhash)return this._blockhashInfo={latestBlockhash:i,lastFetch:Date.now(),transactionSignatures:[],simulatedSignatures:[]},i;await cr(Ch/2)}throw new Error(`Unable to obtain a new blockhash after ${Date.now()-e}ms`)}finally{this._pollingBlockhash=!1}}async getStakeMinimumDelegation(e){const{commitment:t,config:r}=Ne(e),s=this._buildArgs([],t,"base64",r),i=await this._rpcRequest("getStakeMinimumDelegation",s),o=J(i,Qe(L()));if("error"in o)throw new se(o.error,"failed to get stake minimum delegation");return o.result}async simulateTransaction(e,t,r){if("message"in e){const D=e.serialize(),x=oe.Buffer.from(D).toString("base64");if(Array.isArray(t)||r!==void 0)throw new Error("Invalid arguments");const U=t||{};U.encoding="base64","commitment"in U||(U.commitment=this.commitment),t&&typeof t=="object"&&"innerInstructions"in t&&(U.innerInstructions=t.innerInstructions);const R=[x,U],F=await this._rpcRequest("simulateTransaction",R),W=J(F,iu);if("error"in W)throw new Error("failed to simulate transaction: "+W.error.message);return W.result}let s;if(e instanceof Fe){let g=e;s=new Fe,s.feePayer=g.feePayer,s.instructions=e.instructions,s.nonceInfo=g.nonceInfo,s.signatures=g.signatures}else s=Fe.populate(e),s._message=s._json=void 0;if(t!==void 0&&!Array.isArray(t))throw new Error("Invalid arguments");const i=t;if(s.nonceInfo&&i)s.sign(...i);else{let g=this._disableBlockhashCaching;for(;;){const D=await this._blockhashWithExpiryBlockHeight(g);if(s.lastValidBlockHeight=D.lastValidBlockHeight,s.recentBlockhash=D.blockhash,!i)break;if(s.sign(...i),!s.signature)throw new Error("!signature");const x=s.signature.toString("base64");if(!this._blockhashInfo.simulatedSignatures.includes(x)&&!this._blockhashInfo.transactionSignatures.includes(x)){this._blockhashInfo.simulatedSignatures.push(x);break}else g=!0}}const o=s._compile(),a=o.serialize(),h=s._serialize(a).toString("base64"),m={encoding:"base64",commitment:this.commitment};if(r){const g=(Array.isArray(r)?r:o.nonProgramIds()).map(D=>D.toBase58());m.accounts={encoding:"base64",addresses:g}}i&&(m.sigVerify=!0),t&&typeof t=="object"&&"innerInstructions"in t&&(m.innerInstructions=t.innerInstructions);const E=[h,m],S=await this._rpcRequest("simulateTransaction",E),A=J(S,iu);if("error"in A){let g;if("data"in A.error&&(g=A.error.data.logs,g&&Array.isArray(g))){const D=`
15
- `,x=D+g.join(D);console.error(A.error.message,x)}throw new Xr({action:"simulate",signature:"",transactionMessage:A.error.message,logs:g})}return A.result}async sendTransaction(e,t,r){if("version"in e){if(t&&Array.isArray(t))throw new Error("Invalid arguments");const o=e.serialize();return await this.sendRawTransaction(o,t)}if(t===void 0||!Array.isArray(t))throw new Error("Invalid arguments");const s=t;if(e.nonceInfo)e.sign(...s);else{let o=this._disableBlockhashCaching;for(;;){const a=await this._blockhashWithExpiryBlockHeight(o);if(e.lastValidBlockHeight=a.lastValidBlockHeight,e.recentBlockhash=a.blockhash,e.sign(...s),!e.signature)throw new Error("!signature");const l=e.signature.toString("base64");if(this._blockhashInfo.transactionSignatures.includes(l))o=!0;else{this._blockhashInfo.transactionSignatures.push(l);break}}}const i=e.serialize();return await this.sendRawTransaction(i,r)}async sendRawTransaction(e,t){const r=ge(e).toString("base64");return await this.sendEncodedTransaction(r,t)}async sendEncodedTransaction(e,t){const r={encoding:"base64"},s=t&&t.skipPreflight,i=s===!0?"processed":t&&t.preflightCommitment||this.commitment;t&&t.maxRetries!=null&&(r.maxRetries=t.maxRetries),t&&t.minContextSlot!=null&&(r.minContextSlot=t.minContextSlot),s&&(r.skipPreflight=s),i&&(r.preflightCommitment=i);const o=[e,r],a=await this._rpcRequest("sendTransaction",o),l=J(a,s6);if("error"in l){let h;throw"data"in l.error&&(h=l.error.data.logs),new Xr({action:s?"send":"simulate",signature:"",transactionMessage:l.error.message,logs:h})}return l.result}_wsOnOpen(){this._rpcWebSocketConnected=!0,this._rpcWebSocketHeartbeat=setInterval(()=>{(async()=>{try{await this._rpcWebSocket.notify("ping")}catch{}})()},5e3),this._updateSubscriptions()}_wsOnError(e){this._rpcWebSocketConnected=!1,console.error("ws error:",e.message)}_wsOnClose(e){if(this._rpcWebSocketConnected=!1,this._rpcWebSocketGeneration=(this._rpcWebSocketGeneration+1)%Number.MAX_SAFE_INTEGER,this._rpcWebSocketIdleTimeout&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null),this._rpcWebSocketHeartbeat&&(clearInterval(this._rpcWebSocketHeartbeat),this._rpcWebSocketHeartbeat=null),e===1e3){this._updateSubscriptions();return}this._subscriptionCallbacksByServerSubscriptionId={},Object.entries(this._subscriptionsByHash).forEach(([t,r])=>{this._setSubscription(t,{...r,state:"pending"})})}_setSubscription(e,t){var s;const r=(s=this._subscriptionsByHash[e])==null?void 0:s.state;if(this._subscriptionsByHash[e]=t,r!==t.state){const i=this._subscriptionStateChangeCallbacksByHash[e];i&&i.forEach(o=>{try{o(t.state)}catch{}})}}_onSubscriptionStateChange(e,t){var i;const r=this._subscriptionHashByClientSubscriptionId[e];if(r==null)return()=>{};const s=(i=this._subscriptionStateChangeCallbacksByHash)[r]||(i[r]=new Set);return s.add(t),()=>{s.delete(t),s.size===0&&delete this._subscriptionStateChangeCallbacksByHash[r]}}async _updateSubscriptions(){if(Object.keys(this._subscriptionsByHash).length===0){this._rpcWebSocketConnected&&(this._rpcWebSocketConnected=!1,this._rpcWebSocketIdleTimeout=setTimeout(()=>{this._rpcWebSocketIdleTimeout=null;try{this._rpcWebSocket.close()}catch(r){r instanceof Error&&console.log(`Error when closing socket connection: ${r.message}`)}},500));return}if(this._rpcWebSocketIdleTimeout!==null&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null,this._rpcWebSocketConnected=!0),!this._rpcWebSocketConnected){this._rpcWebSocket.connect();return}const e=this._rpcWebSocketGeneration,t=()=>e===this._rpcWebSocketGeneration;await Promise.all(Object.keys(this._subscriptionsByHash).map(async r=>{const s=this._subscriptionsByHash[r];if(s!==void 0)switch(s.state){case"pending":case"unsubscribed":if(s.callbacks.size===0){delete this._subscriptionsByHash[r],s.state==="unsubscribed"&&delete this._subscriptionCallbacksByServerSubscriptionId[s.serverSubscriptionId],await this._updateSubscriptions();return}await(async()=>{const{args:i,method:o}=s;try{this._setSubscription(r,{...s,state:"subscribing"});const a=await this._rpcWebSocket.call(o,i);this._setSubscription(r,{...s,serverSubscriptionId:a,state:"subscribed"}),this._subscriptionCallbacksByServerSubscriptionId[a]=s.callbacks,await this._updateSubscriptions()}catch(a){if(console.error(`Received ${a instanceof Error?"":"JSON-RPC "}error calling \`${o}\``,{args:i,error:a}),!t())return;this._setSubscription(r,{...s,state:"pending"}),await this._updateSubscriptions()}})();break;case"subscribed":s.callbacks.size===0&&await(async()=>{const{serverSubscriptionId:i,unsubscribeMethod:o}=s;if(this._subscriptionsAutoDisposedByRpc.has(i))this._subscriptionsAutoDisposedByRpc.delete(i);else{this._setSubscription(r,{...s,state:"unsubscribing"}),this._setSubscription(r,{...s,state:"unsubscribing"});try{await this._rpcWebSocket.call(o,[i])}catch(a){if(a instanceof Error&&console.error(`${o} error:`,a.message),!t())return;this._setSubscription(r,{...s,state:"subscribed"}),await this._updateSubscriptions();return}}this._setSubscription(r,{...s,state:"unsubscribed"}),await this._updateSubscriptions()})();break}}))}_handleServerNotification(e,t){const r=this._subscriptionCallbacksByServerSubscriptionId[e];r!==void 0&&r.forEach(s=>{try{s(...t)}catch(i){console.error(i)}})}_wsOnAccountNotification(e){const{result:t,subscription:r}=J(e,k4);this._handleServerNotification(r,[t.value,t.context])}_makeSubscription(e,t){const r=this._nextClientSubscriptionId++,s=nu([e.method,t]),i=this._subscriptionsByHash[s];return i===void 0?this._subscriptionsByHash[s]={...e,args:t,callbacks:new Set([e.callback]),state:"pending"}:i.callbacks.add(e.callback),this._subscriptionHashByClientSubscriptionId[r]=s,this._subscriptionDisposeFunctionsByClientSubscriptionId[r]=async()=>{delete this._subscriptionDisposeFunctionsByClientSubscriptionId[r],delete this._subscriptionHashByClientSubscriptionId[r];const o=this._subscriptionsByHash[s];Te(o!==void 0,`Could not find a \`Subscription\` when tearing down client subscription #${r}`),o.callbacks.delete(e.callback),await this._updateSubscriptions()},this._updateSubscriptions(),r}onAccountChange(e,t,r){const{commitment:s,config:i}=Ne(r),o=this._buildArgs([e.toBase58()],s||this._commitment||"finalized","base64",i);return this._makeSubscription({callback:t,method:"accountSubscribe",unsubscribeMethod:"accountUnsubscribe"},o)}async removeAccountChangeListener(e){await this._unsubscribeClientSubscription(e,"account change")}_wsOnProgramAccountNotification(e){const{result:t,subscription:r}=J(e,T4);this._handleServerNotification(r,[{accountId:t.value.pubkey,accountInfo:t.value.account},t.context])}onProgramAccountChange(e,t,r,s){const{commitment:i,config:o}=Ne(r),a=this._buildArgs([e.toBase58()],i||this._commitment||"finalized","base64",o||(s?{filters:su(s)}:void 0));return this._makeSubscription({callback:t,method:"programSubscribe",unsubscribeMethod:"programUnsubscribe"},a)}async removeProgramAccountChangeListener(e){await this._unsubscribeClientSubscription(e,"program account change")}onLogs(e,t,r){const s=this._buildArgs([typeof e=="object"?{mentions:[e.toString()]}:e],r||this._commitment||"finalized");return this._makeSubscription({callback:t,method:"logsSubscribe",unsubscribeMethod:"logsUnsubscribe"},s)}async removeOnLogsListener(e){await this._unsubscribeClientSubscription(e,"logs")}_wsOnLogsNotification(e){const{result:t,subscription:r}=J(e,o6);this._handleServerNotification(r,[t.value,t.context])}_wsOnSlotNotification(e){const{result:t,subscription:r}=J(e,U4);this._handleServerNotification(r,[t])}onSlotChange(e){return this._makeSubscription({callback:e,method:"slotSubscribe",unsubscribeMethod:"slotUnsubscribe"},[])}async removeSlotChangeListener(e){await this._unsubscribeClientSubscription(e,"slot change")}_wsOnSlotUpdatesNotification(e){const{result:t,subscription:r}=J(e,M4);this._handleServerNotification(r,[t])}onSlotUpdate(e){return this._makeSubscription({callback:e,method:"slotsUpdatesSubscribe",unsubscribeMethod:"slotsUpdatesUnsubscribe"},[])}async removeSlotUpdateListener(e){await this._unsubscribeClientSubscription(e,"slot update")}async _unsubscribeClientSubscription(e,t){const r=this._subscriptionDisposeFunctionsByClientSubscriptionId[e];r?await r():console.warn(`Ignored unsubscribe request because an active subscription with id \`${e}\` for '${t}' events could not be found.`)}_buildArgs(e,t,r,s){const i=t||this._commitment;if(i||r||s){let o={};r&&(o.encoding=r),i&&(o.commitment=i),s&&(o=Object.assign(o,s)),e.push(o)}return e}_buildArgsAtLeastConfirmed(e,t,r,s){const i=t||this._commitment;if(i&&!["confirmed","finalized"].includes(i))throw new Error("Using Connection with default commitment: `"+this._commitment+"`, but method requires at least `confirmed`");return this._buildArgs(e,t,r,s)}_wsOnSignatureNotification(e){const{result:t,subscription:r}=J(e,R4);t.value!=="receivedSignature"&&this._subscriptionsAutoDisposedByRpc.add(r),this._handleServerNotification(r,t.value==="receivedSignature"?[{type:"received"},t.context]:[{type:"status",result:t.value},t.context])}onSignature(e,t,r){const s=this._buildArgs([e],r||this._commitment||"finalized"),i=this._makeSubscription({callback:(o,a)=>{if(o.type==="status"){t(o.result,a);try{this.removeSignatureListener(i)}catch{}}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},s);return i}onSignatureWithOptions(e,t,r){const{commitment:s,...i}={...r,commitment:r&&r.commitment||this._commitment||"finalized"},o=this._buildArgs([e],s,void 0,i),a=this._makeSubscription({callback:(l,h)=>{t(l,h);try{this.removeSignatureListener(a)}catch{}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},o);return a}async removeSignatureListener(e){await this._unsubscribeClientSubscription(e,"signature result")}_wsOnRootNotification(e){const{result:t,subscription:r}=J(e,W4);this._handleServerNotification(r,[t])}onRootChange(e){return this._makeSubscription({callback:e,method:"rootSubscribe",unsubscribeMethod:"rootUnsubscribe"},[])}async removeRootChangeListener(e){await this._unsubscribeClientSubscription(e,"root change")}}class yr{constructor(e){this._keypair=void 0,this._keypair=e??Jd()}static generate(){return new yr(Jd())}static fromSecretKey(e,t){if(e.byteLength!==64)throw new Error("bad secret key size");const r=e.slice(32,64);if(!t||!t.skipValidation){const s=e.slice(0,32),i=$i(s);for(let o=0;o<32;o++)if(r[o]!==i[o])throw new Error("provided secretKey is invalid")}return new yr({publicKey:r,secretKey:e})}static fromSeed(e){const t=$i(e),r=new Uint8Array(64);return r.set(e),r.set(t,32),new yr({publicKey:t,secretKey:r})}get publicKey(){return new Y(this._keypair.publicKey)}get secretKey(){return new Uint8Array(this._keypair.secretKey)}}const Nn=Object.freeze({CreateLookupTable:{index:0,layout:exports.struct([exports.u32("instruction"),Zr("recentSlot"),exports.u8("bumpSeed")])},FreezeLookupTable:{index:1,layout:exports.struct([exports.u32("instruction")])},ExtendLookupTable:{index:2,layout:exports.struct([exports.u32("instruction"),Zr(),exports.seq(Be(),Qn(exports.u32(),-8),"addresses")])},DeactivateLookupTable:{index:3,layout:exports.struct([exports.u32("instruction")])},CloseLookupTable:{index:4,layout:exports.struct([exports.u32("instruction")])}});class c6{constructor(){}static decodeInstructionType(e){this.checkProgramId(e.programId);const r=exports.u32("instruction").decode(e.data);let s;for(const[i,o]of Object.entries(Nn))if(o.index==r){s=i;break}if(!s)throw new Error("Invalid Instruction. Should be a LookupTable Instruction");return s}static decodeCreateLookupTable(e){this.checkProgramId(e.programId),this.checkKeysLength(e.keys,4);const{recentSlot:t}=Ue(Nn.CreateLookupTable,e.data);return{authority:e.keys[1].pubkey,payer:e.keys[2].pubkey,recentSlot:Number(t)}}static decodeExtendLookupTable(e){if(this.checkProgramId(e.programId),e.keys.length<2)throw new Error(`invalid instruction; found ${e.keys.length} keys, expected at least 2`);const{addresses:t}=Ue(Nn.ExtendLookupTable,e.data);return{lookupTable:e.keys[0].pubkey,authority:e.keys[1].pubkey,payer:e.keys.length>2?e.keys[2].pubkey:void 0,addresses:t.map(r=>new Y(r))}}static decodeCloseLookupTable(e){return this.checkProgramId(e.programId),this.checkKeysLength(e.keys,3),{lookupTable:e.keys[0].pubkey,authority:e.keys[1].pubkey,recipient:e.keys[2].pubkey}}static decodeFreezeLookupTable(e){return this.checkProgramId(e.programId),this.checkKeysLength(e.keys,2),{lookupTable:e.keys[0].pubkey,authority:e.keys[1].pubkey}}static decodeDeactivateLookupTable(e){return this.checkProgramId(e.programId),this.checkKeysLength(e.keys,2),{lookupTable:e.keys[0].pubkey,authority:e.keys[1].pubkey}}static checkProgramId(e){if(!e.equals(_o.programId))throw new Error("invalid instruction; programId is not AddressLookupTable Program")}static checkKeysLength(e,t){if(e.length<t)throw new Error(`invalid instruction; found ${e.length} keys, expected at least ${t}`)}}class _o{constructor(){}static createLookupTable(e){const[t,r]=Y.findProgramAddressSync([e.authority.toBuffer(),gl(BigInt(e.recentSlot),8)],this.programId),s=Nn.CreateLookupTable,i=Se(s,{recentSlot:BigInt(e.recentSlot),bumpSeed:r}),o=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1},{pubkey:e.payer,isSigner:!0,isWritable:!0},{pubkey:Bt.programId,isSigner:!1,isWritable:!1}];return[new We({programId:this.programId,keys:o,data:i}),t]}static freezeLookupTable(e){const t=Nn.FreezeLookupTable,r=Se(t),s=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1}];return new We({programId:this.programId,keys:s,data:r})}static extendLookupTable(e){const t=Nn.ExtendLookupTable,r=Se(t,{addresses:e.addresses.map(i=>i.toBytes())}),s=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1}];return e.payer&&s.push({pubkey:e.payer,isSigner:!0,isWritable:!0},{pubkey:Bt.programId,isSigner:!1,isWritable:!1}),new We({programId:this.programId,keys:s,data:r})}static deactivateLookupTable(e){const t=Nn.DeactivateLookupTable,r=Se(t),s=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1}];return new We({programId:this.programId,keys:s,data:r})}static closeLookupTable(e){const t=Nn.CloseLookupTable,r=Se(t),s=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1},{pubkey:e.recipient,isSigner:!1,isWritable:!0}];return new We({programId:this.programId,keys:s,data:r})}}_o.programId=new Y("AddressLookupTab1e1111111111111111111111111");class l6{constructor(){}static decodeInstructionType(e){this.checkProgramId(e.programId);const r=exports.u8("instruction").decode(e.data);let s;for(const[i,o]of Object.entries(An))if(o.index==r){s=i;break}if(!s)throw new Error("Instruction type incorrect; not a ComputeBudgetInstruction");return s}static decodeRequestUnits(e){this.checkProgramId(e.programId);const{units:t,additionalFee:r}=Ue(An.RequestUnits,e.data);return{units:t,additionalFee:r}}static decodeRequestHeapFrame(e){this.checkProgramId(e.programId);const{bytes:t}=Ue(An.RequestHeapFrame,e.data);return{bytes:t}}static decodeSetComputeUnitLimit(e){this.checkProgramId(e.programId);const{units:t}=Ue(An.SetComputeUnitLimit,e.data);return{units:t}}static decodeSetComputeUnitPrice(e){this.checkProgramId(e.programId);const{microLamports:t}=Ue(An.SetComputeUnitPrice,e.data);return{microLamports:t}}static checkProgramId(e){if(!e.equals(Mo.programId))throw new Error("invalid instruction; programId is not ComputeBudgetProgram")}}const An=Object.freeze({RequestUnits:{index:0,layout:exports.struct([exports.u8("instruction"),exports.u32("units"),exports.u32("additionalFee")])},RequestHeapFrame:{index:1,layout:exports.struct([exports.u8("instruction"),exports.u32("bytes")])},SetComputeUnitLimit:{index:2,layout:exports.struct([exports.u8("instruction"),exports.u32("units")])},SetComputeUnitPrice:{index:3,layout:exports.struct([exports.u8("instruction"),Zr("microLamports")])}});class Mo{constructor(){}static requestUnits(e){const t=An.RequestUnits,r=Se(t,e);return new We({keys:[],programId:this.programId,data:r})}static requestHeapFrame(e){const t=An.RequestHeapFrame,r=Se(t,e);return new We({keys:[],programId:this.programId,data:r})}static setComputeUnitLimit(e){const t=An.SetComputeUnitLimit,r=Se(t,e);return new We({keys:[],programId:this.programId,data:r})}static setComputeUnitPrice(e){const t=An.SetComputeUnitPrice,r=Se(t,{microLamports:BigInt(e.microLamports)});return new We({keys:[],programId:this.programId,data:r})}}Mo.programId=new Y("ComputeBudget111111111111111111111111111111");const cu=64,lu=32,du=64,uu=exports.struct([exports.u8("numSignatures"),exports.u8("padding"),exports.u16("signatureOffset"),exports.u16("signatureInstructionIndex"),exports.u16("publicKeyOffset"),exports.u16("publicKeyInstructionIndex"),exports.u16("messageDataOffset"),exports.u16("messageDataSize"),exports.u16("messageInstructionIndex")]);class Ro{constructor(){}static createInstructionWithPublicKey(e){const{publicKey:t,message:r,signature:s,instructionIndex:i}=e;Te(t.length===lu,`Public Key must be ${lu} bytes but received ${t.length} bytes`),Te(s.length===du,`Signature must be ${du} bytes but received ${s.length} bytes`);const o=uu.span,a=o+t.length,l=a+s.length,h=1,m=oe.Buffer.alloc(l+r.length),E=i??65535;return uu.encode({numSignatures:h,padding:0,signatureOffset:a,signatureInstructionIndex:E,publicKeyOffset:o,publicKeyInstructionIndex:E,messageDataOffset:l,messageDataSize:r.length,messageInstructionIndex:E},m),m.fill(t,o),m.fill(s,a),m.fill(r,l),new We({keys:[],programId:Ro.programId,data:m})}static createInstructionWithPrivateKey(e){const{privateKey:t,message:r,instructionIndex:s}=e;Te(t.length===cu,`Private key must be ${cu} bytes but received ${t.length} bytes`);try{const i=yr.fromSecretKey(t),o=i.publicKey.toBytes(),a=Bl(r,i.secretKey);return this.createInstructionWithPublicKey({publicKey:o,message:r,signature:a,instructionIndex:s})}catch(i){throw new Error(`Error creating instruction; ${i}`)}}}Ro.programId=new Y("Ed25519SigVerify111111111111111111111111111");const d6=(n,e)=>{const t=Hn.sign(n,e);return[t.toCompactRawBytes(),t.recovery]};Hn.utils.isValidPrivateKey;const u6=Hn.getPublicKey,fu=32,Fa=20,hu=64,f6=11,Ta=exports.struct([exports.u8("numSignatures"),exports.u16("signatureOffset"),exports.u8("signatureInstructionIndex"),exports.u16("ethAddressOffset"),exports.u8("ethAddressInstructionIndex"),exports.u16("messageDataOffset"),exports.u16("messageDataSize"),exports.u8("messageInstructionIndex"),exports.blob(20,"ethAddress"),exports.blob(64,"signature"),exports.u8("recoveryId")]);class wr{constructor(){}static publicKeyToEthAddress(e){Te(e.length===hu,`Public key must be ${hu} bytes but received ${e.length} bytes`);try{return oe.Buffer.from(Is(ge(e))).slice(-Fa)}catch(t){throw new Error(`Error constructing Ethereum address: ${t}`)}}static createInstructionWithPublicKey(e){const{publicKey:t,message:r,signature:s,recoveryId:i,instructionIndex:o}=e;return wr.createInstructionWithEthAddress({ethAddress:wr.publicKeyToEthAddress(t),message:r,signature:s,recoveryId:i,instructionIndex:o})}static createInstructionWithEthAddress(e){const{ethAddress:t,message:r,signature:s,recoveryId:i,instructionIndex:o=0}=e;let a;typeof t=="string"?t.startsWith("0x")?a=oe.Buffer.from(t.substr(2),"hex"):a=oe.Buffer.from(t,"hex"):a=t,Te(a.length===Fa,`Address must be ${Fa} bytes but received ${a.length} bytes`);const l=1+f6,h=l,m=l+a.length,E=m+s.length+1,S=1,A=oe.Buffer.alloc(Ta.span+r.length);return Ta.encode({numSignatures:S,signatureOffset:m,signatureInstructionIndex:o,ethAddressOffset:h,ethAddressInstructionIndex:o,messageDataOffset:E,messageDataSize:r.length,messageInstructionIndex:o,signature:ge(s),ethAddress:ge(a),recoveryId:i},A),A.fill(ge(r),Ta.span),new We({keys:[],programId:wr.programId,data:A})}static createInstructionWithPrivateKey(e){const{privateKey:t,message:r,instructionIndex:s}=e;Te(t.length===fu,`Private key must be ${fu} bytes but received ${t.length} bytes`);try{const i=ge(t),o=u6(i,!1).slice(1),a=oe.Buffer.from(Is(ge(r))),[l,h]=d6(a,i);return this.createInstructionWithPublicKey({publicKey:o,message:r,signature:l,recoveryId:h,instructionIndex:s})}catch(i){throw new Error(`Error creating instruction; ${i}`)}}}wr.programId=new Y("KeccakSecp256k11111111111111111111111111111");var zh;const Hh=new Y("StakeConfig11111111111111111111111111111111");class qh{constructor(e,t){this.staker=void 0,this.withdrawer=void 0,this.staker=e,this.withdrawer=t}}class si{constructor(e,t,r){this.unixTimestamp=void 0,this.epoch=void 0,this.custodian=void 0,this.unixTimestamp=e,this.epoch=t,this.custodian=r}}zh=si;si.default=new zh(0,0,Y.default);class h6{constructor(){}static decodeInstructionType(e){this.checkProgramId(e.programId);const r=exports.u32("instruction").decode(e.data);let s;for(const[i,o]of Object.entries(Dt))if(o.index==r){s=i;break}if(!s)throw new Error("Instruction type incorrect; not a StakeInstruction");return s}static decodeInitialize(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);const{authorized:t,lockup:r}=Ue(Dt.Initialize,e.data);return{stakePubkey:e.keys[0].pubkey,authorized:new qh(new Y(t.staker),new Y(t.withdrawer)),lockup:new si(r.unixTimestamp,r.epoch,new Y(r.custodian))}}static decodeDelegate(e){return this.checkProgramId(e.programId),this.checkKeyLength(e.keys,6),Ue(Dt.Delegate,e.data),{stakePubkey:e.keys[0].pubkey,votePubkey:e.keys[1].pubkey,authorizedPubkey:e.keys[5].pubkey}}static decodeAuthorize(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);const{newAuthorized:t,stakeAuthorizationType:r}=Ue(Dt.Authorize,e.data),s={stakePubkey:e.keys[0].pubkey,authorizedPubkey:e.keys[2].pubkey,newAuthorizedPubkey:new Y(t),stakeAuthorizationType:{index:r}};return e.keys.length>3&&(s.custodianPubkey=e.keys[3].pubkey),s}static decodeAuthorizeWithSeed(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);const{newAuthorized:t,stakeAuthorizationType:r,authoritySeed:s,authorityOwner:i}=Ue(Dt.AuthorizeWithSeed,e.data),o={stakePubkey:e.keys[0].pubkey,authorityBase:e.keys[1].pubkey,authoritySeed:s,authorityOwner:new Y(i),newAuthorizedPubkey:new Y(t),stakeAuthorizationType:{index:r}};return e.keys.length>3&&(o.custodianPubkey=e.keys[3].pubkey),o}static decodeSplit(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);const{lamports:t}=Ue(Dt.Split,e.data);return{stakePubkey:e.keys[0].pubkey,splitStakePubkey:e.keys[1].pubkey,authorizedPubkey:e.keys[2].pubkey,lamports:t}}static decodeMerge(e){return this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3),Ue(Dt.Merge,e.data),{stakePubkey:e.keys[0].pubkey,sourceStakePubKey:e.keys[1].pubkey,authorizedPubkey:e.keys[4].pubkey}}static decodeWithdraw(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,5);const{lamports:t}=Ue(Dt.Withdraw,e.data),r={stakePubkey:e.keys[0].pubkey,toPubkey:e.keys[1].pubkey,authorizedPubkey:e.keys[4].pubkey,lamports:t};return e.keys.length>5&&(r.custodianPubkey=e.keys[5].pubkey),r}static decodeDeactivate(e){return this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3),Ue(Dt.Deactivate,e.data),{stakePubkey:e.keys[0].pubkey,authorizedPubkey:e.keys[2].pubkey}}static checkProgramId(e){if(!e.equals(Wo.programId))throw new Error("invalid instruction; programId is not StakeProgram")}static checkKeyLength(e,t){if(e.length<t)throw new Error(`invalid instruction; found ${e.length} keys, expected at least ${t}`)}}const Dt=Object.freeze({Initialize:{index:0,layout:exports.struct([exports.u32("instruction"),g3(),y3()])},Authorize:{index:1,layout:exports.struct([exports.u32("instruction"),Be("newAuthorized"),exports.u32("stakeAuthorizationType")])},Delegate:{index:2,layout:exports.struct([exports.u32("instruction")])},Split:{index:3,layout:exports.struct([exports.u32("instruction"),exports.ns64("lamports")])},Withdraw:{index:4,layout:exports.struct([exports.u32("instruction"),exports.ns64("lamports")])},Deactivate:{index:5,layout:exports.struct([exports.u32("instruction")])},Merge:{index:7,layout:exports.struct([exports.u32("instruction")])},AuthorizeWithSeed:{index:8,layout:exports.struct([exports.u32("instruction"),Be("newAuthorized"),exports.u32("stakeAuthorizationType"),hr("authoritySeed"),Be("authorityOwner")])}}),m6=Object.freeze({Staker:{index:0},Withdrawer:{index:1}});class Wo{constructor(){}static initialize(e){const{stakePubkey:t,authorized:r,lockup:s}=e,i=s||si.default,o=Dt.Initialize,a=Se(o,{authorized:{staker:ge(r.staker.toBuffer()),withdrawer:ge(r.withdrawer.toBuffer())},lockup:{unixTimestamp:i.unixTimestamp,epoch:i.epoch,custodian:ge(i.custodian.toBuffer())}}),l={keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:Sr,isSigner:!1,isWritable:!1}],programId:this.programId,data:a};return new We(l)}static createAccountWithSeed(e){const t=new Fe;t.add(Bt.createAccountWithSeed({fromPubkey:e.fromPubkey,newAccountPubkey:e.stakePubkey,basePubkey:e.basePubkey,seed:e.seed,lamports:e.lamports,space:this.space,programId:this.programId}));const{stakePubkey:r,authorized:s,lockup:i}=e;return t.add(this.initialize({stakePubkey:r,authorized:s,lockup:i}))}static createAccount(e){const t=new Fe;t.add(Bt.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.stakePubkey,lamports:e.lamports,space:this.space,programId:this.programId}));const{stakePubkey:r,authorized:s,lockup:i}=e;return t.add(this.initialize({stakePubkey:r,authorized:s,lockup:i}))}static delegate(e){const{stakePubkey:t,authorizedPubkey:r,votePubkey:s}=e,i=Dt.Delegate,o=Se(i);return new Fe().add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:s,isSigner:!1,isWritable:!1},{pubkey:dn,isSigner:!1,isWritable:!1},{pubkey:Ti,isSigner:!1,isWritable:!1},{pubkey:Hh,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:o})}static authorize(e){const{stakePubkey:t,authorizedPubkey:r,newAuthorizedPubkey:s,stakeAuthorizationType:i,custodianPubkey:o}=e,a=Dt.Authorize,l=Se(a,{newAuthorized:ge(s.toBuffer()),stakeAuthorizationType:i.index}),h=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:dn,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1}];return o&&h.push({pubkey:o,isSigner:!0,isWritable:!1}),new Fe().add({keys:h,programId:this.programId,data:l})}static authorizeWithSeed(e){const{stakePubkey:t,authorityBase:r,authoritySeed:s,authorityOwner:i,newAuthorizedPubkey:o,stakeAuthorizationType:a,custodianPubkey:l}=e,h=Dt.AuthorizeWithSeed,m=Se(h,{newAuthorized:ge(o.toBuffer()),stakeAuthorizationType:a.index,authoritySeed:s,authorityOwner:ge(i.toBuffer())}),E=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1},{pubkey:dn,isSigner:!1,isWritable:!1}];return l&&E.push({pubkey:l,isSigner:!0,isWritable:!1}),new Fe().add({keys:E,programId:this.programId,data:m})}static splitInstruction(e){const{stakePubkey:t,authorizedPubkey:r,splitStakePubkey:s,lamports:i}=e,o=Dt.Split,a=Se(o,{lamports:i});return new We({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:s,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:a})}static split(e,t){const r=new Fe;return r.add(Bt.createAccount({fromPubkey:e.authorizedPubkey,newAccountPubkey:e.splitStakePubkey,lamports:t,space:this.space,programId:this.programId})),r.add(this.splitInstruction(e))}static splitWithSeed(e,t){const{stakePubkey:r,authorizedPubkey:s,splitStakePubkey:i,basePubkey:o,seed:a,lamports:l}=e,h=new Fe;return h.add(Bt.allocate({accountPubkey:i,basePubkey:o,seed:a,space:this.space,programId:this.programId})),t&&t>0&&h.add(Bt.transfer({fromPubkey:e.authorizedPubkey,toPubkey:i,lamports:t})),h.add(this.splitInstruction({stakePubkey:r,authorizedPubkey:s,splitStakePubkey:i,lamports:l}))}static merge(e){const{stakePubkey:t,sourceStakePubKey:r,authorizedPubkey:s}=e,i=Dt.Merge,o=Se(i);return new Fe().add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:dn,isSigner:!1,isWritable:!1},{pubkey:Ti,isSigner:!1,isWritable:!1},{pubkey:s,isSigner:!0,isWritable:!1}],programId:this.programId,data:o})}static withdraw(e){const{stakePubkey:t,authorizedPubkey:r,toPubkey:s,lamports:i,custodianPubkey:o}=e,a=Dt.Withdraw,l=Se(a,{lamports:i}),h=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:s,isSigner:!1,isWritable:!0},{pubkey:dn,isSigner:!1,isWritable:!1},{pubkey:Ti,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}];return o&&h.push({pubkey:o,isSigner:!0,isWritable:!1}),new Fe().add({keys:h,programId:this.programId,data:l})}static deactivate(e){const{stakePubkey:t,authorizedPubkey:r}=e,s=Dt.Deactivate,i=Se(s);return new Fe().add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:dn,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}}Wo.programId=new Y("Stake11111111111111111111111111111111111111");Wo.space=200;class Kh{constructor(e,t,r,s){this.nodePubkey=void 0,this.authorizedVoter=void 0,this.authorizedWithdrawer=void 0,this.commission=void 0,this.nodePubkey=e,this.authorizedVoter=t,this.authorizedWithdrawer=r,this.commission=s}}class b6{constructor(){}static decodeInstructionType(e){this.checkProgramId(e.programId);const r=exports.u32("instruction").decode(e.data);let s;for(const[i,o]of Object.entries(En))if(o.index==r){s=i;break}if(!s)throw new Error("Instruction type incorrect; not a VoteInstruction");return s}static decodeInitializeAccount(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,4);const{voteInit:t}=Ue(En.InitializeAccount,e.data);return{votePubkey:e.keys[0].pubkey,nodePubkey:e.keys[3].pubkey,voteInit:new Kh(new Y(t.nodePubkey),new Y(t.authorizedVoter),new Y(t.authorizedWithdrawer),t.commission)}}static decodeAuthorize(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);const{newAuthorized:t,voteAuthorizationType:r}=Ue(En.Authorize,e.data);return{votePubkey:e.keys[0].pubkey,authorizedPubkey:e.keys[2].pubkey,newAuthorizedPubkey:new Y(t),voteAuthorizationType:{index:r}}}static decodeAuthorizeWithSeed(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);const{voteAuthorizeWithSeedArgs:{currentAuthorityDerivedKeyOwnerPubkey:t,currentAuthorityDerivedKeySeed:r,newAuthorized:s,voteAuthorizationType:i}}=Ue(En.AuthorizeWithSeed,e.data);return{currentAuthorityDerivedKeyBasePubkey:e.keys[2].pubkey,currentAuthorityDerivedKeyOwnerPubkey:new Y(t),currentAuthorityDerivedKeySeed:r,newAuthorizedPubkey:new Y(s),voteAuthorizationType:{index:i},votePubkey:e.keys[0].pubkey}}static decodeWithdraw(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);const{lamports:t}=Ue(En.Withdraw,e.data);return{votePubkey:e.keys[0].pubkey,authorizedWithdrawerPubkey:e.keys[2].pubkey,lamports:t,toPubkey:e.keys[1].pubkey}}static checkProgramId(e){if(!e.equals(ms.programId))throw new Error("invalid instruction; programId is not VoteProgram")}static checkKeyLength(e,t){if(e.length<t)throw new Error(`invalid instruction; found ${e.length} keys, expected at least ${t}`)}}const En=Object.freeze({InitializeAccount:{index:0,layout:exports.struct([exports.u32("instruction"),w3()])},Authorize:{index:1,layout:exports.struct([exports.u32("instruction"),Be("newAuthorized"),exports.u32("voteAuthorizationType")])},Withdraw:{index:3,layout:exports.struct([exports.u32("instruction"),exports.ns64("lamports")])},UpdateValidatorIdentity:{index:4,layout:exports.struct([exports.u32("instruction")])},AuthorizeWithSeed:{index:10,layout:exports.struct([exports.u32("instruction"),A3()])}}),p6=Object.freeze({Voter:{index:0},Withdrawer:{index:1}});class ms{constructor(){}static initializeAccount(e){const{votePubkey:t,nodePubkey:r,voteInit:s}=e,i=En.InitializeAccount,o=Se(i,{voteInit:{nodePubkey:ge(s.nodePubkey.toBuffer()),authorizedVoter:ge(s.authorizedVoter.toBuffer()),authorizedWithdrawer:ge(s.authorizedWithdrawer.toBuffer()),commission:s.commission}}),a={keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:Sr,isSigner:!1,isWritable:!1},{pubkey:dn,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:o};return new We(a)}static createAccount(e){const t=new Fe;return t.add(Bt.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.votePubkey,lamports:e.lamports,space:this.space,programId:this.programId})),t.add(this.initializeAccount({votePubkey:e.votePubkey,nodePubkey:e.voteInit.nodePubkey,voteInit:e.voteInit}))}static authorize(e){const{votePubkey:t,authorizedPubkey:r,newAuthorizedPubkey:s,voteAuthorizationType:i}=e,o=En.Authorize,a=Se(o,{newAuthorized:ge(s.toBuffer()),voteAuthorizationType:i.index}),l=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:dn,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}];return new Fe().add({keys:l,programId:this.programId,data:a})}static authorizeWithSeed(e){const{currentAuthorityDerivedKeyBasePubkey:t,currentAuthorityDerivedKeyOwnerPubkey:r,currentAuthorityDerivedKeySeed:s,newAuthorizedPubkey:i,voteAuthorizationType:o,votePubkey:a}=e,l=En.AuthorizeWithSeed,h=Se(l,{voteAuthorizeWithSeedArgs:{currentAuthorityDerivedKeyOwnerPubkey:ge(r.toBuffer()),currentAuthorityDerivedKeySeed:s,newAuthorized:ge(i.toBuffer()),voteAuthorizationType:o.index}}),m=[{pubkey:a,isSigner:!1,isWritable:!0},{pubkey:dn,isSigner:!1,isWritable:!1},{pubkey:t,isSigner:!0,isWritable:!1}];return new Fe().add({keys:m,programId:this.programId,data:h})}static withdraw(e){const{votePubkey:t,authorizedWithdrawerPubkey:r,lamports:s,toPubkey:i}=e,o=En.Withdraw,a=Se(o,{lamports:s}),l=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1}];return new Fe().add({keys:l,programId:this.programId,data:a})}static safeWithdraw(e,t,r){if(e.lamports>t-r)throw new Error("Withdraw will leave vote account with insufficient funds.");return ms.withdraw(e)}static updateValidatorIdentity(e){const{votePubkey:t,authorizedWithdrawerPubkey:r,nodePubkey:s}=e,i=En.UpdateValidatorIdentity,o=Se(i),a=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:s,isSigner:!0,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}];return new Fe().add({keys:a,programId:this.programId,data:o})}}ms.programId=new Y("Vote111111111111111111111111111111111111111");ms.space=3762;const jh=new Y("Va1idator1nfo111111111111111111111111111111"),g6=j({name:X(),website:ce(X()),details:ce(X()),iconUrl:ce(X()),keybaseUsername:ce(X())});class Fl{constructor(e,t){this.key=void 0,this.info=void 0,this.key=e,this.info=t}static fromConfigData(e){let t=[...e];if(Vt(t)!==2)return null;const s=[];for(let i=0;i<2;i++){const o=new Y(Gt(t,0,xn)),a=wn(t)===1;s.push({publicKey:o,isSigner:a})}if(s[0].publicKey.equals(jh)&&s[1].isSigner){const i=hr().decode(oe.Buffer.from(t)),o=JSON.parse(i);return dh(o,g6),new Fl(s[1].publicKey,o)}return null}}const y6=new Y("Vote111111111111111111111111111111111111111"),w6=exports.struct([Be("nodePubkey"),Be("authorizedWithdrawer"),exports.u8("commission"),It(),exports.seq(exports.struct([It("slot"),exports.u32("confirmationCount")]),Qn(exports.u32(),-8),"votes"),exports.u8("rootSlotValid"),It("rootSlot"),It(),exports.seq(exports.struct([It("epoch"),Be("authorizedVoter")]),Qn(exports.u32(),-8),"authorizedVoters"),exports.struct([exports.seq(exports.struct([Be("authorizedPubkey"),It("epochOfLastAuthorizedSwitch"),It("targetEpoch")]),32,"buf"),It("idx"),exports.u8("isEmpty")],"priorVoters"),It(),exports.seq(exports.struct([It("epoch"),It("credits"),It("prevCredits")]),Qn(exports.u32(),-8),"epochCredits"),exports.struct([It("slot"),It("timestamp")],"lastTimestamp")]);class Tl{constructor(e){this.nodePubkey=void 0,this.authorizedWithdrawer=void 0,this.commission=void 0,this.rootSlot=void 0,this.votes=void 0,this.authorizedVoters=void 0,this.priorVoters=void 0,this.epochCredits=void 0,this.lastTimestamp=void 0,this.nodePubkey=e.nodePubkey,this.authorizedWithdrawer=e.authorizedWithdrawer,this.commission=e.commission,this.rootSlot=e.rootSlot,this.votes=e.votes,this.authorizedVoters=e.authorizedVoters,this.priorVoters=e.priorVoters,this.epochCredits=e.epochCredits,this.lastTimestamp=e.lastTimestamp}static fromAccountData(e){const r=w6.decode(ge(e),4);let s=r.rootSlot;return r.rootSlotValid||(s=null),new Tl({nodePubkey:new Y(r.nodePubkey),authorizedWithdrawer:new Y(r.authorizedWithdrawer),commission:r.commission,votes:r.votes,rootSlot:s,authorizedVoters:r.authorizedVoters.map(A6),priorVoters:E6(r.priorVoters),epochCredits:r.epochCredits,lastTimestamp:r.lastTimestamp})}}function A6({authorizedVoter:n,epoch:e}){return{epoch:e,authorizedVoter:new Y(n)}}function mu({authorizedPubkey:n,epochOfLastAuthorizedSwitch:e,targetEpoch:t}){return{authorizedPubkey:new Y(n),epochOfLastAuthorizedSwitch:e,targetEpoch:t}}function E6({buf:n,idx:e,isEmpty:t}){return t?[]:[...n.slice(e+1).map(mu),...n.slice(0,e).map(mu)]}const bu={http:{devnet:"http://api.devnet.solana.com",testnet:"http://api.testnet.solana.com","mainnet-beta":"http://api.mainnet-beta.solana.com/"},https:{devnet:"https://api.devnet.solana.com",testnet:"https://api.testnet.solana.com","mainnet-beta":"https://api.mainnet-beta.solana.com/"}};function $h(n,e){const t=e===!1?"http":"https";if(!n)return bu[t].devnet;const r=bu[t][n];if(!r)throw new Error(`Unknown ${t} cluster: ${n}`);return r}async function B6(n,e,t,r){let s,i;t&&Object.prototype.hasOwnProperty.call(t,"lastValidBlockHeight")||t&&Object.prototype.hasOwnProperty.call(t,"nonceValue")?(s=t,i=r):i=t;const o=i&&{skipPreflight:i.skipPreflight,preflightCommitment:i.preflightCommitment||i.commitment,minContextSlot:i.minContextSlot},a=await n.sendRawTransaction(e,o),l=i&&i.commitment,m=(await(s?n.confirmTransaction(s,l):n.confirmTransaction(a,l))).value;if(m.err)throw a!=null?new Xr({action:o!=null&&o.skipPreflight?"send":"simulate",signature:a,transactionMessage:`Status: (${JSON.stringify(m)})`}):new Error(`Raw transaction ${a} failed (${JSON.stringify(m)})`);return a}const Vh=1e9,x6=Object.freeze(Object.defineProperty({__proto__:null,Account:m3,AddressLookupTableAccount:Vi,AddressLookupTableInstruction:c6,AddressLookupTableProgram:_o,Authorized:qh,BLOCKHASH_CACHE_TIMEOUT_MS:Th,BPF_LOADER_DEPRECATED_PROGRAM_ID:b3,BPF_LOADER_PROGRAM_ID:M3,BpfLoader:R3,COMPUTE_BUDGET_INSTRUCTION_LAYOUTS:An,ComputeBudgetInstruction:l6,ComputeBudgetProgram:Mo,Connection:Nh,Ed25519Program:Ro,Enum:f3,EpochSchedule:kh,FeeCalculatorLayout:Dh,Keypair:yr,LAMPORTS_PER_SOL:Vh,LOOKUP_TABLE_INSTRUCTION_LAYOUTS:Nn,Loader:Dr,Lockup:si,MAX_SEED_LENGTH:Eh,Message:cn,MessageAccountKeys:Ks,MessageV0:nr,NONCE_ACCOUNT_LENGTH:gc,NonceAccount:To,PACKET_DATA_SIZE:er,PUBLIC_KEY_LENGTH:xn,PublicKey:Y,SIGNATURE_LENGTH_IN_BYTES:qs,SOLANA_SCHEMA:Ss,STAKE_CONFIG_ID:Hh,STAKE_INSTRUCTION_LAYOUTS:Dt,SYSTEM_INSTRUCTION_LAYOUTS:ze,SYSVAR_CLOCK_PUBKEY:dn,SYSVAR_EPOCH_SCHEDULE_PUBKEY:S3,SYSVAR_INSTRUCTIONS_PUBKEY:Sh,SYSVAR_RECENT_BLOCKHASHES_PUBKEY:Fi,SYSVAR_RENT_PUBKEY:Sr,SYSVAR_REWARDS_PUBKEY:D3,SYSVAR_SLOT_HASHES_PUBKEY:v3,SYSVAR_SLOT_HISTORY_PUBKEY:k3,SYSVAR_STAKE_HISTORY_PUBKEY:Ti,Secp256k1Program:wr,SendTransactionError:Xr,SolanaJSONRPCError:se,SolanaJSONRPCErrorCode:F3,StakeAuthorizationLayout:m6,StakeInstruction:h6,StakeProgram:Wo,Struct:xl,SystemInstruction:U3,SystemProgram:Bt,Transaction:Fe,TransactionExpiredBlockheightExceededError:Do,TransactionExpiredNonceInvalidError:zr,TransactionExpiredTimeoutError:Cl,TransactionInstruction:We,TransactionMessage:ko,TransactionStatus:Rn,VALIDATOR_INFO_KEY:jh,VERSION_PREFIX_MASK:So,VOTE_PROGRAM_ID:y6,ValidatorInfo:Fl,VersionedMessage:Sl,VersionedTransaction:Fo,VoteAccount:Tl,VoteAuthorizationLayout:p6,VoteInit:Kh,VoteInstruction:b6,VoteProgram:ms,clusterApiUrl:$h,sendAndConfirmRawTransaction:B6,sendAndConfirmTransaction:pc},Symbol.toStringTag,{value:"Module"})),Il="Solana",C6="11111111111111111111111111111111",lr=class lr{constructor(e){re(this,"type","Native");re(this,"address");lr.instanceof(e)?this.address=e.address:Nt.instanceof(e)?this.address=new Y(e.toUint8Array()):typeof e=="string"&&_t.valid(e)?this.address=new Y(_t.decode(e)):this.address=new Y(e)}unwrap(){return this.address}toString(){return this.address.toBase58()}toUint8Array(){return new Uint8Array(this.address.toBytes())}toNative(){return this}toUniversalAddress(){return new Nt(this.toUint8Array())}static instanceof(e){return e.constructor.platform===lr.platform}equals(e){return lr.instanceof(e)?e.unwrap().equals(this.unwrap()):this.toUniversalAddress().equals(e)}};re(lr,"byteSize",32),re(lr,"platform",Il);let Yi=lr;zc(Il,Yi);exports.AddressLookupTableAccount=Vi;exports.AddressLookupTableProgram=_o;exports.AutomaticRoute=f0;exports.BN=uc;exports.CircleTransfer=Ct;exports.ComputeBudgetProgram=Mo;exports.Connection=Nh;exports.ErrNotWrapped=Fp;exports.EvmAddress=Oi;exports.EvmZeroAddress=e8;exports.FinalizableRoute=qy;exports.Hash=B0;exports.Hash$1=so;exports.HashMD=Rc;exports.Keypair=yr;exports.LAMPORTS_PER_SOL=Vh;exports.ManualRoute=lc;exports.Message=cn;exports.MessageV0=nr;exports.O=El;exports.PlatformNativeSigner=bp;exports.PublicKey=Y;exports.Route=yo;exports.RouteResolver=u0;exports.RpcClient=yh;exports.SYSVAR_CLOCK_PUBKEY=dn;exports.SYSVAR_INSTRUCTIONS_PUBKEY=Sh;exports.SYSVAR_RENT_PUBKEY=Sr;exports.Secp256k1Program=wr;exports.SendTransactionError=Xr;exports.SolanaAddress=Yi;exports.SolanaZeroAddress=C6;exports.SystemProgram=Bt;exports.TokenTransfer=wt;exports.Transaction=Fe;exports.TransactionExpiredBlockheightExceededError=Do;exports.TransactionInstruction=We;exports.TransactionMessage=ko;exports.UniversalAddress=Nt;exports.VersionedTransaction=Fo;exports.Wormhole=sn;exports._platform=al;exports._platform$1=Il;exports.abytes=vr;exports.addChainId=Q2;exports.addFixedValues=Em;exports.addFrom=J2;exports.aexists=Er;exports.ahash=Yu;exports.anumber=Fs;exports.aoutput=_c;exports.applyChainsConfigConfigOverrides=yy;exports.assert=vn;exports.assertArgument=Xn;exports.assertArgumentCount=Gy;exports.assertNormalize=Xy;exports.assertPrivate=Zy;exports.asyncLoop=d2;exports.axios=ve;exports.b58=Mu;exports.b64=to;exports.bech32=Uu;exports.bignum=xs;exports.bnExports=tl;exports.bound=um;exports.browserExports=Eu;exports.bs58=vt;exports.bufferPolyfill=oe;exports.byteSwap32=qa;exports.byteSwapIfBE=y1;exports.bytes=zt;exports.bytes$1=rl;exports.bytesToHex=A1;exports.canonicalAddress=Dn;exports.chainIdToChain=Wi;exports.chainItem=qt;exports.chainToChainId=no;exports.chainToPlatform=ns;exports.checkOpts=m2;exports.checkOpts$1=B1;exports.circleChainId=Ku;exports.circleContractChains=f1;exports.circleContracts=Ha;exports.clusterApiUrl=$h;exports.commonjsGlobal=an;exports.concat=e2;exports.concatBytes=f2;exports.concatBytes$1=Qu;exports.constMap=we;exports.createBase58check=_m;exports.createView=o2;exports.createView$1=Si;exports.customizableBytes=Ji;exports.dataLength=t2;exports.dataSlice=n2;exports.decomposeLiteral=kf;exports.defineProperties=fc;exports.deliveryInstructionLayout=Nf;exports.denoise=vm;exports.deserialize=Ws;exports.deserialize$1=Sn;exports.display=Cc;exports.dist=Ve;exports.ed25519=kr;exports.envelopeLayout=jc;exports.estimateFinalityTime=Fc;exports.exists=hc;exports.expiration=vs;exports.filters=rs;exports.fromBaseUnits=qr;exports.getAddress=gr;exports.getAugmentedNamespace=Ec;exports.getBytes=Fr;exports.getBytesCopy=Jy;exports.getDefaultExportFromCjs=$s;exports.getTokenByAddress=dp;exports.getTokenDetails=Ny;exports.guardianAttestationEta=Uc;exports.hash=i2;exports.headerLayout=Kc;exports.hex=_t;exports.hexToBytes=E1;exports.hexlify=Qs;exports.hmac=Wc;exports.index_browser_esm=x6;exports.isAddressable=W0;exports.isAttested=Ns;exports.isAutomatic=zy;exports.isBytesLike=Qy;exports.isCallException=Vy;exports.isChain=ro;exports.isCompleted=vy;exports.isDestinationQueued=Dy;exports.isEqualCaseInsensitive=Pu;exports.isError=b0;exports.isFailed=ky;exports.isFinalizable=Ky;exports.isHexString=nl;exports.isLE=Pi;exports.isManual=Hy;exports.isNative=Ot;exports.isRedeemed=Qc;exports.isRefunded=Sy;exports.isSameToken=If;exports.isSignAndSendSigner=Vc;exports.isSignOnlySigner=Mf;exports.isSourceFinalized=Os;exports.isSourceInitiated=Jc;exports.isTokenId=uo;exports.isWormholeMessageId=br;exports.keccak256=ls;exports.keccak_256=Is;exports.makeError=p0;exports.median=am;exports.mod=je;exports.nativeDecimals=Nu;exports.nativeTokenId=Tf;exports.networkChainToNativeChainId=qu;exports.networkPlatformConfigs=l0;exports.number=zs;exports.output=w0;exports.parse=Ai;exports.payloadLiteralToPayloadItemLayout=Ff;exports.platformNativeChainIdToNetworkChain=Ym;exports.porticoContractChains=h1;exports.randomBytes=b2;exports.randomBytes$1=Mc;exports.registerNative=zc;exports.registerPayloadTypes=xt;exports.resolveAddress=Y2;exports.resolveProperties=$y;exports.resolveWrappedToken=Uf;exports.rotl=g1;exports.rotr=a2;exports.rpcAddress=zu;exports.safeBufferExports=h0;exports.scale=Es;exports.secp256k1=Hn;exports.serialize=Qa;exports.serialize$1=Cn;exports.serializePayload=op;exports.sha256=Ts;exports.sha3_256=eb;exports.sha512=hf;exports.signSendWait=Ls;exports.tbtc=Ci;exports.toBigIntLE_1=lh;exports.toBufferLE_1=gl;exports.toBytes=sl;exports.toBytes$1=ss;exports.toChain=ts;exports.toChainId=Gs;exports.toCircleChain=xi;exports.toNative=tr;exports.toUniversal=Sf;exports.tokenBridgeChains=d1;exports.tokenBridgeRelayerChains=u1;exports.truncate=Ei;exports.u32$1=E0;exports.u32$2=Xu;exports.u64=U2;exports.u64$1=me;exports.units=gn;exports.universalAddress=hp;exports.universalAddressItem=xe;exports.unusedArbiterFee=Z2;exports.unusedNonce=X2;exports.usdcContract=Cs;exports.utf8ToBytes=Ju;exports.version=m0;exports.whole=Bs;exports.wrapConstructor=x0;exports.wrapConstructor$1=Ys;exports.wrapConstructorWithOpts=x1;exports.zeroPadBytes=s2;exports.zeroPadValue=r2;
14
+ `+i+o;break;default:a=`Unknown action '${(l=>l)(e)}'`}super(a),this.signature=void 0,this.transactionMessage=void 0,this.transactionLogs=void 0,this.signature=t,this.transactionMessage=r,this.transactionLogs=s||void 0}get transactionError(){return{message:this.transactionMessage,logs:Array.isArray(this.transactionLogs)?this.transactionLogs:void 0}}get logs(){const e=this.transactionLogs;if(!(e!=null&&typeof e=="object"&&"then"in e))return e}async getLogs(e){return Array.isArray(this.transactionLogs)||(this.transactionLogs=new Promise((t,r)=>{e.getTransaction(this.signature).then(s=>{if(s&&s.meta&&s.meta.logMessages){const i=s.meta.logMessages;this.transactionLogs=i,t(i)}else r(new Error("Log messages not found"))}).catch(r)})),await this.transactionLogs}}const T3={JSON_RPC_SERVER_ERROR_BLOCK_CLEANED_UP:-32001,JSON_RPC_SERVER_ERROR_SEND_TRANSACTION_PREFLIGHT_FAILURE:-32002,JSON_RPC_SERVER_ERROR_TRANSACTION_SIGNATURE_VERIFICATION_FAILURE:-32003,JSON_RPC_SERVER_ERROR_BLOCK_NOT_AVAILABLE:-32004,JSON_RPC_SERVER_ERROR_NODE_UNHEALTHY:-32005,JSON_RPC_SERVER_ERROR_TRANSACTION_PRECOMPILE_VERIFICATION_FAILURE:-32006,JSON_RPC_SERVER_ERROR_SLOT_SKIPPED:-32007,JSON_RPC_SERVER_ERROR_NO_SNAPSHOT:-32008,JSON_RPC_SERVER_ERROR_LONG_TERM_STORAGE_SLOT_SKIPPED:-32009,JSON_RPC_SERVER_ERROR_KEY_EXCLUDED_FROM_SECONDARY_INDEX:-32010,JSON_RPC_SERVER_ERROR_TRANSACTION_HISTORY_NOT_AVAILABLE:-32011,JSON_RPC_SCAN_ERROR:-32012,JSON_RPC_SERVER_ERROR_TRANSACTION_SIGNATURE_LEN_MISMATCH:-32013,JSON_RPC_SERVER_ERROR_BLOCK_STATUS_NOT_AVAILABLE_YET:-32014,JSON_RPC_SERVER_ERROR_UNSUPPORTED_TRANSACTION_VERSION:-32015,JSON_RPC_SERVER_ERROR_MIN_CONTEXT_SLOT_NOT_REACHED:-32016};class se extends Error{constructor({code:e,message:t,data:r},s){super(s!=null?`${s}: ${t}`:t),this.code=void 0,this.data=void 0,this.code=e,this.data=r,this.name="SolanaJSONRPCError"}}async function gc(n,e,t,r){const s=r&&{skipPreflight:r.skipPreflight,preflightCommitment:r.preflightCommitment||r.commitment,maxRetries:r.maxRetries,minContextSlot:r.minContextSlot},i=await n.sendTransaction(e,t,s);let o;if(e.recentBlockhash!=null&&e.lastValidBlockHeight!=null)o=(await n.confirmTransaction({abortSignal:r==null?void 0:r.abortSignal,signature:i,blockhash:e.recentBlockhash,lastValidBlockHeight:e.lastValidBlockHeight},r&&r.commitment)).value;else if(e.minNonceContextSlot!=null&&e.nonceInfo!=null){const{nonceInstruction:a}=e.nonceInfo,l=a.keys[0].pubkey;o=(await n.confirmTransaction({abortSignal:r==null?void 0:r.abortSignal,minContextSlot:e.minNonceContextSlot,nonceAccountPubkey:l,nonceValue:e.nonceInfo.nonce,signature:i},r&&r.commitment)).value}else(r==null?void 0:r.abortSignal)!=null&&console.warn("sendAndConfirmTransaction(): A transaction with a deprecated confirmation strategy was supplied along with an `abortSignal`. Only transactions having `lastValidBlockHeight` or a combination of `nonceInfo` and `minNonceContextSlot` are abortable."),o=(await n.confirmTransaction(i,r&&r.commitment)).value;if(o.err)throw i!=null?new Jr({action:"send",signature:i,transactionMessage:`Status: (${JSON.stringify(o)})`}):new Error(`Transaction ${i} failed (${JSON.stringify(o)})`);return i}function dr(n){return new Promise(e=>setTimeout(e,n))}function Se(n,e){const t=n.layout.span>=0?n.layout.span:Ih(n,e),r=oe.Buffer.alloc(t),s=Object.assign({instruction:n.index},e);return n.layout.encode(s,r),r}function Ue(n,e){let t;try{t=n.layout.decode(e)}catch(r){throw new Error("invalid instruction; "+r)}if(t.instruction!==n.index)throw new Error(`invalid instruction; instruction index mismatch ${t.instruction} != ${n.index}`);return t}const Rh=It("lamportsPerSignature"),Wh=exports.struct([exports.u32("version"),exports.u32("state"),Be("authorizedPubkey"),Be("nonce"),exports.struct([Rh],"feeCalculator")]),yc=Wh.span;class Io{constructor(e){this.authorizedPubkey=void 0,this.nonce=void 0,this.feeCalculator=void 0,this.authorizedPubkey=e.authorizedPubkey,this.nonce=e.nonce,this.feeCalculator=e.feeCalculator}static fromAccountData(e){const t=Wh.decode(ge(e),0);return new Io({authorizedPubkey:new Y(t.authorizedPubkey),nonce:new Y(t.nonce).toString(),feeCalculator:t.feeCalculator})}}const I3=n=>{const e=n.decode.bind(n),t=n.encode.bind(n);return{decode:e,encode:t}},U3=n=>e=>{const t=exports.blob(n,e),{encode:r,decode:s}=I3(t),i=t;return i.decode=(o,a)=>{const l=s(o,a);return yh(oe.Buffer.from(l))},i.encode=(o,a,l)=>{const h=wl(o,n);return r(h,a,l)},i},Qr=U3(8);class _3{constructor(){}static decodeInstructionType(e){this.checkProgramId(e.programId);const r=exports.u32("instruction").decode(e.data);let s;for(const[i,o]of Object.entries(ze))if(o.index==r){s=i;break}if(!s)throw new Error("Instruction type incorrect; not a SystemInstruction");return s}static decodeCreateAccount(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);const{lamports:t,space:r,programId:s}=Ue(ze.Create,e.data);return{fromPubkey:e.keys[0].pubkey,newAccountPubkey:e.keys[1].pubkey,lamports:t,space:r,programId:new Y(s)}}static decodeTransfer(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);const{lamports:t}=Ue(ze.Transfer,e.data);return{fromPubkey:e.keys[0].pubkey,toPubkey:e.keys[1].pubkey,lamports:t}}static decodeTransferWithSeed(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);const{lamports:t,seed:r,programId:s}=Ue(ze.TransferWithSeed,e.data);return{fromPubkey:e.keys[0].pubkey,basePubkey:e.keys[1].pubkey,toPubkey:e.keys[2].pubkey,lamports:t,seed:r,programId:new Y(s)}}static decodeAllocate(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,1);const{space:t}=Ue(ze.Allocate,e.data);return{accountPubkey:e.keys[0].pubkey,space:t}}static decodeAllocateWithSeed(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,1);const{base:t,seed:r,space:s,programId:i}=Ue(ze.AllocateWithSeed,e.data);return{accountPubkey:e.keys[0].pubkey,basePubkey:new Y(t),seed:r,space:s,programId:new Y(i)}}static decodeAssign(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,1);const{programId:t}=Ue(ze.Assign,e.data);return{accountPubkey:e.keys[0].pubkey,programId:new Y(t)}}static decodeAssignWithSeed(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,1);const{base:t,seed:r,programId:s}=Ue(ze.AssignWithSeed,e.data);return{accountPubkey:e.keys[0].pubkey,basePubkey:new Y(t),seed:r,programId:new Y(s)}}static decodeCreateWithSeed(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);const{base:t,seed:r,lamports:s,space:i,programId:o}=Ue(ze.CreateWithSeed,e.data);return{fromPubkey:e.keys[0].pubkey,newAccountPubkey:e.keys[1].pubkey,basePubkey:new Y(t),seed:r,lamports:s,space:i,programId:new Y(o)}}static decodeNonceInitialize(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);const{authorized:t}=Ue(ze.InitializeNonceAccount,e.data);return{noncePubkey:e.keys[0].pubkey,authorizedPubkey:new Y(t)}}static decodeNonceAdvance(e){return this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3),Ue(ze.AdvanceNonceAccount,e.data),{noncePubkey:e.keys[0].pubkey,authorizedPubkey:e.keys[2].pubkey}}static decodeNonceWithdraw(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,5);const{lamports:t}=Ue(ze.WithdrawNonceAccount,e.data);return{noncePubkey:e.keys[0].pubkey,toPubkey:e.keys[1].pubkey,authorizedPubkey:e.keys[4].pubkey,lamports:t}}static decodeNonceAuthorize(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);const{authorized:t}=Ue(ze.AuthorizeNonceAccount,e.data);return{noncePubkey:e.keys[0].pubkey,authorizedPubkey:e.keys[1].pubkey,newAuthorizedPubkey:new Y(t)}}static checkProgramId(e){if(!e.equals(Bt.programId))throw new Error("invalid instruction; programId is not SystemProgram")}static checkKeyLength(e,t){if(e.length<t)throw new Error(`invalid instruction; found ${e.length} keys, expected at least ${t}`)}}const ze=Object.freeze({Create:{index:0,layout:exports.struct([exports.u32("instruction"),exports.ns64("lamports"),exports.ns64("space"),Be("programId")])},Assign:{index:1,layout:exports.struct([exports.u32("instruction"),Be("programId")])},Transfer:{index:2,layout:exports.struct([exports.u32("instruction"),Qr("lamports")])},CreateWithSeed:{index:3,layout:exports.struct([exports.u32("instruction"),Be("base"),br("seed"),exports.ns64("lamports"),exports.ns64("space"),Be("programId")])},AdvanceNonceAccount:{index:4,layout:exports.struct([exports.u32("instruction")])},WithdrawNonceAccount:{index:5,layout:exports.struct([exports.u32("instruction"),exports.ns64("lamports")])},InitializeNonceAccount:{index:6,layout:exports.struct([exports.u32("instruction"),Be("authorized")])},AuthorizeNonceAccount:{index:7,layout:exports.struct([exports.u32("instruction"),Be("authorized")])},Allocate:{index:8,layout:exports.struct([exports.u32("instruction"),exports.ns64("space")])},AllocateWithSeed:{index:9,layout:exports.struct([exports.u32("instruction"),Be("base"),br("seed"),exports.ns64("space"),Be("programId")])},AssignWithSeed:{index:10,layout:exports.struct([exports.u32("instruction"),Be("base"),br("seed"),Be("programId")])},TransferWithSeed:{index:11,layout:exports.struct([exports.u32("instruction"),Qr("lamports"),br("seed"),Be("programId")])},UpgradeNonceAccount:{index:12,layout:exports.struct([exports.u32("instruction")])}});class Bt{constructor(){}static createAccount(e){const t=ze.Create,r=Se(t,{lamports:e.lamports,space:e.space,programId:ge(e.programId.toBuffer())});return new We({keys:[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.newAccountPubkey,isSigner:!0,isWritable:!0}],programId:this.programId,data:r})}static transfer(e){let t,r;if("basePubkey"in e){const s=ze.TransferWithSeed;t=Se(s,{lamports:BigInt(e.lamports),seed:e.seed,programId:ge(e.programId.toBuffer())}),r=[{pubkey:e.fromPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0}]}else{const s=ze.Transfer;t=Se(s,{lamports:BigInt(e.lamports)}),r=[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0}]}return new We({keys:r,programId:this.programId,data:t})}static assign(e){let t,r;if("basePubkey"in e){const s=ze.AssignWithSeed;t=Se(s,{base:ge(e.basePubkey.toBuffer()),seed:e.seed,programId:ge(e.programId.toBuffer())}),r=[{pubkey:e.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1}]}else{const s=ze.Assign;t=Se(s,{programId:ge(e.programId.toBuffer())}),r=[{pubkey:e.accountPubkey,isSigner:!0,isWritable:!0}]}return new We({keys:r,programId:this.programId,data:t})}static createAccountWithSeed(e){const t=ze.CreateWithSeed,r=Se(t,{base:ge(e.basePubkey.toBuffer()),seed:e.seed,lamports:e.lamports,space:e.space,programId:ge(e.programId.toBuffer())});let s=[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.newAccountPubkey,isSigner:!1,isWritable:!0}];return e.basePubkey.equals(e.fromPubkey)||s.push({pubkey:e.basePubkey,isSigner:!0,isWritable:!1}),new We({keys:s,programId:this.programId,data:r})}static createNonceAccount(e){const t=new Fe;"basePubkey"in e&&"seed"in e?t.add(Bt.createAccountWithSeed({fromPubkey:e.fromPubkey,newAccountPubkey:e.noncePubkey,basePubkey:e.basePubkey,seed:e.seed,lamports:e.lamports,space:yc,programId:this.programId})):t.add(Bt.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.noncePubkey,lamports:e.lamports,space:yc,programId:this.programId}));const r={noncePubkey:e.noncePubkey,authorizedPubkey:e.authorizedPubkey};return t.add(this.nonceInitialize(r)),t}static nonceInitialize(e){const t=ze.InitializeNonceAccount,r=Se(t,{authorized:ge(e.authorizedPubkey.toBuffer())}),s={keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:Ti,isSigner:!1,isWritable:!1},{pubkey:Sr,isSigner:!1,isWritable:!1}],programId:this.programId,data:r};return new We(s)}static nonceAdvance(e){const t=ze.AdvanceNonceAccount,r=Se(t),s={keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:Ti,isSigner:!1,isWritable:!1},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:r};return new We(s)}static nonceWithdraw(e){const t=ze.WithdrawNonceAccount,r=Se(t,{lamports:e.lamports});return new We({keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0},{pubkey:Ti,isSigner:!1,isWritable:!1},{pubkey:Sr,isSigner:!1,isWritable:!1},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:r})}static nonceAuthorize(e){const t=ze.AuthorizeNonceAccount,r=Se(t,{authorized:ge(e.newAuthorizedPubkey.toBuffer())});return new We({keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:r})}static allocate(e){let t,r;if("basePubkey"in e){const s=ze.AllocateWithSeed;t=Se(s,{base:ge(e.basePubkey.toBuffer()),seed:e.seed,space:e.space,programId:ge(e.programId.toBuffer())}),r=[{pubkey:e.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1}]}else{const s=ze.Allocate;t=Se(s,{space:e.space}),r=[{pubkey:e.accountPubkey,isSigner:!0,isWritable:!0}]}return new We({keys:r,programId:this.programId,data:t})}}Bt.programId=new Y("11111111111111111111111111111111");const M3=nr-300;class Dr{constructor(){}static getMinNumSignatures(e){return 2*(Math.ceil(e/Dr.chunkSize)+1+1)}static async load(e,t,r,s,i){{const E=await e.getMinimumBalanceForRentExemption(i.length),S=await e.getAccountInfo(r.publicKey,"confirmed");let A=null;if(S!==null){if(S.executable)return console.error("Program load failed, account is already executable"),!1;S.data.length!==i.length&&(A=A||new Fe,A.add(Bt.allocate({accountPubkey:r.publicKey,space:i.length}))),S.owner.equals(s)||(A=A||new Fe,A.add(Bt.assign({accountPubkey:r.publicKey,programId:s}))),S.lamports<E&&(A=A||new Fe,A.add(Bt.transfer({fromPubkey:t.publicKey,toPubkey:r.publicKey,lamports:E-S.lamports})))}else A=new Fe().add(Bt.createAccount({fromPubkey:t.publicKey,newAccountPubkey:r.publicKey,lamports:E>0?E:1,space:i.length,programId:s}));A!==null&&await gc(e,A,[t,r],{commitment:"confirmed"})}const o=exports.struct([exports.u32("instruction"),exports.u32("offset"),exports.u32("bytesLength"),exports.u32("bytesLengthPadding"),exports.seq(exports.u8("byte"),tr(exports.u32(),-8),"bytes")]),a=Dr.chunkSize;let l=0,h=i,m=[];for(;h.length>0;){const E=h.slice(0,a),S=oe.Buffer.alloc(a+16);o.encode({instruction:0,offset:l,bytes:E,bytesLength:0,bytesLengthPadding:0},S);const A=new Fe().add({keys:[{pubkey:r.publicKey,isSigner:!0,isWritable:!0}],programId:s,data:S});m.push(gc(e,A,[t,r],{commitment:"confirmed"})),e._rpcEndpoint.includes("solana.com")&&await dr(1e3/4),l+=a,h=h.slice(a)}await Promise.all(m);{const E=exports.struct([exports.u32("instruction")]),S=oe.Buffer.alloc(E.span);E.encode({instruction:1},S);const A=new Fe().add({keys:[{pubkey:r.publicKey,isSigner:!0,isWritable:!0},{pubkey:Sr,isSigner:!1,isWritable:!1}],programId:s,data:S}),g="processed",D=await e.sendTransaction(A,[t,r],{preflightCommitment:g}),{context:x,value:U}=await e.confirmTransaction({signature:D,lastValidBlockHeight:A.lastValidBlockHeight,blockhash:A.recentBlockhash},g);if(U.err)throw new Error(`Transaction ${D} failed (${JSON.stringify(U)})`);for(;;){try{if(await e.getSlot({commitment:g})>x.slot)break}catch{}await new Promise(R=>setTimeout(R,Math.round(_h/2)))}}return!0}}Dr.chunkSize=M3;const R3=new Y("BPFLoader2111111111111111111111111111111111");class W3{static getMinNumSignatures(e){return Dr.getMinNumSignatures(e)}static load(e,t,r,s,i){return Dr.load(e,t,r,i,s)}}function P3(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Da,ru;function L3(){if(ru)return Da;ru=1;var n=Object.prototype.toString,e=Object.keys||function(r){var s=[];for(var i in r)s.push(i);return s};function t(r,s){var i,o,a,l,h,m,E;if(r===!0)return"true";if(r===!1)return"false";switch(typeof r){case"object":if(r===null)return null;if(r.toJSON&&typeof r.toJSON=="function")return t(r.toJSON(),s);if(E=n.call(r),E==="[object Array]"){for(a="[",o=r.length-1,i=0;i<o;i++)a+=t(r[i],!0)+",";return o>-1&&(a+=t(r[i],!0)),a+"]"}else if(E==="[object Object]"){for(l=e(r).sort(),o=l.length,a="",i=0;i<o;)h=l[i],m=t(r[h],!1),m!==void 0&&(a&&(a+=","),a+=JSON.stringify(h)+":"+m),i++;return"{"+a+"}"}else return JSON.stringify(r);case"function":case"undefined":return s?null:void 0;case"string":return JSON.stringify(r);default:return isFinite(r)?r:null}}return Da=function(r){var s=t(r,!1);if(s!==void 0)return""+s},Da}var O3=L3(),su=P3(O3);const Es=32;function va(n){let e=0;for(;n>1;)n/=2,e++;return e}function N3(n){return n===0?1:(n--,n|=n>>1,n|=n>>2,n|=n>>4,n|=n>>8,n|=n>>16,n|=n>>32,n+1)}class Ph{constructor(e,t,r,s,i){this.slotsPerEpoch=void 0,this.leaderScheduleSlotOffset=void 0,this.warmup=void 0,this.firstNormalEpoch=void 0,this.firstNormalSlot=void 0,this.slotsPerEpoch=e,this.leaderScheduleSlotOffset=t,this.warmup=r,this.firstNormalEpoch=s,this.firstNormalSlot=i}getEpoch(e){return this.getEpochAndSlotIndex(e)[0]}getEpochAndSlotIndex(e){if(e<this.firstNormalSlot){const t=va(N3(e+Es+1))-va(Es)-1,r=this.getSlotsInEpoch(t),s=e-(r-Es);return[t,s]}else{const t=e-this.firstNormalSlot,r=Math.floor(t/this.slotsPerEpoch),s=this.firstNormalEpoch+r,i=t%this.slotsPerEpoch;return[s,i]}}getFirstSlotInEpoch(e){return e<=this.firstNormalEpoch?(Math.pow(2,e)-1)*Es:(e-this.firstNormalEpoch)*this.slotsPerEpoch+this.firstNormalSlot}getLastSlotInEpoch(e){return this.getFirstSlotInEpoch(e)+this.getSlotsInEpoch(e)-1}getSlotsInEpoch(e){return e<this.firstNormalEpoch?Math.pow(2,e+va(Es)):this.slotsPerEpoch}}var z3=globalThis.fetch;class H3 extends d3{constructor(e,t,r){const s=i=>{const o=c3(i,{autoconnect:!0,max_reconnects:5,reconnect:!0,reconnect_interval:1e3,...t});return"socket"in o?this.underlyingSocket=o.socket:this.underlyingSocket=o,o};super(s,e,t,r),this.underlyingSocket=void 0}call(...e){var r;const t=(r=this.underlyingSocket)==null?void 0:r.readyState;return t===1?super.call(...e):Promise.reject(new Error("Tried to call a JSON-RPC method `"+e[0]+"` but the socket was not `CONNECTING` or `OPEN` (`readyState` was "+t+")"))}notify(...e){var r;const t=(r=this.underlyingSocket)==null?void 0:r.readyState;return t===1?super.notify(...e):Promise.reject(new Error("Tried to send a JSON-RPC notification `"+e[0]+"` but the socket was not `CONNECTING` or `OPEN` (`readyState` was "+t+")"))}}function q3(n,e){let t;try{t=n.layout.decode(e)}catch(r){throw new Error("invalid instruction; "+r)}if(t.typeIndex!==n.index)throw new Error(`invalid account data; account type mismatch ${t.typeIndex} != ${n.index}`);return t}const iu=56;class Gi{constructor(e){this.key=void 0,this.state=void 0,this.key=e.key,this.state=e.state}isActive(){const e=BigInt("0xffffffffffffffff");return this.state.deactivationSlot===e}static deserialize(e){const t=q3(K3,e),r=e.length-iu;Te(r>=0,"lookup table is invalid"),Te(r%32===0,"lookup table is invalid");const s=r/32,{addresses:i}=exports.struct([exports.seq(Be(),s,"addresses")]).decode(e.slice(iu));return{deactivationSlot:t.deactivationSlot,lastExtendedSlot:t.lastExtendedSlot,lastExtendedSlotStartIndex:t.lastExtendedStartIndex,authority:t.authority.length!==0?new Y(t.authority[0]):void 0,addresses:i.map(o=>new Y(o))}}}const K3={index:1,layout:exports.struct([exports.u32("typeIndex"),Qr("deactivationSlot"),It("lastExtendedSlot"),exports.u8("lastExtendedStartIndex"),exports.u8(),exports.seq(Be(),tr(exports.u8(),-1),"authority")])},j3=/^[^:]+:\/\/([^:[]+|\[[^\]]+\])(:\d+)?(.*)/i;function $3(n){const e=n.match(j3);if(e==null)throw TypeError(`Failed to validate endpoint URL \`${n}\``);const[t,r,s,i]=e,o=n.startsWith("https:")?"wss:":"ws:",a=s==null?null:parseInt(s.slice(1),10),l=a==null?"":`:${a+1}`;return`${o}//${r}${l}${i}`}const Xe=si(El(Y),X(),n=>new Y(n)),Lh=Bl([X(),Ye("base64")]),kl=si(El(oe.Buffer),Lh,n=>oe.Buffer.from(n[0],"base64")),Oh=30*1e3;function V3(n){if(/^https?:/.test(n)===!1)throw new TypeError("Endpoint URL must start with `http:` or `https:`.");return n}function Ne(n){let e,t;if(typeof n=="string")e=n;else if(n){const{commitment:r,...s}=n;e=r,t=s}return{commitment:e,config:t}}function ou(n){return n.map(e=>"memcmp"in e?{...e,memcmp:{...e.memcmp,encoding:e.memcmp.encoding??"base58"}}:e)}function Nh(n){return Kt([j({jsonrpc:Ye("2.0"),id:X(),result:n}),j({jsonrpc:Ye("2.0"),id:X(),error:j({code:ms(),message:X(),data:ce(_8())})})])}const G3=Nh(ms());function pe(n){return si(Nh(n),G3,e=>"error"in e?e:{...e,result:J(e.result,n)})}function Qe(n){return pe(j({context:j({slot:L()}),value:n}))}function Uo(n){return j({context:j({slot:L()}),value:n})}function ka(n,e){return n===0?new ir({header:e.header,staticAccountKeys:e.accountKeys.map(t=>new Y(t)),recentBlockhash:e.recentBlockhash,compiledInstructions:e.instructions.map(t=>({programIdIndex:t.programIdIndex,accountKeyIndexes:t.accounts,data:vt.decode(t.data)})),addressTableLookups:e.addressTableLookups}):new cn(e)}const Y3=j({foundation:L(),foundationTerm:L(),initial:L(),taper:L(),terminal:L()}),X3=pe(Q(te(j({epoch:L(),effectiveSlot:L(),amount:L(),postBalance:L(),commission:ce(te(L()))})))),Z3=Q(j({slot:L(),prioritizationFee:L()})),J3=j({total:L(),validator:L(),foundation:L(),epoch:L()}),Q3=j({epoch:L(),slotIndex:L(),slotsInEpoch:L(),absoluteSlot:L(),blockHeight:ce(L()),transactionCount:ce(L())}),e4=j({slotsPerEpoch:L(),leaderScheduleSlotOffset:L(),warmup:kn(),firstNormalEpoch:L(),firstNormalSlot:L()}),t4=Eh(X(),Q(L())),_r=te(Kt([j({}),X()])),n4=j({err:_r}),r4=Ye("receivedSignature"),s4=j({"solana-core":X(),"feature-set":ce(L())}),i4=j({program:X(),programId:Xe,parsed:ms()}),o4=j({programId:Xe,accounts:Q(Xe),data:X()}),au=Qe(j({err:te(Kt([j({}),X()])),logs:te(Q(X())),accounts:ce(te(Q(te(j({executable:kn(),owner:X(),lamports:L(),data:Q(X()),rentEpoch:ce(L())}))))),unitsConsumed:ce(L()),returnData:ce(te(j({programId:X(),data:Bl([X(),Ye("base64")])}))),innerInstructions:ce(te(Q(j({index:L(),instructions:Q(Kt([i4,o4]))}))))})),a4=Qe(j({byIdentity:Eh(X(),Q(L())),range:j({firstSlot:L(),lastSlot:L()})}));function c4(n,e,t,r,s,i){const o=t||z3;let a;i!=null&&console.warn("You have supplied an `httpAgent` when creating a `Connection` in a browser environment.It has been ignored; `httpAgent` is only used in Node environments.");let l;return r&&(l=async(m,E)=>{const S=await new Promise((A,g)=>{try{r(m,E,(D,x)=>A([D,x]))}catch(D){g(D)}});return await o(...S)}),new vh(async(m,E)=>{const S={method:"POST",body:m,agent:a,headers:Object.assign({"Content-Type":"application/json"},e||{},c6)};try{let A=5,g,D=500;for(;l?g=await l(n,S):g=await o(n,S),!(g.status!==429||s===!0||(A-=1,A===0));)console.error(`Server responded with ${g.status} ${g.statusText}. Retrying after ${D}ms delay...`),await dr(D),D*=2;const x=await g.text();g.ok?E(null,x):E(new Error(`${g.status} ${g.statusText}: ${x}`))}catch(A){A instanceof Error&&E(A)}},{})}function l4(n){return(e,t)=>new Promise((r,s)=>{n.request(e,t,(i,o)=>{if(i){s(i);return}r(o)})})}function d4(n){return e=>new Promise((t,r)=>{e.length===0&&t([]);const s=e.map(i=>n.request(i.methodName,i.args));n.request(s,(i,o)=>{if(i){r(i);return}t(o)})})}const u4=pe(Y3),f4=pe(J3),h4=pe(Z3),m4=pe(Q3),b4=pe(e4),p4=pe(t4),g4=pe(L()),y4=Qe(j({total:L(),circulating:L(),nonCirculating:L(),nonCirculatingAccounts:Q(Xe)})),wc=j({amount:X(),uiAmount:te(L()),decimals:L(),uiAmountString:ce(X())}),w4=Qe(Q(j({address:Xe,amount:X(),uiAmount:te(L()),decimals:L(),uiAmountString:ce(X())}))),A4=Qe(Q(j({pubkey:Xe,account:j({executable:kn(),owner:Xe,lamports:L(),data:kl,rentEpoch:L()})}))),Ac=j({program:X(),parsed:ms(),space:L()}),E4=Qe(Q(j({pubkey:Xe,account:j({executable:kn(),owner:Xe,lamports:L(),data:Ac,rentEpoch:L()})}))),B4=Qe(Q(j({lamports:L(),address:Xe}))),$s=j({executable:kn(),owner:Xe,lamports:L(),data:kl,rentEpoch:L()}),x4=j({pubkey:Xe,account:$s}),C4=si(Kt([El(oe.Buffer),Ac]),Kt([Lh,Ac]),n=>Array.isArray(n)?J(n,kl):n),Ec=j({executable:kn(),owner:Xe,lamports:L(),data:C4,rentEpoch:L()}),S4=j({pubkey:Xe,account:Ec}),D4=j({state:Kt([Ye("active"),Ye("inactive"),Ye("activating"),Ye("deactivating")]),active:L(),inactive:L()}),v4=pe(Q(j({signature:X(),slot:L(),err:_r,memo:te(X()),blockTime:ce(te(L()))}))),k4=pe(Q(j({signature:X(),slot:L(),err:_r,memo:te(X()),blockTime:ce(te(L()))}))),F4=j({subscription:L(),result:Uo($s)}),T4=j({pubkey:Xe,account:$s}),I4=j({subscription:L(),result:Uo(T4)}),U4=j({parent:L(),slot:L(),root:L()}),_4=j({subscription:L(),result:U4}),M4=Kt([j({type:Kt([Ye("firstShredReceived"),Ye("completed"),Ye("optimisticConfirmation"),Ye("root")]),slot:L(),timestamp:L()}),j({type:Ye("createdBank"),parent:L(),slot:L(),timestamp:L()}),j({type:Ye("frozen"),slot:L(),timestamp:L(),stats:j({numTransactionEntries:L(),numSuccessfulTransactions:L(),numFailedTransactions:L(),maxTransactionsPerEntry:L()})}),j({type:Ye("dead"),slot:L(),timestamp:L(),err:X()})]),R4=j({subscription:L(),result:M4}),W4=j({subscription:L(),result:Uo(Kt([n4,r4]))}),P4=j({subscription:L(),result:L()}),L4=j({pubkey:X(),gossip:te(X()),tpu:te(X()),rpc:te(X()),version:te(X())}),cu=j({votePubkey:X(),nodePubkey:X(),activatedStake:L(),epochVoteAccount:kn(),epochCredits:Q(Bl([L(),L(),L()])),commission:L(),lastVote:L(),rootSlot:te(L())}),O4=pe(j({current:Q(cu),delinquent:Q(cu)})),N4=Kt([Ye("processed"),Ye("confirmed"),Ye("finalized")]),z4=j({slot:L(),confirmations:te(L()),err:_r,confirmationStatus:ce(N4)}),H4=Qe(Q(te(z4))),q4=pe(L()),zh=j({accountKey:Xe,writableIndexes:Q(L()),readonlyIndexes:Q(L())}),Fl=j({signatures:Q(X()),message:j({accountKeys:Q(X()),header:j({numRequiredSignatures:L(),numReadonlySignedAccounts:L(),numReadonlyUnsignedAccounts:L()}),instructions:Q(j({accounts:Q(L()),data:X(),programIdIndex:L()})),recentBlockhash:X(),addressTableLookups:ce(Q(zh))})}),Hh=j({pubkey:Xe,signer:kn(),writable:kn(),source:ce(Kt([Ye("transaction"),Ye("lookupTable")]))}),qh=j({accountKeys:Q(Hh),signatures:Q(X())}),Kh=j({parsed:ms(),program:X(),programId:Xe}),jh=j({accounts:Q(Xe),data:X(),programId:Xe}),K4=Kt([jh,Kh]),j4=Kt([j({parsed:ms(),program:X(),programId:X()}),j({accounts:Q(X()),data:X(),programId:X()})]),$h=si(K4,j4,n=>"accounts"in n?J(n,jh):J(n,Kh)),Vh=j({signatures:Q(X()),message:j({accountKeys:Q(Hh),instructions:Q($h),recentBlockhash:X(),addressTableLookups:ce(te(Q(zh)))})}),Yi=j({accountIndex:L(),mint:X(),owner:ce(X()),programId:ce(X()),uiTokenAmount:wc}),Gh=j({writable:Q(Xe),readonly:Q(Xe)}),_o=j({err:_r,fee:L(),innerInstructions:ce(te(Q(j({index:L(),instructions:Q(j({accounts:Q(L()),data:X(),programIdIndex:L()}))})))),preBalances:Q(L()),postBalances:Q(L()),logMessages:ce(te(Q(X()))),preTokenBalances:ce(te(Q(Yi))),postTokenBalances:ce(te(Q(Yi))),loadedAddresses:ce(Gh),computeUnitsConsumed:ce(L())}),Tl=j({err:_r,fee:L(),innerInstructions:ce(te(Q(j({index:L(),instructions:Q($h)})))),preBalances:Q(L()),postBalances:Q(L()),logMessages:ce(te(Q(X()))),preTokenBalances:ce(te(Q(Yi))),postTokenBalances:ce(te(Q(Yi))),loadedAddresses:ce(Gh),computeUnitsConsumed:ce(L())}),bs=Kt([Ye(0),Ye("legacy")]),Mr=j({pubkey:X(),lamports:L(),postBalance:te(L()),rewardType:te(X()),commission:ce(te(L()))}),$4=pe(te(j({blockhash:X(),previousBlockhash:X(),parentSlot:L(),transactions:Q(j({transaction:Fl,meta:te(_o),version:ce(bs)})),rewards:ce(Q(Mr)),blockTime:te(L()),blockHeight:te(L())}))),V4=pe(te(j({blockhash:X(),previousBlockhash:X(),parentSlot:L(),rewards:ce(Q(Mr)),blockTime:te(L()),blockHeight:te(L())}))),G4=pe(te(j({blockhash:X(),previousBlockhash:X(),parentSlot:L(),transactions:Q(j({transaction:qh,meta:te(_o),version:ce(bs)})),rewards:ce(Q(Mr)),blockTime:te(L()),blockHeight:te(L())}))),Y4=pe(te(j({blockhash:X(),previousBlockhash:X(),parentSlot:L(),transactions:Q(j({transaction:Vh,meta:te(Tl),version:ce(bs)})),rewards:ce(Q(Mr)),blockTime:te(L()),blockHeight:te(L())}))),X4=pe(te(j({blockhash:X(),previousBlockhash:X(),parentSlot:L(),transactions:Q(j({transaction:qh,meta:te(Tl),version:ce(bs)})),rewards:ce(Q(Mr)),blockTime:te(L()),blockHeight:te(L())}))),Z4=pe(te(j({blockhash:X(),previousBlockhash:X(),parentSlot:L(),rewards:ce(Q(Mr)),blockTime:te(L()),blockHeight:te(L())}))),J4=pe(te(j({blockhash:X(),previousBlockhash:X(),parentSlot:L(),transactions:Q(j({transaction:Fl,meta:te(_o)})),rewards:ce(Q(Mr)),blockTime:te(L())}))),lu=pe(te(j({blockhash:X(),previousBlockhash:X(),parentSlot:L(),signatures:Q(X()),blockTime:te(L())}))),Fa=pe(te(j({slot:L(),meta:te(_o),blockTime:ce(te(L())),transaction:Fl,version:ce(bs)}))),mi=pe(te(j({slot:L(),transaction:Vh,meta:te(Tl),blockTime:ce(te(L())),version:ce(bs)}))),Q4=Qe(j({blockhash:X(),lastValidBlockHeight:L()})),e6=Qe(kn()),t6=j({slot:L(),numTransactions:L(),numSlots:L(),samplePeriodSecs:L()}),n6=pe(Q(t6)),r6=Qe(te(j({feeCalculator:j({lamportsPerSignature:L()})}))),s6=pe(X()),i6=pe(X()),o6=j({err:_r,logs:Q(X()),signature:X()}),a6=j({result:Uo(o6),subscription:L()}),c6={"solana-client":"js/1.0.0-maintenance"};class Yh{constructor(e,t){this._commitment=void 0,this._confirmTransactionInitialTimeout=void 0,this._rpcEndpoint=void 0,this._rpcWsEndpoint=void 0,this._rpcClient=void 0,this._rpcRequest=void 0,this._rpcBatchRequest=void 0,this._rpcWebSocket=void 0,this._rpcWebSocketConnected=!1,this._rpcWebSocketHeartbeat=null,this._rpcWebSocketIdleTimeout=null,this._rpcWebSocketGeneration=0,this._disableBlockhashCaching=!1,this._pollingBlockhash=!1,this._blockhashInfo={latestBlockhash:null,lastFetch:0,transactionSignatures:[],simulatedSignatures:[]},this._nextClientSubscriptionId=0,this._subscriptionDisposeFunctionsByClientSubscriptionId={},this._subscriptionHashByClientSubscriptionId={},this._subscriptionStateChangeCallbacksByHash={},this._subscriptionCallbacksByServerSubscriptionId={},this._subscriptionsByHash={},this._subscriptionsAutoDisposedByRpc=new Set,this.getBlockHeight=(()=>{const h={};return async m=>{const{commitment:E,config:S}=Ne(m),A=this._buildArgs([],E,void 0,S),g=su(A);return h[g]=h[g]??(async()=>{try{const D=await this._rpcRequest("getBlockHeight",A),x=J(D,pe(L()));if("error"in x)throw new se(x.error,"failed to get block height information");return x.result}finally{delete h[g]}})(),await h[g]}})();let r,s,i,o,a,l;t&&typeof t=="string"?this._commitment=t:t&&(this._commitment=t.commitment,this._confirmTransactionInitialTimeout=t.confirmTransactionInitialTimeout,r=t.wsEndpoint,s=t.httpHeaders,i=t.fetch,o=t.fetchMiddleware,a=t.disableRetryOnRateLimit,l=t.httpAgent),this._rpcEndpoint=V3(e),this._rpcWsEndpoint=r||$3(e),this._rpcClient=c4(e,s,i,o,a,l),this._rpcRequest=l4(this._rpcClient),this._rpcBatchRequest=d4(this._rpcClient),this._rpcWebSocket=new H3(this._rpcWsEndpoint,{autoconnect:!1,max_reconnects:1/0}),this._rpcWebSocket.on("open",this._wsOnOpen.bind(this)),this._rpcWebSocket.on("error",this._wsOnError.bind(this)),this._rpcWebSocket.on("close",this._wsOnClose.bind(this)),this._rpcWebSocket.on("accountNotification",this._wsOnAccountNotification.bind(this)),this._rpcWebSocket.on("programNotification",this._wsOnProgramAccountNotification.bind(this)),this._rpcWebSocket.on("slotNotification",this._wsOnSlotNotification.bind(this)),this._rpcWebSocket.on("slotsUpdatesNotification",this._wsOnSlotUpdatesNotification.bind(this)),this._rpcWebSocket.on("signatureNotification",this._wsOnSignatureNotification.bind(this)),this._rpcWebSocket.on("rootNotification",this._wsOnRootNotification.bind(this)),this._rpcWebSocket.on("logsNotification",this._wsOnLogsNotification.bind(this))}get commitment(){return this._commitment}get rpcEndpoint(){return this._rpcEndpoint}async getBalanceAndContext(e,t){const{commitment:r,config:s}=Ne(t),i=this._buildArgs([e.toBase58()],r,void 0,s),o=await this._rpcRequest("getBalance",i),a=J(o,Qe(L()));if("error"in a)throw new se(a.error,`failed to get balance for ${e.toBase58()}`);return a.result}async getBalance(e,t){return await this.getBalanceAndContext(e,t).then(r=>r.value).catch(r=>{throw new Error("failed to get balance of account "+e.toBase58()+": "+r)})}async getBlockTime(e){const t=await this._rpcRequest("getBlockTime",[e]),r=J(t,pe(te(L())));if("error"in r)throw new se(r.error,`failed to get block time for slot ${e}`);return r.result}async getMinimumLedgerSlot(){const e=await this._rpcRequest("minimumLedgerSlot",[]),t=J(e,pe(L()));if("error"in t)throw new se(t.error,"failed to get minimum ledger slot");return t.result}async getFirstAvailableBlock(){const e=await this._rpcRequest("getFirstAvailableBlock",[]),t=J(e,g4);if("error"in t)throw new se(t.error,"failed to get first available block");return t.result}async getSupply(e){let t={};typeof e=="string"?t={commitment:e}:e?t={...e,commitment:e&&e.commitment||this.commitment}:t={commitment:this.commitment};const r=await this._rpcRequest("getSupply",[t]),s=J(r,y4);if("error"in s)throw new se(s.error,"failed to get supply");return s.result}async getTokenSupply(e,t){const r=this._buildArgs([e.toBase58()],t),s=await this._rpcRequest("getTokenSupply",r),i=J(s,Qe(wc));if("error"in i)throw new se(i.error,"failed to get token supply");return i.result}async getTokenAccountBalance(e,t){const r=this._buildArgs([e.toBase58()],t),s=await this._rpcRequest("getTokenAccountBalance",r),i=J(s,Qe(wc));if("error"in i)throw new se(i.error,"failed to get token account balance");return i.result}async getTokenAccountsByOwner(e,t,r){const{commitment:s,config:i}=Ne(r);let o=[e.toBase58()];"mint"in t?o.push({mint:t.mint.toBase58()}):o.push({programId:t.programId.toBase58()});const a=this._buildArgs(o,s,"base64",i),l=await this._rpcRequest("getTokenAccountsByOwner",a),h=J(l,A4);if("error"in h)throw new se(h.error,`failed to get token accounts owned by account ${e.toBase58()}`);return h.result}async getParsedTokenAccountsByOwner(e,t,r){let s=[e.toBase58()];"mint"in t?s.push({mint:t.mint.toBase58()}):s.push({programId:t.programId.toBase58()});const i=this._buildArgs(s,r,"jsonParsed"),o=await this._rpcRequest("getTokenAccountsByOwner",i),a=J(o,E4);if("error"in a)throw new se(a.error,`failed to get token accounts owned by account ${e.toBase58()}`);return a.result}async getLargestAccounts(e){const t={...e,commitment:e&&e.commitment||this.commitment},r=t.filter||t.commitment?[t]:[],s=await this._rpcRequest("getLargestAccounts",r),i=J(s,B4);if("error"in i)throw new se(i.error,"failed to get largest accounts");return i.result}async getTokenLargestAccounts(e,t){const r=this._buildArgs([e.toBase58()],t),s=await this._rpcRequest("getTokenLargestAccounts",r),i=J(s,w4);if("error"in i)throw new se(i.error,"failed to get token largest accounts");return i.result}async getAccountInfoAndContext(e,t){const{commitment:r,config:s}=Ne(t),i=this._buildArgs([e.toBase58()],r,"base64",s),o=await this._rpcRequest("getAccountInfo",i),a=J(o,Qe(te($s)));if("error"in a)throw new se(a.error,`failed to get info about account ${e.toBase58()}`);return a.result}async getParsedAccountInfo(e,t){const{commitment:r,config:s}=Ne(t),i=this._buildArgs([e.toBase58()],r,"jsonParsed",s),o=await this._rpcRequest("getAccountInfo",i),a=J(o,Qe(te(Ec)));if("error"in a)throw new se(a.error,`failed to get info about account ${e.toBase58()}`);return a.result}async getAccountInfo(e,t){try{return(await this.getAccountInfoAndContext(e,t)).value}catch(r){throw new Error("failed to get info about account "+e.toBase58()+": "+r)}}async getMultipleParsedAccounts(e,t){const{commitment:r,config:s}=Ne(t),i=e.map(h=>h.toBase58()),o=this._buildArgs([i],r,"jsonParsed",s),a=await this._rpcRequest("getMultipleAccounts",o),l=J(a,Qe(Q(te(Ec))));if("error"in l)throw new se(l.error,`failed to get info for accounts ${i}`);return l.result}async getMultipleAccountsInfoAndContext(e,t){const{commitment:r,config:s}=Ne(t),i=e.map(h=>h.toBase58()),o=this._buildArgs([i],r,"base64",s),a=await this._rpcRequest("getMultipleAccounts",o),l=J(a,Qe(Q(te($s))));if("error"in l)throw new se(l.error,`failed to get info for accounts ${i}`);return l.result}async getMultipleAccountsInfo(e,t){return(await this.getMultipleAccountsInfoAndContext(e,t)).value}async getStakeActivation(e,t,r){const{commitment:s,config:i}=Ne(t),o=this._buildArgs([e.toBase58()],s,void 0,{...i,epoch:r??(i==null?void 0:i.epoch)}),a=await this._rpcRequest("getStakeActivation",o),l=J(a,pe(D4));if("error"in l)throw new se(l.error,`failed to get Stake Activation ${e.toBase58()}`);return l.result}async getProgramAccounts(e,t){const{commitment:r,config:s}=Ne(t),{encoding:i,...o}=s||{},a=this._buildArgs([e.toBase58()],r,i||"base64",{...o,...o.filters?{filters:ou(o.filters)}:null}),l=await this._rpcRequest("getProgramAccounts",a),h=Q(x4),m=o.withContext===!0?J(l,Qe(h)):J(l,pe(h));if("error"in m)throw new se(m.error,`failed to get accounts owned by program ${e.toBase58()}`);return m.result}async getParsedProgramAccounts(e,t){const{commitment:r,config:s}=Ne(t),i=this._buildArgs([e.toBase58()],r,"jsonParsed",s),o=await this._rpcRequest("getProgramAccounts",i),a=J(o,pe(Q(S4)));if("error"in a)throw new se(a.error,`failed to get accounts owned by program ${e.toBase58()}`);return a.result}async confirmTransaction(e,t){var i;let r;if(typeof e=="string")r=e;else{const o=e;if((i=o.abortSignal)!=null&&i.aborted)return Promise.reject(o.abortSignal.reason);r=o.signature}let s;try{s=vt.decode(r)}catch{throw new Error("signature must be base58 encoded: "+r)}return Te(s.length===64,"signature has invalid length"),typeof e=="string"?await this.confirmTransactionUsingLegacyTimeoutStrategy({commitment:t||this.commitment,signature:r}):"lastValidBlockHeight"in e?await this.confirmTransactionUsingBlockHeightExceedanceStrategy({commitment:t||this.commitment,strategy:e}):await this.confirmTransactionUsingDurableNonceStrategy({commitment:t||this.commitment,strategy:e})}getCancellationPromise(e){return new Promise((t,r)=>{e!=null&&(e.aborted?r(e.reason):e.addEventListener("abort",()=>{r(e.reason)}))})}getTransactionConfirmationPromise({commitment:e,signature:t}){let r,s,i=!1;const o=new Promise((l,h)=>{try{r=this.onSignature(t,(E,S)=>{r=void 0;const A={context:S,value:E};l({__type:Rn.PROCESSED,response:A})},e);const m=new Promise(E=>{r==null?E():s=this._onSubscriptionStateChange(r,S=>{S==="subscribed"&&E()})});(async()=>{if(await m,i)return;const E=await this.getSignatureStatus(t);if(i||E==null)return;const{context:S,value:A}=E;if(A!=null)if(A!=null&&A.err)h(A.err);else{switch(e){case"confirmed":case"single":case"singleGossip":{if(A.confirmationStatus==="processed")return;break}case"finalized":case"max":case"root":{if(A.confirmationStatus==="processed"||A.confirmationStatus==="confirmed")return;break}case"processed":case"recent":}i=!0,l({__type:Rn.PROCESSED,response:{context:S,value:A}})}})()}catch(m){h(m)}});return{abortConfirmation:()=>{s&&(s(),s=void 0),r!=null&&(this.removeSignatureListener(r),r=void 0)},confirmationPromise:o}}async confirmTransactionUsingBlockHeightExceedanceStrategy({commitment:e,strategy:{abortSignal:t,lastValidBlockHeight:r,signature:s}}){let i=!1;const o=new Promise(E=>{const S=async()=>{try{return await this.getBlockHeight(e)}catch{return-1}};(async()=>{let A=await S();if(!i){for(;A<=r;)if(await dr(1e3),i||(A=await S(),i))return;E({__type:Rn.BLOCKHEIGHT_EXCEEDED})}})()}),{abortConfirmation:a,confirmationPromise:l}=this.getTransactionConfirmationPromise({commitment:e,signature:s}),h=this.getCancellationPromise(t);let m;try{const E=await Promise.race([h,l,o]);if(E.__type===Rn.PROCESSED)m=E.response;else throw new vo(s)}finally{i=!0,a()}return m}async confirmTransactionUsingDurableNonceStrategy({commitment:e,strategy:{abortSignal:t,minContextSlot:r,nonceAccountPubkey:s,nonceValue:i,signature:o}}){let a=!1;const l=new Promise(A=>{let g=i,D=null;const x=async()=>{try{const{context:U,value:R}=await this.getNonceAndContext(s,{commitment:e,minContextSlot:r});return D=U.slot,R==null?void 0:R.nonce}catch{return g}};(async()=>{if(g=await x(),!a)for(;;){if(i!==g){A({__type:Rn.NONCE_INVALID,slotInWhichNonceDidAdvance:D});return}if(await dr(2e3),a||(g=await x(),a))return}})()}),{abortConfirmation:h,confirmationPromise:m}=this.getTransactionConfirmationPromise({commitment:e,signature:o}),E=this.getCancellationPromise(t);let S;try{const A=await Promise.race([E,m,l]);if(A.__type===Rn.PROCESSED)S=A.response;else{let g;for(;;){const D=await this.getSignatureStatus(o);if(D==null)break;if(D.context.slot<(A.slotInWhichNonceDidAdvance??r)){await dr(400);continue}g=D;break}if(g!=null&&g.value){const D=e||"finalized",{confirmationStatus:x}=g.value;switch(D){case"processed":case"recent":if(x!=="processed"&&x!=="confirmed"&&x!=="finalized")throw new Hr(o);break;case"confirmed":case"single":case"singleGossip":if(x!=="confirmed"&&x!=="finalized")throw new Hr(o);break;case"finalized":case"max":case"root":if(x!=="finalized")throw new Hr(o);break;default:}S={context:g.context,value:{err:g.value.err}}}else throw new Hr(o)}}finally{a=!0,h()}return S}async confirmTransactionUsingLegacyTimeoutStrategy({commitment:e,signature:t}){let r;const s=new Promise(l=>{let h=this._confirmTransactionInitialTimeout||6e4;switch(e){case"processed":case"recent":case"single":case"confirmed":case"singleGossip":{h=this._confirmTransactionInitialTimeout||3e4;break}}r=setTimeout(()=>l({__type:Rn.TIMED_OUT,timeoutMs:h}),h)}),{abortConfirmation:i,confirmationPromise:o}=this.getTransactionConfirmationPromise({commitment:e,signature:t});let a;try{const l=await Promise.race([o,s]);if(l.__type===Rn.PROCESSED)a=l.response;else throw new Dl(t,l.timeoutMs/1e3)}finally{clearTimeout(r),i()}return a}async getClusterNodes(){const e=await this._rpcRequest("getClusterNodes",[]),t=J(e,pe(Q(L4)));if("error"in t)throw new se(t.error,"failed to get cluster nodes");return t.result}async getVoteAccounts(e){const t=this._buildArgs([],e),r=await this._rpcRequest("getVoteAccounts",t),s=J(r,O4);if("error"in s)throw new se(s.error,"failed to get vote accounts");return s.result}async getSlot(e){const{commitment:t,config:r}=Ne(e),s=this._buildArgs([],t,void 0,r),i=await this._rpcRequest("getSlot",s),o=J(i,pe(L()));if("error"in o)throw new se(o.error,"failed to get slot");return o.result}async getSlotLeader(e){const{commitment:t,config:r}=Ne(e),s=this._buildArgs([],t,void 0,r),i=await this._rpcRequest("getSlotLeader",s),o=J(i,pe(X()));if("error"in o)throw new se(o.error,"failed to get slot leader");return o.result}async getSlotLeaders(e,t){const r=[e,t],s=await this._rpcRequest("getSlotLeaders",r),i=J(s,pe(Q(Xe)));if("error"in i)throw new se(i.error,"failed to get slot leaders");return i.result}async getSignatureStatus(e,t){const{context:r,value:s}=await this.getSignatureStatuses([e],t);Te(s.length===1);const i=s[0];return{context:r,value:i}}async getSignatureStatuses(e,t){const r=[e];t&&r.push(t);const s=await this._rpcRequest("getSignatureStatuses",r),i=J(s,H4);if("error"in i)throw new se(i.error,"failed to get signature status");return i.result}async getTransactionCount(e){const{commitment:t,config:r}=Ne(e),s=this._buildArgs([],t,void 0,r),i=await this._rpcRequest("getTransactionCount",s),o=J(i,pe(L()));if("error"in o)throw new se(o.error,"failed to get transaction count");return o.result}async getTotalSupply(e){return(await this.getSupply({commitment:e,excludeNonCirculatingAccountsList:!0})).value.total}async getInflationGovernor(e){const t=this._buildArgs([],e),r=await this._rpcRequest("getInflationGovernor",t),s=J(r,u4);if("error"in s)throw new se(s.error,"failed to get inflation");return s.result}async getInflationReward(e,t,r){const{commitment:s,config:i}=Ne(r),o=this._buildArgs([e.map(h=>h.toBase58())],s,void 0,{...i,epoch:t??(i==null?void 0:i.epoch)}),a=await this._rpcRequest("getInflationReward",o),l=J(a,X3);if("error"in l)throw new se(l.error,"failed to get inflation reward");return l.result}async getInflationRate(){const e=await this._rpcRequest("getInflationRate",[]),t=J(e,f4);if("error"in t)throw new se(t.error,"failed to get inflation rate");return t.result}async getEpochInfo(e){const{commitment:t,config:r}=Ne(e),s=this._buildArgs([],t,void 0,r),i=await this._rpcRequest("getEpochInfo",s),o=J(i,m4);if("error"in o)throw new se(o.error,"failed to get epoch info");return o.result}async getEpochSchedule(){const e=await this._rpcRequest("getEpochSchedule",[]),t=J(e,b4);if("error"in t)throw new se(t.error,"failed to get epoch schedule");const r=t.result;return new Ph(r.slotsPerEpoch,r.leaderScheduleSlotOffset,r.warmup,r.firstNormalEpoch,r.firstNormalSlot)}async getLeaderSchedule(){const e=await this._rpcRequest("getLeaderSchedule",[]),t=J(e,p4);if("error"in t)throw new se(t.error,"failed to get leader schedule");return t.result}async getMinimumBalanceForRentExemption(e,t){const r=this._buildArgs([e],t),s=await this._rpcRequest("getMinimumBalanceForRentExemption",r),i=J(s,q4);return"error"in i?(console.warn("Unable to fetch minimum balance for rent exemption"),0):i.result}async getRecentBlockhashAndContext(e){const{context:t,value:{blockhash:r}}=await this.getLatestBlockhashAndContext(e);return{context:t,value:{blockhash:r,feeCalculator:{get lamportsPerSignature(){throw new Error("The capability to fetch `lamportsPerSignature` using the `getRecentBlockhash` API is no longer offered by the network. Use the `getFeeForMessage` API to obtain the fee for a given message.")},toJSON(){return{}}}}}}async getRecentPerformanceSamples(e){const t=await this._rpcRequest("getRecentPerformanceSamples",e?[e]:[]),r=J(t,n6);if("error"in r)throw new se(r.error,"failed to get recent performance samples");return r.result}async getFeeCalculatorForBlockhash(e,t){const r=this._buildArgs([e],t),s=await this._rpcRequest("getFeeCalculatorForBlockhash",r),i=J(s,r6);if("error"in i)throw new se(i.error,"failed to get fee calculator");const{context:o,value:a}=i.result;return{context:o,value:a!==null?a.feeCalculator:null}}async getFeeForMessage(e,t){const r=ge(e.serialize()).toString("base64"),s=this._buildArgs([r],t),i=await this._rpcRequest("getFeeForMessage",s),o=J(i,Qe(te(L())));if("error"in o)throw new se(o.error,"failed to get fee for message");if(o.result===null)throw new Error("invalid blockhash");return o.result}async getRecentPrioritizationFees(e){var o;const t=(o=e==null?void 0:e.lockedWritableAccounts)==null?void 0:o.map(a=>a.toBase58()),r=t!=null&&t.length?[t]:[],s=await this._rpcRequest("getRecentPrioritizationFees",r),i=J(s,h4);if("error"in i)throw new se(i.error,"failed to get recent prioritization fees");return i.result}async getRecentBlockhash(e){try{return(await this.getRecentBlockhashAndContext(e)).value}catch(t){throw new Error("failed to get recent blockhash: "+t)}}async getLatestBlockhash(e){try{return(await this.getLatestBlockhashAndContext(e)).value}catch(t){throw new Error("failed to get recent blockhash: "+t)}}async getLatestBlockhashAndContext(e){const{commitment:t,config:r}=Ne(e),s=this._buildArgs([],t,void 0,r),i=await this._rpcRequest("getLatestBlockhash",s),o=J(i,Q4);if("error"in o)throw new se(o.error,"failed to get latest blockhash");return o.result}async isBlockhashValid(e,t){const{commitment:r,config:s}=Ne(t),i=this._buildArgs([e],r,void 0,s),o=await this._rpcRequest("isBlockhashValid",i),a=J(o,e6);if("error"in a)throw new se(a.error,"failed to determine if the blockhash `"+e+"`is valid");return a.result}async getVersion(){const e=await this._rpcRequest("getVersion",[]),t=J(e,pe(s4));if("error"in t)throw new se(t.error,"failed to get version");return t.result}async getGenesisHash(){const e=await this._rpcRequest("getGenesisHash",[]),t=J(e,pe(X()));if("error"in t)throw new se(t.error,"failed to get genesis hash");return t.result}async getBlock(e,t){const{commitment:r,config:s}=Ne(t),i=this._buildArgsAtLeastConfirmed([e],r,void 0,s),o=await this._rpcRequest("getBlock",i);try{switch(s==null?void 0:s.transactionDetails){case"accounts":{const a=J(o,G4);if("error"in a)throw a.error;return a.result}case"none":{const a=J(o,V4);if("error"in a)throw a.error;return a.result}default:{const a=J(o,$4);if("error"in a)throw a.error;const{result:l}=a;return l?{...l,transactions:l.transactions.map(({transaction:h,meta:m,version:E})=>({meta:m,transaction:{...h,message:ka(E,h.message)},version:E}))}:null}}}catch(a){throw new se(a,"failed to get confirmed block")}}async getParsedBlock(e,t){const{commitment:r,config:s}=Ne(t),i=this._buildArgsAtLeastConfirmed([e],r,"jsonParsed",s),o=await this._rpcRequest("getBlock",i);try{switch(s==null?void 0:s.transactionDetails){case"accounts":{const a=J(o,X4);if("error"in a)throw a.error;return a.result}case"none":{const a=J(o,Z4);if("error"in a)throw a.error;return a.result}default:{const a=J(o,Y4);if("error"in a)throw a.error;return a.result}}}catch(a){throw new se(a,"failed to get block")}}async getBlockProduction(e){let t,r;if(typeof e=="string")r=e;else if(e){const{commitment:a,...l}=e;r=a,t=l}const s=this._buildArgs([],r,"base64",t),i=await this._rpcRequest("getBlockProduction",s),o=J(i,a4);if("error"in o)throw new se(o.error,"failed to get block production information");return o.result}async getTransaction(e,t){const{commitment:r,config:s}=Ne(t),i=this._buildArgsAtLeastConfirmed([e],r,void 0,s),o=await this._rpcRequest("getTransaction",i),a=J(o,Fa);if("error"in a)throw new se(a.error,"failed to get transaction");const l=a.result;return l&&{...l,transaction:{...l.transaction,message:ka(l.version,l.transaction.message)}}}async getParsedTransaction(e,t){const{commitment:r,config:s}=Ne(t),i=this._buildArgsAtLeastConfirmed([e],r,"jsonParsed",s),o=await this._rpcRequest("getTransaction",i),a=J(o,mi);if("error"in a)throw new se(a.error,"failed to get transaction");return a.result}async getParsedTransactions(e,t){const{commitment:r,config:s}=Ne(t),i=e.map(l=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([l],r,"jsonParsed",s)}));return(await this._rpcBatchRequest(i)).map(l=>{const h=J(l,mi);if("error"in h)throw new se(h.error,"failed to get transactions");return h.result})}async getTransactions(e,t){const{commitment:r,config:s}=Ne(t),i=e.map(l=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([l],r,void 0,s)}));return(await this._rpcBatchRequest(i)).map(l=>{const h=J(l,Fa);if("error"in h)throw new se(h.error,"failed to get transactions");const m=h.result;return m&&{...m,transaction:{...m.transaction,message:ka(m.version,m.transaction.message)}}})}async getConfirmedBlock(e,t){const r=this._buildArgsAtLeastConfirmed([e],t),s=await this._rpcRequest("getBlock",r),i=J(s,J4);if("error"in i)throw new se(i.error,"failed to get confirmed block");const o=i.result;if(!o)throw new Error("Confirmed block "+e+" not found");const a={...o,transactions:o.transactions.map(({transaction:l,meta:h})=>{const m=new cn(l.message);return{meta:h,transaction:{...l,message:m}}})};return{...a,transactions:a.transactions.map(({transaction:l,meta:h})=>({meta:h,transaction:Fe.populate(l.message,l.signatures)}))}}async getBlocks(e,t,r){const s=this._buildArgsAtLeastConfirmed(t!==void 0?[e,t]:[e],r),i=await this._rpcRequest("getBlocks",s),o=J(i,pe(Q(L())));if("error"in o)throw new se(o.error,"failed to get blocks");return o.result}async getBlockSignatures(e,t){const r=this._buildArgsAtLeastConfirmed([e],t,void 0,{transactionDetails:"signatures",rewards:!1}),s=await this._rpcRequest("getBlock",r),i=J(s,lu);if("error"in i)throw new se(i.error,"failed to get block");const o=i.result;if(!o)throw new Error("Block "+e+" not found");return o}async getConfirmedBlockSignatures(e,t){const r=this._buildArgsAtLeastConfirmed([e],t,void 0,{transactionDetails:"signatures",rewards:!1}),s=await this._rpcRequest("getBlock",r),i=J(s,lu);if("error"in i)throw new se(i.error,"failed to get confirmed block");const o=i.result;if(!o)throw new Error("Confirmed block "+e+" not found");return o}async getConfirmedTransaction(e,t){const r=this._buildArgsAtLeastConfirmed([e],t),s=await this._rpcRequest("getTransaction",r),i=J(s,Fa);if("error"in i)throw new se(i.error,"failed to get transaction");const o=i.result;if(!o)return o;const a=new cn(o.transaction.message),l=o.transaction.signatures;return{...o,transaction:Fe.populate(a,l)}}async getParsedConfirmedTransaction(e,t){const r=this._buildArgsAtLeastConfirmed([e],t,"jsonParsed"),s=await this._rpcRequest("getTransaction",r),i=J(s,mi);if("error"in i)throw new se(i.error,"failed to get confirmed transaction");return i.result}async getParsedConfirmedTransactions(e,t){const r=e.map(o=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([o],t,"jsonParsed")}));return(await this._rpcBatchRequest(r)).map(o=>{const a=J(o,mi);if("error"in a)throw new se(a.error,"failed to get confirmed transactions");return a.result})}async getConfirmedSignaturesForAddress(e,t,r){let s={},i=await this.getFirstAvailableBlock();for(;!("until"in s)&&(t--,!(t<=0||t<i));)try{const l=await this.getConfirmedBlockSignatures(t,"finalized");l.signatures.length>0&&(s.until=l.signatures[l.signatures.length-1].toString())}catch(l){if(l instanceof Error&&l.message.includes("skipped"))continue;throw l}let o=await this.getSlot("finalized");for(;!("before"in s)&&(r++,!(r>o));)try{const l=await this.getConfirmedBlockSignatures(r);l.signatures.length>0&&(s.before=l.signatures[l.signatures.length-1].toString())}catch(l){if(l instanceof Error&&l.message.includes("skipped"))continue;throw l}return(await this.getConfirmedSignaturesForAddress2(e,s)).map(l=>l.signature)}async getConfirmedSignaturesForAddress2(e,t,r){const s=this._buildArgsAtLeastConfirmed([e.toBase58()],r,void 0,t),i=await this._rpcRequest("getConfirmedSignaturesForAddress2",s),o=J(i,v4);if("error"in o)throw new se(o.error,"failed to get confirmed signatures for address");return o.result}async getSignaturesForAddress(e,t,r){const s=this._buildArgsAtLeastConfirmed([e.toBase58()],r,void 0,t),i=await this._rpcRequest("getSignaturesForAddress",s),o=J(i,k4);if("error"in o)throw new se(o.error,"failed to get signatures for address");return o.result}async getAddressLookupTable(e,t){const{context:r,value:s}=await this.getAccountInfoAndContext(e,t);let i=null;return s!==null&&(i=new Gi({key:e,state:Gi.deserialize(s.data)})),{context:r,value:i}}async getNonceAndContext(e,t){const{context:r,value:s}=await this.getAccountInfoAndContext(e,t);let i=null;return s!==null&&(i=Io.fromAccountData(s.data)),{context:r,value:i}}async getNonce(e,t){return await this.getNonceAndContext(e,t).then(r=>r.value).catch(r=>{throw new Error("failed to get nonce for account "+e.toBase58()+": "+r)})}async requestAirdrop(e,t){const r=await this._rpcRequest("requestAirdrop",[e.toBase58(),t]),s=J(r,s6);if("error"in s)throw new se(s.error,`airdrop to ${e.toBase58()} failed`);return s.result}async _blockhashWithExpiryBlockHeight(e){if(!e){for(;this._pollingBlockhash;)await dr(100);const r=Date.now()-this._blockhashInfo.lastFetch>=Oh;if(this._blockhashInfo.latestBlockhash!==null&&!r)return this._blockhashInfo.latestBlockhash}return await this._pollNewBlockhash()}async _pollNewBlockhash(){this._pollingBlockhash=!0;try{const e=Date.now(),t=this._blockhashInfo.latestBlockhash,r=t?t.blockhash:null;for(let s=0;s<50;s++){const i=await this.getLatestBlockhash("finalized");if(r!==i.blockhash)return this._blockhashInfo={latestBlockhash:i,lastFetch:Date.now(),transactionSignatures:[],simulatedSignatures:[]},i;await dr(_h/2)}throw new Error(`Unable to obtain a new blockhash after ${Date.now()-e}ms`)}finally{this._pollingBlockhash=!1}}async getStakeMinimumDelegation(e){const{commitment:t,config:r}=Ne(e),s=this._buildArgs([],t,"base64",r),i=await this._rpcRequest("getStakeMinimumDelegation",s),o=J(i,Qe(L()));if("error"in o)throw new se(o.error,"failed to get stake minimum delegation");return o.result}async simulateTransaction(e,t,r){if("message"in e){const D=e.serialize(),x=oe.Buffer.from(D).toString("base64");if(Array.isArray(t)||r!==void 0)throw new Error("Invalid arguments");const U=t||{};U.encoding="base64","commitment"in U||(U.commitment=this.commitment),t&&typeof t=="object"&&"innerInstructions"in t&&(U.innerInstructions=t.innerInstructions);const R=[x,U],F=await this._rpcRequest("simulateTransaction",R),W=J(F,au);if("error"in W)throw new Error("failed to simulate transaction: "+W.error.message);return W.result}let s;if(e instanceof Fe){let g=e;s=new Fe,s.feePayer=g.feePayer,s.instructions=e.instructions,s.nonceInfo=g.nonceInfo,s.signatures=g.signatures}else s=Fe.populate(e),s._message=s._json=void 0;if(t!==void 0&&!Array.isArray(t))throw new Error("Invalid arguments");const i=t;if(s.nonceInfo&&i)s.sign(...i);else{let g=this._disableBlockhashCaching;for(;;){const D=await this._blockhashWithExpiryBlockHeight(g);if(s.lastValidBlockHeight=D.lastValidBlockHeight,s.recentBlockhash=D.blockhash,!i)break;if(s.sign(...i),!s.signature)throw new Error("!signature");const x=s.signature.toString("base64");if(!this._blockhashInfo.simulatedSignatures.includes(x)&&!this._blockhashInfo.transactionSignatures.includes(x)){this._blockhashInfo.simulatedSignatures.push(x);break}else g=!0}}const o=s._compile(),a=o.serialize(),h=s._serialize(a).toString("base64"),m={encoding:"base64",commitment:this.commitment};if(r){const g=(Array.isArray(r)?r:o.nonProgramIds()).map(D=>D.toBase58());m.accounts={encoding:"base64",addresses:g}}i&&(m.sigVerify=!0),t&&typeof t=="object"&&"innerInstructions"in t&&(m.innerInstructions=t.innerInstructions);const E=[h,m],S=await this._rpcRequest("simulateTransaction",E),A=J(S,au);if("error"in A){let g;if("data"in A.error&&(g=A.error.data.logs,g&&Array.isArray(g))){const D=`
15
+ `,x=D+g.join(D);console.error(A.error.message,x)}throw new Jr({action:"simulate",signature:"",transactionMessage:A.error.message,logs:g})}return A.result}async sendTransaction(e,t,r){if("version"in e){if(t&&Array.isArray(t))throw new Error("Invalid arguments");const o=e.serialize();return await this.sendRawTransaction(o,t)}if(t===void 0||!Array.isArray(t))throw new Error("Invalid arguments");const s=t;if(e.nonceInfo)e.sign(...s);else{let o=this._disableBlockhashCaching;for(;;){const a=await this._blockhashWithExpiryBlockHeight(o);if(e.lastValidBlockHeight=a.lastValidBlockHeight,e.recentBlockhash=a.blockhash,e.sign(...s),!e.signature)throw new Error("!signature");const l=e.signature.toString("base64");if(this._blockhashInfo.transactionSignatures.includes(l))o=!0;else{this._blockhashInfo.transactionSignatures.push(l);break}}}const i=e.serialize();return await this.sendRawTransaction(i,r)}async sendRawTransaction(e,t){const r=ge(e).toString("base64");return await this.sendEncodedTransaction(r,t)}async sendEncodedTransaction(e,t){const r={encoding:"base64"},s=t&&t.skipPreflight,i=s===!0?"processed":t&&t.preflightCommitment||this.commitment;t&&t.maxRetries!=null&&(r.maxRetries=t.maxRetries),t&&t.minContextSlot!=null&&(r.minContextSlot=t.minContextSlot),s&&(r.skipPreflight=s),i&&(r.preflightCommitment=i);const o=[e,r],a=await this._rpcRequest("sendTransaction",o),l=J(a,i6);if("error"in l){let h;throw"data"in l.error&&(h=l.error.data.logs),new Jr({action:s?"send":"simulate",signature:"",transactionMessage:l.error.message,logs:h})}return l.result}_wsOnOpen(){this._rpcWebSocketConnected=!0,this._rpcWebSocketHeartbeat=setInterval(()=>{(async()=>{try{await this._rpcWebSocket.notify("ping")}catch{}})()},5e3),this._updateSubscriptions()}_wsOnError(e){this._rpcWebSocketConnected=!1,console.error("ws error:",e.message)}_wsOnClose(e){if(this._rpcWebSocketConnected=!1,this._rpcWebSocketGeneration=(this._rpcWebSocketGeneration+1)%Number.MAX_SAFE_INTEGER,this._rpcWebSocketIdleTimeout&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null),this._rpcWebSocketHeartbeat&&(clearInterval(this._rpcWebSocketHeartbeat),this._rpcWebSocketHeartbeat=null),e===1e3){this._updateSubscriptions();return}this._subscriptionCallbacksByServerSubscriptionId={},Object.entries(this._subscriptionsByHash).forEach(([t,r])=>{this._setSubscription(t,{...r,state:"pending"})})}_setSubscription(e,t){var s;const r=(s=this._subscriptionsByHash[e])==null?void 0:s.state;if(this._subscriptionsByHash[e]=t,r!==t.state){const i=this._subscriptionStateChangeCallbacksByHash[e];i&&i.forEach(o=>{try{o(t.state)}catch{}})}}_onSubscriptionStateChange(e,t){var i;const r=this._subscriptionHashByClientSubscriptionId[e];if(r==null)return()=>{};const s=(i=this._subscriptionStateChangeCallbacksByHash)[r]||(i[r]=new Set);return s.add(t),()=>{s.delete(t),s.size===0&&delete this._subscriptionStateChangeCallbacksByHash[r]}}async _updateSubscriptions(){if(Object.keys(this._subscriptionsByHash).length===0){this._rpcWebSocketConnected&&(this._rpcWebSocketConnected=!1,this._rpcWebSocketIdleTimeout=setTimeout(()=>{this._rpcWebSocketIdleTimeout=null;try{this._rpcWebSocket.close()}catch(r){r instanceof Error&&console.log(`Error when closing socket connection: ${r.message}`)}},500));return}if(this._rpcWebSocketIdleTimeout!==null&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null,this._rpcWebSocketConnected=!0),!this._rpcWebSocketConnected){this._rpcWebSocket.connect();return}const e=this._rpcWebSocketGeneration,t=()=>e===this._rpcWebSocketGeneration;await Promise.all(Object.keys(this._subscriptionsByHash).map(async r=>{const s=this._subscriptionsByHash[r];if(s!==void 0)switch(s.state){case"pending":case"unsubscribed":if(s.callbacks.size===0){delete this._subscriptionsByHash[r],s.state==="unsubscribed"&&delete this._subscriptionCallbacksByServerSubscriptionId[s.serverSubscriptionId],await this._updateSubscriptions();return}await(async()=>{const{args:i,method:o}=s;try{this._setSubscription(r,{...s,state:"subscribing"});const a=await this._rpcWebSocket.call(o,i);this._setSubscription(r,{...s,serverSubscriptionId:a,state:"subscribed"}),this._subscriptionCallbacksByServerSubscriptionId[a]=s.callbacks,await this._updateSubscriptions()}catch(a){if(console.error(`Received ${a instanceof Error?"":"JSON-RPC "}error calling \`${o}\``,{args:i,error:a}),!t())return;this._setSubscription(r,{...s,state:"pending"}),await this._updateSubscriptions()}})();break;case"subscribed":s.callbacks.size===0&&await(async()=>{const{serverSubscriptionId:i,unsubscribeMethod:o}=s;if(this._subscriptionsAutoDisposedByRpc.has(i))this._subscriptionsAutoDisposedByRpc.delete(i);else{this._setSubscription(r,{...s,state:"unsubscribing"}),this._setSubscription(r,{...s,state:"unsubscribing"});try{await this._rpcWebSocket.call(o,[i])}catch(a){if(a instanceof Error&&console.error(`${o} error:`,a.message),!t())return;this._setSubscription(r,{...s,state:"subscribed"}),await this._updateSubscriptions();return}}this._setSubscription(r,{...s,state:"unsubscribed"}),await this._updateSubscriptions()})();break}}))}_handleServerNotification(e,t){const r=this._subscriptionCallbacksByServerSubscriptionId[e];r!==void 0&&r.forEach(s=>{try{s(...t)}catch(i){console.error(i)}})}_wsOnAccountNotification(e){const{result:t,subscription:r}=J(e,F4);this._handleServerNotification(r,[t.value,t.context])}_makeSubscription(e,t){const r=this._nextClientSubscriptionId++,s=su([e.method,t]),i=this._subscriptionsByHash[s];return i===void 0?this._subscriptionsByHash[s]={...e,args:t,callbacks:new Set([e.callback]),state:"pending"}:i.callbacks.add(e.callback),this._subscriptionHashByClientSubscriptionId[r]=s,this._subscriptionDisposeFunctionsByClientSubscriptionId[r]=async()=>{delete this._subscriptionDisposeFunctionsByClientSubscriptionId[r],delete this._subscriptionHashByClientSubscriptionId[r];const o=this._subscriptionsByHash[s];Te(o!==void 0,`Could not find a \`Subscription\` when tearing down client subscription #${r}`),o.callbacks.delete(e.callback),await this._updateSubscriptions()},this._updateSubscriptions(),r}onAccountChange(e,t,r){const{commitment:s,config:i}=Ne(r),o=this._buildArgs([e.toBase58()],s||this._commitment||"finalized","base64",i);return this._makeSubscription({callback:t,method:"accountSubscribe",unsubscribeMethod:"accountUnsubscribe"},o)}async removeAccountChangeListener(e){await this._unsubscribeClientSubscription(e,"account change")}_wsOnProgramAccountNotification(e){const{result:t,subscription:r}=J(e,I4);this._handleServerNotification(r,[{accountId:t.value.pubkey,accountInfo:t.value.account},t.context])}onProgramAccountChange(e,t,r,s){const{commitment:i,config:o}=Ne(r),a=this._buildArgs([e.toBase58()],i||this._commitment||"finalized","base64",o||(s?{filters:ou(s)}:void 0));return this._makeSubscription({callback:t,method:"programSubscribe",unsubscribeMethod:"programUnsubscribe"},a)}async removeProgramAccountChangeListener(e){await this._unsubscribeClientSubscription(e,"program account change")}onLogs(e,t,r){const s=this._buildArgs([typeof e=="object"?{mentions:[e.toString()]}:e],r||this._commitment||"finalized");return this._makeSubscription({callback:t,method:"logsSubscribe",unsubscribeMethod:"logsUnsubscribe"},s)}async removeOnLogsListener(e){await this._unsubscribeClientSubscription(e,"logs")}_wsOnLogsNotification(e){const{result:t,subscription:r}=J(e,a6);this._handleServerNotification(r,[t.value,t.context])}_wsOnSlotNotification(e){const{result:t,subscription:r}=J(e,_4);this._handleServerNotification(r,[t])}onSlotChange(e){return this._makeSubscription({callback:e,method:"slotSubscribe",unsubscribeMethod:"slotUnsubscribe"},[])}async removeSlotChangeListener(e){await this._unsubscribeClientSubscription(e,"slot change")}_wsOnSlotUpdatesNotification(e){const{result:t,subscription:r}=J(e,R4);this._handleServerNotification(r,[t])}onSlotUpdate(e){return this._makeSubscription({callback:e,method:"slotsUpdatesSubscribe",unsubscribeMethod:"slotsUpdatesUnsubscribe"},[])}async removeSlotUpdateListener(e){await this._unsubscribeClientSubscription(e,"slot update")}async _unsubscribeClientSubscription(e,t){const r=this._subscriptionDisposeFunctionsByClientSubscriptionId[e];r?await r():console.warn(`Ignored unsubscribe request because an active subscription with id \`${e}\` for '${t}' events could not be found.`)}_buildArgs(e,t,r,s){const i=t||this._commitment;if(i||r||s){let o={};r&&(o.encoding=r),i&&(o.commitment=i),s&&(o=Object.assign(o,s)),e.push(o)}return e}_buildArgsAtLeastConfirmed(e,t,r,s){const i=t||this._commitment;if(i&&!["confirmed","finalized"].includes(i))throw new Error("Using Connection with default commitment: `"+this._commitment+"`, but method requires at least `confirmed`");return this._buildArgs(e,t,r,s)}_wsOnSignatureNotification(e){const{result:t,subscription:r}=J(e,W4);t.value!=="receivedSignature"&&this._subscriptionsAutoDisposedByRpc.add(r),this._handleServerNotification(r,t.value==="receivedSignature"?[{type:"received"},t.context]:[{type:"status",result:t.value},t.context])}onSignature(e,t,r){const s=this._buildArgs([e],r||this._commitment||"finalized"),i=this._makeSubscription({callback:(o,a)=>{if(o.type==="status"){t(o.result,a);try{this.removeSignatureListener(i)}catch{}}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},s);return i}onSignatureWithOptions(e,t,r){const{commitment:s,...i}={...r,commitment:r&&r.commitment||this._commitment||"finalized"},o=this._buildArgs([e],s,void 0,i),a=this._makeSubscription({callback:(l,h)=>{t(l,h);try{this.removeSignatureListener(a)}catch{}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},o);return a}async removeSignatureListener(e){await this._unsubscribeClientSubscription(e,"signature result")}_wsOnRootNotification(e){const{result:t,subscription:r}=J(e,P4);this._handleServerNotification(r,[t])}onRootChange(e){return this._makeSubscription({callback:e,method:"rootSubscribe",unsubscribeMethod:"rootUnsubscribe"},[])}async removeRootChangeListener(e){await this._unsubscribeClientSubscription(e,"root change")}}class wr{constructor(e){this._keypair=void 0,this._keypair=e??eu()}static generate(){return new wr(eu())}static fromSecretKey(e,t){if(e.byteLength!==64)throw new Error("bad secret key size");const r=e.slice(32,64);if(!t||!t.skipValidation){const s=e.slice(0,32),i=Vi(s);for(let o=0;o<32;o++)if(r[o]!==i[o])throw new Error("provided secretKey is invalid")}return new wr({publicKey:r,secretKey:e})}static fromSeed(e){const t=Vi(e),r=new Uint8Array(64);return r.set(e),r.set(t,32),new wr({publicKey:t,secretKey:r})}get publicKey(){return new Y(this._keypair.publicKey)}get secretKey(){return new Uint8Array(this._keypair.secretKey)}}const Nn=Object.freeze({CreateLookupTable:{index:0,layout:exports.struct([exports.u32("instruction"),Qr("recentSlot"),exports.u8("bumpSeed")])},FreezeLookupTable:{index:1,layout:exports.struct([exports.u32("instruction")])},ExtendLookupTable:{index:2,layout:exports.struct([exports.u32("instruction"),Qr(),exports.seq(Be(),tr(exports.u32(),-8),"addresses")])},DeactivateLookupTable:{index:3,layout:exports.struct([exports.u32("instruction")])},CloseLookupTable:{index:4,layout:exports.struct([exports.u32("instruction")])}});class l6{constructor(){}static decodeInstructionType(e){this.checkProgramId(e.programId);const r=exports.u32("instruction").decode(e.data);let s;for(const[i,o]of Object.entries(Nn))if(o.index==r){s=i;break}if(!s)throw new Error("Invalid Instruction. Should be a LookupTable Instruction");return s}static decodeCreateLookupTable(e){this.checkProgramId(e.programId),this.checkKeysLength(e.keys,4);const{recentSlot:t}=Ue(Nn.CreateLookupTable,e.data);return{authority:e.keys[1].pubkey,payer:e.keys[2].pubkey,recentSlot:Number(t)}}static decodeExtendLookupTable(e){if(this.checkProgramId(e.programId),e.keys.length<2)throw new Error(`invalid instruction; found ${e.keys.length} keys, expected at least 2`);const{addresses:t}=Ue(Nn.ExtendLookupTable,e.data);return{lookupTable:e.keys[0].pubkey,authority:e.keys[1].pubkey,payer:e.keys.length>2?e.keys[2].pubkey:void 0,addresses:t.map(r=>new Y(r))}}static decodeCloseLookupTable(e){return this.checkProgramId(e.programId),this.checkKeysLength(e.keys,3),{lookupTable:e.keys[0].pubkey,authority:e.keys[1].pubkey,recipient:e.keys[2].pubkey}}static decodeFreezeLookupTable(e){return this.checkProgramId(e.programId),this.checkKeysLength(e.keys,2),{lookupTable:e.keys[0].pubkey,authority:e.keys[1].pubkey}}static decodeDeactivateLookupTable(e){return this.checkProgramId(e.programId),this.checkKeysLength(e.keys,2),{lookupTable:e.keys[0].pubkey,authority:e.keys[1].pubkey}}static checkProgramId(e){if(!e.equals(Mo.programId))throw new Error("invalid instruction; programId is not AddressLookupTable Program")}static checkKeysLength(e,t){if(e.length<t)throw new Error(`invalid instruction; found ${e.length} keys, expected at least ${t}`)}}class Mo{constructor(){}static createLookupTable(e){const[t,r]=Y.findProgramAddressSync([e.authority.toBuffer(),wl(BigInt(e.recentSlot),8)],this.programId),s=Nn.CreateLookupTable,i=Se(s,{recentSlot:BigInt(e.recentSlot),bumpSeed:r}),o=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1},{pubkey:e.payer,isSigner:!0,isWritable:!0},{pubkey:Bt.programId,isSigner:!1,isWritable:!1}];return[new We({programId:this.programId,keys:o,data:i}),t]}static freezeLookupTable(e){const t=Nn.FreezeLookupTable,r=Se(t),s=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1}];return new We({programId:this.programId,keys:s,data:r})}static extendLookupTable(e){const t=Nn.ExtendLookupTable,r=Se(t,{addresses:e.addresses.map(i=>i.toBytes())}),s=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1}];return e.payer&&s.push({pubkey:e.payer,isSigner:!0,isWritable:!0},{pubkey:Bt.programId,isSigner:!1,isWritable:!1}),new We({programId:this.programId,keys:s,data:r})}static deactivateLookupTable(e){const t=Nn.DeactivateLookupTable,r=Se(t),s=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1}];return new We({programId:this.programId,keys:s,data:r})}static closeLookupTable(e){const t=Nn.CloseLookupTable,r=Se(t),s=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1},{pubkey:e.recipient,isSigner:!1,isWritable:!0}];return new We({programId:this.programId,keys:s,data:r})}}Mo.programId=new Y("AddressLookupTab1e1111111111111111111111111");class d6{constructor(){}static decodeInstructionType(e){this.checkProgramId(e.programId);const r=exports.u8("instruction").decode(e.data);let s;for(const[i,o]of Object.entries(An))if(o.index==r){s=i;break}if(!s)throw new Error("Instruction type incorrect; not a ComputeBudgetInstruction");return s}static decodeRequestUnits(e){this.checkProgramId(e.programId);const{units:t,additionalFee:r}=Ue(An.RequestUnits,e.data);return{units:t,additionalFee:r}}static decodeRequestHeapFrame(e){this.checkProgramId(e.programId);const{bytes:t}=Ue(An.RequestHeapFrame,e.data);return{bytes:t}}static decodeSetComputeUnitLimit(e){this.checkProgramId(e.programId);const{units:t}=Ue(An.SetComputeUnitLimit,e.data);return{units:t}}static decodeSetComputeUnitPrice(e){this.checkProgramId(e.programId);const{microLamports:t}=Ue(An.SetComputeUnitPrice,e.data);return{microLamports:t}}static checkProgramId(e){if(!e.equals(Ro.programId))throw new Error("invalid instruction; programId is not ComputeBudgetProgram")}}const An=Object.freeze({RequestUnits:{index:0,layout:exports.struct([exports.u8("instruction"),exports.u32("units"),exports.u32("additionalFee")])},RequestHeapFrame:{index:1,layout:exports.struct([exports.u8("instruction"),exports.u32("bytes")])},SetComputeUnitLimit:{index:2,layout:exports.struct([exports.u8("instruction"),exports.u32("units")])},SetComputeUnitPrice:{index:3,layout:exports.struct([exports.u8("instruction"),Qr("microLamports")])}});class Ro{constructor(){}static requestUnits(e){const t=An.RequestUnits,r=Se(t,e);return new We({keys:[],programId:this.programId,data:r})}static requestHeapFrame(e){const t=An.RequestHeapFrame,r=Se(t,e);return new We({keys:[],programId:this.programId,data:r})}static setComputeUnitLimit(e){const t=An.SetComputeUnitLimit,r=Se(t,e);return new We({keys:[],programId:this.programId,data:r})}static setComputeUnitPrice(e){const t=An.SetComputeUnitPrice,r=Se(t,{microLamports:BigInt(e.microLamports)});return new We({keys:[],programId:this.programId,data:r})}}Ro.programId=new Y("ComputeBudget111111111111111111111111111111");const du=64,uu=32,fu=64,hu=exports.struct([exports.u8("numSignatures"),exports.u8("padding"),exports.u16("signatureOffset"),exports.u16("signatureInstructionIndex"),exports.u16("publicKeyOffset"),exports.u16("publicKeyInstructionIndex"),exports.u16("messageDataOffset"),exports.u16("messageDataSize"),exports.u16("messageInstructionIndex")]);class Wo{constructor(){}static createInstructionWithPublicKey(e){const{publicKey:t,message:r,signature:s,instructionIndex:i}=e;Te(t.length===uu,`Public Key must be ${uu} bytes but received ${t.length} bytes`),Te(s.length===fu,`Signature must be ${fu} bytes but received ${s.length} bytes`);const o=hu.span,a=o+t.length,l=a+s.length,h=1,m=oe.Buffer.alloc(l+r.length),E=i??65535;return hu.encode({numSignatures:h,padding:0,signatureOffset:a,signatureInstructionIndex:E,publicKeyOffset:o,publicKeyInstructionIndex:E,messageDataOffset:l,messageDataSize:r.length,messageInstructionIndex:E},m),m.fill(t,o),m.fill(s,a),m.fill(r,l),new We({keys:[],programId:Wo.programId,data:m})}static createInstructionWithPrivateKey(e){const{privateKey:t,message:r,instructionIndex:s}=e;Te(t.length===du,`Private key must be ${du} bytes but received ${t.length} bytes`);try{const i=wr.fromSecretKey(t),o=i.publicKey.toBytes(),a=Cl(r,i.secretKey);return this.createInstructionWithPublicKey({publicKey:o,message:r,signature:a,instructionIndex:s})}catch(i){throw new Error(`Error creating instruction; ${i}`)}}}Wo.programId=new Y("Ed25519SigVerify111111111111111111111111111");const u6=(n,e)=>{const t=Hn.sign(n,e);return[t.toCompactRawBytes(),t.recovery]};Hn.utils.isValidPrivateKey;const f6=Hn.getPublicKey,mu=32,Ta=20,bu=64,h6=11,Ia=exports.struct([exports.u8("numSignatures"),exports.u16("signatureOffset"),exports.u8("signatureInstructionIndex"),exports.u16("ethAddressOffset"),exports.u8("ethAddressInstructionIndex"),exports.u16("messageDataOffset"),exports.u16("messageDataSize"),exports.u8("messageInstructionIndex"),exports.blob(20,"ethAddress"),exports.blob(64,"signature"),exports.u8("recoveryId")]);class Ar{constructor(){}static publicKeyToEthAddress(e){Te(e.length===bu,`Public key must be ${bu} bytes but received ${e.length} bytes`);try{return oe.Buffer.from(_s(ge(e))).slice(-Ta)}catch(t){throw new Error(`Error constructing Ethereum address: ${t}`)}}static createInstructionWithPublicKey(e){const{publicKey:t,message:r,signature:s,recoveryId:i,instructionIndex:o}=e;return Ar.createInstructionWithEthAddress({ethAddress:Ar.publicKeyToEthAddress(t),message:r,signature:s,recoveryId:i,instructionIndex:o})}static createInstructionWithEthAddress(e){const{ethAddress:t,message:r,signature:s,recoveryId:i,instructionIndex:o=0}=e;let a;typeof t=="string"?t.startsWith("0x")?a=oe.Buffer.from(t.substr(2),"hex"):a=oe.Buffer.from(t,"hex"):a=t,Te(a.length===Ta,`Address must be ${Ta} bytes but received ${a.length} bytes`);const l=1+h6,h=l,m=l+a.length,E=m+s.length+1,S=1,A=oe.Buffer.alloc(Ia.span+r.length);return Ia.encode({numSignatures:S,signatureOffset:m,signatureInstructionIndex:o,ethAddressOffset:h,ethAddressInstructionIndex:o,messageDataOffset:E,messageDataSize:r.length,messageInstructionIndex:o,signature:ge(s),ethAddress:ge(a),recoveryId:i},A),A.fill(ge(r),Ia.span),new We({keys:[],programId:Ar.programId,data:A})}static createInstructionWithPrivateKey(e){const{privateKey:t,message:r,instructionIndex:s}=e;Te(t.length===mu,`Private key must be ${mu} bytes but received ${t.length} bytes`);try{const i=ge(t),o=f6(i,!1).slice(1),a=oe.Buffer.from(_s(ge(r))),[l,h]=u6(a,i);return this.createInstructionWithPublicKey({publicKey:o,message:r,signature:l,recoveryId:h,instructionIndex:s})}catch(i){throw new Error(`Error creating instruction; ${i}`)}}}Ar.programId=new Y("KeccakSecp256k11111111111111111111111111111");var Xh;const Zh=new Y("StakeConfig11111111111111111111111111111111");class Jh{constructor(e,t){this.staker=void 0,this.withdrawer=void 0,this.staker=e,this.withdrawer=t}}class ii{constructor(e,t,r){this.unixTimestamp=void 0,this.epoch=void 0,this.custodian=void 0,this.unixTimestamp=e,this.epoch=t,this.custodian=r}}Xh=ii;ii.default=new Xh(0,0,Y.default);class m6{constructor(){}static decodeInstructionType(e){this.checkProgramId(e.programId);const r=exports.u32("instruction").decode(e.data);let s;for(const[i,o]of Object.entries(Dt))if(o.index==r){s=i;break}if(!s)throw new Error("Instruction type incorrect; not a StakeInstruction");return s}static decodeInitialize(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);const{authorized:t,lockup:r}=Ue(Dt.Initialize,e.data);return{stakePubkey:e.keys[0].pubkey,authorized:new Jh(new Y(t.staker),new Y(t.withdrawer)),lockup:new ii(r.unixTimestamp,r.epoch,new Y(r.custodian))}}static decodeDelegate(e){return this.checkProgramId(e.programId),this.checkKeyLength(e.keys,6),Ue(Dt.Delegate,e.data),{stakePubkey:e.keys[0].pubkey,votePubkey:e.keys[1].pubkey,authorizedPubkey:e.keys[5].pubkey}}static decodeAuthorize(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);const{newAuthorized:t,stakeAuthorizationType:r}=Ue(Dt.Authorize,e.data),s={stakePubkey:e.keys[0].pubkey,authorizedPubkey:e.keys[2].pubkey,newAuthorizedPubkey:new Y(t),stakeAuthorizationType:{index:r}};return e.keys.length>3&&(s.custodianPubkey=e.keys[3].pubkey),s}static decodeAuthorizeWithSeed(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);const{newAuthorized:t,stakeAuthorizationType:r,authoritySeed:s,authorityOwner:i}=Ue(Dt.AuthorizeWithSeed,e.data),o={stakePubkey:e.keys[0].pubkey,authorityBase:e.keys[1].pubkey,authoritySeed:s,authorityOwner:new Y(i),newAuthorizedPubkey:new Y(t),stakeAuthorizationType:{index:r}};return e.keys.length>3&&(o.custodianPubkey=e.keys[3].pubkey),o}static decodeSplit(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);const{lamports:t}=Ue(Dt.Split,e.data);return{stakePubkey:e.keys[0].pubkey,splitStakePubkey:e.keys[1].pubkey,authorizedPubkey:e.keys[2].pubkey,lamports:t}}static decodeMerge(e){return this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3),Ue(Dt.Merge,e.data),{stakePubkey:e.keys[0].pubkey,sourceStakePubKey:e.keys[1].pubkey,authorizedPubkey:e.keys[4].pubkey}}static decodeWithdraw(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,5);const{lamports:t}=Ue(Dt.Withdraw,e.data),r={stakePubkey:e.keys[0].pubkey,toPubkey:e.keys[1].pubkey,authorizedPubkey:e.keys[4].pubkey,lamports:t};return e.keys.length>5&&(r.custodianPubkey=e.keys[5].pubkey),r}static decodeDeactivate(e){return this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3),Ue(Dt.Deactivate,e.data),{stakePubkey:e.keys[0].pubkey,authorizedPubkey:e.keys[2].pubkey}}static checkProgramId(e){if(!e.equals(Po.programId))throw new Error("invalid instruction; programId is not StakeProgram")}static checkKeyLength(e,t){if(e.length<t)throw new Error(`invalid instruction; found ${e.length} keys, expected at least ${t}`)}}const Dt=Object.freeze({Initialize:{index:0,layout:exports.struct([exports.u32("instruction"),y3(),w3()])},Authorize:{index:1,layout:exports.struct([exports.u32("instruction"),Be("newAuthorized"),exports.u32("stakeAuthorizationType")])},Delegate:{index:2,layout:exports.struct([exports.u32("instruction")])},Split:{index:3,layout:exports.struct([exports.u32("instruction"),exports.ns64("lamports")])},Withdraw:{index:4,layout:exports.struct([exports.u32("instruction"),exports.ns64("lamports")])},Deactivate:{index:5,layout:exports.struct([exports.u32("instruction")])},Merge:{index:7,layout:exports.struct([exports.u32("instruction")])},AuthorizeWithSeed:{index:8,layout:exports.struct([exports.u32("instruction"),Be("newAuthorized"),exports.u32("stakeAuthorizationType"),br("authoritySeed"),Be("authorityOwner")])}}),b6=Object.freeze({Staker:{index:0},Withdrawer:{index:1}});class Po{constructor(){}static initialize(e){const{stakePubkey:t,authorized:r,lockup:s}=e,i=s||ii.default,o=Dt.Initialize,a=Se(o,{authorized:{staker:ge(r.staker.toBuffer()),withdrawer:ge(r.withdrawer.toBuffer())},lockup:{unixTimestamp:i.unixTimestamp,epoch:i.epoch,custodian:ge(i.custodian.toBuffer())}}),l={keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:Sr,isSigner:!1,isWritable:!1}],programId:this.programId,data:a};return new We(l)}static createAccountWithSeed(e){const t=new Fe;t.add(Bt.createAccountWithSeed({fromPubkey:e.fromPubkey,newAccountPubkey:e.stakePubkey,basePubkey:e.basePubkey,seed:e.seed,lamports:e.lamports,space:this.space,programId:this.programId}));const{stakePubkey:r,authorized:s,lockup:i}=e;return t.add(this.initialize({stakePubkey:r,authorized:s,lockup:i}))}static createAccount(e){const t=new Fe;t.add(Bt.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.stakePubkey,lamports:e.lamports,space:this.space,programId:this.programId}));const{stakePubkey:r,authorized:s,lockup:i}=e;return t.add(this.initialize({stakePubkey:r,authorized:s,lockup:i}))}static delegate(e){const{stakePubkey:t,authorizedPubkey:r,votePubkey:s}=e,i=Dt.Delegate,o=Se(i);return new Fe().add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:s,isSigner:!1,isWritable:!1},{pubkey:dn,isSigner:!1,isWritable:!1},{pubkey:Ii,isSigner:!1,isWritable:!1},{pubkey:Zh,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:o})}static authorize(e){const{stakePubkey:t,authorizedPubkey:r,newAuthorizedPubkey:s,stakeAuthorizationType:i,custodianPubkey:o}=e,a=Dt.Authorize,l=Se(a,{newAuthorized:ge(s.toBuffer()),stakeAuthorizationType:i.index}),h=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:dn,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1}];return o&&h.push({pubkey:o,isSigner:!0,isWritable:!1}),new Fe().add({keys:h,programId:this.programId,data:l})}static authorizeWithSeed(e){const{stakePubkey:t,authorityBase:r,authoritySeed:s,authorityOwner:i,newAuthorizedPubkey:o,stakeAuthorizationType:a,custodianPubkey:l}=e,h=Dt.AuthorizeWithSeed,m=Se(h,{newAuthorized:ge(o.toBuffer()),stakeAuthorizationType:a.index,authoritySeed:s,authorityOwner:ge(i.toBuffer())}),E=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1},{pubkey:dn,isSigner:!1,isWritable:!1}];return l&&E.push({pubkey:l,isSigner:!0,isWritable:!1}),new Fe().add({keys:E,programId:this.programId,data:m})}static splitInstruction(e){const{stakePubkey:t,authorizedPubkey:r,splitStakePubkey:s,lamports:i}=e,o=Dt.Split,a=Se(o,{lamports:i});return new We({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:s,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:a})}static split(e,t){const r=new Fe;return r.add(Bt.createAccount({fromPubkey:e.authorizedPubkey,newAccountPubkey:e.splitStakePubkey,lamports:t,space:this.space,programId:this.programId})),r.add(this.splitInstruction(e))}static splitWithSeed(e,t){const{stakePubkey:r,authorizedPubkey:s,splitStakePubkey:i,basePubkey:o,seed:a,lamports:l}=e,h=new Fe;return h.add(Bt.allocate({accountPubkey:i,basePubkey:o,seed:a,space:this.space,programId:this.programId})),t&&t>0&&h.add(Bt.transfer({fromPubkey:e.authorizedPubkey,toPubkey:i,lamports:t})),h.add(this.splitInstruction({stakePubkey:r,authorizedPubkey:s,splitStakePubkey:i,lamports:l}))}static merge(e){const{stakePubkey:t,sourceStakePubKey:r,authorizedPubkey:s}=e,i=Dt.Merge,o=Se(i);return new Fe().add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:dn,isSigner:!1,isWritable:!1},{pubkey:Ii,isSigner:!1,isWritable:!1},{pubkey:s,isSigner:!0,isWritable:!1}],programId:this.programId,data:o})}static withdraw(e){const{stakePubkey:t,authorizedPubkey:r,toPubkey:s,lamports:i,custodianPubkey:o}=e,a=Dt.Withdraw,l=Se(a,{lamports:i}),h=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:s,isSigner:!1,isWritable:!0},{pubkey:dn,isSigner:!1,isWritable:!1},{pubkey:Ii,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}];return o&&h.push({pubkey:o,isSigner:!0,isWritable:!1}),new Fe().add({keys:h,programId:this.programId,data:l})}static deactivate(e){const{stakePubkey:t,authorizedPubkey:r}=e,s=Dt.Deactivate,i=Se(s);return new Fe().add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:dn,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}}Po.programId=new Y("Stake11111111111111111111111111111111111111");Po.space=200;class Qh{constructor(e,t,r,s){this.nodePubkey=void 0,this.authorizedVoter=void 0,this.authorizedWithdrawer=void 0,this.commission=void 0,this.nodePubkey=e,this.authorizedVoter=t,this.authorizedWithdrawer=r,this.commission=s}}class p6{constructor(){}static decodeInstructionType(e){this.checkProgramId(e.programId);const r=exports.u32("instruction").decode(e.data);let s;for(const[i,o]of Object.entries(En))if(o.index==r){s=i;break}if(!s)throw new Error("Instruction type incorrect; not a VoteInstruction");return s}static decodeInitializeAccount(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,4);const{voteInit:t}=Ue(En.InitializeAccount,e.data);return{votePubkey:e.keys[0].pubkey,nodePubkey:e.keys[3].pubkey,voteInit:new Qh(new Y(t.nodePubkey),new Y(t.authorizedVoter),new Y(t.authorizedWithdrawer),t.commission)}}static decodeAuthorize(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);const{newAuthorized:t,voteAuthorizationType:r}=Ue(En.Authorize,e.data);return{votePubkey:e.keys[0].pubkey,authorizedPubkey:e.keys[2].pubkey,newAuthorizedPubkey:new Y(t),voteAuthorizationType:{index:r}}}static decodeAuthorizeWithSeed(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);const{voteAuthorizeWithSeedArgs:{currentAuthorityDerivedKeyOwnerPubkey:t,currentAuthorityDerivedKeySeed:r,newAuthorized:s,voteAuthorizationType:i}}=Ue(En.AuthorizeWithSeed,e.data);return{currentAuthorityDerivedKeyBasePubkey:e.keys[2].pubkey,currentAuthorityDerivedKeyOwnerPubkey:new Y(t),currentAuthorityDerivedKeySeed:r,newAuthorizedPubkey:new Y(s),voteAuthorizationType:{index:i},votePubkey:e.keys[0].pubkey}}static decodeWithdraw(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);const{lamports:t}=Ue(En.Withdraw,e.data);return{votePubkey:e.keys[0].pubkey,authorizedWithdrawerPubkey:e.keys[2].pubkey,lamports:t,toPubkey:e.keys[1].pubkey}}static checkProgramId(e){if(!e.equals(ps.programId))throw new Error("invalid instruction; programId is not VoteProgram")}static checkKeyLength(e,t){if(e.length<t)throw new Error(`invalid instruction; found ${e.length} keys, expected at least ${t}`)}}const En=Object.freeze({InitializeAccount:{index:0,layout:exports.struct([exports.u32("instruction"),A3()])},Authorize:{index:1,layout:exports.struct([exports.u32("instruction"),Be("newAuthorized"),exports.u32("voteAuthorizationType")])},Withdraw:{index:3,layout:exports.struct([exports.u32("instruction"),exports.ns64("lamports")])},UpdateValidatorIdentity:{index:4,layout:exports.struct([exports.u32("instruction")])},AuthorizeWithSeed:{index:10,layout:exports.struct([exports.u32("instruction"),E3()])}}),g6=Object.freeze({Voter:{index:0},Withdrawer:{index:1}});class ps{constructor(){}static initializeAccount(e){const{votePubkey:t,nodePubkey:r,voteInit:s}=e,i=En.InitializeAccount,o=Se(i,{voteInit:{nodePubkey:ge(s.nodePubkey.toBuffer()),authorizedVoter:ge(s.authorizedVoter.toBuffer()),authorizedWithdrawer:ge(s.authorizedWithdrawer.toBuffer()),commission:s.commission}}),a={keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:Sr,isSigner:!1,isWritable:!1},{pubkey:dn,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:o};return new We(a)}static createAccount(e){const t=new Fe;return t.add(Bt.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.votePubkey,lamports:e.lamports,space:this.space,programId:this.programId})),t.add(this.initializeAccount({votePubkey:e.votePubkey,nodePubkey:e.voteInit.nodePubkey,voteInit:e.voteInit}))}static authorize(e){const{votePubkey:t,authorizedPubkey:r,newAuthorizedPubkey:s,voteAuthorizationType:i}=e,o=En.Authorize,a=Se(o,{newAuthorized:ge(s.toBuffer()),voteAuthorizationType:i.index}),l=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:dn,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}];return new Fe().add({keys:l,programId:this.programId,data:a})}static authorizeWithSeed(e){const{currentAuthorityDerivedKeyBasePubkey:t,currentAuthorityDerivedKeyOwnerPubkey:r,currentAuthorityDerivedKeySeed:s,newAuthorizedPubkey:i,voteAuthorizationType:o,votePubkey:a}=e,l=En.AuthorizeWithSeed,h=Se(l,{voteAuthorizeWithSeedArgs:{currentAuthorityDerivedKeyOwnerPubkey:ge(r.toBuffer()),currentAuthorityDerivedKeySeed:s,newAuthorized:ge(i.toBuffer()),voteAuthorizationType:o.index}}),m=[{pubkey:a,isSigner:!1,isWritable:!0},{pubkey:dn,isSigner:!1,isWritable:!1},{pubkey:t,isSigner:!0,isWritable:!1}];return new Fe().add({keys:m,programId:this.programId,data:h})}static withdraw(e){const{votePubkey:t,authorizedWithdrawerPubkey:r,lamports:s,toPubkey:i}=e,o=En.Withdraw,a=Se(o,{lamports:s}),l=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1}];return new Fe().add({keys:l,programId:this.programId,data:a})}static safeWithdraw(e,t,r){if(e.lamports>t-r)throw new Error("Withdraw will leave vote account with insufficient funds.");return ps.withdraw(e)}static updateValidatorIdentity(e){const{votePubkey:t,authorizedWithdrawerPubkey:r,nodePubkey:s}=e,i=En.UpdateValidatorIdentity,o=Se(i),a=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:s,isSigner:!0,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}];return new Fe().add({keys:a,programId:this.programId,data:o})}}ps.programId=new Y("Vote111111111111111111111111111111111111111");ps.space=3762;const em=new Y("Va1idator1nfo111111111111111111111111111111"),y6=j({name:X(),website:ce(X()),details:ce(X()),iconUrl:ce(X()),keybaseUsername:ce(X())});class Il{constructor(e,t){this.key=void 0,this.info=void 0,this.key=e,this.info=t}static fromConfigData(e){let t=[...e];if(Vt(t)!==2)return null;const s=[];for(let i=0;i<2;i++){const o=new Y(Gt(t,0,xn)),a=wn(t)===1;s.push({publicKey:o,isSigner:a})}if(s[0].publicKey.equals(em)&&s[1].isSigner){const i=br().decode(oe.Buffer.from(t)),o=JSON.parse(i);return wh(o,y6),new Il(s[1].publicKey,o)}return null}}const w6=new Y("Vote111111111111111111111111111111111111111"),A6=exports.struct([Be("nodePubkey"),Be("authorizedWithdrawer"),exports.u8("commission"),It(),exports.seq(exports.struct([It("slot"),exports.u32("confirmationCount")]),tr(exports.u32(),-8),"votes"),exports.u8("rootSlotValid"),It("rootSlot"),It(),exports.seq(exports.struct([It("epoch"),Be("authorizedVoter")]),tr(exports.u32(),-8),"authorizedVoters"),exports.struct([exports.seq(exports.struct([Be("authorizedPubkey"),It("epochOfLastAuthorizedSwitch"),It("targetEpoch")]),32,"buf"),It("idx"),exports.u8("isEmpty")],"priorVoters"),It(),exports.seq(exports.struct([It("epoch"),It("credits"),It("prevCredits")]),tr(exports.u32(),-8),"epochCredits"),exports.struct([It("slot"),It("timestamp")],"lastTimestamp")]);class Ul{constructor(e){this.nodePubkey=void 0,this.authorizedWithdrawer=void 0,this.commission=void 0,this.rootSlot=void 0,this.votes=void 0,this.authorizedVoters=void 0,this.priorVoters=void 0,this.epochCredits=void 0,this.lastTimestamp=void 0,this.nodePubkey=e.nodePubkey,this.authorizedWithdrawer=e.authorizedWithdrawer,this.commission=e.commission,this.rootSlot=e.rootSlot,this.votes=e.votes,this.authorizedVoters=e.authorizedVoters,this.priorVoters=e.priorVoters,this.epochCredits=e.epochCredits,this.lastTimestamp=e.lastTimestamp}static fromAccountData(e){const r=A6.decode(ge(e),4);let s=r.rootSlot;return r.rootSlotValid||(s=null),new Ul({nodePubkey:new Y(r.nodePubkey),authorizedWithdrawer:new Y(r.authorizedWithdrawer),commission:r.commission,votes:r.votes,rootSlot:s,authorizedVoters:r.authorizedVoters.map(E6),priorVoters:B6(r.priorVoters),epochCredits:r.epochCredits,lastTimestamp:r.lastTimestamp})}}function E6({authorizedVoter:n,epoch:e}){return{epoch:e,authorizedVoter:new Y(n)}}function pu({authorizedPubkey:n,epochOfLastAuthorizedSwitch:e,targetEpoch:t}){return{authorizedPubkey:new Y(n),epochOfLastAuthorizedSwitch:e,targetEpoch:t}}function B6({buf:n,idx:e,isEmpty:t}){return t?[]:[...n.slice(e+1).map(pu),...n.slice(0,e).map(pu)]}const gu={http:{devnet:"http://api.devnet.solana.com",testnet:"http://api.testnet.solana.com","mainnet-beta":"http://api.mainnet-beta.solana.com/"},https:{devnet:"https://api.devnet.solana.com",testnet:"https://api.testnet.solana.com","mainnet-beta":"https://api.mainnet-beta.solana.com/"}};function tm(n,e){const t=e===!1?"http":"https";if(!n)return gu[t].devnet;const r=gu[t][n];if(!r)throw new Error(`Unknown ${t} cluster: ${n}`);return r}async function x6(n,e,t,r){let s,i;t&&Object.prototype.hasOwnProperty.call(t,"lastValidBlockHeight")||t&&Object.prototype.hasOwnProperty.call(t,"nonceValue")?(s=t,i=r):i=t;const o=i&&{skipPreflight:i.skipPreflight,preflightCommitment:i.preflightCommitment||i.commitment,minContextSlot:i.minContextSlot},a=await n.sendRawTransaction(e,o),l=i&&i.commitment,m=(await(s?n.confirmTransaction(s,l):n.confirmTransaction(a,l))).value;if(m.err)throw a!=null?new Jr({action:o!=null&&o.skipPreflight?"send":"simulate",signature:a,transactionMessage:`Status: (${JSON.stringify(m)})`}):new Error(`Raw transaction ${a} failed (${JSON.stringify(m)})`);return a}const nm=1e9,C6=Object.freeze(Object.defineProperty({__proto__:null,Account:b3,AddressLookupTableAccount:Gi,AddressLookupTableInstruction:l6,AddressLookupTableProgram:Mo,Authorized:Jh,BLOCKHASH_CACHE_TIMEOUT_MS:Oh,BPF_LOADER_DEPRECATED_PROGRAM_ID:p3,BPF_LOADER_PROGRAM_ID:R3,BpfLoader:W3,COMPUTE_BUDGET_INSTRUCTION_LAYOUTS:An,ComputeBudgetInstruction:d6,ComputeBudgetProgram:Ro,Connection:Yh,Ed25519Program:Wo,Enum:h3,EpochSchedule:Ph,FeeCalculatorLayout:Rh,Keypair:wr,LAMPORTS_PER_SOL:nm,LOOKUP_TABLE_INSTRUCTION_LAYOUTS:Nn,Loader:Dr,Lockup:ii,MAX_SEED_LENGTH:Th,Message:cn,MessageAccountKeys:js,MessageV0:ir,NONCE_ACCOUNT_LENGTH:yc,NonceAccount:Io,PACKET_DATA_SIZE:nr,PUBLIC_KEY_LENGTH:xn,PublicKey:Y,SIGNATURE_LENGTH_IN_BYTES:Ks,SOLANA_SCHEMA:vs,STAKE_CONFIG_ID:Zh,STAKE_INSTRUCTION_LAYOUTS:Dt,SYSTEM_INSTRUCTION_LAYOUTS:ze,SYSVAR_CLOCK_PUBKEY:dn,SYSVAR_EPOCH_SCHEDULE_PUBKEY:D3,SYSVAR_INSTRUCTIONS_PUBKEY:Mh,SYSVAR_RECENT_BLOCKHASHES_PUBKEY:Ti,SYSVAR_RENT_PUBKEY:Sr,SYSVAR_REWARDS_PUBKEY:v3,SYSVAR_SLOT_HASHES_PUBKEY:k3,SYSVAR_SLOT_HISTORY_PUBKEY:F3,SYSVAR_STAKE_HISTORY_PUBKEY:Ii,Secp256k1Program:Ar,SendTransactionError:Jr,SolanaJSONRPCError:se,SolanaJSONRPCErrorCode:T3,StakeAuthorizationLayout:b6,StakeInstruction:m6,StakeProgram:Po,Struct:Sl,SystemInstruction:_3,SystemProgram:Bt,Transaction:Fe,TransactionExpiredBlockheightExceededError:vo,TransactionExpiredNonceInvalidError:Hr,TransactionExpiredTimeoutError:Dl,TransactionInstruction:We,TransactionMessage:Fo,TransactionStatus:Rn,VALIDATOR_INFO_KEY:em,VERSION_PREFIX_MASK:Do,VOTE_PROGRAM_ID:w6,ValidatorInfo:Il,VersionedMessage:vl,VersionedTransaction:To,VoteAccount:Ul,VoteAuthorizationLayout:g6,VoteInit:Qh,VoteInstruction:p6,VoteProgram:ps,clusterApiUrl:tm,sendAndConfirmRawTransaction:x6,sendAndConfirmTransaction:gc},Symbol.toStringTag,{value:"Module"})),_l="Solana",S6="11111111111111111111111111111111",ur=class ur{constructor(e){re(this,"type","Native");re(this,"address");ur.instanceof(e)?this.address=e.address:Nt.instanceof(e)?this.address=new Y(e.toUint8Array()):typeof e=="string"&&_t.valid(e)?this.address=new Y(_t.decode(e)):this.address=new Y(e)}unwrap(){return this.address}toString(){return this.address.toBase58()}toUint8Array(){return new Uint8Array(this.address.toBytes())}toNative(){return this}toUniversalAddress(){return new Nt(this.toUint8Array())}static instanceof(e){return e.constructor.platform===ur.platform}equals(e){return ur.instanceof(e)?e.unwrap().equals(this.unwrap()):this.toUniversalAddress().equals(e)}};re(ur,"byteSize",32),re(ur,"platform",_l);let Xi=ur;qc(_l,Xi);exports.AddressLookupTableAccount=Gi;exports.AddressLookupTableProgram=Mo;exports.AutomaticRoute=E0;exports.BN=fc;exports.CircleTransfer=Ct;exports.ComputeBudgetProgram=Ro;exports.Connection=Yh;exports.ErrNotWrapped=Tp;exports.EvmAddress=Ni;exports.EvmZeroAddress=t8;exports.Field=Zs;exports.FinalizableRoute=Ky;exports.FpInvertBatch=Bf;exports.FpLegendre=kb;exports.FpPow=Ef;exports.Hash=I0;exports.Hash$1=io;exports.HashMD=Wc;exports.Keypair=wr;exports.LAMPORTS_PER_SOL=nm;exports.ManualRoute=dc;exports.Message=cn;exports.MessageV0=ir;exports.O=xl;exports.PlatformNativeSigner=pp;exports.PublicKey=Y;exports.Route=wo;exports.RouteResolver=A0;exports.RpcClient=vh;exports.SYSVAR_CLOCK_PUBKEY=dn;exports.SYSVAR_INSTRUCTIONS_PUBKEY=Mh;exports.SYSVAR_RENT_PUBKEY=Sr;exports.Secp256k1Program=Ar;exports.SendTransactionError=Jr;exports.SolanaAddress=Xi;exports.SolanaZeroAddress=S6;exports.SystemProgram=Bt;exports.TokenTransfer=At;exports.Transaction=Fe;exports.TransactionExpiredBlockheightExceededError=vo;exports.TransactionInstruction=We;exports.TransactionMessage=Fo;exports.UniversalAddress=Nt;exports.VersionedTransaction=To;exports.Wormhole=sn;exports._platform=ll;exports._platform$1=_l;exports.abytes=as;exports.abytes$1=vr;exports.addChainId=e8;exports.addFixedValues=Tm;exports.addFrom=Q2;exports.aexists=Br;exports.ahash=Zu;exports.anumber=Is;exports.aoutput=Mc;exports.applyChainsConfigConfigOverrides=wy;exports.assert=vn;exports.assertArgument=Zn;exports.assertArgumentCount=Yy;exports.assertNormalize=Zy;exports.assertPrivate=Jy;exports.asyncLoop=u2;exports.axios=ve;exports.b58=Wu;exports.b64=no;exports.bech32=Mu;exports.bignum=Ss;exports.bitGet=yf;exports.bitLen=Oc;exports.bitMask=lo;exports.bnExports=rl;exports.bound=Am;exports.browserExports=xu;exports.bs58=vt;exports.bufferPolyfill=oe;exports.byteSwap32=Ka;exports.byteSwapIfBE=v1;exports.bytes=zt;exports.bytes$1=il;exports.bytesToHex=F1;exports.bytesToNumberBE=er;exports.canonicalAddress=Dn;exports.chainIdToChain=Pi;exports.chainItem=qt;exports.chainToChainId=ro;exports.chainToPlatform=ss;exports.checkOpts=b2;exports.checkOpts$1=I1;exports.circleChainId=$u;exports.circleContractChains=E1;exports.circleContracts=qa;exports.clusterApiUrl=tm;exports.commonjsGlobal=an;exports.concat=t2;exports.concatBytes=rr;exports.concatBytes$1=h2;exports.concatBytes$2=tf;exports.constMap=we;exports.createBase58check=Hm;exports.createView=a2;exports.createView$1=Di;exports.customizableBytes=Qi;exports.dataLength=n2;exports.dataSlice=r2;exports.decomposeLiteral=Pf;exports.defineProperties=hc;exports.deliveryInstructionLayout=Yf;exports.denoise=Wm;exports.deserialize=Ps;exports.deserialize$1=Sn;exports.display=Sc;exports.dist=Ve;exports.ed25519=Fr;exports.ensureBytes=et;exports.envelopeLayout=Vc;exports.estimateFinalityTime=Tc;exports.exists=mc;exports.expiration=Fs;exports.filters=is;exports.fromBaseUnits=Kr;exports.getAddress=yr;exports.getAugmentedNamespace=Bc;exports.getBytes=Tr;exports.getBytesCopy=Qy;exports.getDefaultExportFromCjs=Vs;exports.getHash=Uf;exports.getMinHashLength=Nc;exports.getTokenByAddress=up;exports.getTokenDetails=zy;exports.guardianAttestationEta=_c;exports.hash=o2;exports.headerLayout=$c;exports.hex=_t;exports.hexToBytes=T1;exports.hexlify=ei;exports.hmac=Pc;exports.index_browser_esm=C6;exports.isAddressable=j0;exports.isAttested=zs;exports.isAutomatic=Hy;exports.isBytesLike=e2;exports.isCallException=Gy;exports.isChain=so;exports.isCompleted=ky;exports.isDestinationQueued=vy;exports.isEqualCaseInsensitive=Ou;exports.isError=C0;exports.isFailed=Fy;exports.isFinalizable=jy;exports.isHexString=sl;exports.isLE=Li;exports.isManual=qy;exports.isNative=Ot;exports.isRedeemed=tl;exports.isRefunded=Dy;exports.isSameToken=Nf;exports.isSignAndSendSigner=Yc;exports.isSignOnlySigner=qf;exports.isSourceFinalized=Ns;exports.isSourceInitiated=el;exports.isTokenId=fo;exports.isWormholeMessageId=pr;exports.keccak256=us;exports.keccak_256=_s;exports.makeError=S0;exports.mapHashToField=Sf;exports.median=pm;exports.memoized=Yr;exports.mod=je;exports.nativeDecimals=Hu;exports.nativeTokenId=Of;exports.networkChainToNativeChainId=ju;exports.networkPlatformConfigs=y0;exports.notImplemented=Af;exports.number=Hs;exports.output=k0;exports.parse=Ei;exports.payloadLiteralToPayloadItemLayout=Lf;exports.platformNativeChainIdToNetworkChain=s1;exports.porticoContractChains=B1;exports.randomBytes=Rc;exports.randomBytes$1=p2;exports.registerNative=qc;exports.registerPayloadTypes=xt;exports.resolveAddress=X2;exports.resolveProperties=Vy;exports.resolveWrappedToken=zf;exports.rotl=D1;exports.rotr=c2;exports.rpcAddress=qu;exports.safeBufferExports=B0;exports.scale=xs;exports.secp256k1=Hn;exports.serialize=ec;exports.serialize$1=Cn;exports.serializePayload=ap;exports.sha256=Us;exports.sha3_256=lb;exports.sha512=bf;exports.signSendWait=Os;exports.tbtc=Si;exports.toBigIntLE_1=yh;exports.toBufferLE_1=wl;exports.toBytes=ol;exports.toBytes$1=os;exports.toChain=rs;exports.toChainId=Ys;exports.toCircleChain=Ci;exports.toNative=sr;exports.toUniversal=Mf;exports.tokenBridgeChains=w1;exports.tokenBridgeRelayerChains=A1;exports.truncate=Bi;exports.u32$1=T0;exports.u32$2=Ju;exports.u64=_2;exports.u64$1=me;exports.units=gn;exports.universalAddress=mp;exports.universalAddressItem=xe;exports.unusedArbiterFee=J2;exports.unusedNonce=Z2;exports.usdcContract=Ds;exports.utf8ToBytes=gf;exports.utf8ToBytes$1=ef;exports.validateObject=kr;exports.version=x0;exports.weierstrass=If;exports.weierstrassPoints=Tf;exports.whole=Cs;exports.wrapConstructor=U0;exports.wrapConstructor$1=Xs;exports.wrapConstructorWithOpts=U1;exports.zeroPadBytes=i2;exports.zeroPadValue=s2;