@lifi/sdk-provider-ethereum 4.0.14 → 4.2.0

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 (401) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/README.md +24 -8
  3. package/dist/cjs/EthereumProvider.d.ts +1 -2
  4. package/dist/cjs/EthereumProvider.js +5 -0
  5. package/dist/cjs/EthereumProvider.js.map +1 -1
  6. package/dist/cjs/actions/checkPermitSupport.d.ts +1 -2
  7. package/dist/cjs/actions/constants.d.ts +6 -7
  8. package/dist/cjs/actions/getAccountCode.d.ts +1 -2
  9. package/dist/cjs/actions/getAllowance.d.ts +4 -5
  10. package/dist/cjs/actions/getEthereumBalance.d.ts +1 -2
  11. package/dist/cjs/actions/getMaxPriorityFeePerGas.d.ts +1 -2
  12. package/dist/cjs/actions/getMulticallAddress.d.ts +1 -2
  13. package/dist/cjs/actions/isBatchingSupported.d.ts +1 -2
  14. package/dist/cjs/actions/isSafeSignature.d.ts +2 -3
  15. package/dist/cjs/actions/isSafeWallet.d.ts +1 -2
  16. package/dist/cjs/actions/isSmartContractWallet.d.ts +1 -2
  17. package/dist/cjs/actions/resolveENSAddress.d.ts +1 -2
  18. package/dist/cjs/actions/resolveEthereumAddress.d.ts +1 -2
  19. package/dist/cjs/actions/resolveTransactionHash.d.ts +1 -2
  20. package/dist/cjs/actions/resolveUNSAddress.d.ts +1 -2
  21. package/dist/cjs/actions/setAllowance.d.ts +3 -4
  22. package/dist/cjs/actions/waitForBatchTransactionReceipt.d.ts +1 -2
  23. package/dist/cjs/actions/waitForRelayedTransactionReceipt.d.ts +1 -2
  24. package/dist/cjs/actions/waitForSafeTransactionExecution.d.ts +2 -3
  25. package/dist/cjs/actions/waitForTransactionReceipt.d.ts +1 -2
  26. package/dist/cjs/client/publicClient.d.ts +1 -2
  27. package/dist/cjs/client/safeClient.d.ts +3 -4
  28. package/dist/cjs/client/types.d.ts +3 -4
  29. package/dist/cjs/core/EthereumStepExecutor.d.ts +1 -2
  30. package/dist/cjs/core/EthereumStepExecutor.js +2 -0
  31. package/dist/cjs/core/EthereumStepExecutor.js.map +1 -1
  32. package/dist/cjs/core/tasks/EthereumBatchedSignAndExecuteTask.d.ts +1 -2
  33. package/dist/cjs/core/tasks/EthereumBatchedWaitForTransactionTask.d.ts +1 -2
  34. package/dist/cjs/core/tasks/EthereumCheckAllowanceTask.d.ts +1 -2
  35. package/dist/cjs/core/tasks/EthereumCheckBalanceTask.d.ts +3 -4
  36. package/dist/cjs/core/tasks/EthereumCheckBalanceTask.js +6 -5
  37. package/dist/cjs/core/tasks/EthereumCheckBalanceTask.js.map +1 -1
  38. package/dist/cjs/core/tasks/EthereumCheckPermitsTask.d.ts +1 -2
  39. package/dist/cjs/core/tasks/EthereumCheckPermitsTask.js +11 -29
  40. package/dist/cjs/core/tasks/EthereumCheckPermitsTask.js.map +1 -1
  41. package/dist/cjs/core/tasks/EthereumNativePermitTask.d.ts +1 -2
  42. package/dist/cjs/core/tasks/EthereumNativePermitTask.js +2 -0
  43. package/dist/cjs/core/tasks/EthereumNativePermitTask.js.map +1 -1
  44. package/dist/cjs/core/tasks/EthereumPermit2AllowanceTask.d.ts +10 -0
  45. package/dist/cjs/core/tasks/EthereumPermit2AllowanceTask.js +33 -0
  46. package/dist/cjs/core/tasks/EthereumPermit2AllowanceTask.js.map +1 -0
  47. package/dist/cjs/core/tasks/EthereumPrepareTransactionTask.d.ts +1 -2
  48. package/dist/cjs/core/tasks/EthereumPrepareTransactionTask.js +6 -4
  49. package/dist/cjs/core/tasks/EthereumPrepareTransactionTask.js.map +1 -1
  50. package/dist/cjs/core/tasks/EthereumRelayedSignAndExecuteTask.d.ts +1 -2
  51. package/dist/cjs/core/tasks/EthereumRelayedSignAndExecuteTask.js +14 -27
  52. package/dist/cjs/core/tasks/EthereumRelayedSignAndExecuteTask.js.map +1 -1
  53. package/dist/cjs/core/tasks/EthereumRelayedWaitForTransactionTask.d.ts +1 -2
  54. package/dist/cjs/core/tasks/EthereumResetAllowanceTask.d.ts +1 -2
  55. package/dist/cjs/core/tasks/EthereumSetAllowanceTask.d.ts +1 -2
  56. package/dist/cjs/core/tasks/EthereumSetAllowanceTask.js +2 -3
  57. package/dist/cjs/core/tasks/EthereumSetAllowanceTask.js.map +1 -1
  58. package/dist/cjs/core/tasks/EthereumSignAndExecuteTask.d.ts +1 -2
  59. package/dist/cjs/core/tasks/EthereumStandardSignAndExecuteTask.d.ts +1 -2
  60. package/dist/cjs/core/tasks/EthereumStandardSignAndExecuteTask.js +3 -4
  61. package/dist/cjs/core/tasks/EthereumStandardSignAndExecuteTask.js.map +1 -1
  62. package/dist/cjs/core/tasks/EthereumStandardWaitForTransactionTask.d.ts +1 -2
  63. package/dist/cjs/core/tasks/EthereumWaitForTransactionStatusTask.d.ts +1 -2
  64. package/dist/cjs/core/tasks/EthereumWaitForTransactionTask.d.ts +1 -2
  65. package/dist/cjs/core/tasks/helpers/estimateTransactionRequest.d.ts +1 -2
  66. package/dist/cjs/core/tasks/helpers/findSignedNativePermit.d.ts +7 -0
  67. package/dist/cjs/core/tasks/helpers/findSignedNativePermit.js +15 -0
  68. package/dist/cjs/core/tasks/helpers/findSignedNativePermit.js.map +1 -0
  69. package/dist/cjs/core/tasks/helpers/getApprovalAmount.d.ts +6 -0
  70. package/dist/cjs/core/tasks/helpers/getApprovalAmount.js +16 -0
  71. package/dist/cjs/core/tasks/helpers/getApprovalAmount.js.map +1 -0
  72. package/dist/cjs/core/tasks/helpers/getEthereumExecutionStrategy.d.ts +7 -2
  73. package/dist/cjs/core/tasks/helpers/getEthereumExecutionStrategy.js +12 -4
  74. package/dist/cjs/core/tasks/helpers/getEthereumExecutionStrategy.js.map +1 -1
  75. package/dist/cjs/core/tasks/helpers/getTxLink.d.ts +1 -2
  76. package/dist/cjs/core/tasks/helpers/getUpdatedStep.d.ts +3 -3
  77. package/dist/cjs/core/tasks/helpers/getUpdatedStep.js +4 -4
  78. package/dist/cjs/core/tasks/helpers/getUpdatedStep.js.map +1 -1
  79. package/dist/cjs/core/tasks/helpers/hasPermit2AllowanceInFlight.d.ts +8 -0
  80. package/dist/cjs/core/tasks/helpers/hasPermit2AllowanceInFlight.js +17 -0
  81. package/dist/cjs/core/tasks/helpers/hasPermit2AllowanceInFlight.js.map +1 -0
  82. package/dist/cjs/core/tasks/helpers/isTypedDataAlreadySigned.d.ts +6 -0
  83. package/dist/cjs/core/tasks/helpers/isTypedDataAlreadySigned.js +29 -0
  84. package/dist/cjs/core/tasks/helpers/isTypedDataAlreadySigned.js.map +1 -0
  85. package/dist/cjs/core/tasks/helpers/preservePermit2Allowances.d.ts +11 -0
  86. package/dist/cjs/core/tasks/helpers/preservePermit2Allowances.js +22 -0
  87. package/dist/cjs/core/tasks/helpers/preservePermit2Allowances.js.map +1 -0
  88. package/dist/cjs/core/tasks/helpers/resolvePermit2Support.d.ts +1 -2
  89. package/dist/cjs/core/tasks/helpers/resolvePermit2Support.js +2 -1
  90. package/dist/cjs/core/tasks/helpers/resolvePermit2Support.js.map +1 -1
  91. package/dist/cjs/core/tasks/helpers/shouldCheckForAllowance.d.ts +1 -2
  92. package/dist/cjs/core/tasks/helpers/signHyperliquidTypedData.d.ts +1 -2
  93. package/dist/cjs/core/tasks/helpers/signHyperliquidTypedData.js +3 -3
  94. package/dist/cjs/core/tasks/helpers/signHyperliquidTypedData.js.map +1 -1
  95. package/dist/cjs/core/tasks/helpers/signTypedDataEntries.d.ts +13 -0
  96. package/dist/cjs/core/tasks/helpers/signTypedDataEntries.js +37 -0
  97. package/dist/cjs/core/tasks/helpers/signTypedDataEntries.js.map +1 -0
  98. package/dist/cjs/core/tasks/helpers/switchChain.d.ts +1 -2
  99. package/dist/cjs/core/tasks/helpers/updateActionWithReceipt.d.ts +1 -2
  100. package/dist/cjs/errors/parseEthereumErrors.d.ts +2 -3
  101. package/dist/cjs/hyperliquid/agentWallet.d.ts +2 -3
  102. package/dist/cjs/hyperliquid/isHyperliquidAgentStep.d.ts +4 -5
  103. package/dist/cjs/index.d.ts +1 -2
  104. package/dist/cjs/index.js +1 -3
  105. package/dist/cjs/permits/acceptsRawEcdsaSignature.d.ts +1 -2
  106. package/dist/cjs/permits/allowanceTransfer.d.ts +12 -13
  107. package/dist/cjs/permits/canAccountUseNativePermits.d.ts +1 -2
  108. package/dist/cjs/permits/canAccountUsePermit2.d.ts +1 -2
  109. package/dist/cjs/permits/constants.d.ts +20 -21
  110. package/dist/cjs/permits/domain.d.ts +1 -2
  111. package/dist/cjs/permits/encodeNativePermitData.d.ts +1 -2
  112. package/dist/cjs/permits/encodePermit2Data.d.ts +1 -2
  113. package/dist/cjs/permits/getNativePermit.d.ts +1 -2
  114. package/dist/cjs/permits/getPermitTransferFromValues.d.ts +1 -2
  115. package/dist/cjs/permits/invariant.d.ts +1 -2
  116. package/dist/cjs/permits/isDelegationDesignatorCode.d.ts +1 -2
  117. package/dist/cjs/permits/isNativePermitValid.d.ts +1 -2
  118. package/dist/cjs/permits/signPermit2Message.d.ts +1 -2
  119. package/dist/cjs/permits/signatureTransfer.d.ts +11 -12
  120. package/dist/cjs/permits/types.d.ts +3 -4
  121. package/dist/cjs/types.d.ts +13 -14
  122. package/dist/cjs/utils/abi.d.ts +6 -7
  123. package/dist/cjs/utils/convertExtendedChain.d.ts +1 -2
  124. package/dist/cjs/utils/getActionWithFallback.d.ts +1 -2
  125. package/dist/cjs/utils/getDomainChainId.d.ts +1 -2
  126. package/dist/cjs/utils/getSafeApiKey.d.ts +1 -2
  127. package/dist/cjs/utils/getTypedDataLane.d.ts +15 -0
  128. package/dist/cjs/utils/getTypedDataLane.js +33 -0
  129. package/dist/cjs/utils/getTypedDataLane.js.map +1 -0
  130. package/dist/cjs/utils/isContractCallStep.d.ts +1 -2
  131. package/dist/cjs/utils/isExtendedChain.d.ts +1 -2
  132. package/dist/cjs/utils/isGaslessStep.d.ts +4 -3
  133. package/dist/cjs/utils/isGaslessStep.js +7 -1
  134. package/dist/cjs/utils/isGaslessStep.js.map +1 -1
  135. package/dist/cjs/utils/isValidSignature.d.ts +2 -3
  136. package/dist/cjs/utils/isZeroAddress.d.ts +3 -4
  137. package/dist/cjs/utils/median.d.ts +1 -2
  138. package/dist/cjs/version.d.ts +2 -3
  139. package/dist/cjs/version.js +1 -1
  140. package/dist/cjs/version.js.map +1 -1
  141. package/dist/esm/EthereumProvider.d.ts +1 -2
  142. package/dist/esm/EthereumProvider.d.ts.map +1 -1
  143. package/dist/esm/EthereumProvider.js +5 -0
  144. package/dist/esm/EthereumProvider.js.map +1 -1
  145. package/dist/esm/actions/checkPermitSupport.d.ts +1 -2
  146. package/dist/esm/actions/checkPermitSupport.d.ts.map +1 -1
  147. package/dist/esm/actions/constants.d.ts +6 -7
  148. package/dist/esm/actions/constants.d.ts.map +1 -1
  149. package/dist/esm/actions/getAccountCode.d.ts +1 -2
  150. package/dist/esm/actions/getAccountCode.d.ts.map +1 -1
  151. package/dist/esm/actions/getAllowance.d.ts +4 -5
  152. package/dist/esm/actions/getAllowance.d.ts.map +1 -1
  153. package/dist/esm/actions/getEthereumBalance.d.ts +1 -2
  154. package/dist/esm/actions/getEthereumBalance.d.ts.map +1 -1
  155. package/dist/esm/actions/getMaxPriorityFeePerGas.d.ts +1 -2
  156. package/dist/esm/actions/getMaxPriorityFeePerGas.d.ts.map +1 -1
  157. package/dist/esm/actions/getMulticallAddress.d.ts +1 -2
  158. package/dist/esm/actions/getMulticallAddress.d.ts.map +1 -1
  159. package/dist/esm/actions/isBatchingSupported.d.ts +1 -2
  160. package/dist/esm/actions/isBatchingSupported.d.ts.map +1 -1
  161. package/dist/esm/actions/isSafeSignature.d.ts +2 -3
  162. package/dist/esm/actions/isSafeSignature.d.ts.map +1 -1
  163. package/dist/esm/actions/isSafeWallet.d.ts +1 -2
  164. package/dist/esm/actions/isSafeWallet.d.ts.map +1 -1
  165. package/dist/esm/actions/isSmartContractWallet.d.ts +1 -2
  166. package/dist/esm/actions/isSmartContractWallet.d.ts.map +1 -1
  167. package/dist/esm/actions/resolveENSAddress.d.ts +1 -2
  168. package/dist/esm/actions/resolveENSAddress.d.ts.map +1 -1
  169. package/dist/esm/actions/resolveEthereumAddress.d.ts +1 -2
  170. package/dist/esm/actions/resolveEthereumAddress.d.ts.map +1 -1
  171. package/dist/esm/actions/resolveTransactionHash.d.ts +1 -2
  172. package/dist/esm/actions/resolveTransactionHash.d.ts.map +1 -1
  173. package/dist/esm/actions/resolveUNSAddress.d.ts +1 -2
  174. package/dist/esm/actions/resolveUNSAddress.d.ts.map +1 -1
  175. package/dist/esm/actions/setAllowance.d.ts +3 -4
  176. package/dist/esm/actions/setAllowance.d.ts.map +1 -1
  177. package/dist/esm/actions/waitForBatchTransactionReceipt.d.ts +1 -2
  178. package/dist/esm/actions/waitForBatchTransactionReceipt.d.ts.map +1 -1
  179. package/dist/esm/actions/waitForRelayedTransactionReceipt.d.ts +1 -2
  180. package/dist/esm/actions/waitForRelayedTransactionReceipt.d.ts.map +1 -1
  181. package/dist/esm/actions/waitForSafeTransactionExecution.d.ts +2 -3
  182. package/dist/esm/actions/waitForSafeTransactionExecution.d.ts.map +1 -1
  183. package/dist/esm/actions/waitForTransactionReceipt.d.ts +1 -2
  184. package/dist/esm/actions/waitForTransactionReceipt.d.ts.map +1 -1
  185. package/dist/esm/client/publicClient.d.ts +1 -2
  186. package/dist/esm/client/publicClient.d.ts.map +1 -1
  187. package/dist/esm/client/safeClient.d.ts +3 -4
  188. package/dist/esm/client/safeClient.d.ts.map +1 -1
  189. package/dist/esm/client/types.d.ts +3 -4
  190. package/dist/esm/client/types.d.ts.map +1 -1
  191. package/dist/esm/core/EthereumStepExecutor.d.ts +1 -2
  192. package/dist/esm/core/EthereumStepExecutor.d.ts.map +1 -1
  193. package/dist/esm/core/EthereumStepExecutor.js +2 -0
  194. package/dist/esm/core/EthereumStepExecutor.js.map +1 -1
  195. package/dist/esm/core/tasks/EthereumBatchedSignAndExecuteTask.d.ts +1 -2
  196. package/dist/esm/core/tasks/EthereumBatchedSignAndExecuteTask.d.ts.map +1 -1
  197. package/dist/esm/core/tasks/EthereumBatchedWaitForTransactionTask.d.ts +1 -2
  198. package/dist/esm/core/tasks/EthereumBatchedWaitForTransactionTask.d.ts.map +1 -1
  199. package/dist/esm/core/tasks/EthereumCheckAllowanceTask.d.ts +1 -2
  200. package/dist/esm/core/tasks/EthereumCheckAllowanceTask.d.ts.map +1 -1
  201. package/dist/esm/core/tasks/EthereumCheckBalanceTask.d.ts +3 -4
  202. package/dist/esm/core/tasks/EthereumCheckBalanceTask.d.ts.map +1 -1
  203. package/dist/esm/core/tasks/EthereumCheckBalanceTask.js +6 -5
  204. package/dist/esm/core/tasks/EthereumCheckBalanceTask.js.map +1 -1
  205. package/dist/esm/core/tasks/EthereumCheckPermitsTask.d.ts +1 -2
  206. package/dist/esm/core/tasks/EthereumCheckPermitsTask.d.ts.map +1 -1
  207. package/dist/esm/core/tasks/EthereumCheckPermitsTask.js +11 -29
  208. package/dist/esm/core/tasks/EthereumCheckPermitsTask.js.map +1 -1
  209. package/dist/esm/core/tasks/EthereumNativePermitTask.d.ts +1 -2
  210. package/dist/esm/core/tasks/EthereumNativePermitTask.d.ts.map +1 -1
  211. package/dist/esm/core/tasks/EthereumNativePermitTask.js +2 -0
  212. package/dist/esm/core/tasks/EthereumNativePermitTask.js.map +1 -1
  213. package/dist/esm/core/tasks/EthereumPermit2AllowanceTask.d.ts +10 -0
  214. package/dist/esm/core/tasks/EthereumPermit2AllowanceTask.d.ts.map +1 -0
  215. package/dist/esm/core/tasks/EthereumPermit2AllowanceTask.js +32 -0
  216. package/dist/esm/core/tasks/EthereumPermit2AllowanceTask.js.map +1 -0
  217. package/dist/esm/core/tasks/EthereumPrepareTransactionTask.d.ts +1 -2
  218. package/dist/esm/core/tasks/EthereumPrepareTransactionTask.d.ts.map +1 -1
  219. package/dist/esm/core/tasks/EthereumPrepareTransactionTask.js +6 -4
  220. package/dist/esm/core/tasks/EthereumPrepareTransactionTask.js.map +1 -1
  221. package/dist/esm/core/tasks/EthereumRelayedSignAndExecuteTask.d.ts +1 -2
  222. package/dist/esm/core/tasks/EthereumRelayedSignAndExecuteTask.d.ts.map +1 -1
  223. package/dist/esm/core/tasks/EthereumRelayedSignAndExecuteTask.js +14 -27
  224. package/dist/esm/core/tasks/EthereumRelayedSignAndExecuteTask.js.map +1 -1
  225. package/dist/esm/core/tasks/EthereumRelayedWaitForTransactionTask.d.ts +1 -2
  226. package/dist/esm/core/tasks/EthereumRelayedWaitForTransactionTask.d.ts.map +1 -1
  227. package/dist/esm/core/tasks/EthereumResetAllowanceTask.d.ts +1 -2
  228. package/dist/esm/core/tasks/EthereumResetAllowanceTask.d.ts.map +1 -1
  229. package/dist/esm/core/tasks/EthereumSetAllowanceTask.d.ts +1 -2
  230. package/dist/esm/core/tasks/EthereumSetAllowanceTask.d.ts.map +1 -1
  231. package/dist/esm/core/tasks/EthereumSetAllowanceTask.js +2 -3
  232. package/dist/esm/core/tasks/EthereumSetAllowanceTask.js.map +1 -1
  233. package/dist/esm/core/tasks/EthereumSignAndExecuteTask.d.ts +1 -2
  234. package/dist/esm/core/tasks/EthereumSignAndExecuteTask.d.ts.map +1 -1
  235. package/dist/esm/core/tasks/EthereumStandardSignAndExecuteTask.d.ts +1 -2
  236. package/dist/esm/core/tasks/EthereumStandardSignAndExecuteTask.d.ts.map +1 -1
  237. package/dist/esm/core/tasks/EthereumStandardSignAndExecuteTask.js +3 -4
  238. package/dist/esm/core/tasks/EthereumStandardSignAndExecuteTask.js.map +1 -1
  239. package/dist/esm/core/tasks/EthereumStandardWaitForTransactionTask.d.ts +1 -2
  240. package/dist/esm/core/tasks/EthereumStandardWaitForTransactionTask.d.ts.map +1 -1
  241. package/dist/esm/core/tasks/EthereumWaitForTransactionStatusTask.d.ts +1 -2
  242. package/dist/esm/core/tasks/EthereumWaitForTransactionStatusTask.d.ts.map +1 -1
  243. package/dist/esm/core/tasks/EthereumWaitForTransactionTask.d.ts +1 -2
  244. package/dist/esm/core/tasks/EthereumWaitForTransactionTask.d.ts.map +1 -1
  245. package/dist/esm/core/tasks/helpers/estimateTransactionRequest.d.ts +1 -2
  246. package/dist/esm/core/tasks/helpers/estimateTransactionRequest.d.ts.map +1 -1
  247. package/dist/esm/core/tasks/helpers/findSignedNativePermit.d.ts +7 -0
  248. package/dist/esm/core/tasks/helpers/findSignedNativePermit.d.ts.map +1 -0
  249. package/dist/esm/core/tasks/helpers/findSignedNativePermit.js +14 -0
  250. package/dist/esm/core/tasks/helpers/findSignedNativePermit.js.map +1 -0
  251. package/dist/esm/core/tasks/helpers/getApprovalAmount.d.ts +6 -0
  252. package/dist/esm/core/tasks/helpers/getApprovalAmount.d.ts.map +1 -0
  253. package/dist/esm/core/tasks/helpers/getApprovalAmount.js +15 -0
  254. package/dist/esm/core/tasks/helpers/getApprovalAmount.js.map +1 -0
  255. package/dist/esm/core/tasks/helpers/getEthereumExecutionStrategy.d.ts +7 -2
  256. package/dist/esm/core/tasks/helpers/getEthereumExecutionStrategy.d.ts.map +1 -1
  257. package/dist/esm/core/tasks/helpers/getEthereumExecutionStrategy.js +12 -4
  258. package/dist/esm/core/tasks/helpers/getEthereumExecutionStrategy.js.map +1 -1
  259. package/dist/esm/core/tasks/helpers/getTxLink.d.ts +1 -2
  260. package/dist/esm/core/tasks/helpers/getTxLink.d.ts.map +1 -1
  261. package/dist/esm/core/tasks/helpers/getUpdatedStep.d.ts +3 -3
  262. package/dist/esm/core/tasks/helpers/getUpdatedStep.d.ts.map +1 -1
  263. package/dist/esm/core/tasks/helpers/getUpdatedStep.js +4 -4
  264. package/dist/esm/core/tasks/helpers/getUpdatedStep.js.map +1 -1
  265. package/dist/esm/core/tasks/helpers/hasPermit2AllowanceInFlight.d.ts +8 -0
  266. package/dist/esm/core/tasks/helpers/hasPermit2AllowanceInFlight.d.ts.map +1 -0
  267. package/dist/esm/core/tasks/helpers/hasPermit2AllowanceInFlight.js +15 -0
  268. package/dist/esm/core/tasks/helpers/hasPermit2AllowanceInFlight.js.map +1 -0
  269. package/dist/esm/core/tasks/helpers/isTypedDataAlreadySigned.d.ts +6 -0
  270. package/dist/esm/core/tasks/helpers/isTypedDataAlreadySigned.d.ts.map +1 -0
  271. package/dist/esm/core/tasks/helpers/isTypedDataAlreadySigned.js +28 -0
  272. package/dist/esm/core/tasks/helpers/isTypedDataAlreadySigned.js.map +1 -0
  273. package/dist/esm/core/tasks/helpers/preservePermit2Allowances.d.ts +11 -0
  274. package/dist/esm/core/tasks/helpers/preservePermit2Allowances.d.ts.map +1 -0
  275. package/dist/esm/core/tasks/helpers/preservePermit2Allowances.js +21 -0
  276. package/dist/esm/core/tasks/helpers/preservePermit2Allowances.js.map +1 -0
  277. package/dist/esm/core/tasks/helpers/resolvePermit2Support.d.ts +1 -2
  278. package/dist/esm/core/tasks/helpers/resolvePermit2Support.d.ts.map +1 -1
  279. package/dist/esm/core/tasks/helpers/resolvePermit2Support.js +2 -1
  280. package/dist/esm/core/tasks/helpers/resolvePermit2Support.js.map +1 -1
  281. package/dist/esm/core/tasks/helpers/shouldCheckForAllowance.d.ts +1 -2
  282. package/dist/esm/core/tasks/helpers/shouldCheckForAllowance.d.ts.map +1 -1
  283. package/dist/esm/core/tasks/helpers/signHyperliquidTypedData.d.ts +1 -2
  284. package/dist/esm/core/tasks/helpers/signHyperliquidTypedData.d.ts.map +1 -1
  285. package/dist/esm/core/tasks/helpers/signHyperliquidTypedData.js +3 -3
  286. package/dist/esm/core/tasks/helpers/signHyperliquidTypedData.js.map +1 -1
  287. package/dist/esm/core/tasks/helpers/signTypedDataEntries.d.ts +13 -0
  288. package/dist/esm/core/tasks/helpers/signTypedDataEntries.d.ts.map +1 -0
  289. package/dist/esm/core/tasks/helpers/signTypedDataEntries.js +36 -0
  290. package/dist/esm/core/tasks/helpers/signTypedDataEntries.js.map +1 -0
  291. package/dist/esm/core/tasks/helpers/switchChain.d.ts +1 -2
  292. package/dist/esm/core/tasks/helpers/switchChain.d.ts.map +1 -1
  293. package/dist/esm/core/tasks/helpers/updateActionWithReceipt.d.ts +1 -2
  294. package/dist/esm/core/tasks/helpers/updateActionWithReceipt.d.ts.map +1 -1
  295. package/dist/esm/errors/parseEthereumErrors.d.ts +2 -3
  296. package/dist/esm/errors/parseEthereumErrors.d.ts.map +1 -1
  297. package/dist/esm/hyperliquid/agentWallet.d.ts +2 -3
  298. package/dist/esm/hyperliquid/agentWallet.d.ts.map +1 -1
  299. package/dist/esm/hyperliquid/isHyperliquidAgentStep.d.ts +4 -5
  300. package/dist/esm/hyperliquid/isHyperliquidAgentStep.d.ts.map +1 -1
  301. package/dist/esm/index.d.ts +1 -2
  302. package/dist/esm/index.js +2 -3
  303. package/dist/esm/permits/acceptsRawEcdsaSignature.d.ts +1 -2
  304. package/dist/esm/permits/acceptsRawEcdsaSignature.d.ts.map +1 -1
  305. package/dist/esm/permits/allowanceTransfer.d.ts +12 -13
  306. package/dist/esm/permits/allowanceTransfer.d.ts.map +1 -1
  307. package/dist/esm/permits/canAccountUseNativePermits.d.ts +1 -2
  308. package/dist/esm/permits/canAccountUseNativePermits.d.ts.map +1 -1
  309. package/dist/esm/permits/canAccountUsePermit2.d.ts +1 -2
  310. package/dist/esm/permits/canAccountUsePermit2.d.ts.map +1 -1
  311. package/dist/esm/permits/constants.d.ts +20 -21
  312. package/dist/esm/permits/constants.d.ts.map +1 -1
  313. package/dist/esm/permits/domain.d.ts +1 -2
  314. package/dist/esm/permits/domain.d.ts.map +1 -1
  315. package/dist/esm/permits/encodeNativePermitData.d.ts +1 -2
  316. package/dist/esm/permits/encodeNativePermitData.d.ts.map +1 -1
  317. package/dist/esm/permits/encodePermit2Data.d.ts +1 -2
  318. package/dist/esm/permits/encodePermit2Data.d.ts.map +1 -1
  319. package/dist/esm/permits/getNativePermit.d.ts +1 -2
  320. package/dist/esm/permits/getNativePermit.d.ts.map +1 -1
  321. package/dist/esm/permits/getPermitTransferFromValues.d.ts +1 -2
  322. package/dist/esm/permits/getPermitTransferFromValues.d.ts.map +1 -1
  323. package/dist/esm/permits/invariant.d.ts +1 -2
  324. package/dist/esm/permits/invariant.d.ts.map +1 -1
  325. package/dist/esm/permits/isDelegationDesignatorCode.d.ts +1 -2
  326. package/dist/esm/permits/isDelegationDesignatorCode.d.ts.map +1 -1
  327. package/dist/esm/permits/isNativePermitValid.d.ts +1 -2
  328. package/dist/esm/permits/isNativePermitValid.d.ts.map +1 -1
  329. package/dist/esm/permits/signPermit2Message.d.ts +1 -2
  330. package/dist/esm/permits/signPermit2Message.d.ts.map +1 -1
  331. package/dist/esm/permits/signatureTransfer.d.ts +11 -12
  332. package/dist/esm/permits/signatureTransfer.d.ts.map +1 -1
  333. package/dist/esm/permits/types.d.ts +3 -4
  334. package/dist/esm/permits/types.d.ts.map +1 -1
  335. package/dist/esm/types.d.ts +13 -14
  336. package/dist/esm/types.d.ts.map +1 -1
  337. package/dist/esm/utils/abi.d.ts +6 -7
  338. package/dist/esm/utils/abi.d.ts.map +1 -1
  339. package/dist/esm/utils/convertExtendedChain.d.ts +1 -2
  340. package/dist/esm/utils/convertExtendedChain.d.ts.map +1 -1
  341. package/dist/esm/utils/getActionWithFallback.d.ts +1 -2
  342. package/dist/esm/utils/getActionWithFallback.d.ts.map +1 -1
  343. package/dist/esm/utils/getDomainChainId.d.ts +1 -2
  344. package/dist/esm/utils/getDomainChainId.d.ts.map +1 -1
  345. package/dist/esm/utils/getSafeApiKey.d.ts +1 -2
  346. package/dist/esm/utils/getSafeApiKey.d.ts.map +1 -1
  347. package/dist/esm/utils/getTypedDataLane.d.ts +15 -0
  348. package/dist/esm/utils/getTypedDataLane.d.ts.map +1 -0
  349. package/dist/esm/utils/getTypedDataLane.js +28 -0
  350. package/dist/esm/utils/getTypedDataLane.js.map +1 -0
  351. package/dist/esm/utils/isContractCallStep.d.ts +1 -2
  352. package/dist/esm/utils/isContractCallStep.d.ts.map +1 -1
  353. package/dist/esm/utils/isExtendedChain.d.ts +1 -2
  354. package/dist/esm/utils/isExtendedChain.d.ts.map +1 -1
  355. package/dist/esm/utils/isGaslessStep.d.ts +4 -3
  356. package/dist/esm/utils/isGaslessStep.d.ts.map +1 -1
  357. package/dist/esm/utils/isGaslessStep.js +7 -2
  358. package/dist/esm/utils/isGaslessStep.js.map +1 -1
  359. package/dist/esm/utils/isValidSignature.d.ts +2 -3
  360. package/dist/esm/utils/isValidSignature.d.ts.map +1 -1
  361. package/dist/esm/utils/isZeroAddress.d.ts +3 -4
  362. package/dist/esm/utils/isZeroAddress.d.ts.map +1 -1
  363. package/dist/esm/utils/median.d.ts +1 -2
  364. package/dist/esm/utils/median.d.ts.map +1 -1
  365. package/dist/esm/version.d.ts +2 -3
  366. package/dist/esm/version.d.ts.map +1 -1
  367. package/dist/esm/version.js +1 -1
  368. package/dist/esm/version.js.map +1 -1
  369. package/package.json +3 -3
  370. package/src/EthereumProvider.ts +6 -0
  371. package/src/core/EthereumStepExecutor.ts +2 -0
  372. package/src/core/tasks/EthereumCheckBalanceTask.ts +6 -7
  373. package/src/core/tasks/EthereumCheckPermitsTask.ts +31 -63
  374. package/src/core/tasks/EthereumNativePermitTask.ts +5 -0
  375. package/src/core/tasks/EthereumPermit2AllowanceTask.ts +53 -0
  376. package/src/core/tasks/EthereumPrepareTransactionTask.ts +11 -2
  377. package/src/core/tasks/EthereumRelayedSignAndExecuteTask.ts +25 -47
  378. package/src/core/tasks/EthereumSetAllowanceTask.ts +2 -3
  379. package/src/core/tasks/EthereumStandardSignAndExecuteTask.ts +2 -9
  380. package/src/core/tasks/helpers/findSignedNativePermit.ts +23 -0
  381. package/src/core/tasks/helpers/getApprovalAmount.ts +30 -0
  382. package/src/core/tasks/helpers/getEthereumExecutionStrategy.ts +31 -5
  383. package/src/core/tasks/helpers/getUpdatedStep.ts +7 -2
  384. package/src/core/tasks/helpers/hasPermit2AllowanceInFlight.ts +31 -0
  385. package/src/core/tasks/helpers/isTypedDataAlreadySigned.ts +56 -0
  386. package/src/core/tasks/helpers/preservePermit2Allowances.ts +44 -0
  387. package/src/core/tasks/helpers/resolvePermit2Support.ts +3 -1
  388. package/src/core/tasks/helpers/signHyperliquidTypedData.ts +3 -3
  389. package/src/core/tasks/helpers/signTypedDataEntries.ts +70 -0
  390. package/src/index.ts +0 -1
  391. package/src/utils/getTypedDataLane.ts +76 -0
  392. package/src/utils/isGaslessStep.ts +22 -9
  393. package/src/version.ts +1 -1
  394. package/dist/cjs/utils/isRelayerStep.d.ts +0 -7
  395. package/dist/cjs/utils/isRelayerStep.js +0 -9
  396. package/dist/cjs/utils/isRelayerStep.js.map +0 -1
  397. package/dist/esm/utils/isRelayerStep.d.ts +0 -7
  398. package/dist/esm/utils/isRelayerStep.d.ts.map +0 -1
  399. package/dist/esm/utils/isRelayerStep.js +0 -8
  400. package/dist/esm/utils/isRelayerStep.js.map +0 -1
  401. package/src/utils/isRelayerStep.ts +0 -8
@@ -1 +1 @@
1
- {"version":3,"file":"setAllowance.d.ts","names":[],"sources":["../../../src/actions/setAllowance.ts"],"mappings":";;;;cAqBa,eACX,QAAQ,WACR,YAAY,QACZ,cAAc,SACd,iBAAiB,SACjB,gBACA,mBAAmB,kBACnB,yCACC,QAAQ,OAAO;;;;;;;;;;;cA0DL,oBACX,QAAQ,aACN,cAAc,OAAO,gBAAgB,UAAU,wBAChD,QAAQ;;;;;;;;;;cAmCE,sBACX,QAAQ,aACN,cAAc,OAAO,kBAAkB,0BACxC,QAAQ"}
1
+ {"version":3,"file":"setAllowance.d.ts","names":[],"sources":["../../../src/actions/setAllowance.ts"],"mappings":";;;;qBAqBa,eACX,QAAQ,WACR,YAAY,QACZ,cAAc,SACd,iBAAiB,SACjB,gBACA,mBAAmB,kBACnB,yCACC,QAAQ,OAAO;;;;;;;;;;;qBA0DL,oBACX,QAAQ,aACN,cAAc,OAAO,gBAAgB,UAAU,wBAChD,QAAQ;;;;;;;;;;qBAmCE,sBACX,QAAQ,aACN,cAAc,OAAO,kBAAkB,0BACxC,QAAQ"}
@@ -2,7 +2,6 @@ import { WalletCallReceipt as WalletCallReceipt$1 } from "../types.js";
2
2
  import { Client, Hash } from "viem";
3
3
  import { GetCallsStatusReturnType } from "viem/actions";
4
4
  //#region src/actions/waitForBatchTransactionReceipt.d.ts
5
- declare const waitForBatchTransactionReceipt: (client: Client, batchHash: Hash, onFailed?: (result: GetCallsStatusReturnType) => void) => Promise<WalletCallReceipt$1>;
5
+ export declare const waitForBatchTransactionReceipt: (client: Client, batchHash: Hash, onFailed?: (result: GetCallsStatusReturnType) => void) => Promise<WalletCallReceipt$1>;
6
6
  //#endregion
7
- export { waitForBatchTransactionReceipt };
8
7
  //# sourceMappingURL=waitForBatchTransactionReceipt.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"waitForBatchTransactionReceipt.d.ts","names":[],"sources":["../../../src/actions/waitForBatchTransactionReceipt.ts"],"mappings":";;;;cAMa,iCACX,QAAQ,QACR,WAAW,MACX,YAAY,QAAQ,sCACnB,QAAQ"}
1
+ {"version":3,"file":"waitForBatchTransactionReceipt.d.ts","names":[],"sources":["../../../src/actions/waitForBatchTransactionReceipt.ts"],"mappings":";;;;qBAMa,iCACX,QAAQ,QACR,WAAW,MACX,YAAY,QAAQ,sCACnB,QAAQ"}
@@ -2,7 +2,6 @@ import { WalletCallReceipt as WalletCallReceipt$1 } from "../types.js";
2
2
  import { LiFiStep, SDKClient } from "@lifi/sdk";
3
3
  import { Hash } from "viem";
4
4
  //#region src/actions/waitForRelayedTransactionReceipt.d.ts
5
- declare const waitForRelayedTransactionReceipt: (client: SDKClient, taskId: Hash, step: LiFiStep) => Promise<WalletCallReceipt$1>;
5
+ export declare const waitForRelayedTransactionReceipt: (client: SDKClient, taskId: Hash, step: LiFiStep) => Promise<WalletCallReceipt$1>;
6
6
  //#endregion
7
- export { waitForRelayedTransactionReceipt };
8
7
  //# sourceMappingURL=waitForRelayedTransactionReceipt.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"waitForRelayedTransactionReceipt.d.ts","names":[],"sources":["../../../src/actions/waitForRelayedTransactionReceipt.ts"],"mappings":";;;;cAaa,mCACX,QAAQ,WACR,QAAQ,MACR,MAAM,aACL,QAAQ"}
1
+ {"version":3,"file":"waitForRelayedTransactionReceipt.d.ts","names":[],"sources":["../../../src/actions/waitForRelayedTransactionReceipt.ts"],"mappings":";;;;qBAaa,mCACX,QAAQ,WACR,QAAQ,MACR,MAAM,aACL,QAAQ"}
@@ -1,7 +1,7 @@
1
1
  import { SDKClient } from "@lifi/sdk";
2
2
  import { Address, Hash } from "viem";
3
3
  //#region src/actions/waitForSafeTransactionExecution.d.ts
4
- interface WaitForSafeTransactionExecutionProps {
4
+ export interface WaitForSafeTransactionExecutionProps {
5
5
  chainId: number;
6
6
  safeAddress: Address;
7
7
  signature: string;
@@ -17,7 +17,6 @@ interface WaitForSafeTransactionExecutionProps {
17
17
  * @returns The on-chain transaction hash once the Safe transaction is executed.
18
18
  * @throws {TransactionError} If the transaction fails, is replaced, or polling times out.
19
19
  */
20
- declare function waitForSafeTransactionExecution(client: SDKClient, { chainId, safeAddress, signature, pollingInterval, timeout: timeoutMs }: WaitForSafeTransactionExecutionProps): Promise<Hash>;
20
+ export declare function waitForSafeTransactionExecution(client: SDKClient, { chainId, safeAddress, signature, pollingInterval, timeout: timeoutMs }: WaitForSafeTransactionExecutionProps): Promise<Hash>;
21
21
  //#endregion
22
- export { WaitForSafeTransactionExecutionProps, waitForSafeTransactionExecution };
23
22
  //# sourceMappingURL=waitForSafeTransactionExecution.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"waitForSafeTransactionExecution.d.ts","names":[],"sources":["../../../src/actions/waitForSafeTransactionExecution.ts"],"mappings":";;;UAUiB;EACf;EACA,aAAa;EACb;EACA;EACA;;;;;;;;;;;iBAYoB,gCACpB,QAAQ,aAEN,SACA,aACA,WACA,iBACA,SAAS,aACR,uCACF,QAAQ"}
1
+ {"version":3,"file":"waitForSafeTransactionExecution.d.ts","names":[],"sources":["../../../src/actions/waitForSafeTransactionExecution.ts"],"mappings":";;;iBAUiB;EACf;EACA,aAAa;EACb;EACA;EACA;;;;;;;;;;;wBAYoB,gCACpB,QAAQ,aAEN,SACA,aACA,WACA,iBACA,SAAS,aACR,uCACF,QAAQ"}
@@ -7,7 +7,6 @@ interface WaitForTransactionReceiptProps {
7
7
  txHash: Hash;
8
8
  onReplaced?: (response: ReplacementReturnType<Chain | undefined>) => void;
9
9
  }
10
- declare function waitForTransactionReceipt(client: SDKClient, { client: viemClient, chainId, txHash, onReplaced }: WaitForTransactionReceiptProps): Promise<TransactionReceipt | undefined>;
10
+ export declare function waitForTransactionReceipt(client: SDKClient, { client: viemClient, chainId, txHash, onReplaced }: WaitForTransactionReceiptProps): Promise<TransactionReceipt | undefined>;
11
11
  //#endregion
12
- export { waitForTransactionReceipt };
13
12
  //# sourceMappingURL=waitForTransactionReceipt.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"waitForTransactionReceipt.d.ts","names":[],"sources":["../../../src/actions/waitForTransactionReceipt.ts"],"mappings":";;;UAiBU;EACR,QAAQ;EACR,SAAS;EACT,QAAQ;EACR,cAAc,UAAU,sBAAsB;;iBAG1B,0BACpB,QAAQ,aAEN,QAAQ,YACR,SACA,QACA,cACC,iCACF,QAAQ"}
1
+ {"version":3,"file":"waitForTransactionReceipt.d.ts","names":[],"sources":["../../../src/actions/waitForTransactionReceipt.ts"],"mappings":";;;UAiBU;EACR,QAAQ;EACR,SAAS;EACT,QAAQ;EACR,cAAc,UAAU,sBAAsB;;wBAG1B,0BACpB,QAAQ,aAEN,QAAQ,YACR,SACA,QACA,cACC,iCACF,QAAQ"}
@@ -7,7 +7,6 @@ import { Client } from "viem";
7
7
  * @param chainId - Id of the chain the provider is for
8
8
  * @returns The public client for the given chain
9
9
  */
10
- declare const getPublicClient: (client: SDKClient, chainId: number) => Promise<Client>;
10
+ export declare const getPublicClient: (client: SDKClient, chainId: number) => Promise<Client>;
11
11
  //#endregion
12
- export { getPublicClient };
13
12
  //# sourceMappingURL=publicClient.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"publicClient.d.ts","names":[],"sources":["../../../src/client/publicClient.ts"],"mappings":";;;;;;;;;cAgBa,kBACX,QAAQ,WACR,oBACC,QAAQ"}
1
+ {"version":3,"file":"publicClient.d.ts","names":[],"sources":["../../../src/client/publicClient.ts"],"mappings":";;;;;;;;;qBAgBa,kBACX,QAAQ,WACR,oBACC,QAAQ"}
@@ -1,7 +1,7 @@
1
1
  import { SafeInfo, SafeMultisigTransaction, SafeMultisigTransactionList } from "./types.js";
2
2
  import { Address, Hash } from "viem";
3
3
  //#region src/client/safeClient.d.ts
4
- interface SafeClientInterface {
4
+ export interface SafeClientInterface {
5
5
  getInfo: (address: Address) => Promise<SafeInfo>;
6
6
  getTransaction: (safeTxHash: Hash) => Promise<SafeMultisigTransaction>;
7
7
  getTransactions: (safeAddress: Address, options?: {
@@ -9,8 +9,7 @@ interface SafeClientInterface {
9
9
  limit?: number;
10
10
  }) => Promise<SafeMultisigTransactionList>;
11
11
  }
12
- declare const getSafeClient: (chainId: number, apiKey?: string) => SafeClientInterface;
13
- type SafeClient = ReturnType<typeof getSafeClient>;
12
+ export declare const getSafeClient: (chainId: number, apiKey?: string) => SafeClientInterface;
13
+ export type SafeClient = ReturnType<typeof getSafeClient>;
14
14
  //#endregion
15
- export { SafeClient, SafeClientInterface, getSafeClient };
16
15
  //# sourceMappingURL=safeClient.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"safeClient.d.ts","names":[],"sources":["../../../src/client/safeClient.ts"],"mappings":";;;UAoEiB;EACf,UAAU,SAAS,YAAY,QAAQ;EACvC,iBAAiB,YAAY,SAAS,QAAQ;EAC9C,kBACE,aAAa,SACb;IAAY;IAAoB;QAC7B,QAAQ;;cAGF,gBACX,iBACA,oBACC;KA+BS,aAAa,kBAAkB"}
1
+ {"version":3,"file":"safeClient.d.ts","names":[],"sources":["../../../src/client/safeClient.ts"],"mappings":";;;iBAoEiB;EACf,UAAU,SAAS,YAAY,QAAQ;EACvC,iBAAiB,YAAY,SAAS,QAAQ;EAC9C,kBACE,aAAa,SACb;IAAY;IAAoB;QAC7B,QAAQ;;qBAGF,gBACX,iBACA,oBACC;YA+BS,aAAa,kBAAkB"}
@@ -1,9 +1,9 @@
1
1
  //#region src/client/types.d.ts
2
- interface SafeInfo {
2
+ export interface SafeInfo {
3
3
  threshold: number;
4
4
  owners: string[];
5
5
  }
6
- interface SafeMultisigTransaction {
6
+ export interface SafeMultisigTransaction {
7
7
  safeTxHash: string;
8
8
  nonce: number;
9
9
  isExecuted: boolean;
@@ -13,10 +13,9 @@ interface SafeMultisigTransaction {
13
13
  signature?: string;
14
14
  }>;
15
15
  }
16
- interface SafeMultisigTransactionList {
16
+ export interface SafeMultisigTransactionList {
17
17
  count: number;
18
18
  results: SafeMultisigTransaction[];
19
19
  }
20
20
  //#endregion
21
- export { SafeInfo, SafeMultisigTransaction, SafeMultisigTransactionList };
22
21
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","names":[],"sources":["../../../src/client/types.ts"],"mappings":";UAAiB;EACf;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;EACA,gBAAgB;IAAQ;;;UAGT;EACf;EACA,SAAS"}
1
+ {"version":3,"file":"types.d.ts","names":[],"sources":["../../../src/client/types.ts"],"mappings":";iBAAiB;EACf;EACA;;iBAGe;EACf;EACA;EACA;EACA;EACA;EACA,gBAAgB;IAAQ;;;iBAGT;EACf;EACA,SAAS"}
@@ -7,7 +7,7 @@ interface EthereumStepExecutorOptions extends StepExecutorOptions {
7
7
  switchChain?: (chainId: number) => Promise<Client | undefined>;
8
8
  disableMessageSigning?: boolean;
9
9
  }
10
- declare class EthereumStepExecutor extends BaseStepExecutor {
10
+ export declare class EthereumStepExecutor extends BaseStepExecutor {
11
11
  private client;
12
12
  private switchChain?;
13
13
  private storage?;
@@ -20,5 +20,4 @@ declare class EthereumStepExecutor extends BaseStepExecutor {
20
20
  override createPipeline: (context: EthereumStepExecutorContext) => TaskPipeline;
21
21
  }
22
22
  //#endregion
23
- export { EthereumStepExecutor };
24
23
  //# sourceMappingURL=EthereumStepExecutor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EthereumStepExecutor.d.ts","names":[],"sources":["../../../src/core/EthereumStepExecutor.ts"],"mappings":";;;;UAmCU,oCAAoC;EAC5C,QAAQ;EACR,eAAe,oBAAoB,QAAQ;EAC3C;;cAGW,6BAA6B;UAChC;UACA;UACA;UACA;EAER,YAAY,SAAS;UAOb;WAOC,cACP,OAAO,OACP,OAAO,kBACP,SAAS,iBACT,cAAc,2BACb,QAAQ,WAAW;EAItB,cACE,MAAM,kBACN,2BACC,QAAQ;WAgCF,gBACP,aAAa,4BACZ,QAAQ;WA0BF,iBACP,SAAS,gCACR"}
1
+ {"version":3,"file":"EthereumStepExecutor.d.ts","names":[],"sources":["../../../src/core/EthereumStepExecutor.ts"],"mappings":";;;;UAoCU,oCAAoC;EAC5C,QAAQ;EACR,eAAe,oBAAoB,QAAQ;EAC3C;;qBAGW,6BAA6B;UAChC;UACA;UACA;UACA;EAER,YAAY,SAAS;UAOb;WAOC,cACP,OAAO,OACP,OAAO,kBACP,SAAS,iBACT,cAAc,2BACb,QAAQ,WAAW;EAItB,cACE,MAAM,kBACN,2BACC,QAAQ;WAgCF,gBACP,aAAa,4BACZ,QAAQ;WA0BF,iBACP,SAAS,gCACR"}
@@ -4,6 +4,7 @@ import { EthereumCheckAllowanceTask } from "./tasks/EthereumCheckAllowanceTask.j
4
4
  import { EthereumCheckBalanceTask } from "./tasks/EthereumCheckBalanceTask.js";
5
5
  import { EthereumCheckPermitsTask } from "./tasks/EthereumCheckPermitsTask.js";
6
6
  import { EthereumNativePermitTask } from "./tasks/EthereumNativePermitTask.js";
7
+ import { EthereumPermit2AllowanceTask } from "./tasks/EthereumPermit2AllowanceTask.js";
7
8
  import { EthereumPrepareTransactionTask } from "./tasks/EthereumPrepareTransactionTask.js";
8
9
  import { EthereumResetAllowanceTask } from "./tasks/EthereumResetAllowanceTask.js";
9
10
  import { EthereumSetAllowanceTask } from "./tasks/EthereumSetAllowanceTask.js";
@@ -64,6 +65,7 @@ var EthereumStepExecutor = class extends BaseStepExecutor {
64
65
  new EthereumResetAllowanceTask(),
65
66
  new EthereumSetAllowanceTask(),
66
67
  new EthereumCheckBalanceTask(),
68
+ new EthereumPermit2AllowanceTask(),
67
69
  new EthereumPrepareTransactionTask(),
68
70
  new EthereumSignAndExecuteTask(),
69
71
  new EthereumWaitForTransactionTask(),
@@ -1 +1 @@
1
- {"version":3,"file":"EthereumStepExecutor.js","names":[],"sources":["../../../src/core/EthereumStepExecutor.ts"],"sourcesContent":["import {\n BaseStepExecutor,\n createDefaultStorage,\n type ExecuteStepRetryError,\n type ExecuteStepRetryParams,\n type ExecutionAction,\n LiFiErrorCode,\n type LiFiStepExtended,\n type SDKClient,\n type SDKError,\n type SDKStorage,\n type StepExecutorBaseContext,\n type StepExecutorOptions,\n TaskPipeline,\n TransactionError,\n} from '@lifi/sdk'\nimport type { Client, GetAddressesReturnType } from 'viem'\nimport { getAddresses } from 'viem/actions'\nimport { getAction } from 'viem/utils'\nimport { parseEthereumErrors } from '../errors/parseEthereumErrors.js'\nimport type { EthereumStepExecutorContext } from '../types.js'\nimport { isZeroAddress } from '../utils/isZeroAddress.js'\nimport { EthereumCheckAllowanceTask } from './tasks/EthereumCheckAllowanceTask.js'\nimport { EthereumCheckBalanceTask } from './tasks/EthereumCheckBalanceTask.js'\nimport { EthereumCheckPermitsTask } from './tasks/EthereumCheckPermitsTask.js'\nimport { EthereumNativePermitTask } from './tasks/EthereumNativePermitTask.js'\nimport { EthereumPrepareTransactionTask } from './tasks/EthereumPrepareTransactionTask.js'\nimport { EthereumResetAllowanceTask } from './tasks/EthereumResetAllowanceTask.js'\nimport { EthereumSetAllowanceTask } from './tasks/EthereumSetAllowanceTask.js'\nimport { EthereumSignAndExecuteTask } from './tasks/EthereumSignAndExecuteTask.js'\nimport { EthereumWaitForTransactionStatusTask } from './tasks/EthereumWaitForTransactionStatusTask.js'\nimport { EthereumWaitForTransactionTask } from './tasks/EthereumWaitForTransactionTask.js'\nimport { shouldCheckForAllowance } from './tasks/helpers/shouldCheckForAllowance.js'\nimport { switchChain } from './tasks/helpers/switchChain.js'\n\ninterface EthereumStepExecutorOptions extends StepExecutorOptions {\n client: Client\n switchChain?: (chainId: number) => Promise<Client | undefined>\n disableMessageSigning?: boolean\n}\n\nexport class EthereumStepExecutor extends BaseStepExecutor {\n private client: Client\n private switchChain?: (chainId: number) => Promise<Client | undefined>\n private storage?: SDKStorage\n private disableMessageSigning?: boolean\n\n constructor(options: EthereumStepExecutorOptions) {\n super(options)\n this.client = options.client\n this.switchChain = options.switchChain\n this.disableMessageSigning = options.disableMessageSigning\n }\n\n private getStorage = (client: SDKClient): SDKStorage => {\n if (!this.storage) {\n this.storage = client.config.storage ?? createDefaultStorage()\n }\n return this.storage\n }\n\n override parseErrors = (\n error: Error,\n step?: LiFiStepExtended,\n action?: ExecutionAction,\n retryParams?: ExecuteStepRetryParams\n ): Promise<SDKError | ExecuteStepRetryError> =>\n parseEthereumErrors(error, step, action, retryParams)\n\n // Ensure that we are using the right chain and wallet when executing transactions.\n checkClient = async (\n step: LiFiStepExtended,\n targetChainId?: number\n ): Promise<Client | undefined> => {\n const updatedClient = await switchChain(\n this.client,\n targetChainId ?? step.action.fromChainId,\n this.allowUserInteraction,\n this.switchChain\n )\n if (updatedClient) {\n this.client = updatedClient\n }\n\n // Prevent execution of the quote by wallet different from the one which requested the quote\n let accountAddress = this.client.account?.address\n if (!accountAddress) {\n const accountAddresses = (await getAction(\n this.client,\n getAddresses,\n 'getAddresses'\n )(undefined)) as GetAddressesReturnType\n accountAddress = accountAddresses?.[0]\n }\n if (\n accountAddress?.toLowerCase() !== step.action.fromAddress?.toLowerCase()\n ) {\n throw new TransactionError(\n LiFiErrorCode.WalletChangedDuringExecution,\n 'The wallet address that requested the quote does not match the wallet address attempting to sign the transaction.'\n )\n }\n return updatedClient\n }\n\n override createContext = async (\n baseContext: StepExecutorBaseContext\n ): Promise<EthereumStepExecutorContext> => {\n const { step, fromChain } = baseContext\n\n const isFromNativeToken =\n fromChain.nativeToken.address === step.action.fromToken.address &&\n isZeroAddress(step.action.fromToken.address)\n\n // Check if message signing is disabled - useful for smart contract wallets\n // We also disable message signing for custom steps\n const disableMessageSigning =\n !!this.disableMessageSigning || step.type !== 'lifi'\n\n return {\n ...baseContext,\n isFromNativeToken,\n disableMessageSigning,\n ethereumClient: this.client,\n checkClient: this.checkClient,\n getStorage: this.getStorage,\n // Signed typed data for native permits and other messages\n signedTypedData: [],\n // Calls for atomic batch transactions (EIP-5792)\n calls: [],\n }\n }\n\n override createPipeline = (\n context: EthereumStepExecutorContext\n ): TaskPipeline => {\n const { step, isBridgeExecution, isFromNativeToken } = context\n\n const tasks = [\n new EthereumCheckPermitsTask(),\n new EthereumCheckAllowanceTask(),\n new EthereumNativePermitTask(),\n new EthereumResetAllowanceTask(),\n new EthereumSetAllowanceTask(),\n new EthereumCheckBalanceTask(),\n new EthereumPrepareTransactionTask(),\n new EthereumSignAndExecuteTask(),\n new EthereumWaitForTransactionTask(),\n new EthereumWaitForTransactionStatusTask(),\n ]\n\n const doCheckAllowance = shouldCheckForAllowance(\n step,\n isBridgeExecution,\n isFromNativeToken,\n this.statusManager\n )\n\n let taskName: string\n if (doCheckAllowance) {\n taskName = EthereumCheckPermitsTask.name\n } else {\n const swapOrBridgeAction = this.statusManager.findAction(\n step,\n isBridgeExecution ? 'CROSS_CHAIN' : 'SWAP'\n )\n taskName =\n swapOrBridgeAction?.txHash || swapOrBridgeAction?.taskId\n ? swapOrBridgeAction?.status === 'DONE'\n ? EthereumWaitForTransactionStatusTask.name\n : EthereumWaitForTransactionTask.name\n : EthereumCheckBalanceTask.name\n }\n\n const firstTaskIndex = tasks.findIndex(\n (task) => task.constructor.name === taskName\n )\n\n const tasksToRun = tasks.slice(firstTaskIndex)\n\n return new TaskPipeline(tasksToRun)\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAyCA,IAAa,uBAAb,cAA0C,iBAAiB;CACzD;CACA;CACA;CACA;CAEA,YAAY,SAAsC;EAChD,MAAM,OAAO;EACb,KAAK,SAAS,QAAQ;EACtB,KAAK,cAAc,QAAQ;EAC3B,KAAK,wBAAwB,QAAQ;CACvC;CAEA,cAAsB,WAAkC;EACtD,IAAI,CAAC,KAAK,SACR,KAAK,UAAU,OAAO,OAAO,WAAW,qBAAqB;EAE/D,OAAO,KAAK;CACd;CAEA,eACE,OACA,MACA,QACA,gBAEA,oBAAoB,OAAO,MAAM,QAAQ,WAAW;CAGtD,cAAc,OACZ,MACA,kBACgC;EAChC,MAAM,gBAAgB,MAAM,YAC1B,KAAK,QACL,iBAAiB,KAAK,OAAO,aAC7B,KAAK,sBACL,KAAK,WACP;EACA,IAAI,eACF,KAAK,SAAS;EAIhB,IAAI,iBAAiB,KAAK,OAAO,SAAS;EAC1C,IAAI,CAAC,gBAMH,kBAAiB,MALe,UAC9B,KAAK,QACL,cACA,cACF,CAAC,CAAC,KAAA,CAAS,EAAA,GACyB;EAEtC,IACE,gBAAgB,YAAY,MAAM,KAAK,OAAO,aAAa,YAAY,GAEvE,MAAM,IAAI,iBACR,cAAc,8BACd,mHACF;EAEF,OAAO;CACT;CAEA,gBAAyB,OACvB,gBACyC;EACzC,MAAM,EAAE,MAAM,cAAc;EAE5B,MAAM,oBACJ,UAAU,YAAY,YAAY,KAAK,OAAO,UAAU,WACxD,cAAc,KAAK,OAAO,UAAU,OAAO;EAI7C,MAAM,wBACJ,CAAC,CAAC,KAAK,yBAAyB,KAAK,SAAS;EAEhD,OAAO;GACL,GAAG;GACH;GACA;GACA,gBAAgB,KAAK;GACrB,aAAa,KAAK;GAClB,YAAY,KAAK;GAEjB,iBAAiB,CAAC;GAElB,OAAO,CAAC;EACV;CACF;CAEA,kBACE,YACiB;EACjB,MAAM,EAAE,MAAM,mBAAmB,sBAAsB;EAEvD,MAAM,QAAQ;GACZ,IAAI,yBAAyB;GAC7B,IAAI,2BAA2B;GAC/B,IAAI,yBAAyB;GAC7B,IAAI,2BAA2B;GAC/B,IAAI,yBAAyB;GAC7B,IAAI,yBAAyB;GAC7B,IAAI,+BAA+B;GACnC,IAAI,2BAA2B;GAC/B,IAAI,+BAA+B;GACnC,IAAI,qCAAqC;EAC3C;EAEA,MAAM,mBAAmB,wBACvB,MACA,mBACA,mBACA,KAAK,aACP;EAEA,IAAI;EACJ,IAAI,kBACF,WAAW,yBAAyB;OAC/B;GACL,MAAM,qBAAqB,KAAK,cAAc,WAC5C,MACA,oBAAoB,gBAAgB,MACtC;GACA,WACE,oBAAoB,UAAU,oBAAoB,SAC9C,oBAAoB,WAAW,SAC7B,qCAAqC,OACrC,+BAA+B,OACjC,yBAAyB;EACjC;EAEA,MAAM,iBAAiB,MAAM,WAC1B,SAAS,KAAK,YAAY,SAAS,QACtC;EAEA,MAAM,aAAa,MAAM,MAAM,cAAc;EAE7C,OAAO,IAAI,aAAa,UAAU;CACpC;AACF"}
1
+ {"version":3,"file":"EthereumStepExecutor.js","names":[],"sources":["../../../src/core/EthereumStepExecutor.ts"],"sourcesContent":["import {\n BaseStepExecutor,\n createDefaultStorage,\n type ExecuteStepRetryError,\n type ExecuteStepRetryParams,\n type ExecutionAction,\n LiFiErrorCode,\n type LiFiStepExtended,\n type SDKClient,\n type SDKError,\n type SDKStorage,\n type StepExecutorBaseContext,\n type StepExecutorOptions,\n TaskPipeline,\n TransactionError,\n} from '@lifi/sdk'\nimport type { Client, GetAddressesReturnType } from 'viem'\nimport { getAddresses } from 'viem/actions'\nimport { getAction } from 'viem/utils'\nimport { parseEthereumErrors } from '../errors/parseEthereumErrors.js'\nimport type { EthereumStepExecutorContext } from '../types.js'\nimport { isZeroAddress } from '../utils/isZeroAddress.js'\nimport { EthereumCheckAllowanceTask } from './tasks/EthereumCheckAllowanceTask.js'\nimport { EthereumCheckBalanceTask } from './tasks/EthereumCheckBalanceTask.js'\nimport { EthereumCheckPermitsTask } from './tasks/EthereumCheckPermitsTask.js'\nimport { EthereumNativePermitTask } from './tasks/EthereumNativePermitTask.js'\nimport { EthereumPermit2AllowanceTask } from './tasks/EthereumPermit2AllowanceTask.js'\nimport { EthereumPrepareTransactionTask } from './tasks/EthereumPrepareTransactionTask.js'\nimport { EthereumResetAllowanceTask } from './tasks/EthereumResetAllowanceTask.js'\nimport { EthereumSetAllowanceTask } from './tasks/EthereumSetAllowanceTask.js'\nimport { EthereumSignAndExecuteTask } from './tasks/EthereumSignAndExecuteTask.js'\nimport { EthereumWaitForTransactionStatusTask } from './tasks/EthereumWaitForTransactionStatusTask.js'\nimport { EthereumWaitForTransactionTask } from './tasks/EthereumWaitForTransactionTask.js'\nimport { shouldCheckForAllowance } from './tasks/helpers/shouldCheckForAllowance.js'\nimport { switchChain } from './tasks/helpers/switchChain.js'\n\ninterface EthereumStepExecutorOptions extends StepExecutorOptions {\n client: Client\n switchChain?: (chainId: number) => Promise<Client | undefined>\n disableMessageSigning?: boolean\n}\n\nexport class EthereumStepExecutor extends BaseStepExecutor {\n private client: Client\n private switchChain?: (chainId: number) => Promise<Client | undefined>\n private storage?: SDKStorage\n private disableMessageSigning?: boolean\n\n constructor(options: EthereumStepExecutorOptions) {\n super(options)\n this.client = options.client\n this.switchChain = options.switchChain\n this.disableMessageSigning = options.disableMessageSigning\n }\n\n private getStorage = (client: SDKClient): SDKStorage => {\n if (!this.storage) {\n this.storage = client.config.storage ?? createDefaultStorage()\n }\n return this.storage\n }\n\n override parseErrors = (\n error: Error,\n step?: LiFiStepExtended,\n action?: ExecutionAction,\n retryParams?: ExecuteStepRetryParams\n ): Promise<SDKError | ExecuteStepRetryError> =>\n parseEthereumErrors(error, step, action, retryParams)\n\n // Ensure that we are using the right chain and wallet when executing transactions.\n checkClient = async (\n step: LiFiStepExtended,\n targetChainId?: number\n ): Promise<Client | undefined> => {\n const updatedClient = await switchChain(\n this.client,\n targetChainId ?? step.action.fromChainId,\n this.allowUserInteraction,\n this.switchChain\n )\n if (updatedClient) {\n this.client = updatedClient\n }\n\n // Prevent execution of the quote by wallet different from the one which requested the quote\n let accountAddress = this.client.account?.address\n if (!accountAddress) {\n const accountAddresses = (await getAction(\n this.client,\n getAddresses,\n 'getAddresses'\n )(undefined)) as GetAddressesReturnType\n accountAddress = accountAddresses?.[0]\n }\n if (\n accountAddress?.toLowerCase() !== step.action.fromAddress?.toLowerCase()\n ) {\n throw new TransactionError(\n LiFiErrorCode.WalletChangedDuringExecution,\n 'The wallet address that requested the quote does not match the wallet address attempting to sign the transaction.'\n )\n }\n return updatedClient\n }\n\n override createContext = async (\n baseContext: StepExecutorBaseContext\n ): Promise<EthereumStepExecutorContext> => {\n const { step, fromChain } = baseContext\n\n const isFromNativeToken =\n fromChain.nativeToken.address === step.action.fromToken.address &&\n isZeroAddress(step.action.fromToken.address)\n\n // Check if message signing is disabled - useful for smart contract wallets\n // We also disable message signing for custom steps\n const disableMessageSigning =\n !!this.disableMessageSigning || step.type !== 'lifi'\n\n return {\n ...baseContext,\n isFromNativeToken,\n disableMessageSigning,\n ethereumClient: this.client,\n checkClient: this.checkClient,\n getStorage: this.getStorage,\n // Signed typed data for native permits and other messages\n signedTypedData: [],\n // Calls for atomic batch transactions (EIP-5792)\n calls: [],\n }\n }\n\n override createPipeline = (\n context: EthereumStepExecutorContext\n ): TaskPipeline => {\n const { step, isBridgeExecution, isFromNativeToken } = context\n\n const tasks = [\n new EthereumCheckPermitsTask(),\n new EthereumCheckAllowanceTask(),\n new EthereumNativePermitTask(),\n new EthereumResetAllowanceTask(),\n new EthereumSetAllowanceTask(),\n new EthereumCheckBalanceTask(),\n new EthereumPermit2AllowanceTask(),\n new EthereumPrepareTransactionTask(),\n new EthereumSignAndExecuteTask(),\n new EthereumWaitForTransactionTask(),\n new EthereumWaitForTransactionStatusTask(),\n ]\n\n const doCheckAllowance = shouldCheckForAllowance(\n step,\n isBridgeExecution,\n isFromNativeToken,\n this.statusManager\n )\n\n let taskName: string\n if (doCheckAllowance) {\n taskName = EthereumCheckPermitsTask.name\n } else {\n const swapOrBridgeAction = this.statusManager.findAction(\n step,\n isBridgeExecution ? 'CROSS_CHAIN' : 'SWAP'\n )\n taskName =\n swapOrBridgeAction?.txHash || swapOrBridgeAction?.taskId\n ? swapOrBridgeAction?.status === 'DONE'\n ? EthereumWaitForTransactionStatusTask.name\n : EthereumWaitForTransactionTask.name\n : EthereumCheckBalanceTask.name\n }\n\n const firstTaskIndex = tasks.findIndex(\n (task) => task.constructor.name === taskName\n )\n\n const tasksToRun = tasks.slice(firstTaskIndex)\n\n return new TaskPipeline(tasksToRun)\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA0CA,IAAa,uBAAb,cAA0C,iBAAiB;CACzD;CACA;CACA;CACA;CAEA,YAAY,SAAsC;EAChD,MAAM,OAAO;EACb,KAAK,SAAS,QAAQ;EACtB,KAAK,cAAc,QAAQ;EAC3B,KAAK,wBAAwB,QAAQ;CACvC;CAEA,cAAsB,WAAkC;EACtD,IAAI,CAAC,KAAK,SACR,KAAK,UAAU,OAAO,OAAO,WAAW,qBAAqB;EAE/D,OAAO,KAAK;CACd;CAEA,eACE,OACA,MACA,QACA,gBAEA,oBAAoB,OAAO,MAAM,QAAQ,WAAW;CAGtD,cAAc,OACZ,MACA,kBACgC;EAChC,MAAM,gBAAgB,MAAM,YAC1B,KAAK,QACL,iBAAiB,KAAK,OAAO,aAC7B,KAAK,sBACL,KAAK,WACP;EACA,IAAI,eACF,KAAK,SAAS;EAIhB,IAAI,iBAAiB,KAAK,OAAO,SAAS;EAC1C,IAAI,CAAC,gBAMH,kBAAiB,MALe,UAC9B,KAAK,QACL,cACA,cACF,CAAC,CAAC,KAAA,CAAS,EAAA,GACyB;EAEtC,IACE,gBAAgB,YAAY,MAAM,KAAK,OAAO,aAAa,YAAY,GAEvE,MAAM,IAAI,iBACR,cAAc,8BACd,mHACF;EAEF,OAAO;CACT;CAEA,gBAAyB,OACvB,gBACyC;EACzC,MAAM,EAAE,MAAM,cAAc;EAE5B,MAAM,oBACJ,UAAU,YAAY,YAAY,KAAK,OAAO,UAAU,WACxD,cAAc,KAAK,OAAO,UAAU,OAAO;EAI7C,MAAM,wBACJ,CAAC,CAAC,KAAK,yBAAyB,KAAK,SAAS;EAEhD,OAAO;GACL,GAAG;GACH;GACA;GACA,gBAAgB,KAAK;GACrB,aAAa,KAAK;GAClB,YAAY,KAAK;GAEjB,iBAAiB,CAAC;GAElB,OAAO,CAAC;EACV;CACF;CAEA,kBACE,YACiB;EACjB,MAAM,EAAE,MAAM,mBAAmB,sBAAsB;EAEvD,MAAM,QAAQ;GACZ,IAAI,yBAAyB;GAC7B,IAAI,2BAA2B;GAC/B,IAAI,yBAAyB;GAC7B,IAAI,2BAA2B;GAC/B,IAAI,yBAAyB;GAC7B,IAAI,yBAAyB;GAC7B,IAAI,6BAA6B;GACjC,IAAI,+BAA+B;GACnC,IAAI,2BAA2B;GAC/B,IAAI,+BAA+B;GACnC,IAAI,qCAAqC;EAC3C;EAEA,MAAM,mBAAmB,wBACvB,MACA,mBACA,mBACA,KAAK,aACP;EAEA,IAAI;EACJ,IAAI,kBACF,WAAW,yBAAyB;OAC/B;GACL,MAAM,qBAAqB,KAAK,cAAc,WAC5C,MACA,oBAAoB,gBAAgB,MACtC;GACA,WACE,oBAAoB,UAAU,oBAAoB,SAC9C,oBAAoB,WAAW,SAC7B,qCAAqC,OACrC,+BAA+B,OACjC,yBAAyB;EACjC;EAEA,MAAM,iBAAiB,MAAM,WAC1B,SAAS,KAAK,YAAY,SAAS,QACtC;EAEA,MAAM,aAAa,MAAM,MAAM,cAAc;EAE7C,OAAO,IAAI,aAAa,UAAU;CACpC;AACF"}
@@ -1,9 +1,8 @@
1
1
  import { EthereumStepExecutorContext } from "../../types.js";
2
2
  import { BaseStepExecutionTask, TaskResult } from "@lifi/sdk";
3
3
  //#region src/core/tasks/EthereumBatchedSignAndExecuteTask.d.ts
4
- declare class EthereumBatchedSignAndExecuteTask extends BaseStepExecutionTask {
4
+ export declare class EthereumBatchedSignAndExecuteTask extends BaseStepExecutionTask {
5
5
  run(context: EthereumStepExecutorContext): Promise<TaskResult>;
6
6
  }
7
7
  //#endregion
8
- export { EthereumBatchedSignAndExecuteTask };
9
8
  //# sourceMappingURL=EthereumBatchedSignAndExecuteTask.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EthereumBatchedSignAndExecuteTask.d.ts","names":[],"sources":["../../../../src/core/tasks/EthereumBatchedSignAndExecuteTask.ts"],"mappings":";;;cAWa,0CAA0C;EACrD,IAAU,SAAS,8BAA8B,QAAQ"}
1
+ {"version":3,"file":"EthereumBatchedSignAndExecuteTask.d.ts","names":[],"sources":["../../../../src/core/tasks/EthereumBatchedSignAndExecuteTask.ts"],"mappings":";;;qBAWa,0CAA0C;EACrD,IAAU,SAAS,8BAA8B,QAAQ"}
@@ -1,9 +1,8 @@
1
1
  import { EthereumStepExecutorContext } from "../../types.js";
2
2
  import { BaseStepExecutionTask, TaskResult } from "@lifi/sdk";
3
3
  //#region src/core/tasks/EthereumBatchedWaitForTransactionTask.d.ts
4
- declare class EthereumBatchedWaitForTransactionTask extends BaseStepExecutionTask {
4
+ export declare class EthereumBatchedWaitForTransactionTask extends BaseStepExecutionTask {
5
5
  run(context: EthereumStepExecutorContext): Promise<TaskResult>;
6
6
  }
7
7
  //#endregion
8
- export { EthereumBatchedWaitForTransactionTask };
9
8
  //# sourceMappingURL=EthereumBatchedWaitForTransactionTask.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EthereumBatchedWaitForTransactionTask.d.ts","names":[],"sources":["../../../../src/core/tasks/EthereumBatchedWaitForTransactionTask.ts"],"mappings":";;;cAca,8CAA8C;EACzD,IAAU,SAAS,8BAA8B,QAAQ"}
1
+ {"version":3,"file":"EthereumBatchedWaitForTransactionTask.d.ts","names":[],"sources":["../../../../src/core/tasks/EthereumBatchedWaitForTransactionTask.ts"],"mappings":";;;qBAca,8CAA8C;EACzD,IAAU,SAAS,8BAA8B,QAAQ"}
@@ -1,10 +1,9 @@
1
1
  import { EthereumStepExecutorContext } from "../../types.js";
2
2
  import { BaseStepExecutionTask, TaskResult } from "@lifi/sdk";
3
3
  //#region src/core/tasks/EthereumCheckAllowanceTask.d.ts
4
- declare class EthereumCheckAllowanceTask extends BaseStepExecutionTask {
4
+ export declare class EthereumCheckAllowanceTask extends BaseStepExecutionTask {
5
5
  override shouldRun(context: EthereumStepExecutorContext): Promise<boolean>;
6
6
  run(context: EthereumStepExecutorContext): Promise<TaskResult>;
7
7
  }
8
8
  //#endregion
9
- export { EthereumCheckAllowanceTask };
10
9
  //# sourceMappingURL=EthereumCheckAllowanceTask.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EthereumCheckAllowanceTask.d.ts","names":[],"sources":["../../../../src/core/tasks/EthereumCheckAllowanceTask.ts"],"mappings":";;;cAOa,mCAAmC;WAC/B,UACb,SAAS,8BACR;EAIH,IAAU,SAAS,8BAA8B,QAAQ"}
1
+ {"version":3,"file":"EthereumCheckAllowanceTask.d.ts","names":[],"sources":["../../../../src/core/tasks/EthereumCheckAllowanceTask.ts"],"mappings":";;;qBAOa,mCAAmC;WAC/B,UACb,SAAS,8BACR;EAIH,IAAU,SAAS,8BAA8B,QAAQ"}
@@ -4,15 +4,14 @@ import { CheckBalanceOptions, CheckBalanceTask } from "@lifi/sdk";
4
4
  /**
5
5
  * Skips the outer-tx gas check for steps where the wallet doesn't fund it:
6
6
  * smart-contract wallets (Safe Apps, 4337, 7579, …) where the
7
- * executor / bundler / paymaster pays, and relayed steps. Source amount
8
- * and non-included native fees are still verified.
7
+ * executor / bundler / paymaster pays, and typed-data steps the user does not
8
+ * fund. Source amount and non-included native fees are still verified.
9
9
  *
10
10
  * Skip-bias is intentional: a wrong skip is caught by the wallet rejecting
11
11
  * the tx; a wrong enforce blocks a tx that would have succeeded.
12
12
  */
13
- declare class EthereumCheckBalanceTask extends CheckBalanceTask {
13
+ export declare class EthereumCheckBalanceTask extends CheckBalanceTask {
14
14
  protected override getCheckBalanceOptions(context: EthereumStepExecutorContext): Promise<CheckBalanceOptions>;
15
15
  }
16
16
  //#endregion
17
- export { EthereumCheckBalanceTask };
18
17
  //# sourceMappingURL=EthereumCheckBalanceTask.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EthereumCheckBalanceTask.d.ts","names":[],"sources":["../../../../src/core/tasks/EthereumCheckBalanceTask.ts"],"mappings":";;;;;;;;;;;;cAgBa,iCAAiC;qBACnB,uBACvB,SAAS,8BACR,QAAQ"}
1
+ {"version":3,"file":"EthereumCheckBalanceTask.d.ts","names":[],"sources":["../../../../src/core/tasks/EthereumCheckBalanceTask.ts"],"mappings":";;;;;;;;;;;;qBAgBa,iCAAiC;qBACnB,uBACvB,SAAS,8BACR,QAAQ"}
@@ -1,4 +1,4 @@
1
- import { isRelayerStep } from "../../utils/isRelayerStep.js";
1
+ import { isPermit2AllowanceLane } from "../../utils/getTypedDataLane.js";
2
2
  import { getAccountCode } from "../../actions/getAccountCode.js";
3
3
  import { isSmartContractWalletCode } from "../../actions/isSmartContractWallet.js";
4
4
  import { CheckBalanceTask } from "@lifi/sdk";
@@ -6,16 +6,17 @@ import { CheckBalanceTask } from "@lifi/sdk";
6
6
  /**
7
7
  * Skips the outer-tx gas check for steps where the wallet doesn't fund it:
8
8
  * smart-contract wallets (Safe Apps, 4337, 7579, …) where the
9
- * executor / bundler / paymaster pays, and relayed steps. Source amount
10
- * and non-included native fees are still verified.
9
+ * executor / bundler / paymaster pays, and typed-data steps the user does not
10
+ * fund. Source amount and non-included native fees are still verified.
11
11
  *
12
12
  * Skip-bias is intentional: a wrong skip is caught by the wallet rejecting
13
13
  * the tx; a wrong enforce blocks a tx that would have succeeded.
14
14
  */
15
15
  var EthereumCheckBalanceTask = class extends CheckBalanceTask {
16
16
  async getCheckBalanceOptions(context) {
17
- const { client, step } = context;
18
- if (isRelayerStep(step)) return { walletPaysGas: false };
17
+ const { client, step, fromChain } = context;
18
+ const userFundsTransaction = isPermit2AllowanceLane(step, fromChain);
19
+ if (step.typedData?.length && !userFundsTransaction) return { walletPaysGas: false };
19
20
  const fromAddress = step.action.fromAddress;
20
21
  if (!fromAddress) return {};
21
22
  const code = await getAccountCode({
@@ -1 +1 @@
1
- {"version":3,"file":"EthereumCheckBalanceTask.js","names":[],"sources":["../../../../src/core/tasks/EthereumCheckBalanceTask.ts"],"sourcesContent":["import { type CheckBalanceOptions, CheckBalanceTask } from '@lifi/sdk'\nimport type { Address } from 'viem'\nimport { getAccountCode } from '../../actions/getAccountCode.js'\nimport { isSmartContractWalletCode } from '../../actions/isSmartContractWallet.js'\nimport type { EthereumStepExecutorContext } from '../../types.js'\nimport { isRelayerStep } from '../../utils/isRelayerStep.js'\n\n/**\n * Skips the outer-tx gas check for steps where the wallet doesn't fund it:\n * smart-contract wallets (Safe Apps, 4337, 7579, …) where the\n * executor / bundler / paymaster pays, and relayed steps. Source amount\n * and non-included native fees are still verified.\n *\n * Skip-bias is intentional: a wrong skip is caught by the wallet rejecting\n * the tx; a wrong enforce blocks a tx that would have succeeded.\n */\nexport class EthereumCheckBalanceTask extends CheckBalanceTask {\n protected override async getCheckBalanceOptions(\n context: EthereumStepExecutorContext\n ): Promise<CheckBalanceOptions> {\n const { client, step } = context\n\n // Relayer pays gas regardless of wallet shape — answer is fixed, no RPC\n // needed.\n if (isRelayerStep(step)) {\n return { walletPaysGas: false }\n }\n\n // Funding wallet (NOT signer) — for Safe Apps these usually match, but\n // the balance question is about the funder. Compare with\n // `canAccountUseNativePermits`, which uses the signer.\n const fromAddress = step.action.fromAddress as Address | undefined\n if (!fromAddress) {\n return {}\n }\n\n // `step.action.fromChainId` (NOT wallet's connected chain) so cross-\n // chain / post-chain-switch flows query the chain that executes the step.\n const code = await getAccountCode({\n client,\n chainId: step.action.fromChainId,\n address: fromAddress,\n })\n\n // `code === undefined` on RPC failure → falls through to \"treat as EOA\"\n // since `isSmartContractWalletCode(undefined)` is `false` (conservative:\n // strict gas check stays on, today's behavior).\n return { walletPaysGas: !isSmartContractWalletCode(code) }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAgBA,IAAa,2BAAb,cAA8C,iBAAiB;CAC7D,MAAyB,uBACvB,SAC8B;EAC9B,MAAM,EAAE,QAAQ,SAAS;EAIzB,IAAI,cAAc,IAAI,GACpB,OAAO,EAAE,eAAe,MAAM;EAMhC,MAAM,cAAc,KAAK,OAAO;EAChC,IAAI,CAAC,aACH,OAAO,CAAC;EAKV,MAAM,OAAO,MAAM,eAAe;GAChC;GACA,SAAS,KAAK,OAAO;GACrB,SAAS;EACX,CAAC;EAKD,OAAO,EAAE,eAAe,CAAC,0BAA0B,IAAI,EAAE;CAC3D;AACF"}
1
+ {"version":3,"file":"EthereumCheckBalanceTask.js","names":[],"sources":["../../../../src/core/tasks/EthereumCheckBalanceTask.ts"],"sourcesContent":["import { type CheckBalanceOptions, CheckBalanceTask } from '@lifi/sdk'\nimport type { Address } from 'viem'\nimport { getAccountCode } from '../../actions/getAccountCode.js'\nimport { isSmartContractWalletCode } from '../../actions/isSmartContractWallet.js'\nimport type { EthereumStepExecutorContext } from '../../types.js'\nimport { isPermit2AllowanceLane } from '../../utils/getTypedDataLane.js'\n\n/**\n * Skips the outer-tx gas check for steps where the wallet doesn't fund it:\n * smart-contract wallets (Safe Apps, 4337, 7579, …) where the\n * executor / bundler / paymaster pays, and typed-data steps the user does not\n * fund. Source amount and non-included native fees are still verified.\n *\n * Skip-bias is intentional: a wrong skip is caught by the wallet rejecting\n * the tx; a wrong enforce blocks a tx that would have succeeded.\n */\nexport class EthereumCheckBalanceTask extends CheckBalanceTask {\n protected override async getCheckBalanceOptions(\n context: EthereumStepExecutorContext\n ): Promise<CheckBalanceOptions> {\n const { client, step, fromChain } = context\n\n const userFundsTransaction = isPermit2AllowanceLane(step, fromChain)\n if (step.typedData?.length && !userFundsTransaction) {\n return { walletPaysGas: false }\n }\n\n // Funding wallet (NOT signer) — for Safe Apps these usually match, but\n // the balance question is about the funder. Compare with\n // `canAccountUseNativePermits`, which uses the signer.\n const fromAddress = step.action.fromAddress as Address | undefined\n if (!fromAddress) {\n return {}\n }\n\n // `step.action.fromChainId` (NOT wallet's connected chain) so cross-\n // chain / post-chain-switch flows query the chain that executes the step.\n const code = await getAccountCode({\n client,\n chainId: step.action.fromChainId,\n address: fromAddress,\n })\n\n // `code === undefined` on RPC failure → falls through to \"treat as EOA\"\n // since `isSmartContractWalletCode(undefined)` is `false` (conservative:\n // strict gas check stays on, today's behavior).\n return { walletPaysGas: !isSmartContractWalletCode(code) }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAgBA,IAAa,2BAAb,cAA8C,iBAAiB;CAC7D,MAAyB,uBACvB,SAC8B;EAC9B,MAAM,EAAE,QAAQ,MAAM,cAAc;EAEpC,MAAM,uBAAuB,uBAAuB,MAAM,SAAS;EACnE,IAAI,KAAK,WAAW,UAAU,CAAC,sBAC7B,OAAO,EAAE,eAAe,MAAM;EAMhC,MAAM,cAAc,KAAK,OAAO;EAChC,IAAI,CAAC,aACH,OAAO,CAAC;EAKV,MAAM,OAAO,MAAM,eAAe;GAChC;GACA,SAAS,KAAK,OAAO;GACrB,SAAS;EACX,CAAC;EAKD,OAAO,EAAE,eAAe,CAAC,0BAA0B,IAAI,EAAE;CAC3D;AACF"}
@@ -1,10 +1,9 @@
1
1
  import { EthereumStepExecutorContext } from "../../types.js";
2
2
  import { BaseStepExecutionTask, TaskResult } from "@lifi/sdk";
3
3
  //#region src/core/tasks/EthereumCheckPermitsTask.d.ts
4
- declare class EthereumCheckPermitsTask extends BaseStepExecutionTask {
4
+ export declare class EthereumCheckPermitsTask extends BaseStepExecutionTask {
5
5
  override shouldRun(context: EthereumStepExecutorContext): Promise<boolean>;
6
6
  run(context: EthereumStepExecutorContext): Promise<TaskResult>;
7
7
  }
8
8
  //#endregion
9
- export { EthereumCheckPermitsTask };
10
9
  //# sourceMappingURL=EthereumCheckPermitsTask.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EthereumCheckPermitsTask.d.ts","names":[],"sources":["../../../../src/core/tasks/EthereumCheckPermitsTask.ts"],"mappings":";;;cAWa,iCAAiC;WAC7B,UACb,SAAS,8BACR;EAUH,IAAU,SAAS,8BAA8B,QAAQ"}
1
+ {"version":3,"file":"EthereumCheckPermitsTask.d.ts","names":[],"sources":["../../../../src/core/tasks/EthereumCheckPermitsTask.ts"],"mappings":";;;qBAUa,iCAAiC;WAC7B,UACb,SAAS,8BACR;EAWH,IAAU,SAAS,8BAA8B,QAAQ"}
@@ -1,50 +1,32 @@
1
+ import { getTypedDataInLane, getTypedDataLane, isPermit2AllowanceLane } from "../../utils/getTypedDataLane.js";
1
2
  import { getDomainChainId } from "../../utils/getDomainChainId.js";
2
- import { assertValidSignature } from "../../utils/isValidSignature.js";
3
+ import { signTypedDataEntries } from "./helpers/signTypedDataEntries.js";
3
4
  import { BaseStepExecutionTask } from "@lifi/sdk";
4
- import { signTypedData } from "viem/actions";
5
- import { getAction } from "viem/utils";
6
5
  //#region src/core/tasks/EthereumCheckPermitsTask.ts
7
6
  var EthereumCheckPermitsTask = class extends BaseStepExecutionTask {
8
7
  async shouldRun(context) {
9
- const { step, disableMessageSigning } = context;
10
- return !!(step.typedData?.filter((typedData) => typedData.primaryType === "Permit"))?.length && !disableMessageSigning;
8
+ const { step, fromChain, disableMessageSigning } = context;
9
+ return !!step.typedData?.some((typedData) => getTypedDataLane(typedData, fromChain) === "native-permit") && !disableMessageSigning;
11
10
  }
12
11
  async run(context) {
13
- const { step, statusManager, allowUserInteraction, checkClient, signedTypedData: currentSignedTypedData } = context;
12
+ const { step, fromChain, statusManager } = context;
14
13
  const action = statusManager.initializeAction({
15
14
  step,
16
15
  type: "PERMIT",
17
16
  chainId: step.action.fromChainId,
18
17
  status: "STARTED"
19
18
  });
20
- const permitTypedData = step.typedData?.filter((typedData) => typedData.primaryType === "Permit") ?? [];
21
- const signedTypedData = [...currentSignedTypedData];
22
- for (const typedData of permitTypedData) {
23
- statusManager.updateAction(step, action.type, "ACTION_REQUIRED");
24
- if (!allowUserInteraction) return { status: "PAUSED" };
25
- const permitClient = await checkClient(step, getDomainChainId(typedData.domain) || step.action.fromChainId);
26
- if (!permitClient) return { status: "PAUSED" };
27
- const signature = await getAction(permitClient, signTypedData, "signTypedData")({
28
- account: permitClient.account,
29
- domain: typedData.domain,
30
- types: typedData.types,
31
- primaryType: typedData.primaryType,
32
- message: typedData.message
33
- });
34
- assertValidSignature(signature);
35
- const signedPermit = {
36
- ...typedData,
37
- signature
38
- };
39
- signedTypedData.push(signedPermit);
40
- }
41
- const matchingPermit = signedTypedData.find((signedTypedData) => getDomainChainId(signedTypedData.domain) === step.action.fromChainId);
19
+ const permitTypedData = getTypedDataInLane(step, "native-permit", fromChain);
20
+ const result = await signTypedDataEntries(context, permitTypedData, action.type);
21
+ if (result.status === "PAUSED") return { status: "PAUSED" };
22
+ const { signedTypedData } = result;
23
+ const matchingPermit = signedTypedData.find((entry) => entry.primaryType === "Permit" && getDomainChainId(entry.domain) === step.action.fromChainId);
42
24
  statusManager.updateAction(step, action.type, "DONE");
43
25
  return {
44
26
  status: "COMPLETED",
45
27
  context: {
46
28
  signedTypedData,
47
- hasMatchingPermit: !!matchingPermit
29
+ hasMatchingPermit: !!matchingPermit && !isPermit2AllowanceLane(step, fromChain)
48
30
  }
49
31
  };
50
32
  }
@@ -1 +1 @@
1
- {"version":3,"file":"EthereumCheckPermitsTask.js","names":[],"sources":["../../../../src/core/tasks/EthereumCheckPermitsTask.ts"],"sourcesContent":["import {\n BaseStepExecutionTask,\n type SignedTypedData,\n type TaskResult,\n} from '@lifi/sdk'\nimport { signTypedData } from 'viem/actions'\nimport { getAction } from 'viem/utils'\nimport type { EthereumStepExecutorContext } from '../../types.js'\nimport { getDomainChainId } from '../../utils/getDomainChainId.js'\nimport { assertValidSignature } from '../../utils/isValidSignature.js'\n\nexport class EthereumCheckPermitsTask extends BaseStepExecutionTask {\n override async shouldRun(\n context: EthereumStepExecutorContext\n ): Promise<boolean> {\n const { step, disableMessageSigning } = context\n\n const permitTypedData = step.typedData?.filter(\n (typedData) => typedData.primaryType === 'Permit'\n )\n\n return !!permitTypedData?.length && !disableMessageSigning\n }\n\n async run(context: EthereumStepExecutorContext): Promise<TaskResult> {\n const {\n step,\n statusManager,\n allowUserInteraction,\n checkClient,\n signedTypedData: currentSignedTypedData,\n } = context\n\n const action = statusManager.initializeAction({\n step,\n type: 'PERMIT',\n chainId: step.action.fromChainId,\n status: 'STARTED',\n })\n\n // First, try to sign all permits in step.typedData\n const permitTypedData =\n step.typedData?.filter(\n (typedData) => typedData.primaryType === 'Permit'\n ) ?? []\n\n const signedTypedData = [...currentSignedTypedData]\n for (const typedData of permitTypedData) {\n statusManager.updateAction(step, action.type, 'ACTION_REQUIRED')\n\n if (!allowUserInteraction) {\n return { status: 'PAUSED' }\n }\n\n const typedDataChainId =\n getDomainChainId(typedData.domain) || step.action.fromChainId\n\n // Switch to the permit's chain if needed\n const permitClient = await checkClient(step, typedDataChainId)\n if (!permitClient) {\n return { status: 'PAUSED' }\n }\n\n const signature = await getAction(\n permitClient,\n signTypedData,\n 'signTypedData'\n )({\n account: permitClient.account!,\n domain: typedData.domain,\n types: typedData.types,\n primaryType: typedData.primaryType,\n message: typedData.message,\n })\n assertValidSignature(signature)\n const signedPermit: SignedTypedData = {\n ...typedData,\n signature,\n }\n signedTypedData.push(signedPermit)\n }\n\n // Check if there's a signed permit for the source transaction chain\n const matchingPermit = signedTypedData.find(\n (signedTypedData) =>\n getDomainChainId(signedTypedData.domain) === step.action.fromChainId\n )\n\n statusManager.updateAction(step, action.type, 'DONE')\n\n return {\n status: 'COMPLETED',\n context: { signedTypedData, hasMatchingPermit: !!matchingPermit },\n }\n }\n}\n"],"mappings":";;;;;;AAWA,IAAa,2BAAb,cAA8C,sBAAsB;CAClE,MAAe,UACb,SACkB;EAClB,MAAM,EAAE,MAAM,0BAA0B;EAMxC,OAAO,CAAC,EAJgB,KAAK,WAAW,QACrC,cAAc,UAAU,gBAAgB,QAC3C,EAAA,EAE0B,UAAU,CAAC;CACvC;CAEA,MAAM,IAAI,SAA2D;EACnE,MAAM,EACJ,MACA,eACA,sBACA,aACA,iBAAiB,2BACf;EAEJ,MAAM,SAAS,cAAc,iBAAiB;GAC5C;GACA,MAAM;GACN,SAAS,KAAK,OAAO;GACrB,QAAQ;EACV,CAAC;EAGD,MAAM,kBACJ,KAAK,WAAW,QACb,cAAc,UAAU,gBAAgB,QAC3C,KAAK,CAAC;EAER,MAAM,kBAAkB,CAAC,GAAG,sBAAsB;EAClD,KAAK,MAAM,aAAa,iBAAiB;GACvC,cAAc,aAAa,MAAM,OAAO,MAAM,iBAAiB;GAE/D,IAAI,CAAC,sBACH,OAAO,EAAE,QAAQ,SAAS;GAO5B,MAAM,eAAe,MAAM,YAAY,MAHrC,iBAAiB,UAAU,MAAM,KAAK,KAAK,OAAO,WAGS;GAC7D,IAAI,CAAC,cACH,OAAO,EAAE,QAAQ,SAAS;GAG5B,MAAM,YAAY,MAAM,UACtB,cACA,eACA,eACF,CAAC,CAAC;IACA,SAAS,aAAa;IACtB,QAAQ,UAAU;IAClB,OAAO,UAAU;IACjB,aAAa,UAAU;IACvB,SAAS,UAAU;GACrB,CAAC;GACD,qBAAqB,SAAS;GAC9B,MAAM,eAAgC;IACpC,GAAG;IACH;GACF;GACA,gBAAgB,KAAK,YAAY;EACnC;EAGA,MAAM,iBAAiB,gBAAgB,MACpC,oBACC,iBAAiB,gBAAgB,MAAM,MAAM,KAAK,OAAO,WAC7D;EAEA,cAAc,aAAa,MAAM,OAAO,MAAM,MAAM;EAEpD,OAAO;GACL,QAAQ;GACR,SAAS;IAAE;IAAiB,mBAAmB,CAAC,CAAC;GAAe;EAClE;CACF;AACF"}
1
+ {"version":3,"file":"EthereumCheckPermitsTask.js","names":[],"sources":["../../../../src/core/tasks/EthereumCheckPermitsTask.ts"],"sourcesContent":["import { BaseStepExecutionTask, type TaskResult } from '@lifi/sdk'\nimport type { EthereumStepExecutorContext } from '../../types.js'\nimport { getDomainChainId } from '../../utils/getDomainChainId.js'\nimport {\n getTypedDataInLane,\n getTypedDataLane,\n isPermit2AllowanceLane,\n} from '../../utils/getTypedDataLane.js'\nimport { signTypedDataEntries } from './helpers/signTypedDataEntries.js'\n\nexport class EthereumCheckPermitsTask extends BaseStepExecutionTask {\n override async shouldRun(\n context: EthereumStepExecutorContext\n ): Promise<boolean> {\n const { step, fromChain, disableMessageSigning } = context\n\n return (\n !!step.typedData?.some(\n (typedData) =>\n getTypedDataLane(typedData, fromChain) === 'native-permit'\n ) && !disableMessageSigning\n )\n }\n\n async run(context: EthereumStepExecutorContext): Promise<TaskResult> {\n const { step, fromChain, statusManager } = context\n\n const action = statusManager.initializeAction({\n step,\n type: 'PERMIT',\n chainId: step.action.fromChainId,\n status: 'STARTED',\n })\n\n const permitTypedData = getTypedDataInLane(step, 'native-permit', fromChain)\n\n const result = await signTypedDataEntries(\n context,\n permitTypedData,\n action.type\n )\n if (result.status === 'PAUSED') {\n return { status: 'PAUSED' }\n }\n const { signedTypedData } = result\n\n const matchingPermit = signedTypedData.find(\n (entry) =>\n entry.primaryType === 'Permit' &&\n getDomainChainId(entry.domain) === step.action.fromChainId\n )\n\n statusManager.updateAction(step, action.type, 'DONE')\n\n return {\n status: 'COMPLETED',\n context: {\n signedTypedData,\n hasMatchingPermit:\n !!matchingPermit && !isPermit2AllowanceLane(step, fromChain),\n },\n }\n }\n}\n"],"mappings":";;;;;AAUA,IAAa,2BAAb,cAA8C,sBAAsB;CAClE,MAAe,UACb,SACkB;EAClB,MAAM,EAAE,MAAM,WAAW,0BAA0B;EAEnD,OACE,CAAC,CAAC,KAAK,WAAW,MACf,cACC,iBAAiB,WAAW,SAAS,MAAM,eAC/C,KAAK,CAAC;CAEV;CAEA,MAAM,IAAI,SAA2D;EACnE,MAAM,EAAE,MAAM,WAAW,kBAAkB;EAE3C,MAAM,SAAS,cAAc,iBAAiB;GAC5C;GACA,MAAM;GACN,SAAS,KAAK,OAAO;GACrB,QAAQ;EACV,CAAC;EAED,MAAM,kBAAkB,mBAAmB,MAAM,iBAAiB,SAAS;EAE3E,MAAM,SAAS,MAAM,qBACnB,SACA,iBACA,OAAO,IACT;EACA,IAAI,OAAO,WAAW,UACpB,OAAO,EAAE,QAAQ,SAAS;EAE5B,MAAM,EAAE,oBAAoB;EAE5B,MAAM,iBAAiB,gBAAgB,MACpC,UACC,MAAM,gBAAgB,YACtB,iBAAiB,MAAM,MAAM,MAAM,KAAK,OAAO,WACnD;EAEA,cAAc,aAAa,MAAM,OAAO,MAAM,MAAM;EAEpD,OAAO;GACL,QAAQ;GACR,SAAS;IACP;IACA,mBACE,CAAC,CAAC,kBAAkB,CAAC,uBAAuB,MAAM,SAAS;GAC/D;EACF;CACF;AACF"}
@@ -1,10 +1,9 @@
1
1
  import { EthereumStepExecutorContext } from "../../types.js";
2
2
  import { BaseStepExecutionTask, TaskResult } from "@lifi/sdk";
3
3
  //#region src/core/tasks/EthereumNativePermitTask.d.ts
4
- declare class EthereumNativePermitTask extends BaseStepExecutionTask {
4
+ export declare class EthereumNativePermitTask extends BaseStepExecutionTask {
5
5
  override shouldRun(context: EthereumStepExecutorContext): Promise<boolean>;
6
6
  run(context: EthereumStepExecutorContext): Promise<TaskResult>;
7
7
  }
8
8
  //#endregion
9
- export { EthereumNativePermitTask };
10
9
  //# sourceMappingURL=EthereumNativePermitTask.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EthereumNativePermitTask.d.ts","names":[],"sources":["../../../../src/core/tasks/EthereumNativePermitTask.ts"],"mappings":";;;cAea,iCAAiC;WAC7B,UACb,SAAS,8BACR;EAwBH,IAAU,SAAS,8BAA8B,QAAQ"}
1
+ {"version":3,"file":"EthereumNativePermitTask.d.ts","names":[],"sources":["../../../../src/core/tasks/EthereumNativePermitTask.ts"],"mappings":";;;qBAgBa,iCAAiC;WAC7B,UACb,SAAS,8BACR;EA4BH,IAAU,SAAS,8BAA8B,QAAQ"}
@@ -1,4 +1,5 @@
1
1
  import { getActionWithFallback } from "../../utils/getActionWithFallback.js";
2
+ import { isPermit2AllowanceLane } from "../../utils/getTypedDataLane.js";
2
3
  import { getEthereumExecutionStrategy } from "./helpers/getEthereumExecutionStrategy.js";
3
4
  import { isValidSignature } from "../../utils/isValidSignature.js";
4
5
  import { getNativePermit } from "../../permits/getNativePermit.js";
@@ -11,6 +12,7 @@ var EthereumNativePermitTask = class extends BaseStepExecutionTask {
11
12
  async shouldRun(context) {
12
13
  const { step, fromChain, hasMatchingPermit, hasSufficientAllowance, disableMessageSigning } = context;
13
14
  if (hasMatchingPermit || hasSufficientAllowance) return false;
15
+ if (isPermit2AllowanceLane(step, fromChain)) return false;
14
16
  const batchingSupported = await getEthereumExecutionStrategy(context) === "batched";
15
17
  return !!fromChain.permit2Proxy && !batchingSupported && !disableMessageSigning && !step.estimate.skipPermit;
16
18
  }
@@ -1 +1 @@
1
- {"version":3,"file":"EthereumNativePermitTask.js","names":[],"sources":["../../../../src/core/tasks/EthereumNativePermitTask.ts"],"sourcesContent":["import {\n BaseStepExecutionTask,\n type SignedTypedData,\n type TaskResult,\n} from '@lifi/sdk'\nimport type { Address } from 'viem'\nimport { signTypedData } from 'viem/actions'\nimport { getAction } from 'viem/utils'\nimport { getNativePermit } from '../../permits/getNativePermit.js'\nimport { isNativePermitValid } from '../../permits/isNativePermitValid.js'\nimport type { EthereumStepExecutorContext } from '../../types.js'\nimport { getActionWithFallback } from '../../utils/getActionWithFallback.js'\nimport { isValidSignature } from '../../utils/isValidSignature.js'\nimport { getEthereumExecutionStrategy } from './helpers/getEthereumExecutionStrategy.js'\n\nexport class EthereumNativePermitTask extends BaseStepExecutionTask {\n override async shouldRun(\n context: EthereumStepExecutorContext\n ): Promise<boolean> {\n const {\n step,\n fromChain,\n hasMatchingPermit,\n hasSufficientAllowance,\n disableMessageSigning,\n } = context\n\n if (hasMatchingPermit || hasSufficientAllowance) {\n return false\n }\n\n const executionStrategy = await getEthereumExecutionStrategy(context)\n const batchingSupported = executionStrategy === 'batched'\n // Check if proxy contract is available and message signing is not disabled, also not available for atomic batch\n const isNativePermitAvailable =\n !!fromChain.permit2Proxy &&\n !batchingSupported &&\n !disableMessageSigning &&\n !step.estimate.skipPermit\n return isNativePermitAvailable\n }\n\n async run(context: EthereumStepExecutorContext): Promise<TaskResult> {\n const {\n step,\n client,\n fromChain,\n statusManager,\n allowUserInteraction,\n checkClient,\n signedTypedData: currentSignedTypedData,\n } = context\n\n const action = statusManager.initializeAction({\n step,\n type: 'NATIVE_PERMIT',\n chainId: step.action.fromChainId,\n status: 'STARTED',\n })\n\n const updatedClient = await checkClient(step)\n if (!updatedClient) {\n return { status: 'PAUSED' }\n }\n\n const fromAmount = BigInt(step.action.fromAmount)\n\n const nativePermitData = await getActionWithFallback(\n client,\n updatedClient,\n getNativePermit,\n 'getNativePermit',\n {\n client,\n viemClient: updatedClient,\n chainId: fromChain.id,\n tokenAddress: step.action.fromToken.address as Address,\n spenderAddress: fromChain.permit2Proxy as Address,\n amount: fromAmount,\n ownerAddress: updatedClient.account!.address,\n }\n )\n\n if (!nativePermitData) {\n statusManager.updateAction(step, action.type, 'DONE')\n return { status: 'COMPLETED' }\n }\n\n const signedTypedData = [...currentSignedTypedData]\n\n // Check if we already have a valid permit for this chain and requirements\n const signedTypedDataForChain = signedTypedData.find((signedTypedData) =>\n isNativePermitValid(signedTypedData, nativePermitData)\n )\n\n if (!signedTypedDataForChain) {\n statusManager.updateAction(step, action.type, 'ACTION_REQUIRED')\n\n if (!allowUserInteraction) {\n return { status: 'PAUSED' }\n }\n\n // Sign the permit\n const signature = await getAction(\n updatedClient,\n signTypedData,\n 'signTypedData'\n )({\n account: updatedClient.account!,\n domain: nativePermitData.domain,\n types: nativePermitData.types,\n primaryType: nativePermitData.primaryType,\n message: nativePermitData.message,\n })\n\n // Some wallets resolve signTypedData with a nullish or empty value\n // instead of rejecting — skip the permit and fall back to the\n // Permit2/standard approval flow\n if (!isValidSignature(signature)) {\n statusManager.updateAction(step, action.type, 'DONE')\n return { status: 'COMPLETED' }\n }\n\n // Add the new permit to the signed permits array\n const signedPermit: SignedTypedData = {\n ...nativePermitData,\n signature,\n }\n signedTypedData.push(signedPermit)\n }\n\n statusManager.updateAction(step, action.type, 'DONE')\n\n return {\n status: 'COMPLETED',\n context: { signedTypedData, hasMatchingPermit: true },\n }\n }\n}\n"],"mappings":";;;;;;;;;AAeA,IAAa,2BAAb,cAA8C,sBAAsB;CAClE,MAAe,UACb,SACkB;EAClB,MAAM,EACJ,MACA,WACA,mBACA,wBACA,0BACE;EAEJ,IAAI,qBAAqB,wBACvB,OAAO;EAIT,MAAM,oBAAoB,MADM,6BAA6B,OAAO,MACpB;EAOhD,OAJE,CAAC,CAAC,UAAU,gBACZ,CAAC,qBACD,CAAC,yBACD,CAAC,KAAK,SAAS;CAEnB;CAEA,MAAM,IAAI,SAA2D;EACnE,MAAM,EACJ,MACA,QACA,WACA,eACA,sBACA,aACA,iBAAiB,2BACf;EAEJ,MAAM,SAAS,cAAc,iBAAiB;GAC5C;GACA,MAAM;GACN,SAAS,KAAK,OAAO;GACrB,QAAQ;EACV,CAAC;EAED,MAAM,gBAAgB,MAAM,YAAY,IAAI;EAC5C,IAAI,CAAC,eACH,OAAO,EAAE,QAAQ,SAAS;EAG5B,MAAM,aAAa,OAAO,KAAK,OAAO,UAAU;EAEhD,MAAM,mBAAmB,MAAM,sBAC7B,QACA,eACA,iBACA,mBACA;GACE;GACA,YAAY;GACZ,SAAS,UAAU;GACnB,cAAc,KAAK,OAAO,UAAU;GACpC,gBAAgB,UAAU;GAC1B,QAAQ;GACR,cAAc,cAAc,QAAS;EACvC,CACF;EAEA,IAAI,CAAC,kBAAkB;GACrB,cAAc,aAAa,MAAM,OAAO,MAAM,MAAM;GACpD,OAAO,EAAE,QAAQ,YAAY;EAC/B;EAEA,MAAM,kBAAkB,CAAC,GAAG,sBAAsB;EAOlD,IAAI,CAJ4B,gBAAgB,MAAM,oBACpD,oBAAoB,iBAAiB,gBAAgB,CAG5B,GAAG;GAC5B,cAAc,aAAa,MAAM,OAAO,MAAM,iBAAiB;GAE/D,IAAI,CAAC,sBACH,OAAO,EAAE,QAAQ,SAAS;GAI5B,MAAM,YAAY,MAAM,UACtB,eACA,eACA,eACF,CAAC,CAAC;IACA,SAAS,cAAc;IACvB,QAAQ,iBAAiB;IACzB,OAAO,iBAAiB;IACxB,aAAa,iBAAiB;IAC9B,SAAS,iBAAiB;GAC5B,CAAC;GAKD,IAAI,CAAC,iBAAiB,SAAS,GAAG;IAChC,cAAc,aAAa,MAAM,OAAO,MAAM,MAAM;IACpD,OAAO,EAAE,QAAQ,YAAY;GAC/B;GAGA,MAAM,eAAgC;IACpC,GAAG;IACH;GACF;GACA,gBAAgB,KAAK,YAAY;EACnC;EAEA,cAAc,aAAa,MAAM,OAAO,MAAM,MAAM;EAEpD,OAAO;GACL,QAAQ;GACR,SAAS;IAAE;IAAiB,mBAAmB;GAAK;EACtD;CACF;AACF"}
1
+ {"version":3,"file":"EthereumNativePermitTask.js","names":[],"sources":["../../../../src/core/tasks/EthereumNativePermitTask.ts"],"sourcesContent":["import {\n BaseStepExecutionTask,\n type SignedTypedData,\n type TaskResult,\n} from '@lifi/sdk'\nimport type { Address } from 'viem'\nimport { signTypedData } from 'viem/actions'\nimport { getAction } from 'viem/utils'\nimport { getNativePermit } from '../../permits/getNativePermit.js'\nimport { isNativePermitValid } from '../../permits/isNativePermitValid.js'\nimport type { EthereumStepExecutorContext } from '../../types.js'\nimport { getActionWithFallback } from '../../utils/getActionWithFallback.js'\nimport { isPermit2AllowanceLane } from '../../utils/getTypedDataLane.js'\nimport { isValidSignature } from '../../utils/isValidSignature.js'\nimport { getEthereumExecutionStrategy } from './helpers/getEthereumExecutionStrategy.js'\n\nexport class EthereumNativePermitTask extends BaseStepExecutionTask {\n override async shouldRun(\n context: EthereumStepExecutorContext\n ): Promise<boolean> {\n const {\n step,\n fromChain,\n hasMatchingPermit,\n hasSufficientAllowance,\n disableMessageSigning,\n } = context\n\n if (hasMatchingPermit || hasSufficientAllowance) {\n return false\n }\n\n if (isPermit2AllowanceLane(step, fromChain)) {\n return false\n }\n\n const executionStrategy = await getEthereumExecutionStrategy(context)\n const batchingSupported = executionStrategy === 'batched'\n // Check if proxy contract is available and message signing is not disabled, also not available for atomic batch\n const isNativePermitAvailable =\n !!fromChain.permit2Proxy &&\n !batchingSupported &&\n !disableMessageSigning &&\n !step.estimate.skipPermit\n return isNativePermitAvailable\n }\n\n async run(context: EthereumStepExecutorContext): Promise<TaskResult> {\n const {\n step,\n client,\n fromChain,\n statusManager,\n allowUserInteraction,\n checkClient,\n signedTypedData: currentSignedTypedData,\n } = context\n\n const action = statusManager.initializeAction({\n step,\n type: 'NATIVE_PERMIT',\n chainId: step.action.fromChainId,\n status: 'STARTED',\n })\n\n const updatedClient = await checkClient(step)\n if (!updatedClient) {\n return { status: 'PAUSED' }\n }\n\n const fromAmount = BigInt(step.action.fromAmount)\n\n const nativePermitData = await getActionWithFallback(\n client,\n updatedClient,\n getNativePermit,\n 'getNativePermit',\n {\n client,\n viemClient: updatedClient,\n chainId: fromChain.id,\n tokenAddress: step.action.fromToken.address as Address,\n spenderAddress: fromChain.permit2Proxy as Address,\n amount: fromAmount,\n ownerAddress: updatedClient.account!.address,\n }\n )\n\n if (!nativePermitData) {\n statusManager.updateAction(step, action.type, 'DONE')\n return { status: 'COMPLETED' }\n }\n\n const signedTypedData = [...currentSignedTypedData]\n\n // Check if we already have a valid permit for this chain and requirements\n const signedTypedDataForChain = signedTypedData.find((signedTypedData) =>\n isNativePermitValid(signedTypedData, nativePermitData)\n )\n\n if (!signedTypedDataForChain) {\n statusManager.updateAction(step, action.type, 'ACTION_REQUIRED')\n\n if (!allowUserInteraction) {\n return { status: 'PAUSED' }\n }\n\n // Sign the permit\n const signature = await getAction(\n updatedClient,\n signTypedData,\n 'signTypedData'\n )({\n account: updatedClient.account!,\n domain: nativePermitData.domain,\n types: nativePermitData.types,\n primaryType: nativePermitData.primaryType,\n message: nativePermitData.message,\n })\n\n // Some wallets resolve signTypedData with a nullish or empty value\n // instead of rejecting — skip the permit and fall back to the\n // Permit2/standard approval flow\n if (!isValidSignature(signature)) {\n statusManager.updateAction(step, action.type, 'DONE')\n return { status: 'COMPLETED' }\n }\n\n // Add the new permit to the signed permits array\n const signedPermit: SignedTypedData = {\n ...nativePermitData,\n signature,\n }\n signedTypedData.push(signedPermit)\n }\n\n statusManager.updateAction(step, action.type, 'DONE')\n\n return {\n status: 'COMPLETED',\n context: { signedTypedData, hasMatchingPermit: true },\n }\n }\n}\n"],"mappings":";;;;;;;;;;AAgBA,IAAa,2BAAb,cAA8C,sBAAsB;CAClE,MAAe,UACb,SACkB;EAClB,MAAM,EACJ,MACA,WACA,mBACA,wBACA,0BACE;EAEJ,IAAI,qBAAqB,wBACvB,OAAO;EAGT,IAAI,uBAAuB,MAAM,SAAS,GACxC,OAAO;EAIT,MAAM,oBAAoB,MADM,6BAA6B,OAAO,MACpB;EAOhD,OAJE,CAAC,CAAC,UAAU,gBACZ,CAAC,qBACD,CAAC,yBACD,CAAC,KAAK,SAAS;CAEnB;CAEA,MAAM,IAAI,SAA2D;EACnE,MAAM,EACJ,MACA,QACA,WACA,eACA,sBACA,aACA,iBAAiB,2BACf;EAEJ,MAAM,SAAS,cAAc,iBAAiB;GAC5C;GACA,MAAM;GACN,SAAS,KAAK,OAAO;GACrB,QAAQ;EACV,CAAC;EAED,MAAM,gBAAgB,MAAM,YAAY,IAAI;EAC5C,IAAI,CAAC,eACH,OAAO,EAAE,QAAQ,SAAS;EAG5B,MAAM,aAAa,OAAO,KAAK,OAAO,UAAU;EAEhD,MAAM,mBAAmB,MAAM,sBAC7B,QACA,eACA,iBACA,mBACA;GACE;GACA,YAAY;GACZ,SAAS,UAAU;GACnB,cAAc,KAAK,OAAO,UAAU;GACpC,gBAAgB,UAAU;GAC1B,QAAQ;GACR,cAAc,cAAc,QAAS;EACvC,CACF;EAEA,IAAI,CAAC,kBAAkB;GACrB,cAAc,aAAa,MAAM,OAAO,MAAM,MAAM;GACpD,OAAO,EAAE,QAAQ,YAAY;EAC/B;EAEA,MAAM,kBAAkB,CAAC,GAAG,sBAAsB;EAOlD,IAAI,CAJ4B,gBAAgB,MAAM,oBACpD,oBAAoB,iBAAiB,gBAAgB,CAG5B,GAAG;GAC5B,cAAc,aAAa,MAAM,OAAO,MAAM,iBAAiB;GAE/D,IAAI,CAAC,sBACH,OAAO,EAAE,QAAQ,SAAS;GAI5B,MAAM,YAAY,MAAM,UACtB,eACA,eACA,eACF,CAAC,CAAC;IACA,SAAS,cAAc;IACvB,QAAQ,iBAAiB;IACzB,OAAO,iBAAiB;IACxB,aAAa,iBAAiB;IAC9B,SAAS,iBAAiB;GAC5B,CAAC;GAKD,IAAI,CAAC,iBAAiB,SAAS,GAAG;IAChC,cAAc,aAAa,MAAM,OAAO,MAAM,MAAM;IACpD,OAAO,EAAE,QAAQ,YAAY;GAC/B;GAGA,MAAM,eAAgC;IACpC,GAAG;IACH;GACF;GACA,gBAAgB,KAAK,YAAY;EACnC;EAEA,cAAc,aAAa,MAAM,OAAO,MAAM,MAAM;EAEpD,OAAO;GACL,QAAQ;GACR,SAAS;IAAE;IAAiB,mBAAmB;GAAK;EACtD;CACF;AACF"}
@@ -0,0 +1,10 @@
1
+ import { EthereumStepExecutorContext } from "../../types.js";
2
+ import { BaseStepExecutionTask, TaskResult } from "@lifi/sdk";
3
+ //#region src/core/tasks/EthereumPermit2AllowanceTask.d.ts
4
+ /** Signs the Permit2 allowances a caller attached to its own step, before prepare. */
5
+ export declare class EthereumPermit2AllowanceTask extends BaseStepExecutionTask {
6
+ override shouldRun(context: EthereumStepExecutorContext): Promise<boolean>;
7
+ run(context: EthereumStepExecutorContext): Promise<TaskResult>;
8
+ }
9
+ //#endregion
10
+ //# sourceMappingURL=EthereumPermit2AllowanceTask.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EthereumPermit2AllowanceTask.d.ts","names":[],"sources":["../../../../src/core/tasks/EthereumPermit2AllowanceTask.ts"],"mappings":";;;;qBASa,qCAAqC;WACjC,UACb,SAAS,8BACR;EAMH,IAAU,SAAS,8BAA8B,QAAQ"}
@@ -0,0 +1,32 @@
1
+ import { getTypedDataInLane, isPermit2AllowanceLane } from "../../utils/getTypedDataLane.js";
2
+ import { signTypedDataEntries } from "./helpers/signTypedDataEntries.js";
3
+ import { BaseStepExecutionTask } from "@lifi/sdk";
4
+ //#region src/core/tasks/EthereumPermit2AllowanceTask.ts
5
+ /** Signs the Permit2 allowances a caller attached to its own step, before prepare. */
6
+ var EthereumPermit2AllowanceTask = class extends BaseStepExecutionTask {
7
+ async shouldRun(context) {
8
+ const { step, fromChain, disableMessageSigning } = context;
9
+ return isPermit2AllowanceLane(step, fromChain) && !disableMessageSigning;
10
+ }
11
+ async run(context) {
12
+ const { step, fromChain, statusManager } = context;
13
+ const action = statusManager.initializeAction({
14
+ step,
15
+ type: "PERMIT",
16
+ chainId: step.action.fromChainId,
17
+ status: "STARTED"
18
+ });
19
+ const allowanceTypedData = getTypedDataInLane(step, "permit2-allowance", fromChain);
20
+ const result = await signTypedDataEntries(context, allowanceTypedData, action.type);
21
+ if (result.status === "PAUSED") return { status: "PAUSED" };
22
+ statusManager.updateAction(step, action.type, "DONE");
23
+ return {
24
+ status: "COMPLETED",
25
+ context: { signedTypedData: result.signedTypedData }
26
+ };
27
+ }
28
+ };
29
+ //#endregion
30
+ export { EthereumPermit2AllowanceTask };
31
+
32
+ //# sourceMappingURL=EthereumPermit2AllowanceTask.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EthereumPermit2AllowanceTask.js","names":[],"sources":["../../../../src/core/tasks/EthereumPermit2AllowanceTask.ts"],"sourcesContent":["import { BaseStepExecutionTask, type TaskResult } from '@lifi/sdk'\nimport type { EthereumStepExecutorContext } from '../../types.js'\nimport {\n getTypedDataInLane,\n isPermit2AllowanceLane,\n} from '../../utils/getTypedDataLane.js'\nimport { signTypedDataEntries } from './helpers/signTypedDataEntries.js'\n\n/** Signs the Permit2 allowances a caller attached to its own step, before prepare. */\nexport class EthereumPermit2AllowanceTask extends BaseStepExecutionTask {\n override async shouldRun(\n context: EthereumStepExecutorContext\n ): Promise<boolean> {\n const { step, fromChain, disableMessageSigning } = context\n\n return isPermit2AllowanceLane(step, fromChain) && !disableMessageSigning\n }\n\n async run(context: EthereumStepExecutorContext): Promise<TaskResult> {\n const { step, fromChain, statusManager } = context\n\n const action = statusManager.initializeAction({\n step,\n type: 'PERMIT',\n chainId: step.action.fromChainId,\n status: 'STARTED',\n })\n\n const allowanceTypedData = getTypedDataInLane(\n step,\n 'permit2-allowance',\n fromChain\n )\n\n // `ACTION_REQUIRED`, not `MESSAGE_REQUIRED`: the widget maps no `PERMIT`\n // text for it. Pinned by `emits exactly STARTED, ACTION_REQUIRED and DONE`.\n const result = await signTypedDataEntries(\n context,\n allowanceTypedData,\n action.type\n )\n if (result.status === 'PAUSED') {\n return { status: 'PAUSED' }\n }\n\n statusManager.updateAction(step, action.type, 'DONE')\n\n return {\n status: 'COMPLETED',\n context: { signedTypedData: result.signedTypedData },\n }\n }\n}\n"],"mappings":";;;;;AASA,IAAa,+BAAb,cAAkD,sBAAsB;CACtE,MAAe,UACb,SACkB;EAClB,MAAM,EAAE,MAAM,WAAW,0BAA0B;EAEnD,OAAO,uBAAuB,MAAM,SAAS,KAAK,CAAC;CACrD;CAEA,MAAM,IAAI,SAA2D;EACnE,MAAM,EAAE,MAAM,WAAW,kBAAkB;EAE3C,MAAM,SAAS,cAAc,iBAAiB;GAC5C;GACA,MAAM;GACN,SAAS,KAAK,OAAO;GACrB,QAAQ;EACV,CAAC;EAED,MAAM,qBAAqB,mBACzB,MACA,qBACA,SACF;EAIA,MAAM,SAAS,MAAM,qBACnB,SACA,oBACA,OAAO,IACT;EACA,IAAI,OAAO,WAAW,UACpB,OAAO,EAAE,QAAQ,SAAS;EAG5B,cAAc,aAAa,MAAM,OAAO,MAAM,MAAM;EAEpD,OAAO;GACL,QAAQ;GACR,SAAS,EAAE,iBAAiB,OAAO,gBAAgB;EACrD;CACF;AACF"}
@@ -1,9 +1,8 @@
1
1
  import { EthereumStepExecutorContext } from "../../types.js";
2
2
  import { BaseStepExecutionTask, TaskResult } from "@lifi/sdk";
3
3
  //#region src/core/tasks/EthereumPrepareTransactionTask.d.ts
4
- declare class EthereumPrepareTransactionTask extends BaseStepExecutionTask {
4
+ export declare class EthereumPrepareTransactionTask extends BaseStepExecutionTask {
5
5
  run(context: EthereumStepExecutorContext): Promise<TaskResult>;
6
6
  }
7
7
  //#endregion
8
- export { EthereumPrepareTransactionTask };
9
8
  //# sourceMappingURL=EthereumPrepareTransactionTask.d.ts.map