viem 3.0.0-next.10 → 3.0.0-next.13

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 (716) hide show
  1. package/dist/chains/definitions/arc.d.ts +15 -1
  2. package/dist/chains/definitions/arc.d.ts.map +1 -1
  3. package/dist/chains/definitions/arc.js +19 -1
  4. package/dist/chains/definitions/arc.js.map +1 -1
  5. package/dist/chains/definitions/berachainBepolia.d.ts +1 -1
  6. package/dist/chains/definitions/berachainBepolia.js +1 -1
  7. package/dist/chains/definitions/blockdag.d.ts +18 -0
  8. package/dist/chains/definitions/blockdag.d.ts.map +1 -0
  9. package/dist/chains/definitions/blockdag.js +18 -0
  10. package/dist/chains/definitions/blockdag.js.map +1 -0
  11. package/dist/chains/definitions/candyChain.d.ts +27 -0
  12. package/dist/chains/definitions/candyChain.d.ts.map +1 -0
  13. package/dist/chains/definitions/candyChain.js +26 -0
  14. package/dist/chains/definitions/candyChain.js.map +1 -0
  15. package/dist/chains/definitions/creditCoin3Devnet.d.ts +6 -0
  16. package/dist/chains/definitions/creditCoin3Devnet.d.ts.map +1 -1
  17. package/dist/chains/definitions/creditCoin3Devnet.js +6 -0
  18. package/dist/chains/definitions/creditCoin3Devnet.js.map +1 -1
  19. package/dist/chains/definitions/creditCoin3Mainnet.d.ts +5 -1
  20. package/dist/chains/definitions/creditCoin3Mainnet.d.ts.map +1 -1
  21. package/dist/chains/definitions/creditCoin3Mainnet.js +4 -0
  22. package/dist/chains/definitions/creditCoin3Mainnet.js.map +1 -1
  23. package/dist/chains/definitions/creditCoin3Testnet.d.ts +5 -1
  24. package/dist/chains/definitions/creditCoin3Testnet.d.ts.map +1 -1
  25. package/dist/chains/definitions/creditCoin3Testnet.js +4 -0
  26. package/dist/chains/definitions/creditCoin3Testnet.js.map +1 -1
  27. package/dist/chains/definitions/crymad.d.ts +25 -0
  28. package/dist/chains/definitions/crymad.d.ts.map +1 -0
  29. package/dist/chains/definitions/crymad.js +23 -0
  30. package/dist/chains/definitions/crymad.js.map +1 -0
  31. package/dist/chains/definitions/crymadL2.d.ts +26 -0
  32. package/dist/chains/definitions/crymadL2.d.ts.map +1 -0
  33. package/dist/chains/definitions/crymadL2.js +24 -0
  34. package/dist/chains/definitions/crymadL2.js.map +1 -0
  35. package/dist/chains/definitions/eCanna.d.ts +18 -0
  36. package/dist/chains/definitions/eCanna.d.ts.map +1 -0
  37. package/dist/chains/definitions/eCanna.js +18 -0
  38. package/dist/chains/definitions/eCanna.js.map +1 -0
  39. package/dist/chains/definitions/eCannaTestnet.d.ts +19 -0
  40. package/dist/chains/definitions/eCannaTestnet.d.ts.map +1 -0
  41. package/dist/chains/definitions/eCannaTestnet.js +19 -0
  42. package/dist/chains/definitions/eCannaTestnet.js.map +1 -0
  43. package/dist/chains/definitions/hausTestnet.d.ts +20 -0
  44. package/dist/chains/definitions/hausTestnet.d.ts.map +1 -0
  45. package/dist/chains/definitions/hausTestnet.js +18 -0
  46. package/dist/chains/definitions/hausTestnet.js.map +1 -0
  47. package/dist/chains/definitions/hyveChain.d.ts +26 -0
  48. package/dist/chains/definitions/hyveChain.d.ts.map +1 -0
  49. package/dist/chains/definitions/hyveChain.js +22 -0
  50. package/dist/chains/definitions/hyveChain.js.map +1 -0
  51. package/dist/chains/definitions/kortana.d.ts +18 -0
  52. package/dist/chains/definitions/kortana.d.ts.map +1 -0
  53. package/dist/chains/definitions/kortana.js +16 -0
  54. package/dist/chains/definitions/kortana.js.map +1 -0
  55. package/dist/chains/definitions/morphTachyon.d.ts +18 -0
  56. package/dist/chains/definitions/morphTachyon.d.ts.map +1 -0
  57. package/dist/chains/definitions/morphTachyon.js +16 -0
  58. package/dist/chains/definitions/morphTachyon.js.map +1 -0
  59. package/dist/chains/definitions/morphTachyonTestnet.d.ts +19 -0
  60. package/dist/chains/definitions/morphTachyonTestnet.d.ts.map +1 -0
  61. package/dist/chains/definitions/morphTachyonTestnet.js +17 -0
  62. package/dist/chains/definitions/morphTachyonTestnet.js.map +1 -0
  63. package/dist/chains/definitions/rabbitChainTestnet.d.ts +19 -0
  64. package/dist/chains/definitions/rabbitChainTestnet.d.ts.map +1 -0
  65. package/dist/chains/definitions/rabbitChainTestnet.js +19 -0
  66. package/dist/chains/definitions/rabbitChainTestnet.js.map +1 -0
  67. package/dist/chains/definitions/robinhood.d.ts +2 -1
  68. package/dist/chains/definitions/robinhood.d.ts.map +1 -1
  69. package/dist/chains/definitions/robinhood.js +6 -2
  70. package/dist/chains/definitions/robinhood.js.map +1 -1
  71. package/dist/chains/definitions/tempo.d.ts +11 -3
  72. package/dist/chains/definitions/tempo.d.ts.map +1 -1
  73. package/dist/chains/definitions/tempo.js +10 -0
  74. package/dist/chains/definitions/tempo.js.map +1 -1
  75. package/dist/chains/definitions/tempoModerato.d.ts +11 -3
  76. package/dist/chains/definitions/tempoModerato.d.ts.map +1 -1
  77. package/dist/chains/definitions/tempoModerato.js +10 -0
  78. package/dist/chains/definitions/tempoModerato.js.map +1 -1
  79. package/dist/chains/definitions/whitechainSepolia.d.ts +54 -2
  80. package/dist/chains/definitions/whitechainSepolia.d.ts.map +1 -1
  81. package/dist/chains/definitions/whitechainSepolia.js +27 -3
  82. package/dist/chains/definitions/whitechainSepolia.js.map +1 -1
  83. package/dist/chains/definitions/xgrTestnet.d.ts +19 -0
  84. package/dist/chains/definitions/xgrTestnet.d.ts.map +1 -0
  85. package/dist/chains/definitions/xgrTestnet.js +19 -0
  86. package/dist/chains/definitions/xgrTestnet.js.map +1 -0
  87. package/dist/chains/definitions/ynxTestnet.d.ts +19 -0
  88. package/dist/chains/definitions/ynxTestnet.d.ts.map +1 -0
  89. package/dist/chains/definitions/ynxTestnet.js +17 -0
  90. package/dist/chains/definitions/ynxTestnet.js.map +1 -0
  91. package/dist/chains/definitions/zagros.d.ts +26 -0
  92. package/dist/chains/definitions/zagros.d.ts.map +1 -0
  93. package/dist/chains/definitions/zagros.js +26 -0
  94. package/dist/chains/definitions/zagros.js.map +1 -0
  95. package/dist/chains/index.d.ts +16 -0
  96. package/dist/chains/index.d.ts.map +1 -1
  97. package/dist/chains/index.js +15 -0
  98. package/dist/chains/index.js.map +1 -1
  99. package/dist/core/actions/address/getStorageValues.d.ts +30 -0
  100. package/dist/core/actions/address/getStorageValues.d.ts.map +1 -0
  101. package/dist/core/actions/address/getStorageValues.js +29 -0
  102. package/dist/core/actions/address/getStorageValues.js.map +1 -0
  103. package/dist/core/actions/address/index.d.ts +1 -0
  104. package/dist/core/actions/address/index.d.ts.map +1 -1
  105. package/dist/core/actions/address/index.js +1 -0
  106. package/dist/core/actions/address/index.js.map +1 -1
  107. package/dist/core/actions/block/simulate.d.ts +2 -0
  108. package/dist/core/actions/block/simulate.d.ts.map +1 -1
  109. package/dist/core/actions/block/simulate.js +3 -0
  110. package/dist/core/actions/block/simulate.js.map +1 -1
  111. package/dist/core/actions/multicall.d.ts.map +1 -1
  112. package/dist/core/actions/multicall.js +7 -1
  113. package/dist/core/actions/multicall.js.map +1 -1
  114. package/dist/core/actions/siwe/verify.d.ts.map +1 -1
  115. package/dist/core/actions/siwe/verify.js +2 -1
  116. package/dist/core/actions/siwe/verify.js.map +1 -1
  117. package/dist/core/actions/transaction/Errors.d.ts +1 -0
  118. package/dist/core/actions/transaction/Errors.d.ts.map +1 -1
  119. package/dist/core/actions/transaction/Errors.js +1 -0
  120. package/dist/core/actions/transaction/Errors.js.map +1 -1
  121. package/dist/core/actions/transaction/fill.d.ts +10 -1
  122. package/dist/core/actions/transaction/fill.d.ts.map +1 -1
  123. package/dist/core/actions/transaction/fill.js +71 -38
  124. package/dist/core/actions/transaction/fill.js.map +1 -1
  125. package/dist/core/actions/transaction/prepare.d.ts.map +1 -1
  126. package/dist/core/actions/transaction/prepare.js +4 -1
  127. package/dist/core/actions/transaction/prepare.js.map +1 -1
  128. package/dist/core/actions/transaction/sign.d.ts.map +1 -1
  129. package/dist/core/actions/transaction/sign.js +3 -1
  130. package/dist/core/actions/transaction/sign.js.map +1 -1
  131. package/dist/core/actions/wallet/sendCalls.d.ts.map +1 -1
  132. package/dist/core/actions/wallet/sendCalls.js +1 -0
  133. package/dist/core/actions/wallet/sendCalls.js.map +1 -1
  134. package/dist/core/internal/transport.js +1 -1
  135. package/dist/core/internal/transport.js.map +1 -1
  136. package/dist/erc4337/actions/userOperation/get.d.ts.map +1 -1
  137. package/dist/erc4337/actions/userOperation/get.js +3 -1
  138. package/dist/erc4337/actions/userOperation/get.js.map +1 -1
  139. package/dist/erc4337/actions/userOperation/waitForReceipt.js +1 -1
  140. package/dist/erc4337/actions/userOperation/waitForReceipt.js.map +1 -1
  141. package/dist/internal/inference.d.ts +24 -0
  142. package/dist/internal/inference.d.ts.map +1 -1
  143. package/dist/node/transports/ipc.d.ts.map +1 -1
  144. package/dist/node/transports/ipc.js +20 -2
  145. package/dist/node/transports/ipc.js.map +1 -1
  146. package/dist/op-stack/actions/l1/getGame.js +1 -1
  147. package/dist/op-stack/actions/l1/getGame.js.map +1 -1
  148. package/dist/op-stack/actions/l1/getGames.js +1 -1
  149. package/dist/op-stack/actions/l1/getGames.js.map +1 -1
  150. package/dist/op-stack/actions/l1/getTimeToNextGame.js +1 -1
  151. package/dist/op-stack/actions/l1/getTimeToNextGame.js.map +1 -1
  152. package/dist/op-stack/actions/l1/getTimeToNextL2Output.js +1 -1
  153. package/dist/op-stack/actions/l1/getTimeToNextL2Output.js.map +1 -1
  154. package/dist/tempo/Abis.d.ts +36662 -5677
  155. package/dist/tempo/Abis.d.ts.map +1 -1
  156. package/dist/tempo/Abis.js +5626 -1536
  157. package/dist/tempo/Abis.js.map +1 -1
  158. package/dist/tempo/Account.d.ts +86 -29
  159. package/dist/tempo/Account.d.ts.map +1 -1
  160. package/dist/tempo/Account.js +204 -70
  161. package/dist/tempo/Account.js.map +1 -1
  162. package/dist/tempo/Addresses.d.ts +16 -1
  163. package/dist/tempo/Addresses.d.ts.map +1 -1
  164. package/dist/tempo/Addresses.js +41 -1
  165. package/dist/tempo/Addresses.js.map +1 -1
  166. package/dist/tempo/Capabilities.d.ts +7 -13
  167. package/dist/tempo/Capabilities.d.ts.map +1 -1
  168. package/dist/tempo/Client.d.ts.map +1 -1
  169. package/dist/tempo/Client.js +1 -1
  170. package/dist/tempo/Client.js.map +1 -1
  171. package/dist/tempo/Decorator.d.ts +226 -7
  172. package/dist/tempo/Decorator.d.ts.map +1 -1
  173. package/dist/tempo/Decorator.js +27 -5
  174. package/dist/tempo/Decorator.js.map +1 -1
  175. package/dist/tempo/ExecutionError.d.ts +81 -0
  176. package/dist/tempo/ExecutionError.d.ts.map +1 -0
  177. package/dist/tempo/ExecutionError.js +309 -0
  178. package/dist/tempo/ExecutionError.js.map +1 -0
  179. package/dist/tempo/Relay.d.ts +303 -0
  180. package/dist/tempo/Relay.d.ts.map +1 -0
  181. package/dist/tempo/Relay.js +170 -0
  182. package/dist/tempo/Relay.js.map +1 -0
  183. package/dist/tempo/Selectors.d.ts +219 -66
  184. package/dist/tempo/Selectors.d.ts.map +1 -1
  185. package/dist/tempo/Selectors.js +220 -67
  186. package/dist/tempo/Selectors.js.map +1 -1
  187. package/dist/tempo/Store.d.ts +62 -0
  188. package/dist/tempo/Store.d.ts.map +1 -0
  189. package/dist/tempo/Store.js +107 -0
  190. package/dist/tempo/Store.js.map +1 -0
  191. package/dist/tempo/Transport.d.ts +48 -2
  192. package/dist/tempo/Transport.d.ts.map +1 -1
  193. package/dist/tempo/Transport.js +116 -34
  194. package/dist/tempo/Transport.js.map +1 -1
  195. package/dist/tempo/Zone.d.ts +51 -0
  196. package/dist/tempo/Zone.d.ts.map +1 -0
  197. package/dist/tempo/Zone.js +40 -0
  198. package/dist/tempo/Zone.js.map +1 -0
  199. package/dist/tempo/actions/accessKey/authorizeSync.d.ts.map +1 -1
  200. package/dist/tempo/actions/accessKey/authorizeSync.js +2 -0
  201. package/dist/tempo/actions/accessKey/authorizeSync.js.map +1 -1
  202. package/dist/tempo/actions/accessKey/burnWitnessSync.d.ts.map +1 -1
  203. package/dist/tempo/actions/accessKey/burnWitnessSync.js +2 -0
  204. package/dist/tempo/actions/accessKey/burnWitnessSync.js.map +1 -1
  205. package/dist/tempo/actions/accessKey/index.d.ts +1 -0
  206. package/dist/tempo/actions/accessKey/index.d.ts.map +1 -1
  207. package/dist/tempo/actions/accessKey/index.js +1 -0
  208. package/dist/tempo/actions/accessKey/index.js.map +1 -1
  209. package/dist/tempo/actions/accessKey/prepareAuthorization.d.ts +76 -0
  210. package/dist/tempo/actions/accessKey/prepareAuthorization.d.ts.map +1 -0
  211. package/dist/tempo/actions/accessKey/prepareAuthorization.js +62 -0
  212. package/dist/tempo/actions/accessKey/prepareAuthorization.js.map +1 -0
  213. package/dist/tempo/actions/accessKey/revokeSync.d.ts.map +1 -1
  214. package/dist/tempo/actions/accessKey/revokeSync.js +2 -0
  215. package/dist/tempo/actions/accessKey/revokeSync.js.map +1 -1
  216. package/dist/tempo/actions/accessKey/signAuthorization.d.ts +43 -38
  217. package/dist/tempo/actions/accessKey/signAuthorization.d.ts.map +1 -1
  218. package/dist/tempo/actions/accessKey/signAuthorization.js +102 -44
  219. package/dist/tempo/actions/accessKey/signAuthorization.js.map +1 -1
  220. package/dist/tempo/actions/accessKey/updateLimitSync.d.ts.map +1 -1
  221. package/dist/tempo/actions/accessKey/updateLimitSync.js +2 -0
  222. package/dist/tempo/actions/accessKey/updateLimitSync.js.map +1 -1
  223. package/dist/tempo/actions/amm/burnSync.d.ts.map +1 -1
  224. package/dist/tempo/actions/amm/burnSync.js +2 -0
  225. package/dist/tempo/actions/amm/burnSync.js.map +1 -1
  226. package/dist/tempo/actions/amm/mintSync.d.ts.map +1 -1
  227. package/dist/tempo/actions/amm/mintSync.js +2 -0
  228. package/dist/tempo/actions/amm/mintSync.js.map +1 -1
  229. package/dist/tempo/actions/amm/rebalanceSwapSync.d.ts.map +1 -1
  230. package/dist/tempo/actions/amm/rebalanceSwapSync.js +2 -0
  231. package/dist/tempo/actions/amm/rebalanceSwapSync.js.map +1 -1
  232. package/dist/tempo/actions/channel/closeSync.d.ts.map +1 -1
  233. package/dist/tempo/actions/channel/closeSync.js +2 -0
  234. package/dist/tempo/actions/channel/closeSync.js.map +1 -1
  235. package/dist/tempo/actions/channel/openSync.d.ts.map +1 -1
  236. package/dist/tempo/actions/channel/openSync.js +2 -0
  237. package/dist/tempo/actions/channel/openSync.js.map +1 -1
  238. package/dist/tempo/actions/channel/requestCloseSync.d.ts.map +1 -1
  239. package/dist/tempo/actions/channel/requestCloseSync.js +2 -0
  240. package/dist/tempo/actions/channel/requestCloseSync.js.map +1 -1
  241. package/dist/tempo/actions/channel/settleSync.d.ts.map +1 -1
  242. package/dist/tempo/actions/channel/settleSync.js +2 -0
  243. package/dist/tempo/actions/channel/settleSync.js.map +1 -1
  244. package/dist/tempo/actions/channel/topUpSync.d.ts.map +1 -1
  245. package/dist/tempo/actions/channel/topUpSync.js +2 -0
  246. package/dist/tempo/actions/channel/topUpSync.js.map +1 -1
  247. package/dist/tempo/actions/channel/withdrawSync.d.ts.map +1 -1
  248. package/dist/tempo/actions/channel/withdrawSync.js +2 -0
  249. package/dist/tempo/actions/channel/withdrawSync.js.map +1 -1
  250. package/dist/tempo/actions/dex/cancelStaleSync.d.ts.map +1 -1
  251. package/dist/tempo/actions/dex/cancelStaleSync.js +2 -0
  252. package/dist/tempo/actions/dex/cancelStaleSync.js.map +1 -1
  253. package/dist/tempo/actions/dex/cancelSync.d.ts.map +1 -1
  254. package/dist/tempo/actions/dex/cancelSync.js +2 -0
  255. package/dist/tempo/actions/dex/cancelSync.js.map +1 -1
  256. package/dist/tempo/actions/dex/createPairSync.d.ts.map +1 -1
  257. package/dist/tempo/actions/dex/createPairSync.js +2 -0
  258. package/dist/tempo/actions/dex/createPairSync.js.map +1 -1
  259. package/dist/tempo/actions/dex/placeFlipSync.d.ts.map +1 -1
  260. package/dist/tempo/actions/dex/placeFlipSync.js +2 -0
  261. package/dist/tempo/actions/dex/placeFlipSync.js.map +1 -1
  262. package/dist/tempo/actions/dex/placeSync.d.ts.map +1 -1
  263. package/dist/tempo/actions/dex/placeSync.js +2 -0
  264. package/dist/tempo/actions/dex/placeSync.js.map +1 -1
  265. package/dist/tempo/actions/dex/withdrawSync.d.ts.map +1 -1
  266. package/dist/tempo/actions/dex/withdrawSync.js +2 -0
  267. package/dist/tempo/actions/dex/withdrawSync.js.map +1 -1
  268. package/dist/tempo/actions/earn/deployment.d.ts +36 -21
  269. package/dist/tempo/actions/earn/deployment.d.ts.map +1 -1
  270. package/dist/tempo/actions/earn/deployment.js +96 -32
  271. package/dist/tempo/actions/earn/deployment.js.map +1 -1
  272. package/dist/tempo/actions/earn.d.ts +21 -21
  273. package/dist/tempo/actions/earn.d.ts.map +1 -1
  274. package/dist/tempo/actions/earn.js +24 -9
  275. package/dist/tempo/actions/earn.js.map +1 -1
  276. package/dist/tempo/actions/fee/setUserTokenSync.d.ts.map +1 -1
  277. package/dist/tempo/actions/fee/setUserTokenSync.js +2 -0
  278. package/dist/tempo/actions/fee/setUserTokenSync.js.map +1 -1
  279. package/dist/tempo/actions/fee/setValidatorTokenSync.d.ts.map +1 -1
  280. package/dist/tempo/actions/fee/setValidatorTokenSync.js +2 -0
  281. package/dist/tempo/actions/fee/setValidatorTokenSync.js.map +1 -1
  282. package/dist/tempo/actions/index.d.ts +3 -0
  283. package/dist/tempo/actions/index.d.ts.map +1 -1
  284. package/dist/tempo/actions/index.js +3 -0
  285. package/dist/tempo/actions/index.js.map +1 -1
  286. package/dist/tempo/actions/multisig/getConfig.d.ts +34 -0
  287. package/dist/tempo/actions/multisig/getConfig.d.ts.map +1 -0
  288. package/dist/tempo/actions/multisig/getConfig.js +27 -0
  289. package/dist/tempo/actions/multisig/getConfig.js.map +1 -0
  290. package/dist/tempo/actions/multisig/getConfigCommitment.d.ts +72 -0
  291. package/dist/tempo/actions/multisig/getConfigCommitment.d.ts.map +1 -0
  292. package/dist/tempo/actions/multisig/getConfigCommitment.js +55 -0
  293. package/dist/tempo/actions/multisig/getConfigCommitment.js.map +1 -0
  294. package/dist/tempo/actions/multisig/getOperation.d.ts +23 -0
  295. package/dist/tempo/actions/multisig/getOperation.d.ts.map +1 -0
  296. package/dist/tempo/actions/multisig/getOperation.js +18 -0
  297. package/dist/tempo/actions/multisig/getOperation.js.map +1 -0
  298. package/dist/tempo/actions/multisig/index.d.ts +6 -0
  299. package/dist/tempo/actions/multisig/index.d.ts.map +1 -0
  300. package/dist/tempo/actions/multisig/index.js +6 -0
  301. package/dist/tempo/actions/multisig/index.js.map +1 -0
  302. package/dist/tempo/actions/multisig/updateConfig.d.ts +193 -0
  303. package/dist/tempo/actions/multisig/updateConfig.d.ts.map +1 -0
  304. package/dist/tempo/actions/multisig/updateConfig.js +170 -0
  305. package/dist/tempo/actions/multisig/updateConfig.js.map +1 -0
  306. package/dist/tempo/actions/multisig/updateConfigSync.d.ts +50 -0
  307. package/dist/tempo/actions/multisig/updateConfigSync.d.ts.map +1 -0
  308. package/dist/tempo/actions/multisig/updateConfigSync.js +55 -0
  309. package/dist/tempo/actions/multisig/updateConfigSync.js.map +1 -0
  310. package/dist/tempo/actions/policy/createSync.d.ts.map +1 -1
  311. package/dist/tempo/actions/policy/createSync.js +2 -0
  312. package/dist/tempo/actions/policy/createSync.js.map +1 -1
  313. package/dist/tempo/actions/policy/modifyBlacklistSync.d.ts.map +1 -1
  314. package/dist/tempo/actions/policy/modifyBlacklistSync.js +2 -0
  315. package/dist/tempo/actions/policy/modifyBlacklistSync.js.map +1 -1
  316. package/dist/tempo/actions/policy/modifyWhitelistSync.d.ts.map +1 -1
  317. package/dist/tempo/actions/policy/modifyWhitelistSync.js +2 -0
  318. package/dist/tempo/actions/policy/modifyWhitelistSync.js.map +1 -1
  319. package/dist/tempo/actions/policy/setAdminSync.d.ts.map +1 -1
  320. package/dist/tempo/actions/policy/setAdminSync.js +2 -0
  321. package/dist/tempo/actions/policy/setAdminSync.js.map +1 -1
  322. package/dist/tempo/actions/propAmm.d.ts +1025 -0
  323. package/dist/tempo/actions/propAmm.d.ts.map +1 -0
  324. package/dist/tempo/actions/propAmm.js +541 -0
  325. package/dist/tempo/actions/propAmm.js.map +1 -0
  326. package/dist/tempo/actions/receivePolicy/burnSync.d.ts.map +1 -1
  327. package/dist/tempo/actions/receivePolicy/burnSync.js +2 -0
  328. package/dist/tempo/actions/receivePolicy/burnSync.js.map +1 -1
  329. package/dist/tempo/actions/receivePolicy/claimSync.d.ts.map +1 -1
  330. package/dist/tempo/actions/receivePolicy/claimSync.js +2 -0
  331. package/dist/tempo/actions/receivePolicy/claimSync.js.map +1 -1
  332. package/dist/tempo/actions/receivePolicy/setSync.d.ts.map +1 -1
  333. package/dist/tempo/actions/receivePolicy/setSync.js +2 -0
  334. package/dist/tempo/actions/receivePolicy/setSync.js.map +1 -1
  335. package/dist/tempo/actions/token/approveSync.d.ts.map +1 -1
  336. package/dist/tempo/actions/token/approveSync.js +2 -0
  337. package/dist/tempo/actions/token/approveSync.js.map +1 -1
  338. package/dist/tempo/actions/token/burn.d.ts +38 -9
  339. package/dist/tempo/actions/token/burn.d.ts.map +1 -1
  340. package/dist/tempo/actions/token/burn.js +12 -5
  341. package/dist/tempo/actions/token/burn.js.map +1 -1
  342. package/dist/tempo/actions/token/burnBlockedSync.d.ts.map +1 -1
  343. package/dist/tempo/actions/token/burnBlockedSync.js +2 -0
  344. package/dist/tempo/actions/token/burnBlockedSync.js.map +1 -1
  345. package/dist/tempo/actions/token/burnSync.d.ts +2 -0
  346. package/dist/tempo/actions/token/burnSync.d.ts.map +1 -1
  347. package/dist/tempo/actions/token/burnSync.js +2 -0
  348. package/dist/tempo/actions/token/burnSync.js.map +1 -1
  349. package/dist/tempo/actions/token/changeTransferPolicySync.d.ts.map +1 -1
  350. package/dist/tempo/actions/token/changeTransferPolicySync.js +2 -0
  351. package/dist/tempo/actions/token/changeTransferPolicySync.js.map +1 -1
  352. package/dist/tempo/actions/token/createSync.d.ts.map +1 -1
  353. package/dist/tempo/actions/token/createSync.js +2 -0
  354. package/dist/tempo/actions/token/createSync.js.map +1 -1
  355. package/dist/tempo/actions/token/grantRolesSync.d.ts.map +1 -1
  356. package/dist/tempo/actions/token/grantRolesSync.js +2 -0
  357. package/dist/tempo/actions/token/grantRolesSync.js.map +1 -1
  358. package/dist/tempo/actions/token/mintSync.d.ts.map +1 -1
  359. package/dist/tempo/actions/token/mintSync.js +2 -0
  360. package/dist/tempo/actions/token/mintSync.js.map +1 -1
  361. package/dist/tempo/actions/token/pauseSync.d.ts.map +1 -1
  362. package/dist/tempo/actions/token/pauseSync.js +2 -0
  363. package/dist/tempo/actions/token/pauseSync.js.map +1 -1
  364. package/dist/tempo/actions/token/prepareUpdateQuoteTokenSync.d.ts.map +1 -1
  365. package/dist/tempo/actions/token/prepareUpdateQuoteTokenSync.js +2 -0
  366. package/dist/tempo/actions/token/prepareUpdateQuoteTokenSync.js.map +1 -1
  367. package/dist/tempo/actions/token/renounceRolesSync.d.ts.map +1 -1
  368. package/dist/tempo/actions/token/renounceRolesSync.js +2 -0
  369. package/dist/tempo/actions/token/renounceRolesSync.js.map +1 -1
  370. package/dist/tempo/actions/token/revokeRolesSync.d.ts.map +1 -1
  371. package/dist/tempo/actions/token/revokeRolesSync.js +2 -0
  372. package/dist/tempo/actions/token/revokeRolesSync.js.map +1 -1
  373. package/dist/tempo/actions/token/setRoleAdminSync.d.ts.map +1 -1
  374. package/dist/tempo/actions/token/setRoleAdminSync.js +2 -0
  375. package/dist/tempo/actions/token/setRoleAdminSync.js.map +1 -1
  376. package/dist/tempo/actions/token/setSupplyCapSync.d.ts.map +1 -1
  377. package/dist/tempo/actions/token/setSupplyCapSync.js +2 -0
  378. package/dist/tempo/actions/token/setSupplyCapSync.js.map +1 -1
  379. package/dist/tempo/actions/token/transferSync.d.ts.map +1 -1
  380. package/dist/tempo/actions/token/transferSync.js +2 -0
  381. package/dist/tempo/actions/token/transferSync.js.map +1 -1
  382. package/dist/tempo/actions/token/unpauseSync.d.ts.map +1 -1
  383. package/dist/tempo/actions/token/unpauseSync.js +2 -0
  384. package/dist/tempo/actions/token/unpauseSync.js.map +1 -1
  385. package/dist/tempo/actions/token/updateQuoteTokenSync.d.ts.map +1 -1
  386. package/dist/tempo/actions/token/updateQuoteTokenSync.js +2 -0
  387. package/dist/tempo/actions/token/updateQuoteTokenSync.js.map +1 -1
  388. package/dist/tempo/actions/virtualAddress/registerMasterSync.d.ts.map +1 -1
  389. package/dist/tempo/actions/virtualAddress/registerMasterSync.js +2 -0
  390. package/dist/tempo/actions/virtualAddress/registerMasterSync.js.map +1 -1
  391. package/dist/tempo/actions/zone/deposit.d.ts +56 -13
  392. package/dist/tempo/actions/zone/deposit.d.ts.map +1 -1
  393. package/dist/tempo/actions/zone/deposit.js +8 -10
  394. package/dist/tempo/actions/zone/deposit.js.map +1 -1
  395. package/dist/tempo/actions/zone/depositSync.d.ts.map +1 -1
  396. package/dist/tempo/actions/zone/depositSync.js +2 -0
  397. package/dist/tempo/actions/zone/depositSync.js.map +1 -1
  398. package/dist/tempo/actions/zone/encryptedDeposit.d.ts +15 -15
  399. package/dist/tempo/actions/zone/encryptedDeposit.d.ts.map +1 -1
  400. package/dist/tempo/actions/zone/encryptedDeposit.js +12 -12
  401. package/dist/tempo/actions/zone/encryptedDeposit.js.map +1 -1
  402. package/dist/tempo/actions/zone/getEncryptionKey.d.ts +3 -4
  403. package/dist/tempo/actions/zone/getEncryptionKey.d.ts.map +1 -1
  404. package/dist/tempo/actions/zone/getEncryptionKey.js +18 -7
  405. package/dist/tempo/actions/zone/getEncryptionKey.js.map +1 -1
  406. package/dist/tempo/actions/zone/getPortalInfo.d.ts +61 -0
  407. package/dist/tempo/actions/zone/getPortalInfo.d.ts.map +1 -0
  408. package/dist/tempo/actions/zone/getPortalInfo.js +63 -0
  409. package/dist/tempo/actions/zone/getPortalInfo.js.map +1 -0
  410. package/dist/tempo/actions/zone/getWithdrawalFee.d.ts.map +1 -1
  411. package/dist/tempo/actions/zone/getWithdrawalFee.js +1 -1
  412. package/dist/tempo/actions/zone/getWithdrawalFee.js.map +1 -1
  413. package/dist/tempo/actions/zone/index.d.ts +1 -0
  414. package/dist/tempo/actions/zone/index.d.ts.map +1 -1
  415. package/dist/tempo/actions/zone/index.js +1 -0
  416. package/dist/tempo/actions/zone/index.js.map +1 -1
  417. package/dist/tempo/actions/zone/requestVerifiableWithdrawal.d.ts +8 -8
  418. package/dist/tempo/actions/zone/requestVerifiableWithdrawal.d.ts.map +1 -1
  419. package/dist/tempo/actions/zone/requestVerifiableWithdrawal.js +1 -1
  420. package/dist/tempo/actions/zone/requestVerifiableWithdrawal.js.map +1 -1
  421. package/dist/tempo/actions/zone/requestWithdrawal.d.ts +8 -8
  422. package/dist/tempo/actions/zone/requestWithdrawal.d.ts.map +1 -1
  423. package/dist/tempo/actions/zone/requestWithdrawal.js +1 -1
  424. package/dist/tempo/actions/zone/requestWithdrawal.js.map +1 -1
  425. package/dist/tempo/actions/zone/requestWithdrawalSync.d.ts.map +1 -1
  426. package/dist/tempo/actions/zone/requestWithdrawalSync.js +2 -0
  427. package/dist/tempo/actions/zone/requestWithdrawalSync.js.map +1 -1
  428. package/dist/tempo/actions/zone/signAuthorizationToken.d.ts +3 -3
  429. package/dist/tempo/actions/zone/signAuthorizationToken.d.ts.map +1 -1
  430. package/dist/tempo/actions/zone/signAuthorizationToken.js +5 -5
  431. package/dist/tempo/actions/zone/signAuthorizationToken.js.map +1 -1
  432. package/dist/tempo/actions/zone/types.d.ts +1 -1
  433. package/dist/tempo/actions/zone/types.d.ts.map +1 -1
  434. package/dist/tempo/chainConfig.d.ts +33 -17
  435. package/dist/tempo/chainConfig.d.ts.map +1 -1
  436. package/dist/tempo/chainConfig.js +188 -72
  437. package/dist/tempo/chainConfig.js.map +1 -1
  438. package/dist/tempo/index.d.ts +11 -5
  439. package/dist/tempo/index.d.ts.map +1 -1
  440. package/dist/tempo/index.js +9 -3
  441. package/dist/tempo/index.js.map +1 -1
  442. package/dist/tempo/internal/relay/cache.d.ts +9 -0
  443. package/dist/tempo/internal/relay/cache.d.ts.map +1 -0
  444. package/dist/tempo/internal/relay/cache.js +72 -0
  445. package/dist/tempo/internal/relay/cache.js.map +1 -0
  446. package/dist/tempo/internal/relay/deadline.d.ts +4 -0
  447. package/dist/tempo/internal/relay/deadline.d.ts.map +1 -0
  448. package/dist/tempo/internal/relay/deadline.js +34 -0
  449. package/dist/tempo/internal/relay/deadline.js.map +1 -0
  450. package/dist/tempo/internal/relay/error.d.ts +47 -0
  451. package/dist/tempo/internal/relay/error.d.ts.map +1 -0
  452. package/dist/tempo/internal/relay/error.js +101 -0
  453. package/dist/tempo/internal/relay/error.js.map +1 -0
  454. package/dist/tempo/internal/relay/feePayer.d.ts +70 -0
  455. package/dist/tempo/internal/relay/feePayer.d.ts.map +1 -0
  456. package/dist/tempo/internal/relay/feePayer.js +442 -0
  457. package/dist/tempo/internal/relay/feePayer.js.map +1 -0
  458. package/dist/tempo/internal/relay/feeToken.d.ts +38 -0
  459. package/dist/tempo/internal/relay/feeToken.d.ts.map +1 -0
  460. package/dist/tempo/internal/relay/feeToken.js +143 -0
  461. package/dist/tempo/internal/relay/feeToken.js.map +1 -0
  462. package/dist/tempo/internal/relay/multisig.d.ts +4 -0
  463. package/dist/tempo/internal/relay/multisig.d.ts.map +1 -0
  464. package/dist/tempo/internal/relay/multisig.js +1039 -0
  465. package/dist/tempo/internal/relay/multisig.js.map +1 -0
  466. package/dist/tempo/internal/relay/plugin.d.ts +5 -0
  467. package/dist/tempo/internal/relay/plugin.d.ts.map +1 -0
  468. package/dist/tempo/internal/relay/plugin.js +10 -0
  469. package/dist/tempo/internal/relay/plugin.js.map +1 -0
  470. package/dist/tempo/internal/relay/preflight.d.ts +17 -0
  471. package/dist/tempo/internal/relay/preflight.d.ts.map +1 -0
  472. package/dist/tempo/internal/relay/preflight.js +53 -0
  473. package/dist/tempo/internal/relay/preflight.js.map +1 -0
  474. package/dist/tempo/internal/relay/request.d.ts +16 -0
  475. package/dist/tempo/internal/relay/request.d.ts.map +1 -0
  476. package/dist/tempo/internal/relay/request.js +327 -0
  477. package/dist/tempo/internal/relay/request.js.map +1 -0
  478. package/dist/tempo/internal/relay/simulate.d.ts +62 -0
  479. package/dist/tempo/internal/relay/simulate.d.ts.map +1 -0
  480. package/dist/tempo/internal/relay/simulate.js +284 -0
  481. package/dist/tempo/internal/relay/simulate.js.map +1 -0
  482. package/dist/tempo/internal/relay/utils.d.ts +346 -0
  483. package/dist/tempo/internal/relay/utils.d.ts.map +1 -0
  484. package/dist/tempo/internal/relay/utils.js +185 -0
  485. package/dist/tempo/internal/relay/utils.js.map +1 -0
  486. package/dist/tempo/internal/relay/virtualAddress.d.ts +9 -0
  487. package/dist/tempo/internal/relay/virtualAddress.d.ts.map +1 -0
  488. package/dist/tempo/internal/relay/virtualAddress.js +73 -0
  489. package/dist/tempo/internal/relay/virtualAddress.js.map +1 -0
  490. package/dist/tempo/internal/relay.d.ts +4 -0
  491. package/dist/tempo/internal/relay.d.ts.map +1 -0
  492. package/dist/tempo/internal/relay.js +132 -0
  493. package/dist/tempo/internal/relay.js.map +1 -0
  494. package/dist/tempo/internal/types.d.ts +2 -2
  495. package/dist/tempo/internal/types.d.ts.map +1 -1
  496. package/dist/tempo/internal/utils.d.ts +1 -0
  497. package/dist/tempo/internal/utils.d.ts.map +1 -1
  498. package/dist/tempo/internal/utils.js +2 -1
  499. package/dist/tempo/internal/utils.js.map +1 -1
  500. package/dist/tempo/multisig/Config.d.ts +43 -0
  501. package/dist/tempo/multisig/Config.d.ts.map +1 -0
  502. package/dist/tempo/multisig/Config.js +92 -0
  503. package/dist/tempo/multisig/Config.js.map +1 -0
  504. package/dist/tempo/multisig/Operation.d.ts +34 -0
  505. package/dist/tempo/multisig/Operation.d.ts.map +1 -0
  506. package/dist/tempo/multisig/Operation.js +179 -0
  507. package/dist/tempo/multisig/Operation.js.map +1 -0
  508. package/dist/tempo/multisig/Signature.d.ts +4 -0
  509. package/dist/tempo/multisig/Signature.d.ts.map +1 -0
  510. package/dist/tempo/multisig/Signature.js +9 -0
  511. package/dist/tempo/multisig/Signature.js.map +1 -0
  512. package/dist/tempo/zones/Abis.d.ts +2 -2
  513. package/dist/tempo/zones/Abis.d.ts.map +1 -1
  514. package/dist/tempo/zones/Abis.js +2 -2
  515. package/dist/tempo/zones/Abis.js.map +1 -1
  516. package/dist/tempo/zones/transport.d.ts +1 -33
  517. package/dist/tempo/zones/transport.d.ts.map +1 -1
  518. package/dist/tempo/zones/transport.js +1 -49
  519. package/dist/tempo/zones/transport.js.map +1 -1
  520. package/dist/tokens/definitions/cirbtc.d.ts +1 -0
  521. package/dist/tokens/definitions/cirbtc.d.ts.map +1 -1
  522. package/dist/tokens/definitions/cirbtc.js +1 -0
  523. package/dist/tokens/definitions/cirbtc.js.map +1 -1
  524. package/dist/tokens/definitions/eurc.d.ts +2 -0
  525. package/dist/tokens/definitions/eurc.d.ts.map +1 -1
  526. package/dist/tokens/definitions/eurc.js +2 -0
  527. package/dist/tokens/definitions/eurc.js.map +1 -1
  528. package/dist/tokens/definitions/ousd.d.ts +26 -0
  529. package/dist/tokens/definitions/ousd.d.ts.map +1 -0
  530. package/dist/tokens/definitions/ousd.js +26 -0
  531. package/dist/tokens/definitions/ousd.js.map +1 -0
  532. package/dist/tokens/definitions/usdc.d.ts +2 -0
  533. package/dist/tokens/definitions/usdc.d.ts.map +1 -1
  534. package/dist/tokens/definitions/usdc.js +2 -0
  535. package/dist/tokens/definitions/usdc.js.map +1 -1
  536. package/dist/tokens/index.d.ts +2 -0
  537. package/dist/tokens/index.d.ts.map +1 -1
  538. package/dist/tokens/index.js +2 -0
  539. package/dist/tokens/index.js.map +1 -1
  540. package/dist/tokens/sets.d.ts +40 -0
  541. package/dist/tokens/sets.d.ts.map +1 -1
  542. package/dist/tokens/sets.js +4 -1
  543. package/dist/tokens/sets.js.map +1 -1
  544. package/dist/utils/Siwe.d.ts +7 -0
  545. package/dist/utils/Siwe.d.ts.map +1 -1
  546. package/dist/utils/Siwe.js +28 -0
  547. package/dist/utils/Siwe.js.map +1 -1
  548. package/dist/utils/TxEnvelope.d.ts.map +1 -1
  549. package/dist/utils/TxEnvelope.js +2 -1
  550. package/dist/utils/TxEnvelope.js.map +1 -1
  551. package/dist/version.d.ts +1 -1
  552. package/dist/version.js +1 -1
  553. package/package.json +2 -2
  554. package/src/chains/definitions/arc.ts +19 -1
  555. package/src/chains/definitions/berachainBepolia.ts +1 -1
  556. package/src/chains/definitions/blockdag.ts +18 -0
  557. package/src/chains/definitions/candyChain.ts +26 -0
  558. package/src/chains/definitions/creditCoin3Devnet.ts +6 -0
  559. package/src/chains/definitions/creditCoin3Mainnet.ts +4 -0
  560. package/src/chains/definitions/creditCoin3Testnet.ts +4 -0
  561. package/src/chains/definitions/crymad.ts +23 -0
  562. package/src/chains/definitions/crymadL2.ts +24 -0
  563. package/src/chains/definitions/eCanna.ts +18 -0
  564. package/src/chains/definitions/eCannaTestnet.ts +19 -0
  565. package/src/chains/definitions/hausTestnet.ts +18 -0
  566. package/src/chains/definitions/hyveChain.ts +22 -0
  567. package/src/chains/definitions/kortana.ts +16 -0
  568. package/src/chains/definitions/morphTachyon.ts +16 -0
  569. package/src/chains/definitions/morphTachyonTestnet.ts +17 -0
  570. package/src/chains/definitions/rabbitChainTestnet.ts +19 -0
  571. package/src/chains/definitions/robinhood.ts +6 -2
  572. package/src/chains/definitions/tempo.ts +10 -0
  573. package/src/chains/definitions/tempoModerato.ts +10 -0
  574. package/src/chains/definitions/whitechainSepolia.ts +28 -3
  575. package/src/chains/definitions/xgrTestnet.ts +19 -0
  576. package/src/chains/definitions/ynxTestnet.ts +17 -0
  577. package/src/chains/definitions/zagros.ts +26 -0
  578. package/src/chains/index.ts +17 -0
  579. package/src/core/actions/address/getStorageValues.ts +55 -0
  580. package/src/core/actions/address/index.ts +1 -0
  581. package/src/core/actions/block/simulate.ts +6 -0
  582. package/src/core/actions/multicall.ts +8 -1
  583. package/src/core/actions/siwe/verify.ts +3 -1
  584. package/src/core/actions/transaction/Errors.ts +1 -0
  585. package/src/core/actions/transaction/fill.ts +83 -41
  586. package/src/core/actions/transaction/prepare.ts +6 -1
  587. package/src/core/actions/transaction/sign.ts +4 -1
  588. package/src/core/actions/wallet/sendCalls.ts +1 -0
  589. package/src/core/internal/transport.ts +1 -1
  590. package/src/erc4337/actions/userOperation/get.ts +3 -1
  591. package/src/erc4337/actions/userOperation/waitForReceipt.ts +1 -1
  592. package/src/internal/inference.ts +24 -0
  593. package/src/node/transports/ipc.ts +17 -2
  594. package/src/op-stack/actions/l1/getGame.ts +1 -1
  595. package/src/op-stack/actions/l1/getGames.ts +1 -1
  596. package/src/op-stack/actions/l1/getTimeToNextGame.ts +1 -1
  597. package/src/op-stack/actions/l1/getTimeToNextL2Output.ts +1 -1
  598. package/src/tempo/Abis.ts +5619 -1513
  599. package/src/tempo/Account.ts +387 -82
  600. package/src/tempo/Addresses.ts +46 -17
  601. package/src/tempo/Capabilities.ts +7 -15
  602. package/src/tempo/Client.ts +1 -1
  603. package/src/tempo/Decorator.ts +304 -22
  604. package/src/tempo/ExecutionError.ts +428 -0
  605. package/src/tempo/Relay.ts +430 -0
  606. package/src/tempo/Selectors.ts +248 -78
  607. package/src/tempo/Store.ts +170 -0
  608. package/src/tempo/Transport.ts +202 -5
  609. package/src/tempo/Zone.ts +72 -0
  610. package/src/tempo/actions/accessKey/authorizeSync.ts +4 -0
  611. package/src/tempo/actions/accessKey/burnWitnessSync.ts +4 -0
  612. package/src/tempo/actions/accessKey/index.ts +2 -0
  613. package/src/tempo/actions/accessKey/prepareAuthorization.ts +132 -0
  614. package/src/tempo/actions/accessKey/revokeSync.ts +4 -0
  615. package/src/tempo/actions/accessKey/signAuthorization.ts +222 -53
  616. package/src/tempo/actions/accessKey/updateLimitSync.ts +4 -0
  617. package/src/tempo/actions/amm/burnSync.ts +4 -0
  618. package/src/tempo/actions/amm/mintSync.ts +4 -0
  619. package/src/tempo/actions/amm/rebalanceSwapSync.ts +4 -0
  620. package/src/tempo/actions/channel/closeSync.ts +4 -0
  621. package/src/tempo/actions/channel/openSync.ts +4 -0
  622. package/src/tempo/actions/channel/requestCloseSync.ts +4 -0
  623. package/src/tempo/actions/channel/settleSync.ts +4 -0
  624. package/src/tempo/actions/channel/topUpSync.ts +4 -0
  625. package/src/tempo/actions/channel/withdrawSync.ts +4 -0
  626. package/src/tempo/actions/dex/cancelStaleSync.ts +4 -0
  627. package/src/tempo/actions/dex/cancelSync.ts +4 -0
  628. package/src/tempo/actions/dex/createPairSync.ts +4 -0
  629. package/src/tempo/actions/dex/placeFlipSync.ts +4 -0
  630. package/src/tempo/actions/dex/placeSync.ts +4 -0
  631. package/src/tempo/actions/dex/withdrawSync.ts +4 -0
  632. package/src/tempo/actions/earn/deployment.ts +108 -42
  633. package/src/tempo/actions/earn.ts +35 -15
  634. package/src/tempo/actions/fee/setUserTokenSync.ts +4 -0
  635. package/src/tempo/actions/fee/setValidatorTokenSync.ts +4 -0
  636. package/src/tempo/actions/index.ts +4 -0
  637. package/src/tempo/actions/multisig/getConfig.ts +46 -0
  638. package/src/tempo/actions/multisig/getConfigCommitment.ts +79 -0
  639. package/src/tempo/actions/multisig/getOperation.ts +37 -0
  640. package/src/tempo/actions/multisig/index.ts +5 -0
  641. package/src/tempo/actions/multisig/updateConfig.ts +210 -0
  642. package/src/tempo/actions/multisig/updateConfigSync.ts +80 -0
  643. package/src/tempo/actions/policy/createSync.ts +4 -0
  644. package/src/tempo/actions/policy/modifyBlacklistSync.ts +4 -0
  645. package/src/tempo/actions/policy/modifyWhitelistSync.ts +4 -0
  646. package/src/tempo/actions/policy/setAdminSync.ts +4 -0
  647. package/src/tempo/actions/propAmm.ts +985 -0
  648. package/src/tempo/actions/receivePolicy/burnSync.ts +4 -0
  649. package/src/tempo/actions/receivePolicy/claimSync.ts +4 -0
  650. package/src/tempo/actions/receivePolicy/setSync.ts +5 -1
  651. package/src/tempo/actions/token/approveSync.ts +5 -1
  652. package/src/tempo/actions/token/burn.ts +21 -9
  653. package/src/tempo/actions/token/burnBlockedSync.ts +5 -1
  654. package/src/tempo/actions/token/burnSync.ts +7 -1
  655. package/src/tempo/actions/token/changeTransferPolicySync.ts +4 -0
  656. package/src/tempo/actions/token/createSync.ts +4 -0
  657. package/src/tempo/actions/token/grantRolesSync.ts +4 -0
  658. package/src/tempo/actions/token/mintSync.ts +5 -1
  659. package/src/tempo/actions/token/pauseSync.ts +4 -0
  660. package/src/tempo/actions/token/prepareUpdateQuoteTokenSync.ts +4 -0
  661. package/src/tempo/actions/token/renounceRolesSync.ts +4 -0
  662. package/src/tempo/actions/token/revokeRolesSync.ts +4 -0
  663. package/src/tempo/actions/token/setRoleAdminSync.ts +4 -0
  664. package/src/tempo/actions/token/setSupplyCapSync.ts +4 -0
  665. package/src/tempo/actions/token/transferSync.ts +5 -1
  666. package/src/tempo/actions/token/unpauseSync.ts +4 -0
  667. package/src/tempo/actions/token/updateQuoteTokenSync.ts +4 -0
  668. package/src/tempo/actions/virtualAddress/registerMasterSync.ts +4 -0
  669. package/src/tempo/actions/zone/deposit.ts +13 -24
  670. package/src/tempo/actions/zone/depositSync.ts +4 -0
  671. package/src/tempo/actions/zone/encryptedDeposit.ts +18 -26
  672. package/src/tempo/actions/zone/getEncryptionKey.ts +20 -8
  673. package/src/tempo/actions/zone/getPortalInfo.ts +126 -0
  674. package/src/tempo/actions/zone/getWithdrawalFee.ts +1 -1
  675. package/src/tempo/actions/zone/index.ts +2 -0
  676. package/src/tempo/actions/zone/requestVerifiableWithdrawal.ts +1 -1
  677. package/src/tempo/actions/zone/requestWithdrawal.ts +1 -1
  678. package/src/tempo/actions/zone/requestWithdrawalSync.ts +4 -0
  679. package/src/tempo/actions/zone/signAuthorizationToken.ts +7 -7
  680. package/src/tempo/actions/zone/types.ts +1 -1
  681. package/src/tempo/chainConfig.ts +287 -86
  682. package/src/tempo/index.ts +15 -4
  683. package/src/tempo/internal/relay/cache.ts +82 -0
  684. package/src/tempo/internal/relay/deadline.ts +45 -0
  685. package/src/tempo/internal/relay/error.ts +129 -0
  686. package/src/tempo/internal/relay/feePayer.ts +693 -0
  687. package/src/tempo/internal/relay/feeToken.ts +190 -0
  688. package/src/tempo/internal/relay/multisig.ts +1357 -0
  689. package/src/tempo/internal/relay/plugin.ts +13 -0
  690. package/src/tempo/internal/relay/preflight.ts +83 -0
  691. package/src/tempo/internal/relay/request.ts +401 -0
  692. package/src/tempo/internal/relay/simulate.ts +394 -0
  693. package/src/tempo/internal/relay/utils.ts +213 -0
  694. package/src/tempo/internal/relay/virtualAddress.ts +95 -0
  695. package/src/tempo/internal/relay.ts +149 -0
  696. package/src/tempo/internal/types.ts +2 -1
  697. package/src/tempo/internal/utils.ts +2 -0
  698. package/src/tempo/multisig/Config.ts +139 -0
  699. package/src/tempo/multisig/Operation.ts +213 -0
  700. package/src/tempo/multisig/Signature.ts +11 -0
  701. package/src/tempo/zones/Abis.ts +2 -2
  702. package/src/tempo/zones/transport.ts +1 -66
  703. package/src/tokens/definitions/cirbtc.ts +1 -0
  704. package/src/tokens/definitions/eurc.ts +2 -0
  705. package/src/tokens/definitions/ousd.ts +26 -0
  706. package/src/tokens/definitions/usdc.ts +2 -0
  707. package/src/tokens/index.ts +2 -0
  708. package/src/tokens/sets.ts +4 -1
  709. package/src/utils/Siwe.ts +36 -0
  710. package/src/utils/TxEnvelope.ts +3 -1
  711. package/src/version.ts +1 -1
  712. package/dist/tempo/Storage.d.ts +0 -43
  713. package/dist/tempo/Storage.d.ts.map +0 -1
  714. package/dist/tempo/Storage.js +0 -96
  715. package/dist/tempo/Storage.js.map +0 -1
  716. package/src/tempo/Storage.ts +0 -119
@@ -0,0 +1,985 @@
1
+ import { AbiEvent, Address, Hex } from 'ox'
2
+ import type { Errors } from 'ox'
3
+ import * as Account from '../../core/Account.js'
4
+ import type * as Chain from '../../core/Chain.js'
5
+ import type * as Client from '../../core/Client.js'
6
+ import { estimateGas as core_estimateGas } from '../../core/actions/transaction/estimateGas.js'
7
+ import { read } from '../../core/actions/contract/read.js'
8
+ import { send } from '../../core/actions/transaction/send.js'
9
+ import { sendSync } from '../../core/actions/transaction/sendSync.js'
10
+ import { multicall } from '../../core/actions/multicall.js'
11
+ import type { Compute, UnionOmit } from '../../core/internal/types.js'
12
+ import * as Abis from '../Abis.js'
13
+ import * as Expiry from '../Expiry.js'
14
+ import type { ReadParameters, WriteParameters } from '../internal/types.js'
15
+ import {
16
+ defineCall,
17
+ dispatchSend,
18
+ pickWriteParameters,
19
+ } from '../internal/utils.js'
20
+ import type { TransactionReceipt } from '../chainConfig.js'
21
+ import * as tokenActions from './token/index.js'
22
+
23
+ /**
24
+ * Reads the base token of a propAMM pool.
25
+ *
26
+ * @example
27
+ * ```ts
28
+ * import { Client, http } from 'viem'
29
+ * import { tempo } from 'viem/chains'
30
+ * import { Actions } from 'viem/tempo'
31
+ *
32
+ * const client = Client.create({ chain: tempo, transport: http() })
33
+ *
34
+ * const token = await Actions.propAmm.baseToken(client, { pool: '0x...' })
35
+ * ```
36
+ *
37
+ * @param client - Client.
38
+ * @param parameters - Pool and read options.
39
+ * @returns Base token address.
40
+ */
41
+ export async function baseToken<chain extends Chain.Chain | undefined>(
42
+ client: Client.Client<chain>,
43
+ parameters: baseToken.Parameters,
44
+ ): Promise<baseToken.ReturnValue> {
45
+ const { pool, ...rest } = parameters
46
+ return read(client, { ...rest, ...baseToken.call({ pool }) })
47
+ }
48
+
49
+ export namespace baseToken {
50
+ export type Args = {
51
+ /** Pool address. */
52
+ pool: Address.Address
53
+ }
54
+
55
+ export type Parameters = ReadParameters & Args
56
+
57
+ export type ReturnValue = read.ReturnType<
58
+ typeof Abis.directPropAmm,
59
+ 'baseToken'
60
+ >
61
+
62
+ /**
63
+ * Defines the pool's `baseToken` call.
64
+ */
65
+ export function call({ pool }: Args) {
66
+ return defineCall({
67
+ abi: Abis.directPropAmm,
68
+ address: pool,
69
+ functionName: 'baseToken',
70
+ })
71
+ }
72
+ }
73
+
74
+ /**
75
+ * Reads the quote token of a propAMM pool.
76
+ *
77
+ * @example
78
+ * ```ts
79
+ * import { Client, http } from 'viem'
80
+ * import { tempo } from 'viem/chains'
81
+ * import { Actions } from 'viem/tempo'
82
+ *
83
+ * const client = Client.create({ chain: tempo, transport: http() })
84
+ *
85
+ * const token = await Actions.propAmm.quoteToken(client, { pool: '0x...' })
86
+ * ```
87
+ *
88
+ * @param client - Client.
89
+ * @param parameters - Pool and read options.
90
+ * @returns Quote token address.
91
+ */
92
+ export async function quoteToken<chain extends Chain.Chain | undefined>(
93
+ client: Client.Client<chain>,
94
+ parameters: quoteToken.Parameters,
95
+ ): Promise<quoteToken.ReturnValue> {
96
+ const { pool, ...rest } = parameters
97
+ return read(client, { ...rest, ...quoteToken.call({ pool }) })
98
+ }
99
+
100
+ export namespace quoteToken {
101
+ export type Args = {
102
+ /** Pool address. */
103
+ pool: Address.Address
104
+ }
105
+
106
+ export type Parameters = ReadParameters & Args
107
+
108
+ export type ReturnValue = read.ReturnType<
109
+ typeof Abis.directPropAmm,
110
+ 'quoteToken'
111
+ >
112
+
113
+ /**
114
+ * Defines the pool's `quoteToken` call.
115
+ */
116
+ export function call({ pool }: Args) {
117
+ return defineCall({
118
+ abi: Abis.directPropAmm,
119
+ address: pool,
120
+ functionName: 'quoteToken',
121
+ })
122
+ }
123
+ }
124
+
125
+ /**
126
+ * Reads whether a propAMM pool is paused.
127
+ *
128
+ * @example
129
+ * ```ts
130
+ * import { Client, http } from 'viem'
131
+ * import { tempo } from 'viem/chains'
132
+ * import { Actions } from 'viem/tempo'
133
+ *
134
+ * const client = Client.create({ chain: tempo, transport: http() })
135
+ *
136
+ * const isPaused = await Actions.propAmm.paused(client, { pool: '0x...' })
137
+ * ```
138
+ *
139
+ * @param client - Client.
140
+ * @param parameters - Pool and read options.
141
+ * @returns Whether swaps are paused.
142
+ */
143
+ export async function paused<chain extends Chain.Chain | undefined>(
144
+ client: Client.Client<chain>,
145
+ parameters: paused.Parameters,
146
+ ): Promise<paused.ReturnValue> {
147
+ const { pool, ...rest } = parameters
148
+ return read(client, { ...rest, ...paused.call({ pool }) })
149
+ }
150
+
151
+ export namespace paused {
152
+ export type Args = {
153
+ /** Pool address. */
154
+ pool: Address.Address
155
+ }
156
+
157
+ export type Parameters = ReadParameters & Args
158
+
159
+ export type ReturnValue = read.ReturnType<typeof Abis.directPropAmm, 'paused'>
160
+
161
+ /**
162
+ * Defines the pool's `paused` call.
163
+ */
164
+ export function call({ pool }: Args) {
165
+ return defineCall({
166
+ abi: Abis.directPropAmm,
167
+ address: pool,
168
+ functionName: 'paused',
169
+ })
170
+ }
171
+ }
172
+
173
+ /**
174
+ * Reads whether an address may call swaps on a pool.
175
+ *
176
+ * @example
177
+ * ```ts
178
+ * import { Client, http } from 'viem'
179
+ * import { tempo } from 'viem/chains'
180
+ * import { Actions } from 'viem/tempo'
181
+ *
182
+ * const client = Client.create({ chain: tempo, transport: http() })
183
+ *
184
+ * const allowed = await Actions.propAmm.takerAllowed(client, { pool: '0x...', taker: '0x...' })
185
+ * ```
186
+ *
187
+ * @param client - Client.
188
+ * @param parameters - Pool, taker, and read options.
189
+ * @returns Whether the taker is allowed.
190
+ */
191
+ export async function takerAllowed<chain extends Chain.Chain | undefined>(
192
+ client: Client.Client<chain>,
193
+ parameters: takerAllowed.Parameters,
194
+ ): Promise<takerAllowed.ReturnValue> {
195
+ const { pool, taker, ...rest } = parameters
196
+ return read(client, {
197
+ ...rest,
198
+ ...takerAllowed.call({ pool, taker }),
199
+ })
200
+ }
201
+
202
+ export namespace takerAllowed {
203
+ export type Args = {
204
+ /** Pool address. */
205
+ pool: Address.Address
206
+ /** Address that calls the swap. */
207
+ taker: Address.Address
208
+ }
209
+
210
+ export type Parameters = ReadParameters & Args
211
+
212
+ export type ReturnValue = read.ReturnType<
213
+ typeof Abis.directPropAmm,
214
+ 'takerAllowed'
215
+ >
216
+
217
+ /**
218
+ * Defines the pool's `takerAllowed` call.
219
+ */
220
+ export function call({ pool, taker }: Args) {
221
+ return defineCall({
222
+ abi: Abis.directPropAmm,
223
+ address: pool,
224
+ args: [taker],
225
+ functionName: 'takerAllowed',
226
+ })
227
+ }
228
+ }
229
+
230
+ /**
231
+ * Reads whether a resolved address may receive swap output.
232
+ *
233
+ * @example
234
+ * ```ts
235
+ * import { Client, http } from 'viem'
236
+ * import { tempo } from 'viem/chains'
237
+ * import { Actions } from 'viem/tempo'
238
+ *
239
+ * const client = Client.create({ chain: tempo, transport: http() })
240
+ *
241
+ * const allowed = await Actions.propAmm.recipientAllowed(client, { pool: '0x...', recipient: '0x...' })
242
+ * ```
243
+ *
244
+ * @param client - Client.
245
+ * @param parameters - Pool, resolved recipient, and read options.
246
+ * @returns Whether the resolved recipient is allowed.
247
+ */
248
+ export async function recipientAllowed<chain extends Chain.Chain | undefined>(
249
+ client: Client.Client<chain>,
250
+ parameters: recipientAllowed.Parameters,
251
+ ): Promise<recipientAllowed.ReturnValue> {
252
+ const { pool, recipient, ...rest } = parameters
253
+ return read(client, {
254
+ ...rest,
255
+ ...recipientAllowed.call({ pool, recipient }),
256
+ })
257
+ }
258
+
259
+ export namespace recipientAllowed {
260
+ export type Args = {
261
+ /** Pool address. */
262
+ pool: Address.Address
263
+ /** Resolved address to check. */
264
+ recipient: Address.Address
265
+ }
266
+
267
+ export type Parameters = ReadParameters & Args
268
+
269
+ export type ReturnValue = read.ReturnType<
270
+ typeof Abis.directPropAmm,
271
+ 'recipientAllowed'
272
+ >
273
+
274
+ /**
275
+ * Defines the pool's `recipientAllowed` call.
276
+ */
277
+ export function call({ pool, recipient }: Args) {
278
+ return defineCall({
279
+ abi: Abis.directPropAmm,
280
+ address: pool,
281
+ args: [recipient],
282
+ functionName: 'recipientAllowed',
283
+ })
284
+ }
285
+ }
286
+
287
+ /**
288
+ * Resolves a Tempo recipient to the address checked by the pool's allowlist.
289
+ *
290
+ * @example
291
+ * ```ts
292
+ * import { Client, http } from 'viem'
293
+ * import { tempo } from 'viem/chains'
294
+ * import { Actions } from 'viem/tempo'
295
+ *
296
+ * const client = Client.create({ chain: tempo, transport: http() })
297
+ *
298
+ * const resolved = await Actions.propAmm.resolveRecipient(client, { pool: '0x...', recipient: '0x...' })
299
+ * ```
300
+ *
301
+ * @param client - Client.
302
+ * @param parameters - Pool, recipient, and read options.
303
+ * @returns Resolved recipient address.
304
+ */
305
+ export async function resolveRecipient<chain extends Chain.Chain | undefined>(
306
+ client: Client.Client<chain>,
307
+ parameters: resolveRecipient.Parameters,
308
+ ): Promise<resolveRecipient.ReturnValue> {
309
+ const { pool, recipient, ...rest } = parameters
310
+ return read(client, {
311
+ ...rest,
312
+ ...resolveRecipient.call({ pool, recipient }),
313
+ })
314
+ }
315
+
316
+ export namespace resolveRecipient {
317
+ export type Args = {
318
+ /** Pool address. */
319
+ pool: Address.Address
320
+ /** Destination provided to the swap. */
321
+ recipient: Address.Address
322
+ }
323
+
324
+ export type Parameters = ReadParameters & Args
325
+
326
+ export type ReturnValue = read.ReturnType<
327
+ typeof Abis.directPropAmm,
328
+ 'resolveRecipient'
329
+ >
330
+
331
+ /**
332
+ * Defines the pool's `resolveRecipient` call.
333
+ */
334
+ export function call({ pool, recipient }: Args) {
335
+ return defineCall({
336
+ abi: Abis.directPropAmm,
337
+ address: pool,
338
+ args: [recipient],
339
+ functionName: 'resolveRecipient',
340
+ })
341
+ }
342
+ }
343
+
344
+ /**
345
+ * Quotes an exact input or exact output for a caller, recipient, and customer route.
346
+ *
347
+ * @example
348
+ * ```ts
349
+ * import { Client, http } from 'viem'
350
+ * import { tempo } from 'viem/chains'
351
+ * import { Actions } from 'viem/tempo'
352
+ *
353
+ * const client = Client.create({ chain: tempo, transport: http() })
354
+ *
355
+ * const { amountOut, price, updatedAt } = await Actions.propAmm.getSwapQuote(client, {
356
+ * pool: '0x...',
357
+ * taker: '0x...',
358
+ * recipient: '0x...',
359
+ * mode: 'exactInput',
360
+ * amountIn: 1_000_000n,
361
+ * })
362
+ * ```
363
+ *
364
+ * @param client - Client.
365
+ * @param parameters - Route, swap mode, amount, and read options. Taker defaults to the read or client account.
366
+ * @returns Quoted amount, oracle observation, rounding credit, and swap request.
367
+ */
368
+ export async function getSwapQuote<
369
+ chain extends Chain.Chain | undefined,
370
+ const parameters extends getSwapQuote.Parameters,
371
+ >(
372
+ client: Client.Client<chain>,
373
+ parameters: parameters,
374
+ ): Promise<getSwapQuote.ReturnValue<parameters>>
375
+ export async function getSwapQuote(
376
+ client: Client.Client,
377
+ parameters: getSwapQuote.Parameters,
378
+ ): Promise<getSwapQuote.ReturnValue> {
379
+ const account = parameters.account ?? client.account
380
+ const taker = parameters.taker ?? (account && Account.from(account).address)
381
+ if (!taker) throw new Error('A taker or client account is required to quote.')
382
+ const recipient =
383
+ parameters.recipient ?? (account && Account.from(account).address)
384
+ if (!recipient) throw new Account.NotFoundError()
385
+ const baseToQuote = parameters.baseToQuote ?? true
386
+ const customerId = parameters.customerId ?? Hex.padLeft(taker, 32)
387
+ const quote = {
388
+ ...parameters,
389
+ baseToQuote,
390
+ customerId,
391
+ recipient,
392
+ taker,
393
+ }
394
+ const [amount, price, updatedAt, creditAfter] =
395
+ quote.mode === 'exactInput'
396
+ ? await read(client, {
397
+ ...parameters,
398
+ ...getSwapQuote.call(quote),
399
+ as: 'Array',
400
+ })
401
+ : await read(client, {
402
+ ...parameters,
403
+ ...getSwapQuote.call(quote),
404
+ as: 'Array',
405
+ })
406
+ const request = {
407
+ baseToQuote,
408
+ customerId,
409
+ expectedOraclePrice: price,
410
+ minimumOracleUpdatedAt: updatedAt,
411
+ oraclePriceToleranceBps: 0n,
412
+ pool: parameters.pool,
413
+ recipient,
414
+ }
415
+ if (parameters.mode === 'exactInput')
416
+ return {
417
+ amountOut: amount,
418
+ price,
419
+ updatedAt,
420
+ creditAfter,
421
+ request: {
422
+ ...request,
423
+ amountIn: parameters.amountIn,
424
+ minAmountOut: amount,
425
+ mode: parameters.mode,
426
+ },
427
+ }
428
+ return {
429
+ amountIn: amount,
430
+ price,
431
+ updatedAt,
432
+ creditAfter,
433
+ request: {
434
+ ...request,
435
+ amountOut: parameters.amountOut,
436
+ maxAmountIn: amount,
437
+ mode: parameters.mode,
438
+ },
439
+ }
440
+ }
441
+
442
+ export namespace getSwapQuote {
443
+ export type Args = {
444
+ /** True sends base and receives quote; false sends quote and receives base. */
445
+ baseToQuote: boolean
446
+ /** Nonzero attribution and rounding-route identifier. */
447
+ customerId: Hex.Hex
448
+ /** Pool address. */
449
+ pool: Address.Address
450
+ /** Destination of the output token. */
451
+ recipient: Address.Address
452
+ /** Address that will call the swap. */
453
+ taker: Address.Address
454
+ } & (
455
+ | {
456
+ /** Exact-input quote. */
457
+ mode: 'exactInput'
458
+ /** Input amount in token base units. */
459
+ amountIn: bigint
460
+ }
461
+ | {
462
+ /** Exact-output quote. */
463
+ mode: 'exactOutput'
464
+ /** Output amount in token base units. */
465
+ amountOut: bigint
466
+ }
467
+ )
468
+
469
+ export type Parameters = ReadParameters &
470
+ UnionOmit<Args, 'baseToQuote' | 'customerId' | 'recipient' | 'taker'> & {
471
+ /** True sends base and receives quote. Defaults to true. */
472
+ baseToQuote?: boolean | undefined
473
+ /** Route identifier. Defaults to the taker address left-padded to 32 bytes. */
474
+ customerId?: Hex.Hex | undefined
475
+ /** Output destination. Defaults to the read account or client account. */
476
+ recipient?: Address.Address | undefined
477
+ /** Address that will call the swap. Defaults to the read account or client account. */
478
+ taker?: Address.Address | undefined
479
+ }
480
+
481
+ /** Quoted amount, oracle observation, rounding credit, and swap request. */
482
+
483
+ export type ReturnValue<parameters extends Parameters = Parameters> = Compute<
484
+ {
485
+ /** Oracle price used for the quote. */
486
+ price: bigint
487
+ /** Oracle observation timestamp. */
488
+ updatedAt: bigint
489
+ /** Route's remaining rounding credit. */
490
+ creditAfter: bigint
491
+ } & (parameters extends { mode: 'exactInput' }
492
+ ? {
493
+ /** Quoted output amount in token base units. */
494
+ amountOut: bigint
495
+ /** Swap inputs bound to this quote. */
496
+ request: Omit<
497
+ Extract<swap.Args, { mode: 'exactInput' }>,
498
+ 'deadline' | 'tradeId'
499
+ >
500
+ }
501
+ : {
502
+ /** Required input amount in token base units. */
503
+ amountIn: bigint
504
+ /** Swap inputs bound to this quote. */
505
+ request: Omit<
506
+ Extract<swap.Args, { mode: 'exactOutput' }>,
507
+ 'deadline' | 'tradeId'
508
+ >
509
+ })
510
+ >
511
+
512
+ /**
513
+ * Defines a route-aware quote call.
514
+ */
515
+ export function call(
516
+ parameters: Extract<Args, { mode: 'exactInput' }>,
517
+ ): ReturnType<typeof quoteExactInputCall>
518
+ export function call(
519
+ parameters: Extract<Args, { mode: 'exactOutput' }>,
520
+ ): ReturnType<typeof quoteExactOutputCall>
521
+ export function call(
522
+ parameters: Args,
523
+ ):
524
+ | ReturnType<typeof quoteExactInputCall>
525
+ | ReturnType<typeof quoteExactOutputCall>
526
+ export function call(parameters: Args) {
527
+ if (parameters.mode === 'exactInput') return quoteExactInputCall(parameters)
528
+ return quoteExactOutputCall(parameters)
529
+ }
530
+ }
531
+
532
+ function quoteExactInputCall(
533
+ parameters: Extract<getSwapQuote.Args, { mode: 'exactInput' }>,
534
+ ) {
535
+ const { amountIn, baseToQuote, customerId, pool, recipient, taker } =
536
+ parameters
537
+ return defineCall({
538
+ abi: Abis.directPropAmm,
539
+ address: pool,
540
+ args: [taker, recipient, customerId, baseToQuote, amountIn],
541
+ functionName: 'quoteExactInputFor',
542
+ })
543
+ }
544
+
545
+ function quoteExactOutputCall(
546
+ parameters: Extract<getSwapQuote.Args, { mode: 'exactOutput' }>,
547
+ ) {
548
+ const { amountOut, baseToQuote, customerId, pool, recipient, taker } =
549
+ parameters
550
+ return defineCall({
551
+ abi: Abis.directPropAmm,
552
+ address: pool,
553
+ args: [taker, recipient, customerId, baseToQuote, amountOut],
554
+ functionName: 'quoteExactOutputFor',
555
+ })
556
+ }
557
+
558
+ /**
559
+ * Internal exact-input contract call.
560
+ */
561
+ namespace exactInput {
562
+ export type Args = {
563
+ amountIn: bigint
564
+ baseToQuote: boolean
565
+ customerId: Hex.Hex
566
+ deadline: bigint
567
+ expectedOraclePrice: bigint
568
+ minAmountOut: bigint
569
+ minimumOracleUpdatedAt: bigint
570
+ oraclePriceToleranceBps: bigint
571
+ pool: Address.Address
572
+ recipient: Address.Address
573
+ tradeId: Hex.Hex
574
+ }
575
+
576
+ export function call({
577
+ amountIn,
578
+ baseToQuote,
579
+ customerId,
580
+ deadline,
581
+ expectedOraclePrice,
582
+ minAmountOut,
583
+ minimumOracleUpdatedAt,
584
+ oraclePriceToleranceBps,
585
+ pool,
586
+ recipient,
587
+ tradeId,
588
+ }: Args) {
589
+ return defineCall({
590
+ abi: Abis.directPropAmm,
591
+ address: pool,
592
+ args: [
593
+ baseToQuote,
594
+ amountIn,
595
+ minAmountOut,
596
+ recipient,
597
+ customerId,
598
+ tradeId,
599
+ deadline,
600
+ expectedOraclePrice,
601
+ oraclePriceToleranceBps,
602
+ minimumOracleUpdatedAt,
603
+ ],
604
+ functionName: 'swapExactInput',
605
+ })
606
+ }
607
+ }
608
+
609
+ /**
610
+ * Internal exact-output contract call.
611
+ */
612
+ namespace exactOutput {
613
+ export type Args = {
614
+ amountOut: bigint
615
+ baseToQuote: boolean
616
+ customerId: Hex.Hex
617
+ deadline: bigint
618
+ expectedOraclePrice: bigint
619
+ maxAmountIn: bigint
620
+ minimumOracleUpdatedAt: bigint
621
+ oraclePriceToleranceBps: bigint
622
+ pool: Address.Address
623
+ recipient: Address.Address
624
+ tradeId: Hex.Hex
625
+ }
626
+
627
+ export function call({
628
+ amountOut,
629
+ baseToQuote,
630
+ customerId,
631
+ deadline,
632
+ expectedOraclePrice,
633
+ maxAmountIn,
634
+ minimumOracleUpdatedAt,
635
+ oraclePriceToleranceBps,
636
+ pool,
637
+ recipient,
638
+ tradeId,
639
+ }: Args) {
640
+ return defineCall({
641
+ abi: Abis.directPropAmm,
642
+ address: pool,
643
+ args: [
644
+ baseToQuote,
645
+ amountOut,
646
+ maxAmountIn,
647
+ recipient,
648
+ customerId,
649
+ tradeId,
650
+ deadline,
651
+ expectedOraclePrice,
652
+ oraclePriceToleranceBps,
653
+ minimumOracleUpdatedAt,
654
+ ],
655
+ functionName: 'swapExactOutput',
656
+ })
657
+ }
658
+ }
659
+
660
+ /**
661
+ * Approves the input token and swaps through an allowed propAMM pool in one transaction.
662
+ *
663
+ * @example
664
+ * ```ts
665
+ * import { Client, http } from 'viem'
666
+ * import { tempo } from 'viem/chains'
667
+ * import { Actions } from 'viem/tempo'
668
+ *
669
+ * const client = Client.create({ chain: tempo, transport: http(), account: '0x...' })
670
+ *
671
+ * const hash = await Actions.propAmm.swap(client, {
672
+ * pool: '0x...',
673
+ * mode: 'exactInput',
674
+ * amountIn: 1_000_000n,
675
+ * minAmountOut: 1_000_000n,
676
+ * expectedOraclePrice: 1_000_000_000_000_000_000n,
677
+ * minimumOracleUpdatedAt: 1_799_999_000n,
678
+ * })
679
+ * ```
680
+ *
681
+ * @param client - Client.
682
+ * @param parameters - Swap and transaction options.
683
+ * @returns Transaction hash.
684
+ */
685
+ export async function swap<
686
+ chain extends Chain.Chain | undefined,
687
+ account extends Account.Account | undefined,
688
+ >(
689
+ client: Client.Client<chain, account>,
690
+ parameters: swap.Parameters<chain, account>,
691
+ ): Promise<swap.ReturnValue> {
692
+ return swap.inner(send, client, parameters)
693
+ }
694
+
695
+ export namespace swap {
696
+ export type Args = {
697
+ /** True sends base and receives quote; false sends quote and receives base. */
698
+ baseToQuote: boolean
699
+ /** Nonzero attribution and rounding-route identifier. */
700
+ customerId: Hex.Hex
701
+ /** Last accepted execution timestamp in seconds. */
702
+ deadline: bigint
703
+ /** Oracle price returned by the quote. */
704
+ expectedOraclePrice: bigint
705
+ /** Earliest accepted oracle observation timestamp. */
706
+ minimumOracleUpdatedAt: bigint
707
+ /** Accepted oracle-price movement in basis points. Zero binds exactly. */
708
+ oraclePriceToleranceBps: bigint
709
+ /** Pool address. */
710
+ pool: Address.Address
711
+ /** Destination of the output token. */
712
+ recipient: Address.Address
713
+ /** Trade attribution value, not replay protection. */
714
+ tradeId: Hex.Hex
715
+ } & (
716
+ | {
717
+ /** Exact-input swap. */
718
+ mode: 'exactInput'
719
+ /** Exact input amount in token base units. */
720
+ amountIn: bigint
721
+ /** Lowest accepted output in token base units. */
722
+ minAmountOut: bigint
723
+ }
724
+ | {
725
+ /** Exact-output swap. */
726
+ mode: 'exactOutput'
727
+ /** Exact output amount in token base units. */
728
+ amountOut: bigint
729
+ /** Highest accepted input in token base units; unused approval remains. */
730
+ maxAmountIn: bigint
731
+ }
732
+ )
733
+
734
+ export type InputArgs = UnionOmit<
735
+ Args,
736
+ | 'baseToQuote'
737
+ | 'customerId'
738
+ | 'deadline'
739
+ | 'oraclePriceToleranceBps'
740
+ | 'recipient'
741
+ | 'tradeId'
742
+ > & {
743
+ /** True sends base and receives quote. Defaults to true. */
744
+ baseToQuote?: boolean | undefined
745
+ /** Route identifier. Defaults to the sender address left-padded to 32 bytes. */
746
+ customerId?: Hex.Hex | undefined
747
+ /** Last accepted execution timestamp. Defaults to five minutes from now. */
748
+ deadline?: bigint | undefined
749
+ /** Output destination. Defaults to the sending account. */
750
+ recipient?: Address.Address | undefined
751
+ /** Accepted oracle-price movement in basis points. Defaults to zero. */
752
+ oraclePriceToleranceBps?: bigint | undefined
753
+ /** Trade attribution value. Defaults to a random 32-byte value per swap. */
754
+ tradeId?: Hex.Hex | undefined
755
+ }
756
+
757
+ export type Parameters<
758
+ chain extends Chain.Chain | undefined = Chain.Chain | undefined,
759
+ account extends Account.Account | undefined = Account.Account | undefined,
760
+ > = WriteParameters &
761
+ InputArgs &
762
+ ([chain, account] extends [unknown, unknown] ? unknown : never)
763
+
764
+ export type ReturnValue = send.ReturnType
765
+
766
+ export type ErrorType = Errors.GlobalErrorType
767
+
768
+ /** @internal */
769
+ export async function inner<
770
+ action extends typeof send | typeof sendSync,
771
+ chain extends Chain.Chain | undefined,
772
+ account extends Account.Account | undefined,
773
+ >(
774
+ action: action,
775
+ client: Client.Client<chain, account>,
776
+ parameters: Parameters<chain, account>,
777
+ ): Promise<dispatchSend.ReturnType<action>> {
778
+ return await dispatchSend(action, client, {
779
+ ...parameters,
780
+ calls: await getCalls(client, parameters),
781
+ })
782
+ }
783
+
784
+ async function getCalls<
785
+ chain extends Chain.Chain | undefined,
786
+ account extends Account.Account | undefined,
787
+ >(
788
+ client: Client.Client<chain, account>,
789
+ parameters: InputArgs & {
790
+ account?: Account.Account | Address.Address | null | undefined
791
+ },
792
+ ) {
793
+ const account = parameters.account ?? client.account
794
+ const recipient =
795
+ parameters.recipient ?? (account && Account.from(account).address)
796
+ if (!recipient) throw new Account.NotFoundError()
797
+ const customerId =
798
+ parameters.customerId ??
799
+ (account && Hex.padLeft(Account.from(account).address, 32))
800
+ if (!customerId) throw new Account.NotFoundError()
801
+ const baseToQuote = parameters.baseToQuote ?? true
802
+ const tokenIn = await (baseToQuote
803
+ ? baseToken(client, { pool: parameters.pool })
804
+ : quoteToken(client, { pool: parameters.pool }))
805
+ const amount =
806
+ parameters.mode === 'exactInput'
807
+ ? parameters.amountIn
808
+ : parameters.maxAmountIn
809
+ return [
810
+ tokenActions.approve.call(client, {
811
+ amount,
812
+ spender: parameters.pool,
813
+ token: tokenIn,
814
+ }),
815
+ swap.call({
816
+ ...parameters,
817
+ baseToQuote,
818
+ customerId,
819
+ deadline: parameters.deadline ?? BigInt(Expiry.minutes(5)),
820
+ tradeId: parameters.tradeId ?? Hex.random(32),
821
+ recipient,
822
+ oraclePriceToleranceBps: parameters.oraclePriceToleranceBps ?? 0n,
823
+ }),
824
+ ] as const
825
+ }
826
+
827
+ /**
828
+ * Estimates gas for the approval and swap transaction.
829
+ *
830
+ * @param client - Client.
831
+ * @param parameters - Swap and transaction options.
832
+ * @returns The gas estimate.
833
+ */
834
+ export async function estimateGas<
835
+ chain extends Chain.Chain | undefined,
836
+ account extends Account.Account | undefined,
837
+ >(
838
+ client: Client.Client<chain, account>,
839
+ parameters: Parameters<chain, account>,
840
+ ): Promise<bigint> {
841
+ return core_estimateGas(client, {
842
+ ...pickWriteParameters(parameters),
843
+ calls: await getCalls(client, parameters),
844
+ } as core_estimateGas.Options & {
845
+ calls: Awaited<ReturnType<typeof getCalls>>
846
+ })
847
+ }
848
+
849
+ /**
850
+ * Simulates the approval and swap calls without submitting a transaction.
851
+ *
852
+ * @param client - Client.
853
+ * @param parameters - Swap and simulation options.
854
+ * @returns The approval and swap simulation results.
855
+ */
856
+ export async function simulate<
857
+ chain extends Chain.Chain | undefined,
858
+ account extends Account.Account | undefined,
859
+ >(client: Client.Client<chain, account>, parameters: simulate.Parameters) {
860
+ const { blockNumber, blockTag, stateOverride, traceTransfers, validation } =
861
+ parameters
862
+ return multicall(client, {
863
+ mode: 'simulate',
864
+ account: parameters.account ?? client.account,
865
+ ...(blockNumber === undefined ? { blockTag } : { blockNumber }),
866
+ calls: await getCalls(client, parameters),
867
+ stateOverride,
868
+ traceTransfers,
869
+ validation,
870
+ })
871
+ }
872
+
873
+ export namespace simulate {
874
+ /** Swap inputs and batch simulation options. */
875
+ export type Parameters = InputArgs &
876
+ Omit<multicall.Options<readonly unknown[], 'simulate'>, 'calls' | 'mode'>
877
+ }
878
+
879
+ /**
880
+ * Defines the raw swap call without its input-token approval.
881
+ */
882
+ export function call(
883
+ parameters: Extract<Args, { mode: 'exactInput' }>,
884
+ ): ReturnType<typeof exactInput.call>
885
+ export function call(
886
+ parameters: Extract<Args, { mode: 'exactOutput' }>,
887
+ ): ReturnType<typeof exactOutput.call>
888
+ export function call(
889
+ parameters: Args,
890
+ ): ReturnType<typeof exactInput.call> | ReturnType<typeof exactOutput.call>
891
+ export function call(parameters: Args) {
892
+ if (parameters.mode === 'exactInput') return exactInput.call(parameters)
893
+ return exactOutput.call(parameters)
894
+ }
895
+
896
+ /**
897
+ * Extracts the unique matching trade event from a receipt.
898
+ */
899
+ export function extractEvent(
900
+ logs: readonly (AbiEvent.extractLogs.Log & { address: Address.Address })[],
901
+ args: { pool: Address.Address; tradeId: Hex.Hex },
902
+ ) {
903
+ const matching = AbiEvent.extractLogs(Abis.directPropAmm, logs, {
904
+ eventName: 'TradeExecuted',
905
+ strict: true,
906
+ }).filter(
907
+ (log) =>
908
+ Address.isEqual(log.address, args.pool) &&
909
+ log.args.tradeId.toLowerCase() === args.tradeId.toLowerCase(),
910
+ )
911
+ if (matching.length !== 1)
912
+ throw new Error(
913
+ `Expected one TradeExecuted event for pool ${args.pool} and trade ${args.tradeId}; found ${matching.length}.`,
914
+ )
915
+ return matching[0]!
916
+ }
917
+ }
918
+
919
+ /**
920
+ * Approves the input token, swaps, and returns the confirmed trade and receipt.
921
+ *
922
+ * @example
923
+ * ```ts
924
+ * import { Client, http } from 'viem'
925
+ * import { tempo } from 'viem/chains'
926
+ * import { Actions } from 'viem/tempo'
927
+ *
928
+ * const client = Client.create({ chain: tempo, transport: http(), account: '0x...' })
929
+ *
930
+ * const trade = await Actions.propAmm.swapSync(client, {
931
+ * pool: '0x...',
932
+ * mode: 'exactInput',
933
+ * amountIn: 1_000_000n,
934
+ * minAmountOut: 1_000_000n,
935
+ * expectedOraclePrice: 1_000_000_000_000_000_000n,
936
+ * minimumOracleUpdatedAt: 1_799_999_000n,
937
+ * })
938
+ * console.log(trade.amountOut, trade.receipt.transactionHash)
939
+ * ```
940
+ *
941
+ * @param client - Client.
942
+ * @param parameters - Swap and transaction options.
943
+ * @returns Confirmed trade data and receipt.
944
+ */
945
+ export async function swapSync<
946
+ chain extends Chain.Chain | undefined,
947
+ account extends Account.Account | undefined,
948
+ >(
949
+ client: Client.Client<chain, account>,
950
+ parameters: swapSync.Parameters<chain, account>,
951
+ ): Promise<swapSync.ReturnValue> {
952
+ const {
953
+ tradeId = Hex.random(32),
954
+ throwOnReceiptRevert = true,
955
+ ...rest
956
+ } = parameters
957
+ const receipt = await swap.inner(sendSync, client, {
958
+ ...rest,
959
+ throwOnReceiptRevert,
960
+ tradeId,
961
+ })
962
+ if ((receipt as TransactionReceipt).status === 'pending')
963
+ return { receipt } as swapSync.ReturnValue
964
+ const { args } = swap.extractEvent(receipt.logs, {
965
+ pool: parameters.pool,
966
+ tradeId,
967
+ })
968
+ return { ...args, receipt }
969
+ }
970
+
971
+ export namespace swapSync {
972
+ export type Args = swap.InputArgs
973
+
974
+ export type Parameters<
975
+ chain extends Chain.Chain | undefined = Chain.Chain | undefined,
976
+ account extends Account.Account | undefined = Account.Account | undefined,
977
+ > = swap.Parameters<chain, account>
978
+
979
+ export type ReturnValue = Compute<
980
+ ReturnType<typeof swap.extractEvent>['args'] & {
981
+ /** Confirmed receipt. */
982
+ receipt: TransactionReceipt
983
+ }
984
+ >
985
+ }