@wormhole-foundation/wormhole-connect 1.1.7-beta.0-development → 1.1.8-beta.1-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 (256) hide show
  1. package/dist/assets/{algorand-Bg-MfjsH.js → algorand-vDDEz6KP.js} +2 -2
  2. package/dist/assets/{ccip-Bk3xy3UX.js → ccip-DQXRFvqz.js} +1 -1
  3. package/dist/assets/{cosmwasm-xANzAboS.js → cosmwasm-DP4CIVSM.js} +2 -2
  4. package/dist/assets/{evm-B20gvxWA.js → evm-BB3755Wr.js} +1 -1
  5. package/dist/assets/{evm-CZSGnl_A.js → evm-C48USybm.js} +4 -4
  6. package/dist/assets/{index-eLk_b8u9.js → index-BU0ECMia.js} +1 -1
  7. package/dist/assets/{index-DyD6kblh.js → index-BbJVBTsE.js} +1 -1
  8. package/dist/assets/{index-BYxgRLLh.js → index-BhEp9mlK.js} +1 -1
  9. package/dist/assets/{index-CI40JjNh.js → index-BjxXYs1y.js} +2 -2
  10. package/dist/assets/{index-D3WFv54i.js → index-Bvun80fl.js} +1 -1
  11. package/dist/assets/{index-jD6ZZ5Tu.js → index-Bz-32kSJ.js} +1 -1
  12. package/dist/assets/{index-CLcPjTbq.js → index-CVb8oZT5.js} +2 -2
  13. package/dist/assets/{index-BN1xR-e3.js → index-Cx-EaiKs.js} +1 -1
  14. package/dist/assets/index-DP2zLB5d.js +5 -0
  15. package/dist/assets/{index-Bmx9-Bo8.js → index-DjbIKpGg.js} +1 -1
  16. package/dist/assets/{index-CxijOPcm.js → index-re-SltAL.js} +1 -1
  17. package/dist/assets/{index.es-CXW154rj.js → index.es-B57TzKWR.js} +2 -2
  18. package/dist/assets/{solana-DOaiyZir.js → solana-Bc-ePjuF.js} +1 -1
  19. package/dist/assets/{sui-mXOoFb4M.js → sui-DVNpNCUB.js} +4 -4
  20. package/dist/assets/{unsignedTransaction-0WUum9tP.js → unsignedTransaction-CPy_oMd2.js} +1 -1
  21. package/dist/assets/unsignedTransaction-arVvzoJx.js +1 -0
  22. package/dist/main.js +68 -68
  23. package/dist/src/config/devnet/chains.d.ts.map +1 -1
  24. package/dist/src/config/devnet/tokens.d.ts.map +1 -1
  25. package/dist/src/config/mainnet/chains.d.ts.map +1 -1
  26. package/dist/src/config/mainnet/tokens.d.ts.map +1 -1
  27. package/dist/src/config/testnet/chains.d.ts.map +1 -1
  28. package/dist/src/config/testnet/tokens.d.ts.map +1 -1
  29. package/dist/src/config/types.d.ts +4 -3
  30. package/dist/src/config/types.d.ts.map +1 -1
  31. package/dist/src/icons/ChainIcons.d.ts +9 -0
  32. package/dist/src/icons/ChainIcons.d.ts.map +1 -0
  33. package/dist/src/icons/Chains/APT.d.ts +4 -0
  34. package/dist/src/icons/Chains/APT.d.ts.map +1 -0
  35. package/dist/src/icons/Chains/ARBITRUM.d.ts +4 -0
  36. package/dist/src/icons/Chains/ARBITRUM.d.ts.map +1 -0
  37. package/dist/src/icons/Chains/AVAX.d.ts +4 -0
  38. package/dist/src/icons/Chains/AVAX.d.ts.map +1 -0
  39. package/dist/src/icons/Chains/BASE.d.ts +4 -0
  40. package/dist/src/icons/Chains/BASE.d.ts.map +1 -0
  41. package/dist/src/icons/Chains/BLAST.d.ts +4 -0
  42. package/dist/src/icons/Chains/BLAST.d.ts.map +1 -0
  43. package/dist/src/icons/Chains/BSC.d.ts +4 -0
  44. package/dist/src/icons/Chains/BSC.d.ts.map +1 -0
  45. package/dist/src/icons/Chains/CELO.d.ts +4 -0
  46. package/dist/src/icons/Chains/CELO.d.ts.map +1 -0
  47. package/dist/src/icons/Chains/ETH.d.ts +4 -0
  48. package/dist/src/icons/Chains/ETH.d.ts.map +1 -0
  49. package/dist/src/icons/Chains/FTM.d.ts +4 -0
  50. package/dist/src/icons/Chains/FTM.d.ts.map +1 -0
  51. package/dist/src/icons/Chains/GLMR.d.ts +4 -0
  52. package/dist/src/icons/Chains/GLMR.d.ts.map +1 -0
  53. package/dist/src/icons/Chains/KAIA.d.ts +4 -0
  54. package/dist/src/icons/Chains/KAIA.d.ts.map +1 -0
  55. package/dist/src/icons/Chains/MANTLE.d.ts +4 -0
  56. package/dist/src/icons/Chains/MANTLE.d.ts.map +1 -0
  57. package/dist/src/icons/Chains/OPTIMISM.d.ts +4 -0
  58. package/dist/src/icons/Chains/OPTIMISM.d.ts.map +1 -0
  59. package/dist/src/icons/Chains/OSMO.d.ts +4 -0
  60. package/dist/src/icons/Chains/OSMO.d.ts.map +1 -0
  61. package/dist/src/icons/{Tokens/MATIC.d.ts → Chains/POLY.d.ts} +1 -1
  62. package/dist/src/icons/Chains/POLY.d.ts.map +1 -0
  63. package/dist/src/icons/Chains/SCROLL.d.ts +4 -0
  64. package/dist/src/icons/Chains/SCROLL.d.ts.map +1 -0
  65. package/dist/src/icons/Chains/SOL.d.ts +4 -0
  66. package/dist/src/icons/Chains/SOL.d.ts.map +1 -0
  67. package/dist/src/icons/Chains/SUI.d.ts +4 -0
  68. package/dist/src/icons/Chains/SUI.d.ts.map +1 -0
  69. package/dist/src/icons/Chains/XLAYER.d.ts +4 -0
  70. package/dist/src/icons/Chains/XLAYER.d.ts.map +1 -0
  71. package/dist/src/icons/{Tokens/noIcon.d.ts → Chains/empty.d.ts} +1 -1
  72. package/dist/src/icons/Chains/empty.d.ts.map +1 -0
  73. package/dist/src/icons/Error.d.ts +5 -0
  74. package/dist/src/icons/Error.d.ts.map +1 -0
  75. package/dist/src/icons/TokenIcons.d.ts +4 -4
  76. package/dist/src/icons/TokenIcons.d.ts.map +1 -1
  77. package/dist/src/icons/Tokens/POLY.d.ts +4 -0
  78. package/dist/src/icons/Tokens/POLY.d.ts.map +1 -0
  79. package/{lib/src/icons/Tokens/noIcon.d.ts → dist/src/icons/Tokens/empty.d.ts} +1 -1
  80. package/dist/src/icons/Tokens/empty.d.ts.map +1 -0
  81. package/dist/src/icons/Warning.d.ts +5 -0
  82. package/dist/src/icons/Warning.d.ts.map +1 -0
  83. package/dist/src/utils/sdkv2.d.ts.map +1 -1
  84. package/dist/src/views/v2/Bridge/AmountInput/index.d.ts.map +1 -1
  85. package/dist/src/views/v2/Bridge/AssetPicker/ChainList.d.ts.map +1 -1
  86. package/dist/src/views/v2/Bridge/AssetPicker/index.d.ts.map +1 -1
  87. package/dist/src/views/v2/Bridge/Routes/SingleRoute.d.ts.map +1 -1
  88. package/dist/src/views/v2/Bridge/SwapInputs/index.d.ts.map +1 -1
  89. package/dist/src/views/v2/Redeem/TransactionDetails/index.d.ts.map +1 -1
  90. package/dist/src/views/v2/TxHistory/Item/index.d.ts.map +1 -1
  91. package/lib/{algorand-DsJKeIr5.mjs → algorand-CnhJd_dq.mjs} +3 -3
  92. package/lib/{algorand-BixJkKlf.js → algorand-F3xFUrZu.js} +1 -1
  93. package/lib/{aptos-BfNT2MMg.js → aptos-CUGJTnxp.js} +2 -2
  94. package/lib/{aptos-prTLw0zg.mjs → aptos-DZsV2iRv.mjs} +1 -1
  95. package/lib/{aptos-DP1G2KNL.mjs → aptos-Dzo7tWbP.mjs} +3 -3
  96. package/lib/{aptos-DSDxN2Oh.js → aptos-JorFrRlO.js} +1 -1
  97. package/lib/{ccip-DqvPZUFd.mjs → ccip-CGdvCMfU.mjs} +1 -1
  98. package/lib/{ccip-CORtuKLa.js → ccip-WvYiDS-K.js} +1 -1
  99. package/lib/{cosmwasm-CARLnvsg.mjs → cosmwasm-DN0AHdEC.mjs} +6 -6
  100. package/lib/{cosmwasm-D_THf_Jx.js → cosmwasm-Dg8T1AeT.js} +2 -2
  101. package/lib/{events-ByywXw-I.js → events-D8Ws4SSV.js} +1 -1
  102. package/lib/{events-D26WqMv7.mjs → events-DdSBahX7.mjs} +1 -1
  103. package/lib/{evm-B4avmxZ0.js → evm-3fprRMRy.js} +1 -1
  104. package/lib/{evm-PZUgLFER.js → evm-D-BOv3OA.js} +4 -4
  105. package/lib/{evm-qAJdXmfg.mjs → evm-DnhPF5dt.mjs} +12 -12
  106. package/lib/{evm-BIZUXCC2.mjs → evm-H_bKmdGg.mjs} +7 -7
  107. package/lib/{index-Dcw9cmF1.js → index--DjYWDRB.js} +1 -1
  108. package/lib/{index-7QTP5abI.js → index-B-zhCYHk.js} +1 -1
  109. package/lib/{index-C3wsSYLo.mjs → index-B17OfY1l.mjs} +2 -2
  110. package/lib/{index-Uwpj8GZq.js → index-B1wNeKc9.js} +1 -1
  111. package/lib/{index-D2AdBTEw.mjs → index-BHklNnJk.mjs} +4 -4
  112. package/lib/{index-DCWQkYP9.mjs → index-BVOQlHAu.mjs} +2 -2
  113. package/lib/{index-CZyMJdwZ.mjs → index-BcmVWAO0.mjs} +1 -1
  114. package/lib/{index-Bk4O6F71.mjs → index-BdfG3lJW.mjs} +1 -1
  115. package/lib/index-BjJ4BDhi.js +5 -0
  116. package/lib/{index-Bo-4EpMy.mjs → index-BlV7bTcP.mjs} +11 -11
  117. package/lib/{index-CjqSmvJv.mjs → index-BpgHIKBe.mjs} +11785 -10206
  118. package/lib/{index-B12QivYB.mjs → index-BuynHxM5.mjs} +140 -149
  119. package/lib/{index-Dui1f--u.mjs → index-BvmOowYJ.mjs} +4 -4
  120. package/lib/{index-Ci2My7Wd.js → index-C7Ggs6qV.js} +1 -1
  121. package/lib/{index-CyivlCUm.mjs → index-C7iFAy5u.mjs} +1 -1
  122. package/lib/{index-CjwkPmul.mjs → index-CMboM3K3.mjs} +2 -2
  123. package/lib/{index-B_MZPnqY.mjs → index-CXSjmxbe.mjs} +2 -2
  124. package/lib/{index-DkGpLtjt.js → index-CYuWGvEH.js} +1 -1
  125. package/lib/{index-C9pDNiDb.mjs → index-C_rNtVK6.mjs} +2 -2
  126. package/lib/{index-CPTLMohs.js → index-CjVR2y_P.js} +1 -1
  127. package/lib/index-CnSAQLrV.mjs +3816 -0
  128. package/lib/{index-DHqcaM3p.js → index-CqEKPcR6.js} +1 -1
  129. package/lib/{index-ByoyzlD8.mjs → index-D2ZeoQJK.mjs} +2 -2
  130. package/lib/{index-aGiZ0Ii1.mjs → index-D3KQzv3w.mjs} +3 -3
  131. package/lib/{index-pRsBJecB.mjs → index-D3R38eof.mjs} +2 -2
  132. package/lib/{index-BlY7x8aT.js → index-D4UVCCA_.js} +1 -1
  133. package/lib/{index-CQJHdG55.mjs → index-D5V8xUx6.mjs} +2 -2
  134. package/lib/{index-De8biE2M.mjs → index-DCDfhwO6.mjs} +1 -1
  135. package/lib/{index-BrMNAxOe.js → index-DJNuweoE.js} +1 -1
  136. package/lib/{index-BMrLuIZN.js → index-DK3NwBVm.js} +1 -1
  137. package/lib/{index-BsusxMly.js → index-DLboWTYu.js} +1 -1
  138. package/lib/{index-DPqJrtJC.js → index-DWjlQfKm.js} +1 -1
  139. package/lib/{index-DVYpLXjZ.mjs → index-DayCZrK8.mjs} +2 -2
  140. package/lib/{index-CwU49oAB.mjs → index-DeqerBZA.mjs} +2 -2
  141. package/lib/{index-DW5lODgc.js → index-DgegRtGl.js} +1 -1
  142. package/lib/{index-9uqt3JNu.js → index-DpDevDxN.js} +1 -1
  143. package/lib/{index-CYf3zJ9U.js → index-Ds1qW639.js} +1 -1
  144. package/lib/{index-0HzcGIG7.js → index-DwrJnKct.js} +1 -1
  145. package/lib/{index-DLtY6fYS.js → index-YHxHDLCx.js} +1 -1
  146. package/lib/index-ZxjZ25k7.js +5 -0
  147. package/lib/{index-CTR28Kqb.js → index-_H1GTLUN.js} +1 -1
  148. package/lib/{index-BckHu5WB.mjs → index-a0jcclYd.mjs} +4 -4
  149. package/lib/{index-Cm4mzU66.js → index-dJYuE1XM.js} +1 -1
  150. package/lib/{index-By-bUyoB.mjs → index-fWs1RWi9.mjs} +2 -2
  151. package/lib/{index-C0BdeM6x.js → index-tgY8ENKu.js} +1 -1
  152. package/lib/{index-C7GdFYql.js → index-uRFn7LyP.js} +83 -83
  153. package/lib/{index.es-Cck7Q64X.mjs → index.es-DmO_K9V9.mjs} +5 -5
  154. package/lib/{index.es-AHohFAAx.js → index.es-ebfnW8JA.js} +2 -2
  155. package/lib/index.js +1 -1
  156. package/lib/index.mjs +2 -2
  157. package/lib/{keccak-BH-QLSRT.mjs → keccak-C4VHYT3-.mjs} +1 -1
  158. package/lib/{keccak-eY58RWPu.js → keccak-CspXZGIt.js} +1 -1
  159. package/lib/{pbkdf2-BfOdx-Dl.mjs → pbkdf2-B6Kn0zmY.mjs} +1 -1
  160. package/lib/{pbkdf2-CSYv20wX.js → pbkdf2-DtpaWNtQ.js} +1 -1
  161. package/lib/{signer-B8jRb0nz.js → signer-DBqxRPZ3.js} +1 -1
  162. package/lib/{signer-DS-_n4Nt.mjs → signer-DZsY9TLP.mjs} +1 -1
  163. package/lib/{solana--qAtGpyY.mjs → solana-BABTG8N7.mjs} +4 -4
  164. package/lib/solana-CR8CywCk.mjs +16 -0
  165. package/lib/solana-CUDRhtZZ.js +1 -0
  166. package/lib/{solana-BSRpQGAt.js → solana-DEDJJyBR.js} +1 -1
  167. package/lib/{solanaEmbed.esm-BQflKuI4.mjs → solanaEmbed.esm-BAbo7-i8.mjs} +3 -3
  168. package/lib/{solanaEmbed.esm-5JVQ2kx5.js → solanaEmbed.esm-BIOABkzi.js} +1 -1
  169. package/lib/src/config/devnet/chains.d.ts.map +1 -1
  170. package/lib/src/config/devnet/tokens.d.ts.map +1 -1
  171. package/lib/src/config/mainnet/chains.d.ts.map +1 -1
  172. package/lib/src/config/mainnet/tokens.d.ts.map +1 -1
  173. package/lib/src/config/testnet/chains.d.ts.map +1 -1
  174. package/lib/src/config/testnet/tokens.d.ts.map +1 -1
  175. package/lib/src/config/types.d.ts +4 -3
  176. package/lib/src/config/types.d.ts.map +1 -1
  177. package/lib/src/icons/ChainIcons.d.ts +9 -0
  178. package/lib/src/icons/ChainIcons.d.ts.map +1 -0
  179. package/lib/src/icons/Chains/APT.d.ts +4 -0
  180. package/lib/src/icons/Chains/APT.d.ts.map +1 -0
  181. package/lib/src/icons/Chains/ARBITRUM.d.ts +4 -0
  182. package/lib/src/icons/Chains/ARBITRUM.d.ts.map +1 -0
  183. package/lib/src/icons/Chains/AVAX.d.ts +4 -0
  184. package/lib/src/icons/Chains/AVAX.d.ts.map +1 -0
  185. package/lib/src/icons/Chains/BASE.d.ts +4 -0
  186. package/lib/src/icons/Chains/BASE.d.ts.map +1 -0
  187. package/lib/src/icons/Chains/BLAST.d.ts +4 -0
  188. package/lib/src/icons/Chains/BLAST.d.ts.map +1 -0
  189. package/lib/src/icons/Chains/BSC.d.ts +4 -0
  190. package/lib/src/icons/Chains/BSC.d.ts.map +1 -0
  191. package/lib/src/icons/Chains/CELO.d.ts +4 -0
  192. package/lib/src/icons/Chains/CELO.d.ts.map +1 -0
  193. package/lib/src/icons/Chains/ETH.d.ts +4 -0
  194. package/lib/src/icons/Chains/ETH.d.ts.map +1 -0
  195. package/lib/src/icons/Chains/FTM.d.ts +4 -0
  196. package/lib/src/icons/Chains/FTM.d.ts.map +1 -0
  197. package/lib/src/icons/Chains/GLMR.d.ts +4 -0
  198. package/lib/src/icons/Chains/GLMR.d.ts.map +1 -0
  199. package/lib/src/icons/Chains/KAIA.d.ts +4 -0
  200. package/lib/src/icons/Chains/KAIA.d.ts.map +1 -0
  201. package/lib/src/icons/Chains/MANTLE.d.ts +4 -0
  202. package/lib/src/icons/Chains/MANTLE.d.ts.map +1 -0
  203. package/lib/src/icons/Chains/OPTIMISM.d.ts +4 -0
  204. package/lib/src/icons/Chains/OPTIMISM.d.ts.map +1 -0
  205. package/lib/src/icons/Chains/OSMO.d.ts +4 -0
  206. package/lib/src/icons/Chains/OSMO.d.ts.map +1 -0
  207. package/lib/src/icons/{Tokens/MATIC.d.ts → Chains/POLY.d.ts} +1 -1
  208. package/lib/src/icons/Chains/POLY.d.ts.map +1 -0
  209. package/lib/src/icons/Chains/SCROLL.d.ts +4 -0
  210. package/lib/src/icons/Chains/SCROLL.d.ts.map +1 -0
  211. package/lib/src/icons/Chains/SOL.d.ts +4 -0
  212. package/lib/src/icons/Chains/SOL.d.ts.map +1 -0
  213. package/lib/src/icons/Chains/SUI.d.ts +4 -0
  214. package/lib/src/icons/Chains/SUI.d.ts.map +1 -0
  215. package/lib/src/icons/Chains/XLAYER.d.ts +4 -0
  216. package/lib/src/icons/Chains/XLAYER.d.ts.map +1 -0
  217. package/lib/src/icons/Chains/empty.d.ts +4 -0
  218. package/lib/src/icons/Chains/empty.d.ts.map +1 -0
  219. package/lib/src/icons/Error.d.ts +5 -0
  220. package/lib/src/icons/Error.d.ts.map +1 -0
  221. package/lib/src/icons/TokenIcons.d.ts +4 -4
  222. package/lib/src/icons/TokenIcons.d.ts.map +1 -1
  223. package/lib/src/icons/Tokens/POLY.d.ts +4 -0
  224. package/lib/src/icons/Tokens/POLY.d.ts.map +1 -0
  225. package/lib/src/icons/Tokens/empty.d.ts +4 -0
  226. package/lib/src/icons/Tokens/empty.d.ts.map +1 -0
  227. package/lib/src/icons/Warning.d.ts +5 -0
  228. package/lib/src/icons/Warning.d.ts.map +1 -0
  229. package/lib/src/utils/sdkv2.d.ts.map +1 -1
  230. package/lib/src/views/v2/Bridge/AmountInput/index.d.ts.map +1 -1
  231. package/lib/src/views/v2/Bridge/AssetPicker/ChainList.d.ts.map +1 -1
  232. package/lib/src/views/v2/Bridge/AssetPicker/index.d.ts.map +1 -1
  233. package/lib/src/views/v2/Bridge/Routes/SingleRoute.d.ts.map +1 -1
  234. package/lib/src/views/v2/Bridge/SwapInputs/index.d.ts.map +1 -1
  235. package/lib/src/views/v2/Redeem/TransactionDetails/index.d.ts.map +1 -1
  236. package/lib/src/views/v2/TxHistory/Item/index.d.ts.map +1 -1
  237. package/lib/{sui-CHdzm0pJ.js → sui-CD_LLkGE.js} +2 -2
  238. package/lib/{sui-CTaDMtDE.mjs → sui-CfiEBlu_.mjs} +74 -75
  239. package/lib/{sui-BrXrepC3.mjs → sui-DYCvDMMh.mjs} +1 -1
  240. package/lib/{sui-B9mPyuqg.js → sui-Da1ir949.js} +1 -1
  241. package/lib/unsignedTransaction-BD81leu1.mjs +16 -0
  242. package/lib/{unsignedTransaction-B6O-8vao.js → unsignedTransaction-BNppfIUA.js} +1 -1
  243. package/lib/unsignedTransaction-DzSLsK-p.js +1 -0
  244. package/lib/{unsignedTransaction-BLH74msy.mjs → unsignedTransaction-l29mWyX4.mjs} +4 -4
  245. package/package.json +17 -17
  246. package/dist/src/icons/Tokens/MATIC.d.ts.map +0 -1
  247. package/dist/src/icons/Tokens/noIcon.d.ts.map +0 -1
  248. package/dist/src/utils/repairVaa.d.ts +0 -4
  249. package/dist/src/utils/repairVaa.d.ts.map +0 -1
  250. package/lib/index-CqmsT5vZ.js +0 -5
  251. package/lib/solana-Dcts27AJ.js +0 -1
  252. package/lib/solana-qJnrP02J.mjs +0 -16
  253. package/lib/src/icons/Tokens/MATIC.d.ts.map +0 -1
  254. package/lib/src/icons/Tokens/noIcon.d.ts.map +0 -1
  255. package/lib/src/utils/repairVaa.d.ts +0 -4
  256. package/lib/src/utils/repairVaa.d.ts.map +0 -1
@@ -1,4 +1,4 @@
1
- "use strict";const H=require("./index-C7GdFYql.js"),Bt=require("./index-DLtY6fYS.js"),ti=require("./events-ByywXw-I.js");function Kr(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}function Ur(t,r){r||(r=t.reduce((o,h)=>o+h.length,0));const n=Kr(r);let c=0;for(const o of t)n.set(o,c),c+=o.length;return n}const wr={...Bt.identityBase,...Bt.base2,...Bt.base8,...Bt.base10,...Bt.base16,...Bt.base32,...Bt.base36,...Bt.base58,...Bt.base64,...Bt.base256emoji};function Hr(t,r,n,c){return{name:t,prefix:r,encoder:{name:t,prefix:r,encode:n},decoder:{decode:c}}}const vr=Hr("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),Ye=Hr("ascii","a",t=>{let r="a";for(let n=0;n<t.length;n++)r+=String.fromCharCode(t[n]);return r},t=>{t=t.substring(1);const r=Kr(t.length);for(let n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r}),Gr={utf8:vr,"utf-8":vr,hex:wr.base16,latin1:Ye,ascii:Ye,binary:Ye,...wr};function de(t,r="utf8"){const n=Gr[r];if(!n)throw new Error(`Unsupported encoding "${r}"`);return(r==="utf8"||r==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t,"utf8"):n.decoder.decode(`${n.prefix}${t}`)}function Le(t,r="utf8"){const n=Gr[r];if(!n)throw new Error(`Unsupported encoding "${r}"`);return(r==="utf8"||r==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):n.encoder.encode(t).substring(1)}const ei={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe",batchFetchMessages:"waku_batchFetchMessages"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe",batchFetchMessages:"irn_batchFetchMessages"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe",batchFetchMessages:"iridium_batchFetchMessages"}},ri=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,ni=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,ii=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function si(t,r){if(t==="__proto__"||t==="constructor"&&r&&typeof r=="object"&&"prototype"in r){oi(t);return}return r}function oi(t){console.warn(`[destr] Dropping "${t}" key to prevent prototype pollution.`)}function De(t,r={}){if(typeof t!="string")return t;const n=t.trim();if(t[0]==='"'&&t.endsWith('"')&&!t.includes("\\"))return n.slice(1,-1);if(n.length<=9){const c=n.toLowerCase();if(c==="true")return!0;if(c==="false")return!1;if(c==="undefined")return;if(c==="null")return null;if(c==="nan")return Number.NaN;if(c==="infinity")return Number.POSITIVE_INFINITY;if(c==="-infinity")return Number.NEGATIVE_INFINITY}if(!ii.test(t)){if(r.strict)throw new SyntaxError("[destr] Invalid JSON");return t}try{if(ri.test(t)||ni.test(t)){if(r.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(t,si)}return JSON.parse(t)}catch(c){if(r.strict)throw c;return t}}function ai(t){return!t||typeof t.then!="function"?Promise.resolve(t):t}function Tt(t,...r){try{return ai(t(...r))}catch(n){return Promise.reject(n)}}function fi(t){const r=typeof t;return t===null||r!=="object"&&r!=="function"}function ci(t){const r=Object.getPrototypeOf(t);return!r||r.isPrototypeOf(Object)}function Ue(t){if(fi(t))return String(t);if(ci(t)||Array.isArray(t))return JSON.stringify(t);if(typeof t.toJSON=="function")return Ue(t.toJSON());throw new Error("[unstorage] Cannot stringify value!")}function Jr(){if(typeof H.dist.Buffer>"u")throw new TypeError("[unstorage] Buffer is not supported!")}const er="base64:";function ui(t){if(typeof t=="string")return t;Jr();const r=H.dist.Buffer.from(t).toString("base64");return er+r}function li(t){return typeof t!="string"||!t.startsWith(er)?t:(Jr(),H.dist.Buffer.from(t.slice(er.length),"base64"))}function Kt(t){return t?t.split("?")[0].replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""):""}function hi(...t){return Kt(t.join(":"))}function $e(t){return t=Kt(t),t?t+":":""}const di="memory",bi=()=>{const t=new Map;return{name:di,getInstance:()=>t,hasItem(r){return t.has(r)},getItem(r){return t.get(r)??null},getItemRaw(r){return t.get(r)??null},setItem(r,n){t.set(r,n)},setItemRaw(r,n){t.set(r,n)},removeItem(r){t.delete(r)},getKeys(){return[...t.keys()]},clear(){t.clear()},dispose(){t.clear()}}};function gi(t={}){const r={mounts:{"":t.driver||bi()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},n=s=>{for(const u of r.mountpoints)if(s.startsWith(u))return{base:u,relativeKey:s.slice(u.length),driver:r.mounts[u]};return{base:"",relativeKey:s,driver:r.mounts[""]}},c=(s,u)=>r.mountpoints.filter(y=>y.startsWith(s)||u&&s.startsWith(y)).map(y=>({relativeBase:s.length>y.length?s.slice(y.length):void 0,mountpoint:y,driver:r.mounts[y]})),o=(s,u)=>{if(r.watching){u=Kt(u);for(const y of r.watchListeners)y(s,u)}},h=async()=>{if(!r.watching){r.watching=!0;for(const s in r.mounts)r.unwatch[s]=await Er(r.mounts[s],o,s)}},S=async()=>{if(r.watching){for(const s in r.unwatch)await r.unwatch[s]();r.unwatch={},r.watching=!1}},E=(s,u,y)=>{const v=new Map,w=x=>{let N=v.get(x.base);return N||(N={driver:x.driver,base:x.base,items:[]},v.set(x.base,N)),N};for(const x of s){const N=typeof x=="string",G=Kt(N?x:x.key),ut=N?void 0:x.value,M=N||!x.options?u:{...u,...x.options},Lt=n(G);w(Lt).items.push({key:G,value:ut,relativeKey:Lt.relativeKey,options:M})}return Promise.all([...v.values()].map(x=>y(x))).then(x=>x.flat())},g={hasItem(s,u={}){s=Kt(s);const{relativeKey:y,driver:v}=n(s);return Tt(v.hasItem,y,u)},getItem(s,u={}){s=Kt(s);const{relativeKey:y,driver:v}=n(s);return Tt(v.getItem,y,u).then(w=>De(w))},getItems(s,u){return E(s,u,y=>y.driver.getItems?Tt(y.driver.getItems,y.items.map(v=>({key:v.relativeKey,options:v.options})),u).then(v=>v.map(w=>({key:hi(y.base,w.key),value:De(w.value)}))):Promise.all(y.items.map(v=>Tt(y.driver.getItem,v.relativeKey,v.options).then(w=>({key:v.key,value:De(w)})))))},getItemRaw(s,u={}){s=Kt(s);const{relativeKey:y,driver:v}=n(s);return v.getItemRaw?Tt(v.getItemRaw,y,u):Tt(v.getItem,y,u).then(w=>li(w))},async setItem(s,u,y={}){if(u===void 0)return g.removeItem(s);s=Kt(s);const{relativeKey:v,driver:w}=n(s);w.setItem&&(await Tt(w.setItem,v,Ue(u),y),w.watch||o("update",s))},async setItems(s,u){await E(s,u,async y=>{if(y.driver.setItems)return Tt(y.driver.setItems,y.items.map(v=>({key:v.relativeKey,value:Ue(v.value),options:v.options})),u);y.driver.setItem&&await Promise.all(y.items.map(v=>Tt(y.driver.setItem,v.relativeKey,Ue(v.value),v.options)))})},async setItemRaw(s,u,y={}){if(u===void 0)return g.removeItem(s,y);s=Kt(s);const{relativeKey:v,driver:w}=n(s);if(w.setItemRaw)await Tt(w.setItemRaw,v,u,y);else if(w.setItem)await Tt(w.setItem,v,ui(u),y);else return;w.watch||o("update",s)},async removeItem(s,u={}){typeof u=="boolean"&&(u={removeMeta:u}),s=Kt(s);const{relativeKey:y,driver:v}=n(s);v.removeItem&&(await Tt(v.removeItem,y,u),(u.removeMeta||u.removeMata)&&await Tt(v.removeItem,y+"$",u),v.watch||o("remove",s))},async getMeta(s,u={}){typeof u=="boolean"&&(u={nativeOnly:u}),s=Kt(s);const{relativeKey:y,driver:v}=n(s),w=Object.create(null);if(v.getMeta&&Object.assign(w,await Tt(v.getMeta,y,u)),!u.nativeOnly){const x=await Tt(v.getItem,y+"$",u).then(N=>De(N));x&&typeof x=="object"&&(typeof x.atime=="string"&&(x.atime=new Date(x.atime)),typeof x.mtime=="string"&&(x.mtime=new Date(x.mtime)),Object.assign(w,x))}return w},setMeta(s,u,y={}){return this.setItem(s+"$",u,y)},removeMeta(s,u={}){return this.removeItem(s+"$",u)},async getKeys(s,u={}){s=$e(s);const y=c(s,!0);let v=[];const w=[];for(const x of y){const N=await Tt(x.driver.getKeys,x.relativeBase,u);for(const G of N){const ut=x.mountpoint+Kt(G);v.some(M=>ut.startsWith(M))||w.push(ut)}v=[x.mountpoint,...v.filter(G=>!G.startsWith(x.mountpoint))]}return s?w.filter(x=>x.startsWith(s)&&x[x.length-1]!=="$"):w.filter(x=>x[x.length-1]!=="$")},async clear(s,u={}){s=$e(s),await Promise.all(c(s,!1).map(async y=>{if(y.driver.clear)return Tt(y.driver.clear,y.relativeBase,u);if(y.driver.removeItem){const v=await y.driver.getKeys(y.relativeBase||"",u);return Promise.all(v.map(w=>y.driver.removeItem(w,u)))}}))},async dispose(){await Promise.all(Object.values(r.mounts).map(s=>Sr(s)))},async watch(s){return await h(),r.watchListeners.push(s),async()=>{r.watchListeners=r.watchListeners.filter(u=>u!==s),r.watchListeners.length===0&&await S()}},async unwatch(){r.watchListeners=[],await S()},mount(s,u){if(s=$e(s),s&&r.mounts[s])throw new Error(`already mounted at ${s}`);return s&&(r.mountpoints.push(s),r.mountpoints.sort((y,v)=>v.length-y.length)),r.mounts[s]=u,r.watching&&Promise.resolve(Er(u,o,s)).then(y=>{r.unwatch[s]=y}).catch(console.error),g},async unmount(s,u=!0){s=$e(s),!(!s||!r.mounts[s])&&(r.watching&&s in r.unwatch&&(r.unwatch[s](),delete r.unwatch[s]),u&&await Sr(r.mounts[s]),r.mountpoints=r.mountpoints.filter(y=>y!==s),delete r.mounts[s])},getMount(s=""){s=Kt(s)+":";const u=n(s);return{driver:u.driver,base:u.base}},getMounts(s="",u={}){return s=Kt(s),c(s,u.parents).map(v=>({driver:v.driver,base:v.mountpoint}))},keys:(s,u={})=>g.getKeys(s,u),get:(s,u={})=>g.getItem(s,u),set:(s,u,y={})=>g.setItem(s,u,y),has:(s,u={})=>g.hasItem(s,u),del:(s,u={})=>g.removeItem(s,u),remove:(s,u={})=>g.removeItem(s,u)};return g}function Er(t,r,n){return t.watch?t.watch((c,o)=>r(c,n+o)):()=>{}}async function Sr(t){typeof t.dispose=="function"&&await Tt(t.dispose)}function be(t){return new Promise((r,n)=>{t.oncomplete=t.onsuccess=()=>r(t.result),t.onabort=t.onerror=()=>n(t.error)})}function Fr(t,r){const n=indexedDB.open(t);n.onupgradeneeded=()=>n.result.createObjectStore(r);const c=be(n);return(o,h)=>c.then(S=>h(S.transaction(r,o).objectStore(r)))}let Ze;function Ae(){return Ze||(Ze=Fr("keyval-store","keyval")),Ze}function Ir(t,r=Ae()){return r("readonly",n=>be(n.get(t)))}function yi(t,r,n=Ae()){return n("readwrite",c=>(c.put(r,t),be(c.transaction)))}function pi(t,r=Ae()){return r("readwrite",n=>(n.delete(t),be(n.transaction)))}function _i(t=Ae()){return t("readwrite",r=>(r.clear(),be(r.transaction)))}function mi(t,r){return t.openCursor().onsuccess=function(){this.result&&(r(this.result),this.result.continue())},be(t.transaction)}function xi(t=Ae()){return t("readonly",r=>{if(r.getAllKeys)return be(r.getAllKeys());const n=[];return mi(r,c=>n.push(c.key)).then(()=>n)})}const wi=t=>JSON.stringify(t,(r,n)=>typeof n=="bigint"?n.toString()+"n":n),vi=t=>{const r=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,n=t.replace(r,'$1"$2n"$3');return JSON.parse(n,(c,o)=>typeof o=="string"&&o.match(/^\d+n$/)?BigInt(o.substring(0,o.length-1)):o)};function kr(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return vi(t)}catch{return t}}function Wr(t){return typeof t=="string"?t:wi(t)||""}const Ei="idb-keyval";var Si=(t={})=>{const r=t.base&&t.base.length>0?`${t.base}:`:"",n=o=>r+o;let c;return t.dbName&&t.storeName&&(c=Fr(t.dbName,t.storeName)),{name:Ei,options:t,async hasItem(o){return!(typeof await Ir(n(o),c)>"u")},async getItem(o){return await Ir(n(o),c)??null},setItem(o,h){return yi(n(o),h,c)},removeItem(o){return pi(n(o),c)},getKeys(){return xi(c)},clear(){return _i(c)}}};const Ii="WALLET_CONNECT_V2_INDEXED_DB",Oi="keyvaluestorage";let Ti=class{constructor(){this.indexedDb=gi({driver:Si({dbName:Ii,storeName:Oi})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(r=>[r.key,r.value])}async getItem(r){const n=await this.indexedDb.getItem(r);if(n!==null)return n}async setItem(r,n){await this.indexedDb.setItem(r,Wr(n))}async removeItem(r){await this.indexedDb.removeItem(r)}};var Qe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof H.dist.global<"u"?H.dist.global:typeof self<"u"?self:{},He={exports:{}};(function(){let t;function r(){}t=r,t.prototype.getItem=function(n){return this.hasOwnProperty(n)?String(this[n]):null},t.prototype.setItem=function(n,c){this[n]=String(c)},t.prototype.removeItem=function(n){delete this[n]},t.prototype.clear=function(){const n=this;Object.keys(n).forEach(function(c){n[c]=void 0,delete n[c]})},t.prototype.key=function(n){return n=n||0,Object.keys(this)[n]},t.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof Qe<"u"&&Qe.localStorage?He.exports=Qe.localStorage:typeof window<"u"&&window.localStorage?He.exports=window.localStorage:He.exports=new r})();function Li(t){var r;return[t[0],kr((r=t[1])!=null?r:"")]}class Ai{constructor(){this.localStorage=He.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(Li)}async getItem(r){const n=this.localStorage.getItem(r);if(n!==null)return kr(n)}async setItem(r,n){this.localStorage.setItem(r,Wr(n))}async removeItem(r){this.localStorage.removeItem(r)}}const Ri="wc_storage_version",Or=1,Pi=async(t,r,n)=>{const c=Ri,o=await r.getItem(c);if(o&&o>=Or){n(r);return}const h=await t.getKeys();if(!h.length){n(r);return}const S=[];for(;h.length;){const E=h.shift();if(!E)continue;const g=E.toLowerCase();if(g.includes("wc@")||g.includes("walletconnect")||g.includes("wc_")||g.includes("wallet_connect")){const s=await t.getItem(E);await r.setItem(E,s),S.push(E)}}await r.setItem(c,Or),n(r),ji(t,S)},ji=async(t,r)=>{r.length&&r.forEach(async n=>{await t.removeItem(n)})};let Ci=class{constructor(){this.initialized=!1,this.setInitialized=n=>{this.storage=n,this.initialized=!0};const r=new Ai;this.storage=r;try{const n=new Ti;Pi(r,n,this.setInitialized)}catch{this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(r){return await this.initialize(),this.storage.getItem(r)}async setItem(r,n){return await this.initialize(),this.storage.setItem(r,n)}async removeItem(r){return await this.initialize(),this.storage.removeItem(r)}async initialize(){this.initialized||await new Promise(r=>{const n=setInterval(()=>{this.initialized&&(clearInterval(n),r())},20)})}};class Ni{}function Mi(t){try{return JSON.stringify(t)}catch{return'"[Circular]"'}}var zi=Bi;function Bi(t,r,n){var c=n&&n.stringify||Mi,o=1;if(typeof t=="object"&&t!==null){var h=r.length+o;if(h===1)return t;var S=new Array(h);S[0]=c(t);for(var E=1;E<h;E++)S[E]=c(r[E]);return S.join(" ")}if(typeof t!="string")return t;var g=r.length;if(g===0)return t;for(var s="",u=1-o,y=-1,v=t&&t.length||0,w=0;w<v;){if(t.charCodeAt(w)===37&&w+1<v){switch(y=y>-1?y:0,t.charCodeAt(w+1)){case 100:case 102:if(u>=g||r[u]==null)break;y<w&&(s+=t.slice(y,w)),s+=Number(r[u]),y=w+2,w++;break;case 105:if(u>=g||r[u]==null)break;y<w&&(s+=t.slice(y,w)),s+=Math.floor(Number(r[u])),y=w+2,w++;break;case 79:case 111:case 106:if(u>=g||r[u]===void 0)break;y<w&&(s+=t.slice(y,w));var x=typeof r[u];if(x==="string"){s+="'"+r[u]+"'",y=w+2,w++;break}if(x==="function"){s+=r[u].name||"<anonymous>",y=w+2,w++;break}s+=c(r[u]),y=w+2,w++;break;case 115:if(u>=g)break;y<w&&(s+=t.slice(y,w)),s+=String(r[u]),y=w+2,w++;break;case 37:y<w&&(s+=t.slice(y,w)),s+="%",y=w+2,w++,u--;break}++u}++w}return y===-1?t:(y<v&&(s+=t.slice(y)),s)}const Tr=zi;var me=Qt;const Ie=Wi().console||{},Di={mapHttpRequest:Ke,mapHttpResponse:Ke,wrapRequestSerializer:tr,wrapResponseSerializer:tr,wrapErrorSerializer:tr,req:Ke,res:Ke,err:Gi};function $i(t,r){return Array.isArray(t)?t.filter(function(c){return c!=="!stdSerializers.err"}):t===!0?Object.keys(r):!1}function Qt(t){t=t||{},t.browser=t.browser||{};const r=t.browser.transmit;if(r&&typeof r.send!="function")throw Error("pino: transmit option must have a send function");const n=t.browser.write||Ie;t.browser.write&&(t.browser.asObject=!0);const c=t.serializers||{},o=$i(t.browser.serialize,c);let h=t.browser.serialize;Array.isArray(t.browser.serialize)&&t.browser.serialize.indexOf("!stdSerializers.err")>-1&&(h=!1);const S=["error","fatal","warn","info","debug","trace"];typeof n=="function"&&(n.error=n.fatal=n.warn=n.info=n.debug=n.trace=n),t.enabled===!1&&(t.level="silent");const E=t.level||"info",g=Object.create(n);g.log||(g.log=Oe),Object.defineProperty(g,"levelVal",{get:u}),Object.defineProperty(g,"level",{get:y,set:v});const s={transmit:r,serialize:o,asObject:t.browser.asObject,levels:S,timestamp:Ji(t)};g.levels=Qt.levels,g.level=E,g.setMaxListeners=g.getMaxListeners=g.emit=g.addListener=g.on=g.prependListener=g.once=g.prependOnceListener=g.removeListener=g.removeAllListeners=g.listeners=g.listenerCount=g.eventNames=g.write=g.flush=Oe,g.serializers=c,g._serialize=o,g._stdErrSerialize=h,g.child=w,r&&(g._logEvent=rr());function u(){return this.level==="silent"?1/0:this.levels.values[this.level]}function y(){return this._level}function v(x){if(x!=="silent"&&!this.levels.values[x])throw Error("unknown level "+x);this._level=x,pe(s,g,"error","log"),pe(s,g,"fatal","error"),pe(s,g,"warn","error"),pe(s,g,"info","log"),pe(s,g,"debug","log"),pe(s,g,"trace","log")}function w(x,N){if(!x)throw new Error("missing bindings for child Pino");N=N||{},o&&x.serializers&&(N.serializers=x.serializers);const G=N.serializers;if(o&&G){var ut=Object.assign({},c,G),M=t.browser.serialize===!0?Object.keys(ut):o;delete x.serializers,Ve([x],M,ut,this._stdErrSerialize)}function Lt(gt){this._childLevel=(gt._childLevel|0)+1,this.error=_e(gt,x,"error"),this.fatal=_e(gt,x,"fatal"),this.warn=_e(gt,x,"warn"),this.info=_e(gt,x,"info"),this.debug=_e(gt,x,"debug"),this.trace=_e(gt,x,"trace"),ut&&(this.serializers=ut,this._serialize=M),r&&(this._logEvent=rr([].concat(gt._logEvent.bindings,x)))}return Lt.prototype=this,new Lt(this)}return g}Qt.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}};Qt.stdSerializers=Di;Qt.stdTimeFunctions=Object.assign({},{nullTime:Vr,epochTime:qr,unixTime:Fi,isoTime:ki});function pe(t,r,n,c){const o=Object.getPrototypeOf(r);r[n]=r.levelVal>r.levels.values[n]?Oe:o[n]?o[n]:Ie[n]||Ie[c]||Oe,Ki(t,r,n)}function Ki(t,r,n){!t.transmit&&r[n]===Oe||(r[n]=function(c){return function(){const h=t.timestamp(),S=new Array(arguments.length),E=Object.getPrototypeOf&&Object.getPrototypeOf(this)===Ie?Ie:this;for(var g=0;g<S.length;g++)S[g]=arguments[g];if(t.serialize&&!t.asObject&&Ve(S,this._serialize,this.serializers,this._stdErrSerialize),t.asObject?c.call(E,Ui(this,n,S,h)):c.apply(E,S),t.transmit){const s=t.transmit.level||r.level,u=Qt.levels.values[s],y=Qt.levels.values[n];if(y<u)return;Hi(this,{ts:h,methodLevel:n,methodValue:y,transmitLevel:s,transmitValue:Qt.levels.values[t.transmit.level||r.level],send:t.transmit.send,val:r.levelVal},S)}}}(r[n]))}function Ui(t,r,n,c){t._serialize&&Ve(n,t._serialize,t.serializers,t._stdErrSerialize);const o=n.slice();let h=o[0];const S={};c&&(S.time=c),S.level=Qt.levels.values[r];let E=(t._childLevel|0)+1;if(E<1&&(E=1),h!==null&&typeof h=="object"){for(;E--&&typeof o[0]=="object";)Object.assign(S,o.shift());h=o.length?Tr(o.shift(),o):void 0}else typeof h=="string"&&(h=Tr(o.shift(),o));return h!==void 0&&(S.msg=h),S}function Ve(t,r,n,c){for(const o in t)if(c&&t[o]instanceof Error)t[o]=Qt.stdSerializers.err(t[o]);else if(typeof t[o]=="object"&&!Array.isArray(t[o]))for(const h in t[o])r&&r.indexOf(h)>-1&&h in n&&(t[o][h]=n[h](t[o][h]))}function _e(t,r,n){return function(){const c=new Array(1+arguments.length);c[0]=r;for(var o=1;o<c.length;o++)c[o]=arguments[o-1];return t[n].apply(this,c)}}function Hi(t,r,n){const c=r.send,o=r.ts,h=r.methodLevel,S=r.methodValue,E=r.val,g=t._logEvent.bindings;Ve(n,t._serialize||Object.keys(t.serializers),t.serializers,t._stdErrSerialize===void 0?!0:t._stdErrSerialize),t._logEvent.ts=o,t._logEvent.messages=n.filter(function(s){return g.indexOf(s)===-1}),t._logEvent.level.label=h,t._logEvent.level.value=S,c(h,t._logEvent,E),t._logEvent=rr(g)}function rr(t){return{ts:0,messages:[],bindings:t||[],level:{label:"",value:0}}}function Gi(t){const r={type:t.constructor.name,msg:t.message,stack:t.stack};for(const n in t)r[n]===void 0&&(r[n]=t[n]);return r}function Ji(t){return typeof t.timestamp=="function"?t.timestamp:t.timestamp===!1?Vr:qr}function Ke(){return{}}function tr(t){return t}function Oe(){}function Vr(){return!1}function qr(){return Date.now()}function Fi(){return Math.round(Date.now()/1e3)}function ki(){return new Date(Date.now()).toISOString()}function Wi(){function t(r){return typeof r<"u"&&r}try{return typeof globalThis<"u"||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch{return t(self)||t(window)||t(this)||{}}}const or=H.getDefaultExportFromCjs(me),Vi=t=>JSON.stringify(t,(r,n)=>typeof n=="bigint"?n.toString()+"n":n);function Lr(t){return typeof t=="string"?t:Vi(t)||""}const qi={level:"info"},Re="custom_context",ar=1e3*1024;class Xi{constructor(r){this.nodeValue=r,this.sizeInBytes=new TextEncoder().encode(this.nodeValue).length,this.next=null}get value(){return this.nodeValue}get size(){return this.sizeInBytes}}class Ar{constructor(r){this.head=null,this.tail=null,this.lengthInNodes=0,this.maxSizeInBytes=r,this.sizeInBytes=0}append(r){const n=new Xi(r);if(n.size>this.maxSizeInBytes)throw new Error(`[LinkedList] Value too big to insert into list: ${r} with size ${n.size}`);for(;this.size+n.size>this.maxSizeInBytes;)this.shift();this.head?(this.tail&&(this.tail.next=n),this.tail=n):(this.head=n,this.tail=n),this.lengthInNodes++,this.sizeInBytes+=n.size}shift(){if(!this.head)return;const r=this.head;this.head=this.head.next,this.head||(this.tail=null),this.lengthInNodes--,this.sizeInBytes-=r.size}toArray(){const r=[];let n=this.head;for(;n!==null;)r.push(n.value),n=n.next;return r}get length(){return this.lengthInNodes}get size(){return this.sizeInBytes}toOrderedArray(){return Array.from(this)}[Symbol.iterator](){let r=this.head;return{next:()=>{if(!r)return{done:!0,value:null};const n=r.value;return r=r.next,{done:!1,value:n}}}}}class Xr{constructor(r,n=ar){this.level=r??"error",this.levelValue=me.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=n,this.logs=new Ar(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(r,n){n===me.levels.values.error?console.error(r):n===me.levels.values.warn?console.warn(r):n===me.levels.values.debug?console.debug(r):n===me.levels.values.trace?console.trace(r):console.log(r)}appendToLogs(r){this.logs.append(Lr({timestamp:new Date().toISOString(),log:r}));const n=typeof r=="string"?JSON.parse(r).level:r.level;n>=this.levelValue&&this.forwardToConsole(r,n)}getLogs(){return this.logs}clearLogs(){this.logs=new Ar(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(r){const n=this.getLogArray();return n.push(Lr({extraMetadata:r})),new Blob(n,{type:"application/json"})}}class Yi{constructor(r,n=ar){this.baseChunkLogger=new Xr(r,n)}write(r){this.baseChunkLogger.appendToLogs(r)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(r){return this.baseChunkLogger.logsToBlob(r)}downloadLogsBlobInBrowser(r){const n=URL.createObjectURL(this.logsToBlob(r)),c=document.createElement("a");c.href=n,c.download=`walletconnect-logs-${new Date().toISOString()}.txt`,document.body.appendChild(c),c.click(),document.body.removeChild(c),URL.revokeObjectURL(n)}}class Zi{constructor(r,n=ar){this.baseChunkLogger=new Xr(r,n)}write(r){this.baseChunkLogger.appendToLogs(r)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(r){return this.baseChunkLogger.logsToBlob(r)}}var Qi=Object.defineProperty,ts=Object.defineProperties,es=Object.getOwnPropertyDescriptors,Rr=Object.getOwnPropertySymbols,rs=Object.prototype.hasOwnProperty,ns=Object.prototype.propertyIsEnumerable,Pr=(t,r,n)=>r in t?Qi(t,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[r]=n,Ge=(t,r)=>{for(var n in r||(r={}))rs.call(r,n)&&Pr(t,n,r[n]);if(Rr)for(var n of Rr(r))ns.call(r,n)&&Pr(t,n,r[n]);return t},Je=(t,r)=>ts(t,es(r));function is(t){return Je(Ge({},t),{level:(t==null?void 0:t.level)||qi.level})}function ss(t,r=Re){return t[r]||""}function os(t,r,n=Re){return t[n]=r,t}function Yr(t,r=Re){let n="";return typeof t.bindings>"u"?n=ss(t,r):n=t.bindings().context||"",n}function as(t,r,n=Re){const c=Yr(t,n);return c.trim()?`${c}/${r}`:r}function fs(t,r,n=Re){const c=as(t,r,n),o=t.child({context:c});return os(o,c,n)}function cs(t){var r,n;const c=new Yi((r=t.opts)==null?void 0:r.level,t.maxSizeInBytes);return{logger:or(Je(Ge({},t.opts),{level:"trace",browser:Je(Ge({},(n=t.opts)==null?void 0:n.browser),{write:o=>c.write(o)})})),chunkLoggerController:c}}function us(t){var r;const n=new Zi((r=t.opts)==null?void 0:r.level,t.maxSizeInBytes);return{logger:or(Je(Ge({},t.opts),{level:"trace"}),n),chunkLoggerController:n}}function ls(t){return typeof t.loggerOverride<"u"&&typeof t.loggerOverride!="string"?{logger:t.loggerOverride,chunkLoggerController:null}:typeof window<"u"?cs(t):us(t)}var fr={},Zr={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var r=Bt.binary,n=Bt.wipe;t.DIGEST_LENGTH=64,t.BLOCK_SIZE=128;var c=function(){function E(){this.digestLength=t.DIGEST_LENGTH,this.blockSize=t.BLOCK_SIZE,this._stateHi=new Int32Array(8),this._stateLo=new Int32Array(8),this._tempHi=new Int32Array(16),this._tempLo=new Int32Array(16),this._buffer=new Uint8Array(256),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return E.prototype._initState=function(){this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209},E.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},E.prototype.clean=function(){n.wipe(this._buffer),n.wipe(this._tempHi),n.wipe(this._tempLo),this.reset()},E.prototype.update=function(g,s){if(s===void 0&&(s=g.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var u=0;if(this._bytesHashed+=s,this._bufferLength>0){for(;this._bufferLength<t.BLOCK_SIZE&&s>0;)this._buffer[this._bufferLength++]=g[u++],s--;this._bufferLength===this.blockSize&&(h(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(s>=this.blockSize&&(u=h(this._tempHi,this._tempLo,this._stateHi,this._stateLo,g,u,s),s%=this.blockSize);s>0;)this._buffer[this._bufferLength++]=g[u++],s--;return this},E.prototype.finish=function(g){if(!this._finished){var s=this._bytesHashed,u=this._bufferLength,y=s/536870912|0,v=s<<3,w=s%128<112?128:256;this._buffer[u]=128;for(var x=u+1;x<w-8;x++)this._buffer[x]=0;r.writeUint32BE(y,this._buffer,w-8),r.writeUint32BE(v,this._buffer,w-4),h(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,w),this._finished=!0}for(var x=0;x<this.digestLength/8;x++)r.writeUint32BE(this._stateHi[x],g,x*8),r.writeUint32BE(this._stateLo[x],g,x*8+4);return this},E.prototype.digest=function(){var g=new Uint8Array(this.digestLength);return this.finish(g),g},E.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{stateHi:new Int32Array(this._stateHi),stateLo:new Int32Array(this._stateLo),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},E.prototype.restoreState=function(g){return this._stateHi.set(g.stateHi),this._stateLo.set(g.stateLo),this._bufferLength=g.bufferLength,g.buffer&&this._buffer.set(g.buffer),this._bytesHashed=g.bytesHashed,this._finished=!1,this},E.prototype.cleanSavedState=function(g){n.wipe(g.stateHi),n.wipe(g.stateLo),g.buffer&&n.wipe(g.buffer),g.bufferLength=0,g.bytesHashed=0},E}();t.SHA512=c;var o=new Int32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]);function h(E,g,s,u,y,v,w){for(var x=s[0],N=s[1],G=s[2],ut=s[3],M=s[4],Lt=s[5],gt=s[6],Ct=s[7],J=u[0],C=u[1],Nt=u[2],te=u[3],yt=u[4],kt=u[5],Ut=u[6],qt=u[7],m,_,X,lt,A,I,O,L;w>=128;){for(var At=0;At<16;At++){var rt=8*At+v;E[At]=r.readUint32BE(y,rt),g[At]=r.readUint32BE(y,rt+4)}for(var At=0;At<80;At++){var xe=x,z=N,ge=G,b=ut,d=M,l=Lt,e=gt,a=Ct,R=J,P=C,D=Nt,$=te,B=yt,K=kt,Rt=Ut,ht=qt;if(m=Ct,_=qt,A=_&65535,I=_>>>16,O=m&65535,L=m>>>16,m=(M>>>14|yt<<18)^(M>>>18|yt<<14)^(yt>>>9|M<<23),_=(yt>>>14|M<<18)^(yt>>>18|M<<14)^(M>>>9|yt<<23),A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,m=M&Lt^~M&gt,_=yt&kt^~yt&Ut,A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,m=o[At*2],_=o[At*2+1],A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,m=E[At%16],_=g[At%16],A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,I+=A>>>16,O+=I>>>16,L+=O>>>16,X=O&65535|L<<16,lt=A&65535|I<<16,m=X,_=lt,A=_&65535,I=_>>>16,O=m&65535,L=m>>>16,m=(x>>>28|J<<4)^(J>>>2|x<<30)^(J>>>7|x<<25),_=(J>>>28|x<<4)^(x>>>2|J<<30)^(x>>>7|J<<25),A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,m=x&N^x&G^N&G,_=J&C^J&Nt^C&Nt,A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,I+=A>>>16,O+=I>>>16,L+=O>>>16,a=O&65535|L<<16,ht=A&65535|I<<16,m=b,_=$,A=_&65535,I=_>>>16,O=m&65535,L=m>>>16,m=X,_=lt,A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,I+=A>>>16,O+=I>>>16,L+=O>>>16,b=O&65535|L<<16,$=A&65535|I<<16,N=xe,G=z,ut=ge,M=b,Lt=d,gt=l,Ct=e,x=a,C=R,Nt=P,te=D,yt=$,kt=B,Ut=K,qt=Rt,J=ht,At%16===15)for(var rt=0;rt<16;rt++)m=E[rt],_=g[rt],A=_&65535,I=_>>>16,O=m&65535,L=m>>>16,m=E[(rt+9)%16],_=g[(rt+9)%16],A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,X=E[(rt+1)%16],lt=g[(rt+1)%16],m=(X>>>1|lt<<31)^(X>>>8|lt<<24)^X>>>7,_=(lt>>>1|X<<31)^(lt>>>8|X<<24)^(lt>>>7|X<<25),A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,X=E[(rt+14)%16],lt=g[(rt+14)%16],m=(X>>>19|lt<<13)^(lt>>>29|X<<3)^X>>>6,_=(lt>>>19|X<<13)^(X>>>29|lt<<3)^(lt>>>6|X<<26),A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,I+=A>>>16,O+=I>>>16,L+=O>>>16,E[rt]=O&65535|L<<16,g[rt]=A&65535|I<<16}m=x,_=J,A=_&65535,I=_>>>16,O=m&65535,L=m>>>16,m=s[0],_=u[0],A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,I+=A>>>16,O+=I>>>16,L+=O>>>16,s[0]=x=O&65535|L<<16,u[0]=J=A&65535|I<<16,m=N,_=C,A=_&65535,I=_>>>16,O=m&65535,L=m>>>16,m=s[1],_=u[1],A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,I+=A>>>16,O+=I>>>16,L+=O>>>16,s[1]=N=O&65535|L<<16,u[1]=C=A&65535|I<<16,m=G,_=Nt,A=_&65535,I=_>>>16,O=m&65535,L=m>>>16,m=s[2],_=u[2],A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,I+=A>>>16,O+=I>>>16,L+=O>>>16,s[2]=G=O&65535|L<<16,u[2]=Nt=A&65535|I<<16,m=ut,_=te,A=_&65535,I=_>>>16,O=m&65535,L=m>>>16,m=s[3],_=u[3],A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,I+=A>>>16,O+=I>>>16,L+=O>>>16,s[3]=ut=O&65535|L<<16,u[3]=te=A&65535|I<<16,m=M,_=yt,A=_&65535,I=_>>>16,O=m&65535,L=m>>>16,m=s[4],_=u[4],A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,I+=A>>>16,O+=I>>>16,L+=O>>>16,s[4]=M=O&65535|L<<16,u[4]=yt=A&65535|I<<16,m=Lt,_=kt,A=_&65535,I=_>>>16,O=m&65535,L=m>>>16,m=s[5],_=u[5],A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,I+=A>>>16,O+=I>>>16,L+=O>>>16,s[5]=Lt=O&65535|L<<16,u[5]=kt=A&65535|I<<16,m=gt,_=Ut,A=_&65535,I=_>>>16,O=m&65535,L=m>>>16,m=s[6],_=u[6],A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,I+=A>>>16,O+=I>>>16,L+=O>>>16,s[6]=gt=O&65535|L<<16,u[6]=Ut=A&65535|I<<16,m=Ct,_=qt,A=_&65535,I=_>>>16,O=m&65535,L=m>>>16,m=s[7],_=u[7],A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,I+=A>>>16,O+=I>>>16,L+=O>>>16,s[7]=Ct=O&65535|L<<16,u[7]=qt=A&65535|I<<16,v+=128,w-=128}return v}function S(E){var g=new c;g.update(E);var s=g.digest();return g.clean(),s}t.hash=S})(Zr);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.convertSecretKeyToX25519=t.convertPublicKeyToX25519=t.verify=t.sign=t.extractPublicKeyFromSecretKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.SEED_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=t.SIGNATURE_LENGTH=void 0;const r=Bt.random,n=Zr,c=Bt.wipe;t.SIGNATURE_LENGTH=64,t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=64,t.SEED_LENGTH=32;function o(b){const d=new Float64Array(16);if(b)for(let l=0;l<b.length;l++)d[l]=b[l];return d}const h=new Uint8Array(32);h[0]=9;const S=o(),E=o([1]),g=o([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),s=o([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),u=o([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),y=o([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),v=o([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function w(b,d){for(let l=0;l<16;l++)b[l]=d[l]|0}function x(b){let d=1;for(let l=0;l<16;l++){let e=b[l]+d+65535;d=Math.floor(e/65536),b[l]=e-d*65536}b[0]+=d-1+37*(d-1)}function N(b,d,l){const e=~(l-1);for(let a=0;a<16;a++){const R=e&(b[a]^d[a]);b[a]^=R,d[a]^=R}}function G(b,d){const l=o(),e=o();for(let a=0;a<16;a++)e[a]=d[a];x(e),x(e),x(e);for(let a=0;a<2;a++){l[0]=e[0]-65517;for(let P=1;P<15;P++)l[P]=e[P]-65535-(l[P-1]>>16&1),l[P-1]&=65535;l[15]=e[15]-32767-(l[14]>>16&1);const R=l[15]>>16&1;l[14]&=65535,N(e,l,1-R)}for(let a=0;a<16;a++)b[2*a]=e[a]&255,b[2*a+1]=e[a]>>8}function ut(b,d){let l=0;for(let e=0;e<32;e++)l|=b[e]^d[e];return(1&l-1>>>8)-1}function M(b,d){const l=new Uint8Array(32),e=new Uint8Array(32);return G(l,b),G(e,d),ut(l,e)}function Lt(b){const d=new Uint8Array(32);return G(d,b),d[0]&1}function gt(b,d){for(let l=0;l<16;l++)b[l]=d[2*l]+(d[2*l+1]<<8);b[15]&=32767}function Ct(b,d,l){for(let e=0;e<16;e++)b[e]=d[e]+l[e]}function J(b,d,l){for(let e=0;e<16;e++)b[e]=d[e]-l[e]}function C(b,d,l){let e,a,R=0,P=0,D=0,$=0,B=0,K=0,Rt=0,ht=0,Pt=0,pt=0,dt=0,nt=0,et=0,Y=0,V=0,U=0,it=0,_t=0,F=0,Mt=0,Dt=0,Ht=0,Gt=0,$t=0,Xt=0,Zt=0,se=0,Jt=0,ce=0,we=0,Pe=0,st=l[0],Z=l[1],ot=l[2],at=l[3],ft=l[4],Q=l[5],mt=l[6],xt=l[7],wt=l[8],vt=l[9],Et=l[10],bt=l[11],ct=l[12],W=l[13],St=l[14],It=l[15];e=d[0],R+=e*st,P+=e*Z,D+=e*ot,$+=e*at,B+=e*ft,K+=e*Q,Rt+=e*mt,ht+=e*xt,Pt+=e*wt,pt+=e*vt,dt+=e*Et,nt+=e*bt,et+=e*ct,Y+=e*W,V+=e*St,U+=e*It,e=d[1],P+=e*st,D+=e*Z,$+=e*ot,B+=e*at,K+=e*ft,Rt+=e*Q,ht+=e*mt,Pt+=e*xt,pt+=e*wt,dt+=e*vt,nt+=e*Et,et+=e*bt,Y+=e*ct,V+=e*W,U+=e*St,it+=e*It,e=d[2],D+=e*st,$+=e*Z,B+=e*ot,K+=e*at,Rt+=e*ft,ht+=e*Q,Pt+=e*mt,pt+=e*xt,dt+=e*wt,nt+=e*vt,et+=e*Et,Y+=e*bt,V+=e*ct,U+=e*W,it+=e*St,_t+=e*It,e=d[3],$+=e*st,B+=e*Z,K+=e*ot,Rt+=e*at,ht+=e*ft,Pt+=e*Q,pt+=e*mt,dt+=e*xt,nt+=e*wt,et+=e*vt,Y+=e*Et,V+=e*bt,U+=e*ct,it+=e*W,_t+=e*St,F+=e*It,e=d[4],B+=e*st,K+=e*Z,Rt+=e*ot,ht+=e*at,Pt+=e*ft,pt+=e*Q,dt+=e*mt,nt+=e*xt,et+=e*wt,Y+=e*vt,V+=e*Et,U+=e*bt,it+=e*ct,_t+=e*W,F+=e*St,Mt+=e*It,e=d[5],K+=e*st,Rt+=e*Z,ht+=e*ot,Pt+=e*at,pt+=e*ft,dt+=e*Q,nt+=e*mt,et+=e*xt,Y+=e*wt,V+=e*vt,U+=e*Et,it+=e*bt,_t+=e*ct,F+=e*W,Mt+=e*St,Dt+=e*It,e=d[6],Rt+=e*st,ht+=e*Z,Pt+=e*ot,pt+=e*at,dt+=e*ft,nt+=e*Q,et+=e*mt,Y+=e*xt,V+=e*wt,U+=e*vt,it+=e*Et,_t+=e*bt,F+=e*ct,Mt+=e*W,Dt+=e*St,Ht+=e*It,e=d[7],ht+=e*st,Pt+=e*Z,pt+=e*ot,dt+=e*at,nt+=e*ft,et+=e*Q,Y+=e*mt,V+=e*xt,U+=e*wt,it+=e*vt,_t+=e*Et,F+=e*bt,Mt+=e*ct,Dt+=e*W,Ht+=e*St,Gt+=e*It,e=d[8],Pt+=e*st,pt+=e*Z,dt+=e*ot,nt+=e*at,et+=e*ft,Y+=e*Q,V+=e*mt,U+=e*xt,it+=e*wt,_t+=e*vt,F+=e*Et,Mt+=e*bt,Dt+=e*ct,Ht+=e*W,Gt+=e*St,$t+=e*It,e=d[9],pt+=e*st,dt+=e*Z,nt+=e*ot,et+=e*at,Y+=e*ft,V+=e*Q,U+=e*mt,it+=e*xt,_t+=e*wt,F+=e*vt,Mt+=e*Et,Dt+=e*bt,Ht+=e*ct,Gt+=e*W,$t+=e*St,Xt+=e*It,e=d[10],dt+=e*st,nt+=e*Z,et+=e*ot,Y+=e*at,V+=e*ft,U+=e*Q,it+=e*mt,_t+=e*xt,F+=e*wt,Mt+=e*vt,Dt+=e*Et,Ht+=e*bt,Gt+=e*ct,$t+=e*W,Xt+=e*St,Zt+=e*It,e=d[11],nt+=e*st,et+=e*Z,Y+=e*ot,V+=e*at,U+=e*ft,it+=e*Q,_t+=e*mt,F+=e*xt,Mt+=e*wt,Dt+=e*vt,Ht+=e*Et,Gt+=e*bt,$t+=e*ct,Xt+=e*W,Zt+=e*St,se+=e*It,e=d[12],et+=e*st,Y+=e*Z,V+=e*ot,U+=e*at,it+=e*ft,_t+=e*Q,F+=e*mt,Mt+=e*xt,Dt+=e*wt,Ht+=e*vt,Gt+=e*Et,$t+=e*bt,Xt+=e*ct,Zt+=e*W,se+=e*St,Jt+=e*It,e=d[13],Y+=e*st,V+=e*Z,U+=e*ot,it+=e*at,_t+=e*ft,F+=e*Q,Mt+=e*mt,Dt+=e*xt,Ht+=e*wt,Gt+=e*vt,$t+=e*Et,Xt+=e*bt,Zt+=e*ct,se+=e*W,Jt+=e*St,ce+=e*It,e=d[14],V+=e*st,U+=e*Z,it+=e*ot,_t+=e*at,F+=e*ft,Mt+=e*Q,Dt+=e*mt,Ht+=e*xt,Gt+=e*wt,$t+=e*vt,Xt+=e*Et,Zt+=e*bt,se+=e*ct,Jt+=e*W,ce+=e*St,we+=e*It,e=d[15],U+=e*st,it+=e*Z,_t+=e*ot,F+=e*at,Mt+=e*ft,Dt+=e*Q,Ht+=e*mt,Gt+=e*xt,$t+=e*wt,Xt+=e*vt,Zt+=e*Et,se+=e*bt,Jt+=e*ct,ce+=e*W,we+=e*St,Pe+=e*It,R+=38*it,P+=38*_t,D+=38*F,$+=38*Mt,B+=38*Dt,K+=38*Ht,Rt+=38*Gt,ht+=38*$t,Pt+=38*Xt,pt+=38*Zt,dt+=38*se,nt+=38*Jt,et+=38*ce,Y+=38*we,V+=38*Pe,a=1,e=R+a+65535,a=Math.floor(e/65536),R=e-a*65536,e=P+a+65535,a=Math.floor(e/65536),P=e-a*65536,e=D+a+65535,a=Math.floor(e/65536),D=e-a*65536,e=$+a+65535,a=Math.floor(e/65536),$=e-a*65536,e=B+a+65535,a=Math.floor(e/65536),B=e-a*65536,e=K+a+65535,a=Math.floor(e/65536),K=e-a*65536,e=Rt+a+65535,a=Math.floor(e/65536),Rt=e-a*65536,e=ht+a+65535,a=Math.floor(e/65536),ht=e-a*65536,e=Pt+a+65535,a=Math.floor(e/65536),Pt=e-a*65536,e=pt+a+65535,a=Math.floor(e/65536),pt=e-a*65536,e=dt+a+65535,a=Math.floor(e/65536),dt=e-a*65536,e=nt+a+65535,a=Math.floor(e/65536),nt=e-a*65536,e=et+a+65535,a=Math.floor(e/65536),et=e-a*65536,e=Y+a+65535,a=Math.floor(e/65536),Y=e-a*65536,e=V+a+65535,a=Math.floor(e/65536),V=e-a*65536,e=U+a+65535,a=Math.floor(e/65536),U=e-a*65536,R+=a-1+37*(a-1),a=1,e=R+a+65535,a=Math.floor(e/65536),R=e-a*65536,e=P+a+65535,a=Math.floor(e/65536),P=e-a*65536,e=D+a+65535,a=Math.floor(e/65536),D=e-a*65536,e=$+a+65535,a=Math.floor(e/65536),$=e-a*65536,e=B+a+65535,a=Math.floor(e/65536),B=e-a*65536,e=K+a+65535,a=Math.floor(e/65536),K=e-a*65536,e=Rt+a+65535,a=Math.floor(e/65536),Rt=e-a*65536,e=ht+a+65535,a=Math.floor(e/65536),ht=e-a*65536,e=Pt+a+65535,a=Math.floor(e/65536),Pt=e-a*65536,e=pt+a+65535,a=Math.floor(e/65536),pt=e-a*65536,e=dt+a+65535,a=Math.floor(e/65536),dt=e-a*65536,e=nt+a+65535,a=Math.floor(e/65536),nt=e-a*65536,e=et+a+65535,a=Math.floor(e/65536),et=e-a*65536,e=Y+a+65535,a=Math.floor(e/65536),Y=e-a*65536,e=V+a+65535,a=Math.floor(e/65536),V=e-a*65536,e=U+a+65535,a=Math.floor(e/65536),U=e-a*65536,R+=a-1+37*(a-1),b[0]=R,b[1]=P,b[2]=D,b[3]=$,b[4]=B,b[5]=K,b[6]=Rt,b[7]=ht,b[8]=Pt,b[9]=pt,b[10]=dt,b[11]=nt,b[12]=et,b[13]=Y,b[14]=V,b[15]=U}function Nt(b,d){C(b,d,d)}function te(b,d){const l=o();let e;for(e=0;e<16;e++)l[e]=d[e];for(e=253;e>=0;e--)Nt(l,l),e!==2&&e!==4&&C(l,l,d);for(e=0;e<16;e++)b[e]=l[e]}function yt(b,d){const l=o();let e;for(e=0;e<16;e++)l[e]=d[e];for(e=250;e>=0;e--)Nt(l,l),e!==1&&C(l,l,d);for(e=0;e<16;e++)b[e]=l[e]}function kt(b,d){const l=o(),e=o(),a=o(),R=o(),P=o(),D=o(),$=o(),B=o(),K=o();J(l,b[1],b[0]),J(K,d[1],d[0]),C(l,l,K),Ct(e,b[0],b[1]),Ct(K,d[0],d[1]),C(e,e,K),C(a,b[3],d[3]),C(a,a,s),C(R,b[2],d[2]),Ct(R,R,R),J(P,e,l),J(D,R,a),Ct($,R,a),Ct(B,e,l),C(b[0],P,D),C(b[1],B,$),C(b[2],$,D),C(b[3],P,B)}function Ut(b,d,l){for(let e=0;e<4;e++)N(b[e],d[e],l)}function qt(b,d){const l=o(),e=o(),a=o();te(a,d[2]),C(l,d[0],a),C(e,d[1],a),G(b,e),b[31]^=Lt(l)<<7}function m(b,d,l){w(b[0],S),w(b[1],E),w(b[2],E),w(b[3],S);for(let e=255;e>=0;--e){const a=l[e/8|0]>>(e&7)&1;Ut(b,d,a),kt(d,b),kt(b,b),Ut(b,d,a)}}function _(b,d){const l=[o(),o(),o(),o()];w(l[0],u),w(l[1],y),w(l[2],E),C(l[3],u,y),m(b,l,d)}function X(b){if(b.length!==t.SEED_LENGTH)throw new Error(`ed25519: seed must be ${t.SEED_LENGTH} bytes`);const d=(0,n.hash)(b);d[0]&=248,d[31]&=127,d[31]|=64;const l=new Uint8Array(32),e=[o(),o(),o(),o()];_(e,d),qt(l,e);const a=new Uint8Array(64);return a.set(b),a.set(l,32),{publicKey:l,secretKey:a}}t.generateKeyPairFromSeed=X;function lt(b){const d=(0,r.randomBytes)(32,b),l=X(d);return(0,c.wipe)(d),l}t.generateKeyPair=lt;function A(b){if(b.length!==t.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${t.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(b.subarray(32))}t.extractPublicKeyFromSecretKey=A;const I=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function O(b,d){let l,e,a,R;for(e=63;e>=32;--e){for(l=0,a=e-32,R=e-12;a<R;++a)d[a]+=l-16*d[e]*I[a-(e-32)],l=Math.floor((d[a]+128)/256),d[a]-=l*256;d[a]+=l,d[e]=0}for(l=0,a=0;a<32;a++)d[a]+=l-(d[31]>>4)*I[a],l=d[a]>>8,d[a]&=255;for(a=0;a<32;a++)d[a]-=l*I[a];for(e=0;e<32;e++)d[e+1]+=d[e]>>8,b[e]=d[e]&255}function L(b){const d=new Float64Array(64);for(let l=0;l<64;l++)d[l]=b[l];for(let l=0;l<64;l++)b[l]=0;O(b,d)}function At(b,d){const l=new Float64Array(64),e=[o(),o(),o(),o()],a=(0,n.hash)(b.subarray(0,32));a[0]&=248,a[31]&=127,a[31]|=64;const R=new Uint8Array(64);R.set(a.subarray(32),32);const P=new n.SHA512;P.update(R.subarray(32)),P.update(d);const D=P.digest();P.clean(),L(D),_(e,D),qt(R,e),P.reset(),P.update(R.subarray(0,32)),P.update(b.subarray(32)),P.update(d);const $=P.digest();L($);for(let B=0;B<32;B++)l[B]=D[B];for(let B=0;B<32;B++)for(let K=0;K<32;K++)l[B+K]+=$[B]*a[K];return O(R.subarray(32),l),R}t.sign=At;function rt(b,d){const l=o(),e=o(),a=o(),R=o(),P=o(),D=o(),$=o();return w(b[2],E),gt(b[1],d),Nt(a,b[1]),C(R,a,g),J(a,a,b[2]),Ct(R,b[2],R),Nt(P,R),Nt(D,P),C($,D,P),C(l,$,a),C(l,l,R),yt(l,l),C(l,l,a),C(l,l,R),C(l,l,R),C(b[0],l,R),Nt(e,b[0]),C(e,e,R),M(e,a)&&C(b[0],b[0],v),Nt(e,b[0]),C(e,e,R),M(e,a)?-1:(Lt(b[0])===d[31]>>7&&J(b[0],S,b[0]),C(b[3],b[0],b[1]),0)}function xe(b,d,l){const e=new Uint8Array(32),a=[o(),o(),o(),o()],R=[o(),o(),o(),o()];if(l.length!==t.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${t.SIGNATURE_LENGTH} bytes`);if(rt(R,b))return!1;const P=new n.SHA512;P.update(l.subarray(0,32)),P.update(b),P.update(d);const D=P.digest();return L(D),m(a,R,D),_(R,l.subarray(32)),kt(a,R),qt(e,a),!ut(l,e)}t.verify=xe;function z(b){let d=[o(),o(),o(),o()];if(rt(d,b))throw new Error("Ed25519: invalid public key");let l=o(),e=o(),a=d[1];Ct(l,E,a),J(e,E,a),te(e,e),C(l,l,e);let R=new Uint8Array(32);return G(R,l),R}t.convertPublicKeyToX25519=z;function ge(b){const d=(0,n.hash)(b.subarray(0,32));d[0]&=248,d[31]&=127,d[31]|=64;const l=new Uint8Array(d.subarray(0,32));return(0,c.wipe)(d),l}t.convertSecretKeyToX25519=ge})(fr);const hs="EdDSA",ds="JWT",Fe=".",qe="base64url",Qr="utf8",tn="utf8",bs=":",gs="did",ys="key",jr="base58btc",ps="z",_s="K36",ms=32,xs=t=>JSON.stringify(t,(r,n)=>typeof n=="bigint"?n.toString()+"n":n),ws=t=>{const r=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,n=t.replace(r,'$1"$2n"$3');return JSON.parse(n,(c,o)=>typeof o=="string"&&o.match(/^\d+n$/)?BigInt(o.substring(0,o.length-1)):o)};function vs(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return ws(t)}catch{return t}}function Es(t){return typeof t=="string"?t:xs(t)||""}function Cr(t){return vs(Le(de(t,qe),Qr))}function ke(t){return Le(de(Es(t),Qr),qe)}function en(t){const r=de(_s,jr),n=ps+Le(Ur([r,t]),jr);return[gs,ys,n].join(bs)}function Ss(t){return Le(t,qe)}function Is(t){return de(t,qe)}function Os(t){return de([ke(t.header),ke(t.payload)].join(Fe),tn)}function Ts(t){return[ke(t.header),ke(t.payload),Ss(t.signature)].join(Fe)}function Ls(t){const r=t.split(Fe),n=Cr(r[0]),c=Cr(r[1]),o=Is(r[2]),h=de(r.slice(0,2).join(Fe),tn);return{header:n,payload:c,signature:o,data:h}}function As(t=Bt.random.randomBytes(ms)){return fr.generateKeyPairFromSeed(t)}async function Rs(t,r,n,c,o=Bt.cjs.fromMiliseconds(Date.now())){const h={alg:hs,typ:ds},S=en(c.publicKey),E=o+n,g={iss:S,sub:t,aud:r,iat:o,exp:E},s=Os({header:h,payload:g}),u=fr.sign(c.secretKey,s);return Ts({header:h,payload:g,signature:u})}const Ps="PARSE_ERROR",js="INVALID_REQUEST",Cs="METHOD_NOT_FOUND",Ns="INVALID_PARAMS",rn="INTERNAL_ERROR",cr="SERVER_ERROR",Ms=[-32700,-32600,-32601,-32602,-32603],Se={[Ps]:{code:-32700,message:"Parse error"},[js]:{code:-32600,message:"Invalid Request"},[Cs]:{code:-32601,message:"Method not found"},[Ns]:{code:-32602,message:"Invalid params"},[rn]:{code:-32603,message:"Internal error"},[cr]:{code:-32e3,message:"Server error"}},nn=cr;function zs(t){return Ms.includes(t)}function Nr(t){return Object.keys(Se).includes(t)?Se[t]:Se[nn]}function Bs(t){const r=Object.values(Se).find(n=>n.code===t);return r||Se[nn]}function sn(t,r,n){return t.message.includes("getaddrinfo ENOTFOUND")||t.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${n} RPC url at ${r}`):t}var on={};/*! *****************************************************************************
1
+ "use strict";const H=require("./index-uRFn7LyP.js"),Bt=require("./index-YHxHDLCx.js"),ti=require("./events-D8Ws4SSV.js");function Kr(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}function Ur(t,r){r||(r=t.reduce((o,h)=>o+h.length,0));const n=Kr(r);let c=0;for(const o of t)n.set(o,c),c+=o.length;return n}const wr={...Bt.identityBase,...Bt.base2,...Bt.base8,...Bt.base10,...Bt.base16,...Bt.base32,...Bt.base36,...Bt.base58,...Bt.base64,...Bt.base256emoji};function Hr(t,r,n,c){return{name:t,prefix:r,encoder:{name:t,prefix:r,encode:n},decoder:{decode:c}}}const vr=Hr("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),Ye=Hr("ascii","a",t=>{let r="a";for(let n=0;n<t.length;n++)r+=String.fromCharCode(t[n]);return r},t=>{t=t.substring(1);const r=Kr(t.length);for(let n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r}),Gr={utf8:vr,"utf-8":vr,hex:wr.base16,latin1:Ye,ascii:Ye,binary:Ye,...wr};function de(t,r="utf8"){const n=Gr[r];if(!n)throw new Error(`Unsupported encoding "${r}"`);return(r==="utf8"||r==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t,"utf8"):n.decoder.decode(`${n.prefix}${t}`)}function Le(t,r="utf8"){const n=Gr[r];if(!n)throw new Error(`Unsupported encoding "${r}"`);return(r==="utf8"||r==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):n.encoder.encode(t).substring(1)}const ei={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe",batchFetchMessages:"waku_batchFetchMessages"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe",batchFetchMessages:"irn_batchFetchMessages"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe",batchFetchMessages:"iridium_batchFetchMessages"}},ri=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,ni=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,ii=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function si(t,r){if(t==="__proto__"||t==="constructor"&&r&&typeof r=="object"&&"prototype"in r){oi(t);return}return r}function oi(t){console.warn(`[destr] Dropping "${t}" key to prevent prototype pollution.`)}function De(t,r={}){if(typeof t!="string")return t;const n=t.trim();if(t[0]==='"'&&t.endsWith('"')&&!t.includes("\\"))return n.slice(1,-1);if(n.length<=9){const c=n.toLowerCase();if(c==="true")return!0;if(c==="false")return!1;if(c==="undefined")return;if(c==="null")return null;if(c==="nan")return Number.NaN;if(c==="infinity")return Number.POSITIVE_INFINITY;if(c==="-infinity")return Number.NEGATIVE_INFINITY}if(!ii.test(t)){if(r.strict)throw new SyntaxError("[destr] Invalid JSON");return t}try{if(ri.test(t)||ni.test(t)){if(r.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(t,si)}return JSON.parse(t)}catch(c){if(r.strict)throw c;return t}}function ai(t){return!t||typeof t.then!="function"?Promise.resolve(t):t}function Tt(t,...r){try{return ai(t(...r))}catch(n){return Promise.reject(n)}}function fi(t){const r=typeof t;return t===null||r!=="object"&&r!=="function"}function ci(t){const r=Object.getPrototypeOf(t);return!r||r.isPrototypeOf(Object)}function Ue(t){if(fi(t))return String(t);if(ci(t)||Array.isArray(t))return JSON.stringify(t);if(typeof t.toJSON=="function")return Ue(t.toJSON());throw new Error("[unstorage] Cannot stringify value!")}function Jr(){if(typeof H.dist.Buffer>"u")throw new TypeError("[unstorage] Buffer is not supported!")}const er="base64:";function ui(t){if(typeof t=="string")return t;Jr();const r=H.dist.Buffer.from(t).toString("base64");return er+r}function li(t){return typeof t!="string"||!t.startsWith(er)?t:(Jr(),H.dist.Buffer.from(t.slice(er.length),"base64"))}function Kt(t){return t?t.split("?")[0].replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""):""}function hi(...t){return Kt(t.join(":"))}function $e(t){return t=Kt(t),t?t+":":""}const di="memory",bi=()=>{const t=new Map;return{name:di,getInstance:()=>t,hasItem(r){return t.has(r)},getItem(r){return t.get(r)??null},getItemRaw(r){return t.get(r)??null},setItem(r,n){t.set(r,n)},setItemRaw(r,n){t.set(r,n)},removeItem(r){t.delete(r)},getKeys(){return[...t.keys()]},clear(){t.clear()},dispose(){t.clear()}}};function gi(t={}){const r={mounts:{"":t.driver||bi()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},n=s=>{for(const u of r.mountpoints)if(s.startsWith(u))return{base:u,relativeKey:s.slice(u.length),driver:r.mounts[u]};return{base:"",relativeKey:s,driver:r.mounts[""]}},c=(s,u)=>r.mountpoints.filter(y=>y.startsWith(s)||u&&s.startsWith(y)).map(y=>({relativeBase:s.length>y.length?s.slice(y.length):void 0,mountpoint:y,driver:r.mounts[y]})),o=(s,u)=>{if(r.watching){u=Kt(u);for(const y of r.watchListeners)y(s,u)}},h=async()=>{if(!r.watching){r.watching=!0;for(const s in r.mounts)r.unwatch[s]=await Er(r.mounts[s],o,s)}},S=async()=>{if(r.watching){for(const s in r.unwatch)await r.unwatch[s]();r.unwatch={},r.watching=!1}},E=(s,u,y)=>{const v=new Map,w=x=>{let N=v.get(x.base);return N||(N={driver:x.driver,base:x.base,items:[]},v.set(x.base,N)),N};for(const x of s){const N=typeof x=="string",G=Kt(N?x:x.key),ut=N?void 0:x.value,M=N||!x.options?u:{...u,...x.options},Lt=n(G);w(Lt).items.push({key:G,value:ut,relativeKey:Lt.relativeKey,options:M})}return Promise.all([...v.values()].map(x=>y(x))).then(x=>x.flat())},g={hasItem(s,u={}){s=Kt(s);const{relativeKey:y,driver:v}=n(s);return Tt(v.hasItem,y,u)},getItem(s,u={}){s=Kt(s);const{relativeKey:y,driver:v}=n(s);return Tt(v.getItem,y,u).then(w=>De(w))},getItems(s,u){return E(s,u,y=>y.driver.getItems?Tt(y.driver.getItems,y.items.map(v=>({key:v.relativeKey,options:v.options})),u).then(v=>v.map(w=>({key:hi(y.base,w.key),value:De(w.value)}))):Promise.all(y.items.map(v=>Tt(y.driver.getItem,v.relativeKey,v.options).then(w=>({key:v.key,value:De(w)})))))},getItemRaw(s,u={}){s=Kt(s);const{relativeKey:y,driver:v}=n(s);return v.getItemRaw?Tt(v.getItemRaw,y,u):Tt(v.getItem,y,u).then(w=>li(w))},async setItem(s,u,y={}){if(u===void 0)return g.removeItem(s);s=Kt(s);const{relativeKey:v,driver:w}=n(s);w.setItem&&(await Tt(w.setItem,v,Ue(u),y),w.watch||o("update",s))},async setItems(s,u){await E(s,u,async y=>{if(y.driver.setItems)return Tt(y.driver.setItems,y.items.map(v=>({key:v.relativeKey,value:Ue(v.value),options:v.options})),u);y.driver.setItem&&await Promise.all(y.items.map(v=>Tt(y.driver.setItem,v.relativeKey,Ue(v.value),v.options)))})},async setItemRaw(s,u,y={}){if(u===void 0)return g.removeItem(s,y);s=Kt(s);const{relativeKey:v,driver:w}=n(s);if(w.setItemRaw)await Tt(w.setItemRaw,v,u,y);else if(w.setItem)await Tt(w.setItem,v,ui(u),y);else return;w.watch||o("update",s)},async removeItem(s,u={}){typeof u=="boolean"&&(u={removeMeta:u}),s=Kt(s);const{relativeKey:y,driver:v}=n(s);v.removeItem&&(await Tt(v.removeItem,y,u),(u.removeMeta||u.removeMata)&&await Tt(v.removeItem,y+"$",u),v.watch||o("remove",s))},async getMeta(s,u={}){typeof u=="boolean"&&(u={nativeOnly:u}),s=Kt(s);const{relativeKey:y,driver:v}=n(s),w=Object.create(null);if(v.getMeta&&Object.assign(w,await Tt(v.getMeta,y,u)),!u.nativeOnly){const x=await Tt(v.getItem,y+"$",u).then(N=>De(N));x&&typeof x=="object"&&(typeof x.atime=="string"&&(x.atime=new Date(x.atime)),typeof x.mtime=="string"&&(x.mtime=new Date(x.mtime)),Object.assign(w,x))}return w},setMeta(s,u,y={}){return this.setItem(s+"$",u,y)},removeMeta(s,u={}){return this.removeItem(s+"$",u)},async getKeys(s,u={}){s=$e(s);const y=c(s,!0);let v=[];const w=[];for(const x of y){const N=await Tt(x.driver.getKeys,x.relativeBase,u);for(const G of N){const ut=x.mountpoint+Kt(G);v.some(M=>ut.startsWith(M))||w.push(ut)}v=[x.mountpoint,...v.filter(G=>!G.startsWith(x.mountpoint))]}return s?w.filter(x=>x.startsWith(s)&&x[x.length-1]!=="$"):w.filter(x=>x[x.length-1]!=="$")},async clear(s,u={}){s=$e(s),await Promise.all(c(s,!1).map(async y=>{if(y.driver.clear)return Tt(y.driver.clear,y.relativeBase,u);if(y.driver.removeItem){const v=await y.driver.getKeys(y.relativeBase||"",u);return Promise.all(v.map(w=>y.driver.removeItem(w,u)))}}))},async dispose(){await Promise.all(Object.values(r.mounts).map(s=>Sr(s)))},async watch(s){return await h(),r.watchListeners.push(s),async()=>{r.watchListeners=r.watchListeners.filter(u=>u!==s),r.watchListeners.length===0&&await S()}},async unwatch(){r.watchListeners=[],await S()},mount(s,u){if(s=$e(s),s&&r.mounts[s])throw new Error(`already mounted at ${s}`);return s&&(r.mountpoints.push(s),r.mountpoints.sort((y,v)=>v.length-y.length)),r.mounts[s]=u,r.watching&&Promise.resolve(Er(u,o,s)).then(y=>{r.unwatch[s]=y}).catch(console.error),g},async unmount(s,u=!0){s=$e(s),!(!s||!r.mounts[s])&&(r.watching&&s in r.unwatch&&(r.unwatch[s](),delete r.unwatch[s]),u&&await Sr(r.mounts[s]),r.mountpoints=r.mountpoints.filter(y=>y!==s),delete r.mounts[s])},getMount(s=""){s=Kt(s)+":";const u=n(s);return{driver:u.driver,base:u.base}},getMounts(s="",u={}){return s=Kt(s),c(s,u.parents).map(v=>({driver:v.driver,base:v.mountpoint}))},keys:(s,u={})=>g.getKeys(s,u),get:(s,u={})=>g.getItem(s,u),set:(s,u,y={})=>g.setItem(s,u,y),has:(s,u={})=>g.hasItem(s,u),del:(s,u={})=>g.removeItem(s,u),remove:(s,u={})=>g.removeItem(s,u)};return g}function Er(t,r,n){return t.watch?t.watch((c,o)=>r(c,n+o)):()=>{}}async function Sr(t){typeof t.dispose=="function"&&await Tt(t.dispose)}function be(t){return new Promise((r,n)=>{t.oncomplete=t.onsuccess=()=>r(t.result),t.onabort=t.onerror=()=>n(t.error)})}function Fr(t,r){const n=indexedDB.open(t);n.onupgradeneeded=()=>n.result.createObjectStore(r);const c=be(n);return(o,h)=>c.then(S=>h(S.transaction(r,o).objectStore(r)))}let Ze;function Ae(){return Ze||(Ze=Fr("keyval-store","keyval")),Ze}function Ir(t,r=Ae()){return r("readonly",n=>be(n.get(t)))}function yi(t,r,n=Ae()){return n("readwrite",c=>(c.put(r,t),be(c.transaction)))}function pi(t,r=Ae()){return r("readwrite",n=>(n.delete(t),be(n.transaction)))}function _i(t=Ae()){return t("readwrite",r=>(r.clear(),be(r.transaction)))}function mi(t,r){return t.openCursor().onsuccess=function(){this.result&&(r(this.result),this.result.continue())},be(t.transaction)}function xi(t=Ae()){return t("readonly",r=>{if(r.getAllKeys)return be(r.getAllKeys());const n=[];return mi(r,c=>n.push(c.key)).then(()=>n)})}const wi=t=>JSON.stringify(t,(r,n)=>typeof n=="bigint"?n.toString()+"n":n),vi=t=>{const r=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,n=t.replace(r,'$1"$2n"$3');return JSON.parse(n,(c,o)=>typeof o=="string"&&o.match(/^\d+n$/)?BigInt(o.substring(0,o.length-1)):o)};function kr(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return vi(t)}catch{return t}}function Wr(t){return typeof t=="string"?t:wi(t)||""}const Ei="idb-keyval";var Si=(t={})=>{const r=t.base&&t.base.length>0?`${t.base}:`:"",n=o=>r+o;let c;return t.dbName&&t.storeName&&(c=Fr(t.dbName,t.storeName)),{name:Ei,options:t,async hasItem(o){return!(typeof await Ir(n(o),c)>"u")},async getItem(o){return await Ir(n(o),c)??null},setItem(o,h){return yi(n(o),h,c)},removeItem(o){return pi(n(o),c)},getKeys(){return xi(c)},clear(){return _i(c)}}};const Ii="WALLET_CONNECT_V2_INDEXED_DB",Oi="keyvaluestorage";let Ti=class{constructor(){this.indexedDb=gi({driver:Si({dbName:Ii,storeName:Oi})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(r=>[r.key,r.value])}async getItem(r){const n=await this.indexedDb.getItem(r);if(n!==null)return n}async setItem(r,n){await this.indexedDb.setItem(r,Wr(n))}async removeItem(r){await this.indexedDb.removeItem(r)}};var Qe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof H.dist.global<"u"?H.dist.global:typeof self<"u"?self:{},He={exports:{}};(function(){let t;function r(){}t=r,t.prototype.getItem=function(n){return this.hasOwnProperty(n)?String(this[n]):null},t.prototype.setItem=function(n,c){this[n]=String(c)},t.prototype.removeItem=function(n){delete this[n]},t.prototype.clear=function(){const n=this;Object.keys(n).forEach(function(c){n[c]=void 0,delete n[c]})},t.prototype.key=function(n){return n=n||0,Object.keys(this)[n]},t.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof Qe<"u"&&Qe.localStorage?He.exports=Qe.localStorage:typeof window<"u"&&window.localStorage?He.exports=window.localStorage:He.exports=new r})();function Li(t){var r;return[t[0],kr((r=t[1])!=null?r:"")]}class Ai{constructor(){this.localStorage=He.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(Li)}async getItem(r){const n=this.localStorage.getItem(r);if(n!==null)return kr(n)}async setItem(r,n){this.localStorage.setItem(r,Wr(n))}async removeItem(r){this.localStorage.removeItem(r)}}const Ri="wc_storage_version",Or=1,Pi=async(t,r,n)=>{const c=Ri,o=await r.getItem(c);if(o&&o>=Or){n(r);return}const h=await t.getKeys();if(!h.length){n(r);return}const S=[];for(;h.length;){const E=h.shift();if(!E)continue;const g=E.toLowerCase();if(g.includes("wc@")||g.includes("walletconnect")||g.includes("wc_")||g.includes("wallet_connect")){const s=await t.getItem(E);await r.setItem(E,s),S.push(E)}}await r.setItem(c,Or),n(r),ji(t,S)},ji=async(t,r)=>{r.length&&r.forEach(async n=>{await t.removeItem(n)})};let Ci=class{constructor(){this.initialized=!1,this.setInitialized=n=>{this.storage=n,this.initialized=!0};const r=new Ai;this.storage=r;try{const n=new Ti;Pi(r,n,this.setInitialized)}catch{this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(r){return await this.initialize(),this.storage.getItem(r)}async setItem(r,n){return await this.initialize(),this.storage.setItem(r,n)}async removeItem(r){return await this.initialize(),this.storage.removeItem(r)}async initialize(){this.initialized||await new Promise(r=>{const n=setInterval(()=>{this.initialized&&(clearInterval(n),r())},20)})}};class Ni{}function Mi(t){try{return JSON.stringify(t)}catch{return'"[Circular]"'}}var zi=Bi;function Bi(t,r,n){var c=n&&n.stringify||Mi,o=1;if(typeof t=="object"&&t!==null){var h=r.length+o;if(h===1)return t;var S=new Array(h);S[0]=c(t);for(var E=1;E<h;E++)S[E]=c(r[E]);return S.join(" ")}if(typeof t!="string")return t;var g=r.length;if(g===0)return t;for(var s="",u=1-o,y=-1,v=t&&t.length||0,w=0;w<v;){if(t.charCodeAt(w)===37&&w+1<v){switch(y=y>-1?y:0,t.charCodeAt(w+1)){case 100:case 102:if(u>=g||r[u]==null)break;y<w&&(s+=t.slice(y,w)),s+=Number(r[u]),y=w+2,w++;break;case 105:if(u>=g||r[u]==null)break;y<w&&(s+=t.slice(y,w)),s+=Math.floor(Number(r[u])),y=w+2,w++;break;case 79:case 111:case 106:if(u>=g||r[u]===void 0)break;y<w&&(s+=t.slice(y,w));var x=typeof r[u];if(x==="string"){s+="'"+r[u]+"'",y=w+2,w++;break}if(x==="function"){s+=r[u].name||"<anonymous>",y=w+2,w++;break}s+=c(r[u]),y=w+2,w++;break;case 115:if(u>=g)break;y<w&&(s+=t.slice(y,w)),s+=String(r[u]),y=w+2,w++;break;case 37:y<w&&(s+=t.slice(y,w)),s+="%",y=w+2,w++,u--;break}++u}++w}return y===-1?t:(y<v&&(s+=t.slice(y)),s)}const Tr=zi;var me=Qt;const Ie=Wi().console||{},Di={mapHttpRequest:Ke,mapHttpResponse:Ke,wrapRequestSerializer:tr,wrapResponseSerializer:tr,wrapErrorSerializer:tr,req:Ke,res:Ke,err:Gi};function $i(t,r){return Array.isArray(t)?t.filter(function(c){return c!=="!stdSerializers.err"}):t===!0?Object.keys(r):!1}function Qt(t){t=t||{},t.browser=t.browser||{};const r=t.browser.transmit;if(r&&typeof r.send!="function")throw Error("pino: transmit option must have a send function");const n=t.browser.write||Ie;t.browser.write&&(t.browser.asObject=!0);const c=t.serializers||{},o=$i(t.browser.serialize,c);let h=t.browser.serialize;Array.isArray(t.browser.serialize)&&t.browser.serialize.indexOf("!stdSerializers.err")>-1&&(h=!1);const S=["error","fatal","warn","info","debug","trace"];typeof n=="function"&&(n.error=n.fatal=n.warn=n.info=n.debug=n.trace=n),t.enabled===!1&&(t.level="silent");const E=t.level||"info",g=Object.create(n);g.log||(g.log=Oe),Object.defineProperty(g,"levelVal",{get:u}),Object.defineProperty(g,"level",{get:y,set:v});const s={transmit:r,serialize:o,asObject:t.browser.asObject,levels:S,timestamp:Ji(t)};g.levels=Qt.levels,g.level=E,g.setMaxListeners=g.getMaxListeners=g.emit=g.addListener=g.on=g.prependListener=g.once=g.prependOnceListener=g.removeListener=g.removeAllListeners=g.listeners=g.listenerCount=g.eventNames=g.write=g.flush=Oe,g.serializers=c,g._serialize=o,g._stdErrSerialize=h,g.child=w,r&&(g._logEvent=rr());function u(){return this.level==="silent"?1/0:this.levels.values[this.level]}function y(){return this._level}function v(x){if(x!=="silent"&&!this.levels.values[x])throw Error("unknown level "+x);this._level=x,pe(s,g,"error","log"),pe(s,g,"fatal","error"),pe(s,g,"warn","error"),pe(s,g,"info","log"),pe(s,g,"debug","log"),pe(s,g,"trace","log")}function w(x,N){if(!x)throw new Error("missing bindings for child Pino");N=N||{},o&&x.serializers&&(N.serializers=x.serializers);const G=N.serializers;if(o&&G){var ut=Object.assign({},c,G),M=t.browser.serialize===!0?Object.keys(ut):o;delete x.serializers,Ve([x],M,ut,this._stdErrSerialize)}function Lt(gt){this._childLevel=(gt._childLevel|0)+1,this.error=_e(gt,x,"error"),this.fatal=_e(gt,x,"fatal"),this.warn=_e(gt,x,"warn"),this.info=_e(gt,x,"info"),this.debug=_e(gt,x,"debug"),this.trace=_e(gt,x,"trace"),ut&&(this.serializers=ut,this._serialize=M),r&&(this._logEvent=rr([].concat(gt._logEvent.bindings,x)))}return Lt.prototype=this,new Lt(this)}return g}Qt.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}};Qt.stdSerializers=Di;Qt.stdTimeFunctions=Object.assign({},{nullTime:Vr,epochTime:qr,unixTime:Fi,isoTime:ki});function pe(t,r,n,c){const o=Object.getPrototypeOf(r);r[n]=r.levelVal>r.levels.values[n]?Oe:o[n]?o[n]:Ie[n]||Ie[c]||Oe,Ki(t,r,n)}function Ki(t,r,n){!t.transmit&&r[n]===Oe||(r[n]=function(c){return function(){const h=t.timestamp(),S=new Array(arguments.length),E=Object.getPrototypeOf&&Object.getPrototypeOf(this)===Ie?Ie:this;for(var g=0;g<S.length;g++)S[g]=arguments[g];if(t.serialize&&!t.asObject&&Ve(S,this._serialize,this.serializers,this._stdErrSerialize),t.asObject?c.call(E,Ui(this,n,S,h)):c.apply(E,S),t.transmit){const s=t.transmit.level||r.level,u=Qt.levels.values[s],y=Qt.levels.values[n];if(y<u)return;Hi(this,{ts:h,methodLevel:n,methodValue:y,transmitLevel:s,transmitValue:Qt.levels.values[t.transmit.level||r.level],send:t.transmit.send,val:r.levelVal},S)}}}(r[n]))}function Ui(t,r,n,c){t._serialize&&Ve(n,t._serialize,t.serializers,t._stdErrSerialize);const o=n.slice();let h=o[0];const S={};c&&(S.time=c),S.level=Qt.levels.values[r];let E=(t._childLevel|0)+1;if(E<1&&(E=1),h!==null&&typeof h=="object"){for(;E--&&typeof o[0]=="object";)Object.assign(S,o.shift());h=o.length?Tr(o.shift(),o):void 0}else typeof h=="string"&&(h=Tr(o.shift(),o));return h!==void 0&&(S.msg=h),S}function Ve(t,r,n,c){for(const o in t)if(c&&t[o]instanceof Error)t[o]=Qt.stdSerializers.err(t[o]);else if(typeof t[o]=="object"&&!Array.isArray(t[o]))for(const h in t[o])r&&r.indexOf(h)>-1&&h in n&&(t[o][h]=n[h](t[o][h]))}function _e(t,r,n){return function(){const c=new Array(1+arguments.length);c[0]=r;for(var o=1;o<c.length;o++)c[o]=arguments[o-1];return t[n].apply(this,c)}}function Hi(t,r,n){const c=r.send,o=r.ts,h=r.methodLevel,S=r.methodValue,E=r.val,g=t._logEvent.bindings;Ve(n,t._serialize||Object.keys(t.serializers),t.serializers,t._stdErrSerialize===void 0?!0:t._stdErrSerialize),t._logEvent.ts=o,t._logEvent.messages=n.filter(function(s){return g.indexOf(s)===-1}),t._logEvent.level.label=h,t._logEvent.level.value=S,c(h,t._logEvent,E),t._logEvent=rr(g)}function rr(t){return{ts:0,messages:[],bindings:t||[],level:{label:"",value:0}}}function Gi(t){const r={type:t.constructor.name,msg:t.message,stack:t.stack};for(const n in t)r[n]===void 0&&(r[n]=t[n]);return r}function Ji(t){return typeof t.timestamp=="function"?t.timestamp:t.timestamp===!1?Vr:qr}function Ke(){return{}}function tr(t){return t}function Oe(){}function Vr(){return!1}function qr(){return Date.now()}function Fi(){return Math.round(Date.now()/1e3)}function ki(){return new Date(Date.now()).toISOString()}function Wi(){function t(r){return typeof r<"u"&&r}try{return typeof globalThis<"u"||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch{return t(self)||t(window)||t(this)||{}}}const or=H.getDefaultExportFromCjs(me),Vi=t=>JSON.stringify(t,(r,n)=>typeof n=="bigint"?n.toString()+"n":n);function Lr(t){return typeof t=="string"?t:Vi(t)||""}const qi={level:"info"},Re="custom_context",ar=1e3*1024;class Xi{constructor(r){this.nodeValue=r,this.sizeInBytes=new TextEncoder().encode(this.nodeValue).length,this.next=null}get value(){return this.nodeValue}get size(){return this.sizeInBytes}}class Ar{constructor(r){this.head=null,this.tail=null,this.lengthInNodes=0,this.maxSizeInBytes=r,this.sizeInBytes=0}append(r){const n=new Xi(r);if(n.size>this.maxSizeInBytes)throw new Error(`[LinkedList] Value too big to insert into list: ${r} with size ${n.size}`);for(;this.size+n.size>this.maxSizeInBytes;)this.shift();this.head?(this.tail&&(this.tail.next=n),this.tail=n):(this.head=n,this.tail=n),this.lengthInNodes++,this.sizeInBytes+=n.size}shift(){if(!this.head)return;const r=this.head;this.head=this.head.next,this.head||(this.tail=null),this.lengthInNodes--,this.sizeInBytes-=r.size}toArray(){const r=[];let n=this.head;for(;n!==null;)r.push(n.value),n=n.next;return r}get length(){return this.lengthInNodes}get size(){return this.sizeInBytes}toOrderedArray(){return Array.from(this)}[Symbol.iterator](){let r=this.head;return{next:()=>{if(!r)return{done:!0,value:null};const n=r.value;return r=r.next,{done:!1,value:n}}}}}class Xr{constructor(r,n=ar){this.level=r??"error",this.levelValue=me.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=n,this.logs=new Ar(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(r,n){n===me.levels.values.error?console.error(r):n===me.levels.values.warn?console.warn(r):n===me.levels.values.debug?console.debug(r):n===me.levels.values.trace?console.trace(r):console.log(r)}appendToLogs(r){this.logs.append(Lr({timestamp:new Date().toISOString(),log:r}));const n=typeof r=="string"?JSON.parse(r).level:r.level;n>=this.levelValue&&this.forwardToConsole(r,n)}getLogs(){return this.logs}clearLogs(){this.logs=new Ar(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(r){const n=this.getLogArray();return n.push(Lr({extraMetadata:r})),new Blob(n,{type:"application/json"})}}class Yi{constructor(r,n=ar){this.baseChunkLogger=new Xr(r,n)}write(r){this.baseChunkLogger.appendToLogs(r)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(r){return this.baseChunkLogger.logsToBlob(r)}downloadLogsBlobInBrowser(r){const n=URL.createObjectURL(this.logsToBlob(r)),c=document.createElement("a");c.href=n,c.download=`walletconnect-logs-${new Date().toISOString()}.txt`,document.body.appendChild(c),c.click(),document.body.removeChild(c),URL.revokeObjectURL(n)}}class Zi{constructor(r,n=ar){this.baseChunkLogger=new Xr(r,n)}write(r){this.baseChunkLogger.appendToLogs(r)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(r){return this.baseChunkLogger.logsToBlob(r)}}var Qi=Object.defineProperty,ts=Object.defineProperties,es=Object.getOwnPropertyDescriptors,Rr=Object.getOwnPropertySymbols,rs=Object.prototype.hasOwnProperty,ns=Object.prototype.propertyIsEnumerable,Pr=(t,r,n)=>r in t?Qi(t,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[r]=n,Ge=(t,r)=>{for(var n in r||(r={}))rs.call(r,n)&&Pr(t,n,r[n]);if(Rr)for(var n of Rr(r))ns.call(r,n)&&Pr(t,n,r[n]);return t},Je=(t,r)=>ts(t,es(r));function is(t){return Je(Ge({},t),{level:(t==null?void 0:t.level)||qi.level})}function ss(t,r=Re){return t[r]||""}function os(t,r,n=Re){return t[n]=r,t}function Yr(t,r=Re){let n="";return typeof t.bindings>"u"?n=ss(t,r):n=t.bindings().context||"",n}function as(t,r,n=Re){const c=Yr(t,n);return c.trim()?`${c}/${r}`:r}function fs(t,r,n=Re){const c=as(t,r,n),o=t.child({context:c});return os(o,c,n)}function cs(t){var r,n;const c=new Yi((r=t.opts)==null?void 0:r.level,t.maxSizeInBytes);return{logger:or(Je(Ge({},t.opts),{level:"trace",browser:Je(Ge({},(n=t.opts)==null?void 0:n.browser),{write:o=>c.write(o)})})),chunkLoggerController:c}}function us(t){var r;const n=new Zi((r=t.opts)==null?void 0:r.level,t.maxSizeInBytes);return{logger:or(Je(Ge({},t.opts),{level:"trace"}),n),chunkLoggerController:n}}function ls(t){return typeof t.loggerOverride<"u"&&typeof t.loggerOverride!="string"?{logger:t.loggerOverride,chunkLoggerController:null}:typeof window<"u"?cs(t):us(t)}var fr={},Zr={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var r=Bt.binary,n=Bt.wipe;t.DIGEST_LENGTH=64,t.BLOCK_SIZE=128;var c=function(){function E(){this.digestLength=t.DIGEST_LENGTH,this.blockSize=t.BLOCK_SIZE,this._stateHi=new Int32Array(8),this._stateLo=new Int32Array(8),this._tempHi=new Int32Array(16),this._tempLo=new Int32Array(16),this._buffer=new Uint8Array(256),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return E.prototype._initState=function(){this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209},E.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},E.prototype.clean=function(){n.wipe(this._buffer),n.wipe(this._tempHi),n.wipe(this._tempLo),this.reset()},E.prototype.update=function(g,s){if(s===void 0&&(s=g.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var u=0;if(this._bytesHashed+=s,this._bufferLength>0){for(;this._bufferLength<t.BLOCK_SIZE&&s>0;)this._buffer[this._bufferLength++]=g[u++],s--;this._bufferLength===this.blockSize&&(h(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(s>=this.blockSize&&(u=h(this._tempHi,this._tempLo,this._stateHi,this._stateLo,g,u,s),s%=this.blockSize);s>0;)this._buffer[this._bufferLength++]=g[u++],s--;return this},E.prototype.finish=function(g){if(!this._finished){var s=this._bytesHashed,u=this._bufferLength,y=s/536870912|0,v=s<<3,w=s%128<112?128:256;this._buffer[u]=128;for(var x=u+1;x<w-8;x++)this._buffer[x]=0;r.writeUint32BE(y,this._buffer,w-8),r.writeUint32BE(v,this._buffer,w-4),h(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,w),this._finished=!0}for(var x=0;x<this.digestLength/8;x++)r.writeUint32BE(this._stateHi[x],g,x*8),r.writeUint32BE(this._stateLo[x],g,x*8+4);return this},E.prototype.digest=function(){var g=new Uint8Array(this.digestLength);return this.finish(g),g},E.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{stateHi:new Int32Array(this._stateHi),stateLo:new Int32Array(this._stateLo),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},E.prototype.restoreState=function(g){return this._stateHi.set(g.stateHi),this._stateLo.set(g.stateLo),this._bufferLength=g.bufferLength,g.buffer&&this._buffer.set(g.buffer),this._bytesHashed=g.bytesHashed,this._finished=!1,this},E.prototype.cleanSavedState=function(g){n.wipe(g.stateHi),n.wipe(g.stateLo),g.buffer&&n.wipe(g.buffer),g.bufferLength=0,g.bytesHashed=0},E}();t.SHA512=c;var o=new Int32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]);function h(E,g,s,u,y,v,w){for(var x=s[0],N=s[1],G=s[2],ut=s[3],M=s[4],Lt=s[5],gt=s[6],Ct=s[7],J=u[0],C=u[1],Nt=u[2],te=u[3],yt=u[4],kt=u[5],Ut=u[6],qt=u[7],m,_,X,lt,A,I,O,L;w>=128;){for(var At=0;At<16;At++){var rt=8*At+v;E[At]=r.readUint32BE(y,rt),g[At]=r.readUint32BE(y,rt+4)}for(var At=0;At<80;At++){var xe=x,z=N,ge=G,b=ut,d=M,l=Lt,e=gt,a=Ct,R=J,P=C,D=Nt,$=te,B=yt,K=kt,Rt=Ut,ht=qt;if(m=Ct,_=qt,A=_&65535,I=_>>>16,O=m&65535,L=m>>>16,m=(M>>>14|yt<<18)^(M>>>18|yt<<14)^(yt>>>9|M<<23),_=(yt>>>14|M<<18)^(yt>>>18|M<<14)^(M>>>9|yt<<23),A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,m=M&Lt^~M&gt,_=yt&kt^~yt&Ut,A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,m=o[At*2],_=o[At*2+1],A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,m=E[At%16],_=g[At%16],A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,I+=A>>>16,O+=I>>>16,L+=O>>>16,X=O&65535|L<<16,lt=A&65535|I<<16,m=X,_=lt,A=_&65535,I=_>>>16,O=m&65535,L=m>>>16,m=(x>>>28|J<<4)^(J>>>2|x<<30)^(J>>>7|x<<25),_=(J>>>28|x<<4)^(x>>>2|J<<30)^(x>>>7|J<<25),A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,m=x&N^x&G^N&G,_=J&C^J&Nt^C&Nt,A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,I+=A>>>16,O+=I>>>16,L+=O>>>16,a=O&65535|L<<16,ht=A&65535|I<<16,m=b,_=$,A=_&65535,I=_>>>16,O=m&65535,L=m>>>16,m=X,_=lt,A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,I+=A>>>16,O+=I>>>16,L+=O>>>16,b=O&65535|L<<16,$=A&65535|I<<16,N=xe,G=z,ut=ge,M=b,Lt=d,gt=l,Ct=e,x=a,C=R,Nt=P,te=D,yt=$,kt=B,Ut=K,qt=Rt,J=ht,At%16===15)for(var rt=0;rt<16;rt++)m=E[rt],_=g[rt],A=_&65535,I=_>>>16,O=m&65535,L=m>>>16,m=E[(rt+9)%16],_=g[(rt+9)%16],A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,X=E[(rt+1)%16],lt=g[(rt+1)%16],m=(X>>>1|lt<<31)^(X>>>8|lt<<24)^X>>>7,_=(lt>>>1|X<<31)^(lt>>>8|X<<24)^(lt>>>7|X<<25),A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,X=E[(rt+14)%16],lt=g[(rt+14)%16],m=(X>>>19|lt<<13)^(lt>>>29|X<<3)^X>>>6,_=(lt>>>19|X<<13)^(X>>>29|lt<<3)^(lt>>>6|X<<26),A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,I+=A>>>16,O+=I>>>16,L+=O>>>16,E[rt]=O&65535|L<<16,g[rt]=A&65535|I<<16}m=x,_=J,A=_&65535,I=_>>>16,O=m&65535,L=m>>>16,m=s[0],_=u[0],A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,I+=A>>>16,O+=I>>>16,L+=O>>>16,s[0]=x=O&65535|L<<16,u[0]=J=A&65535|I<<16,m=N,_=C,A=_&65535,I=_>>>16,O=m&65535,L=m>>>16,m=s[1],_=u[1],A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,I+=A>>>16,O+=I>>>16,L+=O>>>16,s[1]=N=O&65535|L<<16,u[1]=C=A&65535|I<<16,m=G,_=Nt,A=_&65535,I=_>>>16,O=m&65535,L=m>>>16,m=s[2],_=u[2],A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,I+=A>>>16,O+=I>>>16,L+=O>>>16,s[2]=G=O&65535|L<<16,u[2]=Nt=A&65535|I<<16,m=ut,_=te,A=_&65535,I=_>>>16,O=m&65535,L=m>>>16,m=s[3],_=u[3],A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,I+=A>>>16,O+=I>>>16,L+=O>>>16,s[3]=ut=O&65535|L<<16,u[3]=te=A&65535|I<<16,m=M,_=yt,A=_&65535,I=_>>>16,O=m&65535,L=m>>>16,m=s[4],_=u[4],A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,I+=A>>>16,O+=I>>>16,L+=O>>>16,s[4]=M=O&65535|L<<16,u[4]=yt=A&65535|I<<16,m=Lt,_=kt,A=_&65535,I=_>>>16,O=m&65535,L=m>>>16,m=s[5],_=u[5],A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,I+=A>>>16,O+=I>>>16,L+=O>>>16,s[5]=Lt=O&65535|L<<16,u[5]=kt=A&65535|I<<16,m=gt,_=Ut,A=_&65535,I=_>>>16,O=m&65535,L=m>>>16,m=s[6],_=u[6],A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,I+=A>>>16,O+=I>>>16,L+=O>>>16,s[6]=gt=O&65535|L<<16,u[6]=Ut=A&65535|I<<16,m=Ct,_=qt,A=_&65535,I=_>>>16,O=m&65535,L=m>>>16,m=s[7],_=u[7],A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,I+=A>>>16,O+=I>>>16,L+=O>>>16,s[7]=Ct=O&65535|L<<16,u[7]=qt=A&65535|I<<16,v+=128,w-=128}return v}function S(E){var g=new c;g.update(E);var s=g.digest();return g.clean(),s}t.hash=S})(Zr);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.convertSecretKeyToX25519=t.convertPublicKeyToX25519=t.verify=t.sign=t.extractPublicKeyFromSecretKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.SEED_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=t.SIGNATURE_LENGTH=void 0;const r=Bt.random,n=Zr,c=Bt.wipe;t.SIGNATURE_LENGTH=64,t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=64,t.SEED_LENGTH=32;function o(b){const d=new Float64Array(16);if(b)for(let l=0;l<b.length;l++)d[l]=b[l];return d}const h=new Uint8Array(32);h[0]=9;const S=o(),E=o([1]),g=o([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),s=o([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),u=o([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),y=o([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),v=o([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function w(b,d){for(let l=0;l<16;l++)b[l]=d[l]|0}function x(b){let d=1;for(let l=0;l<16;l++){let e=b[l]+d+65535;d=Math.floor(e/65536),b[l]=e-d*65536}b[0]+=d-1+37*(d-1)}function N(b,d,l){const e=~(l-1);for(let a=0;a<16;a++){const R=e&(b[a]^d[a]);b[a]^=R,d[a]^=R}}function G(b,d){const l=o(),e=o();for(let a=0;a<16;a++)e[a]=d[a];x(e),x(e),x(e);for(let a=0;a<2;a++){l[0]=e[0]-65517;for(let P=1;P<15;P++)l[P]=e[P]-65535-(l[P-1]>>16&1),l[P-1]&=65535;l[15]=e[15]-32767-(l[14]>>16&1);const R=l[15]>>16&1;l[14]&=65535,N(e,l,1-R)}for(let a=0;a<16;a++)b[2*a]=e[a]&255,b[2*a+1]=e[a]>>8}function ut(b,d){let l=0;for(let e=0;e<32;e++)l|=b[e]^d[e];return(1&l-1>>>8)-1}function M(b,d){const l=new Uint8Array(32),e=new Uint8Array(32);return G(l,b),G(e,d),ut(l,e)}function Lt(b){const d=new Uint8Array(32);return G(d,b),d[0]&1}function gt(b,d){for(let l=0;l<16;l++)b[l]=d[2*l]+(d[2*l+1]<<8);b[15]&=32767}function Ct(b,d,l){for(let e=0;e<16;e++)b[e]=d[e]+l[e]}function J(b,d,l){for(let e=0;e<16;e++)b[e]=d[e]-l[e]}function C(b,d,l){let e,a,R=0,P=0,D=0,$=0,B=0,K=0,Rt=0,ht=0,Pt=0,pt=0,dt=0,nt=0,et=0,Y=0,V=0,U=0,it=0,_t=0,F=0,Mt=0,Dt=0,Ht=0,Gt=0,$t=0,Xt=0,Zt=0,se=0,Jt=0,ce=0,we=0,Pe=0,st=l[0],Z=l[1],ot=l[2],at=l[3],ft=l[4],Q=l[5],mt=l[6],xt=l[7],wt=l[8],vt=l[9],Et=l[10],bt=l[11],ct=l[12],W=l[13],St=l[14],It=l[15];e=d[0],R+=e*st,P+=e*Z,D+=e*ot,$+=e*at,B+=e*ft,K+=e*Q,Rt+=e*mt,ht+=e*xt,Pt+=e*wt,pt+=e*vt,dt+=e*Et,nt+=e*bt,et+=e*ct,Y+=e*W,V+=e*St,U+=e*It,e=d[1],P+=e*st,D+=e*Z,$+=e*ot,B+=e*at,K+=e*ft,Rt+=e*Q,ht+=e*mt,Pt+=e*xt,pt+=e*wt,dt+=e*vt,nt+=e*Et,et+=e*bt,Y+=e*ct,V+=e*W,U+=e*St,it+=e*It,e=d[2],D+=e*st,$+=e*Z,B+=e*ot,K+=e*at,Rt+=e*ft,ht+=e*Q,Pt+=e*mt,pt+=e*xt,dt+=e*wt,nt+=e*vt,et+=e*Et,Y+=e*bt,V+=e*ct,U+=e*W,it+=e*St,_t+=e*It,e=d[3],$+=e*st,B+=e*Z,K+=e*ot,Rt+=e*at,ht+=e*ft,Pt+=e*Q,pt+=e*mt,dt+=e*xt,nt+=e*wt,et+=e*vt,Y+=e*Et,V+=e*bt,U+=e*ct,it+=e*W,_t+=e*St,F+=e*It,e=d[4],B+=e*st,K+=e*Z,Rt+=e*ot,ht+=e*at,Pt+=e*ft,pt+=e*Q,dt+=e*mt,nt+=e*xt,et+=e*wt,Y+=e*vt,V+=e*Et,U+=e*bt,it+=e*ct,_t+=e*W,F+=e*St,Mt+=e*It,e=d[5],K+=e*st,Rt+=e*Z,ht+=e*ot,Pt+=e*at,pt+=e*ft,dt+=e*Q,nt+=e*mt,et+=e*xt,Y+=e*wt,V+=e*vt,U+=e*Et,it+=e*bt,_t+=e*ct,F+=e*W,Mt+=e*St,Dt+=e*It,e=d[6],Rt+=e*st,ht+=e*Z,Pt+=e*ot,pt+=e*at,dt+=e*ft,nt+=e*Q,et+=e*mt,Y+=e*xt,V+=e*wt,U+=e*vt,it+=e*Et,_t+=e*bt,F+=e*ct,Mt+=e*W,Dt+=e*St,Ht+=e*It,e=d[7],ht+=e*st,Pt+=e*Z,pt+=e*ot,dt+=e*at,nt+=e*ft,et+=e*Q,Y+=e*mt,V+=e*xt,U+=e*wt,it+=e*vt,_t+=e*Et,F+=e*bt,Mt+=e*ct,Dt+=e*W,Ht+=e*St,Gt+=e*It,e=d[8],Pt+=e*st,pt+=e*Z,dt+=e*ot,nt+=e*at,et+=e*ft,Y+=e*Q,V+=e*mt,U+=e*xt,it+=e*wt,_t+=e*vt,F+=e*Et,Mt+=e*bt,Dt+=e*ct,Ht+=e*W,Gt+=e*St,$t+=e*It,e=d[9],pt+=e*st,dt+=e*Z,nt+=e*ot,et+=e*at,Y+=e*ft,V+=e*Q,U+=e*mt,it+=e*xt,_t+=e*wt,F+=e*vt,Mt+=e*Et,Dt+=e*bt,Ht+=e*ct,Gt+=e*W,$t+=e*St,Xt+=e*It,e=d[10],dt+=e*st,nt+=e*Z,et+=e*ot,Y+=e*at,V+=e*ft,U+=e*Q,it+=e*mt,_t+=e*xt,F+=e*wt,Mt+=e*vt,Dt+=e*Et,Ht+=e*bt,Gt+=e*ct,$t+=e*W,Xt+=e*St,Zt+=e*It,e=d[11],nt+=e*st,et+=e*Z,Y+=e*ot,V+=e*at,U+=e*ft,it+=e*Q,_t+=e*mt,F+=e*xt,Mt+=e*wt,Dt+=e*vt,Ht+=e*Et,Gt+=e*bt,$t+=e*ct,Xt+=e*W,Zt+=e*St,se+=e*It,e=d[12],et+=e*st,Y+=e*Z,V+=e*ot,U+=e*at,it+=e*ft,_t+=e*Q,F+=e*mt,Mt+=e*xt,Dt+=e*wt,Ht+=e*vt,Gt+=e*Et,$t+=e*bt,Xt+=e*ct,Zt+=e*W,se+=e*St,Jt+=e*It,e=d[13],Y+=e*st,V+=e*Z,U+=e*ot,it+=e*at,_t+=e*ft,F+=e*Q,Mt+=e*mt,Dt+=e*xt,Ht+=e*wt,Gt+=e*vt,$t+=e*Et,Xt+=e*bt,Zt+=e*ct,se+=e*W,Jt+=e*St,ce+=e*It,e=d[14],V+=e*st,U+=e*Z,it+=e*ot,_t+=e*at,F+=e*ft,Mt+=e*Q,Dt+=e*mt,Ht+=e*xt,Gt+=e*wt,$t+=e*vt,Xt+=e*Et,Zt+=e*bt,se+=e*ct,Jt+=e*W,ce+=e*St,we+=e*It,e=d[15],U+=e*st,it+=e*Z,_t+=e*ot,F+=e*at,Mt+=e*ft,Dt+=e*Q,Ht+=e*mt,Gt+=e*xt,$t+=e*wt,Xt+=e*vt,Zt+=e*Et,se+=e*bt,Jt+=e*ct,ce+=e*W,we+=e*St,Pe+=e*It,R+=38*it,P+=38*_t,D+=38*F,$+=38*Mt,B+=38*Dt,K+=38*Ht,Rt+=38*Gt,ht+=38*$t,Pt+=38*Xt,pt+=38*Zt,dt+=38*se,nt+=38*Jt,et+=38*ce,Y+=38*we,V+=38*Pe,a=1,e=R+a+65535,a=Math.floor(e/65536),R=e-a*65536,e=P+a+65535,a=Math.floor(e/65536),P=e-a*65536,e=D+a+65535,a=Math.floor(e/65536),D=e-a*65536,e=$+a+65535,a=Math.floor(e/65536),$=e-a*65536,e=B+a+65535,a=Math.floor(e/65536),B=e-a*65536,e=K+a+65535,a=Math.floor(e/65536),K=e-a*65536,e=Rt+a+65535,a=Math.floor(e/65536),Rt=e-a*65536,e=ht+a+65535,a=Math.floor(e/65536),ht=e-a*65536,e=Pt+a+65535,a=Math.floor(e/65536),Pt=e-a*65536,e=pt+a+65535,a=Math.floor(e/65536),pt=e-a*65536,e=dt+a+65535,a=Math.floor(e/65536),dt=e-a*65536,e=nt+a+65535,a=Math.floor(e/65536),nt=e-a*65536,e=et+a+65535,a=Math.floor(e/65536),et=e-a*65536,e=Y+a+65535,a=Math.floor(e/65536),Y=e-a*65536,e=V+a+65535,a=Math.floor(e/65536),V=e-a*65536,e=U+a+65535,a=Math.floor(e/65536),U=e-a*65536,R+=a-1+37*(a-1),a=1,e=R+a+65535,a=Math.floor(e/65536),R=e-a*65536,e=P+a+65535,a=Math.floor(e/65536),P=e-a*65536,e=D+a+65535,a=Math.floor(e/65536),D=e-a*65536,e=$+a+65535,a=Math.floor(e/65536),$=e-a*65536,e=B+a+65535,a=Math.floor(e/65536),B=e-a*65536,e=K+a+65535,a=Math.floor(e/65536),K=e-a*65536,e=Rt+a+65535,a=Math.floor(e/65536),Rt=e-a*65536,e=ht+a+65535,a=Math.floor(e/65536),ht=e-a*65536,e=Pt+a+65535,a=Math.floor(e/65536),Pt=e-a*65536,e=pt+a+65535,a=Math.floor(e/65536),pt=e-a*65536,e=dt+a+65535,a=Math.floor(e/65536),dt=e-a*65536,e=nt+a+65535,a=Math.floor(e/65536),nt=e-a*65536,e=et+a+65535,a=Math.floor(e/65536),et=e-a*65536,e=Y+a+65535,a=Math.floor(e/65536),Y=e-a*65536,e=V+a+65535,a=Math.floor(e/65536),V=e-a*65536,e=U+a+65535,a=Math.floor(e/65536),U=e-a*65536,R+=a-1+37*(a-1),b[0]=R,b[1]=P,b[2]=D,b[3]=$,b[4]=B,b[5]=K,b[6]=Rt,b[7]=ht,b[8]=Pt,b[9]=pt,b[10]=dt,b[11]=nt,b[12]=et,b[13]=Y,b[14]=V,b[15]=U}function Nt(b,d){C(b,d,d)}function te(b,d){const l=o();let e;for(e=0;e<16;e++)l[e]=d[e];for(e=253;e>=0;e--)Nt(l,l),e!==2&&e!==4&&C(l,l,d);for(e=0;e<16;e++)b[e]=l[e]}function yt(b,d){const l=o();let e;for(e=0;e<16;e++)l[e]=d[e];for(e=250;e>=0;e--)Nt(l,l),e!==1&&C(l,l,d);for(e=0;e<16;e++)b[e]=l[e]}function kt(b,d){const l=o(),e=o(),a=o(),R=o(),P=o(),D=o(),$=o(),B=o(),K=o();J(l,b[1],b[0]),J(K,d[1],d[0]),C(l,l,K),Ct(e,b[0],b[1]),Ct(K,d[0],d[1]),C(e,e,K),C(a,b[3],d[3]),C(a,a,s),C(R,b[2],d[2]),Ct(R,R,R),J(P,e,l),J(D,R,a),Ct($,R,a),Ct(B,e,l),C(b[0],P,D),C(b[1],B,$),C(b[2],$,D),C(b[3],P,B)}function Ut(b,d,l){for(let e=0;e<4;e++)N(b[e],d[e],l)}function qt(b,d){const l=o(),e=o(),a=o();te(a,d[2]),C(l,d[0],a),C(e,d[1],a),G(b,e),b[31]^=Lt(l)<<7}function m(b,d,l){w(b[0],S),w(b[1],E),w(b[2],E),w(b[3],S);for(let e=255;e>=0;--e){const a=l[e/8|0]>>(e&7)&1;Ut(b,d,a),kt(d,b),kt(b,b),Ut(b,d,a)}}function _(b,d){const l=[o(),o(),o(),o()];w(l[0],u),w(l[1],y),w(l[2],E),C(l[3],u,y),m(b,l,d)}function X(b){if(b.length!==t.SEED_LENGTH)throw new Error(`ed25519: seed must be ${t.SEED_LENGTH} bytes`);const d=(0,n.hash)(b);d[0]&=248,d[31]&=127,d[31]|=64;const l=new Uint8Array(32),e=[o(),o(),o(),o()];_(e,d),qt(l,e);const a=new Uint8Array(64);return a.set(b),a.set(l,32),{publicKey:l,secretKey:a}}t.generateKeyPairFromSeed=X;function lt(b){const d=(0,r.randomBytes)(32,b),l=X(d);return(0,c.wipe)(d),l}t.generateKeyPair=lt;function A(b){if(b.length!==t.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${t.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(b.subarray(32))}t.extractPublicKeyFromSecretKey=A;const I=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function O(b,d){let l,e,a,R;for(e=63;e>=32;--e){for(l=0,a=e-32,R=e-12;a<R;++a)d[a]+=l-16*d[e]*I[a-(e-32)],l=Math.floor((d[a]+128)/256),d[a]-=l*256;d[a]+=l,d[e]=0}for(l=0,a=0;a<32;a++)d[a]+=l-(d[31]>>4)*I[a],l=d[a]>>8,d[a]&=255;for(a=0;a<32;a++)d[a]-=l*I[a];for(e=0;e<32;e++)d[e+1]+=d[e]>>8,b[e]=d[e]&255}function L(b){const d=new Float64Array(64);for(let l=0;l<64;l++)d[l]=b[l];for(let l=0;l<64;l++)b[l]=0;O(b,d)}function At(b,d){const l=new Float64Array(64),e=[o(),o(),o(),o()],a=(0,n.hash)(b.subarray(0,32));a[0]&=248,a[31]&=127,a[31]|=64;const R=new Uint8Array(64);R.set(a.subarray(32),32);const P=new n.SHA512;P.update(R.subarray(32)),P.update(d);const D=P.digest();P.clean(),L(D),_(e,D),qt(R,e),P.reset(),P.update(R.subarray(0,32)),P.update(b.subarray(32)),P.update(d);const $=P.digest();L($);for(let B=0;B<32;B++)l[B]=D[B];for(let B=0;B<32;B++)for(let K=0;K<32;K++)l[B+K]+=$[B]*a[K];return O(R.subarray(32),l),R}t.sign=At;function rt(b,d){const l=o(),e=o(),a=o(),R=o(),P=o(),D=o(),$=o();return w(b[2],E),gt(b[1],d),Nt(a,b[1]),C(R,a,g),J(a,a,b[2]),Ct(R,b[2],R),Nt(P,R),Nt(D,P),C($,D,P),C(l,$,a),C(l,l,R),yt(l,l),C(l,l,a),C(l,l,R),C(l,l,R),C(b[0],l,R),Nt(e,b[0]),C(e,e,R),M(e,a)&&C(b[0],b[0],v),Nt(e,b[0]),C(e,e,R),M(e,a)?-1:(Lt(b[0])===d[31]>>7&&J(b[0],S,b[0]),C(b[3],b[0],b[1]),0)}function xe(b,d,l){const e=new Uint8Array(32),a=[o(),o(),o(),o()],R=[o(),o(),o(),o()];if(l.length!==t.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${t.SIGNATURE_LENGTH} bytes`);if(rt(R,b))return!1;const P=new n.SHA512;P.update(l.subarray(0,32)),P.update(b),P.update(d);const D=P.digest();return L(D),m(a,R,D),_(R,l.subarray(32)),kt(a,R),qt(e,a),!ut(l,e)}t.verify=xe;function z(b){let d=[o(),o(),o(),o()];if(rt(d,b))throw new Error("Ed25519: invalid public key");let l=o(),e=o(),a=d[1];Ct(l,E,a),J(e,E,a),te(e,e),C(l,l,e);let R=new Uint8Array(32);return G(R,l),R}t.convertPublicKeyToX25519=z;function ge(b){const d=(0,n.hash)(b.subarray(0,32));d[0]&=248,d[31]&=127,d[31]|=64;const l=new Uint8Array(d.subarray(0,32));return(0,c.wipe)(d),l}t.convertSecretKeyToX25519=ge})(fr);const hs="EdDSA",ds="JWT",Fe=".",qe="base64url",Qr="utf8",tn="utf8",bs=":",gs="did",ys="key",jr="base58btc",ps="z",_s="K36",ms=32,xs=t=>JSON.stringify(t,(r,n)=>typeof n=="bigint"?n.toString()+"n":n),ws=t=>{const r=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,n=t.replace(r,'$1"$2n"$3');return JSON.parse(n,(c,o)=>typeof o=="string"&&o.match(/^\d+n$/)?BigInt(o.substring(0,o.length-1)):o)};function vs(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return ws(t)}catch{return t}}function Es(t){return typeof t=="string"?t:xs(t)||""}function Cr(t){return vs(Le(de(t,qe),Qr))}function ke(t){return Le(de(Es(t),Qr),qe)}function en(t){const r=de(_s,jr),n=ps+Le(Ur([r,t]),jr);return[gs,ys,n].join(bs)}function Ss(t){return Le(t,qe)}function Is(t){return de(t,qe)}function Os(t){return de([ke(t.header),ke(t.payload)].join(Fe),tn)}function Ts(t){return[ke(t.header),ke(t.payload),Ss(t.signature)].join(Fe)}function Ls(t){const r=t.split(Fe),n=Cr(r[0]),c=Cr(r[1]),o=Is(r[2]),h=de(r.slice(0,2).join(Fe),tn);return{header:n,payload:c,signature:o,data:h}}function As(t=Bt.random.randomBytes(ms)){return fr.generateKeyPairFromSeed(t)}async function Rs(t,r,n,c,o=Bt.cjs.fromMiliseconds(Date.now())){const h={alg:hs,typ:ds},S=en(c.publicKey),E=o+n,g={iss:S,sub:t,aud:r,iat:o,exp:E},s=Os({header:h,payload:g}),u=fr.sign(c.secretKey,s);return Ts({header:h,payload:g,signature:u})}const Ps="PARSE_ERROR",js="INVALID_REQUEST",Cs="METHOD_NOT_FOUND",Ns="INVALID_PARAMS",rn="INTERNAL_ERROR",cr="SERVER_ERROR",Ms=[-32700,-32600,-32601,-32602,-32603],Se={[Ps]:{code:-32700,message:"Parse error"},[js]:{code:-32600,message:"Invalid Request"},[Cs]:{code:-32601,message:"Method not found"},[Ns]:{code:-32602,message:"Invalid params"},[rn]:{code:-32603,message:"Internal error"},[cr]:{code:-32e3,message:"Server error"}},nn=cr;function zs(t){return Ms.includes(t)}function Nr(t){return Object.keys(Se).includes(t)?Se[t]:Se[nn]}function Bs(t){const r=Object.values(Se).find(n=>n.code===t);return r||Se[nn]}function sn(t,r,n){return t.message.includes("getaddrinfo ENOTFOUND")||t.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${n} RPC url at ${r}`):t}var on={};/*! *****************************************************************************
2
2
  Copyright (c) Microsoft Corporation.
3
3
 
4
4
  Permission to use, copy, modify, and/or distribute this software for any
@@ -1,8 +1,8 @@
1
- import { a8 as td, h as H, a2 as th, an as rd, ak as rh, b1 as id, b5 as nd } from "./index-CjqSmvJv.mjs";
1
+ import { a8 as td, h as H, a2 as th, an as rd, ak as rh, b1 as id, b5 as nd } from "./index-BpgHIKBe.mjs";
2
2
  import { d as sd } from "./dijkstra-BZM-8g-B.mjs";
3
- import { e as cr, a as ih } from "./events-D26WqMv7.mjs";
4
- import { c as U, s as zn, x as nh, r as Kn, H as od, a as sh, q as Nn } from "./index-De8biE2M.mjs";
5
- import { r as ad, a as Hr, g as Wr, i as Ot, b as jn, I as Xr, f as Nt, t as gt, c as ms, x as Ws, C as cd, d as hd, E as ht, y as _t, k as mo, A as ld, h as ud, e as ea, j as dd, s as fd, q as oh, l as pd, m as yo, n as vo, o as ah, p as Zt, u as si } from "./index-aGiZ0Ii1.mjs";
3
+ import { e as cr, a as ih } from "./events-DdSBahX7.mjs";
4
+ import { c as U, s as zn, x as nh, r as Kn, H as od, a as sh, q as Nn } from "./index-DCDfhwO6.mjs";
5
+ import { r as ad, a as Hr, g as Wr, i as Ot, b as jn, I as Xr, f as Nt, t as gt, c as ms, x as Ws, C as cd, d as hd, E as ht, y as _t, k as mo, A as ld, h as ud, e as ea, j as dd, s as fd, q as oh, l as pd, m as yo, n as vo, o as ah, p as Zt, u as si } from "./index-D3KQzv3w.mjs";
6
6
  let gd = class extends ad {
7
7
  constructor(e) {
8
8
  super(e), this.events = new cr.EventEmitter(), this.hasRegisteredEventListeners = !1, this.connection = this.setConnection(e), this.connection.connected && this.registerEventListeners();
@@ -1,8 +1,8 @@
1
1
  var h = Object.defineProperty;
2
2
  var m = (i, e, t) => e in i ? h(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
3
3
  var o = (i, e, t) => m(i, typeof e != "symbol" ? e + "" : e, t);
4
- import { ag as w, b_ as g, cA as p, u, bI as l } from "./index-CjqSmvJv.mjs";
5
- import { A as f } from "./aptos-DP1G2KNL.mjs";
4
+ import { ag as w, b_ as g, cA as p, u, bI as l } from "./index-BpgHIKBe.mjs";
5
+ import { A as f } from "./aptos-Dzo7tWbP.mjs";
6
6
  class c {
7
7
  constructor(e, t, r, s) {
8
8
  o(this, "network");
@@ -1,7 +1,7 @@
1
1
  var Z = Object.defineProperty;
2
2
  var j = (t, e, s) => e in t ? Z(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s;
3
3
  var y = (t, e, s) => j(t, typeof e != "symbol" ? e + "" : e, s);
4
- import { b1 as u, bn as Y, bo as I, bp as x, bq as ee, br as ne, bs as se, h as M, cc as O, c4 as ae, ch as E, ci as N, cz as B, cu as _, bU as U, u as te, S as b, e as ie, bV as D, b5 as v, bT as re, bd as me, bW as R, cy as oe, bI as ue, g as le } from "./index-CjqSmvJv.mjs";
4
+ import { b1 as u, bn as Y, bo as I, bp as x, bq as ee, br as ne, bs as se, h as M, cc as O, c4 as ae, ch as E, ci as N, cz as B, cu as _, bU as U, u as te, S as b, e as ie, bV as D, b5 as v, bT as re, bd as me, bW as R, cy as oe, bI as ue, g as le } from "./index-BpgHIKBe.mjs";
5
5
  const h = new u("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA");
6
6
  new u("TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb");
7
7
  const A = new u("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");
@@ -1,7 +1,7 @@
1
1
  var _t = Object.defineProperty;
2
2
  var Pt = (e, t, r) => t in e ? _t(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
3
  var f = (e, t, r) => Pt(e, typeof t != "symbol" ? t + "" : t, r);
4
- import { b1 as c, bn as A, br as z, bq as U, h as l, c4 as le, bs as Z, bp as S, bo as V, c5 as Ze, c6 as Ge, c7 as Wt, c8 as It, c9 as Ut, ca as Nt, cb as O, cc as E, ag as y, cd as T, ce as Ft, cf as ye, b_ as dt, cg as xt, ch as lt, ci as zt, cj as Ot, ck as Q, cl as Lt, cm as G, cn as H, co as qt, cp as Dt, cq as Kt, cr as Vt, cs as Se, ct as Zt, cu as v, cv as Gt, e as oe, S as k, bZ as Ce, bC as Ht, p as j, c3 as Be, cw as Yt, cx as Qt, bd as se, b5 as L, ad as Xt, cy as ft, bI as mt, g as gt } from "./index-CjqSmvJv.mjs";
4
+ import { b1 as c, bn as A, br as z, bq as U, h as l, c4 as le, bs as Z, bp as S, bo as V, c5 as Ze, c6 as Ge, c7 as Wt, c8 as It, c9 as Ut, ca as Nt, cb as O, cc as E, ag as y, cd as T, ce as Ft, cf as ye, b_ as dt, cg as xt, ch as lt, ci as zt, cj as Ot, ck as Q, cl as Lt, cm as G, cn as H, co as qt, cp as Dt, cq as Kt, cr as Vt, cs as Se, ct as Zt, cu as v, cv as Gt, e as oe, S as k, bZ as Ce, bC as Ht, p as j, c3 as Be, cw as Yt, cx as Qt, bd as se, b5 as L, ad as Xt, cy as ft, bI as mt, g as gt } from "./index-BpgHIKBe.mjs";
5
5
  const M = new c("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA");
6
6
  new c("TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb");
7
7
  const Ae = new c("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"), q = new c("So11111111111111111111111111111111111111112");
@@ -0,0 +1,5 @@
1
+ "use strict";var xr=Object.defineProperty;var Br=(t,e,r)=>e in t?xr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var D=(t,e,r)=>Br(t,typeof e!="symbol"?e+"":e,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("./index-uRFn7LyP.js"),b=require("./sui-CD_LLkGE.js");require("./index-DWjlQfKm.js");const Ht=require("./unsignedTransaction-DzSLsK-p.js");class Cr extends TypeError{constructor(e,r){let n;const{message:i,explanation:s,...c}=e,{path:a}=e,o=a.length===0?i:`At path: ${a.join(".")} -- ${i}`;super(s??o),s!=null&&(this.cause=o),Object.assign(this,c),this.name=this.constructor.name,this.failures=()=>n??(n=[e,...r()])}}function $r(t){return K(t)&&typeof t[Symbol.iterator]=="function"}function K(t){return typeof t=="object"&&t!=null}function J(t){return typeof t=="symbol"?t.toString():typeof t=="string"?JSON.stringify(t):`${t}`}function Ur(t){const{done:e,value:r}=t.next();return e?void 0:r}function Pr(t,e,r,n){if(t===!0)return;t===!1?t={}:typeof t=="string"&&(t={message:t});const{path:i,branch:s}=e,{type:c}=r,{refinement:a,message:o=`Expected a value of type \`${c}\`${a?` with refinement \`${a}\``:""}, but received: \`${J(n)}\``}=t;return{value:n,type:c,refinement:a,key:i[i.length-1],path:i,branch:s,...t,message:o}}function*Lt(t,e,r,n){$r(t)||(t=[t]);for(const i of t){const s=Pr(i,e,r,n);s&&(yield s)}}function*lt(t,e,r={}){const{path:n=[],branch:i=[t],coerce:s=!1,mask:c=!1}=r,a={path:n,branch:i};if(s&&(t=e.coercer(t,a),c&&e.type!=="type"&&K(e.schema)&&K(t)&&!Array.isArray(t)))for(const d in t)e.schema[d]===void 0&&delete t[d];let o="valid";for(const d of e.validator(t,a))d.explanation=r.message,o="not_valid",yield[d,void 0];for(let[d,u,h]of e.entries(t,a)){const m=lt(u,h,{path:d===void 0?n:[...n,d],branch:d===void 0?i:[...i,u],coerce:s,mask:c,message:r.message});for(const y of m)y[0]?(o=y[0].refinement!=null?"not_refined":"not_valid",yield[y[0],void 0]):s&&(u=y[1],d===void 0?t=u:t instanceof Map?t.set(d,u):t instanceof Set?t.add(u):K(t)&&(u!==void 0||d in t)&&(t[d]=u))}if(o!=="not_valid")for(const d of e.refiner(t,a))d.explanation=r.message,o="not_refined",yield[d,void 0];o==="valid"&&(yield[void 0,t])}class te{constructor(e){const{type:r,schema:n,validator:i,refiner:s,coercer:c=o=>o,entries:a=function*(){}}=e;this.type=r,this.schema=n,this.entries=a,this.coercer=c,i?this.validator=(o,d)=>{const u=i(o,d);return Lt(u,d,this,o)}:this.validator=()=>[],s?this.refiner=(o,d)=>{const u=s(o,d);return Lt(u,d,this,o)}:this.refiner=()=>[]}assert(e,r){return nt(e,this,r)}create(e,r){return Xt(e,this,r)}is(e){return L(e,this)}mask(e,r){return Zt(e,this,r)}validate(e,r={}){return _e(e,this,r)}}function nt(t,e,r){const n=_e(t,e,{message:r});if(n[0])throw n[0]}function Xt(t,e,r){const n=_e(t,e,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function Zt(t,e,r){const n=_e(t,e,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function L(t,e){return!_e(t,e)[0]}function _e(t,e,r={}){const n=lt(t,e,r),i=Ur(n);return i[0]?[new Cr(i[0],function*(){for(const c of n)c[0]&&(yield c[0])}),void 0]:[void 0,i[1]]}function je(...t){const e=t[0].type==="type",r=t.map(i=>i.schema),n=Object.assign({},...r);return e?Rr(n):p(n)}function W(t,e){return new te({type:t,schema:null,validator:e})}function it(){return W("any",()=>!0)}function E(t){return new te({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(const[r,n]of e.entries())yield[r,n,t]},coercer(e){return Array.isArray(e)?e.slice():e},validator(e){return Array.isArray(e)||`Expected an array value, but received: ${J(e)}`}})}function Mr(){return W("bigint",t=>typeof t=="bigint")}function z(){return W("boolean",t=>typeof t=="boolean")}function ee(){return W("integer",t=>typeof t=="number"&&!isNaN(t)&&Number.isInteger(t)||`Expected an integer, but received: ${J(t)}`)}function k(t){const e=J(t),r=typeof t;return new te({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?t:null,validator(n){return n===t||`Expected the literal \`${e}\`, but received: ${J(n)}`}})}function Yt(){return W("never",()=>!1)}function $(t){return new te({...t,validator:(e,r)=>e===null||t.validator(e,r),refiner:(e,r)=>e===null||t.refiner(e,r)})}function ge(){return W("number",t=>typeof t=="number"&&!isNaN(t)||`Expected a number, but received: ${J(t)}`)}function p(t){const e=t?Object.keys(t):[],r=Yt();return new te({type:"object",schema:t||null,*entries(n){if(t&&K(n)){const i=new Set(Object.keys(n));for(const s of e)i.delete(s),yield[s,n[s],t[s]];for(const s of i)yield[s,n[s],r]}},validator(n){return K(n)||`Expected an object, but received: ${J(n)}`},coercer(n){return K(n)?{...n}:n}})}function v(t){return new te({...t,validator:(e,r)=>e===void 0||t.validator(e,r),refiner:(e,r)=>e===void 0||t.refiner(e,r)})}function Q(t,e){return new te({type:"record",schema:null,*entries(r){if(K(r))for(const n in r){const i=r[n];yield[n,n,t],yield[n,i,e]}},validator(r){return K(r)||`Expected an object, but received: ${J(r)}`}})}function g(){return W("string",t=>typeof t=="string"||`Expected a string, but received: ${J(t)}`)}function Qt(t){const e=Yt();return new te({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(t.length,r.length);for(let i=0;i<n;i++)yield[i,r[i],t[i]||e]}},validator(r){return Array.isArray(r)||`Expected an array, but received: ${J(r)}`}})}function Rr(t){const e=Object.keys(t);return new te({type:"type",schema:t,*entries(r){if(K(r))for(const n of e)yield[n,r[n],t[n]]},validator(r){return K(r)||`Expected an object, but received: ${J(r)}`},coercer(r){return K(r)?{...r}:r}})}function U(t){const e=t.map(r=>r.type).join(" | ");return new te({type:"union",schema:null,coercer(r){for(const n of t){const[i,s]=n.validate(r,{coerce:!0});if(!i)return s}return r},validator(r,n){const i=[];for(const s of t){const[...c]=lt(r,s,n),[a]=c;if(a[0])for(const[o]of c)o&&i.push(o);else return[]}return[`Expected the value to satisfy a union of \`${e}\`, but received: ${J(r)}`,...i]}})}function er(){return W("unknown",()=>!0)}const ft=U([p({AddressOwner:g()}),p({ObjectOwner:g()}),p({Shared:p({initial_shared_version:$(g())})}),k("Immutable")]);W("SuiJsonValue",()=>!0);const Nr=U([p({u32:g()}),p({u64:g()}),p({f64:g()})]);p({attributes:Q(g(),$(Nr)),featureFlags:Q(g(),z()),maxSupportedProtocolVersion:g(),minSupportedProtocolVersion:g(),protocolVersion:g()});U([g(),k("package")]);const ce=p({digest:g(),objectId:g(),version:U([ge(),g(),Mr()])});p({owner:ft,reference:ce});p({objectId:g(),sequenceNumber:g()});p({payment:E(ce),owner:g(),price:g(),budget:g()});const Dr=je(ce,p({type:g(),owner:ft,previousTransaction:g()})),Vr=Q(g(),it()),zr=Q(g(),er()),Fr=p({type:g(),fields:Vr,hasPublicTransfer:z()}),Gr=p({disassembled:zr}),Lr=U([je(Fr,p({dataType:k("moveObject")})),je(Gr,p({dataType:k("package")}))]),Wr=p({type:g(),hasPublicTransfer:z(),version:g(),bcsBytes:g()}),Kr=p({id:g(),moduleMap:Q(g(),g())}),Jr=U([je(Wr,p({dataType:k("moveObject")})),je(Kr,p({dataType:k("package")}))]);BigInt(1e9);const tr=p({code:g(),error:v(g()),object_id:v(g()),parent_object_id:v(g()),version:v(g()),digest:v(g())}),qr=p({data:$(v(Q(g(),g()))),error:$(v(tr))}),Hr=U([qr,v(Q(g(),g()))]),rr=p({objectId:g(),version:g(),digest:g(),type:$(v(g())),content:$(v(Lr)),bcs:$(v(Jr)),owner:$(v(ft)),previousTransaction:$(v(g())),storageRebate:$(v(g())),display:$(v(Hr))});p({showType:$(v(z())),showContent:$(v(z())),showBcs:$(v(z())),showOwner:$(v(z())),showPreviousTransaction:$(v(z())),showStorageRebate:$(v(z())),showDisplay:$(v(z()))});U([k("Exists"),k("notExists"),k("Deleted")]);E(Dr);const Xr=p({data:$(v(rr)),error:$(v(tr))});function Zr(t){return t.data}function Yr(t){if(t.error&&"object_id"in t.error&&"version"in t.error&&"digest"in t.error){const e=t.error;return{objectId:e.object_id,version:e.version,digest:e.digest}}}function Wt(t){if("reference"in t)return t.reference;const e=Zr(t);return e?{objectId:e.objectId,version:e.version,digest:e.digest}:Yr(t)}p({objectId:g(),atCheckpoint:v(ge())});p({data:E(Xr),nextCursor:v($(g())),hasNextPage:z()});U([p({details:rr,status:k("VersionFound")}),p({details:g(),status:k("ObjectNotExists")}),p({details:ce,status:k("ObjectDeleted")}),p({details:Qt([g(),ge()]),status:k("VersionNotFound")}),p({details:p({asked_version:ge(),latest_version:ge(),object_id:g()}),status:k("VersionTooHigh")})]);const Qr=U([g(),p({Object:g()})]);E(Qr);const en=p({address:g(),name:g()}),tn=U([k("Private"),k("Public"),k("Friend")]),gt=p({abilities:E(g())}),rn=p({constraints:gt,isPhantom:z()}),nn=p({TypeParameter:ge()}),Xe=Qt([p({module:g(),package:g(),function:g()}),g()]);p({rank3Days:E(Xe),rank7Days:E(Xe),rank30Days:E(Xe)});function nr(t){if(!t)return!1;if(typeof t=="string"||L(t,nn)||ir(t))return!0;if(typeof t!="object")return!1;const e=t;return!!(L(e.Reference,me)||L(e.MutableReference,me)||L(e.Vector,me))}const me=W("SuiMoveNormalizedType",nr);function ir(t){if(!t||typeof t!="object")return!1;const e=t;if(!e.Struct||typeof e.Struct!="object")return!1;const r=e.Struct;return!(typeof r.address!="string"||typeof r.module!="string"||typeof r.name!="string"||!Array.isArray(r.typeArguments)||!r.typeArguments.every(n=>nr(n)))}W("SuiMoveNormalizedStructType",ir);const sn=p({visibility:tn,isEntry:z(),typeParameters:E(gt),parameters:E(me),return:E(me)}),an=p({name:g(),type:me}),on=p({abilities:gt,typeParameters:E(rn),fields:E(an)}),cn=p({fileFormatVersion:ge(),address:g(),name:g(),friends:E(en),structs:Q(g(),on),exposedFunctions:Q(g(),sn)});Q(g(),cn);function st(t){return typeof t=="object"&&"MutableReference"in t?t.MutableReference:void 0}function sr(t){return typeof t=="object"&&"Reference"in t?t.Reference:void 0}function ht(t){if(typeof t=="object"&&"Struct"in t)return t;const e=sr(t),r=st(t);if(typeof e=="object"&&"Struct"in e)return e;if(typeof r=="object"&&"Struct"in r)return r}function un(t){if(t.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),r=0;r<e.length;r++)e[r]=255;for(var n=0;n<t.length;n++){var i=t.charAt(n),s=i.charCodeAt(0);if(e[s]!==255)throw new TypeError(i+" is ambiguous");e[s]=n}var c=t.length,a=t.charAt(0),o=Math.log(c)/Math.log(256),d=Math.log(256)/Math.log(c);function u(y){if(y instanceof Uint8Array||(ArrayBuffer.isView(y)?y=new Uint8Array(y.buffer,y.byteOffset,y.byteLength):Array.isArray(y)&&(y=Uint8Array.from(y))),!(y instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(y.length===0)return"";for(var S=0,T=0,f=0,O=y.length;f!==O&&y[f]===0;)f++,S++;for(var B=(O-f)*d+1>>>0,P=new Uint8Array(B);f!==O;){for(var A=y[f],j=0,M=B-1;(A!==0||j<T)&&M!==-1;M--,j++)A+=256*P[M]>>>0,P[M]=A%c>>>0,A=A/c>>>0;if(A!==0)throw new Error("Non-zero carry");T=j,f++}for(var q=B-T;q!==B&&P[q]===0;)q++;for(var pe=a.repeat(S);q<B;++q)pe+=t.charAt(P[q]);return pe}function h(y){if(typeof y!="string")throw new TypeError("Expected String");if(y.length===0)return new Uint8Array;for(var S=0,T=0,f=0;y[S]===a;)T++,S++;for(var O=(y.length-S)*o+1>>>0,B=new Uint8Array(O);y[S];){var P=e[y.charCodeAt(S)];if(P===255)return;for(var A=0,j=O-1;(P!==0||A<f)&&j!==-1;j--,A++)P+=c*B[j]>>>0,B[j]=P%256>>>0,P=P/256>>>0;if(P!==0)throw new Error("Non-zero carry");f=A,S++}for(var M=O-f;M!==O&&B[M]===0;)M++;for(var q=new Uint8Array(T+(O-M)),pe=T;M!==O;)q[pe++]=B[M++];return q}function m(y){var S=h(y);if(S)return S;throw new Error("Non-base"+c+" character")}return{encode:u,decodeUnsafe:h,decode:m}}var dn=un;const ln=dn,fn="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";var gn=ln(fn);const ar=w.getDefaultExportFromCjs(gn),xe=t=>ar.encode(t),pt=t=>ar.decode(t);function ue(t){return Uint8Array.from(atob(t),e=>e.charCodeAt(0))}const Ze=8192;function Be(t){if(t.length<Ze)return btoa(String.fromCharCode(...t));let e="";for(var r=0;r<t.length;r+=Ze){const n=t.slice(r,r+Ze);e+=String.fromCharCode(...n)}return btoa(e)}function Je(t){var i;const e=t.startsWith("0x")?t.slice(2):t,n=((i=(e.length%2===0?e:`0${e}}`).match(/.{2}/g))==null?void 0:i.map(s=>parseInt(s,16)))??[];return Uint8Array.from(n)}function Ce(t){return t.reduce((e,r)=>e+r.toString(16).padStart(2,"0"),"")}function yt(t){let e=[],r=0;if(t===0)return[0];for(;t>0;)e[r]=t&127,(t>>=7)&&(e[r]|=128),r+=1;return e}function hn(t){let e=0,r=0,n=0;for(;;){let i=t[n];if(n+=1,e|=(i&127)<<r,!(i&128))break;r+=7}return{value:e,length:n}}class or{constructor(e){this.bytePosition=0,this.dataView=new DataView(e.buffer)}shift(e){return this.bytePosition+=e,this}read8(){let e=this.dataView.getUint8(this.bytePosition);return this.shift(1),e}read16(){let e=this.dataView.getUint16(this.bytePosition,!0);return this.shift(2),e}read32(){let e=this.dataView.getUint32(this.bytePosition,!0);return this.shift(4),e}read64(){let e=this.read32(),n=this.read32().toString(16)+e.toString(16).padStart(8,"0");return BigInt("0x"+n).toString(10)}read128(){let e=BigInt(this.read64()),n=BigInt(this.read64()).toString(16)+e.toString(16).padStart(16,"0");return BigInt("0x"+n).toString(10)}read256(){let e=BigInt(this.read128()),n=BigInt(this.read128()).toString(16)+e.toString(16).padStart(32,"0");return BigInt("0x"+n).toString(10)}readBytes(e){let r=this.bytePosition+this.dataView.byteOffset,n=new Uint8Array(this.dataView.buffer,r,e);return this.shift(e),n}readULEB(){let e=this.bytePosition+this.dataView.byteOffset,r=new Uint8Array(this.dataView.buffer,e),{value:n,length:i}=hn(r);return this.shift(i),n}readVec(e){let r=this.readULEB(),n=[];for(let i=0;i<r;i++)n.push(e(this,i,r));return n}}function pn(t,e){switch(e){case"base58":return xe(t);case"base64":return Be(t);case"hex":return Ce(t);default:throw new Error("Unsupported encoding, supported values are: base64, hex")}}function yn(t,e){switch(e){case"base58":return pt(t);case"base64":return ue(t);case"hex":return Je(t);default:throw new Error("Unsupported encoding, supported values are: base64, hex")}}function mt(t,e=["<",">"]){const[r,n]=e,i=[];let s="",c=0;for(let a=0;a<t.length;a++){const o=t[a];if(o===r&&c++,o===n&&c--,c===0&&o===","){i.push(s.trim()),s="";continue}s+=o}return i.push(s.trim()),i}class cr{constructor({size:e=1024,maxSize:r,allocateSize:n=1024}={}){this.bytePosition=0,this.size=e,this.maxSize=r||e,this.allocateSize=n,this.dataView=new DataView(new ArrayBuffer(e))}ensureSizeOrGrow(e){const r=this.bytePosition+e;if(r>this.size){const n=Math.min(this.maxSize,this.size+this.allocateSize);if(r>n)throw new Error(`Attempting to serialize to BCS, but buffer does not have enough size. Allocated size: ${this.size}, Max size: ${this.maxSize}, Required size: ${r}`);this.size=n;const i=new ArrayBuffer(this.size);new Uint8Array(i).set(new Uint8Array(this.dataView.buffer)),this.dataView=new DataView(i)}}shift(e){return this.bytePosition+=e,this}write8(e){return this.ensureSizeOrGrow(1),this.dataView.setUint8(this.bytePosition,Number(e)),this.shift(1)}write16(e){return this.ensureSizeOrGrow(2),this.dataView.setUint16(this.bytePosition,Number(e),!0),this.shift(2)}write32(e){return this.ensureSizeOrGrow(4),this.dataView.setUint32(this.bytePosition,Number(e),!0),this.shift(4)}write64(e){return Ye(BigInt(e),8).forEach(r=>this.write8(r)),this}write128(e){return Ye(BigInt(e),16).forEach(r=>this.write8(r)),this}write256(e){return Ye(BigInt(e),32).forEach(r=>this.write8(r)),this}writeULEB(e){return yt(e).forEach(r=>this.write8(r)),this}writeVec(e,r){return this.writeULEB(e.length),Array.from(e).forEach((n,i)=>r(this,n,i,e.length)),this}*[Symbol.iterator](){for(let e=0;e<this.bytePosition;e++)yield this.dataView.getUint8(e);return this.toBytes()}toBytes(){return new Uint8Array(this.dataView.buffer.slice(0,this.bytePosition))}toString(e){return pn(this.toBytes(),e)}}function Ye(t,e){let r=new Uint8Array(e),n=0;for(;t>0;)r[n]=Number(t%BigInt(256)),t=t/BigInt(256),n+=1;return r}var ur=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)},X=(t,e,r)=>(ur(t,e,"read from private field"),r?r.call(t):e.get(t)),ze=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},Fe=(t,e,r,n)=>(ur(t,e,"write to private field"),e.set(t,r),r),ye,Se,Me,ae;const dr=class{constructor(t){ze(this,ye,void 0),ze(this,Se,void 0),this.name=t.name,this.read=t.read,this.serializedSize=t.serializedSize??(()=>null),Fe(this,ye,t.write),Fe(this,Se,t.serialize??((e,r)=>{const n=new cr({size:this.serializedSize(e)??void 0,...r});return X(this,ye).call(this,e,n),n.toBytes()})),this.validate=t.validate??(()=>{})}write(t,e){this.validate(t),X(this,ye).call(this,t,e)}serialize(t,e){return this.validate(t),new mn(this,X(this,Se).call(this,t,e))}parse(t){const e=new or(t);return this.read(e)}transform({name:t,input:e,output:r}){return new dr({name:t??this.name,read:n=>r(this.read(n)),write:(n,i)=>X(this,ye).call(this,e(n),i),serializedSize:n=>this.serializedSize(e(n)),serialize:(n,i)=>X(this,Se).call(this,e(n),i),validate:n=>this.validate(e(n))})}};let Z=dr;ye=new WeakMap;Se=new WeakMap;const lr=Symbol.for("@mysten/serialized-bcs");function wt(t){return!!t&&typeof t=="object"&&t[lr]===!0}class mn{constructor(e,r){ze(this,Me,void 0),ze(this,ae,void 0),Fe(this,Me,e),Fe(this,ae,r)}get[lr](){return!0}toBytes(){return X(this,ae)}toHex(){return Ce(X(this,ae))}toBase64(){return Be(X(this,ae))}toBase58(){return xe(X(this,ae))}parse(){return X(this,Me).parse(X(this,ae))}}Me=new WeakMap;ae=new WeakMap;function Ge({size:t,...e}){return new Z({...e,serializedSize:()=>t})}function Qe({readMethod:t,writeMethod:e,...r}){return Ge({...r,read:n=>n[t](),write:(n,i)=>i[e](n),validate:n=>{var i;if(n<0||n>r.maxValue)throw new TypeError(`Invalid ${r.name} value: ${n}. Expected value in range 0-${r.maxValue}`);(i=r.validate)==null||i.call(r,n)}})}function et({readMethod:t,writeMethod:e,...r}){return Ge({...r,read:n=>n[t](),write:(n,i)=>i[e](BigInt(n)),validate:n=>{var s;const i=BigInt(n);if(i<0||i>r.maxValue)throw new TypeError(`Invalid ${r.name} value: ${i}. Expected value in range 0-${r.maxValue}`);(s=r.validate)==null||s.call(r,i)}})}function wn({serialize:t,...e}){const r=new Z({...e,serialize:t,write:(n,i)=>{for(const s of r.serialize(n).toBytes())i.write8(s)}});return r}function bn({toBytes:t,fromBytes:e,...r}){return new Z({...r,read:n=>{const i=n.readULEB(),s=n.readBytes(i);return e(s)},write:(n,i)=>{const s=t(n);i.writeULEB(s.length);for(let c=0;c<s.length;c++)i.write8(s[c])},serialize:n=>{const i=t(n),s=yt(i.length),c=new Uint8Array(s.length+i.length);return c.set(s,0),c.set(i,s.length),c},validate:n=>{var i;if(typeof n!="string")throw new TypeError(`Invalid ${r.name} value: ${n}. Expected string`);(i=r.validate)==null||i.call(r,n)}})}function Sn(t){let e=null;function r(){return e||(e=t()),e}return new Z({name:"lazy",read:n=>r().read(n),serializedSize:n=>r().serializedSize(n),write:(n,i)=>r().write(n,i),serialize:(n,i)=>r().serialize(n,i).toBytes()})}const l={u8(t){return Qe({name:"u8",readMethod:"read8",writeMethod:"write8",size:1,maxValue:2**8-1,...t})},u16(t){return Qe({name:"u16",readMethod:"read16",writeMethod:"write16",size:2,maxValue:2**16-1,...t})},u32(t){return Qe({name:"u32",readMethod:"read32",writeMethod:"write32",size:4,maxValue:2**32-1,...t})},u64(t){return et({name:"u64",readMethod:"read64",writeMethod:"write64",size:8,maxValue:2n**64n-1n,...t})},u128(t){return et({name:"u128",readMethod:"read128",writeMethod:"write128",size:16,maxValue:2n**128n-1n,...t})},u256(t){return et({name:"u256",readMethod:"read256",writeMethod:"write256",size:32,maxValue:2n**256n-1n,...t})},bool(t){return Ge({name:"bool",size:1,read:e=>e.read8()===1,write:(e,r)=>r.write8(e?1:0),...t,validate:e=>{var r;if((r=t==null?void 0:t.validate)==null||r.call(t,e),typeof e!="boolean")throw new TypeError(`Expected boolean, found ${typeof e}`)}})},uleb128(t){return wn({name:"uleb128",read:e=>e.readULEB(),serialize:e=>Uint8Array.from(yt(e)),...t})},bytes(t,e){return Ge({name:`bytes[${t}]`,size:t,read:r=>r.readBytes(t),write:(r,n)=>{for(let i=0;i<t;i++)n.write8(r[i]??0)},...e,validate:r=>{var n;if((n=e==null?void 0:e.validate)==null||n.call(e,r),!("length"in r))throw new TypeError(`Expected array, found ${typeof r}`);if(r.length!==t)throw new TypeError(`Expected array of length ${t}, found ${r.length}`)}})},string(t){return bn({name:"string",toBytes:e=>new TextEncoder().encode(e),fromBytes:e=>new TextDecoder().decode(e),...t})},fixedArray(t,e,r){return new Z({name:`${e.name}[${t}]`,read:n=>{const i=new Array(t);for(let s=0;s<t;s++)i[s]=e.read(n);return i},write:(n,i)=>{for(const s of n)e.write(s,i)},...r,validate:n=>{var i;if((i=r==null?void 0:r.validate)==null||i.call(r,n),!("length"in n))throw new TypeError(`Expected array, found ${typeof n}`);if(n.length!==t)throw new TypeError(`Expected array of length ${t}, found ${n.length}`)}})},option(t){return l.enum(`Option<${t.name}>`,{None:null,Some:t}).transform({input:e=>e==null?{None:!0}:{Some:e},output:e=>"Some"in e?e.Some:null})},vector(t,e){return new Z({name:`vector<${t.name}>`,read:r=>{const n=r.readULEB(),i=new Array(n);for(let s=0;s<n;s++)i[s]=t.read(r);return i},write:(r,n)=>{n.writeULEB(r.length);for(const i of r)t.write(i,n)},...e,validate:r=>{var n;if((n=e==null?void 0:e.validate)==null||n.call(e,r),!("length"in r))throw new TypeError(`Expected array, found ${typeof r}`)}})},tuple(t,e){return new Z({name:`(${t.map(r=>r.name).join(", ")})`,serializedSize:r=>{let n=0;for(let i=0;i<t.length;i++){const s=t[i].serializedSize(r[i]);if(s==null)return null;n+=s}return n},read:r=>{const n=[];for(const i of t)n.push(i.read(r));return n},write:(r,n)=>{for(let i=0;i<t.length;i++)t[i].write(r[i],n)},...e,validate:r=>{var n;if((n=e==null?void 0:e.validate)==null||n.call(e,r),!Array.isArray(r))throw new TypeError(`Expected array, found ${typeof r}`);if(r.length!==t.length)throw new TypeError(`Expected array of length ${t.length}, found ${r.length}`)}})},struct(t,e,r){const n=Object.entries(e);return new Z({name:t,serializedSize:i=>{let s=0;for(const[c,a]of n){const o=a.serializedSize(i[c]);if(o==null)return null;s+=o}return s},read:i=>{const s={};for(const[c,a]of n)s[c]=a.read(i);return s},write:(i,s)=>{for(const[c,a]of n)a.write(i[c],s)},...r,validate:i=>{var s;if((s=r==null?void 0:r.validate)==null||s.call(r,i),typeof i!="object"||i==null)throw new TypeError(`Expected object, found ${typeof i}`)}})},enum(t,e,r){const n=Object.entries(e);return new Z({name:t,read:i=>{const s=i.readULEB(),[c,a]=n[s];return{[c]:(a==null?void 0:a.read(i))??!0}},write:(i,s)=>{const[c,a]=Object.entries(i)[0];for(let o=0;o<n.length;o++){const[d,u]=n[o];if(d===c){s.writeULEB(o),u==null||u.write(a,s);return}}},...r,validate:i=>{var a;if((a=r==null?void 0:r.validate)==null||a.call(r,i),typeof i!="object"||i==null)throw new TypeError(`Expected object, found ${typeof i}`);const s=Object.keys(i);if(s.length!==1)throw new TypeError(`Expected object with one key, found ${s.length}`);const[c]=s;if(!Object.hasOwn(e,c))throw new TypeError(`Invalid enum variant ${c}`)}})},map(t,e){return l.vector(l.tuple([t,e])).transform({name:`Map<${t.name}, ${e.name}>`,input:r=>[...r.entries()],output:r=>{const n=new Map;for(const[i,s]of r)n.set(i,s);return n}})},generic(t,e){return(...r)=>e(...r).transform({name:`${e.name}<${r.map(n=>n.name).join(", ")}>`,input:n=>n,output:n=>n})},lazy(t){return Sn(t)}},Tn=32,Te=class{constructor(t){if(this.types=new Map,this.counter=0,t instanceof Te){this.schema=t.schema,this.types=new Map(t.types);return}if(this.schema=t,this.registerAddressType(Te.ADDRESS,t.addressLength,t.addressEncoding),this.registerVectorType(t.vectorType),t.types&&t.types.structs)for(let e of Object.keys(t.types.structs))this.registerStructType(e,t.types.structs[e]);if(t.types&&t.types.enums)for(let e of Object.keys(t.types.enums))this.registerEnumType(e,t.types.enums[e]);if(t.types&&t.types.aliases)for(let e of Object.keys(t.types.aliases))this.registerAlias(e,t.types.aliases[e]);t.withPrimitives!==!1&&vn(this)}tempKey(){return`bcs-struct-${++this.counter}`}ser(t,e,r){if(typeof t=="string"||Array.isArray(t)){const{name:n,params:i}=this.parseTypeName(t);return this.getTypeInterface(n).encode(this,e,r,i)}if(typeof t=="object"){const n=this.tempKey();return new Te(this).registerStructType(n,t).ser(n,e,r)}throw new Error(`Incorrect type passed into the '.ser()' function.
2
+ ${JSON.stringify(t)}`)}de(t,e,r){if(typeof e=="string")if(r)e=yn(e,r);else throw new Error("To pass a string to `bcs.de`, specify encoding");if(typeof t=="string"||Array.isArray(t)){const{name:n,params:i}=this.parseTypeName(t);return this.getTypeInterface(n).decode(this,e,i)}if(typeof t=="object"){const n=new Te(this),i=this.tempKey();return n.registerStructType(i,t).de(i,e,r)}throw new Error(`Incorrect type passed into the '.de()' function.
3
+ ${JSON.stringify(t)}`)}hasType(t){return this.types.has(t)}registerAlias(t,e){return this.types.set(t,e),this}registerType(t,e,r,n=()=>!0){const{name:i,params:s}=this.parseTypeName(t);return this.types.set(i,{encode(c,a,o,d){const u=s.reduce((h,m,y)=>Object.assign(h,{[m]:d[y]}),{});return this._encodeRaw.call(c,new cr(o),a,d,u)},decode(c,a,o){const d=s.reduce((u,h,m)=>Object.assign(u,{[h]:o[m]}),{});return this._decodeRaw.call(c,new or(a),o,d)},_encodeRaw(c,a,o,d){if(n(a))return e.call(this,c,a,o,d);throw new Error(`Validation failed for type ${i}, data: ${a}`)},_decodeRaw(c,a,o){return r.call(this,c,a,o)}}),this}registerBcsType(t,e){return this.registerType(t,(r,n,i)=>{const s=i.map(c=>new Z({name:String(c),write:(a,o)=>{const{name:d,params:u}=this.parseTypeName(c),h=this.getTypeInterface(d),m=u.reduce((y,S,T)=>Object.assign(y,{[S]:i[T]}),{});return h._encodeRaw.call(this,o,a,u,m)},read:()=>{throw new Error("Not implemented")}}));return e(...s).write(n,r),r},(r,n)=>{const i=n.map(s=>new Z({name:String(s),write:(c,a)=>{throw new Error("Not implemented")},read:c=>{const{name:a,params:o}=this.parseTypeName(s),d=this.getTypeInterface(a),u=o.reduce((h,m,y)=>Object.assign(h,{[m]:n[y]}),{});return d._decodeRaw.call(this,c,o,u)}}));return e(...i).read(r)}),this}registerAddressType(t,e,r="hex"){switch(r){case"base64":return this.registerType(t,function(i,s){return ue(s).reduce((c,a)=>c.write8(a),i)},function(i){return Be(i.readBytes(e))});case"hex":return this.registerType(t,function(i,s){return Je(s).reduce((c,a)=>c.write8(a),i)},function(i){return Ce(i.readBytes(e))});default:throw new Error("Unsupported encoding! Use either hex or base64")}}registerVectorType(t){let{name:e,params:r}=this.parseTypeName(t);if(r.length>1)throw new Error("Vector can have only one type parameter; got "+e);return this.registerType(t,function(i,s,c,a){return i.writeVec(s,(o,d)=>{let u=c[0];if(!u)throw new Error(`Incorrect number of type parameters passed a to vector '${t}'`);let{name:h,params:m}=this.parseTypeName(u);if(this.hasType(h))return this.getTypeInterface(h)._encodeRaw.call(this,o,d,m,a);if(!(h in a))throw new Error(`Unable to find a matching type definition for ${h} in vector; make sure you passed a generic`);let{name:y,params:S}=this.parseTypeName(a[h]);return this.getTypeInterface(y)._encodeRaw.call(this,o,d,S,a)})},function(i,s,c){return i.readVec(a=>{let o=s[0];if(!o)throw new Error(`Incorrect number of type parameters passed to a vector '${t}'`);let{name:d,params:u}=this.parseTypeName(o);if(this.hasType(d))return this.getTypeInterface(d)._decodeRaw.call(this,a,u,c);if(!(d in c))throw new Error(`Unable to find a matching type definition for ${d} in vector; make sure you passed a generic`);let{name:h,params:m}=this.parseTypeName(c[d]);return this.getTypeInterface(h)._decodeRaw.call(this,a,m,c)})})}registerStructType(t,e){for(let c in e){let a=this.tempKey(),o=e[c];!Array.isArray(o)&&typeof o!="string"&&(e[c]=a,this.registerStructType(a,o))}let r=Object.freeze(e),n=Object.keys(r),{name:i,params:s}=this.parseTypeName(t);return this.registerType(t,function(a,o,d,u){if(!o||o.constructor!==Object)throw new Error(`Expected ${i} to be an Object, got: ${o}`);if(d.length!==s.length)throw new Error(`Incorrect number of generic parameters passed; expected: ${s.length}, got: ${d.length}`);for(let h of n){if(!(h in o))throw new Error(`Struct ${i} requires field ${h}:${r[h]}`);const{name:m,params:y}=this.parseTypeName(r[h]);if(!s.includes(m))this.getTypeInterface(m)._encodeRaw.call(this,a,o[h],y,u);else{const S=s.indexOf(m);let{name:T,params:f}=this.parseTypeName(d[S]);if(this.hasType(T)){this.getTypeInterface(T)._encodeRaw.call(this,a,o[h],f,u);continue}if(!(T in u))throw new Error(`Unable to find a matching type definition for ${T} in ${i}; make sure you passed a generic`);let{name:O,params:B}=this.parseTypeName(u[T]);this.getTypeInterface(O)._encodeRaw.call(this,a,o[h],B,u)}}return a},function(a,o,d){if(o.length!==s.length)throw new Error(`Incorrect number of generic parameters passed; expected: ${s.length}, got: ${o.length}`);let u={};for(let h of n){const{name:m,params:y}=this.parseTypeName(r[h]);if(!s.includes(m))u[h]=this.getTypeInterface(m)._decodeRaw.call(this,a,y,d);else{const S=s.indexOf(m);let{name:T,params:f}=this.parseTypeName(o[S]);if(this.hasType(T)){u[h]=this.getTypeInterface(T)._decodeRaw.call(this,a,f,d);continue}if(!(T in d))throw new Error(`Unable to find a matching type definition for ${T} in ${i}; make sure you passed a generic`);let{name:O,params:B}=this.parseTypeName(d[T]);u[h]=this.getTypeInterface(O)._decodeRaw.call(this,a,B,d)}}return u})}registerEnumType(t,e){for(let c in e){let a=this.tempKey(),o=e[c];o!==null&&!Array.isArray(o)&&typeof o!="string"&&(e[c]=a,this.registerStructType(a,o))}let r=Object.freeze(e),n=Object.keys(r),{name:i,params:s}=this.parseTypeName(t);return this.registerType(t,function(a,o,d,u){if(!o)throw new Error(`Unable to write enum "${i}", missing data.
4
+ Received: "${o}"`);if(typeof o!="object")throw new Error(`Incorrect data passed into enum "${i}", expected object with properties: "${n.join(" | ")}".
5
+ Received: "${JSON.stringify(o)}"`);let h=Object.keys(o)[0];if(h===void 0)throw new Error(`Empty object passed as invariant of the enum "${i}"`);let m=n.indexOf(h);if(m===-1)throw new Error(`Unknown invariant of the enum "${i}", allowed values: "${n.join(" | ")}"; received "${h}"`);let y=n[m],S=r[y];if(a.write8(m),S===null)return a;let T=s.indexOf(S),f=T===-1?S:d[T];{let{name:O,params:B}=this.parseTypeName(f);return this.getTypeInterface(O)._encodeRaw.call(this,a,o[h],B,u)}},function(a,o,d){let u=a.readULEB(),h=n[u],m=r[h];if(u===-1)throw new Error(`Decoding type mismatch, expected enum "${i}" invariant index, received "${u}"`);if(m===null)return{[h]:!0};let y=s.indexOf(m),S=y===-1?m:o[y];{let{name:T,params:f}=this.parseTypeName(S);return{[h]:this.getTypeInterface(T)._decodeRaw.call(this,a,f,d)}}})}getTypeInterface(t){let e=this.types.get(t);if(typeof e=="string"){let r=[];for(;typeof e=="string";){if(r.includes(e))throw new Error(`Recursive definition found: ${r.join(" -> ")} -> ${e}`);r.push(e),e=this.types.get(e)}}if(e===void 0)throw new Error(`Type ${t} is not registered`);return e}parseTypeName(t){if(Array.isArray(t)){let[a,...o]=t;return{name:a,params:o}}if(typeof t!="string")throw new Error(`Illegal type passed as a name of the type: ${t}`);let[e,r]=this.schema.genericSeparators||["<",">"],n=t.indexOf(e),i=Array.from(t).reverse().indexOf(r);if(n===-1&&i===-1)return{name:t,params:[]};if(n===-1||i===-1)throw new Error(`Unclosed generic in name '${t}'`);let s=t.slice(0,n),c=mt(t.slice(n+1,t.length-i-1),this.schema.genericSeparators);return{name:s,params:c}}};let C=Te;C.U8="u8";C.U16="u16";C.U32="u32";C.U64="u64";C.U128="u128";C.U256="u256";C.BOOL="bool";C.VECTOR="vector";C.ADDRESS="address";C.STRING="string";C.HEX="hex-string";C.BASE58="base58-string";C.BASE64="base64-string";function vn(t){t.registerType(C.U8,function(e,r){return e.write8(r)},function(e){return e.read8()},e=>e<256),t.registerType(C.U16,function(e,r){return e.write16(r)},function(e){return e.read16()},e=>e<65536),t.registerType(C.U32,function(e,r){return e.write32(r)},function(e){return e.read32()},e=>e<=4294967296n),t.registerType(C.U64,function(e,r){return e.write64(r)},function(e){return e.read64()}),t.registerType(C.U128,function(e,r){return e.write128(r)},function(e){return e.read128()}),t.registerType(C.U256,function(e,r){return e.write256(r)},function(e){return e.read256()}),t.registerType(C.BOOL,function(e,r){return e.write8(r)},function(e){return e.read8().toString(10)==="1"}),t.registerType(C.STRING,function(e,r){return e.writeVec(Array.from(r),(n,i)=>n.write8(i.charCodeAt(0)))},function(e){return e.readVec(r=>r.read8()).map(r=>String.fromCharCode(Number(r))).join("")},e=>!0),t.registerType(C.HEX,function(e,r){return e.writeVec(Array.from(Je(r)),(n,i)=>n.write8(i))},function(e){let r=e.readVec(n=>n.read8());return Ce(new Uint8Array(r))}),t.registerType(C.BASE58,function(e,r){return e.writeVec(Array.from(pt(r)),(n,i)=>n.write8(i))},function(e){let r=e.readVec(n=>n.read8());return xe(new Uint8Array(r))}),t.registerType(C.BASE64,function(e,r){return e.writeVec(Array.from(ue(r)),(n,i)=>n.write8(i))},function(e){let r=e.readVec(n=>n.read8());return Be(new Uint8Array(r))})}function kn(){return{genericSeparators:["<",">"],vectorType:"vector",addressLength:Tn,addressEncoding:"hex"}}const bt=32;function In(t){return En(t)&&On(t)===bt}function jn(t){return t.includes("::")?fr(t):t}function fr(t){const[e,r]=t.split("::"),n=t.slice(e.length+r.length+4),i=n.includes("<")?n.slice(0,n.indexOf("<")):n,s=n.includes("<")?mt(n.slice(n.indexOf("<")+1,n.lastIndexOf(">"))).map(c=>jn(c.trim())):[];return{address:V(e),module:r,name:i,typeParams:s}}function V(t,e=!1){let r=t.toLowerCase();return!e&&r.startsWith("0x")&&(r=r.slice(2)),`0x${r.padStart(bt*2,"0")}`}function we(t,e=!1){return V(t,e)}function En(t){return/^(0x|0X)?[a-fA-F0-9]+$/.test(t)&&t.length%2===0}function On(t){return/^(0x|0X)/.test(t)?(t.length-2)/2:t.length/2}BigInt(1e9);const St="0x1",gr="0x2",fe=we("0x6"),Re=`${gr}::sui::SUI`;we("0x5");const An="object",_n="ID",xn="ascii",Bn="String",Cn="string",$n="String",Un="option",Pn="Option",Mn={address:gr,module:An,name:_n},Rn={address:St,module:xn,name:Bn},Nn={address:St,module:Cn,name:$n},Dn={address:St,module:Un,name:Pn},$e=(t,e)=>t.address===e.address&&t.module===e.module&&t.name===e.name;function Vn(t){var r;const e=(r=ht(t))==null?void 0:r.Struct;return(e==null?void 0:e.address)==="0x2"&&(e==null?void 0:e.module)==="tx_context"&&(e==null?void 0:e.name)==="TxContext"}function tt(t,e){if(!(typeof e>"u")&&typeof e!==t)throw new Error(`Expect ${e} to be ${t}, received ${typeof e}`)}const zn=["Address","Bool","U8","U16","U32","U64","U128","U256"];function at(t,e){if(typeof t=="string"&&zn.includes(t)){if(t in["U8","U16","U32","U64","U128","U256"])tt("number",e);else if(t==="Bool")tt("boolean",e);else if(t==="Address"&&(tt("string",e),e&&!In(e)))throw new Error("Invalid Sui Address");return t.toLowerCase()}else if(typeof t=="string")throw new Error(`Unknown pure normalized type ${JSON.stringify(t,null,2)}`);if("Vector"in t){if((e===void 0||typeof e=="string")&&t.Vector==="U8")return"string";if(e!==void 0&&!Array.isArray(e))throw new Error(`Expect ${e} to be a array, received ${typeof e}`);const r=at(t.Vector,e?e[0]:void 0);return r===void 0?void 0:`vector<${r}>`}if("Struct"in t){if($e(t.Struct,Rn))return"string";if($e(t.Struct,Nn))return"utf8string";if($e(t.Struct,Mn))return"address";if($e(t.Struct,Dn)){const r={Vector:t.Struct.typeArguments[0]};return at(r,e)}}}const Fn=/^vector<(.+)>$/,Gn=/^([^:]+)::([^:]+)::([^<]+)(<(.+)>)?/;class ne{static parseFromStr(e,r=!1){if(e==="address")return{address:null};if(e==="bool")return{bool:null};if(e==="u8")return{u8:null};if(e==="u16")return{u16:null};if(e==="u32")return{u32:null};if(e==="u64")return{u64:null};if(e==="u128")return{u128:null};if(e==="u256")return{u256:null};if(e==="signer")return{signer:null};const n=e.match(Fn);if(n)return{vector:ne.parseFromStr(n[1],r)};const i=e.match(Gn);if(i)return{struct:{address:r?V(i[1]):i[1],module:i[2],name:i[3],typeParams:i[5]===void 0?[]:ne.parseStructTypeArgs(i[5],r)}};throw new Error(`Encountered unexpected token when parsing type args for ${e}`)}static parseStructTypeArgs(e,r=!1){return mt(e).map(n=>ne.parseFromStr(n,r))}static tagToString(e){if("bool"in e)return"bool";if("u8"in e)return"u8";if("u16"in e)return"u16";if("u32"in e)return"u32";if("u64"in e)return"u64";if("u128"in e)return"u128";if("u256"in e)return"u256";if("address"in e)return"address";if("signer"in e)return"signer";if("vector"in e)return`vector<${ne.tagToString(e.vector)}>`;if("struct"in e){const r=e.struct,n=r.typeParams.map(ne.tagToString).join(", ");return`${r.address}::${r.module}::${r.name}${n?`<${n}>`:""}`}throw new Error("Invalid TypeTag")}}const x=new C({...kn(),types:{enums:{"Option<T>":{None:null,Some:"T"}}}});function hr(t){return l.u64({name:"unsafe_u64",...t}).transform({input:e=>e,output:e=>Number(e)})}function Ln(t){return l.enum("Option",{None:null,Some:t})}function Tt(t){return t.transform({input:e=>({[e.kind]:e}),output:e=>{const r=Object.keys(e)[0];return{kind:r,...e[r]}}})}const Y=l.bytes(bt).transform({input:t=>typeof t=="string"?Je(V(t)):t,output:t=>V(Ce(t))}),vt=l.vector(l.u8()).transform({name:"ObjectDigest",input:t=>pt(t),output:t=>xe(new Uint8Array(t))}),Ee=l.struct("SuiObjectRef",{objectId:Y,version:l.u64(),digest:vt}),kt=l.struct("SharedObjectRef",{objectId:Y,initialSharedVersion:l.u64(),mutable:l.bool()}),Le=l.enum("ObjectArg",{ImmOrOwned:Ee,Shared:kt,Receiving:Ee}),It=l.enum("CallArg",{Pure:l.vector(l.u8()),Object:Le,ObjVec:l.vector(Le)}),be=l.enum("TypeTag",{bool:null,u8:null,u64:null,u128:null,address:null,signer:null,vector:l.lazy(()=>be),struct:l.lazy(()=>xt),u16:null,u32:null,u256:null}),H=Tt(l.enum("Argument",{GasCoin:null,Input:l.struct("Input",{index:l.u16()}),Result:l.struct("Result",{index:l.u16()}),NestedResult:l.struct("NestedResult",{index:l.u16(),resultIndex:l.u16()})})),jt=l.struct("ProgrammableMoveCall",{package:Y,module:l.string(),function:l.string(),type_arguments:l.vector(be),arguments:l.vector(H)}).transform({input:t=>{const[e,r,n]=t.target.split("::"),i=t.typeArguments.map(s=>ne.parseFromStr(s,!0));return{package:V(e),module:r,function:n,type_arguments:i,arguments:t.arguments}},output:t=>({target:[t.package,t.module,t.function].join("::"),arguments:t.arguments,typeArguments:t.type_arguments.map(ne.tagToString)})}),Et=Tt(l.enum("Transaction",{MoveCall:jt,TransferObjects:l.struct("TransferObjects",{objects:l.vector(H),address:H}),SplitCoins:l.struct("SplitCoins",{coin:H,amounts:l.vector(H)}),MergeCoins:l.struct("MergeCoins",{destination:H,sources:l.vector(H)}),Publish:l.struct("Publish",{modules:l.vector(l.vector(l.u8())),dependencies:l.vector(Y)}),MakeMoveVec:l.struct("MakeMoveVec",{type:Ln(be),objects:l.vector(H)}),Upgrade:l.struct("Upgrade",{modules:l.vector(l.vector(l.u8())),dependencies:l.vector(Y),packageId:Y,ticket:H})})),Ot=l.struct("ProgrammableTransaction",{inputs:l.vector(It),transactions:l.vector(Et)}),At=l.enum("TransactionKind",{ProgrammableTransaction:Ot,ChangeEpoch:null,Genesis:null,ConsensusCommitPrologue:null}),_t=l.enum("TransactionExpiration",{None:null,Epoch:hr()}),xt=l.struct("StructTag",{address:Y,module:l.string(),name:l.string(),typeParams:l.vector(be)}),Bt=l.struct("GasData",{payment:l.vector(Ee),owner:Y,price:l.u64(),budget:l.u64()}),Ct=l.struct("TransactionDataV1",{kind:At,sender:Y,gasData:Bt,expiration:_t}),$t=l.enum("TransactionData",{V1:Ct}),Wn=l.enum("IntentScope",{TransactionData:null,TransactionEffects:null,CheckpointSummary:null,PersonalMessage:null}),Kn=l.enum("IntentVersion",{V0:null}),Jn=l.enum("AppId",{Sui:null}),qn=l.struct("Intent",{scope:Wn,version:Kn,appId:Jn}),Hn=l.generic(["T"],t=>l.struct("IntentMessage<T>",{intent:qn,value:t})),Ut=l.enum("CompressedSignature",{ED25519:l.fixedArray(64,l.u8()),Secp256k1:l.fixedArray(64,l.u8()),Secp256r1:l.fixedArray(64,l.u8()),ZkLogin:l.vector(l.u8())}),Pt=l.enum("PublicKey",{ED25519:l.fixedArray(32,l.u8()),Secp256k1:l.fixedArray(33,l.u8()),Secp256r1:l.fixedArray(33,l.u8()),ZkLogin:l.vector(l.u8())}),Mt=l.struct("MultiSigPkMap",{pubKey:Pt,weight:l.u8()}),Rt=l.struct("MultiSigPublicKey",{pk_map:l.vector(Mt),threshold:l.u16()}),pr=l.struct("MultiSig",{sigs:l.vector(Ut),bitmap:l.u16(),multisig_pk:Rt}),Xn=l.vector(l.u8()).transform({input:t=>typeof t=="string"?ue(t):t,output:t=>Be(new Uint8Array(t))}),yr=l.struct("SenderSignedTransaction",{intentMessage:Hn($t),txSignatures:l.vector(Xn)}),mr=l.vector(yr,{name:"SenderSignedData"}),R={...l,U8:l.u8(),U16:l.u16(),U32:l.u32(),U64:l.u64(),U128:l.u128(),U256:l.u256(),ULEB128:l.uleb128(),Bool:l.bool(),String:l.string(),Address:Y,Argument:H,CallArg:It,CompressedSignature:Ut,GasData:Bt,MultiSig:pr,MultiSigPkMap:Mt,MultiSigPublicKey:Rt,ObjectArg:Le,ObjectDigest:vt,ProgrammableMoveCall:jt,ProgrammableTransaction:Ot,PublicKey:Pt,SenderSignedData:mr,SenderSignedTransaction:yr,SharedObjectRef:kt,StructTag:xt,SuiObjectRef:Ee,Transaction:Et,TransactionData:$t,TransactionDataV1:Ct,TransactionExpiration:_t,TransactionKind:At,TypeTag:be,ser:x.ser.bind(x),de:x.de.bind(x),getTypeInterface:x.getTypeInterface.bind(x),hasType:x.hasType.bind(x),parseTypeName:x.parseTypeName.bind(x),registerAddressType:x.registerAddressType.bind(x),registerAlias:x.registerAlias.bind(x),registerBcsType:x.registerBcsType.bind(x),registerEnumType:x.registerEnumType.bind(x),registerStructType:x.registerStructType.bind(x),registerType:x.registerType.bind(x),types:x.types};x.registerBcsType("utf8string",()=>l.string({name:"utf8string"}));x.registerBcsType("unsafe_u64",()=>hr());x.registerBcsType("enumKind",t=>Tt(t));[Y,H,It,Ut,Bt,pr,Mt,Rt,Le,vt,jt,Ot,Pt,mr,kt,xt,Ee,Et,$t,Ct,_t,At,be].forEach(t=>{x.registerBcsType(t.name,()=>t)});const Zn=U([p({ImmOrOwned:ce}),p({Shared:p({objectId:g(),initialSharedVersion:U([ee(),g()]),mutable:z()})}),p({Receiving:ce})]),We=p({Pure:E(ee())}),ot=p({Object:Zn}),Ke=U([We,ot]);function Yn(t,e){return{Pure:Array.from(t instanceof Uint8Array?t:wt(t)?t.toBytes():R.ser(e,t,{maxSize:1/0}).toBytes())}}const G={Pure:Yn,ObjectRef({objectId:t,digest:e,version:r}){return{Object:{ImmOrOwned:{digest:e,version:r,objectId:V(t)}}}},SharedObjectRef({objectId:t,mutable:e,initialSharedVersion:r}){return{Object:{Shared:{mutable:e,initialSharedVersion:r,objectId:V(t)}}}},ReceivingRef({objectId:t,digest:e,version:r}){return{Object:{Receiving:{digest:e,version:r,objectId:V(t)}}}}};function Kt(t){return typeof t=="string"?V(t):"ImmOrOwned"in t.Object?V(t.Object.ImmOrOwned.objectId):"Receiving"in t.Object?V(t.Object.Receiving.objectId):V(t.Object.Shared.objectId)}function Qn(t){return typeof t=="object"&&"Object"in t&&"Shared"in t.Object?t.Object.Shared:void 0}function ei(t){var e;return((e=Qn(t))==null?void 0:e.mutable)??!1}function F(t,e){return Xt(t,e)}const ti=t=>U([p({None:U([k(!0),k(null)])}),p({Some:t})]),Oe=U([p({kind:k("Input"),index:ee(),value:v(it()),type:v(k("object"))}),p({kind:k("Input"),index:ee(),value:v(it()),type:k("pure")})]),ri=[Oe,p({kind:k("GasCoin")}),p({kind:k("Result"),index:ee()}),p({kind:k("NestedResult"),index:ee(),resultIndex:ee()})],se=U([...ri]),wr=p({kind:k("MoveCall"),target:W("target",g().validator),typeArguments:E(g()),arguments:E(se)}),br=p({kind:k("TransferObjects"),objects:E(se),address:se}),Sr=p({kind:k("SplitCoins"),coin:se,amounts:E(se)}),Tr=p({kind:k("MergeCoins"),destination:se,sources:E(se)}),vr=p({kind:k("MakeMoveVec"),type:v(ti(Q(g(),er()))),objects:E(se)}),kr=p({kind:k("Publish"),modules:E(E(ee())),dependencies:E(g())}),Ir=p({kind:k("Upgrade"),modules:E(E(ee())),dependencies:E(g()),packageId:g(),ticket:se}),ni=[wr,br,Sr,Tr,kr,Ir,vr],ii=U([...ni]),le={MoveCall(t){return F({kind:"MoveCall",target:t.target,arguments:t.arguments??[],typeArguments:t.typeArguments??[]},wr)},TransferObjects(t,e){return e.kind==="Input"&&e.type==="pure"&&typeof e.value!="object"&&(e.value=G.Pure(R.Address.serialize(e.value))),F({kind:"TransferObjects",objects:t,address:e},br)},SplitCoins(t,e){return e.forEach(r=>{r.kind==="Input"&&r.type==="pure"&&typeof r.value!="object"&&(r.value=G.Pure(R.U64.serialize(r.value)))}),F({kind:"SplitCoins",coin:t,amounts:e},Sr)},MergeCoins(t,e){return F({kind:"MergeCoins",destination:t,sources:e},Tr)},Publish({modules:t,dependencies:e}){return F({kind:"Publish",modules:t.map(r=>typeof r=="string"?Array.from(ue(r)):r),dependencies:e.map(r=>we(r))},kr)},Upgrade({modules:t,dependencies:e,packageId:r,ticket:n}){return F({kind:"Upgrade",modules:t.map(i=>typeof i=="string"?Array.from(ue(i)):i),dependencies:e.map(i=>we(i)),packageId:r,ticket:n},Ir)},MakeMoveVec({type:t,objects:e}){return F({kind:"MakeMoveVec",type:t?{Some:ne.parseFromStr(t)}:{None:null},objects:e},vr)}};function si(t){function e(r,n){return t(r,n)}return e.u8=r=>t(R.U8.serialize(r)),e.u16=r=>t(R.U16.serialize(r)),e.u32=r=>t(R.U32.serialize(r)),e.u64=r=>t(R.U64.serialize(r)),e.u128=r=>t(R.U128.serialize(r)),e.u256=r=>t(R.U256.serialize(r)),e.bool=r=>t(R.Bool.serialize(r)),e.string=r=>t(R.String.serialize(r)),e.address=r=>t(R.Address.serialize(r)),e.id=e.address,e}function ai(t,e){const r=Array.from(`${t}::`).map(i=>i.charCodeAt(0)),n=new Uint8Array(r.length+e.length);return n.set(r),n.set(e,r.length),w.blake2b(n,{dkLen:32})}const oi=v($(U([p({Epoch:ee()}),p({None:U([k(!0),k(null)])})]))),Jt=W("StringEncodedBigint",t=>{if(!["string","number","bigint"].includes(typeof t))return!1;try{return BigInt(t),!0}catch{return!1}}),ci=p({budget:v(Jt),price:v(Jt),payment:v(E(ce)),owner:v(g())}),Ue=p({version:k(1),sender:v(g()),expiration:oi,gasConfig:ci,inputs:E(Oe),transactions:E(ii)});function qt(t){return V(t).replace("0x","")}class ie{constructor(e){this.version=1,this.sender=e==null?void 0:e.sender,this.expiration=e==null?void 0:e.expiration,this.gasConfig=(e==null?void 0:e.gasConfig)??{},this.inputs=(e==null?void 0:e.inputs)??[],this.transactions=(e==null?void 0:e.transactions)??[]}static fromKindBytes(e){const r=R.TransactionKind.parse(e),n="ProgrammableTransaction"in r?r.ProgrammableTransaction:null;if(!n)throw new Error("Unable to deserialize from bytes.");const i=F({version:1,gasConfig:{},inputs:n.inputs.map((s,c)=>F({kind:"Input",value:s,index:c,type:L(s,We)?"pure":"object"},Oe)),transactions:n.transactions},Ue);return ie.restore(i)}static fromBytes(e){var c;const r=R.TransactionData.parse(e),n=r==null?void 0:r.V1,i="ProgrammableTransaction"in n.kind?(c=n==null?void 0:n.kind)==null?void 0:c.ProgrammableTransaction:null;if(!n||!i)throw new Error("Unable to deserialize from bytes.");const s=F({version:1,sender:n.sender,expiration:n.expiration,gasConfig:n.gasData,inputs:i.inputs.map((a,o)=>F({kind:"Input",value:a,index:o,type:L(a,We)?"pure":"object"},Oe)),transactions:i.transactions},Ue);return ie.restore(s)}static restore(e){nt(e,Ue);const r=new ie;return Object.assign(r,e),r}static getDigestFromBytes(e){const r=ai("TransactionData",e);return xe(r)}build({maxSizeBytes:e=1/0,overrides:r,onlyTransactionKind:n}={}){const i=this.inputs.map(u=>(nt(u.value,Ke),u.value)),s={ProgrammableTransaction:{inputs:i,transactions:this.transactions}};if(n)return R.TransactionKind.serialize(s,{maxSize:e}).toBytes();const c=(r==null?void 0:r.expiration)??this.expiration,a=(r==null?void 0:r.sender)??this.sender,o={...this.gasConfig,...r==null?void 0:r.gasConfig};if(!a)throw new Error("Missing transaction sender");if(!o.budget)throw new Error("Missing gas budget");if(!o.payment)throw new Error("Missing gas payment");if(!o.price)throw new Error("Missing gas price");const d={sender:qt(a),expiration:c||{None:!0},gasData:{payment:o.payment,owner:qt(this.gasConfig.owner??a),price:BigInt(o.price),budget:BigInt(o.budget)},kind:{ProgrammableTransaction:{inputs:i,transactions:this.transactions}}};return R.TransactionData.serialize({V1:d},{maxSize:e}).toBytes()}getDigest(){const e=this.build({onlyTransactionKind:!1});return ie.getDigestFromBytes(e)}snapshot(){return F(this,Ue)}}var Nt=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)},_=(t,e,r)=>(Nt(t,e,"read from private field"),r?r.call(t):e.get(t)),re=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},Pe=(t,e,r,n)=>(Nt(t,e,"write to private field"),e.set(t,r),r),N=(t,e,r)=>(Nt(t,e,"access private method"),r),I,ve,Ne,ke,De,de,he,Dt,jr,Vt,Er,zt,Or,Ft,Ar,Ve,ct;const ui={maxPureArgumentSize:16*1024,maxTxGas:5e10,maxGasObjects:256,maxTxSizeBytes:128*1024};function di(t){const e={kind:"Result",index:t},r=[],n=i=>r[i]??(r[i]={kind:"NestedResult",index:t,resultIndex:i});return new Proxy(e,{set(){throw new Error("The transaction result is a proxy, and does not support setting properties directly")},get(i,s){if(s in i)return Reflect.get(i,s);if(s===Symbol.iterator)return function*(){let a=0;for(;;)yield n(a),a++};if(typeof s=="symbol")return;const c=parseInt(s,10);if(!(Number.isNaN(c)||c<0))return n(c)}})}function li(t){const e=ht(t);return e?e.Struct.address==="0x2"&&e.Struct.module==="transfer"&&e.Struct.name==="Receiving":!1}function Ae(t){if(!t.client)throw new Error("No provider passed to Transaction#build, but transaction data was not sufficient to build offline.");return t.client}const fi=Symbol.for("@mysten/transaction"),rt={maxTxGas:"max_tx_gas",maxGasObjects:"max_gas_payment_objects",maxTxSizeBytes:"max_tx_size_bytes",maxPureArgumentSize:"max_pure_argument_size"},gi=1000n,hi=50,pi=(t,e)=>Array.from({length:Math.ceil(t.length/e)},(r,n)=>t.slice(n*e,n*e+e)),ut=class{constructor(t){re(this,ve),re(this,ke),re(this,de),re(this,Dt),re(this,Vt),re(this,zt),re(this,Ft),re(this,Ve),re(this,I,void 0),Pe(this,I,new ie(t?t.blockData:void 0))}static fromKind(t){const e=new ut;return Pe(e,I,ie.fromKindBytes(typeof t=="string"?ue(t):t)),e}static from(t){const e=new ut;return typeof t!="string"||!t.startsWith("{")?Pe(e,I,ie.fromBytes(typeof t=="string"?ue(t):t)):Pe(e,I,ie.restore(JSON.parse(t))),e}setSender(t){_(this,I).sender=t}setSenderIfNotSet(t){_(this,I).sender||(_(this,I).sender=t)}setExpiration(t){_(this,I).expiration=t}setGasPrice(t){_(this,I).gasConfig.price=String(t)}setGasBudget(t){_(this,I).gasConfig.budget=String(t)}setGasOwner(t){_(this,I).gasConfig.owner=t}setGasPayment(t){_(this,I).gasConfig.payment=t.map(e=>Zt(e,ce))}get blockData(){return _(this,I).snapshot()}get[fi](){return!0}get pure(){return Object.defineProperty(this,"pure",{enumerable:!1,value:si((t,e)=>wt(t)?N(this,ve,Ne).call(this,"pure",{Pure:Array.from(t.toBytes())}):N(this,ve,Ne).call(this,"pure",t instanceof Uint8Array?G.Pure(t):e?G.Pure(t,e):t))}),this.pure}get gas(){return{kind:"GasCoin"}}object(t){if(typeof t=="object"&&"kind"in t)return t;const e=Kt(t),r=_(this,I).inputs.find(n=>n.type==="object"&&e===Kt(n.value));return r&&L(r.value,ot)&&"Shared"in r.value.Object&&L(t,ot)&&"Shared"in t.Object&&(r.value.Object.Shared.mutable=r.value.Object.Shared.mutable||t.Object.Shared.mutable),r??N(this,ve,Ne).call(this,"object",typeof t=="string"?V(t):t)}objectRef(...t){return this.object(G.ObjectRef(...t))}receivingRef(...t){return this.object(G.ReceivingRef(...t))}sharedObjectRef(...t){return this.object(G.SharedObjectRef(...t))}add(t){const e=_(this,I).transactions.push(t);return di(e-1)}splitCoins(t,e){return this.add(le.SplitCoins(typeof t=="string"?this.object(t):t,e.map(r=>typeof r=="number"||typeof r=="bigint"||typeof r=="string"?this.pure.u64(r):N(this,ke,De).call(this,r))))}mergeCoins(t,e){return this.add(le.MergeCoins(typeof t=="string"?this.object(t):t,e.map(r=>typeof r=="string"?this.object(r):r)))}publish({modules:t,dependencies:e}){return this.add(le.Publish({modules:t,dependencies:e}))}upgrade({modules:t,dependencies:e,packageId:r,ticket:n}){return this.add(le.Upgrade({modules:t,dependencies:e,packageId:r,ticket:typeof n=="string"?this.object(n):n}))}moveCall({arguments:t,typeArguments:e,target:r}){return this.add(le.MoveCall({arguments:t==null?void 0:t.map(n=>N(this,ke,De).call(this,n)),typeArguments:e,target:r}))}transferObjects(t,e){return this.add(le.TransferObjects(t.map(r=>typeof r=="string"?this.object(r):r),typeof e=="string"?this.pure.address(e):N(this,ke,De).call(this,e)))}makeMoveVec({type:t,objects:e}){return this.add(le.MakeMoveVec({type:t,objects:e.map(r=>typeof r=="string"?this.object(r):r)}))}serialize(){return JSON.stringify(_(this,I).snapshot())}async sign(t){const{signer:e,...r}=t,n=await this.build(r);return e.signTransactionBlock(n)}async build(t={}){return await N(this,Ve,ct).call(this,t),_(this,I).build({maxSizeBytes:N(this,de,he).call(this,"maxTxSizeBytes",t),onlyTransactionKind:t.onlyTransactionKind})}async getDigest(t={}){return await N(this,Ve,ct).call(this,t),_(this,I).getDigest()}};let oe=ut;I=new WeakMap;ve=new WeakSet;Ne=function(t,e){const r=_(this,I).inputs.length,n=F({kind:"Input",value:typeof e=="bigint"?String(e):e,index:r,type:t},Oe);return _(this,I).inputs.push(n),n};ke=new WeakSet;De=function(t){return wt(t)?this.pure(t):t};de=new WeakSet;he=function(t,{protocolConfig:e,limits:r}){if(r&&typeof r[t]=="number")return r[t];if(!e)return ui[t];const n=e==null?void 0:e.attributes[rt[t]];if(!n)throw new Error(`Missing expected protocol config: "${rt[t]}"`);const i="u64"in n?n.u64:"u32"in n?n.u32:n.f64;if(!i)throw new Error(`Unexpected protocol config value found for: "${rt[t]}"`);return Number(i)};Dt=new WeakSet;jr=function(t){const e=N(this,de,he).call(this,"maxPureArgumentSize",t);_(this,I).inputs.forEach((r,n)=>{if(L(r.value,We)&&r.value.Pure.length>e)throw new Error(`Input at index ${n} is too large, max pure input size is ${e} bytes, got ${r.value.Pure.length} bytes`)})};Vt=new WeakSet;Er=async function(t){if(_(this,I).gasConfig.payment){const i=N(this,de,he).call(this,"maxGasObjects",t);if(_(this,I).gasConfig.payment.length>i)throw new Error(`Payment objects exceed maximum amount: ${i}`)}if(t.onlyTransactionKind||_(this,I).gasConfig.payment)return;const e=_(this,I).gasConfig.owner??_(this,I).sender,n=(await Ae(t).getCoins({owner:e,coinType:Re})).data.filter(i=>!_(this,I).inputs.find(c=>L(c.value,Ke)&&"Object"in c.value&&"ImmOrOwned"in c.value.Object?i.coinObjectId===c.value.Object.ImmOrOwned.objectId:!1)).slice(0,N(this,de,he).call(this,"maxGasObjects",t)-1).map(i=>({objectId:i.coinObjectId,digest:i.digest,version:i.version}));if(!n.length)throw new Error("No valid gas coins found for the transaction.");this.setGasPayment(n)};zt=new WeakSet;Or=async function(t){t.onlyTransactionKind||_(this,I).gasConfig.price||this.setGasPrice(await Ae(t).getReferenceGasPrice())};Ft=new WeakSet;Ar=async function(t){const{inputs:e,transactions:r}=_(this,I),n=[],i=[];if(e.forEach(s=>{if(s.type==="object"&&typeof s.value=="string"){i.push({id:V(s.value),input:s});return}}),r.forEach(s=>{if(s.kind==="MoveCall"&&s.arguments.some(a=>a.kind==="Input"&&!L(e[a.index].value,Ke))&&n.push(s),s.kind==="SplitCoins"&&s.amounts.forEach(c=>{if(c.kind==="Input"){const a=e[c.index];typeof a.value!="object"&&(a.value=G.Pure(R.U64.serialize(a.value)))}}),s.kind==="TransferObjects"&&s.address.kind==="Input"){const c=e[s.address.index];typeof c.value!="object"&&(c.value=G.Pure(R.Address.serialize(c.value)))}}),n.length&&await Promise.all(n.map(async s=>{const[c,a,o]=s.target.split("::"),d=await Ae(t).getNormalizedMoveFunction({package:we(c),module:a,function:o}),h=d.parameters.length>0&&Vn(d.parameters.at(-1))?d.parameters.slice(0,d.parameters.length-1):d.parameters;if(h.length!==s.arguments.length)throw new Error("Incorrect number of arguments.");h.forEach((m,y)=>{const S=s.arguments[y];if(S.kind!=="Input")return;const T=e[S.index];if(L(T.value,Ke))return;const f=T.value,O=at(m,f);if(O){T.value=G.Pure(f,O);return}if(ht(m)!=null||typeof m=="object"&&"TypeParameter"in m){if(typeof f!="string")throw new Error(`Expect the argument to be an object id string, got ${JSON.stringify(f,null,2)}`);i.push({id:f,input:T,normalizedType:m});return}throw new Error(`Unknown call arg type ${JSON.stringify(m,null,2)} for value ${JSON.stringify(f,null,2)}`)})})),i.length){const s=[...new Set(i.map(({id:u})=>u))],c=pi(s,hi),a=(await Promise.all(c.map(u=>Ae(t).multiGetObjects({ids:u,options:{showOwner:!0}})))).flat();let o=new Map(s.map((u,h)=>[u,a[h]]));const d=Array.from(o).filter(([u,h])=>h.error).map(([u,h])=>u);if(d.length)throw new Error(`The following input objects are invalid: ${d.join(", ")}`);i.forEach(({id:u,input:h,normalizedType:m})=>{var f;const y=o.get(u),S=(f=y.data)==null?void 0:f.owner,T=S&&typeof S=="object"&&"Shared"in S?S.Shared.initial_shared_version:void 0;if(T){const O=m!=null&&st(m)==null&&sr(m)==null,B=ei(h.value)||O||m!=null&&st(m)!=null;h.value=G.SharedObjectRef({objectId:u,initialSharedVersion:T,mutable:B})}else m&&li(m)?h.value=G.ReceivingRef(Wt(y)):h.value=G.ObjectRef(Wt(y))})}};Ve=new WeakSet;ct=async function(t){if(!t.onlyTransactionKind&&!_(this,I).sender)throw new Error("Missing transaction sender");if(!t.protocolConfig&&!t.limits&&t.client&&(t.protocolConfig=await t.client.getProtocolConfig()),await Promise.all([N(this,zt,Or).call(this,t),N(this,Ft,Ar).call(this,t)]),!t.onlyTransactionKind&&(await N(this,Vt,Er).call(this,t),!_(this,I).gasConfig.budget)){const e=await Ae(t).dryRunTransactionBlock({transactionBlock:_(this,I).build({maxSizeBytes:N(this,de,he).call(this,"maxTxSizeBytes",t),overrides:{gasConfig:{budget:String(N(this,de,he).call(this,"maxTxGas",t)),payment:[]}}})});if(e.effects.status.status!=="success")throw new Error(`Dry run failed, could not automatically determine a budget: ${e.effects.status.error}`,{cause:e});const r=gi*BigInt(this.blockData.gasConfig.price||1n),n=BigInt(e.effects.gasUsed.computationCost)+r,i=n+BigInt(e.effects.gasUsed.storageCost)-BigInt(e.effects.gasUsed.storageRebate);this.setGasBudget(i>n?i:n)}N(this,Dt,jr).call(this,t)};const dt=async(t,e,r)=>{var c,a,o;if(!w.isValidSuiType(r))throw new Error(`Invalid Sui type: ${r}`);const n=await b.getObjectFields(t,e);if(!n)throw new Error(`Unable to fetch object fields from token bridge state. Object ID: ${e}`);const i=(a=(c=n.token_registry.fields)==null?void 0:c.id)==null?void 0:a.id;if(!i)throw new Error("Unable to fetch token registry object ID");const s=w.getPackageIdFromType((o=n.token_registry)==null?void 0:o.type);if(!s)throw new Error("Unable to fetch token registry package ID");return t.getDynamicFieldObject({parentId:i,name:{type:`${s}::token_registry::Key<${r}>`,value:{dummy_field:!1}}})},Ie=async(t,e,r,n)=>{var u,h,m,y;const i=await b.getObjectFields(t,e);if(!i)throw new Error("Unable to fetch object fields from token bridge state");const s=(h=(u=i.token_registry)==null?void 0:u.fields)==null?void 0:h.coin_types,c=(y=(m=s==null?void 0:s.fields)==null?void 0:m.id)==null?void 0:y.id;if(!c)throw new Error("Unable to fetch coin types");const a=w.getTableKeyType(s==null?void 0:s.type);if(!a)throw new Error("Unable to get key type");const o=await t.getDynamicFieldObject({parentId:c,name:{type:a,value:{addr:[...r],chain:n}}});if(o.error){if(o.error.code==="dynamicFieldNotFound")return null;throw new Error(`Unexpected getDynamicFieldObject response ${o.error}`)}const d=b.getFieldsFromObjectResponse(o);if(!d)return null;if(!b.isMoveStructObject(d))throw new Error("What?");return"value"in d?w.trimSuiType(d.value):null};class qe{constructor(e,r,n,i){D(this,"network");D(this,"chain");D(this,"provider");D(this,"contracts");D(this,"coreBridgeObjectId");D(this,"tokenBridgeObjectId");D(this,"chainId");this.network=e,this.chain=r,this.provider=n,this.contracts=i,this.chainId=w.networkChainToNativeChainId.get(e,r);const s=this.contracts.tokenBridge;if(!s)throw new Error(`Wormhole Token Bridge contract for domain ${r} not found`);const c=this.contracts.coreBridge;if(!c)throw new Error(`Wormhole Token Bridge contract for domain ${r} not found`);this.tokenBridgeObjectId=s,this.coreBridgeObjectId=c}static async fromRpc(e,r){const[n,i]=await b.SuiPlatform.chainFromRpc(e),s=r[i];if(s.network!==n)throw new Error(`Network mismatch: ${s.network} != ${n}`);return new qe(n,i,e,s.contracts)}async isWrappedAsset(e){try{return await this.getOriginalAsset(e),!0}catch{return!1}}async getOriginalAsset(e){let r=e.getCoinType();if(!w.isValidSuiType(r))throw new Error(`Invalid Sui type: ${r}`);const n=await dt(this.provider,this.tokenBridgeObjectId,r),i=b.getFieldsFromObjectResponse(n);if(!i)throw w.ErrNotWrapped(r);if(!b.isMoveStructObject(i))throw new Error("Expected fields to be a MoveStruct");if(!("value"in i))throw new Error("Expected a `value` key in fields of MoveStruct");const s=i.value;if(!b.isMoveStructStruct(s))throw new Error("Expected fields to be a MoveStruct");const c=w.trimSuiType(s.type);if(r=w.trimSuiType(r),c.includes(`wrapped_asset::WrappedAsset<${r}>`)){const a=s.fields.info;if(!b.isMoveStructStruct(a))throw new Error("Expected fields to be a MoveStruct");const o=a.fields.token_address;if(!b.isMoveStructStruct(o))throw new Error("Expected fields to be a MoveStruct");if(!b.isMoveStructObject(o.fields))throw new Error("Expected address data to be a MoveObject");if(!("value"in o.fields))throw new Error("Expected a `value` key in fields of MoveStruct");const d=o.fields.value;if(!b.isMoveStructStruct(d))throw new Error("Expected fields to be a MoveStruct");const u=new Uint8Array(d.fields.data);return{chain:w.toChain(Number(a.fields.token_chain)),address:new w.UniversalAddress(u)}}throw w.ErrNotWrapped(r)}async getTokenUniversalAddress(e){let r=e.getCoinType();if(!w.isValidSuiType(r))throw new Error(`Invalid Sui type: ${r}`);const n=await dt(this.provider,this.tokenBridgeObjectId,r),i=b.getFieldsFromObjectResponse(n);if(!i)throw new Error(`Token of type ${r} has not been registered with the token bridge. Has it been attested?`);if(!b.isMoveStructObject(i))throw new Error("Expected fields to be a MoveStruct");if(!("value"in i))throw new Error("Expected a `value` key in fields of MoveStruct");const s=i.value;if(!b.isMoveStructStruct(s))throw new Error("Expected fields to be a MoveStruct");const c=w.trimSuiType(s.type);if(r=w.trimSuiType(r),c.includes(`native_asset::NativeAsset<${r}>`)){const a=s.fields.token_address;if(!b.isMoveStructStruct(a))throw new Error("Expected fields to be a MoveStruct");if(!("value"in a.fields))throw new Error("Expected a `value` key in fields of MoveStruct");const o=a.fields.value;if(!b.isMoveStructStruct(o))throw new Error("Expected fields to be a MoveStruct");const d=new Uint8Array(o.fields.data);return new w.UniversalAddress(d)}throw new Error(`Token of type ${r} is not a native asset`)}async getTokenNativeAddress(e,r){const n=await Ie(this.provider,this.tokenBridgeObjectId,r.toUint8Array(),w.toChainId(e));if(!n)throw new Error(`Token ${r.toString()} not found in token registry`);return new w.SuiAddress(n)}async hasWrappedAsset(e){try{return await this.getWrappedAsset(e),!0}catch{}return!1}async getWrappedAsset(e){if(w.isNative(e.address))throw new Error("Token Address required, 'native' literal not supported");const r=await Ie(this.provider,this.tokenBridgeObjectId,e.address.toUniversalAddress().toUint8Array(),w.toChainId(e.chain));if(!r)throw w.ErrNotWrapped(w.canonicalAddress(e));return w.toNative(this.chain,r)}async isTransferCompleted(e){var a,o,d,u,h,m,y,S;const r=await b.getObjectFields(this.provider,this.tokenBridgeObjectId);if(!r)throw new Error("Unable to fetch object fields from token bridge state");const n=(o=(a=r.consumed_vaas)==null?void 0:a.fields)==null?void 0:o.hashes,i=w.getTableKeyType((u=(d=n==null?void 0:n.fields)==null?void 0:d.items)==null?void 0:u.type);if(!i)throw new Error("Unable to get key type");const s=(S=(y=(m=(h=n==null?void 0:n.fields)==null?void 0:h.items)==null?void 0:m.fields)==null?void 0:y.id)==null?void 0:S.id;if(!s)throw new Error("Unable to fetch consumed VAAs table");const c=await this.provider.getDynamicFieldObject({parentId:s,name:{type:i,value:{data:[...w.keccak_256(e.hash)]}}});if(!c.error)return!0;if(c.error.code==="dynamicFieldNotFound")return!1;throw new Error(`Unexpected getDynamicFieldObject response ${c.error}`)}async*createAttestation(e){const r=0n,n=0n,i=e.toString(),s=await this.provider.getCoinMetadata({coinType:i});if(s===null||s.id===null)throw new Error(`Coin metadata ID for type ${i} not found`);const[c,a]=await this.getPackageIds(),o=new oe,[d]=o.splitCoins(o.gas,[o.pure(r)]),[u]=o.moveCall({target:`${a}::attest_token::attest_token`,arguments:[o.object(this.tokenBridgeObjectId),o.object(s.id),o.pure(n)],typeArguments:[i]});o.moveCall({target:`${c}::publish_message::publish_message`,arguments:[o.object(this.coreBridgeObjectId),d,u,o.object(fe)]}),yield this.createUnsignedTx(o,"Sui.TokenBridge.CreateAttestation")}async*submitAttestation(e,r){const[n,i]=await this.getPackageIds(),s=r.toString(),c=Math.min(e.payload.decimals,8),a=await this.getCoinBuildOutput(n,i,c),o=await b.publishPackage(a,s);yield this.createUnsignedTx(o,"Sui.TokenBridge.PrepareCreateWrapped");let d="",u="",h="",m="",y="",S=!1;for(;!S;){await new Promise(A=>setTimeout(A,500));const P=await this.provider.queryTransactionBlocks({filter:{FromAddress:s},options:{showObjectChanges:!0},limit:3});for(const A of P.data)if("objectChanges"in A){for(const j of A.objectChanges)b.isSuiPublishEvent(j)&&j.packageId!==void 0?d=j.packageId:b.isSuiCreateEvent(j)&&j.objectType.includes("WrappedAssetSetup")?(u=j.objectId,y=j.objectType.split(", ")[1].replace(">","")):b.isSuiCreateEvent(j)&&j.objectType.includes("UpgradeCap")?h=j.objectId:b.isSuiCreateEvent(j)&&j.objectType.includes("CoinMetadata")&&(m=j.objectId);if(d!==""&&u!==""&&h!==""&&m!==""){S=!0;break}else d="",u="",h="",m=""}}const T=w.getCoinTypeFromPackageId(d),f=new oe,[O]=f.moveCall({target:`${n}::vaa::parse_and_verify`,arguments:[f.object(this.coreBridgeObjectId),f.pure(b.uint8ArrayToBCS(w.serialize(e))),f.object(fe)]}),[B]=f.moveCall({target:`${i}::vaa::verify_only_once`,arguments:[f.object(this.tokenBridgeObjectId),O]});f.moveCall({target:`${i}::create_wrapped::complete_registration`,arguments:[f.object(this.tokenBridgeObjectId),f.object(m),f.object(u),f.object(h),B],typeArguments:[T,y]}),yield this.createUnsignedTx(f,"Sui.TokenBridge.SubmitAttestation")}async*transfer(e,r,n,i,s){const c=0n,a=0n,d=e.toString(),u=(w.isNative(n)?Re:n).toString(),h=await b.SuiPlatform.getCoins(this.provider,e,u),[m,...y]=h.filter(A=>b.isSameType(A.coinType,u));if(m===void 0)throw new Error(`Coins array doesn't contain any coins of type ${u}`);const[S,T]=await this.getPackageIds(),f=new oe,[O]=(()=>{if(u===Re)return f.splitCoins(f.gas,[f.pure(i)]);{const A=f.object(m.coinObjectId);return y.length&&f.mergeCoins(A,y.map(j=>f.object(j.coinObjectId))),f.splitCoins(A,[f.pure(i)])}})(),[B]=f.splitCoins(f.gas,[f.pure(c)]),[P]=f.moveCall({target:`${T}::state::verified_asset`,arguments:[f.object(this.tokenBridgeObjectId)],typeArguments:[u]});if(s){if(!d)throw new Error("senderAddress is required for transfer with payload");let A=!1;const j=await(async()=>{const Gt=await b.getOldestEmitterCapObjectId(this.provider,S,d);if(Gt!==null)return f.object(Gt);{const[_r]=f.moveCall({target:`${S}::emitter::new`,arguments:[f.object(this.coreBridgeObjectId)]});return A=!0,_r}})(),[M,q]=f.moveCall({target:`${T}::transfer_tokens_with_payload::prepare_transfer`,arguments:[j,P,O,f.pure(w.toChainId(r.chain)),f.pure(r.address.toUint8Array()),f.pure([...s]),f.pure(0)],typeArguments:[u]});f.moveCall({target:`${T}::coin_utils::return_nonzero`,arguments:[q],typeArguments:[u]});const[pe]=f.moveCall({target:`${T}::transfer_tokens_with_payload::transfer_tokens_with_payload`,arguments:[f.object(this.tokenBridgeObjectId),M],typeArguments:[u]});f.moveCall({target:`${S}::publish_message::publish_message`,arguments:[f.object(this.coreBridgeObjectId),B,pe,f.object(fe)]}),A&&f.transferObjects([j],f.pure(d)),yield this.createUnsignedTx(f,"Sui.TokenBridge.TransferWithPayload")}else{const[A,j]=f.moveCall({target:`${T}::transfer_tokens::prepare_transfer`,arguments:[P,O,f.pure(w.toChainId(r.chain)),f.pure(b.uint8ArrayToBCS(r.address.toUint8Array())),f.pure(a),f.pure(0)],typeArguments:[u]});f.moveCall({target:`${T}::coin_utils::return_nonzero`,arguments:[j],typeArguments:[u]});const[M]=f.moveCall({target:`${T}::transfer_tokens::transfer_tokens`,arguments:[f.object(this.tokenBridgeObjectId),A],typeArguments:[u]});f.moveCall({target:`${S}::publish_message::publish_message`,arguments:[f.object(this.coreBridgeObjectId),B,M,f.object(fe)]}),yield this.createUnsignedTx(f,"Sui.TokenBridge.Transfer")}}async*redeem(e,r,n=!0){const i=await Ie(this.provider,this.tokenBridgeObjectId,r.payload.token.address.toUint8Array(),w.toChainId(r.payload.token.chain));if(!i)throw new Error("Unable to fetch token coinType");const[s,c]=await this.getPackageIds(),a=new oe,[o]=a.moveCall({target:`${s}::vaa::parse_and_verify`,arguments:[a.object(this.coreBridgeObjectId),a.pure(b.uint8ArrayToBCS(w.serialize(r))),a.object(fe)]}),[d]=a.moveCall({target:`${c}::vaa::verify_only_once`,arguments:[a.object(this.tokenBridgeObjectId),o]}),[u]=a.moveCall({target:`${c}::complete_transfer::authorize_transfer`,arguments:[a.object(this.tokenBridgeObjectId),d],typeArguments:[i]}),[h]=a.moveCall({target:`${c}::complete_transfer::redeem_relayer_payout`,arguments:[u],typeArguments:[i]});a.moveCall({target:`${c}::coin_utils::return_nonzero`,arguments:[h],typeArguments:[i]}),yield this.createUnsignedTx(a,"Sui.TokenBridge.Redeem")}async getWrappedNative(){return w.toNative(this.chain,Re)}async getPackageIds(){return Promise.all([b.getPackageId(this.provider,this.coreBridgeObjectId),b.getPackageId(this.provider,this.tokenBridgeObjectId)])}async getCoinBuildOutput(e,r,n){var a;if(n>8)throw new Error("Decimals is capped at 8");const i=(a=await b.getOriginalPackageId(this.provider,this.tokenBridgeObjectId))==null?void 0:a.replace("0x","");if(!i)throw new Error(`Original token bridge package ID not found for object ID ${this.tokenBridgeObjectId}`);const s="a11ceb0b060000000901000a020a14031e1704350405392d07669f01088502600ae502050cea02160004010b010c0205020d000002000201020003030c020001000104020700000700010001090801010c020a050600030803040202000302010702080007080100020800080303090002070801010b020209000901010608010105010b0202080008030209000504434f494e095478436f6e7465787408565f5f305f325f3011577261707065644173736574536574757004636f696e0e6372656174655f777261707065640b64756d6d795f6669656c6404696e697414707265706172655f726567697374726174696f6e0f7075626c69635f7472616e736665720673656e646572087472616e736665720a74785f636f6e746578740f76657273696f6e5f636f6e74726f6c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002"+i+"00020106010000000001090b0031"+n.toString(16).padStart(2,"0")+"0a0138000b012e110238010200";return{modules:[w.b64.encode(w.hex.decode(s))],dependencies:["0x1","0x2",r,e].map(o=>we(o))}}createUnsignedTx(e,r,n=!1){return new Ht.SuiUnsignedTransaction(e,this.network,this.chain,r,n)}}class He{constructor(e,r,n,i){D(this,"network");D(this,"chain");D(this,"connection");D(this,"contracts");D(this,"tokenBridgeRelayerObjectId");D(this,"coreBridgeObjectId");D(this,"tokenBridgeObjectId");D(this,"fields");this.network=e,this.chain=r,this.connection=n,this.contracts=i;const{tokenBridge:s,tokenBridgeRelayer:c,coreBridge:a}=i;if(!s||!c||!a)throw new Error(`Some object IDs for ${r} Automatic Token Bridge not found`);this.tokenBridgeRelayerObjectId=c,this.tokenBridgeObjectId=s,this.coreBridgeObjectId=a}static async fromRpc(e,r){const[n,i]=await b.SuiPlatform.chainFromRpc(e),s=r[i];if(s.network!==n)throw new Error(`Network mismatch for chain ${i}: ${s.network} != ${n}`);return new He(n,i,e,s.contracts)}async*transfer(e,r,n,i,s){const a=new w.SuiAddress(w.isNative(n)?b.SuiPlatform.nativeTokenId(this.network,this.chain).address:n).getCoinType(),{coreBridge:o,tokenBridge:d}=await this.getPackageIds(),u=new oe,h=BigInt(0),[m]=u.splitCoins(u.gas,[u.pure(h)]),[y]=await(async()=>{if(w.isNative(n))return u.splitCoins(u.gas,[u.pure(i)]);{const B=await b.SuiPlatform.getCoins(this.connection,e,a),[P,...A]=B.filter(M=>M.coinType===a);if(P===void 0)throw new Error(`Coins array doesn't contain any coins of type ${a}`);const j=u.object(P.coinObjectId);return A.length&&u.mergeCoins(j,A.map(M=>u.object(M.coinObjectId))),u.splitCoins(j,[u.pure(i)])}})(),[S]=u.moveCall({target:`${d}::state::verified_asset`,arguments:[u.object(this.tokenBridgeObjectId)],typeArguments:[a]}),T=await this.getPackageId(),[f]=u.moveCall({target:`${T}::transfer::transfer_tokens_with_relay`,arguments:[u.object(this.tokenBridgeRelayerObjectId),y,S,u.pure.u64(s??0n),u.pure.u16(w.toChainId(r.chain)),u.pure.address(w.hex.encode(r.address.toUint8Array(),!0)),u.pure.u32(123)],typeArguments:[a]}),[O]=u.moveCall({target:`${d}::transfer_tokens_with_payload::transfer_tokens_with_payload`,arguments:[u.object(this.tokenBridgeObjectId),f],typeArguments:[a]});u.moveCall({target:`${o}::publish_message::publish_message`,arguments:[u.object(this.coreBridgeObjectId),m,O,u.object(fe)]}),yield this.createUnsignedTx(u,"AutomaticTokenBridge.transfer")}async*redeem(e,r){const{coreBridge:n,tokenBridge:i}=await this.getPackageIds(),{address:s,chain:c}=r.payload.token,a=await Ie(this.connection,this.tokenBridgeObjectId,s.toUniversalAddress().toUint8Array(),w.toChainId(c));if(!a)throw new Error("Unable to fetch token coinType");const o=new oe,[d]=o.moveCall({target:`${n}::vaa::parse_and_verify`,arguments:[o.object(this.coreBridgeObjectId),o.pure(b.uint8ArrayToBCS(w.serialize(r))),o.object(fe)]}),[u]=o.moveCall({target:`${i}::vaa::verify_only_once`,arguments:[o.object(this.tokenBridgeObjectId),d]}),[h]=o.moveCall({target:`${i}::complete_transfer_with_payload::authorize_transfer`,arguments:[o.object(this.tokenBridgeObjectId),u],typeArguments:[a]}),m=await this.getPackageId();o.moveCall({target:`${m}::redeem::complete_transfer`,arguments:[o.object(this.tokenBridgeRelayerObjectId),h],typeArguments:[a]}),yield this.createUnsignedTx(o,"AutomaticTokenBridge.redeem")}async getRelayerFee(e,r){const n=w.isNative(r)?b.SuiPlatform.nativeTokenId(this.network,this.chain):r,i=await this.getTokenInfo(n.toString());if(i===null)throw new Error("Unsupported token for relay");const s=await this.getFields(),c=await this.connection.getDynamicFieldObject({parentId:this.tokenBridgeRelayerObjectId,name:{type:"vector<u8>",value:Array.from(w.bytes.encode("relayer_fees"))}});if(!c.data||!c.data.content)throw c.error?new Error("Failed to get relayer fees: "+JSON.stringify(c.error)):new Error("Unable to compute relayer fee");const{content:a}=c.data;if(!b.isMoveStructStruct(a)||!b.isMoveStructId(a.fields.id))throw new Error("Unable to compute relayer fee");const o=await this.connection.getDynamicFieldObject({parentId:a.fields.id.id,name:{type:"u16",value:w.toChainId(e)}});if(!o.data||!o.data.content)throw o.error?new Error("Failed to get relayer fees: "+JSON.stringify(c.error)):new Error("Unable to compute relayer fee");const{content:d}=o.data;if(!b.isMoveStructStruct(d))throw new Error("Unable to compute relayer fee");const u=await b.SuiPlatform.getDecimals(this.chain,this.connection,r.toString()),h=i.swap_rate,m=s.relayer_fee_precision,y=s.swap_rate_precision,S=d.fields.value;return 10n**BigInt(u)*BigInt(S)*BigInt(y)/(BigInt(h)*BigInt(m))}async maxSwapAmount(e){var o,d;const n=(w.isNative(e)?b.SuiPlatform.nativeTokenId(this.network,this.chain):e).toString(),i=await this.connection.getCoinMetadata({coinType:n});if(!i)throw new Error("metadata is null");const s=await this.getPackageId(),c=new oe;c.moveCall({target:`${s}::redeem::calculate_max_swap_amount_in`,arguments:[c.object(this.tokenBridgeRelayerObjectId),c.pure(i.decimals)],typeArguments:[n]});const a=await this.connection.devInspectTransactionBlock({transactionBlock:c,sender:w.hex.encode(new Uint8Array(32))});if(!a.results||a.results.length==0||!((o=a.results[0])!=null&&o.returnValues)||((d=a.results[0])==null?void 0:d.returnValues.length)!==1)throw Error("swap rate not set");return w.bignum.decode(new Uint8Array(a.results[0].returnValues[0][0].toReversed()))}async nativeTokenAmount(e,r){var d,u;const i=(w.isNative(e)?b.SuiPlatform.nativeTokenId(this.network,this.chain):e).toString(),s=await this.connection.getCoinMetadata({coinType:i});if(!s)throw new Error("metadata is null");const c=await this.getPackageId(),a=new oe;a.moveCall({target:`${c}::redeem::calculate_native_swap_amount_out`,arguments:[a.object(this.tokenBridgeRelayerObjectId),a.pure(r),a.pure(s.decimals)],typeArguments:[i]});const o=await this.connection.devInspectTransactionBlock({transactionBlock:a,sender:w.hex.encode(new Uint8Array(32))});if(!o.results||o.results.length==0||!((d=o.results[0])!=null&&d.returnValues)||((u=o.results[0])==null?void 0:u.returnValues.length)!==1)throw Error("swap rate not set");return w.bignum.decode(new Uint8Array(o.results[0].returnValues[0][0].toReversed()))}async getRegisteredTokens(){const r=(await this.getFields()).registered_tokens.fields.id.id;return(await this.connection.getDynamicFields({parentId:r})).data.map(s=>{const{address:c,module:a,name:o}=fr(s.objectType).typeParams[0];return new w.SuiAddress([c,a,o].join(w.SUI_SEPARATOR))})}async isRegisteredToken(e){const r=new w.SuiAddress(w.isNative(e)?b.SuiPlatform.nativeTokenId(this.network,this.chain).address:e).unwrap();try{return await this.getTokenInfo(r)!==null}catch(n){console.error(n)}return!1}async getTokenInfo(e){var o;const r=await this.getFields(),i=new w.SuiAddress(r.registered_tokens.type).getPackageId(),s=r.registered_tokens.fields.id.id,c=new w.SuiAddress(e),a=b.isSameType(w.SUI_COIN,c.unwrap())?w.SUI_COIN:c.getCoinType();try{const d=await this.connection.getDynamicFieldObject({parentId:s,name:{type:`${i}::registered_tokens::Key<${a}>`,value:{dummy_field:!1}}});if(d.error)throw new Error("Failed to get token info: "+JSON.stringify(d.error));if(!d.data||!d.data.content)throw new Error("Failed to get token info: "+JSON.stringify(d));const{content:u}=d.data;return b.isMoveStructStruct(u)&&b.isMoveStructStruct(u.fields.value)?u.fields.value.fields:null}catch(d){if((d==null?void 0:d.code)===-32e3&&((o=d.message)!=null&&o.includes("RPC Error")))return console.error(d),null;throw d}}async getFields(){if(!this.fields){const e=await b.getObjectFields(this.connection,this.tokenBridgeRelayerObjectId);if(e===null)throw new Error("Failed to get fields from token bridge relayer state");this.fields=e}return this.fields}async getPackageId(){const e=await this.getFields();return new w.SuiAddress(e.registered_tokens.type).getPackageId()}async getPackageIds(){const[e,r]=await Promise.all([b.getPackageId(this.connection,this.coreBridgeObjectId),b.getPackageId(this.connection,this.tokenBridgeObjectId)]);return{coreBridge:e,tokenBridge:r}}createUnsignedTx(e,r,n=!1){return new Ht.SuiUnsignedTransaction(e,this.network,this.chain,r,n)}}w.registerProtocol("Sui","TokenBridge",qe);w.registerProtocol("Sui","AutomaticTokenBridge",He);exports.SuiAutomaticTokenBridge=He;exports.SuiTokenBridge=qe;exports.getTokenCoinType=Ie;exports.getTokenFromTokenRegistry=dt;
@@ -1,9 +1,9 @@
1
1
  var Q = Object.defineProperty;
2
2
  var X = (O, e, t) => e in O ? Q(O, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : O[e] = t;
3
3
  var d = (O, e, t) => X(O, typeof e != "symbol" ? e + "" : e, t);
4
- import { A as C, S as g, a as Y } from "./index-DVYpLXjZ.mjs";
5
- import { c_ as Z, ad as S, ag as $, c$ as F, aH as I, d0 as _, d1 as q, bC as tt, ce as b, b_ as et, p as H, c3 as K, d2 as y, d3 as u, d4 as k, d5 as U, bD as D, d6 as z, d7 as st, d8 as V, d9 as ot, bI as nt, aE as rt } from "./index-CjqSmvJv.mjs";
6
- import { A as at } from "./algorand-DsJKeIr5.mjs";
4
+ import { A as C, S as g, a as Y } from "./index-DayCZrK8.mjs";
5
+ import { c$ as Z, ad as S, ag as $, d0 as F, aH as I, d1 as v, d2 as q, bC as tt, ce as b, b_ as et, p as H, c3 as K, d3 as y, d4 as u, d5 as k, d6 as U, bD as D, d7 as z, d8 as st, d9 as V, da as ot, bI as nt, aE as rt } from "./index-BpgHIKBe.mjs";
6
+ import { A as at } from "./algorand-CnhJd_dq.mjs";
7
7
  const G = Z.fromSignature("portal_transfer(byte[])byte[]"), c = class c {
8
8
  constructor(e, t, n, o) {
9
9
  d(this, "network");
@@ -35,12 +35,12 @@ const G = Z.fromSignature("portal_transfer(byte[])byte[]"), c = class c {
35
35
  const t = new I(e).toInt();
36
36
  if (t === 0)
37
37
  return !1;
38
- const n = await this.connection.getAssetByID(t).do(), r = _.from_obj_for_encoding(n).params.creator, a = await this.connection.accountInformation(r).exclude("all").do(), s = q.from_obj_for_encoding(a);
38
+ const n = await this.connection.getAssetByID(t).do(), r = v.from_obj_for_encoding(n).params.creator, a = await this.connection.accountInformation(r).exclude("all").do(), s = q.from_obj_for_encoding(a);
39
39
  return (s == null ? void 0 : s.authAddr) === this.tokenBridgeAddress;
40
40
  }
41
41
  // Returns the original asset with its foreign chain
42
42
  async getOriginalAsset(e) {
43
- const t = new I(e).toInt(), n = await this.connection.getAssetByID(t).do(), o = _.from_obj_for_encoding(n), r = await g.decodeLocalState(this.connection, this.tokenBridgeAppId, o.params.creator);
43
+ const t = new I(e).toInt(), n = await this.connection.getAssetByID(t).do(), o = v.from_obj_for_encoding(n), r = await g.decodeLocalState(this.connection, this.tokenBridgeAppId, o.params.creator);
44
44
  if (r.length < 94)
45
45
  throw new Error("Invalid local state data");
46
46
  const a = r.slice(92, 94), s = tt(b.decode(a)), p = new et(r.slice(60, 92));
@@ -94,7 +94,7 @@ const G = Z.fromSignature("portal_transfer(byte[])byte[]"), c = class c {
94
94
  r.push(...w);
95
95
  let f = "", i;
96
96
  if (o !== 0) {
97
- const l = await this.connection.getAssetByID(o).do(), j = _.from_obj_for_encoding(l), E = await this.connection.accountInformation(j.params.creator).do();
97
+ const l = await this.connection.getAssetByID(o).do(), j = v.from_obj_for_encoding(l), E = await this.connection.accountInformation(j.params.creator).do();
98
98
  if (i = q.from_obj_for_encoding(E), i.authAddr === this.tokenBridgeAddress.toString())
99
99
  throw new Error("Cannot re-attest wormhole assets");
100
100
  }
@@ -191,7 +191,7 @@ const G = Z.fromSignature("portal_transfer(byte[])byte[]"), c = class c {
191
191
  let h = "", l, j = !1;
192
192
  if (s !== 0) {
193
193
  const x = await this.connection.getAssetByID(s).do();
194
- h = _.from_obj_for_encoding(x).params.creator;
194
+ h = v.from_obj_for_encoding(x).params.creator;
195
195
  const R = await this.connection.accountInformation(h).do();
196
196
  l = q.from_obj_for_encoding(R), j = l.authAddr === this.tokenBridgeAddress.toString();
197
197
  }
@@ -233,7 +233,7 @@ const G = Z.fromSignature("portal_transfer(byte[])byte[]"), c = class c {
233
233
  suggestedParams: i
234
234
  });
235
235
  m.push({ tx: J });
236
- let v = [];
236
+ let _ = [];
237
237
  if (s === 0) {
238
238
  const x = U({
239
239
  from: a,
@@ -241,7 +241,7 @@ const G = Z.fromSignature("portal_transfer(byte[])byte[]"), c = class c {
241
241
  amount: p,
242
242
  suggestedParams: i
243
243
  });
244
- m.push({ tx: x }), v = [A, h, h];
244
+ m.push({ tx: x }), _ = [A, h, h];
245
245
  } else {
246
246
  const x = V({
247
247
  from: a,
@@ -250,7 +250,7 @@ const G = Z.fromSignature("portal_transfer(byte[])byte[]"), c = class c {
250
250
  assetIndex: s,
251
251
  suggestedParams: i
252
252
  });
253
- m.push({ tx: x }), v = l != null && l.address ? [A, h, l.address] : [A, h];
253
+ m.push({ tx: x }), _ = l != null && l.address ? [A, h, l.address] : [A, h];
254
254
  }
255
255
  const M = [
256
256
  c.sendTransfer,
@@ -268,7 +268,7 @@ const G = Z.fromSignature("portal_transfer(byte[])byte[]"), c = class c {
268
268
  appArgs: M,
269
269
  foreignApps: [u(this.coreAppId)],
270
270
  foreignAssets: [s],
271
- accounts: v,
271
+ accounts: _,
272
272
  suggestedParams: i
273
273
  });
274
274
  P.fee *= 2, m.push({ tx: P });