@lifi/sdk-provider-ethereum 4.2.12 → 4.3.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 (577) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/dist/cjs/EthereumProvider.d.ts +1 -4
  3. package/dist/cjs/EthereumProvider.js +1 -2
  4. package/dist/cjs/actions/checkPermitSupport.d.ts +1 -4
  5. package/dist/cjs/actions/checkPermitSupport.js +5 -6
  6. package/dist/cjs/actions/checkPermitSupport.js.map +1 -1
  7. package/dist/cjs/actions/constants.d.ts +1 -4
  8. package/dist/cjs/actions/constants.js +1 -2
  9. package/dist/cjs/actions/getAccountCode.d.ts +1 -4
  10. package/dist/cjs/actions/getAccountCode.js +1 -2
  11. package/dist/cjs/actions/getAllowance.d.ts +2 -5
  12. package/dist/cjs/actions/getAllowance.js +6 -7
  13. package/dist/cjs/actions/getAllowance.js.map +1 -1
  14. package/dist/cjs/actions/getEthereumBalance.d.ts +1 -4
  15. package/dist/cjs/actions/getEthereumBalance.js +1 -2
  16. package/dist/cjs/actions/getMaxPriorityFeePerGas.d.ts +1 -4
  17. package/dist/cjs/actions/getMaxPriorityFeePerGas.js +3 -4
  18. package/dist/cjs/actions/getMaxPriorityFeePerGas.js.map +1 -1
  19. package/dist/cjs/actions/getMulticallAddress.d.ts +1 -4
  20. package/dist/cjs/actions/getMulticallAddress.js +1 -2
  21. package/dist/cjs/actions/isBatchingSupported.d.ts +1 -4
  22. package/dist/cjs/actions/isBatchingSupported.js +1 -2
  23. package/dist/cjs/actions/isSafeSignature.d.ts +2 -5
  24. package/dist/cjs/actions/isSafeSignature.js +3 -3
  25. package/dist/cjs/actions/isSafeSignature.js.map +1 -1
  26. package/dist/cjs/actions/isSafeWallet.d.ts +1 -4
  27. package/dist/cjs/actions/isSafeWallet.js +2 -3
  28. package/dist/cjs/actions/isSmartContractWallet.d.ts +1 -4
  29. package/dist/cjs/actions/isSmartContractWallet.js +1 -2
  30. package/dist/cjs/actions/resolveENSAddress.d.ts +1 -4
  31. package/dist/cjs/actions/resolveENSAddress.js +1 -2
  32. package/dist/cjs/actions/resolveEthereumAddress.d.ts +1 -4
  33. package/dist/cjs/actions/resolveEthereumAddress.js +1 -2
  34. package/dist/cjs/actions/resolveTransactionHash.d.ts +1 -4
  35. package/dist/cjs/actions/resolveTransactionHash.js +7 -4
  36. package/dist/cjs/actions/resolveTransactionHash.js.map +1 -1
  37. package/dist/cjs/actions/resolveUNSAddress.d.ts +1 -4
  38. package/dist/cjs/actions/resolveUNSAddress.js +2 -3
  39. package/dist/cjs/actions/setAllowance.d.ts +3 -6
  40. package/dist/cjs/actions/setAllowance.js +10 -7
  41. package/dist/cjs/actions/setAllowance.js.map +1 -1
  42. package/dist/cjs/actions/waitForBatchTransactionReceipt.d.ts +1 -4
  43. package/dist/cjs/actions/waitForBatchTransactionReceipt.js +1 -2
  44. package/dist/cjs/actions/waitForRelayedTransactionReceipt.d.ts +2 -5
  45. package/dist/cjs/actions/waitForRelayedTransactionReceipt.js +50 -12
  46. package/dist/cjs/actions/waitForRelayedTransactionReceipt.js.map +1 -1
  47. package/dist/cjs/actions/waitForSafeTransactionExecution.d.ts +1 -4
  48. package/dist/cjs/actions/waitForSafeTransactionExecution.js +2 -3
  49. package/dist/cjs/actions/waitForTransactionReceipt.d.ts +1 -4
  50. package/dist/cjs/actions/waitForTransactionReceipt.js +1 -2
  51. package/dist/cjs/client/publicClient.d.ts +1 -4
  52. package/dist/cjs/client/publicClient.js +1 -2
  53. package/dist/cjs/client/safeClient.d.ts +1 -4
  54. package/dist/cjs/client/safeClient.js +1 -2
  55. package/dist/cjs/client/types.d.ts +1 -4
  56. package/dist/cjs/core/EthereumStepExecutor.d.ts +1 -4
  57. package/dist/cjs/core/EthereumStepExecutor.js +6 -7
  58. package/dist/cjs/core/EthereumStepExecutor.js.map +1 -1
  59. package/dist/cjs/core/tasks/EthereumBatchedSignAndExecuteTask.d.ts +1 -4
  60. package/dist/cjs/core/tasks/EthereumBatchedSignAndExecuteTask.js +5 -3
  61. package/dist/cjs/core/tasks/EthereumBatchedSignAndExecuteTask.js.map +1 -1
  62. package/dist/cjs/core/tasks/EthereumBatchedWaitForTransactionTask.d.ts +1 -4
  63. package/dist/cjs/core/tasks/EthereumBatchedWaitForTransactionTask.js +1 -2
  64. package/dist/cjs/core/tasks/EthereumBatchedWaitForTransactionTask.js.map +1 -1
  65. package/dist/cjs/core/tasks/EthereumCheckAllowanceAfterPrepareTask.d.ts +1 -4
  66. package/dist/cjs/core/tasks/EthereumCheckAllowanceAfterPrepareTask.js +1 -2
  67. package/dist/cjs/core/tasks/EthereumCheckAllowanceAfterPrepareTask.js.map +1 -1
  68. package/dist/cjs/core/tasks/EthereumCheckAllowanceTask.d.ts +1 -4
  69. package/dist/cjs/core/tasks/EthereumCheckAllowanceTask.js +3 -4
  70. package/dist/cjs/core/tasks/EthereumCheckAllowanceTask.js.map +1 -1
  71. package/dist/cjs/core/tasks/EthereumCheckBalanceTask.d.ts +1 -4
  72. package/dist/cjs/core/tasks/EthereumCheckBalanceTask.js +3 -3
  73. package/dist/cjs/core/tasks/EthereumCheckBalanceTask.js.map +1 -1
  74. package/dist/cjs/core/tasks/EthereumCheckPermitsTask.d.ts +1 -4
  75. package/dist/cjs/core/tasks/EthereumCheckPermitsTask.js +2 -3
  76. package/dist/cjs/core/tasks/EthereumNativePermitTask.d.ts +1 -4
  77. package/dist/cjs/core/tasks/EthereumNativePermitTask.js +5 -6
  78. package/dist/cjs/core/tasks/EthereumNativePermitTask.js.map +1 -1
  79. package/dist/cjs/core/tasks/EthereumPermit2AllowanceTask.d.ts +1 -4
  80. package/dist/cjs/core/tasks/EthereumPermit2AllowanceTask.js +1 -2
  81. package/dist/cjs/core/tasks/EthereumPrepareTransactionTask.d.ts +1 -4
  82. package/dist/cjs/core/tasks/EthereumPrepareTransactionTask.js +7 -6
  83. package/dist/cjs/core/tasks/EthereumPrepareTransactionTask.js.map +1 -1
  84. package/dist/cjs/core/tasks/EthereumRelayedSignAndExecuteTask.d.ts +1 -4
  85. package/dist/cjs/core/tasks/EthereumRelayedSignAndExecuteTask.js +3 -4
  86. package/dist/cjs/core/tasks/EthereumRelayedWaitForTransactionTask.d.ts +1 -4
  87. package/dist/cjs/core/tasks/EthereumRelayedWaitForTransactionTask.js +2 -3
  88. package/dist/cjs/core/tasks/EthereumRelayedWaitForTransactionTask.js.map +1 -1
  89. package/dist/cjs/core/tasks/EthereumResetAllowanceTask.d.ts +1 -4
  90. package/dist/cjs/core/tasks/EthereumResetAllowanceTask.js +6 -6
  91. package/dist/cjs/core/tasks/EthereumResetAllowanceTask.js.map +1 -1
  92. package/dist/cjs/core/tasks/EthereumSetAllowanceTask.d.ts +1 -4
  93. package/dist/cjs/core/tasks/EthereumSetAllowanceTask.js +7 -7
  94. package/dist/cjs/core/tasks/EthereumSetAllowanceTask.js.map +1 -1
  95. package/dist/cjs/core/tasks/EthereumSignAndExecuteTask.d.ts +1 -4
  96. package/dist/cjs/core/tasks/EthereumSignAndExecuteTask.js +2 -3
  97. package/dist/cjs/core/tasks/EthereumSignAndExecuteTask.js.map +1 -1
  98. package/dist/cjs/core/tasks/EthereumStandardSignAndExecuteTask.d.ts +1 -4
  99. package/dist/cjs/core/tasks/EthereumStandardSignAndExecuteTask.js +6 -6
  100. package/dist/cjs/core/tasks/EthereumStandardSignAndExecuteTask.js.map +1 -1
  101. package/dist/cjs/core/tasks/EthereumStandardWaitForTransactionTask.d.ts +1 -4
  102. package/dist/cjs/core/tasks/EthereumStandardWaitForTransactionTask.js +1 -2
  103. package/dist/cjs/core/tasks/EthereumStandardWaitForTransactionTask.js.map +1 -1
  104. package/dist/cjs/core/tasks/EthereumWaitForTransactionStatusTask.d.ts +1 -4
  105. package/dist/cjs/core/tasks/EthereumWaitForTransactionStatusTask.js +1 -2
  106. package/dist/cjs/core/tasks/EthereumWaitForTransactionTask.d.ts +1 -4
  107. package/dist/cjs/core/tasks/EthereumWaitForTransactionTask.js +2 -3
  108. package/dist/cjs/core/tasks/helpers/estimateTransactionRequest.d.ts +1 -4
  109. package/dist/cjs/core/tasks/helpers/estimateTransactionRequest.js +3 -4
  110. package/dist/cjs/core/tasks/helpers/estimateTransactionRequest.js.map +1 -1
  111. package/dist/cjs/core/tasks/helpers/findSignedNativePermit.d.ts +1 -4
  112. package/dist/cjs/core/tasks/helpers/findSignedNativePermit.js +2 -3
  113. package/dist/cjs/core/tasks/helpers/getApprovalAmount.d.ts +1 -4
  114. package/dist/cjs/core/tasks/helpers/getApprovalAmount.js +2 -3
  115. package/dist/cjs/core/tasks/helpers/getEthereumExecutionStrategy.d.ts +1 -4
  116. package/dist/cjs/core/tasks/helpers/getEthereumExecutionStrategy.js +6 -4
  117. package/dist/cjs/core/tasks/helpers/getEthereumExecutionStrategy.js.map +1 -1
  118. package/dist/cjs/core/tasks/helpers/getTxLink.d.ts +1 -4
  119. package/dist/cjs/core/tasks/helpers/getTxLink.js +1 -2
  120. package/dist/cjs/core/tasks/helpers/getUpdatedStep.d.ts +10 -5
  121. package/dist/cjs/core/tasks/helpers/getUpdatedStep.js +11 -20
  122. package/dist/cjs/core/tasks/helpers/getUpdatedStep.js.map +1 -1
  123. package/dist/cjs/core/tasks/helpers/hasApprovalAddressAppearedAtPrepare.d.ts +1 -4
  124. package/dist/cjs/core/tasks/helpers/hasApprovalAddressAppearedAtPrepare.js +1 -2
  125. package/dist/cjs/core/tasks/helpers/hasPermit2AllowanceInFlight.d.ts +1 -4
  126. package/dist/cjs/core/tasks/helpers/hasPermit2AllowanceInFlight.js +1 -2
  127. package/dist/cjs/core/tasks/helpers/isAllowancePreparedForAnotherStrategy.d.ts +1 -4
  128. package/dist/cjs/core/tasks/helpers/isAllowancePreparedForAnotherStrategy.js +1 -2
  129. package/dist/cjs/core/tasks/helpers/isTypedDataAlreadySigned.d.ts +1 -4
  130. package/dist/cjs/core/tasks/helpers/isTypedDataAlreadySigned.js +1 -2
  131. package/dist/cjs/core/tasks/helpers/preservePermit2Allowances.d.ts +1 -4
  132. package/dist/cjs/core/tasks/helpers/preservePermit2Allowances.js +1 -2
  133. package/dist/cjs/core/tasks/helpers/resolveAllowanceSpender.d.ts +1 -4
  134. package/dist/cjs/core/tasks/helpers/resolveAllowanceSpender.js +1 -2
  135. package/dist/cjs/core/tasks/helpers/resolvePermit2Support.d.ts +1 -4
  136. package/dist/cjs/core/tasks/helpers/resolvePermit2Support.js +1 -2
  137. package/dist/cjs/core/tasks/helpers/shouldCheckForAllowance.d.ts +1 -4
  138. package/dist/cjs/core/tasks/helpers/shouldCheckForAllowance.js +2 -2
  139. package/dist/cjs/core/tasks/helpers/shouldCheckForAllowance.js.map +1 -1
  140. package/dist/cjs/core/tasks/helpers/signHyperliquidTypedData.d.ts +1 -4
  141. package/dist/cjs/core/tasks/helpers/signHyperliquidTypedData.js +3 -4
  142. package/dist/cjs/core/tasks/helpers/signHyperliquidTypedData.js.map +1 -1
  143. package/dist/cjs/core/tasks/helpers/signTypedDataEntries.d.ts +1 -4
  144. package/dist/cjs/core/tasks/helpers/signTypedDataEntries.js +1 -2
  145. package/dist/cjs/core/tasks/helpers/signTypedDataEntries.js.map +1 -1
  146. package/dist/cjs/core/tasks/helpers/switchChain.d.ts +1 -4
  147. package/dist/cjs/core/tasks/helpers/switchChain.js +1 -2
  148. package/dist/cjs/core/tasks/helpers/updateActionWithReceipt.d.ts +1 -4
  149. package/dist/cjs/core/tasks/helpers/updateActionWithReceipt.js +1 -2
  150. package/dist/cjs/errors/parseEthereumErrors.d.ts +1 -4
  151. package/dist/cjs/errors/parseEthereumErrors.js +3 -3
  152. package/dist/cjs/errors/parseEthereumErrors.js.map +1 -1
  153. package/dist/cjs/hyperliquid/agentWallet.d.ts +1 -4
  154. package/dist/cjs/hyperliquid/agentWallet.js +1 -2
  155. package/dist/cjs/hyperliquid/isHyperliquidAgentStep.d.ts +1 -4
  156. package/dist/cjs/hyperliquid/isHyperliquidAgentStep.js +1 -2
  157. package/dist/cjs/index.d.ts +2 -2
  158. package/dist/cjs/index.js +8 -8
  159. package/dist/cjs/permits/acceptsRawEcdsaSignature.d.ts +1 -4
  160. package/dist/cjs/permits/acceptsRawEcdsaSignature.js +1 -2
  161. package/dist/cjs/permits/allowanceTransfer.d.ts +1 -4
  162. package/dist/cjs/permits/allowanceTransfer.js +1 -2
  163. package/dist/cjs/permits/allowanceTransfer.js.map +1 -1
  164. package/dist/cjs/permits/canAccountUseNativePermits.d.ts +1 -4
  165. package/dist/cjs/permits/canAccountUseNativePermits.js +1 -2
  166. package/dist/cjs/permits/canAccountUsePermit2.d.ts +1 -4
  167. package/dist/cjs/permits/canAccountUsePermit2.js +1 -2
  168. package/dist/cjs/permits/constants.d.ts +1 -4
  169. package/dist/cjs/permits/constants.js +1 -2
  170. package/dist/cjs/permits/domain.d.ts +1 -4
  171. package/dist/cjs/permits/domain.js +1 -2
  172. package/dist/cjs/permits/encodeNativePermitData.d.ts +1 -4
  173. package/dist/cjs/permits/encodeNativePermitData.js +1 -2
  174. package/dist/cjs/permits/encodePermit2Data.d.ts +1 -4
  175. package/dist/cjs/permits/encodePermit2Data.js +1 -2
  176. package/dist/cjs/permits/getNativePermit.d.ts +1 -4
  177. package/dist/cjs/permits/getNativePermit.js +7 -8
  178. package/dist/cjs/permits/getNativePermit.js.map +1 -1
  179. package/dist/cjs/permits/getPermitTransferFromValues.d.ts +1 -4
  180. package/dist/cjs/permits/getPermitTransferFromValues.js +2 -3
  181. package/dist/cjs/permits/getPermitTransferFromValues.js.map +1 -1
  182. package/dist/cjs/permits/invariant.d.ts +1 -4
  183. package/dist/cjs/permits/invariant.js +1 -2
  184. package/dist/cjs/permits/isDelegationDesignatorCode.d.ts +1 -4
  185. package/dist/cjs/permits/isDelegationDesignatorCode.js +1 -2
  186. package/dist/cjs/permits/isNativePermitValid.d.ts +1 -4
  187. package/dist/cjs/permits/isNativePermitValid.js +2 -3
  188. package/dist/cjs/permits/isNativePermitValid.js.map +1 -1
  189. package/dist/cjs/permits/signPermit2Message.d.ts +1 -4
  190. package/dist/cjs/permits/signPermit2Message.js +1 -2
  191. package/dist/cjs/permits/signPermit2Message.js.map +1 -1
  192. package/dist/cjs/permits/signatureTransfer.d.ts +1 -4
  193. package/dist/cjs/permits/signatureTransfer.js +1 -2
  194. package/dist/cjs/permits/signatureTransfer.js.map +1 -1
  195. package/dist/cjs/permits/types.d.ts +1 -4
  196. package/dist/cjs/types.d.ts +7 -4
  197. package/dist/cjs/types.js +1 -2
  198. package/dist/cjs/types.js.map +1 -1
  199. package/dist/cjs/utils/abi.d.ts +1 -4
  200. package/dist/cjs/utils/abi.js +1 -2
  201. package/dist/cjs/utils/convertExtendedChain.d.ts +1 -4
  202. package/dist/cjs/utils/convertExtendedChain.js +1 -2
  203. package/dist/cjs/utils/getActionWithFallback.d.ts +2 -4
  204. package/dist/cjs/utils/getActionWithFallback.js +3 -4
  205. package/dist/cjs/utils/getActionWithFallback.js.map +1 -1
  206. package/dist/cjs/utils/getDomainChainId.d.ts +1 -4
  207. package/dist/cjs/utils/getDomainChainId.js +1 -2
  208. package/dist/cjs/utils/getSafeApiKey.d.ts +1 -4
  209. package/dist/cjs/utils/getSafeApiKey.js +1 -2
  210. package/dist/cjs/utils/getSendChain.d.ts +2 -0
  211. package/dist/cjs/utils/getSendChain.js +6 -0
  212. package/dist/cjs/utils/getSendChain.js.map +1 -0
  213. package/dist/cjs/utils/getTypedDataLane.d.ts +1 -4
  214. package/dist/cjs/utils/getTypedDataLane.js +1 -2
  215. package/dist/cjs/utils/isContractCallStep.d.ts +1 -4
  216. package/dist/cjs/utils/isContractCallStep.js +1 -2
  217. package/dist/cjs/utils/isExtendedChain.d.ts +1 -4
  218. package/dist/cjs/utils/isExtendedChain.js +1 -2
  219. package/dist/cjs/utils/isGaslessStep.d.ts +8 -4
  220. package/dist/cjs/utils/isGaslessStep.js +8 -2
  221. package/dist/cjs/utils/isGaslessStep.js.map +1 -1
  222. package/dist/cjs/utils/isValidSignature.d.ts +1 -4
  223. package/dist/cjs/utils/isValidSignature.js +1 -2
  224. package/dist/cjs/utils/isZeroAddress.d.ts +1 -4
  225. package/dist/cjs/utils/isZeroAddress.js +1 -2
  226. package/dist/cjs/utils/median.d.ts +1 -4
  227. package/dist/cjs/utils/median.js +1 -2
  228. package/dist/cjs/version.d.ts +1 -4
  229. package/dist/cjs/version.js +2 -3
  230. package/dist/cjs/version.js.map +1 -1
  231. package/dist/esm/EthereumProvider.d.ts +0 -2
  232. package/dist/esm/EthereumProvider.d.ts.map +1 -1
  233. package/dist/esm/EthereumProvider.js +1 -2
  234. package/dist/esm/actions/checkPermitSupport.d.ts +0 -2
  235. package/dist/esm/actions/checkPermitSupport.d.ts.map +1 -1
  236. package/dist/esm/actions/checkPermitSupport.js +5 -6
  237. package/dist/esm/actions/checkPermitSupport.js.map +1 -1
  238. package/dist/esm/actions/constants.d.ts +0 -2
  239. package/dist/esm/actions/constants.d.ts.map +1 -1
  240. package/dist/esm/actions/constants.js +1 -2
  241. package/dist/esm/actions/getAccountCode.d.ts +0 -2
  242. package/dist/esm/actions/getAccountCode.d.ts.map +1 -1
  243. package/dist/esm/actions/getAccountCode.js +1 -2
  244. package/dist/esm/actions/getAllowance.d.ts +1 -3
  245. package/dist/esm/actions/getAllowance.d.ts.map +1 -1
  246. package/dist/esm/actions/getAllowance.js +6 -7
  247. package/dist/esm/actions/getAllowance.js.map +1 -1
  248. package/dist/esm/actions/getEthereumBalance.d.ts +0 -2
  249. package/dist/esm/actions/getEthereumBalance.d.ts.map +1 -1
  250. package/dist/esm/actions/getEthereumBalance.js +1 -2
  251. package/dist/esm/actions/getMaxPriorityFeePerGas.d.ts +1 -3
  252. package/dist/esm/actions/getMaxPriorityFeePerGas.d.ts.map +1 -1
  253. package/dist/esm/actions/getMaxPriorityFeePerGas.js +3 -4
  254. package/dist/esm/actions/getMaxPriorityFeePerGas.js.map +1 -1
  255. package/dist/esm/actions/getMulticallAddress.d.ts +0 -2
  256. package/dist/esm/actions/getMulticallAddress.d.ts.map +1 -1
  257. package/dist/esm/actions/getMulticallAddress.js +1 -2
  258. package/dist/esm/actions/isBatchingSupported.d.ts +0 -2
  259. package/dist/esm/actions/isBatchingSupported.d.ts.map +1 -1
  260. package/dist/esm/actions/isBatchingSupported.js +1 -2
  261. package/dist/esm/actions/isSafeSignature.d.ts +1 -3
  262. package/dist/esm/actions/isSafeSignature.d.ts.map +1 -1
  263. package/dist/esm/actions/isSafeSignature.js +3 -3
  264. package/dist/esm/actions/isSafeSignature.js.map +1 -1
  265. package/dist/esm/actions/isSafeWallet.d.ts +0 -2
  266. package/dist/esm/actions/isSafeWallet.d.ts.map +1 -1
  267. package/dist/esm/actions/isSafeWallet.js +2 -3
  268. package/dist/esm/actions/isSmartContractWallet.d.ts +0 -2
  269. package/dist/esm/actions/isSmartContractWallet.d.ts.map +1 -1
  270. package/dist/esm/actions/isSmartContractWallet.js +1 -2
  271. package/dist/esm/actions/resolveENSAddress.d.ts +0 -2
  272. package/dist/esm/actions/resolveENSAddress.d.ts.map +1 -1
  273. package/dist/esm/actions/resolveENSAddress.js +1 -2
  274. package/dist/esm/actions/resolveEthereumAddress.d.ts +0 -2
  275. package/dist/esm/actions/resolveEthereumAddress.d.ts.map +1 -1
  276. package/dist/esm/actions/resolveEthereumAddress.js +1 -2
  277. package/dist/esm/actions/resolveTransactionHash.d.ts +0 -2
  278. package/dist/esm/actions/resolveTransactionHash.d.ts.map +1 -1
  279. package/dist/esm/actions/resolveTransactionHash.js +7 -4
  280. package/dist/esm/actions/resolveTransactionHash.js.map +1 -1
  281. package/dist/esm/actions/resolveUNSAddress.d.ts +0 -2
  282. package/dist/esm/actions/resolveUNSAddress.d.ts.map +1 -1
  283. package/dist/esm/actions/resolveUNSAddress.js +2 -3
  284. package/dist/esm/actions/setAllowance.d.ts +2 -4
  285. package/dist/esm/actions/setAllowance.d.ts.map +1 -1
  286. package/dist/esm/actions/setAllowance.js +10 -7
  287. package/dist/esm/actions/setAllowance.js.map +1 -1
  288. package/dist/esm/actions/waitForBatchTransactionReceipt.d.ts +0 -2
  289. package/dist/esm/actions/waitForBatchTransactionReceipt.d.ts.map +1 -1
  290. package/dist/esm/actions/waitForBatchTransactionReceipt.js +1 -2
  291. package/dist/esm/actions/waitForRelayedTransactionReceipt.d.ts +1 -3
  292. package/dist/esm/actions/waitForRelayedTransactionReceipt.d.ts.map +1 -1
  293. package/dist/esm/actions/waitForRelayedTransactionReceipt.js +51 -13
  294. package/dist/esm/actions/waitForRelayedTransactionReceipt.js.map +1 -1
  295. package/dist/esm/actions/waitForSafeTransactionExecution.d.ts +0 -2
  296. package/dist/esm/actions/waitForSafeTransactionExecution.d.ts.map +1 -1
  297. package/dist/esm/actions/waitForSafeTransactionExecution.js +2 -3
  298. package/dist/esm/actions/waitForTransactionReceipt.d.ts +0 -2
  299. package/dist/esm/actions/waitForTransactionReceipt.d.ts.map +1 -1
  300. package/dist/esm/actions/waitForTransactionReceipt.js +1 -2
  301. package/dist/esm/client/publicClient.d.ts +0 -2
  302. package/dist/esm/client/publicClient.d.ts.map +1 -1
  303. package/dist/esm/client/publicClient.js +1 -2
  304. package/dist/esm/client/safeClient.d.ts +0 -2
  305. package/dist/esm/client/safeClient.d.ts.map +1 -1
  306. package/dist/esm/client/safeClient.js +1 -2
  307. package/dist/esm/client/types.d.ts +0 -2
  308. package/dist/esm/client/types.d.ts.map +1 -1
  309. package/dist/esm/core/EthereumStepExecutor.d.ts +0 -2
  310. package/dist/esm/core/EthereumStepExecutor.d.ts.map +1 -1
  311. package/dist/esm/core/EthereumStepExecutor.js +6 -7
  312. package/dist/esm/core/EthereumStepExecutor.js.map +1 -1
  313. package/dist/esm/core/tasks/EthereumBatchedSignAndExecuteTask.d.ts +0 -2
  314. package/dist/esm/core/tasks/EthereumBatchedSignAndExecuteTask.d.ts.map +1 -1
  315. package/dist/esm/core/tasks/EthereumBatchedSignAndExecuteTask.js +5 -3
  316. package/dist/esm/core/tasks/EthereumBatchedSignAndExecuteTask.js.map +1 -1
  317. package/dist/esm/core/tasks/EthereumBatchedWaitForTransactionTask.d.ts +0 -2
  318. package/dist/esm/core/tasks/EthereumBatchedWaitForTransactionTask.d.ts.map +1 -1
  319. package/dist/esm/core/tasks/EthereumBatchedWaitForTransactionTask.js +1 -2
  320. package/dist/esm/core/tasks/EthereumCheckAllowanceAfterPrepareTask.d.ts +0 -2
  321. package/dist/esm/core/tasks/EthereumCheckAllowanceAfterPrepareTask.d.ts.map +1 -1
  322. package/dist/esm/core/tasks/EthereumCheckAllowanceAfterPrepareTask.js +1 -2
  323. package/dist/esm/core/tasks/EthereumCheckAllowanceAfterPrepareTask.js.map +1 -1
  324. package/dist/esm/core/tasks/EthereumCheckAllowanceTask.d.ts +0 -2
  325. package/dist/esm/core/tasks/EthereumCheckAllowanceTask.d.ts.map +1 -1
  326. package/dist/esm/core/tasks/EthereumCheckAllowanceTask.js +3 -4
  327. package/dist/esm/core/tasks/EthereumCheckAllowanceTask.js.map +1 -1
  328. package/dist/esm/core/tasks/EthereumCheckBalanceTask.d.ts +0 -2
  329. package/dist/esm/core/tasks/EthereumCheckBalanceTask.d.ts.map +1 -1
  330. package/dist/esm/core/tasks/EthereumCheckBalanceTask.js +4 -4
  331. package/dist/esm/core/tasks/EthereumCheckBalanceTask.js.map +1 -1
  332. package/dist/esm/core/tasks/EthereumCheckPermitsTask.d.ts +0 -2
  333. package/dist/esm/core/tasks/EthereumCheckPermitsTask.d.ts.map +1 -1
  334. package/dist/esm/core/tasks/EthereumCheckPermitsTask.js +2 -3
  335. package/dist/esm/core/tasks/EthereumNativePermitTask.d.ts +0 -2
  336. package/dist/esm/core/tasks/EthereumNativePermitTask.d.ts.map +1 -1
  337. package/dist/esm/core/tasks/EthereumNativePermitTask.js +5 -6
  338. package/dist/esm/core/tasks/EthereumNativePermitTask.js.map +1 -1
  339. package/dist/esm/core/tasks/EthereumPermit2AllowanceTask.d.ts +0 -2
  340. package/dist/esm/core/tasks/EthereumPermit2AllowanceTask.d.ts.map +1 -1
  341. package/dist/esm/core/tasks/EthereumPermit2AllowanceTask.js +1 -2
  342. package/dist/esm/core/tasks/EthereumPrepareTransactionTask.d.ts +0 -2
  343. package/dist/esm/core/tasks/EthereumPrepareTransactionTask.d.ts.map +1 -1
  344. package/dist/esm/core/tasks/EthereumPrepareTransactionTask.js +8 -7
  345. package/dist/esm/core/tasks/EthereumPrepareTransactionTask.js.map +1 -1
  346. package/dist/esm/core/tasks/EthereumRelayedSignAndExecuteTask.d.ts +0 -2
  347. package/dist/esm/core/tasks/EthereumRelayedSignAndExecuteTask.d.ts.map +1 -1
  348. package/dist/esm/core/tasks/EthereumRelayedSignAndExecuteTask.js +3 -4
  349. package/dist/esm/core/tasks/EthereumRelayedWaitForTransactionTask.d.ts +0 -2
  350. package/dist/esm/core/tasks/EthereumRelayedWaitForTransactionTask.d.ts.map +1 -1
  351. package/dist/esm/core/tasks/EthereumRelayedWaitForTransactionTask.js +2 -3
  352. package/dist/esm/core/tasks/EthereumResetAllowanceTask.d.ts +0 -2
  353. package/dist/esm/core/tasks/EthereumResetAllowanceTask.d.ts.map +1 -1
  354. package/dist/esm/core/tasks/EthereumResetAllowanceTask.js +6 -6
  355. package/dist/esm/core/tasks/EthereumResetAllowanceTask.js.map +1 -1
  356. package/dist/esm/core/tasks/EthereumSetAllowanceTask.d.ts +0 -2
  357. package/dist/esm/core/tasks/EthereumSetAllowanceTask.d.ts.map +1 -1
  358. package/dist/esm/core/tasks/EthereumSetAllowanceTask.js +7 -7
  359. package/dist/esm/core/tasks/EthereumSetAllowanceTask.js.map +1 -1
  360. package/dist/esm/core/tasks/EthereumSignAndExecuteTask.d.ts +0 -2
  361. package/dist/esm/core/tasks/EthereumSignAndExecuteTask.d.ts.map +1 -1
  362. package/dist/esm/core/tasks/EthereumSignAndExecuteTask.js +2 -3
  363. package/dist/esm/core/tasks/EthereumStandardSignAndExecuteTask.d.ts +0 -2
  364. package/dist/esm/core/tasks/EthereumStandardSignAndExecuteTask.d.ts.map +1 -1
  365. package/dist/esm/core/tasks/EthereumStandardSignAndExecuteTask.js +6 -6
  366. package/dist/esm/core/tasks/EthereumStandardSignAndExecuteTask.js.map +1 -1
  367. package/dist/esm/core/tasks/EthereumStandardWaitForTransactionTask.d.ts +0 -2
  368. package/dist/esm/core/tasks/EthereumStandardWaitForTransactionTask.d.ts.map +1 -1
  369. package/dist/esm/core/tasks/EthereumStandardWaitForTransactionTask.js +1 -2
  370. package/dist/esm/core/tasks/EthereumWaitForTransactionStatusTask.d.ts +0 -2
  371. package/dist/esm/core/tasks/EthereumWaitForTransactionStatusTask.d.ts.map +1 -1
  372. package/dist/esm/core/tasks/EthereumWaitForTransactionStatusTask.js +1 -2
  373. package/dist/esm/core/tasks/EthereumWaitForTransactionTask.d.ts +0 -2
  374. package/dist/esm/core/tasks/EthereumWaitForTransactionTask.d.ts.map +1 -1
  375. package/dist/esm/core/tasks/EthereumWaitForTransactionTask.js +2 -3
  376. package/dist/esm/core/tasks/helpers/estimateTransactionRequest.d.ts +1 -3
  377. package/dist/esm/core/tasks/helpers/estimateTransactionRequest.d.ts.map +1 -1
  378. package/dist/esm/core/tasks/helpers/estimateTransactionRequest.js +3 -4
  379. package/dist/esm/core/tasks/helpers/estimateTransactionRequest.js.map +1 -1
  380. package/dist/esm/core/tasks/helpers/findSignedNativePermit.d.ts +0 -2
  381. package/dist/esm/core/tasks/helpers/findSignedNativePermit.d.ts.map +1 -1
  382. package/dist/esm/core/tasks/helpers/findSignedNativePermit.js +2 -3
  383. package/dist/esm/core/tasks/helpers/getApprovalAmount.d.ts +0 -2
  384. package/dist/esm/core/tasks/helpers/getApprovalAmount.d.ts.map +1 -1
  385. package/dist/esm/core/tasks/helpers/getApprovalAmount.js +2 -3
  386. package/dist/esm/core/tasks/helpers/getEthereumExecutionStrategy.d.ts +0 -2
  387. package/dist/esm/core/tasks/helpers/getEthereumExecutionStrategy.d.ts.map +1 -1
  388. package/dist/esm/core/tasks/helpers/getEthereumExecutionStrategy.js +6 -4
  389. package/dist/esm/core/tasks/helpers/getEthereumExecutionStrategy.js.map +1 -1
  390. package/dist/esm/core/tasks/helpers/getTxLink.d.ts +0 -2
  391. package/dist/esm/core/tasks/helpers/getTxLink.d.ts.map +1 -1
  392. package/dist/esm/core/tasks/helpers/getTxLink.js +1 -2
  393. package/dist/esm/core/tasks/helpers/getUpdatedStep.d.ts +10 -4
  394. package/dist/esm/core/tasks/helpers/getUpdatedStep.d.ts.map +1 -1
  395. package/dist/esm/core/tasks/helpers/getUpdatedStep.js +12 -21
  396. package/dist/esm/core/tasks/helpers/getUpdatedStep.js.map +1 -1
  397. package/dist/esm/core/tasks/helpers/hasApprovalAddressAppearedAtPrepare.d.ts +0 -2
  398. package/dist/esm/core/tasks/helpers/hasApprovalAddressAppearedAtPrepare.d.ts.map +1 -1
  399. package/dist/esm/core/tasks/helpers/hasApprovalAddressAppearedAtPrepare.js +1 -2
  400. package/dist/esm/core/tasks/helpers/hasPermit2AllowanceInFlight.d.ts +0 -2
  401. package/dist/esm/core/tasks/helpers/hasPermit2AllowanceInFlight.d.ts.map +1 -1
  402. package/dist/esm/core/tasks/helpers/hasPermit2AllowanceInFlight.js +1 -2
  403. package/dist/esm/core/tasks/helpers/isAllowancePreparedForAnotherStrategy.d.ts +0 -2
  404. package/dist/esm/core/tasks/helpers/isAllowancePreparedForAnotherStrategy.d.ts.map +1 -1
  405. package/dist/esm/core/tasks/helpers/isAllowancePreparedForAnotherStrategy.js +1 -2
  406. package/dist/esm/core/tasks/helpers/isTypedDataAlreadySigned.d.ts +0 -2
  407. package/dist/esm/core/tasks/helpers/isTypedDataAlreadySigned.d.ts.map +1 -1
  408. package/dist/esm/core/tasks/helpers/isTypedDataAlreadySigned.js +1 -2
  409. package/dist/esm/core/tasks/helpers/preservePermit2Allowances.d.ts +0 -2
  410. package/dist/esm/core/tasks/helpers/preservePermit2Allowances.d.ts.map +1 -1
  411. package/dist/esm/core/tasks/helpers/preservePermit2Allowances.js +1 -2
  412. package/dist/esm/core/tasks/helpers/resolveAllowanceSpender.d.ts +0 -2
  413. package/dist/esm/core/tasks/helpers/resolveAllowanceSpender.d.ts.map +1 -1
  414. package/dist/esm/core/tasks/helpers/resolveAllowanceSpender.js +1 -2
  415. package/dist/esm/core/tasks/helpers/resolvePermit2Support.d.ts +0 -2
  416. package/dist/esm/core/tasks/helpers/resolvePermit2Support.d.ts.map +1 -1
  417. package/dist/esm/core/tasks/helpers/resolvePermit2Support.js +1 -2
  418. package/dist/esm/core/tasks/helpers/shouldCheckForAllowance.d.ts +0 -2
  419. package/dist/esm/core/tasks/helpers/shouldCheckForAllowance.d.ts.map +1 -1
  420. package/dist/esm/core/tasks/helpers/shouldCheckForAllowance.js +3 -3
  421. package/dist/esm/core/tasks/helpers/shouldCheckForAllowance.js.map +1 -1
  422. package/dist/esm/core/tasks/helpers/signHyperliquidTypedData.d.ts +0 -2
  423. package/dist/esm/core/tasks/helpers/signHyperliquidTypedData.d.ts.map +1 -1
  424. package/dist/esm/core/tasks/helpers/signHyperliquidTypedData.js +3 -4
  425. package/dist/esm/core/tasks/helpers/signTypedDataEntries.d.ts +0 -2
  426. package/dist/esm/core/tasks/helpers/signTypedDataEntries.d.ts.map +1 -1
  427. package/dist/esm/core/tasks/helpers/signTypedDataEntries.js +1 -2
  428. package/dist/esm/core/tasks/helpers/switchChain.d.ts +0 -2
  429. package/dist/esm/core/tasks/helpers/switchChain.d.ts.map +1 -1
  430. package/dist/esm/core/tasks/helpers/switchChain.js +1 -2
  431. package/dist/esm/core/tasks/helpers/updateActionWithReceipt.d.ts +0 -2
  432. package/dist/esm/core/tasks/helpers/updateActionWithReceipt.d.ts.map +1 -1
  433. package/dist/esm/core/tasks/helpers/updateActionWithReceipt.js +1 -2
  434. package/dist/esm/errors/parseEthereumErrors.d.ts +0 -2
  435. package/dist/esm/errors/parseEthereumErrors.d.ts.map +1 -1
  436. package/dist/esm/errors/parseEthereumErrors.js +4 -4
  437. package/dist/esm/errors/parseEthereumErrors.js.map +1 -1
  438. package/dist/esm/hyperliquid/agentWallet.d.ts +0 -2
  439. package/dist/esm/hyperliquid/agentWallet.d.ts.map +1 -1
  440. package/dist/esm/hyperliquid/agentWallet.js +1 -2
  441. package/dist/esm/hyperliquid/isHyperliquidAgentStep.d.ts +0 -2
  442. package/dist/esm/hyperliquid/isHyperliquidAgentStep.d.ts.map +1 -1
  443. package/dist/esm/hyperliquid/isHyperliquidAgentStep.js +1 -2
  444. package/dist/esm/index.d.ts +2 -2
  445. package/dist/esm/index.js +8 -8
  446. package/dist/esm/permits/acceptsRawEcdsaSignature.d.ts +0 -2
  447. package/dist/esm/permits/acceptsRawEcdsaSignature.d.ts.map +1 -1
  448. package/dist/esm/permits/acceptsRawEcdsaSignature.js +1 -2
  449. package/dist/esm/permits/allowanceTransfer.d.ts +0 -2
  450. package/dist/esm/permits/allowanceTransfer.d.ts.map +1 -1
  451. package/dist/esm/permits/allowanceTransfer.js +1 -2
  452. package/dist/esm/permits/allowanceTransfer.js.map +1 -1
  453. package/dist/esm/permits/canAccountUseNativePermits.d.ts +0 -2
  454. package/dist/esm/permits/canAccountUseNativePermits.d.ts.map +1 -1
  455. package/dist/esm/permits/canAccountUseNativePermits.js +1 -2
  456. package/dist/esm/permits/canAccountUsePermit2.d.ts +0 -2
  457. package/dist/esm/permits/canAccountUsePermit2.d.ts.map +1 -1
  458. package/dist/esm/permits/canAccountUsePermit2.js +1 -2
  459. package/dist/esm/permits/constants.d.ts +0 -2
  460. package/dist/esm/permits/constants.d.ts.map +1 -1
  461. package/dist/esm/permits/constants.js +1 -2
  462. package/dist/esm/permits/domain.d.ts +0 -2
  463. package/dist/esm/permits/domain.d.ts.map +1 -1
  464. package/dist/esm/permits/domain.js +1 -2
  465. package/dist/esm/permits/encodeNativePermitData.d.ts +0 -2
  466. package/dist/esm/permits/encodeNativePermitData.d.ts.map +1 -1
  467. package/dist/esm/permits/encodeNativePermitData.js +1 -2
  468. package/dist/esm/permits/encodePermit2Data.d.ts +0 -2
  469. package/dist/esm/permits/encodePermit2Data.d.ts.map +1 -1
  470. package/dist/esm/permits/encodePermit2Data.js +1 -2
  471. package/dist/esm/permits/getNativePermit.d.ts +0 -2
  472. package/dist/esm/permits/getNativePermit.d.ts.map +1 -1
  473. package/dist/esm/permits/getNativePermit.js +7 -8
  474. package/dist/esm/permits/getNativePermit.js.map +1 -1
  475. package/dist/esm/permits/getPermitTransferFromValues.d.ts +0 -2
  476. package/dist/esm/permits/getPermitTransferFromValues.d.ts.map +1 -1
  477. package/dist/esm/permits/getPermitTransferFromValues.js +2 -3
  478. package/dist/esm/permits/getPermitTransferFromValues.js.map +1 -1
  479. package/dist/esm/permits/invariant.d.ts +0 -2
  480. package/dist/esm/permits/invariant.d.ts.map +1 -1
  481. package/dist/esm/permits/invariant.js +1 -2
  482. package/dist/esm/permits/isDelegationDesignatorCode.d.ts +0 -2
  483. package/dist/esm/permits/isDelegationDesignatorCode.d.ts.map +1 -1
  484. package/dist/esm/permits/isDelegationDesignatorCode.js +1 -2
  485. package/dist/esm/permits/isNativePermitValid.d.ts +0 -2
  486. package/dist/esm/permits/isNativePermitValid.d.ts.map +1 -1
  487. package/dist/esm/permits/isNativePermitValid.js +2 -3
  488. package/dist/esm/permits/isNativePermitValid.js.map +1 -1
  489. package/dist/esm/permits/signPermit2Message.d.ts +0 -2
  490. package/dist/esm/permits/signPermit2Message.d.ts.map +1 -1
  491. package/dist/esm/permits/signPermit2Message.js +1 -2
  492. package/dist/esm/permits/signatureTransfer.d.ts +0 -2
  493. package/dist/esm/permits/signatureTransfer.d.ts.map +1 -1
  494. package/dist/esm/permits/signatureTransfer.js +1 -2
  495. package/dist/esm/permits/types.d.ts +0 -2
  496. package/dist/esm/permits/types.d.ts.map +1 -1
  497. package/dist/esm/types.d.ts +6 -2
  498. package/dist/esm/types.d.ts.map +1 -1
  499. package/dist/esm/types.js +1 -2
  500. package/dist/esm/types.js.map +1 -1
  501. package/dist/esm/utils/abi.d.ts +0 -2
  502. package/dist/esm/utils/abi.d.ts.map +1 -1
  503. package/dist/esm/utils/abi.js +1 -2
  504. package/dist/esm/utils/convertExtendedChain.d.ts +0 -2
  505. package/dist/esm/utils/convertExtendedChain.d.ts.map +1 -1
  506. package/dist/esm/utils/convertExtendedChain.js +1 -2
  507. package/dist/esm/utils/getActionWithFallback.d.ts +2 -3
  508. package/dist/esm/utils/getActionWithFallback.d.ts.map +1 -1
  509. package/dist/esm/utils/getActionWithFallback.js +3 -4
  510. package/dist/esm/utils/getActionWithFallback.js.map +1 -1
  511. package/dist/esm/utils/getDomainChainId.d.ts +0 -2
  512. package/dist/esm/utils/getDomainChainId.d.ts.map +1 -1
  513. package/dist/esm/utils/getDomainChainId.js +1 -2
  514. package/dist/esm/utils/getSafeApiKey.d.ts +0 -2
  515. package/dist/esm/utils/getSafeApiKey.d.ts.map +1 -1
  516. package/dist/esm/utils/getSafeApiKey.js +1 -2
  517. package/dist/esm/utils/getSendChain.d.ts +3 -0
  518. package/dist/esm/utils/getSendChain.d.ts.map +1 -0
  519. package/dist/esm/utils/getSendChain.js +5 -0
  520. package/dist/esm/utils/getSendChain.js.map +1 -0
  521. package/dist/esm/utils/getTypedDataLane.d.ts +0 -2
  522. package/dist/esm/utils/getTypedDataLane.d.ts.map +1 -1
  523. package/dist/esm/utils/getTypedDataLane.js +1 -2
  524. package/dist/esm/utils/isContractCallStep.d.ts +0 -2
  525. package/dist/esm/utils/isContractCallStep.d.ts.map +1 -1
  526. package/dist/esm/utils/isContractCallStep.js +1 -2
  527. package/dist/esm/utils/isExtendedChain.d.ts +0 -2
  528. package/dist/esm/utils/isExtendedChain.d.ts.map +1 -1
  529. package/dist/esm/utils/isExtendedChain.js +1 -2
  530. package/dist/esm/utils/isGaslessStep.d.ts +7 -2
  531. package/dist/esm/utils/isGaslessStep.d.ts.map +1 -1
  532. package/dist/esm/utils/isGaslessStep.js +8 -2
  533. package/dist/esm/utils/isGaslessStep.js.map +1 -1
  534. package/dist/esm/utils/isValidSignature.d.ts +0 -2
  535. package/dist/esm/utils/isValidSignature.d.ts.map +1 -1
  536. package/dist/esm/utils/isValidSignature.js +1 -2
  537. package/dist/esm/utils/isZeroAddress.d.ts +0 -2
  538. package/dist/esm/utils/isZeroAddress.d.ts.map +1 -1
  539. package/dist/esm/utils/isZeroAddress.js +1 -2
  540. package/dist/esm/utils/median.d.ts +0 -2
  541. package/dist/esm/utils/median.d.ts.map +1 -1
  542. package/dist/esm/utils/median.js +1 -2
  543. package/dist/esm/version.d.ts +1 -3
  544. package/dist/esm/version.d.ts.map +1 -1
  545. package/dist/esm/version.js +2 -3
  546. package/dist/esm/version.js.map +1 -1
  547. package/package.json +3 -3
  548. package/src/actions/checkPermitSupport.ts +4 -2
  549. package/src/actions/getAllowance.ts +8 -4
  550. package/src/actions/getMaxPriorityFeePerGas.ts +4 -2
  551. package/src/actions/isSafeSignature.ts +3 -3
  552. package/src/actions/resolveTransactionHash.ts +10 -3
  553. package/src/actions/setAllowance.ts +31 -6
  554. package/src/actions/waitForRelayedTransactionReceipt.ts +129 -24
  555. package/src/core/tasks/EthereumBatchedSignAndExecuteTask.ts +4 -0
  556. package/src/core/tasks/EthereumCheckAllowanceTask.ts +3 -2
  557. package/src/core/tasks/EthereumCheckBalanceTask.ts +11 -1
  558. package/src/core/tasks/EthereumNativePermitTask.ts +2 -1
  559. package/src/core/tasks/EthereumPrepareTransactionTask.ts +29 -3
  560. package/src/core/tasks/EthereumResetAllowanceTask.ts +4 -2
  561. package/src/core/tasks/EthereumSetAllowanceTask.ts +4 -2
  562. package/src/core/tasks/EthereumStandardSignAndExecuteTask.ts +4 -2
  563. package/src/core/tasks/helpers/estimateTransactionRequest.ts +4 -2
  564. package/src/core/tasks/helpers/getEthereumExecutionStrategy.ts +12 -3
  565. package/src/core/tasks/helpers/getUpdatedStep.ts +26 -25
  566. package/src/core/tasks/helpers/shouldCheckForAllowance.ts +8 -0
  567. package/src/errors/parseEthereumErrors.ts +11 -2
  568. package/src/index.ts +0 -1
  569. package/src/permits/allowanceTransfer.ts +1 -1
  570. package/src/permits/getNativePermit.ts +9 -5
  571. package/src/permits/getPermitTransferFromValues.ts +2 -1
  572. package/src/permits/isNativePermitValid.ts +1 -1
  573. package/src/types.ts +7 -2
  574. package/src/utils/getActionWithFallback.ts +3 -2
  575. package/src/utils/getSendChain.ts +6 -0
  576. package/src/utils/isGaslessStep.ts +7 -0
  577. package/src/version.ts +1 -1
@@ -1,6 +1,3 @@
1
1
  import { EthereumStepExecutorContext } from "../../../types.js";
2
- //#region src/core/tasks/helpers/getApprovalAmount.d.ts
3
2
  /** How much of the source token to approve to the step's approval address. */
4
- export declare function getApprovalAmount(context: EthereumStepExecutorContext, permit2Supported: boolean): bigint;
5
- //#endregion
6
- //# sourceMappingURL=getApprovalAmount.d.ts.map
3
+ export declare function getApprovalAmount(context: EthereumStepExecutorContext, permit2Supported: boolean): bigint;
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_utils_getTypedDataLane = require("../../../utils/getTypedDataLane.js");
3
2
  const require_permits_constants = require("../../../permits/constants.js");
4
- //#region src/core/tasks/helpers/getApprovalAmount.ts
3
+ const require_utils_getTypedDataLane = require("../../../utils/getTypedDataLane.js");
4
+ // src/core/tasks/helpers/getApprovalAmount.ts
5
5
  /** How much of the source token to approve to the step's approval address. */
6
6
  function getApprovalAmount(context, permit2Supported) {
7
7
  const { step, fromChain, disableMessageSigning } = context;
@@ -10,7 +10,6 @@ function getApprovalAmount(context, permit2Supported) {
10
10
  const approvalAddress = step.estimate.approvalAddress?.toLowerCase();
11
11
  return permit2Allowances.length > 0 && !!approvalAddress && permit2Allowances.every((typedData) => typedData.domain.verifyingContract?.toLowerCase() === approvalAddress) ? require_permits_constants.MaxUint256 : BigInt(step.action.fromAmount);
12
12
  }
13
- //#endregion
14
13
  exports.getApprovalAmount = getApprovalAmount;
15
14
 
16
15
  //# sourceMappingURL=getApprovalAmount.js.map
@@ -1,6 +1,5 @@
1
1
  import { EthereumStepExecutorContext } from "../../../types.js";
2
2
  import { TransactionMethodType } from "@lifi/sdk";
3
- //#region src/core/tasks/helpers/getEthereumExecutionStrategy.d.ts
4
3
  /**
5
4
  * Retry param set by `EthereumPrepareTransactionTask`: the strategy prepare
6
5
  * established when the allowance work done for `batched` did not fit it. The
@@ -18,6 +17,4 @@ export declare const STRATEGY_AFTER_PREPARE = "strategyAfterPrepare";
18
17
  * not-yet-known. Both effects come from that one fact, which is why they share
19
18
  * a parameter.
20
19
  */
21
- export declare function getEthereumExecutionStrategy(context: EthereumStepExecutorContext, afterPrepare?: boolean): Promise<TransactionMethodType>;
22
- //#endregion
23
- //# sourceMappingURL=getEthereumExecutionStrategy.d.ts.map
20
+ export declare function getEthereumExecutionStrategy(context: EthereumStepExecutorContext, afterPrepare?: boolean): Promise<TransactionMethodType>;
@@ -1,7 +1,8 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_actions_isBatchingSupported = require("../../../actions/isBatchingSupported.js");
3
3
  const require_utils_getTypedDataLane = require("../../../utils/getTypedDataLane.js");
4
- //#region src/core/tasks/helpers/getEthereumExecutionStrategy.ts
4
+ let _lifi_sdk = require("@lifi/sdk");
5
+ // src/core/tasks/helpers/getEthereumExecutionStrategy.ts
5
6
  /**
6
7
  * Retry param set by `EthereumPrepareTransactionTask`: the strategy prepare
7
8
  * established when the allowance work done for `batched` did not fit it. The
@@ -30,18 +31,19 @@ async function getEthereumExecutionStrategy(context, afterPrepare = false) {
30
31
  if (!afterPrepare && executionStrategyContext) return executionStrategyContext;
31
32
  const strategyAfterPrepare = retryParams?.[STRATEGY_AFTER_PREPARE];
32
33
  if (!afterPrepare && isTransactionMethodType(strategyAfterPrepare)) return strategyAfterPrepare;
34
+ if ((0, _lifi_sdk.isGaslessStep)(step)) return "relayed";
33
35
  const atomicityNotReady = !!retryParams?.atomicityNotReady;
34
36
  if (step.executionType === "message") return "relayed";
35
37
  if (step.typedData?.length && !require_utils_getTypedDataLane.isPermit2AllowanceLane(step, fromChain)) return "relayed";
36
38
  if (afterPrepare && step.typedData?.length && !step.transactionRequest) return "relayed";
37
39
  if (atomicityNotReady || step.tool === "thorswap") return "standard";
38
40
  const updatedClient = await checkClient(step) ?? ethereumClient;
39
- return await require_actions_isBatchingSupported.isBatchingSupported(client, {
41
+ context.batchingSupported ??= require_actions_isBatchingSupported.isBatchingSupported(client, {
40
42
  client: updatedClient,
41
43
  chainId: fromChain.id
42
- }) ? "batched" : "standard";
44
+ });
45
+ return await context.batchingSupported ? "batched" : "standard";
43
46
  }
44
- //#endregion
45
47
  exports.STRATEGY_AFTER_PREPARE = STRATEGY_AFTER_PREPARE;
46
48
  exports.getEthereumExecutionStrategy = getEthereumExecutionStrategy;
47
49
 
@@ -1 +1 @@
1
- {"version":3,"file":"getEthereumExecutionStrategy.js","names":["isPermit2AllowanceLane","isBatchingSupported"],"sources":["../../../../../src/core/tasks/helpers/getEthereumExecutionStrategy.ts"],"sourcesContent":["import type { TransactionMethodType } from '@lifi/sdk'\nimport { isBatchingSupported } from '../../../actions/isBatchingSupported.js'\nimport type { EthereumStepExecutorContext } from '../../../types.js'\nimport { isPermit2AllowanceLane } from '../../../utils/getTypedDataLane.js'\n\n/**\n * Retry param set by `EthereumPrepareTransactionTask`: the strategy prepare\n * established when the allowance work done for `batched` did not fit it. The\n * replay starts in this strategy.\n */\nexport const STRATEGY_AFTER_PREPARE = 'strategyAfterPrepare'\n\n// A `Record` over the union, so a new strategy fails to compile here instead of\n// being ignored by the replay.\nconst TRANSACTION_METHOD_TYPES: Record<TransactionMethodType, true> = {\n standard: true,\n relayed: true,\n batched: true,\n}\n\nconst isTransactionMethodType = (\n value: unknown\n): value is TransactionMethodType =>\n typeof value === 'string' && Object.hasOwn(TRANSACTION_METHOD_TYPES, value)\n\n/**\n * Determines the execution strategy: 'relayed', 'batched', or 'standard'.\n * Falls back to 'standard' when EIP-5792 batching is unavailable,\n * the wallet rejected the 7702 upgrade, or the tool doesn't support it.\n *\n * `afterPrepare` marks the single call from `EthereumPrepareTransactionTask`.\n * The step has just been re-quoted, so the cached verdict is stale and, for the\n * first time, the absence of a `transactionRequest` is final rather than merely\n * not-yet-known. Both effects come from that one fact, which is why they share\n * a parameter.\n */\nexport async function getEthereumExecutionStrategy(\n context: EthereumStepExecutorContext,\n afterPrepare: boolean = false\n): Promise<TransactionMethodType> {\n const {\n step,\n checkClient,\n retryParams,\n client,\n fromChain,\n ethereumClient,\n executionStrategy: executionStrategyContext,\n } = context\n\n if (!afterPrepare && executionStrategyContext) {\n return executionStrategyContext\n }\n\n // A replay starts in the strategy its first prepare established. Prepare\n // restored the step's typed data before the replay, so nothing on the step\n // shows that strategy yet.\n const strategyAfterPrepare = retryParams?.[STRATEGY_AFTER_PREPARE]\n if (!afterPrepare && isTransactionMethodType(strategyAfterPrepare)) {\n return strategyAfterPrepare\n }\n\n const atomicityNotReady = !!retryParams?.atomicityNotReady\n // Declared by the backend. It is the only signal that reaches the allowance\n // tasks, which run before a `transactionRequest` can exist.\n if (step.executionType === 'message') {\n return 'relayed'\n }\n\n // Typed data the user does not sign for its own send: gasless, `Order`,\n // Hyperliquid. A Permit2 allowance is the one shape excluded, because its signer\n // and its sender are the same person.\n if (step.typedData?.length && !isPermit2AllowanceLane(step, fromChain)) {\n return 'relayed'\n }\n\n // After prepare, missing means never: the step carries typed data and the user\n // has nothing to send, so the relayer is the only lane that can execute it.\n // This is a derivation, not a guess — no other strategy can run such a step.\n //\n // Before prepare the same expression is unsound. A Permit2 allowance that will\n // receive its transaction from `/stepTransaction` is indistinguishable from\n // one that never will, and calling it relayed there costs the step its\n // EIP-5792 batching.\n if (afterPrepare && step.typedData?.length && !step.transactionRequest) {\n return 'relayed'\n }\n\n if (atomicityNotReady || step.tool === 'thorswap') {\n return 'standard'\n }\n\n const updatedClient = (await checkClient(step)) ?? ethereumClient\n const batchingSupported = await isBatchingSupported(client, {\n client: updatedClient,\n chainId: fromChain.id,\n })\n return batchingSupported ? 'batched' : 'standard'\n}\n"],"mappings":";;;;;;;;;AAUA,MAAa,yBAAyB;AAItC,MAAM,2BAAgE;CACpE,UAAU;CACV,SAAS;CACT,SAAS;AACX;AAEA,MAAM,2BACJ,UAEA,OAAO,UAAU,YAAY,OAAO,OAAO,0BAA0B,KAAK;;;;;;;;;;;;AAa5E,eAAsB,6BACpB,SACA,eAAwB,OACQ;CAChC,MAAM,EACJ,MACA,aACA,aACA,QACA,WACA,gBACA,mBAAmB,6BACjB;CAEJ,IAAI,CAAC,gBAAgB,0BACnB,OAAO;CAMT,MAAM,uBAAuB,cAAc;CAC3C,IAAI,CAAC,gBAAgB,wBAAwB,oBAAoB,GAC/D,OAAO;CAGT,MAAM,oBAAoB,CAAC,CAAC,aAAa;CAGzC,IAAI,KAAK,kBAAkB,WACzB,OAAO;CAMT,IAAI,KAAK,WAAW,UAAU,CAACA,+BAAAA,uBAAuB,MAAM,SAAS,GACnE,OAAO;CAWT,IAAI,gBAAgB,KAAK,WAAW,UAAU,CAAC,KAAK,oBAClD,OAAO;CAGT,IAAI,qBAAqB,KAAK,SAAS,YACrC,OAAO;CAGT,MAAM,gBAAiB,MAAM,YAAY,IAAI,KAAM;CAKnD,OAAO,MAJyBC,oCAAAA,oBAAoB,QAAQ;EAC1D,QAAQ;EACR,SAAS,UAAU;CACrB,CAAC,IAC0B,YAAY;AACzC"}
1
+ {"version":3,"file":"getEthereumExecutionStrategy.js","names":["isGaslessStep","isPermit2AllowanceLane","isBatchingSupported"],"sources":["../../../../../src/core/tasks/helpers/getEthereumExecutionStrategy.ts"],"sourcesContent":["import { isGaslessStep, type TransactionMethodType } from '@lifi/sdk'\nimport { isBatchingSupported } from '../../../actions/isBatchingSupported.js'\nimport type { EthereumStepExecutorContext } from '../../../types.js'\nimport { isPermit2AllowanceLane } from '../../../utils/getTypedDataLane.js'\n\n/**\n * Retry param set by `EthereumPrepareTransactionTask`: the strategy prepare\n * established when the allowance work done for `batched` did not fit it. The\n * replay starts in this strategy.\n */\nexport const STRATEGY_AFTER_PREPARE = 'strategyAfterPrepare'\n\n// A `Record` over the union, so a new strategy fails to compile here instead of\n// being ignored by the replay.\nconst TRANSACTION_METHOD_TYPES: Record<TransactionMethodType, true> = {\n standard: true,\n relayed: true,\n batched: true,\n}\n\nconst isTransactionMethodType = (\n value: unknown\n): value is TransactionMethodType =>\n typeof value === 'string' && Object.hasOwn(TRANSACTION_METHOD_TYPES, value)\n\n/**\n * Determines the execution strategy: 'relayed', 'batched', or 'standard'.\n * Falls back to 'standard' when EIP-5792 batching is unavailable,\n * the wallet rejected the 7702 upgrade, or the tool doesn't support it.\n *\n * `afterPrepare` marks the single call from `EthereumPrepareTransactionTask`.\n * The step has just been re-quoted, so the cached verdict is stale and, for the\n * first time, the absence of a `transactionRequest` is final rather than merely\n * not-yet-known. Both effects come from that one fact, which is why they share\n * a parameter.\n */\nexport async function getEthereumExecutionStrategy(\n context: EthereumStepExecutorContext,\n afterPrepare: boolean = false\n): Promise<TransactionMethodType> {\n const {\n step,\n checkClient,\n retryParams,\n client,\n fromChain,\n ethereumClient,\n executionStrategy: executionStrategyContext,\n } = context\n\n if (!afterPrepare && executionStrategyContext) {\n return executionStrategyContext\n }\n\n // A replay starts in the strategy its first prepare established. Prepare\n // restored the step's typed data before the replay, so nothing on the step\n // shows that strategy yet.\n const strategyAfterPrepare = retryParams?.[STRATEGY_AFTER_PREPARE]\n if (!afterPrepare && isTransactionMethodType(strategyAfterPrepare)) {\n return strategyAfterPrepare\n }\n\n // A gasless step only executes through the relay. Before prepare it has no\n // typed data yet, so the relay fee is the only signal.\n if (isGaslessStep(step)) {\n return 'relayed'\n }\n\n const atomicityNotReady = !!retryParams?.atomicityNotReady\n\n // Declared by the backend. It is the only signal that reaches the allowance\n // tasks, which run before a `transactionRequest` can exist.\n if (step.executionType === 'message') {\n return 'relayed'\n }\n\n // Typed data the user does not sign for its own send: gasless, `Order`,\n // Hyperliquid. A Permit2 allowance is the one shape excluded, because its signer\n // and its sender are the same person.\n if (step.typedData?.length && !isPermit2AllowanceLane(step, fromChain)) {\n return 'relayed'\n }\n\n // After prepare, missing means never: the step carries typed data and the user\n // has nothing to send, so the relayer is the only lane that can execute it.\n // This is a derivation, not a guess — no other strategy can run such a step.\n //\n // Before prepare the same expression is unsound. A Permit2 allowance that will\n // receive its transaction from `/stepTransaction` is indistinguishable from\n // one that never will, and calling it relayed there costs the step its\n // EIP-5792 batching.\n if (afterPrepare && step.typedData?.length && !step.transactionRequest) {\n return 'relayed'\n }\n\n if (atomicityNotReady || step.tool === 'thorswap') {\n return 'standard'\n }\n\n const updatedClient = (await checkClient(step)) ?? ethereumClient\n // A re-quote changes the step, not the wallet: prepare reuses the answer the\n // allowance tasks acted on, so a late read cannot flip the strategy.\n context.batchingSupported ??= isBatchingSupported(client, {\n client: updatedClient,\n chainId: fromChain.id,\n })\n return (await context.batchingSupported) ? 'batched' : 'standard'\n}\n"],"mappings":";;;;;;;;;;AAUA,MAAa,yBAAyB;AAItC,MAAM,2BAAgE;CACpE,UAAU;CACV,SAAS;CACT,SAAS;AACX;AAEA,MAAM,2BACJ,UAEA,OAAO,UAAU,YAAY,OAAO,OAAO,0BAA0B,KAAK;;;;;;;;;;;;AAa5E,eAAsB,6BACpB,SACA,eAAwB,OACQ;CAChC,MAAM,EACJ,MACA,aACA,aACA,QACA,WACA,gBACA,mBAAmB,6BACjB;CAEJ,IAAI,CAAC,gBAAgB,0BACnB,OAAO;CAMT,MAAM,uBAAuB,cAAc;CAC3C,IAAI,CAAC,gBAAgB,wBAAwB,oBAAoB,GAC/D,OAAO;CAKT,KAAA,GAAIA,UAAAA,cAAAA,CAAc,IAAI,GACpB,OAAO;CAGT,MAAM,oBAAoB,CAAC,CAAC,aAAa;CAIzC,IAAI,KAAK,kBAAkB,WACzB,OAAO;CAMT,IAAI,KAAK,WAAW,UAAU,CAACC,+BAAAA,uBAAuB,MAAM,SAAS,GACnE,OAAO;CAWT,IAAI,gBAAgB,KAAK,WAAW,UAAU,CAAC,KAAK,oBAClD,OAAO;CAGT,IAAI,qBAAqB,KAAK,SAAS,YACrC,OAAO;CAGT,MAAM,gBAAiB,MAAM,YAAY,IAAI,KAAM;CAGnD,QAAQ,sBAAsBC,oCAAAA,oBAAoB,QAAQ;EACxD,QAAQ;EACR,SAAS,UAAU;CACrB,CAAC;CACD,OAAQ,MAAM,QAAQ,oBAAqB,YAAY;AACzD"}
@@ -1,6 +1,3 @@
1
1
  import { ExtendedChain } from "@lifi/sdk";
2
2
  import { Hash } from "viem";
3
- //#region src/core/tasks/helpers/getTxLink.d.ts
4
- export declare const getTxLink: (chain: ExtendedChain, txHash: Hash) => string;
5
- //#endregion
6
- //# sourceMappingURL=getTxLink.d.ts.map
3
+ export declare const getTxLink: (chain: ExtendedChain, txHash: Hash) => string;
@@ -1,9 +1,8 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- //#region src/core/tasks/helpers/getTxLink.ts
2
+ // src/core/tasks/helpers/getTxLink.ts
3
3
  const getTxLink = (chain, txHash) => {
4
4
  return `${chain.metamask.blockExplorerUrls[0]}tx/${txHash}`;
5
5
  };
6
- //#endregion
7
6
  exports.getTxLink = getTxLink;
8
7
 
9
8
  //# sourceMappingURL=getTxLink.js.map
@@ -1,6 +1,11 @@
1
- import { ExecutionOptions, ExtendedChain, LiFiStepExtended, SDKClient, SignedTypedData } from "@lifi/sdk";
2
- //#region src/core/tasks/helpers/getUpdatedStep.d.ts
1
+ import { ExecutionOptions, LiFiStepExtended, SDKClient, SignedTypedData } from "@lifi/sdk";
3
2
  /** Re-quotes the step through the endpoint that matches how it will execute. */
4
- export declare const getUpdatedStep: (client: SDKClient, step: LiFiStepExtended, fromChain: ExtendedChain, executionOptions?: ExecutionOptions, signedTypedData?: SignedTypedData[]) => Promise<LiFiStepExtended>;
5
- //#endregion
6
- //# sourceMappingURL=getUpdatedStep.d.ts.map
3
+ export declare const getUpdatedStep: (client: SDKClient, step: LiFiStepExtended, executionOptions?: ExecutionOptions, signedTypedData?: SignedTypedData[]) => Promise<LiFiStepExtended>;
4
+ /**
5
+ * Fields `/advanced/stepTransaction` adds to a gasless step. They are not in
6
+ * `@lifi/types` yet.
7
+ */
8
+ export type GaslessStepFields = {
9
+ expiresAt?: number;
10
+ authorization?: unknown;
11
+ };
@@ -1,13 +1,12 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_utils_isGaslessStep = require("../../../utils/isGaslessStep.js");
3
2
  const require_permits_constants = require("../../../permits/constants.js");
4
3
  const require_utils_isContractCallStep = require("../../../utils/isContractCallStep.js");
5
4
  let _lifi_sdk = require("@lifi/sdk");
6
- //#region src/core/tasks/helpers/getUpdatedStep.ts
5
+ // src/core/tasks/helpers/getUpdatedStep.ts
7
6
  /** Re-quotes the step through the endpoint that matches how it will execute. */
8
- const getUpdatedStep = async (client, step, fromChain, executionOptions, signedTypedData) => {
7
+ const getUpdatedStep = async (client, step, executionOptions, signedTypedData) => {
9
8
  if (require_utils_isContractCallStep.isContractCallStep(step)) return getContractCallUpdatedStep(client, step, executionOptions);
10
- if (require_utils_isGaslessStep.isGaslessStep(step, fromChain)) return getRelayerUpdatedStep(client, step);
9
+ if ((0, _lifi_sdk.isGaslessStep)(step)) return getGaslessUpdatedStep(client, step);
11
10
  return getStandardUpdatedStep(client, step, signedTypedData);
12
11
  };
13
12
  const getContractCallUpdatedStep = async (client, step, executionOptions) => {
@@ -71,21 +70,14 @@ const getContractCallUpdatedStep = async (client, step, executionOptions) => {
71
70
  id: step.id
72
71
  };
73
72
  };
74
- const getRelayerUpdatedStep = async (client, step) => {
75
- return {
76
- ...await (0, _lifi_sdk.getRelayerQuote)(client, {
77
- fromChain: step.action.fromChainId,
78
- fromToken: step.action.fromToken.address,
79
- fromAddress: step.action.fromAddress,
80
- fromAmount: step.action.fromAmount,
81
- toChain: step.action.toChainId,
82
- toToken: step.action.toToken.address,
83
- slippage: step.action.slippage,
84
- toAddress: step.action.toAddress,
85
- allowBridges: [step.tool]
86
- }),
87
- id: step.id
88
- };
73
+ /**
74
+ * A gasless step is re-quoted as the routes response gave it: the backend
75
+ * rejects typed data without signatures, and it builds new typed data, a new
76
+ * deadline and new nonces for every quote anyway.
77
+ */
78
+ const getGaslessUpdatedStep = async (client, step) => {
79
+ const { typedData: _typedData, expiresAt: _expiresAt, authorization: _authorization, execution: _execution, ...restStep } = step;
80
+ return (0, _lifi_sdk.getStepTransaction)(client, restStep);
89
81
  };
90
82
  const getStandardUpdatedStep = async (client, step, signedTypedData) => {
91
83
  const filteredSignedTypedData = signedTypedData?.filter((item) => item.signature);
@@ -96,7 +88,6 @@ const getStandardUpdatedStep = async (client, step, signedTypedData) => {
96
88
  } : restStep;
97
89
  return (0, _lifi_sdk.getStepTransaction)(client, params);
98
90
  };
99
- //#endregion
100
91
  exports.getUpdatedStep = getUpdatedStep;
101
92
 
102
93
  //# sourceMappingURL=getUpdatedStep.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getUpdatedStep.js","names":["isContractCallStep","isGaslessStep","TransactionError","LiFiErrorCode","patchContractCalls","PatcherMagicNumber","getContractCallsQuote","convertQuoteToRoute","getRelayerQuote","getStepTransaction"],"sources":["../../../../../src/core/tasks/helpers/getUpdatedStep.ts"],"sourcesContent":["import {\n convertQuoteToRoute,\n type ExecutionOptions,\n type ExtendedChain,\n getContractCallsQuote,\n getRelayerQuote,\n getStepTransaction,\n LiFiErrorCode,\n type LiFiStepExtended,\n patchContractCalls,\n type SDKClient,\n type SignedTypedData,\n TransactionError,\n} from '@lifi/sdk'\nimport { PatcherMagicNumber } from '../../../permits/constants.js'\nimport { isContractCallStep } from '../../../utils/isContractCallStep.js'\nimport { isGaslessStep } from '../../../utils/isGaslessStep.js'\n\n/** Re-quotes the step through the endpoint that matches how it will execute. */\nexport const getUpdatedStep = async (\n client: SDKClient,\n step: LiFiStepExtended,\n fromChain: ExtendedChain,\n executionOptions?: ExecutionOptions,\n signedTypedData?: SignedTypedData[]\n): Promise<LiFiStepExtended> => {\n if (isContractCallStep(step)) {\n return getContractCallUpdatedStep(client, step, executionOptions)\n }\n // Do NOT substitute `hasRelayerMessage` for `isGaslessStep`: an `Order` retry\n // would fetch a relayer quote instead of `/advanced/stepTransaction`. Pinned\n // by `re-quotes an Order step ...` in `getUpdatedStep.unit.spec.ts`.\n if (isGaslessStep(step, fromChain)) {\n return getRelayerUpdatedStep(client, step)\n }\n return getStandardUpdatedStep(client, step, signedTypedData)\n}\n\nconst getContractCallUpdatedStep = async (\n client: SDKClient,\n step: LiFiStepExtended,\n executionOptions?: ExecutionOptions\n): Promise<LiFiStepExtended> => {\n const contractCallsResult = await executionOptions?.getContractCalls?.({\n fromAddress: step.action.fromAddress!,\n fromAmount: BigInt(step.action.fromAmount),\n fromChainId: step.action.fromChainId,\n fromTokenAddress: step.action.fromToken.address,\n slippage: step.action.slippage,\n toAddress: step.action.toAddress,\n toAmount: BigInt(step.estimate.toAmount),\n toChainId: step.action.toChainId,\n toTokenAddress: step.action.toToken.address,\n })\n\n if (!contractCallsResult?.contractCalls?.length) {\n throw new TransactionError(\n LiFiErrorCode.TransactionUnprepared,\n 'Unable to prepare transaction. Contract calls are not found.'\n )\n }\n\n if (contractCallsResult.patcher) {\n const patchedContractCalls = await patchContractCalls(\n client,\n contractCallsResult.contractCalls.map((call) => ({\n chainId: step.action.toChainId,\n fromTokenAddress: call.fromTokenAddress,\n targetContractAddress: call.toContractAddress,\n callDataToPatch: call.toContractCallData,\n delegateCall: false,\n patches: [\n {\n amountToReplace: PatcherMagicNumber.toString(),\n },\n ],\n }))\n )\n\n contractCallsResult.contractCalls.forEach((call, index) => {\n call.toContractAddress = patchedContractCalls[index].target\n call.toContractCallData = patchedContractCalls[index].callData\n })\n }\n\n /**\n * Limitations of the retry logic for contract calls:\n * - denyBridges and denyExchanges are not supported\n * - allowBridges and allowExchanges are not supported\n * - fee is not supported\n * - toAmount is not supported\n */\n const contractCallQuote = await getContractCallsQuote(client, {\n fromAddress: step.action.fromAddress!,\n fromChain: step.action.fromChainId,\n fromToken: step.action.fromToken.address,\n fromAmount: step.action.fromAmount,\n toChain: step.action.toChainId,\n toToken: step.action.toToken.address,\n contractCalls: contractCallsResult.contractCalls,\n toFallbackAddress: step.action.toAddress,\n slippage: step.action.slippage,\n })\n\n contractCallQuote.action.toToken = step.action.toToken\n\n const customStep = contractCallQuote.includedSteps?.find(\n (s) => s.type === 'custom'\n )\n if (customStep && contractCallsResult?.contractTool) {\n const toolDetails = {\n key: contractCallsResult.contractTool.name,\n name: contractCallsResult.contractTool.name,\n logoURI: contractCallsResult.contractTool.logoURI,\n }\n customStep.toolDetails = toolDetails\n contractCallQuote.toolDetails = toolDetails\n }\n\n const route = convertQuoteToRoute(contractCallQuote, {\n adjustZeroOutputFromPreviousStep:\n executionOptions?.adjustZeroOutputFromPreviousStep,\n })\n\n return {\n ...route.steps[0],\n id: step.id,\n }\n}\n\nconst getRelayerUpdatedStep = async (\n client: SDKClient,\n step: LiFiStepExtended\n): Promise<LiFiStepExtended> => {\n const updatedRelayedStep = await getRelayerQuote(client, {\n fromChain: step.action.fromChainId,\n fromToken: step.action.fromToken.address,\n fromAddress: step.action.fromAddress!,\n fromAmount: step.action.fromAmount,\n toChain: step.action.toChainId,\n toToken: step.action.toToken.address,\n slippage: step.action.slippage,\n toAddress: step.action.toAddress,\n allowBridges: [step.tool],\n })\n return {\n ...updatedRelayedStep,\n id: step.id,\n }\n}\n\nconst getStandardUpdatedStep = async (\n client: SDKClient,\n step: LiFiStepExtended,\n signedTypedData?: SignedTypedData[]\n): Promise<LiFiStepExtended> => {\n const filteredSignedTypedData = signedTypedData?.filter(\n (item) => item.signature\n )\n const { typedData: _, ...restStep } = step\n const params = filteredSignedTypedData?.length\n ? { ...restStep, typedData: filteredSignedTypedData }\n : restStep\n return getStepTransaction(client, params)\n}\n"],"mappings":"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"}
1
+ {"version":3,"file":"getUpdatedStep.js","names":["isContractCallStep","isGaslessStep","TransactionError","LiFiErrorCode","patchContractCalls","PatcherMagicNumber","getContractCallsQuote","convertQuoteToRoute","getStepTransaction"],"sources":["../../../../../src/core/tasks/helpers/getUpdatedStep.ts"],"sourcesContent":["import {\n convertQuoteToRoute,\n type ExecutionOptions,\n getContractCallsQuote,\n getStepTransaction,\n isGaslessStep,\n LiFiErrorCode,\n type LiFiStepExtended,\n patchContractCalls,\n type SDKClient,\n type SignedTypedData,\n TransactionError,\n} from '@lifi/sdk'\nimport { PatcherMagicNumber } from '../../../permits/constants.js'\nimport { isContractCallStep } from '../../../utils/isContractCallStep.js'\n\n/** Re-quotes the step through the endpoint that matches how it will execute. */\nexport const getUpdatedStep = async (\n client: SDKClient,\n step: LiFiStepExtended,\n executionOptions?: ExecutionOptions,\n signedTypedData?: SignedTypedData[]\n): Promise<LiFiStepExtended> => {\n if (isContractCallStep(step)) {\n return getContractCallUpdatedStep(client, step, executionOptions)\n }\n if (isGaslessStep(step)) {\n return getGaslessUpdatedStep(client, step)\n }\n return getStandardUpdatedStep(client, step, signedTypedData)\n}\n\nconst getContractCallUpdatedStep = async (\n client: SDKClient,\n step: LiFiStepExtended,\n executionOptions?: ExecutionOptions\n): Promise<LiFiStepExtended> => {\n const contractCallsResult = await executionOptions?.getContractCalls?.({\n fromAddress: step.action.fromAddress!,\n fromAmount: BigInt(step.action.fromAmount),\n fromChainId: step.action.fromChainId,\n fromTokenAddress: step.action.fromToken.address,\n slippage: step.action.slippage,\n toAddress: step.action.toAddress,\n toAmount: BigInt(step.estimate.toAmount),\n toChainId: step.action.toChainId,\n toTokenAddress: step.action.toToken.address,\n })\n\n if (!contractCallsResult?.contractCalls?.length) {\n throw new TransactionError(\n LiFiErrorCode.TransactionUnprepared,\n 'Unable to prepare transaction. Contract calls are not found.'\n )\n }\n\n if (contractCallsResult.patcher) {\n const patchedContractCalls = await patchContractCalls(\n client,\n contractCallsResult.contractCalls.map((call) => ({\n chainId: step.action.toChainId,\n fromTokenAddress: call.fromTokenAddress,\n targetContractAddress: call.toContractAddress,\n callDataToPatch: call.toContractCallData,\n delegateCall: false,\n patches: [\n {\n amountToReplace: PatcherMagicNumber.toString(),\n },\n ],\n }))\n )\n\n contractCallsResult.contractCalls.forEach((call, index) => {\n call.toContractAddress = patchedContractCalls[index].target\n call.toContractCallData = patchedContractCalls[index].callData\n })\n }\n\n /**\n * Limitations of the retry logic for contract calls:\n * - denyBridges and denyExchanges are not supported\n * - allowBridges and allowExchanges are not supported\n * - fee is not supported\n * - toAmount is not supported\n */\n const contractCallQuote = await getContractCallsQuote(client, {\n fromAddress: step.action.fromAddress!,\n fromChain: step.action.fromChainId,\n fromToken: step.action.fromToken.address,\n fromAmount: step.action.fromAmount,\n toChain: step.action.toChainId,\n toToken: step.action.toToken.address,\n contractCalls: contractCallsResult.contractCalls,\n toFallbackAddress: step.action.toAddress,\n slippage: step.action.slippage,\n })\n\n contractCallQuote.action.toToken = step.action.toToken\n\n const customStep = contractCallQuote.includedSteps?.find(\n (s) => s.type === 'custom'\n )\n if (customStep && contractCallsResult?.contractTool) {\n const toolDetails = {\n key: contractCallsResult.contractTool.name,\n name: contractCallsResult.contractTool.name,\n logoURI: contractCallsResult.contractTool.logoURI,\n }\n customStep.toolDetails = toolDetails\n contractCallQuote.toolDetails = toolDetails\n }\n\n const route = convertQuoteToRoute(contractCallQuote, {\n adjustZeroOutputFromPreviousStep:\n executionOptions?.adjustZeroOutputFromPreviousStep,\n })\n\n return {\n ...route.steps[0],\n id: step.id,\n }\n}\n\n/**\n * Fields `/advanced/stepTransaction` adds to a gasless step. They are not in\n * `@lifi/types` yet.\n */\nexport type GaslessStepFields = {\n expiresAt?: number\n authorization?: unknown\n}\n\n/**\n * A gasless step is re-quoted as the routes response gave it: the backend\n * rejects typed data without signatures, and it builds new typed data, a new\n * deadline and new nonces for every quote anyway.\n */\nconst getGaslessUpdatedStep = async (\n client: SDKClient,\n step: LiFiStepExtended\n): Promise<LiFiStepExtended> => {\n const {\n typedData: _typedData,\n expiresAt: _expiresAt,\n authorization: _authorization,\n execution: _execution,\n ...restStep\n } = step as LiFiStepExtended & GaslessStepFields\n return getStepTransaction(client, restStep)\n}\n\nconst getStandardUpdatedStep = async (\n client: SDKClient,\n step: LiFiStepExtended,\n signedTypedData?: SignedTypedData[]\n): Promise<LiFiStepExtended> => {\n const filteredSignedTypedData = signedTypedData?.filter(\n (item) => item.signature\n )\n const { typedData: _, ...restStep } = step\n const params = filteredSignedTypedData?.length\n ? { ...restStep, typedData: filteredSignedTypedData }\n : restStep\n return getStepTransaction(client, params)\n}\n"],"mappings":"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"}
@@ -1,11 +1,8 @@
1
1
  import { EthereumStepExecutorContext } from "../../../types.js";
2
- //#region src/core/tasks/helpers/hasApprovalAddressAppearedAtPrepare.d.ts
3
2
  /**
4
3
  * Whether the step had no `estimate.approvalAddress` before prepare and the
5
4
  * re-quote brought one. No allowance was checked then (`allowanceSpender` is
6
5
  * unset), and the step now needs it checked. The allowance tasks resolve the
7
6
  * spender themselves, so on a Permit2 chain they approve `fromChain.permit2`.
8
7
  */
9
- export declare const hasApprovalAddressAppearedAtPrepare: (context: EthereumStepExecutorContext) => boolean;
10
- //#endregion
11
- //# sourceMappingURL=hasApprovalAddressAppearedAtPrepare.d.ts.map
8
+ export declare const hasApprovalAddressAppearedAtPrepare: (context: EthereumStepExecutorContext) => boolean;
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_core_tasks_helpers_shouldCheckForAllowance = require("./shouldCheckForAllowance.js");
3
- //#region src/core/tasks/helpers/hasApprovalAddressAppearedAtPrepare.ts
3
+ // src/core/tasks/helpers/hasApprovalAddressAppearedAtPrepare.ts
4
4
  /**
5
5
  * Whether the step had no `estimate.approvalAddress` before prepare and the
6
6
  * re-quote brought one. No allowance was checked then (`allowanceSpender` is
@@ -11,7 +11,6 @@ const hasApprovalAddressAppearedAtPrepare = (context) => {
11
11
  const { step, allowanceSpender, isBridgeExecution, isFromNativeToken, statusManager } = context;
12
12
  return !allowanceSpender && require_core_tasks_helpers_shouldCheckForAllowance.shouldCheckForAllowance(step, isBridgeExecution, isFromNativeToken, statusManager);
13
13
  };
14
- //#endregion
15
14
  exports.hasApprovalAddressAppearedAtPrepare = hasApprovalAddressAppearedAtPrepare;
16
15
 
17
16
  //# sourceMappingURL=hasApprovalAddressAppearedAtPrepare.js.map
@@ -1,8 +1,5 @@
1
1
  import { EthereumStepExecutorContext } from "../../../types.js";
2
- //#region src/core/tasks/helpers/hasPermit2AllowanceInFlight.d.ts
3
2
  /** Whether this execution carries a caller-supplied Permit2 allowance, declared or signed. */
4
3
  export declare function hasPermit2AllowanceInFlight(context: EthereumStepExecutorContext): boolean;
5
4
  /** `isPermit2AllowanceLane`, for gates that run after prepare may have replaced `step.typedData`. */
6
- export declare function isPermit2AllowanceLaneInFlight(context: EthereumStepExecutorContext): boolean;
7
- //#endregion
8
- //# sourceMappingURL=hasPermit2AllowanceInFlight.d.ts.map
5
+ export declare function isPermit2AllowanceLaneInFlight(context: EthereumStepExecutorContext): boolean;
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_utils_getTypedDataLane = require("../../../utils/getTypedDataLane.js");
3
- //#region src/core/tasks/helpers/hasPermit2AllowanceInFlight.ts
3
+ // src/core/tasks/helpers/hasPermit2AllowanceInFlight.ts
4
4
  /** Whether this execution carries a caller-supplied Permit2 allowance, declared or signed. */
5
5
  function hasPermit2AllowanceInFlight(context) {
6
6
  const { step, fromChain, signedTypedData } = context;
@@ -10,7 +10,6 @@ function hasPermit2AllowanceInFlight(context) {
10
10
  function isPermit2AllowanceLaneInFlight(context) {
11
11
  return hasPermit2AllowanceInFlight(context) && !require_utils_getTypedDataLane.hasRelayerMessage(context.step, context.fromChain);
12
12
  }
13
- //#endregion
14
13
  exports.hasPermit2AllowanceInFlight = hasPermit2AllowanceInFlight;
15
14
  exports.isPermit2AllowanceLaneInFlight = isPermit2AllowanceLaneInFlight;
16
15
 
@@ -1,6 +1,5 @@
1
1
  import { EthereumStepExecutorContext } from "../../../types.js";
2
2
  import { TransactionMethodType } from "@lifi/sdk";
3
- //#region src/core/tasks/helpers/isAllowancePreparedForAnotherStrategy.d.ts
4
3
  /**
5
4
  * Whether the allowance work done in `preparedFor` does not fit `needed`, the
6
5
  * strategy prepare established. Two things can break:
@@ -12,6 +11,4 @@ import { TransactionMethodType } from "@lifi/sdk";
12
11
  * The spender recorded by `EthereumCheckAllowanceTask` is compared, because
13
12
  * prepare has already replaced the step with the re-quote.
14
13
  */
15
- export declare const isAllowancePreparedForAnotherStrategy: (context: EthereumStepExecutorContext, preparedFor: TransactionMethodType, needed: TransactionMethodType) => Promise<boolean>;
16
- //#endregion
17
- //# sourceMappingURL=isAllowancePreparedForAnotherStrategy.d.ts.map
14
+ export declare const isAllowancePreparedForAnotherStrategy: (context: EthereumStepExecutorContext, preparedFor: TransactionMethodType, needed: TransactionMethodType) => Promise<boolean>;
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_core_tasks_helpers_resolveAllowanceSpender = require("./resolveAllowanceSpender.js");
3
- //#region src/core/tasks/helpers/isAllowancePreparedForAnotherStrategy.ts
3
+ // src/core/tasks/helpers/isAllowancePreparedForAnotherStrategy.ts
4
4
  /**
5
5
  * Whether the allowance work done in `preparedFor` does not fit `needed`, the
6
6
  * strategy prepare established. Two things can break:
@@ -21,7 +21,6 @@ const isAllowancePreparedForAnotherStrategy = async (context, preparedFor, neede
21
21
  const { spenderAddress } = await require_core_tasks_helpers_resolveAllowanceSpender.resolveAllowanceSpender(context, needed);
22
22
  return allowanceSpender.toLowerCase() !== spenderAddress?.toLowerCase();
23
23
  };
24
- //#endregion
25
24
  exports.isAllowancePreparedForAnotherStrategy = isAllowancePreparedForAnotherStrategy;
26
25
 
27
26
  //# sourceMappingURL=isAllowancePreparedForAnotherStrategy.js.map
@@ -1,6 +1,3 @@
1
1
  import { SignedTypedData, TypedData } from "@lifi/sdk";
2
- //#region src/core/tasks/helpers/isTypedDataAlreadySigned.d.ts
3
2
  /** Whether `signedTypedData` already holds a signature for this exact entry. */
4
- export declare function isTypedDataAlreadySigned(signedTypedData: SignedTypedData[], typedData: TypedData): boolean;
5
- //#endregion
6
- //# sourceMappingURL=isTypedDataAlreadySigned.d.ts.map
3
+ export declare function isTypedDataAlreadySigned(signedTypedData: SignedTypedData[], typedData: TypedData): boolean;
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_utils_isValidSignature = require("../../../utils/isValidSignature.js");
3
- //#region src/core/tasks/helpers/isTypedDataAlreadySigned.ts
3
+ // src/core/tasks/helpers/isTypedDataAlreadySigned.ts
4
4
  /** Whether `signedTypedData` already holds a signature for this exact entry. */
5
5
  function isTypedDataAlreadySigned(signedTypedData, typedData) {
6
6
  if (typedData.primaryType === "Permit") return false;
@@ -23,7 +23,6 @@ function isSameValue(a, b) {
23
23
  return String(a) === String(b);
24
24
  }
25
25
  const isRecord = (value) => typeof value === "object" && value !== null;
26
- //#endregion
27
26
  exports.isTypedDataAlreadySigned = isTypedDataAlreadySigned;
28
27
 
29
28
  //# sourceMappingURL=isTypedDataAlreadySigned.js.map
@@ -1,11 +1,8 @@
1
1
  import { ExtendedChain, LiFiStep, LiFiStepExtended, TypedData } from "@lifi/sdk";
2
- //#region src/core/tasks/helpers/preservePermit2Allowances.d.ts
3
2
  /**
4
3
  * `??` keeps the Permit2 allowance only when the answer omits `typedData`. An
5
4
  * answer that carries entries of its own — native permits, or `[]` from a
6
5
  * third-party backend — would drop it, and `signedTypedData` resets per
7
6
  * `executeStep`, so a retry would let the Permit2 proxy hijack the calldata.
8
7
  */
9
- export declare function preservePermit2Allowances(step: LiFiStepExtended | LiFiStep, updatedTypedData: TypedData[] | undefined, chain: ExtendedChain): TypedData[] | undefined;
10
- //#endregion
11
- //# sourceMappingURL=preservePermit2Allowances.d.ts.map
8
+ export declare function preservePermit2Allowances(step: LiFiStepExtended | LiFiStep, updatedTypedData: TypedData[] | undefined, chain: ExtendedChain): TypedData[] | undefined;
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_utils_getTypedDataLane = require("../../../utils/getTypedDataLane.js");
3
- //#region src/core/tasks/helpers/preservePermit2Allowances.ts
3
+ // src/core/tasks/helpers/preservePermit2Allowances.ts
4
4
  /**
5
5
  * `??` keeps the Permit2 allowance only when the answer omits `typedData`. An
6
6
  * answer that carries entries of its own — native permits, or `[]` from a
@@ -16,7 +16,6 @@ function preservePermit2Allowances(step, updatedTypedData, chain) {
16
16
  })) return updatedTypedData;
17
17
  return [...updatedTypedData, ...require_utils_getTypedDataLane.getTypedDataInLane(step, "permit2-allowance", chain)];
18
18
  }
19
- //#endregion
20
19
  exports.preservePermit2Allowances = preservePermit2Allowances;
21
20
 
22
21
  //# sourceMappingURL=preservePermit2Allowances.js.map
@@ -1,7 +1,6 @@
1
1
  import { EthereumStepExecutorContext } from "../../../types.js";
2
2
  import { TransactionMethodType } from "@lifi/sdk";
3
3
  import { Address } from "viem";
4
- //#region src/core/tasks/helpers/resolveAllowanceSpender.d.ts
5
4
  /**
6
5
  * The spender the allowance tasks check and approve in `strategy`: canonical
7
6
  * Permit2 when the step takes the Permit2 flow there, `approvalAddress`
@@ -11,6 +10,4 @@ import { Address } from "viem";
11
10
  export declare const resolveAllowanceSpender: (context: EthereumStepExecutorContext, strategy: TransactionMethodType) => Promise<{
12
11
  permit2Supported: boolean;
13
12
  spenderAddress: Address;
14
- }>;
15
- //#endregion
16
- //# sourceMappingURL=resolveAllowanceSpender.d.ts.map
13
+ }>;
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_core_tasks_helpers_resolvePermit2Support = require("./resolvePermit2Support.js");
3
- //#region src/core/tasks/helpers/resolveAllowanceSpender.ts
3
+ // src/core/tasks/helpers/resolveAllowanceSpender.ts
4
4
  /**
5
5
  * The spender the allowance tasks check and approve in `strategy`: canonical
6
6
  * Permit2 when the step takes the Permit2 flow there, `approvalAddress`
@@ -15,7 +15,6 @@ const resolveAllowanceSpender = async (context, strategy) => {
15
15
  spenderAddress: permit2Supported ? fromChain.permit2 : step.estimate.approvalAddress
16
16
  };
17
17
  };
18
- //#endregion
19
18
  exports.resolveAllowanceSpender = resolveAllowanceSpender;
20
19
 
21
20
  //# sourceMappingURL=resolveAllowanceSpender.js.map
@@ -1,6 +1,5 @@
1
1
  import { EthereumStepExecutorContext } from "../../../types.js";
2
2
  import { TransactionMethodType } from "@lifi/sdk";
3
- //#region src/core/tasks/helpers/resolvePermit2Support.d.ts
4
3
  /**
5
4
  * Whether this step should use the Permit2 signature flow.
6
5
  *
@@ -21,6 +20,4 @@ import { TransactionMethodType } from "@lifi/sdk";
21
20
  * one spender while the sign task routes to the other — turning a needless
22
21
  * approval into a revert.
23
22
  */
24
- export declare const resolvePermit2Support: (context: EthereumStepExecutorContext, strategy: TransactionMethodType) => Promise<boolean>;
25
- //#endregion
26
- //# sourceMappingURL=resolvePermit2Support.d.ts.map
23
+ export declare const resolvePermit2Support: (context: EthereumStepExecutorContext, strategy: TransactionMethodType) => Promise<boolean>;
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_permits_canAccountUsePermit2 = require("../../../permits/canAccountUsePermit2.js");
3
3
  const require_core_tasks_helpers_hasPermit2AllowanceInFlight = require("./hasPermit2AllowanceInFlight.js");
4
- //#region src/core/tasks/helpers/resolvePermit2Support.ts
4
+ // src/core/tasks/helpers/resolvePermit2Support.ts
5
5
  /**
6
6
  * Cheap, synchronous part of the gate: does the step/chain combination allow
7
7
  * the Permit2 flow at all? Permit2 should not be available for atomic batch.
@@ -42,7 +42,6 @@ const resolvePermit2Support = async (context, strategy) => {
42
42
  });
43
43
  return context.permit2SignerSupported;
44
44
  };
45
- //#endregion
46
45
  exports.resolvePermit2Support = resolvePermit2Support;
47
46
 
48
47
  //# sourceMappingURL=resolvePermit2Support.js.map
@@ -1,5 +1,2 @@
1
1
  import { LiFiStepExtended, StatusManager } from "@lifi/sdk";
2
- //#region src/core/tasks/helpers/shouldCheckForAllowance.d.ts
3
- export declare const shouldCheckForAllowance: (step: LiFiStepExtended, isBridgeExecution: boolean, isFromNativeToken: boolean, statusManager: StatusManager) => boolean;
4
- //#endregion
5
- //# sourceMappingURL=shouldCheckForAllowance.d.ts.map
2
+ export declare const shouldCheckForAllowance: (step: LiFiStepExtended, isBridgeExecution: boolean, isFromNativeToken: boolean, statusManager: StatusManager) => boolean;
@@ -1,12 +1,12 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  let _lifi_sdk = require("@lifi/sdk");
3
- //#region src/core/tasks/helpers/shouldCheckForAllowance.ts
3
+ // src/core/tasks/helpers/shouldCheckForAllowance.ts
4
4
  const shouldCheckForAllowance = (step, isBridgeExecution, isFromNativeToken, statusManager) => {
5
+ if ((0, _lifi_sdk.isGaslessStep)(step)) return false;
5
6
  const exchangeActionType = isBridgeExecution ? "CROSS_CHAIN" : "SWAP";
6
7
  const swapOrBridgeAction = statusManager.findAction(step, exchangeActionType);
7
8
  return !(0, _lifi_sdk.hasOpenTransaction)(swapOrBridgeAction) && !isFromNativeToken && !!step.estimate.approvalAddress && !step.estimate.skipApproval;
8
9
  };
9
- //#endregion
10
10
  exports.shouldCheckForAllowance = shouldCheckForAllowance;
11
11
 
12
12
  //# sourceMappingURL=shouldCheckForAllowance.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"shouldCheckForAllowance.js","names":["hasOpenTransaction"],"sources":["../../../../../src/core/tasks/helpers/shouldCheckForAllowance.ts"],"sourcesContent":["import {\n hasOpenTransaction,\n type LiFiStepExtended,\n type StatusManager,\n} from '@lifi/sdk'\n\nexport const shouldCheckForAllowance = (\n step: LiFiStepExtended,\n isBridgeExecution: boolean,\n isFromNativeToken: boolean,\n statusManager: StatusManager\n): boolean => {\n const exchangeActionType = isBridgeExecution ? 'CROSS_CHAIN' : 'SWAP'\n\n const swapOrBridgeAction = statusManager.findAction(step, exchangeActionType)\n\n return (\n // No swap/bridge transaction (hash, batch/relay id or stored bytes) that may\n // still land. A FAILED action with a final outcome does not count, so the\n // allowance is checked again before the new transaction.\n !hasOpenTransaction(swapOrBridgeAction) &&\n // Token is not native (address is not zero)\n !isFromNativeToken &&\n // Approval address is required for allowance checks, but may be null in special cases (e.g. direct transfers)\n !!step.estimate.approvalAddress &&\n !step.estimate.skipApproval\n )\n}\n"],"mappings":";;;AAMA,MAAa,2BACX,MACA,mBACA,mBACA,kBACY;CACZ,MAAM,qBAAqB,oBAAoB,gBAAgB;CAE/D,MAAM,qBAAqB,cAAc,WAAW,MAAM,kBAAkB;CAE5E,OAIE,EAAA,GAACA,UAAAA,mBAAAA,CAAmB,kBAAkB,KAEtC,CAAC,qBAED,CAAC,CAAC,KAAK,SAAS,mBAChB,CAAC,KAAK,SAAS;AAEnB"}
1
+ {"version":3,"file":"shouldCheckForAllowance.js","names":["isGaslessStep","hasOpenTransaction"],"sources":["../../../../../src/core/tasks/helpers/shouldCheckForAllowance.ts"],"sourcesContent":["import {\n hasOpenTransaction,\n isGaslessStep,\n type LiFiStepExtended,\n type StatusManager,\n} from '@lifi/sdk'\n\nexport const shouldCheckForAllowance = (\n step: LiFiStepExtended,\n isBridgeExecution: boolean,\n isFromNativeToken: boolean,\n statusManager: StatusManager\n): boolean => {\n // The relayer handles the allowance of a gasless step: the backend signs it\n // in as a `Permit` companion or uses the Permit2 allowance the account has.\n // An approve or an SDK permit here would cost the user gas they do not have.\n if (isGaslessStep(step)) {\n return false\n }\n\n const exchangeActionType = isBridgeExecution ? 'CROSS_CHAIN' : 'SWAP'\n\n const swapOrBridgeAction = statusManager.findAction(step, exchangeActionType)\n\n return (\n // No swap/bridge transaction (hash, batch/relay id or stored bytes) that may\n // still land. A FAILED action with a final outcome does not count, so the\n // allowance is checked again before the new transaction.\n !hasOpenTransaction(swapOrBridgeAction) &&\n // Token is not native (address is not zero)\n !isFromNativeToken &&\n // Approval address is required for allowance checks, but may be null in special cases (e.g. direct transfers)\n !!step.estimate.approvalAddress &&\n !step.estimate.skipApproval\n )\n}\n"],"mappings":";;;AAOA,MAAa,2BACX,MACA,mBACA,mBACA,kBACY;CAIZ,KAAA,GAAIA,UAAAA,cAAAA,CAAc,IAAI,GACpB,OAAO;CAGT,MAAM,qBAAqB,oBAAoB,gBAAgB;CAE/D,MAAM,qBAAqB,cAAc,WAAW,MAAM,kBAAkB;CAE5E,OAIE,EAAA,GAACC,UAAAA,mBAAAA,CAAmB,kBAAkB,KAEtC,CAAC,qBAED,CAAC,CAAC,KAAK,SAAS,mBAChB,CAAC,KAAK,SAAS;AAEnB"}
@@ -1,10 +1,7 @@
1
1
  import { EthereumStepExecutorContext } from "../../../types.js";
2
2
  import { SignedTypedData, TypedData } from "@lifi/sdk";
3
- //#region src/core/tasks/helpers/signHyperliquidTypedData.d.ts
4
3
  /**
5
4
  * `beforeSignature` runs right before each signature, the agent's included,
6
5
  * after every await before it; it throws to stop the signing.
7
6
  */
8
- export declare const signHyperliquidTypedData: (context: EthereumStepExecutorContext, allowanceTypedData: TypedData[], beforeSignature?: () => void) => Promise<SignedTypedData[] | undefined>;
9
- //#endregion
10
- //# sourceMappingURL=signHyperliquidTypedData.d.ts.map
7
+ export declare const signHyperliquidTypedData: (context: EthereumStepExecutorContext, allowanceTypedData: TypedData[], beforeSignature?: () => void) => Promise<SignedTypedData[] | undefined>;
@@ -1,11 +1,11 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_hyperliquid_agentWallet = require("../../../hyperliquid/agentWallet.js");
3
+ const require_hyperliquid_isHyperliquidAgentStep = require("../../../hyperliquid/isHyperliquidAgentStep.js");
2
4
  const require_utils_getDomainChainId = require("../../../utils/getDomainChainId.js");
3
5
  const require_utils_isValidSignature = require("../../../utils/isValidSignature.js");
4
- const require_hyperliquid_isHyperliquidAgentStep = require("../../../hyperliquid/isHyperliquidAgentStep.js");
5
- const require_hyperliquid_agentWallet = require("../../../hyperliquid/agentWallet.js");
6
6
  let viem_actions = require("viem/actions");
7
7
  let viem_utils = require("viem/utils");
8
- //#region src/core/tasks/helpers/signHyperliquidTypedData.ts
8
+ // src/core/tasks/helpers/signHyperliquidTypedData.ts
9
9
  /**
10
10
  * `beforeSignature` runs right before each signature, the agent's included,
11
11
  * after every await before it; it throws to stop the signing.
@@ -72,7 +72,6 @@ const signHyperliquidTypedData = async (context, allowanceTypedData, beforeSigna
72
72
  }
73
73
  return signedResults;
74
74
  };
75
- //#endregion
76
75
  exports.signHyperliquidTypedData = signHyperliquidTypedData;
77
76
 
78
77
  //# sourceMappingURL=signHyperliquidTypedData.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"signHyperliquidTypedData.js","names":["isApproveAgentMessage","getOrCreateAgentWallet","getDomainChainId","getAction","signTypedData","isApproveBuilderFeeMessage","isHyperliquidOrderMessage"],"sources":["../../../../../src/core/tasks/helpers/signHyperliquidTypedData.ts"],"sourcesContent":["import type { SignedTypedData, TypedData } from '@lifi/sdk'\nimport { signTypedData } from 'viem/actions'\nimport { getAction } from 'viem/utils'\nimport { getOrCreateAgentWallet } from '../../../hyperliquid/agentWallet.js'\nimport {\n isApproveAgentMessage,\n isApproveBuilderFeeMessage,\n isHyperliquidOrderMessage,\n} from '../../../hyperliquid/isHyperliquidAgentStep.js'\nimport type { EthereumStepExecutorContext } from '../../../types.js'\nimport { getDomainChainId } from '../../../utils/getDomainChainId.js'\nimport { assertValidSignature } from '../../../utils/isValidSignature.js'\n\n/**\n * `beforeSignature` runs right before each signature, the agent's included,\n * after every await before it; it throws to stop the signing.\n */\nexport const signHyperliquidTypedData = async (\n context: EthereumStepExecutorContext,\n allowanceTypedData: TypedData[],\n beforeSignature?: () => void\n): Promise<SignedTypedData[] | undefined> => {\n const {\n step,\n fromChain,\n client,\n allowUserInteraction,\n checkClient,\n ethereumClient,\n getStorage,\n } = context\n\n if (!allowUserInteraction) {\n return\n }\n\n const signedResults: SignedTypedData[] = []\n const ownerAddress = ethereumClient.account!.address\n const storage = getStorage(client)\n\n const approveMessage = allowanceTypedData.find(isApproveAgentMessage)\n const existingAgentAddress = approveMessage?.message.agentAddress as\n | string\n | undefined\n\n const {\n account: agentAccount,\n needsApproval,\n expiresAt,\n } = await getOrCreateAgentWallet(storage, ownerAddress, existingAgentAddress)\n\n for (const typedData of allowanceTypedData) {\n if (isApproveAgentMessage(typedData)) {\n if (!needsApproval) {\n continue\n }\n\n const message = {\n ...typedData.message,\n agentAddress: agentAccount.address.toLowerCase(),\n agentName: `${typedData.message.agentName} valid_until ${expiresAt}`,\n }\n const typedDataChainId =\n getDomainChainId(typedData.domain) || fromChain.id\n\n const updatedClient = await checkClient(step, typedDataChainId)\n if (!updatedClient) {\n return\n }\n\n beforeSignature?.()\n const signature = await getAction(\n updatedClient,\n signTypedData,\n 'signTypedData'\n )({\n account: updatedClient.account!,\n primaryType: typedData.primaryType,\n domain: typedData.domain,\n types: typedData.types,\n message,\n })\n assertValidSignature(signature)\n signedResults.push({ ...typedData, message, signature })\n } else if (isApproveBuilderFeeMessage(typedData)) {\n const typedDataChainId =\n getDomainChainId(typedData.domain) || fromChain.id\n\n const updatedClient = await checkClient(step, typedDataChainId)\n if (!updatedClient) {\n return\n }\n\n beforeSignature?.()\n const signature = await getAction(\n updatedClient,\n signTypedData,\n 'signTypedData'\n )({\n account: updatedClient.account!,\n primaryType: typedData.primaryType,\n domain: typedData.domain,\n types: typedData.types,\n message: typedData.message,\n })\n assertValidSignature(signature)\n signedResults.push({ ...typedData, signature })\n } else if (isHyperliquidOrderMessage(typedData)) {\n beforeSignature?.()\n const signature = await agentAccount.signTypedData({\n domain: typedData.domain,\n types: typedData.types,\n primaryType: typedData.primaryType,\n message: typedData.message,\n })\n signedResults.push({ ...typedData, signature })\n }\n }\n\n return signedResults\n}\n"],"mappings":";;;;;;;;;;;;AAiBA,MAAa,2BAA2B,OACtC,SACA,oBACA,oBAC2C;CAC3C,MAAM,EACJ,MACA,WACA,QACA,sBACA,aACA,gBACA,eACE;CAEJ,IAAI,CAAC,sBACH;CAGF,MAAM,gBAAmC,CAAC;CAC1C,MAAM,eAAe,eAAe,QAAS;CAC7C,MAAM,UAAU,WAAW,MAAM;CAGjC,MAAM,uBADiB,mBAAmB,KAAKA,2CAAAA,qBACL,CAAC,EAAE,QAAQ;CAIrD,MAAM,EACJ,SAAS,cACT,eACA,cACE,MAAMC,gCAAAA,uBAAuB,SAAS,cAAc,oBAAoB;CAE5E,KAAK,MAAM,aAAa,oBACtB,IAAID,2CAAAA,sBAAsB,SAAS,GAAG;EACpC,IAAI,CAAC,eACH;EAGF,MAAM,UAAU;GACd,GAAG,UAAU;GACb,cAAc,aAAa,QAAQ,YAAY;GAC/C,WAAW,GAAG,UAAU,QAAQ,UAAU,eAAe;EAC3D;EAIA,MAAM,gBAAgB,MAAM,YAAY,MAFtCE,+BAAAA,iBAAiB,UAAU,MAAM,KAAK,UAAU,EAEY;EAC9D,IAAI,CAAC,eACH;EAGF,kBAAkB;EAClB,MAAM,YAAY,OAAA,GAAMC,WAAAA,UAAAA,CACtB,eACAC,aAAAA,eACA,eACF,CAAC,CAAC;GACA,SAAS,cAAc;GACvB,aAAa,UAAU;GACvB,QAAQ,UAAU;GAClB,OAAO,UAAU;GACjB;EACF,CAAC;EACD,+BAAA,qBAAqB,SAAS;EAC9B,cAAc,KAAK;GAAE,GAAG;GAAW;GAAS;EAAU,CAAC;CACzD,OAAO,IAAIC,2CAAAA,2BAA2B,SAAS,GAAG;EAIhD,MAAM,gBAAgB,MAAM,YAAY,MAFtCH,+BAAAA,iBAAiB,UAAU,MAAM,KAAK,UAAU,EAEY;EAC9D,IAAI,CAAC,eACH;EAGF,kBAAkB;EAClB,MAAM,YAAY,OAAA,GAAMC,WAAAA,UAAAA,CACtB,eACAC,aAAAA,eACA,eACF,CAAC,CAAC;GACA,SAAS,cAAc;GACvB,aAAa,UAAU;GACvB,QAAQ,UAAU;GAClB,OAAO,UAAU;GACjB,SAAS,UAAU;EACrB,CAAC;EACD,+BAAA,qBAAqB,SAAS;EAC9B,cAAc,KAAK;GAAE,GAAG;GAAW;EAAU,CAAC;CAChD,OAAO,IAAIE,2CAAAA,0BAA0B,SAAS,GAAG;EAC/C,kBAAkB;EAClB,MAAM,YAAY,MAAM,aAAa,cAAc;GACjD,QAAQ,UAAU;GAClB,OAAO,UAAU;GACjB,aAAa,UAAU;GACvB,SAAS,UAAU;EACrB,CAAC;EACD,cAAc,KAAK;GAAE,GAAG;GAAW;EAAU,CAAC;CAChD;CAGF,OAAO;AACT"}
1
+ {"version":3,"file":"signHyperliquidTypedData.js","names":["isApproveAgentMessage","getOrCreateAgentWallet","getDomainChainId","getAction","signTypedData","assertValidSignature","isApproveBuilderFeeMessage","isHyperliquidOrderMessage"],"sources":["../../../../../src/core/tasks/helpers/signHyperliquidTypedData.ts"],"sourcesContent":["import type { SignedTypedData, TypedData } from '@lifi/sdk'\nimport { signTypedData } from 'viem/actions'\nimport { getAction } from 'viem/utils'\nimport { getOrCreateAgentWallet } from '../../../hyperliquid/agentWallet.js'\nimport {\n isApproveAgentMessage,\n isApproveBuilderFeeMessage,\n isHyperliquidOrderMessage,\n} from '../../../hyperliquid/isHyperliquidAgentStep.js'\nimport type { EthereumStepExecutorContext } from '../../../types.js'\nimport { getDomainChainId } from '../../../utils/getDomainChainId.js'\nimport { assertValidSignature } from '../../../utils/isValidSignature.js'\n\n/**\n * `beforeSignature` runs right before each signature, the agent's included,\n * after every await before it; it throws to stop the signing.\n */\nexport const signHyperliquidTypedData = async (\n context: EthereumStepExecutorContext,\n allowanceTypedData: TypedData[],\n beforeSignature?: () => void\n): Promise<SignedTypedData[] | undefined> => {\n const {\n step,\n fromChain,\n client,\n allowUserInteraction,\n checkClient,\n ethereumClient,\n getStorage,\n } = context\n\n if (!allowUserInteraction) {\n return\n }\n\n const signedResults: SignedTypedData[] = []\n const ownerAddress = ethereumClient.account!.address\n const storage = getStorage(client)\n\n const approveMessage = allowanceTypedData.find(isApproveAgentMessage)\n const existingAgentAddress = approveMessage?.message.agentAddress as\n | string\n | undefined\n\n const {\n account: agentAccount,\n needsApproval,\n expiresAt,\n } = await getOrCreateAgentWallet(storage, ownerAddress, existingAgentAddress)\n\n for (const typedData of allowanceTypedData) {\n if (isApproveAgentMessage(typedData)) {\n if (!needsApproval) {\n continue\n }\n\n const message = {\n ...typedData.message,\n agentAddress: agentAccount.address.toLowerCase(),\n agentName: `${typedData.message.agentName} valid_until ${expiresAt}`,\n }\n const typedDataChainId =\n getDomainChainId(typedData.domain) || fromChain.id\n\n const updatedClient = await checkClient(step, typedDataChainId)\n if (!updatedClient) {\n return\n }\n\n beforeSignature?.()\n const signature = await getAction(\n updatedClient,\n signTypedData,\n 'signTypedData'\n )({\n account: updatedClient.account!,\n primaryType: typedData.primaryType,\n domain: typedData.domain,\n types: typedData.types,\n message,\n })\n assertValidSignature(signature)\n signedResults.push({ ...typedData, message, signature })\n } else if (isApproveBuilderFeeMessage(typedData)) {\n const typedDataChainId =\n getDomainChainId(typedData.domain) || fromChain.id\n\n const updatedClient = await checkClient(step, typedDataChainId)\n if (!updatedClient) {\n return\n }\n\n beforeSignature?.()\n const signature = await getAction(\n updatedClient,\n signTypedData,\n 'signTypedData'\n )({\n account: updatedClient.account!,\n primaryType: typedData.primaryType,\n domain: typedData.domain,\n types: typedData.types,\n message: typedData.message,\n })\n assertValidSignature(signature)\n signedResults.push({ ...typedData, signature })\n } else if (isHyperliquidOrderMessage(typedData)) {\n beforeSignature?.()\n const signature = await agentAccount.signTypedData({\n domain: typedData.domain,\n types: typedData.types,\n primaryType: typedData.primaryType,\n message: typedData.message,\n })\n signedResults.push({ ...typedData, signature })\n }\n }\n\n return signedResults\n}\n"],"mappings":";;;;;;;;;;;;AAiBA,MAAa,2BAA2B,OACtC,SACA,oBACA,oBAC2C;CAC3C,MAAM,EACJ,MACA,WACA,QACA,sBACA,aACA,gBACA,eACE;CAEJ,IAAI,CAAC,sBACH;CAGF,MAAM,gBAAmC,CAAC;CAC1C,MAAM,eAAe,eAAe,QAAS;CAC7C,MAAM,UAAU,WAAW,MAAM;CAGjC,MAAM,uBADiB,mBAAmB,KAAKA,2CAAAA,qBACL,CAAC,EAAE,QAAQ;CAIrD,MAAM,EACJ,SAAS,cACT,eACA,cACE,MAAMC,gCAAAA,uBAAuB,SAAS,cAAc,oBAAoB;CAE5E,KAAK,MAAM,aAAa,oBACtB,IAAID,2CAAAA,sBAAsB,SAAS,GAAG;EACpC,IAAI,CAAC,eACH;EAGF,MAAM,UAAU;GACd,GAAG,UAAU;GACb,cAAc,aAAa,QAAQ,YAAY;GAC/C,WAAW,GAAG,UAAU,QAAQ,UAAU,eAAe;EAC3D;EAIA,MAAM,gBAAgB,MAAM,YAAY,MAFtCE,+BAAAA,iBAAiB,UAAU,MAAM,KAAK,UAAU,EAEY;EAC9D,IAAI,CAAC,eACH;EAGF,kBAAkB;EAClB,MAAM,YAAY,OAAA,GAAMC,WAAAA,UAAAA,CACtB,eACAC,aAAAA,eACA,eACF,CAAC,CAAC;GACA,SAAS,cAAc;GACvB,aAAa,UAAU;GACvB,QAAQ,UAAU;GAClB,OAAO,UAAU;GACjB;EACF,CAAC;EACDC,+BAAAA,qBAAqB,SAAS;EAC9B,cAAc,KAAK;GAAE,GAAG;GAAW;GAAS;EAAU,CAAC;CACzD,OAAO,IAAIC,2CAAAA,2BAA2B,SAAS,GAAG;EAIhD,MAAM,gBAAgB,MAAM,YAAY,MAFtCJ,+BAAAA,iBAAiB,UAAU,MAAM,KAAK,UAAU,EAEY;EAC9D,IAAI,CAAC,eACH;EAGF,kBAAkB;EAClB,MAAM,YAAY,OAAA,GAAMC,WAAAA,UAAAA,CACtB,eACAC,aAAAA,eACA,eACF,CAAC,CAAC;GACA,SAAS,cAAc;GACvB,aAAa,UAAU;GACvB,QAAQ,UAAU;GAClB,OAAO,UAAU;GACjB,SAAS,UAAU;EACrB,CAAC;EACDC,+BAAAA,qBAAqB,SAAS;EAC9B,cAAc,KAAK;GAAE,GAAG;GAAW;EAAU,CAAC;CAChD,OAAO,IAAIE,2CAAAA,0BAA0B,SAAS,GAAG;EAC/C,kBAAkB;EAClB,MAAM,YAAY,MAAM,aAAa,cAAc;GACjD,QAAQ,UAAU;GAClB,OAAO,UAAU;GACjB,aAAa,UAAU;GACvB,SAAS,UAAU;EACrB,CAAC;EACD,cAAc,KAAK;GAAE,GAAG;GAAW;EAAU,CAAC;CAChD;CAGF,OAAO;AACT"}
@@ -1,6 +1,5 @@
1
1
  import { EthereumStepExecutorContext } from "../../../types.js";
2
2
  import { ExecutionActionStatus, ExecutionActionType, SignedTypedData, TypedData } from "@lifi/sdk";
3
- //#region src/core/tasks/helpers/signTypedDataEntries.d.ts
4
3
  export type SignTypedDataEntriesResult = {
5
4
  status: "PAUSED";
6
5
  } | {
@@ -12,6 +11,4 @@ export type SignTypedDataEntriesResult = {
12
11
  * signatures. `beforeSignature` runs right before each wallet call, after the
13
12
  * chain switch; it throws to stop the signing.
14
13
  */
15
- export declare function signTypedDataEntries(context: EthereumStepExecutorContext, entries: TypedData[], actionType: ExecutionActionType, actionStatus?: ExecutionActionStatus, beforeSignature?: () => void): Promise<SignTypedDataEntriesResult>;
16
- //#endregion
17
- //# sourceMappingURL=signTypedDataEntries.d.ts.map
14
+ export declare function signTypedDataEntries(context: EthereumStepExecutorContext, entries: TypedData[], actionType: ExecutionActionType, actionStatus?: ExecutionActionStatus, beforeSignature?: () => void): Promise<SignTypedDataEntriesResult>;
@@ -3,7 +3,7 @@ const require_utils_getDomainChainId = require("../../../utils/getDomainChainId.
3
3
  const require_utils_isValidSignature = require("../../../utils/isValidSignature.js");
4
4
  let viem_actions = require("viem/actions");
5
5
  let viem_utils = require("viem/utils");
6
- //#region src/core/tasks/helpers/signTypedDataEntries.ts
6
+ // src/core/tasks/helpers/signTypedDataEntries.ts
7
7
  /**
8
8
  * Signs the entries in order, switching chains per entry, and appends the
9
9
  * signatures. `beforeSignature` runs right before each wallet call, after the
@@ -36,7 +36,6 @@ async function signTypedDataEntries(context, entries, actionType, actionStatus =
36
36
  signedTypedData
37
37
  };
38
38
  }
39
- //#endregion
40
39
  exports.signTypedDataEntries = signTypedDataEntries;
41
40
 
42
41
  //# sourceMappingURL=signTypedDataEntries.js.map