@tempoxyz/id 0.0.0-pr-293.sha-db2bcd0 → 0.0.0-pr-293.sha-e314a6e

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 (377) hide show
  1. package/dist/app/client/assets/Account-BYLpNFf3.css +1 -0
  2. package/dist/app/client/assets/Account-DKlYpUaF.js +1 -0
  3. package/dist/app/client/assets/Amount-ZdtluGf-.css +1 -0
  4. package/dist/app/client/assets/Amount-uCaXmEC1.js +1 -0
  5. package/dist/app/client/assets/{Approval-lMS61Hor.js → Approval-_VTK0bIA.js} +1 -1
  6. package/dist/app/client/assets/{Authentication-CNU_hdsE.js → Authentication-CcZraW4V.js} +1 -1
  7. package/dist/app/client/assets/Callout-Cpp2tekO.js +1 -0
  8. package/dist/app/client/assets/Callout-DBfEmP7q.css +1 -0
  9. package/dist/app/client/assets/{Chain-CgM0gkul.js → Chain-BaJbQHEq.js} +1 -1
  10. package/dist/app/client/assets/{Check-l6Xt-h8M.js → Check-T-Kf-w2J.js} +1 -1
  11. package/dist/app/client/assets/{ChevronRight-Dgx1CBfS.js → ChevronRight-Cb0izsfB.js} +1 -1
  12. package/dist/app/client/assets/{ChooseAccount-DKQvWYym.js → ChooseAccount-BbdtokuQ.js} +1 -1
  13. package/dist/app/client/assets/{Client-B3HiaUR7.js → Client-XdlKOIjT.js} +1 -1
  14. package/dist/app/client/assets/{Close-CHeDbDyp.js → Close-9qiwSZoT.js} +1 -1
  15. package/dist/app/client/assets/{Cloud-BnBzwFJQ.js → Cloud-yU0Kxv28.js} +1 -1
  16. package/dist/app/client/assets/CodeInput-BqRteSwD.css +1 -0
  17. package/dist/app/client/assets/CodeInput-C8ad0edh.js +1 -0
  18. package/dist/app/client/assets/Deposit-CclrAoXL.css +1 -0
  19. package/dist/app/client/assets/Deposit-b5yx-L71.js +1 -0
  20. package/dist/app/client/assets/DevTools-BYkmtuV5.css +1 -0
  21. package/dist/app/client/assets/DevTools-Cgd0Ogan.js +1 -0
  22. package/dist/app/client/assets/{DeviceApproval-DKQklicf.js → DeviceApproval-CGdmL9U5.js} +1 -1
  23. package/dist/app/client/assets/{Fingerprint-CVLZp0fE.js → Fingerprint-081gQp_i.js} +1 -1
  24. package/dist/app/client/assets/{Globe-RAkdkLVn.js → Globe-D4HEnXoi.js} +1 -1
  25. package/dist/app/client/assets/Grant-5a-n1gJH.css +1 -0
  26. package/dist/app/client/assets/Grant-C-7ibHJb.js +1 -0
  27. package/dist/app/client/assets/Hex-C9KeV7_9.css +1 -0
  28. package/dist/app/client/assets/Hex-COpLAksw.js +10 -0
  29. package/dist/app/client/assets/IconChip-Cr71cqFZ.js +1 -0
  30. package/dist/app/client/assets/IconChip-yqaQ2y_d.css +1 -0
  31. package/dist/app/client/assets/InputGroup-BMExR1w7.js +1 -0
  32. package/dist/app/client/assets/InputGroup-BlZvt9In.css +1 -0
  33. package/dist/app/client/assets/Inter-cyrillic-e3OmmzmJ.woff2 +0 -0
  34. package/dist/app/client/assets/Inter-cyrillic-ext-DOWZeO4Q.woff2 +0 -0
  35. package/dist/app/client/assets/Inter-greek-BD3ujQlX.woff2 +0 -0
  36. package/dist/app/client/assets/Inter-greek-ext-CXEwbus4.woff2 +0 -0
  37. package/dist/app/client/assets/Inter-latin-BDFm4vTb.woff2 +0 -0
  38. package/dist/app/client/assets/Inter-latin-ext-E7a9JEPe.woff2 +0 -0
  39. package/dist/app/client/assets/Inter-symbols-DEch7Rxr.woff2 +0 -0
  40. package/dist/app/client/assets/Inter-vietnamese-Bg9723vR.woff2 +0 -0
  41. package/dist/app/client/assets/Loader-CVy-jQh9.js +1 -0
  42. package/dist/app/client/assets/{PopoverPopup-AaR182Lw.js → PopoverPopup-CQv00nl_.js} +1 -1
  43. package/dist/app/client/assets/Rows-CT3nC-Gp.js +1 -0
  44. package/dist/app/client/assets/Rows-DPGTUdA8.css +1 -0
  45. package/dist/app/client/assets/{Separator-C1NRk_mW.js → Separator-Doxz2kha.js} +1 -1
  46. package/dist/app/client/assets/SignIn-D2D3rbzT.js +1 -0
  47. package/dist/app/client/assets/SignIn-mlBTwUq4.css +1 -0
  48. package/dist/app/client/assets/Stack-D7Yt22Ed.css +1 -0
  49. package/dist/app/client/assets/Stack-qm24zmlV.js +1 -0
  50. package/dist/app/client/assets/ToolbarRootContext-Ctu7JTLk.js +1 -0
  51. package/dist/app/client/assets/Tooltip-arQraM0D.js +1 -0
  52. package/dist/app/client/assets/Tooltip-d3y9ESUJ.css +1 -0
  53. package/dist/app/client/assets/___-I98bns4o.css +1 -0
  54. package/dist/app/client/assets/___.flows-8Dmgeehd.js +5 -0
  55. package/dist/app/client/assets/{authorize-BQ1QbDZ8.js → authorize-DAtsqrNM.js} +1 -1
  56. package/dist/app/client/assets/{choose-account-Da0fLaYb.js → choose-account-DEFRgijo.js} +1 -1
  57. package/dist/app/client/assets/{deposit-CwKR_KjX.js → deposit--QiYWQfo.js} +1 -1
  58. package/dist/app/client/assets/{device-CCwq2oAs.js → device-Bq9xs5K6.js} +1 -1
  59. package/dist/app/client/assets/{error-Dj24A5n4.js → error-IQXxc1eM.js} +1 -1
  60. package/dist/app/client/assets/{getPseudoElementBounds-DH_jjqMh.js → getPseudoElementBounds-4olojy3W.js} +1 -1
  61. package/dist/app/client/assets/index-CyFheDuU.js +13 -0
  62. package/dist/app/client/assets/index-DSkPoKOK.css +1 -0
  63. package/dist/app/client/assets/{lazyRouteComponent-108fI1-o.js → lazyRouteComponent-Dz0rIGYN.js} +1 -1
  64. package/dist/app/client/assets/{login--cK4-SN_.js → login-B0BjHqjo.js} +1 -1
  65. package/dist/app/client/assets/pathUSD-BMh6ajrW.css +1 -0
  66. package/dist/app/client/assets/pathUSD-DuAfAKZZ.js +1 -0
  67. package/dist/app/client/assets/{removable-CZFK4Sbw.js → removable-CbJQgeuY.js} +1 -1
  68. package/dist/app/client/assets/{routes-BEKA6M9o.js → routes-BkBTe_Iu.js} +1 -1
  69. package/dist/app/client/assets/{suspense-ClIj0Mjn.js → suspense-Djz3yPi6.js} +1 -1
  70. package/dist/app/client/assets/useNavigate-B3GfD6JV.js +1 -0
  71. package/dist/app/client/assets/{useRegisterFieldControl-r_mKBm9D.js → useRegisterFieldControl-C8uwO_R4.js} +1 -1
  72. package/dist/app/client/assets/zyzz-DYC-X0_B.css +1 -0
  73. package/dist/app/client/assets/zyzz.config-DJRBo25J.js +2 -0
  74. package/dist/app/server/.vite/manifest.json +640 -608
  75. package/dist/app/server/assets/Account-BYLpNFf3.css +1 -0
  76. package/dist/app/server/assets/Account-g1_Uaj86.js +2 -0
  77. package/dist/app/server/assets/Account-g1_Uaj86.js.map +1 -0
  78. package/dist/app/server/assets/Amount-BXSuv2fx.js +2 -0
  79. package/dist/app/server/assets/Amount-BXSuv2fx.js.map +1 -0
  80. package/dist/app/server/assets/Amount-ZdtluGf-.css +1 -0
  81. package/dist/app/server/assets/{Approval-DhLkTvkI.js → Approval-DA8fDZIl.js} +2 -2
  82. package/dist/app/server/assets/{Approval-DhLkTvkI.js.map → Approval-DA8fDZIl.js.map} +1 -1
  83. package/dist/app/server/assets/{Authentication-Odm8-gfs.js → Authentication-BJgy8lyC.js} +2 -2
  84. package/dist/app/server/assets/{Authentication-Odm8-gfs.js.map → Authentication-BJgy8lyC.js.map} +1 -1
  85. package/dist/app/server/assets/{Authentication-DLWMd2mA.js → Authentication-CsSh3HGu.js} +2 -2
  86. package/dist/app/server/assets/{Authentication-DLWMd2mA.js.map → Authentication-CsSh3HGu.js.map} +1 -1
  87. package/dist/app/server/assets/Callout-DBfEmP7q.css +1 -0
  88. package/dist/app/server/assets/Callout-DlcQ5BUo.js +2 -0
  89. package/dist/app/server/assets/Callout-DlcQ5BUo.js.map +1 -0
  90. package/dist/app/server/assets/{Chain-CQgBRAXx.js → Chain-C9RGZDJm.js} +2 -2
  91. package/dist/app/server/assets/{Chain-CQgBRAXx.js.map → Chain-C9RGZDJm.js.map} +1 -1
  92. package/dist/app/server/assets/{Check-BwwQ6kDn.js → Check-CQIa-Y5d.js} +2 -2
  93. package/dist/app/server/assets/{Check-BwwQ6kDn.js.map → Check-CQIa-Y5d.js.map} +1 -1
  94. package/dist/app/server/assets/{ChevronRight-B_ft-uyS.js → ChevronRight-wzF9Mh2e.js} +2 -2
  95. package/dist/app/server/assets/{ChevronRight-B_ft-uyS.js.map → ChevronRight-wzF9Mh2e.js.map} +1 -1
  96. package/dist/app/server/assets/{ChooseAccount-FJJ2kRPk.js → ChooseAccount-De_YweJM.js} +2 -2
  97. package/dist/app/server/assets/{ChooseAccount-FJJ2kRPk.js.map → ChooseAccount-De_YweJM.js.map} +1 -1
  98. package/dist/app/server/assets/{Client-D3gnMDTr.js → Client-BAXSFa9e.js} +2 -2
  99. package/dist/app/server/assets/{Client-D3gnMDTr.js.map → Client-BAXSFa9e.js.map} +1 -1
  100. package/dist/app/server/assets/{ClientOnly-CbQVNHub.js → ClientOnly-B8k5xDwz.js} +2 -2
  101. package/dist/app/server/assets/{ClientOnly-CbQVNHub.js.map → ClientOnly-B8k5xDwz.js.map} +1 -1
  102. package/dist/app/server/assets/{Close-ChRMz-uR.js → Close-C74hwnOn.js} +2 -2
  103. package/dist/app/server/assets/{Close-ChRMz-uR.js.map → Close-C74hwnOn.js.map} +1 -1
  104. package/dist/app/server/assets/{Cloud-C3_mtq_Y.js → Cloud-CYXeneSe.js} +2 -2
  105. package/dist/app/server/assets/{Cloud-C3_mtq_Y.js.map → Cloud-CYXeneSe.js.map} +1 -1
  106. package/dist/app/server/assets/CodeInput-BqRteSwD.css +1 -0
  107. package/dist/app/server/assets/CodeInput-DdkMKOyq.js +2 -0
  108. package/dist/app/server/assets/CodeInput-DdkMKOyq.js.map +1 -0
  109. package/dist/app/server/assets/{Credential-D82PNwyx.js → Credential-DXcfPJEP.js} +2 -2
  110. package/dist/app/server/assets/{Credential-D82PNwyx.js.map → Credential-DXcfPJEP.js.map} +1 -1
  111. package/dist/app/server/assets/Deposit-CclrAoXL.css +1 -0
  112. package/dist/app/server/assets/Deposit-DOp5HCDX.js +2 -0
  113. package/dist/app/server/assets/Deposit-DOp5HCDX.js.map +1 -0
  114. package/dist/app/server/assets/DevTools-BYkmtuV5.css +1 -0
  115. package/dist/app/server/assets/DevTools-CxdPUN3V.js +2 -0
  116. package/dist/app/server/assets/DevTools-CxdPUN3V.js.map +1 -0
  117. package/dist/app/server/assets/{DeviceApproval-BhWgrv9l.js → DeviceApproval-o7T8XlX3.js} +2 -2
  118. package/dist/app/server/assets/{DeviceApproval-BhWgrv9l.js.map → DeviceApproval-o7T8XlX3.js.map} +1 -1
  119. package/dist/app/server/assets/{ExecutionError-DSSCSoHl.js → ExecutionError-DoRNvh3D.js} +2 -2
  120. package/dist/app/server/assets/{ExecutionError-DSSCSoHl.js.map → ExecutionError-DoRNvh3D.js.map} +1 -1
  121. package/dist/app/server/assets/{Faucet-Cv-nQMBR.js → Faucet-jp6zNWHE.js} +2 -2
  122. package/dist/app/server/assets/{Faucet-Cv-nQMBR.js.map → Faucet-jp6zNWHE.js.map} +1 -1
  123. package/dist/app/server/assets/{Fingerprint-B0Iay4Ws.js → Fingerprint-CAqjOS3T.js} +2 -2
  124. package/dist/app/server/assets/{Fingerprint-B0Iay4Ws.js.map → Fingerprint-CAqjOS3T.js.map} +1 -1
  125. package/dist/app/server/assets/{Globe-C6rnzTY0.js → Globe-BZ_5dGqa.js} +2 -2
  126. package/dist/app/server/assets/{Globe-C6rnzTY0.js.map → Globe-BZ_5dGqa.js.map} +1 -1
  127. package/dist/app/server/assets/Grant-5a-n1gJH.css +1 -0
  128. package/dist/app/{client/assets/Grant-DurkleN7.js → server/assets/Grant-BwOC2P94.js} +2 -1
  129. package/dist/app/server/assets/Grant-BwOC2P94.js.map +1 -0
  130. package/dist/app/server/assets/Hex-67thYs-f.js +11 -0
  131. package/dist/app/server/assets/Hex-67thYs-f.js.map +1 -0
  132. package/dist/app/server/assets/Hex-C9KeV7_9.css +1 -0
  133. package/dist/app/server/assets/IconChip-Cmufss8d.js +2 -0
  134. package/dist/app/server/assets/IconChip-Cmufss8d.js.map +1 -0
  135. package/dist/app/server/assets/IconChip-yqaQ2y_d.css +1 -0
  136. package/dist/app/server/assets/InputGroup-BlZvt9In.css +1 -0
  137. package/dist/app/server/assets/InputGroup-Bn2KM9pd.js +2 -0
  138. package/dist/app/server/assets/InputGroup-Bn2KM9pd.js.map +1 -0
  139. package/dist/app/server/assets/Inter-cyrillic-e3OmmzmJ.woff2 +0 -0
  140. package/dist/app/server/assets/Inter-cyrillic-ext-DOWZeO4Q.woff2 +0 -0
  141. package/dist/app/server/assets/Inter-greek-BD3ujQlX.woff2 +0 -0
  142. package/dist/app/server/assets/Inter-greek-ext-CXEwbus4.woff2 +0 -0
  143. package/dist/app/server/assets/Inter-latin-BDFm4vTb.woff2 +0 -0
  144. package/dist/app/server/assets/Inter-latin-ext-E7a9JEPe.woff2 +0 -0
  145. package/dist/app/server/assets/Inter-symbols-DEch7Rxr.woff2 +0 -0
  146. package/dist/app/server/assets/Inter-vietnamese-Bg9723vR.woff2 +0 -0
  147. package/dist/app/server/assets/Loader-DvDbd8kj.js +2 -0
  148. package/dist/app/server/assets/{Loader-Ivf5dWFl.js.map → Loader-DvDbd8kj.js.map} +1 -1
  149. package/dist/app/server/assets/{Match-DusFDz9D.js → Match-C65vhhhD.js} +2 -2
  150. package/dist/app/server/assets/{Match-DusFDz9D.js.map → Match-C65vhhhD.js.map} +1 -1
  151. package/dist/app/server/assets/PopoverPopup-kuWGUSYM.js +2 -0
  152. package/dist/app/server/assets/{PopoverPopup-D98JOZVe.js.map → PopoverPopup-kuWGUSYM.js.map} +1 -1
  153. package/dist/app/server/assets/Rows-DPGTUdA8.css +1 -0
  154. package/dist/app/server/assets/Rows-eTPur_py.js +2 -0
  155. package/dist/app/server/assets/Rows-eTPur_py.js.map +1 -0
  156. package/dist/app/server/assets/{Separator-B6od-9JY.js → Separator-BPNenixO.js} +2 -2
  157. package/dist/app/server/assets/{Separator-B6od-9JY.js.map → Separator-BPNenixO.js.map} +1 -1
  158. package/dist/app/server/assets/SignIn-CVPZSR-8.js +2 -0
  159. package/dist/app/server/assets/SignIn-CVPZSR-8.js.map +1 -0
  160. package/dist/app/server/assets/SignIn-mlBTwUq4.css +1 -0
  161. package/dist/app/server/assets/Stack-D7Yt22Ed.css +1 -0
  162. package/dist/app/server/assets/Stack-DQMZBUUB.js +2 -0
  163. package/dist/app/server/assets/Stack-DQMZBUUB.js.map +1 -0
  164. package/dist/app/server/assets/ToolbarRootContext-5168W3t4.js +2 -0
  165. package/dist/app/server/assets/{ToolbarRootContext-BCmWBQ7n.js.map → ToolbarRootContext-5168W3t4.js.map} +1 -1
  166. package/dist/app/server/assets/Tooltip-DR3nssae.js +2 -0
  167. package/dist/app/server/assets/Tooltip-DR3nssae.js.map +1 -0
  168. package/dist/app/server/assets/Tooltip-d3y9ESUJ.css +1 -0
  169. package/dist/app/server/assets/___-I98bns4o.css +1 -0
  170. package/dist/app/server/assets/___.flows-D_J822MU.js +6 -0
  171. package/dist/app/server/assets/___.flows-D_J822MU.js.map +1 -0
  172. package/dist/app/server/assets/_tanstack-start-manifest_v-DQjMcFpU.js +1 -0
  173. package/dist/app/server/assets/{_zyzz__2Fhome_2Frunner_2Fwork_2Fid_2Fid_2Fsrc_2Fapp_2Froutes_2F_5B__5D.flows.tsx-Drf_Iqhc.js → _zyzz__2Fhome_2Frunner_2Fwork_2Fid_2Fid_2Fsrc_2Fapp_2Froutes_2F_5B__5D.flows.tsx-EmCsnNUQ.js} +2 -2
  174. package/dist/app/server/assets/{_zyzz__2Fhome_2Frunner_2Fwork_2Fid_2Fid_2Fsrc_2Fapp_2Froutes_2F_5B__5D.flows.tsx-Drf_Iqhc.js.map → _zyzz__2Fhome_2Frunner_2Fwork_2Fid_2Fid_2Fsrc_2Fapp_2Froutes_2F_5B__5D.flows.tsx-EmCsnNUQ.js.map} +1 -1
  175. package/dist/app/server/assets/{accessKey-CxNqjouy.js → accessKey-DlBe71R7.js} +4 -4
  176. package/dist/app/server/assets/{accessKey-CxNqjouy.js.map → accessKey-DlBe71R7.js.map} +1 -1
  177. package/dist/app/server/assets/{authorize-D_5EG0WN.js → authorize-C3nY01zc.js} +2 -2
  178. package/dist/app/server/assets/{authorize-D_5EG0WN.js.map → authorize-C3nY01zc.js.map} +1 -1
  179. package/dist/app/server/assets/{authorize-pZETCSux.js → authorize-C9tfZ34z.js} +2 -2
  180. package/dist/app/server/assets/{authorize-pZETCSux.js.map → authorize-C9tfZ34z.js.map} +1 -1
  181. package/dist/app/server/assets/{authorize-DXYo-K2n-08rIhXFT.js → authorize-DXYo-K2n-Bc8o9t1x.js} +2 -2
  182. package/dist/app/server/assets/{authorize-DXYo-K2n-08rIhXFT.js.map → authorize-DXYo-K2n-Bc8o9t1x.js.map} +1 -1
  183. package/dist/app/server/assets/{choose-account-BOPrs9l7.js → choose-account-DNfcLweT.js} +2 -2
  184. package/dist/app/server/assets/{choose-account-BOPrs9l7.js.map → choose-account-DNfcLweT.js.map} +1 -1
  185. package/dist/app/server/assets/{choose-account-MDW4jp29.js → choose-account-Lq0qFqBr.js} +2 -2
  186. package/dist/app/server/assets/{choose-account-MDW4jp29.js.map → choose-account-Lq0qFqBr.js.map} +1 -1
  187. package/dist/app/server/assets/{core-Dxqe4Tzf.js → core-Ci_AVqAl.js} +2 -2
  188. package/dist/app/server/assets/{core-Dxqe4Tzf.js.map → core-Ci_AVqAl.js.map} +1 -1
  189. package/dist/app/server/assets/default-u_dwuiYb-D3URkhAV.js +2 -0
  190. package/dist/app/server/assets/{default-u_dwuiYb-BZX-cEte.js.map → default-u_dwuiYb-D3URkhAV.js.map} +1 -1
  191. package/dist/app/server/assets/{deposit-AgLrOoA3.js → deposit-Ch8VqCtG.js} +2 -2
  192. package/dist/app/server/assets/{deposit-AgLrOoA3.js.map → deposit-Ch8VqCtG.js.map} +1 -1
  193. package/dist/app/server/assets/{deposit-Cjt69KmJ.js → deposit-xQrouL3f.js} +2 -2
  194. package/dist/app/server/assets/{deposit-Cjt69KmJ.js.map → deposit-xQrouL3f.js.map} +1 -1
  195. package/dist/app/server/assets/{device-TEgIth9V.js → device-BAsgIC7D.js} +2 -2
  196. package/dist/app/server/assets/{device-TEgIth9V.js.map → device-BAsgIC7D.js.map} +1 -1
  197. package/dist/app/server/assets/{device-DO_RH0Or.js → device-BV99aHMG.js} +2 -2
  198. package/dist/app/server/assets/{device-DO_RH0Or.js.map → device-BV99aHMG.js.map} +1 -1
  199. package/dist/app/server/assets/dist-BhIyCFP8.js +1 -0
  200. package/dist/app/server/assets/{dist-C9wLcfH8.js → dist-C-Rzwa6V.js} +2 -2
  201. package/dist/app/server/assets/{dist-C9wLcfH8.js.map → dist-C-Rzwa6V.js.map} +1 -1
  202. package/dist/app/server/assets/{dist-SBl0rlY-.js → dist-CJN10pUl.js} +2 -2
  203. package/dist/app/server/assets/{dist-SBl0rlY-.js.map → dist-CJN10pUl.js.map} +1 -1
  204. package/dist/app/server/assets/{effect-QlVUlMFu-aB2jdYth.js → effect-QlVUlMFu-svPBY1dH.js} +2 -2
  205. package/dist/app/server/assets/{effect-QlVUlMFu-aB2jdYth.js.map → effect-QlVUlMFu-svPBY1dH.js.map} +1 -1
  206. package/dist/app/server/assets/{error-BDVg4EUJ.js → error-CHeOE_lh.js} +2 -2
  207. package/dist/app/server/assets/{error-BDVg4EUJ.js.map → error-CHeOE_lh.js.map} +1 -1
  208. package/dist/app/server/assets/{error-Yg6jqry-.js → error-PecJkSHO.js} +2 -2
  209. package/dist/app/server/assets/{error-Yg6jqry-.js.map → error-PecJkSHO.js.map} +1 -1
  210. package/dist/app/server/assets/{factory-BPswjDEW.js → factory-Bs0vLkBr.js} +2 -2
  211. package/dist/app/server/assets/{factory-BPswjDEW.js.map → factory-Bs0vLkBr.js.map} +1 -1
  212. package/dist/app/server/assets/getPseudoElementBounds-DIn3v91B.js +2 -0
  213. package/dist/app/server/assets/{getPseudoElementBounds-BdqJhx6M.js.map → getPseudoElementBounds-DIn3v91B.js.map} +1 -1
  214. package/dist/app/server/assets/{index-CLddUTqr-Bavq3Qss.js → index-CLddUTqr-CmUyZRXY.js} +2 -2
  215. package/dist/app/server/assets/{index-CLddUTqr-Bavq3Qss.js.map → index-CLddUTqr-CmUyZRXY.js.map} +1 -1
  216. package/dist/app/server/assets/{index-DZEfthgZ--TkOBRwP.js → index-DZEfthgZ-Bkf7F_aP.js} +2 -2
  217. package/dist/app/server/assets/{index-DZEfthgZ--TkOBRwP.js.map → index-DZEfthgZ-Bkf7F_aP.js.map} +1 -1
  218. package/dist/app/server/assets/{kysely-adapter-BVql8na5.js → kysely-adapter-DhztbDJz.js} +1 -1
  219. package/dist/app/server/assets/{lazyRouteComponent-BXabRVTE.js → lazyRouteComponent-DOSE663E.js} +2 -2
  220. package/dist/app/server/assets/{lazyRouteComponent-BXabRVTE.js.map → lazyRouteComponent-DOSE663E.js.map} +1 -1
  221. package/dist/app/server/assets/{login-BR3Vh4Jw.js → login-6K4ND-gN.js} +2 -2
  222. package/dist/app/server/assets/{login-BR3Vh4Jw.js.map → login-6K4ND-gN.js.map} +1 -1
  223. package/dist/app/server/assets/{login-DtRzF4FQ.js → login-CGq85v-9.js} +2 -2
  224. package/dist/app/server/assets/{login-DtRzF4FQ.js.map → login-CGq85v-9.js.map} +1 -1
  225. package/dist/app/server/assets/{matchContext-Cuq8aYzA.js → matchContext-BHbopc_c.js} +2 -2
  226. package/dist/app/server/assets/{matchContext-Cuq8aYzA.js.map → matchContext-BHbopc_c.js.map} +1 -1
  227. package/dist/app/server/assets/{mutation-BseSOMT8.js → mutation-D0MCZKRo.js} +2 -2
  228. package/dist/app/server/assets/{mutation-BseSOMT8.js.map → mutation-D0MCZKRo.js.map} +1 -1
  229. package/dist/app/server/assets/pathUSD-BMh6ajrW.css +1 -0
  230. package/dist/app/server/assets/pathUSD-DqRWfB70.js +2 -0
  231. package/dist/app/server/assets/pathUSD-DqRWfB70.js.map +1 -0
  232. package/dist/app/server/assets/{query-lzX3sTGO.js → query-BfAOtP6H.js} +2 -2
  233. package/dist/app/server/assets/{query-lzX3sTGO.js.map → query-BfAOtP6H.js.map} +1 -1
  234. package/dist/app/server/assets/react-dom-BbDIEd_j.css +1 -0
  235. package/dist/app/server/assets/{react-dom-DtwtyQPy.js → react-dom-pSpaua7D.js} +1 -1
  236. package/dist/app/server/assets/{react-dom-DtwtyQPy.js.map → react-dom-pSpaua7D.js.map} +1 -1
  237. package/dist/app/server/assets/{removable-HVB1MGzn.js → removable-BIS_RRBc.js} +2 -2
  238. package/dist/app/server/assets/{removable-HVB1MGzn.js.map → removable-BIS_RRBc.js.map} +1 -1
  239. package/dist/app/server/assets/{resolveError-DSqzEjUE.js → resolveError-DPXmbkOB.js} +2 -2
  240. package/dist/app/server/assets/{resolveError-DSqzEjUE.js.map → resolveError-DPXmbkOB.js.map} +1 -1
  241. package/dist/app/server/assets/{router-uhTdTHZE.js → router-nrTsbXpb.js} +2 -2
  242. package/dist/app/server/assets/router-nrTsbXpb.js.map +1 -0
  243. package/dist/app/server/assets/routes-BgiIzrOt.css +1 -0
  244. package/dist/app/server/assets/{routes-CeDOMpI-.js → routes-ClVSwEtU.js} +2 -2
  245. package/dist/app/server/assets/{routes-CeDOMpI-.js.map → routes-ClVSwEtU.js.map} +1 -1
  246. package/dist/app/server/assets/routes-DM3C9lXZ.js +2 -0
  247. package/dist/app/server/assets/routes-DM3C9lXZ.js.map +1 -0
  248. package/dist/app/server/assets/{schemas-fV27l6kI.js → schemas-CFw4XgfH.js} +2 -2
  249. package/dist/app/server/assets/{schemas-fV27l6kI.js.map → schemas-CFw4XgfH.js.map} +1 -1
  250. package/dist/app/server/assets/{secp256k1-5tp4GQIt.js → secp256k1-BmATpikU.js} +2 -2
  251. package/dist/app/server/assets/{secp256k1-5tp4GQIt.js.map → secp256k1-BmATpikU.js.map} +1 -1
  252. package/dist/app/server/assets/{sury-CWZTCd75-BPXRo6iz.js → sury-CWZTCd75-B2_9nmQ-.js} +2 -2
  253. package/dist/app/server/assets/{sury-CWZTCd75-BPXRo6iz.js.map → sury-CWZTCd75-B2_9nmQ-.js.map} +1 -1
  254. package/dist/app/server/assets/{suspense-CVCU9Kbi.js → suspense-gv0MCXZ8.js} +2 -2
  255. package/dist/app/server/assets/{suspense-CVCU9Kbi.js.map → suspense-gv0MCXZ8.js.map} +1 -1
  256. package/dist/app/server/assets/{useNavigate-D9psnozp.js → useNavigate-gn6-bYOz.js} +2 -2
  257. package/dist/app/server/assets/{useNavigate-D9psnozp.js.map → useNavigate-gn6-bYOz.js.map} +1 -1
  258. package/dist/app/server/assets/useRegisterFieldControl-DMeVvRtG.js +2 -0
  259. package/dist/app/server/assets/{useRegisterFieldControl-UOdCWAKS.js.map → useRegisterFieldControl-DMeVvRtG.js.map} +1 -1
  260. package/dist/app/server/assets/{utils-Dst7Jy9U.js → utils-CJnLBS6t.js} +2 -2
  261. package/dist/app/server/assets/{utils-Dst7Jy9U.js.map → utils-CJnLBS6t.js.map} +1 -1
  262. package/dist/app/server/assets/{valibot--1zFm7rT-LDsJca69.js → valibot--1zFm7rT-DAm9l6Yd.js} +2 -2
  263. package/dist/app/server/assets/{valibot--1zFm7rT-LDsJca69.js.map → valibot--1zFm7rT-DAm9l6Yd.js.map} +1 -1
  264. package/dist/app/server/assets/{valibot-D_HTw1Gn-DY-tIZ72.js → valibot-D_HTw1Gn-B_uu9X0a.js} +2 -2
  265. package/dist/app/server/assets/{valibot-D_HTw1Gn-DY-tIZ72.js.map → valibot-D_HTw1Gn-B_uu9X0a.js.map} +1 -1
  266. package/dist/app/server/assets/{zod-Bwrt9trS-Cf4c1iF8.js → zod-Bwrt9trS-DDq3sdx6.js} +2 -2
  267. package/dist/app/server/assets/{zod-Bwrt9trS-Cf4c1iF8.js.map → zod-Bwrt9trS-DDq3sdx6.js.map} +1 -1
  268. package/dist/app/server/assets/{zod-DSgpEGAE-IkLVlUaZ.js → zod-DSgpEGAE-Dzlub58Z.js} +2 -2
  269. package/dist/app/server/assets/{zod-DSgpEGAE-IkLVlUaZ.js.map → zod-DSgpEGAE-Dzlub58Z.js.map} +1 -1
  270. package/dist/app/server/assets/zyzz-6R2K52xP.css +1 -0
  271. package/dist/app/server/assets/{zyzz.config-DYq-16_0.js → zyzz.config-CW977vYL.js} +3 -3
  272. package/dist/app/server/assets/zyzz.config-CW977vYL.js.map +1 -0
  273. package/dist/app/server/index.js +3 -3
  274. package/package.json +1 -1
  275. package/dist/app/client/assets/Account-DiXbQ7gq.css +0 -1
  276. package/dist/app/client/assets/Account-JXT-dSA8.js +0 -1
  277. package/dist/app/client/assets/Amount-C5uw89Ge.js +0 -1
  278. package/dist/app/client/assets/Amount-Ck6sPRDT.css +0 -1
  279. package/dist/app/client/assets/Callout-DE0CvxbE.css +0 -1
  280. package/dist/app/client/assets/Callout-D_dLrptL.js +0 -1
  281. package/dist/app/client/assets/CodeInput-CXbj-o_B.js +0 -1
  282. package/dist/app/client/assets/CodeInput-C_clyqA2.css +0 -1
  283. package/dist/app/client/assets/Deposit-CAkrtNYZ.css +0 -1
  284. package/dist/app/client/assets/Deposit-Cv7IQBO0.js +0 -1
  285. package/dist/app/client/assets/DevTools-CnWAfvO2.js +0 -1
  286. package/dist/app/client/assets/DevTools-DLG9O0YT.css +0 -1
  287. package/dist/app/client/assets/Grant-B6bmC4rh.css +0 -1
  288. package/dist/app/client/assets/Hex-BR5nHbFT.js +0 -10
  289. package/dist/app/client/assets/Hex-CriDfcNg.css +0 -1
  290. package/dist/app/client/assets/IconChip-BVqRSUpG.css +0 -1
  291. package/dist/app/client/assets/IconChip-ClKbN-8M.js +0 -1
  292. package/dist/app/client/assets/InputGroup-4QFqa-T2.css +0 -1
  293. package/dist/app/client/assets/InputGroup-CEI6gBId.js +0 -1
  294. package/dist/app/client/assets/Inter-Variable-DiVDrmQJ.woff2 +0 -0
  295. package/dist/app/client/assets/Loader-CtzJeMeX.js +0 -1
  296. package/dist/app/client/assets/Rows-DgpXomcK.js +0 -1
  297. package/dist/app/client/assets/Rows-oSTffNii.css +0 -1
  298. package/dist/app/client/assets/SignIn-CjGB1wk9.js +0 -1
  299. package/dist/app/client/assets/SignIn-Dz1G9XNf.css +0 -1
  300. package/dist/app/client/assets/Stack-90EFgtQe.js +0 -1
  301. package/dist/app/client/assets/Stack-CKvHhjzW.css +0 -1
  302. package/dist/app/client/assets/ToolbarRootContext-dnisUzmP.js +0 -1
  303. package/dist/app/client/assets/Tooltip-9TI_rDvs.css +0 -1
  304. package/dist/app/client/assets/Tooltip-C3H_9mgz.js +0 -1
  305. package/dist/app/client/assets/___-7yUISk6H.css +0 -1
  306. package/dist/app/client/assets/___.flows-DwoJPGMf.js +0 -5
  307. package/dist/app/client/assets/index-BXTO-7dr.css +0 -1
  308. package/dist/app/client/assets/index-CkKM7xlX.js +0 -13
  309. package/dist/app/client/assets/pathUSD-DY3ycgMd.js +0 -1
  310. package/dist/app/client/assets/pathUSD-Dn2NadYx.css +0 -1
  311. package/dist/app/client/assets/useNavigate-DsbQ8bTr.js +0 -1
  312. package/dist/app/client/assets/zyzz-MTPfhrAv.css +0 -1
  313. package/dist/app/client/assets/zyzz.config-ENEfJGzk.js +0 -2
  314. package/dist/app/server/assets/Account-BqjoGTzm.js +0 -2
  315. package/dist/app/server/assets/Account-BqjoGTzm.js.map +0 -1
  316. package/dist/app/server/assets/Account-DiXbQ7gq.css +0 -1
  317. package/dist/app/server/assets/Amount-Ck6sPRDT.css +0 -1
  318. package/dist/app/server/assets/Amount-CmypanEu.js +0 -2
  319. package/dist/app/server/assets/Amount-CmypanEu.js.map +0 -1
  320. package/dist/app/server/assets/Callout-DE0CvxbE.css +0 -1
  321. package/dist/app/server/assets/Callout-_eafmkya.js +0 -2
  322. package/dist/app/server/assets/Callout-_eafmkya.js.map +0 -1
  323. package/dist/app/server/assets/CodeInput-CRxIP0KX.js +0 -2
  324. package/dist/app/server/assets/CodeInput-CRxIP0KX.js.map +0 -1
  325. package/dist/app/server/assets/CodeInput-C_clyqA2.css +0 -1
  326. package/dist/app/server/assets/Deposit-CAkrtNYZ.css +0 -1
  327. package/dist/app/server/assets/Deposit-CiWidviP.js +0 -2
  328. package/dist/app/server/assets/Deposit-CiWidviP.js.map +0 -1
  329. package/dist/app/server/assets/DevTools-BJcNvNjx.js +0 -2
  330. package/dist/app/server/assets/DevTools-BJcNvNjx.js.map +0 -1
  331. package/dist/app/server/assets/DevTools-DLG9O0YT.css +0 -1
  332. package/dist/app/server/assets/Grant-B6bmC4rh.css +0 -1
  333. package/dist/app/server/assets/Grant-N8RQy7lZ.js +0 -2
  334. package/dist/app/server/assets/Grant-N8RQy7lZ.js.map +0 -1
  335. package/dist/app/server/assets/Hex-CriDfcNg.css +0 -1
  336. package/dist/app/server/assets/Hex-vNjxlXvk.js +0 -11
  337. package/dist/app/server/assets/Hex-vNjxlXvk.js.map +0 -1
  338. package/dist/app/server/assets/IconChip-BQdjH8i6.js +0 -2
  339. package/dist/app/server/assets/IconChip-BQdjH8i6.js.map +0 -1
  340. package/dist/app/server/assets/IconChip-BVqRSUpG.css +0 -1
  341. package/dist/app/server/assets/InputGroup-4QFqa-T2.css +0 -1
  342. package/dist/app/server/assets/InputGroup-BhUIBTgI.js +0 -2
  343. package/dist/app/server/assets/InputGroup-BhUIBTgI.js.map +0 -1
  344. package/dist/app/server/assets/Inter-Variable-DiVDrmQJ.woff2 +0 -0
  345. package/dist/app/server/assets/Loader-Ivf5dWFl.js +0 -2
  346. package/dist/app/server/assets/PopoverPopup-D98JOZVe.js +0 -2
  347. package/dist/app/server/assets/Rows-BuyZXkPa.js +0 -2
  348. package/dist/app/server/assets/Rows-BuyZXkPa.js.map +0 -1
  349. package/dist/app/server/assets/Rows-oSTffNii.css +0 -1
  350. package/dist/app/server/assets/SignIn-D7jl6zbw.js +0 -2
  351. package/dist/app/server/assets/SignIn-D7jl6zbw.js.map +0 -1
  352. package/dist/app/server/assets/SignIn-Dz1G9XNf.css +0 -1
  353. package/dist/app/server/assets/Stack-C3ecM7vx.js +0 -2
  354. package/dist/app/server/assets/Stack-C3ecM7vx.js.map +0 -1
  355. package/dist/app/server/assets/Stack-CKvHhjzW.css +0 -1
  356. package/dist/app/server/assets/ToolbarRootContext-BCmWBQ7n.js +0 -2
  357. package/dist/app/server/assets/Tooltip-9TI_rDvs.css +0 -1
  358. package/dist/app/server/assets/Tooltip-D3NLigmC.js +0 -2
  359. package/dist/app/server/assets/Tooltip-D3NLigmC.js.map +0 -1
  360. package/dist/app/server/assets/___-7yUISk6H.css +0 -1
  361. package/dist/app/server/assets/___.flows-DRvHKxBR.js +0 -6
  362. package/dist/app/server/assets/___.flows-DRvHKxBR.js.map +0 -1
  363. package/dist/app/server/assets/_tanstack-start-manifest_v-BIobT_5u.js +0 -1
  364. package/dist/app/server/assets/default-u_dwuiYb-BZX-cEte.js +0 -2
  365. package/dist/app/server/assets/dist-k0uWU-Rh.js +0 -1
  366. package/dist/app/server/assets/getPseudoElementBounds-BdqJhx6M.js +0 -2
  367. package/dist/app/server/assets/pathUSD-CVs71wGH.js +0 -2
  368. package/dist/app/server/assets/pathUSD-CVs71wGH.js.map +0 -1
  369. package/dist/app/server/assets/pathUSD-Dn2NadYx.css +0 -1
  370. package/dist/app/server/assets/react-dom-bupMaze0.css +0 -1
  371. package/dist/app/server/assets/router-uhTdTHZE.js.map +0 -1
  372. package/dist/app/server/assets/routes-ZveUsG66.js +0 -2
  373. package/dist/app/server/assets/routes-ZveUsG66.js.map +0 -1
  374. package/dist/app/server/assets/routes-dxKeFXjL.css +0 -1
  375. package/dist/app/server/assets/useRegisterFieldControl-UOdCWAKS.js +0 -2
  376. package/dist/app/server/assets/zyzz-DuvTIyXM.css +0 -1
  377. package/dist/app/server/assets/zyzz.config-DYq-16_0.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Chain-CQgBRAXx.js","names":["from","fromRpc","Signature.extract","toRpc","Hex.fromNumber","Signature.toRpc","Hex.fromNumber","assert","InvalidError","from","fromRpc","Hex.toBigInt","Hex.toNumber","toRpc","Quantity.fromNumberish","Hex.fromNumber","Errors.BaseError","assert","InvalidError","Hex.toBigInt","Signature.fromHex","from","fromRpc","Hex.fromNumber","Hex.toNumber","toRpc","Hex.size","Hex.slice","Hex.concat","Errors.BaseError","assert","fromRpc","Hex.toBigInt","toRpc","Quantity.fromNumberish","Errors.BaseError","toRpcType","fromRpcType","fromRpc","Signature.extract","FrameNonce.InvalidError","FrameNonce.fromRpc","Frame.fromRpc","FrameSignature.fromRpc","Authorization.fromRpcList","Signature.yParityToV","toRpc","Hex.fromNumber","FrameNonce.toRpc","Frame.toRpc","FrameSignature.toRpc","Authorization.toRpcList","toRpc","Frame.toRpc","toRpc","Authorization.toRpcList","Hex.fromNumber","FrameRequest.toRpc","FrameSignature.toRpc","FrameNonce.toRpc","Transaction.toRpcType","LogLine.format","TxEnvelopeTempo.getSignPayload","TxEnvelopeTempo.deserialize","KeyAuthorization_.getSignPayload","KeyAuthorization_.deserialize","AccountConfig.getSignPayload","AccountConfig.from","fromRpc","Hex.validate","Hex.toBigInt","Hex.fromNumber","AccountConfig.fromRpc","Address.validate","Hash.validate","SignatureEnvelope.extractAddress","TxEnvelopeTempo.feePayerMagic","TxEnvelopeTempo.serialize","KeyAuthorization_.serialize","SignatureEnvelope.deserialize","SignatureEnvelope.serialize","Hex.isEqual","AccountConfig.zeroSalt","Address.isEqual","Errors.BaseError","toRpc","shimKeyData","Rlp.fromHex","AccountConfig.toTuple","size","Hex.size","Hex.fromNumber","Errors.BaseError","ox_Transaction.toRpcType","ox_Transaction.fromRpcType","ox_Transaction.fromRpc","AuthorizationTempo.fromRpcList","SignatureEnvelope.fromRpc","KeyAuthorization.fromRpc","Signature.fromRpc","Signature.yParityToV","toRpc","ox_Transaction.toRpc","AuthorizationTempo.toRpcList","Hex.fromNumber","KeyAuthorization.toRpc","Signature.toRpc","SignatureEnvelope.toRpc","ox_TransactionRequest.toRpc","AuthorizationTempo.toRpcList","TempoAddress.resolve","Hex.fromNumber","TokenId.toAddress","KeyAuthorization.toRpc","AccountSimulation.toRpc","Hex.random","formatTransactionReceipt","magicBytes","AbiParameters.from","assert","Hex.slice","InvalidWrappedSignatureError","Hex.toNumber","AbiParameters.decode","Authorization.from","validate","Errors.BaseError","formatTransaction","Hex.slice","Hex.concat","AbiParameters.encode","AbiParameters.from","Errors.BaseError","verifyHash","SignatureErc8010.validate","SignatureErc8010.unwrap","SignatureErc6492.validate","SignatureErc6492.wrap","AccountConfig.from","Addresses.configurableAccount","Abis.configurableAccount","AccountConfig.fromRpc","AccountConfig.update","Addresses.signatureVerifier","Abis.signatureVerifier","viem_formatTransaction","ox_Transaction.fromRpc","Hex.fromNumber","ox_Transaction.toRpcType","viem_formatTransactionReceipt","AccountOperation.fromRpc","viem_formatTransactionRequest","ox_TransactionRequest.toRpc","TxEnvelopeTempo.from","Hex.concat","TxEnvelopeTempo.encodeForSigning","Transaction.serialize","Formatters.formatTransaction","Formatters.formatTransactionReceipt","Formatters.formatTransactionRequest","Transaction.deserialize","AccountOperation.getHash","Concurrent.detect","Hex.toBigInt","Hex.random","Hex.fromBytes","SignatureEnvelope.deserialize","Hex.concat","SignatureEnvelope.extractAddress","SignatureEnvelope.verify","verifyConfigurableAccount","BaseError","verifyHash","tempoTestnet","z.string","formatLog","toAddress","from$5","configurableAccount","zeroSalt","signatureVerifier","decode","fromHex","deserialize","from$6","encodeForSigning","signatureVerifier$1","configurableAccount$1","encode","assert$5","parseEventLogs","isEqual","update","getAction","serialize","getSignPayload","readContract","serialize$1","defineTransaction","isTempo","assert$6","fromRpc$8","recoverAddress","fromRpcList$1","serialize$2","fromConfig","fromRpc$7","from$4","getSignPayload$1","deserialize$2","recoverAuthorizationAddress","verify","getMetadata","deserialize$1","toRpc$10","formatTransaction$1","withExecutionError","toRpc$11","writeContract","feePayerMagic","defineCall","fromRpc$9","resolve$1","transactionType","toRpcList$1","extractAddress","serialize$3","toTuple$1","deserialize$3","getSignPayload$2","validate$2","slice","fromNumber","validate$3","toNumber","random","fromBytes","isEqual$1","toBigInt","size","assert$7","concat","BaseError","secp256k1","extract","validate$4","toRpc$12","yParityToV","assert$9","fromRpc$10","assert$8","defineFormatter","getAddress","keccak256","ContractFunctionRevertedError","hexToBigInt","hexToBool","hexToNumber","numberToHex","CallExecutionError","hexToBytes","ContractFunctionExecutionError","formatTransactionRequest$1","TransactionNotFoundError","formatBlockParameter","encodeDeployData","isHex","concatHex","parseAccount","erc1271Abi","isAddressEqual","bytesToHex","erc6492SignatureValidatorByteCode","multicall3Abi","erc6492SignatureValidatorAbi","BaseError$1","call","multicall3Bytecode","encodeFunctionData","defineTransactionRequest","maxUint256","string","from$3","authorization","fromRpc$6","options","signature","chainId","nonce","fromRpcList","authorizationList","toRpc$9","toRpcList","fromNumberish","value","modes","flags","assert$4","flagsValue","modeValue","frame","mode","InvalidError$2","flags_","field","limit","executionGas","stateGas","data","from$2","fromRpc$5","toRpc$8","p256N","secp256k1N","schemes","assert$3","scheme","entry","InvalidError$1","payload","coordinate","fromHex$1","r","s","order","from$1","result","fromRpc$4","fromTuple","toRpc$7","signer","msg","toTuple","tuple","metadata","publicKey","assert$2","keys","InvalidError","index","key","fromRpc$3","integer","decoded","toRpc$6","encoded","toRpcType$1","fromRpcType$1","fromRpc$2","transaction","transaction_","toRpc$5","rpc","toRpc$4","rest","toRpc$3","request_rpc","request","levels","flatten","pair","item","format","fields","level","pairs","message","quote","text","dev","error","parameters","print","info","route","c","warn","compact","describe","shortMessage","read","query","status","line","getHash","from","config","operation","owner","InvalidOperationError","assertBase","assertTransaction","assertKeyAuthorization","cause","fromRpc$1","version","version_","assertInteger","owners","approvalWeights","seen","approval","assertApproval","weight","isWeightReachable","expiresAt","submissionId","transactionHash","assertOperationHash","feePayer","transactionFields","assertSelectedApprovals","sameConfig","serialized","retained","selected","candidate","digest","addresses","previous","current","reachable","signatureCount","ownerWeight","weights","count","configA","a","configB","b","other","toRpc$2","spec","assertApprovals","approvals","keyData","shimKeyData$1","keyType","serializeConfig","InvalidSimulationError","size$1","toRpcType","fromRpcType","fromRpc","toRpc$1","toRpc","nonceKey","receiptStatuses","formatTransactionReceipt$1","receipt","transactionReceipt","log","defineTransactionReceipt","getCode","block","hex","client","address","blockNumber","blockHash","verifyAuthorization","defineChain","chainInstance","chain","extend","properties","fnOrExtended","base","combined","extendSchema","suffixParameters","assert$1","InvalidWrappedSignatureError$1","unwrap","wrapped","suffixLength","suffix","auth","to","validate$1","getTransaction","blockTag_","blockTag","blockNumberHex","hash","sender","magicBytes","assert","InvalidWrappedSignatureError","wrap","validate","serializeSignature","yParity_","yParity","v","verifyHash$1","verifierAddress","verifyErc8010","verifyErc6492","VerificationError","authorization_ox","initData","verifyErc1271","results","multicallAddress","wrappedSignature","factory","factoryData","args","deriveAccount","salt","threshold","getConfig","getConfigCommitment","updateConfig","inner","account_","currentConfig_","accountValue","account","currentConfig","cachedConfig","resolvedAccount","action","nextConfig","extractEvent","upgrade","verifyHash","formatTransaction","blockTimestamp","_","tx","feePayerSignature","formatOperation","formatTransactionReceipt","formatTransactionRequest","_owner","_signatures","rpcRequest","type","shimKeyData","keyId","byteLength","concurrentCounts","detect","isConcurrent","transactionReplacement","getExpiringNonceHash","getReason","replaced","replacement","envelope","calls","getCalls","replacedCalls","isSameCall","i","isEmpty","maxExpirySecs","serializeTransaction","chainConfig","storedTransaction","getAccountSimulation","phase","configurableIdentity","coordinated","useExpiringNonce","randomValidAfter","keyAuthorizationManager","accessKey","keyAuthorization","now","serializedTransaction","innerPayload","accessKeyAddress","keyInfo","code","selectOwners","localOwner","local","getSimulationKey","latest","tempo","tempoDevnet","tempoLocalnet","tempoModerato","InvalidListError","ids","known","schema","list","entries","parts","part","split","head","url","name","id","defaultApiUrl","apiUrl","builtIn","resolve","override"],"sources":["../../../../../node_modules/.pnpm/ox@0.14.57_typescript@7.0.2_zod@4.6.7/node_modules/ox/_esm/core/Authorization.js","../../../../../node_modules/.pnpm/ox@0.14.57_typescript@7.0.2_zod@4.6.7/node_modules/ox/_esm/core/internal/quantity.js","../../../../../node_modules/.pnpm/ox@0.14.57_typescript@7.0.2_zod@4.6.7/node_modules/ox/_esm/core/Frame.js","../../../../../node_modules/.pnpm/ox@0.14.57_typescript@7.0.2_zod@4.6.7/node_modules/ox/_esm/core/internal/curves.js","../../../../../node_modules/.pnpm/ox@0.14.57_typescript@7.0.2_zod@4.6.7/node_modules/ox/_esm/core/FrameSignature.js","../../../../../node_modules/.pnpm/ox@0.14.57_typescript@7.0.2_zod@4.6.7/node_modules/ox/_esm/core/internal/frameNonce.js","../../../../../node_modules/.pnpm/ox@0.14.57_typescript@7.0.2_zod@4.6.7/node_modules/ox/_esm/core/Transaction.js","../../../../../node_modules/.pnpm/ox@0.14.57_typescript@7.0.2_zod@4.6.7/node_modules/ox/_esm/core/FrameRequest.js","../../../../../node_modules/.pnpm/ox@0.14.57_typescript@7.0.2_zod@4.6.7/node_modules/ox/_esm/core/TransactionRequest.js","../../../../internal/LogLine.ts","../../../../internal/Log.ts","../../../../../node_modules/.pnpm/ox@0.14.57_typescript@7.0.2_zod@4.6.7/node_modules/ox/_esm/tempo/AccountOperation.js","../../../../../node_modules/.pnpm/ox@0.14.57_typescript@7.0.2_zod@4.6.7/node_modules/ox/_esm/tempo/AccountSimulation.js","../../../../../node_modules/.pnpm/ox@0.14.57_typescript@7.0.2_zod@4.6.7/node_modules/ox/_esm/tempo/Transaction.js","../../../../../node_modules/.pnpm/ox@0.14.57_typescript@7.0.2_zod@4.6.7/node_modules/ox/_esm/tempo/TransactionRequest.js","../../../../../node_modules/.pnpm/viem@2.57.10_typescript@7.0.2_zod@4.6.7/node_modules/viem/_esm/utils/formatters/transactionReceipt.js","../../../../../node_modules/.pnpm/viem@2.57.10_typescript@7.0.2_zod@4.6.7/node_modules/viem/_esm/actions/public/getCode.js","../../../../../node_modules/.pnpm/viem@2.57.10_typescript@7.0.2_zod@4.6.7/node_modules/viem/_esm/utils/authorization/verifyAuthorization.js","../../../../../node_modules/.pnpm/viem@2.57.10_typescript@7.0.2_zod@4.6.7/node_modules/viem/_esm/utils/chain/defineChain.js","../../../../../node_modules/.pnpm/ox@0.14.57_typescript@7.0.2_zod@4.6.7/node_modules/ox/_esm/erc8010/SignatureErc8010.js","../../../../../node_modules/.pnpm/viem@2.57.10_typescript@7.0.2_zod@4.6.7/node_modules/viem/_esm/actions/public/getTransaction.js","../../../../../node_modules/.pnpm/ox@0.14.57_typescript@7.0.2_zod@4.6.7/node_modules/ox/_esm/erc6492/SignatureErc6492.js","../../../../../node_modules/.pnpm/viem@2.57.10_typescript@7.0.2_zod@4.6.7/node_modules/viem/_esm/utils/signature/serializeSignature.js","../../../../../node_modules/.pnpm/viem@2.57.10_typescript@7.0.2_zod@4.6.7/node_modules/viem/_esm/actions/public/verifyHash.js","../../../../../node_modules/.pnpm/viem@2.57.10_typescript@7.0.2_zod@4.6.7/node_modules/viem/_esm/tempo/actions/accounts.js","../../../../../node_modules/.pnpm/viem@2.57.10_typescript@7.0.2_zod@4.6.7/node_modules/viem/_esm/tempo/Formatters.js","../../../../../node_modules/.pnpm/viem@2.57.10_typescript@7.0.2_zod@4.6.7/node_modules/viem/_esm/tempo/internal/concurrent.js","../../../../../node_modules/.pnpm/viem@2.57.10_typescript@7.0.2_zod@4.6.7/node_modules/viem/_esm/tempo/internal/replacement.js","../../../../../node_modules/.pnpm/viem@2.57.10_typescript@7.0.2_zod@4.6.7/node_modules/viem/_esm/tempo/chainConfig.js","../../../../../node_modules/.pnpm/viem@2.57.10_typescript@7.0.2_zod@4.6.7/node_modules/viem/_esm/chains/definitions/tempo.js","../../../../../node_modules/.pnpm/viem@2.57.10_typescript@7.0.2_zod@4.6.7/node_modules/viem/_esm/chains/definitions/tempoDevnet.js","../../../../../node_modules/.pnpm/viem@2.57.10_typescript@7.0.2_zod@4.6.7/node_modules/viem/_esm/chains/definitions/tempoLocalnet.js","../../../../../node_modules/.pnpm/viem@2.57.10_typescript@7.0.2_zod@4.6.7/node_modules/viem/_esm/chains/definitions/tempoModerato.js","../../../../internal/Chain.ts"],"sourcesContent":["import * as Hash from './Hash.js';\nimport * as Hex from './Hex.js';\nimport * as Rlp from './Rlp.js';\nimport * as Signature from './Signature.js';\n/**\n * Converts an [EIP-7702](https://eips.ethereum.org/EIPS/eip-7702) Authorization object into a typed {@link ox#Authorization.Authorization}.\n *\n * @example\n * An Authorization can be instantiated from an [EIP-7702](https://eips.ethereum.org/EIPS/eip-7702) Authorization tuple in object format.\n *\n * ```ts twoslash\n * import { Authorization } from 'ox'\n *\n * const authorization = Authorization.from({\n * address: '0x1234567890abcdef1234567890abcdef12345678',\n * chainId: 1,\n * nonce: 69n,\n * })\n * ```\n *\n * @example\n * ### Attaching Signatures\n *\n * A {@link ox#Signature.Signature} can be attached with the `signature` option. The example below demonstrates signing\n * an Authorization with {@link ox#Secp256k1.(sign:function)}.\n *\n * ```ts twoslash\n * import { Authorization, Secp256k1 } from 'ox'\n *\n * const authorization = Authorization.from({\n * address: '0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c',\n * chainId: 1,\n * nonce: 40n,\n * })\n *\n * const signature = Secp256k1.sign({\n * payload: Authorization.getSignPayload(authorization),\n * privateKey: '0x...',\n * })\n *\n * const authorization_signed = Authorization.from(authorization, { signature }) // [!code focus]\n * ```\n *\n * @param authorization - An [EIP-7702](https://eips.ethereum.org/EIPS/eip-7702) Authorization tuple in object format.\n * @param options - Authorization options.\n * @returns The {@link ox#Authorization.Authorization}.\n */\nexport function from(authorization, options = {}) {\n if (typeof authorization.chainId === 'string')\n return fromRpc(authorization);\n return { ...authorization, ...options.signature };\n}\n/**\n * Converts an {@link ox#Authorization.Rpc} to an {@link ox#Authorization.Authorization}.\n *\n * @example\n * ```ts twoslash\n * import { Authorization } from 'ox'\n *\n * const authorization = Authorization.fromRpc({\n * address: '0x0000000000000000000000000000000000000000',\n * chainId: '0x1',\n * nonce: '0x1',\n * r: '0x635dc2033e60185bb36709c29c75d64ea51dfbd91c32ef4be198e4ceb169fb4d',\n * s: '0x50c2667ac4c771072746acfdcf1f1483336dcca8bd2df47cd83175dbe60f0540',\n * yParity: '0x0',\n * })\n * ```\n *\n * @param authorization - The RPC-formatted Authorization.\n * @returns A signed {@link ox#Authorization.Authorization}.\n */\nexport function fromRpc(authorization) {\n const { address, chainId, nonce } = authorization;\n const signature = Signature.extract(authorization);\n return {\n address,\n chainId: Number(chainId),\n nonce: BigInt(nonce),\n ...signature,\n };\n}\n/**\n * Converts an {@link ox#Authorization.ListRpc} to an {@link ox#Authorization.List}.\n *\n * @example\n * ```ts twoslash\n * import { Authorization } from 'ox'\n *\n * const authorizationList = Authorization.fromRpcList([{\n * address: '0x0000000000000000000000000000000000000000',\n * chainId: '0x1',\n * nonce: '0x1',\n * r: '0x635dc2033e60185bb36709c29c75d64ea51dfbd91c32ef4be198e4ceb169fb4d',\n * s: '0x50c2667ac4c771072746acfdcf1f1483336dcca8bd2df47cd83175dbe60f0540',\n * yParity: '0x0',\n * }])\n * ```\n *\n * @param authorizationList - The RPC-formatted Authorization list.\n * @returns A signed {@link ox#Authorization.List}.\n */\nexport function fromRpcList(authorizationList) {\n return authorizationList.map(fromRpc);\n}\n/**\n * Converts an {@link ox#Authorization.Tuple} to an {@link ox#Authorization.Authorization}.\n *\n * @example\n * ```ts twoslash\n * import { Authorization } from 'ox'\n *\n * const authorization = Authorization.fromTuple([\n * '0x1',\n * '0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c',\n * '0x3'\n * ])\n * // @log: {\n * // @log: address: '0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c',\n * // @log: chainId: 1,\n * // @log: nonce: 3n\n * // @log: }\n * ```\n *\n * @example\n * It is also possible to append a Signature tuple to the end of an Authorization tuple.\n *\n * ```ts twoslash\n * import { Authorization } from 'ox'\n *\n * const authorization = Authorization.fromTuple([\n * '0x1',\n * '0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c',\n * '0x3',\n * '0x1',\n * '0x68a020a209d3d56c46f38cc50a33f704f4a9a10a59377f8dd762ac66910e9b90',\n * '0x7e865ad05c4035ab5792787d4a0297a43617ae897930a6fe4d822b8faea52064',\n * ])\n * // @log: {\n * // @log: address: '0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c',\n * // @log: chainId: 1,\n * // @log: nonce: 3n\n * // @log: r: BigInt('0x68a020a209d3d56c46f38cc50a33f704f4a9a10a59377f8dd762ac66910e9b90'),\n * // @log: s: BigInt('0x7e865ad05c4035ab5792787d4a0297a43617ae897930a6fe4d822b8faea52064'),\n * // @log: yParity: 0,\n * // @log: }\n * ```\n *\n * @param tuple - The [EIP-7702](https://eips.ethereum.org/EIPS/eip-7702) Authorization tuple.\n * @returns The {@link ox#Authorization.Authorization}.\n */\nexport function fromTuple(tuple) {\n const [chainId, address, nonce, yParity, r, s] = tuple;\n let args = {\n address,\n chainId: chainId === '0x' ? 0 : Number(chainId),\n nonce: nonce === '0x' ? 0n : BigInt(nonce),\n };\n if (yParity && r && s)\n args = { ...args, ...Signature.fromTuple([yParity, r, s]) };\n return from(args);\n}\n/**\n * Converts an {@link ox#Authorization.TupleList} to an {@link ox#Authorization.List}.\n *\n * @example\n * ```ts twoslash\n * import { Authorization } from 'ox'\n *\n * const authorizationList = Authorization.fromTupleList([\n * ['0x1', '0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c', '0x3'],\n * ['0x3', '0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c', '0x14'],\n * ])\n * // @log: [\n * // @log: {\n * // @log: address: '0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c',\n * // @log: chainId: 1,\n * // @log: nonce: 3n,\n * // @log: },\n * // @log: {\n * // @log: address: '0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c',\n * // @log: chainId: 3,\n * // @log: nonce: 20n,\n * // @log: },\n * // @log: ]\n * ```\n *\n * @example\n * It is also possible to append a Signature tuple to the end of an Authorization tuple.\n *\n * ```ts twoslash\n * import { Authorization } from 'ox'\n *\n * const authorizationList = Authorization.fromTupleList([\n * ['0x1', '0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c', '0x3', '0x1', '0x68a020a209d3d56c46f38cc50a33f704f4a9a10a59377f8dd762ac66910e9b90', '0x7e865ad05c4035ab5792787d4a0297a43617ae897930a6fe4d822b8faea52064'],\n * ['0x3', '0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c', '0x14', '0x1', '0x68a020a209d3d56c46f38cc50a33f704f4a9a10a59377f8dd762ac66910e9b90', '0x7e865ad05c4035ab5792787d4a0297a43617ae897930a6fe4d822b8faea52064'],\n * ])\n * // @log: [\n * // @log: {\n * // @log: address: '0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c',\n * // @log: chainId: 1,\n * // @log: nonce: 3n,\n * // @log: r: BigInt('0x68a020a209d3d56c46f38cc50a33f704f4a9a10a59377f8dd762ac66910e9b90'),\n * // @log: s: BigInt('0x7e865ad05c4035ab5792787d4a0297a43617ae897930a6fe4d822b8faea52064'),\n * // @log: yParity: 0,\n * // @log: },\n * // @log: {\n * // @log: address: '0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c',\n * // @log: chainId: 3,\n * // @log: nonce: 20n,\n * // @log: r: BigInt('0x68a020a209d3d56c46f38cc50a33f704f4a9a10a59377f8dd762ac66910e9b90'),\n * // @log: s: BigInt('0x7e865ad05c4035ab5792787d4a0297a43617ae897930a6fe4d822b8faea52064'),\n * // @log: yParity: 0,\n * // @log: },\n * // @log: ]\n * ```\n *\n * @param tupleList - The [EIP-7702](https://eips.ethereum.org/EIPS/eip-7702) Authorization tuple list.\n * @returns An {@link ox#Authorization.List}.\n */\nexport function fromTupleList(tupleList) {\n const list = [];\n for (const tuple of tupleList)\n list.push(fromTuple(tuple));\n return list;\n}\n/**\n * Computes the sign payload for an {@link ox#Authorization.Authorization} in [EIP-7702 format](https://eips.ethereum.org/EIPS/eip-7702): `keccak256('0x05' || rlp([chain_id, address, nonce]))`.\n *\n * @example\n * The example below demonstrates computing the sign payload for an {@link ox#Authorization.Authorization}. This payload\n * can then be passed to signing functions like {@link ox#Secp256k1.(sign:function)}.\n *\n * ```ts twoslash\n * import { Authorization, Secp256k1 } from 'ox'\n *\n * const authorization = Authorization.from({\n * address: '0x1234567890abcdef1234567890abcdef12345678',\n * chainId: 1,\n * nonce: 69n,\n * })\n *\n * const payload = Authorization.getSignPayload(authorization) // [!code focus]\n *\n * const signature = Secp256k1.sign({\n * payload,\n * privateKey: '0x...',\n * })\n * ```\n *\n * @param authorization - The {@link ox#Authorization.Authorization}.\n * @returns The sign payload.\n */\nexport function getSignPayload(authorization) {\n return hash(authorization, { presign: true });\n}\n/**\n * Computes the hash for an {@link ox#Authorization.Authorization} in [EIP-7702 format](https://eips.ethereum.org/EIPS/eip-7702): `keccak256('0x05' || rlp([chain_id, address, nonce]))`.\n *\n * @example\n * ```ts twoslash\n * import { Authorization } from 'ox'\n *\n * const authorization = Authorization.from({\n * address: '0x1234567890abcdef1234567890abcdef12345678',\n * chainId: 1,\n * nonce: 69n,\n * })\n *\n * const hash = Authorization.hash(authorization) // [!code focus]\n * ```\n *\n * @param authorization - The {@link ox#Authorization.Authorization}.\n * @returns The hash.\n */\nexport function hash(authorization, options = {}) {\n const { presign } = options;\n return Hash.keccak256(Hex.concat('0x05', Rlp.fromHex(toTuple(presign\n ? {\n address: authorization.address,\n chainId: authorization.chainId,\n nonce: authorization.nonce,\n }\n : authorization))));\n}\n/**\n * Converts an {@link ox#Authorization.Authorization} to an {@link ox#Authorization.Rpc}.\n *\n * @example\n * ```ts twoslash\n * import { Authorization } from 'ox'\n *\n * const authorization = Authorization.toRpc({\n * address: '0x0000000000000000000000000000000000000000',\n * chainId: 1,\n * nonce: 1n,\n * r: 44944627813007772897391531230081695102703289123332187696115181104739239197517n,\n * s: 36528503505192438307355164441104001310566505351980369085208178712678799181120n,\n * yParity: 0,\n * })\n * ```\n *\n * @param authorization - An Authorization.\n * @returns An RPC-formatted Authorization.\n */\nexport function toRpc(authorization) {\n const { address, chainId, nonce, ...signature } = authorization;\n return {\n address,\n chainId: Hex.fromNumber(chainId),\n nonce: Hex.fromNumber(nonce),\n ...Signature.toRpc(signature),\n };\n}\n/**\n * Converts an {@link ox#Authorization.List} to an {@link ox#Authorization.ListRpc}.\n *\n * @example\n * ```ts twoslash\n * import { Authorization } from 'ox'\n *\n * const authorization = Authorization.toRpcList([{\n * address: '0x0000000000000000000000000000000000000000',\n * chainId: 1,\n * nonce: 1n,\n * r: 44944627813007772897391531230081695102703289123332187696115181104739239197517n,\n * s: 36528503505192438307355164441104001310566505351980369085208178712678799181120n,\n * yParity: 0,\n * }])\n * ```\n *\n * @param authorizationList - An Authorization List.\n * @returns An RPC-formatted Authorization List.\n */\nexport function toRpcList(authorizationList) {\n return authorizationList.map(toRpc);\n}\n/**\n * Converts an {@link ox#Authorization.Authorization} to an {@link ox#Authorization.Tuple}.\n *\n * @example\n * ```ts twoslash\n * import { Authorization } from 'ox'\n *\n * const authorization = Authorization.from({\n * address: '0x1234567890abcdef1234567890abcdef12345678',\n * chainId: 1,\n * nonce: 69n,\n * })\n *\n * const tuple = Authorization.toTuple(authorization) // [!code focus]\n * // @log: [\n * // @log: address: '0x1234567890abcdef1234567890abcdef12345678',\n * // @log: chainId: 1,\n * // @log: nonce: 69n,\n * // @log: ]\n * ```\n *\n * @param authorization - The {@link ox#Authorization.Authorization}.\n * @returns An [EIP-7702](https://eips.ethereum.org/EIPS/eip-7702) Authorization tuple.\n */\nexport function toTuple(authorization) {\n const { address, chainId, nonce } = authorization;\n const signature = Signature.extract(authorization);\n return [\n chainId ? Hex.fromNumber(chainId) : '0x',\n address,\n nonce ? Hex.fromNumber(nonce) : '0x',\n ...(signature ? Signature.toTuple(signature) : []),\n ];\n}\n/**\n * Converts an {@link ox#Authorization.List} to an {@link ox#Authorization.TupleList}.\n *\n * @example\n * ```ts twoslash\n * import { Authorization } from 'ox'\n *\n * const authorization_1 = Authorization.from({\n * address: '0x1234567890abcdef1234567890abcdef12345678',\n * chainId: 1,\n * nonce: 69n,\n * })\n * const authorization_2 = Authorization.from({\n * address: '0x1234567890abcdef1234567890abcdef12345678',\n * chainId: 3,\n * nonce: 20n,\n * })\n *\n * const tuple = Authorization.toTupleList([authorization_1, authorization_2]) // [!code focus]\n * // @log: [\n * // @log: [\n * // @log: address: '0x1234567890abcdef1234567890abcdef12345678',\n * // @log: chainId: 1,\n * // @log: nonce: 69n,\n * // @log: ],\n * // @log: [\n * // @log: address: '0x1234567890abcdef1234567890abcdef12345678',\n * // @log: chainId: 3,\n * // @log: nonce: 20n,\n * // @log: ],\n * // @log: ]\n * ```\n *\n * @param list - An {@link ox#Authorization.List}.\n * @returns An [EIP-7702](https://eips.ethereum.org/EIPS/eip-7702) Authorization tuple list.\n */\nexport function toTupleList(list) {\n if (!list || list.length === 0)\n return [];\n const tupleList = [];\n for (const authorization of list)\n tupleList.push(toTuple(authorization));\n return tupleList;\n}\n//# sourceMappingURL=Authorization.js.map","import * as Hex from '../Hex.js';\n/**\n * Converts a \"numberish\" value (`Hex.Hex | bigint | number`) to an RPC quantity\n * (`Hex.Hex`). Hex values are passed through unchanged; numbers and bigints are\n * encoded via {@link ox#Hex.(fromNumber:function)}.\n *\n * @internal\n */\nexport function fromNumberish(value, options) {\n if (typeof value === 'string')\n return value;\n return Hex.fromNumber(value, options);\n}\n//# sourceMappingURL=quantity.js.map","import * as Address from './Address.js';\nimport * as Bytes from './Bytes.js';\nimport * as Errors from './Errors.js';\nimport * as Hex from './Hex.js';\nimport * as Quantity from './internal/quantity.js';\n/** Frame execution modes. */\nexport const modes = { default: 0, sender: 2, verify: 1 };\n/** Approval and atomic batching flags. */\nexport const flags = {\n approveExecution: 2,\n approveExecutionAndPayment: 3,\n approvePayment: 1,\n atomicBatch: 4,\n none: 0,\n};\n/**\n * Asserts that a {@link ox#Frame.Frame} satisfies frame-local constraints.\n *\n * Sender-dependent approval, batch adjacency, expiry, and transaction-wide gas\n * constraints require the enclosing transaction.\n *\n * @example\n * ### Basic Usage\n *\n * Check a verification frame before including it in a transaction.\n *\n * ```ts twoslash\n * import { Frame } from 'ox'\n *\n * Frame.assert({\n * executionGas: 50_000n,\n * flags: 'approveExecutionAndPayment',\n * mode: 'verify'\n * })\n * ```\n *\n * @param frame - The frame to assert.\n */\nexport function assert(frame) {\n const { data = '0x', executionGas = 0n, flags: flagsValue = 0, mode: modeValue = 0, stateGas = 0n, value = 0n, } = frame;\n const mode = typeof modeValue === 'string' ? modes[modeValue] : modeValue;\n if (!Number.isInteger(mode) || mode < 0 || mode > 2)\n throw new InvalidError('mode must be a supported name or 0, 1, or 2.');\n const flags_ = typeof flagsValue === 'string' ? flags[flagsValue] : flagsValue;\n if (!Number.isInteger(flags_) || flags_ < 0 || flags_ > 7)\n throw new InvalidError('flags must be a supported name or an integer from 0 to 7.');\n if (flags_ & flags.atomicBatch) {\n if (mode === modes.verify)\n throw new InvalidError('VERIFY frames cannot belong to an atomic batch.');\n if (flags_ & flags.approveExecutionAndPayment)\n throw new InvalidError('Atomic batch frames cannot approve execution or payment.');\n }\n if (frame.to !== undefined)\n Address.assert(frame.to, { strict: false });\n for (const [field, limit] of [\n ['executionGas', executionGas],\n ['stateGas', stateGas],\n ])\n if (typeof limit !== 'bigint' || limit < 0n || limit >= 2n ** 64n)\n throw new InvalidError(`${field} must be an unsigned 64-bit integer.`);\n if (executionGas + stateGas >= 2n ** 64n)\n throw new InvalidError('Combined frame gas must be less than 2^64.');\n if (typeof value !== 'bigint' || value < 0n || value >= 2n ** 256n)\n throw new InvalidError('value must be an unsigned 256-bit integer.');\n if (mode !== modes.sender && value !== 0n)\n throw new InvalidError('Only SENDER frames can transfer value.');\n Hex.assert(data, { strict: true });\n if (data.length % 2 !== 0)\n throw new InvalidError('data must contain whole bytes.');\n}\n/**\n * Coerces a frame object into a {@link ox#Frame.Frame}.\n *\n * Validates the frame and returns a copy, preserving literal types and the supplied\n * numeric or named mode and flags. Omitted fields stay omitted;\n * {@link ox#Frame.(toTuple:function)} supplies their defaults when encoding.\n *\n * @example\n * ### Basic Usage\n *\n * Construct a verification frame that approves execution and payment.\n *\n * ```ts twoslash\n * import { Frame } from 'ox'\n *\n * const frame = Frame.from({\n * executionGas: 50_000n,\n * flags: 'approveExecutionAndPayment',\n * mode: 'verify'\n * })\n * ```\n *\n * @param frame - The frame object to convert.\n * @returns The validated frame.\n */\nexport function from(frame) {\n assert(frame);\n return { ...frame };\n}\n/**\n * Converts an RPC frame to a frame.\n *\n * @example\n * ### Basic Usage\n *\n * ```ts twoslash\n * import { Frame } from 'ox'\n *\n * const frame = Frame.fromRpc({\n * data: '0x',\n * executionGas: '0xc350',\n * flags: '0x3',\n * mode: '0x1',\n * stateGas: '0x0',\n * value: '0x0'\n * })\n * ```\n *\n * @param frame - The value to convert.\n * @returns The converted value.\n */\nexport function fromRpc(frame) {\n return from({\n data: frame.data,\n executionGas: Hex.toBigInt(frame.executionGas),\n flags: Hex.toNumber(frame.flags),\n mode: Hex.toNumber(frame.mode),\n stateGas: Hex.toBigInt(frame.stateGas),\n ...(frame.target == null ? {} : { to: frame.target }),\n value: Hex.toBigInt(frame.value),\n });\n}\n/**\n * Converts a frame to its JSON-RPC representation.\n *\n * @example\n * ### Basic Usage\n *\n * ```ts twoslash\n * import { Frame } from 'ox'\n *\n * const frame = Frame.from({ executionGas: 50_000n, mode: 'verify' })\n * const rpc = Frame.toRpc(frame)\n * ```\n *\n * @param frame - The value to convert.\n * @returns The converted value.\n */\nexport function toRpc(frame) {\n const { flags: flags_ = 0, mode = 0 } = frame;\n return {\n data: frame.data ?? '0x',\n executionGas: Quantity.fromNumberish(frame.executionGas ?? 0n),\n flags: Hex.fromNumber(typeof flags_ === 'string' ? flags[flags_] : flags_),\n mode: Hex.fromNumber(typeof mode === 'string' ? modes[mode] : mode),\n stateGas: Quantity.fromNumberish(frame.stateGas ?? 0n),\n ...(frame.to === undefined ? {} : { target: frame.to }),\n value: Quantity.fromNumberish(frame.value ?? 0n),\n };\n}\n/**\n * Converts a {@link ox#Frame.Tuple} to a {@link ox#Frame.Frame}.\n *\n * Returns numeric mode and flags. An empty target becomes an omitted `to`.\n * Integer fields must use minimal whole-byte encodings, with empty bytes for zero.\n *\n * @example\n * ### Basic Usage\n *\n * Decode a frame tuple with separate execution and state gas limits.\n *\n * ```ts twoslash\n * import { Frame } from 'ox'\n *\n * const frame = Frame.fromTuple([\n * '0x01',\n * '0x03',\n * '0x',\n * ['0xc350', '0x'],\n * '0x',\n * '0x'\n * ])\n * // @log: {\n * // @log: data: '0x',\n * // @log: executionGas: 50000n,\n * // @log: flags: 3,\n * // @log: mode: 1,\n * // @log: stateGas: 0n,\n * // @log: value: 0n\n * // @log: }\n * ```\n *\n * @param tuple - The frame tuple to convert.\n * @returns The decoded frame.\n */\nexport function fromTuple(tuple) {\n if (!Array.isArray(tuple) ||\n tuple.length !== 6 ||\n !Array.isArray(tuple[3]) ||\n tuple[3].length !== 2)\n throw new InvalidError('Expected [mode, flags, target, [execution, state], value, data].');\n const [mode, flags, target, [execution, state], value, data] = tuple;\n Hex.assert(target, { strict: true });\n Hex.assert(data, { strict: true });\n const quantities = [mode, flags, execution, state, value];\n for (const quantity of quantities) {\n Hex.assert(quantity, { strict: true });\n if (quantity.length % 2 !== 0 || quantity.startsWith('0x00'))\n throw new InvalidError('Integers must use minimal whole-byte encodings, with empty bytes for zero.');\n }\n const frame = {\n ...(target === '0x' ? {} : { to: target }),\n data,\n executionGas: execution === '0x' ? 0n : Hex.toBigInt(execution),\n flags: flags === '0x' ? 0 : Hex.toNumber(flags),\n mode: mode === '0x' ? 0 : Hex.toNumber(mode),\n stateGas: state === '0x' ? 0n : Hex.toBigInt(state),\n value: value === '0x' ? 0n : Hex.toBigInt(value),\n };\n assert(frame);\n return frame;\n}\n/**\n * Converts a {@link ox#Frame.Frame} to its RLP-ready {@link ox#Frame.Tuple}.\n *\n * Named mode and flags are encoded as integers. An omitted target and zero integer\n * fields are encoded as empty bytes. Omitted mode and flags default to zero;\n * omitted gas limits and value default to `0n`, and data defaults to `'0x'`.\n *\n * @example\n * ### Basic Usage\n *\n * Encode a verification frame in the field order required by EIP-8141.\n *\n * ```ts twoslash\n * import { Frame } from 'ox'\n *\n * const tuple = Frame.toTuple({\n * executionGas: 50_000n,\n * flags: 'approveExecutionAndPayment',\n * mode: 'verify'\n * })\n * // @log: ['0x01', '0x03', '0x', ['0xc350', '0x'], '0x', '0x']\n * ```\n *\n * @param frame - The frame to convert.\n * @returns The encoded frame tuple.\n */\nexport function toTuple(frame) {\n assert(frame);\n const mode = typeof frame.mode === 'string' ? modes[frame.mode] : (frame.mode ?? 0);\n const flags_ = typeof frame.flags === 'string' ? flags[frame.flags] : (frame.flags ?? 0);\n return [\n mode ? Hex.fromBytes(Bytes.fromNumber(mode)) : '0x',\n flags_ ? Hex.fromBytes(Bytes.fromNumber(flags_)) : '0x',\n frame.to ?? '0x',\n [\n frame.executionGas\n ? Hex.fromBytes(Bytes.fromNumber(frame.executionGas))\n : '0x',\n frame.stateGas ? Hex.fromBytes(Bytes.fromNumber(frame.stateGas)) : '0x',\n ],\n frame.value ? Hex.fromBytes(Bytes.fromNumber(frame.value)) : '0x',\n frame.data ?? '0x',\n ];\n}\n/**\n * Returns whether a {@link ox#Frame.Frame} satisfies frame-local constraints.\n *\n * Performs the same checks as {@link ox#Frame.(assert:function)}, returning `false`\n * instead of throwing when the frame is invalid.\n *\n * @example\n * ### Basic Usage\n *\n * Check whether a frame is structurally valid.\n *\n * ```ts twoslash\n * import { Frame } from 'ox'\n *\n * const valid = Frame.validate({\n * executionGas: 50_000n,\n * flags: 'approveExecutionAndPayment',\n * mode: 'verify'\n * })\n * // @log: true\n * ```\n *\n * @param frame - The frame to validate.\n * @returns Whether the frame satisfies frame-local constraints.\n */\nexport function validate(frame) {\n try {\n assert(frame);\n return true;\n }\n catch {\n return false;\n }\n}\n/** Thrown when an EIP-8141 frame is structurally invalid. */\nexport class InvalidError extends Errors.BaseError {\n constructor(details) {\n super('Invalid frame.', { details });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'Frame.InvalidError'\n });\n }\n}\n//# sourceMappingURL=Frame.js.map","/**\n * Curve constants, inlined so that modules needing nothing but an order do not\n * pull a curve implementation into the bundle.\n *\n * These are fixed by the curve specifications and are asserted against\n * `@noble/curves` in `src/core/_test/curves.test.ts`.\n *\n * @internal\n */\n/**\n * Order of the secp256r1 (P-256) curve.\n *\n * @see https://www.secg.org/sec2-v2.pdf\n * @internal\n */\nexport const p256N = 0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551n;\n/** Order of the secp256k1 curve. @internal */\nexport const secp256k1N = 0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n;\n//# sourceMappingURL=curves.js.map","import * as Address from './Address.js';\nimport * as Errors from './Errors.js';\nimport * as Hex from './Hex.js';\nimport { p256N, secp256k1N } from './internal/curves.js';\nimport * as PublicKey from './PublicKey.js';\nimport * as Signature from './Signature.js';\n/** Signature schemes supported by EIP-8141. */\nexport const schemes = { arbitrary: 0, p256: 2, secp256k1: 1 };\n/**\n * Asserts that a {@link ox#FrameSignature.FrameSignature} is structurally valid.\n *\n * Checks metadata, signature scalars, and public key shape without verifying\n * authorization.\n *\n * @example\n * ### Basic Usage\n *\n * Unsigned protocol entries are accepted by default.\n *\n * ```ts twoslash\n * import { FrameSignature } from 'ox'\n *\n * FrameSignature.assert({\n * payload: '0x',\n * scheme: 'secp256k1'\n * })\n * ```\n *\n * @example\n * ### Requiring a Signature\n *\n * Set `signed` to require a protocol signature.\n *\n * ```ts twoslash\n * import { FrameSignature, Hash, Secp256k1 } from 'ox'\n *\n * const payload = Hash.keccak256('0xdeadbeef')\n * const privateKey = Secp256k1.randomPrivateKey()\n * const signature = Secp256k1.sign({ payload, privateKey })\n *\n * const entry = FrameSignature.from({\n * payload,\n * scheme: 'secp256k1',\n * signature\n * })\n *\n * FrameSignature.assert(entry, { signed: true })\n * ```\n *\n * @param entry - The signature entry to assert.\n * @param options - Validation options.\n */\nexport function assert(entry, options = {}) {\n const scheme = typeof entry.scheme === 'string' ? schemes[entry.scheme] : entry.scheme;\n if (!Number.isInteger(scheme) || scheme < 0 || scheme > 2)\n throw new InvalidError('Unsupported signature scheme.');\n if (scheme === 0 && entry.signer !== undefined)\n throw new InvalidError('Arbitrary signatures cannot specify a signer.');\n if (entry.signer !== undefined)\n Address.assert(entry.signer, { strict: false });\n const payload = entry.payload ?? '0x';\n Hex.assert(payload, { strict: true });\n if (payload !== '0x' &&\n (payload.length !== 66 || Hex.toBigInt(payload) === 0n))\n throw new InvalidError('payload must be empty or a nonzero 32-byte digest.');\n switch (entry.scheme) {\n case 0:\n case 'arbitrary':\n Hex.assert(entry.signature, { strict: true });\n if (entry.signature.length % 2 !== 0)\n throw new InvalidError('signature must contain whole bytes.');\n return;\n }\n if (entry.scheme === 2 || entry.scheme === 'p256') {\n if (entry.publicKey !== undefined) {\n PublicKey.assert(entry.publicKey, { compressed: false });\n for (const coordinate of [entry.publicKey.x, entry.publicKey.y]) {\n if (typeof coordinate !== 'bigint' ||\n coordinate < 0n ||\n coordinate >= 2n ** 256n)\n throw new InvalidError('Public key coordinates must fit in 32 bytes.');\n }\n }\n if (entry.signature !== undefined &&\n entry.signature !== '0x' &&\n entry.publicKey === undefined)\n throw new InvalidError('P-256 signatures require a public key.');\n }\n if (entry.signature === undefined || entry.signature === '0x') {\n if (options.signed)\n throw new InvalidError('Signature is required.');\n return;\n }\n if (typeof entry.signature === 'string')\n Hex.assert(entry.signature, { strict: true });\n const signature = typeof entry.signature === 'string'\n ? Signature.fromHex(entry.signature)\n : entry.signature;\n if (typeof signature.r !== 'bigint' || typeof signature.s !== 'bigint')\n throw new InvalidError('Signature scalars must be bigint.');\n if ((scheme === 1 || signature.yParity !== undefined) &&\n signature.yParity !== 0 &&\n signature.yParity !== 1)\n throw new InvalidError('Signature parity must be 0 or 1.');\n Signature.assert(signature, { recovered: scheme === 1 });\n const r = signature.r;\n const s = signature.s;\n const order = scheme === 1 ? secp256k1N : p256N;\n if (r === 0n ||\n r >= order ||\n s === 0n ||\n s >= order ||\n (scheme === 1 && s > order / 2n))\n throw new InvalidError('Signature scalars must be in range; secp256k1 requires low-s.');\n}\n/**\n * Coerces a value into a {@link ox#FrameSignature.FrameSignature}.\n *\n * Accepts arbitrary signature bytes or a signature entry. Protocol signatures accept\n * structured objects or `Signature.toHex` bytes. P-256 entries still require a public key. Omitted\n * `scheme` and `payload` default to `'arbitrary'` and `'0x'`, respectively.\n * An empty payload selects the canonical transaction signing hash; an explicit\n * payload must be a nonzero 32-byte digest.\n *\n * @example\n * ### From Hex\n *\n * Wrap arbitrary witness bytes for contract-defined verification.\n *\n * ```ts twoslash\n * import { FrameSignature } from 'ox'\n *\n * const entry = FrameSignature.from('0xaabb')\n * // @log: { payload: '0x', scheme: 'arbitrary', signature: '0xaabb' }\n * ```\n *\n * @example\n * ### Secp256k1\n *\n * Wrap a signature over an explicit digest, retaining the same payload in the entry.\n *\n * ```ts twoslash\n * import { FrameSignature, Hash, Secp256k1 } from 'ox'\n *\n * const payload = Hash.keccak256('0xdeadbeef')\n * const privateKey = Secp256k1.randomPrivateKey()\n * const signature = Secp256k1.sign({ payload, privateKey })\n *\n * const entry = FrameSignature.from({\n * payload,\n * scheme: 'secp256k1',\n * signature\n * })\n * ```\n *\n * @example\n * ### P256\n *\n * Include the public key with a P-256 signature over an explicit digest.\n *\n * ```ts twoslash\n * import { FrameSignature, Hash, P256 } from 'ox'\n *\n * const { privateKey, publicKey } = P256.createKeyPair()\n * const payload = Hash.keccak256('0xdeadbeef')\n * const signature = P256.sign({ payload, privateKey })\n *\n * const entry = FrameSignature.from({\n * payload,\n * publicKey,\n * scheme: 'p256',\n * signature\n * })\n * ```\n *\n * @example\n * ### Unsigned Entries\n *\n * Omit the signature to prepare a protocol entry before signing the transaction.\n *\n * ```ts twoslash\n * import { FrameSignature } from 'ox'\n *\n * const entry = FrameSignature.from({ scheme: 'secp256k1' })\n * // @log: { payload: '0x', scheme: 'secp256k1' }\n * ```\n *\n * @param entry - Arbitrary signature bytes or a structured signature entry.\n * @returns The validated entry, preserving supplied signature and scheme types.\n */\nexport function from(entry) {\n const result = (typeof entry === 'string'\n ? { payload: '0x', scheme: 'arbitrary', signature: entry }\n : {\n ...entry,\n payload: entry.payload ?? '0x',\n scheme: entry.scheme ?? 'arbitrary',\n });\n assert(result);\n return result;\n}\n/**\n * Converts an RPC signature entry to a structured frame signature.\n *\n * @example\n * ### Basic Usage\n *\n * ```ts twoslash\n * import { FrameSignature } from 'ox'\n *\n * const entry = FrameSignature.fromRpc({\n * msg: '0x',\n * scheme: '0x0',\n * signature: '0xdeadbeef'\n * })\n * ```\n *\n * @param entry - The value to convert.\n * @returns The converted value.\n */\nexport function fromRpc(entry) {\n return fromTuple([\n entry.scheme === '0x0'\n ? '0x'\n : Hex.fromNumber(Hex.toNumber(entry.scheme), { size: 1 }),\n entry.signer ?? '0x',\n entry.msg ?? '0x',\n entry.signature ?? '0x',\n ]);\n}\n/**\n * Converts a structured frame signature to its RPC representation.\n *\n * @example\n * ### Basic Usage\n *\n * ```ts twoslash\n * import { FrameSignature } from 'ox'\n *\n * const entry = FrameSignature.from('0xdeadbeef')\n * const rpc = FrameSignature.toRpc(entry)\n * ```\n *\n * @param entry - The value to convert.\n * @returns The converted value.\n */\nexport function toRpc(entry) {\n const [scheme, signer, msg, signature] = toTuple(entry);\n return {\n msg,\n scheme: (scheme === '0x'\n ? '0x0'\n : Hex.fromNumber(Hex.toNumber(scheme))),\n ...(signature === '0x' && scheme !== '0x' ? {} : { signature }),\n ...(signer === '0x' ? {} : { signer }),\n };\n}\n/**\n * Converts a {@link ox#FrameSignature.Tuple} to a structured\n * {@link ox#FrameSignature.FrameSignature}.\n *\n * Returns a named scheme and unpacks protocol signatures. Empty protocol signatures\n * become unsigned entries. Rejects noncanonical encodings.\n *\n * @example\n * ### Basic Usage\n *\n * Decode an arbitrary signature tuple.\n *\n * ```ts twoslash\n * import { FrameSignature } from 'ox'\n *\n * const entry = FrameSignature.fromTuple([\n * '0x',\n * '0x',\n * '0x',\n * '0xaabb'\n * ])\n * // @log: { payload: '0x', scheme: 'arbitrary', signature: '0xaabb' }\n * ```\n *\n * @param tuple - The signature tuple to convert.\n * @returns The decoded signature entry.\n */\nexport function fromTuple(tuple) {\n if (!Array.isArray(tuple) || tuple.length !== 4)\n throw new InvalidError('Expected [scheme, signer, payload, signature].');\n const [scheme, signer, payload, signature] = tuple;\n Hex.assert(signer, { strict: true });\n Hex.assert(signature, { strict: true });\n if (signature.length % 2 !== 0)\n throw new InvalidError('signature must contain whole bytes.');\n if (scheme !== '0x' && scheme !== '0x01' && scheme !== '0x02')\n throw new InvalidError('Expected a canonical scheme encoding: empty bytes, 0x01, or 0x02.');\n const metadata = { ...(signer === '0x' ? {} : { signer }), payload };\n if (scheme === '0x') {\n if (signer !== '0x')\n throw new InvalidError('Arbitrary signatures cannot specify a signer.');\n return from({ payload, scheme: 'arbitrary', signature });\n }\n if (signature === '0x')\n return scheme === '0x01'\n ? from({ ...metadata, scheme: 'secp256k1' })\n : from({ ...metadata, scheme: 'p256' });\n if (Hex.size(signature) !== (scheme === '0x01' ? 65 : 128))\n throw new InvalidError('Invalid protocol signature length.');\n if (scheme === '0x01') {\n if (Hex.toNumber(Hex.slice(signature, 0, 1)) > 1)\n throw new InvalidError('Recovery parity must be 0 or 1.');\n return from({\n ...metadata,\n scheme: 'secp256k1',\n signature: {\n r: Hex.toBigInt(Hex.slice(signature, 1, 33)),\n s: Hex.toBigInt(Hex.slice(signature, 33, 65)),\n yParity: Hex.toNumber(Hex.slice(signature, 0, 1)),\n },\n });\n }\n const s = Hex.toBigInt(Hex.slice(signature, 32, 64));\n if (s > p256N / 2n)\n throw new InvalidError('P-256 wire signatures require low-s.');\n return from({\n ...metadata,\n publicKey: {\n prefix: 4,\n x: Hex.toBigInt(Hex.slice(signature, 64, 96)),\n y: Hex.toBigInt(Hex.slice(signature, 96, 128)),\n },\n scheme: 'p256',\n signature: { r: Hex.toBigInt(Hex.slice(signature, 0, 32)), s },\n });\n}\n/**\n * Converts a {@link ox#FrameSignature.FrameSignature} to its RLP-ready\n * {@link ox#FrameSignature.Tuple}.\n *\n * Encodes numeric scheme identifiers and packs protocol signatures without mutating\n * the entry. Omitted protocol signatures become empty bytes.\n *\n * @example\n * ### Basic Usage\n *\n * Encode arbitrary witness bytes with the default scheme and payload.\n *\n * ```ts twoslash\n * import { FrameSignature } from 'ox'\n *\n * const entry = FrameSignature.from('0xaabb')\n * const tuple = FrameSignature.toTuple(entry)\n * // @log: ['0x', '0x', '0x', '0xaabb']\n * ```\n *\n * @param entry - The signature entry to convert.\n * @returns The encoded signature tuple.\n */\nexport function toTuple(entry) {\n assert(entry);\n const scheme = typeof entry.scheme === 'string' ? schemes[entry.scheme] : entry.scheme;\n const signature = (() => {\n switch (entry.scheme) {\n case 0:\n case 'arbitrary':\n return entry.signature;\n case 1:\n case 'secp256k1': {\n if (entry.signature === undefined || entry.signature === '0x')\n return '0x';\n const signature = typeof entry.signature === 'string'\n ? Signature.fromHex(entry.signature)\n : entry.signature;\n return Hex.concat(Hex.fromNumber(signature.yParity, { size: 1 }), Hex.fromNumber(signature.r, { size: 32 }), Hex.fromNumber(signature.s, { size: 32 }));\n }\n case 2:\n case 'p256': {\n if (entry.signature === undefined || entry.signature === '0x')\n return '0x';\n const publicKey = entry.publicKey;\n const signature = typeof entry.signature === 'string'\n ? Signature.fromHex(entry.signature)\n : entry.signature;\n const s = signature.s;\n return Hex.concat(Hex.fromNumber(signature.r, { size: 32 }), Hex.fromNumber(s > p256N / 2n ? p256N - s : s, { size: 32 }), Hex.fromNumber(publicKey.x, { size: 32 }), Hex.fromNumber(publicKey.y, { size: 32 }));\n }\n }\n })();\n return [\n scheme ? Hex.fromNumber(scheme, { size: 1 }) : '0x',\n entry.signer ?? '0x',\n entry.payload ?? '0x',\n signature,\n ];\n}\n/**\n * Returns whether a {@link ox#FrameSignature.FrameSignature} is structurally valid.\n *\n * Performs the same checks as {@link ox#FrameSignature.(assert:function)}, returning\n * `false` instead of throwing. Does not verify that the signature authorizes a payload.\n *\n * @example\n * ### Basic Usage\n *\n * Require a signature when checking a protocol entry.\n *\n * ```ts twoslash\n * import { FrameSignature } from 'ox'\n *\n * const entry = FrameSignature.from({ scheme: 'secp256k1' })\n * const valid = FrameSignature.validate(entry, {\n * signed: true\n * })\n * // @log: false\n * ```\n *\n * @param entry - The signature entry to validate.\n * @param options - Validation options.\n * @returns Whether the entry is structurally valid.\n */\nexport function validate(entry, options = {}) {\n try {\n assert(entry, options);\n return true;\n }\n catch {\n return false;\n }\n}\n/** Thrown when frame signature metadata or encoding is invalid. */\nexport class InvalidError extends Errors.BaseError {\n constructor(details) {\n super('Invalid frame signature.', { details });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'FrameSignature.InvalidError'\n });\n }\n}\n//# sourceMappingURL=FrameSignature.js.map","import * as Errors from '../Errors.js';\nimport * as Hex from '../Hex.js';\nimport * as Quantity from './quantity.js';\n/**\n * Asserts keyed nonce constraints.\n * @internal\n */\nexport function assert(keys, nonce) {\n if (!Array.isArray(keys) || keys.length < 1 || keys.length > 16)\n throw new InvalidError('Expected between 1 and 16 nonce keys.');\n for (const [index, key] of keys.entries()) {\n if (typeof key !== 'bigint' || key < 0n || key >= 2n ** 256n)\n throw new InvalidError('Nonce keys must be unsigned 256-bit integers.');\n if (index > 0 && key <= keys[index - 1])\n throw new InvalidError('Nonce keys must be strictly increasing.');\n }\n if (keys.length > 1 && keys[0] === 0n)\n throw new InvalidError('The zero nonce key cannot be combined with other keys.');\n if (nonce !== undefined &&\n (typeof nonce !== 'bigint' || nonce < 0n || nonce >= 2n ** 64n - 1n))\n throw new InvalidError('Nonce must be less than 2^64 - 1 and nonnegative.');\n}\n/**\n * Decodes and validates RPC nonce keys and their shared sequence.\n * @internal\n */\nexport function fromRpc(keys, nonce) {\n if (!Array.isArray(keys))\n throw new InvalidError('Expected a nonce key list.');\n const integer = (value) => {\n if (typeof value !== 'string' ||\n !/^0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)$/.test(value))\n throw new InvalidError('Expected a canonical RPC nonce quantity.');\n return Hex.toBigInt(value);\n };\n const decoded = keys.map(integer);\n assert(decoded, nonce === undefined ? undefined : integer(nonce));\n return decoded;\n}\n/**\n * Encodes and validates nonce keys and their shared sequence.\n * @internal\n */\nexport function toRpc(keys, nonce) {\n if (!Array.isArray(keys))\n throw new InvalidError('Expected a nonce key list.');\n const encoded = keys.map((key) => Quantity.fromNumberish(key));\n fromRpc(encoded, nonce === undefined ? undefined : Quantity.fromNumberish(nonce));\n return encoded;\n}\nexport class InvalidError extends Errors.BaseError {\n constructor() {\n super(...arguments);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'FrameNonce.InvalidError'\n });\n }\n}\n//# sourceMappingURL=frameNonce.js.map","import * as Authorization from './Authorization.js';\nimport * as Frame from './Frame.js';\nimport * as FrameSignature from './FrameSignature.js';\nimport * as Hex from './Hex.js';\nimport * as FrameNonce from './internal/frameNonce.js';\nimport * as Signature from './Signature.js';\n/** Type to RPC Type mapping. */\nexport const toRpcType = {\n legacy: '0x0',\n eip2930: '0x1',\n eip1559: '0x2',\n eip4844: '0x3',\n eip7702: '0x4',\n eip8141: '0x6',\n};\n/** RPC Type to Type mapping. */\nexport const fromRpcType = {\n '0x0': 'legacy',\n '0x1': 'eip2930',\n '0x2': 'eip1559',\n '0x3': 'eip4844',\n '0x4': 'eip7702',\n '0x6': 'eip8141',\n};\n/**\n * Converts an {@link ox#Transaction.Rpc} to an {@link ox#Transaction.Transaction}.\n *\n * @example\n * ```ts twoslash\n * import { Transaction } from 'ox'\n *\n * const transaction = Transaction.fromRpc({\n * hash: '0x353fdfc38a2f26115daadee9f5b8392ce62b84f410957967e2ed56b35338cdd0',\n * nonce: '0x357',\n * blockHash:\n * '0xc350d807505fb835650f0013632c5515592987ba169bbc6626d9fc54d91f0f0b',\n * blockNumber: '0x12f296f',\n * transactionIndex: '0x2',\n * from: '0x814e5e0e31016b9a7f138c76b7e7b2bb5c1ab6a6',\n * to: '0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad',\n * value: '0x9b6e64a8ec60000',\n * gas: '0x43f5d',\n * maxFeePerGas: '0x2ca6ae494',\n * maxPriorityFeePerGas: '0x41cc3c0',\n * input:\n * '0x3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006643504700000000000000000000000000000000000000000000000000000000000000040b080604000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002800000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000009b6e64a8ec600000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000009b6e64a8ec60000000000000000000000000000000000000000000000000000019124bb5ae978c000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000c56c7a0eaa804f854b536a5f3d5f49d2ec4b12b80000000000000000000000000000000000000000000000000000000000000060000000000000000000000000c56c7a0eaa804f854b536a5f3d5f49d2ec4b12b8000000000000000000000000000000fee13a103a10d593b9ae06b3e05f2e7e1c00000000000000000000000000000000000000000000000000000000000000190000000000000000000000000000000000000000000000000000000000000060000000000000000000000000c56c7a0eaa804f854b536a5f3d5f49d2ec4b12b800000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000190240001b9872b',\n * r: '0x635dc2033e60185bb36709c29c75d64ea51dfbd91c32ef4be198e4ceb169fb4d',\n * s: '0x50c2667ac4c771072746acfdcf1f1483336dcca8bd2df47cd83175dbe60f0540',\n * yParity: '0x0',\n * chainId: '0x1',\n * accessList: [],\n * type: '0x2',\n * })\n * ```\n *\n * @param transaction - The RPC transaction to convert.\n * @returns An instantiated {@link ox#Transaction.Transaction}.\n */\nexport function fromRpc(transaction, _options = {}) {\n if (!transaction)\n return null;\n const signature = transaction.type === '0x6' ? undefined : Signature.extract(transaction);\n const transaction_ = {\n ...transaction,\n ...signature,\n };\n transaction_.blockNumber = transaction.blockNumber\n ? BigInt(transaction.blockNumber)\n : null;\n if ('blockTimestamp' in transaction)\n transaction_.blockTimestamp = transaction.blockTimestamp\n ? BigInt(transaction.blockTimestamp)\n : transaction.blockTimestamp === null\n ? null\n : undefined;\n transaction_.data = transaction.input;\n transaction_.gas = BigInt(transaction.gas ?? 0n);\n transaction_.nonce = BigInt(transaction.nonce ?? 0n);\n transaction_.transactionIndex = transaction.transactionIndex\n ? Number(transaction.transactionIndex)\n : null;\n transaction_.value = BigInt(transaction.value ?? 0n);\n if (transaction.type === '0x6' && transaction.nonceKeys !== undefined) {\n if (transaction.nonce === undefined)\n throw new FrameNonce.InvalidError('A keyed transaction result requires nonce.');\n transaction_.nonceKeys = FrameNonce.fromRpc(transaction.nonceKeys, transaction.nonce);\n }\n if (transaction.frames)\n transaction_.frames = transaction.frames.map(Frame.fromRpc);\n if (transaction.signatures)\n transaction_.signatures = transaction.signatures.map(FrameSignature.fromRpc);\n if (transaction.authorizationList)\n transaction_.authorizationList = Authorization.fromRpcList(transaction.authorizationList);\n if (transaction.chainId)\n transaction_.chainId =\n transaction.type === '0x6' &&\n BigInt(transaction.chainId) > BigInt(Number.MAX_SAFE_INTEGER)\n ? BigInt(transaction.chainId)\n : Number(transaction.chainId);\n if (transaction.gasPrice)\n transaction_.gasPrice = BigInt(transaction.gasPrice);\n if (transaction.maxFeePerBlobGas)\n transaction_.maxFeePerBlobGas = BigInt(transaction.maxFeePerBlobGas);\n if (transaction.maxFeePerGas)\n transaction_.maxFeePerGas = BigInt(transaction.maxFeePerGas);\n if (transaction.maxPriorityFeePerGas)\n transaction_.maxPriorityFeePerGas = BigInt(transaction.maxPriorityFeePerGas);\n if (transaction.type)\n transaction_.type =\n fromRpcType[transaction.type] ?? transaction.type;\n if (signature)\n transaction_.v = Signature.yParityToV(signature.yParity);\n return transaction_;\n}\n/**\n * Converts an {@link ox#Transaction.Transaction} to an {@link ox#Transaction.Rpc}.\n *\n * @example\n * ```ts twoslash\n * import { Transaction } from 'ox'\n *\n * const transaction = Transaction.toRpc({\n * accessList: [],\n * blockHash:\n * '0xc350d807505fb835650f0013632c5515592987ba169bbc6626d9fc54d91f0f0b',\n * blockNumber: 19868015n,\n * chainId: 1,\n * from: '0x814e5e0e31016b9a7f138c76b7e7b2bb5c1ab6a6',\n * gas: 278365n,\n * hash: '0x353fdfc38a2f26115daadee9f5b8392ce62b84f410957967e2ed56b35338cdd0',\n * input:\n * '0x3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006643504700000000000000000000000000000000000000000000000000000000000000040b080604000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002800000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000009b6e64a8ec600000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000009b6e64a8ec60000000000000000000000000000000000000000000000000000019124bb5ae978c000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000c56c7a0eaa804f854b536a5f3d5f49d2ec4b12b80000000000000000000000000000000000000000000000000000000000000060000000000000000000000000c56c7a0eaa804f854b536a5f3d5f49d2ec4b12b8000000000000000000000000000000fee13a103a10d593b9ae06b3e05f2e7e1c00000000000000000000000000000000000000000000000000000000000000190000000000000000000000000000000000000000000000000000000000000060000000000000000000000000c56c7a0eaa804f854b536a5f3d5f49d2ec4b12b800000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000190240001b9872b',\n * maxFeePerGas: 11985937556n,\n * maxPriorityFeePerGas: 68993984n,\n * nonce: 855n,\n * r: 44944627813007772897391531230081695102703289123332187696115181104739239197517n,\n * s: 36528503505192438307355164441104001310566505351980369085208178712678799181120n,\n * to: '0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad',\n * transactionIndex: 2,\n * type: 'eip1559',\n * v: 27,\n * value: 700000000000000000n,\n * yParity: 0,\n * })\n * ```\n *\n * @param transaction - The transaction to convert.\n * @returns An RPC-formatted transaction.\n */\nexport function toRpc(transaction, _options) {\n const rpc = {};\n rpc.blockHash = transaction.blockHash;\n rpc.blockNumber =\n typeof transaction.blockNumber === 'bigint'\n ? Hex.fromNumber(transaction.blockNumber)\n : null;\n if (typeof transaction.blockTimestamp === 'bigint')\n rpc.blockTimestamp = Hex.fromNumber(transaction.blockTimestamp);\n else if (transaction.blockTimestamp === null)\n rpc.blockTimestamp = null;\n rpc.from = transaction.from;\n rpc.gas = Hex.fromNumber(transaction.gas ?? 0n);\n rpc.hash = transaction.hash;\n rpc.input = transaction.input;\n rpc.nonce = Hex.fromNumber(transaction.nonce ?? 0n);\n rpc.to = transaction.to;\n rpc.transactionIndex = transaction.transactionIndex\n ? Hex.fromNumber(transaction.transactionIndex)\n : null;\n rpc.type = toRpcType[transaction.type] ?? transaction.type;\n rpc.value = Hex.fromNumber(transaction.value ?? 0n);\n if (transaction.type === 'eip8141' && transaction.nonceKeys !== undefined)\n rpc.nonceKeys = FrameNonce.toRpc(transaction.nonceKeys, transaction.nonce);\n if (transaction.frames)\n rpc.frames = transaction.frames.map(Frame.toRpc);\n if (transaction.signatures)\n rpc.signatures = transaction.signatures.map(FrameSignature.toRpc);\n if (transaction.accessList)\n rpc.accessList = transaction.accessList;\n if (transaction.authorizationList)\n rpc.authorizationList = Authorization.toRpcList(transaction.authorizationList);\n if (transaction.blobVersionedHashes)\n rpc.blobVersionedHashes = transaction.blobVersionedHashes;\n if (transaction.chainId)\n rpc.chainId = Hex.fromNumber(transaction.chainId);\n if (typeof transaction.gasPrice === 'bigint')\n rpc.gasPrice = Hex.fromNumber(transaction.gasPrice);\n if (typeof transaction.maxFeePerBlobGas === 'bigint')\n rpc.maxFeePerBlobGas = Hex.fromNumber(transaction.maxFeePerBlobGas);\n if (typeof transaction.maxFeePerGas === 'bigint')\n rpc.maxFeePerGas = Hex.fromNumber(transaction.maxFeePerGas);\n if (typeof transaction.maxPriorityFeePerGas === 'bigint')\n rpc.maxPriorityFeePerGas = Hex.fromNumber(transaction.maxPriorityFeePerGas);\n if (typeof transaction.r === 'bigint')\n rpc.r = Hex.fromNumber(transaction.r, { size: 32 });\n if (typeof transaction.s === 'bigint')\n rpc.s = Hex.fromNumber(transaction.s, { size: 32 });\n if (typeof transaction.v === 'number')\n rpc.v = Hex.fromNumber(transaction.v, { size: 1 });\n if (typeof transaction.yParity === 'number')\n rpc.yParity = transaction.yParity === 0 ? '0x0' : '0x1';\n return rpc;\n}\n//# sourceMappingURL=Transaction.js.map","import * as Frame from './Frame.js';\n/**\n * Converts an RPC frame request, preserving omitted gas limits for node estimation.\n *\n * @example\n * ```ts twoslash\n * import { FrameRequest } from 'ox'\n *\n * const frame = FrameRequest.fromRpc({ mode: '0x2', stateGas: '0x0' })\n * ```\n *\n * @param frame - The RPC frame request.\n * @returns The decoded request with omitted gas limits preserved.\n */\nexport function fromRpc(frame) {\n const { executionGas, stateGas, ...rest } = Frame.fromRpc({\n ...frame,\n data: frame.data ?? '0x',\n executionGas: frame.executionGas ?? '0x0',\n flags: frame.flags ?? '0x0',\n stateGas: frame.stateGas ?? '0x0',\n value: frame.value ?? '0x0',\n });\n return {\n ...rest,\n ...(frame.executionGas === undefined ? {} : { executionGas }),\n ...(frame.stateGas === undefined ? {} : { stateGas }),\n };\n}\n/**\n * Converts a frame request to RPC fields without filling omitted gas limits.\n *\n * Explicit zero limits remain zero. Omitted mode, flags, value, and data use frame defaults.\n *\n * @example\n * ```ts twoslash\n * import { FrameRequest } from 'ox'\n *\n * const frame = FrameRequest.toRpc({ mode: 'sender', stateGas: 0n })\n * ```\n *\n * @param frame - The frame request. Gas and value accept hex, bigint, or number values.\n * @returns The RPC request with omitted gas limits preserved.\n */\nexport function toRpc(frame) {\n const { executionGas, stateGas, ...rest } = Frame.toRpc(frame);\n return {\n ...rest,\n ...(frame.executionGas === undefined ? {} : { executionGas }),\n ...(frame.stateGas === undefined ? {} : { stateGas }),\n };\n}\n//# sourceMappingURL=FrameRequest.js.map","import * as Authorization from './Authorization.js';\nimport * as FrameRequest from './FrameRequest.js';\nimport * as FrameSignature from './FrameSignature.js';\nimport * as Hex from './Hex.js';\nimport * as FrameNonce from './internal/frameNonce.js';\nimport * as Transaction from './Transaction.js';\n/**\n * Converts a {@link ox#TransactionRequest.Rpc} to a {@link ox#TransactionRequest.TransactionRequest}.\n *\n * @example\n * ```ts twoslash\n * import { TransactionRequest } from 'ox'\n *\n * const request = TransactionRequest.fromRpc({\n * to: '0x0000000000000000000000000000000000000000',\n * value: '0x2386f26fc10000',\n * })\n * ```\n *\n * @param request - The RPC request to convert.\n * @returns A transaction request.\n */\nexport function fromRpc(request) {\n const request_ = { ...request };\n if (typeof request.authorizationList !== 'undefined')\n request_.authorizationList = Authorization.fromRpcList(request.authorizationList);\n if (typeof request.chainId !== 'undefined')\n request_.chainId = Hex.toNumber(request.chainId);\n if (request.frames)\n request_.frames = request.frames.map(FrameRequest.fromRpc);\n if (request.signatures)\n request_.signatures = request.signatures.map(FrameSignature.fromRpc);\n if (typeof request.gas !== 'undefined')\n request_.gas = Hex.toBigInt(request.gas);\n if (typeof request.gasPrice !== 'undefined')\n request_.gasPrice = Hex.toBigInt(request.gasPrice);\n if (typeof request.maxFeePerBlobGas !== 'undefined')\n request_.maxFeePerBlobGas = Hex.toBigInt(request.maxFeePerBlobGas);\n if (typeof request.maxFeePerGas !== 'undefined')\n request_.maxFeePerGas = Hex.toBigInt(request.maxFeePerGas);\n if (typeof request.maxPriorityFeePerGas !== 'undefined')\n request_.maxPriorityFeePerGas = Hex.toBigInt(request.maxPriorityFeePerGas);\n if (typeof request.nonce !== 'undefined')\n request_.nonce = Hex.toBigInt(request.nonce);\n if (request.nonceKeys !== undefined)\n request_.nonceKeys = FrameNonce.fromRpc(request.nonceKeys, request.nonce);\n if (typeof request.type !== 'undefined')\n request_.type =\n Transaction.fromRpcType[request.type] || request.type;\n if (typeof request.value !== 'undefined')\n request_.value = Hex.toBigInt(request.value);\n return request_;\n}\n/**\n * Converts a {@link ox#TransactionRequest.TransactionRequest} to a {@link ox#TransactionRequest.Rpc}.\n *\n * @example\n * ```ts twoslash\n * import { TransactionRequest, Value } from 'ox'\n *\n * const request = TransactionRequest.toRpc({\n * to: '0x0000000000000000000000000000000000000000',\n * value: Value.fromEther('0.01'),\n * })\n * ```\n *\n * @example\n * ### Using with a Provider\n *\n * You can use {@link ox#Provider.(from:function)} to instantiate an EIP-1193 Provider and\n * send a transaction to the Wallet using the `eth_sendTransaction` method.\n *\n * ```ts twoslash\n * import 'ox/window'\n * import { Provider, TransactionRequest, Value } from 'ox'\n *\n * const provider = Provider.from(window.ethereum!)\n *\n * const request = TransactionRequest.toRpc({\n * to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',\n * value: Value.fromEther('0.01'),\n * })\n *\n * const hash = await provider.request({ // [!code focus]\n * method: 'eth_sendTransaction', // [!code focus]\n * params: [request], // [!code focus]\n * }) // [!code focus]\n * ```\n *\n * @param request - The request to convert.\n * @returns An RPC request.\n */\nexport function toRpc(request) {\n const request_rpc = {};\n if (typeof request.accessList !== 'undefined')\n request_rpc.accessList = request.accessList;\n if (typeof request.authorizationList !== 'undefined')\n request_rpc.authorizationList = Authorization.toRpcList(request.authorizationList);\n if (typeof request.blobVersionedHashes !== 'undefined')\n request_rpc.blobVersionedHashes = request.blobVersionedHashes;\n if (typeof request.blobs !== 'undefined')\n request_rpc.blobs = request.blobs;\n if (typeof request.chainId !== 'undefined')\n request_rpc.chainId = Hex.fromNumber(request.chainId);\n if (typeof request.data !== 'undefined') {\n request_rpc.data = request.data;\n request_rpc.input = request.data;\n }\n else if (typeof request.input !== 'undefined') {\n request_rpc.data = request.input;\n request_rpc.input = request.input;\n }\n if (typeof request.from !== 'undefined')\n request_rpc.from = request.from;\n if (request.frames)\n request_rpc.frames = request.frames.map(FrameRequest.toRpc);\n if (request.signatures)\n request_rpc.signatures = request.signatures.map(FrameSignature.toRpc);\n if (typeof request.gas !== 'undefined')\n request_rpc.gas = Hex.fromNumber(request.gas);\n if (typeof request.gasPrice !== 'undefined')\n request_rpc.gasPrice = Hex.fromNumber(request.gasPrice);\n if (typeof request.maxFeePerBlobGas !== 'undefined')\n request_rpc.maxFeePerBlobGas = Hex.fromNumber(request.maxFeePerBlobGas);\n if (typeof request.maxFeePerGas !== 'undefined')\n request_rpc.maxFeePerGas = Hex.fromNumber(request.maxFeePerGas);\n if (typeof request.maxPriorityFeePerGas !== 'undefined')\n request_rpc.maxPriorityFeePerGas = Hex.fromNumber(request.maxPriorityFeePerGas);\n if (typeof request.maxPriorityFeePerGas !== 'undefined')\n request_rpc.maxPriorityFeePerGas = Hex.fromNumber(request.maxPriorityFeePerGas);\n if (typeof request.nonce !== 'undefined')\n request_rpc.nonce = Hex.fromNumber(request.nonce);\n if (request.nonceKeys !== undefined)\n request_rpc.nonceKeys = FrameNonce.toRpc(request.nonceKeys, request.nonce);\n if (typeof request.to !== 'undefined')\n request_rpc.to = request.to;\n if (typeof request.type !== 'undefined')\n request_rpc.type =\n Transaction.toRpcType[request.type] || request.type;\n if (typeof request.value !== 'undefined')\n request_rpc.value = Hex.fromNumber(request.value);\n return request_rpc;\n}\n//# sourceMappingURL=TransactionRequest.js.map","/**\n * Prints `Log` entries as condensed lines on the Vite dev server. The production build logs objects.\n * @module\n */\n\n/** Each level's label and ANSI color in the dev server's lines. */\nconst levels = {\n error: { color: 31, label: 'ERROR' },\n info: { color: 32, label: ' INFO' },\n warn: { color: 33, label: ' WARN' },\n} as const\n\n/** Flattens nested objects into `[key, value]` pairs with dotted keys, such as `request.id`. */\nfunction flatten(\n value: object,\n options: flatten.Options = { prefix: '' },\n): [string, unknown][] {\n return Object.entries(value).flatMap((pair): [string, unknown][] => {\n const key = `${options.prefix}${pair[0]}`\n const item: unknown = pair[1]\n if (typeof item === 'object' && item !== null && !Array.isArray(item))\n return flatten(item, { prefix: `${key}.` })\n return [[key, item]]\n })\n}\n\ndeclare namespace flatten {\n type Options = {\n /** The dotted path so far, such as `error.cause.`. */\n prefix: string\n }\n}\n\n/** Formats a log entry as one line in the style of Rust's `tracing`, then indented stack frames. */\nexport function format(\n value: Record<string, unknown>,\n options: format.Options,\n) {\n const { message, ...fields } = value\n const level = levels[options.level]\n const pairs = flatten(fields)\n\n const head = [\n `\\x1b[2m${new Date().toISOString().slice(11, 23)}\\x1b[0m`,\n `\\x1b[1;${level.color}m${level.label}\\x1b[0m`,\n `\\x1b[1m${String(message)}\\x1b[0m`,\n ...pairs\n .filter((pair) => !pair[0].endsWith('stack'))\n .map(\n (pair) => `\\x1b[3m${pair[0]}\\x1b[0m\\x1b[2m=\\x1b[0m${quote(pair[1])}`,\n ),\n ].join(' ')\n const frames = pairs\n .filter((pair) => pair[0].endsWith('stack'))\n .flatMap((pair) => String(pair[1]).split('\\n'))\n // Paths start at `src/` or `node_modules/`, without the checkout or pnpm's store directory.\n .map((frame) =>\n frame\n .replace(\n /\\/node_modules\\/\\.pnpm\\/[^/]+\\/node_modules\\//,\n '/node_modules/',\n )\n .replace(/\\((?:\\/[^()]*?)?\\/((?:node_modules|src)\\/[^()]*)\\)/, '($1)'),\n )\n .map((frame) => `\\x1b[2m ${frame}\\x1b[0m`)\n return [head, ...frames].join('\\n')\n}\n\nexport declare namespace format {\n type Options = {\n /** The entry's level. */\n level: keyof typeof levels\n }\n}\n\n/** Quotes a value with whitespace, a quote, or `=`, so each pair stays one token. */\nfunction quote(value: unknown) {\n const text = String(value)\n return /[\\s\"=]/.test(text) || text === '' ? JSON.stringify(text) : text\n}\n","/**\n * Structured logs for the Worker, one object per entry, which Workers Logs indexes by field. An\n * entry holds a fixed message, chosen fields, the request's ID, method, and route, and an error's\n * safe properties. Headers, bodies, query strings, and path parameters never reach a log.\n * @module\n */\nimport type { Context } from 'hono'\nimport * as LogLine from './LogLine.js'\n\n/** What a log entry records. */\nexport type Options = {\n /** The error behind the entry. */\n error?: unknown\n /** Extra fields to index, such as a client ID. Never secrets, tokens, or personal data. */\n fields?: Record<string, boolean | number | string | undefined> | undefined\n /** A fixed sentence, which occurrences group by. It never holds values. */\n message: string\n}\n\n/** Returns whether the module runs on the Vite dev server. */\nexport function dev() {\n return (import.meta as Meta).env?.DEV === true\n}\n\n/** Logs an unexpected failure. Outside a request, such as in a cron, it takes no context. */\nexport function error(c: Context, options: Options): void\nexport function error(options: Options): void\nexport function error(...parameters: [Context, Options] | [Options]) {\n console.error(print(entry(...parameters), { level: 'error' }))\n}\n\n/** Logs a routine event worth keeping, such as a configuration change. */\nexport function info(c: Context, options: Options): void\nexport function info(options: Options): void\nexport function info(...parameters: [Context, Options] | [Options]) {\n console.info(print(entry(...parameters), { level: 'info' }))\n}\n\n/**\n * Returns the pattern of the first matched route without a wildcard, such as\n * `/v1/device/requests/:code`, which hides path parameters. Without one, returns `/*`, since the\n * path can carry a code.\n */\nexport function route(c: Context) {\n // The `hono/route` helper reads a symbol of its own Hono copy, and the Vite dev server loads Void's\n // Hono as another copy. The request's own getter works with either.\n return (\n c.req.matchedRoutes.find((entry) => !entry.path.includes('*'))?.path ?? '/*'\n )\n}\n\n/** Logs a recoverable problem that did not fail the request. */\nexport function warn(c: Context, options: Options): void\nexport function warn(options: Options): void\nexport function warn(...parameters: [Context, Options] | [Options]) {\n console.warn(print(entry(...parameters), { level: 'warn' }))\n}\n\n/** The part of `import.meta` that Vite fills. */\ntype Meta = ImportMeta & {\n /** Absent outside Vite. */\n env?:\n | {\n /** Whether the module runs on the Vite dev server. */\n DEV?: boolean | undefined\n }\n | undefined\n}\n\n/** Returns an object without its `undefined` properties. */\nfunction compact(value: Record<string, unknown>) {\n return Object.fromEntries(\n Object.entries(value).filter((pair) => pair[1] !== undefined),\n )\n}\n\n/** The parts of an error that are safe to log, with its causes up to three deep. */\nfunction describe(\n error: unknown,\n options: describe.Options = { depth: 0 },\n): Record<string, unknown> {\n // A thrown value that is not an `Error` can be anything, including a secret.\n if (!(error instanceof Error)) return { name: 'NonError', type: typeof error }\n\n // Viem and ox put request arguments, which can hold ID tokens and proofs, in `message`, and a\n // summary in `shortMessage`. Drizzle puts a failed query's parameters, which can hold an email\n // address or a code, in `message`, and the query alone in `query`. The stack repeats the message,\n // so only its frames are kept.\n const message = (() => {\n const shortMessage = read(error, { key: 'shortMessage' })\n if (typeof shortMessage === 'string') return shortMessage\n const query = read(error, { key: 'query' })\n if (\n typeof query === 'string' &&\n Array.isArray(Reflect.get(error, 'params'))\n )\n return `Failed query: ${query}`\n return error.message\n })()\n const status = read(error, { key: 'status' })\n return compact({\n cause:\n error.cause !== undefined && options.depth < 3\n ? describe(error.cause, { depth: options.depth + 1 })\n : undefined,\n code: read(error, { key: 'code' }),\n // Viem's `RpcRequestError` holds the node's JSON-RPC error message in `details`, such as the\n // reason that a relay refuses a transaction. Its `message` adds the URL, which can hold a\n // provider's key, and the request body, so only `details` is kept.\n details:\n error.name === 'RpcRequestError'\n ? read(error, { key: 'details' })\n : undefined,\n message,\n name: error.name,\n stack: error.stack\n ?.split('\\n')\n .filter((line) => /^\\s+at /.test(line))\n .map((line) => line.trim())\n .join('\\n'),\n status: typeof status === 'number' ? status : undefined,\n })\n}\n\ndeclare namespace describe {\n type Options = {\n /** How many causes deep this error is. */\n depth: number\n }\n}\n\n/** Builds the logged object, leaving out absent fields. */\nfunction entry(...parameters: [Context, Options] | [Options]) {\n const [c, options] =\n parameters.length === 2 ? parameters : [undefined, parameters[0]]\n const { error, fields, message } = options\n return compact({\n // Fields come first, so they never replace the entry's own keys.\n ...fields,\n error: error === undefined ? undefined : describe(error),\n message,\n request: c\n ? compact({\n id: c.get('requestId'),\n method: c.req.method,\n path: route(c),\n })\n : undefined,\n })\n}\n\n/** Returns the entry as an object, or as one condensed line on the Vite dev server. */\nfunction print(\n value: Record<string, unknown>,\n options: LogLine.format.Options,\n) {\n return dev() ? LogLine.format(value, options) : value\n}\n\n/** Reads an error property when it is a string or number. */\nfunction read(error: Error, options: { key: string }) {\n const value: unknown = Reflect.get(error, options.key)\n return typeof value === 'string' || typeof value === 'number'\n ? value\n : undefined\n}\n","import * as Address from '../core/Address.js';\nimport * as Errors from '../core/Errors.js';\nimport * as Hash from '../core/Hash.js';\nimport * as Hex from '../core/Hex.js';\nimport * as AccountConfig from './AccountConfig.js';\nimport * as KeyAuthorization_ from './KeyAuthorization.js';\nimport * as SignatureEnvelope from './SignatureEnvelope.js';\nimport * as TxEnvelopeTempo from './TxEnvelopeTempo.js';\n/**\n * Derives the deterministic hash for an account operation.\n *\n * @example\n * ```ts twoslash\n * // @noErrors\n * import { AccountOperation } from 'ox/tempo'\n *\n * const hash = AccountOperation.getHash({\n * account,\n * config,\n * transaction,\n * type: 'transaction',\n * })\n * ```\n *\n * @param options - Operation payload and account identity.\n * @returns The operation hash signed by each owner.\n */\nexport function getHash(options) {\n const { account, config } = options;\n const payload = options.type === 'transaction'\n ? TxEnvelopeTempo.getSignPayload(TxEnvelopeTempo.deserialize(options.transaction))\n : KeyAuthorization_.getSignPayload(KeyAuthorization_.deserialize(options.keyAuthorization));\n return AccountConfig.getSignPayload({\n account,\n config,\n payload,\n });\n}\n/**\n * Validates, deduplicates, and selects owner approvals for an operation.\n *\n * The function retains one canonical approval per owner. It selects the\n * smallest deterministic quorum by owner weight, then orders the selected\n * approvals by owner address for serialization. The caller supplies the\n * account and config; the chain validates their factory-derived identity.\n *\n * @example\n * ```ts twoslash\n * // @noErrors\n * import { AccountOperation } from 'ox/tempo'\n *\n * const selection = await AccountOperation.selectApprovals({\n * account,\n * approvals,\n * config,\n * hash,\n * })\n * ```\n *\n * @param options - Approval selection parameters.\n * @returns The retained approvals and deterministic quorum selection.\n */\nexport async function selectApprovals(options) {\n const { account, approvals, hash } = options;\n if (!Address.validate(account) || Hex.toBigInt(account) === 0n)\n throw new InvalidApprovalError({ reason: 'account is invalid' });\n if (!Hash.validate(hash))\n throw new InvalidApprovalError({ reason: 'hash is invalid' });\n const config = AccountConfig.from(options.config);\n return selectApprovals_internal({\n account,\n approvals,\n config,\n hash,\n });\n}\n/**\n * Serializes a key authorization with selected owner approvals.\n *\n * @example\n * ```ts twoslash\n * // @noErrors\n * import { AccountOperation } from 'ox/tempo'\n *\n * const authorization = AccountOperation.serializeKeyAuthorization(\n * keyAuthorization,\n * {\n * account,\n * approvals: selection.selectedApprovals,\n * config,\n * },\n * )\n * ```\n *\n * @param keyAuthorization - Canonical serialized unsigned key authorization.\n * @param options - Configurable account, config, and selected approvals.\n * @returns The signed serialized key authorization.\n */\nexport function serializeKeyAuthorization(keyAuthorization, options) {\n const authorization = KeyAuthorization_.deserialize(keyAuthorization);\n if (authorization.signature)\n throw new InvalidOperationError({\n reason: 'keyAuthorization must not contain a signature',\n });\n if (KeyAuthorization_.serialize(authorization).toLowerCase() !==\n keyAuthorization.toLowerCase())\n throw new InvalidOperationError({\n reason: 'keyAuthorization is not canonically serialized',\n });\n const config = AccountConfig.from(options.config);\n const signatures = SignatureEnvelope.sortApprovals({\n account: options.account,\n config,\n payload: KeyAuthorization_.getSignPayload(authorization),\n signatures: options.approvals.map((approval) => assertApproval(options.account, approval, config)),\n });\n return KeyAuthorization_.serialize(KeyAuthorization_.from(authorization, {\n signature: SignatureEnvelope.from({\n account: options.account,\n config,\n signatures,\n }),\n }));\n}\n/**\n * Serializes an account transaction operation with selected owner approvals.\n *\n * @example\n * ```ts twoslash\n * // @noErrors\n * import { AccountOperation } from 'ox/tempo'\n *\n * const transaction = AccountOperation.serializeTransaction(operation, {\n * approvals: selection.selectedApprovals,\n * })\n * ```\n *\n * @param operation - Account transaction operation.\n * @param options - Transaction serialization options.\n * @returns The signed serialized Tempo transaction.\n */\nexport function serializeTransaction(operation, options) {\n const value = from(operation);\n const envelope = TxEnvelopeTempo.deserialize(value.transaction);\n const approvals = options.approvals.map((approval) => assertApproval(value.account, approval, value.config));\n assertRetainedApprovals(value, approvals);\n const signatures = SignatureEnvelope.sortApprovals({\n account: value.account,\n config: value.config,\n payload: TxEnvelopeTempo.getSignPayload(envelope),\n signatures: approvals,\n });\n const signature = SignatureEnvelope.from({\n account: value.account,\n config: value.config,\n signatures,\n });\n return TxEnvelopeTempo.serialize(envelope, value.transaction.startsWith(TxEnvelopeTempo.feePayerMagic)\n ? {\n format: 'feePayer',\n sender: envelope.from,\n signature,\n }\n : { signature });\n}\n/**\n * Validates and normalizes an account operation.\n *\n * @example\n * ```ts twoslash\n * // @noErrors\n * import { AccountOperation } from 'ox/tempo'\n *\n * const operation = AccountOperation.from(value)\n * ```\n *\n * @param operation - Account operation.\n * @returns The validated operation.\n */\nexport function from(operation) {\n try {\n const config = AccountConfig.from(operation.config);\n if (typeof config.threshold !== 'number' ||\n config.owners.some((owner) => typeof owner.weight !== 'number'))\n throw new InvalidOperationError({\n reason: 'config threshold and owner weights must be numbers',\n });\n const value = { ...operation, config };\n assertBase(value, config);\n if (value.type === 'transaction')\n assertTransaction(value);\n else if (value.type === 'keyAuthorization')\n assertKeyAuthorization(value, config);\n else\n throw new InvalidOperationError({ reason: 'unknown operation type' });\n return value;\n }\n catch (cause) {\n if (cause instanceof InvalidOperationError)\n throw cause;\n throw new InvalidOperationError({ cause });\n }\n}\n/**\n * Converts a JSON-RPC account operation to its domain representation.\n *\n * @example\n * ```ts twoslash\n * // @noErrors\n * import { AccountOperation } from 'ox/tempo'\n *\n * const operation = AccountOperation.fromRpc(value)\n * ```\n *\n * @param operation - JSON-RPC account operation.\n * @returns The validated operation.\n */\nexport function fromRpc(operation) {\n try {\n const version = operation.config?.version;\n if (typeof version !== 'string' || !Hex.validate(version))\n throw new InvalidOperationError({\n reason: 'config.version must be a hexadecimal quantity',\n });\n const version_ = Hex.toBigInt(version);\n if (Hex.fromNumber(version_) !== version)\n throw new InvalidOperationError({\n reason: 'config.version must use canonical quantity encoding',\n });\n return from({\n ...operation,\n config: AccountConfig.fromRpc(operation.config),\n });\n }\n catch (cause) {\n if (cause instanceof InvalidOperationError)\n throw cause;\n throw new InvalidOperationError({ cause });\n }\n}\n/**\n * Converts an account operation to its JSON-RPC representation.\n *\n * @example\n * ```ts twoslash\n * // @noErrors\n * import { AccountOperation } from 'ox/tempo'\n *\n * const operationRpc = AccountOperation.toRpc(operation)\n * ```\n *\n * @param operation - Account operation.\n * @returns The JSON-RPC operation.\n */\nexport function toRpc(operation) {\n const value = from(operation);\n return {\n ...value,\n config: AccountConfig.toRpc(value.config),\n };\n}\n/**\n * Validates and selects approvals recursively.\n *\n * @internal\n */\nasync function selectApprovals_internal(options) {\n const owners = new Map(options.config.owners.map((owner) => [\n owner.owner.toLowerCase(),\n { address: owner.owner, weight: Number(owner.weight) },\n ]));\n const groups = new Map();\n for (const serialized of options.approvals) {\n const signature = SignatureEnvelope.from(serialized);\n if (signature.type === 'keychain' || signature.type === 'configurable')\n throw new InvalidApprovalError({\n reason: 'only primitive signatures can approve an account operation',\n });\n const address = SignatureEnvelope.extractAddress({\n payload: options.hash,\n signature,\n });\n const owner = owners.get(address.toLowerCase());\n if (!owner)\n throw new InvalidApprovalError({\n reason: `signature is from non-owner ${address}`,\n });\n const key = address.toLowerCase();\n const group = groups.get(key);\n if (group)\n group.signatures.push(signature);\n else\n groups.set(key, {\n address: owner.address,\n signatures: [signature],\n weight: owner.weight,\n });\n }\n const valid = [];\n const retained = [];\n for (const group of groups.values()) {\n const signatures = group.signatures.map((signature) => {\n if (!SignatureEnvelope.verify(signature, {\n address: group.address,\n payload: options.hash,\n }))\n throw new InvalidApprovalError({\n reason: `signature from owner ${group.address} is invalid`,\n });\n return SignatureEnvelope.serialize(signature);\n });\n const signature = signatures.sort(compareHex)[0];\n valid.push({\n address: group.address,\n signature,\n weight: group.weight,\n });\n retained.push({ address: group.address, signature });\n }\n const ranked = valid.sort((a, b) => b.weight - a.weight || compareApprovalAddress(a, b));\n const selected = [];\n let weight = 0;\n for (const approval of ranked.slice(0, AccountConfig.maxSignatures)) {\n if (weight >= Number(options.config.threshold))\n break;\n selected.push(approval);\n weight += approval.weight;\n }\n selected.sort(compareApprovalAddress);\n return {\n approvals: retained\n .sort(compareApprovalAddress)\n .map((approval) => approval.signature),\n selectedApprovals: selected.map((approval) => approval.signature),\n signatureCount: selected.length,\n threshold: Number(options.config.threshold),\n weight,\n };\n}\n/**\n * Orders approval records by owner address.\n *\n * @internal\n */\nfunction compareApprovalAddress(a, b) {\n const addressA = Hex.toBigInt(a.address);\n const addressB = Hex.toBigInt(b.address);\n return addressA < addressB ? -1 : addressA > addressB ? 1 : 0;\n}\n/**\n * Orders hexadecimal data bytewise.\n *\n * @internal\n */\nfunction compareHex(a, b) {\n const hexA = a.toLowerCase();\n const hexB = b.toLowerCase();\n return hexA < hexB ? -1 : hexA > hexB ? 1 : 0;\n}\n/**\n * Validates fields shared by every operation.\n *\n * @internal\n */\nfunction assertBase(operation, config) {\n if (!Address.validate(operation.account))\n throw new InvalidOperationError({ reason: 'account is invalid' });\n if (Hex.toBigInt(operation.account) === 0n)\n throw new InvalidOperationError({ reason: 'account cannot be zero' });\n if (!Hash.validate(operation.hash))\n throw new InvalidOperationError({ reason: 'hash is invalid' });\n assertInteger(operation.createdAt, 'createdAt');\n assertInteger(operation.updatedAt, 'updatedAt');\n if (operation.updatedAt < operation.createdAt)\n throw new InvalidOperationError({\n reason: 'updatedAt cannot precede createdAt',\n });\n assertInteger(operation.signatureCount, 'signatureCount');\n assertInteger(operation.threshold, 'threshold');\n assertInteger(operation.weight, 'weight');\n if (operation.threshold !== Number(config.threshold))\n throw new InvalidOperationError({\n reason: 'threshold must equal config.threshold',\n });\n if (operation.weight > 0xff)\n throw new InvalidOperationError({ reason: 'weight exceeds u8 max' });\n if (operation.signatureCount > AccountConfig.maxSignatures)\n throw new InvalidOperationError({ reason: 'too many selected signatures' });\n if (!Array.isArray(operation.approvals))\n throw new InvalidOperationError({ reason: 'approvals must be an array' });\n if (operation.approvals.length > config.owners.length)\n throw new InvalidOperationError({ reason: 'too many retained approvals' });\n if (operation.signatureCount > operation.approvals.length)\n throw new InvalidOperationError({\n reason: 'signatureCount exceeds retained approvals',\n });\n if ((operation.signatureCount === 0) !== (operation.weight === 0))\n throw new InvalidOperationError({\n reason: 'signatureCount and weight must both be zero or nonzero',\n });\n const owners = new Map(config.owners.map((owner) => [\n owner.owner.toLowerCase(),\n Number(owner.weight),\n ]));\n const approvalWeights = [];\n const seen = new Set();\n for (const approval of operation.approvals) {\n if (typeof approval !== 'string' ||\n !Hex.validate(approval, { strict: true }))\n throw new InvalidOperationError({ reason: 'approval is invalid' });\n const signature = assertApproval(operation.account, approval, config);\n const address = SignatureEnvelope.extractAddress({\n payload: operation.hash,\n signature,\n });\n const key = address.toLowerCase();\n const weight = owners.get(key);\n if (weight === undefined)\n throw new InvalidOperationError({\n reason: 'approval is from a non-owner',\n });\n if (seen.has(key))\n throw new InvalidOperationError({\n reason: operation.type === 'keyAuthorization'\n ? 'key authorization contains duplicate owner approvals'\n : 'duplicate owner approval',\n });\n seen.add(key);\n approvalWeights.push(weight);\n }\n if (!isWeightReachable(approvalWeights, operation.signatureCount, operation.weight))\n throw new InvalidOperationError({\n reason: 'weight is not reachable by signatureCount retained owner approvals',\n });\n}\n/**\n * Validates a transaction operation and its state-specific fields.\n *\n * @internal\n */\nfunction assertTransaction(operation) {\n if ('keyAuthorization' in operation &&\n operation.keyAuthorization !== undefined)\n throw new InvalidOperationError({\n reason: 'transaction operations cannot contain keyAuthorization',\n });\n const expiresAt = operation.expiresAt;\n const submissionId = operation.submissionId;\n const transactionHash = operation.transactionHash;\n if (operation.status === 'pending') {\n if (expiresAt !== undefined ||\n submissionId !== undefined ||\n transactionHash !== undefined)\n throw new InvalidOperationError({\n reason: 'pending transactions cannot contain submission fields',\n });\n }\n else if (operation.status === 'submitting') {\n assertInteger(expiresAt, 'expiresAt');\n if (!Hash.validate(submissionId ?? ''))\n throw new InvalidOperationError({ reason: 'submissionId is invalid' });\n if (submissionId.toLowerCase() === operation.hash.toLowerCase())\n throw new InvalidOperationError({\n reason: 'submissionId must differ from the operation hash',\n });\n if (transactionHash !== undefined)\n throw new InvalidOperationError({\n reason: 'submitting transactions cannot contain transactionHash',\n });\n }\n else if (operation.status === 'success') {\n if (!Hash.validate(transactionHash ?? ''))\n throw new InvalidOperationError({ reason: 'transactionHash is invalid' });\n if (expiresAt !== undefined || submissionId !== undefined)\n throw new InvalidOperationError({\n reason: 'successful transactions cannot contain submission fields',\n });\n }\n else\n throw new InvalidOperationError({ reason: 'invalid transaction status' });\n if (operation.status !== 'pending' &&\n (operation.weight < operation.threshold || operation.signatureCount === 0))\n throw new InvalidOperationError({\n reason: 'submitted transactions must have quorum',\n });\n if (typeof operation.transaction !== 'string')\n throw new InvalidOperationError({ reason: 'transaction is invalid' });\n const transaction = TxEnvelopeTempo.deserialize(operation.transaction);\n if (transaction.signature)\n throw new InvalidOperationError({\n reason: 'transaction must not contain an outer sender signature',\n });\n if (transaction.from &&\n transaction.from.toLowerCase() !== operation.account.toLowerCase())\n throw new InvalidOperationError({\n reason: 'transaction sender does not match the operation account',\n });\n assertOperationHash(operation, TxEnvelopeTempo.getSignPayload(transaction));\n const feePayer = operation.transaction.startsWith(TxEnvelopeTempo.feePayerMagic);\n const serialized = TxEnvelopeTempo.serialize(transaction, feePayer\n ? transaction.from\n ? { format: 'feePayer', sender: transaction.from }\n : { format: 'feePayer' }\n : {});\n if (serialized.toLowerCase() !== operation.transaction.toLowerCase())\n throw new InvalidOperationError({\n reason: 'transaction is not canonically serialized',\n });\n}\n/**\n * Validates a key authorization operation and its serialized payload.\n *\n * @internal\n */\nfunction assertKeyAuthorization(operation, config) {\n const transactionFields = operation;\n if (transactionFields.expiresAt !== undefined ||\n transactionFields.submissionId !== undefined ||\n transactionFields.transaction !== undefined ||\n transactionFields.transactionHash !== undefined)\n throw new InvalidOperationError({\n reason: 'key authorization operations cannot contain transaction fields',\n });\n if (operation.status !== 'pending' && operation.status !== 'success')\n throw new InvalidOperationError({\n reason: 'invalid key authorization status',\n });\n if (operation.status === 'success' &&\n (operation.weight < operation.threshold || operation.signatureCount === 0))\n throw new InvalidOperationError({\n reason: 'successful key authorizations must have quorum',\n });\n if (operation.status === 'pending' && operation.weight >= operation.threshold)\n throw new InvalidOperationError({\n reason: 'pending key authorizations cannot have quorum',\n });\n if (typeof operation.keyAuthorization !== 'string')\n throw new InvalidOperationError({ reason: 'keyAuthorization is invalid' });\n const authorization = KeyAuthorization_.deserialize(operation.keyAuthorization);\n if (!authorization.account ||\n authorization.account.toLowerCase() !== operation.account.toLowerCase())\n throw new InvalidOperationError({\n reason: 'key authorization account does not match the operation account',\n });\n const signature = authorization.signature;\n if (operation.status === 'pending' && signature)\n throw new InvalidOperationError({\n reason: 'pending key authorizations must be unsigned',\n });\n if (operation.status === 'success') {\n if (signature?.type !== 'configurable')\n throw new InvalidOperationError({\n reason: 'successful key authorizations require a configurable account signature',\n });\n if (signature.account.toLowerCase() !== operation.account.toLowerCase())\n throw new InvalidOperationError({\n reason: 'key authorization signature account does not match',\n });\n if (signature.signatures.length !== operation.signatureCount)\n throw new InvalidOperationError({\n reason: 'key authorization signatureCount does not match its signature',\n });\n assertSelectedApprovals(operation, signature.signatures, authorization);\n if (!sameConfig(signature.config, config))\n throw new InvalidOperationError({\n reason: 'key authorization config does not match',\n });\n }\n assertOperationHash(operation, KeyAuthorization_.getSignPayload(authorization));\n if (KeyAuthorization_.serialize(authorization).toLowerCase() !==\n operation.keyAuthorization.toLowerCase())\n throw new InvalidOperationError({\n reason: 'keyAuthorization is not canonically serialized',\n });\n}\n/**\n * Validates a retained signature in the root owner's approval context.\n *\n * @internal\n */\nfunction assertApproval(account, serialized, config) {\n const approval = SignatureEnvelope.deserialize(serialized);\n if (approval.type === 'keychain' || approval.type === 'configurable')\n throw new InvalidOperationError({\n reason: 'only primitive owner approvals are allowed',\n });\n SignatureEnvelope.assert({\n account,\n config,\n signatures: [approval],\n type: 'configurable',\n });\n if (SignatureEnvelope.serialize(approval).toLowerCase() !==\n serialized.toLowerCase())\n throw new InvalidOperationError({ reason: 'approval is not canonical' });\n return approval;\n}\n/**\n * Checks that selected transaction approvals are retained by the operation.\n *\n * @internal\n */\nfunction assertRetainedApprovals(operation, selected) {\n const retained = operation.approvals.map((approval) => SignatureEnvelope.deserialize(approval));\n for (const approval of selected) {\n const index = retained.findIndex((candidate) => SignatureEnvelope.serialize(candidate).toLowerCase() ===\n SignatureEnvelope.serialize(approval).toLowerCase());\n if (index === -1)\n throw new InvalidOperationError({\n reason: 'transaction signature is not a retained approval',\n });\n retained.splice(index, 1);\n }\n}\n/**\n * Checks that a successful key authorization uses retained approvals in canonical order.\n *\n * @internal\n */\nfunction assertSelectedApprovals(operation, selected, authorization) {\n const retained = operation.approvals.map((approval) => SignatureEnvelope.deserialize(approval));\n for (const approval of selected) {\n const index = retained.findIndex((candidate) => SignatureEnvelope.serialize(candidate).toLowerCase() ===\n SignatureEnvelope.serialize(approval).toLowerCase());\n if (index === -1)\n throw new InvalidOperationError({\n reason: 'key authorization signature is not a retained approval',\n });\n retained.splice(index, 1);\n }\n const digest = AccountConfig.getSignPayload({\n account: operation.account,\n config: operation.config,\n payload: KeyAuthorization_.getSignPayload(authorization),\n });\n const addresses = selected.map((signature) => SignatureEnvelope.extractAddress({ payload: digest, signature }));\n for (let index = 1; index < addresses.length; index++) {\n const previous = Hex.toBigInt(addresses[index - 1]);\n const current = Hex.toBigInt(addresses[index]);\n if (previous === current)\n throw new InvalidOperationError({\n reason: 'key authorization contains duplicate owner approvals',\n });\n if (previous > current)\n throw new InvalidOperationError({\n reason: 'key authorization approvals are not canonically ordered',\n });\n }\n}\n/**\n * Checks whether exactly `signatureCount` retained owners can produce `weight`.\n *\n * @internal\n */\nfunction isWeightReachable(weights, signatureCount, weight) {\n const reachable = Array.from({ length: signatureCount + 1 }, () => new Set());\n reachable[0].add(0);\n for (const ownerWeight of weights)\n for (let count = signatureCount; count > 0; count--)\n for (const current of reachable[count - 1])\n reachable[count].add(current + ownerWeight);\n return reachable[signatureCount].has(weight);\n}\n/**\n * Validates the deterministic operation hash.\n *\n * @internal\n */\nfunction assertOperationHash(operation, payload) {\n const hash = AccountConfig.getSignPayload({\n account: operation.account,\n config: operation.config,\n payload,\n });\n if (hash.toLowerCase() !== operation.hash.toLowerCase())\n throw new InvalidOperationError({\n reason: 'hash does not match the operation payload',\n });\n}\n/**\n * Validates a nonnegative safe integer field.\n *\n * @internal\n */\nfunction assertInteger(value, field) {\n if (typeof value !== 'number' || !Number.isSafeInteger(value) || value < 0)\n throw new InvalidOperationError({\n reason: `${field} must be a nonnegative safe integer`,\n });\n}\n/**\n * Compares normalized account configurations.\n *\n * @internal\n */\nfunction sameConfig(a, b) {\n const configA = AccountConfig.from(a);\n const configB = AccountConfig.from(b);\n return (Hex.isEqual(configA.salt ?? AccountConfig.zeroSalt, configB.salt ?? AccountConfig.zeroSalt) &&\n configA.threshold === configB.threshold &&\n configA.version === configB.version &&\n configA.owners.length === configB.owners.length &&\n configA.owners.every((owner, index) => {\n const other = configB.owners[index];\n return (Address.isEqual(owner.owner, other.owner) &&\n owner.weight === other.weight);\n }));\n}\n/** Thrown when an account operation owner approval is invalid. */\nexport class InvalidApprovalError extends Errors.BaseError {\n /**\n * Creates an invalid operation approval error.\n *\n * @example\n * ```ts twoslash\n * import { AccountOperation } from 'ox/tempo'\n *\n * throw new AccountOperation.InvalidApprovalError({\n * reason: 'signature is from a non-owner',\n * })\n * ```\n *\n * @param options - Error options.\n */\n constructor(options = {}) {\n super(options.reason\n ? `Invalid operation approval: ${options.reason}.`\n : 'Invalid operation approval.', { cause: options.cause });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'AccountOperation.InvalidApprovalError'\n });\n }\n}\n/** Thrown when an account operation is malformed or internally inconsistent. */\nexport class InvalidOperationError extends Errors.BaseError {\n /**\n * Creates an invalid account operation error.\n *\n * @example\n * ```ts twoslash\n * import { AccountOperation } from 'ox/tempo'\n *\n * throw new AccountOperation.InvalidOperationError({\n * reason: 'hash does not match the operation payload',\n * })\n * ```\n *\n * @param options - Error options.\n */\n constructor(options = {}) {\n super(options.reason\n ? `Invalid account operation: ${options.reason}.`\n : 'Invalid account operation.', { cause: options.cause });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'AccountOperation.InvalidOperationError'\n });\n }\n}\n//# sourceMappingURL=AccountOperation.js.map","import * as Address from '../core/Address.js';\nimport * as Errors from '../core/Errors.js';\nimport * as Hex from '../core/Hex.js';\nimport * as Rlp from '../core/Rlp.js';\nimport * as AccountConfig from './AccountConfig.js';\n/**\n * Converts a JSON-RPC account simulation spec to its domain representation.\n *\n * @example\n * ```ts twoslash\n * // @noErrors\n * import { AccountSimulation } from 'ox/tempo'\n *\n * const spec = AccountSimulation.fromRpc(specRpc)\n * ```\n *\n * @param spec - JSON-RPC account simulation spec.\n * @returns The account simulation spec with decoded configurations.\n */\nexport function fromRpc(spec) {\n const { approvals, config, signer } = spec;\n assertApprovals(approvals);\n if (signer !== undefined)\n Address.assert(signer);\n return {\n approvals,\n config: deserializeConfig(config),\n ...(signer !== undefined ? { signer } : {}),\n };\n}\n/**\n * Converts an account simulation spec to its JSON-RPC representation.\n *\n * @example\n * ```ts twoslash\n * // @noErrors\n * import { AccountSimulation } from 'ox/tempo'\n *\n * const specRpc = AccountSimulation.toRpc(spec)\n * ```\n *\n * @param spec - Account simulation spec.\n * @returns The JSON-RPC account simulation spec with encoded configurations.\n */\nexport function toRpc(spec) {\n const { approvals, config, signer } = spec;\n assertApprovals(approvals);\n if (signer !== undefined)\n Address.assert(signer);\n return {\n approvals: approvals.map(({ keyData, keyType, owner }) => ({\n ...(keyData !== undefined ? { keyData: shimKeyData(keyData) } : {}),\n ...(keyType !== undefined ? { keyType } : {}),\n owner,\n })),\n config: serializeConfig(config),\n ...(signer !== undefined ? { signer } : {}),\n };\n}\n/** @internal */\nfunction assertApprovals(approvals) {\n if (approvals.some((approval) => typeof approval !== 'object' ||\n approval === null ||\n 'spec' in approval ||\n 'type' in approval))\n throw new InvalidSimulationError({\n reason: 'only untagged primitive owner approvals are allowed',\n });\n if (approvals.length > AccountConfig.maxSignatures)\n throw new InvalidSimulationError({\n reason: `approval count exceeds ${AccountConfig.maxSignatures}`,\n });\n}\n/** @internal */\nfunction deserializeConfig(config) {\n const tuple = Rlp.toHex(config);\n if (!Array.isArray(tuple) || tuple.length !== 4)\n throw new InvalidSimulationError({ reason: 'invalid config encoding' });\n const [salt, version, threshold, owners] = tuple;\n if (Array.isArray(salt) ||\n Hex.size(salt) !== 32 ||\n Array.isArray(version) ||\n Hex.size(version) > 8 ||\n (version !== '0x' && Hex.slice(version, 0, 1) === '0x00') ||\n Array.isArray(threshold) ||\n Hex.size(threshold) > 1 ||\n !Array.isArray(owners) ||\n owners.some((owner) => !Array.isArray(owner) ||\n owner.length !== 2 ||\n owner.some(Array.isArray) ||\n !Address.validate(owner[0]) ||\n Hex.size(owner[1]) > 1))\n throw new InvalidSimulationError({ reason: 'invalid config encoding' });\n const value = AccountConfig.fromTuple(tuple);\n AccountConfig.assert(value);\n if (!Hex.isEqual(config, serializeConfig(value)))\n throw new InvalidSimulationError({ reason: 'noncanonical config encoding' });\n return value;\n}\n/** @internal */\nfunction serializeConfig(config) {\n return Rlp.fromHex(AccountConfig.toTuple(config));\n}\n/**\n * Shims key data into the 1-, 2-, or 4-byte length hint accepted by Tempo's\n * gas estimator. Other sizes are replaced by a 2-byte hint of their length.\n * @internal\n */\nfunction shimKeyData(data) {\n const size = Hex.size(data);\n if (size === 1 || size === 2 || size === 4)\n return data;\n return Hex.fromNumber(size, { size: 2 });\n}\n/** Thrown when an account simulation spec is invalid. */\nexport class InvalidSimulationError extends Errors.BaseError {\n constructor(options) {\n super(`Invalid account simulation: ${options.reason}.`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'AccountSimulation.InvalidSimulationError'\n });\n }\n}\n//# sourceMappingURL=AccountSimulation.js.map","import * as Hex from '../core/Hex.js';\nimport * as Signature from '../core/Signature.js';\nimport * as ox_Transaction from '../core/Transaction.js';\nimport * as AuthorizationTempo from './AuthorizationTempo.js';\nimport * as KeyAuthorization from './KeyAuthorization.js';\nimport * as SignatureEnvelope from './SignatureEnvelope.js';\n/** Type to RPC Type mapping. */\nexport const toRpcType = {\n ...ox_Transaction.toRpcType,\n tempo: '0x76',\n};\n/** RPC Type to Type mapping. */\nexport const fromRpcType = {\n ...ox_Transaction.fromRpcType,\n '0x76': 'tempo',\n};\n/**\n * Converts an {@link ox#Transaction.Rpc} to an {@link ox#Transaction.Transaction}.\n *\n * @example\n * ```ts twoslash\n * import { Transaction } from 'ox/tempo'\n *\n * const transaction = Transaction.fromRpc({\n * hash: '0x353fdfc38a2f26115daadee9f5b8392ce62b84f410957967e2ed56b35338cdd0',\n * nonce: '0x357',\n * blockHash:\n * '0xc350d807505fb835650f0013632c5515592987ba169bbc6626d9fc54d91f0f0b',\n * blockNumber: '0x12f296f',\n * calls: [\n * {\n * input: '0xdeadbeef',\n * to: '0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad',\n * value: '0x9b6e64a8ec60000',\n * },\n * ],\n * feeToken: '0x20c0000000000000000000000000000000000000',\n * transactionIndex: '0x2',\n * from: '0x814e5e0e31016b9a7f138c76b7e7b2bb5c1ab6a6',\n * value: '0x9b6e64a8ec60000',\n * gas: '0x43f5d',\n * maxFeePerGas: '0x2ca6ae494',\n * maxPriorityFeePerGas: '0x41cc3c0',\n * input:\n * '0x3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006643504700000000000000000000000000000000000000000000000000000000000000040b080604000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002800000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000009b6e64a8ec600000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000009b6e64a8ec60000000000000000000000000000000000000000000000000000019124bb5ae978c000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000c56c7a0eaa804f854b536a5f3d5f49d2ec4b12b80000000000000000000000000000000000000000000000000000000000000060000000000000000000000000c56c7a0eaa804f854b536a5f3d5f49d2ec4b12b8000000000000000000000000000000fee13a103a10d593b9ae06b3e05f2e7e1c00000000000000000000000000000000000000000000000000000000000000190000000000000000000000000000000000000000000000000000000000000060000000000000000000000000c56c7a0eaa804f854b536a5f3d5f49d2ec4b12b800000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000190240001b9872b',\n * signature: {\n * r: '0x635dc2033e60185bb36709c29c75d64ea51dfbd91c32ef4be198e4ceb169fb4d',\n * s: '0x50c2667ac4c771072746acfdcf1f1483336dcca8bd2df47cd83175dbe60f0540',\n * type: 'secp256k1',\n * yParity: '0x0',\n * },\n * chainId: '0x1',\n * accessList: [],\n * type: '0x76',\n * })\n * ```\n *\n * @param transaction - The RPC transaction to convert.\n * @returns An instantiated {@link ox#Transaction.Transaction}.\n */\nexport function fromRpc(transaction, _options = {}) {\n if (!transaction)\n return null;\n const transaction_ = ox_Transaction.fromRpc(transaction);\n transaction_.type = fromRpcType[transaction.type];\n if (transaction.aaAuthorizationList) {\n transaction_.authorizationList = AuthorizationTempo.fromRpcList(transaction.aaAuthorizationList);\n delete transaction_.aaAuthorizationList;\n }\n if (transaction.calls)\n transaction_.calls = transaction.calls.map((call) => ({\n to: call.to,\n value: call.value && call.value !== '0x' ? BigInt(call.value) : undefined,\n // @ts-expect-error\n data: call.input || call.data || '0x',\n }));\n if (transaction.feeToken)\n transaction_.feeToken = transaction.feeToken;\n if (transaction.nonceKey)\n transaction_.nonceKey = BigInt(transaction.nonceKey);\n if (transaction.signature)\n transaction_.signature = SignatureEnvelope.fromRpc(transaction.signature);\n if (transaction.validAfter)\n transaction_.validAfter = Number(transaction.validAfter);\n if (transaction.validBefore)\n transaction_.validBefore = Number(transaction.validBefore);\n if (transaction.keyAuthorization)\n transaction_.keyAuthorization = KeyAuthorization.fromRpc(transaction.keyAuthorization);\n if (transaction.feePayerSignature) {\n transaction_.feePayerSignature = Signature.fromRpc(transaction.feePayerSignature);\n transaction_.feePayerSignature.v = Signature.yParityToV(transaction_.feePayerSignature.yParity);\n }\n return transaction_;\n}\n/**\n * Converts an {@link ox#Transaction.Transaction} to an {@link ox#Transaction.Rpc}.\n *\n * @example\n * ```ts twoslash\n * import { Transaction } from 'ox/tempo'\n *\n * const transaction = Transaction.toRpc({\n * accessList: [],\n * blockHash:\n * '0xc350d807505fb835650f0013632c5515592987ba169bbc6626d9fc54d91f0f0b',\n * blockNumber: 19868015n,\n * calls: [\n * {\n * data: '0xdeadbeef',\n * to: '0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad',\n * value: 700000000000000000n,\n * },\n * ],\n * chainId: 1,\n * feeToken: '0x20c0000000000000000000000000000000000000',\n * from: '0x814e5e0e31016b9a7f138c76b7e7b2bb5c1ab6a6',\n * gas: 278365n,\n * hash: '0x353fdfc38a2f26115daadee9f5b8392ce62b84f410957967e2ed56b35338cdd0',\n * input:\n * '0x3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006643504700000000000000000000000000000000000000000000000000000000000000040b080604000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002800000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000009b6e64a8ec600000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000009b6e64a8ec60000000000000000000000000000000000000000000000000000019124bb5ae978c000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000c56c7a0eaa804f854b536a5f3d5f49d2ec4b12b80000000000000000000000000000000000000000000000000000000000000060000000000000000000000000c56c7a0eaa804f854b536a5f3d5f49d2ec4b12b8000000000000000000000000000000fee13a103a10d593b9ae06b3e05f2e7e1c00000000000000000000000000000000000000000000000000000000000000190000000000000000000000000000000000000000000000000000000000000060000000000000000000000000c56c7a0eaa804f854b536a5f3d5f49d2ec4b12b800000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000190240001b9872b',\n * maxFeePerGas: 11985937556n,\n * maxPriorityFeePerGas: 68993984n,\n * nonce: 855n,\n * signature: {\n * signature: {\n * r: 44944627813007772897391531230081695102703289123332187696115181104739239197517n,\n * s: 36528503505192438307355164441104001310566505351980369085208178712678799181120n,\n * yParity: 0,\n * },\n * type: 'secp256k1',\n * },\n * transactionIndex: 2,\n * type: 'tempo',\n * })\n * ```\n *\n * @param transaction - The transaction to convert.\n * @returns An RPC-formatted transaction.\n */\nexport function toRpc(transaction, _options) {\n const rpc = ox_Transaction.toRpc(transaction);\n rpc.type = toRpcType[transaction.type];\n if (transaction.authorizationList)\n rpc.aaAuthorizationList = AuthorizationTempo.toRpcList(transaction.authorizationList);\n if (transaction.calls)\n rpc.calls = transaction.calls.map((call) => ({\n to: call.to,\n value: call.value ? Hex.fromNumber(call.value) : undefined,\n data: call.data,\n }));\n if (transaction.feeToken)\n rpc.feeToken = transaction.feeToken;\n if (transaction.keyAuthorization)\n rpc.keyAuthorization = KeyAuthorization.toRpc(transaction.keyAuthorization);\n if (typeof transaction.nonceKey === 'bigint')\n rpc.nonceKey = Hex.fromNumber(transaction.nonceKey);\n if (transaction.feePayerSignature) {\n rpc.feePayerSignature = Signature.toRpc(transaction.feePayerSignature);\n rpc.feePayerSignature.v = Hex.fromNumber(Signature.yParityToV(transaction.feePayerSignature?.yParity));\n }\n if (transaction.signature)\n rpc.signature = SignatureEnvelope.toRpc(transaction.signature);\n if (typeof transaction.validAfter === 'number')\n rpc.validAfter = Hex.fromNumber(transaction.validAfter);\n if (typeof transaction.validBefore === 'number')\n rpc.validBefore = Hex.fromNumber(transaction.validBefore);\n return rpc;\n}\n//# sourceMappingURL=Transaction.js.map","import * as Hex from '../core/Hex.js';\nimport * as ox_TransactionRequest from '../core/TransactionRequest.js';\nimport * as AccountSimulation from './AccountSimulation.js';\nimport * as AuthorizationTempo from './AuthorizationTempo.js';\nimport * as KeyAuthorization from './KeyAuthorization.js';\nimport * as TempoAddress from './TempoAddress.js';\nimport * as TokenId from './TokenId.js';\nimport * as Transaction from './Transaction.js';\n/**\n * Converts a {@link ox#TransactionRequest.Rpc} to a {@link ox#TransactionRequest.TransactionRequest}.\n *\n * @example\n * ```ts twoslash\n * import { TransactionRequest } from 'ox/tempo'\n *\n * const request = TransactionRequest.fromRpc({\n * calls: [{\n * data: '0xdeadbeef',\n * to: '0xcafebabecafebabecafebabecafebabecafebabe',\n * }],\n * feeToken: '0x20c0000000000000000000000000000000000000',\n * type: '0x76',\n * })\n * ```\n *\n * @param request - The RPC request to convert.\n * @returns A transaction request.\n */\nexport function fromRpc(request) {\n const { authorizationList: _, keyAuthorizationSimulation: __, keyType: ___, configurableAccountSimulation: ____, ...rest } = request;\n const request_ = ox_TransactionRequest.fromRpc(rest);\n if (typeof request.type !== 'undefined')\n request_.type =\n Transaction.fromRpcType[request.type] || request_.type;\n if (request.authorizationList)\n request_.authorizationList = AuthorizationTempo.fromRpcList(request.authorizationList);\n if (request.calls)\n request_.calls = request.calls.map((call) => {\n const mapped = {\n to: call.to,\n data: call.data,\n };\n if (call.value && call.value !== '0x')\n mapped.value = Hex.toBigInt(call.value);\n return mapped;\n });\n if (typeof request.feeToken !== 'undefined')\n request_.feeToken = request.feeToken;\n if (request.keyAuthorization)\n request_.keyAuthorization = KeyAuthorization.fromRpc(request.keyAuthorization);\n if (request.keyAuthorizationSimulation)\n request_.keyAuthorizationSimulation = AccountSimulation.fromRpc(request.keyAuthorizationSimulation);\n if (typeof request.keyType !== 'undefined')\n request_.keyType =\n request.keyType === 'configurableAccount'\n ? 'configurable'\n : request.keyType;\n if (request.configurableAccountSimulation)\n request_.accountSimulation = AccountSimulation.fromRpc(request.configurableAccountSimulation);\n if (typeof request.validBefore !== 'undefined')\n request_.validBefore = Hex.toNumber(request.validBefore);\n if (typeof request.validAfter !== 'undefined')\n request_.validAfter = Hex.toNumber(request.validAfter);\n if (typeof request.nonceKey !== 'undefined')\n request_.nonceKey = Hex.toBigInt(request.nonceKey);\n return request_;\n}\n/**\n * Converts a {@link ox#TransactionRequest.TransactionRequest} to a {@link ox#TransactionRequest.Rpc}.\n *\n * @see {@link https://docs.tempo.xyz/protocol/transactions}\n *\n * @example\n * ```ts twoslash\n * import { Value } from 'ox'\n * import { TransactionRequest } from 'ox/tempo'\n *\n * const request = TransactionRequest.toRpc({\n * calls: [{\n * data: '0xdeadbeef',\n * to: '0xcafebabecafebabecafebabecafebabecafebabe',\n * }],\n * feeToken: '0x20c0000000000000000000000000000000000000',\n * })\n * ```\n *\n * @example\n * ### Using with a Provider\n *\n * You can use {@link ox#Provider.(from:function)} to instantiate an EIP-1193 Provider and\n * send a transaction to the Wallet using the `eth_sendTransaction` method.\n *\n * ```ts twoslash\n * import 'ox/window'\n * import { Provider, Value } from 'ox'\n * import { TransactionRequest } from 'ox/tempo'\n *\n * const provider = Provider.from(window.ethereum!)\n *\n * const request = TransactionRequest.toRpc({\n * calls: [{\n * data: '0xdeadbeef',\n * to: '0xcafebabecafebabecafebabecafebabecafebabe',\n * }],\n * feeToken: '0x20c0000000000000000000000000000000000000',\n * })\n *\n * const hash = await provider.request({ // [!code focus]\n * method: 'eth_sendTransaction', // [!code focus]\n * params: [request], // [!code focus]\n * }) // [!code focus]\n * ```\n *\n * @param request - The request to convert.\n * @returns An RPC request.\n */\nexport function toRpc(request) {\n const request_rpc = ox_TransactionRequest.toRpc({\n ...request,\n authorizationList: undefined,\n });\n if (request.authorizationList)\n request_rpc.authorizationList = AuthorizationTempo.toRpcList(request.authorizationList);\n if (request.calls)\n request_rpc.calls = request.calls.map((call) => ({\n to: call.to ? TempoAddress.resolve(call.to) : call.to,\n value: call.value ? Hex.fromNumber(call.value) : '0x',\n data: call.data ?? '0x',\n }));\n else if (request.to || request.data || request.value)\n request_rpc.calls = [\n {\n to: request.to ? TempoAddress.resolve(request.to) : undefined,\n value: request.value ? Hex.fromNumber(request.value) : '0x',\n data: request.data ?? '0x',\n },\n ];\n if (typeof request.feeToken !== 'undefined')\n request_rpc.feeToken = TokenId.toAddress(request.feeToken);\n if (request.keyAuthorization)\n request_rpc.keyAuthorization = KeyAuthorization.toRpc(request.keyAuthorization);\n if (request.keyAuthorizationSimulation)\n request_rpc.keyAuthorizationSimulation = AccountSimulation.toRpc(request.keyAuthorizationSimulation);\n if (request.accountSimulation)\n request_rpc.configurableAccountSimulation = AccountSimulation.toRpc(request.accountSimulation);\n if (typeof request.validBefore !== 'undefined')\n request_rpc.validBefore = Hex.fromNumber(request.validBefore);\n if (typeof request.validAfter !== 'undefined')\n request_rpc.validAfter = Hex.fromNumber(request.validAfter);\n const nonceKey = (() => {\n if (request.nonceKey === 'random')\n return Hex.random(6);\n if (typeof request.nonceKey === 'bigint')\n return Hex.fromNumber(request.nonceKey);\n return undefined;\n })();\n if (nonceKey)\n request_rpc.nonceKey = nonceKey;\n if (typeof request.accountSimulation !== 'undefined' ||\n typeof request.calls !== 'undefined' ||\n typeof request.feePayer !== 'undefined' ||\n typeof request.feeToken !== 'undefined' ||\n typeof request.keyAuthorization !== 'undefined' ||\n typeof request.nonceKey !== 'undefined' ||\n typeof request.validBefore !== 'undefined' ||\n typeof request.validAfter !== 'undefined' ||\n request.type === 'tempo') {\n request_rpc.type = Transaction.toRpcType.tempo;\n delete request_rpc.data;\n delete request_rpc.input;\n delete request_rpc.to;\n delete request_rpc.value;\n }\n return request_rpc;\n}\n//# sourceMappingURL=TransactionRequest.js.map","import { hexToNumber } from '../encoding/fromHex.js';\nimport { defineFormatter } from './formatter.js';\nimport { formatLog } from './log.js';\nimport { transactionType } from './transaction.js';\nexport const receiptStatuses = {\n '0x0': 'reverted',\n '0x1': 'success',\n};\nexport function formatTransactionReceipt(transactionReceipt, _) {\n const receipt = {\n ...transactionReceipt,\n blockNumber: transactionReceipt.blockNumber\n ? BigInt(transactionReceipt.blockNumber)\n : null,\n contractAddress: transactionReceipt.contractAddress\n ? transactionReceipt.contractAddress\n : null,\n cumulativeGasUsed: transactionReceipt.cumulativeGasUsed\n ? BigInt(transactionReceipt.cumulativeGasUsed)\n : null,\n effectiveGasPrice: transactionReceipt.effectiveGasPrice\n ? BigInt(transactionReceipt.effectiveGasPrice)\n : null,\n gasUsed: transactionReceipt.gasUsed\n ? BigInt(transactionReceipt.gasUsed)\n : null,\n logs: transactionReceipt.logs\n ? transactionReceipt.logs.map((log) => formatLog(log))\n : null,\n to: transactionReceipt.to ? transactionReceipt.to : null,\n transactionIndex: transactionReceipt.transactionIndex\n ? hexToNumber(transactionReceipt.transactionIndex)\n : null,\n status: transactionReceipt.status\n ? receiptStatuses[transactionReceipt.status]\n : null,\n type: transactionReceipt.type\n ? transactionType[transactionReceipt.type] || transactionReceipt.type\n : null,\n };\n if (transactionReceipt.blobGasPrice)\n receipt.blobGasPrice = BigInt(transactionReceipt.blobGasPrice);\n if (transactionReceipt.blobGasUsed)\n receipt.blobGasUsed = BigInt(transactionReceipt.blobGasUsed);\n return receipt;\n}\nexport const defineTransactionReceipt = /*#__PURE__*/ defineFormatter('transactionReceipt', formatTransactionReceipt);\n//# sourceMappingURL=transactionReceipt.js.map","import { formatBlockParameter, } from '../../utils/block/formatBlockParameter.js';\n/**\n * Retrieves the bytecode at an address.\n *\n * - Docs: https://viem.sh/docs/contract/getCode\n * - JSON-RPC Methods: [`eth_getCode`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getcode)\n *\n * @param client - Client to use\n * @param parameters - {@link GetCodeParameters}\n * @returns The contract's bytecode. {@link GetCodeReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getCode } from 'viem/contract'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const code = await getCode(client, {\n * address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',\n * })\n */\nexport async function getCode(client, { address, blockHash, blockNumber, blockTag = 'latest', requireCanonical, }) {\n const block = formatBlockParameter({\n blockHash,\n blockNumber,\n blockTag,\n requireCanonical,\n });\n const hex = await client.request({\n method: 'eth_getCode',\n params: [address, block],\n }, {\n dedupe: typeof blockNumber === 'bigint' || blockHash !== undefined,\n });\n if (hex === '0x')\n return undefined;\n return hex;\n}\n//# sourceMappingURL=getCode.js.map","import { getAddress } from '../address/getAddress.js';\nimport { isAddressEqual, } from '../address/isAddressEqual.js';\nimport { recoverAuthorizationAddress, } from './recoverAuthorizationAddress.js';\n/**\n * Verify that an Authorization object was signed by the provided address.\n *\n * - Docs {@link https://viem.sh/docs/utilities/verifyAuthorization}\n *\n * @param parameters - {@link VerifyAuthorizationParameters}\n * @returns Whether or not the signature is valid. {@link VerifyAuthorizationReturnType}\n */\nexport async function verifyAuthorization({ address, authorization, signature, }) {\n return isAddressEqual(getAddress(address), await recoverAuthorizationAddress({\n authorization,\n signature,\n }));\n}\n//# sourceMappingURL=verifyAuthorization.js.map","export function defineChain(chain) {\n const chainInstance = {\n formatters: undefined,\n fees: undefined,\n serializers: undefined,\n ...chain,\n };\n function extend(base) {\n return (fnOrExtended) => {\n const properties = (typeof fnOrExtended === 'function' ? fnOrExtended(base) : fnOrExtended);\n const combined = { ...base, ...properties };\n return Object.assign(combined, { extend: extend(combined) });\n };\n }\n return Object.assign(chainInstance, {\n extend: extend(chainInstance),\n });\n}\nexport function extendSchema() {\n return {};\n}\n//# sourceMappingURL=defineChain.js.map","import * as AbiParameters from '../core/AbiParameters.js';\nimport * as Authorization from '../core/Authorization.js';\nimport * as Errors from '../core/Errors.js';\nimport * as Hex from '../core/Hex.js';\nimport * as Secp256k1 from '../core/Secp256k1.js';\nimport * as Signature from '../core/Signature.js';\n/**\n * Magic bytes used to identify ERC-8010 wrapped signatures.\n */\nexport const magicBytes = '0x8010801080108010801080108010801080108010801080108010801080108010';\n/** Suffix ABI parameters for the ERC-8010 wrapped signature. */\nexport const suffixParameters = AbiParameters.from('(uint256 chainId, address delegation, uint256 nonce, uint8 yParity, uint256 r, uint256 s), address to, bytes data');\n/**\n * Asserts that the wrapped signature is valid.\n *\n * @example\n * ```ts twoslash\n * import { SignatureErc8010 } from 'ox/erc8010'\n *\n * SignatureErc8010.assert('0xdeadbeef')\n * // @error: InvalidWrappedSignatureError: Value `0xdeadbeef` is an invalid ERC-8010 wrapped signature.\n * ```\n *\n * @param value - The value to assert.\n */\nexport function assert(value) {\n if (typeof value === 'string') {\n if (Hex.slice(value, -32) !== magicBytes)\n throw new InvalidWrappedSignatureError(value);\n }\n else\n Signature.assert(value.authorization);\n}\n/**\n * Parses an [ERC-8010 wrapped signature](https://github.com/jxom/ERCs/blob/16f7e3891fff2e1e9c25dea0485497739db8a816/ERCS/erc-8010.md) into its constituent parts.\n *\n * @example\n * ```ts twoslash\n * // @noErrors\n * import { Secp256k1 } from 'ox'\n * import { SignatureErc8010 } from 'ox/erc8010' // [!code focus]\n *\n * const signature = Secp256k1.sign({\n * payload: '0x...',\n * privateKey: '0x...',\n * })\n *\n * // Instantiate from serialized format. // [!code focus]\n * const wrapped = SignatureErc8010.from('0x...') // [!code focus]\n * // @log: { authorization: { ... }, data: '0x...', signature: { ... } } // [!code focus]\n *\n * // Instantiate from constituent parts. // [!code focus]\n * const wrapped = SignatureErc8010.from({ // [!code focus]\n * authorization: { ... }, // [!code focus]\n * data: '0x...', // [!code focus]\n * signature, // [!code focus]\n * })\n * // @log: { authorization: { ... }, data: '0x...', signature: { ... } }\n * ```\n *\n * @param value - Value to parse.\n * @returns Parsed value.\n */\nexport function from(value) {\n if (typeof value === 'string')\n return unwrap(value);\n return value;\n}\n/**\n * Unwraps an [ERC-8010 wrapped signature](https://github.com/jxom/ERCs/blob/16f7e3891fff2e1e9c25dea0485497739db8a816/ERCS/erc-8010.md) into its constituent parts.\n *\n * @example\n * ```ts twoslash\n * import { SignatureErc8010 } from 'ox/erc8010'\n *\n * const { authorization, data, signature } = SignatureErc8010.unwrap('0x...')\n * ```\n *\n * @param wrapped - Wrapped signature to unwrap.\n * @returns Unwrapped signature.\n */\nexport function unwrap(wrapped) {\n assert(wrapped);\n const suffixLength = Hex.toNumber(Hex.slice(wrapped, -64, -32));\n const suffix = Hex.slice(wrapped, -suffixLength - 64, -64);\n const signature = Hex.slice(wrapped, 0, -suffixLength - 64);\n const [auth, to, data] = AbiParameters.decode(suffixParameters, suffix);\n const authorization = Authorization.from({\n address: auth.delegation,\n chainId: Number(auth.chainId),\n nonce: auth.nonce,\n yParity: auth.yParity,\n r: auth.r,\n s: auth.s,\n });\n return {\n authorization,\n signature,\n ...(data && data !== '0x' ? { data, to } : {}),\n };\n}\n/**\n * Wraps a signature into [ERC-8010 format](https://github.com/jxom/ERCs/blob/16f7e3891fff2e1e9c25dea0485497739db8a816/ERCS/erc-8010.md).\n *\n * @example\n * ```ts twoslash\n * // @noErrors\n * import { Secp256k1, Signature } from 'ox'\n * import { SignatureErc8010 } from 'ox/erc8010' // [!code focus]\n *\n * const signature = Secp256k1.sign({\n * payload: '0x...',\n * privateKey: '0x...',\n * })\n *\n * const wrapped = SignatureErc8010.wrap({ // [!code focus]\n * authorization: { ... }, // [!code focus]\n * data: '0xdeadbeef', // [!code focus]\n * signature: Signature.toHex(signature), // [!code focus]\n * }) // [!code focus]\n * ```\n *\n * @param value - Values to wrap.\n * @returns Wrapped signature.\n */\nexport function wrap(value) {\n const { data, signature } = value;\n assert(value);\n const self = Secp256k1.recoverAddress({\n payload: Authorization.getSignPayload(value.authorization),\n signature: Signature.from(value.authorization),\n });\n const suffix = AbiParameters.encode(suffixParameters, [\n {\n ...value.authorization,\n delegation: value.authorization.address,\n chainId: BigInt(value.authorization.chainId),\n },\n value.to ?? self,\n data ?? '0x',\n ]);\n const suffixLength = Hex.fromNumber(Hex.size(suffix), { size: 32 });\n return Hex.concat(signature, suffix, suffixLength, magicBytes);\n}\n/**\n * Validates a wrapped signature. Returns `true` if the wrapped signature is valid, `false` otherwise.\n *\n * @example\n * ```ts twoslash\n * import { SignatureErc8010 } from 'ox/erc8010'\n *\n * const valid = SignatureErc8010.validate('0xdeadbeef')\n * // @log: false\n * ```\n *\n * @param value - The value to validate.\n * @returns `true` if the value is valid, `false` otherwise.\n */\nexport function validate(value) {\n try {\n assert(value);\n return true;\n }\n catch {\n return false;\n }\n}\n/** Thrown when the ERC-8010 wrapped signature is invalid. */\nexport class InvalidWrappedSignatureError extends Errors.BaseError {\n constructor(wrapped) {\n super(`Value \\`${wrapped}\\` is an invalid ERC-8010 wrapped signature.`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'SignatureErc8010.InvalidWrappedSignatureError'\n });\n }\n}\n//# sourceMappingURL=SignatureErc8010.js.map","import { TransactionNotFoundError, } from '../../errors/transaction.js';\nimport { numberToHex, } from '../../utils/encoding/toHex.js';\nimport { formatTransaction, } from '../../utils/formatters/transaction.js';\n/**\n * Returns information about a [Transaction](https://viem.sh/docs/glossary/terms#transaction) given a hash or block identifier.\n *\n * - Docs: https://viem.sh/docs/actions/public/getTransaction\n * - Example: https://stackblitz.com/github/wevm/viem/tree/main/examples/transactions_fetching-transactions\n * - JSON-RPC Methods: [`eth_getTransactionByHash`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionByHash)\n *\n * @param client - Client to use\n * @param parameters - {@link GetTransactionParameters}\n * @returns The transaction information. {@link GetTransactionReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getTransaction } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const transaction = await getTransaction(client, {\n * hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d',\n * })\n */\nexport async function getTransaction(client, { blockHash, blockNumber, blockTag: blockTag_, hash, index, sender, nonce, }) {\n const blockTag = blockTag_ || 'latest';\n const blockNumberHex = blockNumber !== undefined ? numberToHex(blockNumber) : undefined;\n let transaction = null;\n if (hash) {\n transaction = await client.request({\n method: 'eth_getTransactionByHash',\n params: [hash],\n }, { dedupe: true });\n }\n else if (blockHash) {\n transaction = await client.request({\n method: 'eth_getTransactionByBlockHashAndIndex',\n params: [blockHash, numberToHex(index)],\n }, { dedupe: true });\n }\n else if ((blockNumberHex || blockTag) && typeof index === 'number') {\n transaction = await client.request({\n method: 'eth_getTransactionByBlockNumberAndIndex',\n params: [blockNumberHex || blockTag, numberToHex(index)],\n }, { dedupe: Boolean(blockNumberHex) });\n }\n else if (sender && typeof nonce === 'number') {\n transaction = await client.request({\n method: 'eth_getTransactionBySenderAndNonce',\n params: [sender, numberToHex(nonce)],\n }, { dedupe: true });\n }\n if (!transaction)\n throw new TransactionNotFoundError({\n blockHash,\n blockNumber,\n blockTag,\n hash,\n index,\n });\n const format = client.chain?.formatters?.transaction?.format || formatTransaction;\n return format(transaction, 'getTransaction');\n}\n//# sourceMappingURL=getTransaction.js.map","import * as AbiParameters from '../core/AbiParameters.js';\nimport * as Errors from '../core/Errors.js';\nimport * as Hex from '../core/Hex.js';\n/**\n * Magic bytes used to identify ERC-6492 wrapped signatures.\n */\nexport const magicBytes = '0x6492649264926492649264926492649264926492649264926492649264926492';\n/**\n * Deployless ERC-6492 signature verification bytecode.\n */\nexport const universalSignatureValidatorBytecode = '0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572';\n/**\n * ABI for the ERC-6492 universal deployless signature validator contract.\n *\n * Constructor return value is `0x1` (valid) or `0x0` (invalid).\n */\nexport const universalSignatureValidatorAbi = [\n {\n inputs: [\n {\n name: '_signer',\n type: 'address',\n },\n {\n name: '_hash',\n type: 'bytes32',\n },\n {\n name: '_signature',\n type: 'bytes',\n },\n ],\n stateMutability: 'nonpayable',\n type: 'constructor',\n },\n {\n inputs: [\n {\n name: '_signer',\n type: 'address',\n },\n {\n name: '_hash',\n type: 'bytes32',\n },\n {\n name: '_signature',\n type: 'bytes',\n },\n ],\n outputs: [\n {\n type: 'bool',\n },\n ],\n stateMutability: 'nonpayable',\n type: 'function',\n name: 'isValidSig',\n },\n];\n/**\n * Asserts that the wrapped signature is valid.\n *\n * @example\n * ```ts twoslash\n * import { SignatureErc6492 } from 'ox/erc6492'\n *\n * SignatureErc6492.assert('0xdeadbeef')\n * // @error: InvalidWrappedSignatureError: Value `0xdeadbeef` is an invalid ERC-6492 wrapped signature.\n * ```\n *\n * @param wrapped - The wrapped signature to assert.\n */\nexport function assert(wrapped) {\n if (Hex.slice(wrapped, -32) !== magicBytes)\n throw new InvalidWrappedSignatureError(wrapped);\n}\n/**\n * Parses an [ERC-6492 wrapped signature](https://eips.ethereum.org/EIPS/eip-6492#specification) into its constituent parts.\n *\n * @example\n * ```ts twoslash\n * // @noErrors\n * import { Secp256k1 } from 'ox'\n * import { SignatureErc6492 } from 'ox/erc6492' // [!code focus]\n *\n * const signature = Secp256k1.sign({\n * payload: '0x...',\n * privateKey: '0x...',\n * })\n *\n * // Instantiate from serialized format. // [!code focus]\n * const wrapped = SignatureErc6492.from('0x...') // [!code focus]\n * // @log: { data: '0x...', signature: { ... }, to: '0x...', } // [!code focus]\n *\n * // Instantiate from constituent parts. // [!code focus]\n * const wrapped = SignatureErc6492.from({ // [!code focus]\n * data: '0x...', // [!code focus]\n * signature, // [!code focus]\n * to: '0x...', // [!code focus]\n * })\n * // @log: { data: '0x...', signature: { ... }, to: '0x...', }\n * ```\n *\n * @param wrapped - Wrapped signature to parse.\n * @returns Wrapped signature.\n */\nexport function from(wrapped) {\n if (typeof wrapped === 'string')\n return unwrap(wrapped);\n return wrapped;\n}\n/**\n * Parses an [ERC-6492 wrapped signature](https://eips.ethereum.org/EIPS/eip-6492#specification) into its constituent parts.\n *\n * @example\n * ```ts twoslash\n * import { SignatureErc6492 } from 'ox/erc6492'\n *\n * const { data, signature, to } = SignatureErc6492.unwrap('0x...')\n * ```\n *\n * @param wrapped - Wrapped signature to parse.\n * @returns Wrapped signature.\n */\nexport function unwrap(wrapped) {\n assert(wrapped);\n const [to, data, signature] = AbiParameters.decode(AbiParameters.from('address, bytes, bytes'), wrapped);\n return { data, signature, to };\n}\n/**\n * Serializes an [ERC-6492 wrapped signature](https://eips.ethereum.org/EIPS/eip-6492#specification).\n *\n * @example\n * ```ts twoslash\n * import { Secp256k1, Signature } from 'ox'\n * import { SignatureErc6492 } from 'ox/erc6492' // [!code focus]\n *\n * const signature = Secp256k1.sign({\n * payload: '0x...',\n * privateKey: '0x...',\n * })\n *\n * const wrapped = SignatureErc6492.wrap({ // [!code focus]\n * data: '0xdeadbeef', // [!code focus]\n * signature: Signature.toHex(signature), // [!code focus]\n * to: '0x00000000219ab540356cBB839Cbe05303d7705Fa', // [!code focus]\n * }) // [!code focus]\n * ```\n *\n * @param value - Wrapped signature to serialize.\n * @returns Serialized wrapped signature.\n */\nexport function wrap(value) {\n const { data, signature, to } = value;\n return Hex.concat(AbiParameters.encode(AbiParameters.from('address, bytes, bytes'), [\n to,\n data,\n signature,\n ]), magicBytes);\n}\n/**\n * Validates a wrapped signature. Returns `true` if the wrapped signature is valid, `false` otherwise.\n *\n * @example\n * ```ts twoslash\n * import { SignatureErc6492 } from 'ox/erc6492'\n *\n * const valid = SignatureErc6492.validate('0xdeadbeef')\n * // @log: false\n * ```\n *\n * @param wrapped - The wrapped signature to validate.\n * @returns `true` if the wrapped signature is valid, `false` otherwise.\n */\nexport function validate(wrapped) {\n try {\n assert(wrapped);\n return true;\n }\n catch {\n return false;\n }\n}\n/** Thrown when the ERC-6492 wrapped signature is invalid. */\nexport class InvalidWrappedSignatureError extends Errors.BaseError {\n constructor(wrapped) {\n super(`Value \\`${wrapped}\\` is an invalid ERC-6492 wrapped signature.`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'SignatureErc6492.InvalidWrappedSignatureError'\n });\n }\n}\n//# sourceMappingURL=SignatureErc6492.js.map","import { secp256k1 } from '@noble/curves/secp256k1';\nimport { hexToBigInt } from '../encoding/fromHex.js';\nimport { hexToBytes } from '../encoding/toBytes.js';\n/**\n * @description Converts a signature into hex format.\n *\n * @param signature The signature to convert.\n * @returns The signature in hex format.\n *\n * @example\n * serializeSignature({\n * r: '0x6e100a352ec6ad1b70802290e18aeed190704973570f3b8ed42cb9808e2ea6bf',\n * s: '0x4a90a229a244495b41890987806fcbd2d5d23fc0dbe5f5256c2613c039d76db8',\n * yParity: 1\n * })\n * // \"0x6e100a352ec6ad1b70802290e18aeed190704973570f3b8ed42cb9808e2ea6bf4a90a229a244495b41890987806fcbd2d5d23fc0dbe5f5256c2613c039d76db81c\"\n */\nexport function serializeSignature({ r, s, to = 'hex', v, yParity, }) {\n const yParity_ = (() => {\n if (yParity === 0 || yParity === 1)\n return yParity;\n if (v && (v === 27n || v === 28n || v >= 35n))\n return v % 2n === 0n ? 1 : 0;\n throw new Error('Invalid `v` or `yParity` value');\n })();\n const signature = `0x${new secp256k1.Signature(hexToBigInt(r), hexToBigInt(s)).toCompactHex()}${yParity_ === 0 ? '1b' : '1c'}`;\n if (to === 'hex')\n return signature;\n return hexToBytes(signature);\n}\n//# sourceMappingURL=serializeSignature.js.map","import { SignatureErc6492 } from 'ox/erc6492';\nimport { SignatureErc8010 } from 'ox/erc8010';\nimport { erc1271Abi, erc6492SignatureValidatorAbi, multicall3Abi, } from '../../constants/abis.js';\nimport { erc6492SignatureValidatorByteCode, multicall3Bytecode, } from '../../constants/contracts.js';\nimport { CallExecutionError, ContractFunctionExecutionError, } from '../../errors/contract.js';\nimport { encodeDeployData, } from '../../utils/abi/encodeDeployData.js';\nimport { encodeFunctionData, } from '../../utils/abi/encodeFunctionData.js';\nimport { getAddress, } from '../../utils/address/getAddress.js';\nimport { isAddressEqual, } from '../../utils/address/isAddressEqual.js';\nimport { verifyAuthorization } from '../../utils/authorization/verifyAuthorization.js';\nimport { concatHex } from '../../utils/data/concat.js';\nimport { isHex } from '../../utils/data/isHex.js';\nimport { hexToBool } from '../../utils/encoding/fromHex.js';\nimport { bytesToHex, numberToHex, } from '../../utils/encoding/toHex.js';\nimport { getAction } from '../../utils/getAction.js';\nimport { recoverAddress, } from '../../utils/signature/recoverAddress.js';\nimport { serializeSignature, } from '../../utils/signature/serializeSignature.js';\nimport { call } from './call.js';\nimport { getCode } from './getCode.js';\nimport { readContract } from './readContract.js';\n/**\n * Verifies a message hash onchain using ERC-6492.\n *\n * @param client - Client to use.\n * @param parameters - {@link VerifyHashParameters}\n * @returns Whether or not the signature is valid. {@link VerifyHashReturnType}\n */\nexport async function verifyHash(client, parameters) {\n const { address, chain = client.chain, hash, erc6492VerifierAddress: verifierAddress = parameters.universalSignatureVerifierAddress ??\n chain?.contracts?.erc6492Verifier?.address, multicallAddress = parameters.multicallAddress ??\n chain?.contracts?.multicall3?.address, mode = 'auto', } = parameters;\n if (chain?.verifyHash)\n return await chain.verifyHash(client, parameters);\n const signature = (() => {\n const signature = parameters.signature;\n if (isHex(signature))\n return signature;\n if (typeof signature === 'object' && 'r' in signature && 's' in signature)\n return serializeSignature(signature);\n return bytesToHex(signature);\n })();\n try {\n if (mode === 'eoa') {\n try {\n const verified = isAddressEqual(getAddress(address), await recoverAddress({ hash, signature }));\n if (verified)\n return true;\n }\n catch { }\n }\n if (SignatureErc8010.validate(signature))\n return await verifyErc8010(client, {\n ...parameters,\n multicallAddress,\n signature,\n });\n return await verifyErc6492(client, {\n ...parameters,\n verifierAddress,\n signature,\n });\n }\n catch (error) {\n if (mode !== 'eoa') {\n // Fallback attempt to verify the signature via ECDSA recovery.\n try {\n const verified = isAddressEqual(getAddress(address), await recoverAddress({ hash, signature }));\n if (verified)\n return true;\n }\n catch { }\n }\n if (error instanceof VerificationError) {\n // if the execution fails, the signature was not valid and an internal method inside of the validator reverted\n // this can happen for many reasons, for example if signer can not be recovered from the signature\n // or if the signature has no valid format\n return false;\n }\n throw error;\n }\n}\n/** @internal */\nexport async function verifyErc8010(client, parameters) {\n const { address, blockHash, blockNumber, blockTag, hash, multicallAddress, requireCanonical, } = parameters;\n const { authorization: authorization_ox, data: initData, signature, to, } = SignatureErc8010.unwrap(parameters.signature);\n // Check if already delegated\n const code = await getCode(client, {\n address,\n blockHash,\n blockNumber,\n blockTag,\n requireCanonical,\n });\n // If already delegated, perform standard ERC-1271 verification.\n if (code === concatHex(['0xef0100', authorization_ox.address]))\n return await verifyErc1271(client, {\n ...parameters,\n signature,\n });\n const authorization = {\n address: authorization_ox.address,\n chainId: Number(authorization_ox.chainId),\n nonce: Number(authorization_ox.nonce),\n r: numberToHex(authorization_ox.r, { size: 32 }),\n s: numberToHex(authorization_ox.s, { size: 32 }),\n yParity: authorization_ox.yParity,\n };\n const valid = await verifyAuthorization({\n address,\n authorization,\n });\n if (!valid)\n throw new VerificationError();\n // Deployless verification.\n const results = await getAction(client, readContract, 'readContract')({\n ...(multicallAddress\n ? { address: multicallAddress }\n : { code: multicall3Bytecode }),\n authorizationList: [authorization],\n abi: multicall3Abi,\n blockHash,\n blockNumber,\n blockTag: 'pending',\n functionName: 'aggregate3',\n requireCanonical,\n args: [\n [\n ...(initData\n ? [\n {\n allowFailure: true,\n target: to ?? address,\n callData: initData,\n },\n ]\n : []),\n {\n allowFailure: true,\n target: address,\n callData: encodeFunctionData({\n abi: erc1271Abi,\n functionName: 'isValidSignature',\n args: [hash, signature],\n }),\n },\n ],\n ],\n });\n const data = results[results.length - 1]?.returnData;\n if (data?.startsWith('0x1626ba7e'))\n return true;\n throw new VerificationError();\n}\n/** @internal */\n// biome-ignore lint/correctness/noUnusedVariables: _\nasync function verifyErc6492(client, parameters) {\n const { address, factory, factoryData, hash, signature, verifierAddress, ...rest } = parameters;\n const wrappedSignature = await (async () => {\n // If no `factory` or `factoryData` is provided, it is assumed that the\n // address is not a Smart Account, or the Smart Account is already deployed.\n if (!factory && !factoryData)\n return signature;\n // If the signature is already wrapped, return the signature.\n if (SignatureErc6492.validate(signature))\n return signature;\n // If the Smart Account is not deployed, wrap the signature with a 6492 wrapper\n // to perform counterfactual validation.\n return SignatureErc6492.wrap({\n data: factoryData,\n signature,\n to: factory,\n });\n })();\n const args = verifierAddress\n ? {\n to: verifierAddress,\n data: encodeFunctionData({\n abi: erc6492SignatureValidatorAbi,\n functionName: 'isValidSig',\n args: [address, hash, wrappedSignature],\n }),\n ...rest,\n }\n : {\n data: encodeDeployData({\n abi: erc6492SignatureValidatorAbi,\n args: [address, hash, wrappedSignature],\n bytecode: erc6492SignatureValidatorByteCode,\n }),\n ...rest,\n };\n const { data } = await getAction(client, call, 'call')(args).catch((error) => {\n if (error instanceof CallExecutionError)\n throw new VerificationError();\n throw error;\n });\n if (hexToBool(data ?? '0x0'))\n return true;\n throw new VerificationError();\n}\n/** @internal */\nexport async function verifyErc1271(client, parameters) {\n const { address, blockHash, blockNumber, blockTag, hash, requireCanonical, signature, } = parameters;\n const result = await getAction(client, readContract, 'readContract')({\n address,\n abi: erc1271Abi,\n args: [hash, signature],\n blockHash,\n blockNumber,\n blockTag,\n functionName: 'isValidSignature',\n requireCanonical,\n }).catch((error) => {\n if (error instanceof ContractFunctionExecutionError)\n throw new VerificationError();\n throw error;\n });\n if (result.startsWith('0x1626ba7e'))\n return true;\n throw new VerificationError();\n}\nclass VerificationError extends Error {\n}\n//# sourceMappingURL=verifyHash.js.map","import { AccountConfig, AccountOperation } from 'ox/tempo';\nimport { readContract } from '../../actions/public/readContract.js';\nimport { writeContract } from '../../actions/wallet/writeContract.js';\nimport { writeContractSync } from '../../actions/wallet/writeContractSync.js';\nimport { parseEventLogs } from '../../utils/abi/parseEventLogs.js';\nimport * as Abis from '../Abis.js';\nimport { fromConfig } from '../Account.js';\nimport * as Addresses from '../Addresses.js';\nimport { withExecutionError } from '../internal/errors.js';\nimport { defineCall } from '../internal/utils.js';\n/**\n * Derives a configurable account address from an initial config with the\n * configurable account precompile.\n *\n * The precompile validates the config and derives the address with the chain's\n * recovery factory. To derive the address locally, use\n * `AccountConfig.getAddress` or `Account.fromConfig({ address: 'infer' })`.\n *\n * @example\n * ```ts\n * import { createClient, http } from 'viem'\n * import { tempo } from 'viem/chains'\n * import { Actions } from 'viem/tempo'\n *\n * const client = createClient({\n * chain: tempo,\n * transport: http(),\n * })\n *\n * const address = await Actions.accounts.deriveAccount(client, {\n * owners: [{ owner: '0x...', weight: 1 }],\n * threshold: 1,\n * })\n * ```\n *\n * @param client - Client.\n * @param parameters - Parameters.\n * @returns The configurable account address.\n */\nexport async function deriveAccount(client, parameters) {\n const { owners, salt, threshold, ...rest } = parameters;\n return withExecutionError(readContract)(client, {\n ...rest,\n ...deriveAccount.call({ owners, salt, threshold }),\n });\n}\n(function (deriveAccount) {\n /**\n * Defines a call to the `deriveAccount` function.\n *\n * Can be passed to [`multicall`](https://viem.sh/docs/contract/multicall).\n *\n * @param args - Arguments.\n * @returns The call.\n */\n function call(args) {\n const { owners, salt, threshold } = AccountConfig.from(args);\n return defineCall({\n address: Addresses.configurableAccount,\n abi: Abis.configurableAccount,\n args: [salt, threshold, owners],\n functionName: 'deriveAccount',\n });\n }\n deriveAccount.call = call;\n})(deriveAccount || (deriveAccount = {}));\n/**\n * Gets the current cached config for a configurable account.\n *\n * The coordinator reads the account's current onchain commitment and returns\n * the matching config from its store. It returns `null` when the config is not\n * cached.\n *\n * @example\n * ```ts\n * const config = await client.accounts.getConfig({\n * address: '0x...',\n * })\n * ```\n *\n * @param client - Client.\n * @param parameters - Parameters.\n * @returns The config, or `null` when it is unknown.\n */\nexport async function getConfig(client, parameters) {\n const config = await client.request({\n method: 'account_getConfig',\n params: [{ address: parameters.address }],\n });\n return config ? AccountConfig.fromRpc(config) : null;\n}\n/**\n * Gets the current configuration commitment for a configurable account.\n *\n * @example\n * ```ts\n * import { createClient, http } from 'viem'\n * import { tempo } from 'viem/chains'\n * import { Actions } from 'viem/tempo'\n *\n * const client = createClient({\n * chain: tempo,\n * transport: http(),\n * })\n *\n * const commitment = await Actions.accounts.getConfigCommitment(client, {\n * account: '0x...',\n * })\n * ```\n *\n * @param client - Client.\n * @param parameters - Parameters.\n * @returns The current configuration commitment, or zero when no config has\n * been committed.\n */\nexport async function getConfigCommitment(client, parameters) {\n const { account, ...rest } = parameters;\n return withExecutionError(readContract)(client, {\n ...rest,\n ...getConfigCommitment.call({ account }),\n });\n}\n(function (getConfigCommitment) {\n /**\n * Defines a call to the `getConfigCommitment` function.\n *\n * Can be passed to [`multicall`](https://viem.sh/docs/contract/multicall).\n *\n * @param args - Arguments.\n * @returns The call.\n */\n function call(args) {\n return defineCall({\n address: Addresses.configurableAccount,\n abi: Abis.configurableAccount,\n args: [args.account],\n functionName: 'getConfigCommitment',\n });\n }\n getConfigCommitment.call = call;\n})(getConfigCommitment || (getConfigCommitment = {}));\n/**\n * Gets a coordinated account operation by its hash.\n *\n * @param client - Client.\n * @param parameters - Parameters.\n * @returns The operation, or `null` when it is unknown.\n */\nexport async function getOperation(client, parameters) {\n const operation = await client.request({\n method: 'account_getOperation',\n params: [parameters.hash],\n });\n return operation ? AccountOperation.fromRpc(operation) : null;\n}\n/**\n * Replaces the current configuration for a configurable account.\n *\n * The transaction must be authorized directly by the account's current owner\n * quorum. Local owner-signing flows can include {@link updateConfig.call} in a\n * prepared transaction before collecting approvals.\n *\n * @example\n * ```ts\n * import { createClient, http } from 'viem'\n * import { sendTransactionSync } from 'viem/actions'\n * import { tempoLocalnet } from 'viem/chains'\n * import { Account, Actions } from 'viem/tempo'\n *\n * const owner = Account.fromSecp256k1(\n * '0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80',\n * )\n * const account = Account.fromConfig({\n * address: 'infer',\n * owners: [owner],\n * })\n * const client = createClient({\n * chain: tempoLocalnet,\n * transport: http(),\n * })\n *\n * await sendTransactionSync(client, {\n * account,\n * to: account.address,\n * })\n *\n * const hash = await Actions.accounts.updateConfig(client, {\n * account,\n * nextConfig: {\n * owners: [{ owner: owner.address, weight: 1 }],\n * threshold: 1,\n * },\n * })\n * ```\n *\n * @param client - Client.\n * @param parameters - Parameters.\n * @returns The transaction hash.\n */\nexport async function updateConfig(client, parameters) {\n return updateConfig.inner(writeContract, client, parameters);\n}\n(function (updateConfig) {\n /** @internal */\n async function inner(action, client, parameters) {\n const { account: account_, currentConfig: currentConfig_, nextConfig, ...rest } = parameters;\n const accountValue = account_ ?? client.account;\n const account = (() => {\n if (typeof accountValue === 'object' &&\n accountValue.source === 'configurable')\n return accountValue;\n return undefined;\n })();\n const config = (() => {\n if (currentConfig_)\n return currentConfig_;\n if (account?.config)\n return account.config;\n return undefined;\n })();\n const address = (() => {\n if (account)\n return account.address;\n if (typeof accountValue === 'string')\n return accountValue;\n if (accountValue)\n return accountValue.address;\n return undefined;\n })();\n const currentConfig = await (async () => {\n if (config)\n return AccountConfig.from(config);\n if (!address)\n throw new Error('A configurable account address or current config is required.');\n const cachedConfig = await getConfig(client, { address });\n if (!cachedConfig)\n throw new Error(`No current account config is cached for account ${address}. Provide the current config.`);\n return cachedConfig;\n })();\n const resolvedAccount = (() => {\n if (account)\n return { ...account, config: currentConfig };\n if (typeof accountValue === 'object')\n return accountValue;\n if (address)\n return fromConfig({ address, ...currentConfig });\n return undefined;\n })();\n return (await withExecutionError(action)(client, {\n ...rest,\n ...(resolvedAccount ? { account: resolvedAccount } : {}),\n ...updateConfig.call({ currentConfig, nextConfig }),\n }));\n }\n updateConfig.inner = inner;\n /**\n * Defines a call to the `updateConfig` function.\n *\n * Can be passed as a parameter to:\n * - [`estimateContractGas`](https://viem.sh/docs/contract/estimateContractGas): estimate gas\n * - [`simulateContract`](https://viem.sh/docs/contract/simulateContract): simulate the update\n * - [`sendCalls`](https://viem.sh/docs/actions/wallet/sendCalls): include the update in a call batch\n *\n * @example\n * ```ts\n * import { Actions, type AccountConfig } from 'viem/tempo'\n *\n * declare const currentConfig: AccountConfig.Config\n *\n * const call = Actions.accounts.updateConfig.call({\n * currentConfig,\n * nextConfig: {\n * owners: [{ owner: '0x...', weight: 1 }],\n * threshold: 1,\n * },\n * })\n * ```\n *\n * @param args - Current and replacement account configurations.\n * @returns The call.\n */\n function call(args) {\n const currentConfig = AccountConfig.from(args.currentConfig);\n const nextConfig = AccountConfig.update(currentConfig, args.nextConfig);\n return defineCall({\n address: Addresses.configurableAccount,\n abi: Abis.configurableAccount,\n args: [currentConfig, nextConfig.threshold, nextConfig.owners],\n functionName: 'updateConfig',\n });\n }\n updateConfig.call = call;\n /**\n * Extracts the `ConfigurableAccountConfigUpdated` event from logs.\n *\n * @param logs - Transaction logs.\n * @returns The configuration update event.\n */\n function extractEvent(logs) {\n const [log] = parseEventLogs({\n abi: Abis.configurableAccount,\n logs,\n eventName: 'ConfigurableAccountConfigUpdated',\n strict: true,\n });\n if (!log)\n throw new Error('`ConfigurableAccountConfigUpdated` event not found.');\n return log;\n }\n updateConfig.extractEvent = extractEvent;\n})(updateConfig || (updateConfig = {}));\n/**\n * Replaces a configurable account configuration and waits for confirmation.\n *\n * @example\n * ```ts\n * import { createWalletClient, custom, type EIP1193Provider } from 'viem'\n * import { tempo } from 'viem/chains'\n * import { Actions, type AccountConfig } from 'viem/tempo'\n *\n * declare const provider: EIP1193Provider\n * declare const currentConfig: AccountConfig.Config\n *\n * const client = createWalletClient({\n * account: '0x...',\n * chain: tempo,\n * transport: custom(provider),\n * })\n *\n * const { receipt } = await Actions.accounts.updateConfigSync(client, {\n * currentConfig,\n * nextConfig: {\n * owners: [{ owner: '0x...', weight: 1 }],\n * threshold: 1,\n * },\n * })\n * ```\n *\n * @param client - Client.\n * @param parameters - Parameters.\n * @returns The updated configuration event and transaction receipt.\n */\nexport async function updateConfigSync(client, parameters) {\n const { throwOnReceiptRevert = true, ...rest } = parameters;\n const receipt = await updateConfig.inner(writeContractSync, client, {\n ...rest,\n throwOnReceiptRevert,\n });\n if (receipt.status === 'pending')\n return { receipt };\n const { args } = updateConfig.extractEvent(receipt.logs);\n return {\n account: args.account,\n config: AccountConfig.from({\n owners: args.owners,\n salt: args.salt,\n threshold: args.threshold,\n version: args.version,\n }),\n receipt,\n };\n}\n/**\n * Upgrades an existing account to a configurable account in place\n * ([TIP-1113](https://tips.sh/1113)).\n *\n * The account keeps its address and installs `owners` and `threshold`. The\n * root key must sign the upgrade, which is sent as the transaction's only\n * call. After the upgrade, the root key can no longer sign for the account.\n *\n * @example\n * ```ts\n * import { createClient, http } from 'viem'\n * import { tempoLocalnet } from 'viem/chains'\n * import { Account, Actions } from 'viem/tempo'\n *\n * const root = Account.fromSecp256k1('0x...')\n * const client = createClient({\n * chain: tempoLocalnet,\n * transport: http(),\n * })\n *\n * const hash = await Actions.accounts.upgrade(client, {\n * account: root,\n * owners: [{ owner: '0x...', weight: 1 }],\n * threshold: 1,\n * })\n * ```\n *\n * @param client - Client.\n * @param parameters - Parameters.\n * @returns The transaction hash.\n */\nexport async function upgrade(client, parameters) {\n return upgrade.inner(writeContract, client, parameters);\n}\n(function (upgrade) {\n /** @internal */\n async function inner(action, client, parameters) {\n const { owners, threshold, ...rest } = parameters;\n for (const key of [\n 'authorizationList',\n 'calls',\n 'data',\n 'keyAuthorization',\n 'to',\n ])\n if (rest[key] !== undefined)\n throw new Error(`\\`${key}\\` is not supported: the upgrade must be the only call, without authorizations.`);\n const account = rest.account ?? client.account;\n if (typeof account === 'object') {\n if (account.source === 'configurable')\n throw new Error('The account is already a configurable account.');\n if (account.source === 'accessKey')\n throw new Error('The root key must sign the upgrade, not an access key.');\n }\n // Always send a Tempo envelope, so relays recognize and cache the upgrade.\n return (await withExecutionError(action)(client, {\n ...rest,\n ...upgrade.call({ owners, threshold }),\n type: 'tempo',\n }));\n }\n upgrade.inner = inner;\n /**\n * Defines a call to the `upgradeAccount` function.\n *\n * The call must be the only call in a transaction signed by the account's\n * root key.\n *\n * @example\n * ```ts\n * import { Actions } from 'viem/tempo'\n *\n * const call = Actions.accounts.upgrade.call({\n * owners: [{ owner: '0x...', weight: 1 }],\n * threshold: 1,\n * })\n * ```\n *\n * @param args - Owners and threshold to install.\n * @returns The call.\n */\n function call(args) {\n const { owners, threshold } = AccountConfig.from(args);\n return defineCall({\n address: Addresses.configurableAccount,\n abi: Abis.configurableAccount,\n args: [threshold, owners],\n functionName: 'upgradeAccount',\n });\n }\n upgrade.call = call;\n /**\n * Extracts the `AccountUpgraded` event from logs.\n *\n * @param logs - Transaction logs.\n * @returns The account upgrade event.\n */\n function extractEvent(logs) {\n const [log] = parseEventLogs({\n abi: Abis.configurableAccount,\n logs,\n eventName: 'AccountUpgraded',\n strict: true,\n });\n if (!log)\n throw new Error('`AccountUpgraded` event not found.');\n return log;\n }\n upgrade.extractEvent = extractEvent;\n})(upgrade || (upgrade = {}));\n/**\n * Upgrades an existing account to a configurable account in place\n * ([TIP-1113](https://tips.sh/1113)) and waits for confirmation.\n *\n * @example\n * ```ts\n * import { createClient, http } from 'viem'\n * import { tempoLocalnet } from 'viem/chains'\n * import { Account, Actions } from 'viem/tempo'\n *\n * const root = Account.fromSecp256k1('0x...')\n * const client = createClient({\n * chain: tempoLocalnet,\n * transport: http(),\n * })\n *\n * const { config } = await Actions.accounts.upgradeSync(client, {\n * account: root,\n * owners: [{ owner: '0x...', weight: 1 }],\n * threshold: 1,\n * })\n * ```\n *\n * @param client - Client.\n * @param parameters - Parameters.\n * @returns The installed configuration, its commitment, and the transaction receipt.\n */\nexport async function upgradeSync(client, parameters) {\n const { throwOnReceiptRevert = true, ...rest } = parameters;\n const receipt = await upgrade.inner(writeContractSync, client, {\n ...rest,\n throwOnReceiptRevert,\n });\n // Pending and (with `throwOnReceiptRevert: false`) reverted receipts carry no upgrade event.\n if (receipt.status !== 'success')\n return { receipt };\n const { args } = upgrade.extractEvent(receipt.logs);\n return {\n account: args.account,\n commitment: args.commitment,\n config: AccountConfig.from({\n owners: args.owners,\n salt: args.salt,\n threshold: args.threshold,\n version: 1n,\n }),\n receipt,\n };\n}\n/**\n * Verifies a configurable account signature against the account's current\n * configuration with the signature verifier precompile.\n *\n * Returns `false` when the signature is for another account or a config that\n * is not the account's current config. Throws when the signature is malformed\n * or its approvals do not reach quorum.\n *\n * @example\n * ```ts\n * import { createClient, http } from 'viem'\n * import { tempo } from 'viem/chains'\n * import { Actions } from 'viem/tempo'\n *\n * const client = createClient({\n * chain: tempo,\n * transport: http(),\n * })\n *\n * const valid = await Actions.accounts.verifyHash(client, {\n * account: '0x...',\n * hash: '0x...',\n * signature: '0x...',\n * })\n * ```\n *\n * @param client - Client.\n * @param parameters - Parameters.\n * @returns Whether the signature is valid for the account.\n */\nexport async function verifyHash(client, parameters) {\n const { account, hash, signature, ...rest } = parameters;\n return withExecutionError(readContract)(client, {\n ...rest,\n ...verifyHash.call({ account, hash, signature }),\n });\n}\n(function (verifyHash) {\n /**\n * Defines a call to the `verifyConfigurableAccount` function on the\n * signature verifier precompile.\n *\n * @param args - Arguments.\n * @returns The call.\n */\n function call(args) {\n const { account, hash, signature } = args;\n return defineCall({\n address: Addresses.signatureVerifier,\n abi: Abis.signatureVerifier,\n args: [account, hash, signature],\n functionName: 'verifyConfigurableAccount',\n });\n }\n verifyHash.call = call;\n})(verifyHash || (verifyHash = {}));\n//# sourceMappingURL=accounts.js.map","// TODO: Find opportunities to make this file less duplicated + more simplified with Viem v3.\nimport * as Hex from 'ox/Hex';\nimport { AccountOperation, Transaction as ox_Transaction, TransactionRequest as ox_TransactionRequest, } from 'ox/tempo';\nimport { parseAccount } from '../accounts/utils/parseAccount.js';\nimport { formatTransaction as viem_formatTransaction } from '../utils/formatters/transaction.js';\nimport { formatTransactionReceipt as viem_formatTransactionReceipt } from '../utils/formatters/transactionReceipt.js';\nimport { formatTransactionRequest as viem_formatTransactionRequest } from '../utils/formatters/transactionRequest.js';\nimport { isTempo, } from './Transaction.js';\nexport function formatTransaction(transaction) {\n if (!isTempo(transaction))\n return viem_formatTransaction(transaction);\n // TODO: upstream `blockTimestamp` formatting into `ox`.\n const blockTimestamp = transaction.blockTimestamp == null\n ? undefined\n : BigInt(transaction.blockTimestamp);\n const operation = transaction.operation;\n const { feePayerSignature, gasPrice: _, nonce, ...tx } = ox_Transaction.fromRpc(transaction);\n return {\n ...tx,\n accessList: tx.accessList,\n ...(typeof blockTimestamp !== 'undefined' && { blockTimestamp }),\n feePayerSignature: feePayerSignature\n ? {\n r: Hex.fromNumber(feePayerSignature.r, { size: 32 }),\n s: Hex.fromNumber(feePayerSignature.s, { size: 32 }),\n v: BigInt(feePayerSignature.v ?? 27),\n yParity: feePayerSignature.yParity,\n }\n : undefined,\n nonce: Number(nonce),\n operation: formatOperation(operation),\n typeHex: ox_Transaction.toRpcType[tx.type],\n type: tx.type,\n };\n}\nexport function formatTransactionReceipt(receipt) {\n const transactionReceipt = viem_formatTransactionReceipt(receipt);\n return {\n ...transactionReceipt,\n operation: formatOperation(receipt.operation),\n ...(receipt.status === 'pending'\n ? { status: 'pending', type: 'tempo' }\n : {}),\n };\n}\n/** Formats a transaction operation attached to an RPC result. */\nfunction formatOperation(value) {\n if (!value)\n return undefined;\n const operation = AccountOperation.fromRpc(value);\n if (operation.type !== 'transaction')\n throw new Error('Expected an account transaction operation.');\n return operation;\n}\nexport function formatTransactionRequest(r, action) {\n const request = r;\n const account = request.account\n ? parseAccount(request.account)\n : undefined;\n const owner = request.owner\n ? parseAccount(request.owner)\n : undefined;\n if (owner?.type === 'json-rpc')\n throw new Error('A local owner account is required to approve a configurable account transaction.');\n // If the request is not a Tempo transaction, route to Viem formatter.\n if (!isTempo(request))\n return viem_formatTransactionRequest(r, action);\n if (action)\n request.calls = request.calls ?? [\n {\n to: r.to ||\n (!r.data || r.data === '0x'\n ? '0x0000000000000000000000000000000000000000'\n : undefined),\n value: r.value,\n data: r.data,\n },\n ];\n // If we have marked the transaction as intended to be paid by a fee\n // payer (feePayer: true), we strip the fee token from the sender's\n // sign payload — per TIP-76 the sender does not commit to it; the fee\n // payer chooses and commits to the token via its own signature.\n //\n // Once the fee payer has signed (`feePayerSignature` is populated),\n // the relay has chosen a token and signed over it. The broadcast\n // envelope must therefore include `feeToken` so the chain can verify\n // the fee payer's signature and identify which token to charge.\n if (request.feePayer === true && !request.feePayerSignature)\n delete request.feeToken;\n // Client-only TIP-1107 fields drive local signing and envelope assembly.\n const { owner: _owner, signatures: _signatures, ...rpcRequest } = request;\n const rpc = ox_TransactionRequest.toRpc({\n ...rpcRequest,\n type: 'tempo',\n });\n if (action === 'estimateGas') {\n rpc.maxFeePerGas = undefined;\n rpc.maxPriorityFeePerGas = undefined;\n }\n rpc.to = undefined;\n rpc.data = undefined;\n rpc.value = undefined;\n const signer = owner ?? account;\n const [keyType, keyData] = (() => {\n const type = signer && 'keyType' in signer ? signer.keyType : signer?.source;\n if (!type)\n return [request.keyType, shimKeyData(request.keyData)];\n if (type === 'webAuthn')\n // Send a 2-byte big-endian length hint (1400 = 0x0578) instead of a\n // 1400-byte dummy blob. The node's gas estimator expects key_data to\n // be 1, 2, or 4 bytes encoding the desired WebAuthn signature size;\n // anything else falls back to the 800-byte default.\n return ['webAuthn', '0x0578'];\n if (['p256', 'secp256k1'].includes(type))\n return [type, undefined];\n return [request.keyType, shimKeyData(request.keyData)];\n })();\n const keyId = signer && 'accessKeyAddress' in signer\n ? signer.accessKeyAddress\n : request.keyId;\n if (account)\n rpc.from = account.address;\n return {\n ...rpc,\n ...(request.capabilities ? { capabilities: request.capabilities } : {}),\n ...(keyData ? { keyData } : {}),\n ...(keyId ? { keyId } : {}),\n ...(keyType ? { keyType } : {}),\n // Keep client-only keys visible to `extract`; undefined values never reach JSON-RPC.\n ...(request.accountSimulation ? { accountSimulation: undefined } : {}),\n ...(request.owner ? { owner: undefined } : {}),\n ...(typeof request.feePayer !== 'undefined'\n ? {\n feePayer: typeof request.feePayer === 'object'\n ? parseAccount(request.feePayer)\n : request.feePayer,\n }\n : {}),\n ...('feePayerSignature' in request &&\n request.feePayerSignature !== undefined\n ? { feePayerSignature: request.feePayerSignature }\n : {}),\n };\n}\n/**\n * Auto-shim user-provided keyData that is longer than 4 bytes into a\n * 2-byte big-endian length hint. The node gas estimator only accepts\n * 1, 2, or 4-byte key_data as a size hint; anything else silently falls\n * back to the 800-byte default.\n */\nfunction shimKeyData(data) {\n if (!data)\n return data;\n const byteLength = (data.length - 2) / 2; // subtract \"0x\" prefix\n if (byteLength <= 4)\n return data;\n return Hex.fromNumber(byteLength, { size: 2 });\n}\n//# sourceMappingURL=Formatters.js.map","const concurrentCounts = new Map();\n/**\n * Detects if there are concurrent tasks occuring for a given key\n * within the same event loop tick. Registers the request, yields to allow\n * other concurrent calls to register, then returns whether multiple requests\n * were detected.\n *\n * @example\n * ```ts\n * const isConcurrent = await Concurrent.detect(address)\n * ```\n */\nexport async function detect(key) {\n concurrentCounts.set(key, (concurrentCounts.get(key) ?? 0) + 1);\n await Promise.resolve();\n const isConcurrent = (concurrentCounts.get(key) ?? 0) > 1;\n queueMicrotask(() => {\n const count = concurrentCounts.get(key) ?? 0;\n if (count <= 1)\n concurrentCounts.delete(key);\n else\n concurrentCounts.set(key, count - 1);\n });\n return isConcurrent;\n}\n//# sourceMappingURL=concurrent.js.map","import * as Hex from 'ox/Hex';\nimport { TxEnvelopeTempo } from 'ox/tempo';\nimport { maxUint256 } from '../../constants/number.js';\nimport { isAddressEqual } from '../../utils/address/isAddressEqual.js';\nimport { keccak256 } from '../../utils/hash/keccak256.js';\n/**\n * Tempo transaction replacement semantics.\n *\n * - Protocol nonces (nonce key `0`, including Ethereum transaction types) and\n * 2D nonces occupy the sender's `(nonceKey, nonce)` slot.\n * - Expiring nonces are deduplicated by their expiring nonce hash, so a\n * transaction is replaced only by another carrying the same sender payload\n * (e.g. re-sponsored with a different fee payer signature or fee token).\n */\nexport const transactionReplacement = {\n getKey(transaction) {\n const tx = transaction;\n if (tx.type !== 'tempo')\n return `0:${tx.nonce}`;\n const nonceKey = tx.nonceKey ?? 0n;\n if (nonceKey === maxUint256)\n return `expiring:${getExpiringNonceHash(tx)}`;\n return `${nonceKey}:${tx.nonce}`;\n },\n getReason({ replaced, replacement }) {\n return getReason(replaced, replacement);\n },\n};\n/**\n * Returns the expiring nonce hash of a Tempo transaction:\n * `keccak256(encodeForSigning(tx) || sender)`. It excludes the fee payer\n * signature and fee token, so it is invariant to sponsorship.\n *\n * @internal\n */\nexport function getExpiringNonceHash(transaction) {\n const tx = transaction;\n const envelope = TxEnvelopeTempo.from({\n accessList: tx.accessList,\n authorizationList: tx.authorizationList,\n calls: tx.calls,\n chainId: tx.chainId,\n feePayerSignature: tx.feePayerSignature ? null : undefined,\n feeToken: tx.feeToken,\n gas: tx.gas,\n keyAuthorization: tx.keyAuthorization ?? undefined,\n maxFeePerGas: tx.maxFeePerGas,\n maxPriorityFeePerGas: tx.maxPriorityFeePerGas,\n nonce: BigInt(tx.nonce),\n nonceKey: tx.nonceKey,\n validAfter: tx.validAfter,\n validBefore: tx.validBefore,\n });\n return keccak256(Hex.concat(TxEnvelopeTempo.encodeForSigning(envelope), tx.from));\n}\nfunction getReason(replaced, replacement) {\n const calls = getCalls(replacement);\n const replacedCalls = getCalls(replaced);\n if (calls.length === replacedCalls.length &&\n calls.every((call, i) => isSameCall(call, replacedCalls[i])))\n return 'repriced';\n if (calls.every((call) => call.to &&\n isAddressEqual(call.to, replacement.from) &&\n !call.value &&\n isEmpty(call.data)))\n return 'cancelled';\n return 'replaced';\n}\nfunction getCalls(transaction) {\n if (transaction.type === 'tempo')\n return transaction.calls;\n return [\n { data: transaction.input, to: transaction.to, value: transaction.value },\n ];\n}\nfunction isSameCall(a, b) {\n return ((a.to && b.to ? isAddressEqual(a.to, b.to) : !a.to && !b.to) &&\n (a.value ?? 0n) === (b.value ?? 0n) &&\n (isEmpty(a.data) ? isEmpty(b.data) : a.data === b.data));\n}\nfunction isEmpty(data) {\n return !data || data === '0x';\n}\n//# sourceMappingURL=replacement.js.map","import * as Hex from 'ox/Hex';\nimport { AccountConfig, AccountOperation, SignatureEnvelope, } from 'ox/tempo';\nimport { getCode } from '../actions/public/getCode.js';\nimport { getTransaction } from '../actions/public/getTransaction.js';\nimport { readContract } from '../actions/public/readContract.js';\nimport { verifyHash } from '../actions/public/verifyHash.js';\nimport { maxUint256 } from '../constants/number.js';\nimport { BaseError } from '../errors/base.js';\nimport { ContractFunctionRevertedError } from '../errors/contract.js';\nimport { isAddressEqual } from '../utils/address/isAddressEqual.js';\nimport { extendSchema } from '../utils/chain/defineChain.js';\nimport { defineTransaction } from '../utils/formatters/transaction.js';\nimport { defineTransactionReceipt } from '../utils/formatters/transactionReceipt.js';\nimport { defineTransactionRequest } from '../utils/formatters/transactionRequest.js';\nimport { getAction } from '../utils/getAction.js';\nimport { keccak256 } from '../utils/hash/keccak256.js';\nimport { getMetadata } from './actions/accessKey.js';\nimport { getConfig, verifyHash as verifyConfigurableAccount, } from './actions/accounts.js';\nimport * as Formatters from './Formatters.js';\nimport * as Concurrent from './internal/concurrent.js';\nimport { transactionReplacement } from './internal/replacement.js';\nimport * as Transaction from './Transaction.js';\nconst maxExpirySecs = 25;\n// TODO: casting to satisfy viem – viem v3 to have more flexible serializer type.\nconst serializeTransaction = ((transaction, signature) => Transaction.serialize(transaction, signature));\nexport const chainConfig = {\n blockTime: 1_000,\n extendSchema: extendSchema(),\n formatters: {\n transaction: defineTransaction({\n exclude: ['aaAuthorizationList'],\n format: Formatters.formatTransaction,\n }),\n transactionReceipt: defineTransactionReceipt({\n format: Formatters.formatTransactionReceipt,\n }),\n transactionRequest: defineTransactionRequest({\n format: Formatters.formatTransactionRequest,\n }),\n },\n prepareTransactionRequest: [\n async (r, { client, phase }) => {\n const request = r;\n if (request.hash) {\n if (!request.account ||\n typeof request.account === 'string' ||\n request.account.source !== 'configurable')\n throw new Error('A local configurable account is required to approve a stored configurable account transaction.');\n if (!request.owner || typeof request.owner === 'string')\n throw new Error('A local owner account is required to approve a stored configurable account transaction.');\n if (request.owner.source !== 'root')\n throw new Error('A Tempo owner account is required to approve a stored configurable account transaction.');\n const transaction = await getAction(client, getTransaction, 'getTransaction')({ hash: request.hash });\n const operation = 'operation' in transaction\n ? transaction.operation\n : undefined;\n if (!operation)\n throw new Error('Expected an account operation transaction.');\n if (!isAddressEqual(operation.account, request.account.address))\n throw new Error('Account operation account does not match the requested account.');\n const storedTransaction = Transaction.deserialize(operation.transaction);\n const hash = AccountOperation.getHash({\n account: operation.account,\n config: operation.config,\n transaction: operation.transaction,\n type: 'transaction',\n });\n if (hash.toLowerCase() !== request.hash.toLowerCase())\n throw new Error('Account operation hash does not match transaction.');\n return {\n ...storedTransaction,\n // Serialized zero values must not trigger a new fill of an approved transaction.\n gas: storedTransaction.gas ?? 0n,\n maxFeePerGas: storedTransaction.maxFeePerGas ?? 0n,\n maxPriorityFeePerGas: storedTransaction.maxPriorityFeePerGas ?? 0n,\n account: request.account,\n from: operation.account,\n accountSimulation: getAccountSimulation({\n config: operation.config,\n local: request.account,\n }),\n owner: request.owner,\n };\n }\n // FIXME: node estimates gas with secp256k1 dummy sig + null feePayerSignature.\n // Actual tx has larger keychain/webAuthn sigs + real fee payer sig, costing more intrinsic gas.\n if (phase === 'afterFillParameters') {\n // Fee payer signature covers the gas limit, so the relay must set it before signing and Viem must not change it afterward.\n if (typeof request.gas !== 'undefined' &&\n request.feePayer &&\n !request.feePayerSignature) {\n if (request.keyAuthorization?.signature.type === 'webAuthn')\n request.gas = (request.gas ?? 0n) + 20000n;\n else if (request.account?.source === 'accessKey')\n request.gas = (request.gas ?? 0n) + 10000n;\n }\n return request;\n }\n const configurableIdentity = (() => {\n if (request.account?.source === 'configurable')\n return {\n account: request.account.address,\n config: request.account.config,\n local: request.account,\n };\n return undefined;\n })();\n if (request.owner && !configurableIdentity)\n throw new Error('A configurable account is required when an owner is provided.');\n if (request.owner && typeof request.owner === 'string')\n throw new Error('A local owner account is required to approve a configurable account transaction.');\n if (request.owner && request.owner.source !== 'root')\n throw new Error('A Tempo owner account is required to approve a configurable account transaction.');\n const coordinated = !!configurableIdentity &&\n !!request.owner &&\n client.transport.accounts === true;\n if (configurableIdentity) {\n const { account, local } = configurableIdentity;\n if (!account)\n throw new Error('A configurable account address is required with a current config.');\n const config = await (async () => {\n if (configurableIdentity.config)\n return configurableIdentity.config;\n if (!coordinated)\n return undefined;\n const cachedConfig = await getAction(client, getConfig, 'getConfig')({ address: account });\n if (!cachedConfig)\n throw new Error(`No current account config is cached for account ${account}. Provide the current config.`);\n return cachedConfig;\n })();\n if (!config)\n throw new Error('An account config is required to prepare a transaction.');\n request.from = account;\n request.accountSimulation = getAccountSimulation({\n config,\n local,\n });\n }\n // Register concurrency before account preparation performs storage or\n // network I/O so overlapping requests cannot miss each other.\n const useExpiringNonce = await (async () => {\n if (request.nonceKey === 'expiring' || request.nonceKey === maxUint256)\n return true;\n if (typeof request.nonceKey !== 'undefined')\n return false;\n if (configurableIdentity)\n return false;\n if (request.feePayer && typeof request.nonceKey === 'undefined')\n return true;\n const account = request.account;\n const address = typeof account === 'string' ? account : account?.address;\n if (address && typeof request.nonceKey === 'undefined')\n return await Concurrent.detect(address.toLowerCase());\n return false;\n })();\n if (coordinated && typeof request.nonceKey === 'undefined') {\n // A random nonce lane lets a stored approval ceremony remain valid\n // indefinitely without blocking other pending operations.\n request.nonceKey = Hex.toBigInt(Hex.random(31)) + 1n;\n request.nonce = 0;\n }\n else if (useExpiringNonce) {\n request.nonceKey = maxUint256;\n request.nonce ??= 0;\n if (typeof request.validAfter === 'undefined')\n request.validAfter = randomValidAfter();\n if (typeof request.validBefore === 'undefined')\n request.validBefore = Math.floor(Date.now() / 1000) + maxExpirySecs;\n }\n else if (typeof request.nonceKey !== 'undefined') {\n request.nonce = typeof request.nonce === 'number' ? request.nonce : 0;\n }\n if (!request.keyAuthorization &&\n request.account?.source === 'accessKey') {\n const keyAuthorizationManager = request.account.keyAuthorizationManager;\n if (keyAuthorizationManager) {\n const chainId = request.chainId ?? request.chain?.id;\n if (typeof chainId !== 'undefined') {\n const address = request.account.address;\n const accessKey = request.account.accessKeyAddress;\n const key = { address, accessKey, chainId };\n const keyAuthorization = await keyAuthorizationManager.get(key);\n if (keyAuthorization) {\n const now = BigInt(Math.floor(Date.now() / 1000));\n if (keyAuthorization.expiry != null &&\n BigInt(keyAuthorization.expiry) <= now) {\n await keyAuthorizationManager.remove(key);\n }\n else {\n const metadata = await getAction(client, getMetadata, 'getMetadata')({ account: address, accessKey });\n if (isAddressEqual(metadata.address, accessKey) &&\n !metadata.isRevoked &&\n metadata.expiry > now)\n await keyAuthorizationManager.remove(key);\n else\n request.keyAuthorization = keyAuthorization;\n }\n }\n }\n }\n }\n if (!request.feeToken && request.chain?.feeToken)\n request.feeToken = request.chain.feeToken;\n return request;\n },\n { runAt: ['beforeFillTransaction', 'afterFillParameters'] },\n ],\n serializers: {\n transaction: serializeTransaction,\n async transactionEnvelope({ serializedTransaction, transaction }) {\n const request = transaction;\n if (!request.accountSimulation)\n return serializedTransaction;\n try {\n SignatureEnvelope.deserialize(serializedTransaction);\n }\n catch {\n const transaction = Transaction.deserialize(serializedTransaction);\n if (transaction.signature?.type === 'configurable')\n return serializedTransaction;\n throw new Error('A Tempo owner account is required to approve a configurable account transaction.');\n }\n return await serializeTransaction({\n ...request,\n signatures: [...(request.signatures ?? []), serializedTransaction],\n });\n },\n },\n transactionReplacement,\n async verifyHash(client, parameters) {\n const { address, hash, signature, mode } = parameters;\n const serialized = (() => {\n if (typeof signature === 'string')\n return signature;\n if (signature instanceof Uint8Array)\n return Hex.fromBytes(signature);\n return undefined;\n })();\n const envelope = (() => {\n if (!serialized)\n return;\n try {\n return SignatureEnvelope.deserialize(serialized);\n }\n catch {\n return undefined;\n }\n })();\n // `verifyHash` supports \"signature envelopes\" (a Tempo proposal) to natively verify arbitrary\n // envelope-compatible (WebAuthn, P256, etc.) signatures.\n if (envelope) {\n // Access key (keychain) signature verification: check the key is\n // authorized, not expired, and not revoked on the AccountKeychain.\n if (envelope?.type === 'keychain' && mode === 'allowAccessKey') {\n // For v2 keychain envelopes, the inner signature signs\n // keccak256(0x04 || hash || userAddress).\n const innerPayload = envelope.version === 'v2'\n ? keccak256(Hex.concat('0x04', hash, address))\n : hash;\n const accessKeyAddress = (() => {\n try {\n return SignatureEnvelope.extractAddress({\n payload: innerPayload,\n signature: envelope.inner,\n });\n }\n catch {\n return undefined;\n }\n })();\n if (!accessKeyAddress)\n return false;\n const keyInfo = await getMetadata(client, {\n account: address,\n accessKey: accessKeyAddress,\n blockHash: parameters.blockHash,\n blockNumber: parameters.blockNumber,\n blockTag: parameters.blockTag,\n requireCanonical: parameters.requireCanonical,\n });\n if (keyInfo.isRevoked)\n return false;\n if (keyInfo.expiry <= BigInt(Math.floor(Date.now() / 1000)))\n return false;\n return SignatureEnvelope.verify(envelope.inner, {\n address: accessKeyAddress,\n payload: innerPayload,\n });\n }\n // Configurable account signatures are verified against the account's\n // current config commitment, which only the chain knows.\n // Reverts (malformed signatures or approvals below quorum) are invalid signatures.\n if (envelope.type === 'configurable')\n return await readContract(client, {\n blockHash: parameters.blockHash,\n blockNumber: parameters.blockNumber,\n blockTag: parameters.blockTag,\n requireCanonical: parameters.requireCanonical,\n ...verifyConfigurableAccount.call({\n account: address,\n hash,\n signature: serialized,\n }),\n }).catch((error) => {\n if (error instanceof BaseError &&\n error.walk((cause) => cause instanceof ContractFunctionRevertedError))\n return false;\n throw error;\n });\n // Stateless, non-keychain signature envelopes (P256, WebAuthn) can be\n // verified directly without a network request.\n if (envelope.type === 'p256' || envelope.type === 'webAuthn') {\n const code = await getCode(client, {\n address,\n blockHash: parameters.blockHash,\n blockNumber: parameters.blockNumber,\n blockTag: parameters.blockTag,\n requireCanonical: parameters.requireCanonical,\n });\n // Check if EOA, if not, we want to go down the ERC-1271 flow.\n if (\n // not a contract (EOA)\n !code ||\n // default delegation (tempo EOA)\n code === '0xef01007702c00000000000000000000000000000000000')\n return SignatureEnvelope.verify(envelope, {\n address,\n payload: hash,\n });\n }\n }\n return await getAction(client, verifyHash, 'verifyHash')({ ...parameters, chain: null });\n },\n};\n/** Builds a bounded account spec for gas simulation. */\nfunction getAccountSimulation(options) {\n const { config, local } = options;\n return {\n approvals: selectOwners(config).map((owner) => {\n const localOwner = local?.owners.find((account) => isAddressEqual(account.address, owner.owner));\n return {\n ...getSimulationKey(localOwner),\n owner: owner.owner,\n };\n }),\n config,\n };\n}\n/** Returns signature metadata for conservative gas estimation. */\nfunction getSimulationKey(account) {\n const keyType = (() => {\n if (account &&\n typeof account === 'object' &&\n 'keyType' in account &&\n typeof account.keyType === 'string')\n return account.keyType;\n return undefined;\n })();\n if (!keyType || keyType === 'webAuthn')\n return { keyData: '0x0578', keyType: 'webAuthn' };\n if (keyType === 'p256' || keyType === 'secp256k1')\n return { keyType };\n return { keyData: '0x0578', keyType: 'webAuthn' };\n}\n/** Returns random past seconds to distinguish otherwise-identical expiring transactions. */\nfunction randomValidAfter() {\n const now = BigInt(Math.floor(Date.now() / 1_000));\n const latest = now - 60n;\n if (latest <= 0n)\n return 0;\n return Number(BigInt(Hex.random(8)) % latest);\n}\n/** Selects a deterministic minimum-cardinality owner quorum. */\nfunction selectOwners(config) {\n const owners = [...config.owners].sort((a, b) => Number(b.weight) - Number(a.weight) ||\n a.owner.toLowerCase().localeCompare(b.owner.toLowerCase()));\n const selected = [];\n let weight = 0;\n for (const owner of owners.slice(0, AccountConfig.maxSignatures)) {\n if (weight >= Number(config.threshold))\n break;\n selected.push(owner);\n weight += Number(owner.weight);\n }\n return selected.sort((a, b) => a.owner.toLowerCase().localeCompare(b.owner.toLowerCase()));\n}\n//# sourceMappingURL=chainConfig.js.map","import { chainConfig } from '../../tempo/chainConfig.js';\nimport { defineChain } from '../../utils/chain/defineChain.js';\nexport const tempo = /*#__PURE__*/ defineChain({\n ...chainConfig,\n id: 4217,\n blockExplorers: {\n default: {\n name: 'Tempo Explorer',\n url: 'https://explore.tempo.xyz',\n },\n },\n contracts: {\n earnFactory: {\n address: '0x3085A8003f340CD51C72D9e1a1298CDafB171B02',\n },\n erc4626EngineFactory: {\n address: '0xd43D00981222a8db444A528E69f19E3cE5A7D2Ff',\n },\n },\n name: 'Tempo Mainnet',\n nativeCurrency: {\n name: 'USD',\n symbol: 'USD',\n decimals: 6,\n },\n rpcUrls: {\n default: {\n http: ['https://rpc.tempo.xyz'],\n webSocket: ['wss://rpc.tempo.xyz'],\n },\n },\n});\n//# sourceMappingURL=tempo.js.map","import { chainConfig } from '../../tempo/chainConfig.js';\nimport { defineChain } from '../../utils/chain/defineChain.js';\nexport const tempoDevnet = /*#__PURE__*/ defineChain({\n ...chainConfig,\n id: 31318,\n name: 'Tempo Devnet',\n hardfork: 't3',\n blockExplorers: {\n default: {\n name: 'Tempo Explorer',\n url: 'https://explore.devnet.tempo.xyz',\n },\n },\n nativeCurrency: {\n name: 'USD',\n symbol: 'USD',\n decimals: 6,\n },\n rpcUrls: {\n default: {\n http: ['https://rpc.devnet.tempoxyz.dev'],\n webSocket: ['wss://rpc.devnet.tempoxyz.dev'],\n },\n },\n testnet: true,\n});\n//# sourceMappingURL=tempoDevnet.js.map","import { chainConfig } from '../../tempo/chainConfig.js';\nimport { defineChain } from '../../utils/chain/defineChain.js';\nexport const tempoLocalnet = /*#__PURE__*/ defineChain({\n ...chainConfig,\n id: 1337,\n name: 'Tempo',\n hardfork: 't3',\n nativeCurrency: {\n name: 'USD',\n symbol: 'USD',\n decimals: 6,\n },\n rpcUrls: {\n default: { http: ['http://localhost:8545'] },\n },\n});\n//# sourceMappingURL=tempoLocalnet.js.map","import { chainConfig } from '../../tempo/chainConfig.js';\nimport { defineChain } from '../../utils/chain/defineChain.js';\nexport const tempoModerato = /*#__PURE__*/ defineChain({\n ...chainConfig,\n id: 42431,\n hardfork: 't5',\n blockExplorers: {\n default: {\n name: 'Tempo Explorer',\n url: 'https://explore.testnet.tempo.xyz',\n },\n },\n contracts: {\n earnFactory: {\n address: '0x1de6B233984583F4d936ae4265f3b60282b70cc6',\n },\n erc4626EngineFactory: {\n address: '0x0d57c10249eb3a92b7d81bBA6221F80F2865448A',\n },\n },\n name: 'Tempo Testnet (Moderato)',\n nativeCurrency: {\n name: 'USD',\n symbol: 'USD',\n decimals: 6,\n },\n rpcUrls: {\n default: {\n http: ['https://rpc.moderato.tempo.xyz'],\n webSocket: ['wss://rpc.moderato.tempo.xyz'],\n },\n },\n testnet: true,\n});\n//# sourceMappingURL=tempoModerato.js.map","/**\n * The Tempo chains whose balances Tempo ID reads, by the name in the `chain` parameter: `mainnet`,\n * `testnet`, or a name that `RPC_URLS` lists.\n * @module\n */\nimport {\n tempo,\n tempoDevnet,\n tempoLocalnet,\n tempoTestnet,\n} from 'viem/tempo/chains'\nimport { z } from 'zod'\nimport * as Log from './Log.js'\n\n/**\n * `RPC_URLS` or `TEMPO_API_URLS` holds an entry that does not parse. The message names the entry by\n * position only, since a URL can hold a key.\n */\nexport class InvalidListError extends Error {\n override readonly name = 'Chain.InvalidListError'\n\n constructor(options: InvalidListError.Options) {\n super(\n `Invalid ${options.variable} entry ${options.index + 1}: ${options.reason}. Write each entry as \\`name:chainId=url\\`, such as \\`local:1337=http://localhost:8545\\`, and separate entries with commas.`,\n )\n }\n}\n\nexport declare namespace InvalidListError {\n type Options = {\n /** From 0. */\n index: number\n /** What the entry gets wrong. */\n reason: string\n /** The variable that holds the entry. */\n variable: list.Variable\n }\n}\n\n/** Each built-in chain's ID, by its name. */\nexport const ids = { mainnet: tempo.id, testnet: tempoTestnet.id } as const\n\n/** The Tempo chains whose tokens Tempo ID knows. A listed RPC URL serves one of them. */\nexport const known = [tempo, tempoTestnet, tempoDevnet, tempoLocalnet]\n\n/** A chain's name: up to 32 lowercase letters, digits, and dashes. */\nexport const schema = z.string().regex(/^[a-z0-9][a-z0-9-]{0,31}$/)\n\n/** A chain's name: `mainnet`, `testnet`, or a listed entry's name. */\nexport type Chain = z.output<typeof schema>\n\n/** A chain that `RPC_URLS` lists. */\nexport type Entry = {\n /** The Tempo chain that the node serves. */\n chainId: number\n /** The name in the `chain` parameter. */\n name: string\n /** The node's RPC URL, which can hold a provider's key. */\n url: string\n}\n\n/**\n * Returns the chains that a `RPC_URLS` value lists, in order, from comma-separated\n * `name:chainId=url` entries. An entry named `mainnet` or `testnet` replaces that chain's RPC URL.\n *\n * @throws {InvalidListError} When an entry does not parse, repeats a name, gives a built-in name\n * another chain's ID, or names a chain that is not a Tempo chain.\n */\nexport function list(options: list.Options): readonly Entry[] {\n const { variable = 'RPC_URLS' } = options\n const entries: Entry[] = []\n const parts = (options.value ?? '')\n .split(',')\n .map((part) => part.trim())\n .filter(Boolean)\n\n for (const [index, part] of parts.entries()) {\n // The URL can hold `=` and `:` itself, so the first `=` ends the name and the chain ID.\n const split = part.indexOf('=')\n const head = split === -1 ? part : part.slice(0, split)\n const url = split === -1 ? '' : part.slice(split + 1).trim()\n const [name = '', id = ''] = head.split(':').map((value) => value.trim())\n const chainId = Number(id)\n\n if (!schema.safeParse(name).success)\n throw new InvalidListError({\n index,\n reason:\n 'the name needs lowercase letters, digits, and dashes, up to 32 characters',\n variable,\n })\n if (name in ids && chainId !== ids[name as keyof typeof ids])\n throw new InvalidListError({\n index,\n reason: `\\`${name}\\` is chain ${ids[name as keyof typeof ids]}`,\n variable,\n })\n if (entries.some((entry) => entry.name === name))\n throw new InvalidListError({\n index,\n reason: `\\`${name}\\` repeats an earlier entry`,\n variable,\n })\n if (!known.some((chain) => chain.id === chainId))\n throw new InvalidListError({\n index,\n // The segment can hold a URL's key when the entry has no `=`, so only digits are named.\n reason: /^\\d+$/.test(id)\n ? `\\`${id}\\` is not a Tempo chain ID, such as ${tempoLocalnet.id}`\n : `the chain ID needs digits, such as ${tempoLocalnet.id}`,\n variable,\n })\n if (!URL.canParse(url) || !/^https?:$/.test(new URL(url).protocol))\n throw new InvalidListError({\n index,\n reason: 'the URL needs http or https',\n variable,\n })\n\n entries.push({ chainId, name, url })\n }\n\n return entries\n}\n\nexport declare namespace list {\n type Options = {\n /** The variable's value. */\n value: string | undefined\n /** The variable that errors name. Defaults to `RPC_URLS`. */\n variable?: Variable | undefined\n }\n\n /** A variable that lists chains in the `name:chainId=url` format. */\n type Variable = 'RPC_URLS' | 'TEMPO_API_URLS'\n}\n\n/** The Tempo API of the built-in chains, which limits requests without a key. */\nconst defaultApiUrl = 'https://api.tempo.xyz'\n\n/**\n * Returns the Tempo API URL that `TEMPO_API_URLS` lists for `chainId`, else {@link defaultApiUrl}\n * for a built-in chain. `none` turns the API off. A list that does not parse logs a warning, and\n * returns `undefined`.\n */\nexport function apiUrl(options: apiUrl.Options) {\n if (options.apiUrls?.trim() === 'none') return undefined\n const builtIn = Object.values(ids).some((id) => id === options.chainId)\n\n try {\n const entry = list({\n value: options.apiUrls,\n variable: 'TEMPO_API_URLS',\n }).find((candidate) => candidate.chainId === options.chainId)\n return entry?.url ?? (builtIn ? defaultApiUrl : undefined)\n } catch (error) {\n if (!(error instanceof InvalidListError)) throw error\n Log.warn({ error, message: 'TEMPO_API_URLS does not parse.' })\n return undefined\n }\n}\n\nexport declare namespace apiUrl {\n type Options = {\n /** The value of `TEMPO_API_URLS`. */\n apiUrls: string | undefined\n /** The chain's ID. */\n chainId: number\n }\n}\n\n/**\n * Returns the name that `GET /v1/chains` lists for `chainId`: `mainnet`, `testnet`, or the first\n * `RPC_URLS` entry with that ID. Returns `undefined` when none does, or `rpcUrls` does not parse.\n */\nexport function name(options: name.Options) {\n const builtIn = (Object.keys(ids) as (keyof typeof ids)[]).find(\n (key) => ids[key] === options.chainId,\n )\n if (builtIn) return builtIn\n\n try {\n return list({ value: options.rpcUrls }).find(\n (entry) => entry.chainId === options.chainId,\n )?.name\n } catch (error) {\n if (!(error instanceof InvalidListError)) throw error\n return undefined\n }\n}\n\nexport declare namespace name {\n type Options = {\n /** The chain's ID. */\n chainId: number\n /** The value of `RPC_URLS`. */\n rpcUrls: string | undefined\n }\n}\n\n/**\n * Returns the chain ID and RPC URL of the chain `name`, or `undefined` for an unknown name. A listed\n * URL applies first, then `rpcUrl` for a built-in chain, then the chain's public RPC URL.\n *\n * @throws {InvalidListError} When `rpcUrls` does not parse and `name` is not built in.\n */\nexport function resolve(options: resolve.Options) {\n const { name } = options\n if (name === 'mainnet' || name === 'testnet')\n return {\n chainId: ids[name],\n rpcUrl:\n override({ chainId: ids[name], rpcUrls: options.rpcUrls }) ??\n options.rpcUrl,\n }\n\n const entry = list({ value: options.rpcUrls }).find(\n (candidate) => candidate.name === name,\n )\n if (!entry) return undefined\n return { chainId: entry.chainId, rpcUrl: entry.url }\n}\n\nexport declare namespace resolve {\n type Options = {\n /** The chain's name. */\n name: Chain\n /** `TEMPO_RPC_URL`, for each built-in chain that `rpcUrls` does not list. */\n rpcUrl: string | undefined\n /** The value of `RPC_URLS`. */\n rpcUrls: string | undefined\n }\n\n type ReturnType =\n | {\n /** The chain's ID. */\n chainId: number\n /** The RPC URL, or `undefined` for the chain's own. */\n rpcUrl: string | undefined\n }\n | undefined\n}\n\n/**\n * Returns the URL that a `RPC_URLS` entry gives the built-in chain `chainId`, or `undefined`. A list\n * that does not parse logs a warning, so built-in chains still read.\n */\nexport function override(options: override.Options) {\n const name = (Object.keys(ids) as (keyof typeof ids)[]).find(\n (key) => ids[key] === options.chainId,\n )\n if (!name) return undefined\n\n try {\n return list({ value: options.rpcUrls }).find((entry) => entry.name === name)\n ?.url\n } catch (error) {\n if (!(error instanceof InvalidListError)) throw error\n Log.warn({ error, message: 'RPC_URLS does not parse.' })\n return undefined\n }\n}\n\nexport declare namespace override {\n type Options = {\n /** The chain's ID. */\n chainId: number\n /** The value of `RPC_URLS`. */\n rpcUrls: string | undefined\n }\n}\n"],"ignoreList":[0,1,2,3,4,5,6,7,8,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32],"mappings":"A,ykCA+CA,SAAgBA,GAAK,EAAe,EAAU,CAAC,EAAG,CAG9C,OAFI,OAAO2R,EAAc,SAAY,SAC1B1R,GAAQ0R,CAAa,EACzB,CAAE,GAAGA,EAAe,GAAGE,EAAQ,SAAU,CACpD,CAqBA,SAAgB5R,GAAQ,EAAe,CACnC,GAAM,CAAE,UAAS,UAAS,SAAU0R,EAC9BG,EAAY5R,GAAkByR,CAAa,EACjD,MAAO,CACH,UACA,QAAS,OAAOI,CAAO,EACvB,MAAO,OAAOC,CAAK,EACnB,GAAGF,CACP,CACJ,CAqBA,SAAgBG,GAAY,EAAmB,CAC3C,OAAOC,EAAkB,IAAIjS,EAAO,CACxC,CAyMA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AASxT,EAAQ,OAAQ,CAAC,GACzDA,EAAQ,MACZ,EAEF,IAAMgC,EAAQiR,EAAK,CAAE,MAAOjT,EAAQ,OAAQ,CAAC,CAAC,CAAC,KAC5C,GAAcmI,EAAU,OAASqL,CACpC,EACA,GAAKxR,EACL,MAAO,CAAE,QAASA,EAAM,QAAS,OAAQA,EAAM,GAAI,CACrD,CA0BA,SAAgB8R,GAAS,EAA2B,CAClD,IAAMN,EAAQ,OAAO,KAAKV,CAAG,CAAC,CAA0B,KACrD,GAAQA,EAAIvP,KAASvD,EAAQ,OAChC,EACA,GAAKwT,EAEL,GAAI,CACF,OAAOP,EAAK,CAAE,MAAOjT,EAAQ,OAAQ,CAAC,CAAC,CAAC,KAAM,GAAUgC,EAAM,OAASwR,CAAI,CAAC,EACxE,GACN,OAASnO,EAAO,CACd,GAAI,EAAEA,aAAiBwN,GAAmB,MAAMxN,EAChDM,GAAS,CAAE,QAAO,QAAS,0BAA2B,CAAC,EACvD,MACF,CACF,C"}
1
+ {"version":3,"file":"Chain-C9RGZDJm.js","names":["from","fromRpc","Signature.extract","toRpc","Hex.fromNumber","Signature.toRpc","Hex.fromNumber","assert","InvalidError","from","fromRpc","Hex.toBigInt","Hex.toNumber","toRpc","Quantity.fromNumberish","Hex.fromNumber","Errors.BaseError","assert","InvalidError","Hex.toBigInt","Signature.fromHex","from","fromRpc","Hex.fromNumber","Hex.toNumber","toRpc","Hex.size","Hex.slice","Hex.concat","Errors.BaseError","assert","fromRpc","Hex.toBigInt","toRpc","Quantity.fromNumberish","Errors.BaseError","toRpcType","fromRpcType","fromRpc","Signature.extract","FrameNonce.InvalidError","FrameNonce.fromRpc","Frame.fromRpc","FrameSignature.fromRpc","Authorization.fromRpcList","Signature.yParityToV","toRpc","Hex.fromNumber","FrameNonce.toRpc","Frame.toRpc","FrameSignature.toRpc","Authorization.toRpcList","toRpc","Frame.toRpc","toRpc","Authorization.toRpcList","Hex.fromNumber","FrameRequest.toRpc","FrameSignature.toRpc","FrameNonce.toRpc","Transaction.toRpcType","LogLine.format","TxEnvelopeTempo.getSignPayload","TxEnvelopeTempo.deserialize","KeyAuthorization_.getSignPayload","KeyAuthorization_.deserialize","AccountConfig.getSignPayload","AccountConfig.from","fromRpc","Hex.validate","Hex.toBigInt","Hex.fromNumber","AccountConfig.fromRpc","Address.validate","Hash.validate","SignatureEnvelope.extractAddress","TxEnvelopeTempo.feePayerMagic","TxEnvelopeTempo.serialize","KeyAuthorization_.serialize","SignatureEnvelope.deserialize","SignatureEnvelope.serialize","Hex.isEqual","AccountConfig.zeroSalt","Address.isEqual","Errors.BaseError","toRpc","shimKeyData","Rlp.fromHex","AccountConfig.toTuple","size","Hex.size","Hex.fromNumber","Errors.BaseError","ox_Transaction.toRpcType","ox_Transaction.fromRpcType","ox_Transaction.fromRpc","AuthorizationTempo.fromRpcList","SignatureEnvelope.fromRpc","KeyAuthorization.fromRpc","Signature.fromRpc","Signature.yParityToV","toRpc","ox_Transaction.toRpc","AuthorizationTempo.toRpcList","Hex.fromNumber","KeyAuthorization.toRpc","Signature.toRpc","SignatureEnvelope.toRpc","ox_TransactionRequest.toRpc","AuthorizationTempo.toRpcList","TempoAddress.resolve","Hex.fromNumber","TokenId.toAddress","KeyAuthorization.toRpc","AccountSimulation.toRpc","Hex.random","formatTransactionReceipt","magicBytes","AbiParameters.from","assert","Hex.slice","InvalidWrappedSignatureError","Hex.toNumber","AbiParameters.decode","Authorization.from","validate","Errors.BaseError","formatTransaction","Hex.slice","Hex.concat","AbiParameters.encode","AbiParameters.from","Errors.BaseError","verifyHash","SignatureErc8010.validate","SignatureErc8010.unwrap","SignatureErc6492.validate","SignatureErc6492.wrap","AccountConfig.from","Addresses.configurableAccount","Abis.configurableAccount","AccountConfig.fromRpc","AccountConfig.update","Addresses.signatureVerifier","Abis.signatureVerifier","viem_formatTransaction","ox_Transaction.fromRpc","Hex.fromNumber","ox_Transaction.toRpcType","viem_formatTransactionReceipt","AccountOperation.fromRpc","viem_formatTransactionRequest","ox_TransactionRequest.toRpc","TxEnvelopeTempo.from","Hex.concat","TxEnvelopeTempo.encodeForSigning","Transaction.serialize","Formatters.formatTransaction","Formatters.formatTransactionReceipt","Formatters.formatTransactionRequest","Transaction.deserialize","AccountOperation.getHash","Concurrent.detect","Hex.toBigInt","Hex.random","Hex.fromBytes","SignatureEnvelope.deserialize","Hex.concat","SignatureEnvelope.extractAddress","SignatureEnvelope.verify","verifyConfigurableAccount","BaseError","verifyHash","tempoTestnet","z.string","formatLog","toAddress","from$5","configurableAccount","zeroSalt","signatureVerifier","decode","fromHex","deserialize","from$6","encodeForSigning","signatureVerifier$1","configurableAccount$1","encode","assert$5","parseEventLogs","isEqual","update","getAction","serialize","getSignPayload","readContract","serialize$1","defineTransaction","isTempo","assert$6","fromRpc$8","recoverAddress","fromRpcList$1","serialize$2","fromConfig","fromRpc$7","from$4","getSignPayload$1","deserialize$2","recoverAuthorizationAddress","verify","getMetadata","deserialize$1","toRpc$10","formatTransaction$1","withExecutionError","toRpc$11","writeContract","feePayerMagic","defineCall","fromRpc$9","resolve$1","transactionType","toRpcList$1","extractAddress","serialize$3","toTuple$1","deserialize$3","getSignPayload$2","validate$2","slice","fromNumber","validate$3","toNumber","random","fromBytes","isEqual$1","toBigInt","size","assert$7","concat","BaseError","secp256k1","extract","validate$4","toRpc$12","yParityToV","assert$9","fromRpc$10","assert$8","defineFormatter","getAddress","keccak256","ContractFunctionRevertedError","hexToBigInt","hexToBool","hexToNumber","numberToHex","CallExecutionError","hexToBytes","ContractFunctionExecutionError","formatTransactionRequest$1","TransactionNotFoundError","formatBlockParameter","encodeDeployData","isHex","concatHex","parseAccount","erc1271Abi","isAddressEqual","bytesToHex","erc6492SignatureValidatorByteCode","multicall3Abi","erc6492SignatureValidatorAbi","BaseError$1","call","multicall3Bytecode","encodeFunctionData","defineTransactionRequest","maxUint256","string","from$3","authorization","fromRpc$6","options","signature","chainId","nonce","fromRpcList","authorizationList","toRpc$9","toRpcList","fromNumberish","value","modes","flags","assert$4","flagsValue","modeValue","frame","mode","InvalidError$2","flags_","field","limit","executionGas","stateGas","data","from$2","fromRpc$5","toRpc$8","p256N","secp256k1N","schemes","assert$3","scheme","entry","InvalidError$1","payload","coordinate","fromHex$1","r","s","order","from$1","result","fromRpc$4","fromTuple","toRpc$7","signer","msg","toTuple","tuple","metadata","publicKey","assert$2","keys","InvalidError","index","key","fromRpc$3","integer","decoded","toRpc$6","encoded","toRpcType$1","fromRpcType$1","fromRpc$2","transaction","transaction_","toRpc$5","rpc","toRpc$4","rest","toRpc$3","request_rpc","request","levels","flatten","pair","item","format","fields","level","pairs","message","quote","text","dev","error","parameters","print","info","route","c","warn","compact","describe","shortMessage","read","query","status","line","getHash","from","config","operation","owner","InvalidOperationError","assertBase","assertTransaction","assertKeyAuthorization","cause","fromRpc$1","version","version_","assertInteger","owners","approvalWeights","seen","approval","assertApproval","weight","isWeightReachable","expiresAt","submissionId","transactionHash","assertOperationHash","feePayer","transactionFields","assertSelectedApprovals","sameConfig","serialized","retained","selected","candidate","digest","addresses","previous","current","reachable","signatureCount","ownerWeight","weights","count","configA","a","configB","b","other","toRpc$2","spec","assertApprovals","approvals","keyData","shimKeyData$1","keyType","serializeConfig","InvalidSimulationError","size$1","toRpcType","fromRpcType","fromRpc","toRpc$1","toRpc","nonceKey","receiptStatuses","formatTransactionReceipt$1","receipt","transactionReceipt","log","defineTransactionReceipt","getCode","block","hex","client","address","blockNumber","blockHash","verifyAuthorization","defineChain","chainInstance","chain","extend","properties","fnOrExtended","base","combined","extendSchema","suffixParameters","assert$1","InvalidWrappedSignatureError$1","unwrap","wrapped","suffixLength","suffix","auth","to","validate$1","getTransaction","blockTag_","blockTag","blockNumberHex","hash","sender","magicBytes","assert","InvalidWrappedSignatureError","wrap","validate","serializeSignature","yParity_","yParity","v","verifyHash$1","verifierAddress","verifyErc8010","verifyErc6492","VerificationError","authorization_ox","initData","verifyErc1271","results","multicallAddress","wrappedSignature","factory","factoryData","args","deriveAccount","salt","threshold","getConfig","getConfigCommitment","updateConfig","inner","account_","currentConfig_","accountValue","account","currentConfig","cachedConfig","resolvedAccount","action","nextConfig","extractEvent","upgrade","verifyHash","formatTransaction","blockTimestamp","_","tx","feePayerSignature","formatOperation","formatTransactionReceipt","formatTransactionRequest","_owner","_signatures","rpcRequest","type","shimKeyData","keyId","byteLength","concurrentCounts","detect","isConcurrent","transactionReplacement","getExpiringNonceHash","getReason","replaced","replacement","envelope","calls","getCalls","replacedCalls","isSameCall","i","isEmpty","maxExpirySecs","serializeTransaction","chainConfig","storedTransaction","getAccountSimulation","phase","configurableIdentity","coordinated","useExpiringNonce","randomValidAfter","keyAuthorizationManager","accessKey","keyAuthorization","now","serializedTransaction","innerPayload","accessKeyAddress","keyInfo","code","selectOwners","localOwner","local","getSimulationKey","latest","tempo","tempoDevnet","tempoLocalnet","tempoModerato","InvalidListError","ids","known","schema","list","entries","parts","part","split","head","url","name","id","defaultApiUrl","apiUrl","builtIn","resolve","override"],"sources":["../../../../../node_modules/.pnpm/ox@0.14.57_typescript@7.0.2_zod@4.6.7/node_modules/ox/_esm/core/Authorization.js","../../../../../node_modules/.pnpm/ox@0.14.57_typescript@7.0.2_zod@4.6.7/node_modules/ox/_esm/core/internal/quantity.js","../../../../../node_modules/.pnpm/ox@0.14.57_typescript@7.0.2_zod@4.6.7/node_modules/ox/_esm/core/Frame.js","../../../../../node_modules/.pnpm/ox@0.14.57_typescript@7.0.2_zod@4.6.7/node_modules/ox/_esm/core/internal/curves.js","../../../../../node_modules/.pnpm/ox@0.14.57_typescript@7.0.2_zod@4.6.7/node_modules/ox/_esm/core/FrameSignature.js","../../../../../node_modules/.pnpm/ox@0.14.57_typescript@7.0.2_zod@4.6.7/node_modules/ox/_esm/core/internal/frameNonce.js","../../../../../node_modules/.pnpm/ox@0.14.57_typescript@7.0.2_zod@4.6.7/node_modules/ox/_esm/core/Transaction.js","../../../../../node_modules/.pnpm/ox@0.14.57_typescript@7.0.2_zod@4.6.7/node_modules/ox/_esm/core/FrameRequest.js","../../../../../node_modules/.pnpm/ox@0.14.57_typescript@7.0.2_zod@4.6.7/node_modules/ox/_esm/core/TransactionRequest.js","../../../../internal/LogLine.ts","../../../../internal/Log.ts","../../../../../node_modules/.pnpm/ox@0.14.57_typescript@7.0.2_zod@4.6.7/node_modules/ox/_esm/tempo/AccountOperation.js","../../../../../node_modules/.pnpm/ox@0.14.57_typescript@7.0.2_zod@4.6.7/node_modules/ox/_esm/tempo/AccountSimulation.js","../../../../../node_modules/.pnpm/ox@0.14.57_typescript@7.0.2_zod@4.6.7/node_modules/ox/_esm/tempo/Transaction.js","../../../../../node_modules/.pnpm/ox@0.14.57_typescript@7.0.2_zod@4.6.7/node_modules/ox/_esm/tempo/TransactionRequest.js","../../../../../node_modules/.pnpm/viem@2.57.10_typescript@7.0.2_zod@4.6.7/node_modules/viem/_esm/utils/formatters/transactionReceipt.js","../../../../../node_modules/.pnpm/viem@2.57.10_typescript@7.0.2_zod@4.6.7/node_modules/viem/_esm/actions/public/getCode.js","../../../../../node_modules/.pnpm/viem@2.57.10_typescript@7.0.2_zod@4.6.7/node_modules/viem/_esm/utils/authorization/verifyAuthorization.js","../../../../../node_modules/.pnpm/viem@2.57.10_typescript@7.0.2_zod@4.6.7/node_modules/viem/_esm/utils/chain/defineChain.js","../../../../../node_modules/.pnpm/ox@0.14.57_typescript@7.0.2_zod@4.6.7/node_modules/ox/_esm/erc8010/SignatureErc8010.js","../../../../../node_modules/.pnpm/viem@2.57.10_typescript@7.0.2_zod@4.6.7/node_modules/viem/_esm/actions/public/getTransaction.js","../../../../../node_modules/.pnpm/ox@0.14.57_typescript@7.0.2_zod@4.6.7/node_modules/ox/_esm/erc6492/SignatureErc6492.js","../../../../../node_modules/.pnpm/viem@2.57.10_typescript@7.0.2_zod@4.6.7/node_modules/viem/_esm/utils/signature/serializeSignature.js","../../../../../node_modules/.pnpm/viem@2.57.10_typescript@7.0.2_zod@4.6.7/node_modules/viem/_esm/actions/public/verifyHash.js","../../../../../node_modules/.pnpm/viem@2.57.10_typescript@7.0.2_zod@4.6.7/node_modules/viem/_esm/tempo/actions/accounts.js","../../../../../node_modules/.pnpm/viem@2.57.10_typescript@7.0.2_zod@4.6.7/node_modules/viem/_esm/tempo/Formatters.js","../../../../../node_modules/.pnpm/viem@2.57.10_typescript@7.0.2_zod@4.6.7/node_modules/viem/_esm/tempo/internal/concurrent.js","../../../../../node_modules/.pnpm/viem@2.57.10_typescript@7.0.2_zod@4.6.7/node_modules/viem/_esm/tempo/internal/replacement.js","../../../../../node_modules/.pnpm/viem@2.57.10_typescript@7.0.2_zod@4.6.7/node_modules/viem/_esm/tempo/chainConfig.js","../../../../../node_modules/.pnpm/viem@2.57.10_typescript@7.0.2_zod@4.6.7/node_modules/viem/_esm/chains/definitions/tempo.js","../../../../../node_modules/.pnpm/viem@2.57.10_typescript@7.0.2_zod@4.6.7/node_modules/viem/_esm/chains/definitions/tempoDevnet.js","../../../../../node_modules/.pnpm/viem@2.57.10_typescript@7.0.2_zod@4.6.7/node_modules/viem/_esm/chains/definitions/tempoLocalnet.js","../../../../../node_modules/.pnpm/viem@2.57.10_typescript@7.0.2_zod@4.6.7/node_modules/viem/_esm/chains/definitions/tempoModerato.js","../../../../internal/Chain.ts"],"sourcesContent":["import * as Hash from './Hash.js';\nimport * as Hex from './Hex.js';\nimport * as Rlp from './Rlp.js';\nimport * as Signature from './Signature.js';\n/**\n * Converts an [EIP-7702](https://eips.ethereum.org/EIPS/eip-7702) Authorization object into a typed {@link ox#Authorization.Authorization}.\n *\n * @example\n * An Authorization can be instantiated from an [EIP-7702](https://eips.ethereum.org/EIPS/eip-7702) Authorization tuple in object format.\n *\n * ```ts twoslash\n * import { Authorization } from 'ox'\n *\n * const authorization = Authorization.from({\n * address: '0x1234567890abcdef1234567890abcdef12345678',\n * chainId: 1,\n * nonce: 69n,\n * })\n * ```\n *\n * @example\n * ### Attaching Signatures\n *\n * A {@link ox#Signature.Signature} can be attached with the `signature` option. The example below demonstrates signing\n * an Authorization with {@link ox#Secp256k1.(sign:function)}.\n *\n * ```ts twoslash\n * import { Authorization, Secp256k1 } from 'ox'\n *\n * const authorization = Authorization.from({\n * address: '0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c',\n * chainId: 1,\n * nonce: 40n,\n * })\n *\n * const signature = Secp256k1.sign({\n * payload: Authorization.getSignPayload(authorization),\n * privateKey: '0x...',\n * })\n *\n * const authorization_signed = Authorization.from(authorization, { signature }) // [!code focus]\n * ```\n *\n * @param authorization - An [EIP-7702](https://eips.ethereum.org/EIPS/eip-7702) Authorization tuple in object format.\n * @param options - Authorization options.\n * @returns The {@link ox#Authorization.Authorization}.\n */\nexport function from(authorization, options = {}) {\n if (typeof authorization.chainId === 'string')\n return fromRpc(authorization);\n return { ...authorization, ...options.signature };\n}\n/**\n * Converts an {@link ox#Authorization.Rpc} to an {@link ox#Authorization.Authorization}.\n *\n * @example\n * ```ts twoslash\n * import { Authorization } from 'ox'\n *\n * const authorization = Authorization.fromRpc({\n * address: '0x0000000000000000000000000000000000000000',\n * chainId: '0x1',\n * nonce: '0x1',\n * r: '0x635dc2033e60185bb36709c29c75d64ea51dfbd91c32ef4be198e4ceb169fb4d',\n * s: '0x50c2667ac4c771072746acfdcf1f1483336dcca8bd2df47cd83175dbe60f0540',\n * yParity: '0x0',\n * })\n * ```\n *\n * @param authorization - The RPC-formatted Authorization.\n * @returns A signed {@link ox#Authorization.Authorization}.\n */\nexport function fromRpc(authorization) {\n const { address, chainId, nonce } = authorization;\n const signature = Signature.extract(authorization);\n return {\n address,\n chainId: Number(chainId),\n nonce: BigInt(nonce),\n ...signature,\n };\n}\n/**\n * Converts an {@link ox#Authorization.ListRpc} to an {@link ox#Authorization.List}.\n *\n * @example\n * ```ts twoslash\n * import { Authorization } from 'ox'\n *\n * const authorizationList = Authorization.fromRpcList([{\n * address: '0x0000000000000000000000000000000000000000',\n * chainId: '0x1',\n * nonce: '0x1',\n * r: '0x635dc2033e60185bb36709c29c75d64ea51dfbd91c32ef4be198e4ceb169fb4d',\n * s: '0x50c2667ac4c771072746acfdcf1f1483336dcca8bd2df47cd83175dbe60f0540',\n * yParity: '0x0',\n * }])\n * ```\n *\n * @param authorizationList - The RPC-formatted Authorization list.\n * @returns A signed {@link ox#Authorization.List}.\n */\nexport function fromRpcList(authorizationList) {\n return authorizationList.map(fromRpc);\n}\n/**\n * Converts an {@link ox#Authorization.Tuple} to an {@link ox#Authorization.Authorization}.\n *\n * @example\n * ```ts twoslash\n * import { Authorization } from 'ox'\n *\n * const authorization = Authorization.fromTuple([\n * '0x1',\n * '0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c',\n * '0x3'\n * ])\n * // @log: {\n * // @log: address: '0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c',\n * // @log: chainId: 1,\n * // @log: nonce: 3n\n * // @log: }\n * ```\n *\n * @example\n * It is also possible to append a Signature tuple to the end of an Authorization tuple.\n *\n * ```ts twoslash\n * import { Authorization } from 'ox'\n *\n * const authorization = Authorization.fromTuple([\n * '0x1',\n * '0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c',\n * '0x3',\n * '0x1',\n * '0x68a020a209d3d56c46f38cc50a33f704f4a9a10a59377f8dd762ac66910e9b90',\n * '0x7e865ad05c4035ab5792787d4a0297a43617ae897930a6fe4d822b8faea52064',\n * ])\n * // @log: {\n * // @log: address: '0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c',\n * // @log: chainId: 1,\n * // @log: nonce: 3n\n * // @log: r: BigInt('0x68a020a209d3d56c46f38cc50a33f704f4a9a10a59377f8dd762ac66910e9b90'),\n * // @log: s: BigInt('0x7e865ad05c4035ab5792787d4a0297a43617ae897930a6fe4d822b8faea52064'),\n * // @log: yParity: 0,\n * // @log: }\n * ```\n *\n * @param tuple - The [EIP-7702](https://eips.ethereum.org/EIPS/eip-7702) Authorization tuple.\n * @returns The {@link ox#Authorization.Authorization}.\n */\nexport function fromTuple(tuple) {\n const [chainId, address, nonce, yParity, r, s] = tuple;\n let args = {\n address,\n chainId: chainId === '0x' ? 0 : Number(chainId),\n nonce: nonce === '0x' ? 0n : BigInt(nonce),\n };\n if (yParity && r && s)\n args = { ...args, ...Signature.fromTuple([yParity, r, s]) };\n return from(args);\n}\n/**\n * Converts an {@link ox#Authorization.TupleList} to an {@link ox#Authorization.List}.\n *\n * @example\n * ```ts twoslash\n * import { Authorization } from 'ox'\n *\n * const authorizationList = Authorization.fromTupleList([\n * ['0x1', '0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c', '0x3'],\n * ['0x3', '0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c', '0x14'],\n * ])\n * // @log: [\n * // @log: {\n * // @log: address: '0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c',\n * // @log: chainId: 1,\n * // @log: nonce: 3n,\n * // @log: },\n * // @log: {\n * // @log: address: '0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c',\n * // @log: chainId: 3,\n * // @log: nonce: 20n,\n * // @log: },\n * // @log: ]\n * ```\n *\n * @example\n * It is also possible to append a Signature tuple to the end of an Authorization tuple.\n *\n * ```ts twoslash\n * import { Authorization } from 'ox'\n *\n * const authorizationList = Authorization.fromTupleList([\n * ['0x1', '0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c', '0x3', '0x1', '0x68a020a209d3d56c46f38cc50a33f704f4a9a10a59377f8dd762ac66910e9b90', '0x7e865ad05c4035ab5792787d4a0297a43617ae897930a6fe4d822b8faea52064'],\n * ['0x3', '0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c', '0x14', '0x1', '0x68a020a209d3d56c46f38cc50a33f704f4a9a10a59377f8dd762ac66910e9b90', '0x7e865ad05c4035ab5792787d4a0297a43617ae897930a6fe4d822b8faea52064'],\n * ])\n * // @log: [\n * // @log: {\n * // @log: address: '0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c',\n * // @log: chainId: 1,\n * // @log: nonce: 3n,\n * // @log: r: BigInt('0x68a020a209d3d56c46f38cc50a33f704f4a9a10a59377f8dd762ac66910e9b90'),\n * // @log: s: BigInt('0x7e865ad05c4035ab5792787d4a0297a43617ae897930a6fe4d822b8faea52064'),\n * // @log: yParity: 0,\n * // @log: },\n * // @log: {\n * // @log: address: '0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c',\n * // @log: chainId: 3,\n * // @log: nonce: 20n,\n * // @log: r: BigInt('0x68a020a209d3d56c46f38cc50a33f704f4a9a10a59377f8dd762ac66910e9b90'),\n * // @log: s: BigInt('0x7e865ad05c4035ab5792787d4a0297a43617ae897930a6fe4d822b8faea52064'),\n * // @log: yParity: 0,\n * // @log: },\n * // @log: ]\n * ```\n *\n * @param tupleList - The [EIP-7702](https://eips.ethereum.org/EIPS/eip-7702) Authorization tuple list.\n * @returns An {@link ox#Authorization.List}.\n */\nexport function fromTupleList(tupleList) {\n const list = [];\n for (const tuple of tupleList)\n list.push(fromTuple(tuple));\n return list;\n}\n/**\n * Computes the sign payload for an {@link ox#Authorization.Authorization} in [EIP-7702 format](https://eips.ethereum.org/EIPS/eip-7702): `keccak256('0x05' || rlp([chain_id, address, nonce]))`.\n *\n * @example\n * The example below demonstrates computing the sign payload for an {@link ox#Authorization.Authorization}. This payload\n * can then be passed to signing functions like {@link ox#Secp256k1.(sign:function)}.\n *\n * ```ts twoslash\n * import { Authorization, Secp256k1 } from 'ox'\n *\n * const authorization = Authorization.from({\n * address: '0x1234567890abcdef1234567890abcdef12345678',\n * chainId: 1,\n * nonce: 69n,\n * })\n *\n * const payload = Authorization.getSignPayload(authorization) // [!code focus]\n *\n * const signature = Secp256k1.sign({\n * payload,\n * privateKey: '0x...',\n * })\n * ```\n *\n * @param authorization - The {@link ox#Authorization.Authorization}.\n * @returns The sign payload.\n */\nexport function getSignPayload(authorization) {\n return hash(authorization, { presign: true });\n}\n/**\n * Computes the hash for an {@link ox#Authorization.Authorization} in [EIP-7702 format](https://eips.ethereum.org/EIPS/eip-7702): `keccak256('0x05' || rlp([chain_id, address, nonce]))`.\n *\n * @example\n * ```ts twoslash\n * import { Authorization } from 'ox'\n *\n * const authorization = Authorization.from({\n * address: '0x1234567890abcdef1234567890abcdef12345678',\n * chainId: 1,\n * nonce: 69n,\n * })\n *\n * const hash = Authorization.hash(authorization) // [!code focus]\n * ```\n *\n * @param authorization - The {@link ox#Authorization.Authorization}.\n * @returns The hash.\n */\nexport function hash(authorization, options = {}) {\n const { presign } = options;\n return Hash.keccak256(Hex.concat('0x05', Rlp.fromHex(toTuple(presign\n ? {\n address: authorization.address,\n chainId: authorization.chainId,\n nonce: authorization.nonce,\n }\n : authorization))));\n}\n/**\n * Converts an {@link ox#Authorization.Authorization} to an {@link ox#Authorization.Rpc}.\n *\n * @example\n * ```ts twoslash\n * import { Authorization } from 'ox'\n *\n * const authorization = Authorization.toRpc({\n * address: '0x0000000000000000000000000000000000000000',\n * chainId: 1,\n * nonce: 1n,\n * r: 44944627813007772897391531230081695102703289123332187696115181104739239197517n,\n * s: 36528503505192438307355164441104001310566505351980369085208178712678799181120n,\n * yParity: 0,\n * })\n * ```\n *\n * @param authorization - An Authorization.\n * @returns An RPC-formatted Authorization.\n */\nexport function toRpc(authorization) {\n const { address, chainId, nonce, ...signature } = authorization;\n return {\n address,\n chainId: Hex.fromNumber(chainId),\n nonce: Hex.fromNumber(nonce),\n ...Signature.toRpc(signature),\n };\n}\n/**\n * Converts an {@link ox#Authorization.List} to an {@link ox#Authorization.ListRpc}.\n *\n * @example\n * ```ts twoslash\n * import { Authorization } from 'ox'\n *\n * const authorization = Authorization.toRpcList([{\n * address: '0x0000000000000000000000000000000000000000',\n * chainId: 1,\n * nonce: 1n,\n * r: 44944627813007772897391531230081695102703289123332187696115181104739239197517n,\n * s: 36528503505192438307355164441104001310566505351980369085208178712678799181120n,\n * yParity: 0,\n * }])\n * ```\n *\n * @param authorizationList - An Authorization List.\n * @returns An RPC-formatted Authorization List.\n */\nexport function toRpcList(authorizationList) {\n return authorizationList.map(toRpc);\n}\n/**\n * Converts an {@link ox#Authorization.Authorization} to an {@link ox#Authorization.Tuple}.\n *\n * @example\n * ```ts twoslash\n * import { Authorization } from 'ox'\n *\n * const authorization = Authorization.from({\n * address: '0x1234567890abcdef1234567890abcdef12345678',\n * chainId: 1,\n * nonce: 69n,\n * })\n *\n * const tuple = Authorization.toTuple(authorization) // [!code focus]\n * // @log: [\n * // @log: address: '0x1234567890abcdef1234567890abcdef12345678',\n * // @log: chainId: 1,\n * // @log: nonce: 69n,\n * // @log: ]\n * ```\n *\n * @param authorization - The {@link ox#Authorization.Authorization}.\n * @returns An [EIP-7702](https://eips.ethereum.org/EIPS/eip-7702) Authorization tuple.\n */\nexport function toTuple(authorization) {\n const { address, chainId, nonce } = authorization;\n const signature = Signature.extract(authorization);\n return [\n chainId ? Hex.fromNumber(chainId) : '0x',\n address,\n nonce ? Hex.fromNumber(nonce) : '0x',\n ...(signature ? Signature.toTuple(signature) : []),\n ];\n}\n/**\n * Converts an {@link ox#Authorization.List} to an {@link ox#Authorization.TupleList}.\n *\n * @example\n * ```ts twoslash\n * import { Authorization } from 'ox'\n *\n * const authorization_1 = Authorization.from({\n * address: '0x1234567890abcdef1234567890abcdef12345678',\n * chainId: 1,\n * nonce: 69n,\n * })\n * const authorization_2 = Authorization.from({\n * address: '0x1234567890abcdef1234567890abcdef12345678',\n * chainId: 3,\n * nonce: 20n,\n * })\n *\n * const tuple = Authorization.toTupleList([authorization_1, authorization_2]) // [!code focus]\n * // @log: [\n * // @log: [\n * // @log: address: '0x1234567890abcdef1234567890abcdef12345678',\n * // @log: chainId: 1,\n * // @log: nonce: 69n,\n * // @log: ],\n * // @log: [\n * // @log: address: '0x1234567890abcdef1234567890abcdef12345678',\n * // @log: chainId: 3,\n * // @log: nonce: 20n,\n * // @log: ],\n * // @log: ]\n * ```\n *\n * @param list - An {@link ox#Authorization.List}.\n * @returns An [EIP-7702](https://eips.ethereum.org/EIPS/eip-7702) Authorization tuple list.\n */\nexport function toTupleList(list) {\n if (!list || list.length === 0)\n return [];\n const tupleList = [];\n for (const authorization of list)\n tupleList.push(toTuple(authorization));\n return tupleList;\n}\n//# sourceMappingURL=Authorization.js.map","import * as Hex from '../Hex.js';\n/**\n * Converts a \"numberish\" value (`Hex.Hex | bigint | number`) to an RPC quantity\n * (`Hex.Hex`). Hex values are passed through unchanged; numbers and bigints are\n * encoded via {@link ox#Hex.(fromNumber:function)}.\n *\n * @internal\n */\nexport function fromNumberish(value, options) {\n if (typeof value === 'string')\n return value;\n return Hex.fromNumber(value, options);\n}\n//# sourceMappingURL=quantity.js.map","import * as Address from './Address.js';\nimport * as Bytes from './Bytes.js';\nimport * as Errors from './Errors.js';\nimport * as Hex from './Hex.js';\nimport * as Quantity from './internal/quantity.js';\n/** Frame execution modes. */\nexport const modes = { default: 0, sender: 2, verify: 1 };\n/** Approval and atomic batching flags. */\nexport const flags = {\n approveExecution: 2,\n approveExecutionAndPayment: 3,\n approvePayment: 1,\n atomicBatch: 4,\n none: 0,\n};\n/**\n * Asserts that a {@link ox#Frame.Frame} satisfies frame-local constraints.\n *\n * Sender-dependent approval, batch adjacency, expiry, and transaction-wide gas\n * constraints require the enclosing transaction.\n *\n * @example\n * ### Basic Usage\n *\n * Check a verification frame before including it in a transaction.\n *\n * ```ts twoslash\n * import { Frame } from 'ox'\n *\n * Frame.assert({\n * executionGas: 50_000n,\n * flags: 'approveExecutionAndPayment',\n * mode: 'verify'\n * })\n * ```\n *\n * @param frame - The frame to assert.\n */\nexport function assert(frame) {\n const { data = '0x', executionGas = 0n, flags: flagsValue = 0, mode: modeValue = 0, stateGas = 0n, value = 0n, } = frame;\n const mode = typeof modeValue === 'string' ? modes[modeValue] : modeValue;\n if (!Number.isInteger(mode) || mode < 0 || mode > 2)\n throw new InvalidError('mode must be a supported name or 0, 1, or 2.');\n const flags_ = typeof flagsValue === 'string' ? flags[flagsValue] : flagsValue;\n if (!Number.isInteger(flags_) || flags_ < 0 || flags_ > 7)\n throw new InvalidError('flags must be a supported name or an integer from 0 to 7.');\n if (flags_ & flags.atomicBatch) {\n if (mode === modes.verify)\n throw new InvalidError('VERIFY frames cannot belong to an atomic batch.');\n if (flags_ & flags.approveExecutionAndPayment)\n throw new InvalidError('Atomic batch frames cannot approve execution or payment.');\n }\n if (frame.to !== undefined)\n Address.assert(frame.to, { strict: false });\n for (const [field, limit] of [\n ['executionGas', executionGas],\n ['stateGas', stateGas],\n ])\n if (typeof limit !== 'bigint' || limit < 0n || limit >= 2n ** 64n)\n throw new InvalidError(`${field} must be an unsigned 64-bit integer.`);\n if (executionGas + stateGas >= 2n ** 64n)\n throw new InvalidError('Combined frame gas must be less than 2^64.');\n if (typeof value !== 'bigint' || value < 0n || value >= 2n ** 256n)\n throw new InvalidError('value must be an unsigned 256-bit integer.');\n if (mode !== modes.sender && value !== 0n)\n throw new InvalidError('Only SENDER frames can transfer value.');\n Hex.assert(data, { strict: true });\n if (data.length % 2 !== 0)\n throw new InvalidError('data must contain whole bytes.');\n}\n/**\n * Coerces a frame object into a {@link ox#Frame.Frame}.\n *\n * Validates the frame and returns a copy, preserving literal types and the supplied\n * numeric or named mode and flags. Omitted fields stay omitted;\n * {@link ox#Frame.(toTuple:function)} supplies their defaults when encoding.\n *\n * @example\n * ### Basic Usage\n *\n * Construct a verification frame that approves execution and payment.\n *\n * ```ts twoslash\n * import { Frame } from 'ox'\n *\n * const frame = Frame.from({\n * executionGas: 50_000n,\n * flags: 'approveExecutionAndPayment',\n * mode: 'verify'\n * })\n * ```\n *\n * @param frame - The frame object to convert.\n * @returns The validated frame.\n */\nexport function from(frame) {\n assert(frame);\n return { ...frame };\n}\n/**\n * Converts an RPC frame to a frame.\n *\n * @example\n * ### Basic Usage\n *\n * ```ts twoslash\n * import { Frame } from 'ox'\n *\n * const frame = Frame.fromRpc({\n * data: '0x',\n * executionGas: '0xc350',\n * flags: '0x3',\n * mode: '0x1',\n * stateGas: '0x0',\n * value: '0x0'\n * })\n * ```\n *\n * @param frame - The value to convert.\n * @returns The converted value.\n */\nexport function fromRpc(frame) {\n return from({\n data: frame.data,\n executionGas: Hex.toBigInt(frame.executionGas),\n flags: Hex.toNumber(frame.flags),\n mode: Hex.toNumber(frame.mode),\n stateGas: Hex.toBigInt(frame.stateGas),\n ...(frame.target == null ? {} : { to: frame.target }),\n value: Hex.toBigInt(frame.value),\n });\n}\n/**\n * Converts a frame to its JSON-RPC representation.\n *\n * @example\n * ### Basic Usage\n *\n * ```ts twoslash\n * import { Frame } from 'ox'\n *\n * const frame = Frame.from({ executionGas: 50_000n, mode: 'verify' })\n * const rpc = Frame.toRpc(frame)\n * ```\n *\n * @param frame - The value to convert.\n * @returns The converted value.\n */\nexport function toRpc(frame) {\n const { flags: flags_ = 0, mode = 0 } = frame;\n return {\n data: frame.data ?? '0x',\n executionGas: Quantity.fromNumberish(frame.executionGas ?? 0n),\n flags: Hex.fromNumber(typeof flags_ === 'string' ? flags[flags_] : flags_),\n mode: Hex.fromNumber(typeof mode === 'string' ? modes[mode] : mode),\n stateGas: Quantity.fromNumberish(frame.stateGas ?? 0n),\n ...(frame.to === undefined ? {} : { target: frame.to }),\n value: Quantity.fromNumberish(frame.value ?? 0n),\n };\n}\n/**\n * Converts a {@link ox#Frame.Tuple} to a {@link ox#Frame.Frame}.\n *\n * Returns numeric mode and flags. An empty target becomes an omitted `to`.\n * Integer fields must use minimal whole-byte encodings, with empty bytes for zero.\n *\n * @example\n * ### Basic Usage\n *\n * Decode a frame tuple with separate execution and state gas limits.\n *\n * ```ts twoslash\n * import { Frame } from 'ox'\n *\n * const frame = Frame.fromTuple([\n * '0x01',\n * '0x03',\n * '0x',\n * ['0xc350', '0x'],\n * '0x',\n * '0x'\n * ])\n * // @log: {\n * // @log: data: '0x',\n * // @log: executionGas: 50000n,\n * // @log: flags: 3,\n * // @log: mode: 1,\n * // @log: stateGas: 0n,\n * // @log: value: 0n\n * // @log: }\n * ```\n *\n * @param tuple - The frame tuple to convert.\n * @returns The decoded frame.\n */\nexport function fromTuple(tuple) {\n if (!Array.isArray(tuple) ||\n tuple.length !== 6 ||\n !Array.isArray(tuple[3]) ||\n tuple[3].length !== 2)\n throw new InvalidError('Expected [mode, flags, target, [execution, state], value, data].');\n const [mode, flags, target, [execution, state], value, data] = tuple;\n Hex.assert(target, { strict: true });\n Hex.assert(data, { strict: true });\n const quantities = [mode, flags, execution, state, value];\n for (const quantity of quantities) {\n Hex.assert(quantity, { strict: true });\n if (quantity.length % 2 !== 0 || quantity.startsWith('0x00'))\n throw new InvalidError('Integers must use minimal whole-byte encodings, with empty bytes for zero.');\n }\n const frame = {\n ...(target === '0x' ? {} : { to: target }),\n data,\n executionGas: execution === '0x' ? 0n : Hex.toBigInt(execution),\n flags: flags === '0x' ? 0 : Hex.toNumber(flags),\n mode: mode === '0x' ? 0 : Hex.toNumber(mode),\n stateGas: state === '0x' ? 0n : Hex.toBigInt(state),\n value: value === '0x' ? 0n : Hex.toBigInt(value),\n };\n assert(frame);\n return frame;\n}\n/**\n * Converts a {@link ox#Frame.Frame} to its RLP-ready {@link ox#Frame.Tuple}.\n *\n * Named mode and flags are encoded as integers. An omitted target and zero integer\n * fields are encoded as empty bytes. Omitted mode and flags default to zero;\n * omitted gas limits and value default to `0n`, and data defaults to `'0x'`.\n *\n * @example\n * ### Basic Usage\n *\n * Encode a verification frame in the field order required by EIP-8141.\n *\n * ```ts twoslash\n * import { Frame } from 'ox'\n *\n * const tuple = Frame.toTuple({\n * executionGas: 50_000n,\n * flags: 'approveExecutionAndPayment',\n * mode: 'verify'\n * })\n * // @log: ['0x01', '0x03', '0x', ['0xc350', '0x'], '0x', '0x']\n * ```\n *\n * @param frame - The frame to convert.\n * @returns The encoded frame tuple.\n */\nexport function toTuple(frame) {\n assert(frame);\n const mode = typeof frame.mode === 'string' ? modes[frame.mode] : (frame.mode ?? 0);\n const flags_ = typeof frame.flags === 'string' ? flags[frame.flags] : (frame.flags ?? 0);\n return [\n mode ? Hex.fromBytes(Bytes.fromNumber(mode)) : '0x',\n flags_ ? Hex.fromBytes(Bytes.fromNumber(flags_)) : '0x',\n frame.to ?? '0x',\n [\n frame.executionGas\n ? Hex.fromBytes(Bytes.fromNumber(frame.executionGas))\n : '0x',\n frame.stateGas ? Hex.fromBytes(Bytes.fromNumber(frame.stateGas)) : '0x',\n ],\n frame.value ? Hex.fromBytes(Bytes.fromNumber(frame.value)) : '0x',\n frame.data ?? '0x',\n ];\n}\n/**\n * Returns whether a {@link ox#Frame.Frame} satisfies frame-local constraints.\n *\n * Performs the same checks as {@link ox#Frame.(assert:function)}, returning `false`\n * instead of throwing when the frame is invalid.\n *\n * @example\n * ### Basic Usage\n *\n * Check whether a frame is structurally valid.\n *\n * ```ts twoslash\n * import { Frame } from 'ox'\n *\n * const valid = Frame.validate({\n * executionGas: 50_000n,\n * flags: 'approveExecutionAndPayment',\n * mode: 'verify'\n * })\n * // @log: true\n * ```\n *\n * @param frame - The frame to validate.\n * @returns Whether the frame satisfies frame-local constraints.\n */\nexport function validate(frame) {\n try {\n assert(frame);\n return true;\n }\n catch {\n return false;\n }\n}\n/** Thrown when an EIP-8141 frame is structurally invalid. */\nexport class InvalidError extends Errors.BaseError {\n constructor(details) {\n super('Invalid frame.', { details });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'Frame.InvalidError'\n });\n }\n}\n//# sourceMappingURL=Frame.js.map","/**\n * Curve constants, inlined so that modules needing nothing but an order do not\n * pull a curve implementation into the bundle.\n *\n * These are fixed by the curve specifications and are asserted against\n * `@noble/curves` in `src/core/_test/curves.test.ts`.\n *\n * @internal\n */\n/**\n * Order of the secp256r1 (P-256) curve.\n *\n * @see https://www.secg.org/sec2-v2.pdf\n * @internal\n */\nexport const p256N = 0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551n;\n/** Order of the secp256k1 curve. @internal */\nexport const secp256k1N = 0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n;\n//# sourceMappingURL=curves.js.map","import * as Address from './Address.js';\nimport * as Errors from './Errors.js';\nimport * as Hex from './Hex.js';\nimport { p256N, secp256k1N } from './internal/curves.js';\nimport * as PublicKey from './PublicKey.js';\nimport * as Signature from './Signature.js';\n/** Signature schemes supported by EIP-8141. */\nexport const schemes = { arbitrary: 0, p256: 2, secp256k1: 1 };\n/**\n * Asserts that a {@link ox#FrameSignature.FrameSignature} is structurally valid.\n *\n * Checks metadata, signature scalars, and public key shape without verifying\n * authorization.\n *\n * @example\n * ### Basic Usage\n *\n * Unsigned protocol entries are accepted by default.\n *\n * ```ts twoslash\n * import { FrameSignature } from 'ox'\n *\n * FrameSignature.assert({\n * payload: '0x',\n * scheme: 'secp256k1'\n * })\n * ```\n *\n * @example\n * ### Requiring a Signature\n *\n * Set `signed` to require a protocol signature.\n *\n * ```ts twoslash\n * import { FrameSignature, Hash, Secp256k1 } from 'ox'\n *\n * const payload = Hash.keccak256('0xdeadbeef')\n * const privateKey = Secp256k1.randomPrivateKey()\n * const signature = Secp256k1.sign({ payload, privateKey })\n *\n * const entry = FrameSignature.from({\n * payload,\n * scheme: 'secp256k1',\n * signature\n * })\n *\n * FrameSignature.assert(entry, { signed: true })\n * ```\n *\n * @param entry - The signature entry to assert.\n * @param options - Validation options.\n */\nexport function assert(entry, options = {}) {\n const scheme = typeof entry.scheme === 'string' ? schemes[entry.scheme] : entry.scheme;\n if (!Number.isInteger(scheme) || scheme < 0 || scheme > 2)\n throw new InvalidError('Unsupported signature scheme.');\n if (scheme === 0 && entry.signer !== undefined)\n throw new InvalidError('Arbitrary signatures cannot specify a signer.');\n if (entry.signer !== undefined)\n Address.assert(entry.signer, { strict: false });\n const payload = entry.payload ?? '0x';\n Hex.assert(payload, { strict: true });\n if (payload !== '0x' &&\n (payload.length !== 66 || Hex.toBigInt(payload) === 0n))\n throw new InvalidError('payload must be empty or a nonzero 32-byte digest.');\n switch (entry.scheme) {\n case 0:\n case 'arbitrary':\n Hex.assert(entry.signature, { strict: true });\n if (entry.signature.length % 2 !== 0)\n throw new InvalidError('signature must contain whole bytes.');\n return;\n }\n if (entry.scheme === 2 || entry.scheme === 'p256') {\n if (entry.publicKey !== undefined) {\n PublicKey.assert(entry.publicKey, { compressed: false });\n for (const coordinate of [entry.publicKey.x, entry.publicKey.y]) {\n if (typeof coordinate !== 'bigint' ||\n coordinate < 0n ||\n coordinate >= 2n ** 256n)\n throw new InvalidError('Public key coordinates must fit in 32 bytes.');\n }\n }\n if (entry.signature !== undefined &&\n entry.signature !== '0x' &&\n entry.publicKey === undefined)\n throw new InvalidError('P-256 signatures require a public key.');\n }\n if (entry.signature === undefined || entry.signature === '0x') {\n if (options.signed)\n throw new InvalidError('Signature is required.');\n return;\n }\n if (typeof entry.signature === 'string')\n Hex.assert(entry.signature, { strict: true });\n const signature = typeof entry.signature === 'string'\n ? Signature.fromHex(entry.signature)\n : entry.signature;\n if (typeof signature.r !== 'bigint' || typeof signature.s !== 'bigint')\n throw new InvalidError('Signature scalars must be bigint.');\n if ((scheme === 1 || signature.yParity !== undefined) &&\n signature.yParity !== 0 &&\n signature.yParity !== 1)\n throw new InvalidError('Signature parity must be 0 or 1.');\n Signature.assert(signature, { recovered: scheme === 1 });\n const r = signature.r;\n const s = signature.s;\n const order = scheme === 1 ? secp256k1N : p256N;\n if (r === 0n ||\n r >= order ||\n s === 0n ||\n s >= order ||\n (scheme === 1 && s > order / 2n))\n throw new InvalidError('Signature scalars must be in range; secp256k1 requires low-s.');\n}\n/**\n * Coerces a value into a {@link ox#FrameSignature.FrameSignature}.\n *\n * Accepts arbitrary signature bytes or a signature entry. Protocol signatures accept\n * structured objects or `Signature.toHex` bytes. P-256 entries still require a public key. Omitted\n * `scheme` and `payload` default to `'arbitrary'` and `'0x'`, respectively.\n * An empty payload selects the canonical transaction signing hash; an explicit\n * payload must be a nonzero 32-byte digest.\n *\n * @example\n * ### From Hex\n *\n * Wrap arbitrary witness bytes for contract-defined verification.\n *\n * ```ts twoslash\n * import { FrameSignature } from 'ox'\n *\n * const entry = FrameSignature.from('0xaabb')\n * // @log: { payload: '0x', scheme: 'arbitrary', signature: '0xaabb' }\n * ```\n *\n * @example\n * ### Secp256k1\n *\n * Wrap a signature over an explicit digest, retaining the same payload in the entry.\n *\n * ```ts twoslash\n * import { FrameSignature, Hash, Secp256k1 } from 'ox'\n *\n * const payload = Hash.keccak256('0xdeadbeef')\n * const privateKey = Secp256k1.randomPrivateKey()\n * const signature = Secp256k1.sign({ payload, privateKey })\n *\n * const entry = FrameSignature.from({\n * payload,\n * scheme: 'secp256k1',\n * signature\n * })\n * ```\n *\n * @example\n * ### P256\n *\n * Include the public key with a P-256 signature over an explicit digest.\n *\n * ```ts twoslash\n * import { FrameSignature, Hash, P256 } from 'ox'\n *\n * const { privateKey, publicKey } = P256.createKeyPair()\n * const payload = Hash.keccak256('0xdeadbeef')\n * const signature = P256.sign({ payload, privateKey })\n *\n * const entry = FrameSignature.from({\n * payload,\n * publicKey,\n * scheme: 'p256',\n * signature\n * })\n * ```\n *\n * @example\n * ### Unsigned Entries\n *\n * Omit the signature to prepare a protocol entry before signing the transaction.\n *\n * ```ts twoslash\n * import { FrameSignature } from 'ox'\n *\n * const entry = FrameSignature.from({ scheme: 'secp256k1' })\n * // @log: { payload: '0x', scheme: 'secp256k1' }\n * ```\n *\n * @param entry - Arbitrary signature bytes or a structured signature entry.\n * @returns The validated entry, preserving supplied signature and scheme types.\n */\nexport function from(entry) {\n const result = (typeof entry === 'string'\n ? { payload: '0x', scheme: 'arbitrary', signature: entry }\n : {\n ...entry,\n payload: entry.payload ?? '0x',\n scheme: entry.scheme ?? 'arbitrary',\n });\n assert(result);\n return result;\n}\n/**\n * Converts an RPC signature entry to a structured frame signature.\n *\n * @example\n * ### Basic Usage\n *\n * ```ts twoslash\n * import { FrameSignature } from 'ox'\n *\n * const entry = FrameSignature.fromRpc({\n * msg: '0x',\n * scheme: '0x0',\n * signature: '0xdeadbeef'\n * })\n * ```\n *\n * @param entry - The value to convert.\n * @returns The converted value.\n */\nexport function fromRpc(entry) {\n return fromTuple([\n entry.scheme === '0x0'\n ? '0x'\n : Hex.fromNumber(Hex.toNumber(entry.scheme), { size: 1 }),\n entry.signer ?? '0x',\n entry.msg ?? '0x',\n entry.signature ?? '0x',\n ]);\n}\n/**\n * Converts a structured frame signature to its RPC representation.\n *\n * @example\n * ### Basic Usage\n *\n * ```ts twoslash\n * import { FrameSignature } from 'ox'\n *\n * const entry = FrameSignature.from('0xdeadbeef')\n * const rpc = FrameSignature.toRpc(entry)\n * ```\n *\n * @param entry - The value to convert.\n * @returns The converted value.\n */\nexport function toRpc(entry) {\n const [scheme, signer, msg, signature] = toTuple(entry);\n return {\n msg,\n scheme: (scheme === '0x'\n ? '0x0'\n : Hex.fromNumber(Hex.toNumber(scheme))),\n ...(signature === '0x' && scheme !== '0x' ? {} : { signature }),\n ...(signer === '0x' ? {} : { signer }),\n };\n}\n/**\n * Converts a {@link ox#FrameSignature.Tuple} to a structured\n * {@link ox#FrameSignature.FrameSignature}.\n *\n * Returns a named scheme and unpacks protocol signatures. Empty protocol signatures\n * become unsigned entries. Rejects noncanonical encodings.\n *\n * @example\n * ### Basic Usage\n *\n * Decode an arbitrary signature tuple.\n *\n * ```ts twoslash\n * import { FrameSignature } from 'ox'\n *\n * const entry = FrameSignature.fromTuple([\n * '0x',\n * '0x',\n * '0x',\n * '0xaabb'\n * ])\n * // @log: { payload: '0x', scheme: 'arbitrary', signature: '0xaabb' }\n * ```\n *\n * @param tuple - The signature tuple to convert.\n * @returns The decoded signature entry.\n */\nexport function fromTuple(tuple) {\n if (!Array.isArray(tuple) || tuple.length !== 4)\n throw new InvalidError('Expected [scheme, signer, payload, signature].');\n const [scheme, signer, payload, signature] = tuple;\n Hex.assert(signer, { strict: true });\n Hex.assert(signature, { strict: true });\n if (signature.length % 2 !== 0)\n throw new InvalidError('signature must contain whole bytes.');\n if (scheme !== '0x' && scheme !== '0x01' && scheme !== '0x02')\n throw new InvalidError('Expected a canonical scheme encoding: empty bytes, 0x01, or 0x02.');\n const metadata = { ...(signer === '0x' ? {} : { signer }), payload };\n if (scheme === '0x') {\n if (signer !== '0x')\n throw new InvalidError('Arbitrary signatures cannot specify a signer.');\n return from({ payload, scheme: 'arbitrary', signature });\n }\n if (signature === '0x')\n return scheme === '0x01'\n ? from({ ...metadata, scheme: 'secp256k1' })\n : from({ ...metadata, scheme: 'p256' });\n if (Hex.size(signature) !== (scheme === '0x01' ? 65 : 128))\n throw new InvalidError('Invalid protocol signature length.');\n if (scheme === '0x01') {\n if (Hex.toNumber(Hex.slice(signature, 0, 1)) > 1)\n throw new InvalidError('Recovery parity must be 0 or 1.');\n return from({\n ...metadata,\n scheme: 'secp256k1',\n signature: {\n r: Hex.toBigInt(Hex.slice(signature, 1, 33)),\n s: Hex.toBigInt(Hex.slice(signature, 33, 65)),\n yParity: Hex.toNumber(Hex.slice(signature, 0, 1)),\n },\n });\n }\n const s = Hex.toBigInt(Hex.slice(signature, 32, 64));\n if (s > p256N / 2n)\n throw new InvalidError('P-256 wire signatures require low-s.');\n return from({\n ...metadata,\n publicKey: {\n prefix: 4,\n x: Hex.toBigInt(Hex.slice(signature, 64, 96)),\n y: Hex.toBigInt(Hex.slice(signature, 96, 128)),\n },\n scheme: 'p256',\n signature: { r: Hex.toBigInt(Hex.slice(signature, 0, 32)), s },\n });\n}\n/**\n * Converts a {@link ox#FrameSignature.FrameSignature} to its RLP-ready\n * {@link ox#FrameSignature.Tuple}.\n *\n * Encodes numeric scheme identifiers and packs protocol signatures without mutating\n * the entry. Omitted protocol signatures become empty bytes.\n *\n * @example\n * ### Basic Usage\n *\n * Encode arbitrary witness bytes with the default scheme and payload.\n *\n * ```ts twoslash\n * import { FrameSignature } from 'ox'\n *\n * const entry = FrameSignature.from('0xaabb')\n * const tuple = FrameSignature.toTuple(entry)\n * // @log: ['0x', '0x', '0x', '0xaabb']\n * ```\n *\n * @param entry - The signature entry to convert.\n * @returns The encoded signature tuple.\n */\nexport function toTuple(entry) {\n assert(entry);\n const scheme = typeof entry.scheme === 'string' ? schemes[entry.scheme] : entry.scheme;\n const signature = (() => {\n switch (entry.scheme) {\n case 0:\n case 'arbitrary':\n return entry.signature;\n case 1:\n case 'secp256k1': {\n if (entry.signature === undefined || entry.signature === '0x')\n return '0x';\n const signature = typeof entry.signature === 'string'\n ? Signature.fromHex(entry.signature)\n : entry.signature;\n return Hex.concat(Hex.fromNumber(signature.yParity, { size: 1 }), Hex.fromNumber(signature.r, { size: 32 }), Hex.fromNumber(signature.s, { size: 32 }));\n }\n case 2:\n case 'p256': {\n if (entry.signature === undefined || entry.signature === '0x')\n return '0x';\n const publicKey = entry.publicKey;\n const signature = typeof entry.signature === 'string'\n ? Signature.fromHex(entry.signature)\n : entry.signature;\n const s = signature.s;\n return Hex.concat(Hex.fromNumber(signature.r, { size: 32 }), Hex.fromNumber(s > p256N / 2n ? p256N - s : s, { size: 32 }), Hex.fromNumber(publicKey.x, { size: 32 }), Hex.fromNumber(publicKey.y, { size: 32 }));\n }\n }\n })();\n return [\n scheme ? Hex.fromNumber(scheme, { size: 1 }) : '0x',\n entry.signer ?? '0x',\n entry.payload ?? '0x',\n signature,\n ];\n}\n/**\n * Returns whether a {@link ox#FrameSignature.FrameSignature} is structurally valid.\n *\n * Performs the same checks as {@link ox#FrameSignature.(assert:function)}, returning\n * `false` instead of throwing. Does not verify that the signature authorizes a payload.\n *\n * @example\n * ### Basic Usage\n *\n * Require a signature when checking a protocol entry.\n *\n * ```ts twoslash\n * import { FrameSignature } from 'ox'\n *\n * const entry = FrameSignature.from({ scheme: 'secp256k1' })\n * const valid = FrameSignature.validate(entry, {\n * signed: true\n * })\n * // @log: false\n * ```\n *\n * @param entry - The signature entry to validate.\n * @param options - Validation options.\n * @returns Whether the entry is structurally valid.\n */\nexport function validate(entry, options = {}) {\n try {\n assert(entry, options);\n return true;\n }\n catch {\n return false;\n }\n}\n/** Thrown when frame signature metadata or encoding is invalid. */\nexport class InvalidError extends Errors.BaseError {\n constructor(details) {\n super('Invalid frame signature.', { details });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'FrameSignature.InvalidError'\n });\n }\n}\n//# sourceMappingURL=FrameSignature.js.map","import * as Errors from '../Errors.js';\nimport * as Hex from '../Hex.js';\nimport * as Quantity from './quantity.js';\n/**\n * Asserts keyed nonce constraints.\n * @internal\n */\nexport function assert(keys, nonce) {\n if (!Array.isArray(keys) || keys.length < 1 || keys.length > 16)\n throw new InvalidError('Expected between 1 and 16 nonce keys.');\n for (const [index, key] of keys.entries()) {\n if (typeof key !== 'bigint' || key < 0n || key >= 2n ** 256n)\n throw new InvalidError('Nonce keys must be unsigned 256-bit integers.');\n if (index > 0 && key <= keys[index - 1])\n throw new InvalidError('Nonce keys must be strictly increasing.');\n }\n if (keys.length > 1 && keys[0] === 0n)\n throw new InvalidError('The zero nonce key cannot be combined with other keys.');\n if (nonce !== undefined &&\n (typeof nonce !== 'bigint' || nonce < 0n || nonce >= 2n ** 64n - 1n))\n throw new InvalidError('Nonce must be less than 2^64 - 1 and nonnegative.');\n}\n/**\n * Decodes and validates RPC nonce keys and their shared sequence.\n * @internal\n */\nexport function fromRpc(keys, nonce) {\n if (!Array.isArray(keys))\n throw new InvalidError('Expected a nonce key list.');\n const integer = (value) => {\n if (typeof value !== 'string' ||\n !/^0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)$/.test(value))\n throw new InvalidError('Expected a canonical RPC nonce quantity.');\n return Hex.toBigInt(value);\n };\n const decoded = keys.map(integer);\n assert(decoded, nonce === undefined ? undefined : integer(nonce));\n return decoded;\n}\n/**\n * Encodes and validates nonce keys and their shared sequence.\n * @internal\n */\nexport function toRpc(keys, nonce) {\n if (!Array.isArray(keys))\n throw new InvalidError('Expected a nonce key list.');\n const encoded = keys.map((key) => Quantity.fromNumberish(key));\n fromRpc(encoded, nonce === undefined ? undefined : Quantity.fromNumberish(nonce));\n return encoded;\n}\nexport class InvalidError extends Errors.BaseError {\n constructor() {\n super(...arguments);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'FrameNonce.InvalidError'\n });\n }\n}\n//# sourceMappingURL=frameNonce.js.map","import * as Authorization from './Authorization.js';\nimport * as Frame from './Frame.js';\nimport * as FrameSignature from './FrameSignature.js';\nimport * as Hex from './Hex.js';\nimport * as FrameNonce from './internal/frameNonce.js';\nimport * as Signature from './Signature.js';\n/** Type to RPC Type mapping. */\nexport const toRpcType = {\n legacy: '0x0',\n eip2930: '0x1',\n eip1559: '0x2',\n eip4844: '0x3',\n eip7702: '0x4',\n eip8141: '0x6',\n};\n/** RPC Type to Type mapping. */\nexport const fromRpcType = {\n '0x0': 'legacy',\n '0x1': 'eip2930',\n '0x2': 'eip1559',\n '0x3': 'eip4844',\n '0x4': 'eip7702',\n '0x6': 'eip8141',\n};\n/**\n * Converts an {@link ox#Transaction.Rpc} to an {@link ox#Transaction.Transaction}.\n *\n * @example\n * ```ts twoslash\n * import { Transaction } from 'ox'\n *\n * const transaction = Transaction.fromRpc({\n * hash: '0x353fdfc38a2f26115daadee9f5b8392ce62b84f410957967e2ed56b35338cdd0',\n * nonce: '0x357',\n * blockHash:\n * '0xc350d807505fb835650f0013632c5515592987ba169bbc6626d9fc54d91f0f0b',\n * blockNumber: '0x12f296f',\n * transactionIndex: '0x2',\n * from: '0x814e5e0e31016b9a7f138c76b7e7b2bb5c1ab6a6',\n * to: '0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad',\n * value: '0x9b6e64a8ec60000',\n * gas: '0x43f5d',\n * maxFeePerGas: '0x2ca6ae494',\n * maxPriorityFeePerGas: '0x41cc3c0',\n * input:\n * '0x3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006643504700000000000000000000000000000000000000000000000000000000000000040b080604000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002800000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000009b6e64a8ec600000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000009b6e64a8ec60000000000000000000000000000000000000000000000000000019124bb5ae978c000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000c56c7a0eaa804f854b536a5f3d5f49d2ec4b12b80000000000000000000000000000000000000000000000000000000000000060000000000000000000000000c56c7a0eaa804f854b536a5f3d5f49d2ec4b12b8000000000000000000000000000000fee13a103a10d593b9ae06b3e05f2e7e1c00000000000000000000000000000000000000000000000000000000000000190000000000000000000000000000000000000000000000000000000000000060000000000000000000000000c56c7a0eaa804f854b536a5f3d5f49d2ec4b12b800000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000190240001b9872b',\n * r: '0x635dc2033e60185bb36709c29c75d64ea51dfbd91c32ef4be198e4ceb169fb4d',\n * s: '0x50c2667ac4c771072746acfdcf1f1483336dcca8bd2df47cd83175dbe60f0540',\n * yParity: '0x0',\n * chainId: '0x1',\n * accessList: [],\n * type: '0x2',\n * })\n * ```\n *\n * @param transaction - The RPC transaction to convert.\n * @returns An instantiated {@link ox#Transaction.Transaction}.\n */\nexport function fromRpc(transaction, _options = {}) {\n if (!transaction)\n return null;\n const signature = transaction.type === '0x6' ? undefined : Signature.extract(transaction);\n const transaction_ = {\n ...transaction,\n ...signature,\n };\n transaction_.blockNumber = transaction.blockNumber\n ? BigInt(transaction.blockNumber)\n : null;\n if ('blockTimestamp' in transaction)\n transaction_.blockTimestamp = transaction.blockTimestamp\n ? BigInt(transaction.blockTimestamp)\n : transaction.blockTimestamp === null\n ? null\n : undefined;\n transaction_.data = transaction.input;\n transaction_.gas = BigInt(transaction.gas ?? 0n);\n transaction_.nonce = BigInt(transaction.nonce ?? 0n);\n transaction_.transactionIndex = transaction.transactionIndex\n ? Number(transaction.transactionIndex)\n : null;\n transaction_.value = BigInt(transaction.value ?? 0n);\n if (transaction.type === '0x6' && transaction.nonceKeys !== undefined) {\n if (transaction.nonce === undefined)\n throw new FrameNonce.InvalidError('A keyed transaction result requires nonce.');\n transaction_.nonceKeys = FrameNonce.fromRpc(transaction.nonceKeys, transaction.nonce);\n }\n if (transaction.frames)\n transaction_.frames = transaction.frames.map(Frame.fromRpc);\n if (transaction.signatures)\n transaction_.signatures = transaction.signatures.map(FrameSignature.fromRpc);\n if (transaction.authorizationList)\n transaction_.authorizationList = Authorization.fromRpcList(transaction.authorizationList);\n if (transaction.chainId)\n transaction_.chainId =\n transaction.type === '0x6' &&\n BigInt(transaction.chainId) > BigInt(Number.MAX_SAFE_INTEGER)\n ? BigInt(transaction.chainId)\n : Number(transaction.chainId);\n if (transaction.gasPrice)\n transaction_.gasPrice = BigInt(transaction.gasPrice);\n if (transaction.maxFeePerBlobGas)\n transaction_.maxFeePerBlobGas = BigInt(transaction.maxFeePerBlobGas);\n if (transaction.maxFeePerGas)\n transaction_.maxFeePerGas = BigInt(transaction.maxFeePerGas);\n if (transaction.maxPriorityFeePerGas)\n transaction_.maxPriorityFeePerGas = BigInt(transaction.maxPriorityFeePerGas);\n if (transaction.type)\n transaction_.type =\n fromRpcType[transaction.type] ?? transaction.type;\n if (signature)\n transaction_.v = Signature.yParityToV(signature.yParity);\n return transaction_;\n}\n/**\n * Converts an {@link ox#Transaction.Transaction} to an {@link ox#Transaction.Rpc}.\n *\n * @example\n * ```ts twoslash\n * import { Transaction } from 'ox'\n *\n * const transaction = Transaction.toRpc({\n * accessList: [],\n * blockHash:\n * '0xc350d807505fb835650f0013632c5515592987ba169bbc6626d9fc54d91f0f0b',\n * blockNumber: 19868015n,\n * chainId: 1,\n * from: '0x814e5e0e31016b9a7f138c76b7e7b2bb5c1ab6a6',\n * gas: 278365n,\n * hash: '0x353fdfc38a2f26115daadee9f5b8392ce62b84f410957967e2ed56b35338cdd0',\n * input:\n * '0x3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006643504700000000000000000000000000000000000000000000000000000000000000040b080604000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002800000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000009b6e64a8ec600000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000009b6e64a8ec60000000000000000000000000000000000000000000000000000019124bb5ae978c000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000c56c7a0eaa804f854b536a5f3d5f49d2ec4b12b80000000000000000000000000000000000000000000000000000000000000060000000000000000000000000c56c7a0eaa804f854b536a5f3d5f49d2ec4b12b8000000000000000000000000000000fee13a103a10d593b9ae06b3e05f2e7e1c00000000000000000000000000000000000000000000000000000000000000190000000000000000000000000000000000000000000000000000000000000060000000000000000000000000c56c7a0eaa804f854b536a5f3d5f49d2ec4b12b800000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000190240001b9872b',\n * maxFeePerGas: 11985937556n,\n * maxPriorityFeePerGas: 68993984n,\n * nonce: 855n,\n * r: 44944627813007772897391531230081695102703289123332187696115181104739239197517n,\n * s: 36528503505192438307355164441104001310566505351980369085208178712678799181120n,\n * to: '0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad',\n * transactionIndex: 2,\n * type: 'eip1559',\n * v: 27,\n * value: 700000000000000000n,\n * yParity: 0,\n * })\n * ```\n *\n * @param transaction - The transaction to convert.\n * @returns An RPC-formatted transaction.\n */\nexport function toRpc(transaction, _options) {\n const rpc = {};\n rpc.blockHash = transaction.blockHash;\n rpc.blockNumber =\n typeof transaction.blockNumber === 'bigint'\n ? Hex.fromNumber(transaction.blockNumber)\n : null;\n if (typeof transaction.blockTimestamp === 'bigint')\n rpc.blockTimestamp = Hex.fromNumber(transaction.blockTimestamp);\n else if (transaction.blockTimestamp === null)\n rpc.blockTimestamp = null;\n rpc.from = transaction.from;\n rpc.gas = Hex.fromNumber(transaction.gas ?? 0n);\n rpc.hash = transaction.hash;\n rpc.input = transaction.input;\n rpc.nonce = Hex.fromNumber(transaction.nonce ?? 0n);\n rpc.to = transaction.to;\n rpc.transactionIndex = transaction.transactionIndex\n ? Hex.fromNumber(transaction.transactionIndex)\n : null;\n rpc.type = toRpcType[transaction.type] ?? transaction.type;\n rpc.value = Hex.fromNumber(transaction.value ?? 0n);\n if (transaction.type === 'eip8141' && transaction.nonceKeys !== undefined)\n rpc.nonceKeys = FrameNonce.toRpc(transaction.nonceKeys, transaction.nonce);\n if (transaction.frames)\n rpc.frames = transaction.frames.map(Frame.toRpc);\n if (transaction.signatures)\n rpc.signatures = transaction.signatures.map(FrameSignature.toRpc);\n if (transaction.accessList)\n rpc.accessList = transaction.accessList;\n if (transaction.authorizationList)\n rpc.authorizationList = Authorization.toRpcList(transaction.authorizationList);\n if (transaction.blobVersionedHashes)\n rpc.blobVersionedHashes = transaction.blobVersionedHashes;\n if (transaction.chainId)\n rpc.chainId = Hex.fromNumber(transaction.chainId);\n if (typeof transaction.gasPrice === 'bigint')\n rpc.gasPrice = Hex.fromNumber(transaction.gasPrice);\n if (typeof transaction.maxFeePerBlobGas === 'bigint')\n rpc.maxFeePerBlobGas = Hex.fromNumber(transaction.maxFeePerBlobGas);\n if (typeof transaction.maxFeePerGas === 'bigint')\n rpc.maxFeePerGas = Hex.fromNumber(transaction.maxFeePerGas);\n if (typeof transaction.maxPriorityFeePerGas === 'bigint')\n rpc.maxPriorityFeePerGas = Hex.fromNumber(transaction.maxPriorityFeePerGas);\n if (typeof transaction.r === 'bigint')\n rpc.r = Hex.fromNumber(transaction.r, { size: 32 });\n if (typeof transaction.s === 'bigint')\n rpc.s = Hex.fromNumber(transaction.s, { size: 32 });\n if (typeof transaction.v === 'number')\n rpc.v = Hex.fromNumber(transaction.v, { size: 1 });\n if (typeof transaction.yParity === 'number')\n rpc.yParity = transaction.yParity === 0 ? '0x0' : '0x1';\n return rpc;\n}\n//# sourceMappingURL=Transaction.js.map","import * as Frame from './Frame.js';\n/**\n * Converts an RPC frame request, preserving omitted gas limits for node estimation.\n *\n * @example\n * ```ts twoslash\n * import { FrameRequest } from 'ox'\n *\n * const frame = FrameRequest.fromRpc({ mode: '0x2', stateGas: '0x0' })\n * ```\n *\n * @param frame - The RPC frame request.\n * @returns The decoded request with omitted gas limits preserved.\n */\nexport function fromRpc(frame) {\n const { executionGas, stateGas, ...rest } = Frame.fromRpc({\n ...frame,\n data: frame.data ?? '0x',\n executionGas: frame.executionGas ?? '0x0',\n flags: frame.flags ?? '0x0',\n stateGas: frame.stateGas ?? '0x0',\n value: frame.value ?? '0x0',\n });\n return {\n ...rest,\n ...(frame.executionGas === undefined ? {} : { executionGas }),\n ...(frame.stateGas === undefined ? {} : { stateGas }),\n };\n}\n/**\n * Converts a frame request to RPC fields without filling omitted gas limits.\n *\n * Explicit zero limits remain zero. Omitted mode, flags, value, and data use frame defaults.\n *\n * @example\n * ```ts twoslash\n * import { FrameRequest } from 'ox'\n *\n * const frame = FrameRequest.toRpc({ mode: 'sender', stateGas: 0n })\n * ```\n *\n * @param frame - The frame request. Gas and value accept hex, bigint, or number values.\n * @returns The RPC request with omitted gas limits preserved.\n */\nexport function toRpc(frame) {\n const { executionGas, stateGas, ...rest } = Frame.toRpc(frame);\n return {\n ...rest,\n ...(frame.executionGas === undefined ? {} : { executionGas }),\n ...(frame.stateGas === undefined ? {} : { stateGas }),\n };\n}\n//# sourceMappingURL=FrameRequest.js.map","import * as Authorization from './Authorization.js';\nimport * as FrameRequest from './FrameRequest.js';\nimport * as FrameSignature from './FrameSignature.js';\nimport * as Hex from './Hex.js';\nimport * as FrameNonce from './internal/frameNonce.js';\nimport * as Transaction from './Transaction.js';\n/**\n * Converts a {@link ox#TransactionRequest.Rpc} to a {@link ox#TransactionRequest.TransactionRequest}.\n *\n * @example\n * ```ts twoslash\n * import { TransactionRequest } from 'ox'\n *\n * const request = TransactionRequest.fromRpc({\n * to: '0x0000000000000000000000000000000000000000',\n * value: '0x2386f26fc10000',\n * })\n * ```\n *\n * @param request - The RPC request to convert.\n * @returns A transaction request.\n */\nexport function fromRpc(request) {\n const request_ = { ...request };\n if (typeof request.authorizationList !== 'undefined')\n request_.authorizationList = Authorization.fromRpcList(request.authorizationList);\n if (typeof request.chainId !== 'undefined')\n request_.chainId = Hex.toNumber(request.chainId);\n if (request.frames)\n request_.frames = request.frames.map(FrameRequest.fromRpc);\n if (request.signatures)\n request_.signatures = request.signatures.map(FrameSignature.fromRpc);\n if (typeof request.gas !== 'undefined')\n request_.gas = Hex.toBigInt(request.gas);\n if (typeof request.gasPrice !== 'undefined')\n request_.gasPrice = Hex.toBigInt(request.gasPrice);\n if (typeof request.maxFeePerBlobGas !== 'undefined')\n request_.maxFeePerBlobGas = Hex.toBigInt(request.maxFeePerBlobGas);\n if (typeof request.maxFeePerGas !== 'undefined')\n request_.maxFeePerGas = Hex.toBigInt(request.maxFeePerGas);\n if (typeof request.maxPriorityFeePerGas !== 'undefined')\n request_.maxPriorityFeePerGas = Hex.toBigInt(request.maxPriorityFeePerGas);\n if (typeof request.nonce !== 'undefined')\n request_.nonce = Hex.toBigInt(request.nonce);\n if (request.nonceKeys !== undefined)\n request_.nonceKeys = FrameNonce.fromRpc(request.nonceKeys, request.nonce);\n if (typeof request.type !== 'undefined')\n request_.type =\n Transaction.fromRpcType[request.type] || request.type;\n if (typeof request.value !== 'undefined')\n request_.value = Hex.toBigInt(request.value);\n return request_;\n}\n/**\n * Converts a {@link ox#TransactionRequest.TransactionRequest} to a {@link ox#TransactionRequest.Rpc}.\n *\n * @example\n * ```ts twoslash\n * import { TransactionRequest, Value } from 'ox'\n *\n * const request = TransactionRequest.toRpc({\n * to: '0x0000000000000000000000000000000000000000',\n * value: Value.fromEther('0.01'),\n * })\n * ```\n *\n * @example\n * ### Using with a Provider\n *\n * You can use {@link ox#Provider.(from:function)} to instantiate an EIP-1193 Provider and\n * send a transaction to the Wallet using the `eth_sendTransaction` method.\n *\n * ```ts twoslash\n * import 'ox/window'\n * import { Provider, TransactionRequest, Value } from 'ox'\n *\n * const provider = Provider.from(window.ethereum!)\n *\n * const request = TransactionRequest.toRpc({\n * to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',\n * value: Value.fromEther('0.01'),\n * })\n *\n * const hash = await provider.request({ // [!code focus]\n * method: 'eth_sendTransaction', // [!code focus]\n * params: [request], // [!code focus]\n * }) // [!code focus]\n * ```\n *\n * @param request - The request to convert.\n * @returns An RPC request.\n */\nexport function toRpc(request) {\n const request_rpc = {};\n if (typeof request.accessList !== 'undefined')\n request_rpc.accessList = request.accessList;\n if (typeof request.authorizationList !== 'undefined')\n request_rpc.authorizationList = Authorization.toRpcList(request.authorizationList);\n if (typeof request.blobVersionedHashes !== 'undefined')\n request_rpc.blobVersionedHashes = request.blobVersionedHashes;\n if (typeof request.blobs !== 'undefined')\n request_rpc.blobs = request.blobs;\n if (typeof request.chainId !== 'undefined')\n request_rpc.chainId = Hex.fromNumber(request.chainId);\n if (typeof request.data !== 'undefined') {\n request_rpc.data = request.data;\n request_rpc.input = request.data;\n }\n else if (typeof request.input !== 'undefined') {\n request_rpc.data = request.input;\n request_rpc.input = request.input;\n }\n if (typeof request.from !== 'undefined')\n request_rpc.from = request.from;\n if (request.frames)\n request_rpc.frames = request.frames.map(FrameRequest.toRpc);\n if (request.signatures)\n request_rpc.signatures = request.signatures.map(FrameSignature.toRpc);\n if (typeof request.gas !== 'undefined')\n request_rpc.gas = Hex.fromNumber(request.gas);\n if (typeof request.gasPrice !== 'undefined')\n request_rpc.gasPrice = Hex.fromNumber(request.gasPrice);\n if (typeof request.maxFeePerBlobGas !== 'undefined')\n request_rpc.maxFeePerBlobGas = Hex.fromNumber(request.maxFeePerBlobGas);\n if (typeof request.maxFeePerGas !== 'undefined')\n request_rpc.maxFeePerGas = Hex.fromNumber(request.maxFeePerGas);\n if (typeof request.maxPriorityFeePerGas !== 'undefined')\n request_rpc.maxPriorityFeePerGas = Hex.fromNumber(request.maxPriorityFeePerGas);\n if (typeof request.maxPriorityFeePerGas !== 'undefined')\n request_rpc.maxPriorityFeePerGas = Hex.fromNumber(request.maxPriorityFeePerGas);\n if (typeof request.nonce !== 'undefined')\n request_rpc.nonce = Hex.fromNumber(request.nonce);\n if (request.nonceKeys !== undefined)\n request_rpc.nonceKeys = FrameNonce.toRpc(request.nonceKeys, request.nonce);\n if (typeof request.to !== 'undefined')\n request_rpc.to = request.to;\n if (typeof request.type !== 'undefined')\n request_rpc.type =\n Transaction.toRpcType[request.type] || request.type;\n if (typeof request.value !== 'undefined')\n request_rpc.value = Hex.fromNumber(request.value);\n return request_rpc;\n}\n//# sourceMappingURL=TransactionRequest.js.map","/**\n * Prints `Log` entries as condensed lines on the Vite dev server. The production build logs objects.\n * @module\n */\n\n/** Each level's label and ANSI color in the dev server's lines. */\nconst levels = {\n error: { color: 31, label: 'ERROR' },\n info: { color: 32, label: ' INFO' },\n warn: { color: 33, label: ' WARN' },\n} as const\n\n/** Flattens nested objects into `[key, value]` pairs with dotted keys, such as `request.id`. */\nfunction flatten(\n value: object,\n options: flatten.Options = { prefix: '' },\n): [string, unknown][] {\n return Object.entries(value).flatMap((pair): [string, unknown][] => {\n const key = `${options.prefix}${pair[0]}`\n const item: unknown = pair[1]\n if (typeof item === 'object' && item !== null && !Array.isArray(item))\n return flatten(item, { prefix: `${key}.` })\n return [[key, item]]\n })\n}\n\ndeclare namespace flatten {\n type Options = {\n /** The dotted path so far, such as `error.cause.`. */\n prefix: string\n }\n}\n\n/** Formats a log entry as one line in the style of Rust's `tracing`, then indented stack frames. */\nexport function format(\n value: Record<string, unknown>,\n options: format.Options,\n) {\n const { message, ...fields } = value\n const level = levels[options.level]\n const pairs = flatten(fields)\n\n const head = [\n `\\x1b[2m${new Date().toISOString().slice(11, 23)}\\x1b[0m`,\n `\\x1b[1;${level.color}m${level.label}\\x1b[0m`,\n `\\x1b[1m${String(message)}\\x1b[0m`,\n ...pairs\n .filter((pair) => !pair[0].endsWith('stack'))\n .map(\n (pair) => `\\x1b[3m${pair[0]}\\x1b[0m\\x1b[2m=\\x1b[0m${quote(pair[1])}`,\n ),\n ].join(' ')\n const frames = pairs\n .filter((pair) => pair[0].endsWith('stack'))\n .flatMap((pair) => String(pair[1]).split('\\n'))\n // Paths start at `src/` or `node_modules/`, without the checkout or pnpm's store directory.\n .map((frame) =>\n frame\n .replace(\n /\\/node_modules\\/\\.pnpm\\/[^/]+\\/node_modules\\//,\n '/node_modules/',\n )\n .replace(/\\((?:\\/[^()]*?)?\\/((?:node_modules|src)\\/[^()]*)\\)/, '($1)'),\n )\n .map((frame) => `\\x1b[2m ${frame}\\x1b[0m`)\n return [head, ...frames].join('\\n')\n}\n\nexport declare namespace format {\n type Options = {\n /** The entry's level. */\n level: keyof typeof levels\n }\n}\n\n/** Quotes a value with whitespace, a quote, or `=`, so each pair stays one token. */\nfunction quote(value: unknown) {\n const text = String(value)\n return /[\\s\"=]/.test(text) || text === '' ? JSON.stringify(text) : text\n}\n","/**\n * Structured logs for the Worker, one object per entry, which Workers Logs indexes by field. An\n * entry holds a fixed message, chosen fields, the request's ID, method, and route, and an error's\n * safe properties. Headers, bodies, query strings, and path parameters never reach a log.\n * @module\n */\nimport type { Context } from 'hono'\nimport * as LogLine from './LogLine.js'\n\n/** What a log entry records. */\nexport type Options = {\n /** The error behind the entry. */\n error?: unknown\n /** Extra fields to index, such as a client ID. Never secrets, tokens, or personal data. */\n fields?: Record<string, boolean | number | string | undefined> | undefined\n /** A fixed sentence, which occurrences group by. It never holds values. */\n message: string\n}\n\n/** Returns whether the module runs on the Vite dev server. */\nexport function dev() {\n return (import.meta as Meta).env?.DEV === true\n}\n\n/** Logs an unexpected failure. Outside a request, such as in a cron, it takes no context. */\nexport function error(c: Context, options: Options): void\nexport function error(options: Options): void\nexport function error(...parameters: [Context, Options] | [Options]) {\n console.error(print(entry(...parameters), { level: 'error' }))\n}\n\n/** Logs a routine event worth keeping, such as a configuration change. */\nexport function info(c: Context, options: Options): void\nexport function info(options: Options): void\nexport function info(...parameters: [Context, Options] | [Options]) {\n console.info(print(entry(...parameters), { level: 'info' }))\n}\n\n/**\n * Returns the pattern of the first matched route without a wildcard, such as\n * `/v1/device/requests/:code`, which hides path parameters. Without one, returns `/*`, since the\n * path can carry a code.\n */\nexport function route(c: Context) {\n // The `hono/route` helper reads a symbol of its own Hono copy, and the Vite dev server loads Void's\n // Hono as another copy. The request's own getter works with either.\n return (\n c.req.matchedRoutes.find((entry) => !entry.path.includes('*'))?.path ?? '/*'\n )\n}\n\n/** Logs a recoverable problem that did not fail the request. */\nexport function warn(c: Context, options: Options): void\nexport function warn(options: Options): void\nexport function warn(...parameters: [Context, Options] | [Options]) {\n console.warn(print(entry(...parameters), { level: 'warn' }))\n}\n\n/** The part of `import.meta` that Vite fills. */\ntype Meta = ImportMeta & {\n /** Absent outside Vite. */\n env?:\n | {\n /** Whether the module runs on the Vite dev server. */\n DEV?: boolean | undefined\n }\n | undefined\n}\n\n/** Returns an object without its `undefined` properties. */\nfunction compact(value: Record<string, unknown>) {\n return Object.fromEntries(\n Object.entries(value).filter((pair) => pair[1] !== undefined),\n )\n}\n\n/** The parts of an error that are safe to log, with its causes up to three deep. */\nfunction describe(\n error: unknown,\n options: describe.Options = { depth: 0 },\n): Record<string, unknown> {\n // A thrown value that is not an `Error` can be anything, including a secret.\n if (!(error instanceof Error)) return { name: 'NonError', type: typeof error }\n\n // Viem and ox put request arguments, which can hold ID tokens and proofs, in `message`, and a\n // summary in `shortMessage`. Drizzle puts a failed query's parameters, which can hold an email\n // address or a code, in `message`, and the query alone in `query`. The stack repeats the message,\n // so only its frames are kept.\n const message = (() => {\n const shortMessage = read(error, { key: 'shortMessage' })\n if (typeof shortMessage === 'string') return shortMessage\n const query = read(error, { key: 'query' })\n if (\n typeof query === 'string' &&\n Array.isArray(Reflect.get(error, 'params'))\n )\n return `Failed query: ${query}`\n return error.message\n })()\n const status = read(error, { key: 'status' })\n return compact({\n cause:\n error.cause !== undefined && options.depth < 3\n ? describe(error.cause, { depth: options.depth + 1 })\n : undefined,\n code: read(error, { key: 'code' }),\n // Viem's `RpcRequestError` holds the node's JSON-RPC error message in `details`, such as the\n // reason that a relay refuses a transaction. Its `message` adds the URL, which can hold a\n // provider's key, and the request body, so only `details` is kept.\n details:\n error.name === 'RpcRequestError'\n ? read(error, { key: 'details' })\n : undefined,\n message,\n name: error.name,\n stack: error.stack\n ?.split('\\n')\n .filter((line) => /^\\s+at /.test(line))\n .map((line) => line.trim())\n .join('\\n'),\n status: typeof status === 'number' ? status : undefined,\n })\n}\n\ndeclare namespace describe {\n type Options = {\n /** How many causes deep this error is. */\n depth: number\n }\n}\n\n/** Builds the logged object, leaving out absent fields. */\nfunction entry(...parameters: [Context, Options] | [Options]) {\n const [c, options] =\n parameters.length === 2 ? parameters : [undefined, parameters[0]]\n const { error, fields, message } = options\n return compact({\n // Fields come first, so they never replace the entry's own keys.\n ...fields,\n error: error === undefined ? undefined : describe(error),\n message,\n request: c\n ? compact({\n id: c.get('requestId'),\n method: c.req.method,\n path: route(c),\n })\n : undefined,\n })\n}\n\n/** Returns the entry as an object, or as one condensed line on the Vite dev server. */\nfunction print(\n value: Record<string, unknown>,\n options: LogLine.format.Options,\n) {\n return dev() ? LogLine.format(value, options) : value\n}\n\n/** Reads an error property when it is a string or number. */\nfunction read(error: Error, options: { key: string }) {\n const value: unknown = Reflect.get(error, options.key)\n return typeof value === 'string' || typeof value === 'number'\n ? value\n : undefined\n}\n","import * as Address from '../core/Address.js';\nimport * as Errors from '../core/Errors.js';\nimport * as Hash from '../core/Hash.js';\nimport * as Hex from '../core/Hex.js';\nimport * as AccountConfig from './AccountConfig.js';\nimport * as KeyAuthorization_ from './KeyAuthorization.js';\nimport * as SignatureEnvelope from './SignatureEnvelope.js';\nimport * as TxEnvelopeTempo from './TxEnvelopeTempo.js';\n/**\n * Derives the deterministic hash for an account operation.\n *\n * @example\n * ```ts twoslash\n * // @noErrors\n * import { AccountOperation } from 'ox/tempo'\n *\n * const hash = AccountOperation.getHash({\n * account,\n * config,\n * transaction,\n * type: 'transaction',\n * })\n * ```\n *\n * @param options - Operation payload and account identity.\n * @returns The operation hash signed by each owner.\n */\nexport function getHash(options) {\n const { account, config } = options;\n const payload = options.type === 'transaction'\n ? TxEnvelopeTempo.getSignPayload(TxEnvelopeTempo.deserialize(options.transaction))\n : KeyAuthorization_.getSignPayload(KeyAuthorization_.deserialize(options.keyAuthorization));\n return AccountConfig.getSignPayload({\n account,\n config,\n payload,\n });\n}\n/**\n * Validates, deduplicates, and selects owner approvals for an operation.\n *\n * The function retains one canonical approval per owner. It selects the\n * smallest deterministic quorum by owner weight, then orders the selected\n * approvals by owner address for serialization. The caller supplies the\n * account and config; the chain validates their factory-derived identity.\n *\n * @example\n * ```ts twoslash\n * // @noErrors\n * import { AccountOperation } from 'ox/tempo'\n *\n * const selection = await AccountOperation.selectApprovals({\n * account,\n * approvals,\n * config,\n * hash,\n * })\n * ```\n *\n * @param options - Approval selection parameters.\n * @returns The retained approvals and deterministic quorum selection.\n */\nexport async function selectApprovals(options) {\n const { account, approvals, hash } = options;\n if (!Address.validate(account) || Hex.toBigInt(account) === 0n)\n throw new InvalidApprovalError({ reason: 'account is invalid' });\n if (!Hash.validate(hash))\n throw new InvalidApprovalError({ reason: 'hash is invalid' });\n const config = AccountConfig.from(options.config);\n return selectApprovals_internal({\n account,\n approvals,\n config,\n hash,\n });\n}\n/**\n * Serializes a key authorization with selected owner approvals.\n *\n * @example\n * ```ts twoslash\n * // @noErrors\n * import { AccountOperation } from 'ox/tempo'\n *\n * const authorization = AccountOperation.serializeKeyAuthorization(\n * keyAuthorization,\n * {\n * account,\n * approvals: selection.selectedApprovals,\n * config,\n * },\n * )\n * ```\n *\n * @param keyAuthorization - Canonical serialized unsigned key authorization.\n * @param options - Configurable account, config, and selected approvals.\n * @returns The signed serialized key authorization.\n */\nexport function serializeKeyAuthorization(keyAuthorization, options) {\n const authorization = KeyAuthorization_.deserialize(keyAuthorization);\n if (authorization.signature)\n throw new InvalidOperationError({\n reason: 'keyAuthorization must not contain a signature',\n });\n if (KeyAuthorization_.serialize(authorization).toLowerCase() !==\n keyAuthorization.toLowerCase())\n throw new InvalidOperationError({\n reason: 'keyAuthorization is not canonically serialized',\n });\n const config = AccountConfig.from(options.config);\n const signatures = SignatureEnvelope.sortApprovals({\n account: options.account,\n config,\n payload: KeyAuthorization_.getSignPayload(authorization),\n signatures: options.approvals.map((approval) => assertApproval(options.account, approval, config)),\n });\n return KeyAuthorization_.serialize(KeyAuthorization_.from(authorization, {\n signature: SignatureEnvelope.from({\n account: options.account,\n config,\n signatures,\n }),\n }));\n}\n/**\n * Serializes an account transaction operation with selected owner approvals.\n *\n * @example\n * ```ts twoslash\n * // @noErrors\n * import { AccountOperation } from 'ox/tempo'\n *\n * const transaction = AccountOperation.serializeTransaction(operation, {\n * approvals: selection.selectedApprovals,\n * })\n * ```\n *\n * @param operation - Account transaction operation.\n * @param options - Transaction serialization options.\n * @returns The signed serialized Tempo transaction.\n */\nexport function serializeTransaction(operation, options) {\n const value = from(operation);\n const envelope = TxEnvelopeTempo.deserialize(value.transaction);\n const approvals = options.approvals.map((approval) => assertApproval(value.account, approval, value.config));\n assertRetainedApprovals(value, approvals);\n const signatures = SignatureEnvelope.sortApprovals({\n account: value.account,\n config: value.config,\n payload: TxEnvelopeTempo.getSignPayload(envelope),\n signatures: approvals,\n });\n const signature = SignatureEnvelope.from({\n account: value.account,\n config: value.config,\n signatures,\n });\n return TxEnvelopeTempo.serialize(envelope, value.transaction.startsWith(TxEnvelopeTempo.feePayerMagic)\n ? {\n format: 'feePayer',\n sender: envelope.from,\n signature,\n }\n : { signature });\n}\n/**\n * Validates and normalizes an account operation.\n *\n * @example\n * ```ts twoslash\n * // @noErrors\n * import { AccountOperation } from 'ox/tempo'\n *\n * const operation = AccountOperation.from(value)\n * ```\n *\n * @param operation - Account operation.\n * @returns The validated operation.\n */\nexport function from(operation) {\n try {\n const config = AccountConfig.from(operation.config);\n if (typeof config.threshold !== 'number' ||\n config.owners.some((owner) => typeof owner.weight !== 'number'))\n throw new InvalidOperationError({\n reason: 'config threshold and owner weights must be numbers',\n });\n const value = { ...operation, config };\n assertBase(value, config);\n if (value.type === 'transaction')\n assertTransaction(value);\n else if (value.type === 'keyAuthorization')\n assertKeyAuthorization(value, config);\n else\n throw new InvalidOperationError({ reason: 'unknown operation type' });\n return value;\n }\n catch (cause) {\n if (cause instanceof InvalidOperationError)\n throw cause;\n throw new InvalidOperationError({ cause });\n }\n}\n/**\n * Converts a JSON-RPC account operation to its domain representation.\n *\n * @example\n * ```ts twoslash\n * // @noErrors\n * import { AccountOperation } from 'ox/tempo'\n *\n * const operation = AccountOperation.fromRpc(value)\n * ```\n *\n * @param operation - JSON-RPC account operation.\n * @returns The validated operation.\n */\nexport function fromRpc(operation) {\n try {\n const version = operation.config?.version;\n if (typeof version !== 'string' || !Hex.validate(version))\n throw new InvalidOperationError({\n reason: 'config.version must be a hexadecimal quantity',\n });\n const version_ = Hex.toBigInt(version);\n if (Hex.fromNumber(version_) !== version)\n throw new InvalidOperationError({\n reason: 'config.version must use canonical quantity encoding',\n });\n return from({\n ...operation,\n config: AccountConfig.fromRpc(operation.config),\n });\n }\n catch (cause) {\n if (cause instanceof InvalidOperationError)\n throw cause;\n throw new InvalidOperationError({ cause });\n }\n}\n/**\n * Converts an account operation to its JSON-RPC representation.\n *\n * @example\n * ```ts twoslash\n * // @noErrors\n * import { AccountOperation } from 'ox/tempo'\n *\n * const operationRpc = AccountOperation.toRpc(operation)\n * ```\n *\n * @param operation - Account operation.\n * @returns The JSON-RPC operation.\n */\nexport function toRpc(operation) {\n const value = from(operation);\n return {\n ...value,\n config: AccountConfig.toRpc(value.config),\n };\n}\n/**\n * Validates and selects approvals recursively.\n *\n * @internal\n */\nasync function selectApprovals_internal(options) {\n const owners = new Map(options.config.owners.map((owner) => [\n owner.owner.toLowerCase(),\n { address: owner.owner, weight: Number(owner.weight) },\n ]));\n const groups = new Map();\n for (const serialized of options.approvals) {\n const signature = SignatureEnvelope.from(serialized);\n if (signature.type === 'keychain' || signature.type === 'configurable')\n throw new InvalidApprovalError({\n reason: 'only primitive signatures can approve an account operation',\n });\n const address = SignatureEnvelope.extractAddress({\n payload: options.hash,\n signature,\n });\n const owner = owners.get(address.toLowerCase());\n if (!owner)\n throw new InvalidApprovalError({\n reason: `signature is from non-owner ${address}`,\n });\n const key = address.toLowerCase();\n const group = groups.get(key);\n if (group)\n group.signatures.push(signature);\n else\n groups.set(key, {\n address: owner.address,\n signatures: [signature],\n weight: owner.weight,\n });\n }\n const valid = [];\n const retained = [];\n for (const group of groups.values()) {\n const signatures = group.signatures.map((signature) => {\n if (!SignatureEnvelope.verify(signature, {\n address: group.address,\n payload: options.hash,\n }))\n throw new InvalidApprovalError({\n reason: `signature from owner ${group.address} is invalid`,\n });\n return SignatureEnvelope.serialize(signature);\n });\n const signature = signatures.sort(compareHex)[0];\n valid.push({\n address: group.address,\n signature,\n weight: group.weight,\n });\n retained.push({ address: group.address, signature });\n }\n const ranked = valid.sort((a, b) => b.weight - a.weight || compareApprovalAddress(a, b));\n const selected = [];\n let weight = 0;\n for (const approval of ranked.slice(0, AccountConfig.maxSignatures)) {\n if (weight >= Number(options.config.threshold))\n break;\n selected.push(approval);\n weight += approval.weight;\n }\n selected.sort(compareApprovalAddress);\n return {\n approvals: retained\n .sort(compareApprovalAddress)\n .map((approval) => approval.signature),\n selectedApprovals: selected.map((approval) => approval.signature),\n signatureCount: selected.length,\n threshold: Number(options.config.threshold),\n weight,\n };\n}\n/**\n * Orders approval records by owner address.\n *\n * @internal\n */\nfunction compareApprovalAddress(a, b) {\n const addressA = Hex.toBigInt(a.address);\n const addressB = Hex.toBigInt(b.address);\n return addressA < addressB ? -1 : addressA > addressB ? 1 : 0;\n}\n/**\n * Orders hexadecimal data bytewise.\n *\n * @internal\n */\nfunction compareHex(a, b) {\n const hexA = a.toLowerCase();\n const hexB = b.toLowerCase();\n return hexA < hexB ? -1 : hexA > hexB ? 1 : 0;\n}\n/**\n * Validates fields shared by every operation.\n *\n * @internal\n */\nfunction assertBase(operation, config) {\n if (!Address.validate(operation.account))\n throw new InvalidOperationError({ reason: 'account is invalid' });\n if (Hex.toBigInt(operation.account) === 0n)\n throw new InvalidOperationError({ reason: 'account cannot be zero' });\n if (!Hash.validate(operation.hash))\n throw new InvalidOperationError({ reason: 'hash is invalid' });\n assertInteger(operation.createdAt, 'createdAt');\n assertInteger(operation.updatedAt, 'updatedAt');\n if (operation.updatedAt < operation.createdAt)\n throw new InvalidOperationError({\n reason: 'updatedAt cannot precede createdAt',\n });\n assertInteger(operation.signatureCount, 'signatureCount');\n assertInteger(operation.threshold, 'threshold');\n assertInteger(operation.weight, 'weight');\n if (operation.threshold !== Number(config.threshold))\n throw new InvalidOperationError({\n reason: 'threshold must equal config.threshold',\n });\n if (operation.weight > 0xff)\n throw new InvalidOperationError({ reason: 'weight exceeds u8 max' });\n if (operation.signatureCount > AccountConfig.maxSignatures)\n throw new InvalidOperationError({ reason: 'too many selected signatures' });\n if (!Array.isArray(operation.approvals))\n throw new InvalidOperationError({ reason: 'approvals must be an array' });\n if (operation.approvals.length > config.owners.length)\n throw new InvalidOperationError({ reason: 'too many retained approvals' });\n if (operation.signatureCount > operation.approvals.length)\n throw new InvalidOperationError({\n reason: 'signatureCount exceeds retained approvals',\n });\n if ((operation.signatureCount === 0) !== (operation.weight === 0))\n throw new InvalidOperationError({\n reason: 'signatureCount and weight must both be zero or nonzero',\n });\n const owners = new Map(config.owners.map((owner) => [\n owner.owner.toLowerCase(),\n Number(owner.weight),\n ]));\n const approvalWeights = [];\n const seen = new Set();\n for (const approval of operation.approvals) {\n if (typeof approval !== 'string' ||\n !Hex.validate(approval, { strict: true }))\n throw new InvalidOperationError({ reason: 'approval is invalid' });\n const signature = assertApproval(operation.account, approval, config);\n const address = SignatureEnvelope.extractAddress({\n payload: operation.hash,\n signature,\n });\n const key = address.toLowerCase();\n const weight = owners.get(key);\n if (weight === undefined)\n throw new InvalidOperationError({\n reason: 'approval is from a non-owner',\n });\n if (seen.has(key))\n throw new InvalidOperationError({\n reason: operation.type === 'keyAuthorization'\n ? 'key authorization contains duplicate owner approvals'\n : 'duplicate owner approval',\n });\n seen.add(key);\n approvalWeights.push(weight);\n }\n if (!isWeightReachable(approvalWeights, operation.signatureCount, operation.weight))\n throw new InvalidOperationError({\n reason: 'weight is not reachable by signatureCount retained owner approvals',\n });\n}\n/**\n * Validates a transaction operation and its state-specific fields.\n *\n * @internal\n */\nfunction assertTransaction(operation) {\n if ('keyAuthorization' in operation &&\n operation.keyAuthorization !== undefined)\n throw new InvalidOperationError({\n reason: 'transaction operations cannot contain keyAuthorization',\n });\n const expiresAt = operation.expiresAt;\n const submissionId = operation.submissionId;\n const transactionHash = operation.transactionHash;\n if (operation.status === 'pending') {\n if (expiresAt !== undefined ||\n submissionId !== undefined ||\n transactionHash !== undefined)\n throw new InvalidOperationError({\n reason: 'pending transactions cannot contain submission fields',\n });\n }\n else if (operation.status === 'submitting') {\n assertInteger(expiresAt, 'expiresAt');\n if (!Hash.validate(submissionId ?? ''))\n throw new InvalidOperationError({ reason: 'submissionId is invalid' });\n if (submissionId.toLowerCase() === operation.hash.toLowerCase())\n throw new InvalidOperationError({\n reason: 'submissionId must differ from the operation hash',\n });\n if (transactionHash !== undefined)\n throw new InvalidOperationError({\n reason: 'submitting transactions cannot contain transactionHash',\n });\n }\n else if (operation.status === 'success') {\n if (!Hash.validate(transactionHash ?? ''))\n throw new InvalidOperationError({ reason: 'transactionHash is invalid' });\n if (expiresAt !== undefined || submissionId !== undefined)\n throw new InvalidOperationError({\n reason: 'successful transactions cannot contain submission fields',\n });\n }\n else\n throw new InvalidOperationError({ reason: 'invalid transaction status' });\n if (operation.status !== 'pending' &&\n (operation.weight < operation.threshold || operation.signatureCount === 0))\n throw new InvalidOperationError({\n reason: 'submitted transactions must have quorum',\n });\n if (typeof operation.transaction !== 'string')\n throw new InvalidOperationError({ reason: 'transaction is invalid' });\n const transaction = TxEnvelopeTempo.deserialize(operation.transaction);\n if (transaction.signature)\n throw new InvalidOperationError({\n reason: 'transaction must not contain an outer sender signature',\n });\n if (transaction.from &&\n transaction.from.toLowerCase() !== operation.account.toLowerCase())\n throw new InvalidOperationError({\n reason: 'transaction sender does not match the operation account',\n });\n assertOperationHash(operation, TxEnvelopeTempo.getSignPayload(transaction));\n const feePayer = operation.transaction.startsWith(TxEnvelopeTempo.feePayerMagic);\n const serialized = TxEnvelopeTempo.serialize(transaction, feePayer\n ? transaction.from\n ? { format: 'feePayer', sender: transaction.from }\n : { format: 'feePayer' }\n : {});\n if (serialized.toLowerCase() !== operation.transaction.toLowerCase())\n throw new InvalidOperationError({\n reason: 'transaction is not canonically serialized',\n });\n}\n/**\n * Validates a key authorization operation and its serialized payload.\n *\n * @internal\n */\nfunction assertKeyAuthorization(operation, config) {\n const transactionFields = operation;\n if (transactionFields.expiresAt !== undefined ||\n transactionFields.submissionId !== undefined ||\n transactionFields.transaction !== undefined ||\n transactionFields.transactionHash !== undefined)\n throw new InvalidOperationError({\n reason: 'key authorization operations cannot contain transaction fields',\n });\n if (operation.status !== 'pending' && operation.status !== 'success')\n throw new InvalidOperationError({\n reason: 'invalid key authorization status',\n });\n if (operation.status === 'success' &&\n (operation.weight < operation.threshold || operation.signatureCount === 0))\n throw new InvalidOperationError({\n reason: 'successful key authorizations must have quorum',\n });\n if (operation.status === 'pending' && operation.weight >= operation.threshold)\n throw new InvalidOperationError({\n reason: 'pending key authorizations cannot have quorum',\n });\n if (typeof operation.keyAuthorization !== 'string')\n throw new InvalidOperationError({ reason: 'keyAuthorization is invalid' });\n const authorization = KeyAuthorization_.deserialize(operation.keyAuthorization);\n if (!authorization.account ||\n authorization.account.toLowerCase() !== operation.account.toLowerCase())\n throw new InvalidOperationError({\n reason: 'key authorization account does not match the operation account',\n });\n const signature = authorization.signature;\n if (operation.status === 'pending' && signature)\n throw new InvalidOperationError({\n reason: 'pending key authorizations must be unsigned',\n });\n if (operation.status === 'success') {\n if (signature?.type !== 'configurable')\n throw new InvalidOperationError({\n reason: 'successful key authorizations require a configurable account signature',\n });\n if (signature.account.toLowerCase() !== operation.account.toLowerCase())\n throw new InvalidOperationError({\n reason: 'key authorization signature account does not match',\n });\n if (signature.signatures.length !== operation.signatureCount)\n throw new InvalidOperationError({\n reason: 'key authorization signatureCount does not match its signature',\n });\n assertSelectedApprovals(operation, signature.signatures, authorization);\n if (!sameConfig(signature.config, config))\n throw new InvalidOperationError({\n reason: 'key authorization config does not match',\n });\n }\n assertOperationHash(operation, KeyAuthorization_.getSignPayload(authorization));\n if (KeyAuthorization_.serialize(authorization).toLowerCase() !==\n operation.keyAuthorization.toLowerCase())\n throw new InvalidOperationError({\n reason: 'keyAuthorization is not canonically serialized',\n });\n}\n/**\n * Validates a retained signature in the root owner's approval context.\n *\n * @internal\n */\nfunction assertApproval(account, serialized, config) {\n const approval = SignatureEnvelope.deserialize(serialized);\n if (approval.type === 'keychain' || approval.type === 'configurable')\n throw new InvalidOperationError({\n reason: 'only primitive owner approvals are allowed',\n });\n SignatureEnvelope.assert({\n account,\n config,\n signatures: [approval],\n type: 'configurable',\n });\n if (SignatureEnvelope.serialize(approval).toLowerCase() !==\n serialized.toLowerCase())\n throw new InvalidOperationError({ reason: 'approval is not canonical' });\n return approval;\n}\n/**\n * Checks that selected transaction approvals are retained by the operation.\n *\n * @internal\n */\nfunction assertRetainedApprovals(operation, selected) {\n const retained = operation.approvals.map((approval) => SignatureEnvelope.deserialize(approval));\n for (const approval of selected) {\n const index = retained.findIndex((candidate) => SignatureEnvelope.serialize(candidate).toLowerCase() ===\n SignatureEnvelope.serialize(approval).toLowerCase());\n if (index === -1)\n throw new InvalidOperationError({\n reason: 'transaction signature is not a retained approval',\n });\n retained.splice(index, 1);\n }\n}\n/**\n * Checks that a successful key authorization uses retained approvals in canonical order.\n *\n * @internal\n */\nfunction assertSelectedApprovals(operation, selected, authorization) {\n const retained = operation.approvals.map((approval) => SignatureEnvelope.deserialize(approval));\n for (const approval of selected) {\n const index = retained.findIndex((candidate) => SignatureEnvelope.serialize(candidate).toLowerCase() ===\n SignatureEnvelope.serialize(approval).toLowerCase());\n if (index === -1)\n throw new InvalidOperationError({\n reason: 'key authorization signature is not a retained approval',\n });\n retained.splice(index, 1);\n }\n const digest = AccountConfig.getSignPayload({\n account: operation.account,\n config: operation.config,\n payload: KeyAuthorization_.getSignPayload(authorization),\n });\n const addresses = selected.map((signature) => SignatureEnvelope.extractAddress({ payload: digest, signature }));\n for (let index = 1; index < addresses.length; index++) {\n const previous = Hex.toBigInt(addresses[index - 1]);\n const current = Hex.toBigInt(addresses[index]);\n if (previous === current)\n throw new InvalidOperationError({\n reason: 'key authorization contains duplicate owner approvals',\n });\n if (previous > current)\n throw new InvalidOperationError({\n reason: 'key authorization approvals are not canonically ordered',\n });\n }\n}\n/**\n * Checks whether exactly `signatureCount` retained owners can produce `weight`.\n *\n * @internal\n */\nfunction isWeightReachable(weights, signatureCount, weight) {\n const reachable = Array.from({ length: signatureCount + 1 }, () => new Set());\n reachable[0].add(0);\n for (const ownerWeight of weights)\n for (let count = signatureCount; count > 0; count--)\n for (const current of reachable[count - 1])\n reachable[count].add(current + ownerWeight);\n return reachable[signatureCount].has(weight);\n}\n/**\n * Validates the deterministic operation hash.\n *\n * @internal\n */\nfunction assertOperationHash(operation, payload) {\n const hash = AccountConfig.getSignPayload({\n account: operation.account,\n config: operation.config,\n payload,\n });\n if (hash.toLowerCase() !== operation.hash.toLowerCase())\n throw new InvalidOperationError({\n reason: 'hash does not match the operation payload',\n });\n}\n/**\n * Validates a nonnegative safe integer field.\n *\n * @internal\n */\nfunction assertInteger(value, field) {\n if (typeof value !== 'number' || !Number.isSafeInteger(value) || value < 0)\n throw new InvalidOperationError({\n reason: `${field} must be a nonnegative safe integer`,\n });\n}\n/**\n * Compares normalized account configurations.\n *\n * @internal\n */\nfunction sameConfig(a, b) {\n const configA = AccountConfig.from(a);\n const configB = AccountConfig.from(b);\n return (Hex.isEqual(configA.salt ?? AccountConfig.zeroSalt, configB.salt ?? AccountConfig.zeroSalt) &&\n configA.threshold === configB.threshold &&\n configA.version === configB.version &&\n configA.owners.length === configB.owners.length &&\n configA.owners.every((owner, index) => {\n const other = configB.owners[index];\n return (Address.isEqual(owner.owner, other.owner) &&\n owner.weight === other.weight);\n }));\n}\n/** Thrown when an account operation owner approval is invalid. */\nexport class InvalidApprovalError extends Errors.BaseError {\n /**\n * Creates an invalid operation approval error.\n *\n * @example\n * ```ts twoslash\n * import { AccountOperation } from 'ox/tempo'\n *\n * throw new AccountOperation.InvalidApprovalError({\n * reason: 'signature is from a non-owner',\n * })\n * ```\n *\n * @param options - Error options.\n */\n constructor(options = {}) {\n super(options.reason\n ? `Invalid operation approval: ${options.reason}.`\n : 'Invalid operation approval.', { cause: options.cause });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'AccountOperation.InvalidApprovalError'\n });\n }\n}\n/** Thrown when an account operation is malformed or internally inconsistent. */\nexport class InvalidOperationError extends Errors.BaseError {\n /**\n * Creates an invalid account operation error.\n *\n * @example\n * ```ts twoslash\n * import { AccountOperation } from 'ox/tempo'\n *\n * throw new AccountOperation.InvalidOperationError({\n * reason: 'hash does not match the operation payload',\n * })\n * ```\n *\n * @param options - Error options.\n */\n constructor(options = {}) {\n super(options.reason\n ? `Invalid account operation: ${options.reason}.`\n : 'Invalid account operation.', { cause: options.cause });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'AccountOperation.InvalidOperationError'\n });\n }\n}\n//# sourceMappingURL=AccountOperation.js.map","import * as Address from '../core/Address.js';\nimport * as Errors from '../core/Errors.js';\nimport * as Hex from '../core/Hex.js';\nimport * as Rlp from '../core/Rlp.js';\nimport * as AccountConfig from './AccountConfig.js';\n/**\n * Converts a JSON-RPC account simulation spec to its domain representation.\n *\n * @example\n * ```ts twoslash\n * // @noErrors\n * import { AccountSimulation } from 'ox/tempo'\n *\n * const spec = AccountSimulation.fromRpc(specRpc)\n * ```\n *\n * @param spec - JSON-RPC account simulation spec.\n * @returns The account simulation spec with decoded configurations.\n */\nexport function fromRpc(spec) {\n const { approvals, config, signer } = spec;\n assertApprovals(approvals);\n if (signer !== undefined)\n Address.assert(signer);\n return {\n approvals,\n config: deserializeConfig(config),\n ...(signer !== undefined ? { signer } : {}),\n };\n}\n/**\n * Converts an account simulation spec to its JSON-RPC representation.\n *\n * @example\n * ```ts twoslash\n * // @noErrors\n * import { AccountSimulation } from 'ox/tempo'\n *\n * const specRpc = AccountSimulation.toRpc(spec)\n * ```\n *\n * @param spec - Account simulation spec.\n * @returns The JSON-RPC account simulation spec with encoded configurations.\n */\nexport function toRpc(spec) {\n const { approvals, config, signer } = spec;\n assertApprovals(approvals);\n if (signer !== undefined)\n Address.assert(signer);\n return {\n approvals: approvals.map(({ keyData, keyType, owner }) => ({\n ...(keyData !== undefined ? { keyData: shimKeyData(keyData) } : {}),\n ...(keyType !== undefined ? { keyType } : {}),\n owner,\n })),\n config: serializeConfig(config),\n ...(signer !== undefined ? { signer } : {}),\n };\n}\n/** @internal */\nfunction assertApprovals(approvals) {\n if (approvals.some((approval) => typeof approval !== 'object' ||\n approval === null ||\n 'spec' in approval ||\n 'type' in approval))\n throw new InvalidSimulationError({\n reason: 'only untagged primitive owner approvals are allowed',\n });\n if (approvals.length > AccountConfig.maxSignatures)\n throw new InvalidSimulationError({\n reason: `approval count exceeds ${AccountConfig.maxSignatures}`,\n });\n}\n/** @internal */\nfunction deserializeConfig(config) {\n const tuple = Rlp.toHex(config);\n if (!Array.isArray(tuple) || tuple.length !== 4)\n throw new InvalidSimulationError({ reason: 'invalid config encoding' });\n const [salt, version, threshold, owners] = tuple;\n if (Array.isArray(salt) ||\n Hex.size(salt) !== 32 ||\n Array.isArray(version) ||\n Hex.size(version) > 8 ||\n (version !== '0x' && Hex.slice(version, 0, 1) === '0x00') ||\n Array.isArray(threshold) ||\n Hex.size(threshold) > 1 ||\n !Array.isArray(owners) ||\n owners.some((owner) => !Array.isArray(owner) ||\n owner.length !== 2 ||\n owner.some(Array.isArray) ||\n !Address.validate(owner[0]) ||\n Hex.size(owner[1]) > 1))\n throw new InvalidSimulationError({ reason: 'invalid config encoding' });\n const value = AccountConfig.fromTuple(tuple);\n AccountConfig.assert(value);\n if (!Hex.isEqual(config, serializeConfig(value)))\n throw new InvalidSimulationError({ reason: 'noncanonical config encoding' });\n return value;\n}\n/** @internal */\nfunction serializeConfig(config) {\n return Rlp.fromHex(AccountConfig.toTuple(config));\n}\n/**\n * Shims key data into the 1-, 2-, or 4-byte length hint accepted by Tempo's\n * gas estimator. Other sizes are replaced by a 2-byte hint of their length.\n * @internal\n */\nfunction shimKeyData(data) {\n const size = Hex.size(data);\n if (size === 1 || size === 2 || size === 4)\n return data;\n return Hex.fromNumber(size, { size: 2 });\n}\n/** Thrown when an account simulation spec is invalid. */\nexport class InvalidSimulationError extends Errors.BaseError {\n constructor(options) {\n super(`Invalid account simulation: ${options.reason}.`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'AccountSimulation.InvalidSimulationError'\n });\n }\n}\n//# sourceMappingURL=AccountSimulation.js.map","import * as Hex from '../core/Hex.js';\nimport * as Signature from '../core/Signature.js';\nimport * as ox_Transaction from '../core/Transaction.js';\nimport * as AuthorizationTempo from './AuthorizationTempo.js';\nimport * as KeyAuthorization from './KeyAuthorization.js';\nimport * as SignatureEnvelope from './SignatureEnvelope.js';\n/** Type to RPC Type mapping. */\nexport const toRpcType = {\n ...ox_Transaction.toRpcType,\n tempo: '0x76',\n};\n/** RPC Type to Type mapping. */\nexport const fromRpcType = {\n ...ox_Transaction.fromRpcType,\n '0x76': 'tempo',\n};\n/**\n * Converts an {@link ox#Transaction.Rpc} to an {@link ox#Transaction.Transaction}.\n *\n * @example\n * ```ts twoslash\n * import { Transaction } from 'ox/tempo'\n *\n * const transaction = Transaction.fromRpc({\n * hash: '0x353fdfc38a2f26115daadee9f5b8392ce62b84f410957967e2ed56b35338cdd0',\n * nonce: '0x357',\n * blockHash:\n * '0xc350d807505fb835650f0013632c5515592987ba169bbc6626d9fc54d91f0f0b',\n * blockNumber: '0x12f296f',\n * calls: [\n * {\n * input: '0xdeadbeef',\n * to: '0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad',\n * value: '0x9b6e64a8ec60000',\n * },\n * ],\n * feeToken: '0x20c0000000000000000000000000000000000000',\n * transactionIndex: '0x2',\n * from: '0x814e5e0e31016b9a7f138c76b7e7b2bb5c1ab6a6',\n * value: '0x9b6e64a8ec60000',\n * gas: '0x43f5d',\n * maxFeePerGas: '0x2ca6ae494',\n * maxPriorityFeePerGas: '0x41cc3c0',\n * input:\n * '0x3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006643504700000000000000000000000000000000000000000000000000000000000000040b080604000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002800000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000009b6e64a8ec600000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000009b6e64a8ec60000000000000000000000000000000000000000000000000000019124bb5ae978c000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000c56c7a0eaa804f854b536a5f3d5f49d2ec4b12b80000000000000000000000000000000000000000000000000000000000000060000000000000000000000000c56c7a0eaa804f854b536a5f3d5f49d2ec4b12b8000000000000000000000000000000fee13a103a10d593b9ae06b3e05f2e7e1c00000000000000000000000000000000000000000000000000000000000000190000000000000000000000000000000000000000000000000000000000000060000000000000000000000000c56c7a0eaa804f854b536a5f3d5f49d2ec4b12b800000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000190240001b9872b',\n * signature: {\n * r: '0x635dc2033e60185bb36709c29c75d64ea51dfbd91c32ef4be198e4ceb169fb4d',\n * s: '0x50c2667ac4c771072746acfdcf1f1483336dcca8bd2df47cd83175dbe60f0540',\n * type: 'secp256k1',\n * yParity: '0x0',\n * },\n * chainId: '0x1',\n * accessList: [],\n * type: '0x76',\n * })\n * ```\n *\n * @param transaction - The RPC transaction to convert.\n * @returns An instantiated {@link ox#Transaction.Transaction}.\n */\nexport function fromRpc(transaction, _options = {}) {\n if (!transaction)\n return null;\n const transaction_ = ox_Transaction.fromRpc(transaction);\n transaction_.type = fromRpcType[transaction.type];\n if (transaction.aaAuthorizationList) {\n transaction_.authorizationList = AuthorizationTempo.fromRpcList(transaction.aaAuthorizationList);\n delete transaction_.aaAuthorizationList;\n }\n if (transaction.calls)\n transaction_.calls = transaction.calls.map((call) => ({\n to: call.to,\n value: call.value && call.value !== '0x' ? BigInt(call.value) : undefined,\n // @ts-expect-error\n data: call.input || call.data || '0x',\n }));\n if (transaction.feeToken)\n transaction_.feeToken = transaction.feeToken;\n if (transaction.nonceKey)\n transaction_.nonceKey = BigInt(transaction.nonceKey);\n if (transaction.signature)\n transaction_.signature = SignatureEnvelope.fromRpc(transaction.signature);\n if (transaction.validAfter)\n transaction_.validAfter = Number(transaction.validAfter);\n if (transaction.validBefore)\n transaction_.validBefore = Number(transaction.validBefore);\n if (transaction.keyAuthorization)\n transaction_.keyAuthorization = KeyAuthorization.fromRpc(transaction.keyAuthorization);\n if (transaction.feePayerSignature) {\n transaction_.feePayerSignature = Signature.fromRpc(transaction.feePayerSignature);\n transaction_.feePayerSignature.v = Signature.yParityToV(transaction_.feePayerSignature.yParity);\n }\n return transaction_;\n}\n/**\n * Converts an {@link ox#Transaction.Transaction} to an {@link ox#Transaction.Rpc}.\n *\n * @example\n * ```ts twoslash\n * import { Transaction } from 'ox/tempo'\n *\n * const transaction = Transaction.toRpc({\n * accessList: [],\n * blockHash:\n * '0xc350d807505fb835650f0013632c5515592987ba169bbc6626d9fc54d91f0f0b',\n * blockNumber: 19868015n,\n * calls: [\n * {\n * data: '0xdeadbeef',\n * to: '0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad',\n * value: 700000000000000000n,\n * },\n * ],\n * chainId: 1,\n * feeToken: '0x20c0000000000000000000000000000000000000',\n * from: '0x814e5e0e31016b9a7f138c76b7e7b2bb5c1ab6a6',\n * gas: 278365n,\n * hash: '0x353fdfc38a2f26115daadee9f5b8392ce62b84f410957967e2ed56b35338cdd0',\n * input:\n * '0x3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006643504700000000000000000000000000000000000000000000000000000000000000040b080604000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002800000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000009b6e64a8ec600000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000009b6e64a8ec60000000000000000000000000000000000000000000000000000019124bb5ae978c000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000c56c7a0eaa804f854b536a5f3d5f49d2ec4b12b80000000000000000000000000000000000000000000000000000000000000060000000000000000000000000c56c7a0eaa804f854b536a5f3d5f49d2ec4b12b8000000000000000000000000000000fee13a103a10d593b9ae06b3e05f2e7e1c00000000000000000000000000000000000000000000000000000000000000190000000000000000000000000000000000000000000000000000000000000060000000000000000000000000c56c7a0eaa804f854b536a5f3d5f49d2ec4b12b800000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000190240001b9872b',\n * maxFeePerGas: 11985937556n,\n * maxPriorityFeePerGas: 68993984n,\n * nonce: 855n,\n * signature: {\n * signature: {\n * r: 44944627813007772897391531230081695102703289123332187696115181104739239197517n,\n * s: 36528503505192438307355164441104001310566505351980369085208178712678799181120n,\n * yParity: 0,\n * },\n * type: 'secp256k1',\n * },\n * transactionIndex: 2,\n * type: 'tempo',\n * })\n * ```\n *\n * @param transaction - The transaction to convert.\n * @returns An RPC-formatted transaction.\n */\nexport function toRpc(transaction, _options) {\n const rpc = ox_Transaction.toRpc(transaction);\n rpc.type = toRpcType[transaction.type];\n if (transaction.authorizationList)\n rpc.aaAuthorizationList = AuthorizationTempo.toRpcList(transaction.authorizationList);\n if (transaction.calls)\n rpc.calls = transaction.calls.map((call) => ({\n to: call.to,\n value: call.value ? Hex.fromNumber(call.value) : undefined,\n data: call.data,\n }));\n if (transaction.feeToken)\n rpc.feeToken = transaction.feeToken;\n if (transaction.keyAuthorization)\n rpc.keyAuthorization = KeyAuthorization.toRpc(transaction.keyAuthorization);\n if (typeof transaction.nonceKey === 'bigint')\n rpc.nonceKey = Hex.fromNumber(transaction.nonceKey);\n if (transaction.feePayerSignature) {\n rpc.feePayerSignature = Signature.toRpc(transaction.feePayerSignature);\n rpc.feePayerSignature.v = Hex.fromNumber(Signature.yParityToV(transaction.feePayerSignature?.yParity));\n }\n if (transaction.signature)\n rpc.signature = SignatureEnvelope.toRpc(transaction.signature);\n if (typeof transaction.validAfter === 'number')\n rpc.validAfter = Hex.fromNumber(transaction.validAfter);\n if (typeof transaction.validBefore === 'number')\n rpc.validBefore = Hex.fromNumber(transaction.validBefore);\n return rpc;\n}\n//# sourceMappingURL=Transaction.js.map","import * as Hex from '../core/Hex.js';\nimport * as ox_TransactionRequest from '../core/TransactionRequest.js';\nimport * as AccountSimulation from './AccountSimulation.js';\nimport * as AuthorizationTempo from './AuthorizationTempo.js';\nimport * as KeyAuthorization from './KeyAuthorization.js';\nimport * as TempoAddress from './TempoAddress.js';\nimport * as TokenId from './TokenId.js';\nimport * as Transaction from './Transaction.js';\n/**\n * Converts a {@link ox#TransactionRequest.Rpc} to a {@link ox#TransactionRequest.TransactionRequest}.\n *\n * @example\n * ```ts twoslash\n * import { TransactionRequest } from 'ox/tempo'\n *\n * const request = TransactionRequest.fromRpc({\n * calls: [{\n * data: '0xdeadbeef',\n * to: '0xcafebabecafebabecafebabecafebabecafebabe',\n * }],\n * feeToken: '0x20c0000000000000000000000000000000000000',\n * type: '0x76',\n * })\n * ```\n *\n * @param request - The RPC request to convert.\n * @returns A transaction request.\n */\nexport function fromRpc(request) {\n const { authorizationList: _, keyAuthorizationSimulation: __, keyType: ___, configurableAccountSimulation: ____, ...rest } = request;\n const request_ = ox_TransactionRequest.fromRpc(rest);\n if (typeof request.type !== 'undefined')\n request_.type =\n Transaction.fromRpcType[request.type] || request_.type;\n if (request.authorizationList)\n request_.authorizationList = AuthorizationTempo.fromRpcList(request.authorizationList);\n if (request.calls)\n request_.calls = request.calls.map((call) => {\n const mapped = {\n to: call.to,\n data: call.data,\n };\n if (call.value && call.value !== '0x')\n mapped.value = Hex.toBigInt(call.value);\n return mapped;\n });\n if (typeof request.feeToken !== 'undefined')\n request_.feeToken = request.feeToken;\n if (request.keyAuthorization)\n request_.keyAuthorization = KeyAuthorization.fromRpc(request.keyAuthorization);\n if (request.keyAuthorizationSimulation)\n request_.keyAuthorizationSimulation = AccountSimulation.fromRpc(request.keyAuthorizationSimulation);\n if (typeof request.keyType !== 'undefined')\n request_.keyType =\n request.keyType === 'configurableAccount'\n ? 'configurable'\n : request.keyType;\n if (request.configurableAccountSimulation)\n request_.accountSimulation = AccountSimulation.fromRpc(request.configurableAccountSimulation);\n if (typeof request.validBefore !== 'undefined')\n request_.validBefore = Hex.toNumber(request.validBefore);\n if (typeof request.validAfter !== 'undefined')\n request_.validAfter = Hex.toNumber(request.validAfter);\n if (typeof request.nonceKey !== 'undefined')\n request_.nonceKey = Hex.toBigInt(request.nonceKey);\n return request_;\n}\n/**\n * Converts a {@link ox#TransactionRequest.TransactionRequest} to a {@link ox#TransactionRequest.Rpc}.\n *\n * @see {@link https://docs.tempo.xyz/protocol/transactions}\n *\n * @example\n * ```ts twoslash\n * import { Value } from 'ox'\n * import { TransactionRequest } from 'ox/tempo'\n *\n * const request = TransactionRequest.toRpc({\n * calls: [{\n * data: '0xdeadbeef',\n * to: '0xcafebabecafebabecafebabecafebabecafebabe',\n * }],\n * feeToken: '0x20c0000000000000000000000000000000000000',\n * })\n * ```\n *\n * @example\n * ### Using with a Provider\n *\n * You can use {@link ox#Provider.(from:function)} to instantiate an EIP-1193 Provider and\n * send a transaction to the Wallet using the `eth_sendTransaction` method.\n *\n * ```ts twoslash\n * import 'ox/window'\n * import { Provider, Value } from 'ox'\n * import { TransactionRequest } from 'ox/tempo'\n *\n * const provider = Provider.from(window.ethereum!)\n *\n * const request = TransactionRequest.toRpc({\n * calls: [{\n * data: '0xdeadbeef',\n * to: '0xcafebabecafebabecafebabecafebabecafebabe',\n * }],\n * feeToken: '0x20c0000000000000000000000000000000000000',\n * })\n *\n * const hash = await provider.request({ // [!code focus]\n * method: 'eth_sendTransaction', // [!code focus]\n * params: [request], // [!code focus]\n * }) // [!code focus]\n * ```\n *\n * @param request - The request to convert.\n * @returns An RPC request.\n */\nexport function toRpc(request) {\n const request_rpc = ox_TransactionRequest.toRpc({\n ...request,\n authorizationList: undefined,\n });\n if (request.authorizationList)\n request_rpc.authorizationList = AuthorizationTempo.toRpcList(request.authorizationList);\n if (request.calls)\n request_rpc.calls = request.calls.map((call) => ({\n to: call.to ? TempoAddress.resolve(call.to) : call.to,\n value: call.value ? Hex.fromNumber(call.value) : '0x',\n data: call.data ?? '0x',\n }));\n else if (request.to || request.data || request.value)\n request_rpc.calls = [\n {\n to: request.to ? TempoAddress.resolve(request.to) : undefined,\n value: request.value ? Hex.fromNumber(request.value) : '0x',\n data: request.data ?? '0x',\n },\n ];\n if (typeof request.feeToken !== 'undefined')\n request_rpc.feeToken = TokenId.toAddress(request.feeToken);\n if (request.keyAuthorization)\n request_rpc.keyAuthorization = KeyAuthorization.toRpc(request.keyAuthorization);\n if (request.keyAuthorizationSimulation)\n request_rpc.keyAuthorizationSimulation = AccountSimulation.toRpc(request.keyAuthorizationSimulation);\n if (request.accountSimulation)\n request_rpc.configurableAccountSimulation = AccountSimulation.toRpc(request.accountSimulation);\n if (typeof request.validBefore !== 'undefined')\n request_rpc.validBefore = Hex.fromNumber(request.validBefore);\n if (typeof request.validAfter !== 'undefined')\n request_rpc.validAfter = Hex.fromNumber(request.validAfter);\n const nonceKey = (() => {\n if (request.nonceKey === 'random')\n return Hex.random(6);\n if (typeof request.nonceKey === 'bigint')\n return Hex.fromNumber(request.nonceKey);\n return undefined;\n })();\n if (nonceKey)\n request_rpc.nonceKey = nonceKey;\n if (typeof request.accountSimulation !== 'undefined' ||\n typeof request.calls !== 'undefined' ||\n typeof request.feePayer !== 'undefined' ||\n typeof request.feeToken !== 'undefined' ||\n typeof request.keyAuthorization !== 'undefined' ||\n typeof request.nonceKey !== 'undefined' ||\n typeof request.validBefore !== 'undefined' ||\n typeof request.validAfter !== 'undefined' ||\n request.type === 'tempo') {\n request_rpc.type = Transaction.toRpcType.tempo;\n delete request_rpc.data;\n delete request_rpc.input;\n delete request_rpc.to;\n delete request_rpc.value;\n }\n return request_rpc;\n}\n//# sourceMappingURL=TransactionRequest.js.map","import { hexToNumber } from '../encoding/fromHex.js';\nimport { defineFormatter } from './formatter.js';\nimport { formatLog } from './log.js';\nimport { transactionType } from './transaction.js';\nexport const receiptStatuses = {\n '0x0': 'reverted',\n '0x1': 'success',\n};\nexport function formatTransactionReceipt(transactionReceipt, _) {\n const receipt = {\n ...transactionReceipt,\n blockNumber: transactionReceipt.blockNumber\n ? BigInt(transactionReceipt.blockNumber)\n : null,\n contractAddress: transactionReceipt.contractAddress\n ? transactionReceipt.contractAddress\n : null,\n cumulativeGasUsed: transactionReceipt.cumulativeGasUsed\n ? BigInt(transactionReceipt.cumulativeGasUsed)\n : null,\n effectiveGasPrice: transactionReceipt.effectiveGasPrice\n ? BigInt(transactionReceipt.effectiveGasPrice)\n : null,\n gasUsed: transactionReceipt.gasUsed\n ? BigInt(transactionReceipt.gasUsed)\n : null,\n logs: transactionReceipt.logs\n ? transactionReceipt.logs.map((log) => formatLog(log))\n : null,\n to: transactionReceipt.to ? transactionReceipt.to : null,\n transactionIndex: transactionReceipt.transactionIndex\n ? hexToNumber(transactionReceipt.transactionIndex)\n : null,\n status: transactionReceipt.status\n ? receiptStatuses[transactionReceipt.status]\n : null,\n type: transactionReceipt.type\n ? transactionType[transactionReceipt.type] || transactionReceipt.type\n : null,\n };\n if (transactionReceipt.blobGasPrice)\n receipt.blobGasPrice = BigInt(transactionReceipt.blobGasPrice);\n if (transactionReceipt.blobGasUsed)\n receipt.blobGasUsed = BigInt(transactionReceipt.blobGasUsed);\n return receipt;\n}\nexport const defineTransactionReceipt = /*#__PURE__*/ defineFormatter('transactionReceipt', formatTransactionReceipt);\n//# sourceMappingURL=transactionReceipt.js.map","import { formatBlockParameter, } from '../../utils/block/formatBlockParameter.js';\n/**\n * Retrieves the bytecode at an address.\n *\n * - Docs: https://viem.sh/docs/contract/getCode\n * - JSON-RPC Methods: [`eth_getCode`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getcode)\n *\n * @param client - Client to use\n * @param parameters - {@link GetCodeParameters}\n * @returns The contract's bytecode. {@link GetCodeReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getCode } from 'viem/contract'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const code = await getCode(client, {\n * address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',\n * })\n */\nexport async function getCode(client, { address, blockHash, blockNumber, blockTag = 'latest', requireCanonical, }) {\n const block = formatBlockParameter({\n blockHash,\n blockNumber,\n blockTag,\n requireCanonical,\n });\n const hex = await client.request({\n method: 'eth_getCode',\n params: [address, block],\n }, {\n dedupe: typeof blockNumber === 'bigint' || blockHash !== undefined,\n });\n if (hex === '0x')\n return undefined;\n return hex;\n}\n//# sourceMappingURL=getCode.js.map","import { getAddress } from '../address/getAddress.js';\nimport { isAddressEqual, } from '../address/isAddressEqual.js';\nimport { recoverAuthorizationAddress, } from './recoverAuthorizationAddress.js';\n/**\n * Verify that an Authorization object was signed by the provided address.\n *\n * - Docs {@link https://viem.sh/docs/utilities/verifyAuthorization}\n *\n * @param parameters - {@link VerifyAuthorizationParameters}\n * @returns Whether or not the signature is valid. {@link VerifyAuthorizationReturnType}\n */\nexport async function verifyAuthorization({ address, authorization, signature, }) {\n return isAddressEqual(getAddress(address), await recoverAuthorizationAddress({\n authorization,\n signature,\n }));\n}\n//# sourceMappingURL=verifyAuthorization.js.map","export function defineChain(chain) {\n const chainInstance = {\n formatters: undefined,\n fees: undefined,\n serializers: undefined,\n ...chain,\n };\n function extend(base) {\n return (fnOrExtended) => {\n const properties = (typeof fnOrExtended === 'function' ? fnOrExtended(base) : fnOrExtended);\n const combined = { ...base, ...properties };\n return Object.assign(combined, { extend: extend(combined) });\n };\n }\n return Object.assign(chainInstance, {\n extend: extend(chainInstance),\n });\n}\nexport function extendSchema() {\n return {};\n}\n//# sourceMappingURL=defineChain.js.map","import * as AbiParameters from '../core/AbiParameters.js';\nimport * as Authorization from '../core/Authorization.js';\nimport * as Errors from '../core/Errors.js';\nimport * as Hex from '../core/Hex.js';\nimport * as Secp256k1 from '../core/Secp256k1.js';\nimport * as Signature from '../core/Signature.js';\n/**\n * Magic bytes used to identify ERC-8010 wrapped signatures.\n */\nexport const magicBytes = '0x8010801080108010801080108010801080108010801080108010801080108010';\n/** Suffix ABI parameters for the ERC-8010 wrapped signature. */\nexport const suffixParameters = AbiParameters.from('(uint256 chainId, address delegation, uint256 nonce, uint8 yParity, uint256 r, uint256 s), address to, bytes data');\n/**\n * Asserts that the wrapped signature is valid.\n *\n * @example\n * ```ts twoslash\n * import { SignatureErc8010 } from 'ox/erc8010'\n *\n * SignatureErc8010.assert('0xdeadbeef')\n * // @error: InvalidWrappedSignatureError: Value `0xdeadbeef` is an invalid ERC-8010 wrapped signature.\n * ```\n *\n * @param value - The value to assert.\n */\nexport function assert(value) {\n if (typeof value === 'string') {\n if (Hex.slice(value, -32) !== magicBytes)\n throw new InvalidWrappedSignatureError(value);\n }\n else\n Signature.assert(value.authorization);\n}\n/**\n * Parses an [ERC-8010 wrapped signature](https://github.com/jxom/ERCs/blob/16f7e3891fff2e1e9c25dea0485497739db8a816/ERCS/erc-8010.md) into its constituent parts.\n *\n * @example\n * ```ts twoslash\n * // @noErrors\n * import { Secp256k1 } from 'ox'\n * import { SignatureErc8010 } from 'ox/erc8010' // [!code focus]\n *\n * const signature = Secp256k1.sign({\n * payload: '0x...',\n * privateKey: '0x...',\n * })\n *\n * // Instantiate from serialized format. // [!code focus]\n * const wrapped = SignatureErc8010.from('0x...') // [!code focus]\n * // @log: { authorization: { ... }, data: '0x...', signature: { ... } } // [!code focus]\n *\n * // Instantiate from constituent parts. // [!code focus]\n * const wrapped = SignatureErc8010.from({ // [!code focus]\n * authorization: { ... }, // [!code focus]\n * data: '0x...', // [!code focus]\n * signature, // [!code focus]\n * })\n * // @log: { authorization: { ... }, data: '0x...', signature: { ... } }\n * ```\n *\n * @param value - Value to parse.\n * @returns Parsed value.\n */\nexport function from(value) {\n if (typeof value === 'string')\n return unwrap(value);\n return value;\n}\n/**\n * Unwraps an [ERC-8010 wrapped signature](https://github.com/jxom/ERCs/blob/16f7e3891fff2e1e9c25dea0485497739db8a816/ERCS/erc-8010.md) into its constituent parts.\n *\n * @example\n * ```ts twoslash\n * import { SignatureErc8010 } from 'ox/erc8010'\n *\n * const { authorization, data, signature } = SignatureErc8010.unwrap('0x...')\n * ```\n *\n * @param wrapped - Wrapped signature to unwrap.\n * @returns Unwrapped signature.\n */\nexport function unwrap(wrapped) {\n assert(wrapped);\n const suffixLength = Hex.toNumber(Hex.slice(wrapped, -64, -32));\n const suffix = Hex.slice(wrapped, -suffixLength - 64, -64);\n const signature = Hex.slice(wrapped, 0, -suffixLength - 64);\n const [auth, to, data] = AbiParameters.decode(suffixParameters, suffix);\n const authorization = Authorization.from({\n address: auth.delegation,\n chainId: Number(auth.chainId),\n nonce: auth.nonce,\n yParity: auth.yParity,\n r: auth.r,\n s: auth.s,\n });\n return {\n authorization,\n signature,\n ...(data && data !== '0x' ? { data, to } : {}),\n };\n}\n/**\n * Wraps a signature into [ERC-8010 format](https://github.com/jxom/ERCs/blob/16f7e3891fff2e1e9c25dea0485497739db8a816/ERCS/erc-8010.md).\n *\n * @example\n * ```ts twoslash\n * // @noErrors\n * import { Secp256k1, Signature } from 'ox'\n * import { SignatureErc8010 } from 'ox/erc8010' // [!code focus]\n *\n * const signature = Secp256k1.sign({\n * payload: '0x...',\n * privateKey: '0x...',\n * })\n *\n * const wrapped = SignatureErc8010.wrap({ // [!code focus]\n * authorization: { ... }, // [!code focus]\n * data: '0xdeadbeef', // [!code focus]\n * signature: Signature.toHex(signature), // [!code focus]\n * }) // [!code focus]\n * ```\n *\n * @param value - Values to wrap.\n * @returns Wrapped signature.\n */\nexport function wrap(value) {\n const { data, signature } = value;\n assert(value);\n const self = Secp256k1.recoverAddress({\n payload: Authorization.getSignPayload(value.authorization),\n signature: Signature.from(value.authorization),\n });\n const suffix = AbiParameters.encode(suffixParameters, [\n {\n ...value.authorization,\n delegation: value.authorization.address,\n chainId: BigInt(value.authorization.chainId),\n },\n value.to ?? self,\n data ?? '0x',\n ]);\n const suffixLength = Hex.fromNumber(Hex.size(suffix), { size: 32 });\n return Hex.concat(signature, suffix, suffixLength, magicBytes);\n}\n/**\n * Validates a wrapped signature. Returns `true` if the wrapped signature is valid, `false` otherwise.\n *\n * @example\n * ```ts twoslash\n * import { SignatureErc8010 } from 'ox/erc8010'\n *\n * const valid = SignatureErc8010.validate('0xdeadbeef')\n * // @log: false\n * ```\n *\n * @param value - The value to validate.\n * @returns `true` if the value is valid, `false` otherwise.\n */\nexport function validate(value) {\n try {\n assert(value);\n return true;\n }\n catch {\n return false;\n }\n}\n/** Thrown when the ERC-8010 wrapped signature is invalid. */\nexport class InvalidWrappedSignatureError extends Errors.BaseError {\n constructor(wrapped) {\n super(`Value \\`${wrapped}\\` is an invalid ERC-8010 wrapped signature.`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'SignatureErc8010.InvalidWrappedSignatureError'\n });\n }\n}\n//# sourceMappingURL=SignatureErc8010.js.map","import { TransactionNotFoundError, } from '../../errors/transaction.js';\nimport { numberToHex, } from '../../utils/encoding/toHex.js';\nimport { formatTransaction, } from '../../utils/formatters/transaction.js';\n/**\n * Returns information about a [Transaction](https://viem.sh/docs/glossary/terms#transaction) given a hash or block identifier.\n *\n * - Docs: https://viem.sh/docs/actions/public/getTransaction\n * - Example: https://stackblitz.com/github/wevm/viem/tree/main/examples/transactions_fetching-transactions\n * - JSON-RPC Methods: [`eth_getTransactionByHash`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionByHash)\n *\n * @param client - Client to use\n * @param parameters - {@link GetTransactionParameters}\n * @returns The transaction information. {@link GetTransactionReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getTransaction } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const transaction = await getTransaction(client, {\n * hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d',\n * })\n */\nexport async function getTransaction(client, { blockHash, blockNumber, blockTag: blockTag_, hash, index, sender, nonce, }) {\n const blockTag = blockTag_ || 'latest';\n const blockNumberHex = blockNumber !== undefined ? numberToHex(blockNumber) : undefined;\n let transaction = null;\n if (hash) {\n transaction = await client.request({\n method: 'eth_getTransactionByHash',\n params: [hash],\n }, { dedupe: true });\n }\n else if (blockHash) {\n transaction = await client.request({\n method: 'eth_getTransactionByBlockHashAndIndex',\n params: [blockHash, numberToHex(index)],\n }, { dedupe: true });\n }\n else if ((blockNumberHex || blockTag) && typeof index === 'number') {\n transaction = await client.request({\n method: 'eth_getTransactionByBlockNumberAndIndex',\n params: [blockNumberHex || blockTag, numberToHex(index)],\n }, { dedupe: Boolean(blockNumberHex) });\n }\n else if (sender && typeof nonce === 'number') {\n transaction = await client.request({\n method: 'eth_getTransactionBySenderAndNonce',\n params: [sender, numberToHex(nonce)],\n }, { dedupe: true });\n }\n if (!transaction)\n throw new TransactionNotFoundError({\n blockHash,\n blockNumber,\n blockTag,\n hash,\n index,\n });\n const format = client.chain?.formatters?.transaction?.format || formatTransaction;\n return format(transaction, 'getTransaction');\n}\n//# sourceMappingURL=getTransaction.js.map","import * as AbiParameters from '../core/AbiParameters.js';\nimport * as Errors from '../core/Errors.js';\nimport * as Hex from '../core/Hex.js';\n/**\n * Magic bytes used to identify ERC-6492 wrapped signatures.\n */\nexport const magicBytes = '0x6492649264926492649264926492649264926492649264926492649264926492';\n/**\n * Deployless ERC-6492 signature verification bytecode.\n */\nexport const universalSignatureValidatorBytecode = '0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572';\n/**\n * ABI for the ERC-6492 universal deployless signature validator contract.\n *\n * Constructor return value is `0x1` (valid) or `0x0` (invalid).\n */\nexport const universalSignatureValidatorAbi = [\n {\n inputs: [\n {\n name: '_signer',\n type: 'address',\n },\n {\n name: '_hash',\n type: 'bytes32',\n },\n {\n name: '_signature',\n type: 'bytes',\n },\n ],\n stateMutability: 'nonpayable',\n type: 'constructor',\n },\n {\n inputs: [\n {\n name: '_signer',\n type: 'address',\n },\n {\n name: '_hash',\n type: 'bytes32',\n },\n {\n name: '_signature',\n type: 'bytes',\n },\n ],\n outputs: [\n {\n type: 'bool',\n },\n ],\n stateMutability: 'nonpayable',\n type: 'function',\n name: 'isValidSig',\n },\n];\n/**\n * Asserts that the wrapped signature is valid.\n *\n * @example\n * ```ts twoslash\n * import { SignatureErc6492 } from 'ox/erc6492'\n *\n * SignatureErc6492.assert('0xdeadbeef')\n * // @error: InvalidWrappedSignatureError: Value `0xdeadbeef` is an invalid ERC-6492 wrapped signature.\n * ```\n *\n * @param wrapped - The wrapped signature to assert.\n */\nexport function assert(wrapped) {\n if (Hex.slice(wrapped, -32) !== magicBytes)\n throw new InvalidWrappedSignatureError(wrapped);\n}\n/**\n * Parses an [ERC-6492 wrapped signature](https://eips.ethereum.org/EIPS/eip-6492#specification) into its constituent parts.\n *\n * @example\n * ```ts twoslash\n * // @noErrors\n * import { Secp256k1 } from 'ox'\n * import { SignatureErc6492 } from 'ox/erc6492' // [!code focus]\n *\n * const signature = Secp256k1.sign({\n * payload: '0x...',\n * privateKey: '0x...',\n * })\n *\n * // Instantiate from serialized format. // [!code focus]\n * const wrapped = SignatureErc6492.from('0x...') // [!code focus]\n * // @log: { data: '0x...', signature: { ... }, to: '0x...', } // [!code focus]\n *\n * // Instantiate from constituent parts. // [!code focus]\n * const wrapped = SignatureErc6492.from({ // [!code focus]\n * data: '0x...', // [!code focus]\n * signature, // [!code focus]\n * to: '0x...', // [!code focus]\n * })\n * // @log: { data: '0x...', signature: { ... }, to: '0x...', }\n * ```\n *\n * @param wrapped - Wrapped signature to parse.\n * @returns Wrapped signature.\n */\nexport function from(wrapped) {\n if (typeof wrapped === 'string')\n return unwrap(wrapped);\n return wrapped;\n}\n/**\n * Parses an [ERC-6492 wrapped signature](https://eips.ethereum.org/EIPS/eip-6492#specification) into its constituent parts.\n *\n * @example\n * ```ts twoslash\n * import { SignatureErc6492 } from 'ox/erc6492'\n *\n * const { data, signature, to } = SignatureErc6492.unwrap('0x...')\n * ```\n *\n * @param wrapped - Wrapped signature to parse.\n * @returns Wrapped signature.\n */\nexport function unwrap(wrapped) {\n assert(wrapped);\n const [to, data, signature] = AbiParameters.decode(AbiParameters.from('address, bytes, bytes'), wrapped);\n return { data, signature, to };\n}\n/**\n * Serializes an [ERC-6492 wrapped signature](https://eips.ethereum.org/EIPS/eip-6492#specification).\n *\n * @example\n * ```ts twoslash\n * import { Secp256k1, Signature } from 'ox'\n * import { SignatureErc6492 } from 'ox/erc6492' // [!code focus]\n *\n * const signature = Secp256k1.sign({\n * payload: '0x...',\n * privateKey: '0x...',\n * })\n *\n * const wrapped = SignatureErc6492.wrap({ // [!code focus]\n * data: '0xdeadbeef', // [!code focus]\n * signature: Signature.toHex(signature), // [!code focus]\n * to: '0x00000000219ab540356cBB839Cbe05303d7705Fa', // [!code focus]\n * }) // [!code focus]\n * ```\n *\n * @param value - Wrapped signature to serialize.\n * @returns Serialized wrapped signature.\n */\nexport function wrap(value) {\n const { data, signature, to } = value;\n return Hex.concat(AbiParameters.encode(AbiParameters.from('address, bytes, bytes'), [\n to,\n data,\n signature,\n ]), magicBytes);\n}\n/**\n * Validates a wrapped signature. Returns `true` if the wrapped signature is valid, `false` otherwise.\n *\n * @example\n * ```ts twoslash\n * import { SignatureErc6492 } from 'ox/erc6492'\n *\n * const valid = SignatureErc6492.validate('0xdeadbeef')\n * // @log: false\n * ```\n *\n * @param wrapped - The wrapped signature to validate.\n * @returns `true` if the wrapped signature is valid, `false` otherwise.\n */\nexport function validate(wrapped) {\n try {\n assert(wrapped);\n return true;\n }\n catch {\n return false;\n }\n}\n/** Thrown when the ERC-6492 wrapped signature is invalid. */\nexport class InvalidWrappedSignatureError extends Errors.BaseError {\n constructor(wrapped) {\n super(`Value \\`${wrapped}\\` is an invalid ERC-6492 wrapped signature.`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'SignatureErc6492.InvalidWrappedSignatureError'\n });\n }\n}\n//# sourceMappingURL=SignatureErc6492.js.map","import { secp256k1 } from '@noble/curves/secp256k1';\nimport { hexToBigInt } from '../encoding/fromHex.js';\nimport { hexToBytes } from '../encoding/toBytes.js';\n/**\n * @description Converts a signature into hex format.\n *\n * @param signature The signature to convert.\n * @returns The signature in hex format.\n *\n * @example\n * serializeSignature({\n * r: '0x6e100a352ec6ad1b70802290e18aeed190704973570f3b8ed42cb9808e2ea6bf',\n * s: '0x4a90a229a244495b41890987806fcbd2d5d23fc0dbe5f5256c2613c039d76db8',\n * yParity: 1\n * })\n * // \"0x6e100a352ec6ad1b70802290e18aeed190704973570f3b8ed42cb9808e2ea6bf4a90a229a244495b41890987806fcbd2d5d23fc0dbe5f5256c2613c039d76db81c\"\n */\nexport function serializeSignature({ r, s, to = 'hex', v, yParity, }) {\n const yParity_ = (() => {\n if (yParity === 0 || yParity === 1)\n return yParity;\n if (v && (v === 27n || v === 28n || v >= 35n))\n return v % 2n === 0n ? 1 : 0;\n throw new Error('Invalid `v` or `yParity` value');\n })();\n const signature = `0x${new secp256k1.Signature(hexToBigInt(r), hexToBigInt(s)).toCompactHex()}${yParity_ === 0 ? '1b' : '1c'}`;\n if (to === 'hex')\n return signature;\n return hexToBytes(signature);\n}\n//# sourceMappingURL=serializeSignature.js.map","import { SignatureErc6492 } from 'ox/erc6492';\nimport { SignatureErc8010 } from 'ox/erc8010';\nimport { erc1271Abi, erc6492SignatureValidatorAbi, multicall3Abi, } from '../../constants/abis.js';\nimport { erc6492SignatureValidatorByteCode, multicall3Bytecode, } from '../../constants/contracts.js';\nimport { CallExecutionError, ContractFunctionExecutionError, } from '../../errors/contract.js';\nimport { encodeDeployData, } from '../../utils/abi/encodeDeployData.js';\nimport { encodeFunctionData, } from '../../utils/abi/encodeFunctionData.js';\nimport { getAddress, } from '../../utils/address/getAddress.js';\nimport { isAddressEqual, } from '../../utils/address/isAddressEqual.js';\nimport { verifyAuthorization } from '../../utils/authorization/verifyAuthorization.js';\nimport { concatHex } from '../../utils/data/concat.js';\nimport { isHex } from '../../utils/data/isHex.js';\nimport { hexToBool } from '../../utils/encoding/fromHex.js';\nimport { bytesToHex, numberToHex, } from '../../utils/encoding/toHex.js';\nimport { getAction } from '../../utils/getAction.js';\nimport { recoverAddress, } from '../../utils/signature/recoverAddress.js';\nimport { serializeSignature, } from '../../utils/signature/serializeSignature.js';\nimport { call } from './call.js';\nimport { getCode } from './getCode.js';\nimport { readContract } from './readContract.js';\n/**\n * Verifies a message hash onchain using ERC-6492.\n *\n * @param client - Client to use.\n * @param parameters - {@link VerifyHashParameters}\n * @returns Whether or not the signature is valid. {@link VerifyHashReturnType}\n */\nexport async function verifyHash(client, parameters) {\n const { address, chain = client.chain, hash, erc6492VerifierAddress: verifierAddress = parameters.universalSignatureVerifierAddress ??\n chain?.contracts?.erc6492Verifier?.address, multicallAddress = parameters.multicallAddress ??\n chain?.contracts?.multicall3?.address, mode = 'auto', } = parameters;\n if (chain?.verifyHash)\n return await chain.verifyHash(client, parameters);\n const signature = (() => {\n const signature = parameters.signature;\n if (isHex(signature))\n return signature;\n if (typeof signature === 'object' && 'r' in signature && 's' in signature)\n return serializeSignature(signature);\n return bytesToHex(signature);\n })();\n try {\n if (mode === 'eoa') {\n try {\n const verified = isAddressEqual(getAddress(address), await recoverAddress({ hash, signature }));\n if (verified)\n return true;\n }\n catch { }\n }\n if (SignatureErc8010.validate(signature))\n return await verifyErc8010(client, {\n ...parameters,\n multicallAddress,\n signature,\n });\n return await verifyErc6492(client, {\n ...parameters,\n verifierAddress,\n signature,\n });\n }\n catch (error) {\n if (mode !== 'eoa') {\n // Fallback attempt to verify the signature via ECDSA recovery.\n try {\n const verified = isAddressEqual(getAddress(address), await recoverAddress({ hash, signature }));\n if (verified)\n return true;\n }\n catch { }\n }\n if (error instanceof VerificationError) {\n // if the execution fails, the signature was not valid and an internal method inside of the validator reverted\n // this can happen for many reasons, for example if signer can not be recovered from the signature\n // or if the signature has no valid format\n return false;\n }\n throw error;\n }\n}\n/** @internal */\nexport async function verifyErc8010(client, parameters) {\n const { address, blockHash, blockNumber, blockTag, hash, multicallAddress, requireCanonical, } = parameters;\n const { authorization: authorization_ox, data: initData, signature, to, } = SignatureErc8010.unwrap(parameters.signature);\n // Check if already delegated\n const code = await getCode(client, {\n address,\n blockHash,\n blockNumber,\n blockTag,\n requireCanonical,\n });\n // If already delegated, perform standard ERC-1271 verification.\n if (code === concatHex(['0xef0100', authorization_ox.address]))\n return await verifyErc1271(client, {\n ...parameters,\n signature,\n });\n const authorization = {\n address: authorization_ox.address,\n chainId: Number(authorization_ox.chainId),\n nonce: Number(authorization_ox.nonce),\n r: numberToHex(authorization_ox.r, { size: 32 }),\n s: numberToHex(authorization_ox.s, { size: 32 }),\n yParity: authorization_ox.yParity,\n };\n const valid = await verifyAuthorization({\n address,\n authorization,\n });\n if (!valid)\n throw new VerificationError();\n // Deployless verification.\n const results = await getAction(client, readContract, 'readContract')({\n ...(multicallAddress\n ? { address: multicallAddress }\n : { code: multicall3Bytecode }),\n authorizationList: [authorization],\n abi: multicall3Abi,\n blockHash,\n blockNumber,\n blockTag: 'pending',\n functionName: 'aggregate3',\n requireCanonical,\n args: [\n [\n ...(initData\n ? [\n {\n allowFailure: true,\n target: to ?? address,\n callData: initData,\n },\n ]\n : []),\n {\n allowFailure: true,\n target: address,\n callData: encodeFunctionData({\n abi: erc1271Abi,\n functionName: 'isValidSignature',\n args: [hash, signature],\n }),\n },\n ],\n ],\n });\n const data = results[results.length - 1]?.returnData;\n if (data?.startsWith('0x1626ba7e'))\n return true;\n throw new VerificationError();\n}\n/** @internal */\n// biome-ignore lint/correctness/noUnusedVariables: _\nasync function verifyErc6492(client, parameters) {\n const { address, factory, factoryData, hash, signature, verifierAddress, ...rest } = parameters;\n const wrappedSignature = await (async () => {\n // If no `factory` or `factoryData` is provided, it is assumed that the\n // address is not a Smart Account, or the Smart Account is already deployed.\n if (!factory && !factoryData)\n return signature;\n // If the signature is already wrapped, return the signature.\n if (SignatureErc6492.validate(signature))\n return signature;\n // If the Smart Account is not deployed, wrap the signature with a 6492 wrapper\n // to perform counterfactual validation.\n return SignatureErc6492.wrap({\n data: factoryData,\n signature,\n to: factory,\n });\n })();\n const args = verifierAddress\n ? {\n to: verifierAddress,\n data: encodeFunctionData({\n abi: erc6492SignatureValidatorAbi,\n functionName: 'isValidSig',\n args: [address, hash, wrappedSignature],\n }),\n ...rest,\n }\n : {\n data: encodeDeployData({\n abi: erc6492SignatureValidatorAbi,\n args: [address, hash, wrappedSignature],\n bytecode: erc6492SignatureValidatorByteCode,\n }),\n ...rest,\n };\n const { data } = await getAction(client, call, 'call')(args).catch((error) => {\n if (error instanceof CallExecutionError)\n throw new VerificationError();\n throw error;\n });\n if (hexToBool(data ?? '0x0'))\n return true;\n throw new VerificationError();\n}\n/** @internal */\nexport async function verifyErc1271(client, parameters) {\n const { address, blockHash, blockNumber, blockTag, hash, requireCanonical, signature, } = parameters;\n const result = await getAction(client, readContract, 'readContract')({\n address,\n abi: erc1271Abi,\n args: [hash, signature],\n blockHash,\n blockNumber,\n blockTag,\n functionName: 'isValidSignature',\n requireCanonical,\n }).catch((error) => {\n if (error instanceof ContractFunctionExecutionError)\n throw new VerificationError();\n throw error;\n });\n if (result.startsWith('0x1626ba7e'))\n return true;\n throw new VerificationError();\n}\nclass VerificationError extends Error {\n}\n//# sourceMappingURL=verifyHash.js.map","import { AccountConfig, AccountOperation } from 'ox/tempo';\nimport { readContract } from '../../actions/public/readContract.js';\nimport { writeContract } from '../../actions/wallet/writeContract.js';\nimport { writeContractSync } from '../../actions/wallet/writeContractSync.js';\nimport { parseEventLogs } from '../../utils/abi/parseEventLogs.js';\nimport * as Abis from '../Abis.js';\nimport { fromConfig } from '../Account.js';\nimport * as Addresses from '../Addresses.js';\nimport { withExecutionError } from '../internal/errors.js';\nimport { defineCall } from '../internal/utils.js';\n/**\n * Derives a configurable account address from an initial config with the\n * configurable account precompile.\n *\n * The precompile validates the config and derives the address with the chain's\n * recovery factory. To derive the address locally, use\n * `AccountConfig.getAddress` or `Account.fromConfig({ address: 'infer' })`.\n *\n * @example\n * ```ts\n * import { createClient, http } from 'viem'\n * import { tempo } from 'viem/chains'\n * import { Actions } from 'viem/tempo'\n *\n * const client = createClient({\n * chain: tempo,\n * transport: http(),\n * })\n *\n * const address = await Actions.accounts.deriveAccount(client, {\n * owners: [{ owner: '0x...', weight: 1 }],\n * threshold: 1,\n * })\n * ```\n *\n * @param client - Client.\n * @param parameters - Parameters.\n * @returns The configurable account address.\n */\nexport async function deriveAccount(client, parameters) {\n const { owners, salt, threshold, ...rest } = parameters;\n return withExecutionError(readContract)(client, {\n ...rest,\n ...deriveAccount.call({ owners, salt, threshold }),\n });\n}\n(function (deriveAccount) {\n /**\n * Defines a call to the `deriveAccount` function.\n *\n * Can be passed to [`multicall`](https://viem.sh/docs/contract/multicall).\n *\n * @param args - Arguments.\n * @returns The call.\n */\n function call(args) {\n const { owners, salt, threshold } = AccountConfig.from(args);\n return defineCall({\n address: Addresses.configurableAccount,\n abi: Abis.configurableAccount,\n args: [salt, threshold, owners],\n functionName: 'deriveAccount',\n });\n }\n deriveAccount.call = call;\n})(deriveAccount || (deriveAccount = {}));\n/**\n * Gets the current cached config for a configurable account.\n *\n * The coordinator reads the account's current onchain commitment and returns\n * the matching config from its store. It returns `null` when the config is not\n * cached.\n *\n * @example\n * ```ts\n * const config = await client.accounts.getConfig({\n * address: '0x...',\n * })\n * ```\n *\n * @param client - Client.\n * @param parameters - Parameters.\n * @returns The config, or `null` when it is unknown.\n */\nexport async function getConfig(client, parameters) {\n const config = await client.request({\n method: 'account_getConfig',\n params: [{ address: parameters.address }],\n });\n return config ? AccountConfig.fromRpc(config) : null;\n}\n/**\n * Gets the current configuration commitment for a configurable account.\n *\n * @example\n * ```ts\n * import { createClient, http } from 'viem'\n * import { tempo } from 'viem/chains'\n * import { Actions } from 'viem/tempo'\n *\n * const client = createClient({\n * chain: tempo,\n * transport: http(),\n * })\n *\n * const commitment = await Actions.accounts.getConfigCommitment(client, {\n * account: '0x...',\n * })\n * ```\n *\n * @param client - Client.\n * @param parameters - Parameters.\n * @returns The current configuration commitment, or zero when no config has\n * been committed.\n */\nexport async function getConfigCommitment(client, parameters) {\n const { account, ...rest } = parameters;\n return withExecutionError(readContract)(client, {\n ...rest,\n ...getConfigCommitment.call({ account }),\n });\n}\n(function (getConfigCommitment) {\n /**\n * Defines a call to the `getConfigCommitment` function.\n *\n * Can be passed to [`multicall`](https://viem.sh/docs/contract/multicall).\n *\n * @param args - Arguments.\n * @returns The call.\n */\n function call(args) {\n return defineCall({\n address: Addresses.configurableAccount,\n abi: Abis.configurableAccount,\n args: [args.account],\n functionName: 'getConfigCommitment',\n });\n }\n getConfigCommitment.call = call;\n})(getConfigCommitment || (getConfigCommitment = {}));\n/**\n * Gets a coordinated account operation by its hash.\n *\n * @param client - Client.\n * @param parameters - Parameters.\n * @returns The operation, or `null` when it is unknown.\n */\nexport async function getOperation(client, parameters) {\n const operation = await client.request({\n method: 'account_getOperation',\n params: [parameters.hash],\n });\n return operation ? AccountOperation.fromRpc(operation) : null;\n}\n/**\n * Replaces the current configuration for a configurable account.\n *\n * The transaction must be authorized directly by the account's current owner\n * quorum. Local owner-signing flows can include {@link updateConfig.call} in a\n * prepared transaction before collecting approvals.\n *\n * @example\n * ```ts\n * import { createClient, http } from 'viem'\n * import { sendTransactionSync } from 'viem/actions'\n * import { tempoLocalnet } from 'viem/chains'\n * import { Account, Actions } from 'viem/tempo'\n *\n * const owner = Account.fromSecp256k1(\n * '0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80',\n * )\n * const account = Account.fromConfig({\n * address: 'infer',\n * owners: [owner],\n * })\n * const client = createClient({\n * chain: tempoLocalnet,\n * transport: http(),\n * })\n *\n * await sendTransactionSync(client, {\n * account,\n * to: account.address,\n * })\n *\n * const hash = await Actions.accounts.updateConfig(client, {\n * account,\n * nextConfig: {\n * owners: [{ owner: owner.address, weight: 1 }],\n * threshold: 1,\n * },\n * })\n * ```\n *\n * @param client - Client.\n * @param parameters - Parameters.\n * @returns The transaction hash.\n */\nexport async function updateConfig(client, parameters) {\n return updateConfig.inner(writeContract, client, parameters);\n}\n(function (updateConfig) {\n /** @internal */\n async function inner(action, client, parameters) {\n const { account: account_, currentConfig: currentConfig_, nextConfig, ...rest } = parameters;\n const accountValue = account_ ?? client.account;\n const account = (() => {\n if (typeof accountValue === 'object' &&\n accountValue.source === 'configurable')\n return accountValue;\n return undefined;\n })();\n const config = (() => {\n if (currentConfig_)\n return currentConfig_;\n if (account?.config)\n return account.config;\n return undefined;\n })();\n const address = (() => {\n if (account)\n return account.address;\n if (typeof accountValue === 'string')\n return accountValue;\n if (accountValue)\n return accountValue.address;\n return undefined;\n })();\n const currentConfig = await (async () => {\n if (config)\n return AccountConfig.from(config);\n if (!address)\n throw new Error('A configurable account address or current config is required.');\n const cachedConfig = await getConfig(client, { address });\n if (!cachedConfig)\n throw new Error(`No current account config is cached for account ${address}. Provide the current config.`);\n return cachedConfig;\n })();\n const resolvedAccount = (() => {\n if (account)\n return { ...account, config: currentConfig };\n if (typeof accountValue === 'object')\n return accountValue;\n if (address)\n return fromConfig({ address, ...currentConfig });\n return undefined;\n })();\n return (await withExecutionError(action)(client, {\n ...rest,\n ...(resolvedAccount ? { account: resolvedAccount } : {}),\n ...updateConfig.call({ currentConfig, nextConfig }),\n }));\n }\n updateConfig.inner = inner;\n /**\n * Defines a call to the `updateConfig` function.\n *\n * Can be passed as a parameter to:\n * - [`estimateContractGas`](https://viem.sh/docs/contract/estimateContractGas): estimate gas\n * - [`simulateContract`](https://viem.sh/docs/contract/simulateContract): simulate the update\n * - [`sendCalls`](https://viem.sh/docs/actions/wallet/sendCalls): include the update in a call batch\n *\n * @example\n * ```ts\n * import { Actions, type AccountConfig } from 'viem/tempo'\n *\n * declare const currentConfig: AccountConfig.Config\n *\n * const call = Actions.accounts.updateConfig.call({\n * currentConfig,\n * nextConfig: {\n * owners: [{ owner: '0x...', weight: 1 }],\n * threshold: 1,\n * },\n * })\n * ```\n *\n * @param args - Current and replacement account configurations.\n * @returns The call.\n */\n function call(args) {\n const currentConfig = AccountConfig.from(args.currentConfig);\n const nextConfig = AccountConfig.update(currentConfig, args.nextConfig);\n return defineCall({\n address: Addresses.configurableAccount,\n abi: Abis.configurableAccount,\n args: [currentConfig, nextConfig.threshold, nextConfig.owners],\n functionName: 'updateConfig',\n });\n }\n updateConfig.call = call;\n /**\n * Extracts the `ConfigurableAccountConfigUpdated` event from logs.\n *\n * @param logs - Transaction logs.\n * @returns The configuration update event.\n */\n function extractEvent(logs) {\n const [log] = parseEventLogs({\n abi: Abis.configurableAccount,\n logs,\n eventName: 'ConfigurableAccountConfigUpdated',\n strict: true,\n });\n if (!log)\n throw new Error('`ConfigurableAccountConfigUpdated` event not found.');\n return log;\n }\n updateConfig.extractEvent = extractEvent;\n})(updateConfig || (updateConfig = {}));\n/**\n * Replaces a configurable account configuration and waits for confirmation.\n *\n * @example\n * ```ts\n * import { createWalletClient, custom, type EIP1193Provider } from 'viem'\n * import { tempo } from 'viem/chains'\n * import { Actions, type AccountConfig } from 'viem/tempo'\n *\n * declare const provider: EIP1193Provider\n * declare const currentConfig: AccountConfig.Config\n *\n * const client = createWalletClient({\n * account: '0x...',\n * chain: tempo,\n * transport: custom(provider),\n * })\n *\n * const { receipt } = await Actions.accounts.updateConfigSync(client, {\n * currentConfig,\n * nextConfig: {\n * owners: [{ owner: '0x...', weight: 1 }],\n * threshold: 1,\n * },\n * })\n * ```\n *\n * @param client - Client.\n * @param parameters - Parameters.\n * @returns The updated configuration event and transaction receipt.\n */\nexport async function updateConfigSync(client, parameters) {\n const { throwOnReceiptRevert = true, ...rest } = parameters;\n const receipt = await updateConfig.inner(writeContractSync, client, {\n ...rest,\n throwOnReceiptRevert,\n });\n if (receipt.status === 'pending')\n return { receipt };\n const { args } = updateConfig.extractEvent(receipt.logs);\n return {\n account: args.account,\n config: AccountConfig.from({\n owners: args.owners,\n salt: args.salt,\n threshold: args.threshold,\n version: args.version,\n }),\n receipt,\n };\n}\n/**\n * Upgrades an existing account to a configurable account in place\n * ([TIP-1113](https://tips.sh/1113)).\n *\n * The account keeps its address and installs `owners` and `threshold`. The\n * root key must sign the upgrade, which is sent as the transaction's only\n * call. After the upgrade, the root key can no longer sign for the account.\n *\n * @example\n * ```ts\n * import { createClient, http } from 'viem'\n * import { tempoLocalnet } from 'viem/chains'\n * import { Account, Actions } from 'viem/tempo'\n *\n * const root = Account.fromSecp256k1('0x...')\n * const client = createClient({\n * chain: tempoLocalnet,\n * transport: http(),\n * })\n *\n * const hash = await Actions.accounts.upgrade(client, {\n * account: root,\n * owners: [{ owner: '0x...', weight: 1 }],\n * threshold: 1,\n * })\n * ```\n *\n * @param client - Client.\n * @param parameters - Parameters.\n * @returns The transaction hash.\n */\nexport async function upgrade(client, parameters) {\n return upgrade.inner(writeContract, client, parameters);\n}\n(function (upgrade) {\n /** @internal */\n async function inner(action, client, parameters) {\n const { owners, threshold, ...rest } = parameters;\n for (const key of [\n 'authorizationList',\n 'calls',\n 'data',\n 'keyAuthorization',\n 'to',\n ])\n if (rest[key] !== undefined)\n throw new Error(`\\`${key}\\` is not supported: the upgrade must be the only call, without authorizations.`);\n const account = rest.account ?? client.account;\n if (typeof account === 'object') {\n if (account.source === 'configurable')\n throw new Error('The account is already a configurable account.');\n if (account.source === 'accessKey')\n throw new Error('The root key must sign the upgrade, not an access key.');\n }\n // Always send a Tempo envelope, so relays recognize and cache the upgrade.\n return (await withExecutionError(action)(client, {\n ...rest,\n ...upgrade.call({ owners, threshold }),\n type: 'tempo',\n }));\n }\n upgrade.inner = inner;\n /**\n * Defines a call to the `upgradeAccount` function.\n *\n * The call must be the only call in a transaction signed by the account's\n * root key.\n *\n * @example\n * ```ts\n * import { Actions } from 'viem/tempo'\n *\n * const call = Actions.accounts.upgrade.call({\n * owners: [{ owner: '0x...', weight: 1 }],\n * threshold: 1,\n * })\n * ```\n *\n * @param args - Owners and threshold to install.\n * @returns The call.\n */\n function call(args) {\n const { owners, threshold } = AccountConfig.from(args);\n return defineCall({\n address: Addresses.configurableAccount,\n abi: Abis.configurableAccount,\n args: [threshold, owners],\n functionName: 'upgradeAccount',\n });\n }\n upgrade.call = call;\n /**\n * Extracts the `AccountUpgraded` event from logs.\n *\n * @param logs - Transaction logs.\n * @returns The account upgrade event.\n */\n function extractEvent(logs) {\n const [log] = parseEventLogs({\n abi: Abis.configurableAccount,\n logs,\n eventName: 'AccountUpgraded',\n strict: true,\n });\n if (!log)\n throw new Error('`AccountUpgraded` event not found.');\n return log;\n }\n upgrade.extractEvent = extractEvent;\n})(upgrade || (upgrade = {}));\n/**\n * Upgrades an existing account to a configurable account in place\n * ([TIP-1113](https://tips.sh/1113)) and waits for confirmation.\n *\n * @example\n * ```ts\n * import { createClient, http } from 'viem'\n * import { tempoLocalnet } from 'viem/chains'\n * import { Account, Actions } from 'viem/tempo'\n *\n * const root = Account.fromSecp256k1('0x...')\n * const client = createClient({\n * chain: tempoLocalnet,\n * transport: http(),\n * })\n *\n * const { config } = await Actions.accounts.upgradeSync(client, {\n * account: root,\n * owners: [{ owner: '0x...', weight: 1 }],\n * threshold: 1,\n * })\n * ```\n *\n * @param client - Client.\n * @param parameters - Parameters.\n * @returns The installed configuration, its commitment, and the transaction receipt.\n */\nexport async function upgradeSync(client, parameters) {\n const { throwOnReceiptRevert = true, ...rest } = parameters;\n const receipt = await upgrade.inner(writeContractSync, client, {\n ...rest,\n throwOnReceiptRevert,\n });\n // Pending and (with `throwOnReceiptRevert: false`) reverted receipts carry no upgrade event.\n if (receipt.status !== 'success')\n return { receipt };\n const { args } = upgrade.extractEvent(receipt.logs);\n return {\n account: args.account,\n commitment: args.commitment,\n config: AccountConfig.from({\n owners: args.owners,\n salt: args.salt,\n threshold: args.threshold,\n version: 1n,\n }),\n receipt,\n };\n}\n/**\n * Verifies a configurable account signature against the account's current\n * configuration with the signature verifier precompile.\n *\n * Returns `false` when the signature is for another account or a config that\n * is not the account's current config. Throws when the signature is malformed\n * or its approvals do not reach quorum.\n *\n * @example\n * ```ts\n * import { createClient, http } from 'viem'\n * import { tempo } from 'viem/chains'\n * import { Actions } from 'viem/tempo'\n *\n * const client = createClient({\n * chain: tempo,\n * transport: http(),\n * })\n *\n * const valid = await Actions.accounts.verifyHash(client, {\n * account: '0x...',\n * hash: '0x...',\n * signature: '0x...',\n * })\n * ```\n *\n * @param client - Client.\n * @param parameters - Parameters.\n * @returns Whether the signature is valid for the account.\n */\nexport async function verifyHash(client, parameters) {\n const { account, hash, signature, ...rest } = parameters;\n return withExecutionError(readContract)(client, {\n ...rest,\n ...verifyHash.call({ account, hash, signature }),\n });\n}\n(function (verifyHash) {\n /**\n * Defines a call to the `verifyConfigurableAccount` function on the\n * signature verifier precompile.\n *\n * @param args - Arguments.\n * @returns The call.\n */\n function call(args) {\n const { account, hash, signature } = args;\n return defineCall({\n address: Addresses.signatureVerifier,\n abi: Abis.signatureVerifier,\n args: [account, hash, signature],\n functionName: 'verifyConfigurableAccount',\n });\n }\n verifyHash.call = call;\n})(verifyHash || (verifyHash = {}));\n//# sourceMappingURL=accounts.js.map","// TODO: Find opportunities to make this file less duplicated + more simplified with Viem v3.\nimport * as Hex from 'ox/Hex';\nimport { AccountOperation, Transaction as ox_Transaction, TransactionRequest as ox_TransactionRequest, } from 'ox/tempo';\nimport { parseAccount } from '../accounts/utils/parseAccount.js';\nimport { formatTransaction as viem_formatTransaction } from '../utils/formatters/transaction.js';\nimport { formatTransactionReceipt as viem_formatTransactionReceipt } from '../utils/formatters/transactionReceipt.js';\nimport { formatTransactionRequest as viem_formatTransactionRequest } from '../utils/formatters/transactionRequest.js';\nimport { isTempo, } from './Transaction.js';\nexport function formatTransaction(transaction) {\n if (!isTempo(transaction))\n return viem_formatTransaction(transaction);\n // TODO: upstream `blockTimestamp` formatting into `ox`.\n const blockTimestamp = transaction.blockTimestamp == null\n ? undefined\n : BigInt(transaction.blockTimestamp);\n const operation = transaction.operation;\n const { feePayerSignature, gasPrice: _, nonce, ...tx } = ox_Transaction.fromRpc(transaction);\n return {\n ...tx,\n accessList: tx.accessList,\n ...(typeof blockTimestamp !== 'undefined' && { blockTimestamp }),\n feePayerSignature: feePayerSignature\n ? {\n r: Hex.fromNumber(feePayerSignature.r, { size: 32 }),\n s: Hex.fromNumber(feePayerSignature.s, { size: 32 }),\n v: BigInt(feePayerSignature.v ?? 27),\n yParity: feePayerSignature.yParity,\n }\n : undefined,\n nonce: Number(nonce),\n operation: formatOperation(operation),\n typeHex: ox_Transaction.toRpcType[tx.type],\n type: tx.type,\n };\n}\nexport function formatTransactionReceipt(receipt) {\n const transactionReceipt = viem_formatTransactionReceipt(receipt);\n return {\n ...transactionReceipt,\n operation: formatOperation(receipt.operation),\n ...(receipt.status === 'pending'\n ? { status: 'pending', type: 'tempo' }\n : {}),\n };\n}\n/** Formats a transaction operation attached to an RPC result. */\nfunction formatOperation(value) {\n if (!value)\n return undefined;\n const operation = AccountOperation.fromRpc(value);\n if (operation.type !== 'transaction')\n throw new Error('Expected an account transaction operation.');\n return operation;\n}\nexport function formatTransactionRequest(r, action) {\n const request = r;\n const account = request.account\n ? parseAccount(request.account)\n : undefined;\n const owner = request.owner\n ? parseAccount(request.owner)\n : undefined;\n if (owner?.type === 'json-rpc')\n throw new Error('A local owner account is required to approve a configurable account transaction.');\n // If the request is not a Tempo transaction, route to Viem formatter.\n if (!isTempo(request))\n return viem_formatTransactionRequest(r, action);\n if (action)\n request.calls = request.calls ?? [\n {\n to: r.to ||\n (!r.data || r.data === '0x'\n ? '0x0000000000000000000000000000000000000000'\n : undefined),\n value: r.value,\n data: r.data,\n },\n ];\n // If we have marked the transaction as intended to be paid by a fee\n // payer (feePayer: true), we strip the fee token from the sender's\n // sign payload — per TIP-76 the sender does not commit to it; the fee\n // payer chooses and commits to the token via its own signature.\n //\n // Once the fee payer has signed (`feePayerSignature` is populated),\n // the relay has chosen a token and signed over it. The broadcast\n // envelope must therefore include `feeToken` so the chain can verify\n // the fee payer's signature and identify which token to charge.\n if (request.feePayer === true && !request.feePayerSignature)\n delete request.feeToken;\n // Client-only TIP-1107 fields drive local signing and envelope assembly.\n const { owner: _owner, signatures: _signatures, ...rpcRequest } = request;\n const rpc = ox_TransactionRequest.toRpc({\n ...rpcRequest,\n type: 'tempo',\n });\n if (action === 'estimateGas') {\n rpc.maxFeePerGas = undefined;\n rpc.maxPriorityFeePerGas = undefined;\n }\n rpc.to = undefined;\n rpc.data = undefined;\n rpc.value = undefined;\n const signer = owner ?? account;\n const [keyType, keyData] = (() => {\n const type = signer && 'keyType' in signer ? signer.keyType : signer?.source;\n if (!type)\n return [request.keyType, shimKeyData(request.keyData)];\n if (type === 'webAuthn')\n // Send a 2-byte big-endian length hint (1400 = 0x0578) instead of a\n // 1400-byte dummy blob. The node's gas estimator expects key_data to\n // be 1, 2, or 4 bytes encoding the desired WebAuthn signature size;\n // anything else falls back to the 800-byte default.\n return ['webAuthn', '0x0578'];\n if (['p256', 'secp256k1'].includes(type))\n return [type, undefined];\n return [request.keyType, shimKeyData(request.keyData)];\n })();\n const keyId = signer && 'accessKeyAddress' in signer\n ? signer.accessKeyAddress\n : request.keyId;\n if (account)\n rpc.from = account.address;\n return {\n ...rpc,\n ...(request.capabilities ? { capabilities: request.capabilities } : {}),\n ...(keyData ? { keyData } : {}),\n ...(keyId ? { keyId } : {}),\n ...(keyType ? { keyType } : {}),\n // Keep client-only keys visible to `extract`; undefined values never reach JSON-RPC.\n ...(request.accountSimulation ? { accountSimulation: undefined } : {}),\n ...(request.owner ? { owner: undefined } : {}),\n ...(typeof request.feePayer !== 'undefined'\n ? {\n feePayer: typeof request.feePayer === 'object'\n ? parseAccount(request.feePayer)\n : request.feePayer,\n }\n : {}),\n ...('feePayerSignature' in request &&\n request.feePayerSignature !== undefined\n ? { feePayerSignature: request.feePayerSignature }\n : {}),\n };\n}\n/**\n * Auto-shim user-provided keyData that is longer than 4 bytes into a\n * 2-byte big-endian length hint. The node gas estimator only accepts\n * 1, 2, or 4-byte key_data as a size hint; anything else silently falls\n * back to the 800-byte default.\n */\nfunction shimKeyData(data) {\n if (!data)\n return data;\n const byteLength = (data.length - 2) / 2; // subtract \"0x\" prefix\n if (byteLength <= 4)\n return data;\n return Hex.fromNumber(byteLength, { size: 2 });\n}\n//# sourceMappingURL=Formatters.js.map","const concurrentCounts = new Map();\n/**\n * Detects if there are concurrent tasks occuring for a given key\n * within the same event loop tick. Registers the request, yields to allow\n * other concurrent calls to register, then returns whether multiple requests\n * were detected.\n *\n * @example\n * ```ts\n * const isConcurrent = await Concurrent.detect(address)\n * ```\n */\nexport async function detect(key) {\n concurrentCounts.set(key, (concurrentCounts.get(key) ?? 0) + 1);\n await Promise.resolve();\n const isConcurrent = (concurrentCounts.get(key) ?? 0) > 1;\n queueMicrotask(() => {\n const count = concurrentCounts.get(key) ?? 0;\n if (count <= 1)\n concurrentCounts.delete(key);\n else\n concurrentCounts.set(key, count - 1);\n });\n return isConcurrent;\n}\n//# sourceMappingURL=concurrent.js.map","import * as Hex from 'ox/Hex';\nimport { TxEnvelopeTempo } from 'ox/tempo';\nimport { maxUint256 } from '../../constants/number.js';\nimport { isAddressEqual } from '../../utils/address/isAddressEqual.js';\nimport { keccak256 } from '../../utils/hash/keccak256.js';\n/**\n * Tempo transaction replacement semantics.\n *\n * - Protocol nonces (nonce key `0`, including Ethereum transaction types) and\n * 2D nonces occupy the sender's `(nonceKey, nonce)` slot.\n * - Expiring nonces are deduplicated by their expiring nonce hash, so a\n * transaction is replaced only by another carrying the same sender payload\n * (e.g. re-sponsored with a different fee payer signature or fee token).\n */\nexport const transactionReplacement = {\n getKey(transaction) {\n const tx = transaction;\n if (tx.type !== 'tempo')\n return `0:${tx.nonce}`;\n const nonceKey = tx.nonceKey ?? 0n;\n if (nonceKey === maxUint256)\n return `expiring:${getExpiringNonceHash(tx)}`;\n return `${nonceKey}:${tx.nonce}`;\n },\n getReason({ replaced, replacement }) {\n return getReason(replaced, replacement);\n },\n};\n/**\n * Returns the expiring nonce hash of a Tempo transaction:\n * `keccak256(encodeForSigning(tx) || sender)`. It excludes the fee payer\n * signature and fee token, so it is invariant to sponsorship.\n *\n * @internal\n */\nexport function getExpiringNonceHash(transaction) {\n const tx = transaction;\n const envelope = TxEnvelopeTempo.from({\n accessList: tx.accessList,\n authorizationList: tx.authorizationList,\n calls: tx.calls,\n chainId: tx.chainId,\n feePayerSignature: tx.feePayerSignature ? null : undefined,\n feeToken: tx.feeToken,\n gas: tx.gas,\n keyAuthorization: tx.keyAuthorization ?? undefined,\n maxFeePerGas: tx.maxFeePerGas,\n maxPriorityFeePerGas: tx.maxPriorityFeePerGas,\n nonce: BigInt(tx.nonce),\n nonceKey: tx.nonceKey,\n validAfter: tx.validAfter,\n validBefore: tx.validBefore,\n });\n return keccak256(Hex.concat(TxEnvelopeTempo.encodeForSigning(envelope), tx.from));\n}\nfunction getReason(replaced, replacement) {\n const calls = getCalls(replacement);\n const replacedCalls = getCalls(replaced);\n if (calls.length === replacedCalls.length &&\n calls.every((call, i) => isSameCall(call, replacedCalls[i])))\n return 'repriced';\n if (calls.every((call) => call.to &&\n isAddressEqual(call.to, replacement.from) &&\n !call.value &&\n isEmpty(call.data)))\n return 'cancelled';\n return 'replaced';\n}\nfunction getCalls(transaction) {\n if (transaction.type === 'tempo')\n return transaction.calls;\n return [\n { data: transaction.input, to: transaction.to, value: transaction.value },\n ];\n}\nfunction isSameCall(a, b) {\n return ((a.to && b.to ? isAddressEqual(a.to, b.to) : !a.to && !b.to) &&\n (a.value ?? 0n) === (b.value ?? 0n) &&\n (isEmpty(a.data) ? isEmpty(b.data) : a.data === b.data));\n}\nfunction isEmpty(data) {\n return !data || data === '0x';\n}\n//# sourceMappingURL=replacement.js.map","import * as Hex from 'ox/Hex';\nimport { AccountConfig, AccountOperation, SignatureEnvelope, } from 'ox/tempo';\nimport { getCode } from '../actions/public/getCode.js';\nimport { getTransaction } from '../actions/public/getTransaction.js';\nimport { readContract } from '../actions/public/readContract.js';\nimport { verifyHash } from '../actions/public/verifyHash.js';\nimport { maxUint256 } from '../constants/number.js';\nimport { BaseError } from '../errors/base.js';\nimport { ContractFunctionRevertedError } from '../errors/contract.js';\nimport { isAddressEqual } from '../utils/address/isAddressEqual.js';\nimport { extendSchema } from '../utils/chain/defineChain.js';\nimport { defineTransaction } from '../utils/formatters/transaction.js';\nimport { defineTransactionReceipt } from '../utils/formatters/transactionReceipt.js';\nimport { defineTransactionRequest } from '../utils/formatters/transactionRequest.js';\nimport { getAction } from '../utils/getAction.js';\nimport { keccak256 } from '../utils/hash/keccak256.js';\nimport { getMetadata } from './actions/accessKey.js';\nimport { getConfig, verifyHash as verifyConfigurableAccount, } from './actions/accounts.js';\nimport * as Formatters from './Formatters.js';\nimport * as Concurrent from './internal/concurrent.js';\nimport { transactionReplacement } from './internal/replacement.js';\nimport * as Transaction from './Transaction.js';\nconst maxExpirySecs = 25;\n// TODO: casting to satisfy viem – viem v3 to have more flexible serializer type.\nconst serializeTransaction = ((transaction, signature) => Transaction.serialize(transaction, signature));\nexport const chainConfig = {\n blockTime: 1_000,\n extendSchema: extendSchema(),\n formatters: {\n transaction: defineTransaction({\n exclude: ['aaAuthorizationList'],\n format: Formatters.formatTransaction,\n }),\n transactionReceipt: defineTransactionReceipt({\n format: Formatters.formatTransactionReceipt,\n }),\n transactionRequest: defineTransactionRequest({\n format: Formatters.formatTransactionRequest,\n }),\n },\n prepareTransactionRequest: [\n async (r, { client, phase }) => {\n const request = r;\n if (request.hash) {\n if (!request.account ||\n typeof request.account === 'string' ||\n request.account.source !== 'configurable')\n throw new Error('A local configurable account is required to approve a stored configurable account transaction.');\n if (!request.owner || typeof request.owner === 'string')\n throw new Error('A local owner account is required to approve a stored configurable account transaction.');\n if (request.owner.source !== 'root')\n throw new Error('A Tempo owner account is required to approve a stored configurable account transaction.');\n const transaction = await getAction(client, getTransaction, 'getTransaction')({ hash: request.hash });\n const operation = 'operation' in transaction\n ? transaction.operation\n : undefined;\n if (!operation)\n throw new Error('Expected an account operation transaction.');\n if (!isAddressEqual(operation.account, request.account.address))\n throw new Error('Account operation account does not match the requested account.');\n const storedTransaction = Transaction.deserialize(operation.transaction);\n const hash = AccountOperation.getHash({\n account: operation.account,\n config: operation.config,\n transaction: operation.transaction,\n type: 'transaction',\n });\n if (hash.toLowerCase() !== request.hash.toLowerCase())\n throw new Error('Account operation hash does not match transaction.');\n return {\n ...storedTransaction,\n // Serialized zero values must not trigger a new fill of an approved transaction.\n gas: storedTransaction.gas ?? 0n,\n maxFeePerGas: storedTransaction.maxFeePerGas ?? 0n,\n maxPriorityFeePerGas: storedTransaction.maxPriorityFeePerGas ?? 0n,\n account: request.account,\n from: operation.account,\n accountSimulation: getAccountSimulation({\n config: operation.config,\n local: request.account,\n }),\n owner: request.owner,\n };\n }\n // FIXME: node estimates gas with secp256k1 dummy sig + null feePayerSignature.\n // Actual tx has larger keychain/webAuthn sigs + real fee payer sig, costing more intrinsic gas.\n if (phase === 'afterFillParameters') {\n // Fee payer signature covers the gas limit, so the relay must set it before signing and Viem must not change it afterward.\n if (typeof request.gas !== 'undefined' &&\n request.feePayer &&\n !request.feePayerSignature) {\n if (request.keyAuthorization?.signature.type === 'webAuthn')\n request.gas = (request.gas ?? 0n) + 20000n;\n else if (request.account?.source === 'accessKey')\n request.gas = (request.gas ?? 0n) + 10000n;\n }\n return request;\n }\n const configurableIdentity = (() => {\n if (request.account?.source === 'configurable')\n return {\n account: request.account.address,\n config: request.account.config,\n local: request.account,\n };\n return undefined;\n })();\n if (request.owner && !configurableIdentity)\n throw new Error('A configurable account is required when an owner is provided.');\n if (request.owner && typeof request.owner === 'string')\n throw new Error('A local owner account is required to approve a configurable account transaction.');\n if (request.owner && request.owner.source !== 'root')\n throw new Error('A Tempo owner account is required to approve a configurable account transaction.');\n const coordinated = !!configurableIdentity &&\n !!request.owner &&\n client.transport.accounts === true;\n if (configurableIdentity) {\n const { account, local } = configurableIdentity;\n if (!account)\n throw new Error('A configurable account address is required with a current config.');\n const config = await (async () => {\n if (configurableIdentity.config)\n return configurableIdentity.config;\n if (!coordinated)\n return undefined;\n const cachedConfig = await getAction(client, getConfig, 'getConfig')({ address: account });\n if (!cachedConfig)\n throw new Error(`No current account config is cached for account ${account}. Provide the current config.`);\n return cachedConfig;\n })();\n if (!config)\n throw new Error('An account config is required to prepare a transaction.');\n request.from = account;\n request.accountSimulation = getAccountSimulation({\n config,\n local,\n });\n }\n // Register concurrency before account preparation performs storage or\n // network I/O so overlapping requests cannot miss each other.\n const useExpiringNonce = await (async () => {\n if (request.nonceKey === 'expiring' || request.nonceKey === maxUint256)\n return true;\n if (typeof request.nonceKey !== 'undefined')\n return false;\n if (configurableIdentity)\n return false;\n if (request.feePayer && typeof request.nonceKey === 'undefined')\n return true;\n const account = request.account;\n const address = typeof account === 'string' ? account : account?.address;\n if (address && typeof request.nonceKey === 'undefined')\n return await Concurrent.detect(address.toLowerCase());\n return false;\n })();\n if (coordinated && typeof request.nonceKey === 'undefined') {\n // A random nonce lane lets a stored approval ceremony remain valid\n // indefinitely without blocking other pending operations.\n request.nonceKey = Hex.toBigInt(Hex.random(31)) + 1n;\n request.nonce = 0;\n }\n else if (useExpiringNonce) {\n request.nonceKey = maxUint256;\n request.nonce ??= 0;\n if (typeof request.validAfter === 'undefined')\n request.validAfter = randomValidAfter();\n if (typeof request.validBefore === 'undefined')\n request.validBefore = Math.floor(Date.now() / 1000) + maxExpirySecs;\n }\n else if (typeof request.nonceKey !== 'undefined') {\n request.nonce = typeof request.nonce === 'number' ? request.nonce : 0;\n }\n if (!request.keyAuthorization &&\n request.account?.source === 'accessKey') {\n const keyAuthorizationManager = request.account.keyAuthorizationManager;\n if (keyAuthorizationManager) {\n const chainId = request.chainId ?? request.chain?.id;\n if (typeof chainId !== 'undefined') {\n const address = request.account.address;\n const accessKey = request.account.accessKeyAddress;\n const key = { address, accessKey, chainId };\n const keyAuthorization = await keyAuthorizationManager.get(key);\n if (keyAuthorization) {\n const now = BigInt(Math.floor(Date.now() / 1000));\n if (keyAuthorization.expiry != null &&\n BigInt(keyAuthorization.expiry) <= now) {\n await keyAuthorizationManager.remove(key);\n }\n else {\n const metadata = await getAction(client, getMetadata, 'getMetadata')({ account: address, accessKey });\n if (isAddressEqual(metadata.address, accessKey) &&\n !metadata.isRevoked &&\n metadata.expiry > now)\n await keyAuthorizationManager.remove(key);\n else\n request.keyAuthorization = keyAuthorization;\n }\n }\n }\n }\n }\n if (!request.feeToken && request.chain?.feeToken)\n request.feeToken = request.chain.feeToken;\n return request;\n },\n { runAt: ['beforeFillTransaction', 'afterFillParameters'] },\n ],\n serializers: {\n transaction: serializeTransaction,\n async transactionEnvelope({ serializedTransaction, transaction }) {\n const request = transaction;\n if (!request.accountSimulation)\n return serializedTransaction;\n try {\n SignatureEnvelope.deserialize(serializedTransaction);\n }\n catch {\n const transaction = Transaction.deserialize(serializedTransaction);\n if (transaction.signature?.type === 'configurable')\n return serializedTransaction;\n throw new Error('A Tempo owner account is required to approve a configurable account transaction.');\n }\n return await serializeTransaction({\n ...request,\n signatures: [...(request.signatures ?? []), serializedTransaction],\n });\n },\n },\n transactionReplacement,\n async verifyHash(client, parameters) {\n const { address, hash, signature, mode } = parameters;\n const serialized = (() => {\n if (typeof signature === 'string')\n return signature;\n if (signature instanceof Uint8Array)\n return Hex.fromBytes(signature);\n return undefined;\n })();\n const envelope = (() => {\n if (!serialized)\n return;\n try {\n return SignatureEnvelope.deserialize(serialized);\n }\n catch {\n return undefined;\n }\n })();\n // `verifyHash` supports \"signature envelopes\" (a Tempo proposal) to natively verify arbitrary\n // envelope-compatible (WebAuthn, P256, etc.) signatures.\n if (envelope) {\n // Access key (keychain) signature verification: check the key is\n // authorized, not expired, and not revoked on the AccountKeychain.\n if (envelope?.type === 'keychain' && mode === 'allowAccessKey') {\n // For v2 keychain envelopes, the inner signature signs\n // keccak256(0x04 || hash || userAddress).\n const innerPayload = envelope.version === 'v2'\n ? keccak256(Hex.concat('0x04', hash, address))\n : hash;\n const accessKeyAddress = (() => {\n try {\n return SignatureEnvelope.extractAddress({\n payload: innerPayload,\n signature: envelope.inner,\n });\n }\n catch {\n return undefined;\n }\n })();\n if (!accessKeyAddress)\n return false;\n const keyInfo = await getMetadata(client, {\n account: address,\n accessKey: accessKeyAddress,\n blockHash: parameters.blockHash,\n blockNumber: parameters.blockNumber,\n blockTag: parameters.blockTag,\n requireCanonical: parameters.requireCanonical,\n });\n if (keyInfo.isRevoked)\n return false;\n if (keyInfo.expiry <= BigInt(Math.floor(Date.now() / 1000)))\n return false;\n return SignatureEnvelope.verify(envelope.inner, {\n address: accessKeyAddress,\n payload: innerPayload,\n });\n }\n // Configurable account signatures are verified against the account's\n // current config commitment, which only the chain knows.\n // Reverts (malformed signatures or approvals below quorum) are invalid signatures.\n if (envelope.type === 'configurable')\n return await readContract(client, {\n blockHash: parameters.blockHash,\n blockNumber: parameters.blockNumber,\n blockTag: parameters.blockTag,\n requireCanonical: parameters.requireCanonical,\n ...verifyConfigurableAccount.call({\n account: address,\n hash,\n signature: serialized,\n }),\n }).catch((error) => {\n if (error instanceof BaseError &&\n error.walk((cause) => cause instanceof ContractFunctionRevertedError))\n return false;\n throw error;\n });\n // Stateless, non-keychain signature envelopes (P256, WebAuthn) can be\n // verified directly without a network request.\n if (envelope.type === 'p256' || envelope.type === 'webAuthn') {\n const code = await getCode(client, {\n address,\n blockHash: parameters.blockHash,\n blockNumber: parameters.blockNumber,\n blockTag: parameters.blockTag,\n requireCanonical: parameters.requireCanonical,\n });\n // Check if EOA, if not, we want to go down the ERC-1271 flow.\n if (\n // not a contract (EOA)\n !code ||\n // default delegation (tempo EOA)\n code === '0xef01007702c00000000000000000000000000000000000')\n return SignatureEnvelope.verify(envelope, {\n address,\n payload: hash,\n });\n }\n }\n return await getAction(client, verifyHash, 'verifyHash')({ ...parameters, chain: null });\n },\n};\n/** Builds a bounded account spec for gas simulation. */\nfunction getAccountSimulation(options) {\n const { config, local } = options;\n return {\n approvals: selectOwners(config).map((owner) => {\n const localOwner = local?.owners.find((account) => isAddressEqual(account.address, owner.owner));\n return {\n ...getSimulationKey(localOwner),\n owner: owner.owner,\n };\n }),\n config,\n };\n}\n/** Returns signature metadata for conservative gas estimation. */\nfunction getSimulationKey(account) {\n const keyType = (() => {\n if (account &&\n typeof account === 'object' &&\n 'keyType' in account &&\n typeof account.keyType === 'string')\n return account.keyType;\n return undefined;\n })();\n if (!keyType || keyType === 'webAuthn')\n return { keyData: '0x0578', keyType: 'webAuthn' };\n if (keyType === 'p256' || keyType === 'secp256k1')\n return { keyType };\n return { keyData: '0x0578', keyType: 'webAuthn' };\n}\n/** Returns random past seconds to distinguish otherwise-identical expiring transactions. */\nfunction randomValidAfter() {\n const now = BigInt(Math.floor(Date.now() / 1_000));\n const latest = now - 60n;\n if (latest <= 0n)\n return 0;\n return Number(BigInt(Hex.random(8)) % latest);\n}\n/** Selects a deterministic minimum-cardinality owner quorum. */\nfunction selectOwners(config) {\n const owners = [...config.owners].sort((a, b) => Number(b.weight) - Number(a.weight) ||\n a.owner.toLowerCase().localeCompare(b.owner.toLowerCase()));\n const selected = [];\n let weight = 0;\n for (const owner of owners.slice(0, AccountConfig.maxSignatures)) {\n if (weight >= Number(config.threshold))\n break;\n selected.push(owner);\n weight += Number(owner.weight);\n }\n return selected.sort((a, b) => a.owner.toLowerCase().localeCompare(b.owner.toLowerCase()));\n}\n//# sourceMappingURL=chainConfig.js.map","import { chainConfig } from '../../tempo/chainConfig.js';\nimport { defineChain } from '../../utils/chain/defineChain.js';\nexport const tempo = /*#__PURE__*/ defineChain({\n ...chainConfig,\n id: 4217,\n blockExplorers: {\n default: {\n name: 'Tempo Explorer',\n url: 'https://explore.tempo.xyz',\n },\n },\n contracts: {\n earnFactory: {\n address: '0x3085A8003f340CD51C72D9e1a1298CDafB171B02',\n },\n erc4626EngineFactory: {\n address: '0xd43D00981222a8db444A528E69f19E3cE5A7D2Ff',\n },\n },\n name: 'Tempo Mainnet',\n nativeCurrency: {\n name: 'USD',\n symbol: 'USD',\n decimals: 6,\n },\n rpcUrls: {\n default: {\n http: ['https://rpc.tempo.xyz'],\n webSocket: ['wss://rpc.tempo.xyz'],\n },\n },\n});\n//# sourceMappingURL=tempo.js.map","import { chainConfig } from '../../tempo/chainConfig.js';\nimport { defineChain } from '../../utils/chain/defineChain.js';\nexport const tempoDevnet = /*#__PURE__*/ defineChain({\n ...chainConfig,\n id: 31318,\n name: 'Tempo Devnet',\n hardfork: 't3',\n blockExplorers: {\n default: {\n name: 'Tempo Explorer',\n url: 'https://explore.devnet.tempo.xyz',\n },\n },\n nativeCurrency: {\n name: 'USD',\n symbol: 'USD',\n decimals: 6,\n },\n rpcUrls: {\n default: {\n http: ['https://rpc.devnet.tempoxyz.dev'],\n webSocket: ['wss://rpc.devnet.tempoxyz.dev'],\n },\n },\n testnet: true,\n});\n//# sourceMappingURL=tempoDevnet.js.map","import { chainConfig } from '../../tempo/chainConfig.js';\nimport { defineChain } from '../../utils/chain/defineChain.js';\nexport const tempoLocalnet = /*#__PURE__*/ defineChain({\n ...chainConfig,\n id: 1337,\n name: 'Tempo',\n hardfork: 't3',\n nativeCurrency: {\n name: 'USD',\n symbol: 'USD',\n decimals: 6,\n },\n rpcUrls: {\n default: { http: ['http://localhost:8545'] },\n },\n});\n//# sourceMappingURL=tempoLocalnet.js.map","import { chainConfig } from '../../tempo/chainConfig.js';\nimport { defineChain } from '../../utils/chain/defineChain.js';\nexport const tempoModerato = /*#__PURE__*/ defineChain({\n ...chainConfig,\n id: 42431,\n hardfork: 't5',\n blockExplorers: {\n default: {\n name: 'Tempo Explorer',\n url: 'https://explore.testnet.tempo.xyz',\n },\n },\n contracts: {\n earnFactory: {\n address: '0x1de6B233984583F4d936ae4265f3b60282b70cc6',\n },\n erc4626EngineFactory: {\n address: '0x0d57c10249eb3a92b7d81bBA6221F80F2865448A',\n },\n },\n name: 'Tempo Testnet (Moderato)',\n nativeCurrency: {\n name: 'USD',\n symbol: 'USD',\n decimals: 6,\n },\n rpcUrls: {\n default: {\n http: ['https://rpc.moderato.tempo.xyz'],\n webSocket: ['wss://rpc.moderato.tempo.xyz'],\n },\n },\n testnet: true,\n});\n//# sourceMappingURL=tempoModerato.js.map","/**\n * The Tempo chains whose balances Tempo ID reads, by the name in the `chain` parameter: `mainnet`,\n * `testnet`, or a name that `RPC_URLS` lists.\n * @module\n */\nimport {\n tempo,\n tempoDevnet,\n tempoLocalnet,\n tempoTestnet,\n} from 'viem/tempo/chains'\nimport { z } from 'zod'\nimport * as Log from './Log.js'\n\n/**\n * `RPC_URLS` or `TEMPO_API_URLS` holds an entry that does not parse. The message names the entry by\n * position only, since a URL can hold a key.\n */\nexport class InvalidListError extends Error {\n override readonly name = 'Chain.InvalidListError'\n\n constructor(options: InvalidListError.Options) {\n super(\n `Invalid ${options.variable} entry ${options.index + 1}: ${options.reason}. Write each entry as \\`name:chainId=url\\`, such as \\`local:1337=http://localhost:8545\\`, and separate entries with commas.`,\n )\n }\n}\n\nexport declare namespace InvalidListError {\n type Options = {\n /** From 0. */\n index: number\n /** What the entry gets wrong. */\n reason: string\n /** The variable that holds the entry. */\n variable: list.Variable\n }\n}\n\n/** Each built-in chain's ID, by its name. */\nexport const ids = { mainnet: tempo.id, testnet: tempoTestnet.id } as const\n\n/** The Tempo chains whose tokens Tempo ID knows. A listed RPC URL serves one of them. */\nexport const known = [tempo, tempoTestnet, tempoDevnet, tempoLocalnet]\n\n/** A chain's name: up to 32 lowercase letters, digits, and dashes. */\nexport const schema = z.string().regex(/^[a-z0-9][a-z0-9-]{0,31}$/)\n\n/** A chain's name: `mainnet`, `testnet`, or a listed entry's name. */\nexport type Chain = z.output<typeof schema>\n\n/** A chain that `RPC_URLS` lists. */\nexport type Entry = {\n /** The Tempo chain that the node serves. */\n chainId: number\n /** The name in the `chain` parameter. */\n name: string\n /** The node's RPC URL, which can hold a provider's key. */\n url: string\n}\n\n/**\n * Returns the chains that a `RPC_URLS` value lists, in order, from comma-separated\n * `name:chainId=url` entries. An entry named `mainnet` or `testnet` replaces that chain's RPC URL.\n *\n * @throws {InvalidListError} When an entry does not parse, repeats a name, gives a built-in name\n * another chain's ID, or names a chain that is not a Tempo chain.\n */\nexport function list(options: list.Options): readonly Entry[] {\n const { variable = 'RPC_URLS' } = options\n const entries: Entry[] = []\n const parts = (options.value ?? '')\n .split(',')\n .map((part) => part.trim())\n .filter(Boolean)\n\n for (const [index, part] of parts.entries()) {\n // The URL can hold `=` and `:` itself, so the first `=` ends the name and the chain ID.\n const split = part.indexOf('=')\n const head = split === -1 ? part : part.slice(0, split)\n const url = split === -1 ? '' : part.slice(split + 1).trim()\n const [name = '', id = ''] = head.split(':').map((value) => value.trim())\n const chainId = Number(id)\n\n if (!schema.safeParse(name).success)\n throw new InvalidListError({\n index,\n reason:\n 'the name needs lowercase letters, digits, and dashes, up to 32 characters',\n variable,\n })\n if (name in ids && chainId !== ids[name as keyof typeof ids])\n throw new InvalidListError({\n index,\n reason: `\\`${name}\\` is chain ${ids[name as keyof typeof ids]}`,\n variable,\n })\n if (entries.some((entry) => entry.name === name))\n throw new InvalidListError({\n index,\n reason: `\\`${name}\\` repeats an earlier entry`,\n variable,\n })\n if (!known.some((chain) => chain.id === chainId))\n throw new InvalidListError({\n index,\n // The segment can hold a URL's key when the entry has no `=`, so only digits are named.\n reason: /^\\d+$/.test(id)\n ? `\\`${id}\\` is not a Tempo chain ID, such as ${tempoLocalnet.id}`\n : `the chain ID needs digits, such as ${tempoLocalnet.id}`,\n variable,\n })\n if (!URL.canParse(url) || !/^https?:$/.test(new URL(url).protocol))\n throw new InvalidListError({\n index,\n reason: 'the URL needs http or https',\n variable,\n })\n\n entries.push({ chainId, name, url })\n }\n\n return entries\n}\n\nexport declare namespace list {\n type Options = {\n /** The variable's value. */\n value: string | undefined\n /** The variable that errors name. Defaults to `RPC_URLS`. */\n variable?: Variable | undefined\n }\n\n /** A variable that lists chains in the `name:chainId=url` format. */\n type Variable = 'RPC_URLS' | 'TEMPO_API_URLS'\n}\n\n/** The Tempo API of the built-in chains, which limits requests without a key. */\nconst defaultApiUrl = 'https://api.tempo.xyz'\n\n/**\n * Returns the Tempo API URL that `TEMPO_API_URLS` lists for `chainId`, else {@link defaultApiUrl}\n * for a built-in chain. `none` turns the API off. A list that does not parse logs a warning, and\n * returns `undefined`.\n */\nexport function apiUrl(options: apiUrl.Options) {\n if (options.apiUrls?.trim() === 'none') return undefined\n const builtIn = Object.values(ids).some((id) => id === options.chainId)\n\n try {\n const entry = list({\n value: options.apiUrls,\n variable: 'TEMPO_API_URLS',\n }).find((candidate) => candidate.chainId === options.chainId)\n return entry?.url ?? (builtIn ? defaultApiUrl : undefined)\n } catch (error) {\n if (!(error instanceof InvalidListError)) throw error\n Log.warn({ error, message: 'TEMPO_API_URLS does not parse.' })\n return undefined\n }\n}\n\nexport declare namespace apiUrl {\n type Options = {\n /** The value of `TEMPO_API_URLS`. */\n apiUrls: string | undefined\n /** The chain's ID. */\n chainId: number\n }\n}\n\n/**\n * Returns the name that `GET /v1/chains` lists for `chainId`: `mainnet`, `testnet`, or the first\n * `RPC_URLS` entry with that ID. Returns `undefined` when none does, or `rpcUrls` does not parse.\n */\nexport function name(options: name.Options) {\n const builtIn = (Object.keys(ids) as (keyof typeof ids)[]).find(\n (key) => ids[key] === options.chainId,\n )\n if (builtIn) return builtIn\n\n try {\n return list({ value: options.rpcUrls }).find(\n (entry) => entry.chainId === options.chainId,\n )?.name\n } catch (error) {\n if (!(error instanceof InvalidListError)) throw error\n return undefined\n }\n}\n\nexport declare namespace name {\n type Options = {\n /** The chain's ID. */\n chainId: number\n /** The value of `RPC_URLS`. */\n rpcUrls: string | undefined\n }\n}\n\n/**\n * Returns the chain ID and RPC URL of the chain `name`, or `undefined` for an unknown name. A listed\n * URL applies first, then `rpcUrl` for a built-in chain, then the chain's public RPC URL.\n *\n * @throws {InvalidListError} When `rpcUrls` does not parse and `name` is not built in.\n */\nexport function resolve(options: resolve.Options) {\n const { name } = options\n if (name === 'mainnet' || name === 'testnet')\n return {\n chainId: ids[name],\n rpcUrl:\n override({ chainId: ids[name], rpcUrls: options.rpcUrls }) ??\n options.rpcUrl,\n }\n\n const entry = list({ value: options.rpcUrls }).find(\n (candidate) => candidate.name === name,\n )\n if (!entry) return undefined\n return { chainId: entry.chainId, rpcUrl: entry.url }\n}\n\nexport declare namespace resolve {\n type Options = {\n /** The chain's name. */\n name: Chain\n /** `TEMPO_RPC_URL`, for each built-in chain that `rpcUrls` does not list. */\n rpcUrl: string | undefined\n /** The value of `RPC_URLS`. */\n rpcUrls: string | undefined\n }\n\n type ReturnType =\n | {\n /** The chain's ID. */\n chainId: number\n /** The RPC URL, or `undefined` for the chain's own. */\n rpcUrl: string | undefined\n }\n | undefined\n}\n\n/**\n * Returns the URL that a `RPC_URLS` entry gives the built-in chain `chainId`, or `undefined`. A list\n * that does not parse logs a warning, so built-in chains still read.\n */\nexport function override(options: override.Options) {\n const name = (Object.keys(ids) as (keyof typeof ids)[]).find(\n (key) => ids[key] === options.chainId,\n )\n if (!name) return undefined\n\n try {\n return list({ value: options.rpcUrls }).find((entry) => entry.name === name)\n ?.url\n } catch (error) {\n if (!(error instanceof InvalidListError)) throw error\n Log.warn({ error, message: 'RPC_URLS does not parse.' })\n return undefined\n }\n}\n\nexport declare namespace override {\n type Options = {\n /** The chain's ID. */\n chainId: number\n /** The value of `RPC_URLS`. */\n rpcUrls: string | undefined\n }\n}\n"],"ignoreList":[0,1,2,3,4,5,6,7,8,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32],"mappings":"A,ykCA+CA,SAAgBA,GAAK,EAAe,EAAU,CAAC,EAAG,CAG9C,OAFI,OAAO2R,EAAc,SAAY,SAC1B1R,GAAQ0R,CAAa,EACzB,CAAE,GAAGA,EAAe,GAAGE,EAAQ,SAAU,CACpD,CAqBA,SAAgB5R,GAAQ,EAAe,CACnC,GAAM,CAAE,UAAS,UAAS,SAAU0R,EAC9BG,EAAY5R,GAAkByR,CAAa,EACjD,MAAO,CACH,UACA,QAAS,OAAOI,CAAO,EACvB,MAAO,OAAOC,CAAK,EACnB,GAAGF,CACP,CACJ,CAqBA,SAAgBG,GAAY,EAAmB,CAC3C,OAAOC,EAAkB,IAAIjS,EAAO,CACxC,CAyMA,SAAgBE,GAAM,EAAe,CACjC,GAAM,CAAE,UAAS,UAAS,QAAO,GAAG2R,GAAcH,EAClD,MAAO,CACH,UACA,QAASvR,EAAe2R,CAAO,EAC/B,MAAO3R,EAAe4R,CAAK,EAC3B,GAAG3R,GAAgByR,CAAS,CAChC,CACJ,CAqBA,SAAgBM,GAAU,EAAmB,CACzC,OAAOF,EAAkB,IAAI/R,EAAK,CACtC,CCxUA,SAAgBkS,EAAc,EAAO,EAAS,CAG1C,OAFI,OAAOC,GAAU,SACVA,EACJhS,EAAegS,EAAOT,CAAO,CACxC,CCNA,IAAaU,EAAQ,CAAE,QAAS,EAAG,OAAQ,EAAG,OAAQ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